@zeniai/web-app-ui 5.0.77-qa → 5.0.78-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-BhkbfnzS.js +1 -0
- package/dist/assets/AddressScreen-BmR-OoZ_.js +9 -0
- package/dist/assets/{AiCfoScreen-9dFOdDvS.js → AiCfoScreen-C8ZpEKvV.js} +5 -5
- package/dist/assets/BillPayApprovalRoutes-CzEk_nhg.js +1 -0
- package/dist/assets/{BillPayRoutes-DRXDrSZP.js → BillPayRoutes-BYOQqAtg.js} +28 -28
- package/dist/assets/BusinessVerificationPageScreen-DsFRoHnS.js +9 -0
- package/dist/assets/{ChargeCardRoutes-C9NA04uL.js → ChargeCardRoutes-UrbQPmqH.js} +8 -8
- package/dist/assets/{CompanyPassportScreen-BWjh-1tt.js → CompanyPassportScreen-DfcahYi3.js} +1 -1
- package/dist/assets/ConnectionAuthScreen-KRY6Oem5.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-CtDlGb6t.js +1 -0
- package/dist/assets/CustomerOnboardingRoutes-ClmI94EA.js +23 -0
- package/dist/assets/{DashboardRoutes-BR-AxyQo.js → DashboardRoutes-D6LkoAS1.js} +4 -4
- package/dist/assets/{DefaultTenantHome-C74gAQVt.js → DefaultTenantHome-C_HBx_e-.js} +1 -1
- package/dist/assets/DomesticWireDetailScreen-loJ8GquO.js +18 -0
- package/dist/assets/{DrawerScreen-DzkaoOWL.js → DrawerScreen-sfY6PIZF.js} +1 -1
- package/dist/assets/EntityDetailRoutes-DzARLOVe.js +1 -0
- package/dist/assets/{ExpenseAutomationRoutes-But3rf3J.js → ExpenseAutomationRoutes-mHXp4ejt.js} +5 -5
- package/dist/assets/FeaturePreviewScreen-BbijPpnJ.js +1 -0
- package/dist/assets/HubSpotOAuthCallbackScreen-Cqm6jDxt.js +1 -0
- package/dist/assets/{MagicLinkRoutes-Chwo-qkP.js → MagicLinkRoutes-DOskkrWK.js} +7 -7
- package/dist/assets/MagicLinkSignInScreen-CRHf1Pq5.js +12 -0
- package/dist/assets/{MobileAppDrawer-B3x5wY10.js → MobileAppDrawer-DrdSJdo1.js} +1 -1
- package/dist/assets/NotFoundScreen-C5GqrkuK.js +1 -0
- package/dist/assets/NotificationRoutes-2PbblZyO.js +1 -0
- package/dist/assets/OAuthConsentScreen-BJ1rRrOX.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-C-wtMSOq.js +1 -0
- package/dist/assets/PeopleRoutes-DW6v38OQ.js +22 -0
- package/dist/assets/PerformanceRoutes-SuLEsbMN.js +1 -0
- package/dist/assets/{Preview-B7yw63qf.js → Preview-TxzQXr3i.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-CzbbjqA7.js → QBOConnectionScreen-BCkDW1I6.js} +1 -1
- package/dist/assets/ReferralListScreen-DYfKAeQl.js +5 -0
- package/dist/assets/ReimbursementApprovalRoutes-B6agiTbB.js +1 -0
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-Cf6fN3gm.js → ReimbursementApprovalRuleDetailScreen-O71vUBoF.js} +1 -1
- package/dist/assets/ReimbursementRoutes-D5zdl8gM.js +68 -0
- package/dist/assets/ReportsRoutes-BDvJqZZF.js +1 -0
- package/dist/assets/RewardsRoutes-CrQQoiRC.js +1 -0
- package/dist/assets/ScreenRoutes-DCX1O3Md.js +2 -0
- package/dist/assets/{SettingsRoutes-B6i5o_xZ.js → SettingsRoutes-88kae7-O.js} +7 -7
- package/dist/assets/{SetupPagesScreen-D9wDjvOC.js → SetupPagesScreen-Ccazxtke.js} +5 -5
- package/dist/assets/SignInScreen-mIfi177N.js +1 -0
- package/dist/assets/SignOutScreen-DIeOz12t.js +9 -0
- package/dist/assets/{TaskListScreen-BXp_P6Ec.js → TaskListScreen-BfyHzekg.js} +2 -2
- package/dist/assets/TaskRoutes-Bmq0PDng.js +9 -0
- package/dist/assets/TransactionDetailRoutes-CALv3lzc.js +1 -0
- package/dist/assets/{TransactionDetailScreen-DRZw6o-C.js → TransactionDetailScreen-DVUrpN27.js} +2 -2
- package/dist/assets/{TransactionListRoutes-BOekcd9c.js → TransactionListRoutes-ZGPTqV4b.js} +1 -1
- package/dist/assets/TreasuryRoutes-mN-Tiy6z.js +37 -0
- package/dist/assets/{VendorsRoutes-ZfxM-ykJ.js → VendorsRoutes-Cx_ts7OM.js} +28 -28
- package/dist/assets/WiseConfirmationScreen-BVKaZUB7.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-CpvkXgX6.js → ZeniAccountRoutes-DLsDt2CE.js} +12 -12
- package/dist/assets/ZeniAccountStatementScreen-z63ZBClm.js +9 -0
- package/dist/assets/{accountMappingHelper-D6x0RpVY.js → accountMappingHelper-DpGnVAea.js} +1 -1
- package/dist/assets/{analytics-CgRNtlDm.js → analytics-Dwe2jubl.js} +1 -1
- package/dist/assets/{analyticsHelper-BunVJ4K_.js → analyticsHelper-VfNEEHsS.js} +1 -1
- package/dist/assets/{core-uYqCzel8.js → core-XIdi9yav.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-DCnYf30M.js → decodeURIComponentSafe-CqshbMyv.js} +1 -1
- package/dist/assets/{dnd-BSWou54V.js → dnd-C8_bqxJQ.js} +1 -1
- package/dist/assets/{empty-CKinwWZY.js → empty-CP3zMx39.js} +1 -1
- package/dist/assets/{empty-BFCAZWzA.js → empty-CwZgS-VN.js} +1 -1
- package/dist/assets/{emptyVideoElement-E29-Nor3.js → emptyVideoElement-BnCGoR33.js} +1 -1
- package/dist/assets/epic-Bd7YYQOZ.js +2 -0
- package/dist/assets/getLocaleForTenant-CJ_gALMc.js +1 -0
- package/dist/assets/{index-DojfCsv7.js → index-BFHwjIZ6.js} +12640 -12668
- package/dist/assets/{index-8d_FSGLw.js → index-BGt9CQn-.js} +1 -1
- package/dist/assets/{index-BsLHs9Ab.js → index-BuT_Em2K.js} +1 -1
- package/dist/assets/{index-DWPRup5s.js → index-BwOJsH8g.js} +1 -1
- package/dist/assets/{index-Dl7Wgss6.js → index-C5MHMUJX.js} +1 -1
- package/dist/assets/{index-F3uqdkEv.js → index-CT8IgTpZ.js} +2 -2
- package/dist/assets/{index-DeBaxB_L.js → index-DZp35-bi.js} +1 -1
- package/dist/assets/{index-CxWCBC6O.js → index-hYoHMc0Z.js} +1 -1
- package/dist/assets/{lexical-DbCoEckm.js → lexical-L3dbahzM.js} +1 -1
- package/dist/assets/{liveblocks-CfCKAQeM.js → liveblocks-BTKJAzKw.js} +1 -1
- package/dist/assets/{lottie-Dc_IH0fS.js → lottie-B4nk2ufU.js} +1 -1
- package/dist/assets/{mui-CTbUXhla.js → mui-D-cfPqvW.js} +1 -1
- package/dist/assets/{pathToGoBack-Y7yporNq.js → pathToGoBack-CEbHtWH4.js} +1 -1
- package/dist/assets/{pdf-lib-CNgiyR2K.js → pdf-lib-DNtyO1c9.js} +1 -1
- package/dist/assets/{pdf-O9N1jd2N.js → pdf-vaniLLX-.js} +3 -3
- package/dist/assets/{plaid-Bio3MiLm.js → plaid-_FJLoBl-.js} +1 -1
- package/dist/assets/{pusher--jGYOMJ8.js → pusher-DxLcqjAa.js} +1 -1
- package/dist/assets/{react-BYbqG6ZW.js → react-AWyiT1J_.js} +1 -1
- package/dist/assets/{react-D9RjhqSo.js → react-B6KkVX_w.js} +1 -1
- package/dist/assets/{react-BaqpebX1.js → react-BDdVRErx.js} +1 -1
- package/dist/assets/{react-KPWjcD7D.js → react-CZ7HzwCB.js} +1 -1
- package/dist/assets/{react-kWXzqyUF.js → react-DW2dmFYn.js} +1 -1
- package/dist/assets/{react-DqfAPb7w.js → react-PsEdw6eg.js} +1 -1
- package/dist/assets/{recharts-BUFoogHS.js → recharts-Db9qTggV.js} +1 -1
- package/dist/assets/{routePaths-DoAvT9jx.js → routePaths-DYhINZNz.js} +1 -1
- package/dist/assets/{sentry-131ydzJg.js → sentry-BidZRtdZ.js} +1 -1
- package/dist/assets/{url-BRm_J7V6.js → url-B1tfhvRN.js} +1 -1
- package/dist/assets/{url-DlWfObPw.js → url-CX5VwIV_.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-DvEC_Rfy.js +1 -0
- package/dist/assets/{useDeviceId-CBU-vDdN.js → useDeviceId-rJ9quQG0.js} +1 -1
- package/dist/assets/{useFetchSuggestedQuestionsWhenReady-D9n2AKQx.js → useFetchSuggestedQuestionsWhenReady-BXeQAqTk.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-Dbj0dyeX.js → useInitialThreadRequest-1r6joKrr.js} +1 -1
- package/dist/assets/{utils-BkkIzijx.js → utils-DDxx6oUt.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-DN0z2FuE.js → withTransactionSidePanel-_oROnP2L.js} +3 -3
- package/dist/assets/{zeni-epic-state-BmAPZlsC.js → zeni-epic-state-znLEvSss.js} +6 -6
- package/dist/index.html +1 -1
- package/package.json +4 -4
- package/dist/assets/AddressRoutes-O04th73J.js +0 -1
- package/dist/assets/AddressScreen-Bk_munT3.js +0 -9
- package/dist/assets/BillPayApprovalRoutes-COiJeUFT.js +0 -1
- package/dist/assets/BusinessVerificationPageScreen-CnAB8eUQ.js +0 -9
- package/dist/assets/ConnectionAuthScreen-D6DaHf5c.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-3eEcB707.js +0 -1
- package/dist/assets/CustomerOnboardingRoutes-l7rM0eut.js +0 -23
- package/dist/assets/DomesticWireDetailScreen-CWWX1EFM.js +0 -18
- package/dist/assets/EntityDetailRoutes-B7e2LtGS.js +0 -1
- package/dist/assets/FeaturePreviewScreen-B2O-98_e.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-DexCFc1l.js +0 -1
- package/dist/assets/MagicLinkSignInScreen-DWsNyqtg.js +0 -12
- package/dist/assets/NotFoundScreen-t1ueGvDG.js +0 -1
- package/dist/assets/NotificationRoutes-CIdj2V-n.js +0 -1
- package/dist/assets/OAuthConsentScreen-CP2RFaGU.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-BXYFz1ZW.js +0 -1
- package/dist/assets/PeopleRoutes-MqrPexG5.js +0 -22
- package/dist/assets/PerformanceRoutes-B1RTm-Zq.js +0 -1
- package/dist/assets/ReferralListScreen-DTQFACuG.js +0 -5
- package/dist/assets/ReimbursementApprovalRoutes-Dclz8XkB.js +0 -1
- package/dist/assets/ReimbursementRoutes-Dd9IEYb-.js +0 -68
- package/dist/assets/ReportsRoutes-B9O7T9pm.js +0 -1
- package/dist/assets/RewardsRoutes-DN2HacCh.js +0 -1
- package/dist/assets/ScreenRoutes-BsLKoqEt.js +0 -2
- package/dist/assets/SignInScreen-D68DdO0g.js +0 -1
- package/dist/assets/SignOutScreen-CiC1xhyM.js +0 -9
- package/dist/assets/TaskRoutes-Dne-2qND.js +0 -9
- package/dist/assets/TransactionDetailRoutes-C1ih2pnm.js +0 -1
- package/dist/assets/TreasuryRoutes-BMXt9CZJ.js +0 -37
- package/dist/assets/WiseConfirmationScreen-D5IG7vtp.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-C_K9i07r.js +0 -9
- package/dist/assets/epic-dPIWYPli.js +0 -2
- package/dist/assets/getLocaleForTenant-BVZe9vGW.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-It-lF7wN.js +0 -1
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-BTKJAzKw.js";import{a as o}from"./sentry-BidZRtdZ.js";import{g as f,j as H,h as L,u as M,k as _}from"./core-XIdi9yav.js";import{m as F,Z as N,z as R,b3 as W,G as U,V as $,A as z,c as l,e as G,a3 as Y,b4 as Q}from"./index-BFHwjIZ6.js";import{eY as Z,eO as q,Ma as I,Mb as J,tI as K,ty as g,e_ as X,bN as ee,tD as re,Mc as ae}from"./zeni-epic-state-znLEvSss.js";import{D as ne,e as te,n as se,S as oe}from"./mui-D-cfPqvW.js";import{u as ie}from"./useAskAiCfoHostNavButtonProps-DvEC_Rfy.js";import{c as le}from"./useFetchSuggestedQuestionsWhenReady-BXeQAqTk.js";import{M as de}from"./MobileAppDrawer-DrdSJdo1.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]="e0f17ef8-d3b9-4255-b287-196bc988da6b",e._sentryDebugIdIdentifier="sentry-dbid-e0f17ef8-d3b9-4255-b287-196bc988da6b")}catch{}})();const ce={overlayWidth:new U(100,100,30)},fe=({isReferralDrawerOpen:e,closeDrawerHandler:r})=>{const a=F(),n=N();if(R.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{r(!0)},u=f(d=>Z(d));return s.jsx(ne,{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(te,{in:e,direction:"left",children:s.jsx(ue,{onClick:d=>d.stopPropagation(),children:s.jsx(W,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ue=se(oe)`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
`,P="refer-and-earn-status-update",pe=_(function(e){const r=I(e),a=e.referralViewState.rewardsPlanFetchState,n=ee([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(ae({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(re(n))},onBackClick:()=>{a("../",{relative:"path"})},onReloadInvitees:()=>{e(g(!0))},onCopyReferralLink:()=>{l.trackRewardsPageClicked("copy referral link")},onClickRefer:()=>{l.trackRewardsPageClicked("refer")},onEventReceived:n=>{n===P&&e(g(!0,!0))}}})(Y(Q));function Se({isReferralDrawerOpen:e}){const r=H(),a=L(),n=M(),[i,u]=o.useState(!1),[d,D]=o.useState(!1),[x,E]=o.useState(!1),[k,b]=o.useState(!1),p=R.getSignedInUser(),m=f(t=>q(t)),C=f(t=>I(t)),h=C.fetchState,w=f(t=>t.referralViewState.rewardsPlanFetchState),y=J([C,w]),{areTenantIdsInSync:c}=$();o.useEffect(()=>{m?.rewardsLastViewedTime==null&&x===!1&&(a(K()),E(!0))},[]),o.useEffect(()=>{!i&&h==="Not-Started"&&c&&(u(!0),a(g(!0)))},[h,a,c]),o.useEffect(()=>{!d&&w.fetchState==="Not-Started"&&c&&(D(!0),a(X(!0)))},[w,a,c]),o.useEffect(()=>{b(e!=null&&e===!0)},[e]);const[j,A]=o.useState(!1),v=t=>{A(t)},{isAiCfoAccessEnabled:T,onAskAiCfoClick:O}=ie({mobileExploreReferrer:"Rewards"});le({isDataReady:y===!0});const V={events:p?.userId!=null?[`private-encrypted-${p.userId}.${P}`]:[],eventCallback:(t,S,B)=>{B.onEventReceived(t)}};return s.jsxs(s.Fragment,{children:[y===!0?s.jsx(z,{analytics:l,onLoad:t=>(S=>{p!=null&&S.trackPageLoaded(G.Event.rewardsPageViewed)})(t)}):null,s.jsx(de,{isAppContentDrawerOpen:j,handleDrawerToggle:v}),k===!0?s.jsx(fe,{closeDrawerHandler:()=>{b(!1),r("..")},isReferralDrawerOpen:k}):null,s.jsx(pe,{location:n,navigate:r,currentTenant:m,onClickMenuIcon:()=>{v(!0)},isAiCfoAccessEnabled:T,onAskAiCfoClick:O,...V})]})}export{Se as R};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as t}from"./liveblocks-BTKJAzKw.js";import x from"./NotFoundScreen-C5GqrkuK.js";import{a as p}from"./sentry-BidZRtdZ.js";import{j as C,u as I,h as A,g as c,N as E,k,n as D,o as d}from"./core-XIdi9yav.js";import{eO as N,N4 as b,Nk as S,CF as T,BO as V,CE as u,Cv as O,NA as U}from"./zeni-epic-state-znLEvSss.js";import{m as _,z as B,B as $,a3 as W,bJ as z,ac as F}from"./index-BFHwjIZ6.js";import"./mui-D-cfPqvW.js";import{R as g}from"./ReimbursementApprovalRuleDetailScreen-O71vUBoF.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]="01cee2ea-de3f-47a5-ad56-dcd474496007",e._sentryDebugIdIdentifier="sentry-dbid-01cee2ea-de3f-47a5-ad56-dcd474496007")}catch{}})();const m="reimbursement-approval-rule-update",J=k(function(e){return{approvalView:b(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}},function(e,r){const{navigate:a,location:l}=r;return{onApprovalRulesEventReceived:s=>{s.endsWith(m)&&e(U(!1))},onBackClick:()=>{F(l)?a("../../"):a("../../../reimbursements/setup")},onDeleteRuleClick:s=>{e(O(s))},onEditRuleClick:s=>{s!=null?(e(u(s)),a(`./${s}/edit`)):(e(u()),a("./new"))}}})(W(z)),P=()=>{const e=C(),r=I(),a=A(),[l,s]=p.useState(!1),[f,y]=p.useState(!1),v=c(n=>n.remiSetupApproverViewState.fetchState),o=c(n=>N(n)),w=_(),i=c(n=>b(n)),h=c(n=>S(n).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{h?.updateStatus.fetchState==="Completed"&&a(T())},[h]),p.useEffect(()=>{l||v!=="Not-Started"||(s(!0),a(V(!0)))},[l,v,a]),B.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{i.allApprovalRules.length===0&&i.fetchState==="Completed"&&(f||(y(!0),a(u())),e("./new"))},[f,i,a]);const j={events:o.companyId!=null?[`private-encrypted-${o.companyId}.${m}`]:[],eventCallback:(n,q,R)=>{n.endsWith(m)&&R.onApprovalRulesEventReceived(n)}};return o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?t.jsx(E,{to:"../../promo"}):o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted!==!0||i.fetchState!=="Completed"&&i.fetchState!=="Error"?t.jsx($,{fetchState:"In-Progress",style:{backgroundColor:w.colors.grey5}}):t.jsx(J,{currentTenant:o,location:r,navigate:e,...j})};function Z(){return t.jsxs(D,{children:[t.jsx(d,{path:"/",element:t.jsx(P,{})}),t.jsx(d,{path:"/new",element:t.jsx(g,{})}),t.jsx(d,{path:"/:approvalRuleId/edit",element:t.jsx(g,{})}),t.jsx(d,{path:"*",element:t.jsx(x,{})})]})}export{Z as R};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as g}from"./liveblocks-
|
|
1
|
+
import{j as g}from"./liveblocks-BTKJAzKw.js";import{a as y}from"./sentry-BidZRtdZ.js";import{j as A,h as w,u as C,l as T,g as b,k as U}from"./core-XIdi9yav.js";import{Nk as R,N4 as E,Cy as x,CH as _,CF as S,CG as h,Nl as k}from"./zeni-epic-state-znLEvSss.js";import{z as B,m as N,B as V,bA as F,ac as j}from"./index-BFHwjIZ6.js";import"./mui-D-cfPqvW.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]="76e88467-3709-4dc1-be22-b5e708f7928c",e._sentryDebugIdIdentifier="sentry-dbid-76e88467-3709-4dc1-be22-b5e708f7928c")}catch{}})();function O(e){return k(e)==null}const $=U(function(e,a){const t=R(e),s=t.remiSetupApproverViewUpdateData?.type??"approval_create",n=s==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return a.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===a.approvalRuleId)===0),{localData:t,hideUpperBoundField:n,isLowerBoundDisabled:l,approvalUpdateActionType:s}},function(e,a){const{navigate:t,approvalUpdateDataView:s,approverViewData:n,approvalRuleId:l}=a,r=s.remiSetupApproverViewUpdateData?.type,i=j(a.location);return{onApprovalRuleDataUpdated:o=>{const u=p=>{const v=[];return p.forEach(c=>{const D=c.actors.selectedUsers.map(d=>({type:"user",subType:void 0,userId:d.userId,idType:"user",isImplicitActor:!1})),I=c.actors.selectedNonUsers.map(d=>{const f=!!O(d.value);return{type:f?"attribute":"role",subType:d.value,userId:void 0,idType:void 0,isImplicitActor:!f}}),m=D.concat(I);v.push({action:c.stepType.selectedOption,actors:m,operator:m.length>1?c.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),v};if(r==="approval_create"){const p={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}else{const p={approvalRuleId:l,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}},onResetClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(_())},onSaveRuleSuccess:()=>{t("../")}}})(F);function J(){const e=A(),a=w(),t=C(),{approvalRuleId:s}=T(),n=B.getSignedInUser(),l=N(),r=b(p=>R(p)),i=b(p=>E(p)),[o,u]=y.useState(!1);if(y.useEffect(()=>{o||(u(!0),a(x(!0)))}),y.useEffect(()=>{i.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[i,s]),n==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(V,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):g.jsx($,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:i,location:t})}export{J as R,O as i};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-BTKJAzKw.js";import{j as J,h as re,u as Z,l as X,g as E,N as $,k as K,i as mt,n as ct,o as C}from"./core-XIdi9yav.js";import{eO as V,NB as le,c1 as me,BJ as xe,jL as dt,BW as ne,BV as ae,NC as ut,bn as ce,fI as Te,ND as pt,JY as bt,jA as De,JZ as fe,J_ as gt,iv as ht,MS as St,iK as ft,Bx as It,sm as yt,iC as Rt,Ch as je,NE as Fe,NF as At,NG as kt,NH as vt,NI as Ct,NJ as Et,C1 as Ie,iQ as wt,M$ as Bt,BX as xt,BH as Tt,NK as Dt,BG as jt,NL as Ft,BP as ye,C5 as Ut,C4 as Lt,C0 as Nt,NM as Ue,H6 as Pt,bo as Mt,BS as $t,Cz as _t,NN as Ot,NO as zt,Cd as Gt,Ca as Re,Ml as Ht,BE as Zt,NP as Le,CY as Ae,D4 as Vt,NQ as Wt,NR as G,NS as Jt,NT as Ne,NU as Kt,NV as Pe,NW as Me,Cp as se,bt as qt,bF as de,cB as ue,eU as $e,eS as _e,NX as Yt,gM as Xt,My as Qt,NY as en,NZ as Oe,MC as tn,Nk as nn,N_ as an,NA as sn,D1 as ke,D0 as on,N$ as rn,O0 as ln,O1 as mn,O2 as cn,O3 as dn,N5 as un,CT as pn,CX as bn,bv as gn,bE as hn,cw as Sn,ck as fn,bs as In,IS as yn,cM as Rn,cO as An,cN as kn,cv as vn}from"./zeni-epic-state-znLEvSss.js";import{w as ze,Z as Ge,y as Q,S as k,z as P,bK as He,A as ee,c as v,aE as ve,o as j,aq as Y,I as Cn,D as Ze,bL as En,r as H,bM as wn,k as te,bN as Bn,V as xn,G as Tn,B as pe,e as Ve,a3 as Dn,bb as jn,Y as Fn,m as We,bO as Un,a6 as Ln}from"./index-BFHwjIZ6.js";import{n as _,S as Nn}from"./mui-D-cfPqvW.js";import ie from"./NotFoundScreen-C5GqrkuK.js";import{S as Ce}from"./SetupPagesScreen-Ccazxtke.js";import{F as Je}from"./FeaturePreviewScreen-BbijPpnJ.js";import{a as S}from"./sentry-BidZRtdZ.js";import{u as be}from"./useAskAiCfoHostNavButtonProps-DvEC_Rfy.js";import{u as Ke}from"./useInitialThreadRequest-1r6joKrr.js";import{c as qe}from"./useFetchSuggestedQuestionsWhenReady-BXeQAqTk.js";import{D as Pn}from"./DrawerScreen-sfY6PIZF.js";import{M as Ye}from"./MobileAppDrawer-DrdSJdo1.js";import{R as Mn}from"./ReimbursementApprovalRoutes-B6agiTbB.js";import{FallBackRoute as $n}from"./ScreenRoutes-DCX1O3Md.js";import"./recharts-Db9qTggV.js";import"./analytics-Dwe2jubl.js";import"./plaid-_FJLoBl-.js";import"./dnd-C8_bqxJQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-B4nk2ufU.js";import"./lexical-L3dbahzM.js";import"./pdf-vaniLLX-.js";import"./utils-DDxx6oUt.js";import"./analyticsHelper-VfNEEHsS.js";import"./routePaths-DYhINZNz.js";import"./BusinessVerificationPageScreen-DsFRoHnS.js";import"./ReimbursementApprovalRuleDetailScreen-O71vUBoF.js";import"./getLocaleForTenant-CJ_gALMc.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]="75c23160-89a4-4328-a585-41ee00437eca",e._sentryDebugIdIdentifier="sentry-dbid-75c23160-89a4-4328-a585-41ee00437eca")}catch{}})();const Xe=e=>`/${e}/reimbursements`,_n=e=>S.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},S.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:L}}}=Ze.getLocalizedStrings(),On=K(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=P.getSignedInUser(),c=ce(d),m=r.plaidConnectionDetails,o=Te(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=le(e,t.reimbursementId),b=pt(e,d?.userId??"");let R=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(R=`${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:`${Y.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:R,isUserAdmin:me(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:De(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=P.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ae(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ye(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Nt(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(ye(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(jt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Dt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(xt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ie(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(Bt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(Ie("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ne({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(Fe()),e(At());const i=Xe(o),l=H(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(v.trackReimbursementDeleteReimbursement(n),e(je(n)))},onSaveBankAccount:()=>{a?.userId&&e(Rt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(yt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(ft(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(St())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(fe("common"))},onCancelAutoComplete:()=>{e(fe("common"))}}}})(En);function Ee(){const e=J(),t=re(),n=Z(),{reimbursementId:r}=X(),d=ze(),c=Ge(),[m,o]=S.useState(r==null),[a,i]=S.useState(1),{useFeatureGate:l}=Q(),{isFeatureEnabled:b}=l(k.isLimitedCategoryForReimbursement),{isFeatureEnabled:R}=l(k.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(k.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=be({mobileExploreReferrer:"Reimbursement Details"}),w=Z().pathname,D=w.includes("edit"),A=w.includes("reimbursement/new"),[F,B]=S.useState(!1),x=P.getSignedInUser(),I=E(p=>V(p)),g=E(p=>le(p,r)),N=Ke(I?.companyId,{clearParams:g.fetchState==="Completed"}),U=me(I?.userRole??[]);S.useEffect(()=>{(A&&!F||D&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(B(!0),t(xe(!1,b,R,r)))});const M=E(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(x==null)throw Error("Can't access address page without signing in...");const y={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||U&&g.billStatus==="rejected"||U===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx($,{to:y}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(He,{isNewReimbursement:r==null}):s.jsxs(zn,{windowSize:c,children:[s.jsx(ee,{analytics:v,onLoad:p=>(W=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&W.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(Gn,{}):null,m&&c!=="small"?s.jsx(Hn,{children:s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${Y.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:x?.userId??"",sessionId:x?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,x?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:j.sp3,paddingBottom:"15px",paddingLeft:j.sp5},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Zn,{children:[s.jsx(Vn,{onClick:()=>o(!1),children:s.jsx(_n,{})}),s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${Y.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:x?.userId??"",sessionId:x?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,x?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:j.sp5,paddingRight:j.sp3,paddingBottom:j.sp5,paddingLeft:j.sp3},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})]}):null,s.jsx(Wn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:N??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 zn=_.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
position: relative;
|
|
4
|
+
height: 100vh;
|
|
5
|
+
flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
|
|
6
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
7
|
+
`,Gn=_.div`
|
|
8
|
+
position: fixed;
|
|
9
|
+
top: 0;
|
|
10
|
+
left: 0;
|
|
11
|
+
right: 0;
|
|
12
|
+
bottom: 0;
|
|
13
|
+
background-color: ${Cn.overlayBackgroundBlack};
|
|
14
|
+
z-index: 5;
|
|
15
|
+
`,Hn=_.div`
|
|
16
|
+
position: absolute;
|
|
17
|
+
top: 0;
|
|
18
|
+
left: 0;
|
|
19
|
+
width: 42%;
|
|
20
|
+
height: 100%;
|
|
21
|
+
z-index: 6;
|
|
22
|
+
display: flex;
|
|
23
|
+
background-color: transparent;
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
`,Zn=_.div`
|
|
26
|
+
position: fixed;
|
|
27
|
+
top: 0;
|
|
28
|
+
left: 0;
|
|
29
|
+
right: 0;
|
|
30
|
+
bottom: 0;
|
|
31
|
+
z-index: 11;
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
overflow-y: auto;
|
|
35
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
36
|
+
`,Vn=_.button`
|
|
37
|
+
align-self: flex-end;
|
|
38
|
+
background: none;
|
|
39
|
+
border: none;
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
padding: ${j.sp2} ${j.sp3};
|
|
42
|
+
line-height: 1;
|
|
43
|
+
color: ${e=>e.theme.colors.hero};
|
|
44
|
+
&:hover {
|
|
45
|
+
color: ${e=>e.theme.colors.primary};
|
|
46
|
+
}
|
|
47
|
+
svg {
|
|
48
|
+
width: ${j.sp4};
|
|
49
|
+
height: ${j.sp4};
|
|
50
|
+
}
|
|
51
|
+
`,Wn=_.div`
|
|
52
|
+
display: flex;
|
|
53
|
+
flex-direction: column;
|
|
54
|
+
width: 100%;
|
|
55
|
+
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
56
|
+
`,Jn=K(function(e,t){const n=Ue(e,t.reimbursementId),r=P.getSignedInUser(),d=ce(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,zt(t.currentTenant),r));const i=me(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${Y.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:d,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:De(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(Fe());const a=Xe(o),i=H(d.state?.pathnameStackToGoBack,d.pathname);c(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Zt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Ht({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(Re(n,a.type,"")):e(Re(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=H(d.state?.pathnameStackToGoBack,d.pathname);c("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{v.trackReimbursementDeleteReimbursement(n),e(je(n))},cancelAndDeleteReport:a=>{a===!0?v.trackReimbursementCancelAndDeleteReimbursement(n):v.trackReimbursementCancelReimbursement(n),e(Gt(n,a))},handleZeniLogoClick:()=>{m.toggle()}}})(wn);function Kn(){const e=J(),t=re(),n=Z(),r=n.hash.substring(1),d=ze(),{reimbursementId:c}=X(),m=P.getSignedInUser(),o=E(y=>V(y)),a=E(y=>Ue(y,c??"")),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=Ke(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:b,onAskAiCfoClick:R}=be({mobileExploreReferrer:"Reimbursement Details"});qe({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:h}=Q(),{isFeatureEnabled:T}=h(k.isLimitedCategoryForReimbursement),[u,w]=S.useState(!1),[D,A]=S.useState(!1),[F,B]=S.useState(!1),{isFeatureEnabled:x}=h(k.isReimbursementCommentingEnabled),{isFeatureEnabled:I}=h(k.isShowDeletedReimbursementsFeatureEnabled),g=E(y=>le(y,c??"")),N=Pt(o),U=Mt(o.userRole),M=a.fetchState;if(S.useEffect(()=>{u||c==null?u==1&&M==="Error"&&e("page-not-found",{replace:!0}):(w(!0),t($t(c,!1,I)))},[u,c,t,M]),S.useEffect(()=>{I&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&N===!1?B(!1):B(a.remiActivities[0]?.isRealTimeApprovalEnabled&&(U||a.allApprovers.find(y=>y.user.userId===m?.userId)!=null||a.remiDetails?.lastUpdatedBy===m?.userId))},[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,U,o.isZeni,N,m]),S.useEffect(()=>{D||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(xe(!1,T,I,c)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(_t(!1,!0,!0,a.lastUpdatedByUserId)))},[D,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(He,{}):s.jsxs(s.Fragment,{children:[s.jsx(ee,{analytics:v,onLoad:y=>(p=>{c!=null&&p.trackReimbursementReimbursementDetails(c)})(y)}),s.jsx(Jn,{initialOpenThreadRequest:l??void 0,scrollId:r,isReimbursementCommentingEnabled:x,isShowDeletedReimbursementEnabled:I,location:n,navigate:e,isRealTimeApprovalEnabled:F,currentTenant:o,reimbursementId:c??"",themeState:d,isAiCfoAccessEnabled:b,onAskAiCfoClick:R})]})}const qn=K(function(e,t){return{remisReviewView:Le(e),analytics:t.analytics}},function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(G())},onCloseReviewItem:n=>{e(Wt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Vt());break;case"approve":e(Ae("approved",r??""));break;case"reject":e(Ae("rejected",r??""))}}}})(Bn);function Yn(){const e=J(),t=E(c=>c.remisBulkActionViewState.bulkSubmissionFetchState.fetchState),{remisForReview:n}=E(c=>Le(c)),r=te(),d=r?.loggedInUserRole?.includes("admin")===!0;return S.useEffect(()=>{t!=="Completed"&&n.length!==0||e("./")},[t,n.length]),s.jsx(qn,{navigate:e,analytics:v,isAdmin:d})}const z=tn(),Qe="bulk-operation-update",oe="reimbursement-approval-rule-update",{spendManagement:Xn,common:we}=Ze.getLocalizedStrings(),Be=Xn.reimbursement.bulkActions,Qn=_.div`
|
|
57
|
+
display: flex;
|
|
58
|
+
min-height: 100%;
|
|
59
|
+
width: 100%;
|
|
60
|
+
flex: 1 1 auto;
|
|
61
|
+
flex-direction: column;
|
|
62
|
+
align-items: center;
|
|
63
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
64
|
+
`,ea=K(function(e,t){const n=Me(e,z,t.isBulkActionEnabled);let r=n.allSubTabs;const d=P.getSignedInUser(),c=ce(d),m=e.tenantState.currentTenantId,o=V(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,R=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:v,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:i,companyName:a,timePeriod:z,spendManagementEndPoint:`${Fn}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:R.affectedEntityIds}},function(e,t){const{navigate:n,currentTenant:r,location:d,period:c}=t,{tenantEmailDomain:m}=r;return{updateTabToState:o=>{e(G()),e(Ne(o))},onSubtabChange:o=>{e(G()),e(Pe(o))},onTransactionClick:(o,a)=>{const i=aa(m,o,a),l=H(d.state?.pathnameStackToGoBack,d.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=na(m),a=H(d.state?.pathnameStackToGoBack,d.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;v?.trackReimbursementNewReimbursement();const a=`/${o}/reimbursement/new`,i=H(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)&&v.trackSpendManagmentFilterChange("reimbursement",o.categories.map(a=>`${a.field}-${JSON.stringify(a.values)}`))},updateDownloadStateHandler:o=>{o==="In-Progress"&&v.trackSpendManagementDownloadClick("reimbursement"),e(ln({uiState:{downloadState:o}}))},onReloadTransactions:()=>{e(se(c,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:o=>{e(rn(o))},removeAllTransactionsFromBulkActionList:()=>{e(G())},onProceedForBulkActionClick:(o,a)=>{switch(o){case"delete":case"cancel":e(on(o,a??""));break;case"send_for_approval":e(ke("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(ke("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(oe)&&e(sn(!1))},onEventReceived:o=>{o===Qe&&e(an())}}})(Dn(jn));function ta(){const e=J(),t=re(),n=Z(),r=n.state,d=Ge(),[c,m]=S.useState(null),o=mt("/:tenantEmailDomain/reimbursements/bulk-review")!=null;S.useEffect(()=>{if(r?.tab!=null&&r?.subTab!=null){const f=Jt(r.tab.toString());f!=null?t(Ne(f)):console.log("Warning:Not a valid remiListTab");const O=Kt(r.subTab.toString());O!=null?t(Pe(O)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(G())}},[]);const{useFeatureGate:a}=Q(),{isFeatureEnabled:i}=a(k.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(k.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:b}=a(k.isBillPayCommentingEnabled),{isFeatureEnabled:R}=a(k.isReimbursementCommentingEnabled),{isFeatureEnabled:h}=a(k.isReimbursementBulkActionEnabled),T=P.getSignedInUser(),u=E(f=>V(f)),[w,D]=S.useState(!1),[A,F]=S.useState(!1),B=te(),x=B?.loggedInUserRole?.includes("admin")===!0,I=E(f=>Me(f,z,h)),{areTenantIdsInSync:g}=xn(),N=I.fetchState,{isAiCfoAccessEnabled:U,onAskAiCfoClick:M}=be({mobileExploreReferrer:"Reimbursement List"});if(qe({isDataReady:N==="Completed"}),S.useEffect(()=>{!A&&g&&(F(!0),t(se(z,!0,l,!1,!0)))},[A,z,t,g]),T==null)throw Error("Can't access address page without signing in...");const y=!!u?.userRole&&qt(u),p=de(B?.loggedInUserRoleMap),W=ue(B?.loggedInUserRoleMap),et=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,tt=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,nt=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,at=E(f=>Te(f.companyState,u.companyId)),st=at?.company.featuresActivationInfo.connectedAccountProvider,ge=f=>{D(f)},{isFeatureEnabled:it}=a(k.isDebitCardFeatureEnabled),ot=$e(it,u),rt=_e(u),{remisProcessed:q,remisProcessing:he}=E(f=>Yt(f));S.useEffect(()=>{q===he&&c!=null&&(t(Xt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:q>1?Be.reports:Be.report},{variableName:"_has_",variableValue:q>1?we.texts.have:we.texts.has},{variableName:"_action_",variableValue:Qt(c)}]})),t(en()),setTimeout(()=>{t(se(z,!0,l,!1,!0,!0))},3e3),m(null))},[q,he]);const lt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${Qe}`,`private-encrypted-${u.companyId}.${oe}`]:[],eventCallback:(f,O,Se)=>{f.endsWith(oe)?Se.onReimbursementApprovalRulesEventReceived?.(f):O.entity_type==="reimbursement"&&(m(O.operation_type),Se.onEventReceived(f))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?ot===!0||rt===!0?s.jsx(Je,{}):tt&&(!y||p)||W&&et?s.jsxs(s.Fragment,{children:[N==="Completed"?s.jsx(ee,{analytics:v,onLoad:f=>(O=>O.trackPageLoaded(Ve.Event.reimbursementHome))(f)}):null,s.jsx(Ye,{isAppContentDrawerOpen:w,handleDrawerToggle:ge}),s.jsxs(Qn,{windowSize:d,children:[s.jsx(Pn,{isOpen:o,drawerLeftMargin:new Tn(0,0,300,600),onClose:()=>{e("./"),t(G())},children:s.jsx(sa,{onClick:f=>f.stopPropagation(),children:s.jsx(Yn,{})})}),s.jsx(ea,{isShowDeletedBillsEnabled:i,isShowDeletedReimbursementEnabled:l,isBillPayCommentingEnabled:b,isReimbursementCommentingEnabled:R,location:n,navigate:e,currentTenant:u,period:z,isAdmin:x,isEmployee:y,entity:"reimbursement",onClickMenuIcon:()=>{ge(!0)},createdByUserList:I.createdByUserList,createdByUserListFetchState:I.createdByUserListFetchState,isDownloadEnabled:I.isDownloadEnabled,connectedAccountProvider:st,isBulkActionEnabled:h,bulkSubmissionLimit:I.remiBulkSubmissionLimit,bulkSubmissionFetchState:I.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:U,onAskAiCfoClick:M,...lt})]})]}):nt&&p?s.jsx($,{to:"../setup"}):B!=null&&Oe(u,B.loggedInUserRoleMap)?s.jsx($,{to:"../promo"}):s.jsx(pe,{fetchState:"In-Progress"}):s.jsx(ie,{})}const na=e=>`/${e}/reimbursements/setup`,aa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},sa=_(Nn)`
|
|
65
|
+
display: flex;
|
|
66
|
+
min-height: 100%;
|
|
67
|
+
flex-direction: column;
|
|
68
|
+
`,ia=K(function(e,t){const{companyId:n}=t;return{reimbursementSetupView:un(e,n),analytics:v,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=J(),t=Z(),{tenantEmailDomain:n}=X(),r=We(),[d,c]=S.useState(!1),m=E(A=>V(A)),o=P.getSignedInUserTenant(n)?.companyId??m.companyId,a=P.getSignedInUser(),i=m.userRoleId,l=!!m.userRole?.includes("reimbursements_user"),b=te(),R=de(b?.loggedInUserRoleMap),h=ue(b?.loggedInUserRoleMap),T=!!m.userReimbursementInfo?.isReimbursementTOSAccepted,u=!!m.companyReimbursementInfo?.info?.isReimbursementEnabled,w=!!m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,D=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"}):w&&R?s.jsx($,{to:"../../reimbursements/setup"}):m.companyReimbursementInfo&&!w||m.userReimbursementInfo&&h&&T===!1?s.jsxs(s.Fragment,{children:[s.jsx(ee,{analytics:v,onLoad:A=>(F=>F.trackPageLoaded(Ve.Event.reimbursementPromoPage))(A)}),s.jsx(Ye,{isAppContentDrawerOpen:d,handleDrawerToggle:D}),s.jsx(ia,{companyId:o,navigate:e,location:t,userReimbursementInfo:m.userReimbursementInfo,userRoleId:i,isEmployee:l,onClickMenuIcon:()=>{D(!0)}})]}):s.jsx(pe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function Pa(){const e=E(W=>V(W)),t=te(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=We(),d=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,c=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=Q(),{isFeatureEnabled:o}=m(k.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(k.isDebitCardFeatureEnabled),i=$e(a,e),l=_e(e),b=e?.userRole!=null&&gn(e?.userRole),R=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b)&&hn(t?.loggedInUserRoleMap),h=Sn(t?.loggedInUserRoleMap),T=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!b,u=de(t?.loggedInUserRoleMap),w=T&&u,{isFeatureEnabled:D}=m(k.isDepositAccountsFeatureEnabled),A=D&&!b&&fn(t?.loggedInUserRoleMap),F=Ln(e,o,a)&&!b&&In(t?.loggedInUserRoleMap),B=yn(t?.loggedInUserRoleMap),x=Rn(t?.loggedInUserRoleMap),I=An(t?.loggedInUserRoleMap),g=kn(t?.loggedInUserRoleMap),N=vn(t?.loggedInUserRoleMap),U=ue(t?.loggedInUserRoleMap),{tenantEmailDomain:M}=X(),y=Z(),p=n===!0&&(u||U&&c);return s.jsxs(ct,{children:[y.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(C,{path:"verification",element:s.jsx(Ce,{isBillPayAdminLevelAccess:R,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:w,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:F,isUserHasOnlyCardAccess:B,productType:"reimbursement",type:"verification"})}),s.jsx(C,{path:"setup",element:s.jsx(Ce,{isBillPayAdminLevelAccess:R,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:w,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:F,isUserHasOnlyCardAccess:B,productType:"reimbursement",type:"setup"})}),s.jsx(C,{path:"promo",element:s.jsx(oa,{})}),s.jsx(C,{path:"approval-rules/*",element:w?s.jsx(Mn,{}):s.jsx($n,{isUserHasZeniAccountsAccess:x,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:N,isUserHasReimbursementAccess:U,isUserHasTreasuryAccess:I,isTenantBankingOnly:i,tenantEmailDomain:M??""})}),p&&s.jsx(C,{path:"*",element:s.jsx(ta,{})}),(i===!0||l===!0)&&s.jsx(C,{path:"/*",element:s.jsx(Je,{})}),t!=null&&Oe(e,t?.loggedInUserRoleMap)&&s.jsx(C,{path:"*",element:s.jsx($,{to:"../promo"})}),d&&u&&s.jsx(C,{path:"*",element:s.jsx($,{to:"../setup"})})]}):y.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(C,{path:"new",element:s.jsx(Ee,{})}),s.jsx(C,{path:":reimbursementId",element:s.jsx(Kn,{})}),s.jsx(C,{path:":reimbursementId/edit",element:s.jsx(Ee,{})}),s.jsx(C,{path:"*",element:s.jsx(ie,{})})]}):s.jsx(C,{path:"*",element:s.jsx(pe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${j.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(C,{path:"*",element:s.jsx(ie,{})})]})}export{Pa as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as p}from"./liveblocks-BTKJAzKw.js";import{u as z,j as ye,h as Ce,l as ge,g as d,k as Se,n as we,o as G}from"./core-XIdi9yav.js";import{eO as L,f8 as S,Jj as Ie,jA as Q,Jk as X,pS as O,jo as Re,is as Te,tm as K,pX as Ae,bv as Oe,Jl as ke,bn as Fe,ul as De,Jm as je,Jn as Ee,te as Pe,Jo as Y,Jp as Le,Jq as Me,Jr as Be,Js as Je,Jt as w,Ju as k,Jv as F,Jw as H,Jx as D,Jy as j,dC as ve,u1 as Ue,tR as N,tS as q,u7 as Ve,tW as $,ud as xe,Jz as ze,JA as Ge,JB as Ye,JC as He,JD as Ne,eU as qe,eS as $e}from"./zeni-epic-state-znLEvSss.js";import{R as We,U as Ze,Z as Qe,y as ee,S as E,z as ae,V as Xe,k as Ke,a as ea,A as aa,c as P,e as sa,r as se,W as ta,X as oa,Y as na}from"./index-BFHwjIZ6.js";import"./mui-D-cfPqvW.js";import ra from"./NotFoundScreen-C5GqrkuK.js";import{F as ia}from"./FeaturePreviewScreen-BbijPpnJ.js";import{a as _}from"./sentry-BidZRtdZ.js";import{u as la,a as ca,b as da,c as pa}from"./useFetchSuggestedQuestionsWhenReady-BXeQAqTk.js";import{u as ma}from"./useInitialThreadRequest-1r6joKrr.js";import{t as W,a as Z}from"./routePaths-DYhINZNz.js";import{M as fa}from"./MobileAppDrawer-DrdSJdo1.js";import"./recharts-Db9qTggV.js";import"./analytics-Dwe2jubl.js";import"./plaid-_FJLoBl-.js";import"./dnd-C8_bqxJQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-B4nk2ufU.js";import"./lexical-L3dbahzM.js";import"./pdf-vaniLLX-.js";import"./utils-DDxx6oUt.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]="eaaae7a2-c68a-4d72-9e9f-27ed524dd209",e._sentryDebugIdIdentifier="sentry-dbid-eaaae7a2-c68a-4d72-9e9f-27ed524dd209")}catch{}})();const ua=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(j({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(F({resetLeftScroll:!0})),e(k({resetLeftScroll:!0}))},_a=e=>{e(Ge()),e(Ye()),e(He()),e(Ne())},ha=Se(function(e){const o=ae.getSignedInUser(),m=e.tenantState.currentTenantId,u=L(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:m??""},t=S(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:Q(e),isAccountingProjectsEnabled:X(e),currentTenantCompanyName:a,statementEndPoint:`${na}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:m,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(O(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(ze(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(xe(a)),s){const{isCompareModeOn:r,filter:c}=o,{additionalBalances:f,balancesRange:l}=c;let i=[...f];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(N(o.firstMonthOfFY,r,l.numberOfPeriods<1?1:l.numberOfPeriods,i)),f.length>0&&e(q(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",l.numberOfPeriods<1?1:l.numberOfPeriods,i))}t!==!0&&setTimeout(()=>y(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(w(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e($({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($(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(Ve(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(N(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(q(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,c;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,c=ve(s)):s.balanceTimeFrame==="year"?(r="quarter",c={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),c!=null&&r!=null){const f=a.accountName===""?a.accountDescription:a.accountName,l=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return W(o.tenantEmailDomain,a.accountId,a.accountType,f,r,c);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return Z(o.tenantEmailDomain,a.accountId,a.accountType,s.id,f,r,c)}return a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?Z(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,c):a.accountType!=null?W(o.tenantEmailDomain,a.accountId,a.accountType,f,r,c):void 0})();if(l!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);m(l,{state:{pathnameStackToGoBack:i,referrer:I(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(H({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(H({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:()=>{m("../../")},onUpdateAccountViewMode:a=>{e(Be({viewMode:a})),e(Je({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",I(o.selectedReportID)),e(w("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",I(o.selectedReportID)),e(w("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",I(o.selectedReportID)),e(w("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Me({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Le({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(Y({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(K())},onUpdateDisplayOrder:a=>{e(Ee(a))},onUpdateReportFormat:a=>{_a(e),e(je(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}})(ta);function ba(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Ze(),m=Qe(),u=oa(m),a=ye(),s=Ce(),t=z(),{tenantEmailDomain:r}=ge(),{useFeatureGate:c}=ee(),{isFeatureEnabled:f}=c(E.isReportsHorizontalClassLayoutSwitchEnabled),l=ae.getSignedInUser(),[i,C]=_.useState(!1),[M,te]=_.useState(!1),{isFeatureEnabled:B}=c(E.isReportsCommentingEnabled);if(l==null)throw Error("Can't access reports page without signing in...");const J=d(n=>L(n)),oe=J.company?.companyInfo.firstMonthOfFY??1,ne=ma(B?J?.companyId:void 0),g=d(n=>S(n).fetchState),re=d(n=>Ie(n)),{areTenantIdsInSync:h}=Xe(),R=d(n=>n.financeStatementState.selectedReportId),v=d(n=>Q(n)),T=d(n=>X(n)),ie=d(n=>S(n).isCompareModeOn),b=d(n=>S(n).filter),A=d(n=>S(n).selectedReportAndTimeframeFetchState),le=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&h&&(C(!0),s(O(l.userId,!0,!0,!1)))},[i,l,s,h]),_.useEffect(()=>{i&&!M&&g==="Completed"&&h&&(s(O(l.userId,!1,!0,!1)),te(!0))},[i,M,g,h]),_.useEffect(()=>{if(i&&A.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Ae(b.timeframe));break;case"profit_and_loss_by_projects":T&&s(K());break;case"balance_sheet":s(Te(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}},[i,R,A,h,v,T]);const U=Ke(),ce=U?.loggedInUserRole!=null&&Oe(U?.loggedInUserRole)!==!0,[de,pe]=_.useState(!1),V=n=>{pe(n)},me=ea(),fe=da();return function(n){const{isDataReady:ue}=n,{pathname:_e}=z(),x=We(_e??"")==="reports",he=la(ue),be=_.useMemo(()=>x?ua:void 0,[x]);ca({canFetchSuggestedQuestions:he,pageContexts:be})}({isDataReady:g==="Completed"}),pa({isDataReady:g==="Completed"}),p.jsxs(p.Fragment,{children:[g==="Completed"?p.jsx(aa,{analytics:P,onLoad:n=>n.trackPageLoaded(sa.Event.reports)}):null,p.jsx(fa,{isAppContentDrawerOpen:de,handleDrawerToggle:V}),p.jsx(ha,{firstMonthOfFY:oe,tenantEmailDomain:r,location:t,navigate:a,windowSize:m,classViewLayout:le,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:v,isAccountingProjectsEnabled:T,isCompareModeOn:ie,hasTransactionAccess:ce,signedInUser:l,selectedReportAndTimeframeFetchState:A,handleDrawerToggle:V,reportsResyncFetchState:re.reportsResyncFetchState,isAiCfoAccessEnabled:fe&&me&&!e,onAskAiCfoClick:()=>{if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0)},isHorizontalClassReportSwitchEnabled:f,isReportsCommentingEnabled:B,initialOpenThreadRequest:ne})]})}const I=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function Ua(){const e=d(s=>L(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:m}=o(E.isDebitCardFeatureEnabled),u=qe(m,e),a=$e(e);return u===!0||a===!0?p.jsx(ia,{}):p.jsxs(we,{children:[p.jsx(G,{path:"/",element:p.jsx(ba,{})}),p.jsx(G,{path:"*",element:p.jsx(ra,{})})]})}export{Ua as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as a}from"./liveblocks-BTKJAzKw.js";import{y as w,z as j,aK as y,A as E,c as p,e as F,cF as P,S as L}from"./index-BFHwjIZ6.js";import"./mui-D-cfPqvW.js";import l from"./NotFoundScreen-C5GqrkuK.js";import{a as u}from"./sentry-BidZRtdZ.js";import{h as A,g as b,j as T,u as V,k as R,n as U,o as d}from"./core-XIdi9yav.js";import{eO as z,PW as C,ML as Y,PX as _,tI as G,e_ as O,PY as K,tG as M}from"./zeni-epic-state-znLEvSss.js";import{R as x}from"./ReferralListScreen-DYfKAeQl.js";import"./recharts-Db9qTggV.js";import"./analytics-Dwe2jubl.js";import"./plaid-_FJLoBl-.js";import"./dnd-C8_bqxJQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-B4nk2ufU.js";import"./lexical-L3dbahzM.js";import"./pdf-vaniLLX-.js";import"./utils-DDxx6oUt.js";import"./useAskAiCfoHostNavButtonProps-DvEC_Rfy.js";import"./useFetchSuggestedQuestionsWhenReady-BXeQAqTk.js";import"./MobileAppDrawer-DrdSJdo1.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]="398a84b3-50c2-4821-ab67-0a75e0948568",e._sentryDebugIdIdentifier="sentry-dbid-398a84b3-50c2-4821-ab67-0a75e0948568")}catch{}})();const W=R(function(e,t){const n=C(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}},function(e,t){const{navigate:n}=t,i=j.getSignedInUser();return{onDismissClick:()=>{e(_()),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(M())},onUpdateInviteFormLocalData:s=>{e(K({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}})(P),X=()=>{const e=A(),[t,n]=u.useState(!1),[i,s]=u.useState(!1),r=b(o=>z(o)),c=T(),k=V(),{useDynamicConfig:g}=w(),f=j.getSignedInUser();if(f==null)throw Error("Can't access invite referral screen without signing in...");const m=b(o=>C(o)),D=f?.firstName!=null?f.firstName:"User",{configValue:h}=g(y.zeniCardsConfig),{configValue:S}=g(y.zeniAccountsConfig),v=Y(S);u.useEffect(()=>{e(_()),r?.rewardsLastViewedTime==null&&i===!1&&(e(G()),s(!0))},[]),u.useEffect(()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(O(!0)))},[m.fetchState,e]);const I=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(E,{analytics:p,onLoad:o=>(N=>N.trackPageLoaded(F.Event.inviteEmailViewed))(o)}):null,a.jsx(W,{navigate:c,location:k,currentTenant:r,companyName:I,userName:D,inviteFormCompayData:m.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:v.maxAnnualPercentageYield})]})};function fe(){const{useFeatureGate:e}=w(),{isFeatureEnabled:t}=e(L.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(d,{path:"/",element:t?a.jsx(x,{}):a.jsx(l,{})}),a.jsx(d,{path:"how-it-works",element:t?a.jsx(x,{isReferralDrawerOpen:!0}):a.jsx(l,{})}),a.jsx(d,{path:"refer/*",element:t?a.jsx(X,{}):a.jsx(l,{})}),a.jsx(d,{path:"*",element:a.jsx(l,{})})]})}export{fe as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-D6LkoAS1.js","assets/sentry-BidZRtdZ.js","assets/core-XIdi9yav.js","assets/zeni-epic-state-znLEvSss.js","assets/index-BFHwjIZ6.js","assets/mui-D-cfPqvW.js","assets/analytics-Dwe2jubl.js","assets/utils-DDxx6oUt.js","assets/withTransactionSidePanel-_oROnP2L.js","assets/useAskAiCfoHostNavButtonProps-DvEC_Rfy.js","assets/useFetchSuggestedQuestionsWhenReady-BXeQAqTk.js","assets/TransactionDetailScreen-DVUrpN27.js","assets/decodeURIComponentSafe-CqshbMyv.js","assets/routePaths-DYhINZNz.js","assets/NotFoundScreen-C5GqrkuK.js","assets/analyticsHelper-VfNEEHsS.js","assets/CompanyPassportScreen-DfcahYi3.js","assets/MobileAppDrawer-DrdSJdo1.js","assets/FeaturePreviewScreen-BbijPpnJ.js","assets/ReferralListScreen-DYfKAeQl.js","assets/index-Bc34frN_.css","assets/BillPayRoutes-BYOQqAtg.js","assets/AddressScreen-BmR-OoZ_.js","assets/DomesticWireDetailScreen-loJ8GquO.js","assets/useInitialThreadRequest-1r6joKrr.js","assets/DrawerScreen-sfY6PIZF.js","assets/SetupPagesScreen-Ccazxtke.js","assets/BusinessVerificationPageScreen-DsFRoHnS.js","assets/BillPayApprovalRoutes-CzEk_nhg.js","assets/ReimbursementApprovalRuleDetailScreen-O71vUBoF.js","assets/getLocaleForTenant-CJ_gALMc.js","assets/ReimbursementRoutes-D5zdl8gM.js","assets/ReimbursementApprovalRoutes-B6agiTbB.js","assets/TransactionListRoutes-ZGPTqV4b.js","assets/ZeniAccountStatementScreen-z63ZBClm.js","assets/SettingsRoutes-88kae7-O.js","assets/accountMappingHelper-DpGnVAea.js","assets/QBOConnectionScreen-BCkDW1I6.js","assets/empty-CP3zMx39.js","assets/index-DZp35-bi.js","assets/url-B1tfhvRN.js","assets/index-hYoHMc0Z.js","assets/ReportsRoutes-BDvJqZZF.js","assets/ChargeCardRoutes-UrbQPmqH.js","assets/PeopleRoutes-DW6v38OQ.js","assets/ExpenseAutomationRoutes-mHXp4ejt.js","assets/TreasuryRoutes-mN-Tiy6z.js","assets/VendorsRoutes-Cx_ts7OM.js","assets/pathToGoBack-CEbHtWH4.js","assets/ZeniAccountRoutes-DLsDt2CE.js","assets/AddressRoutes-BhkbfnzS.js","assets/PandLWithForecastRoutes-C-wtMSOq.js","assets/CustomerOnboardingRoutes-ClmI94EA.js","assets/TransactionDetailRoutes-CALv3lzc.js","assets/EntityDetailRoutes-DzARLOVe.js","assets/NotificationRoutes-2PbblZyO.js","assets/PerformanceRoutes-SuLEsbMN.js","assets/RewardsRoutes-CrQQoiRC.js","assets/TaskRoutes-Bmq0PDng.js","assets/TaskListScreen-BfyHzekg.js","assets/AiCfoScreen-C8ZpEKvV.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as n,bn as os,eO as ls,eU as cs,eS as ds,eT as ms,fD as us,eQ as _s,cP as Ee,cw as Es,f9 as As,co as ps,bD as Is,bq as Ts,fe as gs,v as xs,IR as hs,bv as js,IS as Us,bF as bs,fb as Ds,bE as Hs,bs as Rs,ck as ys,IT as fs,IU as Cs,cM as vs,cO as Os,cN as Ps,cv as Fs,cB as Ls,mv as Ae,eP as pe,fN as Bs,fi as Ie,fK as Te,fL as ge,fj as ks}from"./zeni-epic-state-znLEvSss.js";import{j as e}from"./liveblocks-BTKJAzKw.js";import{a as v}from"./sentry-BidZRtdZ.js";import{h as Ss,j as Vs,l as Ns,u as Ms,g as z,i as xe,N as c,n as Zs,o as t}from"./core-XIdi9yav.js";import{m as ws,u as zs,z as D,y as Gs,a as $s,T as Ys,S as L,k as qs,L as B,D as he,t as _,P as Ws,c as X,l}from"./index-BFHwjIZ6.js";import"./mui-D-cfPqvW.js";import{f as je}from"./analyticsHelper-VfNEEHsS.js";import{t as Ks}from"./getLocaleForTenant-CJ_gALMc.js";import"./recharts-Db9qTggV.js";import"./analytics-Dwe2jubl.js";import"./plaid-_FJLoBl-.js";import"./dnd-C8_bqxJQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-B4nk2ufU.js";import"./lexical-L3dbahzM.js";import"./pdf-vaniLLX-.js";import"./utils-DDxx6oUt.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},U=new i.Error().stack;U&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[U]="8d57101d-d10e-42f1-81f7-56a8235a5bb9",i._sentryDebugIdIdentifier="sentry-dbid-8d57101d-d10e-42f1-81f7-56a8235a5bb9")}catch{}})();const Qs={dashboard:()=>n(()=>import("./DashboardRoutes-D6LkoAS1.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])),bills:()=>n(()=>import("./BillPayRoutes-BYOQqAtg.js"),__vite__mapDeps([21,1,2,3,4,5,6,7,22,14,23,9,10,24,25,17,18,26,15,13,27,28,29,30,20])),reimbursement:()=>n(()=>import("./ReimbursementRoutes-D5zdl8gM.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,14,26,17,15,13,27,18,9,10,24,25,32,29,30,20])),transactions:()=>n(()=>import("./TransactionListRoutes-ZGPTqV4b.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,13,34,20])),settings:()=>n(()=>import("./SettingsRoutes-88kae7-O.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,22,14,15,27,13,16,37,38,39,40,41,12,28,29,32,20])),reports:()=>n(()=>import("./ReportsRoutes-BDvJqZZF.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,14,18,10,24,13,17,20])),chargeCards:()=>n(()=>import("./ChargeCardRoutes-UrbQPmqH.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,14,15,13,27,9,10,22,20])),people:()=>n(()=>import("./PeopleRoutes-DW6v38OQ.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,14,9,10,17,20])),expenseAutomation:()=>n(()=>import("./ExpenseAutomationRoutes-mHXp4ejt.js"),__vite__mapDeps([45,1,2,3,14,4,5,6,7,9,10,11,12,13,8,36,25,20])),treasury:()=>n(()=>import("./TreasuryRoutes-mN-Tiy6z.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,14,26,17,15,13,27,9,10,18,20])),vendors:()=>n(()=>import("./VendorsRoutes-Cx_ts7OM.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,22,14,18,13,48,9,10,17,25,36,20])),zeniAccounts:()=>n(()=>import("./ZeniAccountRoutes-DLsDt2CE.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,14,26,17,15,13,27,18,23,22,9,10,34,20]))},Js=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=i=>{"requestIdleCallback"in window?requestIdleCallback(i):setTimeout(i,100)},Xs=l(()=>n(()=>import("./ReportsRoutes-BDvJqZZF.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,14,18,10,24,13,17,20]))),en=l(()=>n(()=>import("./AddressRoutes-BhkbfnzS.js"),__vite__mapDeps([50,1,2,3,22,4,5,6,7,14,20]))),sn=l(()=>n(()=>import("./PeopleRoutes-DW6v38OQ.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,14,9,10,17,20]))),nn=l(()=>n(()=>import("./PandLWithForecastRoutes-C-wtMSOq.js"),__vite__mapDeps([51,1,2,3,4,5,6,7,14,18,9,10,24,13,17,20]))),an=l(()=>n(()=>import("./CustomerOnboardingRoutes-ClmI94EA.js"),__vite__mapDeps([52,1,2,3,22,4,5,6,7,14,37,38,39,40,41,12,20]))),tn=l(()=>n(()=>import("./VendorsRoutes-Cx_ts7OM.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,22,14,18,13,48,9,10,17,25,36,20]))),rn=l(()=>n(()=>import("./TransactionDetailRoutes-CALv3lzc.js"),__vite__mapDeps([53,1,2,3,14,4,5,6,7,11,9,10,12,13,20]))),Ue=l(()=>n(()=>import("./EntityDetailRoutes-DzARLOVe.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,12,8,9,10,11,13,20]))),on=l(()=>n(()=>import("./DashboardRoutes-D6LkoAS1.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]))),be=l(()=>n(()=>import("./BillPayRoutes-BYOQqAtg.js"),__vite__mapDeps([21,1,2,3,4,5,6,7,22,14,23,9,10,24,25,17,18,26,15,13,27,28,29,30,20]))),ln=l(()=>n(()=>import("./SettingsRoutes-88kae7-O.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,22,14,15,27,13,16,37,38,39,40,41,12,28,29,32,20]))),De=l(()=>n(()=>import("./ReimbursementRoutes-D5zdl8gM.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,14,26,17,15,13,27,18,9,10,24,25,32,29,30,20]))),cn=l(()=>n(()=>import("./ZeniAccountRoutes-DLsDt2CE.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,14,26,17,15,13,27,18,23,22,9,10,34,20]))),dn=l(()=>n(()=>import("./TreasuryRoutes-mN-Tiy6z.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,14,26,17,15,13,27,9,10,18,20]))),mn=l(()=>n(()=>import("./TransactionListRoutes-ZGPTqV4b.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,13,34,20]))),un=l(()=>n(()=>import("./ChargeCardRoutes-UrbQPmqH.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,14,15,13,27,9,10,22,20]))),_n=l(()=>n(()=>import("./NotificationRoutes-2PbblZyO.js"),__vite__mapDeps([55,1,2,3,14,4,5,6,7,9,10,20]))),En=l(()=>n(()=>import("./PerformanceRoutes-SuLEsbMN.js"),__vite__mapDeps([56,1,2,3,14,4,5,6,7,9,10,17,20]))),An=l(()=>n(()=>import("./ExpenseAutomationRoutes-mHXp4ejt.js"),__vite__mapDeps([45,1,2,3,14,4,5,6,7,9,10,11,12,13,8,36,25,20]))),pn=l(()=>n(()=>import("./RewardsRoutes-CrQQoiRC.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,14,19,9,10,17,20]))),In=l(()=>n(()=>import("./TaskRoutes-Bmq0PDng.js"),__vite__mapDeps([58,1,2,3,14,4,5,6,7,24,17,59,9,10,20]))),Tn=l(()=>n(()=>import("./AiCfoScreen-C8ZpEKvV.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,48,20]))),y=l(()=>n(()=>import("./NotFoundScreen-C5GqrkuK.js"),__vite__mapDeps([14,1,2,3,4,5,6,7,20]))),gn=l(()=>n(()=>import("./TaskListScreen-BfyHzekg.js"),__vite__mapDeps([59,1,2,3,4,5,6,7,9,10,17,20])));function wn({setTenantEmailDomain:i}){const U=Ss(),S=Vs(),{tenantEmailDomain:o}=Ns(),V=ws().mode,{setLoading:f,clearAllLoading:O,clearLoading:Z}=zs(),R=D.getSignedInUserTenant(o)?.tenantId,h=D.getSignedInUser(),K=os(h),G=Ms(),[N,Re]=v.useState(!1),r=z(a=>ls(a)),{useFeatureGate:P}=Gs(),Q=$s(),ye=Ys(),{isFeatureEnabled:fe}=P(L.isExpenseAutomationEnabled),{isFeatureEnabled:Ce}=P(L.isExpenseAutomationEnabledV2),ve=Ce||fe&&K,{isFeatureEnabled:Oe}=P(L.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Pe}=P(L.isTreasuryEnabled),{isFeatureEnabled:Fe}=P(L.isChargeCardFeatureEnabled),{isFeatureEnabled:se}=P(L.isDebitCardFeatureEnabled),j=z(a=>a.tenantState.fetchState),A=z(a=>a.tenantState.activeTenantFetchState.fetchState),u=A==="Completed"||j==="Completed"?cs(se,r):void 0,$=A==="Completed"||j==="Completed"?ds(r):void 0,Le=A==="Completed"||j==="Completed"?ms(r):void 0,Be=Fe||se||!!Le||!!$||!!u,{isFeatureEnabled:ke}=P(L.isSettingsFeatureEnabled),{isFeatureEnabled:Se}=P(L.isAiCfoFileUploadEnabled),Y=z(a=>us(a));if(o!=null){const a=D.getSignedInUserTenant(o);h!=null&&a!=null&&je(h,r,V)}const w={tenantId:R,userId:h?.userId,sessionId:h?.zeniSessionId},ne=_s(),E=qs(),Ve=r.company==null||E?.loggedInUserRoleMap!=null&&Ee(E.loggedInUserRole),Ne=Es(E?.loggedInUserRoleMap),ae=v.useRef(!0),te=xe("/:tenantEmailDomain/onboarding/*")!==null,J=xe("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Me=z(a=>w.tenantId!=null?As(a,w.tenantId):void 0);v.useEffect(()=>{f(B.TENANT_FETCHING),i(o)},[o]),v.useEffect(()=>{if(J!=null&&R!=null){const a=J.params.selectedPeriod;if(a!=null){const b=a.split("-");if(b.length===2){const d=ps(Number(b[0])),s=Number(b[1]),m=Is(`01-${d<10?`0${d}`:d}-${s}`,he.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),M=Ts();m.isAfter(M,"month")===!1?U(gs(R,{month:d,year:s})):S("./month_end_close_checks/review")}}}},[J,R]),v.useEffect(()=>{N||(Re(!0),f(B.TENANT_FETCHING)),ae.current?ae.current=!1:!xs(ne,w)&&D.isSignedIn()&&(f(B.TENANT_FETCHING),function(a,b,d,s){if(pe(b?.userId,b?.zeniSessionId,a.tenantId),d(Bs(!0)),d(Ie(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const m=D.getSignedInUserTenantWithId(a.tenantId);s&&he.updateAppLocaleID(Ks(s)),m?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(m?.tenantEmailDomain)}a.userId!=null?X.identify(a.userId,{tenant_id:a.tenantId}):X.resetUserIdentity()}(w,h,U,Me))},[w,ne,h,U,D]),v.useEffect(()=>{D.isSignedIn()&&(f(B.TENANT_FETCHING),function(a,b,d,s,m,M,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const q=s!=null&&m?.zeniSessionId!=null,ts=d==null||d.tenantId!==s,is=d!=null&&d.excludedResources==null,rs=d!=null&&d.externalConnections==null;if(q&&ts){k(Ie(s));const W=D.getSignedInUserTenantWithId(s);W?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(W?.tenantEmailDomain),pe(m?.userId,m?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(Te(m.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(ge(m.userId,s)))}else q&&is&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(Te(m.userId,s))),q&&rs&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(ge(m.userId,s)));if(q){X.identify(m.userId,{tenant_id:s});const W=s==null||s!=null&&(b==="Completed"||b==="Error");a==="Completed"||b!=="Not-Started"&&b!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),M(B.TENANT_FETCHING),k(ks(m.userId,s,m.zeniSessionId))),W&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(Ae(m.userId,m.zeniSessionId)))}}(j,A,r,R,h,f,U))},[R,A]),v.useEffect(()=>{D.isSignedIn()&&j==="Completed"&&Y.tenantsBaseInOrder.length>0&&(Z(B.TENANT_FETCHING),D.saveSignedInUserTenants(hs(Y.tenantsBaseInOrder)),h!=null&&je(h,r,V,void 0,Y.tenantsBaseInOrder))},[Y,j,r,h]),v.useEffect(()=>{A==="In-Progress"&&f(B.TENANT_FETCHING),A!=="Completed"&&A!=="Error"||(A==="Completed"&&R!=null?(O(),_.markActiveTenantFetchCompleted(R)):A==="Error"&&R!=null&&(_.markActiveTenantFetchFailed(R),Z(B.TENANT_FETCHING),Z(B.TENANT_SWITCHING))),j!=="Completed"&&j!=="Error"||(j==="Completed"?_.markAllTenantsFetchCompleted():j==="Error"&&_.markAllTenantsFetchFailed())},[A,j,R,N]);const ie=v.useRef(!1);v.useEffect(()=>{!ie.current&&A==="Completed"&&N&&(ie.current=!0,function(a=Js,b=3e3){setTimeout(()=>{const d=s=>{if(s>=a.length)return;const m=a[s],M=Qs[m];M!=null?M().then(()=>ee(()=>d(s+1))).catch(()=>ee(()=>d(s+1))):d(s+1)};ee(()=>d(0))},b)}())},[A,N]);const C=r?.userRole!=null&&js(r?.userRole),{isFeatureEnabled:Ze}=P(L.isReferralFeatureEnabled),we=r?.userRole!=null&&r.userRole.includes("charge_card_user"),ze=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),F=r?.userRole!=null&&Ee(r.userRole),re=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!C,oe=Be&&!C,Ge=Us(E?.loggedInUserRoleMap),$e=r.externalConnections?.accounting[0]?.isValid,le=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!C,de=ce&&bs(E?.loggedInUserRoleMap),me=Oe&&!C,Ye=r.company!=null&&Ds(r.company),qe=Pe&&Ye===!0&&!C,We=re&&Hs(E?.loggedInUserRoleMap),Ke=oe&&Rs(E?.loggedInUserRoleMap),Qe=me&&ys(E?.loggedInUserRoleMap),Je=fs(E?.loggedInUserRoleMap),Xe=Cs(E?.loggedInUserRoleMap),p=vs(E?.loggedInUserRoleMap),I=Os(E?.loggedInUserRoleMap),T=Ps(E?.loggedInUserRoleMap),g=Fs(E?.loggedInUserRoleMap),x=Ls(E?.loggedInUserRoleMap),ue=re&&g,_e=ce&&x,es=me&&p,ss=qe&&I,ns=oe&&T,as=r.excludedResources?.resources?.find(a=>a.resource==="/invites")!=null||Ne===!0||Ge===!0||Je===!0||Xe===!0;return D.isSignedIn()?R==null?j==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...G.state,message:"...",origin:G.pathname}}):(h!=null&&j!=="In-Progress"&&U(Ae(h.userId,h.zeniSessionId)),null):A!=="In-Progress"&&A!=="Not-Started"||j==="Completed"?(le===!0||K&&!te)&&$e===!1&&u===!1&&$===!1?(i(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!N||le!==!1||te||K?N&&r?.userRole&&u!=null&&$!=null&&o!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Zs,{children:e.jsxs(t,{element:e.jsx(Ws,{}),children:[e.jsx(t,{path:"/",element:e.jsx(xn,{isDashboardAccess:F,isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:T,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,isTenantCardsOnly:$})}),e.jsx(t,{path:"dashboard/*",element:F?e.jsx(on,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:T,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reports/*",element:F?e.jsx(Xs,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:T,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"people/*",element:as||F?e.jsx(sn,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:T,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"forecast/*",element:F?e.jsx(nn,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:T,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(an,{})}),e.jsx(t,{path:"transaction/*",element:F&&C===!1||we||ze?e.jsx(rn,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:T,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"transactions/*",element:F&&C===!1?e.jsx(mn,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:T,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"customer/*",element:F&&C===!1?e.jsx(Ue,{entityType:"customer"}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:T,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isTenantBankingOnly:u,isUserHasTreasuryAccess:I,tenantEmailDomain:o})}),e.jsx(t,{path:"vendor/*",element:F&&C===!1?e.jsx(Ue,{entityType:"vendor"}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:T,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"tasks",element:e.jsx(gn,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(In,{})}),e.jsx(t,{path:"address/*",element:We||de||Qe||Ke?e.jsx(en,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:T,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"checking/*",element:es?e.jsx(cn,{}):e.jsx(y,{})}),e.jsx(t,{path:"treasury/*",element:ss?e.jsx(dn,{}):e.jsx(y,{})}),e.jsx(t,{path:"performance",element:ye?e.jsx(En,{}):e.jsx(He,{tenantEmailDomain:o})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:ve&&C===!1?e.jsx(An,{}):e.jsx(He,{tenantEmailDomain:o})}),e.jsx(t,{path:"notifications/*",element:e.jsx(_n,{})}),e.jsx(t,{path:"vendors/*",element:Ve?e.jsx(tn,{}):e.jsx(y,{})}),e.jsx(t,{path:"bill/*",element:ue?e.jsx(be,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:T,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"bills/*",element:ue?e.jsx(be,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:T,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursement/*",element:_e?e.jsx(De,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:T,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursements/*",element:_e?e.jsx(De,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:T,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"settings/*",element:ke?e.jsx(ln,{hasAdminLevelAccess:de}):e.jsx(y,{})}),e.jsx(t,{path:"cards/*",element:ns?e.jsx(un,{}):e.jsx(y,{})}),e.jsx(t,{path:"rewards/*",element:Ze?e.jsx(pn,{}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo",element:Q?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo/",element:Q?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:Q?e.jsx(Tn,{isFileUploadEnabled:Se}):e.jsx(y,{})}),e.jsx(t,{path:"*",element:e.jsx(y,{})})]})}):null:(i(void 0),e.jsx(c,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),i(void 0),e.jsx(c,{to:"/signin/auth",replace:!0,state:{...G.state,message:"...",origin:G.pathname}}))}const xn=({isDashboardAccess:i,isUserHasZeniAccountsAccess:U,isUserHasChargeCardAccess:S,isUserHasBillPayAccess:o,isUserHasReimbursementAccess:V,isUserHasTreasuryAccess:f,isTenantBankingOnly:O,isTenantCardsOnly:Z})=>O===!0&&U?e.jsx(c,{to:"checking"}):Z===!0?e.jsx(c,{to:"cards"}):i?e.jsx(c,{to:"dashboard"}):U?e.jsx(c,{to:"checking"}):f?e.jsx(c,{to:"treasury"}):S?e.jsx(c,{to:"cards"}):o?e.jsx(c,{to:"bills"}):V?e.jsx(c,{to:"reimbursements"}):e.jsx(c,{to:"dashboard"}),H=({isUserHasZeniAccountsAccess:i,isUserHasChargeCardAccess:U,isUserHasBillPayAccess:S,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:V,isTenantBankingOnly:f,tenantEmailDomain:O})=>f===!0||i?e.jsx(bn,{tenantEmailDomain:O}):V?e.jsx(Un,{tenantEmailDomain:O}):U?e.jsx(Dn,{tenantEmailDomain:O}):S?e.jsx(jn,{tenantEmailDomain:O}):o?e.jsx(hn,{tenantEmailDomain:O}):e.jsx(y,{}),hn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/reimbursements`}),jn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/bills`}),Un=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/treasury`}),bn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/checking`}),Dn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/cards`}),He=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/dashboard`});export{H as FallBackRoute,wn as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-
|
|
1
|
+
import{j as a}from"./liveblocks-BTKJAzKw.js";import{a as p}from"./sentry-BidZRtdZ.js";import{j as _,u as B,h as k,g as h,k as R,l as F,n as X,o as C}from"./core-XIdi9yav.js";import{bn as xe,eO as j,gG as de,KX as Ee,Jk as Ae,jA as ue,lT as we,gI as je,KZ as ve,KY as ke,Nm as Pe,xj as De,BO as Ue,MX as Me,N4 as _e,c1 as W,cG as Te,cH as Be,J1 as Re,Nn as Fe,J2 as Ve,vL as Ne,No as Oe,E2 as Le,Bu as $e,Bl as pe,Bi as Je,vP as ge,Bo as me,Br as fe,Bx as ee,sm as ne,vO as ze,jc as Q,jf as he,Np as Ge,kg as Ke,w2 as Ze,JS as He,JT as qe,ja as Xe,Nq as Qe,jd as Ye,qM as We,Nr as en,Ns as nn,qQ as tn,gi as an,Ja as se,gp as sn,Jb as on,v$ as cn,Nt as rn,Nu as ln,BL as dn,eS as be,eU as Se,Nv as un,fw as pn,Jl as gn,v_ as oe,fB as ie,fA as mn,vZ as fn,fz as hn,fy as bn,Nw as Sn,eX as ye,Nx as yn,Ny as In,w5 as Cn,vY as ce,Nz as xn,fd as En,vV as An,bU as wn,c0 as jn,b$ as vn,bV as kn,bZ as Pn,bY as Dn,bX as Un,b_ as Mn,bW as _n}from"./zeni-epic-state-znLEvSss.js";import{y as te,S as U,z as x,ac as Ie,bB as Tn,c as J,e as Bn,k as V,B as ae,bC as Rn,bD as Fn,an as Vn,f as Ce,bE as Nn,bF as On,bG as Ln,a6 as $n,V as Jn,bH as zn,r as Gn,bI as Kn}from"./index-BFHwjIZ6.js";import{n as M}from"./mui-D-cfPqvW.js";import{M as P}from"./MobileAppDrawer-DrdSJdo1.js";import{a as L,g as $,m as Zn}from"./accountMappingHelper-DpGnVAea.js";import{t as Hn,A as qn}from"./AddressScreen-BmR-OoZ_.js";import T from"./NotFoundScreen-C5GqrkuK.js";import{g as Xn}from"./analyticsHelper-VfNEEHsS.js";import{B as Qn}from"./BusinessVerificationPageScreen-DsFRoHnS.js";import{C as Yn}from"./CompanyPassportScreen-DfcahYi3.js";import{q as re}from"./QBOConnectionScreen-BCkDW1I6.js";import{B as Wn}from"./BillPayApprovalRoutes-CzEk_nhg.js";import{R as et}from"./ReimbursementApprovalRoutes-B6agiTbB.js";import"./recharts-Db9qTggV.js";import"./analytics-Dwe2jubl.js";import"./plaid-_FJLoBl-.js";import"./dnd-C8_bqxJQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-B4nk2ufU.js";import"./lexical-L3dbahzM.js";import"./pdf-vaniLLX-.js";import"./utils-DDxx6oUt.js";import"./routePaths-DYhINZNz.js";import"./empty-CP3zMx39.js";import"./pdf-lib-DNtyO1c9.js";import"./index-DZp35-bi.js";import"./url-B1tfhvRN.js";import"./index-hYoHMc0Z.js";import"./decodeURIComponentSafe-CqshbMyv.js";import"./ReimbursementApprovalRuleDetailScreen-O71vUBoF.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]="141754f2-c264-4b87-ac68-41723230eb79",e._sentryDebugIdIdentifier="sentry-dbid-141754f2-c264-4b87-ac68-41723230eb79")}catch{}})();const nt=M.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,7 +6,7 @@ import{j as a}from"./liveblocks-CfCKAQeM.js";import{a as p}from"./sentry-131ydzJ
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,tt=
|
|
9
|
+
`,tt=R(function(e,s){return{accountMappingView:s.accountMappingView,isFiling1099FeatureEnabled:s.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:s.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:ue(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:Ae(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(e,s){const{navigate:o,location:c,isFiling1099FeatureEnabled:i}=s;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:t,billsAccountSection:r,reimbursementsAccountSection:u,vendorsAccountSection:d,filing1099Section:g}=n,{incomeAccount:f,expenseAccount:m}=t,{billPayAccount:l}=r,{reimbursementsAccount:E}=u,{prepaidExpensesAccount:y,fixedAssetsAccount:w,accruedExpensesAccount:S}=d,{bankAccount:I,expenseCategory1099:N}=g,A=L(s.accountMappingView.incomeAccountList,f.selectedOption),z=L(s.accountMappingView.expenseAccountList,m.selectedOption),G=L(s.accountMappingView.billPayAccountList,l.selectedOption),K=L(s.accountMappingView.reimbursementsAccountList,E.selectedOption),O=$(s.accountMappingView.prepaidExpensesAccountList,y.selectedOptions),b=$(s.accountMappingView.fixedAssetsAccountList,w.selectedOptions),D=$(s.accountMappingView.accruedExpensesAccountList,S.selectedOptions),Z=$(s.accountMappingView.bankAccounts1099FilingAccountList,I.selectedOptions),H=Zn(s.accountMappingView.expenseAccounts1099FilingAccountList,N),q={selectedIncomeAccountId:A?.accountId,selectedExpenseAccountId:z?.accountId,selectedBillPayAccountId:G?.accountId,selectedReimbursementsAccountId:K?.accountId,selectedPrepaidExpensesAccountIds:O.map(v=>v.accountId),selectedFixedAssetsAccountIds:b.map(v=>v.accountId),selectedAccruedExpensesAccountIds:D.map(v=>v.accountId),selectedBankAccounts1099FilingAccountIds:Z.map(v=>v.accountId),selectedExpenseAccounts1099FilingAccountIds:H};e(ke({data:q}))},onBackClick:()=>{Ie(c)===!1?(o("../../dashboard"),e(ve())):e(de())},onSaveClick:()=>{e(je()),i&&J.track(Bn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(we(s.currentTenant.companyId,n))}}})(Tn),at=()=>{const e=_(),s=B(),o=k(),{useFeatureGate:c}=te(),{isFeatureEnabled:i}=c(U.isFiling1099FeatureEnabled),{isFeatureEnabled:n}=c(U.isScheduledJEAccruedExpensesFeatureEnabled),t=x.getSignedInUser(),r=xe(t),u=h(y=>j(y)),[d,g]=p.useState(!1),[f,m]=p.useState(!1);p.useEffect(()=>{d===!1&&(o(de()),g(!0))},[d]);const l=h(y=>Ee(y)),E=y=>{m(y)};return a.jsxs(nt,{children:[a.jsx(P,{isAppContentDrawerOpen:f,handleDrawerToggle:E}),a.jsx(tt,{currentTenant:u,navigate:e,accountMappingView:l,isFiling1099FeatureEnabled:i&&r,isAccruedExpensesFeatureEnabled:n,location:s,isSettings:Ie(s),onClickMenuIcon:()=>E(!0)})]})},st=M.div`
|
|
10
10
|
display: flex;
|
|
11
11
|
height: 100%;
|
|
12
12
|
width: 100%;
|
|
@@ -14,7 +14,7 @@ import{j as a}from"./liveblocks-CfCKAQeM.js";import{a as p}from"./sentry-131ydzJ
|
|
|
14
14
|
flex-direction: column;
|
|
15
15
|
align-items: center;
|
|
16
16
|
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
-
`,ot=
|
|
17
|
+
`,ot=R(function(e,s){const o=j(e),c=Me(e),i=_e(e),n=s.roleMap.bill_pay_admin;return{isDisabled:(W(o?.userRole??[])||n)&&"readonly",billpayApprovalView:c,remiApproverView:i,analytics:J}},function(e,s){const{navigate:o,currentTenant:c}=s;return{onSetupApprovalRulesBillPaySectionClick:()=>{o("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{o("reimbursements/approval-rules")},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}})(Rn),it=()=>{const e=_(),s=B(),o=k(),{tenantEmailDomain:c}=F(),[i,n]=p.useState(!1),[t,r]=p.useState(!1),[u,d]=p.useState(!1),g=h(S=>j(S)),f=h(S=>S.billPaySetupApproverViewState.fetchState),m=h(S=>S.remiSetupApproverViewState.fetchState),l=h(S=>Pe(S)),E=g.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const y=V();p.useEffect(()=>{u||f!=="Not-Started"||(d(!0),o(De(!0)))},[u,f,o]),p.useEffect(()=>{t||m!=="Not-Started"||(r(!0),o(Ue(!0)))},[t,m,o]);const w=S=>{n(S)};return y?.loggedInUserRoleMap!=null?a.jsxs(st,{children:[a.jsx(P,{isAppContentDrawerOpen:i,handleDrawerToggle:w}),a.jsx(ot,{navigate:e,location:s,companyId:E,currentTenant:g,roleMap:y.loggedInUserRoleMap,onClickMenuIcon:()=>{w(!0)}})]}):a.jsx(ae,{fetchState:l.fetchState})},ct=M.div`
|
|
18
18
|
display: flex;
|
|
19
19
|
height: 100%;
|
|
20
20
|
width: 100%;
|
|
@@ -22,7 +22,7 @@ import{j as a}from"./liveblocks-CfCKAQeM.js";import{a as p}from"./sentry-131ydzJ
|
|
|
22
22
|
flex-direction: column;
|
|
23
23
|
align-items: center;
|
|
24
24
|
background-color: ${e=>e.theme.colors.grey4};
|
|
25
|
-
`,rt=
|
|
25
|
+
`,rt=R(function(e,s){const{companyId:o,isZeniAccountEnabled:c,isChargeCardEnabled:i,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:r}=s,u=j(e);return{bankSetupView:Oe(e,o,n,t,c,i,r),connectedAccountProvider:u.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:J}},function(e,s){const{navigate:o,currentTenant:c,companyId:i}=s;return{onFetchLinkTokenClick:(n,t,r)=>{e(ne(t,n,r))},onEstablishConnectionClick:(n,t,r)=>{e(ee(n,i,t,r))},onUpdatePaymentAccountStatus:(n,t,r,u,d)=>{e(fe(n,t,d,u,r))},onUpdatePaymentAccountLoginStatus:(n,t,r,u)=>{e(me(!1,n,u,r,t))},onEstablishConnectionSuccess:(n,t)=>{e(ge(t,n))},onUpdateAccountClick:(n,t,r,u,d)=>{e(d==="paymentAccount"?pe(n,t,r,u):Je(u,n,t))},onUpdatePrimaryFundingAccount:(n,t,r)=>{e($e(i,t,n,r))},onRemoveConnection:n=>{e(Le(n))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}})(Fn),lt=()=>{const e=_(),s=B(),o=k(),{tenantEmailDomain:c}=F(),i=V(),[n,t]=p.useState(!1),[r,u]=p.useState(!1),d=h(I=>j(I)),g=h(I=>I.settingsViewState.bankConnection.fetchState),f=Te(d,i?.loggedInUserRoleMap),m=Be(d,i?.loggedInUserRoleMap),l=Re(d,i?.loggedInUserRoleMap),E=Fe(d,i?.loggedInUserRoleMap),y=Ve(d,i?.loggedInUserRoleMap),w=d.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");p.useEffect(()=>{r||g==="Completed"||(u(!0),o(Ne(!1)))},[r,o,g]);const S=I=>{t(I)};return f||l||m||y?a.jsxs(ct,{children:[a.jsx(P,{isAppContentDrawerOpen:n,handleDrawerToggle:S}),a.jsx(rt,{navigate:e,location:s,companyId:w,currentTenant:d,roleMap:i.loggedInUserRoleMap,isBillPayEnabled:f,isRemiEnabled:m,isZeniAccountEnabled:l,isChargeCardEnabled:y,isTreasuryEnabled:E,onClickMenuIcon:()=>{S(!0)}})]}):a.jsx(T,{})},dt=M.div`
|
|
26
26
|
display: flex;
|
|
27
27
|
height: 100%;
|
|
28
28
|
width: 100%;
|
|
@@ -30,7 +30,7 @@ import{j as a}from"./liveblocks-CfCKAQeM.js";import{a as p}from"./sentry-131ydzJ
|
|
|
30
30
|
flex-direction: column;
|
|
31
31
|
align-items: center;
|
|
32
32
|
background-color: ${e=>e.theme.colors.grey4};
|
|
33
|
-
`,ut=
|
|
33
|
+
`,ut=R(function(e,s){const{companyId:o}=s,c=j(e),i=s.roleMap.bill_pay_admin,n=Ge(e,o),{uiState:t}=n,r=(W(c?.userRole??[])||i)&&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:Ce.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:r,analytics:J}},function(e,s){const{navigate:o,currentTenant:c,companyId:i}=s;return{onFetchLinkTokenClick:(n,t)=>{e(ne("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(ee(n,i,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ge("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,r)=>{e(fe(n,t,"billing","billing_setup",r))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(me(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(pe(n,t,"billing","billing_setup"))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")},handleCreateCardSetupIntent:n=>{e(he(n))},handleConfirmCardSetupIntent:n=>{e(Ye(n))},updateCardPaymentModalState:n=>{e(Qe({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,r)=>{e(Xe(n,t,r))},handleFetchPaymentSources:()=>{e(Q())},resetCardPaymentViewState:()=>{e(qe())},handleResetCardPaymentErrorStatuses:()=>{e(He())},onBillingAddressSave:n=>{e(Ze(n))},onAddressEditHandler:n=>{if(n!=null){const t=Hn(n);e(Ke({addressType:"subscription_billing_address",addressToCreate:t}))}}}})(Nn),pt=()=>{const e=_(),s=B(),o=k(),{tenantEmailDomain:c}=F(),[i,n]=p.useState(!1),[t,r]=p.useState(!1),[u,d]=p.useState(!1),g=h(I=>j(I)),f=h(I=>I.cardPaymentViewState),m=h(I=>I.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),l=Vn(f.addCardPaymentSourceStatus.fetchState),E=f.addCardPaymentSourceStatus.fetchState,y=g.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const w=V();p.useEffect(()=>{y!=null&&o(ze(y,!1))},[y,o]),p.useEffect(()=>{t||(r(!0),o(Q()))},[t,o]),p.useEffect(()=>{u||(he(["card"]),d(!0))},[u]),p.useEffect(()=>{l==="In-Progress"&&E==="Completed"&&o(Q())},[l,E]);const S=I=>{n(I)};return w?.loggedInUserRoleMap!=null?a.jsxs(dt,{children:[a.jsx(P,{isAppContentDrawerOpen:i,handleDrawerToggle:S}),a.jsx(ut,{navigate:e,location:s,companyId:y,currentTenant:g,roleMap:w.loggedInUserRoleMap,onClickMenuIcon:()=>{S(!0)},googleAPIKey:Ce.googleMapsAPIKey})]}):a.jsx(ae,{fetchState:m})},Y="external_integrations",gt=R(function(e){const s=nn(e,Y);return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",notifyMeRegisteredSlugs:new Set(s.map(o=>o.additionalInfo).filter(o=>o!=null))}},function(e,s){const{navigate:o,integrationsView:c,signedInUserEmail:i,tenantEmailDomain:n,tenantId:t}=s;return{onBackClick:()=>{o("../")},onNavigateToDashboard:()=>{o("../dashboard")},onReconnectQBO:()=>{re.init("/connection/auth",n),re.handleClick()},onRefreshClick:()=>{c.integrations.refreshQBO.fetchState!=="In-Progress"&&e(cn())},onSaveChargeBeeCredentials:(r,u)=>{const d=c.externalConnections?.revenue?.find(g=>g.connectionName==="chargebee")?.connectionId;d!=null&&e(sn(t,d,se("revenue"),on("chargebee"),{api_key:r,site:u}))},onConnectHubSpot:(r,u)=>{const d=c.externalConnections?.revenue?.find(g=>g.connectionName==="hubspot")?.connectionId;if(d!=null){const g=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:r,client_secret:u,connection_id:d,redirect_uri:g,tenant_id:t}));const f="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(r)}&scope=${encodeURIComponent(f)}&redirect_uri=${encodeURIComponent(g)}`}},onDisconnect:(r,u)=>{e(an(t,r,se(u)))},onNotifyMe:r=>{e(tn(Y,r,i))}}})(On),mt=()=>{const e=_(),s=k(),{tenantEmailDomain:o}=F(),[c,i]=p.useState(!1),n=h(l=>l.tenantState.fetchState),t=h(l=>j(l)),r=t.companyId??x.getSignedInUserTenant(o)?.companyId,u=x.getSignedInUser(),d=V(),g=W(t.userRole??[]);if(u==null)throw Error("Can't access Integrations page without signing in...");p.useEffect(()=>{s(We(Y))},[s]);const f=l=>{i(l)},m=h(l=>en(l,r));return d?.loggedInUserRoleMap!=null?a.jsxs(ft,{children:[a.jsx(P,{isAppContentDrawerOpen:c,handleDrawerToggle:f}),a.jsx(gt,{navigate:e,onClickMenuIcon:()=>{f(!0)},isAdmin:g,integrationsView:m,signedInUserEmail:u.userEmail??"",tenantEmailDomain:t.tenantEmailDomain??o??"",tenantId:t.tenantId,saveChargeBeeState:m.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:m.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:m.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:m.externalConnections?.saveOAuthConnectionError?.message,deleteConnectionState:m.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:m.externalConnections?.deleteConnectionError?.message,isLoading:n==="In-Progress"})]}):a.jsx(ae,{fetchState:n})},ft=M.div`
|
|
34
34
|
display: flex;
|
|
35
35
|
height: 100%;
|
|
36
36
|
width: 100%;
|
|
@@ -46,7 +46,7 @@ import{j as a}from"./liveblocks-CfCKAQeM.js";import{a as p}from"./sentry-131ydzJ
|
|
|
46
46
|
flex-direction: column;
|
|
47
47
|
align-items: center;
|
|
48
48
|
background-color: ${e=>e.theme.colors.grey4};
|
|
49
|
-
`,bt=()=>{const e=
|
|
49
|
+
`,bt=()=>{const e=k(),{tenantEmailDomain:s}=F(),[o,c]=p.useState(!1),i=h(l=>j(l)).companyId??x.getSignedInUserTenant(s)?.companyId,n=x.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=h(l=>rn(l,n.userId)),r=h(l=>ln(l,i,"bill_pay","user_reimbursement_account")),{plaidConnectionDetails:u}=r,d=l=>{c(l)},g=p.useCallback(l=>{e(ne("user_reimbursement_account",l))},[]),f=p.useCallback(l=>{e(ee(l,i,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},[]);p.useEffect(()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(dn(n.userId))},[n.userId,t.fetchState]);const m=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return a.jsxs(ht,{children:[a.jsx(P,{isAppContentDrawerOpen:o,handleDrawerToggle:d}),a.jsx(Ln,{plaidConnectionDetails:u,isLoading:m,myBankConnectionsView:t,onFetchLinkTokenClick:g,onEstablishConnectionClick:f,onClickMenuIcon:()=>{d(!0)}})]})},St=M.div`
|
|
50
50
|
display: flex;
|
|
51
51
|
height: 100%;
|
|
52
52
|
width: 100%;
|
|
@@ -54,4 +54,4 @@ import{j as a}from"./liveblocks-CfCKAQeM.js";import{a as p}from"./sentry-131ydzJ
|
|
|
54
54
|
flex-direction: column;
|
|
55
55
|
align-items: center;
|
|
56
56
|
background-color: ${e=>e.theme.colors.grey4};
|
|
57
|
-
`,le=({appContent:e})=>{const s=
|
|
57
|
+
`,le=({appContent:e})=>{const s=k(),o=_(),c=B(),[i,n]=p.useState(!1),t=h(b=>j(b)),{tenantEmailDomain:r}=t,u=t.companyId??x.getSignedInUserTenant(r)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:d}=te(),{isFeatureEnabled:g}=d(U.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=d(U.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=d(U.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=d(U.isTreasuryEnabled),E=h(b=>ue(b)),y=be(t),w=Se(m,t),S=!w&&E,I=$n(t,f,m),{areTenantIdsInSync:N}=Jn();p.useEffect(()=>{N&&s(un(u,S))},[u,s,S,N]);const A=h(b=>pn(b,S)),z=A.fetchState==="Not-Started"||A.fetchState==="In-Progress"||u==null,G=gn(t),K=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,O=b=>{n(b)};return a.jsxs(St,{children:[a.jsx(P,{isAppContentDrawerOpen:i,handleDrawerToggle:O}),e!=null?a.jsx(a.Fragment,{children:e}):a.jsx(zn,{myProfileView:A,isAccountingClassesEnabled:E,isReimbursementDisabled:K===!1,isZeniAccountsDisabled:g===!1,isChargeCardDisabled:I===!1,isTreasuryDisabled:l===!1,isLiteRoleDisabled:G===!1,onClickMenuIcon:()=>{O(!0)},isLoading:z,isBankingOnlyTenant:w,isCardsOnlyTenant:y,onAddressClick:b=>{const D=function(H,q){let v=`/${H}/settings/my_profile`;return v=v.concat(`/new/${q}`),v}(r,b),Z=Gn(c.state?.pathnameStackToGoBack,c.pathname);o(D,{state:{pathnameStackToGoBack:Z}})},onGetOtp:b=>{const D={...A.myProfileLocalData,phone:b};s(oe({localData:D})),s(bn(b,"MyProfile"))},onResendOtp:b=>{s(hn(b,"MyProfile"))},onCancelClick:()=>{s(fn())},onSaveClick:()=>{s(ie("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},onVerifyOtp:(b,D)=>{s(mn(b,D,"MyProfile"))},onVerifyOtpSuccess:b=>{b!=null&&x.saveZeniOtpToken(b),s(ie("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},updateMyProfileLocalData:b=>{s(oe({localData:b}))}})]})};function yt(){const e=k(),s=h(l=>j(l)).companyId,o=h(l=>Sn(l)),c=h(l=>ye(l)),i=x.getSignedInUser(),[n,t]=p.useState(!1),r=p.useCallback(l=>{t(l)},[]),u=p.useCallback(l=>{e(yn(l))},[]),d=p.useCallback(()=>{i?.userEmail!=null&&e(In({loggedInUserEmail:i.userEmail}))},[i?.userEmail]),g=p.useCallback(()=>{e(Cn())},[]);if(i==null)throw Error("Can't access Notification Settings page without signing in...");const f=p.useCallback(()=>{const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ce(l,s))},[s,c.notificationSettings.monthEndInsightsNotificationSettings.enabled]),m=p.useCallback(()=>{e(xn())},[]);return p.useEffect(()=>{if(c.fetchState==="Completed"&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"){const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ce(l,s))}},[o.fetchState,s,c.notificationSettings.monthEndInsightsNotificationSettings.enabled,c.fetchState]),a.jsxs(a.Fragment,{children:[a.jsx(P,{isAppContentDrawerOpen:n,handleDrawerToggle:r}),a.jsx(Kn,{notificationSettingsView:o,onFormDataChange:u,onCancel:d,onSave:g,onClickMenuIcon:()=>{r(!0)},signedInUser:i,onRefresh:f,resetUpdateStatus:m})]})}function ea(e){const[s,o]=p.useState(!1),c=h(l=>ye(l)),i=h(l=>j(l)),n=V(),t=x.getSignedInUser(),r=k(),{useFeatureGate:u}=te(),{isFeatureEnabled:d}=u(U.isDebitCardFeatureEnabled),g=t?.userEmail==null||c.fetchState!=="Completed"||En(c.notificationSettings,t.userEmail,d,i);p.useEffect(()=>{c.fetchState!=="In-Progress"&&c.fetchState!=="Completed"&&s===!1&&(o(!0),r(An()))},[c.fetchState,s]);const f=Se(d,i),m=be(i);return c.fetchState!=="In-Progress"&&c.fetchState!=="Not-Started"||g!==!0?wn(i)?a.jsxs(X,{children:[jn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"accounting/*",element:a.jsx(at,{})}),vn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"approval_rules/*",element:a.jsx(It,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),kn(i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"my_bank_connections",element:a.jsx(bt,{})}),Pn(i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"bank_connections",element:a.jsx(lt,{})}),Dn(i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"business_verification",element:a.jsx(Qn,{productType:f?"zeni_accounts":m?"charge_cards":Xn(i,n?.loggedInUserRoleMap)})}),Un(n?.loggedInUserRole??[],i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"company_details",element:a.jsx(Yn,{})}),Mn(n?.loggedInUserRole??[],i)&&a.jsx(C,{path:"billing",element:a.jsx(pt,{})}),_n(n?.loggedInUserRole??[],d,i)&&a.jsx(C,{path:"integrations",element:a.jsx(mt,{})}),a.jsx(C,{path:"my_profile/new/:addressType",element:a.jsx(le,{appContent:a.jsx(qn,{isSubPage:!1})})}),a.jsx(C,{path:"my_profile",element:a.jsx(le,{})}),g&&a.jsx(C,{path:"notifications",element:a.jsx(yt,{})}),a.jsx(C,{path:"*",element:a.jsx(T,{})})]}):a.jsx(X,{children:a.jsx(C,{path:"*",element:a.jsx(T,{})})}):null}function It(e){return a.jsxs(X,{children:[a.jsx(C,{path:"/",element:a.jsx(it,{})}),a.jsx(C,{path:"bills/approval-rules/*",element:a.jsx(Wn,{})}),a.jsx(C,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?a.jsx(et,{}):a.jsx(T,{})}),a.jsx(C,{path:"*",element:a.jsx(T,{})})]})}export{ea as default};
|