@zeniai/web-app-ui 5.1.24-qa → 5.1.25-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-BB0ro6wv.js +1 -0
- package/dist/assets/{AddressScreen-C3We4eyN.js → AddressScreen-t45pXVvS.js} +2 -2
- package/dist/assets/{AiCfoScreen-C6dwBblm.js → AiCfoScreen-7mHfCmdb.js} +1 -1
- package/dist/assets/BillPayApprovalRoutes-DbZZgApj.js +1 -0
- package/dist/assets/{BillPayRoutes-ChzEJIHg.js → BillPayRoutes-DGHURUBB.js} +27 -27
- package/dist/assets/{BusinessVerificationPageScreen-nQv85Uad.js → BusinessVerificationPageScreen-DRR9km69.js} +2 -2
- package/dist/assets/{ChargeCardRoutes-CWvEm_FW.js → ChargeCardRoutes-DSSh6FmN.js} +11 -11
- package/dist/assets/{CompanyPassportScreen-8MMgr-em.js → CompanyPassportScreen-03cd6rew.js} +1 -1
- package/dist/assets/ConnectionAuthScreen-CUXkV4cL.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-DxioIAXi.js +1 -0
- package/dist/assets/CustomerOnboardingRoutes-CJBZR08A.js +23 -0
- package/dist/assets/{DashboardRoutes-BFOprzRu.js → DashboardRoutes-BWWut7Lp.js} +1 -1
- package/dist/assets/{DefaultTenantHome-bwYGUFtt.js → DefaultTenantHome-D0x0VK8i.js} +1 -1
- package/dist/assets/DomesticWireDetailScreen-By9DmOyv.js +18 -0
- package/dist/assets/DrawerScreen-DHM1klM-.js +1 -0
- package/dist/assets/EntityDetailRoutes-CETjyGK7.js +1 -0
- package/dist/assets/ExpenseAutomationRoutes-BMCXnpCB.js +25 -0
- package/dist/assets/{FeaturePreviewScreen-Zo2IVjPv.js → FeaturePreviewScreen-4ttP8nOi.js} +1 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-CNkM-iq3.js +1 -0
- package/dist/assets/MagicLinkRoutes-BKlgQ_Ie.js +72 -0
- package/dist/assets/MagicLinkSignInScreen-CQoHv1Ew.js +12 -0
- package/dist/assets/{MobileAppDrawer-BxSXohph.js → MobileAppDrawer-Biso_61t.js} +1 -1
- package/dist/assets/NotFoundScreen-C0-Skng9.js +1 -0
- package/dist/assets/{NotificationRoutes-B_CBUW39.js → NotificationRoutes-D9fJ9SYM.js} +1 -1
- package/dist/assets/OAuthConsentScreen-C9NM67kC.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-DTh6WUET.js +1 -0
- package/dist/assets/PeopleRoutes-CfzOn3nZ.js +22 -0
- package/dist/assets/PerformanceRoutes-BRNqvpgs.js +1 -0
- package/dist/assets/{Preview-DvwNtgYT.js → Preview-CmzR2zNp.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-M1NooqUL.js → QBOConnectionScreen-CmHLrNN0.js} +1 -1
- package/dist/assets/ReferralListScreen-DGyOm6sF.js +5 -0
- package/dist/assets/ReimbursementApprovalRoutes-CCftKChl.js +1 -0
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-9VzS6BHL.js → ReimbursementApprovalRuleDetailScreen-DYLPHNtr.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-Dq085h3F.js → ReimbursementRoutes-B0uSlLog.js} +5 -5
- package/dist/assets/{ReportsRoutes-C-PynvD8.js → ReportsRoutes-RqLKE5WA.js} +1 -1
- package/dist/assets/RewardsRoutes-COd7r8nd.js +1 -0
- package/dist/assets/ScreenRoutes-nOndy_UK.js +2 -0
- package/dist/assets/{SettingsRoutes-BlIVqT42.js → SettingsRoutes-CzU-HcCn.js} +8 -8
- package/dist/assets/{SetupPagesScreen-D_mOzgH8.js → SetupPagesScreen-Bi9C_-FR.js} +5 -5
- package/dist/assets/{SignInScreen-Bw6-BJcu.js → SignInScreen-BfWJdDbb.js} +1 -1
- package/dist/assets/SignOutScreen-DqrJH-ux.js +9 -0
- package/dist/assets/{TaskListScreen-BI7bNeeY.js → TaskListScreen-Bwwbd5X8.js} +2 -2
- package/dist/assets/TaskRoutes-CBdj5pZX.js +9 -0
- package/dist/assets/{TransactionDetailRoutes-paith4IQ.js → TransactionDetailRoutes-BtVYAo59.js} +1 -1
- package/dist/assets/{TransactionDetailScreen-B4sA-qV9.js → TransactionDetailScreen-BxH3gBsf.js} +2 -2
- package/dist/assets/{TransactionListRoutes-CmERKiR1.js → TransactionListRoutes-DaBzUpfC.js} +1 -1
- package/dist/assets/TreasuryRoutes-opcOBJb-.js +37 -0
- package/dist/assets/{VendorsRoutes-BDaxw0g0.js → VendorsRoutes-Fq7EQRDW.js} +27 -27
- package/dist/assets/WiseConfirmationScreen-C3f57wCu.js +12 -0
- package/dist/assets/ZeniAccountRoutes-2E4c7VWB.js +57 -0
- package/dist/assets/ZeniAccountStatementScreen-CgW4jBMr.js +9 -0
- package/dist/assets/{accountMappingHelper-BeLxsEhj.js → accountMappingHelper-EVwRyhXo.js} +1 -1
- package/dist/assets/{analytics-Dcb_7Yrn.js → analytics-DyffXLrl.js} +1 -1
- package/dist/assets/{analyticsHelper-jFpAmJF-.js → analyticsHelper-tq4PT7c_.js} +1 -1
- package/dist/assets/{core-B01_r_a6.js → core-DYij5xsh.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-BOkChgPc.js → decodeURIComponentSafe-CSUd4Wt5.js} +1 -1
- package/dist/assets/{dnd-aIvu8cuo.js → dnd-BU-7caEQ.js} +1 -1
- package/dist/assets/{empty-DLWGhBLz.js → empty-Bz6RdLl6.js} +1 -1
- package/dist/assets/{empty-DP7Qtv_6.js → empty-zLrsqSwy.js} +1 -1
- package/dist/assets/{emptyVideoElement-mC3LqJrg.js → emptyVideoElement-Cxq76LDO.js} +1 -1
- package/dist/assets/{epic-U_1X8d7m.js → epic-knsZntkZ.js} +1 -1
- package/dist/assets/getLocaleForTenant-DwUbw-k6.js +1 -0
- package/dist/assets/{index-CKvoU8sU.js → index-3OE7eXoF.js} +1 -1
- package/dist/assets/{index-BAIA3LT3.js → index-44V9br91.js} +1 -1
- package/dist/assets/{index-BpLeRKyQ.js → index-BCP41PwF.js} +13079 -12886
- package/dist/assets/{index-B9Boa_Td.js → index-BdURJOvl.js} +2 -2
- package/dist/assets/{index-HFOJdDTm.js → index-C2zxt7CG.js} +1 -1
- package/dist/assets/{index-C7ZZYs3m.js → index-C90tJyPI.js} +1 -1
- package/dist/assets/{index-DEwFeJzq.js → index-CeyemrXI.js} +1 -1
- package/dist/assets/{index-fiqC8vZO.js → index-hKAQTJHr.js} +1 -1
- package/dist/assets/{lexical-CSRsdQQS.js → lexical-eKqIIoQI.js} +1 -1
- package/dist/assets/{liveblocks-CnWjJuBt.js → liveblocks-BiGkkGoP.js} +1 -1
- package/dist/assets/{lottie-DUONjUug.js → lottie-CCiYx5dW.js} +1 -1
- package/dist/assets/{mui-DRaG-BlK.js → mui-CdvNR06J.js} +1 -1
- package/dist/assets/{pathToGoBack-3jAhRKQN.js → pathToGoBack-DzYXGaMH.js} +1 -1
- package/dist/assets/{pdf-UaypZdKm.js → pdf-05F57jtv.js} +3 -3
- package/dist/assets/{pdf-lib-t9AAxY-T.js → pdf-lib-CUEF9aFq.js} +1 -1
- package/dist/assets/{plaid-VN7yDnB4.js → plaid-CsGNESZa.js} +1 -1
- package/dist/assets/{pusher-UqFP2KpO.js → pusher-C7xS39FJ.js} +1 -1
- package/dist/assets/{react-r8LsJVdm.js → react-BcY5rxQv.js} +1 -1
- package/dist/assets/{react-DNgryaI2.js → react-Ce6YQI4l.js} +1 -1
- package/dist/assets/{react-B_Uab5TB.js → react-CltIT5UZ.js} +1 -1
- package/dist/assets/{react-YISROtP4.js → react-D3qjGIuX.js} +1 -1
- package/dist/assets/{react-CFhlJXGh.js → react-hPevf4CC.js} +1 -1
- package/dist/assets/{react-CqO-0SNq.js → react-i6kyX3or.js} +1 -1
- package/dist/assets/{recharts-q0doAU-l.js → recharts-D0oa1BQl.js} +1 -1
- package/dist/assets/{routePaths-DKueXFNV.js → routePaths-jIme_4o7.js} +1 -1
- package/dist/assets/{sentry-1cGDtjwd.js → sentry-DQGl2YSn.js} +1 -1
- package/dist/assets/{url-C9c3hZCp.js → url-DJZEEGtj.js} +1 -1
- package/dist/assets/{url-C_w1-pX_.js → url-DRf0E0e8.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-CJVqvntW.js → useAiCfoDashboardSuggestedQuestionsChips-Duk5q7Ch.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-CVdued0l.js +1 -0
- package/dist/assets/{useDeviceId-DJ_jocMS.js → useDeviceId-Dsh8klAH.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-CQfQwdcJ.js → useInitialThreadRequest-Du_koxHd.js} +1 -1
- package/dist/assets/{utils-Y2cylN27.js → utils-BCjesvPZ.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-DmWmvchE.js → withTransactionSidePanel-DYnpLjtY.js} +3 -3
- package/dist/assets/{zeni-epic-state-BFnJgXOA.js → zeni-epic-state-YenBAkdY.js} +4 -4
- package/dist/index.html +1 -1
- package/package.json +2 -2
- package/dist/assets/AddressRoutes-BXepFj9h.js +0 -1
- package/dist/assets/BillPayApprovalRoutes-CzR07ga7.js +0 -1
- package/dist/assets/ConnectionAuthScreen-Cp9PziKM.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-6YR1UCPF.js +0 -1
- package/dist/assets/CustomerOnboardingRoutes-DDZKUKQ0.js +0 -23
- package/dist/assets/DomesticWireDetailScreen-Ccpt27Jh.js +0 -18
- package/dist/assets/DrawerScreen-Ws0z-NUv.js +0 -1
- package/dist/assets/EntityDetailRoutes-D1mTwT3C.js +0 -1
- package/dist/assets/ExpenseAutomationRoutes-09lBk8XF.js +0 -25
- package/dist/assets/HubSpotOAuthCallbackScreen-Bbw-9Yo-.js +0 -1
- package/dist/assets/MagicLinkRoutes-C3rqh8Fw.js +0 -72
- package/dist/assets/MagicLinkSignInScreen-Bj94YiBV.js +0 -12
- package/dist/assets/NotFoundScreen-9vX5PPUK.js +0 -1
- package/dist/assets/OAuthConsentScreen-BSoh7BaY.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-qhgXCR2A.js +0 -1
- package/dist/assets/PeopleRoutes-rPv0lqG2.js +0 -22
- package/dist/assets/PerformanceRoutes-CIHIO47z.js +0 -1
- package/dist/assets/ReferralListScreen-D9q0zSoM.js +0 -5
- package/dist/assets/ReimbursementApprovalRoutes-Cj_JI2Ho.js +0 -1
- package/dist/assets/RewardsRoutes-3AigZKYG.js +0 -1
- package/dist/assets/ScreenRoutes-Wul9B3xA.js +0 -2
- package/dist/assets/SignOutScreen-BxHMhJ_p.js +0 -9
- package/dist/assets/TaskRoutes-Bz0R6ftk.js +0 -9
- package/dist/assets/TreasuryRoutes-BfNa5UV0.js +0 -37
- package/dist/assets/WiseConfirmationScreen-Cpz-oGtC.js +0 -12
- package/dist/assets/ZeniAccountRoutes-xcG5O_eT.js +0 -57
- package/dist/assets/ZeniAccountStatementScreen-BtTE0JKm.js +0 -9
- package/dist/assets/getLocaleForTenant-DIoHb36m.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-CxSINRsZ.js +0 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import{j as a}from"./liveblocks-BiGkkGoP.js";import{t as $e,A as Ce}from"./AddressScreen-t45pXVvS.js";import Ke from"./NotFoundScreen-C0-Skng9.js";import{a as g}from"./sentry-DQGl2YSn.js";import{h as se,g as oe,u as ie,i as re,j as D,N as E,n as ce,l as ze,o as Me,p as z}from"./core-DYij5xsh.js";import{v as de,A as le,z as B,n as ue,h as qe,c as _,r as V,x as J,d as N,B as je,f as X,ap as Qe,k as Ze,aq as ke,i as te,ar as He,as as Ie,o as Je,at as We,au as Ee,av as Xe}from"./index-BCP41PwF.js";import{bn as Ye,eQ as ee,fh as et,e$ as pe,eZ as me,bt as tt,mV as at,fd as nt,bO as st,jj as ae,jm as ve,JV as ot,bT as it,c2 as ge,sv as fe,sg as rt,Kp as Y,sw as _e,HN as ct,kn as Ue,Kq as Ve,Kr as dt,Ks as lt,Kt as ut,jh as pt,jk as mt,si as Be,su as gt,bE as Te,cv as ft,sI as xe,qp as ht,qd as yt,kf as bt,fF as St,fE as Ct,fD as kt,Ku as It,sa as Et,sJ as Tt,sM as xt,sP as Ot,sV as Pt,cT as At}from"./zeni-epic-state-YenBAkdY.js";import{n as he}from"./mui-CdvNR06J.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-CmHLrNN0.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";import"./empty-zLrsqSwy.js";import"./pdf-lib-CUEF9aFq.js";import"./index-C2zxt7CG.js";import"./url-DRf0E0e8.js";import"./index-3OE7eXoF.js";import"./decodeURIComponentSafe-CSUd4Wt5.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="7bab9640-f08f-4475-81b2-f0473c66a61e",t._sentryDebugIdIdentifier="sentry-dbid-7bab9640-f08f-4475-81b2-f0473c66a61e")}catch{}})();const wt=ce(function(t,s){const o=[];s.isApAgingFeatureEnabled===!1&&o.push("accounts_payable_aging"),s.isArAgingFeatureEnabled===!1&&o.push("accounts_receivable_aging"),s.shouldFetchZeniAccountsPromoCard===!1&&o.push("zeni_accounts_promo_card"),s.shouldFetchRewardsPlanCard===!1&&o.push("rewards_card"),s.isExpenseAutomationEnabledForUser===!1&&o.push("expense_automation_card");const u=nt(t,o,s.signedInUser,s.isExpenseAutomationFeatureEnabledV2,s.isExpenseAutomationEnabledForUser,s.isTreasuryEnabled);return{dashboardFetchState:st(u.reportsInOrder.map(d=>({fetchState:d.fetchState,error:d.error}))).fetchState}},function(t,s){const{themeState:o,navigate:u,location:d}=s;return{onZeniLogoClick:()=>{o.toggle()},onDashboardFetchDone:()=>{const r=V(d.state?.pathnameStackToGoBack,d.pathname);u("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Qe),jt=()=>{const t=se(),s=oe(),o=ie(),u=de(),[d,r]=g.useState(!1),[p,b]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),f=Ye(i),{useFeatureGate:m}=ue(),I=qe(),{isFeatureEnabled:T}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:x}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:k}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:h}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),$=C||U&&f,c=D(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),w=c.company!=null&&et(c.company),R=L&&w,O=D(l=>l.onboardingCustomerViewState.fetchState),S=c.excludedResources,G=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const j=pe(F,c),P=me(c),A=[],Q=S?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,K=S?.resources?.find(l=>l.resource==="/reports/task_card")==null,M=c?.userRole!=null&&tt(c?.userRole),v=S?.resources?.find(l=>l.resource==="/bills")==null&&!M,q=S?.resources?.find(l=>l.resource==="/reimbursements")==null;if(Q===!1&&A.push("top_expenses"),K===!1&&A.push("task_card"),v===!1&&A.push("bill_pay_card","bill_pay_promo_card"),q===!1&&A.push("reimbursement_card","reimbursement_promo_card"),k===!1&&A.push("zeni_accounts_promo_card"),h===!1&&A.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||j||P||(r(!0),o(at(i.userId,G,c.tenantId,!0,!1,A)))},[d,O,j,P,i,c.tenantId,o]),g.useEffect(()=>{(j||P)&&setTimeout(()=>{b(!0)},5e3)},[j,P]),O!=="Completed")return a.jsx(E,{to:"../"});if(O==="Completed"&&p){const l=V(s.state?.pathnameStackToGoBack,s.pathname);if(j)return a.jsx(E,{to:"../../checking",state:{...s.state,pathnameStackToGoBack:l,message:"activation"}});if(P)return a.jsx(E,{to:"../../cards",state:{...s.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(J,{analytics:N,onLoad:l=>(Z=>Z.trackPageLoaded(X.Event.onboardingDashboardActivation))(l)}),a.jsx(wt,{navigate:t,location:s,themeState:u,signedInUser:i,isApAgingFeatureEnabled:T,isArAgingFeatureEnabled:x,shouldFetchZeniAccountsPromoCard:k,shouldFetchRewardsPlanCard:h,isExpenseAutomationEnabledForUser:$,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:R,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(je,{fetchState:"In-Progress",style:{backgroundColor:I.colors.grey5}})},Oe=he.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
height: 100vh;
|
|
4
|
+
background-color: ${t=>t.theme.colors.grey4};
|
|
5
|
+
`,Pe=he.div`
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
align-items: center;
|
|
9
|
+
min-width: calc(100% - ${Ie}px);
|
|
10
|
+
padding-left: ${Ie}px;
|
|
11
|
+
flex: 1;
|
|
12
|
+
|
|
13
|
+
${t=>t.theme.breakpoints.down("md")} {
|
|
14
|
+
width: 100%;
|
|
15
|
+
padding-left: ${Je.sp0};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
${t=>t.windowSize!=="small"?"overflow: auto;":""}
|
|
19
|
+
`,Ae=ce(function(t,s){const{companyId:o,isAdmin:u,currentTenant:d,isOnAddressPage:r}=s,p=B.getSignedInUser(),b=d.tenantId,e={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:b??""},n=ee(t),i=fe(t,o),f=Ve(t),m=ge(d?.userRole??[])&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",I=dt(t.userRoleConfigState);return{onboardingCustomerView:i,analytics:N,isRefreshingViewInBackground:!1,isDisabled:m,companyTitles:I.companyTitles,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",fileProps:{filesEndPoint:We.fileMicroServiceBaseUrl,authParams:e},signedInUser:B.getSignedInUser(),currentTenant:d,isAdmin:u,isOnAddressPage:r,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",cardPaymentView:f,isCardPaymentPopupOpen:!1,stripeKey:te.stripeKey}},function(t,s){const{companyId:o,currentTenant:u,themeState:d,navigate:r,location:p}=s,{tenantEmailDomain:b}=u;return{onFetchLinkTokenClick:(e,n)=>{t(Pt(e,n))},onEstablishConnectionClick:(e,n)=>{t(Ot(e,n))},onUpdatePaymentAccountStatus:(e,n,i)=>{t(xt(e,n,i))},onUpdatePaymentAccountLoginStatus:(e,n)=>{t(Tt(!1,e,n))},onEstablishConnectionSuccess:()=>{t(Et(o,!0,!1))},handleOnConnectClick:()=>{N.trackOnboardingConnectQBO(),ne.handleClick()},updateQBOPopupState:e=>{t(Y({isQBOPopupOpen:e}))},onCompanyOfficerUpdated:e=>{const n=e.map(i=>{const{officerType:f,userId:m,name:I,email:T,ssn:x,nationalityCountryCode:k,dob:h,phone:U,syncToken:C,selectDocument:F,role:$,ownership:c,isSelectedForVerification:L,userVerificationStatus:w,fileIds:R,isPhoneVerified:O}=i;let S;return F.selectDocumentType==="driverLicense"?S="driving_license":F.selectDocumentType==="passport"?S="passport":F.selectDocumentType==="stateId"?S="id_document":F.selectDocumentType==="ssnCard"&&(S="social_security_card"),{officerType:f,userId:m,firstName:I.firstName,lastName:I.lastName,email:T,ssn:x,nationalityCountryCode:k?.selectedOption!=null?Ee(k.selectedOption):void 0,phone:U,birthday:h!=null?Te(h?.toString()):h,syncToken:C,titleAtCompany:$.selectedOption,ownershipInCompany:c,documentTypeSelectedForVerification:S,isSelectedForVerification:L,userVerificationStatus:w,fileIds:R,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1,isPhoneVerified:O}});t(xe({officers:n}))},onGetOtp:(e,n)=>{t(kt(e,"CustomerOnboarding")),n!=null&&t(It({officerType:n,phone:e}))},onResendOtp:e=>{t(Ct(e,"CustomerOnboarding"))},onVerifyOtp:(e,n)=>{t(St(e,n,"CustomerOnboarding"))},updateFilesEntity:e=>{t(bt({files:e}))},onDeleteFile:e=>{t(yt(e))},onEditFileName:(e,n)=>{t(ht(e,n.split(".")[0]))},onCompanyDetailsChanged:e=>{const{companyDescription:n,companyIndustry:i,companyIndustryType:f,companyLegalName:m,companyTaxId:I,companyWebsite:T,companyPhone:x,primaryContactEmail:k,primaryContactName:h,primaryContactUserId:U,primaryContactSyncToken:C,syncToken:F,fileIds:$,typeOfIncorporation:c,stateOfIncorporation:L,incDate:w,companySourceOfFunds:R,companySourceOfFundsDescription:O,companySubIndustry:S,countriesOfOperations:G,purposeOfAccount:j,purposeOfAccountDescription:P,regulatedStatus:A,regulatedStatusDescription:Q,transactionVolume:K,transactionVolumeDescription:M,usNexus:v,usNexusTypes:q}=e,l={companyId:o,companyDescription:n,companyIndustry:i.selectedOption,companyIndustryType:f?.selectedOption??"",companyLegalName:m,taxIdOrEIN:I,website:T!=""&&T!=null?ft(T):void 0,phone:x,syncToken:F,fileIds:$,incDate:w!=null?Te(w?.toString()):w,typeOfIncorporation:c?.selectedOption??"",stateOfIncorporation:L?.selectedOption??"",companySourceOfFunds:R?.selectedOption??"",companySourceOfFundsDescription:O,companySubIndustry:S?.selectedOption??"",countriesOfOperations:G?.selectedOptions.map(H=>H.length===2?H:Ee(H))??[],purposeOfAccount:j?.selectedOption??"",purposeOfAccountDescription:P,regulatedStatus:A??"",regulatedStatusDescription:Q,transactionVolume:K?.selectedOption??"",transactionVolumeDescription:M,usNexus:v,usNexusTypes:q?.selectedOptions??[]},Z={userId:U,firstName:h.firstName,lastName:h.lastName,email:k,syncToken:C};t(xe({companyDetails:l,primaryContactDetails:Z}))},onAddressClick:(e,n)=>{const i=De(b,e,n),f=V(p.state?.pathnameStackToGoBack,p.pathname);r(i,{state:{pathnameStackToGoBack:f}})},onRegisteredAddressClick:(e,n)=>{const i=De(b,e,n),f=V(p.state?.pathnameStackToGoBack,p.pathname);r(i,{state:{pathnameStackToGoBack:f}})},onUpdateCustomerView:(e,n,i)=>{t(gt(o,!1,n,i,e))},onAddressEditHandler:e=>{if(e!=null){const n=$e(e);t(Ue({addressType:"subscription_billing_address",addressToCreate:n}))}},onSkipSetupClick:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);t(Be(o,!1,!1)),r("./activation",{state:{pathnameStackToGoBack:e}})},onUpdateStep:e=>{t(_e({step:e}))},onZeniLogoClick:()=>{d.toggle()},handleLogOutClick:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);r("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleCreateCardSetupIntent:e=>{t(ve(e))},handleConfirmCardSetupIntent:e=>{t(mt(e))},updateCardPaymentModalState:e=>{t(Y({isCardPaymentPopupOpen:e}))},handleAddCardPaymentSource:(e,n,i)=>{t(pt(e,n,i))},handleFetchPaymentSources:()=>{t(ae())},resetCardPaymentViewState:()=>{t(ut())},handleResetCardPaymentErrorStatuses:()=>{t(lt())},redirectToProductSuitePage:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);r(`/${b}/onboarding/thankyou`,{state:{pathnameStackToGoBack:e,message:"OnboardingThankyou"},replace:!0})}}})(He),W=({taxCFOCustomer:t=!1,isOnAddressPage:s=!1,appContent:o})=>{const u=se(),d=oe(),r=ie(),p=Ze(),b=de(),[e,n]=g.useState(!1),[i,f]=g.useState(!1),[m,I]=g.useState(!1),{tenantEmailDomain:T}=re(),x=le(),{useFeatureGate:k}=ue(),{isFeatureEnabled:h}=k(_.isDebitCardFeatureEnabled),U=ze("/:tenantEmailDomain/onboarding")!==null&&d.search?.includes("code"),C=D(y=>y.onboardingCustomerViewState.fetchState),F=D(y=>y.onboardingCustomerViewState.currentStep),$=D(y=>y.onboardingCustomerViewState.uiState),c=D(y=>ee(y)),L=D(y=>y.userRoleConfigState.fetchState),w=D(y=>y.cardPaymentViewState),R=ke(w.addCardPaymentSourceStatus.fetchState),O=w.addCardPaymentSourceStatus.fetchState,{code:S,realmId:G,state:j}=Dt(d.search),P=c.externalConnections?.accounting[0],A=P?.connectionType,Q=P?.connectionName,K=P?.connectionId??"",M=B.getSignedInUser()?.userId??"";g.useEffect(()=>{i||(f(!0),r(ae()))},[i,r]),g.useEffect(()=>{m||(ve(["card"]),I(!0))},[m]),g.useEffect(()=>{R==="In-Progress"&&O==="Completed"&&r(ae())},[R,O]),g.useEffect(()=>{Ft(S,G,j,K,M)===!0&&c.externalConnections?.saveConnectionState!=="In-Progress"&&C==="Completed"&&(r(ot(c.tenantId,{connection_type:A??"accounting",connection_name:Q??"quickbooks_online",authorization_code:S,realm_id:G,connection_id:K,user_id:M},it(window.location.origin+"/onboarding/auth"))),N.trackOnboardingSaveQBOConnection(G,K),u(d.pathname))},[S,G,j,d.pathname,C]),g.useEffect(()=>{ne.isInitiated===!1&&C==="Completed"&&ne.init("/onboarding/auth",c.tenantEmailDomain)},[C]);const v=c.companyId??B.getSignedInUserTenant(T)?.companyId,q=ge(c?.userRole??[]),l=D(y=>fe(y,v));g.useEffect(()=>{e||C!=="Not-Started"||v==null||(n(!0),r(rt(v,!0,!U)))},[e,C,v]),g.useEffect(()=>{c.externalConnections?.saveConnectionState!=="Completed"&&c.externalConnections?.saveConnectionState!=="Error"||!$.isQBOPopupOpen||F!=="qbo_connection"||r(Y({isQBOPopupOpen:!1}))},[c.externalConnections?.saveConnectionState]),g.useEffect(()=>{C==="Completed"&&U&&(r(_e({step:"qbo_connection"})),r(Y({isQBOPopupOpen:!0})))},[U,C]),g.useEffect(()=>{L==="Not-Started"&&r(ct(!0))},[L,r]);const Z=ke(l.companyDetailsLocalData?.addressStatus);g.useEffect(()=>{l.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate==null&&l.companyDetailsLocalData?.addressStatus?.addressToCreate!=null&&Z==null&&r(Ue({addressType:"company_registered_address",addressToCreate:l.companyDetailsLocalData?.addressStatus?.addressToCreate}))},[l.companyDetailsLocalData?.addressStatus?.addressToCreate,l.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate]);const H=l.isInterimEmailSent;if(B.getSignedInUser()==null)throw Error("Can't access onboarding flow without signing in...");const Le=pe(h,c),Re=me(c),ye=c.company?.companyOnboardingInfo.isOnboardingCompleted,be=y=>y.trackPageLoaded(X.Event.onboardingPage),Se=c.productSettings.isOtherProductsEnabled,Ge=c.productSettings.isTreasuryEnabled;if(ye===!0){if(!Se)return Ge?a.jsx(E,{to:"../../treasury"}):Le?a.jsx(E,{to:"../../checking"}):Re?a.jsx(E,{to:"../../cards"}):a.jsx(E,{to:"../../dashboard"});const y=l.updateStatus.fetchState==="In-Progress";if(Se&&!y)return t?a.jsxs(Oe,{children:[a.jsx(J,{analytics:N,onLoad:Ne=>be(Ne)}),a.jsx(Ae,{navigate:u,location:d,companyId:v,currentTenant:c,isAdmin:q,isOnAddressPage:s,themeState:b,googleAPIKey:te.googleMapsAPIKey}),o!=null?a.jsx(Pe,{windowSize:p,children:o}):null]}):a.jsx(E,{to:"../../onboarding/thankyou"})}else if(ye===!1&&x?.loggedInUserRoleMap!=null)return H===!0?a.jsx(E,{to:"../../onboarding/thankyou"}):a.jsxs(Oe,{children:[a.jsx(J,{analytics:N,onLoad:y=>be(y)}),a.jsx(Ae,{navigate:u,location:d,companyId:v,currentTenant:c,isAdmin:q,isOnAddressPage:s,themeState:b,googleAPIKey:te.googleMapsAPIKey}),o!=null?a.jsx(Pe,{windowSize:p,children:o}):null]});return null};function De(t,s,o){let u=`/${t}/onboarding/address`;return u=o!=null?u.concat(`/edit/${s}/${encodeURIComponent(o)}`):u.concat(`/new/${s}`),u}const Fe=he.div`
|
|
20
|
+
display: flex;
|
|
21
|
+
height: 100vh;
|
|
22
|
+
background-color: ${t=>t.theme.colors.grey4};
|
|
23
|
+
`,we=ce(function(t,s){const{companyId:o,currentTenant:u}=s,d=fe(t,o),r=Ve(t);return{hasVerifiedBankAccount:(d.paymentAccount?.providerVerificationStatus?.code?.includes("verified")??!1)||(r.bankAccountsList[0]?.providerVerificationStatus?.code?.includes("verified")??!1),isDisabled:ge(u?.userRole??[])&&d.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",signedInUser:B.getSignedInUser(),currentTenant:u,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(t,s){const{currentTenant:o,themeState:u,navigate:d,location:r}=s,{tenantEmailDomain:p}=o;return{onZeniLogoClick:()=>{u.toggle()},handleLogOutClick:()=>{const b=V(r.state?.pathnameStackToGoBack,r.pathname);d("/signout",{replace:!0,state:{pathnameStackToGoBack:b,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleUpdatePaymentAddressDetailClick:()=>{const b=V(r.state?.pathnameStackToGoBack,r.pathname);d(`/${p}/onboarding/billing/edit`,{state:{pathnameStackToGoBack:b,message:"UpdatePaymentAddressDetail"}})}}})(Xe),vt=()=>{const t=se(),s=ie(),o=oe(),u=de(),{useFeatureGate:d}=ue(),{isFeatureEnabled:r}=d(_.isDebitCardFeatureEnabled),{tenantEmailDomain:p}=re(),b=le(),[e,n]=g.useState(!1);g.useEffect(()=>{e===!1&&o.state?.message==="OnboardingThankyou"&&n(!0)},[o.state]);const i=D(h=>ee(h)),f=i.productSettings.isOtherProductsEnabled;g.useEffect(()=>{s(Be(m,!1,!f))},[]);const m=i.companyId??B.getSignedInUserTenant(p)?.companyId;if(b.loggedInUser==null)throw Error("Can't access onboarding flow without signing in...");const I=pe(r,i),T=me(i),x=D(h=>h.onboardingCustomerViewState.updateStatus.fetchState),k=i.company?.companyOnboardingInfo.isOnboardingCompleted;return k!==!0||f?x==="Completed"&&k===!0&&f&&b?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(J,{analytics:N,onLoad:h=>{h.trackPageLoaded(X.Event.onboardingLandingPage,"Onboarding",At(i.productSettings))}}),a.jsx(we,{navigate:t,showUpdatePaymentDetailButton:f,location:o,companyId:m,currentTenant:i,themeState:u,isVisitingFirstTime:e})]}):x==="Completed"&&k===!1&&b?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(J,{analytics:N,onLoad:h=>{h.trackPageLoaded(X.Event.onboardingInterimPage)}}),a.jsx(we,{navigate:t,showUpdatePaymentDetailButton:f,location:o,companyId:m,currentTenant:i,themeState:u,isVisitingFirstTime:e})]}):a.jsx(je,{fetchState:x}):I?a.jsx(E,{to:"../../checking"}):T?a.jsx(E,{to:"../../cards"}):a.jsx(E,{to:"../../dashboard"})};function sa(){return a.jsxs(Me,{children:[a.jsx(z,{path:"/",element:a.jsx(W,{})}),a.jsx(z,{path:"/billing/edit",element:a.jsx(W,{taxCFOCustomer:!0})}),a.jsx(z,{path:"/thankyou",element:a.jsx(vt,{})}),a.jsx(z,{path:"/activation",element:a.jsx(jt,{})}),a.jsx(z,{path:"/address/edit/:addressType/:addressId",element:a.jsx(W,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(z,{path:"/address/new/:addressType",element:a.jsx(W,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(z,{path:"*",element:a.jsx(Ke,{})})]})}export{sa as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as d}from"./liveblocks-CnWjJuBt.js";import{i as K,j as _,g as H,u as z,h as W,n as te,k as oa,o as gt,p as F}from"./core-B01_r_a6.js";import{eP as U,KJ as Xe,bE as sa,bq as xe,LW as In,i6 as Tn,LX as Nt,LY as xn,i9 as bt,LZ as Qe,L_ as Dn,ie as wn,L$ as $t,M0 as Fn,ij as Ct,M1 as He,M2 as On,cl as St,M3 as Pn,M4 as Mn,L1 as Rn,jc as Bn,M5 as jn,bn as Ge,M6 as ra,Kx as ce,bc as ia,jq as ca,n2 as la,j9 as da,Kz as le,Ky as ee,eO as ua,eU as Ln,fq as kt,M7 as Un,M8 as Gn,M9 as ma,Ma as Re,um as Ye,un as Ve,uK as De,uE as de,ur as Ne,Mb as Yn,Mc as Vn,Md as Nn,Me as pa,Mf as Be,Mg as $n,dE as Je,qY as ha,Mh as zn,Mi as Kn,Mj as qn,Mk as yt,JW as At,jG as we,uS as vt,r4 as Zn,Ml as Qn,uo as zt,q$ as Ie,qX as fa,Mm as ge,Mn as Hn,Mo as Et,JV as It,sY as ga,Mp as Wn,Mq as Xn,Mr as Jn,Ms as Tt,t9 as eo,Mt as to,uq as Kt,sX as ba,Mu as be,Mv as ao,bt as Ca,uW as ka,Mw as no,Mx as oo,My as so,Mz as xt,uR as ro,MA as io,up as qt,uV as _a,MB as Ce,MC as co,MD as lo,ME as Sa,jv as ya,m$ as Aa,jA as va,mZ as Ea,mY as Ia,mX as Ta,sk as uo,fg as mo,cN as po,cO as ho,mU as fo,fc as go,n9 as bo,D_ as Zt,MF as Co,MG as ko,MH as _o,MI as So,b5 as et,f4 as yo,gR as Ao,fG as vo,n3 as Eo,j2 as Io,n0 as To,m_ as xo,e_ as Do,eY as wo}from"./zeni-epic-state-BFnJgXOA.js";import{z as j,a2 as ae,r as D,d as x,D as q,aU as Fo,Z as $e,w as ze,aV as xa,f as N,aW as Oo,k as _e,aX as Da,S as Se,c as R,h as Po,aY as Mo,aZ as Ro,T as wa,J as Fa,a as Oa,W as Bo,a_ as jo,O as Lo,aN as Pa,$ as se,a$ as Ma,b0 as Ra,a1 as Ba,b1 as Uo,b2 as Go,aq as Yo,p as Vo,V as No,b3 as $o,b4 as zo,b5 as Ko,b6 as ke}from"./index-BpLeRKyQ.js";import{n as Dt}from"./mui-DRaG-BlK.js";import{a as b}from"./sentry-1cGDtjwd.js";import{w as ja}from"./withTransactionSidePanel-DmWmvchE.js";import{c as La,t as Fe,f as ue,a as wt,v as qo}from"./routePaths-DKueXFNV.js";import{u as ne}from"./useAskAiCfoHostNavButtonProps-CxSINRsZ.js";import Ue from"./NotFoundScreen-9vX5PPUK.js";import{u as Ft}from"./useInitialThreadRequest-CQfQwdcJ.js";import{t as Ua}from"./analyticsHelper-jFpAmJF-.js";import{C as Zo}from"./CompanyPassportScreen-8MMgr-em.js";import{u as Qo}from"./useAiCfoDashboardSuggestedQuestionsChips-CJVqvntW.js";import{F as Ho}from"./FeaturePreviewScreen-Zo2IVjPv.js";import{R as Wo}from"./ReferralListScreen-D9q0zSoM.js";import"./recharts-q0doAU-l.js";import"./analytics-Dcb_7Yrn.js";import"./plaid-VN7yDnB4.js";import"./dnd-aIvu8cuo.js";import"./stripe-DMRn4zHo.js";import"./lottie-DUONjUug.js";import"./lexical-CSRsdQQS.js";import"./pdf-UaypZdKm.js";import"./utils-Y2cylN27.js";import"./TransactionDetailScreen-B4sA-qV9.js";import"./decodeURIComponentSafe-BOkChgPc.js";import"./MobileAppDrawer-BxSXohph.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]="2284337b-9f6c-4328-9292-f5dd4ae7f49b",e._sentryDebugIdIdentifier="sentry-dbid-2284337b-9f6c-4328-9292-f5dd4ae7f49b")}catch{}})();const Xo=ja(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=_(y=>y.tenantState.currentTenantId),c=_(y=>U(y)),{tenantEmailDomain:m}=K(),g=H(),C=c?.companyName??"",u={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},l=b.useMemo(()=>({authParams:u,companyName:C,downloadEndPoint:`${ae}/agingDetailedReport`,timezone:Xe()}),[]),h=b.useMemo(()=>r!=null?sa(r):xe(),[r]),p=z(),f=W(),A=_(y=>In(y,h,o)),E=b.useCallback(()=>{o!=null&&A.fetchState!=="In-Progress"&&A.fetchState!=="Completed"&&p(Tn(o,h))},[h]),S=b.useCallback(()=>{f("../../",{relative:"path"})},[]),I=b.useCallback((y,M)=>{p(Nt({sortKey:y,sortOrder:M}))},[]),T=b.useCallback(y=>{p(Nt({downloadState:y}))},[]),L=b.useCallback(y=>{if(e)e(y.transactionId,y.transactionType);else if(m!=null){const M=La({id:y.transactionId,type:y.transactionType},m);f(M);const X=D(g.state?.pathnameStackToGoBack,g.pathname);f(M,{state:{pathnameStackToGoBack:X}})}},[m,e]),k=b.useCallback(()=>{A.vendor!=null&&x.trackApAgingDetail("AP Aging",h.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),A.vendor.id,A.vendor.name)},[A.vendor,h]);return b.useEffect(()=>{E()},[]),b.useEffect(()=>{A.fetchState==="Completed"&&k()},[k,A.fetchState]),d.jsx(Fo,{apAgingDetail:A,downloadParams:l,reportDate:h,analytics:x,onTransactionClick:L,onReload:E,onBackClick:S,onColumnSortConfigChanged:I,updateDownloadStateHandler:T,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Jo=()=>{const e=z(),a=W(),t=_(I=>xn(I)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ne({mobileExploreReferrer:"AP Aging"});$e({isDataReady:t.fetchState==="Completed"});const r=j.getSignedInUser(),s=_(I=>I.tenantState.currentTenantId),i=_(I=>U(I)),c=i?.companyName??"",m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},g=b.useMemo(()=>({authParams:m,companyName:c,downloadEndPoint:`${ae}/agingReport`,timezone:Xe()}),[]),C=t.apAgingUIState.selectedDate??xe(),u=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(bt(C))},[]);b.useEffect(()=>{u()},[]);const l=b.useCallback(()=>{a("../",{relative:"path"})},[]),h=b.useCallback(I=>{e(Qe({searchString:I}))},[]),p=b.useCallback((I,T)=>{e(Qe({sortKey:T,sortOrder:I}))},[]),f=b.useCallback(I=>{a(`./${I}/${C.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[C]),A=b.useCallback(I=>{e(Qe({downloadState:I}))},[]),E=b.useCallback((I,T)=>{},[]),S=b.useCallback((I,T)=>{e(Qe({selectedDate:I,agingDateSelectionType:T})),e(bt(I))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(ze,{analytics:x,onLoad:I=>I.trackPageLoaded(N.Event.agingReport,"AP Aging")}):null,d.jsx(xa,{uiState:t.apAgingUIState,report:t,downloadParams:g,analytics:x,onReloadReport:u,onBackClick:l,onSearchTextChange:h,onSortOrderChange:p,onEntityNameClick:f,updateDownloadStateHandler:A,onSelectedDateChanged:S,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},es=ja(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=_(k=>U(k)),{tenantEmailDomain:c}=K(),m=H(),g=i.companyName,C={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},u=b.useMemo(()=>({authParams:C,companyName:g,downloadEndPoint:`${ae}/agingDetailedReport`,timezone:Xe()}),[]),l=b.useMemo(()=>r!=null?sa(r):xe(),[r]),h=z(),p=W(),f=_(k=>Dn(k,l,o)),A=b.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&h(wn(o,l))},[l]),E=b.useCallback(()=>{p("../../",{relative:"path"})},[]),S=b.useCallback((k,y)=>{h($t({sortKey:k,sortOrder:y}))},[]),I=b.useCallback(k=>{h($t({downloadState:k}))},[]),T=b.useCallback(k=>{if(e)e(k.transactionId,k.transactionType);else if(c!=null){const y=La({id:k.transactionId,type:k.transactionType},c);p(y);const M=D(m.state?.pathnameStackToGoBack,m.pathname);p(y,{state:{pathnameStackToGoBack:M}})}},[c,e]),L=b.useCallback(()=>{f.customer!=null&&x.trackArAgingDetail("AR Aging",l.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)},[f.customer,l]);return b.useEffect(()=>{A()},[]),b.useEffect(()=>{f.fetchState==="Completed"&&L()},[f.fetchState,L]),d.jsx(Oo,{arAgingDetail:f,downloadParams:u,reportDate:l,analytics:x,onTransactionClick:T,onReload:A,onBackClick:E,onColumnSortConfigChanged:S,updateDownloadStateHandler:I,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),ts=()=>{const e=z(),a=W(),t=_(S=>Fn(S)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ne({mobileExploreReferrer:"AR Aging"});$e({isDataReady:t.fetchState==="Completed"});const r=j.getSignedInUser(),s=_(S=>U(S)),i=s.companyName,c={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},m=b.useMemo(()=>({authParams:c,companyName:i,downloadEndPoint:`${ae}/agingReport`,timezone:Xe()}),[]),g=t.arAgingUIState.selectedDate??xe(),C=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(Ct(g))},[]);b.useEffect(()=>{C()},[]);const u=b.useCallback(()=>{a("../",{relative:"path"})},[]),l=b.useCallback(S=>{e(He({searchString:S}))},[]),h=b.useCallback((S,I)=>{e(He({sortKey:I,sortOrder:S}))},[]),p=b.useCallback(S=>{a(`./${S}/${g.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[g]),f=b.useCallback(S=>{e(He({downloadState:S}))},[]),A=b.useCallback((S,I)=>{e(He({selectedDate:S,agingDateSelectionType:I})),e(Ct(S))},[]),E=b.useCallback((S,I)=>{e(On({nodeId:S,isCollapsed:I}))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(ze,{analytics:x,onLoad:S=>S.trackPageLoaded(N.Event.agingReport,"AR Aging")}):null,d.jsx(xa,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:x,onReloadReport:C,onBackClick:u,onSearchTextChange:l,onSortOrderChange:h,onEntityNameClick:p,updateDownloadStateHandler:f,onSelectedDateChanged:A,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Ga=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function Ya(e,a){const t=Rn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=Fe(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Bn(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?x.trackZeniAccountsCashBalancePromoClicked("Move Money"):(x.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else x.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const as=te(function(e){const a=Pn(e).accountsInOrder.map((n,o)=>Ga(n,o)),t=Mn(e);return{sectionTitle:q.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:x}},Ya)(Da),ns=te(function(e){const a=jn(e).accountsInOrder.map((o,r)=>Ga(o,r)),t=j.getSignedInUser(),n=Ge(t);return{sectionTitle:q.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:x}},Ya)(Da);function os(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=_e(),o=_(s=>U(s).company?.companyInfo.firstMonthOfFY??1),r=St(n?.loggedInUserRoleMap);return _(s=>s.cashBalanceState.fetchState)==="Error"?d.jsx(Ue,{}):d.jsx(as,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function ss(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=_e(),o=St(n?.loggedInUserRoleMap),r=_(s=>U(s).company?.companyInfo.firstMonthOfFY??1);return _(s=>s.cardBalanceState.fetchState)==="Error"?d.jsx(Ue,{}):d.jsx(ns,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const rs=Dt.div`
|
|
1
|
+
import{j as d}from"./liveblocks-BiGkkGoP.js";import{i as K,j as _,g as H,u as z,h as W,n as te,k as oa,o as gt,p as F}from"./core-DYij5xsh.js";import{eQ as U,KK as Xe,bE as sa,bq as xe,LX as In,i7 as Tn,LY as Nt,LZ as xn,ia as bt,L_ as Qe,L$ as Dn,ig as wn,M0 as $t,M1 as Fn,ik as Ct,M2 as He,M3 as On,cl as St,M4 as Pn,M5 as Mn,L2 as Rn,jd as Bn,M6 as jn,bn as Ge,M7 as ra,Ky as ce,bc as ia,jr as ca,n3 as la,ja as da,KA as le,Kz as ee,eP as ua,eV as Ln,fr as kt,M8 as Un,M9 as Gn,Ma as ma,Mb as Re,un as Ye,uo as Ve,uL as De,uF as de,us as Ne,Mc as Yn,Md as Vn,Me as Nn,Mf as pa,Mg as Be,Mh as $n,dE as Je,qZ as ha,Mi as zn,Mj as Kn,Mk as qn,Ml as yt,JX as At,jH as we,uT as vt,r5 as Zn,Mm as Qn,up as zt,r0 as Ie,qY as fa,Mn as ge,Mo as Hn,Mp as Et,JW as It,sZ as ga,Mq as Wn,Mr as Xn,Ms as Jn,Mt as Tt,ta as eo,Mu as to,ur as Kt,sY as ba,Mv as be,Mw as ao,bt as Ca,uX as ka,Mx as no,My as oo,Mz as so,MA as xt,uS as ro,MB as io,uq as qt,uW as _a,MC as Ce,MD as co,ME as lo,MF as Sa,jw as ya,n0 as Aa,jB as va,m_ as Ea,mZ as Ia,mY as Ta,sl as uo,fh as mo,cN as po,cO as ho,mV as fo,fd as go,na as bo,D$ as Zt,MG as Co,MH as ko,MI as _o,MJ as So,b5 as et,f5 as yo,gS as Ao,fH as vo,n4 as Eo,j3 as Io,n1 as To,m$ as xo,e$ as Do,eZ as wo}from"./zeni-epic-state-YenBAkdY.js";import{z as j,a2 as ae,r as D,d as x,D as q,aU as Fo,Z as $e,x as ze,aV as xa,f as N,aW as Oo,A as _e,aX as Da,n as Se,c as R,h as Po,aY as Mo,aZ as Ro,T as wa,k as Fa,a as Oa,Y as Bo,a_ as jo,O as Lo,aN as Pa,$ as se,a$ as Ma,b0 as Ra,a1 as Ba,b1 as Uo,b2 as Go,aq as Yo,p as Vo,W as No,b3 as $o,b4 as zo,b5 as Ko,b6 as ke}from"./index-BCP41PwF.js";import{n as Dt}from"./mui-CdvNR06J.js";import{a as b}from"./sentry-DQGl2YSn.js";import{w as ja}from"./withTransactionSidePanel-DYnpLjtY.js";import{c as La,t as Fe,f as ue,a as wt,v as qo}from"./routePaths-jIme_4o7.js";import{u as ne}from"./useAskAiCfoHostNavButtonProps-CVdued0l.js";import Ue from"./NotFoundScreen-C0-Skng9.js";import{u as Ft}from"./useInitialThreadRequest-Du_koxHd.js";import{t as Ua}from"./analyticsHelper-tq4PT7c_.js";import{C as Zo}from"./CompanyPassportScreen-03cd6rew.js";import{u as Qo}from"./useAiCfoDashboardSuggestedQuestionsChips-Duk5q7Ch.js";import{F as Ho}from"./FeaturePreviewScreen-4ttP8nOi.js";import{R as Wo}from"./ReferralListScreen-DGyOm6sF.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";import"./TransactionDetailScreen-BxH3gBsf.js";import"./decodeURIComponentSafe-CSUd4Wt5.js";import"./MobileAppDrawer-Biso_61t.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]="dfccd8e7-5c8f-4f2c-9e26-40250f20aff7",e._sentryDebugIdIdentifier="sentry-dbid-dfccd8e7-5c8f-4f2c-9e26-40250f20aff7")}catch{}})();const Xo=ja(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=_(y=>y.tenantState.currentTenantId),c=_(y=>U(y)),{tenantEmailDomain:m}=K(),g=H(),C=c?.companyName??"",u={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},l=b.useMemo(()=>({authParams:u,companyName:C,downloadEndPoint:`${ae}/agingDetailedReport`,timezone:Xe()}),[]),h=b.useMemo(()=>r!=null?sa(r):xe(),[r]),p=z(),f=W(),A=_(y=>In(y,h,o)),E=b.useCallback(()=>{o!=null&&A.fetchState!=="In-Progress"&&A.fetchState!=="Completed"&&p(Tn(o,h))},[h]),S=b.useCallback(()=>{f("../../",{relative:"path"})},[]),I=b.useCallback((y,M)=>{p(Nt({sortKey:y,sortOrder:M}))},[]),T=b.useCallback(y=>{p(Nt({downloadState:y}))},[]),L=b.useCallback(y=>{if(e)e(y.transactionId,y.transactionType);else if(m!=null){const M=La({id:y.transactionId,type:y.transactionType},m);f(M);const X=D(g.state?.pathnameStackToGoBack,g.pathname);f(M,{state:{pathnameStackToGoBack:X}})}},[m,e]),k=b.useCallback(()=>{A.vendor!=null&&x.trackApAgingDetail("AP Aging",h.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),A.vendor.id,A.vendor.name)},[A.vendor,h]);return b.useEffect(()=>{E()},[]),b.useEffect(()=>{A.fetchState==="Completed"&&k()},[k,A.fetchState]),d.jsx(Fo,{apAgingDetail:A,downloadParams:l,reportDate:h,analytics:x,onTransactionClick:L,onReload:E,onBackClick:S,onColumnSortConfigChanged:I,updateDownloadStateHandler:T,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Jo=()=>{const e=z(),a=W(),t=_(I=>xn(I)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ne({mobileExploreReferrer:"AP Aging"});$e({isDataReady:t.fetchState==="Completed"});const r=j.getSignedInUser(),s=_(I=>I.tenantState.currentTenantId),i=_(I=>U(I)),c=i?.companyName??"",m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},g=b.useMemo(()=>({authParams:m,companyName:c,downloadEndPoint:`${ae}/agingReport`,timezone:Xe()}),[]),C=t.apAgingUIState.selectedDate??xe(),u=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(bt(C))},[]);b.useEffect(()=>{u()},[]);const l=b.useCallback(()=>{a("../",{relative:"path"})},[]),h=b.useCallback(I=>{e(Qe({searchString:I}))},[]),p=b.useCallback((I,T)=>{e(Qe({sortKey:T,sortOrder:I}))},[]),f=b.useCallback(I=>{a(`./${I}/${C.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[C]),A=b.useCallback(I=>{e(Qe({downloadState:I}))},[]),E=b.useCallback((I,T)=>{},[]),S=b.useCallback((I,T)=>{e(Qe({selectedDate:I,agingDateSelectionType:T})),e(bt(I))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(ze,{analytics:x,onLoad:I=>I.trackPageLoaded(N.Event.agingReport,"AP Aging")}):null,d.jsx(xa,{uiState:t.apAgingUIState,report:t,downloadParams:g,analytics:x,onReloadReport:u,onBackClick:l,onSearchTextChange:h,onSortOrderChange:p,onEntityNameClick:f,updateDownloadStateHandler:A,onSelectedDateChanged:S,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},es=ja(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=_(k=>U(k)),{tenantEmailDomain:c}=K(),m=H(),g=i.companyName,C={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},u=b.useMemo(()=>({authParams:C,companyName:g,downloadEndPoint:`${ae}/agingDetailedReport`,timezone:Xe()}),[]),l=b.useMemo(()=>r!=null?sa(r):xe(),[r]),h=z(),p=W(),f=_(k=>Dn(k,l,o)),A=b.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&h(wn(o,l))},[l]),E=b.useCallback(()=>{p("../../",{relative:"path"})},[]),S=b.useCallback((k,y)=>{h($t({sortKey:k,sortOrder:y}))},[]),I=b.useCallback(k=>{h($t({downloadState:k}))},[]),T=b.useCallback(k=>{if(e)e(k.transactionId,k.transactionType);else if(c!=null){const y=La({id:k.transactionId,type:k.transactionType},c);p(y);const M=D(m.state?.pathnameStackToGoBack,m.pathname);p(y,{state:{pathnameStackToGoBack:M}})}},[c,e]),L=b.useCallback(()=>{f.customer!=null&&x.trackArAgingDetail("AR Aging",l.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)},[f.customer,l]);return b.useEffect(()=>{A()},[]),b.useEffect(()=>{f.fetchState==="Completed"&&L()},[f.fetchState,L]),d.jsx(Oo,{arAgingDetail:f,downloadParams:u,reportDate:l,analytics:x,onTransactionClick:T,onReload:A,onBackClick:E,onColumnSortConfigChanged:S,updateDownloadStateHandler:I,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),ts=()=>{const e=z(),a=W(),t=_(S=>Fn(S)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ne({mobileExploreReferrer:"AR Aging"});$e({isDataReady:t.fetchState==="Completed"});const r=j.getSignedInUser(),s=_(S=>U(S)),i=s.companyName,c={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},m=b.useMemo(()=>({authParams:c,companyName:i,downloadEndPoint:`${ae}/agingReport`,timezone:Xe()}),[]),g=t.arAgingUIState.selectedDate??xe(),C=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(Ct(g))},[]);b.useEffect(()=>{C()},[]);const u=b.useCallback(()=>{a("../",{relative:"path"})},[]),l=b.useCallback(S=>{e(He({searchString:S}))},[]),h=b.useCallback((S,I)=>{e(He({sortKey:I,sortOrder:S}))},[]),p=b.useCallback(S=>{a(`./${S}/${g.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[g]),f=b.useCallback(S=>{e(He({downloadState:S}))},[]),A=b.useCallback((S,I)=>{e(He({selectedDate:S,agingDateSelectionType:I})),e(Ct(S))},[]),E=b.useCallback((S,I)=>{e(On({nodeId:S,isCollapsed:I}))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(ze,{analytics:x,onLoad:S=>S.trackPageLoaded(N.Event.agingReport,"AR Aging")}):null,d.jsx(xa,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:x,onReloadReport:C,onBackClick:u,onSearchTextChange:l,onSortOrderChange:h,onEntityNameClick:p,updateDownloadStateHandler:f,onSelectedDateChanged:A,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Ga=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function Ya(e,a){const t=Rn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=Fe(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Bn(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?x.trackZeniAccountsCashBalancePromoClicked("Move Money"):(x.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else x.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const as=te(function(e){const a=Pn(e).accountsInOrder.map((n,o)=>Ga(n,o)),t=Mn(e);return{sectionTitle:q.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:x}},Ya)(Da),ns=te(function(e){const a=jn(e).accountsInOrder.map((o,r)=>Ga(o,r)),t=j.getSignedInUser(),n=Ge(t);return{sectionTitle:q.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:x}},Ya)(Da);function os(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=_e(),o=_(s=>U(s).company?.companyInfo.firstMonthOfFY??1),r=St(n?.loggedInUserRoleMap);return _(s=>s.cashBalanceState.fetchState)==="Error"?d.jsx(Ue,{}):d.jsx(as,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function ss(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=_e(),o=St(n?.loggedInUserRoleMap),r=_(s=>U(s).company?.companyInfo.firstMonthOfFY??1);return _(s=>s.cardBalanceState.fetchState)==="Error"?d.jsx(Ue,{}):d.jsx(ns,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const rs=Dt.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex: 1 1 auto;
|
|
4
4
|
min-height: 100%;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as v}from"./liveblocks-
|
|
1
|
+
import{j as v}from"./liveblocks-BiGkkGoP.js";import{a as u}from"./sentry-DQGl2YSn.js";import{u as y,j as b,n as w,g as A,N}from"./core-DYij5xsh.js";import{Jp as U,eQ as _,fp as k,Jq as L,mX as R,Jr as z}from"./zeni-epic-state-YenBAkdY.js";import{u as j,z as f,L as T,t as I,D as O,b as $}from"./index-BCP41PwF.js";import"./mui-CdvNR06J.js";import{t as P}from"./getLocaleForTenant-DwUbw-k6.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="68c6c8f2-48ad-4b53-9bc9-c97dd2b3c715",t._sentryDebugIdIdentifier="sentry-dbid-68c6c8f2-48ad-4b53-9bc9-c97dd2b3c715")}catch{}})();const Q=w(function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:z(t).tenantsInOrder}})(function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=A(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map(l=>l.tenantEmailDomain),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,S=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce((l,F)=>l||i.split("/").find(D=>D===F)!=null,!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,S=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=$(c,p);return v.jsx(N,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:S}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=j(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b(e=>U(e)),n=b(e=>e.tenantState.fetchState),i=b(e=>e.tenantState.error),a=b(e=>e.tenantState.activeTenantFetchState.fetchState),c=b(e=>_(e)),d=f.getSignedInUser();return u.useLayoutEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,h.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)},[a,n]),u.useEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&I.shouldFetchActiveTenant(e)&&(h.current=!0,I.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(k(d.userId,e))))},[n,a,d,t]),u.useEffect(()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,S=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&S&&I.shouldFetchAllTenants()&&(r.current=!0,I.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!L(i))&&t(R(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(O.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(Q,{})}const q=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],J={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of q)if(t.toLocaleLowerCase().includes(s))return J[s]}export{oe as default};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import{j as l}from"./liveblocks-BiGkkGoP.js";import{h as w,g as C,j as h,n as A,i as P}from"./core-DYij5xsh.js";import{Nr as k,Ny as q,fF as K,fE as M,fD as Q,iE as W,Kz as X,qg as J,eQ as V,MZ as D,iC as F,Ns as v,NB as T,iA as G,iX as N}from"./zeni-epic-state-YenBAkdY.js";import{bu as L,k as j,n as R,z as U,h as Z,p,c as S,B as z,bv as Y,o as O,bw as ee,r as te}from"./index-BCP41PwF.js";import{n as H}from"./mui-CdvNR06J.js";import"./sentry-DQGl2YSn.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]="08bbebf8-846d-4aa0-9e97-571ca34c193d",e._sentryDebugIdIdentifier="sentry-dbid-08bbebf8-846d-4aa0-9e97-571ca34c193d")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(W(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(X("common")),n!=null&&e(J(n))},onGetOtp:n=>{e(Q(n,"BillPayVendor"))},onResendOtp:n=>{e(M(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(K(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(q(n,a,o))}}})(L);function _({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(c=>k(c,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=H.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
height: 100vh;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
+
`,oe=A(function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}},function(e,t){const{navigate:n,location:a,vendorId:o}=t;return{onFetchBankName:s=>{e(N(s))},onSaveHandler:s=>{e(G(t.bankAccountContext,s,"standard",o))},onCancel:()=>{(()=>{const s=p(a.state?.pathnameStackToGoBack),c=s.poppedPathname??B();n(c,{state:{pathnameStackToGoBack:s.newStack}})})(),e(v())},onACHDetailsUpdated:s=>{const{bankAccountSection:c}=s;e(T({data:c}))},onBackClick:()=>{if(e(F({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")n("../",{relative:"path"});else{const s=p(t.location.state?.pathnameStackToGoBack),c=s.poppedPathname??B(0);t.navigate(c,{state:{pathnameStackToGoBack:s.newStack}})}e(v())}}})(Y);function fe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=j(),{vendorId:s,billId:c}=P(),d=e??s,{useFeatureGate:r}=R(),i=U.getSignedInUser(),b=h(u=>V(u)),g=Z(),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h(u=>k(u,d)),{isFeatureEnabled:I}=r(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=r(S.isDepositAccountsFeatureEnabled);if(i==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(z,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:g.colors.grey5}}):l.jsxs(ae,{windowSize:o,children:[l.jsx(_,{vendorId:d,billId:c}),l.jsx(oe,{location:a,navigate:n,billId:c,vendorId:d,currentTenant:b,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const B=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t},me=(e,t,n)=>{let a=`/${e}/bill/${encodeURIComponent(t)}`;return n=="draft"&&(a+="/edit"),a},he=e=>`/${e}/bills`,ke=(e,t)=>{let n=`/${e}/bill`;return n=t!=null?n.concat(`/${t}/edit`):n.concat("/new"),n},E=(e,t,n,a)=>{let o=`/${e}/bill`;return o+=n!=null?`/${n}/edit/vendor`:"/new/vendor",o+=a!=null?`/${a}/edit/${t}`:`/create/${t}`,o};function ve(e,t,n){return E(e,"ach",t,n)}function Se(e,t,n){return E(e,"domestic",t,n)}function ge(e,t,n){return E(e,"international",t,n)}const se=(e,t,n)=>{let a=`/${e}/bill/`;return a=n!=null?a.concat(`${encodeURIComponent(n)}/${t}/`):a.concat(`new/${t}/`),a},re=H.div`
|
|
10
|
+
display: flex;
|
|
11
|
+
height: 100vh;
|
|
12
|
+
width: 100%;
|
|
13
|
+
flex: 1 1 auto;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
align-items: center;
|
|
16
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
+
box-shadow: ${e=>`0px 2px ${O.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
18
|
+
`,ce=A(function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}},function(e,t){const{billId:n,navigate:a,location:o,vendorId:s,currentTenant:c}=t,{tenantEmailDomain:d}=c;return{onFetchBankName:r=>{e(N(r))},onSaveHandler:r=>{e(G(t.bankAccountContext,r,"us-domestic",s))},onWireDetailsUpdated:r=>{const{bankAccountSection:i}=r;e(T({data:i}))},onCancel:()=>{(()=>{const r=p(o.state?.pathnameStackToGoBack),i=r.poppedPathname??$();a(i,{state:{pathnameStackToGoBack:r.newStack}})})(),e(v())},onAddressClick:r=>{if(t.bankAccountContext==="express-pay")a("./add-address");else{const i=se(d,r,n),b=te(o.state?.pathnameStackToGoBack,o.pathname);a(i,{state:{pathnameStackToGoBack:b}})}},onBackClick:()=>{if(e(F({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")a("../",{relative:"path"});else{const r=p(t.location.state?.pathnameStackToGoBack),i=r.poppedPathname??$(0);t.navigate(i,{state:{pathnameStackToGoBack:r.newStack}})}e(v())}}})(ee);function xe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=j(),{vendorId:s,billId:c}=P(),d=e??s,r=U.getSignedInUser(),{useFeatureGate:i}=R(),b=Z(),g=h(u=>V(u)),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h(u=>k(u,d)),{isFeatureEnabled:I}=i(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=i(S.isDepositAccountsFeatureEnabled);if(r==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(z,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:b.colors.grey5,boxShadow:`0px 2px ${O.sp1} ${b.colors.dropShadowNormal}`}}):l.jsxs(re,{windowSize:o,children:[l.jsx(_,{vendorId:d,billId:c}),l.jsx(ce,{location:a,navigate:n,billId:c,vendorId:d,currentTenant:g,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const $=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t};export{fe as A,xe as D,_ as V,me as a,se as b,ke as c,Se as d,he as g,ge as i,ve as v};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as i}from"./liveblocks-BiGkkGoP.js";import{k as c,y as l,h as f}from"./index-BCP41PwF.js";import{D as b}from"./mui-CdvNR06J.js";import"./sentry-DQGl2YSn.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]="46aa1f46-1cbc-4db3-8963-3dfca34b6304",e._sentryDebugIdIdentifier="sentry-dbid-46aa1f46-1cbc-4db3-8963-3dfca34b6304")}catch{}})();const p={drawerLeftMargin:new l(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:a,onClose:t}=e,n=c(),s=o?.valuePx(n)??p.drawerLeftMargin.valuePx(n),d=f();return i.jsx(b,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:d.colors.black,opacity:.8,cursor:"pointer"}}},onClose:t,children:a})}export{h as D};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-BiGkkGoP.js";import{a as d}from"./sentry-DQGl2YSn.js";import{h as A,u as B,g as F,i as L,j as c,N as q,n as H,o as N,p as _}from"./core-DYij5xsh.js";import{LG as z,eQ as K,L3 as O,kH as R,HF as k,LL as M,Ky as W,jH as Y,HG as S,L8 as $,L9 as Q,KA as V,Kz as J}from"./zeni-epic-state-YenBAkdY.js";import{aR as U,d as X,p as Z,r as tt}from"./index-BCP41PwF.js";import"./mui-CdvNR06J.js";import{d as b}from"./decodeURIComponentSafe-CSUd4Wt5.js";import{w as et}from"./withTransactionSidePanel-DYnpLjtY.js";import{f as at,c as nt}from"./routePaths-jIme_4o7.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";import"./useAskAiCfoHostNavButtonProps-CVdued0l.js";import"./TransactionDetailScreen-BxH3gBsf.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="5fdf096a-3967-4312-a74a-bbcbc6cf9a17",a._sentryDebugIdIdentifier="sentry-dbid-5fdf096a-3967-4312-a74a-bbcbc6cf9a17")}catch{}})();const ot=H(function(a,t){const e=t.entity,o=M(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:W(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:Y(a)}},function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,l=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:l}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(V({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(J("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a($()),a(Q()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??I();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(k(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(U),it=et(function({entityType:a,...t}){const e=A(),o=B(),l=F(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:j,entityNameEncoded:x}=L(),r=b(j??""),p=b(x??""),f=rt(r,p),G=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=c(n=>z(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),v=c(n=>K(n).company?.companyInfo.firstMonthOfFY??1),u=c(n=>O(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&f===!0&&(T(!0),o(R(i)))},[m,f,i]);const E=c(n=>n.trendState.fetchState),P=u?.selectedPeriod?.timePeriod??g,w=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(u?.selectedPeriod?.timePeriod,g);return d.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&o(k(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),f?s.jsx(ot,{firstMonthOfFY:v,tenantEmailDomain:C,location:l,navigate:e,entity:i,defaultTransactionTimePeriod:w,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(q,{to:I(G.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,I=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function jt({entityType:a}){return s.jsx(N,{children:s.jsx(_,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{jt as EntityDetailRoutes,jt as default};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import{j as S}from"./liveblocks-BiGkkGoP.js";import Fn from"./NotFoundScreen-C0-Skng9.js";import{a,b as wt}from"./sentry-DQGl2YSn.js";import{n as Fe,S as Bn}from"./mui-CdvNR06J.js";import{u as de,h as Pt,g as qe,j as A,n as _n,i as rt,o as Vn,p as Le}from"./core-DYij5xsh.js";import{eQ as Re,Q8 as Mn,n5 as ke,fk as On,qT as jn,nn as xt,nI as Rt,Q9 as Dt,nS as Ln,Qa as Ut,ng as zn,qp as Qn,f4 as fe,Qb as De,sS as Ft,C3 as Bt,Qc as _t,Qd as $n,pZ as Ge,LH as dt,LJ as qn,jK as Gn,LK as Jn,jR as Nn,cV as Kn,tX as Je,nt as Vt,nX as Ue,Qe as Yn,KA as ut,Kz as we,Qf as mt,k6 as Hn,Qg as Zn,Qh as Wn,Qi as Xn,Qj as ea,nA as ta,nl as ue,n_ as Pe,Qk as na,Ql as aa,Qm as oa,o5 as sa,jV as ca,jM as ia,Qn as la,jU as ht,LR as ra,Qo as da,Qp as ua,pV as ma,px as ha,nY as le,pw as ze,Qq as pa,Qr as ga,Qs as Ca,lp as Sa,bq as Ia,lk as pt,l6 as fa,Qt as ka,gU as gt,fV as Ea,lh as va,vQ as ya,Qu as ba,ow as Aa,or as Ta,ov as wa,og as Pa,Qv as xa,f7 as Mt,nL as Ra,nw as Da,fl as Ct,o0 as Ua,Qw as Fa,Qx as Ba,nZ as Ot,Qy as _a,Qz as Va,QA as Ma,QB as Oa,QC as St,q5 as ja,pn as La,Ky as za,QD as Qa,QE as $a,jT as qa,QF as Ga,GB as Ja,jS as Na,jH as Ka,f6 as Ya,oX as jt,pf as Ha,nW as It,n$ as Za,bE as Wa,le as Xa,lb as eo,QG as to,of as ft,pd as kt,pb as no,p0 as ao,oH as oo,pe as so,QH as co,QI as io,oL as lo,QJ as ro,oB as uo,oK as mo,oI as ho,pi as po}from"./zeni-epic-state-YenBAkdY.js";import{n as Lt,c as re,d as L,r as H,W as zt,Z as Qt,cE as go,z as Be,cF as Co,at as xe,cG as So,aT as Et,B as $t,cH as Io,aq as Qe,D as fo,cI as ko,a2 as Eo,cJ as vo,T as yo,cK as bo,cL as Ao,v as To,A as wo,aN as Po,b7 as xo,y as Ro,cM as Do}from"./index-BCP41PwF.js";import{u as qt}from"./useAskAiCfoHostNavButtonProps-CVdued0l.js";import{c as vt,C as Uo}from"./TransactionDetailScreen-BxH3gBsf.js";import{w as Fo}from"./withTransactionSidePanel-DYnpLjtY.js";import{h as Bo,v as _o}from"./routePaths-jIme_4o7.js";import{g as $e}from"./accountMappingHelper-EVwRyhXo.js";import{D as Vo}from"./DrawerScreen-DHM1klM-.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";import"./decodeURIComponentSafe-CSUd4Wt5.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="55723cd3-1e2d-479c-907d-3148bd2b5aa9",t._sentryDebugIdIdentifier="sentry-dbid-55723cd3-1e2d-479c-907d-3148bd2b5aa9")}catch{}})();const Mo=()=>{const t=de(),i=Pt(),T=qe(),f=A(d=>Re(d)),{useFeatureGate:E}=Lt(),{isFeatureEnabled:g}=E(re.isRealtimeInsightsFeatureEnabled),u=A(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),o=A(d=>Mn(d,f.tenantId)),{isAiCfoAccessEnabled:v,onAskAiCfoClick:C}=qt({mobileExploreReferrer:"Month-End Close Overview"}),m=a.useCallback((d,D,K=!1)=>{t(ke({tenantId:D,period:{month:d.month,year:d.year},refreshViewInBackground:K}))},[]),y=a.useCallback(d=>{const D=T.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(d.month,d.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,D??null),t(On(f.tenantId,d))},[f.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),r=u[f.tenantId],_=a.useCallback(()=>{const d=T.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(r.month,r.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),m(r,f.tenantId,!0)},[m,r,f.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),h=H(T.state?.pathnameStackToGoBack,T.pathname),w=a.useCallback(()=>{if(o.monthEndCloseChecks!=null&&r!=null){const d=o.monthEndCloseChecks.monthEndCloseCheckList.find(D=>D.progress<100);if(d!=null)return void i(`./${d.id}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}});i(`./month_end_insights/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}})}},[o.monthEndCloseChecks,r]),{areTenantIdsInSync:I}=zt();return Qt({isDataReady:o.fetchState==="Completed"}),a.useEffect(()=>{r!=null&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&I&&m(r,f.tenantId)},[m,r,o.fetchState,f.tenantId,I]),a.useEffect(()=>{r!=null&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&I&&t(jn(r))},[r,o.monthClosePerformanceTrendFetchStatus.fetchState,I]),a.useEffect(()=>{const d=setInterval(()=>{o.fetchState!=="In-Progress"&&o.fetchState==="Completed"&&_()},3e5);return()=>clearInterval(d)},[o.fetchState]),a.useEffect(()=>{if(o.fetchState==="Completed"&&o.monthEndCloseChecks?.auditSummary!=null){const d=T.state?.referrer;L.trackMonthCloseAuditPage(o.selectedPeriod.month,o.selectedPeriod.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[o.fetchState,o.selectedPeriod,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),S.jsx(Oo,{children:S.jsx(go,{monthEndCloseChecksView:o,isRealtimeInsightsFeatureEnabled:g,onMonthEndCheckClick:d=>{i(`./${d}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:y,handleReviewButtonClick:w,onBackClick:()=>{i("../../dashboard")},onReload:_,isAiCfoAccessEnabled:v,onAskAiCfoClick:C})})},Oo=Fe.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
height: 100vh;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
background-color: ${t=>t.theme.colors.grey4};
|
|
8
|
+
`,jo=wt.memo(({reconciliation:t,selectedDrawerAccountId:i,onClose:T,onFetchLinkTokenClick:f,onEstablishConnectionClick:E})=>{const g=de(),u=Be.getSignedInUser(),o=A(e=>Re(e)),v=t.excludedAccountIDs,C=a.useMemo(()=>({userId:u?.userId??"",sessionId:u?.zeniSessionId??"",tenantId:o?.tenantId??""}),[u?.userId,u?.zeniSessionId,o?.tenantId]),{accountReconciliationsByAccountID:m,monthYearPeriod:y,statementUploadChosen:r}=t,_=m[i],h=_?.accountReconEntity.statementMetaData?.statementUploadId,w=(e,n)=>{g(Qn(e,n.split(".")[0]))},I=e=>{h!=null&&g(zn({accountId:i,selectedPeriod:y,fileId:e,statementUploadId:h}))},d=()=>{g(Dt({statementUploadChosen:!1}))},D=e=>{g(Ln({accountId:i,selectedPeriod:y,payload:e}))},K=e=>{g(Ut({accountId:i,selectedPeriod:y,localData:{accountSource:e}}))},te=a.useCallback(()=>{g(xt({accountId:i}))},[g,i]),V=a.useCallback(()=>{g(Rt({accountId:i}))},[g,i]),U=v.includes(i)?t.excludedAccountReconciliationByAccountID[i]:void 0;return _!=null?S.jsx(yt,{children:S.jsx(bt,{children:S.jsx(Co,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:_,monthYearPeriod:y,onDismissClick:T,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:f,onEstablishConnectionClick:E,onEditFileName:w,onDeleteFile:I,onSelectSourceType:K,filesEndPoint:xe.fileMicroServiceBaseUrl,authParams:C,openFilePicker:r,onStatementUploadSuccess:D,onUploadWindowOpenedOnce:d,onExcludeFromReconciliation:te})})}):U!=null?S.jsx(yt,{children:S.jsx(bt,{children:S.jsx(So,{excludedAccountReconciliation:U,includeAccountFetch:t.includeAccountFetchState,onIncludeIntoReconciliation:V})})}):null}),yt=Fe.div`
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
height: 100%;
|
|
12
|
+
`,bt=Fe.div`
|
|
13
|
+
flex: 1;
|
|
14
|
+
min-height: 0;
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
box-sizing: border-box;
|
|
18
|
+
min-width: 0;
|
|
19
|
+
overflow-x: hidden;
|
|
20
|
+
overflow-y: auto;
|
|
21
|
+
`;function Lo({companyId:t,closeCustomerRequestDrawer:i,addCustomerRequest:T,resetCustomerRequest:f}){const E=Be.getSignedInUser();if(E==null)throw Error("Can't access Customer Request page without signing in...");const g=A(u=>$n(u,t,E));return a.useEffect(()=>{f()},[]),S.jsx(S.Fragment,{children:g.fetchState==="In-Progress"||g.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?S.jsx($t,{fetchState:"In-Progress"}):S.jsx(Io,{onCloseClick:i,addCustomerRequest:T,snippets:g.companyMonthEndReportTemplatesData,bulletPoints:g.zeniRequestsData??[]})})}const zo=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,{common:{strings:{hyphen:Qo,comma:At,space:$o}},dateFormat:Gt}=fo.getLocalizedStrings(),Tt=po,qo=_n(function(t,i){const{uncategorizedAccounts:T,vendorSearchAutoCompleteData:f,monthEndInsightsCustomerRequestData:E,monthEndInsightsPreviewMode:g,companyId:u,isMissingReceiptsBulkUploadEnabled:o,isTransactionActivityEnabled:v}=i,C=Be.getSignedInUser(),m=t.tenantState.currentTenantId,y={userId:C?.userId??"",sessionId:C?.zeniSessionId??"",tenantId:m??""},r=fe(t),{selectedTransactionCategorizationTab:_}=r;return{expenseAutomationViewSelector:r,bulkUploadSelector:o===!0?r.missingReceipts.bulkUpload:void 0,vendorSearchAutoCompleteData:f,authParams:y,receiptUploadEndpoint:`${xe.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${Eo}/transaction_attachments`,bulkUploadEndpoint:o===!0?`${xe.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:_,monthEndInsightsCustomerRequestData:E,monthEndInsightsPreviewMode:g,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:C,uncategorizedAccounts:T,companyId:u,isTransactionActivityEnabled:v}},function(t,i){const{themeState:T,isAccountingClassesEnabled:f,isCOTEnabled:E,isUncategorizedExpenseCategoryEnabled:g,isMissingReceiptsBulkUploadEnabled:u,location:o,vendorSearchAutoCompleteData:v,expenseAutomationViewSelector:C,currentTenant:m,uncategorizedAccounts:y,navigate:r,onClickCustomerRequest:_,handleEditClick:h,setActivityLogTransactionId:w}=i,{selectedPeriod:I,currentSelectedView:d,reconciliation:{selectedAccountId:D}}=C,{accountSettingsView:K}=C.jeSchedules,te=Vt(I),V=Ue(te.start),U=Ue(te.end);return{onZeniLogoClick:()=>{T.toggle()},onUploadReceiptAttachment:e=>{L.trackMissingReceiptAttached(I.month,I.year),t(La(e))},onUploadTransactionReceipt:(e,n,s,l,k,p)=>{t(St(e,n,{fetchState:"In-Progress"}));const b=()=>t(St(e,n,{fetchState:"Error"}));vo(`${xe.accountMicroServiceBaseUrl}/1.0/transactions/${n}/attachments`,p,n,s,l,k).then(P=>{P!=null?t(ja(e,P)):b()}).catch(b)},onMissingReceiptsRowClick:(e,n)=>{if(i.openTransactionPanel)return void i.openTransactionPanel(e,n);const s=H(o.state?.pathnameStackToGoBack,o.pathname);r(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,n)=>{t(Oa(e,n)),m!=null&&t(ke({tenantId:m.tenantId,period:n,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,n,s,l)=>{t(Ma(e,{fetchState:n,error:s})),s!=null&&t(gt({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:l!=null?$o+Qo+l+At:At}]}))},onUpdateJESchedulesUIState:e=>{t(Va(e))},onUpdateMissingReceiptsUIState:e=>{t(_a(e))},onFetchMissingReceiptsList:()=>{U!=null&&V!=null&&t(Ot({start:V,end:U},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...u===!0?{onBulkUploadFiles:e=>{t(ho(e))},onBulkUploadProgress:e=>{t(mo(e))},onBulkUploadSuccess:e=>{t(uo({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(ro(e))},onConfirmBulkUploadMatch:(e,n,s,l,k)=>{t(lo(e,n,s,l,k))},onBulkUploadConfirmMatchAcknowledged:()=>{t(io())},onSetBulkUploadResultsTab:e=>{t(co(e))},onSetBulkUploadCompletedSubTab:e=>{t(so(e))},onSetBulkUploadSortConfig:(e,n)=>{t(kt({sortKey:e,sortOrder:n}))},onClearBulkUpload:()=>{t(oo())},onSearchTransactionsForManualMatch:(e,n)=>{t(Tt(e,n??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=C.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(Tt(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,n)=>{t(ao(e,n))},onFetchBulkUploadBatches:e=>{t(jt(e))},onFetchMoreBatchDetails:()=>{t(no())},onResetBulkUploadSort:()=>{t(kt({sortKey:void 0,sortOrder:void 0}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(Ba())},onSearchTextChanged:e=>{const n=C.currentSelectedView,s=C.selectedTransactionCategorizationTab;n==="transaction_categorization"&&(t(ze({selectedTab:s,uiState:{searchString:e}})),U!=null&&V!=null&&t(le(s,{start:V,end:U},!0,!1,e,void 0,!0)))},onFiltersChange:e=>{const n=C.selectedTransactionCategorizationTab;t(Fa({filters:e,selectedTab:n}))},onRefresh:()=>{i.trackExpenseAutomationTabAnalytics(!0),t(Ua(g))},onClose:()=>{d==="reconciliation"&&D!=null&&t(Ct({selectedAccountId:void 0})),r("../")},onBack:()=>{d==="reconciliation"&&D!=null&&t(Ct({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(Da(e))},onSaveReconciliationReview:e=>{t(Ra(e))},onUpdateStep:e=>{const{selectedPeriod:n}=C,s=H(o.state?.pathnameStackToGoBack,o.pathname);r(`../${e}/${n.month}-${n.year}`,{state:{pathnameStackToGoBack:s,referrer:C.currentSelectedView}}),t(Mt(e))},handleLogOutClick:()=>{const e=H(o.state?.pathnameStackToGoBack,o.pathname);r("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:n}=e,{prepaidExpensesAccount:s,fixedAssetsAccount:l,accruedExpensesAccount:k}=n,p=$e(K.prepaidExpensesAccountList,s.selectedOptions),b=$e(K.fixedAssetsAccountList,l.selectedOptions),P=$e(K.accruedExpensesAccountList,k.selectedOptions),M={selectedPrepaidExpensesAccountIds:p.map(x=>x.accountId),selectedFixedAssetsAccountIds:b.map(x=>x.accountId),selectedAccruedExpensesAccountIds:P.map(x=>x.accountId)};t(xa({data:M}))},onSaveJeAccountSettingsClick:()=>{t(Pa())},onJESchedulesFormDataChange(e,n){const{jeScheduleID:s,accumulatedDepreciationCategory:l,scheduleClass:k,scheduleExpenseCategory:p,vendor:b}=n,{allAccountList:P,allClassList:M,allDepreciationAccountList:x}=C.jeSchedules,Q=v.entityAutoCompleteView.vendor.length>0?v.entityAutoCompleteView.vendor.find($=>$.id===b?.selectedOption):void 0,ne={id:Q?.zeniId??b?.selectedOption??"",name:Q?.name??b?.defaultOptions.find($=>$.value===b?.selectedOption)?.label??"",logo:Q?.logo},ae=p?.selectedOption!=null?P.find($=>$.qboId===p.selectedOption):void 0,Ee=k?.selectedOption!=null?M.find($=>$.classId===k.selectedOption):void 0,oe=l?.selectedOption!=null?x.find($=>$.qboId===l.selectedOption):void 0;t(wa({scheduledJournalEntryID:e,localData:{jeScheduleID:s,scheduledJournalEntryID:e,updatedCategoryId:ae?.accountId,updatedClassId:Ee?.classId,updatedAccumulatedDepreciationCategoryID:oe?.accountId,updatedVendor:{id:ne.id,name:ne.name}}}))},ignoreRecommendedJeSchedule(e,n){t(Ta(e,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,n)=>{e.trim().length>=2?t(ut({searchString:e,entityType:n,searchOrigin:"common"})):e.trim().length===0&&t(we("common"))},onCancelAutoComplete:()=>{t(we("common"))}},onPostJESchedule(e,n){t(Aa({scheduledJournalEntryID:e,jeScheduleTransactionKey:n}))},clearJeScheduleLocalData(){t(ba())},handleJeScheduleClick:(e,n,s)=>{t(ya({selectedJEScheduleKey:n}));const l=H(o.state?.pathnameStackToGoBack,o.pathname);r(`../../vendors/schedules/${s}/details/${e}`,{state:{pathnameStackToGoBack:l,message:"expenseAutomation",origin:"je_schedules"}})},improveMonthEndInsightsUsingZeniGPTClick:e=>{m!=null&&t(va(e,m.companyId,m.tenantId))},onClickCustomerRequest:_,setActivityLogTransactionId:w,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(Ea())},onOpenFileAttachmentSnackBar:()=>{t(gt({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(ka(e))},onUpdateFileAttachment:e=>{t(fa({files:e}))},previewMonthEndReport:(e,n,s,l)=>{m!=null&&t(pt(e,m.companyId,n,!0,s,l,m.tenantId))},saveMonthEndReport:(e,n,s,l)=>{m!=null&&t(pt(e,m.companyId,n,!1,s,l,m.tenantId))},onEditMonthEndInsightsClick:h,sendMonthEndReport:e=>{const n=o.state?.referrer,{selectedPeriod:s,auditSummary:l}=C;m!=null&&l?.auditScorePercentage!=null&&(t(Sa(m.companyId,e,m.tenantId)),L.trackInsightsEmailPage(s.month,s.year,!1,"draft",l.auditScorePercentage,Ia().format(Gt.analytics.MMMDDCommaYYYYformat),n??null))},onTransactionCategorizationRowClick:(e,n)=>{if(i.openTransactionPanel)return void i.openTransactionPanel(e,n);const s=H(o.state?.pathnameStackToGoBack,o.pathname);r(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",origin:"transaction_categorization"}})},setLocalDataForCategoryAndClass:(e,n,s,l,k,p,b,P,M,x,Q,ne,ae)=>{t(Ca(e,n,s,l,y,k,p,b,P,M,x,Q,ne,ae))},onCancelAutoComplete:()=>{t(we("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(mt({scrollPosition:e}))},onUpdateTab:e=>{i.closeSidePanel?.(),U!=null&&V!=null&&(t(le(e,{start:V,end:U},!1,!1)),t(ga(e)))},onUpdateTransactionCategorizationCompletedSubTab:e=>{i.closeSidePanel?.(),U!=null&&V!=null&&(t(pa(e)),t(le("autoCategorized",{start:V,end:U},!1,!1)))},onUpdateTransactionCategorizationUIState:(e,n)=>{t(ze({selectedTab:e,uiState:n})),U!=null&&V!=null&&t(le(e,{start:V,end:U},!1,!1,n.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,n)=>{t(ze({selectedTab:e,uiState:n}))},onFetchTransactionCategorizationList:(e,n,s,l,k,p,b)=>{U!=null&&V!=null&&t(le(e,{start:V,end:U},!0,s,n,l,k,p,b))},resetTransactionCategorizationLocalData:(e,n,s,l,k,p,b,P)=>{t(ha(e,n,s,l,P??null,k,p,!1,b))},updateSelectedVendorForTransaction:(e,n,s,l,k)=>{t(ht({selectedTab:e,transactionId:n,lineId:s,selectedTransaction:l,uncategorizedAccounts:y,updatedVendor:k,isAccountingClassesEnabled:f}))},onSaveUpdateTransactionCategorization:(e,n,s)=>{const l=o.state?.referrer;e==="autoCategorized"?L.trackTransactionsAutoCategorisedPage(I.month,I.year,C.transactionView.totalCountByTab.autoCategorized,n.length,!1,l??null):L.trackTransactionsReviewPage(I.month,I.year,C.transactionView.totalCountByTab.review,n.length,!1,l??null),t(ma(e,n,s,g))},onUpdateSelectedCheckboxTransactionIds:(e,n)=>{t(ua({selectedTab:e,transactionIds:n}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,n,s,l,k,p,b)=>{const{transactionId:P,transaction:M,lineIds:x}=n;p!=null&&t(ra({transactionId:P,customerUpdates:p})),t(da({selectedTab:l,transactionId:P.id,lineId:x[0],selectedTransaction:M,uncategorizedAccounts:y,updatedCustomer:p,selectedEntity:k,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:b})),k!=null&&t(Je(k,e,n,s,!0,E,b))},onFetchRecommendationsForEntityCategorization:(e,n,s,l,k,p,b)=>{const{transactionId:P,transaction:M,lineIds:x}=n;p!=null&&(t(ca({transactionId:P,vendorUpdates:{name:p.name,id:p.id?p.id:void 0}})),t(ia({vendorId:p.id?p.id:void 0,localData:{vendorName:p.name,vendorId:p.id?p.id:void 0}}))),p?.id?(t(ht({selectedTab:l,transactionId:P.id,lineId:x[0],selectedTransaction:M,uncategorizedAccounts:y,updatedVendor:p,selectedEntity:k,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:b})),k!=null&&t(Je(k,e,n,s,!0,E,b))):t(la({selectedTab:l,transactionId:P.id,lineId:x[0]}))},fetchFluxViewOnScroll:(e,n)=>{t(Pe(e,!0,!1,n,!1,!0))},onFetchFluxViewList:()=>{t(Pe(I,!0,!1,null,!1,!1))},markAsReview:(e,n,s,l)=>{L.trackFluxAnalysisReviewed(s.month,s.year,l??!1,e),t(sa(n,e,s,l??!1))},onUpdateFluxAnalysisUIState:e=>{t(oa(e))},updateOperatingExpensesIdsForReview:e=>{t(aa({operatingExpenseIds:e,selectedPeriod:I}))},redirectToVendorDetailPage:e=>{if(i.tenantEmailDomain!=null){const n=_o(e.id,e.qboId,i.tenantEmailDomain),s=H(i.location.state?.pathnameStackToGoBack,i.location.pathname);i.navigate(n,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(na({sectionId:e,selectedPeriod:I}))},onFetchReimbursementView:(e,n,s)=>{t(Pe(e,!0,!1,n,!0,s))},onReviewClicked:e=>{t(ue(I,e))},setOpenDrawerClicked:e=>{t(De({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,n)=>{t(Ft("expense_automation_reconcile",e,n))},onEstablishConnectionClick:(e,n)=>{const s=m?.companyId;s!=null&&(t(Bt(e,s,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",n)),t(_t({accountId:n,connectionInProgress:!0})))},onAddStatementClick:e=>{t(De({selectedDrawerAccountId:e})),t(Ut({accountId:e,selectedPeriod:I,localData:{accountSource:"bank_statement"}})),t(Dt({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(ue(I,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(ta({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,n)=>{t(ea({sortKey:e,sortOrder:n}))},onReconReviewTabColumnSortConfigChanged:(e,n)=>{t(Xn({sortKey:e,sortOrder:n}))},onReconTabUpdate:e=>{i.closeSidePanel?.(),t(Wn({selectedTab:e}))},updateReconReviewTabLocalData:(e,n,s)=>{const l=e.vendor?.id;s&&l!=null&&t(Hn(l)),t(Zn({data:e,transactionId:n}))},onReconMatchedTransactionClick:e=>{if(i.openTransactionPanel)return void i.openTransactionPanel(e,Ge("bill"));const n=H(o.state?.pathnameStackToGoBack,o.pathname);r(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:n,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{r(-1)},onReconListPageScroll:e=>{t(mt({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(ut({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(we("common"))},onReconNodeCollapseToggled:(e,n)=>{t(Yn({nodeId:e,collapsed:n}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(xt({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(Rt({accountId:e}))}}},(t,i,T)=>{const{isMissingReceiptsBulkUploadEnabled:f,...E}=T;return function(g,u,o){return{...g,...u,...o,onUploadTransactionReceipt:(v,C,m,y,r)=>{u.onUploadTransactionReceipt(v,C,m,y,r,g.authParams)}}}(t,i,E)})(ko),Go=Fo(function(t){const i=t.displayName??t.name??"Component",T=wt.memo(t),f=E=>{const g=de(),u=function(){const w=de(),I=A(d=>fe(d).reconciliation.selectedDrawerAccountId);return{isOpen:I!=null,selectedAccountId:I,openPanel:a.useCallback(d=>{w(De({selectedDrawerAccountId:d}))},[w]),closePanel:a.useCallback(()=>{w(De({selectedDrawerAccountId:void 0}))},[w])}}(),o=A(w=>fe(w).reconciliation),v=A(w=>Re(w)),C=a.useCallback((w,I)=>{g(Ft("expense_automation_reconcile",w,I))},[g]),m=a.useCallback((w,I)=>{const d=v?.companyId;d!=null&&(g(Bt(w,d,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",I)),g(_t({accountId:I,connectionInProgress:!0})))},[g,v?.companyId]),y=a.useMemo(()=>{if(u.isOpen&&u.selectedAccountId!=null)return S.jsx(jo,{reconciliation:o,selectedDrawerAccountId:u.selectedAccountId,onClose:u.closePanel,onFetchLinkTokenClick:C,onEstablishConnectionClick:m})},[u.isOpen,u.selectedAccountId,u.closePanel,o,C,m]),r=a.useMemo(()=>({reconPanelContent:y,reconSidePanelIsOpen:u.isOpen,closeReconSidePanel:u.closePanel}),[y,u.isOpen,u.closePanel]),_=a.useContext(Et),h=a.useMemo(()=>u.isOpen?{closePanel:u.closePanel,selectedItemId:u.selectedAccountId}:_,[u.isOpen,u.closePanel,u.selectedAccountId,_]);return S.jsx(Et.Provider,{value:h,children:S.jsx(T,{...E,...r})})};return f.displayName=`withReconSidePanel(${i})`,f}(({closeSidePanel:t,openTransactionPanel:i,panelContent:T,sidePanelIsFullView:f,sidePanelIsOpen:E,reconPanelContent:g,reconSidePanelIsOpen:u,closeReconSidePanel:o})=>{const{isAiCfoOpen:v,setIsAiCfoOpen:C}=yo(),m=bo(),{isOpen:y}=Ao(),r=Pt(),_=qe(),h=de(),{isAiCfoAccessEnabled:w,onAskAiCfoClick:I}=qt({mobileExploreReferrer:"Transaction categorization"}),d=a.useCallback(()=>{E===!0&&f!==!0&&t?.()},[t,E,f]),{areTenantIdsInSync:D}=zt(),K=(()=>{const c=A(q=>fe(q)),j=qe(),{currentSelectedViewFetchState:N,currentSelectedView:O,selectedPeriod:B}=c,Ie=Qe(O),X=Qe(N.fetchState),be=a.useCallback(q=>{const Y=j.state?.referrer;O==="transaction_categorization"&&(c.selectedTransactionCategorizationTab==="review"?L.trackTransactionsReviewPage(B.month,B.year,c.transactionView.totalCountByTab.review,0,q,Y??null):L.trackTransactionsAutoCategorisedPage(B.month,B.year,c.transactionView.totalCountByTab.autoCategorized,0,q,Y??null)),O==="missing_receipts"&&L.trackMissingReceiptsPage(B.month,B.year,q,c.missingReceipts.transactions.length,Y??null),O==="je_schedules"&&L.trackMonthCloseScheduleListPage(B.month,B.year,q,c.jeSchedules.draftSchedules.length,c.jeSchedules.resolveSchedules.length,Y??null),O==="flux_analysis"&&L.trackFluxAnalysisPage(B.month,B.year,q,zo(c.fluxAnalysis),Y??null),O==="month_end_insights"&&c.auditSummary?.auditScorePercentage!=null&&L.trackInsightsEmailPage(B.month,B.year,q,"draft",c.auditSummary.auditScorePercentage,null,Y??null)},[B,c]);return a.useEffect(()=>{X===N.fetchState&&O===Ie||N.fetchState!=="Completed"||be(!1)},[O,N.fetchState,Ie]),be})(),te=To(),[V,U]=a.useState(!1),e=A(c=>dt(c)),n=A(c=>Re(c)),[s,l]=a.useState(!1),[k,p]=a.useState(!1),[b,P]=a.useState([]),[M,x]=a.useState(void 0),Q=a.useCallback(c=>{c!=null&&(v&&C(!1),m(),d()),x(c)},[d,v,m,C]),ne=a.useCallback(()=>{m(),x(void 0),d(),I()},[d,I,m]),ae=a.useRef(v);a.useEffect(()=>{v===!0&&ae.current===!1&&(m(),x(void 0),d()),ae.current=v},[d,v,m]);const Ee=a.useRef(y);a.useEffect(()=>{y===!0&&Ee.current===!1&&(v&&C(!1),x(void 0),E===!0&&f!==!0&&t?.()),Ee.current=y},[t,y,v,C,f,E]);const oe=E===!0&&f!==!0,$=a.useRef(oe);a.useEffect(()=>{oe&&!$.current&&(v&&C(!1),m(),x(void 0)),$.current=oe},[v,oe,m,C]);const[Ne,Jt]=a.useState(!1),Ke=a.useRef(!1),{selectedTab:Ye}=rt(),{tenantEmailDomain:Nt}=rt(),[_e,He]=a.useState(_.state?.message==="comingFromTransactionDetail"),Ze=_.state?.message==="comingFromOverview",Kt=wo(),Ve=Be.getSignedInUser(),{useDynamicConfig:Yt,useFeatureGate:me}=Lt(),{configValue:Ht}=Yt(Po.enableUncategorizedExpenseCategory),Z=Ht?.uncategorized_expense_category_enabled===!0,{isFeatureEnabled:We}=me(re.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:he}=me(re.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:Xe}=me(re.isTransactionActivityEnabled),{isFeatureEnabled:Zt}=me(re.isExpenseAutomationCommentingEnabled),{isFeatureEnabled:Wt}=me(re.isProjectsTransactionsEnabled),Xt=a.useCallback(c=>{const j=Ge(c.view==="reconciliation"?"bill":"expense");i?.(c.entityId,j)},[i]),en=A(c=>za(c,"common")),z=A(c=>fe(c)),{categoryOptions:tn,paymentAccountNames:nn}=A(c=>Qa(c.accountState)),an=A(c=>$a(c.classState)),{monthEndCloseChecksView:J,currentSelectedView:R,selectedPeriod:F,selectedTransactionCategorizationTab:se,currentSelectedViewBackgroundRefreshFetchState:on,currentSelectedViewFetchState:W,jeSchedules:Me,reconciliation:sn}=z;a.useEffect(()=>{R==="transaction_categorization"&&E!==!0||Q(void 0)},[R,Q,E]);const ve=a.useRef(null);a.useEffect(()=>{ve.current!==null?ve.current!==se&&(ve.current=se,R==="transaction_categorization"&&Q(void 0)):ve.current=se},[R,se,Q]);const cn=A(c=>M==null?void 0:qa(c.transactionState,M)),ce=cn?.qboId,ln=A(c=>ce==null?void 0:Ga(c,ce));a.useEffect(()=>{ce!=null&&h(Ja(ce))},[h,ce]);const{selectedAccountId:pe}=sn,et=Qe(Me.accountSettingsView.saveState.fetchState),rn=A(c=>Na(c.accountState,c.accountListState,"accountList")),dn=A(c=>Ka(c)),ge=Ye!=null?Ya(Ye):R,un=A(c=>c.entityAutoCompleteState.autoCompleteText.common);if(Qt({isDataReady:W.fetchState==="Completed"}),Ve==null)throw Error("Can't access expense automation screen without signing in...");const tt=Vt(F),Ce=Ue(tt.start),Se=Ue(tt.end);if(Ce==null||Se==null)throw Error(`Invalid start - ${Ce} and end - ${Se} period from given ${F}`);const mn=a.useCallback(()=>{l(!1)},[]),hn=a.useCallback(()=>{p(!0)},[]),pn=a.useCallback(c=>{P(c),p(!1)},[]),gn=a.useCallback(()=>{P([])},[]),ye=z.missingReceipts.bulkUpload.phase,nt=z.missingReceipts.bulkUpload.currentBatchId;a.useEffect(()=>{he===!0&&R==="missing_receipts"&&ye==="matching"&&nt!=null&&h(jt({cacheOverride:!0}))},[he,R,ye,nt,h]);const at=Ve?.userId,Cn=F.month,Sn=F.year,ot=n?.tenantId;a.useEffect(()=>{R==="missing_receipts"&&he!==!1&&ye==="idle"&&at!=null&&ot!=null&&h(Ha())},[R,he,ye,at,ot,Cn,Sn,h]),a.useEffect(()=>{e.newVendorState?.vendorDetailLocalData?.vendorName!=null?U(!0):U(!1)},[e.newVendorState?.vendorDetailLocalData?.vendorName]),a.useEffect(()=>{ge!=null&&R!==ge&&h(Mt(ge))},[ge]),a.useEffect(()=>{Ne!==!1||W.fetchState!=="Completed"&&W.fetchState!=="Error"||!D||(Jt(!0),h(It(!1,!1,Z)))},[Ne,W,D,Z]),a.useEffect(()=>{!Ze&&D&&(h(It(!1,!1,Z)),h(ue(F,pe,!1,!1)))},[F.month,F.year,D,Z]);const st=a.useCallback((c=!1,j=!1)=>{const N={start:Ce,end:Se};switch(R){case"transaction_categorization":h(le(se,N,c,!_e,void 0,void 0,j,void 0,Z)),He(!1);break;case"flux_analysis":h(Pe(F,c,j,null));break;case"month_end_insights":if(j===!1){const O=new Date(F.year,F.month,0),B=Wa(O.toDateString()).format(Gt.analytics.YYYYDashMMDashDDFormat);h(Xa(!0,n.companyId,n.tenantId,B)),h(eo(n.companyId,n.tenantId))}break;case"je_schedules":h(Za(N,j));break;case"missing_receipts":h(Ot(N,{amount:75,currencyCode:"USD",currencySymbol:"$"},c,j));break;default:h(ue(F,pe,c,j))}},[R,Ce,Se,n.companyId,n.tenantId,se,F,pe,_e,He,Z]);a.useEffect(()=>{R===ge&&W.fetchState==="Not-Started"&&D&&st(!0)},[W,Ce,Se,n.companyId,n.tenantId,D]),a.useEffect(()=>{Ze||_e||Ke.current||on.fetchState==="In-Progress"||W.fetchState!=="Completed"||(Ke.current=!0,st(!0,!0))},[]),a.useEffect(()=>{J.fetchState!=="In-Progress"&&J.fetchState!=="Completed"&&h(ke({tenantId:n.tenantId,period:F,refreshViewInBackground:!1}))},[J.fetchState,n.tenantId]),a.useEffect(()=>{z.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?l(!0):l(!1)},[z.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),a.useEffect(()=>{z.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&D&&(h(ke({tenantId:n.tenantId,period:F,refreshViewInBackground:!0})),h(to({companyId:n.companyId})),r("../"))},[z.monthEndInsights?.sendMonthEndReportStatus?.fetchState,n.tenantId,F,n.companyId,D]),a.useEffect(()=>{const c=setInterval(()=>{J.fetchState!=="In-Progress"&&J.fetchState==="Completed"&&h(ke({tenantId:n.tenantId,period:F,refreshViewInBackground:!0}))},3e5);return()=>clearInterval(c)},[J.fetchState,n.tenantId,F,h]),a.useEffect(()=>{const c=setInterval(()=>{R==="reconciliation"&&pe==null&&z.reconciliation.fetchStatus.fetchState==="Completed"&&z.reconciliation.refreshStatus.fetchState!=="In-Progress"&&h(ue(F,void 0,!0,!0))},3e5);return()=>clearInterval(c)},[R,h,z.reconciliation.fetchStatus.fetchState,z.reconciliation.refreshStatus.fetchState,ue,pe,F]);const In=vt();a.useEffect(()=>{const c=(J.monthEndCloseChecks?.monthEndCloseCheckList.find(j=>j.id==="month_end_insights")?.isDisabled??!1)&&!We;R!=="month_end_insights"||!c&&J.monthEndCloseChecks?.reportEmailSentDate==null||r("../")},[R,J.monthEndCloseChecks]);const fn=u===!0?g:T,kn=u===!0||E===!0,En=u===!0?o:t;a.useEffect(()=>{et==="In-Progress"&&Me.accountSettingsView.saveState.fetchState==="Completed"&&h(ft())},[et,Me.accountSettingsView.saveState.fetchState,ft]);const{transactionId:ct,onSaveVendor:vn,onSaveSuccess:yn,onCancel:bn,vendorViewDetails:An}=(({expenseAutomationViewSelector:c,closeDrawerHandler:j,currentSelectedView:N})=>{const O=de();let B,Ie,X;const be=vt(),q=c.transactionView;let Y=()=>{};const{transactions:Tn,selectedTransactionId:ie,selectedTransactionLineId:Ae,transactionLocalData:wn}=q;if(N==="transaction_categorization"){const Oe=wn.find(ee=>ee.transactionId===ie),G=Tn.find(ee=>ee.id===ie),it=Ae!=null?Oe?.transactionReviewLocalData?.lineItemById[Ae]:void 0,lt=it?.account;Ie=it?.class?.classId,B=["Uncategorized Income","Uncategorized Expense"].includes(lt?.accountName??"")?void 0:lt?.accountId;const xn=Bo(ie,G?.typeOfTransaction);G!=null&&xn&&(X={id:ie,type:Ge(G.typeOfTransaction)}),Y=()=>{if(ie!=null&&Ae!=null&&G!=null){const ee=q.transactionLocalData.find(Te=>Te.transactionId===ie)?.transactionReviewLocalData;if(ee!=null&&G.lines!=null&&G.lines.length>0){const Te=ee.lineItemById[Ae];let je=ee.selectedEntity;if(Kn(G)||(je=Te.selectedEntityLine),je!=null){const Rn=je,Dn={transactionId:{id:G.id,type:G.type},transaction:G,lineIds:G.lines.map(Un=>Un.id)??[]};O(Je(Rn,Te.amount.amount,Dn,!1,!0,be))}}}}}const Pn=A(Oe=>dt(Oe,void 0,B,Ie));return{transactionId:X,onSaveVendor:()=>{O(Nn(X,void 0,!1,!0))},onSaveSuccess:Y,onCancel:()=>{X!=null&&O(qn({transactionId:X})),O(Gn()),O(Jn()),j()},vendorViewDetails:Pn}})({expenseAutomationViewSelector:z,closeDrawerHandler:()=>{U(!1)},currentSelectedView:R});return Kt?.loggedInUserRoleMap==null?J.fetchState==="Error"?S.jsx(xo,{onGoHome:()=>r("../",{replace:!0}),onReload:()=>window.location.reload()}):S.jsx($t,{fetchState:"In-Progress"}):S.jsxs(S.Fragment,{children:[S.jsx(Vo,{isOpen:k,drawerLeftMargin:new Ro(0,0,300,650),onClose:()=>{p(!1)},children:S.jsx(Jo,{onClick:c=>c.stopPropagation(),children:S.jsx(Lo,{companyId:n.companyId,closeCustomerRequestDrawer:()=>p(!1),addCustomerRequest:pn,resetCustomerRequest:gn})})}),ct!=null&&V&&S.jsx(Uo,{isOpen:V,transactionId:ct,onSaveVendor:vn,onSaveSuccess:yn,onCancel:bn,vendorViewDetails:An}),S.jsx(qo,{navigate:r,location:_,themeState:te,categoryOptions:tn,classesForFilters:an,accountsForFilters:nn,vendorSearchAutoCompleteData:{autoCompleteText:un,entityAutoCompleteView:en},expenseAutomationViewSelector:z,isMissingReceiptsBulkUploadEnabled:he,monthEndInsightsPreviewMode:s,monthEndInsightsCustomerRequestData:b,isRealtimeInsightsFeatureEnabled:We,isUncategorizedExpenseCategoryEnabled:Z,isAccountingClassesEnabled:dn,isProjectsTransactionsEnabled:Wt,isCOTEnabled:In,currentTenant:n,companyId:n.companyId,signedInUser:Ve,isTransactionActivityEnabled:Xe,activityLogTransactionId:R==="transaction_categorization"?M:void 0,activityLogPanel:R==="transaction_categorization"&&Xe===!0&&M!=null?S.jsx(Do,{activityLogView:ln,qboId:ce,onClose:()=>Q(void 0),selectedTransactionId:M},String(M)):null,uncategorizedAccounts:rn,onClickCustomerRequest:hn,handleEditClick:mn,tenantEmailDomain:Nt,trackExpenseAutomationTabAnalytics:K,setActivityLogTransactionId:Q,closeSidePanel:En,openTransactionPanel:i,sidePanelIsOpen:kn,sidePanelIsFullView:u!==!0&&f,panelContent:fn,isAiCfoAccessEnabled:w,onAskAiCfoClick:ne,isExpenseAutomationCommentingEnabled:Zt,onExpenseAutomationCommentingThreadClick:Xt,sidePanelListPercent:u===!0?66:void 0})]})})),Jo=Fe(Bn)`
|
|
22
|
+
display: flex;
|
|
23
|
+
min-height: 100%;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
`;function Cs(){return S.jsxs(Vn,{children:[S.jsx(Le,{path:"*",element:S.jsx(Mo,{})}),S.jsx(Le,{path:"/:selectedTab/:selectedPeriod/*",element:S.jsx(Go,{})}),S.jsx(Le,{path:"*",element:S.jsx(Fn,{})})]})}export{Cs as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-
|
|
1
|
+
import{j as s}from"./liveblocks-BiGkkGoP.js";import{a as r}from"./sentry-DQGl2YSn.js";import{a3 as f,a4 as l,a5 as p,p as m}from"./index-BCP41PwF.js";import"./mui-CdvNR06J.js";import c from"./NotFoundScreen-C0-Skng9.js";import{h as u,g as b}from"./core-DYij5xsh.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]="720da2d7-8f85-4925-8f09-ee6187521283",e._sentryDebugIdIdentifier="sentry-dbid-720da2d7-8f85-4925-8f09-ee6187521283")}catch{}})();const _=()=>{const e=u(),a=b(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),d=r.useCallback(()=>{(()=>{const n=m(a.state?.pathnameStackToGoBack),i=n.poppedPathname??k();e(i,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=f(a.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:t,onGoBack:d}):s.jsx(c,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{_ as F};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as r}from"./sentry-DQGl2YSn.js";import{u as f,h as l,g as m}from"./core-DYij5xsh.js";import{gB as p,JN as g,JO as b}from"./zeni-epic-state-YenBAkdY.js";import{u as _,L as h,z as y}from"./index-BCP41PwF.js";import"./liveblocks-BiGkkGoP.js";import"./recharts-D0oa1BQl.js";import"./mui-CdvNR06J.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="9f9bef73-359b-41f5-8e92-59c721cb1b6d",e._sentryDebugIdIdentifier="sentry-dbid-9f9bef73-359b-41f5-8e92-59c721cb1b6d")}catch{}})();function R(){const e=f(),n=l(),o=m(),{setLoading:i,clearAllLoading:d}=_(),s=r.useRef(!1);return r.useLayoutEffect(()=>{i(h.CONNECTION_AUTH)},[i]),r.useEffect(()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),c=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&c!=null){const t=JSON.parse(c);e(p(t.tenant_id,t.connection_id,g("revenue"),b("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}d();const u=y.getActiveTenantForUser();n(u?.tenantEmailDomain!=null?`/${u.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})},[]),null}export{R as default};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import{j as a}from"./liveblocks-BiGkkGoP.js";import{i as S,n as x,h as C,g as y,u as ee,s as ae,j as E,N as te,o as ne,p}from"./core-DYij5xsh.js";import{JG as k,JH as v,JI as T,zG as D,zs as G,JJ as z,JK as oe,JL as se,zw as ie,eX as $,zD as le,zA as de}from"./zeni-epic-state-YenBAkdY.js";import{k as g,o as d,m as re,d as j,i as J,E as ce,p as me,q as pe,r as H,n as ue,c as he,s as xe,v as ge,h as be,w as fe,B as we,x as Se,M as ye,S as ke,X as ve,y as je,C as $e}from"./index-BCP41PwF.js";import{n as m}from"./mui-CdvNR06J.js";import b from"./NotFoundScreen-C0-Skng9.js";import{a as I}from"./sentry-DQGl2YSn.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.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]="504cabe5-8a87-4e2b-8b5d-d88b917ba85d",e._sentryDebugIdIdentifier="sentry-dbid-504cabe5-8a87-4e2b-8b5d-d88b917ba85d")}catch{}})();const Ie=m.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
height: 100%;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
+
box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
10
|
+
`,Ce=x(function(e){const t=k(e),n=v(e),{companyName:o}=t;return{companyName:o,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,magicLinkViewState:t}},function(e,t){const{vendorId:n,billId:o}=t;return{onFetchBankName:s=>{e(G(s))},onSaveHandler:s=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(o),e(D(s,"standard",n,o))},onACHDetailsUpdated:s=>{const{bankAccountSection:l}=s;e(T({data:l}))}}})(re);function F(){const e=g(),{vendorId:t,billId:n}=S();return t==null||n==null?a.jsx(b,{}):a.jsx(a.Fragment,{children:a.jsx(Ie,{windowSize:e,children:a.jsx(Ce,{vendorId:t,billId:n})})})}const De=m.div`
|
|
11
|
+
display: flex;
|
|
12
|
+
height: 100vh;
|
|
13
|
+
width: 100%;
|
|
14
|
+
flex: 1 1 auto;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
align-items: center;
|
|
17
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
18
|
+
box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
19
|
+
`,ze=x(function(e,t){const{isSubPage:n}=t;return{addressToEdit:z(e),googleAPIKey:J.googleMapsAPIKey,isSubPage:n}},function(e,t){const{navigate:n,location:o}=t,s=()=>{const l=me(o.state?.pathnameStackToGoBack),i=l.poppedPathname??Ae();n(i,{state:{pathnameStackToGoBack:l.newStack}})};return{onSubmitHandler:l=>{const i=Pe(l);e(oe({addressToCreate:i})),s()},onCancel:()=>{s()}}})(ce);function Be({isSubPage:e}){const t=C(),n=y(),o=g();return a.jsx(a.Fragment,{children:a.jsx(De,{windowSize:o,children:a.jsx(ze,{location:n,navigate:t,isSubPage:e===!0,googleAPIKey:J.googleMapsAPIKey})})})}const Ae=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t},Pe=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng}),Le=m.div`
|
|
20
|
+
display: flex;
|
|
21
|
+
height: 100%;
|
|
22
|
+
width: 100%;
|
|
23
|
+
flex: 1 1 auto;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
align-items: center;
|
|
26
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
27
|
+
box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
28
|
+
`,Ne=x(function(e){const t=k(e),n=v(e),o=z(e),{companyName:s}=t;return{companyName:s,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:t}},function(e,t){const{navigate:n,location:o,vendorId:s,billId:l}=t;return{onFetchBankName:i=>{e(G(i))},onSaveHandler:i=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(D(i,"us-domestic",s,l))},onWireDetailsUpdated:i=>{const{bankAccountSection:r}=i;e(T({data:r}))},onAddressClick:()=>{const i=o.pathname.replace("us-domestic","address"),r=H(o.state?.pathnameStackToGoBack,o.pathname);n(i,{state:{pathnameStackToGoBack:r}})}}})(pe);function Ee(){const e=C(),t=y(),n=g(),{vendorId:o,billId:s}=S();return o==null||s==null?a.jsx(b,{}):a.jsx(a.Fragment,{children:a.jsx(Le,{windowSize:n,children:a.jsx(Ne,{location:t,navigate:e,vendorId:o,billId:s})})})}const Fe=m.div`
|
|
29
|
+
display: flex;
|
|
30
|
+
height: 100%;
|
|
31
|
+
width: 100%;
|
|
32
|
+
flex: 1 1 auto;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
align-items: center;
|
|
35
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
36
|
+
box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
37
|
+
`,Te=x(function(e){const t=k(e),n=v(e),o=z(e),{companyName:s}=t;return{companyName:s,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:t}},function(e,t){const{navigate:n,location:o,vendorId:s,billId:l}=t;return{onFetchBankNameBySwift:i=>{e(ie(i))},onSaveHandler:i=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(D(i,"international",s,l,t.isLocalCurrencyEnabled))},onBankDetailsUpdated:i=>{const{internationalWireSwiftAccountSection:r}=i;e(se({data:r}))},onAddressClick:()=>{const i=o.pathname.replace("international","address"),r=H(o.state?.pathnameStackToGoBack,o.pathname);n(i,{state:{pathnameStackToGoBack:r}})}}})(xe);function Ge(){const e=C(),t=y(),n=g(),{vendorId:o,billId:s}=S(),{useFeatureGate:l}=ue(),{isFeatureEnabled:i}=l(he.isBillPayLocalCurrencyFeatureEnabled);return o==null||s==null?a.jsx(b,{}):a.jsx(Fe,{windowSize:n,children:a.jsx(Te,{location:t,navigate:e,vendorId:o,billId:s,isLocalCurrencyEnabled:i})})}const Je={containerWidth:new je(100,58)},He=m(ke)`
|
|
38
|
+
width: ${d.sp4};
|
|
39
|
+
height: ${d.sp4};
|
|
40
|
+
margin-bottom: ${d.sp3};
|
|
41
|
+
margin-top: ${d.sp3};
|
|
42
|
+
margin-left: ${d.sp8};
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
position: absolute;
|
|
45
|
+
color: ${e=>e.theme.colors.brandColorJade};
|
|
46
|
+
`,Ke=m.div`
|
|
47
|
+
display: flex;
|
|
48
|
+
height: 100vh;
|
|
49
|
+
flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
|
|
50
|
+
width: 100vw;
|
|
51
|
+
overflow-y: scroll;
|
|
52
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
53
|
+
`,Me=m.div`
|
|
54
|
+
display: flex;
|
|
55
|
+
flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
|
|
56
|
+
flex-direction: column;
|
|
57
|
+
width: ${e=>`${Je.containerWidth.value(e.windowSize)}%`};
|
|
58
|
+
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
59
|
+
box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
60
|
+
padding-top: ${e=>e.windowSize!=="small"?d.sp2:"0px"};
|
|
61
|
+
`,Ve=m.div`
|
|
62
|
+
display: flex;
|
|
63
|
+
flex-direction: column;
|
|
64
|
+
align-items: center;
|
|
65
|
+
justify-content: center;
|
|
66
|
+
padding: ${e=>e.windowSize==="small"?d.sp3:`62px ${d.sp6} ${d.sp9} ${d.sp8}`};
|
|
67
|
+
height: ${e=>e.windowSize==="small"?"490px":"auto"};
|
|
68
|
+
overflow: ${e=>e.windowSize==="small"?"unset":"hidden"};
|
|
69
|
+
width: ${e=>e.windowSize=="small"?"auto":"42%"};
|
|
70
|
+
background-color: ${e=>e.windowSize==="small"?e.theme.colors.grey4:e.theme.colors.background};
|
|
71
|
+
margin-top: ${e=>e.windowSize==="small"?e.isAddressPage?"0px":"186px":"unset"};
|
|
72
|
+
`,_e=x(function(e,t){return{file:t.file,type:t.type}})(ve);function h({appContent:e}){const t=ee(),n=y(),{tenantEmailDomain:o,vendorId:s,billId:l}=S(),[i]=ae(),r=i.get("token"),K=n.pathname.includes("address"),f=g(),M=ge(),B=be(),w=fe(),V=()=>{M.toggle()},_=E(u=>k(u)),W=E(u=>v(u)),{authParams:U,fetchState:c,billAttachment:O,billFetchState:A,companyName:X,currencySymbol:q,amount:Q}=_,{tenantId:P,userId:L,sessionId:N}=U,{fetchState:R,internationalBankAccountCreateStatus:Y}=W;return I.useEffect(()=>{$()},[]),I.useEffect(()=>{w&&c==="Not-Started"&&s!=null&&o!=null&&r!=null&&t(le(s,o,r))},[w,c,s,o,r,t]),I.useEffect(()=>{w&&c==="Completed"&&($(L,N,P),l!=null&&t(de(l)))},[c,w,L,N,P,l,t]),c==="Error"?a.jsx(b,{}):R==="Completed"||Y.fetchState==="Completed"?($(),a.jsx(te,{to:"../../../../../../../bank/account/save/success",replace:!0,relative:"path"})):c==="In-Progress"?a.jsx(we,{fetchState:c,style:{height:"100vh",backgroundColor:B.colors.grey5,boxShadow:`0px 2px ${d.sp1} ${B.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[c==="Completed"&&A==="Completed"&&a.jsx(Se,{analytics:j,onLoad:u=>(Z=>Z.trackBillPayMagicLinkPageLoad(o??"",s??"",X,l??"",We(n.pathname),q,Q))(u)}),a.jsxs(Ke,{windowSize:f,children:[f!=="small"?a.jsx(He,{onClick:V}):null,a.jsx(Ve,{windowSize:f,isAddressPage:K,children:A==="In-Progress"?a.jsx(ye,{size:"ExtraLarge",start:!0}):a.jsx(_e,{file:O,type:"bill"})}),a.jsx(Me,{windowSize:f,children:e})]})]})}const We=e=>`${e.split("/").at(-2)}_${e.split("/").at(-1)}`;function Ue(){return a.jsx($e,{})}function ra(){return a.jsxs(ne,{children:[a.jsx(p,{path:"bank/account/save/success",element:a.jsx(Ue,{})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/standard",element:a.jsx(h,{appContent:a.jsx(F,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/same-day",element:a.jsx(h,{appContent:a.jsx(F,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/address",element:a.jsx(h,{appContent:a.jsx(Be,{isSubPage:!0})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/us-domestic",element:a.jsx(h,{appContent:a.jsx(Ee,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/international",element:a.jsx(h,{appContent:a.jsx(Ge,{})})}),a.jsx(p,{path:"*",element:a.jsx(b,{})})]})}export{ra as default};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import{j as u}from"./liveblocks-BiGkkGoP.js";import{a as f}from"./sentry-DQGl2YSn.js";import{u as U,g as M,h as O,s as _,j as l,N as D}from"./core-DYij5xsh.js";import{z as r,h as w,D as P,e as V,d as A,f as N,J as B,M as Q,g as R}from"./index-BCP41PwF.js";import{eQ as W,Jr as X,JB as $,Js as q,eX as G,fo as H,Jx as K,fM as Y,cT as Z,JC as ee,JD as te}from"./zeni-epic-state-YenBAkdY.js";import{n as ne}from"./mui-CdvNR06J.js";import{u as se}from"./useDeviceId-Dsh8klAH.js";import{f as ie}from"./analyticsHelper-tq4PT7c_.js";import{t as ae}from"./getLocaleForTenant-DwUbw-k6.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="450bd111-1fef-49e6-861c-c3923e766031",t._sentryDebugIdIdentifier="sentry-dbid-450bd111-1fef-49e6-861c-c3923e766031")}catch{}})();const T=(t,i)=>t!=null&&t.length>0&&i==="magic_links";function Te(){const t=U(),i=M(),m=O(),[y]=_(),n=y.get("token"),p=y.get("stytch_token_type"),g=r.getMagicLinkCodeVerifier(),a=se(),{otpChallenge:d,twoFAPhoneNumber:x,magicLinkEmail:c,verifyDeviceFetchState:C,resendVerifyDeviceOTPFetchState:z}=l(e=>e.tenantState),S=l(e=>e.tenantState.fetchState),b=l(e=>e.tenantState.activeTenantFetchState.fetchState),h=l(e=>e.tenantState.signInState),I=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),s=l(e=>e.tenantState.loggedInUser),o=l(e=>W(e)),k=l(e=>X(e)),E=r.getSignedInUser(),v=w().mode;f.useEffect(()=>{s?.zeniSessionId==null&&n!=null&&T(n,p)&&a!=null&&g!=null&&(r.saveMagicLinkTriggered(n),t($(n,a,g)))},[n,p,t,a,g,s?.zeniSessionId]),f.useEffect(()=>{h!=="In-Progress"||S!=="Completed"&&b!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(q(k.tenantsInOrder),s.zeniSessionId),G(s.userId,s.zeniSessionId,o.tenantId),t(H(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(K("Completed")),P.updateAppLocaleID(ae(o)),ie(s,o,v,void 0,k.tenantsInOrder),Y().then(()=>{const e=R();e!=null&&V(e)}),setTimeout(()=>{A.trackLogin(N.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[h,S,b,s,o,k,v,i.state,t]);const j=f.useCallback(()=>{m("/signin/auth")},[m]),F=f.useCallback(()=>{a!=null&&d!=null&&c!=null&&t(ee(a,c,d))},[a,d,t,c]),J=f.useCallback(e=>{a!=null&&n!=null&&c!=null&&d!=null&&t(te(e,a,c,d))},[a,n,t,c,d]);if(I==="Completed"&&d!=null)return u.jsx(B,{phoneNumber:x,verifyOtpFetchState:C.fetchState,resendVerifyDeviceOTPFetchState:z,onResendOtp:F,onVerifyOtp:J,onCancelVerifyDevice:j});if(h==="In-Progress"&&S==="Completed"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=i.state?.origin??"/";return u.jsx(D,{to:e,state:{...i.state,origin:""}})}if(!T(n,p)||g==null||I==="Error"){const e=i.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(D,{to:e,state:{...i.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||I==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(Q,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
|
|
2
|
+
position: fixed;
|
|
3
|
+
top: 0;
|
|
4
|
+
left: 0;
|
|
5
|
+
right: 0;
|
|
6
|
+
bottom: 0;
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
z-index: 9999;
|
|
11
|
+
background-color: ${t=>t.theme.colors.background};
|
|
12
|
+
`;export{Te as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as U}from"./liveblocks-
|
|
1
|
+
import{j as U}from"./liveblocks-BiGkkGoP.js";import{a as c}from"./sentry-DQGl2YSn.js";import{u as pe,j as s,i as Qe,g as We,h as qe,l as M}from"./core-DYij5xsh.js";import{eQ as he,f0 as Ke,f1 as Se,eU as Xe,bn as ea,eP as aa,f2 as ta,f3 as na,f5 as sa,f8 as oa,fh as ia,f9 as g,fb as ra,fc as ue,ff as da,fd as la,fe as ca,fg as ua,cJ as fa,fj as ma,cO as ba,bt as pa,eT as ha,fo as Sa,fp as ga,fn as Ea}from"./zeni-epic-state-YenBAkdY.js";import{a7 as ka,a8 as Ca,v as ya,n as Ia,z as k,w as Ta,u as wa,c as r,a9 as Aa,aa as _a,A as Fa,a as Da,ab as va,a3 as $a,ac as Ba,ad as Ga,ae as fe,af as me,L as Pa,ag as Ma,ah as be,d as R,$ as Ra,r as A,ai as N,aj as Na}from"./index-BCP41PwF.js";import{D as Ua}from"./mui-CdvNR06J.js";(function(){try{var f=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new f.Error().stack;d&&(f._sentryDebugIds=f._sentryDebugIds||{},f._sentryDebugIds[d]="eeaefe33-1ddd-4bfa-8388-4cf9001ce0de",f._sentryDebugIdIdentifier="sentry-dbid-eeaefe33-1ddd-4bfa-8388-4cf9001ce0de")}catch{}})();const Va=ka(({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:t}=Qe(),a=We(),C=ya(),o=qe(),V=Xe(),m=pe(),{useFeatureGate:i}=Ia(),O=k.getSignedInUser(),_=ea(O),n=s(e=>he(e)),ge=n.masterTOSInfo?.isMasterTOSAccepted??!1,j=s(e=>aa(e)),x=j.uiState.currentChatSessionId,y=Ta(),{setLoading:Ee}=wa(),[F,L]=c.useState(void 0),D=M("/:tenantEmailDomain/dashboard")!==null,z=M("/:tenantEmailDomain/reports")!==null,I=M("/:tenantEmailDomain/onboarding/*")!==null,{isFeatureEnabled:Y}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:ke}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:H}=i(r.isDebitCardFeatureEnabled),Ce=Aa(n,ke,H),{isFeatureEnabled:ye}=i(r.isSettingsFeatureEnabled),Z=s(e=>ta(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),v=s(e=>na(e));c.useEffect(()=>{y&&T&&!I&&v.fetchState==="Not-Started"&&m(sa(!0))},[y,T,v.fetchState,I]);const h=k.getSignedInUser(),$=s(e=>e.tenantState),Ie=s(e=>$.fetchState==="Completed"?oa(e):[]),E=s(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:Te}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:we}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:J}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:Q}=i(r.isExpenseAutomationEnabledV2),W=Q||J&&_,{isFeatureEnabled:Ae}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:_e}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:Fe}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:De}=i(r.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:ve}=i(r.isTreasuryEnabled),{isFeatureEnabled:$e}=i(r.isTaskManagerCustomerUserAccessEnabled),Be=_||!_&&$e,Ge=n.company!=null&&ia(n.company),w=ve&&Ge,Pe=s(e=>g(e).totalUnreadCount),Me=s(e=>g(e).reducedFetchCountState),q=s(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),K=s(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),Re=s(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),B=s(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:X,isLoading:ee,isFetchingMore:ae,hasFetchedAll:te,fetchMore:Ne}=_a();c.useEffect(()=>{const e=setTimeout(()=>Ne?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(ee===!1&&ae===!1&&te===!0)if(n?.companyId!=null&&X!=null){const e=`dashboard_${n.companyId}`;L(X.filter(u=>u.roomId===e&&u.readAt==null).length)}else L(0)},[ee,ae,te]),c.useEffect(()=>{y&&!I&&Re.fetchState==="Not-Started"&&V.tenantId!=null&&m(ra("task_manager","dashboard"))},[y,V.tenantId]),c.useEffect(()=>{I||B.fetchState!=="Not-Started"||m(ue({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{F!=null&&B.fetchState==="In-Progress"&&(m(ue({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),m(Se({unreadCount:F},"comments")))},[F,B.fetchState]);const Ue={fetchStatus:Me,count:Pe},ne=t!=null?k.getSignedInUserTenant(t):null,se=s(e=>ne?.tenantId!=null?da(e,ne.tenantId):void 0),S=[];Te===!1&&S.push("accounts_payable_aging"),we===!1&&S.push("accounts_receivable_aging"),Y===!1&&S.push("zeni_accounts_promo_card"),T===!1&&S.push("rewards_card"),W===!1&&S.push("expense_automation_card");const Ve=Fa(),oe=s(e=>la(e,S,h,Q,J,w).fetchState),ie=s(e=>ca(e).fetchState),Oe=D&&(oe==="Completed"||oe==="Error")||z&&(ie==="Completed"||ie==="Error")||!D&&!z?void 0:"disabled",je=c.useMemo(()=>ua(n.userRole),[n.userRole]),xe=fa(je),Le=n?.rewardsLastViewedTime==null,ze=h?.userEmail!=null&&Z.fetchState==="Completed"&&ma(Z.notificationSettings,h.userEmail,H,n),re=Da(),Ye=re&&va(a),de=ba(Ve?.loggedInUserRoleMap),le=n.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,G=c.useCallback(()=>w&&de&&!k.getTreasuryPopupSeen(t??"")&&le===!1&&$a(a.pathname)!=="treasury",[w,de,le,a.pathname,t]),[He,ce]=c.useState(G);c.useEffect(()=>{ce(G())},[G]);const Ze=s(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,Je=Ba(Ze);return U.jsx(Ua,{container:window.document.body,variant:"temporary",open:f,onClose:()=>d(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:U.jsx(Ga,{signedInUser:O,currentTenantId:$.currentTenantId??"",tenants:$.fetchState==="Completed"?Ie:se!=null?[se]:[],currentTenant:n,isTenantDropdownDisabled:Oe,isSettings:me(a),isSettingsFeatureEnabled:ye,isVendorsTabVisible:xe,isZeniAccountEnabled:Y,isChargeCardEnabled:Ce,isTreasuryEnabled:w,treasuryYieldPercentage:Je,isTreasuryPopupVisible:He,isNotificationsTabVisible:ze,notificationCountDetails:Ue,isExpenseAutomationEnabledForUser:W&&pa(n.userRole)===!1,selectedMenu:fe(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Le,rewardsPlan:v.rewardsPlan},isAiCfoAccessEnabled:re,onNotificationIconClick:()=>{d(!1);let e=q===0&&K>0?"notifications/comments":"notifications/tasks";me(a)&&(e=q===0&&K>0?"../../notifications/comments":"../../notifications/tasks");const u=A(a.state?.pathnameStackToGoBack,a.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=A(a.state?.pathnameStackToGoBack,a.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),t==null)return;if(e.type==="ai_cfo"){if(R.trackAICFOChatScreenStateChanged("viewed","left_menu",x??null,null),!ge)return void Ra({location:a,navigate:o,mergeState:{referrer:"Sidebar"}});const p=A(a.state?.pathnameStackToGoBack,a.pathname);return void o(`/${t}/ai-cfo/explore`,{state:{pathnameStackToGoBack:p,referrer:"Sidebar"}})}const u=A(a.state?.pathnameStackToGoBack,a.pathname),l=e.type,b=N(l)&&l!=="command_center";if(N(e.type)&&E[n.tenantId]!=null&&R.trackMonthEndCloseClicked(E[n.tenantId].month,E[n.tenantId].year,"Sidebar"),b&&E[n.tenantId]!=null){const p=E[n.tenantId];return void o(`/${t}/month_end_close_checks/review/${e.type}/${p.month}-${p.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const P=Na(e.type);be(e.type)?(x!=null&&m(Ea()),o(`/${t}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${t}/${P}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${t}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${t}/rewards`)},handleBackClick:()=>{o(`/${t}/dashboard`)},handleTenantSelect:e=>{Ee(Pa.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=fe(a);let b=`/${encodeURIComponent(u)}/`;const P=N(l);l==="home"?b+="dashboard":l==="users_and_roles"?b+="people":Ma(l)?b+="settings/my_profile":be(l)?b+=`ai-cfo/${l}`:b+=l==="task_checklist"?"tasks":P?"month_end_close_checks/review":encodeURIComponent(l),o(b,{replace:!0}),h!=null&&(m(Sa(e.tenantId)),m(ga(h.userId,e.tenantId,h.zeniSessionId)));const p=e;R.trackCompanySwitch(p.companyId,p.companyName,p.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(t??"",!0),ce(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:Ye,aiCfoView:j,isOnDashboard:D,updateCurrentChatSessionId:e=>{m(ha({sessionId:e,agentId:"controller"})),o(`/${t}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:Ae,isTaskManagerAccessEnabled:Be,thanksGivingAnimationEnabled:_e,christmasAnimationEnabled:Fe,newYearAnimationEnabled:De})})}),Ha=f=>{const d=pe(),t=s(C=>he(C)),a={events:t.userRoleId!=null?[`private-encrypted-${t.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{Ca(o)&&Ke(o.mode)==="dashboard"&&d(Se({unreadCount:o.data.unread},"tasks"))}};return U.jsx(Va,{...f,...a})};export{Ha as M};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./liveblocks-BiGkkGoP.js";import{h as r,n}from"./core-DYij5xsh.js";import{I as i}from"./index-BCP41PwF.js";import"./mui-CdvNR06J.js";import"./sentry-DQGl2YSn.js";import"./zeni-epic-state-YenBAkdY.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new o.Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="a91be54e-6c13-4a77-b876-d2a39d3636be",o._sentryDebugIdIdentifier="sentry-dbid-a91be54e-6c13-4a77-b876-d2a39d3636be")}catch{}})();const a=n(null,function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}})(i);function _(){const o=r();return e.jsx(a,{navigate:o})}export{_ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as ct,a as mt,m as dt,j as A}from"./liveblocks-
|
|
1
|
+
import{l as ct,a as mt,m as dt,j as A}from"./liveblocks-BiGkkGoP.js";import lt from"./NotFoundScreen-C0-Skng9.js";import{a as k}from"./sentry-DQGl2YSn.js";import{h as ft,g as ut,i as ht,u as pt,j as S,n as kt,o as gt,p as H}from"./core-DYij5xsh.js";import{cr as St,f2 as K,eQ as Z,fg as bt,f9 as b,Q3 as O,fc as d,f1 as y,rb as M,wr as It,Q4 as Ct,f0 as Tt,fj as yt,rg as Et,Q5 as $,bq as F,gU as x,rk as J,Q6 as _t,cC as At,cw as Nt}from"./zeni-epic-state-YenBAkdY.js";import{W as Bt,z as wt,n as xt,c as Rt,Z as Ut,cB as Dt,r as N,a7 as vt,cC as Gt,a8 as Pt,p as $t}from"./index-BCP41PwF.js";import"./mui-CdvNR06J.js";import{u as Ft}from"./useAskAiCfoHostNavButtonProps-CVdued0l.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="63130727-1220-4b37-8de6-e0336d87779e",t._sentryDebugIdIdentifier="sentry-dbid-63130727-1220-4b37-8de6-e0336d87779e")}catch{}})();const Mt=(t,l)=>new Promise((n,u)=>{const g=t.map(i=>new Promise(s=>{l(i),s()}));Promise.all(g).then(()=>{setTimeout(()=>{n()},2e3)}).catch(i=>{u(i)})}),jt=kt(function(t,l){const n=K(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=Z(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&yt(n.notificationSettings,u.userEmail,g,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}},function(t,l){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:g,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:B,fetchMoreCommentsNotifications:R}=l;return{onNotificationClick:(a,o,m,c)=>{if(c==="task_deleted"){const r=`/${u}/tasks`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const r=`/${u}/tasks/${o}`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}m==="unread"&&t(J("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(B(a),t($([a],F())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!At(g)&&(r="not-found"),c[1].startsWith("bill")&&!Nt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(y(a,o))},onUpdateNotificationTabState:(a,o)=>{t(d(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(O(a,o));const m=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(m,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(_t(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const m=[];o==="all"?m.push("read","unread"):o!=="mentions"&&m.push(o),t(M("task_manager","dashboard",m))}else R?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(J("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{m==="read"&&(B(r),t($([r],F())))})).then(()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))},r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}).catch(r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(Et("task_manager","read")):(t(d({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Mt(s,B).then(()=>{t($(s,F())),t(d({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}).catch(o=>{t(d({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onBackClick:()=>{const a=$t(n.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";h(o,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=N(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}})(vt(Gt)),Vt=()=>{const t=ft(),l=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:g}=Bt(),i=St(u??""),s=pt(),h=wt.getSignedInUser(),[B,R]=k.useState(!1),a=S(e=>K(e)),o=S(e=>Z(e)),{useFeatureGate:m}=xt(),{isFeatureEnabled:c}=m(Rt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=Ft({mobileExploreReferrer:"Notifications"});Ut({isDataReady:!0});const X=bt(o.userRole);if(o==null||n==null||o.companyId==null)throw Error("Can't access notifications page without current tenant...");if(h==null)throw Error("Can't access notifications page without signed in...");const j=S(e=>b(e).notificationDetailsByTab.tasks.fetchState),V=S(e=>b(e).currentTab),U=S(e=>b(e).currentSubTab),Y=S(e=>b(e).notificationDetailsByTab.comments.fetchCountState),D=S(e=>b(e).notificationDetailsByTab.comments.fetchState),tt=S(e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount),et=S(e=>b(e).allExternalNotifications).filter(e=>e.inboxNotification.readAt==null).map(e=>e.inboxNotification.id),at=Dt().allUsers,{inboxNotifications:w,isLoading:E,hasFetchedAll:C,isFetchingMore:v,fetchMore:ot}=ct(),{threads:Q,isLoading:W,fetchMore:q,isFetchingMore:z,hasFetchedAll:L}=mt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(V!==i&&i!=null&&s(O(i)),i==null){const e=`../${V}`,p=N(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}},[i]),k.useEffect(()=>{Y.fetchState==="Not-Started"&&s(d({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),k.useEffect(()=>{if(E===!1&&C===!0&&o?.companyId!=null&&w!=null){const e=`dashboard_${o.companyId}`,p=w.filter(T=>T.roomId===e&&T.readAt==null).length;s(d({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}},[E,C]),k.useEffect(()=>{j!=="In-Progress"&&g&&s(M("task_manager","dashboard",["read","unread"]))},[g]),k.useEffect(()=>{const e=setTimeout(()=>ot?.(),0);return()=>clearTimeout(e)});const G=E||v===!0||C!==!0||E||v===!0||C!==!0;k.useEffect(()=>{G&&D!=="In-Progress"?s(d({fetchState:"In-Progress",error:void 0},"comments")):G||D!=="In-Progress"||s(d({fetchState:"Completed",error:void 0},"comments"))},[G,D]),k.useEffect(()=>{s(y({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&B===!1&&(R(!0),s(It()))},[a.fetchState]),k.useEffect(()=>{if(E===!1&&W===!1&&w!=null&&Q!=null){const e=`dashboard_${o.companyId}`,p=w.filter(f=>f.roomId===e).filter(f=>f.kind==="thread"),T=p.filter(f=>f.readAt==null),_=p.map(f=>f.id),it=p.map(f=>{const P=Q.find(rt=>rt.id===f.threadId);return P!=null?{inboxNotification:{...f,threadId:P.id},thread:P}:(z||L===!0||q==null||q(),null)}).filter(f=>f!=null);s(d({allNotificationsIds:_},"comments")),s(y({totalCount:_.length,unreadCount:T.length},"comments")),s(Ct(it))}},[E,v,z,C,L,W,w?.length]);const st={events:o.userRoleId!=null?[`private-encrypted-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Pt(p)){const T=Tt(p.mode);if(T==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const _=[];U==="all"?_.push("read","unread"):U!=="mentions"&&_.push(U),s(M("task_manager",T,_,!0))}}}},nt=dt();return A.jsx(jt,{tenantEmailDomain:n,loggedInUserRoleMap:X,signedInUser:h,externalNotificationsUnreadCount:tt,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:at,markInboxNotificationAsRead:nt,allUnreadCommentsNotificationIds:et,isAiCfoAccessEnabled:r,onAskAiCfoClick:I,...st})};function ne(){return A.jsxs(gt,{children:[A.jsx(H,{path:"/:selectedTab",element:A.jsx(Vt,{})}),A.jsx(H,{path:"*",element:A.jsx(lt,{})})]})}export{ne as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as m}from"./liveblocks-BiGkkGoP.js";import{a as r}from"./sentry-DQGl2YSn.js";import{u as A,g as j,j as o,N as C}from"./core-DYij5xsh.js";import{JQ as J,eQ as M,f8 as P,JR as R,JS as x,JT as z,JU as D,mX as k,IM as L}from"./zeni-epic-state-YenBAkdY.js";import{z as h,G as I}from"./index-BCP41PwF.js";import"./mui-CdvNR06J.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new n.Error().stack;s&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[s]="160ce3d7-e3f6-443e-810d-7e1dcf1dbf6c",n._sentryDebugIdIdentifier="sentry-dbid-160ce3d7-e3f6-443e-810d-7e1dcf1dbf6c")}catch{}})();function ee(){const n=A(),s=j(),{params:t,error:i}=r.useMemo(()=>J(s.search),[s.search]),w=r.useMemo(()=>new URLSearchParams(s.search).get("client_name")??t?.clientId??"Unknown Application",[s.search,t]),f=h.isSignedIn(),a=h.getSignedInUser(),p=o(e=>M(e)),l=o(e=>P(e)),d=o(e=>e.tenantState.fetchState),y=o(R),S=o(x),c=o(z),[v,b]=r.useState(null),[E,U]=r.useState(null);r.useEffect(()=>{document.querySelector("#app-shell-loader")?.remove()},[]),r.useEffect(()=>()=>{n(D())},[n,s.search]),r.useEffect(()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)},[i]);const g=r.useRef(!1);r.useEffect(()=>{f&&a!=null&&!g.current&&(d!=="Not-Started"&&d!=="Error"||(g.current=!0,n(k(a.userId,a.zeniSessionId??void 0))))},[f,a,d,n]),r.useEffect(()=>{c!=null&&c!==""&&(window.location.href=c)},[c]);const _=r.useMemo(()=>{if(p?.tenantId!=null)return p.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some(T=>T.tenantId===e)?e:l.length===1?l[0].tenantId:null},[p?.tenantId,l]),u=v??_;return i!=null?m.jsx(I,{variant:"invalid_params",paramsError:i}):f?m.jsx(I,{variant:"signed_in",clientName:w,userEmail:a?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:u,onSelectTenant:b,approveError:E??S,isApproving:y==="In-Progress",showAllowButton:u!=null,onApprove:()=>{t!=null&&a!=null&&u!=null&&n(L(a.userId,a.zeniSessionId??void 0,u,t.clientId,t.redirectUri,t.codeChallenge,t.codeChallengeMethod,t.state,t.responseType))},onDeny:()=>{if(t!=null)try{const e=new URL(t.redirectUri);e.searchParams.set("error","access_denied"),e.searchParams.set("error_description","The user denied the request"),e.searchParams.set("state",t.state),window.location.href=e.toString()}catch{U("Unable to deny: redirect_uri is not a valid URL. Close this window or contact support.")}}}):m.jsx(C,{to:"/signin/auth",state:{origin:s.pathname+s.search},replace:!0})}export{ee as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as n}from"./liveblocks-BiGkkGoP.js";import{h as z,u as Y,g as Z,i as Q,j as d,n as H,o as J,p as I}from"./core-DYij5xsh.js";import{eQ as U,q$ as R,qz as X,Km as v,qu as T,bt as ee,bn as ae,bT as te,qv as se,Kn as oe,K8 as C,dE as re,uo as ne,Ko as ce,uL as ie,e$ as le,eZ as de}from"./zeni-epic-state-YenBAkdY.js";import{z as me,W as fe,Z as pe,A as ue,n as $,c as q,x as he,d as w,ao as ge,r as Fe}from"./index-BCP41PwF.js";import"./mui-CdvNR06J.js";import be from"./NotFoundScreen-C0-Skng9.js";import{F as Ie}from"./FeaturePreviewScreen-4ttP8nOi.js";import{a as g}from"./sentry-DQGl2YSn.js";import{u as Ce}from"./useAskAiCfoHostNavButtonProps-CVdued0l.js";import{u as Te}from"./useInitialThreadRequest-Du_koxHd.js";import{t as Se}from"./routePaths-jIme_4o7.js";import{M as ye}from"./MobileAppDrawer-Biso_61t.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new s.Error().stack;e&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[e]="2f1f3d8f-a1b0-4ec5-99cc-d3736cca8050",s._sentryDebugIdIdentifier="sentry-dbid-2f1f3d8f-a1b0-4ec5-99cc-d3736cca8050")}catch{}})();const S=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},Ae=H(function(s){const e=oe(s),a={},o=e.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach(r=>{a[r]=o[r]===!1}),{selectedTimeframe:e.selectedTimeframe,isForecastVsActualOn:e.isForecastVsActualOn,compareMode:e.compareMode,forecastList:e.forecastList,selectedForecast:e.selectedForecast,pandLreport:e.pandLReportWithForecast,scrollPosition:e.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:a,type:"name+balances_forecast",analytics:w}},function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(v(a,o)),e.isPandLReportFetched(a)||s(T(a)),S(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(ie(a))},onForecastVsActualsCompareToggle:a=>{s(ce(a)),s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(ne(e.firstMonthOfFY,a,0,[]))},onAccountBalanceClick:e.hasTransactionAccess!==!0?void 0:(a,o)=>{let r,c;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,c=re(o)):o.balanceTimeFrame==="year"?(r="quarter",c={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),c!=null&&r!=null){const m=Se(e.tenantEmailDomain,a.accountId,a.accountType,p,r,c),u=Fe(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(m,{state:{pathnameStackToGoBack:u,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(C({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}})(ge);function O(){const s=z(),e=Y(),a=Z(),{forecastId:o,tenantEmailDomain:r}=Q(),[c,p]=g.useState(!1),[m,u]=g.useState(!1),h=me.getSignedInUser(),y=d(t=>U(t)),M=y.company?.companyInfo.firstMonthOfFY??1,i=d(t=>R(t.forecastState,t.forecastListState)),l=d(t=>t.forecastListState.fetchState==="Completed"),A=d(t=>t.profitAndLossState),k=d(t=>t.reportUIOptionsState.selectedForecast),x=t=>A.pandLByForecastID[t]!=null&&se(t,A).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:F}=fe();pe({isDataReady:l});const{isAiCfoAccessEnabled:B,onAskAiCfoClick:N}=Ce({mobileExploreReferrer:"Forecast"});g.useEffect(()=>{if(!c&&F)p(!0),l||e(X());else if(l&&!m){u(!0);const t=((f,j,P)=>j!=null?f.forecasts.findIndex(b=>b.id===j):P!=null?f.forecasts.findIndex(b=>b.id===P):f.forecasts.length>0?0:-1)(i,o,k?.id);t===-1&&o!=null?s("page-not-found",{replace:!0}):t!==-1&&t!=k?.index?(e(v(i.forecasts[t].id,t)),S(o,i.forecasts[t].id,s,a.search)):o==null&&t!==-1&&S(void 0,i.forecasts[t].id,s,a.search),t!==-1&&!x(i.forecasts[t].id)&&F&&e(T(i.forecasts[t].id))}},[c,p,e,l,i,m,u,R,T,F]);const D=ue(),W=D?.loggedInUserRole!=null&&ee(D.loggedInUserRole),{useFeatureGate:_}=$(),{isFeatureEnabled:E}=_(q.isReportsCommentingEnabled),G=Te(E?y?.companyId:void 0,{clearParams:l&&m}),[K,V]=g.useState(!1),L=t=>{V(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(he,{analytics:w,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:K,handleDrawerToggle:L}),n.jsx(Ae,{firstMonthOfFY:M,tenantEmailDomain:r,forecastIdFromUrlPath:o,navigate:s,location:a,isPandLReportFetched:x,meetingUrl:te(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${h?.firstName}&lastname=${h?.lastName}&email=${h?.userEmail}`),hasTransactionAccess:W,isAiCfoAccessEnabled:B,onAskAiCfoClick:N,isReportsCommentingEnabled:E,isZeniUser:ae(h),initialOpenThreadRequest:G,onClickMenuIcon:()=>{L(!0)}})]})}function Ve(){const s=d(c=>U(c)),{useFeatureGate:e}=$(),{isFeatureEnabled:a}=e(q.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(Ie,{}):n.jsxs(J,{children:[n.jsx(I,{path:"/",element:n.jsx(O,{})}),n.jsx(I,{path:"/:forecastId",element:n.jsx(O,{})}),n.jsx(I,{path:"/:forecastId/*",element:n.jsx(be,{})})]})}export{Ve as PandLWithForecastRoutes,Ve as default};
|