@zeniai/web-app-ui 5.0.94-qa → 5.0.95-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-0Eyzeqmo.js +1 -0
- package/dist/assets/{AddressScreen-BNN0XhH8.js → AddressScreen-C1kNIoFW.js} +2 -2
- package/dist/assets/AiCfoScreen-DiEWR7_7.js +22 -0
- package/dist/assets/{BillPayApprovalRoutes-BpV8hV9h.js → BillPayApprovalRoutes-BFuKAoJn.js} +1 -1
- package/dist/assets/{BillPayRoutes-BnNnXg6p.js → BillPayRoutes-yYgD8ElZ.js} +34 -34
- package/dist/assets/{BusinessVerificationPageScreen-fGxnzjnu.js → BusinessVerificationPageScreen-LVeN_2_9.js} +2 -2
- package/dist/assets/{ChargeCardRoutes-Cxl-Dfno.js → ChargeCardRoutes-Dqh0dx38.js} +8 -8
- package/dist/assets/{CompanyPassportScreen-6oghFs5-.js → CompanyPassportScreen-CoCoQTkp.js} +1 -1
- package/dist/assets/ConnectionAuthScreen-B7BFXXXS.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-D5Bh3dbO.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-52j6GlB4.js → CustomerOnboardingRoutes-BeOSK0bV.js} +4 -4
- package/dist/assets/DashboardRoutes-DeXVvCqq.js +20 -0
- package/dist/assets/{DefaultTenantHome-ChuSwEZz.js → DefaultTenantHome-DZiebdrx.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-DT1-4XE1.js → DomesticWireDetailScreen-BU_VenPR.js} +3 -3
- package/dist/assets/DrawerScreen-BbhUunYL.js +1 -0
- package/dist/assets/EntityDetailRoutes-DdiBSVG3.js +1 -0
- package/dist/assets/{ExpenseAutomationRoutes-BGsp6tOc.js → ExpenseAutomationRoutes-hIKcsGeT.js} +4 -4
- package/dist/assets/FeaturePreviewScreen-C1-h6LMu.js +1 -0
- package/dist/assets/{HubSpotOAuthCallbackScreen-BtWyS7u5.js → HubSpotOAuthCallbackScreen-C_sETmGk.js} +1 -1
- package/dist/assets/{MagicLinkRoutes-CiL3RYaJ.js → MagicLinkRoutes-DZdU0REk.js} +4 -4
- package/dist/assets/MagicLinkSignInScreen-BDghb4vk.js +12 -0
- package/dist/assets/MobileAppDrawer-CgbJlL9u.js +1 -0
- package/dist/assets/NotFoundScreen-DjvK1NbN.js +1 -0
- package/dist/assets/{NotificationRoutes-TuKcUgWz.js → NotificationRoutes-HNy89jXR.js} +1 -1
- package/dist/assets/OAuthConsentScreen-BRyPWMqe.js +1 -0
- package/dist/assets/{PandLWithForecastRoutes-CU7PJY2i.js → PandLWithForecastRoutes-CBP1v8tZ.js} +1 -1
- package/dist/assets/PeopleRoutes-B7-ewz69.js +22 -0
- package/dist/assets/PerformanceRoutes-COR3BTZa.js +1 -0
- package/dist/assets/{Preview-CX79dadf.js → Preview-DVbW5PS-.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-CNoF2iT1.js → QBOConnectionScreen-BRbkYHuP.js} +1 -1
- package/dist/assets/ReferralListScreen-C5_wj8jW.js +5 -0
- package/dist/assets/ReimbursementApprovalRoutes-DNyMDR4t.js +1 -0
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-DI_WfNSZ.js → ReimbursementApprovalRuleDetailScreen-CO_HtFbP.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-B57Ww3xn.js → ReimbursementRoutes-pmb5ZMBe.js} +4 -4
- package/dist/assets/ReportsRoutes-C9h_dCJo.js +1 -0
- package/dist/assets/RewardsRoutes-COWJicvP.js +1 -0
- package/dist/assets/ScreenRoutes-DB3q5PNA.js +2 -0
- package/dist/assets/{SettingsRoutes-CvryzcuN.js → SettingsRoutes-DEx1uOuX.js} +7 -7
- package/dist/assets/{SetupPagesScreen-Bap8l3lK.js → SetupPagesScreen-DM0dhGt1.js} +5 -5
- package/dist/assets/{SignInScreen-C1Bdz5-O.js → SignInScreen-BIF8y6r_.js} +1 -1
- package/dist/assets/SignOutScreen-D0ouX99i.js +9 -0
- package/dist/assets/{TaskListScreen-BgQVLwxs.js → TaskListScreen-CQTVeDwe.js} +2 -2
- package/dist/assets/TaskRoutes-DzCuQY-E.js +9 -0
- package/dist/assets/{TransactionDetailRoutes-BtJNx8FU.js → TransactionDetailRoutes-BjnNsU6t.js} +1 -1
- package/dist/assets/{TransactionDetailScreen-ZjUg5MTR.js → TransactionDetailScreen-BSarw1vq.js} +2 -2
- package/dist/assets/{TransactionListRoutes-CpUzH2wx.js → TransactionListRoutes-CXfUmvjI.js} +1 -1
- package/dist/assets/{TreasuryRoutes-DGZRuDr3.js → TreasuryRoutes-CDE_tE4t.js} +6 -6
- package/dist/assets/{VendorsRoutes-BmMfshWa.js → VendorsRoutes-Cz9uX3LH.js} +13 -13
- package/dist/assets/WiseConfirmationScreen-B9n09x9Y.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-Dt7DM9ni.js → ZeniAccountRoutes-DIt49_h_.js} +11 -11
- package/dist/assets/ZeniAccountStatementScreen-Dafm8AUT.js +9 -0
- package/dist/assets/{accountMappingHelper-ClJz5V9X.js → accountMappingHelper-DdryjbCH.js} +1 -1
- package/dist/assets/{analytics-NZ6ROu06.js → analytics-B35UERag.js} +1 -1
- package/dist/assets/{analyticsHelper-BTp5Ghm5.js → analyticsHelper-D8sAsSDg.js} +1 -1
- package/dist/assets/{core-D-NK-UK9.js → core-B20PugrR.js} +2 -2
- package/dist/assets/{decodeURIComponentSafe-C48GZJfu.js → decodeURIComponentSafe-HZX6LUOb.js} +1 -1
- package/dist/assets/{dnd-C49i2BE4.js → dnd-CTNaOehy.js} +1 -1
- package/dist/assets/{empty-DH2H1-Nx.js → empty-DbjE3Pml.js} +1 -1
- package/dist/assets/{empty-CtUkBjnR.js → empty-DqPV1QMu.js} +1 -1
- package/dist/assets/{emptyVideoElement-BCGqnPYV.js → emptyVideoElement-D5A8Alvf.js} +1 -1
- package/dist/assets/{epic-D64Ymfe0.js → epic-C05Fn23e.js} +1 -1
- package/dist/assets/getLocaleForTenant-ht-6GSU5.js +1 -0
- package/dist/assets/{index-CppZNJwq.js → index-BJUGjRvu.js} +1 -1
- package/dist/assets/{index-B-v2HYWQ.js → index-D8hCAHx9.js} +11630 -11593
- package/dist/assets/{index-DUe_bU79.js → index-DDN5QRfh.js} +2 -2
- package/dist/assets/{index-Cii2mjSS.js → index-DODLcfP6.js} +1 -1
- package/dist/assets/{index-CTaHBGA6.js → index-Dh7l3Ca4.js} +1 -1
- package/dist/assets/{index-Bx6iIwrK.js → index-DwJt1swd.js} +1 -1
- package/dist/assets/{index-AU1I47Je.js → index-Dx-tgz0s.js} +1 -1
- package/dist/assets/{index-DCy8xCNa.js → index-qbNk-Sh2.js} +1 -1
- package/dist/assets/{lexical-Bp-0qESw.js → lexical-BDpP_OMn.js} +1 -1
- package/dist/assets/{liveblocks-D6iO1SmY.js → liveblocks-BSDLCmF2.js} +1 -1
- package/dist/assets/{lottie-BWZi4J-8.js → lottie-DG71PfmK.js} +1 -1
- package/dist/assets/{mui-DqRlPgPp.js → mui-BBkBdMVO.js} +1 -1
- package/dist/assets/{pathToGoBack-DvdlIQjg.js → pathToGoBack-BJj5tqvK.js} +1 -1
- package/dist/assets/{pdf-BpZ3cLIj.js → pdf-Cp8DoYAG.js} +3 -3
- package/dist/assets/{pdf-lib-CNmHIzRc.js → pdf-lib-BqwRJQ00.js} +1 -1
- package/dist/assets/{plaid-BzyOi-ir.js → plaid-DHvUog4a.js} +1 -1
- package/dist/assets/{pusher-BMtiLftw.js → pusher-DsZLo3j0.js} +1 -1
- package/dist/assets/{react-CmUCRpgB.js → react-BPL_4xi4.js} +1 -1
- package/dist/assets/{react-TFItAO3U.js → react-BUTkVbbW.js} +1 -1
- package/dist/assets/{react-D3MVFA0D.js → react-D4RyndA4.js} +1 -1
- package/dist/assets/{react-BJh7Ho8n.js → react-DpONCvOo.js} +1 -1
- package/dist/assets/{react-Djxq7qii.js → react-Uu6ZW5p-.js} +1 -1
- package/dist/assets/{react-DxEGkukB.js → react-zGcoIiO8.js} +1 -1
- package/dist/assets/{recharts-Dt8dM4EI.js → recharts-BzjcN9SN.js} +1 -1
- package/dist/assets/{routePaths-DPqSbEW8.js → routePaths-XreQojZr.js} +1 -1
- package/dist/assets/{sentry-DJeJwz74.js → sentry-67DqaLi1.js} +1 -1
- package/dist/assets/{url-CawXuWkK.js → url-D5ovKX_j.js} +1 -1
- package/dist/assets/{url-Cab0ioG_.js → url-DgheZiFv.js} +1 -1
- package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-CvDMoudE.js +1 -0
- package/dist/assets/useAskAiCfoHostNavButtonProps-CDnIxewv.js +1 -0
- package/dist/assets/{useDeviceId-CYAkkrZp.js → useDeviceId-CZrGGxHD.js} +1 -1
- package/dist/assets/useInitialThreadRequest-BHiBt2ra.js +1 -0
- package/dist/assets/{utils-CGva6Exy.js → utils-C7uJ9upL.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-CklFSvII.js → withTransactionSidePanel-C7OFQuvJ.js} +1 -1
- package/dist/assets/{zeni-epic-state-22WFBgK9.js → zeni-epic-state-B3AwsZqW.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +2 -2
- package/dist/assets/AddressRoutes-C4ikWgPo.js +0 -1
- package/dist/assets/AiCfoScreen-Bg9ijLCA.js +0 -22
- package/dist/assets/ConnectionAuthScreen-rIEFWD8p.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-BYdpJPsr.js +0 -1
- package/dist/assets/DashboardRoutes-BdO71Zfj.js +0 -20
- package/dist/assets/DrawerScreen-ueiFgeV8.js +0 -1
- package/dist/assets/EntityDetailRoutes-BDYJNo-V.js +0 -1
- package/dist/assets/FeaturePreviewScreen-C2KS_KpA.js +0 -1
- package/dist/assets/MagicLinkSignInScreen-GKE3oNCV.js +0 -12
- package/dist/assets/MobileAppDrawer-DFwRXpE0.js +0 -1
- package/dist/assets/NotFoundScreen-C4a6Q5Lb.js +0 -1
- package/dist/assets/OAuthConsentScreen-ChC9fP6N.js +0 -1
- package/dist/assets/PeopleRoutes-CeW1yv_N.js +0 -22
- package/dist/assets/PerformanceRoutes-COmcQAYA.js +0 -1
- package/dist/assets/ReferralListScreen-BaQmHM5w.js +0 -5
- package/dist/assets/ReimbursementApprovalRoutes-mwgyiXL7.js +0 -1
- package/dist/assets/ReportsRoutes-HX8_E7zU.js +0 -1
- package/dist/assets/RewardsRoutes-CszUbBSt.js +0 -1
- package/dist/assets/ScreenRoutes-BXmEXdCM.js +0 -2
- package/dist/assets/SignOutScreen-DjrE-8HT.js +0 -9
- package/dist/assets/TaskRoutes-DmrwyMwf.js +0 -9
- package/dist/assets/WiseConfirmationScreen-CAo6wnNv.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-pkvytZBY.js +0 -9
- package/dist/assets/getLocaleForTenant-zP94FwPU.js +0 -1
- package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-B_ZCAUsA.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-h3l_262v.js +0 -1
- package/dist/assets/useInitialThreadRequest-DZ6IEgJ5.js +0 -1
package/dist/assets/{CustomerOnboardingRoutes-52j6GlB4.js → CustomerOnboardingRoutes-BeOSK0bV.js}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-
|
|
1
|
+
import{j as a}from"./liveblocks-BSDLCmF2.js";import{t as Ke,A as Ce}from"./AddressScreen-C1kNIoFW.js";import $e from"./NotFoundScreen-DjvK1NbN.js";import{a as g}from"./sentry-67DqaLi1.js";import{h as oe,g as se,u as ie,i as re,j as A,N as E,n as ce,l as ze,o as qe,p as z}from"./core-B20PugrR.js";import{F as de,k as le,z as B,w as ue,m as Me,I as _,s as V,N as J,d as N,x as we,f as Y,ap as Qe,p 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 Ye}from"./index-D8hCAHx9.js";import{bn as Xe,eP as ee,fg as et,e_ as pe,eY as me,bt as tt,mR as at,fc as nt,bO as ot,jf as ae,ji as ve,JP as st,bT as it,c2 as ge,sp as fe,sa as rt,Kj as X,sq as _e,HH as ct,kj as Ue,Kk as Ve,Kl as dt,Km as lt,Kn as ut,jd as pt,jg as mt,sc as Be,so as gt,bE as Te,cv as ft,sC as xe,qc as ht,q0 as yt,kb as bt,fE as St,fD as Ct,fC as kt,Ko as It,s4 as Et,sD as Tt,sG as xt,sJ as Ot,sP as Pt,cT as Dt}from"./zeni-epic-state-B3AwsZqW.js";import{n as he}from"./mui-BBkBdMVO.js";import{g as At,h as Ft,q as ne}from"./QBOConnectionScreen-BRbkYHuP.js";import"./recharts-BzjcN9SN.js";import"./analytics-B35UERag.js";import"./plaid-DHvUog4a.js";import"./dnd-CTNaOehy.js";import"./stripe-DMRn4zHo.js";import"./lottie-DG71PfmK.js";import"./lexical-BDpP_OMn.js";import"./pdf-Cp8DoYAG.js";import"./utils-C7uJ9upL.js";import"./empty-DbjE3Pml.js";import"./pdf-lib-BqwRJQ00.js";import"./index-qbNk-Sh2.js";import"./url-D5ovKX_j.js";import"./index-Dx-tgz0s.js";import"./decodeURIComponentSafe-HZX6LUOb.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="36ddb3ec-687c-4720-88eb-df85f94ddafb",t._sentryDebugIdIdentifier="sentry-dbid-36ddb3ec-687c-4720-88eb-df85f94ddafb")}catch{}})();const jt=ce(function(t,o){const s=[];o.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),o.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),o.shouldFetchZeniAccountsPromoCard===!1&&s.push("zeni_accounts_promo_card"),o.shouldFetchRewardsPlanCard===!1&&s.push("rewards_card"),o.isExpenseAutomationEnabledForUser===!1&&s.push("expense_automation_card");const u=nt(t,s,o.signedInUser,o.isExpenseAutomationFeatureEnabledV2,o.isExpenseAutomationEnabledForUser,o.isTreasuryEnabled);return{dashboardFetchState:ot(u.reportsInOrder.map(d=>({fetchState:d.fetchState,error:d.error}))).fetchState}},function(t,o){const{themeState:s,navigate:u,location:d}=o;return{onZeniLogoClick:()=>{s.toggle()},onDashboardFetchDone:()=>{const r=V(d.state?.pathnameStackToGoBack,d.pathname);u("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Qe),wt=()=>{const t=oe(),o=se(),s=ie(),u=de(),[d,r]=g.useState(!1),[p,b]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),f=Xe(i),{useFeatureGate:m}=ue(),I=Me(),{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),K=C||U&&f,c=A(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),j=c.company!=null&&et(c.company),R=L&&j,O=A(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 w=pe(F,c),P=me(c),D=[],Q=S?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,$=S?.resources?.find(l=>l.resource==="/reports/task_card")==null,q=c?.userRole!=null&&tt(c?.userRole),v=S?.resources?.find(l=>l.resource==="/bills")==null&&!q,M=S?.resources?.find(l=>l.resource==="/reimbursements")==null;if(Q===!1&&D.push("top_expenses"),$===!1&&D.push("task_card"),v===!1&&D.push("bill_pay_card","bill_pay_promo_card"),M===!1&&D.push("reimbursement_card","reimbursement_promo_card"),k===!1&&D.push("zeni_accounts_promo_card"),h===!1&&D.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||w||P||(r(!0),s(at(i.userId,G,c.tenantId,!0,!1,D)))},[d,O,w,P,i,c.tenantId,s]),g.useEffect(()=>{(w||P)&&setTimeout(()=>{b(!0)},5e3)},[w,P]),O!=="Completed")return a.jsx(E,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(w)return a.jsx(E,{to:"../../checking",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}});if(P)return a.jsx(E,{to:"../../cards",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(J,{analytics:N,onLoad:l=>(Z=>Z.trackPageLoaded(Y.Event.onboardingDashboardActivation))(l)}),a.jsx(jt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:T,isArAgingFeatureEnabled:x,shouldFetchZeniAccountsPromoCard:k,shouldFetchRewardsPlanCard:h,isExpenseAutomationEnabledForUser:K,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:R,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(we,{fetchState:"In-Progress",style:{backgroundColor:I.colors.grey5}})},Oe=he.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
background-color: ${t=>t.theme.colors.grey4};
|
|
5
|
-
`,Pe=
|
|
5
|
+
`,Pe=he.div`
|
|
6
6
|
display: flex;
|
|
7
7
|
flex-direction: column;
|
|
8
8
|
align-items: center;
|
|
@@ -16,8 +16,8 @@ import{j as a}from"./liveblocks-D6iO1SmY.js";import{t as Ke,A as Ce}from"./Addre
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
${t=>t.windowSize!=="small"?"overflow: auto;":""}
|
|
19
|
-
`,De=ce(function(t,o){const{companyId:s,isAdmin:u,currentTenant:d,isOnAddressPage:r}=o,p=B.getSignedInUser(),
|
|
19
|
+
`,De=ce(function(t,o){const{companyId:s,isAdmin:u,currentTenant:d,isOnAddressPage:r}=o,p=B.getSignedInUser(),b=d.tenantId,e={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:b??""},n=ee(t),i=fe(t,s),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,o){const{companyId:s,currentTenant:u,themeState:d,navigate:r,location:p}=o,{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(s,!0,!1))},handleOnConnectClick:()=>{N.trackOnboardingConnectQBO(),ne.handleClick()},updateQBOPopupState:e=>{t(X({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:K,ownership:c,isSelectedForVerification:L,userVerificationStatus:j,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:K.selectedOption,ownershipInCompany:c,documentTypeSelectedForVerification:S,isSelectedForVerification:L,userVerificationStatus:j,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:K,typeOfIncorporation:c,stateOfIncorporation:L,incDate:j,companySourceOfFunds:R,companySourceOfFundsDescription:O,companySubIndustry:S,countriesOfOperations:G,purposeOfAccount:w,purposeOfAccountDescription:P,regulatedStatus:D,regulatedStatusDescription:Q,transactionVolume:$,transactionVolumeDescription:q,usNexus:v,usNexusTypes:M}=e,l={companyId:s,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:K,incDate:j!=null?Te(j?.toString()):j,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:w?.selectedOption??"",purposeOfAccountDescription:P,regulatedStatus:D??"",regulatedStatusDescription:Q,transactionVolume:$?.selectedOption??"",transactionVolumeDescription:q,usNexus:v,usNexusTypes:M?.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=Ae(b,e,n),f=V(p.state?.pathnameStackToGoBack,p.pathname);r(i,{state:{pathnameStackToGoBack:f}})},onRegisteredAddressClick:(e,n)=>{const i=Ae(b,e,n),f=V(p.state?.pathnameStackToGoBack,p.pathname);r(i,{state:{pathnameStackToGoBack:f}})},onUpdateCustomerView:(e,n,i)=>{t(gt(s,!1,n,i,e))},onAddressEditHandler:e=>{if(e!=null){const n=Ke(e);t(Ue({addressType:"subscription_billing_address",addressToCreate:n}))}},onSkipSetupClick:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);t(Be(s,!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(X({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:o=!1,appContent:s})=>{const u=oe(),d=se(),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=A(y=>y.onboardingCustomerViewState.fetchState),F=A(y=>y.onboardingCustomerViewState.currentStep),K=A(y=>y.onboardingCustomerViewState.uiState),c=A(y=>ee(y)),L=A(y=>y.userRoleConfigState.fetchState),j=A(y=>y.cardPaymentViewState),R=ke(j.addCardPaymentSourceStatus.fetchState),O=j.addCardPaymentSourceStatus.fetchState,{code:S,realmId:G,state:w}=At(d.search),P=c.externalConnections?.accounting[0],D=P?.connectionType,Q=P?.connectionName,$=P?.connectionId??"",q=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,w,$,q)===!0&&c.externalConnections?.saveConnectionState!=="In-Progress"&&C==="Completed"&&(r(st(c.tenantId,{connection_type:D??"accounting",connection_name:Q??"quickbooks_online",authorization_code:S,realm_id:G,connection_id:$,user_id:q},it(window.location.origin+"/onboarding/auth"))),N.trackOnboardingSaveQBOConnection(G,$),u(d.pathname))},[S,G,w,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,M=ge(c?.userRole??[]),l=A(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"||!K.isQBOPopupOpen||F!=="qbo_connection"||r(X({isQBOPopupOpen:!1}))},[c.externalConnections?.saveConnectionState]),g.useEffect(()=>{C==="Completed"&&U&&(r(_e({step:"qbo_connection"})),r(X({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(Y.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(De,{navigate:u,location:d,companyId:v,currentTenant:c,isAdmin:M,isOnAddressPage:o,themeState:b,googleAPIKey:te.googleMapsAPIKey}),s!=null?a.jsx(Pe,{windowSize:p,children:s}):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(De,{navigate:u,location:d,companyId:v,currentTenant:c,isAdmin:M,isOnAddressPage:o,themeState:b,googleAPIKey:te.googleMapsAPIKey}),s!=null?a.jsx(Pe,{windowSize:p,children:s}):null]});return null};function Ae(t,o,s){let u=`/${t}/onboarding/address`;return u=s!=null?u.concat(`/edit/${o}/${encodeURIComponent(s)}`):u.concat(`/new/${o}`),u}const Fe=he.div`
|
|
20
20
|
display: flex;
|
|
21
21
|
height: 100vh;
|
|
22
22
|
background-color: ${t=>t.theme.colors.grey4};
|
|
23
|
-
`,
|
|
23
|
+
`,je=ce(function(t,o){const{companyId:s,currentTenant:u}=o,d=fe(t,s),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,o){const{currentTenant:s,themeState:u,navigate:d,location:r}=o,{tenantEmailDomain:p}=s;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"}})}}})(Ye),vt=()=>{const t=oe(),o=ie(),s=se(),u=de(),{useFeatureGate:d}=ue(),{isFeatureEnabled:r}=d(_.isDebitCardFeatureEnabled),{tenantEmailDomain:p}=re(),b=le(),[e,n]=g.useState(!1);g.useEffect(()=>{e===!1&&s.state?.message==="OnboardingThankyou"&&n(!0)},[s.state]);const i=A(h=>ee(h)),f=i.productSettings.isOtherProductsEnabled;g.useEffect(()=>{o(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=A(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(Y.Event.onboardingLandingPage,"Onboarding",Dt(i.productSettings))}}),a.jsx(je,{navigate:t,showUpdatePaymentDetailButton:f,location:s,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(Y.Event.onboardingInterimPage)}}),a.jsx(je,{navigate:t,showUpdatePaymentDetailButton:f,location:s,companyId:m,currentTenant:i,themeState:u,isVisitingFirstTime:e})]}):a.jsx(we,{fetchState:x}):I?a.jsx(E,{to:"../../checking"}):T?a.jsx(E,{to:"../../cards"}):a.jsx(E,{to:"../../dashboard"})};function oa(){return a.jsxs(qe,{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(wt,{})}),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($e,{})})]})}export{oa as default};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import{j as d}from"./liveblocks-BSDLCmF2.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-B20PugrR.js";import{eP as U,KE as Xe,bE as sa,bq as xe,LR as In,i3 as Tn,LS as Nt,LT as xn,i6 as bt,LU as Qe,LV as Dn,ib as wn,LW as $t,LX as Fn,ig as Ct,LY as He,LZ as On,cl as St,L_ as Pn,L$ as Mn,KY as Rn,j9 as Bn,M0 as jn,bn as Ge,M1 as ra,Ks as ce,bc as ia,jn as ca,m$ as la,j6 as da,Ku as le,Kt as ee,eO as ua,eU as Ln,fq as kt,M2 as Un,M3 as Gn,M4 as ma,M5 as Re,uh as Ye,ui as Ve,uF as De,uz as de,um as Ne,M6 as Yn,M7 as Vn,M8 as Nn,M9 as pa,Ma as Be,Mb as $n,dE as Je,qM as ha,Mc as zn,Md as Kn,Me as qn,Mf as yt,JR as At,jD as we,uN as vt,qU as Zn,Mg as Qn,uj as zt,qP as Ie,qL as fa,Mh as ge,Mi as Hn,Mj as Et,JQ as It,sT as ga,Mk as Wn,Ml as Xn,Mm as Jn,Mn as Tt,t4 as eo,Mo as to,ul as Kt,sS as ba,Mp as be,Mq as ao,bt as Ca,uR as ka,Mr as no,Ms as oo,Mt as so,Mu as xt,uM as ro,Mv as io,uk as qt,uQ as _a,Mw as Ce,Mx as co,My as lo,Mz as Sa,js as ya,mY as Aa,jx as va,mW as Ea,mV as Ia,mU as Ta,sf as uo,fg as mo,cN as po,cO as ho,mR as fo,fc as go,n6 as bo,DV as Zt,MA as Co,MB as ko,MC as _o,MD as So,b5 as et,f4 as yo,gO as Ao,fG as vo,n0 as Eo,i$ as Io,mZ as To,mX as xo,e_ as Do,eY as wo}from"./zeni-epic-state-B3AwsZqW.js";import{z as j,a2 as ae,s as D,d as x,O as q,aU as Fo,_ as $e,N as ze,aV as xa,f as N,aW as Oo,k as _e,aX as Da,w as Se,I as R,m as Po,aY as Mo,aZ as Ro,W as wa,p as Fa,a as Oa,Z as Bo,a_ as jo,U 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,r as Vo,Y as No,b3 as $o,b4 as zo,b5 as Ko,b6 as ke}from"./index-D8hCAHx9.js";import{n as Dt}from"./mui-BBkBdMVO.js";import{a as b}from"./sentry-67DqaLi1.js";import{w as ja}from"./withTransactionSidePanel-C7OFQuvJ.js";import{c as La,t as Fe,f as ue,a as wt,v as qo}from"./routePaths-XreQojZr.js";import{u as ne}from"./useAskAiCfoHostNavButtonProps-CDnIxewv.js";import Ue from"./NotFoundScreen-DjvK1NbN.js";import{u as Ft}from"./useInitialThreadRequest-BHiBt2ra.js";import{t as Ua}from"./analyticsHelper-D8sAsSDg.js";import{C as Zo}from"./CompanyPassportScreen-CoCoQTkp.js";import{u as Qo}from"./useAiCfoDashboardSuggestedQuestionsChips-CvDMoudE.js";import{F as Ho}from"./FeaturePreviewScreen-C1-h6LMu.js";import{R as Wo}from"./ReferralListScreen-C5_wj8jW.js";import"./recharts-BzjcN9SN.js";import"./analytics-B35UERag.js";import"./plaid-DHvUog4a.js";import"./dnd-CTNaOehy.js";import"./stripe-DMRn4zHo.js";import"./lottie-DG71PfmK.js";import"./lexical-BDpP_OMn.js";import"./pdf-Cp8DoYAG.js";import"./utils-C7uJ9upL.js";import"./TransactionDetailScreen-BSarw1vq.js";import"./decodeURIComponentSafe-HZX6LUOb.js";import"./MobileAppDrawer-CgbJlL9u.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]="955bc4d5-6a30-4c03-a92d-3dc788074429",e._sentryDebugIdIdentifier="sentry-dbid-955bc4d5-6a30-4c03-a92d-3dc788074429")}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
|
+
display: flex;
|
|
3
|
+
flex: 1 1 auto;
|
|
4
|
+
min-height: 100%;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
7
|
+
`,is=Dt.div`
|
|
8
|
+
display: flex;
|
|
9
|
+
flex: 1 1 auto;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
align-items: center;
|
|
12
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
13
|
+
`;function cs({title:e,reportId:a,entityAutoCompleteView:t,autoCompleteText:n,isAiCfoAccessEnabled:o,onAskAiCfoClick:r}){const s=W(),i=z(),c=H(),{tenantEmailDomain:m}=K(),g=Po();return d.jsxs(rs,{children:[d.jsx(Mo,{source:a==="cash_balance"?"CashBalanceDetailScreen":"CardBalanceDetailScreen",title:e,onBackClick:()=>{s("../")},hideSearchBtn:!0,backgroundColor:g.colors.grey4,searchAutoComplete:{autoCompleteData:{entityAutoCompleteView:t,autoCompleteText:n},autoCompleteActions:{onAutoCompleteInputChange:C=>{C.trim().length>=2?i(le({searchString:C,searchOrigin:"navbar"})):C.trim().length===0&&i(ee("navbar"))},onAutoCompleteEntity:C=>{n!=null&&x?.trackSearch(N.Event.search,ls(a),C.type,C.name,n);const u=ue(C,m),l=D(c.state?.pathnameStackToGoBack,c.pathname);s(u,{state:{pathnameStackToGoBack:l}})}}},rightSideComponent:d.jsx(Ro,{isAiCfoAccessEnabled:o,onAskAiCfoClick:r})}),d.jsx(is,{children:a==="cash_balance"?d.jsx(os,{}):d.jsx(ss,{})})]})}function Qt(){const e=H(),a=z(),{useFeatureGate:t}=Se(),{isFeatureEnabled:n}=t(R.isDepositAccountsFeatureEnabled),o=_(p=>p.cashBalanceState.fetchState),r=_(p=>p.cardBalanceState.fetchState),s=j.getSignedInUser();if(s==null)throw Error("Can't access dashboard detail without signing in...");const i=ra((p=>{const f=ia(p,"/").split("/");return f[f.length-1]})(e.pathname));let c="Not-Started",m="";const g=q.getLocalizedStrings();switch(i){case"cash_balance":c=o,m=g.reportTitleById.cash_balance;break;case"card_balance":c=r,m=g.reportTitleById.card_balance;break;default:console.error(`${i} is not supported!`)}const{isAiCfoAccessEnabled:C,onAskAiCfoClick:u}=ne({mobileExploreReferrer:i==="card_balance"?"Card Balance":"Cash Balance"});$e({isDataReady:c==="Completed"});const l=_(p=>p.entityAutoCompleteState.autoCompleteText.navbar),h=_(p=>ce(p,"navbar"));return b.useEffect(()=>{c==="Not-Started"&&function(p,f,A){switch(f){case"card_balance":p(da());break;case"cash_balance":p(ca()),A===!0&&p(la());break;default:throw new Error(`balance report type ${f} is not yet supported`)}}(a,i,n)},[s,a,c]),d.jsxs(d.Fragment,{children:[c==="Completed"?d.jsx(ze,{analytics:x,onLoad:p=>((f,A)=>{switch(A){case"card_balance":f.trackPageLoaded(N.Event.cardBalance);break;case"cash_balance":f.trackPageLoaded(N.Event.cashBalance);break;default:console.error(`Analytics: Not tracking Page Loaded for ${A}!`)}})(p,i)}):null,d.jsx(cs,{title:m,reportId:i,autoCompleteText:l,entityAutoCompleteView:h,isAiCfoAccessEnabled:C,onAskAiCfoClick:u})]})}const ls=e=>{switch(e){case"cash_balance":return"Cash Balance";case"card_balance":return"Card Balance";default:return"Dashboard"}},ds=[];function Ke(e){const{mobileExploreReferrer:a}=e,t=z(),n=W(),o=H(),{tenantEmailDomain:r}=K(),{setIsAiCfoOpen:s,setAiCfoSidePanelQuestionToSubmit:i}=wa(),c=Fa(),m=Ba(c),g=oa(),C=_(O=>O.tenantState.fetchState==="Completed"||O.tenantState.activeTenantFetchState.fetchState==="Completed"?U(O):void 0),u=C?.masterTOSInfo?.isMasterTOSAccepted??!1,l=_(O=>ua(O)),h=l.uiState?.currentChatSessionId,p=l.allSessionsWithOrderedQuestionAnswers??ds,f=j.getSignedInUser()?.userId,A=Oa(),E=Bo()&&A&&r!=null,S=jo(),I=Lo(!0),T=_(O=>S!=null?Ln(O,S):void 0),{useDynamicConfig:L}=Se(),{configValue:k}=L(Pa.aiCfoMessageDynamicConfig),y=b.useMemo(()=>Array.isArray(k.default_message_list)?k.default_message_list:[],[k.default_message_list]),M=b.useMemo(()=>y.slice(0,2),[y]),X=S!=null&&T!=null&&T.fetchState!=="Completed"&&T.fetchState!=="Error"&&(I||T.fetchState==="In-Progress"),Oe=b.useMemo(()=>{if(S==null||T?.fetchState==="Error")return M;if(X)return[];const O=(T?.suggestedQuestions??[]).map(pe=>pe.trim()).filter(pe=>pe.length>0).slice(0,2);return O.length===0?M:O},[M,X,S,T?.fetchState,T?.suggestedQuestions]),Pe=b.useCallback((O,pe)=>{if(f==null||O.trim()==="")return;if(!u)return void se({location:o,navigate:n,mergeState:{referrer:a}});const Me=Ma(g.getState());if(m){const Ze=D(o.state?.pathnameStackToGoBack,o.pathname);n(`/${r}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:Ze,referrer:a,aiCfoInitialQuestion:O,aiCfoShouldSubmit:!Me}})}else{if(Me)return t(kt(O)),void s(!0);i(O),s(!0),Ra(t,O,"insights_section",h,p,f,pe,void 0)}},[p,h,t,u,m,o,a,n,s,i,g,r,f]),me=b.useCallback(()=>{if(u)if(m){const O=D(o.state?.pathnameStackToGoBack,o.pathname);n(`/${r}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:O,referrer:a}})}else s(!0);else se({location:o,navigate:n,mergeState:{referrer:a}})},[u,m,o,a,n,s,r]);return b.useMemo(()=>{if(E)return{isSuggestedQuestionsLoading:X,onAskSomethingElseClick:me,onSuggestedQuestionClick:Pe,suggestedQuestions:Oe}},[E,X,me,Pe,Oe])}const qe=Uo,us=te(function(e){const a=Un(e),t=Gn(e),n=ma(e),{scrollPosition:o,...r}=n,s=q.getLocalizedStrings().reportTitleById.cash_in_cash_out,i=j.getSignedInUser(),c=e.tenantState.currentTenantId,m=U(e),g=m?.companyName??"",C={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},u=e.entityAutoCompleteState.autoCompleteText.navbar,l=ce(e,"navbar");return{selectedRangeReport:a,reportLabels:{reportTitle:s},highlightedRangeReport:t,uiState:r,scrollPosition:o,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:g,statementEndPoint:`${ae}/statement`,authParams:C},analytics:x,autoCompleteData:{autoCompleteText:u,entityAutoCompleteView:l}}},function(e,a){return{updateDownloadStateHandler:t=>{e(Yn(t))},onTimeframeSelectionChanged:()=>{},onCOABalancesRangeChanged:(t,n)=>{e(Ne(t,n)),e(Re({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(De("month")),e(de(a.firstMonthOfFY,t)),e(Re({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ye(a.firstMonthOfFY,t,o,n)),n.length>0&&e(Ve(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.isCompareModeOn!==t&&setTimeout(()=>e(Re({resetLeftScroll:!0})),50)},onElementCollapseStateChanged:(t,n)=>{e(Re({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(Re({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(le({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(ee("navbar"))},onAutoCompleteEntity:t=>{const n=ue(t,a.tenantEmailDomain),o=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.navigate("../")}}})(qe),ms=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e,{isAiCfoAccessEnabled:o,onAskAiCfoClick:r}=ne({mobileExploreReferrer:"DashboardCashInCashOut"}),s=Ke({mobileExploreReferrer:"DashboardCashInCashOut"}),i=_(c=>ma(c)).mode==="compare_mode";return d.jsx(us,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:a,location:t,isCompareModeOn:i,navigate:n,insightsSectionAiCfoInfo:s,isAiCfoAccessEnabled:o,onAskAiCfoClick:r})},ps=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Je(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},hs=te(function(e){const a=Vn(e),t=Nn(e),n=pa(e),{scrollPosition:o,...r}=n,s=q.getLocalizedStrings().reportTitleById.cash_position,i=j.getSignedInUser(),c=e.tenantState.currentTenantId,m=U(e),g=m?.companyName??"",C={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},u=e.entityAutoCompleteState.autoCompleteText.navbar,l=ce(e,"navbar");return{selectedRangeReport:a,reportLabels:{reportTitle:s},highlightedRangeReport:t,uiState:r,scrollPosition:o,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:g,statementEndPoint:`${ae}/statement`,authParams:C},analytics:x,autoCompleteData:{autoCompleteText:u,entityAutoCompleteView:l}}},function(e,a){return{updateDownloadStateHandler:t=>{e($n(t))},onTimeframeSelectionChanged:t=>{e(De(t)),setTimeout(()=>e(Be({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ne(t,n)),e(Be({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(de(a.firstMonthOfFY,t)),e(Be({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ye(a.firstMonthOfFY,t,o,n)),n.length>0&&e(Ve(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.isCompareModeOn!==t&&setTimeout(()=>e(Be({resetLeftScroll:!0})),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=ps(n),s=t.accountName===""?t.accountDescription:t.accountName;if(o!=null&&r!=null){const i=Fe(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),c=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:c,referrer:"Cash Position"}})}},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(le({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(ee("navbar"))},onAutoCompleteEntity:t=>{const n=ue(t,a.tenantEmailDomain),o=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onTableScroll:t=>{e(Be({scrollPosition:t}))},onBackClick:()=>{a.navigate("../")}}})(qe),fs=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e,{isAiCfoAccessEnabled:o,onAskAiCfoClick:r}=ne({mobileExploreReferrer:"DashboardCashPosition"}),s=Ke({mobileExploreReferrer:"DashboardCashPosition"}),i=_(c=>pa(c)).mode==="compare_mode";return d.jsx(hs,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:a,location:t,isCompareModeOn:i,navigate:n,insightsSectionAiCfoInfo:s,isAiCfoAccessEnabled:o,onAskAiCfoClick:r})},$=(e,a,t,n)=>{e===!1?a!=null&&n("../../",{relative:"path"}):a!=t&&(a!=null&&a.length>0?n(`../${t}`,{replace:!0}):n(`./forecast/${t}`,{replace:!0}))};function dt(){return d.jsxs(gt,{children:[d.jsx(F,{path:"/",element:d.jsx(re,{})}),d.jsx(F,{path:"/:forecastId",element:d.jsx(re,{})}),d.jsx(F,{path:"/:forecastId/*",element:d.jsx(Ue,{})})]})}const gs=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Je(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},bs=te(function(e){const a=ha(e),t=zn(e),n=Kn(e),o=qn(e),r=yt(e),{scrollPosition:s,...i}=r,c=t.reportTitle,m=j.getSignedInUser(),g=e.tenantState.currentTenantId,C=U(e),u=C?.companyName??"",l={userId:m?.userId??"",sessionId:m?.zeniSessionId??"",tenantId:g??""},h=e.entityAutoCompleteState.autoCompleteText.navbar,p=ce(e,"navbar"),f=At(C);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:c},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:u,statementEndPoint:`${ae}/statement`,authParams:l},analytics:x,isZeniUser:Ge(m),autoCompleteData:{autoCompleteText:h,entityAutoCompleteView:p},isZeniCOAUsed:f,isAccountingClassesEnabled:we(e)}},function(e,a){return{updateDownloadStateHandler:t=>{e(Hn(t))},onTimeframeSelectionChanged:t=>{e(De(t)),setTimeout(()=>e(ge({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ne(t,n)),e(ge({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(de(a.firstMonthOfFY,t)),e(ge({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ye(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Ve(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&$(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout(()=>e(ge({resetLeftScroll:!0})),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=gs(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?wt(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):Fe(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),c=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:c,referrer:"Burn Rate"}})}},onElementCollapseStateChanged:(t,n)=>{e(ge({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(ge({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(le({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(ee("navbar"))},onAutoCompleteEntity:t=>{const n=ue(t,a.tenantEmailDomain),o=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.selectedForecastId!=null?a.navigate("../../../"):a.navigate("../")},onForecastToggle:(t,n)=>{e(Ie(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?Te:Ot,n)),t==="forecast_mode"?(e(zt({viewMode:"account_group"})),e(fa(!1,n?.id)),n!=null&&$(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):$(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(ge({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Burn Rate"),e(zt({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(Qn({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(Zn())},onResyncReports:()=>{e(vt("net_burn_or_income_by_classes"))}}})(qe),Cs=e=>{const a=z(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,{isAiCfoAccessEnabled:s,onAskAiCfoClick:i}=ne({mobileExploreReferrer:"DashboardNetBurnOrIncome"}),c=Ke({mobileExploreReferrer:"DashboardNetBurnOrIncome"}),m=_(k=>yt(k)),g=m.isForecastModeOn,C=m.timeframe,u=m.selectedForecast?.id,l=_(k=>Et(k.forecastState,u??"")),h=_(k=>ha(k)),p=_(k=>It(k)),f=_(k=>we(k)),A=m.mode==="compare_mode",E=h.dataAvailable;b.useEffect(()=>{if(u!=null&&g===!0&&($(g,r,u,o),l!=null)){const k=l?.forecastPeriod,y=E!=null&&k.endDate.isAfter(E?.endDate)===!0?E:k;a(de(e.firstMonthOfFY,{startDate:y.endDate.startOf(C),endDate:y?.endDate}))}},[u]);const S=_e(),{useFeatureGate:I}=Se(),{isFeatureEnabled:T}=I(R.isReportsCommentingEnabled),L=Ft(T?S?.currentTenant?.companyId:void 0,{clearParams:h.fetchState==="Completed"});return d.jsx(bs,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,forecastIdFromUrlPath:r,location:n,isAccountingClassesEnabled:f,isCompareModeOn:A,navigate:o,analytics:x,reportsResyncFetchState:p.reportsResyncFetchState,insightsSectionAiCfoInfo:c,isAiCfoAccessEnabled:s,onAskAiCfoClick:i,initialOpenThreadRequest:L,isReportsCommentingEnabled:T})},ks=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Je(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},_s=te(function(e){const a=ga(e),t=Wn(e),n=Xn(e),o=Jn(e),r=Tt(e),{scrollPosition:s,...i}=r,c=q.getLocalizedStrings().reportTitleById.operating_expenses,m=j.getSignedInUser(),g=e.tenantState.currentTenantId,C=U(e),u=C?.companyName??"",l={userId:m?.userId??"",sessionId:m?.zeniSessionId??"",tenantId:g??""},h=e.entityAutoCompleteState.autoCompleteText.navbar,p=ce(e,"navbar"),f=At(C);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:c},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:u,statementEndPoint:`${ae}/statement`,authParams:l},analytics:x,isZeniUser:Ge(m),autoCompleteData:{autoCompleteText:h,entityAutoCompleteView:p},isZeniCOAUsed:f,isAccountingClassesEnabled:we(e)}},function(e,a){return{updateDownloadStateHandler:t=>{e(ao(t))},onTimeframeSelectionChanged:t=>{e(De(t)),setTimeout(()=>e(be({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ne(t,n)),e(be({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(de(a.firstMonthOfFY,t)),e(be({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ye(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Ve(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&$(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout(()=>e(be({resetLeftScroll:!0})),50)},onAccountBalanceClick:a.hasTransactionAccess!==!0?void 0:(t,n)=>{const{timePeriod:o,timeframe:r}=ks(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?wt(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):Fe(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),c=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:c,referrer:"Operating Expenses"}})}},onElementCollapseStateChanged:(t,n)=>{e(be({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(be({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(le({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(ee("navbar"))},onAutoCompleteEntity:t=>{const n=ue(t,a.tenantEmailDomain),o=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.selectedForecastId!=null?a.navigate("../../../"):a.navigate("../")},onForecastToggle:(t,n)=>{e(Ie(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?Te:Ot,n)),t=="forecast_mode"?(e(Kt({viewMode:"account_group"})),e(ba(!1,n?.id)),n!=null&&$(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):$(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(be({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Operating Expenses"),e(Kt({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(to({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(eo())},onResyncReports:()=>{e(vt("operating_expenses_by_classes"))}}})(qe),Ss=e=>{const a=z(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,{isAiCfoAccessEnabled:s,onAskAiCfoClick:i}=ne({mobileExploreReferrer:"DashboardOpEx"}),c=Ke({mobileExploreReferrer:"DashboardOpEx"}),m=_(y=>Tt(y)),g=m.isForecastModeOn,C=m.timeframe,u=m.selectedForecast?.id,l=_(y=>Et(y.forecastState,u??"")),h=_(y=>ga(y)),p=_(y=>It(y)),f=_(y=>we(y)),A=m.mode==="compare_mode",E=h.dataAvailable;b.useEffect(()=>{if(u!=null&&g===!0&&($(g,r,u,o),l!=null)){const y=l?.forecastPeriod,M=E!=null&&y.endDate.isAfter(E?.endDate)===!0?E:y;a(de(e.firstMonthOfFY,{startDate:M.endDate.startOf(C),endDate:M?.endDate}))}},[u]);const S=_e(),I=S?.loggedInUserRole!=null&&Ca(S?.loggedInUserRole)!==!0,{useFeatureGate:T}=Se(),{isFeatureEnabled:L}=T(R.isReportsCommentingEnabled),k=Ft(L?S?.currentTenant?.companyId:void 0,{clearParams:h.fetchState==="Completed"});return d.jsx(_s,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,location:n,isAccountingClassesEnabled:f,isCompareModeOn:A,navigate:o,forecastIdFromUrlPath:r,analytics:x,hasTransactionAccess:I,reportsResyncFetchState:p.reportsResyncFetchState,insightsSectionAiCfoInfo:c,isAiCfoAccessEnabled:s,onAskAiCfoClick:i,initialOpenThreadRequest:k,isReportsCommentingEnabled:L})},ys=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Je(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},As=te(function(e){const a=ka(e),t=no(e),n=oo(e),o=so(e),r=xt(e),{scrollPosition:s,...i}=r,c=q.getLocalizedStrings().reportTitleById.revenue,m=j.getSignedInUser(),g=e.tenantState.currentTenantId,C=U(e),u=C?.companyName??"",l={userId:m?.userId??"",sessionId:m?.zeniSessionId??"",tenantId:g??""},h=e.entityAutoCompleteState.autoCompleteText.navbar,p=ce(e,"navbar"),f=At(C);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:c},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:u,statementEndPoint:`${ae}/statement`,authParams:l},analytics:x,isZeniUser:Ge(m),autoCompleteData:{autoCompleteText:h,entityAutoCompleteView:p},isZeniCOAUsed:f,isAccountingClassesEnabled:we(e)}},function(e,a){return{updateDownloadStateHandler:t=>{e(co(t))},onTimeframeSelectionChanged:t=>{e(De(t)),setTimeout(()=>e(Ce({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ne(t,n)),e(Ce({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(de(a.firstMonthOfFY,t)),e(Ce({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ye(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Ve(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&$(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout(()=>e(Ce({resetLeftScroll:!0})),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=ys(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?wt(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):Fe(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),c=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:c,referrer:"Revenues"}})}},onElementCollapseStateChanged:(t,n)=>{e(Ce({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(Ce({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(le({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(ee("navbar"))},onAutoCompleteEntity:t=>{const n=ue(t,a.tenantEmailDomain),o=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.selectedForecastId!=null?a.navigate("../../../"):a.navigate("../")},onForecastToggle:(t,n)=>{e(Ie(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?Te:Ot,n)),t==="forecast_mode"?(e(qt({viewMode:"account_group"})),e(_a(!1,n?.id)),n!=null&&$(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):$(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(Ce({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Revenues"),e(qt({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(io({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(ro())},onResyncReports:()=>{e(vt("revenue_by_classes"))}}})(qe),vs=e=>{const a=z(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,{isAiCfoAccessEnabled:s,onAskAiCfoClick:i}=ne({mobileExploreReferrer:"DashboardRevenue"}),c=Ke({mobileExploreReferrer:"DashboardRevenue"}),m=_(k=>xt(k)),g=m.isForecastModeOn,C=m.timeframe,u=m.selectedForecast?.id,l=_(k=>Et(k.forecastState,u??"")),h=_(k=>ka(k)),p=h.dataAvailable,f=m.mode==="compare_mode",A=_(k=>we(k)),E=_(k=>It(k));b.useEffect(()=>{if(u!=null&&g===!0&&($(g,r,u,o),l!=null)){const k=l?.forecastPeriod,y=p!=null&&k.endDate.isAfter(p?.endDate)===!0?p:k;a(de(e.firstMonthOfFY,{startDate:y.endDate.startOf(C),endDate:y?.endDate}))}},[u]);const S=_e(),{useFeatureGate:I}=Se(),{isFeatureEnabled:T}=I(R.isReportsCommentingEnabled),L=Ft(T?S?.currentTenant?.companyId:void 0,{clearParams:h.fetchState==="Completed"});return d.jsx(As,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,isAccountingClassesEnabled:A,isCompareModeOn:f,location:n,navigate:o,forecastIdFromUrlPath:r,analytics:x,reportsResyncFetchState:E.reportsResyncFetchState,insightsSectionAiCfoInfo:c,isAiCfoAccessEnabled:s,onAskAiCfoClick:i,initialOpenThreadRequest:L,isReportsCommentingEnabled:T})},Es=e=>{let a,t;if(e.endDate!=null)switch(e.timePeriod){case"this_month_to_date":case"last_month":case"this_week_to_date":case"last_week":a="month",t={startDate:e.endDate.startOf("month"),endDate:e.endDate};break;case"last_3_months":case"last_6_months":case"last_12_months":case"this_year_to_date":case"last_year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;default:console.error(`this timeperiod ${e.timePeriod} is not supported!`)}return{timeframe:a,timePeriod:t}},Is=te(function(e){const a=lo(e),t=e.entityAutoCompleteState.autoCompleteText.navbar,n=ce(e,"navbar");return{report:a,analytics:x,autoCompleteData:{autoCompleteText:t,entityAutoCompleteView:n}}},function(e,a){return{onTimeframeSelectionChanged:t=>{x.trackTimeframeSwitch(Ua(t),"Top Expenses"),e(Sa(t))},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Es(n),s=t.accountName===""?t.accountDescription:t.accountName;if(o!=null&&r!=null){const i=Fe(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),c=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:c,referrer:"Top Expenses"}})}},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(le({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(ee("navbar"))},onAutoCompleteEntity:t=>{const n=ue(t,a.tenantEmailDomain),o=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.navigate("../")}}})(Go),Ts=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e;return d.jsx(Is,{tenantEmailDomain:a,location:t,navigate:n})},xs=Dt.div`
|
|
14
|
+
display: flex;
|
|
15
|
+
flex: 1 1 auto;
|
|
16
|
+
min-height: 100%;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
background-color: ${e=>e.theme.colors.grey5};
|
|
19
|
+
align-items: center;
|
|
20
|
+
`,Te=3,Ot=1;function Ds({fetchState:e,firstMonthOfFY:a,reportId:t,forecastId:n}){const o=W(),r=H(),{tenantEmailDomain:s}=K();let i;$e({isDataReady:!0});const c={firstMonthOfFY:a,tenantEmailDomain:s,location:r,navigate:o,forecastIdFromUrlPath:n,fetchState:e};switch(t){case"operating_expenses":i=d.jsx(Ss,{...c});break;case"revenue":i=d.jsx(vs,{...c});break;case"net_burn_or_income":i=d.jsx(Cs,{...c});break;case"cash_position":i=d.jsx(fs,{...c});break;case"top_expenses":i=d.jsx(Ts,{...c});break;case"cash_in_cash_out":i=d.jsx(ms,{...c});break;default:console.error(`${t} is not supported!`),i=null}return i!=null?d.jsx(xs,{children:i}):null}function re(){const e=H(),a=z(),{forecastId:t}=K();let n="Not-Started";const o=_(l=>Tt(l).fetchState),r=_(l=>xt(l).fetchState),s=_(l=>yt(l).fetchState),i=_(l=>l.cashPositionState.fetchState),c=_(l=>l.topExState.fetchState),m=_(l=>l.cashInCashOutState.fetchState);if(j.getSignedInUser()==null)throw Error("Can't access dashboard detail without signing in...");const g=_(l=>U(l)),C=g?.company?.companyInfo?.firstMonthOfFY??1,u=ra((l=>{const h=ia(l,"/").split("/");return t!=null?h[h.length-3]:h[h.length-1]})(e.pathname));switch(u){case"operating_expenses":n=o;break;case"revenue":n=r;break;case"net_burn_or_income":n=s;break;case"cash_position":n=i;break;case"top_expenses":n=c;break;case"cash_in_cash_out":n=m;break;default:console.error(`${u} is not supported!`)}return b.useEffect(()=>{n==="Not-Started"&&function(l,h,p,f){switch(h){case"operating_expenses":l(Ta(!0)),f!=null&&(l(Ie(p,!0,Te,{id:f,index:0})),l(ba(!1,f)));break;case"revenue":l(Ia(!0)),f!=null&&(l(Ie(p,!0,Te,{id:f,index:0})),l(_a(!1,f)));break;case"net_burn_or_income":l(Ea(!0)),f!=null&&(l(Ie(p,!0,Te,{id:f,index:0})),l(fa(!1,f)));break;case"cash_position":l(va(!0));break;case"top_expenses":l(Aa());break;case"cash_in_cash_out":l(ya());break;default:throw new Error(`report type ${h} is not yet supported`)}}(a,u,C,t)},[t]),d.jsxs(d.Fragment,{children:[n==="Completed"?d.jsx(ze,{analytics:x,onLoad:l=>((h,p)=>{const f=e.state?.referrer;switch(p){case"operating_expenses":h.trackPageLoaded(N.Event.operatingExpenses,f);break;case"revenue":h.trackPageLoaded(N.Event.revenues,f);break;case"net_burn_or_income":h.trackPageLoaded(N.Event.burnRate,f);break;case"cash_position":h.trackPageLoaded(N.Event.cashPosition,f);break;case"top_expenses":h.trackPageLoaded(N.Event.topExpenses,f);break;case"cash_in_cash_out":h.trackPageLoaded(N.Event.cashInCashOut,f);break;default:console.error(`Analytics: Not tracking Page Loaded for ${p}!`)}})(l,u)}):null,d.jsx(Ds,{firstMonthOfFY:C,fetchState:n,reportId:u,forecastId:t})]})}var ut=typeof navigator<"u"&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function mt(e,a,t,n){e.addEventListener?e.addEventListener(a,t,n):e.attachEvent&&e.attachEvent("on".concat(a),function(){t(window.event)})}function Va(e,a){for(var t=a.slice(0,a.length-1),n=0;n<t.length;n++)t[n]=e[t[n].toLowerCase()];return t}function Na(e){typeof e!="string"&&(e="");for(var a=(e=e.replace(/\s/g,"")).split(","),t=a.lastIndexOf("");t>=0;)a[t-1]+=",",a.splice(t,1),t=a.lastIndexOf("");return a}for(var Pt={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":ut?173:189,"=":ut?61:187,";":ut?59:186,"'":222,"[":219,"]":221,"\\":220},ie={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},_t={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},B={16:!1,18:!1,17:!1,91:!1},P={},We=1;We<20;We++)Pt["f".concat(We)]=111+We;var w=[],Ht=!1,$a="all",Wt=[],tt=function(e){return Pt[e.toLowerCase()]||ie[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function Xt(e){$a=e||"all"}function Le(){return $a||"all"}var pt=function(e){var a=e.key,t=e.scope,n=e.method,o=e.splitKey,r=o===void 0?"+":o;Na(a).forEach(function(s){var i=s.split(r),c=i.length,m=i[c-1],g=m==="*"?"*":tt(m);if(P[g]){t||(t=Le());var C=c>1?Va(ie,i):[];P[g]=P[g].filter(function(u){return!((!n||u.method===n)&&u.scope===t&&function(l,h){for(var p=l.length>=h.length?l:h,f=l.length>=h.length?h:l,A=!0,E=0;E<p.length;E++)f.indexOf(p[E])===-1&&(A=!1);return A}(u.mods,C))})}})};function Jt(e,a,t,n){var o;if(a.element===n&&(a.scope===t||a.scope==="all")){for(var r in o=a.mods.length>0,B)Object.prototype.hasOwnProperty.call(B,r)&&(!B[r]&&a.mods.indexOf(+r)>-1||B[r]&&a.mods.indexOf(+r)===-1)&&(o=!1);(a.mods.length!==0||B[16]||B[18]||B[17]||B[91])&&!o&&a.shortcut!=="*"||a.method(e,a)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}function ea(e,a){var t=P["*"],n=e.keyCode||e.which||e.charCode;if(G.filter.call(this,e)){if(n!==93&&n!==224||(n=91),w.indexOf(n)===-1&&n!==229&&w.push(n),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(h){var p=_t[h];e[h]&&w.indexOf(p)===-1?w.push(p):!e[h]&&w.indexOf(p)>-1?w.splice(w.indexOf(p),1):h==="metaKey"&&e[h]&&w.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(w=w.slice(w.indexOf(p))))}),n in B){for(var o in B[n]=!0,ie)ie[o]===n&&(G[o]=!0);if(!t)return}for(var r in B)Object.prototype.hasOwnProperty.call(B,r)&&(B[r]=e[_t[r]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(w.indexOf(17)===-1&&w.push(17),w.indexOf(18)===-1&&w.push(18),B[17]=!0,B[18]=!0);var s=Le();if(t)for(var i=0;i<t.length;i++)t[i].scope===s&&(e.type==="keydown"&&t[i].keydown||e.type==="keyup"&&t[i].keyup)&&Jt(e,t[i],s,a);if(n in P){for(var c=0;c<P[n].length;c++)if((e.type==="keydown"&&P[n][c].keydown||e.type==="keyup"&&P[n][c].keyup)&&P[n][c].key){for(var m=P[n][c],g=m.splitKey,C=m.key.split(g),u=[],l=0;l<C.length;l++)u.push(tt(C[l]));u.sort().join("")===w.sort().join("")&&Jt(e,m,s,a)}}}}function G(e,a,t){w=[];var n=Na(e),o=[],r="all",s=document,i=0,c=!1,m=!0,g="+",C=!1;for(t===void 0&&typeof a=="function"&&(t=a),Object.prototype.toString.call(a)==="[object Object]"&&(a.scope&&(r=a.scope),a.element&&(s=a.element),a.keyup&&(c=a.keyup),a.keydown!==void 0&&(m=a.keydown),a.capture!==void 0&&(C=a.capture),typeof a.splitKey=="string"&&(g=a.splitKey)),typeof a=="string"&&(r=a);i<n.length;i++)o=[],(e=n[i].split(g)).length>1&&(o=Va(ie,e)),(e=(e=e[e.length-1])==="*"?"*":tt(e))in P||(P[e]=[]),P[e].push({keyup:c,keydown:m,scope:r,mods:o,shortcut:n[i],method:t,key:n[i],splitKey:g,element:s});s!==void 0&&!function(u){return Wt.indexOf(u)>-1}(s)&&window&&(Wt.push(s),mt(s,"keydown",function(u){ea(u,s)},C),Ht||(Ht=!0,mt(window,"focus",function(){w=[]},C)),mt(s,"keyup",function(u){ea(u,s),function(l){var h=l.keyCode||l.which||l.charCode,p=w.indexOf(h);if(p>=0&&w.splice(p,1),l.key&&l.key.toLowerCase()==="meta"&&w.splice(0,w.length),h!==93&&h!==224||(h=91),h in B)for(var f in B[h]=!1,ie)ie[f]===h&&(G[f]=!1)}(u)},C))}var ht={setScope:Xt,getScope:Le,deleteScope:function(e,a){var t,n;for(var o in e||(e=Le()),P)if(Object.prototype.hasOwnProperty.call(P,o))for(t=P[o],n=0;n<t.length;)t[n].scope===e?t.splice(n,1):n++;Le()===e&&Xt(a||"all")},getPressedKeyCodes:function(){return w.slice(0)},isPressed:function(e){return typeof e=="string"&&(e=tt(e)),w.indexOf(e)!==-1},filter:function(e){var a=e.target||e.srcElement,t=a.tagName,n=!0;return!a.isContentEditable&&(t!=="INPUT"&&t!=="TEXTAREA"&&t!=="SELECT"||a.readOnly)||(n=!1),n},trigger:function(e){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(P).forEach(function(t){var n=P[t].find(function(o){return o.scope===a&&o.shortcut===e});n&&n.method&&n.method()})},unbind:function(e){if(e===void 0)Object.keys(P).forEach(function(s){return delete P[s]});else if(Array.isArray(e))e.forEach(function(s){s.key&&pt(s)});else if(typeof e=="object")e.key&&pt(e);else if(typeof e=="string"){for(var a=arguments.length,t=new Array(a>1?a-1:0),n=1;n<a;n++)t[n-1]=arguments[n];var o=t[0],r=t[1];typeof o=="function"&&(r=o,o=""),pt({key:e,scope:o,method:r,splitKey:"+"})}},keyMap:Pt,modifier:ie,modifierMap:_t};for(var ft in ht)Object.prototype.hasOwnProperty.call(ht,ft)&&(G[ft]=ht[ft]);if(typeof window<"u"){var ws=window.hotkeys;G.noConflict=function(e){return e&&window.hotkeys===G&&(window.hotkeys=ws),G},window.hotkeys=G}G.filter=function(){return!0};var ta=function(e,a){var t=e.target,n=t&&t.tagName;return!!(n&&a&&a.includes(n))};function Fs(e,a,t,n){t instanceof Array&&(n=t,t=void 0);var o=t||{},r=o.enableOnTags,s=o.filter,i=o.keyup,c=o.keydown,m=o.filterPreventDefault,g=m===void 0||m,C=o.enabled,u=C===void 0||C,l=o.enableOnContentEditable,h=l!==void 0&&l,p=b.useRef(null),f=b.useCallback(function(A,E){var S,I;return s&&!s(A)?!g:!!(ta(A,["INPUT","TEXTAREA","SELECT"])&&!ta(A,r)||(S=A.target)!=null&&S.isContentEditable&&!h)||!!(p.current===null||document.activeElement===p.current||(I=p.current)!=null&&I.contains(document.activeElement))&&(a(A,E),!0)},n?[p,r,s].concat(n):[p,r,s]);return b.useEffect(function(){if(u)return i&&c!==!0&&(t.keydown=!1),G(e,t||{},f),function(){return G.unbind(e,f)};G.unbind(e,f)},[f,e,u]),p}G.isPressed;const Os=[],aa="dashboard_card",J="ai_cfo_dashboard_card";function na(e,a){return a?e.some(t=>String(t)===J)?e.slice():[J,...e]:e.filter(t=>String(t)!==J)}const Ps=["net_burn_or_income_story_card","cash_balance","task_card","card_balance","zeni_promo_card","insights_dashboard","information_card","company_details","bill_pay_promo_card","bill_pay_card","reimbursement_card","reimbursement_promo_card","zeni_accounts_promo_card","rewards_card","treasury_promo_card"],Ms=(e,a,t,n,o)=>({card:{dimension:et(t),cardType:n,cardIndex:o,fetchState:a,disableAnimations:!1,spansFullDashboardWidth:!1},data:e.status!=null?{balanceAmount:e.balance?.available,lastUpdatedTime:e.status.lastRefreshSuccessTime,changePercent:e.balance?.change?.percent,changeComparedToDate:e.balance?.change?.since}:void 0}),je=(e,a,t,n,o)=>({card:{dimension:et(t),cardType:n,cardIndex:o,fetchState:a,disableAnimations:!1,spansFullDashboardWidth:!1},data:e}),Rs=(e,a,t,n)=>je(void 0,e,ke,a,t),Bs=(e,a,t,n,o)=>({card:{dimension:et(ke),cardType:a,cardIndex:t,fetchState:e,disableAnimations:!1,spansFullDashboardWidth:!1},data:{funds:n,hasUserSeenVideo:o,videoUrl:"https://www.youtube.com/watch?v=sqvJWKCMZgk"}}),js=e=>{const a=et(ke);return a.height=ke.height+10,{card:{dimension:a,cardType:J,cardIndex:e,fetchState:"Completed",disableAnimations:!1,spansFullDashboardWidth:!0}}},Ls=te(function(e,a){const t=Ys(a.dashboardReport),n=a.passedCardsOrdered,o=a.dashboardReport.reportsInOrder,{isInterestedInChargeCard:r,cardsCreditLimit:s,cashbackRate:i,treasuryFundDetails:c,hasUserSeenTreasuryVideo:m,treasuryFetchState:g}=a;let C=n.map((u,l)=>{if(u==="reimbursement_promo_card"||u==="bill_pay_promo_card")return Rs(t,u,l);if(u==="zeni_promo_card")return je({isExpressedInterest:r,creditLimit:s,cashbackRate:i,fetchState:"Completed"},a.cardBalanceFetchState,ke,u,l);if(u==="treasury_promo_card")return Bs(g,u,l,c,m);if(u==="information_card")return je(void 0,"Completed",ke,u,l);if(u===J)return js(l);{const h=o.find(p=>p?.reportId===u);return h?function(p,f,A,E){const S=p.reportId;switch(S){case"card_balance":case"cash_balance":return[Ms(p,f,A,S,E)];case"expense_automation_card":case"operating_expenses":case"revenue":case"top_expenses":case"cash_position":case"cash_in_cash_out":case"insights_dashboard":case"company_details":case"task_card":case"bill_pay_card":case"reimbursement_card":case"net_burn_or_income":case"accounts_payable_aging":case"accounts_receivable_aging":case"zeni_accounts_promo_card":case"rewards_card":return[je(p,f,A,S,E)];case"net_burn_or_income_story_card":return[je(p,f,A,"net_burn_or_income_story_card",E)];default:return console.error(`card type ${S} not yet supported!`),[]}}(h,h.fetchState,ke,l):[]}}).flat();return a.isSummaryCardsFiltered===!0&&(C=C.filter(u=>Ps.includes(u.card.cardType)==0).filter(u=>{const l=u.data?.availableNumberOfPeriods;return l!=null?l>0:u.card.cardType!="top_expenses"||u.data==null||function(h){if(h==null||h.length===0)return!0;let p=!0;for(const f of h)if(f.balance.available.amount!==0){p=!1;break}return p}(u.data.topExpenses.accountsOrdered)===!1})),{cardDataArray:C,autoCompleteData:{autoCompleteText:e.entityAutoCompleteState.autoCompleteText.navbar,entityAutoCompleteView:ce(e,"navbar")},analytics:x,isReimbursementEnabled:a.isReimbursementEnabled,isBillPayEnabled:a.isBillPayEnabled}},function(e,a){const t=a.tenantId,n=j.getSignedInUser();return{cardActions:{onCardClick:(o,r,s,i)=>{if(console.warn(`onCardClick at ${o} for the type ${r}`),r==="zeni_promo_card"&&i!=null)x.trackDashboardCardClicked("cards promo",2),x.trackZeniCardsPromoCardClicked(a.isChargeCardFeatureEnabled,i,2,`${n?.firstName??""} ${n?.lastName??""}`,a.isChargeCardFeatureEnabled?a.cardsCreditLimit:void 0),i==="Learn More"?window.open("https://www.zeni.ai/product/business-credit-card","_blank"):a.navigate("../cards/promo",{relative:"path"});else if(a.isForecastOn)switch(r){case"net_burn_or_income":case"operating_expenses":case"revenue":a.navigate(`${r}/forecast/${a.selectedForecastOnDashboard}`,{state:{referrer:s}});break;default:a.navigate(`${r}`,{state:{referrer:s}})}else r==="rewards_card"?(n!=null&&x.trackDashboardCardClicked("rewards promo",o+1),a.navigate("../../rewards/refer",{state:{referrer:s}})):r==="expense_automation_card"?(x.trackMonthEndCloseClicked(a.selectedPeriod.month,a.selectedPeriod.year,"Dashboard"),a.navigate("../../month_end_close_checks/review",{state:{referrer:"Dashboard"}})):a.navigate(`${r}`,{state:{referrer:s}})},onReloadData:(o,r)=>{const s=[];a.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),a.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),a.isZeniAccountEnabled===!1&&s.push("zeni_accounts_promo_card"),a.isRewardsFeatureEnabled===!1&&s.push("rewards_card"),function(i,c,m,g){if(c!==J)switch(c){case"card_balance":i(da());break;case"cash_balance":i(ca());break;case"operating_expenses":i(Ta(!0));break;case"revenue":i(Ia(!0));break;case"net_burn_or_income":i(Ea(!0));break;case"net_burn_or_income_story_card":i(xo(!0));break;case"cash_position":i(va(!0));break;case"top_expenses":i(Aa());break;case"cash_in_cash_out":i(ya());break;case"insights_dashboard":i(To());break;case"bill_pay_card":i(Io());break;case"reimbursement_card":i(Eo());break;case"company_details":i(vo(m));break;case"task_card":i(Ao());break;case"accounts_payable_aging":g.includes("accounts_payable_aging")===!1&&i(bt(xe()));break;case"accounts_receivable_aging":i(Ct(xe()));break;case"zeni_accounts_promo_card":g.includes("zeni_accounts_promo_card")===!1&&i(la());break;case"rewards_card":g.includes("rewards_card")===!1&&i(yo(!0));break;default:throw new Error(`report type ${c} is not yet supported`)}}(e,r,a.companyId,s)},onTimeframeChange:(o,r)=>{x.trackTimeframeSwitch(Ua(r),Gs(o),"Dashboard"),function(s,i,c){switch(i){case"operating_expenses":case"revenue":case"net_burn_or_income":case"cash_position":s(De(c));break;case"top_expenses":s(Sa(c));break;default:throw new Error(`report type ${i} doesn't support changeTimeframe`)}}(e,o,r)},onUpdateSelectedInsightIndex:o=>{e(So(o))},onCategoryClick:(o,r,s)=>{o==="bill-pay"?a.navigate("../bills",{state:{tab:r,subTab:s},relative:"path"}):o==="reimbursement"?a.navigate("../reimbursements",{state:{tab:r,subTab:s},relative:"path"}):o==="uncategorized-account-mapping"?a.navigate("../settings/accounting",{relative:"path"}):o==="show-all-tasks"?a.navigate("../tasks",{relative:"path"}):a.navigate(`../../transactions/${o}`)},onCardBtnClick:(o,r)=>{if(o==="bill_pay_promo_card"){const s="../bills",i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i},relative:"path"})}else if(o==="reimbursement_promo_card"){const s="../reimbursements",i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i},relative:"path"})}else if(o==="zeni_accounts_promo_card")if(a.hasZeniAccountsAdminAccess){let s="../checking/promo";r!=null&&(s=`../checking/${r}`);const i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i},relative:"path"})}else window.open("https://www.zeni.ai/product/business-checking-accounts","_blank");else if(o==="treasury_promo_card")if(a.isUserHasTreasuryAccess){j.saveTreasuryPopupSeen(a.tenantEmailDomain,!0);const s="../treasury",i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i},relative:"path"})}else window.open("https://www.zeni.ai/product/treasury","_blank")},onSaveClick:(o,r,s)=>{o==="net_burn_or_income_story_card"&&(x.trackUpdateBurnRateCalculatorSettings(r,s,ko(s)),e(_o(t,r,s)))},onVideoPlay:()=>{e(Zt())},onVideoClose:()=>{e(Zt()),e(Co())}},autoCompleteActions:{onAutoCompleteInputChange:o=>{o.trim().length>=2?e(le({searchString:o,searchOrigin:"navbar"})):o.trim().length===0&&e(ee("navbar"))},onCancelAutoComplete:()=>{e(ee("navbar"))},onAutoCompleteEntity:o=>{let r="";r=o.type!=="vendor"||o.detailType!=="bank_merchant"&&o.detailType!=="card_merchant"?ue(o,a.tenantEmailDomain):qo(o.zeniId,o.qboId,a.tenantEmailDomain);const s=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(r,{state:{pathnameStackToGoBack:s,referrer:"Search"}})}}}})(Ko);function Us(){const e=oa(),a=Fa(),t=Ba(a),{isAiCfoOpen:n,setIsAiCfoOpen:o,setAiCfoSidePanelQuestionToSubmit:r}=wa(),s=W(),i=z(),c=H(),m=j.getSignedInUser(),{useFeatureGate:g,useDynamicConfig:C}=Se(),u=Ge(m),[l,h]=b.useState(!1),[p,f]=b.useState(!1),A=Oa(),{tenantEmailDomain:E}=K(),{isAiCfoAccessEnabled:S,onAskAiCfoClick:I}=ne({mobileExploreReferrer:"Dashboard"}),T=_(v=>v.tenantState.fetchState==="Completed"||v.tenantState.activeTenantFetchState.fetchState==="Completed"?U(v):void 0),L=T??j.getSignedInUserTenant(E),k=T?.masterTOSInfo?.isMasterTOSAccepted??!1,y=L.tenantId,M=L.companyId;b.useEffect(()=>{l===!1&&c.state?.message==="activation"&&(i(uo(M)),h(!0))},[c.state,l,M,i]),b.useEffect(()=>{A&&!p&&c.state?.message==="open_ai_cfo_drawer"&&(f(!0),k?(o(!0),s({pathname:c.pathname,search:c.search,hash:c.hash},{replace:!0,state:{...c.state,message:void 0}})):se({location:c,navigate:s,mergeState:{referrer:"Dashboard",message:void 0}}))},[c,p,A,k,o,s]);const{isFeatureEnabled:X}=g(R.isApAgingFeatureEnabled),{isFeatureEnabled:Oe}=g(R.isExpenseAutomationEnabled),{isFeatureEnabled:Pe}=g(R.isExpenseAutomationEnabledV2),me=Pe||Oe&&u,{isFeatureEnabled:O}=g(R.isTreasuryEnabled),pe=Yo(me),{isFeatureEnabled:Me}=g(R.isArAgingFeatureEnabled),{isFeatureEnabled:Ze}=g(R.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Mt}=g(R.isReferralFeatureEnabled),{isFeatureEnabled:za}=g(R.isChargeCardFeatureEnabled),{isFeatureEnabled:Ka}=g(R.isAiCfoFileUploadEnabled),{isFeatureEnabled:qa}=g(R.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:Za}=g(R.isDashboardSidebarNewYearAnimationEnabled),{configValue:Rt}=C(Pa.zeniCardsConfig),Qa=Rt.charge_card_cashback_rate_per_transaction==null?.0175:Rt.charge_card_cashback_rate_per_transaction;if(c.state?.message==="activation"){const v=Vo(c.state?.pathnameStackToGoBack);s(c.pathname,{state:{...c.state,message:void 0,pathnameStackToGoBack:v.newStack}})}const[Bt,Ha]=b.useState(!1),[at,Wa]=b.useState(!1);Fs("command+p, Control+p",v=>{Wa(!at),v.preventDefault()},{enableOnContentEditable:!0,enableOnTags:["INPUT","SELECT","TEXTAREA"]},[at]);const jt=T?.externalConnections?.accounting[0]?.isValid;if(m==null)throw Error("Can't access dashboard without signing in...");const he=_(v=>U(v)?.excludedResources),Xa=_(v=>v.expenseAutomationViewState.selectedPeriodByTenantId),Ja=!!T?.companyReimbursementInfo?.info?.isReimbursementEnabled,en=!!T?.companyBillPayInfo?.info?.isBillPayEnabled,tn=_(v=>v.treasurySetupViewState.treasuryFundsDetails).fetchStatus.fetchState,an=T?.company!=null&&mo(T.company),nt=O&&an,ot=_e(),nn=St(ot?.loggedInUserRoleMap),Y=[],Lt=he?.resources?.find(v=>v.resource==="/reports/top_expenses")==null,on=he?.resources?.find(v=>v.resource==="/reports/task_card")==null,st=T?.userRole!=null&&Ca(T?.userRole),sn=he?.resources?.find(v=>v.resource==="/bills")==null&&!st,rn=he?.resources?.find(v=>v.resource==="/reimbursements")==null,cn=po(ot?.loggedInUserRoleMap),ln=ho(ot?.loggedInUserRoleMap),dn=T?.company?.companyChargeCardInfo?.chargeCardsCreditAccountLimit??0,un=T?.companyChargeCardInfo?.info?.isCompanyInterestedInChargeCard??!1,mn=_(v=>v.treasurySetupViewState.treasuryFundsDetails).fundsDetails;Lt===!1&&Y.push("top_expenses"),on===!1&&Y.push("task_card"),sn===!1&&Y.push("bill_pay_card","bill_pay_promo_card"),X===!1&&Y.push("accounts_payable_aging"),Me===!1&&Y.push("accounts_receivable_aging"),(me===!1||st)&&Y.push("expense_automation_card"),rn===!1&&Y.push("reimbursement_card","reimbursement_promo_card"),Ze===!1&&Y.push("zeni_accounts_promo_card"),Mt===!1&&Y.push("rewards_card"),nt===!1&&Y.push("treasury_promo_card");const{areTenantIdsInSync:Ut}=No();b.useLayoutEffect(()=>{Bt&&pe===me||jt!==!0||!Ut||he?.fetchState!=="Completed"&&he?.fetchState!=="Error"||(Ha(!0),i(fo(m.userId,M,y,!0,!1,Y)))},[Bt,m,y,i,Lt,jt,he?.fetchState,Ut]);const pn=_(v=>v.reportUIOptionsState.forecastOnDashboard.isForecastModeOn),hn=_(v=>v.revenueState.uiState.selectedForecast?.id),fn=_(v=>v.cardBalanceState.fetchState),oe=_(v=>go(v,Y,m,Pe,Oe,nt)),gn=oe.fetchState,bn=b.useMemo(()=>na(oe.cardsOrdered,S),[oe.cardsOrdered,S]),Cn=b.useMemo(()=>na(oe.cardsForDashboardUI,S),[oe.cardsForDashboardUI,S]);$e({isDataReady:!0});const{isSuggestedQuestionsLoading:kn,suggestedPromptQuestions:_n}=Qo(),Gt=T?.isTreasuryVideoViewed===!0||oe.isTreasuryVideoClosed===!0,Yt=_(v=>ua(v)),ye=Yt.uiState?.currentChatSessionId,rt=Yt.allSessionsWithOrderedQuestionAnswers??Os,{currentSessionQuestionAnswers:Sn}=$o(rt,ye),Vt=Sn.length===0,yn=b.useCallback((v,Z,fe)=>{const Ae=m?.userId;if(Ae==null)return;const V=v.trim();if(V.length===0&&Z.length===0)return;if(!k)return void se({location:c,navigate:s,mergeState:{referrer:"Dashboard"}});const Q=Ma(e.getState()),ve=()=>{const Ee=D(c.state?.pathnameStackToGoBack,c.pathname);s(`/${E}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:Ee,referrer:"Dashboard",aiCfoInitialQuestion:V,aiCfoShouldSubmit:!Q&&V.length>0,aiCfoInitialSubmissionSource:aa,...typeof fe=="number"?{aiCfoSuggestionIndex:fe}:{}}})};return t?Z.length>0?void o(!0):void ve():Z.length>0?Q?(i(kt(V)),void o(!0)):(r(V.length>0?V:null),o(!0),void(V.length>0&&Ra(i,V,aa,ye,rt,Ae,fe,Z.length>0?Z:void 0))):(Q&&i(kt(V)),void ve())},[rt,ye,i,k,t,c,s,r,o,m?.userId,e,E]),An=b.useCallback(()=>{k?o(!0):se({location:c,navigate:s,mergeState:{referrer:"Dashboard"}})},[k,c,s,o]),vn=b.useCallback(()=>{if(!k)return void se({location:c,navigate:s,mergeState:{referrer:"Dashboard"}});if(E==null)return;const v=D(c.state?.pathnameStackToGoBack,c.pathname);s(`/${E}/ai-cfo/explore`,{state:{pathnameStackToGoBack:v,referrer:"Dashboard"}})},[k,c,s,E]),En=b.useCallback(()=>{if(k)if(t){if(E==null||T==null)return;const v=ye==null||Vt?`/${E}/ai-cfo/explore`:`/${E}/ai-cfo/${ye}`,Z=c.state?.pathnameStackToGoBack??[],fe=D(Z,c.pathname);s(v,{state:{...c.state,pathnameStackToGoBack:fe,[zo]:!0}})}else se({location:c,navigate:s,mergeState:{referrer:"Dashboard"}});else se({location:c,navigate:s,mergeState:{referrer:"Dashboard"}})},[k,t,c,s,E,T,ye,Vt]);return d.jsxs(d.Fragment,{children:[gn==="Completed"?d.jsx(ze,{analytics:x,onLoad:v=>{v.trackPageLoaded(N.Event.dashboard),nt&&!Gt&&v.trackTreasuryPromoView("Dashboard Promo Video")}}):null,d.jsx(Ls,{maxColumns:n?2:void 0,isAiCfoAccessEnabled:S,onAskAiCfoClick:I,onAiCfoDashboardOpenPanel:An,onAiCfoDashboardOpenScopePage:En,isAiCfoFileUploadEnabled:Ka===!0&&t===!1,onAiCfoDashboardPromptSubmit:yn,onAiCfoDashboardExpandToFullPage:vn,aiCfoDashboardSuggestedPromptQuestions:_n,aiCfoDashboardSuggestedPromptQuestionsLoading:kn,onDragAndDropCard:(v,Z)=>{if(v===J||Z===J)return;const fe=function(Q,ve,Ee){const it=Ee.indexOf(Q),ct=Ee.indexOf(ve);if(it===-1||ct===-1||it===ct)return Ee;const lt=[...Ee];return lt.splice(it,1),lt.splice(ct,0,Q),lt}(v,Z,bn),Ae=fe.filter(Q=>Q!==J),V=oe.cardsOrdered;(Ae.length!==V.length||Ae.some((Q,ve)=>Q!==V[ve]))&&i(bo(Ae))},dashboardReport:oe,passedCardsOrdered:Cn,tenantId:y,companyId:M,tenantEmailDomain:E,location:c,navigate:s,isApAgingFeatureEnabled:X,isArAgingFeatureEnabled:Me,isBillPayEnabled:en,isReimbursementEnabled:Ja,isSummaryCardsFiltered:at,isForecastOn:pn,selectedForecastOnDashboard:hn,isVisitingFirstTime:l,isZeniAccountEnabled:Ze,isRewardsFeatureEnabled:Mt,hasZeniAccountsAdminAccess:nn,isExpenseAutomationEnabledForUser:me&&st===!1,selectedPeriod:Xa[y],isChargeCardFeatureEnabled:za,isUserHasCardsAccess:cn,isUserHasTreasuryAccess:ln,cardsCreditLimit:dn,cashbackRate:Qa,isInterestedInChargeCard:un,cardBalanceFetchState:fn,christmasAnimationEnabled:qa,newYearAnimationEnabled:Za,treasuryFundDetails:mn,hasUserSeenTreasuryVideo:Gt,treasuryFetchState:tn})]})}const Gs=e=>{switch(e){case"operating_expenses":return"Operating Expenses";case"revenue":return"Revenues";case"top_expenses":return"Top Expenses";case"net_burn_or_income":return"Burn Rate";case"cash_in_cash_out":return"Cash In, Cash Out";case"cash_position":return"Cash Position"}return"Dashboard"},Ys=e=>e.fetchState!=="Error"?e.fetchState:e.reportsInOrder.map(a=>a.fetchState).reduce((a,t)=>a==="In-Progress"||a==="Not-Started"?a:t);function gr(){const e=_e(),a=e?.excludedResources?.find(m=>m.resource==="/reports/top_expenses")==null,{useFeatureGate:t}=Se(),{isFeatureEnabled:n}=t(R.isApAgingFeatureEnabled),{isFeatureEnabled:o}=t(R.isArAgingFeatureEnabled),r=_(m=>U(m)),{isFeatureEnabled:s}=t(R.isDebitCardFeatureEnabled),i=Do(s,r),c=wo(r);return i===!0||c===!0?d.jsx(gt,{children:d.jsx(F,{path:"/*",element:d.jsx(Ho,{})})}):d.jsxs(gt,{children:[d.jsx(F,{path:"/",element:d.jsx(Us,{})}),d.jsx(F,{path:"cash_balance/*",element:d.jsx(Qt,{})}),d.jsx(F,{path:"card_balance/*",element:d.jsx(Qt,{})}),d.jsx(F,{path:"operating_expenses/*",element:d.jsx(re,{})}),d.jsx(F,{path:"operating_expenses/forecast/*",element:d.jsx(dt,{})}),d.jsx(F,{path:"revenue/forecast/*",element:d.jsx(dt,{})}),d.jsx(F,{path:"revenue/*",element:d.jsx(re,{})}),d.jsx(F,{path:"net_burn_or_income/forecast/*",element:d.jsx(dt,{})}),d.jsx(F,{path:"net_burn_or_income/*",element:d.jsx(re,{})}),n===!0&&d.jsxs(d.Fragment,{children:[d.jsx(F,{path:"accounts_payable_aging/*",element:d.jsx(Jo,{})}),d.jsx(F,{path:"accounts_payable_aging/:vendorId/:reportDate/*",element:d.jsx(Xo,{})})]}),o&&d.jsxs(d.Fragment,{children:[d.jsx(F,{path:"accounts_receivable_aging/:customerId/:reportDate/*",element:d.jsx(es,{})}),d.jsx(F,{path:"accounts_receivable_aging/*",element:d.jsx(ts,{})})]}),d.jsx(F,{path:"cash_position/*",element:d.jsx(re,{})}),d.jsx(F,{path:"top_expenses/*",element:a===!0?d.jsx(re,{}):d.jsx(Ue,{})}),d.jsx(F,{path:"cash_in_cash_out/*",element:d.jsx(re,{})}),d.jsx(F,{path:"company_details",element:d.jsx(Zo,{})}),d.jsx(F,{path:"referrals/*",element:d.jsx(Wo,{})}),d.jsx(F,{path:"*",element:d.jsx(Ue,{})})]})}export{gr as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as v}from"./liveblocks-
|
|
1
|
+
import{j as v}from"./liveblocks-BSDLCmF2.js";import{a as u}from"./sentry-67DqaLi1.js";import{u as y,j as b,n as w,g as A,N as k}from"./core-B20PugrR.js";import{Jj as N,eP as _,fo as U,Jk as L,mT as R,Jl as z}from"./zeni-epic-state-B3AwsZqW.js";import{u as O,z as f,L as T,t as I,O as j,b as $}from"./index-D8hCAHx9.js";import"./mui-BBkBdMVO.js";import{t as P}from"./getLocaleForTenant-ht-6GSU5.js";import"./recharts-BzjcN9SN.js";import"./analytics-B35UERag.js";import"./plaid-DHvUog4a.js";import"./dnd-CTNaOehy.js";import"./stripe-DMRn4zHo.js";import"./lottie-DG71PfmK.js";import"./lexical-BDpP_OMn.js";import"./pdf-Cp8DoYAG.js";import"./utils-C7uJ9upL.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]="bb461043-7c8e-4cb2-88cd-c02ca9e7c126",t._sentryDebugIdIdentifier="sentry-dbid-bb461043-7c8e-4cb2-88cd-c02ca9e7c126")}catch{}})();const J=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),c=r.state?.origin,a=r.state?.queryParams;let i=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,S=null;const C=E(r.pathname);if(C!=null)i=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(c!=null)if(n.reduce((l,F)=>l||c.split("/").find(D=>D===F)!=null,!1))i=c,c.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,S=a.aiCfoEmailRefId??null);else{const l=E(c);l!=null?(i=`../${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=$(i,p);return v.jsx(k,{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}=O(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b(e=>N(e)),n=b(e=>e.tenantState.fetchState),c=b(e=>e.tenantState.error),a=b(e=>e.tenantState.activeTenantFetchState.fetchState),i=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(U(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(c))&&t(R(e.userId)))},[n,a,c,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"||i==null||(j.updateAppLocaleID(P(i)),o())},[n,a,i]),v.jsx(J,{})}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"],q={"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 q[s]}export{oe as default};
|
package/dist/assets/{DomesticWireDetailScreen-DT1-4XE1.js → DomesticWireDetailScreen-BU_VenPR.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as l}from"./liveblocks-
|
|
1
|
+
import{j as l}from"./liveblocks-BSDLCmF2.js";import{h as y,g as C,j as h,n as A,i as V}from"./core-B20PugrR.js";import{Nl as k,Ns as q,fE as K,fD as M,fC as W,iA as J,Kt as L,q3 as Q,eP as B,MT as D,iy as T,Nm as v,Nv as F,iw as G,iT as N}from"./zeni-epic-state-B3AwsZqW.js";import{bu as X,p as j,w as R,z as U,m as O,r as p,I as S,x as Z,bv as Y,o as z,bw as ee,s as te}from"./index-D8hCAHx9.js";import{n as H}from"./mui-BBkBdMVO.js";import"./sentry-67DqaLi1.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]="5bdd7558-6a8a-48bd-880c-0fbd31e86632",e._sentryDebugIdIdentifier="sentry-dbid-5bdd7558-6a8a-48bd-880c-0fbd31e86632")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(J(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(L("common")),n!=null&&e(Q(n))},onGetOtp:n=>{e(W(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))}}})(X);function _({vendorId:e,billId:t,isExpressPayPage:n}){const a=y(),o=C(),s=h(r=>k(r,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=H.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|
|
@@ -6,7 +6,7 @@ import{j as l}from"./liveblocks-D6iO1SmY.js";import{l as w,u as C,g as h,n as A,
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
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),
|
|
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),r=s.poppedPathname??P();n(r,{state:{pathnameStackToGoBack:s.newStack}})})(),e(v())},onACHDetailsUpdated:s=>{const{bankAccountSection:r}=s;e(F({data:r}))},onBackClick:()=>{if(e(T({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")n("../",{relative:"path"});else{const s=p(t.location.state?.pathnameStackToGoBack),r=s.poppedPathname??P(0);t.navigate(r,{state:{pathnameStackToGoBack:s.newStack}})}e(v())}}})(Y);function fe({vendorIdParam:e,accountContext:t}){const n=y(),a=C(),o=j(),{vendorId:s,billId:r}=V(),c=e??s,{useFeatureGate:d}=R(),i=U.getSignedInUser(),b=h(u=>B(u)),g=O(),I=p(a.state?.pathnameStackToGoBack),f=t??(I.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h(u=>k(u,c)),{isFeatureEnabled:x}=d(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:w}=d(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:c,billId:r}),l.jsx(oe,{location:a,navigate:n,billId:r,vendorId:c,currentTenant:b,bankAccountContext:f,isVendorRecommendationEnabled:x,isZeniAccountsFeatureEnabled:w})]})}const P=(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},de=H.div`
|
|
10
10
|
display: flex;
|
|
11
11
|
height: 100vh;
|
|
12
12
|
width: 100%;
|
|
@@ -15,4 +15,4 @@ import{j as l}from"./liveblocks-D6iO1SmY.js";import{l as w,u as C,g as h,n as A,
|
|
|
15
15
|
align-items: center;
|
|
16
16
|
background-color: ${e=>e.theme.colors.grey4};
|
|
17
17
|
box-shadow: ${e=>`0px 2px ${z.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
18
|
-
`,
|
|
18
|
+
`,re=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:r}=t,{tenantEmailDomain:c}=r;return{onFetchBankName:d=>{e(N(d))},onSaveHandler:d=>{e(G(t.bankAccountContext,d,"us-domestic",s))},onWireDetailsUpdated:d=>{const{bankAccountSection:i}=d;e(F({data:i}))},onCancel:()=>{(()=>{const d=p(o.state?.pathnameStackToGoBack),i=d.poppedPathname??$();a(i,{state:{pathnameStackToGoBack:d.newStack}})})(),e(v())},onAddressClick:d=>{if(t.bankAccountContext==="express-pay")a("./add-address");else{const i=se(c,d,n),b=te(o.state?.pathnameStackToGoBack,o.pathname);a(i,{state:{pathnameStackToGoBack:b}})}},onBackClick:()=>{if(e(T({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")a("../",{relative:"path"});else{const d=p(t.location.state?.pathnameStackToGoBack),i=d.poppedPathname??$(0);t.navigate(i,{state:{pathnameStackToGoBack:d.newStack}})}e(v())}}})(ee);function Ie({vendorIdParam:e,accountContext:t}){const n=y(),a=C(),o=j(),{vendorId:s,billId:r}=V(),c=e??s,d=U.getSignedInUser(),{useFeatureGate:i}=R(),b=O(),g=h(u=>B(u)),I=p(a.state?.pathnameStackToGoBack),f=t??(I.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h(u=>k(u,c)),{isFeatureEnabled:x}=i(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:w}=i(S.isDepositAccountsFeatureEnabled);if(d==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 ${z.sp1} ${b.colors.dropShadowNormal}`}}):l.jsxs(de,{windowSize:o,children:[l.jsx(_,{vendorId:c,billId:r}),l.jsx(re,{location:a,navigate:n,billId:r,vendorId:c,currentTenant:g,bankAccountContext:f,isVendorRecommendationEnabled:x,isZeniAccountsFeatureEnabled:w})]})}const $=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t};export{fe as A,Ie 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-BSDLCmF2.js";import{p as l,y as f,m as c}from"./index-D8hCAHx9.js";import{D as p}from"./mui-BBkBdMVO.js";import"./sentry-67DqaLi1.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]="445c2df8-e5b6-4835-9e4f-a5dee1dd8d73",e._sentryDebugIdIdentifier="sentry-dbid-445c2df8-e5b6-4835-9e4f-a5dee1dd8d73")}catch{}})();const u={drawerLeftMargin:new f(0,0,240)};function m(e){const{isOpen:r,drawerLeftMargin:o,children:d,onClose:t}=e,n=l(),s=o?.valuePx(n)??u.drawerLeftMargin.valuePx(n),a=c();return i.jsx(p,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:a.colors.black,opacity:.8,cursor:"pointer"}}},onClose:t,children:d})}export{m as D};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-BSDLCmF2.js";import{a as d}from"./sentry-67DqaLi1.js";import{h as B,u as G,g as F,i as K,j as c,N as q,n as L,o as N,p as _}from"./core-B20PugrR.js";import{LA as z,eP as O,KZ as R,kD as H,Hz as k,LF as M,Ks as W,jD as Y,HA as S,L2 as $,L3 as V,Ku as Z,Kt as J}from"./zeni-epic-state-B3AwsZqW.js";import{aR as Q,d as U,r as X,s as tt}from"./index-D8hCAHx9.js";import"./mui-BBkBdMVO.js";import{d as b}from"./decodeURIComponentSafe-HZX6LUOb.js";import{w as et}from"./withTransactionSidePanel-C7OFQuvJ.js";import{f as at,c as nt}from"./routePaths-XreQojZr.js";import"./recharts-BzjcN9SN.js";import"./analytics-B35UERag.js";import"./plaid-DHvUog4a.js";import"./dnd-CTNaOehy.js";import"./stripe-DMRn4zHo.js";import"./lottie-DG71PfmK.js";import"./lexical-BDpP_OMn.js";import"./pdf-Cp8DoYAG.js";import"./utils-C7uJ9upL.js";import"./useAskAiCfoHostNavButtonProps-CDnIxewv.js";import"./TransactionDetailScreen-BSarw1vq.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]="74f19250-9481-4b0c-9237-2448255abc2b",a._sentryDebugIdIdentifier="sentry-dbid-74f19250-9481-4b0c-9237-2448255abc2b")}catch{}})();const ot=L(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:U,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(Z({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(J("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a($()),a(V()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=X(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}))}}}})(Q),it=et(function({entityType:a,...t}){const e=B(),o=G(),l=F(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:j,entityNameEncoded:x}=K(),r=b(j??""),p=b(x??""),u=rt(r,p),v=[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")),w=c(n=>O(n).company?.companyInfo.firstMonthOfFY??1),f=c(n=>R(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&u===!0&&(T(!0),o(H(i)))},[m,u,i]);const P=c(n=>n.trendState.fetchState),E=f?.selectedPeriod?.timePeriod??g,A=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(f?.selectedPeriod?.timePeriod,g);return d.useEffect(()=>{m===!0&&h===!1&&P==="Completed"&&(D(!0),E!=null&&o(k(i,"EntityDetail",{timeframe:f?.selectedPeriod?.timeframe??"quarter",timePeriod:E})))},[m,h,P]),u?s.jsx(ot,{firstMonthOfFY:w,tenantEmailDomain:C,location:l,navigate:e,entity:i,defaultTransactionTimePeriod:A,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(q,{to:I(v.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};
|