@zeniai/web-app-ui 5.0.55-qa → 5.0.56-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-T4qftw_1.js +1 -0
- package/dist/assets/AddressScreen-BklJKutc.js +9 -0
- package/dist/assets/{AiCfoScreen-twy_oEHo.js → AiCfoScreen-B4xK4s4e.js} +3 -3
- package/dist/assets/{BillPayApprovalRoutes-2MMsFms-.js → BillPayApprovalRoutes-SfFy4Q3x.js} +1 -1
- package/dist/assets/{BillPayRoutes-DabCBXCD.js → BillPayRoutes-C_kzPWNw.js} +4 -4
- package/dist/assets/{BusinessVerificationPageScreen-DY36UKxh.js → BusinessVerificationPageScreen-DgymQkoP.js} +2 -2
- package/dist/assets/{ChargeCardRoutes-BKvKKz6Y.js → ChargeCardRoutes-DKy3Qza2.js} +8 -8
- package/dist/assets/CompanyPassportScreen-Q42ItsTK.js +1 -0
- package/dist/assets/{ConnectionAuthScreen-AkiKcrRN.js → ConnectionAuthScreen-DWjSQZql.js} +1 -1
- package/dist/assets/CustomerOnboardingAuthScreen-CTfinB3p.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-reDt__4U.js → CustomerOnboardingRoutes-BeIEf537.js} +4 -4
- package/dist/assets/{DashboardRoutes-B6YOY8LT.js → DashboardRoutes-DmT1zvbt.js} +3 -3
- package/dist/assets/{DefaultTenantHome-CG3A8Zld.js → DefaultTenantHome-CkOir1h_.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-CHZr0Rwr.js → DomesticWireDetailScreen-Ba2RcbCG.js} +3 -3
- package/dist/assets/DrawerScreen-GbmWLeG7.js +1 -0
- package/dist/assets/{EntityDetailRoutes-BJ_l6xDX.js → EntityDetailRoutes-EYGmcLTc.js} +1 -1
- package/dist/assets/{ExpenseAutomationRoutes-jv6wUEHc.js → ExpenseAutomationRoutes-CO8PFCnO.js} +4 -4
- package/dist/assets/FeaturePreviewScreen-BbZ1xf4z.js +1 -0
- package/dist/assets/{MagicLinkRoutes-DHuoixGe.js → MagicLinkRoutes-CohCNxyX.js} +18 -18
- package/dist/assets/MagicLinkSignInScreen-B2CB3dkp.js +12 -0
- package/dist/assets/{MobileAppDrawer-BCaWgXZQ.js → MobileAppDrawer-n8t03yaO.js} +1 -1
- package/dist/assets/NotFoundScreen-DpPEAqIa.js +1 -0
- package/dist/assets/{NotificationRoutes-CzsQHWBP.js → NotificationRoutes-TwQiwNf3.js} +1 -1
- package/dist/assets/{PandLWithForecastRoutes-rl7st3Iq.js → PandLWithForecastRoutes-Wtfusoui.js} +1 -1
- package/dist/assets/{PeopleRoutes-BGm45BRK.js → PeopleRoutes-7E-ffjBJ.js} +5 -5
- package/dist/assets/PerformanceRoutes-CHrolr76.js +1 -0
- package/dist/assets/{Preview-CPDm5N-k.js → Preview-CktKjgWY.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-DYw5d1DS.js → QBOConnectionScreen-DyznN-F2.js} +1 -1
- package/dist/assets/{ReferralListScreen-B2bhjkxb.js → ReferralListScreen-Dy8iQFPt.js} +2 -2
- package/dist/assets/{ReimbursementApprovalRoutes-C_ldCyqW.js → ReimbursementApprovalRoutes-BbOdeAtw.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BM0wb7RO.js → ReimbursementApprovalRuleDetailScreen-DuDkeiAm.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-C1eoHxke.js → ReimbursementRoutes-BOMyJgrz.js} +4 -4
- package/dist/assets/{ReportsRoutes-aH8NyeQL.js → ReportsRoutes-BSTB7uRz.js} +1 -1
- package/dist/assets/RewardsRoutes-vMUR4VOs.js +1 -0
- package/dist/assets/{ScreenRoutes-Be433Rce.js → ScreenRoutes-D4dqaFnm.js} +2 -2
- package/dist/assets/{SettingsRoutes-Dkedlq8H.js → SettingsRoutes-r9Ej5ZGq.js} +4 -4
- package/dist/assets/{SetupPagesScreen-DrXS3IRK.js → SetupPagesScreen-BaBZaUCN.js} +1 -1
- package/dist/assets/{SignInScreen-B584l1AV.js → SignInScreen-Nl88Hc6C.js} +1 -1
- package/dist/assets/{SignOutScreen--i7fPI83.js → SignOutScreen-D4lUsOmx.js} +1 -1
- package/dist/assets/{TaskListScreen-CbCuzBgx.js → TaskListScreen-Bvnm9IXP.js} +2 -2
- package/dist/assets/{TaskRoutes-C6JGvbta.js → TaskRoutes-BAXcXFEg.js} +2 -2
- package/dist/assets/TransactionDetailRoutes-DLz2n5Pp.js +1 -0
- package/dist/assets/{TransactionDetailScreen-B0sPog3q.js → TransactionDetailScreen-BARgRHWT.js} +2 -2
- package/dist/assets/{TransactionListRoutes-DbOVYmb-.js → TransactionListRoutes-FB1Nag0X.js} +1 -1
- package/dist/assets/{TreasuryRoutes-Bw9U7ZrB.js → TreasuryRoutes-D09j5H5F.js} +5 -5
- package/dist/assets/{VendorsRoutes-CYu2rHMN.js → VendorsRoutes-CMOWuwxW.js} +1 -1
- package/dist/assets/WiseConfirmationScreen-BburOEIH.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-C-OLyEIo.js → ZeniAccountRoutes-CvMBgZsl.js} +10 -10
- package/dist/assets/ZeniAccountStatementScreen-CqjHqKdC.js +9 -0
- package/dist/assets/{accountMappingHelper-CQSFsM6N.js → accountMappingHelper-BOSY12FJ.js} +1 -1
- package/dist/assets/{analytics-ByrfXPqG.js → analytics-CcGmsyc8.js} +1 -1
- package/dist/assets/{analyticsHelper-xeJXIGDO.js → analyticsHelper-DJMvFBQ1.js} +1 -1
- package/dist/assets/{core-DcM32IW_.js → core-DkPdadc6.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-mAxyJdJ8.js → decodeURIComponentSafe-h3wJzOm1.js} +1 -1
- package/dist/assets/{dnd-36WXho_9.js → dnd-D-YvLFfj.js} +1 -1
- package/dist/assets/{empty-GSTAUqhH.js → empty-C7PzWdR6.js} +1 -1
- package/dist/assets/{empty-lHXrwReA.js → empty-ohi5JxHm.js} +1 -1
- package/dist/assets/{emptyVideoElement-Bsa6If51.js → emptyVideoElement-B09QwhYv.js} +1 -1
- package/dist/assets/epic-DC-PDk7m.js +2 -0
- package/dist/assets/getLocaleForTenant-FjCgXmXO.js +1 -0
- package/dist/assets/{index-Bw9qJkeB.js → index-8VSOxL6k.js} +1 -1
- package/dist/assets/{index-CR2DVZE0.js → index-BIUa1dNl.js} +2 -2
- package/dist/assets/{index-Dq0r4E9j.js → index-BVoPsTXN.js} +1 -1
- package/dist/assets/{index-BZDuIo7x.js → index-CpD5ML2i.js} +12483 -12422
- package/dist/assets/{index-p7Us2Fcf.js → index-CxVN3Ojx.js} +1 -1
- package/dist/assets/{index-DTGcnfLC.js → index-DHz0Faq_.js} +1 -1
- package/dist/assets/{index-CjaQ8-D2.js → index-ufE2I9Jb.js} +1 -1
- package/dist/assets/{lexical-CYAYrhLa.js → lexical-Sc7rk4Y7.js} +1 -1
- package/dist/assets/{liveblocks-BeS4QmMp.js → liveblocks-tcXs1fes.js} +1 -1
- package/dist/assets/{lottie-Bdncx-qB.js → lottie-CwApzZxI.js} +1 -1
- package/dist/assets/{mui--qrGbwFJ.js → mui-DbdGpDJj.js} +1 -1
- package/dist/assets/{pathToGoBack-Cn4t6MOa.js → pathToGoBack-D9y2NyzP.js} +1 -1
- package/dist/assets/{pdf-6nmWWkz8.js → pdf-DG2fyOfp.js} +4 -4
- package/dist/assets/{pdf-lib-rQgtUIvp.js → pdf-lib-fmjHY_Su.js} +1 -1
- package/dist/assets/{plaid-BZ0BFqP0.js → plaid-UeHpA8su.js} +1 -1
- package/dist/assets/{pusher-4QLniNXV.js → pusher-CH-5kFcN.js} +1 -1
- package/dist/assets/{react-DKUlDjBa.js → react-BTMxDr8F.js} +1 -1
- package/dist/assets/{react-DCTwOcr5.js → react-CAp_bFar.js} +1 -1
- package/dist/assets/{react-BszWSDWQ.js → react-CFEMacjg.js} +1 -1
- package/dist/assets/{react-BOWjwOm8.js → react-CjW2GUTT.js} +1 -1
- package/dist/assets/{react-C3zOniDH.js → react-D3qpynvt.js} +1 -1
- package/dist/assets/{react-BFaux__7.js → react-P8ikJhK3.js} +1 -1
- package/dist/assets/{recharts-DoWl4vaN.js → recharts-D0a4NFa9.js} +1 -1
- package/dist/assets/{routePaths-DLti7tZb.js → routePaths-D7wc65Bl.js} +1 -1
- package/dist/assets/{sentry-BlmJH5WH.js → sentry-DNuKG-9f.js} +1 -1
- package/dist/assets/{url-BG92tf7R.js → url-Bxb4Dr7g.js} +1 -1
- package/dist/assets/{url-AJ2wpRsW.js → url-EFuL_PC5.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-BtZXhZ4f.js +1 -0
- package/dist/assets/{useDeviceId-DaD3aMiS.js → useDeviceId-DoEHbao8.js} +1 -1
- package/dist/assets/useFetchSuggestedQuestionsWhenReady-Bhmav9DR.js +1 -0
- package/dist/assets/{useInitialThreadRequest-CV6--y9X.js → useInitialThreadRequest-DId3URPK.js} +1 -1
- package/dist/assets/{utils-RmRP6xA4.js → utils-BmJyX3cx.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-BOlkvwMK.js → withTransactionSidePanel-CzkV98Uv.js} +1 -1
- package/dist/assets/{zeni-epic-state-ChnjRetZ.js → zeni-epic-state-CSoWjbAn.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +3 -3
- package/dist/assets/AddressRoutes-DmNqU45X.js +0 -1
- package/dist/assets/AddressScreen-CD02bE7U.js +0 -9
- package/dist/assets/CompanyPassportScreen-Deb1Mskj.js +0 -1
- package/dist/assets/CustomerOnboardingAuthScreen-B7puRRld.js +0 -1
- package/dist/assets/DrawerScreen-C9oSGPfX.js +0 -1
- package/dist/assets/FeaturePreviewScreen-Dvylx-Wk.js +0 -1
- package/dist/assets/MagicLinkSignInScreen-Cy0ox9On.js +0 -12
- package/dist/assets/NotFoundScreen-B8ppov_c.js +0 -1
- package/dist/assets/PerformanceRoutes-5okn2Dl7.js +0 -1
- package/dist/assets/RewardsRoutes-BG1TYOwi.js +0 -1
- package/dist/assets/TransactionDetailRoutes-DWhYtS5p.js +0 -1
- package/dist/assets/WiseConfirmationScreen-CT1Vk2du.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-Dufb_RXJ.js +0 -9
- package/dist/assets/epic-DhZTt5cl.js +0 -2
- package/dist/assets/getLocaleForTenant-Fu8c_Haa.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-CHoGbMpp.js +0 -1
- package/dist/assets/useFetchSuggestedQuestionsWhenReady-DVUj1bst.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as t}from"./liveblocks-
|
|
1
|
+
import{j as t}from"./liveblocks-tcXs1fes.js";import{a as u}from"./sentry-DNuKG-9f.js";import{j as T,u as R,h as P,g as m,k as B,l as _,n as q,o as x}from"./core-DkPdadc6.js";import{bn as Ie,eN as k,gv as ce,Ki as xe,IG as Ce,jq as le,lJ as Ee,gx as Ae,Kk as je,Kj as ke,MJ as we,x2 as Pe,Bx as ve,Mi as Me,Mr as De,c0 as re,cF as Ue,cG as Te,Iv as Fe,MK as Re,Iw as Be,vu as _e,ML as Ve,DN as Le,Bd as Oe,B4 as de,B1 as Ne,vy as ue,B7 as pe,Ba as ge,Bg as X,s5 as Y,vx as $e,j2 as W,j5 as me,MM as Ge,k6 as Ke,vN as ze,Jd as Je,Je as Qe,j0 as Ze,MN as He,j3 as qe,MO as We,vK as Xe,MP as Ye,MQ as en,Bu as nn,eR as fe,eT as he,MR as tn,fv as an,IH as sn,vJ as te,fA as ae,fz as on,vI as cn,fy as ln,fx as rn,MS as dn,eW as be,MT as un,MU as pn,vQ as gn,vH as se,MV as mn,fc as fn,vE as hn,bT as bn,b$ as Sn,b_ as yn,bU as In,bY as xn,bX as Cn,bW as En,bZ as An,bV as jn}from"./zeni-epic-state-CSoWjbAn.js";import{a as ee,p as D,z as C,ab as Se,bB as kn,d as G,f as wn,j as V,B as ne,bC as Pn,bD as vn,am as Mn,i as ye,bE as Dn,bF as Un,bG as Tn,a5 as Fn,Q as Rn,bH as Bn,r as _n,bI as Vn}from"./index-CpD5ML2i.js";import{n as U}from"./mui-DbdGpDJj.js";import{M as v}from"./MobileAppDrawer-n8t03yaO.js";import{a as N,g as $,m as Ln}from"./accountMappingHelper-BOSY12FJ.js";import{t as On,A as Nn}from"./AddressScreen-BklJKutc.js";import F from"./NotFoundScreen-DpPEAqIa.js";import{g as $n}from"./analyticsHelper-DJMvFBQ1.js";import{B as Gn}from"./BusinessVerificationPageScreen-DgymQkoP.js";import{C as Kn}from"./CompanyPassportScreen-Q42ItsTK.js";import{q as oe}from"./QBOConnectionScreen-DyznN-F2.js";import{B as zn}from"./BillPayApprovalRoutes-SfFy4Q3x.js";import{R as Jn}from"./ReimbursementApprovalRoutes-BbOdeAtw.js";import"./recharts-D0a4NFa9.js";import"./analytics-CcGmsyc8.js";import"./plaid-UeHpA8su.js";import"./dnd-D-YvLFfj.js";import"./stripe-DMRn4zHo.js";import"./lottie-CwApzZxI.js";import"./lexical-Sc7rk4Y7.js";import"./pdf-DG2fyOfp.js";import"./utils-BmJyX3cx.js";import"./routePaths-D7wc65Bl.js";import"./empty-C7PzWdR6.js";import"./pdf-lib-fmjHY_Su.js";import"./index-BVoPsTXN.js";import"./url-Bxb4Dr7g.js";import"./index-ufE2I9Jb.js";import"./decodeURIComponentSafe-h3wJzOm1.js";import"./ReimbursementApprovalRuleDetailScreen-DuDkeiAm.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]="0704b8ec-5a3a-4d46-aa67-2b3498c0e087",e._sentryDebugIdIdentifier="sentry-dbid-0704b8ec-5a3a-4d46-aa67-2b3498c0e087")}catch{}})();const Qn=U.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,7 +6,7 @@ import{j as t}from"./liveblocks-BeS4QmMp.js";import{a as u}from"./sentry-BlmJH5W
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,
|
|
9
|
+
`,Zn=B(function(e,a){return{accountMappingView:a.accountMappingView,isFiling1099FeatureEnabled:a.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:a.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:le(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:Ce(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(e,a){const{navigate:i,location:c,isFiling1099FeatureEnabled:o}=a;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:s,billsAccountSection:r,reimbursementsAccountSection:p,vendorsAccountSection:d,filing1099Section:f}=n,{incomeAccount:b,expenseAccount:g}=s,{billPayAccount:l}=r,{reimbursementsAccount:E}=p,{prepaidExpensesAccount:y,fixedAssetsAccount:j,accruedExpensesAccount:S}=d,{bankAccount:I,expenseCategory1099:L}=f,A=N(a.accountMappingView.incomeAccountList,b.selectedOption),K=N(a.accountMappingView.expenseAccountList,g.selectedOption),z=N(a.accountMappingView.billPayAccountList,l.selectedOption),J=N(a.accountMappingView.reimbursementsAccountList,E.selectedOption),O=$(a.accountMappingView.prepaidExpensesAccountList,y.selectedOptions),h=$(a.accountMappingView.fixedAssetsAccountList,j.selectedOptions),M=$(a.accountMappingView.accruedExpensesAccountList,S.selectedOptions),Q=$(a.accountMappingView.bankAccounts1099FilingAccountList,I.selectedOptions),Z=Ln(a.accountMappingView.expenseAccounts1099FilingAccountList,L),H={selectedIncomeAccountId:A?.accountId,selectedExpenseAccountId:K?.accountId,selectedBillPayAccountId:z?.accountId,selectedReimbursementsAccountId:J?.accountId,selectedPrepaidExpensesAccountIds:O.map(w=>w.accountId),selectedFixedAssetsAccountIds:h.map(w=>w.accountId),selectedAccruedExpensesAccountIds:M.map(w=>w.accountId),selectedBankAccounts1099FilingAccountIds:Q.map(w=>w.accountId),selectedExpenseAccounts1099FilingAccountIds:Z};e(ke({data:H}))},onBackClick:()=>{Se(c)===!1?(i("../../dashboard"),e(je())):e(ce())},onSaveClick:()=>{e(Ae()),o&&G.track(wn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(Ee(a.currentTenant.companyId,n))}}})(kn),Hn=()=>{const e=T(),a=R(),i=P(),{useFeatureGate:c}=ee(),{isFeatureEnabled:o}=c(D.isFiling1099FeatureEnabled),{isFeatureEnabled:n}=c(D.isScheduledJEAccruedExpensesFeatureEnabled),s=C.getSignedInUser(),r=Ie(s),p=m(y=>k(y)),[d,f]=u.useState(!1),[b,g]=u.useState(!1);u.useEffect(()=>{d===!1&&(i(ce()),f(!0))},[d]);const l=m(y=>xe(y)),E=y=>{g(y)};return t.jsxs(Qn,{children:[t.jsx(v,{isAppContentDrawerOpen:b,handleDrawerToggle:E}),t.jsx(Zn,{currentTenant:p,navigate:e,accountMappingView:l,isFiling1099FeatureEnabled:o&&r,isAccruedExpensesFeatureEnabled:n,location:a,isSettings:Se(a),onClickMenuIcon:()=>E(!0)})]})},qn=U.div`
|
|
10
10
|
display: flex;
|
|
11
11
|
height: 100%;
|
|
12
12
|
width: 100%;
|
|
@@ -30,7 +30,7 @@ import{j as t}from"./liveblocks-BeS4QmMp.js";import{a as u}from"./sentry-BlmJH5W
|
|
|
30
30
|
flex-direction: column;
|
|
31
31
|
align-items: center;
|
|
32
32
|
background-color: ${e=>e.theme.colors.grey4};
|
|
33
|
-
`,at=B(function(e,a){const{companyId:i}=a,c=k(e),o=a.roleMap.bill_pay_admin,n=Ge(e,i),{uiState:s}=n,r=(re(c?.userRole??[])||o)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:s,stripeKey:ye.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:r,analytics:G}},function(e,a){const{navigate:i,currentTenant:c,companyId:o}=a;return{onFetchLinkTokenClick:(n,s)=>{e(Y("billing_setup",n,s))},onEstablishConnectionClick:n=>{e(X(n,o,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ue("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,s,r)=>{e(ge(n,s,"billing","billing_setup",r))},onUpdatePaymentAccountLoginStatus:(n,s)=>{e(pe(!1,n,"billing","billing_setup",s))},onUpdateAccountClick:(n,s)=>{e(de(n,s,"billing","billing_setup"))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?i("../.."):i("../")},onNavigateToDashboard:()=>{i("../dashboard")},handleCreateCardSetupIntent:n=>{e(me(n))},handleConfirmCardSetupIntent:n=>{e(qe(n))},updateCardPaymentModalState:n=>{e(
|
|
33
|
+
`,at=B(function(e,a){const{companyId:i}=a,c=k(e),o=a.roleMap.bill_pay_admin,n=Ge(e,i),{uiState:s}=n,r=(re(c?.userRole??[])||o)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:s,stripeKey:ye.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:r,analytics:G}},function(e,a){const{navigate:i,currentTenant:c,companyId:o}=a;return{onFetchLinkTokenClick:(n,s)=>{e(Y("billing_setup",n,s))},onEstablishConnectionClick:n=>{e(X(n,o,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ue("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,s,r)=>{e(ge(n,s,"billing","billing_setup",r))},onUpdatePaymentAccountLoginStatus:(n,s)=>{e(pe(!1,n,"billing","billing_setup",s))},onUpdateAccountClick:(n,s)=>{e(de(n,s,"billing","billing_setup"))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?i("../.."):i("../")},onNavigateToDashboard:()=>{i("../dashboard")},handleCreateCardSetupIntent:n=>{e(me(n))},handleConfirmCardSetupIntent:n=>{e(qe(n))},updateCardPaymentModalState:n=>{e(He({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,s,r)=>{e(Ze(n,s,r))},handleFetchPaymentSources:()=>{e(W())},resetCardPaymentViewState:()=>{e(Qe())},handleResetCardPaymentErrorStatuses:()=>{e(Je())},onBillingAddressSave:n=>{e(ze(n))},onAddressEditHandler:n=>{if(n!=null){const s=On(n);e(Ke({addressType:"subscription_billing_address",addressToCreate:s}))}}}})(Dn),st=()=>{const e=T(),a=R(),i=P(),{tenantEmailDomain:c}=_(),[o,n]=u.useState(!1),[s,r]=u.useState(!1),[p,d]=u.useState(!1),f=m(I=>k(I)),b=m(I=>I.cardPaymentViewState),g=m(I=>I.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),l=Mn(b.addCardPaymentSourceStatus.fetchState),E=b.addCardPaymentSourceStatus.fetchState,y=f.companyId??C.getSignedInUserTenant(c)?.companyId;if(C.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const j=V();u.useEffect(()=>{y!=null&&i($e(y,!1))},[y,i]),u.useEffect(()=>{s||(r(!0),i(W()))},[s,i]),u.useEffect(()=>{p||(me(["card"]),d(!0))},[p]),u.useEffect(()=>{l==="In-Progress"&&E==="Completed"&&i(W())},[l,E]);const S=I=>{n(I)};return j?.loggedInUserRoleMap!=null?t.jsxs(tt,{children:[t.jsx(v,{isAppContentDrawerOpen:o,handleDrawerToggle:S}),t.jsx(at,{navigate:e,location:a,companyId:y,currentTenant:f,roleMap:j.loggedInUserRoleMap,onClickMenuIcon:()=>{S(!0)},googleAPIKey:ye.googleMapsAPIKey})]}):t.jsx(ne,{fetchState:g})},ot=B(function(){return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(e,a){const{navigate:i,integrationsView:c,tenantEmailDomain:o}=a;return{onBackClick:()=>{i("../")},onNavigateToDashboard:()=>{i("../dashboard")},onReconnectQBO:()=>{oe.init("/connection/auth",o),oe.handleClick()},onRefreshClick:()=>{c.integrations.refreshQBO.fetchState!=="In-Progress"&&e(Xe())}}})(Un),it=()=>{const e=T(),{tenantEmailDomain:a}=_(),[i,c]=u.useState(!1),o=m(g=>g.tenantState.fetchState),n=m(g=>k(g)),s=n.companyId??C.getSignedInUserTenant(a)?.companyId,r=C.getSignedInUser(),p=V(),d=p?.loggedInUserRole.includes("admin")===!0;if(r==null)throw Error("Can't access Integrations page without signing in...");const f=g=>{c(g)},b=m(g=>We(g,s));return p?.loggedInUserRoleMap!=null?t.jsxs(ct,{children:[t.jsx(v,{isAppContentDrawerOpen:i,handleDrawerToggle:f}),t.jsx(ot,{navigate:e,onClickMenuIcon:()=>{f(!0)},isAdmin:d,integrationsView:b,isLoading:o==="In-Progress",tenantEmailDomain:n.tenantEmailDomain})]}):t.jsx(ne,{fetchState:o})},ct=U.div`
|
|
34
34
|
display: flex;
|
|
35
35
|
height: 100%;
|
|
36
36
|
width: 100%;
|
|
@@ -54,4 +54,4 @@ import{j as t}from"./liveblocks-BeS4QmMp.js";import{a as u}from"./sentry-BlmJH5W
|
|
|
54
54
|
flex-direction: column;
|
|
55
55
|
align-items: center;
|
|
56
56
|
background-color: ${e=>e.theme.colors.grey4};
|
|
57
|
-
`,ie=({appContent:e})=>{const a=P(),i=T(),c=R(),[o,n]=u.useState(!1),s=m(h=>k(h)),{tenantEmailDomain:r}=s,p=s.companyId??C.getSignedInUserTenant(r)?.companyId;if(C.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:d}=ee(),{isFeatureEnabled:f}=d(D.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(D.isChargeCardFeatureEnabled),{isFeatureEnabled:g}=d(D.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=d(D.isTreasuryEnabled),E=m(h=>le(h)),y=fe(s),j=he(g,s),S=!j&&E,I=Fn(s,b,g),{areTenantIdsInSync:L}=Rn();u.useEffect(()=>{L&&a(tn(p,S))},[p,a,S,L]);const A=m(h=>an(h,S)),K=A.fetchState==="Not-Started"||A.fetchState==="In-Progress"||p==null,z=sn(s),J=!!s.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,O=h=>{n(h)};return t.jsxs(dt,{children:[t.jsx(v,{isAppContentDrawerOpen:o,handleDrawerToggle:O}),e!=null?t.jsx(t.Fragment,{children:e}):t.jsx(Bn,{myProfileView:A,isAccountingClassesEnabled:E,isReimbursementDisabled:J===!1,isZeniAccountsDisabled:f===!1,isChargeCardDisabled:I===!1,isTreasuryDisabled:l===!1,isLiteRoleDisabled:z===!1,onClickMenuIcon:()=>{O(!0)},isLoading:K,isBankingOnlyTenant:j,isCardsOnlyTenant:y,onAddressClick:h=>{const M=function(H
|
|
57
|
+
`,ie=({appContent:e})=>{const a=P(),i=T(),c=R(),[o,n]=u.useState(!1),s=m(h=>k(h)),{tenantEmailDomain:r}=s,p=s.companyId??C.getSignedInUserTenant(r)?.companyId;if(C.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:d}=ee(),{isFeatureEnabled:f}=d(D.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(D.isChargeCardFeatureEnabled),{isFeatureEnabled:g}=d(D.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=d(D.isTreasuryEnabled),E=m(h=>le(h)),y=fe(s),j=he(g,s),S=!j&&E,I=Fn(s,b,g),{areTenantIdsInSync:L}=Rn();u.useEffect(()=>{L&&a(tn(p,S))},[p,a,S,L]);const A=m(h=>an(h,S)),K=A.fetchState==="Not-Started"||A.fetchState==="In-Progress"||p==null,z=sn(s),J=!!s.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,O=h=>{n(h)};return t.jsxs(dt,{children:[t.jsx(v,{isAppContentDrawerOpen:o,handleDrawerToggle:O}),e!=null?t.jsx(t.Fragment,{children:e}):t.jsx(Bn,{myProfileView:A,isAccountingClassesEnabled:E,isReimbursementDisabled:J===!1,isZeniAccountsDisabled:f===!1,isChargeCardDisabled:I===!1,isTreasuryDisabled:l===!1,isLiteRoleDisabled:z===!1,onClickMenuIcon:()=>{O(!0)},isLoading:K,isBankingOnlyTenant:j,isCardsOnlyTenant:y,onAddressClick:h=>{const M=function(Z,H){let w=`/${Z}/settings/my_profile`;return w=w.concat(`/new/${H}`),w}(r,h),Q=_n(c.state?.pathnameStackToGoBack,c.pathname);i(M,{state:{pathnameStackToGoBack:Q}})},onGetOtp:h=>{const M={...A.myProfileLocalData,phone:h};a(te({localData:M})),a(rn(h,"MyProfile"))},onResendOtp:h=>{a(ln(h,"MyProfile"))},onCancelClick:()=>{a(cn())},onSaveClick:()=>{a(ae("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},onVerifyOtp:(h,M)=>{a(on(h,M,"MyProfile"))},onVerifyOtpSuccess:h=>{h!=null&&C.saveZeniOtpToken(h),a(ae("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},updateMyProfileLocalData:h=>{a(te({localData:h}))}})]})};function ut(){const e=P(),a=m(l=>k(l)).companyId,i=m(l=>dn(l)),c=m(l=>be(l)),o=C.getSignedInUser(),[n,s]=u.useState(!1),r=u.useCallback(l=>{s(l)},[]),p=u.useCallback(l=>{e(un(l))},[]),d=u.useCallback(()=>{o?.userEmail!=null&&e(pn({loggedInUserEmail:o.userEmail}))},[o?.userEmail]),f=u.useCallback(()=>{e(gn())},[]);if(o==null)throw Error("Can't access Notification Settings page without signing in...");const b=u.useCallback(()=>{const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(se(l,a))},[a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled]),g=u.useCallback(()=>{e(mn())},[]);return u.useEffect(()=>{if(c.fetchState==="Completed"&&i.fetchState!=="In-Progress"&&i.fetchState!=="Completed"){const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(se(l,a))}},[i.fetchState,a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled,c.fetchState]),t.jsxs(t.Fragment,{children:[t.jsx(v,{isAppContentDrawerOpen:n,handleDrawerToggle:r}),t.jsx(Vn,{notificationSettingsView:i,onFormDataChange:p,onCancel:d,onSave:f,onClickMenuIcon:()=>{r(!0)},signedInUser:o,onRefresh:b,resetUpdateStatus:g})]})}function Jt(e){const[a,i]=u.useState(!1),c=m(l=>be(l)),o=m(l=>k(l)),n=V(),s=C.getSignedInUser(),r=P(),{useFeatureGate:p}=ee(),{isFeatureEnabled:d}=p(D.isDebitCardFeatureEnabled),f=s?.userEmail==null||c.fetchState!=="Completed"||fn(c.notificationSettings,s.userEmail,d,o);u.useEffect(()=>{c.fetchState!=="In-Progress"&&c.fetchState!=="Completed"&&a===!1&&(i(!0),r(hn()))},[c.fetchState,a]);const b=he(d,o),g=fe(o);return c.fetchState!=="In-Progress"&&c.fetchState!=="Not-Started"||f!==!0?bn(o)?t.jsxs(q,{children:[Sn(n?.loggedInUserRole??[],d,o,n?.loggedInUserRoleMap)&&t.jsx(x,{path:"accounting/*",element:t.jsx(Hn,{})}),yn(n?.loggedInUserRole??[],d,o,n?.loggedInUserRoleMap)&&t.jsx(x,{path:"approval_rules/*",element:t.jsx(pt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),In(o,n?.loggedInUserRoleMap)&&t.jsx(x,{path:"my_bank_connections",element:t.jsx(rt,{})}),xn(o,n?.loggedInUserRoleMap)&&t.jsx(x,{path:"bank_connections",element:t.jsx(nt,{})}),Cn(o,n?.loggedInUserRoleMap)&&t.jsx(x,{path:"business_verification",element:t.jsx(Gn,{productType:b?"zeni_accounts":g?"charge_cards":$n(o,n?.loggedInUserRoleMap)})}),En(n?.loggedInUserRole??[],o,n?.loggedInUserRoleMap)&&t.jsx(x,{path:"company_details",element:t.jsx(Kn,{})}),An(n?.loggedInUserRole??[],o)&&t.jsx(x,{path:"billing",element:t.jsx(st,{})}),jn(n?.loggedInUserRole??[],d,o)&&t.jsx(x,{path:"integrations",element:t.jsx(it,{})}),t.jsx(x,{path:"my_profile/new/:addressType",element:t.jsx(ie,{appContent:t.jsx(Nn,{isSubPage:!1})})}),t.jsx(x,{path:"my_profile",element:t.jsx(ie,{})}),f&&t.jsx(x,{path:"notifications",element:t.jsx(ut,{})}),t.jsx(x,{path:"*",element:t.jsx(F,{})})]}):t.jsx(q,{children:t.jsx(x,{path:"*",element:t.jsx(F,{})})}):null}function pt(e){return t.jsxs(q,{children:[t.jsx(x,{path:"/",element:t.jsx(Xn,{})}),t.jsx(x,{path:"bills/approval-rules/*",element:t.jsx(zn,{})}),t.jsx(x,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?t.jsx(Jn,{}):t.jsx(F,{})}),t.jsx(x,{path:"*",element:t.jsx(F,{})})]})}export{Jt as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-
|
|
1
|
+
import{j as u}from"./liveblocks-tcXs1fes.js";import{j as Q,u as X,h as Y,l as W,g as E,N as M,k as G,q as Xe}from"./core-DkPdadc6.js";import{bD as Ye,cj as Ie,M6 as ye,eN as F,cv as en,xd as Z,x2 as nn,Mi as tn,Ml as an,pE as ee,ps as ne,j_ as te,rD as N,Mn as Ae,fz as $e,fy as We,fx as Ge,Mo as sn,xm as on,Bd as ke,B4 as _e,B1 as ve,AU as J,B7 as Pe,Ba as Ee,Bg as we,s5 as De,fO as cn,cq as rn,eT as un,eR as dn,eS as ln,bs as pn,Mp as mn,zW as le,Ay as yn,Mq as fn,bE as gn,Ct as pe,Bx as Sn,Mr as bn,Ms as hn,Cx as Cn,CB as In,rw as An,GH as kn,D6 as Ce,D$ as me,Mt as _n,Mu as vn,Mv as Pn,Mw as He,Mx as En,J0 as wn,Lv as Dn,Jc as Tn,My as qe,Mz as xe,Dk as Je,k6 as Un,pv as Ke,rF as On,bC as je,rR as Me,ct as Bn,MA as Qe,fb as xn,CQ as Fn,CU as Vn,MB as jn,D9 as Re,MC as Mn,MD as Rn,ME as Nn,MF as zn,fH as Ln,yx as Zn,MG as $n,yC as Wn,yB as Gn}from"./zeni-epic-state-CSoWjbAn.js";import{j as ae,a as ie,p as de,h as Te,aJ as K,z as D,x as se,d as w,B as Ue,f as $,bq as Hn,ap as oe,br as V,bs as qn,bt as Jn,ab as Ve,bu as Kn,r as Ne,aq as ze,q as Qn,E as Xn,bv as Yn,bw as et,bx as nt,a2 as tt}from"./index-CpD5ML2i.js";import{a as C}from"./sentry-DNuKG-9f.js";import{n as Fe,D as at,S as it}from"./mui-DbdGpDJj.js";import{M as fe}from"./MobileAppDrawer-n8t03yaO.js";import R from"./NotFoundScreen-DpPEAqIa.js";import{a as Le}from"./analyticsHelper-DJMvFBQ1.js";import{c as Ze}from"./routePaths-D7wc65Bl.js";import{B as Be}from"./BusinessVerificationPageScreen-DgymQkoP.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="b2fe682d-cf4c-4a98-8246-8f2b3066b02d",e._sentryDebugIdIdentifier="sentry-dbid-b2fe682d-cf4c-4a98-8246-8f2b3066b02d")}catch{}})();const st=Fe.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as f}from"./liveblocks-
|
|
1
|
+
import{j as f}from"./liveblocks-tcXs1fes.js";import{a as u,b as T,q as A}from"./sentry-DNuKG-9f.js";import{h as D,j as z,g as l,u as j,N as M,k as O}from"./core-DkPdadc6.js";import{u as F,z as s,h as P,d as E,D as N,e as _,f as B,v as q,g as V,s as $,i as v}from"./index-CpD5ML2i.js";import{eN as G,Ii as J,Ij as R,eO as W,fh as H,Io as K,fG as Q,cS as X,Ip as b,Iq as Y,Ir as Z,bR as y}from"./zeni-epic-state-CSoWjbAn.js";import"./mui-DbdGpDJj.js";import{u as ee}from"./useDeviceId-DoEHbao8.js";import{f as te}from"./analyticsHelper-DJMvFBQ1.js";import{t as ne}from"./getLocaleForTenant-FjCgXmXO.js";import"./recharts-D0a4NFa9.js";import"./analytics-CcGmsyc8.js";import"./plaid-UeHpA8su.js";import"./dnd-D-YvLFfj.js";import"./stripe-DMRn4zHo.js";import"./lottie-CwApzZxI.js";import"./lexical-Sc7rk4Y7.js";import"./pdf-DG2fyOfp.js";import"./utils-BmJyX3cx.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="6a6b71c5-d397-4d97-a384-02a373999f8a",t._sentryDebugIdIdentifier="sentry-dbid-6a6b71c5-d397-4d97-a384-02a373999f8a")}catch{}})();const ie=O(function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}},function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{A({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const c=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Z({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(c),sourceUri:y(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(Y(n,a)))},clearSignInError:()=>{t(b())}}})($),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=D(),d=z(),{clearAllLoading:g}=F(),n=s.getSignedInUser();u.useLayoutEffect(()=>{g()},[g]);const a=ee(),c=l(e=>e.tenantState.magicLinkCodeVerifier),{sendEmailMagicLinkFetchState:h,accountLocked:C,accountUnlockTime:k}=l(e=>e.tenantState),p=l(e=>e.tenantState.fetchState),L=l(e=>e.tenantState.activeTenantFetchState.fetchState),I=l(e=>e.tenantState.signInState),o=l(e=>e.tenantState.loggedInUser),r=l(e=>G(e)),S=l(e=>J(e)),m=j(),w=P().mode,U=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(u.useEffect(()=>{h.fetchState==="Completed"&&c!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))},[h.fetchState,c]),u.useEffect(()=>{t(void 0)},[]),u.useEffect(()=>{I!=="In-Progress"||p!=="Completed"&&L!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(R(S.tenantsInOrder),o.zeniSessionId),W(o.userId,o.zeniSessionId,r.tenantId),i(H(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(K("Completed")),N.updateAppLocaleID(ne(r)),te(o,r,w,void 0,S.tenantsInOrder),Q().then(()=>{const e=V();e!=null&&_(e)}),setTimeout(()=>{E.trackLogin(B.Event.loginSuccess,o.authProvider??"google",X(r.productSettings))},2e3))},[I,p,L,o,r,S,w,m.state,i]),I==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(M,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!U,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),C===!0&&k!=null?f.jsx(q,{onClose:()=>i(b()),unlockDate:k}):null]})}export{ve as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-
|
|
1
|
+
import{j as s}from"./liveblocks-tcXs1fes.js";import{a as n}from"./sentry-DNuKG-9f.js";import{h as u,u as m,j as p,N as g}from"./core-DkPdadc6.js";import{z as f,B as b,t as y,d,f as h}from"./index-CpD5ML2i.js";import{fL as I,fM as x,IE as j}from"./zeni-epic-state-CSoWjbAn.js";import{n as w}from"./mui-DbdGpDJj.js";import"./recharts-D0a4NFa9.js";import"./analytics-CcGmsyc8.js";import"./plaid-UeHpA8su.js";import"./dnd-D-YvLFfj.js";import"./stripe-DMRn4zHo.js";import"./lottie-CwApzZxI.js";import"./lexical-Sc7rk4Y7.js";import"./pdf-DG2fyOfp.js";import"./utils-BmJyX3cx.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]="87daac91-5bee-429d-bb3a-42090e257f5c",e._sentryDebugIdIdentifier="sentry-dbid-87daac91-5bee-429d-bb3a-42090e257f5c")}catch{}})();function $(){const e=u(),t=m(),i=p(),a=n.useRef(!1),c=f.isSignedIn(),r=t.state?.message==="logout",o=r||c;return n.useEffect(()=>{o&&!a.current&&(a.current=!0,setTimeout(()=>{try{f.clearAll(),e(I()),e(x(!1)),j(),y.reset(),d.trackLogout(h.Event.logoutSuccess),d.resetUserIdentity()}catch(l){console.error("Error during sign out:",l)}finally{r||i("/signin/auth",{replace:!0})}},0))},[o,r]),o?s.jsx(E,{children:s.jsx(b,{fetchState:"In-Progress"})}):s.jsx(g,{to:"../",replace:!0})}const E=w.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as k}from"./liveblocks-
|
|
1
|
+
import{j as k}from"./liveblocks-tcXs1fes.js";import{a as m}from"./sentry-DNuKG-9f.js";import{j,h as N,u as R,g as G,l as $,k as v}from"./core-DkPdadc6.js";import{M as O,z as K,a as M,p as U,x as _,d as z,f as V,cF as W,r as f,m as q}from"./index-CpD5ML2i.js";import{eN as X,Pn as B,Fs as y,Po as L,Pj as H,ET as S,Pp as J,EX as I,Ew as Q,Ft as b,Pq as w,gC as Y,Fi as Z,Fn as aa,Fa as ta,F8 as ea,Fo as sa,F5 as oa,Pr as na,Ps as ia,Pt as la,Pu as u,e9 as ra,Pv as ca,Pw as pa}from"./zeni-epic-state-CSoWjbAn.js";import{n as ka}from"./mui-DbdGpDJj.js";import{u as ua}from"./useAskAiCfoHostNavButtonProps-BtZXhZ4f.js";import{c as da}from"./useFetchSuggestedQuestionsWhenReady-Bhmav9DR.js";import{M as ma}from"./MobileAppDrawer-n8t03yaO.js";import"./recharts-D0a4NFa9.js";import"./analytics-CcGmsyc8.js";import"./plaid-UeHpA8su.js";import"./dnd-D-YvLFfj.js";import"./stripe-DMRn4zHo.js";import"./lottie-CwApzZxI.js";import"./lexical-Sc7rk4Y7.js";import"./pdf-DG2fyOfp.js";import"./utils-BmJyX3cx.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="dd773218-5bfe-43de-99e3-71993e247e01",t._sentryDebugIdIdentifier="sentry-dbid-dd773218-5bfe-43de-99e3-71993e247e01")}catch{}})();const fa=ka.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,4 +6,4 @@ import{j as k}from"./liveblocks-BeS4QmMp.js";import{a as m}from"./sentry-BlmJH5W
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${t=>t.theme.colors.grey4};
|
|
9
|
-
`,Ta
|
|
9
|
+
`,Ta=v(function(t,e){const o=B(t,e.isTaskTemplatesEnabled),{taskGroupId:i}=e,n=i!=null&&i!==""?{...o,taskGroupsWithTasksList:o.taskGroupsWithTasksList.map(l=>({...l,tasks:l.tasks.filter(r=>r.taskGroupIds.includes(i))})).filter(l=>l.tasks.length>0)}:o;return{taskListView:n,tagListView:H(t),localData:n.localData,isTaskTemplatesEnabled:e.isTaskTemplatesEnabled}},function(t,e){const{navigate:o,currentTenant:i,location:n,isTaskTemplatesEnabled:l}=e,{tenantEmailDomain:r}=i,{groupByKey:T}=e.uiState;return{onTaskManagementRowClick:a=>{const s=ga(r,a),p=f(n.state?.pathnameStackToGoBack,n.pathname);o(s,{state:{pathnameStackToGoBack:p}})},onReloadTasks:()=>{t(y(!0,l))},onNewTaskClick:()=>{if(e.localData.defaultTaskGroupId!=null){const a=C(r,e.localData.defaultTaskGroupId),s=f(n.state?.pathnameStackToGoBack,n.pathname);o(a,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(a,s)=>{t(w({uiState:{sortKey:a,sortOrder:s}}))},onFiltersChange:a=>{t(la({filters:a}))},onSearchTextChanged:a=>{t(ia({searchText:a}))},onReloadCards:()=>{t(y(!0,l))},onBackClick:()=>{if(n.state?.message==="triggerBackClick"){const a=q(n.state?.pathnameStackToGoBack),s=a.poppedPathname??"../";o(s,{state:{pathnameStackToGoBack:a.newStack}})}else o("../")},updateLocalData:a=>{t(na({localData:a}))},resetLocalData:()=>{t(L({taskGroupById:e.taskGroupState.taskGroupById}))},handleCreateGroup:a=>{t(oa(e.localData.newTaskGroupName,a))},assignGroupToTasks:a=>{t(ea(e.localData.selectedTaskIds,a,sa(e.uiState.groupByKey,a)))},onDeleteTaskGroup:a=>{t(ta(a))},onAddNewTaskToTaskGroup:a=>{if(e.localData.defaultTaskGroupId!=null){const s=ha(T,a);t(S({taskDetailLocalData:s}));const p=C(r,e.uiState.groupByKey==="groupName"?a:e.localData.defaultTaskGroupId),g=f(n.state?.pathnameStackToGoBack,n.pathname);o(p,{state:{pathnameStackToGoBack:g,message:"comingFromTaskListPage"}})}},onDragNDrop:(a,s)=>{t(aa(e.localData.selectedTaskIds.length>0?e.localData.selectedTaskIds:[a],s))},onTaskGroupRename:(a,s)=>{t(Z(a,s))},onTimeSpentUpdate:(a,s)=>{t(b({task:a,updates:s}))},onShowToast:a=>{t(Y(a))},onGroupByFilterChange:a=>{t(w({uiState:{groupByKey:a}}))},updateTask:(a,s)=>{t(b({task:a,updates:s}))},onCreateTagClick:(a,s)=>{t(Q(a,s))},handleGroupTemplateClick:a=>{t(I(a,[]))},handleGroupTemplateTaskClick:(a,s)=>{t(I(a,[s]))},handleNewTaskInitialization:a=>{if(t(S({taskDetailLocalData:{...J,name:a}})),e.localData.defaultTaskGroupId!=null){const s=C(r,e.localData.defaultTaskGroupId),p=f(n.state?.pathnameStackToGoBack,n.pathname);o(s,{state:{pathnameStackToGoBack:p,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:a=>{o(`/${r}/tasks/group/${a}`)}}})(W);function $a(){const{isAiCfoOpen:t,setIsAiCfoOpen:e}=O(),o=j(),i=N(),n=R(),l=K.getSignedInUser(),r=G(c=>X(c)),{taskGroupId:T}=$(),{useFeatureGate:a}=M(),{isFeatureEnabled:s}=a(U.isTaskTemplatesEnabled),[p,g]=m.useState(!1),[E,F]=m.useState(!1),h=G(c=>B(c,s)),D=G(c=>c.taskGroupState),d=h.fetchState,{isAiCfoAccessEnabled:P,onAskAiCfoClick:A}=ua({isAiCfoOpen:t,setIsAiCfoOpen:e,mobileExploreReferrer:"Task Checklist"});if(da({isDataReady:d==="Completed"}),m.useEffect(()=>{p||(g(!0),i(y(!1,s)))},[p,i]),m.useEffect(()=>{d==="Completed"&&i(L({taskGroupById:D.taskGroupById}))},[d,D.taskGroupById]),l==null)throw Error("Can't access task list page without signing in...");return k.jsxs(k.Fragment,{children:[d==="Completed"?k.jsx(_,{analytics:z,onLoad:c=>(x=>x.trackPageLoaded(V.Event.taskListPage))(c)}):null,k.jsxs(fa,{children:[k.jsx(ma,{isAppContentDrawerOpen:E,handleDrawerToggle:c=>{F(c)}}),k.jsx(Ta,{location:n,navigate:o,currentTenant:r,taskGroupId:T,taskGroupState:D,localData:h.localData,uiState:h.uiState,isTaskTemplatesEnabled:s,taskListFetchState:d,isAiCfoAccessEnabled:P,onAskAiCfoClick:A})]})]})}const ga=(t,e)=>`/${t}/tasks/${encodeURIComponent(e)}`,C=(t,e)=>`/${t}/tasks/new/${e}`,ha=(t,e)=>{if(t==="assignee"){const o=e.split(",");return{...u.taskDetailLocalData,assignee:o}}if(t==="priority"){const o=ra(e);return{...u.taskDetailLocalData,priority:o}}if(t==="status"){const o=ca(e);return{...u.taskDetailLocalData,status:o}}if(t==="tag"){const o=e.split(",");return{...u.taskDetailLocalData,tagIds:o}}if(t==="dueDate"){const o=pa(e);return{...u.taskDetailLocalData,dueDate:o}}return{...u.taskDetailLocalData}};export{$a as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-
|
|
1
|
+
import{j as s}from"./liveblocks-tcXs1fes.js";import $ from"./NotFoundScreen-DpPEAqIa.js";import{a as d}from"./sentry-DNuKG-9f.js";import{j as z,h as V,u as _,l as A,g as f,N as O,k as R,n as q,o as u}from"./core-DkPdadc6.js";import{$ as J,z as b,r as w,x as M,d as D,f as H,cE as Q,i as Z,ap as K,m as W}from"./index-CpD5ML2i.js";import{eN as C,Pj as G,EP as P,ED as X,Ff as Y,Pk as v,Pl as aa,Ez as ea,Ew as ta,pE as sa,ps as na,j_ as oa,EJ as ia,Pm as ra,EG as la,EU as ca,ET as ma}from"./zeni-epic-state-CSoWjbAn.js";import{n as da}from"./mui-DbdGpDJj.js";import{u as pa}from"./useInitialThreadRequest-DId3URPK.js";import{M as ua}from"./MobileAppDrawer-n8t03yaO.js";import ka from"./TaskListScreen-Bvnm9IXP.js";import"./recharts-D0a4NFa9.js";import"./analytics-CcGmsyc8.js";import"./plaid-UeHpA8su.js";import"./dnd-D-YvLFfj.js";import"./stripe-DMRn4zHo.js";import"./lottie-CwApzZxI.js";import"./lexical-Sc7rk4Y7.js";import"./pdf-DG2fyOfp.js";import"./utils-BmJyX3cx.js";import"./useAskAiCfoHostNavButtonProps-BtZXhZ4f.js";import"./useFetchSuggestedQuestionsWhenReady-Bhmav9DR.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]="566bbe97-67ad-433a-b87a-9058c001c390",a._sentryDebugIdIdentifier="sentry-dbid-566bbe97-67ad-433a-b87a-9058c001c390")}catch{}})();const fa=R(function(a,t){const{location:n,taskGroupId:l}=t,m=v(a,t.taskId),c=C(a),i=l!=null?aa(a.taskGroupState,l):void 0,p=b.getSignedInUser(),e=c.tenantId,r={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:e??""},k=G(a);return{taskDetailSelectorView:m,authParams:r,isNewClicked:n.state?.message==="comingFromTaskListPage",filesEndPoint:K.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${Z.appUrl}${t.location.pathname}`,tagListView:k,taskGroupName:l!=null&&i!=null&&i.isDefault===!1?i.name:void 0}},function(a,t){const{taskId:n,navigate:l,currentTenant:m,location:c,taskGroupId:i}=t,{tenantEmailDomain:p}=m;return{onSaveChangesToLocalStore:e=>{a(ma({taskDetailLocalData:e,taskId:n}))},onSaveDetailClick:()=>{a(ca(n,i))},onArchiveTaskClick:()=>{t.taskId!=null&&a(la(t.taskId))},onDismissClick:()=>{if(c.state?.message==="triggerBackClick"){const e=W(c.state?.pathnameStackToGoBack),r=e.poppedPathname??"../../dashboard";l(r,{state:{pathnameStackToGoBack:e.newStack}})}else{const e=B(p),r=w(c.state?.pathnameStackToGoBack,c.pathname);l(e,{state:{pathnameStackToGoBack:r}})}a(ra({taskId:n}))},onDeleteTaskClick:()=>{a(ia(n))},updateFilesEntity:e=>{a(oa({files:e}))},onDeleteFile:e=>{a(na(e))},onEditFileName:(e,r)=>{a(sa(e,r.split(".")[0]))},onReloadTaskDetailPage:()=>{a(P(!1,n))},onCreateTagClick:e=>{a(ta(e,n))},onDeleteTagClick:e=>{a(ea(e,n))}}})(Q);function I(){const a=z(),t=V(),n=_(),l=J(),{taskId:m,taskGroupId:c}=A(),i=f(o=>C(o)),p=pa(i?.companyId),[e,r]=d.useState(!1),[k,F]=d.useState(!1),[S,L]=d.useState(!1),[x,N]=d.useState(!1),E=f(o=>G(o)),T=f(o=>o.taskGroupViewState.fetchState);d.useEffect(()=>{k||(F(!0),t(P(!1,m)))},[k,t]),d.useEffect(()=>{S||E.fetchState==="Completed"||(L(!0),t(X()))},[S,t,E.fetchState]),d.useEffect(()=>{x||T==="Completed"||(N(!0),t(Y()))},[x,t,T]);const j=f(o=>v(o,m)),g=j.fetchState,y=b.getSignedInUser();if(y==null)throw Error("Can't access task detail page without signing in...");if(g==="Error"&&j.error?.code===400){const{tenantEmailDomain:o}=i,h=B(o),U=w(n.state?.pathnameStackToGoBack,n.pathname);return s.jsx(O,{to:h,state:{pathnameStackToGoBack:U}})}return s.jsxs(s.Fragment,{children:[g==="Completed"?s.jsx(M,{analytics:D,onLoad:o=>(h=>h.trackPageLoaded(H.Event.taskDetailPage))(o)}):null,s.jsxs(ga,{children:[s.jsx(ua,{isAppContentDrawerOpen:e,handleDrawerToggle:o=>{r(o)}}),s.jsx(fa,{analytics:D,currentTenant:i,handleZeniLogoClick:()=>{l.toggle()},initialOpenThreadRequest:p,location:n,loggedInUser:y,navigate:a,taskGroupId:c,taskId:m,taskDetailFetchState:g})]})]})}const ga=da.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,4 +6,4 @@ import{j as s}from"./liveblocks-BeS4QmMp.js";import z from"./NotFoundScreen-B8pp
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${a=>a.theme.colors.grey4};
|
|
9
|
-
`,B=a=>`/${a}/tasks`;function
|
|
9
|
+
`,B=a=>`/${a}/tasks`;function za(){return s.jsxs(q,{children:[s.jsx(u,{path:"/new",element:s.jsx(I,{})}),s.jsx(u,{path:"/new/:taskGroupId",element:s.jsx(I,{})}),s.jsx(u,{path:"/group/:taskGroupId",element:s.jsx(ka,{})}),s.jsx(u,{path:"/:taskId",element:s.jsx(I,{})}),s.jsx(u,{path:"*",element:s.jsx($,{})})]})}export{za as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as t}from"./liveblocks-tcXs1fes.js";import i from"./NotFoundScreen-DpPEAqIa.js";import{T as r}from"./TransactionDetailScreen-BARgRHWT.js";import"./sentry-DNuKG-9f.js";import{n as d,o as e}from"./core-DkPdadc6.js";import"./zeni-epic-state-CSoWjbAn.js";import"./recharts-D0a4NFa9.js";import"./index-CpD5ML2i.js";import"./mui-DbdGpDJj.js";import"./analytics-CcGmsyc8.js";import"./plaid-UeHpA8su.js";import"./dnd-D-YvLFfj.js";import"./stripe-DMRn4zHo.js";import"./lottie-CwApzZxI.js";import"./lexical-Sc7rk4Y7.js";import"./pdf-DG2fyOfp.js";import"./utils-BmJyX3cx.js";import"./useAskAiCfoHostNavButtonProps-BtZXhZ4f.js";import"./useFetchSuggestedQuestionsWhenReady-Bhmav9DR.js";import"./decodeURIComponentSafe-h3wJzOm1.js";import"./routePaths-D7wc65Bl.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new o.Error().stack;n&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[n]="256f287b-7a3d-4d6d-890e-a8cb9db8b86d",o._sentryDebugIdIdentifier="sentry-dbid-256f287b-7a3d-4d6d-890e-a8cb9db8b86d")}catch{}})();function q(){return t.jsxs(d,{children:[t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(e,{path:"/*",element:t.jsx(r,{})})]})}export{q as default};
|
package/dist/assets/{TransactionDetailScreen-B0sPog3q.js → TransactionDetailScreen-BARgRHWT.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{j as I}from"./liveblocks-
|
|
1
|
+
import{j as I}from"./liveblocks-tcXs1fes.js";import{a as d}from"./sentry-DNuKG-9f.js";import{h as j,g as S,u as re,j as le,l as de,N as je,k as Ke}from"./core-DkPdadc6.js";import{bn as $e,eN as J,cO as ue,bv as me,pj as H,Jq as P,Kr as pe,Ks as Y,JQ as he,jB as fe,Kt as ge,JV as Q,JW as X,kq as Se,Gz as Z,Jk as _,jv as Te,jt as ve,jF as Me,Ku as qe,Kv as We,t8 as G,jA as ye,FW as Ee,cT as Je,cU as He,Kw as Ye,Jj as Qe,Kx as Xe,tc as Ze,Ky as ea,Kz as aa,KA as ta,KB as na,KC as oa,jE as sa,KD as ia,KE as ca,Jl as ra,KF as la,KG as da,KH as ua,FQ as ma,FE as pa,G6 as ha,jG as fa,GA as ie,FN as ga}from"./zeni-epic-state-CSoWjbAn.js";import{z as De,a as ee,p as V,aJ as Ce,h as Sa,q as Ta,aK as va,E as ya,m as q,j as Ea,aL as Da,r as W,M as Ca,d as be,aM as ba,ap as Ia,U as M}from"./index-CpD5ML2i.js";import{n as ka,S as Aa,D as Ua}from"./mui-DbdGpDJj.js";import{u as xa}from"./useAskAiCfoHostNavButtonProps-BtZXhZ4f.js";import{c as _a}from"./useFetchSuggestedQuestionsWhenReady-Bhmav9DR.js";import{d as Ie}from"./decodeURIComponentSafe-h3wJzOm1.js";import{h as ke,g as Va,d as Ba,b as Fa}from"./routePaths-D7wc65Bl.js";import{t as Pa}from"./utils-BmJyX3cx.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="b1484834-c48d-4917-8d23-c8a8639a11e3",a._sentryDebugIdIdentifier="sentry-dbid-b1484834-c48d-4917-8d23-c8a8639a11e3")}catch{}})();const ae=()=>{const a=De.getSignedInUser(),{useFeatureGate:e}=ee(),{isFeatureEnabled:s}=e(V.isChainOfThoughtEnabled);return d.useMemo(()=>$e(a)&&s,[a,s])};function Ae(a){if(a!=null){if("customer"in a&&a.customer!=null){const{customer:e}=a;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in a&&a.vendor!=null){const{vendor:e}=a;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function Za(a,e){const s=j(),{useFeatureGate:t,useDynamicConfig:n}=ee(),o=S(u=>J(u)),i=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),l=o.userRole!=null&&ue(o.userRole),g=o.userRole!=null&&me(o.userRole),{isFeatureEnabled:T}=t(V.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:b}=t(V.isExpenseAutomationEnabled),{configValue:h}=n(Ce.enableUncategorizedExpenseCategory),f=h?.uncategorized_expense_category_enabled===!0,k=ae(),v=d.useMemo(()=>({id:a,type:H(e)}),[a,e]),m=S(u=>P(u,v)),C=S(u=>{const N=P(u,v)?.transactionDetailLocalData.vendorUpdates?.id;return N==null?"Not-Started":u.transactionVendorViewState.editVendorStateById[N]?.saveStatus.fetchState??"Not-Started"}),p=d.useMemo(()=>m?.fetchState==="Completed"?Ae(m?.transaction):void 0,[m?.fetchState,m?.transaction]),E=S(u=>{if(p!=null)return pe(u.customerIncomeState,u.vendorExpenseState,u.trendState,p,"month")}),A=S(u=>Y(u)),B=S(u=>{if(p!=null)return he(u.trendWithTransactionsState,p,"TransactionDetail")}),K=o.company?.companyInfo.firstMonthOfFY??1,$=S(u=>fe(u.accountState,u.accountListState,"accountList")),[w,F]=d.useState(!1),[L,y]=d.useState(!1),[c,O]=d.useState(!1);d.useEffect(()=>{F(!1),y(!1),O(!1)},[a,e]);const D=d.useCallback(()=>{F(!1),y(!1)},[]),[U,x]=d.useState(!1),z=B?.selectedPeriod?.timePeriod;return d.useEffect(()=>{c||m==null||m.transaction==null||(s(ge({id:m.transaction.id,type:m.transaction.type})),O(!0)),p!=null&&(!i||l&&g===!1)&&(w?L||E==null||(y(!0),s(Z(p,"TransactionDetail",{timeframe:"month",timePeriod:z??E}))):(s(Q()),s(X()),F(!0),s(Se(p))))},[s,c,m?.fetchState,m?.transaction,p,i,l,g,w,L,E,z]),d.useEffect(()=>{A.newVendorState?.vendorDetailLocalData?.vendorName!=null?x(!0):x(!1)},[A.newVendorState?.vendorDetailLocalData?.vendorName]),d.useEffect(()=>()=>{s(_("common"))},[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:i,isUserHasDashboardAccess:l,isUserHasInvestorOrBankerAccess:g,isVendorBulkUpdateOnTransactionEnabled:T,isExpenseAutomationEnabled:b,isUncategorizedExpenseCategoryEnabled:f,isChainOfThoughtEnabled:k,selectedTransaction:v,transactionDetail:m,vendorSaveStatus:C,tranEntity:p,defaultTrendTransactionTimePeriod:E,vendorViewDetails:A,uiState:B,firstMonthOfFY:K,uncategorizedAccounts:$,resetTrendIsFetchedStates:D,isCreateVendorDrawerOpen:U,setIsCreateVendorDrawerOpen:x}}const wa={overlayWidth:new ya(100,100,58)},La=({isOpen:a,onSaveVendor:e,onSaveSuccess:s,onCancel:t,vendorViewDetails:n})=>{const o=Sa(),i=Ta(),l=j(),g=S(h=>Y(h)),T=()=>{t()},b={vendorDetailView:n??g,onSaveSuccess:()=>{l(ve()),l(Me("Not-Started")),s()},onSaveVendor:e,onCancelClick:T,saveVendorDetailLocalData:h=>{l(Te({vendorId:void 0,localData:h}))}};return I.jsx(Ua,{anchor:"right",open:a,PaperProps:{style:{width:wa.overlayWidth.valuePercentage(i),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:T,children:I.jsx(Oa,{onClick:h=>h.stopPropagation(),children:I.jsx(va,{...b})})})},Oa=ka(Aa)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|
|
5
|
-
`,za=({closeDrawerHandler:a,overrideTransactionId:e,overrideTransactionType:s})=>{const t=re(),n=le(),o=j(),i=ae(),{transactionTypeEncoded:l,transactionId:g}=de(),T=e??g,b=s??Ie(l??"");let f;ke(T,b)&&(f={id:T,type:H(b)});const h=f!=null?S(v=>P(v,f)):void 0,k=()=>{const v=q(t.state?.pathnameStackToGoBack),m=v.poppedPathname??((C=2)=>{let p="../";for(let E=0;E<C;E++)p=`${p}../`;return p})(1);n(m,{state:{pathnameStackToGoBack:v.newStack}})};return{transactionId:f,onSaveVendor:()=>{o(ye(f,void 0))},onSaveSuccess:()=>{if(h!=null&&h?.transaction&&h?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&h?.transactionDetailLocalData.vendorUpdates?.id!=null){const v=h?.transactionDetailLocalData.vendorUpdates,m={id:h?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:h?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:v?.name,qboId:h?.transactionDetailLocalData.vendorUpdates?.qboId??""},C={transactionId:{id:h?.transaction?.id,type:h?.transaction?.type},transaction:h?.transaction,lineIds:h?.transaction?.lines?.map(p=>p.id)??[]};o(G(m,h?.transaction?.amount.amount,C,!1,!1,i))}k()},onCancel:()=>{f!=null&&o(qe({transactionId:f})),o(ve()),o(We()),a(!0),k()}}},Na=Ke(function(a,e){const s=P(a,e.selectedTransaction);let t;s==null&&console.warn("Check if the you've selected the transaction before getting the details");const n=De.getSignedInUser(),o=a.tenantState.currentTenantId,i={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""};s!=null&&s.fetchState==="Completed"&&s.transaction!=null&&e.entity!=null&&(t=Ye(a,e.entity,"TransactionDetail"));const l=a.entityAutoCompleteState.autoCompleteText.common,g=Qe(a,"common"),T=J(a);return{transactionDetail:s,transactionAttachmentEndpointToDownload:`${M}/transaction_attachment`,transactionAttachmentsEndpointToFetch:T.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${M}/transaction_attachments_accounting_provider`:`${M}/transaction_attachments`,attachmentUploadEndpoint:`${Ia.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:i,trendReport:t,analytics:be,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:l,entityAutoCompleteView:g},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails")}},function(a,e){const{isCOTEnabled:s}=e;return{onBackClick:()=>{if(a(_("common")),e.onBackClick!=null)return void e.onBackClick();const t=q(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ue(2);e.navigate(n,{state:{pathnameStackToGoBack:t.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(t,n)=>{e.transaction!=null&&a(ga({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:t,customerId:n}))},onTransactionClick:t=>{e.resetTrendIsFetchedStates(),a(Q()),a(X());const n=W(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(Ba(t,e.tenantEmailDomain),{state:{pathnameStackToGoBack:n}})},onTrendSelectedPeriodChange:t=>{if(t==null)e.defaultTrendTransactionTimePeriod!=null&&a(ie(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const n=t.currentTimePeriod==null?t.addTimePeriod:{startDate:t.addTimePeriod.startDate,endDate:t.currentTimePeriod.endDate};a(Z(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:t.addTimePeriod})),a(ie(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:n}))}},onSaveUpdates:(t,n,o,i)=>{a(i===!0&&o!=null?ye(t,o,!0,e.isExpenseAutomationEnabled,e.isUncategorizedExpenseCategoryEnabled):ha({transactionId:t,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:n,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled})),a(_("common"))},onUploadAttachmentAttachment:t=>{a(fa(t))},onDeleteAttachment:t=>{e.transaction!=null&&a(pa(t,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(t,n)=>{a(ma({transactionId:t,transactionLocalData:n}))},onUpdateAllChecked:(t,n,o,i)=>{e.transaction!=null&&a(ua(e.selectedTransaction,e.transaction,t,n,o,i))},onResetLineItemsCategoryClassInLocalData:(t,n,o,i,l,g)=>{a(da(t,n,o,i,l,g))},onChangeCategoryClassWhenUpdateAllIsChecked:(t,n)=>{e.transaction!=null&&a(la({id:e.transaction.id,type:e.transaction.type},e.transaction,t,n))},onSaveSuccess:()=>{const t=q(e.location.state?.pathnameStackToGoBack);if(t.poppedPathname!=null){const n=Pa(t.poppedPathname,"/").split("/"),o=n[n.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(o)&&e.navigate(t.poppedPathname,{state:{pathnameStackToGoBack:t.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const i=`${Va(e.tenantEmailDomain)}`;e.navigate(i)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const i=`${Fa(e.tenantEmailDomain)}`;e.navigate(i)}}},onPageRefresh:()=>{a(Ee(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(t,n)=>{t.trim().length>=2?a(ra({searchString:t,entityType:n,searchOrigin:"common"})):t.trim().length===0&&a(_("common"))},onCancelAutoComplete:()=>{a(_("common"))}},onFetchRecommendationsForEntity:(t,n,o,i)=>{a(G(t,n,o,i,!1,s))},clearRecommendationForLineId:t=>{const{transactionId:n,transaction:o,lineId:i}=t;a(ca(n,o,i))},resetUpdateErrorState:()=>{const t={id:e.selectedTransaction.id,type:e.selectedTransaction.type};a(ia(t))},onSaveVendorInLocalData:(t,n,o,i,l)=>{if(a(sa({transactionId:t,vendorUpdates:n,entity:o})),n.id!=null&&o!=null&&i!=null&&l!=null&&a(G(o,i,l,!1,!1,s)),a(Te({vendorId:n.id?n.id:void 0,localData:{vendorName:n.name,vendorId:n.id?n.id:void 0}})),!n.id&&e.transaction!=null){const g=e.transaction,T=W(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(g.type??"")}/${g.id}/vendor/create`,{state:{pathnameStackToGoBack:T}})}},onSaveCustomerInLocalData:(t,n,o,i,l)=>{a(oa({transactionId:t,customerUpdates:n,entity:o})),n.id!=null&&o!=null&&i!=null&&l!=null&&a(G(o,i,l,!1,!1,s))},onUpdateAllTranactionsWithCurrentVendorChecked:t=>{a(na({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:t}))},onClickUpdateVendorToAllLineItems:(t,n,o)=>{a(ta(t,n,o))},onResetVendorToAllLineItems:(t,n,o)=>{a(aa(t,n,o))},saveLatestSelectedEntity:(t,n,o)=>{a(ea({transactionId:t,lineId:n,entity:o}))},updateVendorBulkRecommendationsFetchStatus:(t,n)=>{a(Ze(t,n))},setIsVendorUpdateAllChecked:(t,n,o)=>{a(Xe(t,n,o))}}})(ba);function et(){const a=le(),e=j(),s=re(),{useFeatureGate:t,useDynamicConfig:n}=ee(),o=Ea(),i=S(r=>J(r)),l=i.userRole.includes("charge_card_user")||i.userRole.includes("charge_card_admin"),g=i.userRole!=null&&ue(i.userRole),T=i.userRole!=null&&me(i.userRole),{isFeatureEnabled:b}=t(V.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:f}=t(V.isExpenseAutomationEnabled),{configValue:h}=n(Ce.enableUncategorizedExpenseCategory),k=h?.uncategorized_expense_category_enabled===!0,{tenantEmailDomain:v,transactionTypeEncoded:m,transactionId:C}=de(),[p,E]=d.useState(!1),A=Ie(m??""),F=ke(C,A),K=S(r=>r.transactionVendorViewState),$=ae(),{isFeatureEnabled:w}=t(V.isTransactionCommentingEnabled),B=o?.currentTenant?.companyId,L=o?.currentTenant?.companyName;let y;F&&(y={id:C,type:H(A)});const c=y!=null?S(r=>P(r,y)):void 0,O=c?.transactionDetailLocalData.vendorUpdates?.id!=null?K.editVendorStateById[c?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",D=c?.fetchState==="Completed"?Ae(c?.transaction):void 0,U=S(r=>D!=null?pe(r.customerIncomeState,r.vendorExpenseState,r.trendState,D,"month"):void 0),x=S(r=>Y(r)),z=S(r=>D!=null?fe(r.trendWithTransactionsState,D,"TransactionDetail"):void 0),u=i.company?.companyInfo.firstMonthOfFY??1,N=S(r=>he(r.accountState,r.accountListState,"accountList")),[xe,te]=d.useState(!1),[_e,ne]=d.useState(!1),[Ve,Fe]=d.useState(!1),oe=()=>{te(!1),ne(!1)},Be=Da();d.useEffect(()=>{if(y!=null&&c!=null&&c.fetchState==="Not-Started")e(Ee(y)),oe();else if(y!=null&&c!=null&&c.fetchState==="Error"){const r=W(s.state?.pathnameStackToGoBack,s.pathname),R={pathnameStackToGoBack:r,message:"pageNotFound",origin:"transaction_detail"};Be&&(R.message="expenseAutomation",R.origin="transaction_categorization",R.pathnameStackToGoBack=r),a("page-not-found",{replace:!0,state:R})}},[y]),d.useEffect(()=>{Ve||c==null||c.transaction==null||(e(ge({id:c.transaction.id,type:c.transaction.type})),Fe(!0)),D==null&&c?.fetchState==="Completed"&&ce(c?.transaction),D!=null&&(!l||g&&T===!1)&&(xe?_e||U==null||(ne(!0),e(Z(D,"TransactionDetail",{timeframe:"month",timePeriod:z?.selectedPeriod?.timePeriod??U}))):(e(Q()),e(X()),ce(c?.transaction),te(!0),e(Se(D))))},[c?.fetchState,c?.transaction,U,l]),d.useEffect(()=>{x.newVendorState?.vendorDetailLocalData?.vendorName!=null?E(!0):E(!1)},[x.newVendorState?.vendorDetailLocalData?.vendorName]),d.useEffect(()=>()=>{e(_("common"))},[]);const Pe=[m,C].filter(r=>r!=null),{transactionId:se,onSaveVendor:we,onSaveSuccess:Le,onCancel:Oe}=za({closeDrawerHandler:r=>{E(!1),a(r?"../":"../..")}}),{isAiCfoOpen:ze,setIsAiCfoOpen:Ne}=Ca(),{isAiCfoAccessEnabled:Re,onAskAiCfoClick:Ge}=xa({isAiCfoOpen:ze,setIsAiCfoOpen:Ne,mobileExploreReferrer:"Transaction Details"});return _a({isDataReady:c?.fetchState==="Completed"}),F?I.jsxs(I.Fragment,{children:[se!=null&&p&&I.jsx(La,{isOpen:p,transactionId:se,onSaveVendor:we,onSaveSuccess:Le,onCancel:Oe}),I.jsx(Na,{hideDeleteAttachment:!0,firstMonthOfFY:u,isDisabled:c?.transaction?.type==="transfer"&&o?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:v,location:s,navigate:a,selectedTransaction:y,entity:D,isCOTEnabled:$,defaultTrendTransactionTimePeriod:U,resetTrendIsFetchedStates:oe,transaction:c?.transaction,uncategorizedAccounts:N,vendorSaveStatus:O,isVendorBulkUpdateOnTransactionEnabled:b,isExpenseAutomationEnabled:f,isUncategorizedExpenseCategoryEnabled:k,isAiCfoAccessEnabled:Re,onAskAiCfoClick:Ge,isTransactionCommentingEnabled:w,companyId:B,companyName:L})]}):I.jsx(je,{to:Ue(Pe.length)})}const Ue=(a=2)=>{let e="../";for(let s=0;s<a;s++)e=`${e}../`;return e},ce=a=>{if(a!=null){const{transactionCategory:e,transactionClass:s}=Ra(a),t=Ga(a);be.trackTransactionDetails(a.account?.accountId,a.account?.accountName,a.id,t,e.length>0?e:void 0,s.length>0?s:void 0,a.type,a.amount,a.memo,a.lines?.length??0,a.attachments?.map(n=>n.fileName))}},Ra=a=>{const e=[],s=[];return a.lines?.forEach(t=>{switch(t.type){case"transaction_with_account_and_class_line":case"transaction_with_product_or_service_line":case"journal_entry_transaction_line":case"linked_transaction_line":{const n=t;n!=null&&n.account!=null&&n.account.accountName?.length>0&&e.push(n.account.accountName),n.class!=null&&n.class.className?.length>0&&s.push(n.class.className);break}}}),{transactionCategory:e,transactionClass:s}},Ga=a=>Je(a)===!0?a.customer?.name??"":He(a)===!0?a.vendor?.name??"":a.memo!=null?a.memo:a.type;export{La as C,et as T,za as a,Na as b,ae as c,Za as u};
|
|
5
|
+
`,za=({closeDrawerHandler:a,overrideTransactionId:e,overrideTransactionType:s})=>{const t=re(),n=le(),o=j(),i=ae(),{transactionTypeEncoded:l,transactionId:g}=de(),T=e??g,b=s??Ie(l??"");let h;ke(T,b)&&(h={id:T,type:H(b)});const f=h!=null?S(v=>P(v,h)):void 0,k=()=>{const v=q(t.state?.pathnameStackToGoBack),m=v.poppedPathname??((C=2)=>{let p="../";for(let E=0;E<C;E++)p=`${p}../`;return p})(1);n(m,{state:{pathnameStackToGoBack:v.newStack}})};return{transactionId:h,onSaveVendor:()=>{o(ye(h,void 0))},onSaveSuccess:()=>{if(f!=null&&f?.transaction&&f?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&f?.transactionDetailLocalData.vendorUpdates?.id!=null){const v=f?.transactionDetailLocalData.vendorUpdates,m={id:f?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:f?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:v?.name,qboId:f?.transactionDetailLocalData.vendorUpdates?.qboId??""},C={transactionId:{id:f?.transaction?.id,type:f?.transaction?.type},transaction:f?.transaction,lineIds:f?.transaction?.lines?.map(p=>p.id)??[]};o(G(m,f?.transaction?.amount.amount,C,!1,!1,i))}k()},onCancel:()=>{h!=null&&o(qe({transactionId:h})),o(ve()),o(We()),a(!0),k()}}},Na=Ke(function(a,e){const s=P(a,e.selectedTransaction);let t;s==null&&console.warn("Check if the you've selected the transaction before getting the details");const n=De.getSignedInUser(),o=a.tenantState.currentTenantId,i={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""};s!=null&&s.fetchState==="Completed"&&s.transaction!=null&&e.entity!=null&&(t=Ye(a,e.entity,"TransactionDetail"));const l=a.entityAutoCompleteState.autoCompleteText.common,g=Qe(a,"common"),T=J(a);return{transactionDetail:s,transactionAttachmentEndpointToDownload:`${M}/transaction_attachment`,transactionAttachmentsEndpointToFetch:T.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${M}/transaction_attachments_accounting_provider`:`${M}/transaction_attachments`,attachmentUploadEndpoint:`${Ia.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:i,trendReport:t,analytics:be,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:l,entityAutoCompleteView:g},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails")}},function(a,e){const{isCOTEnabled:s}=e;return{onBackClick:()=>{if(a(_("common")),e.onBackClick!=null)return void e.onBackClick();const t=q(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ue(2);e.navigate(n,{state:{pathnameStackToGoBack:t.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(t,n)=>{e.transaction!=null&&a(ga({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:t,customerId:n}))},onTransactionClick:t=>{e.resetTrendIsFetchedStates(),a(Q()),a(X());const n=W(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(Fa(t,e.tenantEmailDomain),{state:{pathnameStackToGoBack:n}})},onTrendSelectedPeriodChange:t=>{if(t==null)e.defaultTrendTransactionTimePeriod!=null&&a(ie(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const n=t.currentTimePeriod==null?t.addTimePeriod:{startDate:t.addTimePeriod.startDate,endDate:t.currentTimePeriod.endDate};a(Z(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:t.addTimePeriod})),a(ie(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:n}))}},onSaveUpdates:(t,n,o,i)=>{a(i===!0&&o!=null?ye(t,o,!0,e.isExpenseAutomationEnabled,e.isUncategorizedExpenseCategoryEnabled):fa({transactionId:t,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:n,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled})),a(_("common"))},onUploadAttachmentAttachment:t=>{a(ha(t))},onDeleteAttachment:t=>{e.transaction!=null&&a(pa(t,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(t,n)=>{a(ma({transactionId:t,transactionLocalData:n}))},onUpdateAllChecked:(t,n,o,i)=>{e.transaction!=null&&a(ua(e.selectedTransaction,e.transaction,t,n,o,i))},onResetLineItemsCategoryClassInLocalData:(t,n,o,i,l,g)=>{a(da(t,n,o,i,l,g))},onChangeCategoryClassWhenUpdateAllIsChecked:(t,n)=>{e.transaction!=null&&a(la({id:e.transaction.id,type:e.transaction.type},e.transaction,t,n))},onSaveSuccess:()=>{const t=q(e.location.state?.pathnameStackToGoBack);if(t.poppedPathname!=null){const n=Pa(t.poppedPathname,"/").split("/"),o=n[n.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(o)&&e.navigate(t.poppedPathname,{state:{pathnameStackToGoBack:t.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const i=`${Va(e.tenantEmailDomain)}`;e.navigate(i)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const i=`${Ba(e.tenantEmailDomain)}`;e.navigate(i)}}},onPageRefresh:()=>{a(Ee(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(t,n)=>{t.trim().length>=2?a(ra({searchString:t,entityType:n,searchOrigin:"common"})):t.trim().length===0&&a(_("common"))},onCancelAutoComplete:()=>{a(_("common"))}},onFetchRecommendationsForEntity:(t,n,o,i)=>{a(G(t,n,o,i,!1,s))},clearRecommendationForLineId:t=>{const{transactionId:n,transaction:o,lineId:i}=t;a(ca(n,o,i))},resetUpdateErrorState:()=>{const t={id:e.selectedTransaction.id,type:e.selectedTransaction.type};a(ia(t))},onSaveVendorInLocalData:(t,n,o,i,l)=>{if(a(sa({transactionId:t,vendorUpdates:n,entity:o})),n.id!=null&&o!=null&&i!=null&&l!=null&&a(G(o,i,l,!1,!1,s)),a(Te({vendorId:n.id?n.id:void 0,localData:{vendorName:n.name,vendorId:n.id?n.id:void 0}})),!n.id&&e.transaction!=null){const g=e.transaction,T=W(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(g.type??"")}/${g.id}/vendor/create`,{state:{pathnameStackToGoBack:T}})}},onSaveCustomerInLocalData:(t,n,o,i,l)=>{a(oa({transactionId:t,customerUpdates:n,entity:o})),n.id!=null&&o!=null&&i!=null&&l!=null&&a(G(o,i,l,!1,!1,s))},onUpdateAllTranactionsWithCurrentVendorChecked:t=>{a(na({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:t}))},onClickUpdateVendorToAllLineItems:(t,n,o)=>{a(ta(t,n,o))},onResetVendorToAllLineItems:(t,n,o)=>{a(aa(t,n,o))},saveLatestSelectedEntity:(t,n,o)=>{a(ea({transactionId:t,lineId:n,entity:o}))},updateVendorBulkRecommendationsFetchStatus:(t,n)=>{a(Ze(t,n))},setIsVendorUpdateAllChecked:(t,n,o)=>{a(Xe(t,n,o))}}})(ba);function et(){const a=le(),e=j(),s=re(),{useFeatureGate:t,useDynamicConfig:n}=ee(),o=Ea(),i=S(r=>J(r)),l=i.userRole.includes("charge_card_user")||i.userRole.includes("charge_card_admin"),g=i.userRole!=null&&ue(i.userRole),T=i.userRole!=null&&me(i.userRole),{isFeatureEnabled:b}=t(V.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:h}=t(V.isExpenseAutomationEnabled),{configValue:f}=n(Ce.enableUncategorizedExpenseCategory),k=f?.uncategorized_expense_category_enabled===!0,{tenantEmailDomain:v,transactionTypeEncoded:m,transactionId:C}=de(),[p,E]=d.useState(!1),A=Ie(m??""),B=ke(C,A),K=S(r=>r.transactionVendorViewState),$=ae(),{isFeatureEnabled:w}=t(V.isTransactionCommentingEnabled),F=o?.currentTenant?.companyId,L=o?.currentTenant?.companyName;let y;B&&(y={id:C,type:H(A)});const c=y!=null?S(r=>P(r,y)):void 0,O=c?.transactionDetailLocalData.vendorUpdates?.id!=null?K.editVendorStateById[c?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",D=c?.fetchState==="Completed"?Ae(c?.transaction):void 0,U=S(r=>D!=null?pe(r.customerIncomeState,r.vendorExpenseState,r.trendState,D,"month"):void 0),x=S(r=>Y(r)),z=S(r=>D!=null?he(r.trendWithTransactionsState,D,"TransactionDetail"):void 0),u=i.company?.companyInfo.firstMonthOfFY??1,N=S(r=>fe(r.accountState,r.accountListState,"accountList")),[xe,te]=d.useState(!1),[_e,ne]=d.useState(!1),[Ve,Be]=d.useState(!1),oe=()=>{te(!1),ne(!1)},Fe=Da();d.useEffect(()=>{if(y!=null&&c!=null&&c.fetchState==="Not-Started")e(Ee(y)),oe();else if(y!=null&&c!=null&&c.fetchState==="Error"){const r=W(s.state?.pathnameStackToGoBack,s.pathname),R={pathnameStackToGoBack:r,message:"pageNotFound",origin:"transaction_detail"};Fe&&(R.message="expenseAutomation",R.origin="transaction_categorization",R.pathnameStackToGoBack=r),a("page-not-found",{replace:!0,state:R})}},[y]),d.useEffect(()=>{Ve||c==null||c.transaction==null||(e(ge({id:c.transaction.id,type:c.transaction.type})),Be(!0)),D==null&&c?.fetchState==="Completed"&&ce(c?.transaction),D!=null&&(!l||g&&T===!1)&&(xe?_e||U==null||(ne(!0),e(Z(D,"TransactionDetail",{timeframe:"month",timePeriod:z?.selectedPeriod?.timePeriod??U}))):(e(Q()),e(X()),ce(c?.transaction),te(!0),e(Se(D))))},[c?.fetchState,c?.transaction,U,l]),d.useEffect(()=>{x.newVendorState?.vendorDetailLocalData?.vendorName!=null?E(!0):E(!1)},[x.newVendorState?.vendorDetailLocalData?.vendorName]),d.useEffect(()=>()=>{e(_("common"))},[]);const Pe=[m,C].filter(r=>r!=null),{transactionId:se,onSaveVendor:we,onSaveSuccess:Le,onCancel:Oe}=za({closeDrawerHandler:r=>{E(!1),a(r?"../":"../..")}}),{isAiCfoOpen:ze,setIsAiCfoOpen:Ne}=Ca(),{isAiCfoAccessEnabled:Re,onAskAiCfoClick:Ge}=xa({isAiCfoOpen:ze,setIsAiCfoOpen:Ne,mobileExploreReferrer:"Transaction Details"});return _a({isDataReady:c?.fetchState==="Completed"}),B?I.jsxs(I.Fragment,{children:[se!=null&&p&&I.jsx(La,{isOpen:p,transactionId:se,onSaveVendor:we,onSaveSuccess:Le,onCancel:Oe}),I.jsx(Na,{hideDeleteAttachment:!0,firstMonthOfFY:u,isDisabled:c?.transaction?.type==="transfer"&&o?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:v,location:s,navigate:a,selectedTransaction:y,entity:D,isCOTEnabled:$,defaultTrendTransactionTimePeriod:U,resetTrendIsFetchedStates:oe,transaction:c?.transaction,uncategorizedAccounts:N,vendorSaveStatus:O,isVendorBulkUpdateOnTransactionEnabled:b,isExpenseAutomationEnabled:h,isUncategorizedExpenseCategoryEnabled:k,isAiCfoAccessEnabled:Re,onAskAiCfoClick:Ge,isTransactionCommentingEnabled:w,companyId:F,companyName:L})]}):I.jsx(je,{to:Ue(Pe.length)})}const Ue=(a=2)=>{let e="../";for(let s=0;s<a;s++)e=`${e}../`;return e},ce=a=>{if(a!=null){const{transactionCategory:e,transactionClass:s}=Ra(a),t=Ga(a);be.trackTransactionDetails(a.account?.accountId,a.account?.accountName,a.id,t,e.length>0?e:void 0,s.length>0?s:void 0,a.type,a.amount,a.memo,a.lines?.length??0,a.attachments?.map(n=>n.fileName))}},Ra=a=>{const e=[],s=[];return a.lines?.forEach(t=>{switch(t.type){case"transaction_with_account_and_class_line":case"transaction_with_product_or_service_line":case"journal_entry_transaction_line":case"linked_transaction_line":{const n=t;n!=null&&n.account!=null&&n.account.accountName?.length>0&&e.push(n.account.accountName),n.class!=null&&n.class.className?.length>0&&s.push(n.class.className);break}}}),{transactionCategory:e,transactionClass:s}},Ga=a=>Je(a)===!0?a.customer?.name??"":He(a)===!0?a.vendor?.name??"":a.memo!=null?a.memo:a.type;export{La as C,et as T,za as a,Na as b,ae as c,Za as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as i}from"./liveblocks-BeS4QmMp.js";import{j as J,u as w,h as U,l as H,g as j,N as C,k as Q,n as Ae,o as b}from"./core-DcM32IW_.js";import{eN as R,iP as T,NO as W,Gq as ue,bq as ie,NP as he,jq as X,JS as Z,NQ as se,NR as Se,bC as x,Gn as me,NS as ke,NT as re,NU as Ie,NV as pe,NW as be,NX as ve,NY as de,HD as Ye,bn as xe}from"./zeni-epic-state-ChnjRetZ.js";import{D as K,d as M,c6 as ee,v as _,r as te,a as fe,p as q,N as Pe,z as Ee}from"./index-BZDuIo7x.js";import"./mui--qrGbwFJ.js";import{a as y}from"./sentry-BlmJH5WH.js";import{w as ae}from"./withTransactionSidePanel-BOlkvwMK.js";import{p as ne,b as ce}from"./routePaths-DLti7tZb.js";import{u as Le}from"./utils-RmRP6xA4.js";import{d as L}from"./decodeURIComponentSafe-mAxyJdJ8.js";import{Z as je}from"./ZeniAccountStatementScreen-Dufb_RXJ.js";import"./recharts-DoWl4vaN.js";import"./analytics-ByrfXPqG.js";import"./plaid-BZ0BFqP0.js";import"./dnd-36WXho_9.js";import"./stripe-DMRn4zHo.js";import"./lottie-Bdncx-qB.js";import"./lexical-CYAYrhLa.js";import"./pdf-6nmWWkz8.js";import"./useAskAiCfoHostNavButtonProps-CHoGbMpp.js";import"./useFetchSuggestedQuestionsWhenReady-DVUj1bst.js";import"./TransactionDetailScreen-B0sPog3q.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="901421c9-6468-4a8b-a546-102e2e5bac2d",a._sentryDebugIdIdentifier="sentry-dbid-901421c9-6468-4a8b-a546-102e2e5bac2d")}catch{}})();const ze=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],N=a=>Le(a),Ce=Q(function(a,e){const t=he(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,N(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:Z(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:X(a)}},function(a,e){return{onBackClick:()=>{const t=te(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=K.getLocalizedStrings(),s=N(e.selectedAccount.tranListType),r=Oe(t,n,c,s,e.bookCloseDate);M.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(se({uiState:{dateRange:r},type:N(e.selectedAccount.tranListType)})),a(ue(s,T(r),!1,s==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(T(r))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=ce(t,e.tenantEmailDomain),c=_(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(se({uiState:{scrollYOffset:t},type:N(e.selectedAccount.tranListType)}))}}})(ee),G=ae(function({...a}){const e=J(),t=w(),n=U(),c=t.pathname.split("/").find(d=>ze.includes(d)),o=c??"uncategorized-expense",{tenantEmailDomain:s}=H(),r=K.getLocalizedStrings(),{accountType:p,title:A,subTitle:h}=Me(o),S="month",k=j(d=>R(d)),D=k.company?.companyInfo.firstMonthOfFY??1,{dataAvailable:g,initialTimeframeTick:v}=Be(o,D,k.bookCloseDate),[P,B]=y.useState(!1),[Y,O]=y.useState(void 0),l=y.useMemo(()=>{const d=T(v);return{tranListType:o,accountType:W(p),title:A,subTitle:h,timeframe:S,period:d}},[o,S,p,g]);y.useEffect(()=>{if(!P&&l!=null){B(!0),M.trackTransactionList(void 0,void 0,void 0,l.title);const d=N(l.tranListType);n(ue(d,l.period,!0,d==="missingReceipts"?r.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}},[P,l,n]);let E=l;return l!=null&&Y!=null&&(E={...l,period:Y}),c==null||E==null?i.jsx(C,{to:"../"}):i.jsx(Ce,{firstMonthOfFY:D,tenantEmailDomain:s,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:g,navigate:e,selectedAccount:E,referrerType:o,bookCloseDate:k.bookCloseDate,onSelectedTimePeriodChange:d=>O(d),...a})}),Me=a=>{let e="",t="",n="";const c=K.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=c.uncategorizedTransactionList.income.title,n=c.uncategorizedTransactionList.income.subTitle;break;case"uncategorized-expense":e="expenses",t=c.uncategorizedTransactionList.expense.title,n=c.uncategorizedTransactionList.expense.subTitle;break;case"miscategorized-expense":e="expenses",t=c.miscategorizedTransactionList.expense.title,n=c.miscategorizedTransactionList.expense.subTitle;break;case"miscategorized-income":e="income",t=c.miscategorizedTransactionList.income.title,n=c.miscategorizedTransactionList.income.subTitle;break;case"missing-receipts":t=c.uncategorizedTransactionList.missingReceipt.title,n=c.uncategorizedTransactionList.missingReceipt.subTitle}return{accountType:e,title:t,subTitle:n}},Be=(a,e,t)=>{const n=ie();let c=ie().startOf("month").subtract(11,"month");return t!=null&&a!=="missing-receipts"?t.add(1,"day").isBefore(c)?{dataAvailable:{startDate:t.add(1,"day"),endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}:(c=t.add(1,"day"),{dataAvailable:{startDate:c,endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}):{dataAvailable:ne(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Oe=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},Fe=Q(function(a,e){const t=ke(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:Z(e.selectedAccount.period),dataAvailableForPeriod:ne(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:X(a)}},function(a,e){return{onBackClick:()=>{const t=te(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Te();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),M.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(re({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(me(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,T(o))),e.onSelectedTimePeriodChange(T(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=ce(t,e.tenantEmailDomain),c=_(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(re({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}})(ee),Ge=ae(function({referrerType:a,...e}){const t=J(),n=w(),c=U(),{tenantEmailDomain:o,accountTypeEncoded:s,accountIdEncoded:r,classIdEncoded:p,timeframe:A,startDate:h,endDate:S,titleEncoded:k}=H(),D=L(s??""),g=L(r??""),v=L(p??""),P=L(k??""),B=j(f=>Se(f.transactionListState,g,D,v)),[Y,O]=y.useState(!1),[l,E]=y.useState(void 0),d=j(f=>R(f)),$=d.company?.companyInfo.firstMonthOfFY??1;let u;const m=Ne(D,g,v,A,h,S,P);if(m){const f={startDate:x(h,"YYYY-MM-DD"),endDate:x(S,"YYYY-MM-DD")},V=_e(B?.dateRange,f);u={accountId:g,accountType:W(D),classId:v,title:P,timeframe:A,period:V}}y.useEffect(()=>{Y||u==null||(O(!0),M.trackTransactionList(u.accountId,void 0,a,u.title),c(me(u.accountId,u.accountType,u.classId,u.period)))},[Y,u,c]);let z=u;u!=null&&l!=null&&(z={...u,period:l});const F=[s,r,p,A,h,S,k].filter(f=>f!=null);return m&&z!=null?i.jsx(Fe,{firstMonthOfFY:$,tenantEmailDomain:o,location:n,navigate:t,selectedAccount:z,referrerType:a,onSelectedTimePeriodChange:f=>E(f),...e}):i.jsx(C,{to:Te(F.length)})}),Te=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ne=(a,e,t,n,c,o,s)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&x(c,"YYYY-MM-DD").isValid()&&x(o,"YYYY-MM-DD").isValid()&&s!=null,_e=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?T(a):T(e),we=Q(function(a,e){const t=be(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&ve(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:Z(e.selectedAccount.period),dataAvailableForPeriod:ne(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:X(a)}},function(a,e){return{onBackClick:()=>{const t=te(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??De();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),M.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(de({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(pe(e.selectedAccount.accountId,e.selectedAccount.accountType,T(o))),e.onSelectedTimePeriodChange(T(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=ce(t,e.tenantEmailDomain),c=_(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(de({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=Ve(e.tenantEmailDomain),n=_(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}})(ee),le=ae(function({referrerType:a,...e}){const t=J(),n=w(),c=U(),{tenantEmailDomain:o,accountTypeEncoded:s,accountIdEncoded:r,timeframe:p,startDate:A,endDate:h,titleEncoded:S,excludeSubAccounts:k}=H(),D=L(s??""),g=L(r??""),v=L(S??""),P=!(k!=null&&k==="exclude_subaccounts"),B=j(I=>Ie(I.transactionListState,g,D)),[Y,O]=y.useState(!1),[l,E]=y.useState(void 0),d=j(I=>R(I)),$=d.company?.featuresActivationInfo.connectedAccountProvider==="unit",u=d.company?.companyInfo.firstMonthOfFY??1;let m;const z=Re(D,g,p,A,h,v);if(z){const I={startDate:x(A,"YYYY-MM-DD"),endDate:x(h,"YYYY-MM-DD")},ye=$e(B?.dateRange,I);m={accountId:g,accountType:W(D),title:v,timeframe:p,period:ye}}let F=m;m!=null&&l!=null&&(F={...m,period:l});const{useFeatureGate:f}=fe(),{isFeatureEnabled:V}=f(q.isTransactionCommentingEnabled),{areTenantIdsInSync:oe}=Pe();y.useEffect(()=>{!Y&&m!=null&&oe&&(O(!0),M.trackTransactionList(m.accountId,void 0,a,m.title),c(pe(m.accountId,m.accountType,m.period,void 0,!1,P)))},[Y,m,c,oe]);const ge=[s,r,p,A,h,S].filter(I=>I!=null);return z&&F!=null?i.jsx(we,{firstMonthOfFY:u,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:$,isTransactionCommentingEnabled:V,selectedAccount:F,referrerType:a,onSelectedTimePeriodChange:I=>E(I),...e}):i.jsx(C,{to:De(ge.length)})}),De=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Re=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&x(n,"YYYY-MM-DD").isValid()&&x(c,"YYYY-MM-DD").isValid()&&o!=null,$e=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?T(a):T(e),Ve=a=>`/${a}/transactions/${Ye}/statements`;function pt(){const a=w().state?.referrer,e=Ee.getSignedInUser(),t=xe(e),{useFeatureGate:n}=fe(),{isFeatureEnabled:c}=n(q.isExpenseAutomationEnabled),o=j(p=>p.expenseAutomationViewState.selectedPeriodByTenantId)[j(p=>R(p)).tenantId],{isFeatureEnabled:s}=n(q.isExpenseAutomationEnabledV2),r=s||c&&t;return i.jsxs(Ae,{children:[i.jsx(b,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:i.jsx(le,{referrerType:a})}),i.jsx(b,{path:"/zeni-clearing-account/statements",element:i.jsx(je,{})}),i.jsx(b,{path:"/*",element:i.jsx(le,{referrerType:a})}),i.jsx(b,{path:"/uncategorized-income/*",element:i.jsx(G,{})}),i.jsx(b,{path:"/uncategorized-expense/*",element:r?i.jsx(C,{to:`../../month_end_close_checks/review/transaction_categorization/${o.month}-${o.year}`}):i.jsx(G,{})}),i.jsx(b,{path:"/miscategorized-income/*",element:i.jsx(G,{})}),i.jsx(b,{path:"/miscategorized-expense/*",element:r?i.jsx(C,{to:`../../month_end_close_checks/review/transaction_categorization/${o.month}-${o.year}`}):i.jsx(G,{})}),i.jsx(b,{path:"/missing-receipts/*",element:r?i.jsx(C,{to:`../../month_end_close_checks/review/missing_receipts/${o.month}-${o.year}`}):i.jsx(G,{})}),i.jsx(b,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:i.jsx(Ge,{referrerType:a})})]})}export{pt as default};
|
|
1
|
+
import{j as i}from"./liveblocks-tcXs1fes.js";import{j as J,u as w,h as U,l as Q,g as j,N as C,k as H,n as Ae,o as b}from"./core-DkPdadc6.js";import{eN as R,iP as T,NO as W,Gq as ue,bq as ie,NP as he,jq as X,JS as Z,NQ as se,NR as Se,bC as x,Gn as me,NS as ke,NT as re,NU as Ie,NV as pe,NW as be,NX as ve,NY as de,HD as Ye,bn as xe}from"./zeni-epic-state-CSoWjbAn.js";import{D as K,d as M,c6 as ee,r as _,m as te,a as fe,p as q,Q as Pe,z as Ee}from"./index-CpD5ML2i.js";import"./mui-DbdGpDJj.js";import{a as y}from"./sentry-DNuKG-9f.js";import{w as ae}from"./withTransactionSidePanel-CzkV98Uv.js";import{p as ne,b as ce}from"./routePaths-D7wc65Bl.js";import{u as Le}from"./utils-BmJyX3cx.js";import{d as L}from"./decodeURIComponentSafe-h3wJzOm1.js";import{Z as je}from"./ZeniAccountStatementScreen-CqjHqKdC.js";import"./recharts-D0a4NFa9.js";import"./analytics-CcGmsyc8.js";import"./plaid-UeHpA8su.js";import"./dnd-D-YvLFfj.js";import"./stripe-DMRn4zHo.js";import"./lottie-CwApzZxI.js";import"./lexical-Sc7rk4Y7.js";import"./pdf-DG2fyOfp.js";import"./useAskAiCfoHostNavButtonProps-BtZXhZ4f.js";import"./useFetchSuggestedQuestionsWhenReady-Bhmav9DR.js";import"./TransactionDetailScreen-BARgRHWT.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="d4a221e9-eea7-46db-8d5c-1252dbafda19",a._sentryDebugIdIdentifier="sentry-dbid-d4a221e9-eea7-46db-8d5c-1252dbafda19")}catch{}})();const ze=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],N=a=>Le(a),Ce=H(function(a,e){const t=he(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,N(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:Z(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:X(a)}},function(a,e){return{onBackClick:()=>{const t=te(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=K.getLocalizedStrings(),s=N(e.selectedAccount.tranListType),r=Oe(t,n,c,s,e.bookCloseDate);M.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(se({uiState:{dateRange:r},type:N(e.selectedAccount.tranListType)})),a(ue(s,T(r),!1,s==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(T(r))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=ce(t,e.tenantEmailDomain),c=_(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(se({uiState:{scrollYOffset:t},type:N(e.selectedAccount.tranListType)}))}}})(ee),G=ae(function({...a}){const e=J(),t=w(),n=U(),c=t.pathname.split("/").find(d=>ze.includes(d)),o=c??"uncategorized-expense",{tenantEmailDomain:s}=Q(),r=K.getLocalizedStrings(),{accountType:p,title:A,subTitle:h}=Me(o),S="month",k=j(d=>R(d)),D=k.company?.companyInfo.firstMonthOfFY??1,{dataAvailable:g,initialTimeframeTick:v}=Be(o,D,k.bookCloseDate),[P,B]=y.useState(!1),[Y,O]=y.useState(void 0),l=y.useMemo(()=>{const d=T(v);return{tranListType:o,accountType:W(p),title:A,subTitle:h,timeframe:S,period:d}},[o,S,p,g]);y.useEffect(()=>{if(!P&&l!=null){B(!0),M.trackTransactionList(void 0,void 0,void 0,l.title);const d=N(l.tranListType);n(ue(d,l.period,!0,d==="missingReceipts"?r.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}},[P,l,n]);let E=l;return l!=null&&Y!=null&&(E={...l,period:Y}),c==null||E==null?i.jsx(C,{to:"../"}):i.jsx(Ce,{firstMonthOfFY:D,tenantEmailDomain:s,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:g,navigate:e,selectedAccount:E,referrerType:o,bookCloseDate:k.bookCloseDate,onSelectedTimePeriodChange:d=>O(d),...a})}),Me=a=>{let e="",t="",n="";const c=K.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=c.uncategorizedTransactionList.income.title,n=c.uncategorizedTransactionList.income.subTitle;break;case"uncategorized-expense":e="expenses",t=c.uncategorizedTransactionList.expense.title,n=c.uncategorizedTransactionList.expense.subTitle;break;case"miscategorized-expense":e="expenses",t=c.miscategorizedTransactionList.expense.title,n=c.miscategorizedTransactionList.expense.subTitle;break;case"miscategorized-income":e="income",t=c.miscategorizedTransactionList.income.title,n=c.miscategorizedTransactionList.income.subTitle;break;case"missing-receipts":t=c.uncategorizedTransactionList.missingReceipt.title,n=c.uncategorizedTransactionList.missingReceipt.subTitle}return{accountType:e,title:t,subTitle:n}},Be=(a,e,t)=>{const n=ie();let c=ie().startOf("month").subtract(11,"month");return t!=null&&a!=="missing-receipts"?t.add(1,"day").isBefore(c)?{dataAvailable:{startDate:t.add(1,"day"),endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}:(c=t.add(1,"day"),{dataAvailable:{startDate:c,endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}):{dataAvailable:ne(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Oe=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},Fe=H(function(a,e){const t=ke(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:Z(e.selectedAccount.period),dataAvailableForPeriod:ne(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:X(a)}},function(a,e){return{onBackClick:()=>{const t=te(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Te();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),M.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(re({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(me(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,T(o))),e.onSelectedTimePeriodChange(T(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=ce(t,e.tenantEmailDomain),c=_(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(re({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}})(ee),Ge=ae(function({referrerType:a,...e}){const t=J(),n=w(),c=U(),{tenantEmailDomain:o,accountTypeEncoded:s,accountIdEncoded:r,classIdEncoded:p,timeframe:A,startDate:h,endDate:S,titleEncoded:k}=Q(),D=L(s??""),g=L(r??""),v=L(p??""),P=L(k??""),B=j(f=>Se(f.transactionListState,g,D,v)),[Y,O]=y.useState(!1),[l,E]=y.useState(void 0),d=j(f=>R(f)),$=d.company?.companyInfo.firstMonthOfFY??1;let u;const m=Ne(D,g,v,A,h,S,P);if(m){const f={startDate:x(h,"YYYY-MM-DD"),endDate:x(S,"YYYY-MM-DD")},V=_e(B?.dateRange,f);u={accountId:g,accountType:W(D),classId:v,title:P,timeframe:A,period:V}}y.useEffect(()=>{Y||u==null||(O(!0),M.trackTransactionList(u.accountId,void 0,a,u.title),c(me(u.accountId,u.accountType,u.classId,u.period)))},[Y,u,c]);let z=u;u!=null&&l!=null&&(z={...u,period:l});const F=[s,r,p,A,h,S,k].filter(f=>f!=null);return m&&z!=null?i.jsx(Fe,{firstMonthOfFY:$,tenantEmailDomain:o,location:n,navigate:t,selectedAccount:z,referrerType:a,onSelectedTimePeriodChange:f=>E(f),...e}):i.jsx(C,{to:Te(F.length)})}),Te=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ne=(a,e,t,n,c,o,s)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&x(c,"YYYY-MM-DD").isValid()&&x(o,"YYYY-MM-DD").isValid()&&s!=null,_e=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?T(a):T(e),we=H(function(a,e){const t=be(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&ve(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:Z(e.selectedAccount.period),dataAvailableForPeriod:ne(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:X(a)}},function(a,e){return{onBackClick:()=>{const t=te(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??De();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),M.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(de({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(pe(e.selectedAccount.accountId,e.selectedAccount.accountType,T(o))),e.onSelectedTimePeriodChange(T(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=ce(t,e.tenantEmailDomain),c=_(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(de({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=Ve(e.tenantEmailDomain),n=_(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}})(ee),le=ae(function({referrerType:a,...e}){const t=J(),n=w(),c=U(),{tenantEmailDomain:o,accountTypeEncoded:s,accountIdEncoded:r,timeframe:p,startDate:A,endDate:h,titleEncoded:S,excludeSubAccounts:k}=Q(),D=L(s??""),g=L(r??""),v=L(S??""),P=!(k!=null&&k==="exclude_subaccounts"),B=j(I=>Ie(I.transactionListState,g,D)),[Y,O]=y.useState(!1),[l,E]=y.useState(void 0),d=j(I=>R(I)),$=d.company?.featuresActivationInfo.connectedAccountProvider==="unit",u=d.company?.companyInfo.firstMonthOfFY??1;let m;const z=Re(D,g,p,A,h,v);if(z){const I={startDate:x(A,"YYYY-MM-DD"),endDate:x(h,"YYYY-MM-DD")},ye=$e(B?.dateRange,I);m={accountId:g,accountType:W(D),title:v,timeframe:p,period:ye}}let F=m;m!=null&&l!=null&&(F={...m,period:l});const{useFeatureGate:f}=fe(),{isFeatureEnabled:V}=f(q.isTransactionCommentingEnabled),{areTenantIdsInSync:oe}=Pe();y.useEffect(()=>{!Y&&m!=null&&oe&&(O(!0),M.trackTransactionList(m.accountId,void 0,a,m.title),c(pe(m.accountId,m.accountType,m.period,void 0,!1,P)))},[Y,m,c,oe]);const ge=[s,r,p,A,h,S].filter(I=>I!=null);return z&&F!=null?i.jsx(we,{firstMonthOfFY:u,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:$,isTransactionCommentingEnabled:V,selectedAccount:F,referrerType:a,onSelectedTimePeriodChange:I=>E(I),...e}):i.jsx(C,{to:De(ge.length)})}),De=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Re=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&x(n,"YYYY-MM-DD").isValid()&&x(c,"YYYY-MM-DD").isValid()&&o!=null,$e=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?T(a):T(e),Ve=a=>`/${a}/transactions/${Ye}/statements`;function pt(){const a=w().state?.referrer,e=Ee.getSignedInUser(),t=xe(e),{useFeatureGate:n}=fe(),{isFeatureEnabled:c}=n(q.isExpenseAutomationEnabled),o=j(p=>p.expenseAutomationViewState.selectedPeriodByTenantId)[j(p=>R(p)).tenantId],{isFeatureEnabled:s}=n(q.isExpenseAutomationEnabledV2),r=s||c&&t;return i.jsxs(Ae,{children:[i.jsx(b,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:i.jsx(le,{referrerType:a})}),i.jsx(b,{path:"/zeni-clearing-account/statements",element:i.jsx(je,{})}),i.jsx(b,{path:"/*",element:i.jsx(le,{referrerType:a})}),i.jsx(b,{path:"/uncategorized-income/*",element:i.jsx(G,{})}),i.jsx(b,{path:"/uncategorized-expense/*",element:r?i.jsx(C,{to:`../../month_end_close_checks/review/transaction_categorization/${o.month}-${o.year}`}):i.jsx(G,{})}),i.jsx(b,{path:"/miscategorized-income/*",element:i.jsx(G,{})}),i.jsx(b,{path:"/miscategorized-expense/*",element:r?i.jsx(C,{to:`../../month_end_close_checks/review/transaction_categorization/${o.month}-${o.year}`}):i.jsx(G,{})}),i.jsx(b,{path:"/missing-receipts/*",element:r?i.jsx(C,{to:`../../month_end_close_checks/review/missing_receipts/${o.month}-${o.year}`}):i.jsx(G,{})}),i.jsx(b,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:i.jsx(Ge,{referrerType:a})})]})}export{pt as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e}from"./liveblocks-
|
|
1
|
+
import{j as e}from"./liveblocks-tcXs1fes.js";import{j as B,u as M,h as U,l as O,g as f,N as L,k as N,n as Ie,o as k}from"./core-DkPdadc6.js";import{ck as V,eN as D,MA as R,D6 as ae,fb as Q,CQ as ne,MC as Te,D9 as we,My as ke,Mz as se,MQ as be,Bg as je,s5 as Ae,ME as Ee,Dk as ve,MB as re,cN as W,wb as oe,eR as De,eT as Fe,NL as Le,NM as Be,CR as Me,NN as Ue,CS as Re,C$ as Pe,bv as Oe,bD as Ne,cv as Ve,bE as ze,cj as _e,fa as $e,bs as Ge,Ik as He,ci as Qe}from"./zeni-epic-state-CSoWjbAn.js";import{j as z,am as We,z as A,x as _,d as b,b$ as Ze,c0 as qe,c1 as H,q as Z,h as Ke,Q as Je,M as Xe,a as ie,p as v,E as Ye,B as et,c2 as tt,ap as q,r as at,c3 as nt,m as K,c4 as st,I as X,c5 as rt,a5 as ot}from"./index-CpD5ML2i.js";import{D as it,n as P,S as ct}from"./mui-DbdGpDJj.js";import lt from"./NotFoundScreen-DpPEAqIa.js";import{S as Y}from"./SetupPagesScreen-BaBZaUCN.js";import{a as d}from"./sentry-DNuKG-9f.js";import{u as ut}from"./useAskAiCfoHostNavButtonProps-BtZXhZ4f.js";import{c as dt}from"./useFetchSuggestedQuestionsWhenReady-Bhmav9DR.js";import{M as ce}from"./MobileAppDrawer-n8t03yaO.js";import{F as pt}from"./FeaturePreviewScreen-BbZ1xf4z.js";import{a as ee}from"./analyticsHelper-DJMvFBQ1.js";import"./recharts-D0a4NFa9.js";import"./analytics-CcGmsyc8.js";import"./plaid-UeHpA8su.js";import"./dnd-D-YvLFfj.js";import"./stripe-DMRn4zHo.js";import"./lottie-CwApzZxI.js";import"./lexical-Sc7rk4Y7.js";import"./pdf-DG2fyOfp.js";import"./utils-BmJyX3cx.js";import"./routePaths-D7wc65Bl.js";import"./BusinessVerificationPageScreen-DgymQkoP.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="58aea884-5497-4722-a3b5-bd73ec5688d2",t._sentryDebugIdIdentifier="sentry-dbid-58aea884-5497-4722-a3b5-bd73ec5688d2")}catch{}})();const mt=N(function(t,a){const{companyId:n}=a;return{treasurySetupView:R(t,n),analytics:b}},function(t,a){const{navigate:n,analytics:o,treasurySetupView:p}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const r=p.fundAllocationLocalData;o.trackTreasuryPortfolioConfirm(r.riskScore,ee(r)),t(we(!0))},onUpdateFundAllocation:r=>{o.trackTreasuryAllocationAction("update",ee(r)),t(Te(r))}}})(Ze);function ft(){const t=B(),a=M(),n=U(),{tenantEmailDomain:o}=O(),p=z(),r=f(w=>w.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState),m=We(r),s=V(p?.loggedInUserRoleMap),[c,i]=d.useState(!1),[y,T]=d.useState(!1),[u,l]=d.useState(!1),g=f(w=>D(w)),h=A.getSignedInUserTenant(o)?.companyId??g.companyId,C=A.getSignedInUser(),S=f(w=>R(w,h)),I=f(w=>w.treasurySetupViewState.fetchState),x=f(w=>w.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),F=f(w=>w.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState);if(C==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(d.useEffect(()=>{c||I!=="Not-Started"||h==null||(i(!0),n(ae(h,!0,!1)))},[c,I,h,n]),d.useEffect(()=>{u||F!=="Not-Started"||h==null||(l(!0),n(Q()))},[u,F,h,n]),d.useEffect(()=>{y||x!=="Not-Started"||h==null||(T(!0),n(ne()))},[y,x,h,n]),d.useEffect(()=>{m==="In-Progress"&&r==="Completed"&&t("../")},[m,r,t]),g.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(L,{to:"../promo"});const E=g.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||I!=="Completed";return e.jsxs(e.Fragment,{children:[!E&&e.jsx(_,{analytics:b,onLoad:()=>{}}),e.jsx(mt,{navigate:t,location:a,companyId:h,isEditMode:!0,isLoading:E,isReadOnly:!s,treasurySetupView:S,analytics:b})]})}const yt=N(function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:be(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:R(t,n)}},function(t,a){const{navigate:n,transferDetails:o,treasurySetupView:p}=a,r=o.treasuryTransferMoneyLocalData,m=p.fundAllocationLocalData;return{onCancelClick:()=>{H(a.analytics,"cancel",r,m,"Transfer"),t(se()),n("../")},onTransferClick:()=>{H(a.analytics,"confirm",r,m,"Transfer"),t(ve())},onSaveChangesToLocalStore:s=>{t(Ee(s))},onFetchLinkTokenClick:s=>{t(Ae("treasury_setup",s))},onEstablishConnectionClick:s=>{t(je(s,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}})(qe),gt=({isFirstTransfer:t})=>{const a=B(),{tenantEmailDomain:n}=O(),o=U(),[p,r]=d.useState(!1),[m,s]=d.useState(!1),[c,i]=d.useState(!1),[y,T]=d.useState(!1),u=f(x=>x.treasurySetupViewState.fetchState),l=f(x=>x.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),g=f(x=>x.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),h=f(x=>D(x)),C=A.getSignedInUserTenant(n)?.companyId??h.companyId,S=f(x=>ke(x)),I=f(x=>R(x,C));if(A.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return d.useEffect(()=>{m||u!=="Not-Started"||C==null||(s(!0),o(ae(C,!0,!1)))},[m,u,C,o]),d.useEffect(()=>{c||l!=="Not-Started"||C==null||(i(!0),o(Q()))},[c,l,C,o]),d.useEffect(()=>{y||g!=="Not-Started"||C==null||(T(!0),o(ne()))},[y,g,C,o]),e.jsxs(e.Fragment,{children:[e.jsx(_,{analytics:b,onLoad:()=>{}}),e.jsx(yt,{analytics:b,navigate:a,transferDetails:S,onAnotherTransferClick:()=>{r(!1),o(se())},currentTenant:h,treasurySetupView:I,showReviewContent:p,maxInsuredAmount:5e5,onReviewClick:()=>{H(b,"review",S.treasuryTransferMoneyLocalData,I.fundAllocationLocalData,"Transfer"),r(!0)},isFirstTransfer:t,setShowReviewContent:r,onBackClick:()=>{}})]})},ht=P.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,7 +6,7 @@ import{j as e}from"./liveblocks-BeS4QmMp.js";import{j as B,u as M,h as U,l as O,
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${t=>t.theme.colors.grey4};
|
|
9
|
-
`,St={overlayWidth:new Ye(100,100,48)},xt=N(function(t,a){const n=re(t),{companyId:o}=a;return{treasuryDetail:n,treasurySetupView:R(t,o),downloadEndPoint:`${
|
|
9
|
+
`,St={overlayWidth:new Ye(100,100,48)},xt=N(function(t,a){const n=re(t),{companyId:o}=a;return{treasuryDetail:n,treasurySetupView:R(t,o),downloadEndPoint:`${q.bankingMicroServiceBaseUrl}/1.0/treasury-account/statements?query={"statement_type":"tax_statement"}`}},function(t,a){const{navigate:n,currentTenant:o,location:p,handleDrawerToggle:r,analytics:m}=a,{tenantEmailDomain:s}=o;return{onSettingsClick:()=>{m.trackAccountsListPageClicked("Settings Icon"),n("setup")},onReloadTransactions:()=>{t(oe(!0))},handleTreasuryOptionSelection:c=>{let i="page-not-found";c==="editPortfolio"?i=Ct(s):c==="statements"?i=It(s):c==="taxLetter"?i=Tt(s):c==="settings"&&(i=wt(s));const y=at(p.state?.pathnameStackToGoBack,p.pathname);n(i,{state:{pathnameStackToGoBack:y}})},onColumnSortConfigChanged:(c,i)=>{t(Le({uiState:{sortKey:c,sortOrder:i}}))},onTransferClick:()=>{n("./transfer")},onBackClick:()=>{n("../../")},onClickMenuIcon:()=>{r(!0)},onAutoTransferClick:()=>{n("../../checking/auto-transfer")}}})(tt);function G({isTransferDrawerOpen:t,isEditPortfolioDrawerOpen:a}){const n=M(),o=B(),p=U(),r=Z(),m=Ke(),s=f(j=>D(j)),{tenantEmailDomain:c}=O(),i=s.companyId??A.getSignedInUserTenant(c)?.companyId,[y,T]=d.useState(!1),u=f(j=>re(j)),l=u.fetchState,g=u.accountSummary?.totalBalance?.amount,h=f(j=>j.treasurySetupViewState.treasuryFundsDetails?.fetchStatus),C=s.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",S=z(),I=!!s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,x=V(S?.loggedInUserRoleMap),F=W(S?.loggedInUserRoleMap),{areTenantIdsInSync:E}=Je();d.useEffect(()=>{l==="Not-Started"&&!y&&E&&(T(!0),p(oe(!0)))},[y,p,l,E]),d.useEffect(()=>{u.transactionsFetchState.fetchState==="Completed"&&u.transactions.length===0&&!n.pathname.includes("transfer")&&x&&o("./transfer")},[u.transactionsFetchState.fetchState,u.transactions.length]);const w=()=>{o("..")},[le,ue]=d.useState(!1),J=j=>{ue(j)},{isAiCfoOpen:de,setIsAiCfoOpen:pe}=Xe(),{isAiCfoAccessEnabled:me,onAskAiCfoClick:fe}=ut({isAiCfoOpen:de,setIsAiCfoOpen:pe,mobileExploreReferrer:"Treasury"});dt({isDataReady:l==="Completed"});const{useFeatureGate:$}=ie(),{isFeatureEnabled:ye}=$(v.isDebitCardFeatureEnabled),{isFeatureEnabled:ge}=$(v.isAutoTransferRuleEnabled),{isFeatureEnabled:he}=$(v.isTreasuryCommentingEnabled),Se=De(s),xe=Fe(ye,s);if(Se===!0&&xe!==!0)return e.jsx(pt,{});if(C){const j=h?.fetchState!=="Completed"||u.accountSummaryFetchState.fetchState!=="Completed";return e.jsxs(e.Fragment,{children:[u.accountSummaryFetchState.fetchState==="Completed"&&h?.fetchState==="Completed"&&t===!1&&a===!1?e.jsx(_,{analytics:b,onLoad:()=>{}}):null,e.jsx(it,{onClose:w,anchor:"right",open:a||t,transitionDuration:250,PaperProps:{style:{width:St.overlayWidth.valuePercentage(r),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:m.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsxs(kt,{onClick:Ce=>Ce.stopPropagation(),children:[t===!0?e.jsx(gt,{isFirstTransfer:u.transactions.length===0||g===0}):null,a===!0?e.jsx(ft,{}):null]})}),e.jsxs(ht,{windowSize:r,children:[e.jsx(ce,{isAppContentDrawerOpen:le,handleDrawerToggle:J}),e.jsx(xt,{treasuryDetailsView:u,isAutoTransferRuleEnabled:ge,navigate:o,currentTenant:s,location:n,companyId:i,analytics:b,isTreasuryCommentingEnabled:he,handleDrawerToggle:J,isLoading:j,isAiCfoAccessEnabled:me,onAskAiCfoClick:fe})]})]})}return I&&x?e.jsx(L,{to:"../setup"}):s.companyTreasuryInfo?.info&&!I&&F?e.jsx(L,{to:"../promo",state:n.state}):e.jsx(et,{fetchState:"In-Progress",style:{backgroundColor:m.colors.grey5}})}const Ct=t=>`/${t}/treasury/edit-portfolio`,It=t=>`/${t}/treasury/statements`,Tt=t=>`/${t}/treasury/tax-letter`,wt=t=>`/${t}/treasury/setup`,kt=P(ct)`
|
|
10
10
|
display: flex;
|
|
11
11
|
min-height: 100%;
|
|
12
12
|
flex-direction: column;
|
|
@@ -18,7 +18,7 @@ import{j as e}from"./liveblocks-BeS4QmMp.js";import{j as B,u as M,h as U,l as O,
|
|
|
18
18
|
flex-direction: column;
|
|
19
19
|
align-items: center;
|
|
20
20
|
background-color: ${t=>t.theme.colors.grey4};
|
|
21
|
-
`;function jt(){const t=B(),a=U(),n=
|
|
21
|
+
`;function jt(){const t=B(),a=U(),n=Z(),o=M(),p=`${q.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=d.useState(!1),s=f(l=>Be(l));d.useEffect(()=>{r||s.fetchState!=="Not-Started"||(m(!0),a(Me(!1)))},[r,s.fetchState,a]);const c=A.getSignedInUser(),i=f(l=>D(l)),y={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:i.tenantId??""},T=i.company?.companyInfo.companyLegalName??i.companyName;if(c==null)throw Error("Can't access statements page without signing in...");const u=s.fetchState!=="Completed";return e.jsx(bt,{windowSize:n,children:e.jsx(nt,{currentTenantCompanyName:T,statementListView:s,isLoading:u,onBackClick:()=>{const l=K(o.state?.pathnameStackToGoBack),g=l.poppedPathname??"..";t(g,{state:{pathnameStackToGoBack:l.newStack}})},authParams:y,downloadEndPoint:p})})}const At=P.div`
|
|
22
22
|
display: flex;
|
|
23
23
|
height: 100vh;
|
|
24
24
|
width: 100%;
|
|
@@ -26,7 +26,7 @@ import{j as e}from"./liveblocks-BeS4QmMp.js";import{j as B,u as M,h as U,l as O,
|
|
|
26
26
|
flex-direction: column;
|
|
27
27
|
align-items: center;
|
|
28
28
|
background-color: ${t=>t.theme.colors.grey4};
|
|
29
|
-
`;function Et(){const t=B(),a=
|
|
29
|
+
`;function Et(){const t=B(),a=Z(),n=M(),o=U(),p=`${q.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=d.useState(!1),s=f(l=>Ue(l));d.useEffect(()=>{r||s.fetchState!=="Not-Started"||(m(!0),o(Re(!1)))},[r,s.fetchState,o]);const c=A.getSignedInUser(),i=f(l=>D(l)),y={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:i.tenantId??""},T=i.company?.companyInfo.companyLegalName??i.companyName;if(c==null)throw Error("Can't access tax letter page without signing in...");const u=s.fetchState!=="Completed";return e.jsx(At,{windowSize:a,children:e.jsx(st,{currentTenantCompanyName:T,taxLetterListView:s,isLoading:u,onBackClick:()=>{const l=K(n.state?.pathnameStackToGoBack),g=l.poppedPathname??"..";t(g,{state:{pathnameStackToGoBack:l.newStack}})},authParams:y,downloadEndPoint:p})})}const vt=N(function(t,a){const{companyId:n}=a,o=R(t,n);return{treasurySetupView:o,isSetupComplete:o.companyTreasuryInfo?.businessVerificationStatus?.code==="verified",videoUrl:"https://www.youtube.com/watch?v=sqvJWKCMZgk",meetingUrl:"https://meetings.hubspot.com/yoshi-araki/treasury-product-schedule-demo-link?embed=true"}},function(t,a){const{navigate:n,companyId:o}=a;return{onSetupButtonClick:()=>{t(Pe(o))},onBackClick:()=>{n("../..",{relative:"path"})},onTreasurySetupSuccess:p=>{n(p?"..":"../setup",{relative:"path"})}}})(rt),Dt=()=>{const t=B(),a=M(),n=U(),{tenantEmailDomain:o}=O(),[p,r]=d.useState(!1),m=f(S=>D(S)),[s,c]=d.useState(!1),i=f(S=>S.treasurySetupViewState.treasuryFundsDetails?.fetchStatus);d.useEffect(()=>{s||i?.fetchState!=="Not-Started"||y==null||(c(!0),n(Q()))},[i,n]);const y=A.getSignedInUserTenant(o)?.companyId??m.companyId,T=A.getSignedInUser(),u=!!m.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,l=S=>{r(S)};if(T==null)throw Error("Can't access treasury promo page without signing in...");const g=z(),h=V(g?.loggedInUserRoleMap),C=W(g?.loggedInUserRoleMap);if(u&&h)return e.jsx(L,{to:"../../treasury/setup"});if(m.company?.companyTreasuryInfo&&(!u&&h||C)){if(a.state?.message==="activation"){const S=K(a.state?.pathnameStackToGoBack);t(a.pathname,{state:{...a.state,message:void 0,pathnameStackToGoBack:S.newStack}})}return i?.fetchState!=="Completed"?e.jsx(te,{children:e.jsx(X,{size:"ExtraLarge",start:!0})}):e.jsxs(e.Fragment,{children:[e.jsx(_,{analytics:b,onLoad:S=>(I=>I.trackTreasuryPromoView("Treasury Promo Page"))(S)}),e.jsx(ce,{isAppContentDrawerOpen:p,handleDrawerToggle:l}),e.jsx(vt,{analytics:b,navigate:t,companyId:y,onClickMenuIcon:()=>{l(!0)}})]})}return e.jsx(te,{children:e.jsx(X,{size:"ExtraLarge",start:!0})})},te=P.div`
|
|
30
30
|
display: flex;
|
|
31
31
|
width: 100%;
|
|
32
32
|
height: 100%;
|
|
@@ -34,4 +34,4 @@ import{j as e}from"./liveblocks-BeS4QmMp.js";import{j as B,u as M,h as U,l as O,
|
|
|
34
34
|
justify-content: center;
|
|
35
35
|
align-items: center;
|
|
36
36
|
background-color: ${t=>t.theme.colors.grey5};
|
|
37
|
-
`;function ta(){const t=M(),a=f(E=>D(E)),{useFeatureGate:n}=ie(),{isFeatureEnabled:o}=n(v.isTreasuryEnabled),p=!!a.company?.companyTreasuryInfo?.isTreasuryTOSAccepted,r=z(),m=
|
|
37
|
+
`;function ta(){const t=M(),a=f(E=>D(E)),{useFeatureGate:n}=ie(),{isFeatureEnabled:o}=n(v.isTreasuryEnabled),p=!!a.company?.companyTreasuryInfo?.isTreasuryTOSAccepted,r=z(),m=W(r?.loggedInUserRoleMap),s=a?.userRole!=null&&Oe(a?.userRole),c=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!s)&&Ne(r?.loggedInUserRoleMap),i=Ve(r?.loggedInUserRoleMap),y=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!s)&&ze(r?.loggedInUserRoleMap),{isFeatureEnabled:T}=n(v.isDepositAccountsFeatureEnabled),u=T&&!s&&_e(r?.loggedInUserRoleMap),l=a.company!=null&&$e(a.company),g=o&&l===!0&&!s&&V(r?.loggedInUserRoleMap),{isFeatureEnabled:h}=n(v.isChargeCardFeatureEnabled),{isFeatureEnabled:C}=n(v.isDebitCardFeatureEnabled),S=ot(a,h,C)&&!s&&Ge(r?.loggedInUserRoleMap),I=He(r?.loggedInUserRoleMap),x=Qe(r?.loggedInUserRoleMap),F=a.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified";return e.jsxs(Ie,{children:[x?null:e.jsx(k,{path:"setup",element:e.jsx(Y,{isBillPayAdminLevelAccess:c,isReimbursementAdminLevelAccess:y,isZeniAccountAdminLevelAccess:u,isChargeCardAdminLevelAccess:S,isTreasuryAdminLevelAccess:g,isUserHasOnlyCardAccess:I,isUserHasOnlyBillPayAccess:i,productType:"zeni_treasury",type:"setup"})}),x?null:e.jsx(k,{path:"verification",element:e.jsx(Y,{isBillPayAdminLevelAccess:c,isUserHasOnlyBillPayAccess:i,isReimbursementAdminLevelAccess:y,isZeniAccountAdminLevelAccess:u,isChargeCardAdminLevelAccess:S,isTreasuryAdminLevelAccess:g,isUserHasOnlyCardAccess:I,productType:"zeni_treasury",type:"verification"})}),e.jsx(k,{path:"promo",element:e.jsx(Dt,{})}),e.jsx(k,{path:"statements",element:e.jsx(jt,{})}),e.jsx(k,{path:"tax-letter",element:e.jsx(Et,{})}),F?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"/",element:e.jsx(G,{isTransferDrawerOpen:!1,isEditPortfolioDrawerOpen:!1})}),g?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"edit-portfolio",element:e.jsx(G,{isEditPortfolioDrawerOpen:!0,isTransferDrawerOpen:!1})}),e.jsx(k,{path:"transfer",element:e.jsx(G,{isTransferDrawerOpen:!0,isEditPortfolioDrawerOpen:!1})})]}):null,e.jsx(k,{path:"*",element:e.jsx(lt,{})})]}):p&&g?e.jsx(k,{path:"*",element:e.jsx(L,{to:"../setup"})}):a.company?.companyZeniAccountInfo&&m?e.jsx(k,{path:"*",element:e.jsx(L,{to:"../promo",state:t.state})}):e.jsx(k,{path:"*",element:null})]})}export{ta as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as l}from"./liveblocks-
|
|
1
|
+
import{j as l}from"./liveblocks-tcXs1fes.js";import{a as g}from"./sentry-DNuKG-9f.js";import{j as M,u as q,l as J,g as S,k as G,h as Y,n as nt,o as B,N as K}from"./core-DkPdadc6.js";import{eN as O,Jg as Ee,Jh as Ue,fO as ee,cq as be,cr as ke,uM as ft,Ji as st,uQ as Yt,Hu as te,jq as ae,uK as qt,uE as Ht,Jj as Ne,uw as Wt,uv as Qt,up as Zt,uB as Xt,uR as ea,Jk as pe,Jl as Me,ux as ta,Jm as he,eY as gt,v4 as vt,uZ as xt,Jn as Tt,nT as Ct,uU as yt,uS as Dt,Jo as It,vb as Et,v8 as bt,uV as kt,va as Ge,FW as wt,Jp as aa,Jq as na,ct as sa,Jr as oa,Js as la,Jt as me,Ju as ce,Jv as we,Hv as $e,vq as ye,Ht as De,vd as At,uN as Ke,Jw as ia,Hw as W,Jx as ze,uH as ca,Jy as da,Jz as ra,JA as Ye,JB as qe,JC as He,JD as We,vk as Ae,JE as jt,v1 as Ft,JF as ua,JG as pa,JH as ha,JI as ma,JJ as Sa,JK as fa,JL as ga,JM as va,sh as xa,si as Ta,GA as Fe,JN as Ca,JO as ya,iP as Pe,bq as Da,JP as Ia,JQ as Ea,ko as ba,kx as ka,Gz as _e,bC as ot,JR as Pt,Gf as _t,JS as wa,JT as Aa,JU as ja,kz as Fa,JV as lt,JW as it,JX as ct,JY as dt,JZ as Pa,kv as _a,J_ as Va,ky as La,J$ as Oa,K0 as Vt,GW as Lt,jO as Ba,K1 as Ja,K2 as Ve,K3 as Ot,GU as Bt,xD as Ra,K4 as Ua,K5 as Na,k6 as Jt,K6 as Ma,K7 as Ga,H6 as $a,pZ as Ka,K8 as Rt,K9 as rt,H3 as Le,Ka as ut,Kb as za,H8 as Ya,Kc as qa,Kd as Ha,Ke as Wa,Kf as Qa,Kg as Za,q0 as Xa,Kh as en,Hx as tn,Ki as an,GN as Oe,gx as nn,Kj as sn,Kk as on,gv as ln,Kl as cn,Km as dn,xH as rn,Kn as un,Ko as pn,Kp as hn,Kq as mn,jS as Sn,bn as fn,eT as gn,eR as vn}from"./zeni-epic-state-CSoWjbAn.js";import{z as R,am as Be,B as Ut,x as Z,d as P,U as X,as as xn,r as N,D as Ie,$ as de,at as Qe,au as Tn,av as Cn,m as Ze,aw as yn,h as Dn,q as re,E as Xe,a as ne,p as z,ax as In,i as et,M as Se,ay as En,az as Nt,Q as bn,aA as kn,j as wn,aB as An,ap as Mt,aC as jn,o as Q,A as Fn,G as Gt,J as Pn,aD as _n,aE as Vn,f as tt,aF as Ln,aG as On,k as Bn,aH as Jn,aI as Rn}from"./index-CpD5ML2i.js";import{n as U,D as Un,S as $t}from"./mui-DbdGpDJj.js";import{t as Nn,A as Mn}from"./AddressScreen-BklJKutc.js";import ie from"./NotFoundScreen-DpPEAqIa.js";import{F as Gn}from"./FeaturePreviewScreen-BbZ1xf4z.js";import{b as H,v as at,c as $n}from"./routePaths-D7wc65Bl.js";import{p as Kt}from"./pathToGoBack-D9y2NyzP.js";import{u as fe}from"./useAskAiCfoHostNavButtonProps-BtZXhZ4f.js";import{c as ge}from"./useFetchSuggestedQuestionsWhenReady-Bhmav9DR.js";import{M as ve}from"./MobileAppDrawer-n8t03yaO.js";import{D as Kn}from"./DrawerScreen-GbmWLeG7.js";import{g as zn,m as Yn}from"./accountMappingHelper-BOSY12FJ.js";import"./recharts-D0a4NFa9.js";import"./analytics-CcGmsyc8.js";import"./plaid-UeHpA8su.js";import"./dnd-D-YvLFfj.js";import"./stripe-DMRn4zHo.js";import"./lottie-CwApzZxI.js";import"./lexical-Sc7rk4Y7.js";import"./pdf-DG2fyOfp.js";import"./utils-BmJyX3cx.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]="070c0944-1d98-4c4c-9b60-9c7857d4f617",e._sentryDebugIdIdentifier="sentry-dbid-070c0944-1d98-4c4c-9b60-9c7857d4f617")}catch{}})();const qn=Ie.getLocalizedStrings(),Hn=G(function(e,a){const s=Ue(e,a.scheduleTab),t=e.tenantState.currentTenantId;return{authParams:{userId:a.signedInUser.userId??"",sessionId:a.signedInUser.zeniSessionId??"",tenantId:t??""},linkBillExpenseView:s.linkBillExpenseView,transactions:s.linkBillExpenseView.transactions}},function(e,a){const{navigate:s,location:t}=a;return{onTransactionSelect(n){e(st({selectedTransaction:n}))},onBackClick:()=>{s("..",{relative:"path"})},onCancel(){e(st({selectedTransaction:void 0})),e(Yt()),s("..",{relative:"path"})},onTransactionClick:n=>{const o=`${H(n,a.tenantEmailDomain)}`,c=N(t.state?.pathnameStackToGoBack,t.pathname);s(o,{state:{pathnameStackToGoBack:c}})},onLinkSave(){a.setShouldNavigateBack(!1),e(ft(a.scheduleTab,a.scheduleAccruedDetailsView.selectedJEAccruedSchedule?.jeScheduleId))}}})(xn),Wn=({setShouldNavigateBack:e})=>{const a=M(),s=q(),{scheduleDetailId:t,tenantEmailDomain:n}=J(),{scheduleType:o}=J();if(n==null)throw Error("Can't access Link Bill Expense page without tenant Email Domain");const c=S(f=>O(f)),d=Ee(o)??"accrued_expenses",u=R.getSignedInUser();if(u==null)throw Error("Can't access Link Bill Expensedetail page without signing in...");if(t==null)throw Error("Invalid Schedule Detail Id");const i=S(f=>Ue(f,d)),m=i.selectedJELinkRowIndex,r=S(f=>ee(f,c.companyId)),p=Be(i.updateStatus.fetchState);g.useEffect(()=>{p==="In-Progress"&&i.updateStatus.fetchState==="Completed"&&a("..",{relative:"path"})},[p,i.updateStatus.fetchState]),g.useEffect(()=>{i.fetchState==="Not-Started"&&a("..",{relative:"path"})},[]),g.useEffect(()=>{i.selectedJEAccruedSchedule!=null&&i.selectedJELinkRowIndex!=null||a("..",{relative:"path"})},[i.selectedJEAccruedSchedule,i.selectedJELinkRowIndex]);const h=i.linkBillExpenseView.fetchState==="Completed";return l.jsx(l.Fragment,{children:i.linkBillExpenseView.fetchState==="In-Progress"?l.jsx(Ut,{fetchState:i.linkBillExpenseView.fetchState}):i.selectedJEAccruedSchedule!=null&&m!=null?l.jsxs(l.Fragment,{children:[h===!0?l.jsx(Z,{analytics:P,onLoad:()=>{Qn(i,d,r)}}):null,l.jsx(Hn,{signedInUser:u,attachmentEndPoint:`${X}/vendor_attachments`,setShouldNavigateBack:e,scheduleVendorId:i.selectedJEAccruedSchedule.vendor.id??"",location:s,tenantEmailDomain:n,scheduleAccruedDetailsView:i,saveFetchState:i.updateStatus.fetchState,scheduleTab:d,navigate:a,analytics:P,controllerUserDetails:r,saveStatus:i.updateStatus.fetchState,jeAccruedSchedule:i.selectedJEAccruedSchedule,localData:i.scheduleAccruedDetailsLocalData.jeScheduleDetails[m]})]}):null})},zt=e=>{const a=qn.dateFormat.analytics.YYYYDashMMDashDDFormat;return{scheduleCreateDate:e.createTime.format(a)??null,scheduleMonthlyAmount:e.recurringAmount??null,startingBalance:e.otherAttributes.startingBalance??null,scheduleAccountCategory:e.jeCredit.account?.accountName??null,description:e.memo,runningBalance:e.balanceAsOfToday??null,currentBalance:e.balanceAsOfToday??null,currentStatus:e.status.label,period:e.period??null,startMonth:e.startDate?.format(a)??null,endMonth:e.endDate?.format(a)??null}},Qn=(e,a,s)=>{const t=e.selectedJEAccruedSchedule,n=e.selectedJELinkRowIndex;let o;n!=null&&t!=null&&(o=t.scheduledJournalEntry[n]);const{transactions:c}=e.linkBillExpenseView,d=c.some(m=>m.isRecommendedTransaction===!0),u=be(s.controllers),i=ke(s.controllerUserIds);t!=null&&P.trackScheduleAccruedDetailsJournalEntryLinkedLoaded({scheduleType:a,schedule:{...zt(t)},scheduleExpenseCategoryAndClass:{expenseCategory:t.jeDebit.account?.accountName??null,expenseClass:t.jeDebit.accountingClass?.className??null},journalEntryDetails:{wasRecommendationAvailable:d,journalEntryPostingStatus:o?.status.label??""},vendorName:t.vendor.name??null,controllerEmails:u,controllerUserIds:i})},Zn=U.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|