@zeniai/web-app-ui 5.0.57-qa → 5.0.58-next
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-gzjBzuUq.js +1 -0
- package/dist/assets/AddressScreen-e0Pj7PP8.js +9 -0
- package/dist/assets/{AiCfoScreen-Cln5kFvq.js → AiCfoScreen-CREn42qd.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-BkiWlWG1.js → BillPayApprovalRoutes-dPyoK6Ak.js} +1 -1
- package/dist/assets/BillPayRoutes-Dr-0zZSu.js +119 -0
- package/dist/assets/{BusinessVerificationPageScreen-CETF7Xs2.js → BusinessVerificationPageScreen-Cd40kgea.js} +2 -2
- package/dist/assets/ChargeCardRoutes-yp4vXuBR.js +71 -0
- package/dist/assets/{CompanyPassportScreen-CEn8Hq_N.js → CompanyPassportScreen-v-A14_4c.js} +1 -1
- package/dist/assets/{ConnectionAuthScreen-DIDoz4Y4.js → ConnectionAuthScreen-CzUMtiLT.js} +1 -1
- package/dist/assets/CustomerOnboardingAuthScreen-BIdIyLkQ.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-C6aBtTbj.js → CustomerOnboardingRoutes-DAl1N1ul.js} +4 -4
- package/dist/assets/DashboardRoutes-CfMUg2zu.js +20 -0
- package/dist/assets/{DefaultTenantHome-DrSW3qnP.js → DefaultTenantHome-C856UYmo.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-DqS4Tcvr.js → DomesticWireDetailScreen-Dmty-wcu.js} +3 -3
- package/dist/assets/{DrawerScreen-CZjhB4M8.js → DrawerScreen-D_EfYa49.js} +1 -1
- package/dist/assets/{EntityDetailRoutes-uteOKaRW.js → EntityDetailRoutes-B_yOLFwg.js} +1 -1
- package/dist/assets/ExpenseAutomationRoutes-CD9fJQ1B.js +25 -0
- package/dist/assets/FeaturePreviewScreen-BLkw206M.js +1 -0
- package/dist/assets/{MagicLinkRoutes-CrxYhL_N.js → MagicLinkRoutes-DZdaDfp8.js} +2 -2
- package/dist/assets/MagicLinkSignInScreen-CXrLUJ69.js +12 -0
- package/dist/assets/{MobileAppDrawer-CsFu1SGJ.js → MobileAppDrawer-B4YhcBfV.js} +1 -1
- package/dist/assets/NotFoundScreen-BRSAD1CL.js +1 -0
- package/dist/assets/NotificationRoutes-BVFVKZIw.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-DDylyD65.js +1 -0
- package/dist/assets/PeopleRoutes-C9Ddmzuf.js +22 -0
- package/dist/assets/PerformanceRoutes-DyWlaYl6.js +1 -0
- package/dist/assets/{Preview-DPJ5uAOV.js → Preview-CCYe3OR4.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-ZbQqcTvr.js → QBOConnectionScreen-CXf7xZy7.js} +1 -1
- package/dist/assets/ReferralListScreen-DtxdROqg.js +5 -0
- package/dist/assets/ReimbursementApprovalRoutes-CepOXFom.js +1 -0
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-B4Iu7nC0.js → ReimbursementApprovalRuleDetailScreen-CXFTxe1t.js} +1 -1
- package/dist/assets/ReimbursementRoutes-BE22p95d.js +68 -0
- package/dist/assets/{ReportsRoutes-D-5WE4O3.js → ReportsRoutes-Dtvr-pPW.js} +1 -1
- package/dist/assets/RewardsRoutes-Bbnjgt-H.js +1 -0
- package/dist/assets/{ScreenRoutes-DAtAgM93.js → ScreenRoutes-JvctnGiS.js} +2 -2
- package/dist/assets/{SettingsRoutes-DiqY7ZzG.js → SettingsRoutes-e8aSak7Z.js} +6 -6
- package/dist/assets/{SetupPagesScreen-5gu402_s.js → SetupPagesScreen-DVBuL6-C.js} +5 -5
- package/dist/assets/{SignInScreen-Bv_CmdB4.js → SignInScreen-1JB_pjvd.js} +1 -1
- package/dist/assets/SignOutScreen-C4_OJSj1.js +9 -0
- package/dist/assets/TaskListScreen-Bv6jghVg.js +9 -0
- package/dist/assets/{TaskRoutes-XLr0JwdP.js → TaskRoutes-4j6qOv2b.js} +1 -1
- package/dist/assets/TransactionDetailRoutes-CB1i4hYU.js +1 -0
- package/dist/assets/TransactionDetailScreen-DW88Zsus.js +5 -0
- package/dist/assets/{TransactionListRoutes-CPz2tIys.js → TransactionListRoutes-CA_m8fcq.js} +1 -1
- package/dist/assets/TreasuryRoutes-YDcbDBXC.js +37 -0
- package/dist/assets/VendorsRoutes-BbLFNuvT.js +112 -0
- package/dist/assets/WiseConfirmationScreen-CSKHP9kL.js +12 -0
- package/dist/assets/ZeniAccountRoutes-X8SJrpX6.js +66 -0
- package/dist/assets/ZeniAccountStatementScreen-CAtmURw3.js +9 -0
- package/dist/assets/{accountMappingHelper-DXLz-vZu.js → accountMappingHelper-DvC_WWi8.js} +1 -1
- package/dist/assets/{analytics-C7fHeQaW.js → analytics-D1ODE1Ix.js} +1 -1
- package/dist/assets/{analyticsHelper-BI0zNJMo.js → analyticsHelper-DL8E6jB6.js} +1 -1
- package/dist/assets/{core-BojUR2ky.js → core-kd_mEvMc.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-Cj7RmfYA.js → decodeURIComponentSafe-CWCanM9M.js} +1 -1
- package/dist/assets/{dnd-CxlDz5d0.js → dnd-64rfSyZU.js} +1 -1
- package/dist/assets/{empty-U91QAR9K.js → empty-CPs1X-RI.js} +1 -1
- package/dist/assets/{empty-BfK9KfwA.js → empty-Cgt5sWdf.js} +1 -1
- package/dist/assets/{emptyVideoElement-CycntGaA.js → emptyVideoElement-fT8-FQ3f.js} +1 -1
- package/dist/assets/{epic-C89Urkp1.js → epic-CRJXeZGy.js} +1 -1
- package/dist/assets/getLocaleForTenant-CbdZJNMO.js +1 -0
- package/dist/assets/{index-DlIWyK0U.js → index-BA18ZHSY.js} +1 -1
- package/dist/assets/{index-Bl7KFfTZ.js → index-BDSGrZ82.js} +1 -1
- package/dist/assets/{index-BFSmByg_.js → index-CAQ6-ND6.js} +1 -1
- package/dist/assets/{index-LcueFkuq.js → index-CYDtjmC2.js} +1 -1
- package/dist/assets/{index-C30E8A69.js → index-Ci1GaydZ.js} +2 -2
- package/dist/assets/{index-CJekYpNM.js → index-DCaXcWXE.js} +1 -1
- package/dist/assets/{index-Dw0sYJvv.js → index-DzAxH0sX.js} +2503 -2475
- package/dist/assets/{lexical-BsuE2Lsd.js → lexical--COyOM8W.js} +1 -1
- package/dist/assets/{liveblocks-BJogRArg.js → liveblocks-BFnsX8B0.js} +1 -1
- package/dist/assets/{lottie-Cn4ueTxI.js → lottie-cF0OZPLg.js} +1 -1
- package/dist/assets/{mui-Bg09VkiQ.js → mui-HcBIKYw3.js} +1 -1
- package/dist/assets/{pathToGoBack-DkMRBkCy.js → pathToGoBack-D0tENoX2.js} +1 -1
- package/dist/assets/{pdf-unrI9041.js → pdf-C7R1L7h-.js} +3 -3
- package/dist/assets/{pdf-lib-CayRdH4_.js → pdf-lib-DDepbdus.js} +1 -1
- package/dist/assets/{plaid-DLEkn0-3.js → plaid-B2FXOAMc.js} +1 -1
- package/dist/assets/{pusher-0TzEhQ4N.js → pusher-D-h2s4xN.js} +1 -1
- package/dist/assets/{react-DqIU-sTG.js → react-B3xIIldn.js} +1 -1
- package/dist/assets/{react-DE-H5XLs.js → react-BSrBE3nc.js} +1 -1
- package/dist/assets/{react-OJ3jwYUc.js → react-Cf8SABl6.js} +1 -1
- package/dist/assets/{react-PyBVK2LU.js → react-Djk0KEGU.js} +1 -1
- package/dist/assets/{react-DrHghgwg.js → react-koHDI_aa.js} +1 -1
- package/dist/assets/{react-DroQkqxO.js → react-okDy65Yp.js} +1 -1
- package/dist/assets/{recharts-CYOGURoz.js → recharts-Td_75k_G.js} +1 -1
- package/dist/assets/{routePaths-DriCJPaW.js → routePaths-DTjzb3UO.js} +1 -1
- package/dist/assets/{sentry-WdXgkw90.js → sentry-BReBlZug.js} +1 -1
- package/dist/assets/{url-DF46HIMu.js → url-DIvgpV5A.js} +1 -1
- package/dist/assets/{url-BxFmO3XK.js → url-DwnSoc9u.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-vEeThjOY.js +1 -0
- package/dist/assets/{useDeviceId-CYsEMtI-.js → useDeviceId-D301EHf1.js} +1 -1
- package/dist/assets/useFetchSuggestedQuestionsWhenReady-CqXHVPRH.js +1 -0
- package/dist/assets/{useInitialThreadRequest-DBmAMV6A.js → useInitialThreadRequest-yd2wjPhE.js} +1 -1
- package/dist/assets/{utils-CJNmQJBz.js → utils-B46LtKXi.js} +1 -1
- package/dist/assets/withTransactionSidePanel-BtsXx_bA.js +21 -0
- package/dist/assets/{zeni-epic-state-BJsXImBw.js → zeni-epic-state-B5rZ-c32.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +3 -3
- package/dist/assets/AddressRoutes-Bag7m6qW.js +0 -1
- package/dist/assets/AddressScreen-Ca2p0J93.js +0 -9
- package/dist/assets/BillPayRoutes-BUnKFudo.js +0 -119
- package/dist/assets/ChargeCardRoutes-DyrY3AOh.js +0 -71
- package/dist/assets/CustomerOnboardingAuthScreen-sEtdhf6t.js +0 -1
- package/dist/assets/DashboardRoutes-ibMx9tJv.js +0 -20
- package/dist/assets/ExpenseAutomationRoutes-vN-ZEfGB.js +0 -25
- package/dist/assets/FeaturePreviewScreen-Bb7LAhIT.js +0 -1
- package/dist/assets/MagicLinkSignInScreen-DMujXaBO.js +0 -12
- package/dist/assets/NotFoundScreen-DYeXrX7_.js +0 -1
- package/dist/assets/NotificationRoutes-KbJh7WKb.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-DXlZi8qW.js +0 -1
- package/dist/assets/PeopleRoutes-Dfo2HPQ8.js +0 -22
- package/dist/assets/PerformanceRoutes-CtfzaZEr.js +0 -1
- package/dist/assets/ReferralListScreen-CJVut1-a.js +0 -5
- package/dist/assets/ReimbursementApprovalRoutes-DbWpAe_W.js +0 -1
- package/dist/assets/ReimbursementRoutes-DE6qZeFt.js +0 -68
- package/dist/assets/RewardsRoutes-Bse1jH88.js +0 -1
- package/dist/assets/SignOutScreen-Bg5nBSS2.js +0 -9
- package/dist/assets/TaskListScreen-CeAHUBwa.js +0 -9
- package/dist/assets/TransactionDetailRoutes-W70apOcQ.js +0 -1
- package/dist/assets/TransactionDetailScreen-DwslT8ci.js +0 -5
- package/dist/assets/TreasuryRoutes-CLsQ2k2B.js +0 -37
- package/dist/assets/VendorsRoutes-DBHqiibW.js +0 -112
- package/dist/assets/WiseConfirmationScreen-CUSz1saI.js +0 -12
- package/dist/assets/ZeniAccountRoutes-D7qmRpeW.js +0 -66
- package/dist/assets/ZeniAccountStatementScreen-YO51ZD4a.js +0 -9
- package/dist/assets/getLocaleForTenant-DXctzPv_.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-C3l35BIu.js +0 -1
- package/dist/assets/useFetchSuggestedQuestionsWhenReady-BonCp6Rh.js +0 -1
- package/dist/assets/withTransactionSidePanel-DUWL7sXt.js +0 -21
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as i}from"./liveblocks-BJogRArg.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-BojUR2ky.js";import{eN as R,iP as T,NO as K,Gq as ue,bq as ie,NP as he,jq as W,JS as X,NQ as se,NR as Se,bC as Y,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 xe,bn as Ye}from"./zeni-epic-state-BJsXImBw.js";import{D as Z,d as M,c6 as ee,x as _,v as te,a as fe,p as q,K as Pe,z as Ee}from"./index-Dw0sYJvv.js";import"./mui-Bg09VkiQ.js";import{a as y}from"./sentry-WdXgkw90.js";import{w as ae}from"./withTransactionSidePanel-DUWL7sXt.js";import{p as ne,b as ce}from"./routePaths-DriCJPaW.js";import{u as Le}from"./utils-CJNmQJBz.js";import{d as L}from"./decodeURIComponentSafe-Cj7RmfYA.js";import{Z as je}from"./ZeniAccountStatementScreen-YO51ZD4a.js";import"./recharts-CYOGURoz.js";import"./analytics-C7fHeQaW.js";import"./plaid-DLEkn0-3.js";import"./dnd-CxlDz5d0.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cn4ueTxI.js";import"./lexical-BsuE2Lsd.js";import"./pdf-unrI9041.js";import"./useAskAiCfoHostNavButtonProps-C3l35BIu.js";import"./useFetchSuggestedQuestionsWhenReady-BonCp6Rh.js";import"./TransactionDetailScreen-DwslT8ci.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]="4450e89d-cc1d-43a8-aa21-0ba6337359a2",a._sentryDebugIdIdentifier="sentry-dbid-4450e89d-cc1d-43a8-aa21-0ba6337359a2")}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:X(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:W(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=Z.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=Z.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),[x,O]=y.useState(void 0),l=y.useMemo(()=>{const d=T(v);return{tranListType:o,accountType:K(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&&x!=null&&(E={...l,period:x}),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=Z.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:X(e.selectedAccount.period),dataAvailableForPeriod:ne(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:W(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)),[x,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:Y(h,"YYYY-MM-DD"),endDate:Y(S,"YYYY-MM-DD")},V=_e(B?.dateRange,f);u={accountId:g,accountType:K(D),classId:v,title:P,timeframe:A,period:V}}y.useEffect(()=>{x||u==null||(O(!0),M.trackTransactionList(u.accountId,void 0,a,u.title),c(me(u.accountId,u.accountType,u.classId,u.period)))},[x,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")&&Y(c,"YYYY-MM-DD").isValid()&&Y(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:X(e.selectedAccount.period),dataAvailableForPeriod:ne(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:W(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)),[x,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:Y(A,"YYYY-MM-DD"),endDate:Y(h,"YYYY-MM-DD")},ye=$e(B?.dateRange,I);m={accountId:g,accountType:K(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(()=>{!x&&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)))},[x,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")&&Y(n,"YYYY-MM-DD").isValid()&&Y(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/${xe}/statements`;function pt(){const a=w().state?.referrer,e=Ee.getSignedInUser(),t=Ye(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-BFnsX8B0.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-kd_mEvMc.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-B5rZ-c32.js";import{D as K,d as M,c6 as ee,s as _,r as te,a as fe,p as q,M as Pe,z as Ee}from"./index-DzAxH0sX.js";import"./mui-HcBIKYw3.js";import{a as y}from"./sentry-BReBlZug.js";import{w as ae}from"./withTransactionSidePanel-BtsXx_bA.js";import{p as ne,b as ce}from"./routePaths-DTjzb3UO.js";import{u as Le}from"./utils-B46LtKXi.js";import{d as L}from"./decodeURIComponentSafe-CWCanM9M.js";import{Z as je}from"./ZeniAccountStatementScreen-CAtmURw3.js";import"./recharts-Td_75k_G.js";import"./analytics-D1ODE1Ix.js";import"./plaid-B2FXOAMc.js";import"./dnd-64rfSyZU.js";import"./stripe-DMRn4zHo.js";import"./lottie-cF0OZPLg.js";import"./lexical--COyOM8W.js";import"./pdf-C7R1L7h-.js";import"./useAskAiCfoHostNavButtonProps-vEeThjOY.js";import"./useFetchSuggestedQuestionsWhenReady-CqXHVPRH.js";import"./TransactionDetailScreen-DW88Zsus.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]="9e17c48f-2c1b-4f2d-ada2-e0c446025a36",a._sentryDebugIdIdentifier="sentry-dbid-9e17c48f-2c1b-4f2d-ada2-e0c446025a36")}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};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import{j as e}from"./liveblocks-BFnsX8B0.js";import{j as B,u as M,h as U,l as N,g as f,N as L,k as V,n as xe,o as k}from"./core-kd_mEvMc.js";import{ck as O,eN as D,MA as R,D6 as ae,fb as W,CQ as ne,MC as we,D9 as Te,My as Ce,Mz as se,MQ as Ie,Bg as ke,s5 as je,ME as be,Dk as Ae,MB as re,cN as Z,wb as oe,eR as Ee,eT as ve,NL as De,NM as Fe,CR as Le,NN as Be,CS as Me,C$ as Ue,bv as Re,bD as Pe,cv as Ne,bE as Ve,cj as Oe,fa as ze,bs as _e,Ik as $e,ci as Ge}from"./zeni-epic-state-B5rZ-c32.js";import{j as z,am as He,z as A,y as _,d as j,b$ as We,c0 as Ze,c1 as H,q,h as qe,M as Ke,a as ie,p as v,C as Je,w as Qe,c2 as Xe,ap as K,s as Ye,c3 as et,r as J,c4 as tt,I as X,c5 as at,a5 as nt}from"./index-DzAxH0sX.js";import{D as st,n as P,S as rt}from"./mui-HcBIKYw3.js";import ot from"./NotFoundScreen-BRSAD1CL.js";import{S as Y}from"./SetupPagesScreen-DVBuL6-C.js";import{a as d}from"./sentry-BReBlZug.js";import{u as it}from"./useAskAiCfoHostNavButtonProps-vEeThjOY.js";import{c as ct}from"./useFetchSuggestedQuestionsWhenReady-CqXHVPRH.js";import{M as ce}from"./MobileAppDrawer-B4YhcBfV.js";import{F as lt}from"./FeaturePreviewScreen-BLkw206M.js";import{a as ee}from"./analyticsHelper-DL8E6jB6.js";import"./recharts-Td_75k_G.js";import"./analytics-D1ODE1Ix.js";import"./plaid-B2FXOAMc.js";import"./dnd-64rfSyZU.js";import"./stripe-DMRn4zHo.js";import"./lottie-cF0OZPLg.js";import"./lexical--COyOM8W.js";import"./pdf-C7R1L7h-.js";import"./utils-B46LtKXi.js";import"./routePaths-DTjzb3UO.js";import"./BusinessVerificationPageScreen-Cd40kgea.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]="c3f14a5f-636f-4ec2-95d5-7329dd2f07ca",t._sentryDebugIdIdentifier="sentry-dbid-c3f14a5f-636f-4ec2-95d5-7329dd2f07ca")}catch{}})();const ut=V(function(t,a){const{companyId:n}=a;return{treasurySetupView:R(t,n),analytics:j}},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(Te(!0))},onUpdateFundAllocation:r=>{o.trackTreasuryAllocationAction("update",ee(r)),t(we(r))}}})(We);function dt(){const t=B(),a=M(),n=U(),{tenantEmailDomain:o}=N(),p=z(),r=f(I=>I.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState),m=He(r),s=O(p?.loggedInUserRoleMap),[c,i]=d.useState(!1),[y,C]=d.useState(!1),[u,l]=d.useState(!1),g=f(I=>D(I)),h=A.getSignedInUserTenant(o)?.companyId??g.companyId,w=A.getSignedInUser(),S=f(I=>R(I,h)),T=f(I=>I.treasurySetupViewState.fetchState),x=f(I=>I.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),F=f(I=>I.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState);if(w==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(d.useEffect(()=>{c||T!=="Not-Started"||h==null||(i(!0),n(ae(h,!0,!1)))},[c,T,h,n]),d.useEffect(()=>{u||F!=="Not-Started"||h==null||(l(!0),n(W()))},[u,F,h,n]),d.useEffect(()=>{y||x!=="Not-Started"||h==null||(C(!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||T!=="Completed";return e.jsxs(e.Fragment,{children:[!E&&e.jsx(_,{analytics:j,onLoad:()=>{}}),e.jsx(ut,{navigate:t,location:a,companyId:h,isEditMode:!0,isLoading:E,isReadOnly:!s,treasurySetupView:S,analytics:j})]})}const pt=V(function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:Ie(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(Ae())},onSaveChangesToLocalStore:s=>{t(be(s))},onFetchLinkTokenClick:s=>{t(je("treasury_setup",s))},onEstablishConnectionClick:s=>{t(ke(s,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}})(Ze),mt=({isFirstTransfer:t})=>{const a=B(),{tenantEmailDomain:n}=N(),o=U(),[p,r]=d.useState(!1),[m,s]=d.useState(!1),[c,i]=d.useState(!1),[y,C]=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)),w=A.getSignedInUserTenant(n)?.companyId??h.companyId,S=f(x=>Ce(x)),T=f(x=>R(x,w));if(A.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return d.useEffect(()=>{m||u!=="Not-Started"||w==null||(s(!0),o(ae(w,!0,!1)))},[m,u,w,o]),d.useEffect(()=>{c||l!=="Not-Started"||w==null||(i(!0),o(W()))},[c,l,w,o]),d.useEffect(()=>{y||g!=="Not-Started"||w==null||(C(!0),o(ne()))},[y,g,w,o]),e.jsxs(e.Fragment,{children:[e.jsx(_,{analytics:j,onLoad:()=>{}}),e.jsx(pt,{analytics:j,navigate:a,transferDetails:S,onAnotherTransferClick:()=>{r(!1),o(se())},currentTenant:h,treasurySetupView:T,showReviewContent:p,maxInsuredAmount:5e5,onReviewClick:()=>{H(j,"review",S.treasuryTransferMoneyLocalData,T.fundAllocationLocalData,"Transfer"),r(!0)},isFirstTransfer:t,setShowReviewContent:r,onBackClick:()=>{}})]})},ft=P.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${t=>t.theme.colors.grey4};
|
|
9
|
+
`,yt={overlayWidth:new Je(100,100,48)},gt=V(function(t,a){const n=re(t),{companyId:o}=a;return{treasuryDetail:n,treasurySetupView:R(t,o),downloadEndPoint:`${K.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=ht(s):c==="statements"?i=St(s):c==="taxLetter"?i=xt(s):c==="settings"&&(i=wt(s));const y=Ye(p.state?.pathnameStackToGoBack,p.pathname);n(i,{state:{pathnameStackToGoBack:y}})},onColumnSortConfigChanged:(c,i)=>{t(De({uiState:{sortKey:c,sortOrder:i}}))},onTransferClick:()=>{n("./transfer")},onBackClick:()=>{n("../../")},onClickMenuIcon:()=>{r(!0)},onAutoTransferClick:()=>{n("../../checking/auto-transfer")}}})(Xe);function G({isTransferDrawerOpen:t,isEditPortfolioDrawerOpen:a}){const n=M(),o=B(),p=U(),r=q(),m=qe(),s=f(b=>D(b)),{tenantEmailDomain:c}=N(),i=s.companyId??A.getSignedInUserTenant(c)?.companyId,[y,C]=d.useState(!1),u=f(b=>re(b)),l=u.fetchState,g=u.accountSummary?.totalBalance?.amount,h=f(b=>b.treasurySetupViewState.treasuryFundsDetails?.fetchStatus),w=s.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",S=z(),T=!!s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,x=O(S?.loggedInUserRoleMap),F=Z(S?.loggedInUserRoleMap),{areTenantIdsInSync:E}=Ke();d.useEffect(()=>{l==="Not-Started"&&!y&&E&&(C(!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 I=()=>{o("..")},[le,ue]=d.useState(!1),Q=b=>{ue(b)},{isAiCfoAccessEnabled:de,onAskAiCfoClick:pe}=it({mobileExploreReferrer:"Treasury"});ct({isDataReady:l==="Completed"});const{useFeatureGate:$}=ie(),{isFeatureEnabled:me}=$(v.isDebitCardFeatureEnabled),{isFeatureEnabled:fe}=$(v.isAutoTransferRuleEnabled),{isFeatureEnabled:ye}=$(v.isTreasuryCommentingEnabled),ge=Ee(s),he=ve(me,s);if(ge===!0&&he!==!0)return e.jsx(lt,{});if(w){const b=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:j,onLoad:()=>{}}):null,e.jsx(st,{onClose:I,anchor:"right",open:a||t,transitionDuration:250,PaperProps:{style:{width:yt.overlayWidth.valuePercentage(r),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:m.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsxs(Tt,{onClick:Se=>Se.stopPropagation(),children:[t===!0?e.jsx(mt,{isFirstTransfer:u.transactions.length===0||g===0}):null,a===!0?e.jsx(dt,{}):null]})}),e.jsxs(ft,{windowSize:r,children:[e.jsx(ce,{isAppContentDrawerOpen:le,handleDrawerToggle:Q}),e.jsx(gt,{treasuryDetailsView:u,isAutoTransferRuleEnabled:fe,navigate:o,currentTenant:s,location:n,companyId:i,analytics:j,isTreasuryCommentingEnabled:ye,handleDrawerToggle:Q,isLoading:b,isAiCfoAccessEnabled:de,onAskAiCfoClick:pe})]})]})}return T&&x?e.jsx(L,{to:"../setup"}):s.companyTreasuryInfo?.info&&!T&&F?e.jsx(L,{to:"../promo",state:n.state}):e.jsx(Qe,{fetchState:"In-Progress",style:{backgroundColor:m.colors.grey5}})}const ht=t=>`/${t}/treasury/edit-portfolio`,St=t=>`/${t}/treasury/statements`,xt=t=>`/${t}/treasury/tax-letter`,wt=t=>`/${t}/treasury/setup`,Tt=P(rt)`
|
|
10
|
+
display: flex;
|
|
11
|
+
min-height: 100%;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
`,Ct=P.div`
|
|
14
|
+
display: flex;
|
|
15
|
+
height: 100vh;
|
|
16
|
+
width: 100%;
|
|
17
|
+
flex: 1 1 auto;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
align-items: center;
|
|
20
|
+
background-color: ${t=>t.theme.colors.grey4};
|
|
21
|
+
`;function It(){const t=B(),a=U(),n=q(),o=M(),p=`${K.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=d.useState(!1),s=f(l=>Fe(l));d.useEffect(()=>{r||s.fetchState!=="Not-Started"||(m(!0),a(Le(!1)))},[r,s.fetchState,a]);const c=A.getSignedInUser(),i=f(l=>D(l)),y={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:i.tenantId??""},C=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(Ct,{windowSize:n,children:e.jsx(et,{currentTenantCompanyName:C,statementListView:s,isLoading:u,onBackClick:()=>{const l=J(o.state?.pathnameStackToGoBack),g=l.poppedPathname??"..";t(g,{state:{pathnameStackToGoBack:l.newStack}})},authParams:y,downloadEndPoint:p})})}const kt=P.div`
|
|
22
|
+
display: flex;
|
|
23
|
+
height: 100vh;
|
|
24
|
+
width: 100%;
|
|
25
|
+
flex: 1 1 auto;
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
align-items: center;
|
|
28
|
+
background-color: ${t=>t.theme.colors.grey4};
|
|
29
|
+
`;function jt(){const t=B(),a=q(),n=M(),o=U(),p=`${K.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=d.useState(!1),s=f(l=>Be(l));d.useEffect(()=>{r||s.fetchState!=="Not-Started"||(m(!0),o(Me(!1)))},[r,s.fetchState,o]);const c=A.getSignedInUser(),i=f(l=>D(l)),y={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:i.tenantId??""},C=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(kt,{windowSize:a,children:e.jsx(tt,{currentTenantCompanyName:C,taxLetterListView:s,isLoading:u,onBackClick:()=>{const l=J(n.state?.pathnameStackToGoBack),g=l.poppedPathname??"..";t(g,{state:{pathnameStackToGoBack:l.newStack}})},authParams:y,downloadEndPoint:p})})}const bt=V(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(Ue(o))},onBackClick:()=>{n("../..",{relative:"path"})},onTreasurySetupSuccess:p=>{n(p?"..":"../setup",{relative:"path"})}}})(at),At=()=>{const t=B(),a=M(),n=U(),{tenantEmailDomain:o}=N(),[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(W()))},[i,n]);const y=A.getSignedInUserTenant(o)?.companyId??m.companyId,C=A.getSignedInUser(),u=!!m.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,l=S=>{r(S)};if(C==null)throw Error("Can't access treasury promo page without signing in...");const g=z(),h=O(g?.loggedInUserRoleMap),w=Z(g?.loggedInUserRoleMap);if(u&&h)return e.jsx(L,{to:"../../treasury/setup"});if(m.company?.companyTreasuryInfo&&(!u&&h||w)){if(a.state?.message==="activation"){const S=J(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:j,onLoad:S=>(T=>T.trackTreasuryPromoView("Treasury Promo Page"))(S)}),e.jsx(ce,{isAppContentDrawerOpen:p,handleDrawerToggle:l}),e.jsx(bt,{analytics:j,navigate:t,companyId:y,onClickMenuIcon:()=>{l(!0)}})]})}return e.jsx(te,{children:e.jsx(X,{size:"ExtraLarge",start:!0})})},te=P.div`
|
|
30
|
+
display: flex;
|
|
31
|
+
width: 100%;
|
|
32
|
+
height: 100%;
|
|
33
|
+
flex-direction: row;
|
|
34
|
+
justify-content: center;
|
|
35
|
+
align-items: center;
|
|
36
|
+
background-color: ${t=>t.theme.colors.grey5};
|
|
37
|
+
`;function Xt(){const t=M(),a=f(E=>D(E)),{useFeatureGate:n}=ie(),{isFeatureEnabled:o}=n(v.isTreasuryEnabled),p=!!a.company?.companyTreasuryInfo?.isTreasuryTOSAccepted,r=z(),m=Z(r?.loggedInUserRoleMap),s=a?.userRole!=null&&Re(a?.userRole),c=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!s)&&Pe(r?.loggedInUserRoleMap),i=Ne(r?.loggedInUserRoleMap),y=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!s)&&Ve(r?.loggedInUserRoleMap),{isFeatureEnabled:C}=n(v.isDepositAccountsFeatureEnabled),u=C&&!s&&Oe(r?.loggedInUserRoleMap),l=a.company!=null&&ze(a.company),g=o&&l===!0&&!s&&O(r?.loggedInUserRoleMap),{isFeatureEnabled:h}=n(v.isChargeCardFeatureEnabled),{isFeatureEnabled:w}=n(v.isDebitCardFeatureEnabled),S=nt(a,h,w)&&!s&&_e(r?.loggedInUserRoleMap),T=$e(r?.loggedInUserRoleMap),x=Ge(r?.loggedInUserRoleMap),F=a.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified";return e.jsxs(xe,{children:[x?null:e.jsx(k,{path:"setup",element:e.jsx(Y,{isBillPayAdminLevelAccess:c,isReimbursementAdminLevelAccess:y,isZeniAccountAdminLevelAccess:u,isChargeCardAdminLevelAccess:S,isTreasuryAdminLevelAccess:g,isUserHasOnlyCardAccess:T,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:T,productType:"zeni_treasury",type:"verification"})}),e.jsx(k,{path:"promo",element:e.jsx(At,{})}),e.jsx(k,{path:"statements",element:e.jsx(It,{})}),e.jsx(k,{path:"tax-letter",element:e.jsx(jt,{})}),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(ot,{})})]}):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{Xt as default};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import{j as l}from"./liveblocks-BFnsX8B0.js";import{a as g}from"./sentry-BReBlZug.js";import{j as M,u as Y,l as O,g as S,k as G,h as z,n as at,o as B,N as $}from"./core-kd_mEvMc.js";import{eN as L,Jg as Ee,Jh as Re,fO as X,cq as be,cr as Ie,uM as St,Ji as nt,uQ as zt,Hu as ee,jq as te,uK as Yt,uE as qt,Jj as Ue,uw as Ht,uv as Wt,up as Qt,uB as Zt,uR as Xt,Jk as he,Jl as Ne,ux as ea,Jm as pe,eY as ft,v4 as gt,uZ as vt,Jn as xt,nT as Tt,uU as yt,uS as Dt,Jo as Ct,vb as Et,v8 as bt,uV as It,va as Me,FW as kt,Jp as ta,Jq as aa,ct as na,Jr as sa,Js as oa,Jt as me,Ju as ie,Jv as ke,Hv as Ge,vq as ye,Ht as De,vd as wt,uN as $e,Jw as la,Hw as H,Jx as Ke,uH as ia,Jy as ca,Jz as da,JA as ze,JB as Ye,JC as qe,JD as He,vk as we,JE as At,v1 as jt,JF as ra,JG as ua,JH as ha,JI as pa,JJ as ma,JK as Sa,JL as fa,JM as ga,sh as va,si as xa,GA as je,JN as Ta,JO as ya,iP as Fe,bq as Da,JP as Ca,JQ as Ea,ko as ba,kx as Ia,Gz as Pe,bC as st,JR as Ft,Gf as Pt,JS as ka,JT as wa,JU as Aa,kz as ja,JV as ot,JW as lt,JX as it,JY as ct,JZ as Fa,kv as Pa,J_ as _a,ky as Va,J$ as La,K0 as _t,GW as Vt,jO as Ba,K1 as Ja,K2 as _e,K3 as Lt,GU as Bt,xD as Oa,K4 as Ra,K5 as Ua,k6 as Jt,K6 as Na,K7 as Ma,H6 as Ga,pZ as $a,K8 as Ot,K9 as dt,H3 as Ve,Ka as rt,Kb as Ka,H8 as za,Kc as Ya,Kd as qa,Ke as Ha,Kf as Wa,Kg as Qa,q0 as Za,Kh as Xa,Hx as en,Ki as tn,GN as Le,gx as an,Kj as nn,Kk as sn,gv as on,Kl as ln,Km as cn,xH as dn,Kn as rn,Ko as un,Kp as hn,Kq as pn,jS as mn,bn as Sn,eT as fn,eR as gn}from"./zeni-epic-state-B5rZ-c32.js";import{z as R,am as Be,w as Rt,y as Q,d as j,Q as Z,as as vn,s as N,D as Ce,$ as ce,at as We,au as xn,av as Tn,r as Qe,aw as yn,h as Dn,q as de,C as Ze,a as ae,p as K,ax as Cn,k as Xe,ay as En,az as Ut,M as bn,aA as In,j as kn,aB as wn,ap as Nt,aC as An,o as W,S as jn,F as Mt,G as Fn,aD as Pn,aE as _n,f as et,aF as Vn,aG as Ln,n as Bn,aH as Jn,aI as On}from"./index-DzAxH0sX.js";import{n as U,D as Rn,S as Gt}from"./mui-HcBIKYw3.js";import{t as Un,A as Nn}from"./AddressScreen-e0Pj7PP8.js";import le from"./NotFoundScreen-BRSAD1CL.js";import{F as Mn}from"./FeaturePreviewScreen-BLkw206M.js";import{b as q,v as tt,c as Gn}from"./routePaths-DTjzb3UO.js";import{p as $t}from"./pathToGoBack-D0tENoX2.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-vEeThjOY.js";import{c as fe}from"./useFetchSuggestedQuestionsWhenReady-CqXHVPRH.js";import{M as ge}from"./MobileAppDrawer-B4YhcBfV.js";import{D as $n}from"./DrawerScreen-D_EfYa49.js";import{g as Kn,m as zn}from"./accountMappingHelper-DvC_WWi8.js";import"./recharts-Td_75k_G.js";import"./analytics-D1ODE1Ix.js";import"./plaid-B2FXOAMc.js";import"./dnd-64rfSyZU.js";import"./stripe-DMRn4zHo.js";import"./lottie-cF0OZPLg.js";import"./lexical--COyOM8W.js";import"./pdf-C7R1L7h-.js";import"./utils-B46LtKXi.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]="fd80d504-f9fb-4983-9cbc-437ce6cb8ea2",e._sentryDebugIdIdentifier="sentry-dbid-fd80d504-f9fb-4983-9cbc-437ce6cb8ea2")}catch{}})();const Yn=Ce.getLocalizedStrings(),qn=G(function(e,a){const s=Re(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(nt({selectedTransaction:n}))},onBackClick:()=>{s("..",{relative:"path"})},onCancel(){e(nt({selectedTransaction:void 0})),e(zt()),s("..",{relative:"path"})},onTransactionClick:n=>{const o=`${q(n,a.tenantEmailDomain)}`,c=N(t.state?.pathnameStackToGoBack,t.pathname);s(o,{state:{pathnameStackToGoBack:c}})},onLinkSave(){a.setShouldNavigateBack(!1),e(St(a.scheduleTab,a.scheduleAccruedDetailsView.selectedJEAccruedSchedule?.jeScheduleId))}}})(vn),Hn=({setShouldNavigateBack:e})=>{const a=M(),s=Y(),{scheduleDetailId:t,tenantEmailDomain:n}=O(),{scheduleType:o}=O();if(n==null)throw Error("Can't access Link Bill Expense page without tenant Email Domain");const c=S(f=>L(f)),r=Ee(o)??"accrued_expenses",h=R.getSignedInUser();if(h==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=>Re(f,r)),m=i.selectedJELinkRowIndex,d=S(f=>X(f,c.companyId)),u=Be(i.updateStatus.fetchState);g.useEffect(()=>{u==="In-Progress"&&i.updateStatus.fetchState==="Completed"&&a("..",{relative:"path"})},[u,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 p=i.linkBillExpenseView.fetchState==="Completed";return l.jsx(l.Fragment,{children:i.linkBillExpenseView.fetchState==="In-Progress"?l.jsx(Rt,{fetchState:i.linkBillExpenseView.fetchState}):i.selectedJEAccruedSchedule!=null&&m!=null?l.jsxs(l.Fragment,{children:[p===!0?l.jsx(Q,{analytics:j,onLoad:()=>{Wn(i,r,d)}}):null,l.jsx(qn,{signedInUser:h,attachmentEndPoint:`${Z}/vendor_attachments`,setShouldNavigateBack:e,scheduleVendorId:i.selectedJEAccruedSchedule.vendor.id??"",location:s,tenantEmailDomain:n,scheduleAccruedDetailsView:i,saveFetchState:i.updateStatus.fetchState,scheduleTab:r,navigate:a,analytics:j,controllerUserDetails:d,saveStatus:i.updateStatus.fetchState,jeAccruedSchedule:i.selectedJEAccruedSchedule,localData:i.scheduleAccruedDetailsLocalData.jeScheduleDetails[m]})]}):null})},Kt=e=>{const a=Yn.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}},Wn=(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,r=c.some(m=>m.isRecommendedTransaction===!0),h=be(s.controllers),i=Ie(s.controllerUserIds);t!=null&&j.trackScheduleAccruedDetailsJournalEntryLinkedLoaded({scheduleType:a,schedule:{...Kt(t)},scheduleExpenseCategoryAndClass:{expenseCategory:t.jeDebit.account?.accountName??null,expenseClass:t.jeDebit.accountingClass?.className??null},journalEntryDetails:{wasRecommendationAvailable:r,journalEntryPostingStatus:o?.status.label??""},vendorName:t.vendor.name??null,controllerEmails:h,controllerUserIds:i})},Qn=U.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 0 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
+
`,Zn=G(function(e){const a=L(e),s=e.entityAutoCompleteState.autoCompleteText.common,t=Ue(e,"common");return{tenantName:a.companyName,vendorSearchAutoCompleteData:{autoCompleteText:s,entityAutoCompleteView:t}}},function(e,a){const{navigate:s,location:t}=a,n="accrued_expenses";return{onNavigateBack:()=>{s("../schedules/accrued_expenses")},onZeniLogoClick:()=>{a.themeState.toggle()},onSave:o=>{a.setShouldNavigateBack(!0),e(St(n,o))},onDelete:o=>{e(ea(n,o))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(o,c)=>{o.trim().length>=2?e(Ne({searchString:o,entityType:c,searchOrigin:"common"})):o.trim().length===0&&e(he("common"))},onCancelAutoComplete:()=>{e(he("common"))}},onEditAmount:(o,c)=>{e(Xt(n,o,c))},onJELinkClick:o=>{e(Zt({selectedJELinkRowIndex:o})),s("./edit_link")},onCancelAccrual:(o,c,r)=>{e(Qt(o,c,r))},onTransactionClick:o=>{const c=`${q(o,a.tenantEmailDomain)}`,r=N(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:r}})},onViewPostedJE:o=>{const c=`${q(o,a.tenantEmailDomain)}`,r=N(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:r}})},onViewRecordedJE:o=>{const c=`${q(o,a.tenantEmailDomain)}`,r=N(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:r}})},onViewBillExpense:o=>{const c=`${q(o,a.tenantEmailDomain)}`,r=N(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:r}})},onDetailPageChange:(o,c,r)=>{const{scheduleDetailsAccruedExpensesSection:h}=o,{amount:i,memo:m,months:d,scheduleAccruedExpenseCategory:u,scheduleClass:p,scheduleExpenseCategory:f,startDate:D,vendor:x}=h,b=p.selectedOption!=null?a.classList.find(I=>I.classId===p.selectedOption):void 0,C=f.selectedOption!=null?a.accountList.find(I=>I.qboId===f.selectedOption):void 0,E=u.selectedOption!=null?a.accruedAccountList.find(I=>I.qboId===u.selectedOption):void 0,w=d?.selectedOption;e(Ht({scheduleType:n,localData:c,selectedJeScheduleDetailId:a.scheduleDetailId})),r!==!1||a.scheduleDetailId!=null||C?.accountId==null||a.isAccountingClassesEnabled!==!1&&b?.classId==null||E==null||x.selectedOption==null||m==null||i==null&&i==0||D==null||w==null||e(Wt({scheduleType:n}))}}})(xn),Xn=({shouldNavigateBack:e,setShouldNavigateBack:a})=>{const s=M(),t=Y(),n=z(),o=ce(),{tenantEmailDomain:c}=O(),[r,h]=g.useState(!1);if(c==null)throw new Error("Can't access this page without a tenantEmailDomain");const{scheduleDetailId:i}=O();let m;i!=="new"&&(m=i);const d=es(i),u=S(y=>y.scheduleAccruedDetailState.selectedJEAccruedScheduleKey),p="accrued_expenses",f=S(y=>Re(y,"accrued_expenses")),D=S(y=>ee(y)),x=S(y=>y.classListState.fetchState),b=S(y=>te(y)),C=D!=="Completed"||x!=="Completed";g.useEffect(()=>{r===!1&&C?(n(Yt(p,m)),h(!0)):C===!1&&r===!1&&i!=="new"&&(n(qt(p,i)),h(!0))},[r]);const E=S(y=>L(y)),w=S(y=>X(y,E.companyId)),I=f.fetchState,k=f.allAccountList,_=f.allClassList,F=f.allAccruedAccountList,V=f.scheduleAccruedDetailsLocalData;if(d!==!0||f.fetchState==="Error")return l.jsx(le,{});const A=I==="Completed"&&r===!0;return I!=="Completed"&&I!=="Not-Started"?l.jsx(We,{}):l.jsxs(Qn,{children:[A===!0?l.jsx(Q,{analytics:j,onLoad:()=>{ts(f,p,w)}}):null,l.jsx(Zn,{setShouldNavigateBack:a,scheduleAccruedDetailsView:f,location:t,navigate:s,classList:_,accountList:k,shouldNavigateBack:e,accruedAccountList:F,scheduleLocalData:V,selectedJEScheduleKey:u,scheduleDetailId:m,selectedScheduledJournalEntries:f.selectedJEAccruedSchedule?.scheduledJournalEntry??[],themeState:o,tenantEmailDomain:c,analytics:j,controllerUserDetails:w,isAccountingClassesEnabled:b,status:f.selectedJEAccruedSchedule?.status.code})]})},es=e=>e!=null,ts=(e,a,s)=>{const t=e.selectedJEAccruedSchedule,n=be(s.controllers),o=Ie(s.controllerUserIds);t!=null&&j.trackScheduleAccruedDetailsLoaded({scheduleType:a,scheduleExpenseCategoryAndClass:{expenseCategory:t.jeDebit.account?.accountName??null,expenseClass:t.jeDebit.accountingClass?.className??null},schedule:{...Kt(t)},vendorName:t.vendor.name??null,controllerEmails:n,controllerUserIds:o})},as=U.div`
|
|
10
|
+
display: flex;
|
|
11
|
+
min-height: 100%;
|
|
12
|
+
width: 100%;
|
|
13
|
+
flex: 1 0 auto;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
align-items: center;
|
|
16
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
+
`,Je=Ce.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,ns=G(function(e){const a=L(e),s=pe(e,"fixed_assets");return{tenantName:a.companyName,scheduleDetailsView:s}},function(e,a){const{navigate:s,location:t,vendorSearchAutoCompleteData:n,selectedScheduledJournalEntries:o}=a,c="fixed_assets",r=t.state?.message==="expenseAutomation",h=o.flatMap(i=>i.error).filter(i=>!!i)??[];return{onNavigateBack:()=>{if(r===!0){const i=Qe(a.location.state?.pathnameStackToGoBack),m=i.poppedPathname??$t(2);a.navigate(m,{state:{pathnameStackToGoBack:i.newStack}})}else s("../schedules/fixed_assets")},onZeniLogoClick:()=>{a.themeState.toggle()},onSave:i=>{e(Me(c,i,h.length>0))},onDelete:i=>{e(It(c,i))},onMarkAsComplete:()=>{a.selectedJEScheduleKey!=null&&e(bt(c,a.selectedJEScheduleKey))},onEditAmount:(i,m)=>{e(Et(c,i,m))},onJELinkClick:i=>{e(Ct({selectedJELinkRowIndex:i})),s("./edit_link")},onTransactionClick:i=>{const m=`${q(i,a.tenantEmailDomain)}`,d=N(t.state?.pathnameStackToGoBack,t.pathname);s(m,{state:{pathnameStackToGoBack:d,message:"comingFromScheduleDetailsFixedAssets"}})},onViewLinkedJE:i=>{const m=`${q(i,a.tenantEmailDomain)}`,d=N(t.state?.pathnameStackToGoBack,t.pathname);s(m,{state:{pathnameStackToGoBack:d}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,m)=>{i.trim().length>=2?e(Ne({searchString:i,entityType:m,searchOrigin:"common"})):i.trim().length===0&&e(he("common"))},onCancelAutoComplete:()=>{e(he("common"))}},onDetailPageChange:(i,m)=>{const{scheduleDetailsFixedAssetsSection:d,scheduleDetailsListSection:u}=i,{scheduleClass:p,scheduleExpenseCategory:f,accumulatedDepreciationCategory:D,assetId:x,months:b,startDate:C,postingDate:E,vendor:w}=d,I=n.entityAutoCompleteView.vendor.length>0?n.entityAutoCompleteView.vendor.find(v=>v.id===w?.selectedOption):void 0,k={id:I?.zeniId??w?.selectedOption??"",name:I?.name??w?.defaultOptions.find(v=>v.value===w?.selectedOption)?.label??"",logo:I?.logo},_=p.selectedOption!=null?a.classList.find(v=>v.classId===p.selectedOption):void 0,F=f.selectedOption!=null?a.accountList.find(v=>v.qboId===f.selectedOption):void 0,V=D.selectedOption!=null?a.depAccountList.find(v=>v.qboId===D.selectedOption):void 0,A=b?.selectedOption,y=u.map((v,re)=>({...a.scheduleLocalData.jeScheduleDetails[re],amount:{...a.scheduleLocalData.jeScheduleDetails[re].amount,amount:v.amount}})),P=E.type==="day"?E.dayOfMonth?E.dayOfMonth:1:void 0,T=E.type==="lastDayOfMonth"||void 0;e(yt({scheduleType:c,localData:{selectedAccount:F?.accountId,selectedClass:_?.classId,selectedAccumulatedDepreciationCategory:V?.accountId,selectedDate:C,selectedMonths:A,assetId:x,jeScheduleDetails:y,lastDayOfMonth:T,selectedDayOfMonth:P,selectedVendor:k},selectedJeScheduleDetailId:a.scheduleDetailId})),m!==!1||V?.accountId==null||a.scheduleDetailId!=null&&a.status!=="draft"&&a.status!=="marked_as_completed"||F?.accountId==null||a.isAccountingClassesEnabled!==!1&&_?.classId==null||C==null||A==null||T!==!0&&P==null||e(Dt({scheduleType:c}))}}})(Tn),ss=()=>{const e=M(),a=Y(),s=z(),t=ce(),{tenantEmailDomain:n}=O(),[o,c]=g.useState(!1),{scheduleDetailId:r}=O(),h=a.state?.message==="expenseAutomation",i=os(r),m=S(T=>T.scheduleDetailState.selectedJEScheduleKey);g.useEffect(()=>{m!=null&&m.length!==0||r!=="new"||e("../schedules/fixed_assets")},[m,r]);const d="fixed_assets",u=S(T=>pe(T,d)),p=S(T=>T.entityAutoCompleteState.autoCompleteText.common),f=S(T=>Ue(T,"common")),D=S(T=>ee(T)),x=S(T=>T.classListState.fetchState),b=S(T=>te(T)),C=S(T=>ft(T).selectedPeriod),E=D!=="Completed"||x!=="Completed";g.useEffect(()=>{o===!1&&E?(s(gt(d,y,!0)),c(!0)):E===!1&&o===!1&&(s(vt(d,r==="new"?void 0:r,!0)),c(!0))},[o]),g.useEffect(()=>{if(u.markAsCompleteStatus.fetchState==="Completed")if(s(xt()),h===!0){const{month:T,year:v}=C;e(`../../month_end_close_checks/review/je_schedules/${T}-${v}`)}else e("../schedules/fixed_assets")},[u.markAsCompleteStatus.fetchState]);const w=S(T=>L(T)),I=S(T=>X(T,w.companyId)),k=u.fetchState,_=u.allAccountList,F=u.allClassList,V=u.allDepreciationAccountList,A=u.scheduleDetailsLocalData.fixed_assets;let y;if(r!=="new"&&(y=r),i!==!0||u.fetchState==="Error")return l.jsx(le,{});const P=k==="Completed"&&o===!0;return k!=="Completed"?l.jsx(We,{}):l.jsxs(as,{children:[P===!0?l.jsx(Q,{analytics:j,onLoad:()=>{is(u,d,I)}}):null,l.jsx(ns,{location:a,navigate:e,classList:F,vendorSearchEntityAutoCompleteView:f,vendorSearchAutoCompleteData:{autoCompleteText:p,entityAutoCompleteView:f},expenseAutomationSelectedPeriod:C,usedInExpenseAutomation:h,removeJeScheduleTransactionKey:(T,v)=>{s(Tt(T,v))},accountList:_,depAccountList:V,scheduleLocalData:A,selectedJEScheduleKey:m,scheduleDetailId:y,selectedScheduledJournalEntries:u.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:t,tenantEmailDomain:n,analytics:j,controllerUserDetails:I,isAccountingClassesEnabled:b,status:u.selectedJEScheduleTransaction?.status.code})]})},os=e=>e!=null,ls=e=>({transactionDate:e.date.format(Je),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),is=(e,a,s)=>{const t=e.selectedJEScheduleTransaction?.baseTransaction,n=e.selectedJEScheduleTransaction,o=be(s.controllers),c=Ie(s.controllerUserIds);var r;t!=null&&n!=null&&j.trackScheduleDetailsLoaded({scheduleType:a,transaction:{...ls(t)},scheduleExpenseCategoryAndClass:{expenseCategory:n.jeDebit.account?.accountName??null,expenseClass:n.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(r=n,{currentBalance:r.balanceAsOfToday??null,currentStatus:r.status.label,period:r.period??null,startMonth:r.startDate?.format(Je)??null,endMonth:r.endDate?.format(Je)??null})},vendorName:n.vendor.name??null,fixedAssetsDetails:{accumulatedDepreciationCategory:n.jeCredit.account?.accountName??null,assetId:n.otherAttributes.assetId??null},controllerEmails:o,controllerUserIds:c})},cs=U.div`
|
|
18
|
+
display: flex;
|
|
19
|
+
min-height: 100%;
|
|
20
|
+
width: 100%;
|
|
21
|
+
flex: 1 0 auto;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
align-items: center;
|
|
24
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
25
|
+
`,Oe=Ce.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,ds=G(function(e,a){const s=L(e),t=pe(e,a.scheduleTab);return{tenantName:s.companyName,scheduleDetailsView:t}},function(e,a){const{navigate:s,location:t,usedInExpenseAutomation:n,vendorSearchAutoCompleteData:o,selectedScheduledJournalEntries:c}=a,r=c.flatMap(h=>h.error).filter(h=>!!h)??[];return{onNavigateBack:()=>{if(n===!0){const h=Qe(a.location.state?.pathnameStackToGoBack),i=h.poppedPathname??$t(2);a.navigate(i,{state:{pathnameStackToGoBack:h.newStack}})}else s("../schedules/prepaid_expenses")},onZeniLogoClick:()=>{a.themeState.toggle()},onSave:h=>{e(Me(a.scheduleTab,h,r.length>0))},onDelete:h=>{e(It(a.scheduleTab,h))},onMarkAsComplete:()=>{a.selectedJEScheduleKey!=null&&e(bt(a.scheduleTab,a.selectedJEScheduleKey))},onEditAmount:(h,i)=>{e(Et(a.scheduleTab,h,i))},onJELinkClick:h=>{e(Ct({selectedJELinkRowIndex:h})),s("./edit_link")},onTransactionClick:h=>{const i=`${q(h,a.tenantEmailDomain)}`,m=N(t.state?.pathnameStackToGoBack,t.pathname);s(i,{state:{pathnameStackToGoBack:m,message:"comingFromScheduleDetails"}})},onViewLinkedJE:h=>{const i=`${q(h,a.tenantEmailDomain)}`,m=N(t.state?.pathnameStackToGoBack,t.pathname);s(i,{state:{pathnameStackToGoBack:m}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(h,i)=>{h.trim().length>=2?e(Ne({searchString:h,entityType:i,searchOrigin:"common"})):h.trim().length===0&&e(he("common"))},onCancelAutoComplete:()=>{e(he("common"))}},onDetailPageChange:(h,i)=>{const{scheduleDetailsSection:m,scheduleDetailsListSection:d}=h,{scheduleClass:u,scheduleExpenseCategory:p,months:f,startDate:D,postingDate:x,vendor:b}=m,C=o.entityAutoCompleteView.vendor.length>0?o.entityAutoCompleteView.vendor.find(y=>y.id===b?.selectedOption):void 0,E={id:C?.zeniId??b?.selectedOption??"",name:C?.name??b?.defaultOptions.find(y=>y.value===b?.selectedOption)?.label??"",logo:C?.logo},w=u.selectedOption!=null?a.classList.find(y=>y.classId===u.selectedOption):void 0,I=p.selectedOption!=null?a.accountList.find(y=>y.qboId===p.selectedOption):void 0,k=f?.selectedOption,_=d.map((y,P)=>({...a.scheduleLocalData.jeScheduleDetails[P],amount:{...a.scheduleLocalData.jeScheduleDetails[P].amount,amount:y.amount}})),F=x.type==="day"?x.dayOfMonth?x.dayOfMonth:1:void 0,V=x.type==="lastDayOfMonth"||void 0,A={selectedAccount:I?.accountId,selectedClass:w?.classId,selectedDate:D,selectedMonths:k,jeScheduleDetails:_,lastDayOfMonth:V,selectedVendor:E,selectedDayOfMonth:F};e(yt({scheduleType:a.scheduleTab,localData:A,selectedJeScheduleDetailId:a.scheduleDetailId})),i!==!1||a.scheduleDetailId!=null&&a.status!=="draft"&&a.status!=="marked_as_completed"||I?.accountId==null||a.isAccountingClassesEnabled!==!1&&w?.classId==null||D==null||k==null||V!==!0&&F==null||e(Dt({scheduleType:a.scheduleTab}))}}})(yn),rs=()=>{const e=M(),a=Y(),s=z(),t=ce(),{tenantEmailDomain:n}=O(),[o,c]=g.useState(!1),r=a.state?.message==="expenseAutomation",{scheduleType:h,scheduleDetailId:i}=O(),m=us(h,i),d=S(T=>T.scheduleDetailState.selectedJEScheduleKey);g.useEffect(()=>{d!=null&&d.length!==0||i!=="new"||e("../schedules/prepaid_expenses")},[d,i]);const u=Ee(h)??"prepaid_expenses",p=S(T=>pe(T,u)),f=S(T=>T.entityAutoCompleteState.autoCompleteText.common),D=S(T=>Ue(T,"common")),x=S(T=>ee(T)),b=S(T=>T.classListState.fetchState),C=S(T=>te(T)),E=S(T=>ft(T).selectedPeriod),w=x!=="Completed"||b!=="Completed";g.useEffect(()=>{o===!1&&w?(s(gt(u,y,!0)),c(!0)):w===!1&&o===!1&&(s(vt(u,i==="new"?void 0:i,!0)),c(!0))},[o]),g.useEffect(()=>{if(p.markAsCompleteStatus.fetchState==="Completed")if(s(xt()),r===!0){const{month:T,year:v}=E;e(`../../month_end_close_checks/review/je_schedules/${T}-${v}`)}else e("../schedules/prepaid_expenses")},[p.markAsCompleteStatus.fetchState]);const I=S(T=>L(T)),k=S(T=>X(T,I.companyId)),_=p.fetchState,F=p.allAccountList,V=p.allClassList,A=p.scheduleDetailsLocalData;let y;if(i!=="new"&&(y=i),m!==!0||p.fetchState==="Error")return l.jsx(le,{});const P=_==="Completed"&&o===!0;return _!=="Completed"?l.jsx(We,{}):l.jsxs(cs,{children:[P===!0?l.jsx(Q,{analytics:j,onLoad:()=>{ps(p,u,k)}}):null,l.jsx(ds,{location:a,vendorSearchEntityAutoCompleteView:D,vendorSearchAutoCompleteData:{autoCompleteText:f,entityAutoCompleteView:D},usedInExpenseAutomation:r,removeJeScheduleTransactionKey:(T,v)=>{s(Tt(T,v))},expenseAutomationSelectedPeriod:E,navigate:e,classList:V,accountList:F,scheduleLocalData:A[u],selectedJEScheduleKey:d,scheduleDetailId:y,selectedScheduledJournalEntries:p.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:t,tenantEmailDomain:n,scheduleTab:u,analytics:j,controllerUserDetails:k,isAccountingClassesEnabled:C,status:p.selectedJEScheduleTransaction?.status.code})]})},us=(e,a)=>Ee(e)!=null&&a!=null,hs=e=>({transactionDate:e.date.format(Oe),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),ps=(e,a,s)=>{const t=e.selectedJEScheduleTransaction?.baseTransaction,n=e.selectedJEScheduleTransaction,o=be(s.controllers),c=Ie(s.controllerUserIds);var r;t!=null&&n!=null&&j.trackScheduleDetailsLoaded({scheduleType:a,transaction:{...hs(t)},scheduleExpenseCategoryAndClass:{expenseCategory:n.jeDebit.account?.accountName??null,expenseClass:n.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(r=n,{currentBalance:r.balanceAsOfToday??null,currentStatus:r.status.label,period:r.period??null,startMonth:r.startDate?.format(Oe)??null,endMonth:r.endDate?.format(Oe)??null})},vendorName:n.vendor.name??null,controllerEmails:o,controllerUserIds:c})},ms={drawerLeftMargin:new Ze(0,0,100,200)},Ss=G(function(e,a){const{jeScheduledTransaction:s,selectedJERow:t,scheduleType:n,isVendorBulkUpdateOnTransactionEnabled:o}=a,{scheduleDetailsLocalData:c,updateStatus:r}=pe(e,a.scheduleType),h=L(e),i=c[n].jeScheduleDetails[t].jeLink,m=i.type==="recommended"?i.recommendedTransactionID:i.transactionDetailID,d=m!=null?aa(e,m):void 0,u=R.getSignedInUser(),p=e.tenantState.currentTenantId,f={userId:u?.userId??"",sessionId:u?.zeniSessionId??"",tenantId:h.tenantId??p},D=h?.company?.companyInfo?.firstMonthOfFY??1;return{jeScheduledTransaction:s,transactionDetail:d,localData:c[n].jeScheduleDetails[t],saveStatus:r.fetchState,authParams:f,isVendorBulkUpdateOnTransactionEnabled:o,firstMonthOfFY:D,isDisabled:r.fetchState==="In-Progress"?"readonly":void 0,analytics:j,qboAppUrl:na(Xe.qboRedirectionUrl)}},function(e,a){const{selectedJERow:s,jeScheduleDetailId:t,navigate:n}=a;return{onUpdateLocalData:o=>{const c=o.linkJETransaction.qboURL;c!=null&&e(oa({scheduleType:a.scheduleType,jeScheduleDetailId:t,rowId:s,jeLink:c}))},onFetchTransactionClick:o=>{e(kt(o))},onSaveClick:()=>{e(Me(a.scheduleType,t))},onBackClick:()=>{n("..",{relative:"path"})},onCancelClick:()=>{const o=a.jeScheduledTransaction.scheduledJournalEntry[s];e(sa({scheduleType:a.scheduleType,jeScheduleDetailId:t,rowId:s,originalScheduledJE:o})),n("..",{relative:"path"})}}})(Cn),fs=()=>{const e=Dn(),a=M(),s=z(),{scheduleDetailId:t}=O(),n=de(),o=ms.drawerLeftMargin.valuePx(n),{scheduleType:c}=O(),{useFeatureGate:r}=ae(),{isFeatureEnabled:h}=r(K.isVendorBulkUpdateOnTransactionEnabled),i=Ee(c)??"prepaid_expenses",[m,d]=g.useState(!1);if(R.getSignedInUser()==null)throw Error("Can't access Account detail page without signing in...");if(t==null)throw Error("Invalid Schedule Detail Id");const u=S(C=>pe(C,i));g.useEffect(()=>{u.fetchState==="Not-Started"&&a("..",{relative:"path"})},[]);const p=u.selectedJELinkRowIndex,f=p!=null?u.scheduleDetailsLocalData[i].jeScheduleDetails[p]?.jeLink:null,D=f?.type==="recommended"?f.recommendedTransactionID:f?.transactionDetailID;g.useEffect(()=>{D!=null&&s(kt(D))},[]),g.useEffect(()=>{f?.type==="recommended"&&m===!1&&p!=null&&(d(!0),s(ta({scheduleType:i,jeScheduleDetailId:t,rowId:p})))});const x=S(C=>L(C)),b=S(C=>X(C,x.companyId));return l.jsx(Rn,{anchor:"right",open:!0,PaperProps:{style:{width:`calc(100% - ${o})`,boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:e.colors.black,opacity:.75,cursor:"pointer"}}},onClose:()=>a("..",{relative:"path"}),children:l.jsx(gs,{onClick:C=>C.stopPropagation(),children:u.fetchState!=="Completed"||u.selectedJEScheduleTransaction==null||p==null?l.jsx(Rt,{fetchState:u.fetchState}):l.jsx(Ss,{scheduleType:i,jeScheduleDetailId:t,selectedJERow:p,jeScheduledTransaction:u.selectedJEScheduleTransaction,isCOTEnabled:!1,navigate:a,scheduleTab:i,controllerUserDetails:b,isVendorBulkUpdateOnTransactionEnabled:h})})})},gs=U(Gt)`
|
|
26
|
+
display: flex;
|
|
27
|
+
min-height: 100%;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
`,ve=e=>{switch(e){case"vendors_tab":return"../summary";case"filing_1099":return"../filing_1099";case"prepaid_expenses":return"../schedules/prepaid_expenses";case"fixed_assets":return"../schedules/fixed_assets";case"accrued_expenses":return"../schedules/accrued_expenses";default:return"../opex"}},xe=e=>{switch(e){case"prepaid_expenses":return"prepaid_expenses";case"fixed_assets":return"fixed_assets";case"accrued_expenses":return"accrued_expenses";case"operating_expenses_by_vendor":return"operating_expenses";default:return"vendors_list"}},Te=()=>{const e=Y(),a=z(),s=S(t=>me(t));return g.useEffect(()=>{const t=e.pathname.split("/").pop();if(t!=null){const n=(o=>{switch(o){case"prepaid_expenses":return"prepaid_expenses";case"fixed_assets":return"fixed_assets";case"accrued_expenses":return"accrued_expenses";case"opex":return"operating_expenses";case"filing_1099":return"filing_1099";default:return"vendors_list"}})(t);n!==s.currentTab&&a(ie(n))}},[e.pathname,s.currentTab,a]),s},ne="accrued_expenses",vs=G(function(e,a){const s=L(e),t=me(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,vendorTabView:t,isAccountingClassesEnabled:te(e)}},function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=ve(t);s(n),e(ie(xe(t)))},onSortOrderChanged:(t,n)=>{e(He({scheduleType:ne,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(qe({scheduleType:ne,subTab:t}))},onSearchTextChanged:t=>{e(Ye({scheduleType:ne,searchText:t}))},onReloadReport:()=>{e(wt(ne))},onScroll:t=>{e(ze({scheduleType:ne,scrollYOffset:t}))},onClickNewButton:()=>{e(ca()),e(da()),j.trackScheduleAccruedDetailsNewRequested({scheduleType:"accrued_expenses"}),s("details/new")},onClickSchedule:t=>{e(ia({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeAccruedSchedules.find(o=>o.jeAccruedScheduleKey===t);s(`details/${n?.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(Ke({scheduleType:ne,fetchState:t}))}}})(En),xs=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const[t,n]=g.useState(!1),[o,c]=g.useState(!1),r=M(),h=z(),{useFeatureGate:i}=ae(),m=ce();Te();const{isFeatureEnabled:d,isFeatureGateLoading:u}=i(K.isOpexByVendorFeatureEnabled),p=R.getSignedInUser(),f=S(v=>L(v)),D={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:f.tenantId},x=g.useMemo(()=>({authParams:D,jeScheduleEndPoint:`${Z}/jeScheduleReports`,timezone:ke(),companyName:f.companyName}),[]),[b,C]=g.useState(!1),E=S(v=>ee(v)),w=S(v=>Ge(v,"accrued_expenses")),I=e.includes("prepaid_expenses"),k=e.includes("fixed_assets"),_=e.includes("accrued_expenses");g.useEffect(()=>{(I||k||_)&&b===!1&&E!=="Completed"&&(h(ye()),C(!0))},[b]),g.useEffect(()=>{u===!1&&(h(De({shouldFetchAccruedExpenses:_,shouldFetchFixedAssets:!0,shouldFetchPrepaidExpenses:I,shouldFetchOpexByVendor:d,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),n(!0))},[E,k,u,d]),g.useEffect(()=>{t===!1&&w==="Completed"&&h(wt("accrued_expenses",{selectedTimeframe:$e("accrued_expenses"),selectedCategoryId:"all"},!0))},[t,w]);const F=S(v=>la(v,ne)),{isAiCfoAccessEnabled:V,onAskAiCfoClick:A}=Se({mobileExploreReferrer:"Vendors — Accrued Expenses"});fe({isDataReady:F.fetchState==="Completed"});const y=S(v=>H(v).isReportGenerated);S(v=>H(v).fetchState)!=="Completed"||y!==!0||d!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),_||r("../opex");const P=S(v=>X(v,f.companyId)),T=v=>{c(v)};return l.jsxs(l.Fragment,{children:[l.jsx(ge,{isAppContentDrawerOpen:o,handleDrawerToggle:T}),l.jsx(vs,{navigate:r,previousTabPosition:a,setPreviousTabPosition:s,scheduleListReport:F,downloadParams:x,themeState:m,vendorTabsToShow:e,analytics:j,controllerUserDetails:P,isAiCfoAccessEnabled:V,onAskAiCfoClick:A,onClickMenuIcon:()=>T(!0)})]})},se="fixed_assets",Ts=G(function(e,a){const s=L(e),t=me(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,controllerUserDetails:a.controllerUserDetails,vendorTabView:t,isAccountingClassesEnabled:te(e)}},function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=ve(t);s(n),e(ie(xe(t)))},onSortOrderChanged:(t,n)=>{e(He({scheduleType:se,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(qe({scheduleType:se,subTab:t}))},onSearchTextChanged:t=>{e(Ye({scheduleType:se,searchText:t}))},onReloadReport:()=>{e(we(se))},onScroll:t=>{e(ze({scheduleType:se,scrollYOffset:t}))},onClickSchedule:t=>{e(jt({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeScheduledTransactions.find(o=>o.jeScheduleTransactionKey===t);s(n?.jeScheduleId==null?"details/new":`details/${n.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(Ke({scheduleType:se,fetchState:t}))}}})(Ut),ys=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const[t,n]=g.useState(!1),o=M(),c=z();Te();const{useFeatureGate:r}=ae(),h=ce(),{isFeatureEnabled:i,isFeatureGateLoading:m}=r(K.isOpexByVendorFeatureEnabled),d=R.getSignedInUser(),u=S(v=>L(v)),p={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:u.tenantId},f=g.useMemo(()=>({authParams:p,jeScheduleEndPoint:`${Z}/jeScheduleReports`,timezone:ke(),companyName:u.companyName}),[]),[D,x]=g.useState(!1),b=S(v=>ee(v)),C=S(v=>Ge(v,"fixed_assets")),E=e.includes("prepaid_expenses"),w=e.includes("fixed_assets"),I=e.includes("accrued_expenses");g.useEffect(()=>{(E||w||I)&&D===!1&&b!=="Completed"&&(c(ye()),x(!0))},[D]),g.useEffect(()=>{m===!1&&(c(De({shouldFetchAccruedExpenses:I,shouldFetchFixedAssets:!0,shouldFetchPrepaidExpenses:E,shouldFetchOpexByVendor:i,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),n(!0))},[b,w,m,i]),g.useEffect(()=>{t===!1&&C==="Completed"&&c(we("fixed_assets",{selectedTimeframe:$e("fixed_assets"),selectedCategoryId:"all"},!0))},[t,C]);const k=S(v=>At(v,se)),{isAiCfoAccessEnabled:_,onAskAiCfoClick:F}=Se({mobileExploreReferrer:"Vendors — Fixed Assets"});fe({isDataReady:k.fetchState==="Completed"});const V=S(v=>H(v).isReportGenerated);S(v=>H(v).fetchState)!=="Completed"||V!==!0||i!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),w||o("../opex");const A=S(v=>X(v,u.companyId)),[y,P]=g.useState(!1),T=v=>{P(v)};return l.jsxs(l.Fragment,{children:[l.jsx(ge,{isAppContentDrawerOpen:y,handleDrawerToggle:T}),l.jsx(Ts,{navigate:o,scheduleListReport:k,downloadParams:f,previousTabPosition:a,setPreviousTabPosition:s,themeState:h,vendorTabsToShow:e,analytics:j,controllerUserDetails:A,isAiCfoAccessEnabled:_,onAskAiCfoClick:F,onClickMenuIcon:()=>{T(!0)}})]})},Ds=U.div`
|
|
30
|
+
display: flex;
|
|
31
|
+
min-height: 100%;
|
|
32
|
+
width: 100%;
|
|
33
|
+
flex: 1 1 auto;
|
|
34
|
+
flex-direction: column;
|
|
35
|
+
align-items: center;
|
|
36
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
37
|
+
`,Cs=G(function(e,a){const s=R.getSignedInUser(),t=e.tenantState.currentTenantId,n=L(e),o=n?.companyName??"",c={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""},r=H(e),h=ra(e);return{report:r,uiState:h,isAccountingClassesEnabled:te(e),analytics:j,vendorTabsToShow:a.vendorTabsToShow,downloadParams:{downloadState:h.downloadState,currentTenantCompanyName:o,statementEndPoint:`${Z}/opexByVendor`,authParams:c,timezone:ke()}}},function(e,a){const{navigate:s}=a;return{onFetchOpExByVendors:(t,n,o)=>{e(xa(t,n,o))},onVendorNameAndBalanceClicked:(t,n)=>{if(a.tenantEmailDomain!=null){const o=tt(t.id,t.qboId,a.tenantEmailDomain,n),c=N(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c,referrer:"Operating Expenses By Vendor"}})}},onReloadReport:()=>{e(va(!0))},onBackClick:()=>{s("../../dashboard")},onTimeframeSelectionChanged:t=>{e(ga(t))},onAdditionalBalanceSelectionChanged:(t,n)=>{e(fa({isCompareModeOn:t,additionalBalances:n}))},onSortOrderChanged:(t,n,o)=>{e(Sa({sortkey:n,sortOrder:t,timeframe:o}))},onVendorTabSelectionChanged:t=>{const n=ve(t);s(n),e(ie(xe(t)))},onSortOrSearchStarted:t=>{e(ma(t))},onPageFetchStarted:()=>{e(pa(!0))},updateDownloadStateHandler:t=>{e(ha(t))},onClearSearch:t=>{e(ua({timeframe:t}))}}})(In);function Es({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const t=M(),n=z(),o=Y(),{tenantEmailDomain:c}=O(),r=de(),h=R.getSignedInUser(),{useFeatureGate:i}=ae(),{isFeatureEnabled:m,isFeatureGateLoading:d}=i(K.isOpexByVendorFeatureEnabled),u=S(A=>H(A));if(h==null)throw Error("Can't access opex by vendor page without signing in...");Te();const[p,f]=g.useState(!1),D=S(A=>ee(A)),x=e.includes("prepaid_expenses"),b=e.includes("fixed_assets"),C=e.includes("accrued_expenses"),E=S(A=>me(A)),{isAiCfoAccessEnabled:w,onAskAiCfoClick:I}=Se({mobileExploreReferrer:"Vendors — Operating Expenses by Vendor"});fe({isDataReady:u.fetchState==="Completed"&&u.isReportGenerated===!0});const{areTenantIdsInSync:k}=bn();g.useEffect(()=>{(x||b||C)&&p===!1&&D!=="Completed"&&k&&(n(ye()),f(!0))},[p,k]),g.useEffect(()=>{k&&n(De({shouldFetchAccruedExpenses:C,shouldFetchFixedAssets:b,shouldFetchPrepaidExpenses:x,shouldFetchOpexByVendor:m===!0&&d===!1,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1}))},[D,b,d,m,k]),u.fetchState!=="Completed"||u.isReportGenerated!==!0||m!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),(u.isReportGenerated===!1&&u.fetchState==="Completed"||m===!1&&d===!1)&&t("../summary");const[_,F]=g.useState(!1),V=A=>{F(A)};return l.jsxs(Ds,{windowSize:r,children:[u.fetchState==="Completed"?l.jsx(Q,{analytics:j,onLoad:A=>{E.previousTab==null?A.trackVendorOperatingExpensesPageLoaded("Side Panel"):A.trackVendorOperatingExpenses(E.currentTab,E.previousTab??null)}}):null,l.jsx(ge,{isAppContentDrawerOpen:_,handleDrawerToggle:V}),l.jsx(Cs,{location:o,navigate:t,previousTabPosition:a,setPreviousTabPosition:s,tenantEmailDomain:c,vendorTabsToShow:e,isAiCfoAccessEnabled:w,onAskAiCfoClick:I,onClickMenuIcon:()=>{V(!0)}})]})}const oe="prepaid_expenses",bs=G(function(e,a){const s=L(e),t=me(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,controllerUserDetails:a.controllerUserDetails,vendorTabView:t,isAccountingClassesEnabled:te(e)}},function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=ve(t);s(n),e(ie(xe(t)))},onSortOrderChanged:(t,n)=>{e(He({scheduleType:oe,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(qe({scheduleType:oe,subTab:t}))},onSearchTextChanged:t=>{e(Ye({scheduleType:oe,searchText:t}))},onReloadReport:()=>{e(we(oe))},onScroll:t=>{e(ze({scheduleType:oe,scrollYOffset:t}))},onClickSchedule:t=>{e(jt({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeScheduledTransactions.find(o=>o.jeScheduleTransactionKey===t);s(n?.jeScheduleId==null?"details/new":`details/${n.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(Ke({scheduleType:oe,fetchState:t}))}}})(Ut),Is=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const[t,n]=g.useState(!1),o=M(),c=z(),{useFeatureGate:r}=ae(),h=ce();Te();const i=R.getSignedInUser(),{isFeatureEnabled:m,isFeatureGateLoading:d}=r(K.isOpexByVendorFeatureEnabled),u=S(v=>L(v)),p=S(v=>Ge(v,"prepaid_expenses")),f={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:u.tenantId},D=g.useMemo(()=>({authParams:f,jeScheduleEndPoint:`${Z}/jeScheduleReports`,timezone:ke(),companyName:u.companyName}),[]),[x,b]=g.useState(!1),C=S(v=>ee(v)),E=e.includes("prepaid_expenses"),w=e.includes("fixed_assets"),I=e.includes("accrued_expenses");g.useEffect(()=>{(E||w||I)&&x===!1&&C!=="Completed"&&(c(ye()),b(!0))},[x]),g.useEffect(()=>{t===!1&&p==="Completed"&&c(we("prepaid_expenses",{selectedTimeframe:$e("prepaid_expenses"),selectedCategoryId:"all"},!0))},[t,p]),g.useEffect(()=>{d===!1&&(c(De({shouldFetchAccruedExpenses:I,shouldFetchFixedAssets:w,shouldFetchPrepaidExpenses:!0,shouldFetchOpexByVendor:m,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),n(!0))},[C,w,d,m]);const k=S(v=>At(v,oe)),{isAiCfoAccessEnabled:_,onAskAiCfoClick:F}=Se({mobileExploreReferrer:"Vendors — Prepaid Expenses"});fe({isDataReady:k.fetchState==="Completed"});const V=S(v=>H(v).isReportGenerated);S(v=>H(v).fetchState)!=="Completed"||V!==!0||m!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),E||o("../opex");const A=S(v=>X(v,u.companyId)),[y,P]=g.useState(!1),T=v=>{P(v)};return l.jsxs(l.Fragment,{children:[l.jsx(ge,{isAppContentDrawerOpen:y,handleDrawerToggle:T}),l.jsx(bs,{navigate:o,previousTabPosition:a,setPreviousTabPosition:s,scheduleListReport:k,downloadParams:D,themeState:h,vendorTabsToShow:e,analytics:j,controllerUserDetails:A,isAiCfoAccessEnabled:_,onAskAiCfoClick:F,onClickMenuIcon:()=>{T(!0)}})]})},ks=U.div`
|
|
38
|
+
display: flex;
|
|
39
|
+
min-height: 100%;
|
|
40
|
+
width: 100%;
|
|
41
|
+
flex: 1 1 auto;
|
|
42
|
+
flex-direction: column;
|
|
43
|
+
align-items: center;
|
|
44
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
45
|
+
`,ws=G(function(e,a){const{isFiling1099FeatureEnabled:s,vendorDetailView:t,selectedVendor:n,firstMonthOfFY:o,currentTenant:c,currentUserRoleMap:r}=a,h=R.getSignedInUser(),i={userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:c.tenantId??""};return{firstMonthOfFY:o,isFiling1099FeatureEnabled:s,vendorDetailView:t,allTransactions:t?.allVendorTransactionsView,allTransactionsTabData:t?.allTransactionsTabData!=null?{timePeriod:ka(t?.allTransactionsTabData.timePeriod),numberOfQuartersFetched:t?.allTransactionsTabData.numberOfQuartersFetched}:void 0,vendorLogo:n?.logo,readOnlyMode:r?.bookkeeping_user===!0,filesEndPoint:Nt.fileMicroServiceBaseUrl,authParams:i,scrollToTrend:a.isTrendPeriodSelected}},function(e,a){const{navigate:s,vendorDetailView:t,vendorId:n,defaultTransactionTimePeriod:o,vendorEntity:c,tenantEmailDomain:r,location:h,firstMonthOfFY:i}=a,m=()=>{const d=Qe(h.state?.pathnameStackToGoBack),u=d.poppedPathname??((p=2)=>{let f=p;a.isTrendPeriodSelected===!0&&(f=5);let D="../";for(let x=0;x<f;x++)D=`${D}../`;return D})(1);s(u,{state:{pathnameStackToGoBack:d.newStack}})};return{onSaveVendor:()=>{t!=null&&((d,u)=>{const{vendorId:p,vendorName:f,existingCategory:D,existingClass:x,existingOwner:b,selectedCategory:C,selectedClass:E,selectedOwner:w,isRecommendedCategorySelected:I,isRecommendedClassSelected:k,categoryRecommendationTypeSelected:_,classRecommendationTypeSelected:F}=La(d,u);p!=null&&j.trackVendorDetailsSave(p,f??"",D,x,b,C,E,w,I,k,_,F)})(t?.vendorViewDetails,t?.vendorViewDetails.ownerList),n!=null&&e(Va(n,void 0))},onVendorSpendTrendFilterTabClick:d=>{e(_a(d))},saveVendorDetailLocalData:d=>{n!=null&&e(Pa({vendorId:n,localData:d}))},saveContactsInVendorTabDetailLocalData:(d,u)=>{e(Fa({vendorId:d,localData:{contacts:u}}))},onCancelClick:()=>{var d;t?.vendorViewDetails.vendorView?.vendorBasic!=null&&(d=t.vendorViewDetails.vendorView.vendorBasic).id!=null&&j.trackVendorDetailsCancel(d.id??"",d.name,d.account?.accountName,d.class?.className,d.owner?.email),e(ot()),e(lt()),e(it()),e(ct()),m()},handleSpendTrendPercentChangeClick:()=>{var d;t?.vendorViewDetails.vendorView?.vendorBasic!=null&&(d=t.vendorViewDetails.vendorView?.vendorBasic,d.id!=null&&j.trackVendorDetailsSpendTrendHotlinkClicked(d.id??"",d.name,d.account?.accountName,d.class?.className,d.owner?.email))},onSaveSuccess:()=>{n!=null&&e(ja("Not-Started",n)),e(ot()),e(lt()),e(it()),e(ct()),m()},onTrendSelectedPeriodChange:d=>{if(d==null)o!=null&&e(je(c,"EntityDetail",{timeframe:"quarter",timePeriod:o}));else{const u=d.currentTimePeriod==null?d.addTimePeriod:{startDate:d.addTimePeriod.startDate,endDate:d.currentTimePeriod.endDate};e(Pe(c,"EntityDetail",{timeframe:d.timeframe,timePeriod:d.addTimePeriod},i)),e(je(c,"EntityDetail",{timeframe:d.timeframe,timePeriod:u}))}},onVendorTabSelectionChanged:d=>{e(Aa(d))},onAddressClick:(d,u)=>{if(r==null)return;const p=Gn(r,d,u),f=N(h.state?.pathnameStackToGoBack,h.pathname);s(p,{state:{pathnameStackToGoBack:f}})},onVendorDetailUIChange:d=>{e(wa({collapsableStatus:d}))},onTransactionItemClick:d=>{const u=`${q(d,r)}`,p=N(h.state?.pathnameStackToGoBack,h.pathname);s(u,{state:{pathnameStackToGoBack:p}})},onLoadPreviousTransactionsClick:(d,u)=>{e(Ft({timePeriod:Fe(d),numberOfQuartersFetched:u})),e(Pt(c,Fe(d),!0,!0))}}})(wn);function ut({referrerType:e,isFiling1099FeatureEnabled:a}){const s=z(),t=Y(),n=M(),o=kn(),[c,r]=g.useState(!1),[h,i]=g.useState(!1),[m,d]=g.useState(!1),u=O(),p=u.vendorId,f=u.qboId,{tenantEmailDomain:D,timeframe:x,startDate:b,endDate:C}=u,E={id:f??"",name:"",type:"vendor",zeniId:p??"",qboId:f??""};g.useEffect(()=>{x!=null&&b!=null&&C!=null?r(!0):(r(!1),m===!1&&(d(!0),s(je(E,"EntityDetail"))))},[x,b,C]);const w=de(),I=S(J=>L(J)),k=S(J=>p!=null?Ta(J,p,E):void 0),_=S(J=>J.vendorState.vendorByID[p??""]),F=S(J=>L(J).company?.companyInfo.firstMonthOfFY??1),V=S(()=>ya(F,2)),A=Fe({startDate:V.startDate,endDate:Da()}),y=Ca(F),P=S(J=>Ea(J.trendWithTransactionsState,E,"EntityDetail")),[T,v]=g.useState(!1),re=c===!1&&m===!1?void 0:P?.selectedPeriod?.timePeriod??y;return g.useEffect(()=>(e==null&&k?.fetchState!=="Not-Started"||p==null||s(ba(p,E)),()=>{e!=null&&p!=null&&s(Ia(p))}),[p,t.state,s]),g.useEffect(()=>{k?.fetchState==="Completed"&&k?.vendorViewDetails.vendorView?.vendorBasic!=null&&((J,ue,Ae)=>{J.id!=null&&j.trackVendorDetails(J.id,J.name,Ae,J.account?.accountName,J.class?.className,J.owner?.email,ue.percentChange,ue.last30DaysSpend,ue.last90DaysSpend,ue.yearToDateSpend)})(k?.vendorViewDetails.vendorView?.vendorBasic,k?.vendorSpend,e),v(!1)},[k?.fetchState]),g.useEffect(()=>{if(k?.fetchState==="Completed"&&T===!1){re!=null&&c===!1&&(s(Pe(E,"EntityDetail",{timeframe:P?.selectedPeriod?.timeframe??"quarter",timePeriod:re},F)),v(!0));const J=Ce.getLocalizedStrings().dateFormat.analytics;if(c===!0&&x!=null&&b!=null&&C!=null){v(!0);const ue=x,Ae={startDate:st(b,J.YYYYDashMMDashDDFormat),endDate:st(C,J.YYYYDashMMDashDDFormat)};s(Pe(E,"EntityDetail",{timeframe:ue,timePeriod:Ae}))}}},[k?.fetchState,re,P?.selectedPeriod?.timeframe,c,F]),g.useEffect(()=>{k?.fetchState==="Completed"&&h===!1&&(s(Ft({timePeriod:A,numberOfQuartersFetched:3})),s(Pt(E,k.allTransactionsTabData?.timePeriod??A,!1,!0)),i(!0))},[k?.fetchState,h]),p==null?l.jsx(le,{}):l.jsx(ks,{windowSize:w,children:l.jsx(ws,{location:t,navigate:n,isFiling1099FeatureEnabled:a,vendorDetailView:k,vendorId:p,currentTenant:I,selectedVendor:_,firstMonthOfFY:F,isTrendPeriodSelected:c,selectedPeriodTimePeriod:P?.selectedPeriod?.timePeriod,defaultTransactionTimePeriod:y,vendorEntity:E,currentUserRoleMap:o?.loggedInUserRoleMap,tenantEmailDomain:D})})}const As=Ce.getLocalizedStrings().spendManagement.billPay.vendorCreation.vendorDetails,js={containerWidth:new Ze(100,58)},Fs=U(jn)`
|
|
46
|
+
width: ${W.sp4};
|
|
47
|
+
height: ${W.sp4};
|
|
48
|
+
cursor: pointer;
|
|
49
|
+
color: ${e=>e.theme.colors.brandColorJade};
|
|
50
|
+
`,Ps=U.div`
|
|
51
|
+
display: flex;
|
|
52
|
+
height: 100vh;
|
|
53
|
+
flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
|
|
54
|
+
width: 100%;
|
|
55
|
+
overflow-y: scroll;
|
|
56
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
57
|
+
`,_s=U.div`
|
|
58
|
+
display: flex;
|
|
59
|
+
flex-direction: column;
|
|
60
|
+
width: ${e=>`${js.containerWidth.value(e.windowSize)}%`};
|
|
61
|
+
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
62
|
+
`,Vs=G(function(e,a){const s=R.getSignedInUser(),t=e.tenantState.currentTenantId,n={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""},o=e.vendorFiling1099UploadDetailsState,c=e.vendorFiling1099UploadDetailsState;let r={fetchState:"Not-Started",error:void 0};return a.vendorId!=null&&(r=e.vendorViewState.editVendorStateById[a.vendorId]?.fetchStatus),{uploadInvoiceEndPoint:`${Nt.documentAIMicroServiceBaseUrl}`,vendorFiling1099UploadDetailsState:o,vendorFiling1099UploadDetailsViewState:c,uploadStaus:c.w9FormUploadStatus,authParams:n,billId:a.billId,vendorId:a.vendorId,file:a.file,showAutofill:a.showAutofill,type:a.type,analytics:j,entityId:a.billId,fetchVendorFetchStatus:r,vendorLegalName:a.vendorLegalName}},function(e,a){const s=a.vendorId;return{onInvoiceUpload:t=>{if(function(n){return n!=null&&"w9_form"in n}(t)&&(e(Ra({w9FormFile:t.files[0]})),t.w9_form[0]!=null)){e(Ua({ocrData:t.w9_form[0],vendorId:s}));const n=(o=>({street:[o.street.join(" ")],city:o.city,state:o.state,postalCode:o.postal_code,countryCode:o.country_code??void 0,country:o.country??""}))(t.w9_form[0].address);e(Jt({addressType:"vendor_address",addressToCreate:n}))}},updateInvoiceUploadFetchState:t=>{e(_e({fetchState:t,error:void 0}))},onSkipAutofill:t=>{e(Oa(t))},onVendorFiling1099UploadDetailsSave:t=>{e(Bt(t))},onDeleteClick:()=>{e(_e({fetchState:"Not-Started",error:void 0})),e(Lt({vendorId:s,w9Documents:[]}))}}})(Pn);function ht({appContent:e,showFullScreenSkeletonWhileLoading:a}){const s=z(),t=M(),{vendorId:n}=O(),o=de(),c=ce(),r=R.getSignedInUser(),[h,i]=g.useState(!1),{useFeatureGate:m}=ae(),{isFeatureEnabled:d}=m(K.isVendorRecommendationFeatureEnabled),u=S(y=>L(y)).companyName,p=new AbortController,f=p.signal;let D,x,b,C,E;if(n==null)throw new Error("Vendor ID not found for Vendor Filing 1099 Details Screen");D=S(y=>_t(y,n)),x=S(y=>y.vendorFiling1099UploadDetailsState.vendor1099DetailsSaveStatus),b=S(y=>y.vendorViewState.editVendorStateById[n]?.fetchStatus),E=S(y=>y.vendorFiling1099UploadDetailsState.vendor1099DetailsLocalData.w9Documents?.[0]),C=S(y=>y.vendorFiling1099UploadDetailsState);const w=b?.fetchState==="In-Progress"||C?.w9FormUploadStatus?.fetchState==="In-Progress",I=()=>{c.toggle()};g.useEffect(()=>()=>{p.abort(),s(Vt(n))},[]),g.useEffect(()=>{h||n!=null&&(i(!0),s(Ba(!1,n,f)))},[n]);const k=Be(b?.fetchState),_=Be(x?.fetchState),F=D.vendor?.contactIds,V=F?.[F.length-1],A=S(y=>y.contactState.contactById[V]);if(g.useEffect(()=>{n!=null&&k==="In-Progress"&&b?.fetchState==="Completed"&&D?.vendor!=null&&(s(Ja(n,D.vendor,A)),D?.vendor.filing1099W9Files?.[0]!=null&&s(_e({fetchState:"Completed",error:void 0})))},[n,D?.vendor]),g.useEffect(()=>{_==="In-Progress"&&x?.fetchState==="Completed"&&t("../../vendors/filing_1099")},[x?.fetchState]),a===!0&&b?.fetchState!=="Completed"&&b?.fetchState!=="Error")return l.jsx(Rs,{children:l.jsx(An,{})});if(r==null)throw Error("Can't access VendorFiling1099UploadScreen without signing in...");return l.jsxs(Ps,{windowSize:o,children:[o!=="small"?l.jsxs(Bs,{children:[l.jsx(Fs,{onClick:I}),l.jsxs(Ls,{showContent:r.userEmailDomain==="zeni.ai",children:[l.jsx(Js,{showAutofill:!1}),l.jsx(Os,{showAutofill:!1,children:u})]})]}):null,l.jsx(Vs,{vendorId:n,file:E,showAutofill:!1,type:"w9",isVendorRecommendationEnabled:d,pdfTitle:E?As.w9FormTitle:void 0,showTitlebar:!0,showTitlebarIcon:!0,vendorLegalName:D?.vendor?.legalName,isLoading:w}),l.jsx(_s,{windowSize:o,children:e})]})}const Ls=U.div`
|
|
63
|
+
display: ${e=>e.showContent?"flex":"none"};
|
|
64
|
+
align-items: center;
|
|
65
|
+
`,Bs=U.div`
|
|
66
|
+
margin-bottom: ${W.sp3};
|
|
67
|
+
margin-top: ${W.sp3};
|
|
68
|
+
margin-left: ${W.sp8};
|
|
69
|
+
position: absolute;
|
|
70
|
+
display: flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
`,Js=U.div`
|
|
73
|
+
width: 1px;
|
|
74
|
+
height: ${W.sp3};
|
|
75
|
+
margin: ${W.sp0} ${W.sp3};
|
|
76
|
+
background-color: ${e=>e.showAutofill?Mt.neutralGrey1Light:e.theme.colors.hero};
|
|
77
|
+
`,Os=U(Fn.StandardMedium)`
|
|
78
|
+
color: ${e=>e.showAutofill?Mt.neutralGrey5Light:e.theme.colors.primary};
|
|
79
|
+
`,Rs=U.div`
|
|
80
|
+
width: 100%;
|
|
81
|
+
height: 100vh;
|
|
82
|
+
overflow: hidden;
|
|
83
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
84
|
+
`,Us=G(function(e){const a=Na(e);return{vendorDetailView:Ma(e),globalMerchantView:a}},function(e,a){const{navigate:s}=a;return{updateVendorDetailLocalData:t=>{e(Ot({vendorDetails:t}))},fetchRecommendation:t=>{e($a("tenant",t))},onSaveClick:()=>{e(Ga())},onBackClick:()=>{s("../review")}}})(_n);function Ns(){const e=M();return l.jsx(Us,{navigate:e})}const Ms=U.div`
|
|
85
|
+
display: flex;
|
|
86
|
+
min-height: 100%;
|
|
87
|
+
width: 100%;
|
|
88
|
+
flex: 1 1 auto;
|
|
89
|
+
flex-direction: column;
|
|
90
|
+
align-items: center;
|
|
91
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
92
|
+
`,Gs=G(function(e,a){const{vendorFirstReviewDetails:s}=a,t=e.globalMerchantAutoCompleteState.autoCompleteText,n=R.getSignedInUser(),o=e.tenantState.currentTenantId,c={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""},r=L(e);return{vendorFirstReviewView:s,globalMerchantAutoCompleteData:{globalMerchantAutoCompleteView:s.globalMerchantAutoCompleteView,autoCompleteText:t},analytics:j,authParams:c,attachmentEndpoint:r.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${Z}/vendor_attachments_accounting_provider`:`${Z}/vendor_attachments`}},function(e,a){const{navigate:s}=a;return{onFetchVendorReviewView:(t,n,o)=>{e(Ve(t,n,o))},onGlobalMerchantAutoCompleteInputChange:(t,n)=>{t.trim().length>=2?e(Za({searchString:t,globalMerchantType:n??"vendor"})):t.trim().length===0&&e(rt())},onUpdateLocalData:(t,n,o,c)=>{if(n!=null){const r=$s(n);e(Qa({vendorId:t,currentSelection:r,selectedGlobalMerchantId:o,vendorRenamedText:c}))}},onResetVendorLocalData:t=>{e(Wa({vendorId:t}))},onVendorNameClick:(t,n)=>{if(a.tenantEmailDomain!=null){const o=tt(t,n,a.tenantEmailDomain),c=N(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c}})}},onUpdatePageToken:t=>{e(Ha({pageToken:t}))},onUpdateSortUiState:(t,n)=>{e(qa({sortOrder:t,sortKey:n}))},onUpdateScrollYOffset:t=>{e(Ya({scrollYOffset:t}))},onClickSave:(t,n,o)=>{e(za(t,n,o))},onClickCancelPopup:()=>{e(Ka())},onClearGlobalMerchantAutoCompleteResults:()=>{e(rt())},onClickRedirectToQBO:()=>{window.open(`${Xe.qboRedirectionUrl}/vendors`,"_blank")},updateVendorDetailLocalData:t=>{e(Ot({vendorDetails:t})),s(`./vendor/${t.id}`)},onBackClick:()=>{s("../..")},onReloadList:()=>{e(Ve(null))}}})(Vn);function pt(){const e=M(),a=z(),s=Y(),{tenantEmailDomain:t}=O(),n=de(),o=R.getSignedInUser(),{vendorId:c}=O(),r=S(u=>dt(u)),[h,i]=g.useState(!1),m=S(u=>dt(u).fetchState);if(g.useEffect(()=>{m==="Not-Started"&&h===!1&&(a(Ve(null)),i(!0))},[]),o==null)throw Error("Can't access first review page without signing in...");const d=u=>u.trackPageLoaded(et.Event.vendorTenantReviewListPage);return l.jsxs(l.Fragment,{children:[m==="Completed"?l.jsx(Q,{analytics:j,onLoad:d}):null,l.jsx(Q,{analytics:j,onLoad:d}),l.jsx($n,{isOpen:c!=null,drawerLeftMargin:new Ze(0,0,300,600),onClose:()=>{e("../review")},children:l.jsx(Ks,{onClick:u=>u.stopPropagation(),children:l.jsx(Ns,{})})}),l.jsx(Ms,{windowSize:n,children:l.jsx(Gs,{location:s,navigate:e,vendorFirstReviewDetails:r,tenantEmailDomain:t})})]})}const $s=e=>e.recommendedFirst===!0?"recommendedFirst":e.recommendedSecond===!0?"recommendedSecond":e.retain===!0?"retain":e.rename===!0?"rename":e.customMerchant===!0?"customMerchant":null,Ks=U(Gt)`
|
|
93
|
+
display: flex;
|
|
94
|
+
min-height: 100%;
|
|
95
|
+
flex-direction: column;
|
|
96
|
+
`,zs=G(function(e,a){const s=R.getSignedInUser(),t=e.tenantState.currentTenantId,n=e.vendorFiling1099UploadDetailsState,o={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""};let c={fetchState:"Not-Started",error:void 0};return a.vendorId!=null&&(c=e.vendorViewState.editVendorStateById[a.vendorId]?.fetchStatus),{analytics:j,vendorFiling1099UploadDetailsViewState:n,authParams:o,googleAPIKey:Xe.googleMapsAPIKey,vendorId:a.vendorId,fetchVendorFetchStatus:c,vendor:a.vendorFiling1099UploadDetails?.vendor}},function(e,a){const{currentTenant:s,navigate:t,location:n,vendorId:o,vendorFiling1099UploadDetails:c}=a,{tenantEmailDomain:r}=s;return{onVendorFiling1099UploadDetailsSave:h=>{e(Bt(h)),j.trackVendor1099DetailSave(c.vendor.legalName??"")},onSaveChangesToLocalStore:h=>{e(Lt(h))},onResetVendorFiling1099FormStatus:()=>{e(Xa())},onAddressEditHandler:h=>{const i=Un((m=>({street:m.vendor1099FilingSectionId.street,suite:m.vendor1099FilingSectionId.suite,city:m.vendor1099FilingSectionId.city,state:m.vendor1099FilingSectionId.state,country:m.vendor1099FilingSectionId.country,countryCode:m.vendor1099FilingSectionId.countryCode,postalCode:m.vendor1099FilingSectionId.postalCode,secondaryInfo:m.vendor1099FilingSectionId.secondaryInfo}))(h));e(Jt({addressType:"vendor_address",addressToCreate:i}))},goBackToListPage:()=>{e(Vt(o));const h=`/${r}/vendors/filing_1099/`,i=N(n.state?.pathnameStackToGoBack,n.pathname);t(h,{state:{pathnameStackToGoBack:i}})},onAddressClick:h=>{const i=function(d,u,p){let f=`/${d}/vendors/filing_1099/upload/${p}/edit`;return f=f.concat(`/new/${u}`),f}(r,h,o),m=N(n.state?.pathnameStackToGoBack,n.pathname);t(i,{state:{pathnameStackToGoBack:m}})},AddressFormPage:Bn}})(Ln);function Ys(){const e=M(),a=Y(),{vendorId:s}=O(),t=S(r=>L(r));let n;if(s==null)throw new Error("Vendor ID not found for Vendor Filing 1099 Details Screen");n=S(r=>_t(r,s));const{tenantEmailDomain:o}=t,c=t.companyId??R.getSignedInUserTenant(o)?.companyId;if(c==null)throw new Error("Company ID not found for Vendor Filing 1099 Details Screen");return l.jsx(zs,{location:a,navigate:e,currentTenant:t,vendorId:s,vendorFiling1099UploadDetails:n,companyId:c})}const qs=U.div`
|
|
97
|
+
display: flex;
|
|
98
|
+
min-height: 100%;
|
|
99
|
+
width: 100%;
|
|
100
|
+
flex: 1 1 auto;
|
|
101
|
+
flex-direction: column;
|
|
102
|
+
align-items: center;
|
|
103
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
104
|
+
`,Hs=G(function(e,a){const{vendorsFiling1099ListDetails:s,accountMappingView:t,analytics:n}=a;return{analytics:n,vendorsFiling1099List:s.vendors,isVendor1099Populated:s.isVendor1099Populated,accountMappingView:t,fetchState:s.fetchState,uiState:s.uiState,lastRefreshSuccessTime:s.lastRefreshSuccessTime,vendorTabsToShow:a.vendorTabsToShow}},function(e,a){const{navigate:s,analytics:t}=a;return{onUpdateSortUiState:(n,o)=>{e(cn({sortOrder:n,sortKey:o}))},onUpdateSearchUiState:n=>{e(ln({searchString:n}))},onVendorRowClick:n=>{if(a.tenantEmailDomain!=null){const o=`/${a.tenantEmailDomain}/vendors/filing_1099/upload/${encodeURIComponent(n)}/edit`,c=N(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c}})}},onReloadVendors:()=>{e(Le(!0))},onBackClick:()=>{e(sn()),e(on())},onVendorTabSelectionChanged:n=>{const o=ve(n);s(o),e(ie(xe(n)))},onAccountMappingChange:n=>{const{filing1099:o}=n,{bankAccount:c,expenseCategory1099:r}=o,h=Kn(a.accountMappingView.bankAccounts1099FilingAccountList,c.selectedOptions),i=zn(a.accountMappingView.expenseAccounts1099FilingAccountList,r),m={selectedBankAccounts1099FilingAccountIds:h.map(d=>d.accountId),selectedExpenseAccounts1099FilingAccountIds:i};e(nn({data:m}))},onSaveClick:()=>{e(an()),t.track(et.Event.vendor1099TabSettingsSave)}}})(Jn);function mt({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const t=M(),n=z(),o=Y(),{tenantEmailDomain:c}=O(),r=de(),h=R.getSignedInUser(),[i,m]=g.useState(!1),[d,u]=g.useState(!1);if(h==null)throw Error("Can't access vendor filing 1099 page without signing in...");Te();const p=S(I=>en(I)),f=S(I=>tn(I)),{isAiCfoAccessEnabled:D,onAskAiCfoClick:x}=Se({mobileExploreReferrer:"Vendors — 1099"});fe({isDataReady:p.fetchState==="Completed"}),g.useEffect(()=>{d||(u(!0),n(Le(!1)))},[d,u]),g.useEffect(()=>{f.saveState.fetchState==="Completed"&&n(Le(!1))},[f.saveState.fetchState]);const b=I=>{m(I)},C=S(I=>L(I)),E={userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:C.tenantId},w=g.useMemo(()=>({authParams:E,tenantName:C.companyName,filing1099ReportEndPoint:`${Z}/filing1099Reports`}),[]);return l.jsxs(l.Fragment,{children:[p.fetchState==="Completed"?l.jsx(l.Fragment,{children:l.jsx(Q,{analytics:j,onLoad:()=>j.trackPageLoaded(et.Event.vendor1099ListPage)})}):null,l.jsxs(qs,{windowSize:r,children:[l.jsx(ge,{isAppContentDrawerOpen:i,handleDrawerToggle:b}),l.jsx(Hs,{location:o,navigate:t,previousTabPosition:a,setPreviousTabPosition:s,analytics:j,vendorsFiling1099ListDetails:p,vendorTypeList:p.vendorTypeList,accountMappingView:f,downloadParams:w,tenantEmailDomain:c,vendorTabsToShow:e,isAiCfoAccessEnabled:D,onAskAiCfoClick:x,onClickMenuIcon:()=>{b(!0)}})]})]})}const Ws=U.div`
|
|
105
|
+
display: flex;
|
|
106
|
+
min-height: 100%;
|
|
107
|
+
width: 100%;
|
|
108
|
+
flex: 1 1 auto;
|
|
109
|
+
flex-direction: column;
|
|
110
|
+
align-items: center;
|
|
111
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
112
|
+
`,Qs=G(function(e,a){const{vendorsListDetails:s}=a;return{vendorsList:s.vendors,totalVendorCount:s.totalVendorCount,fetchState:s.fetchState,uiState:s.uiState,searchText:s.searchString,lastRefreshSuccessTime:s.lastRefreshSuccessTime,vendorTabsToShow:a.vendorTabsToShow,isAccountingClassesEnabled:te(e),analytics:j}},function(e,a){const{navigate:s}=a;return{onFetchVendorsList:(t="",n,o)=>{e(mn({searchString:t,keepExistingListItems:n,view:"vendorsTab",pageToken:o}))},onUpdatePageToken:t=>{e(pn({pageToken:t}))},onUpdateSortUiState:(t,n)=>{e(hn({sortOrder:t,sortkey:n}))},onUpdateCurrentYTDSelection:t=>{e(un({ytdSpendSelection:t}))},onVendorRowClick:(t,n)=>{if(a.tenantEmailDomain!=null){const o=tt(t,n,a.tenantEmailDomain),c=N(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c,referrer:"Vendor List"}})}},onReloadVendors:()=>{console.log("Reload vendors")},onUpdateScrollYOffset:t=>{e(rn({scrollYOffset:t}))},onBackClick:()=>{s("../..")},onVendorTabSelectionChanged:t=>{const n=ve(t);s(n),e(ie(xe(t)))}}})(On);function Zs({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const t=M(),n=z(),o=Y(),{tenantEmailDomain:c}=O(),r=de(),h=R.getSignedInUser(),{useFeatureGate:i}=ae(),{isFeatureEnabled:m,isFeatureGateLoading:d}=i(K.isOpexByVendorFeatureEnabled);Te();const u=e.includes("prepaid_expenses"),p=e.includes("fixed_assets"),f=e.includes("accrued_expenses"),D=S(P=>me(P));let x={};x=S(P=>dn(P,"vendorsTab"));const[b,C]=g.useState(!1),{isAiCfoAccessEnabled:E,onAskAiCfoClick:w}=Se({mobileExploreReferrer:"Vendors Summary"});fe({isDataReady:x.fetchState==="Completed"});const I=S(P=>ee(P)),k=S(P=>H(P).isReportGenerated);S(P=>H(P).fetchState)==="Completed"&&k&&m&&!e.includes("operating_expenses_by_vendor")&&e.splice(1,0,"operating_expenses_by_vendor");const[_,F]=g.useState(!1);if(g.useEffect(()=>{(u||p)&&_===!1&&I!=="Completed"&&(n(ye()),F(!0))},[_]),g.useEffect(()=>{n(De({shouldFetchAccruedExpenses:f,shouldFetchFixedAssets:p,shouldFetchPrepaidExpenses:u,shouldFetchOpexByVendor:m&&d===!1,shouldFetchVendorsList:!0,shouldFetchFiling1099Vendor:!1}))},[I,p,d,m]),g.useEffect(()=>{b||x.fetchState!=="Completed"||(C(!0),j.trackVendorList(D.currentTab,D.previousTab??null,x.totalVendorCount,x.uiState.sortKey,x.uiState.ytdSpendSelection))},[x.fetchState]),h==null)throw Error("Can't access address page without signing in...");const[V,A]=g.useState(!1),y=P=>{A(P)};return l.jsxs(Ws,{windowSize:r,children:[l.jsx(ge,{isAppContentDrawerOpen:V,handleDrawerToggle:y}),l.jsx(Qs,{location:o,navigate:t,vendorsListDetails:x,tenantEmailDomain:c,vendorTabsToShow:e,onClickMenuIcon:()=>{y(!0)},previousTabPosition:a,setPreviousTabPosition:s,isAiCfoAccessEnabled:E,onAskAiCfoClick:w})]})}function bo(){const{useFeatureGate:e}=ae(),a=Y().state?.referrer,[s,t]=g.useState(!1),[n,o]=g.useState(0),c=R.getSignedInUser(),r=Sn(c),{isFeatureEnabled:h}=e(K.isOpexByVendorFeatureEnabled),{isFeatureEnabled:i}=e(K.isVendorReviewFeatureEnabled),{isFeatureEnabled:m}=e(K.isScheduledJEPrepaidExpensesFeatureEnabled),{isFeatureEnabled:d}=e(K.isScheduledJEFixedAssetsFeatureEnabled),{isFeatureEnabled:u}=e(K.isScheduledJEAccruedExpensesFeatureEnabled),{isFeatureEnabled:p}=e(K.isFiling1099FeatureEnabled),f=S(w=>L(w)),D=f?.externalConnections?.accounting[0]?.connectionName,x=["vendors_tab"];D!=="netsuite"&&m===!0&&x.push("prepaid_expenses"),D!=="netsuite"&&d===!0&&x.push("fixed_assets"),D!=="netsuite"&&u===!0&&x.push("accrued_expenses"),D!=="netsuite"&&p&&r&&(x.push("filing_1099"),h&&x.splice(1,0,"operating_expenses_by_vendor"));const{isFeatureEnabled:b}=e(K.isDebitCardFeatureEnabled),C=fn(b,f),E=gn(f);return C===!0||E===!0?l.jsx(at,{children:l.jsx(B,{path:"/*",element:l.jsx(Mn,{})})}):l.jsxs(at,{children:[l.jsx(B,{path:"/opex",element:h===!0?l.jsx(Es,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx($,{to:"../summary"})}),l.jsx(B,{path:"/summary",element:l.jsx(Zs,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x})}),l.jsx(B,{path:"schedules/fixed_assets/details/:scheduleDetailId",element:d===!0?l.jsx(ss,{}):l.jsx($,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/accrued_expenses/details/:scheduleDetailId",element:d===!0?l.jsx(Xn,{shouldNavigateBack:s,setShouldNavigateBack:t}):l.jsx($,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/:scheduleType/details/:scheduleDetailId",element:m===!0?l.jsx(rs,{}):l.jsx($,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/:scheduleType/details/:scheduleDetailId/edit_link",element:m===!0||d===!0?l.jsx(fs,{}):l.jsx($,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/accrued_expenses/details/:scheduleDetailId/edit_link",element:u===!0?l.jsx(Hn,{setShouldNavigateBack:t}):l.jsx($,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/prepaid_expenses",element:m===!0?l.jsx(Is,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx($,{to:"../opex"})}),l.jsx(B,{path:"schedules/fixed_assets",element:d===!0?l.jsx(ys,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx($,{to:"../opex"})}),l.jsx(B,{path:"schedules/accrued_expenses",element:u===!0?l.jsx(xs,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx($,{to:"../opex"})}),l.jsx(B,{path:"/filing_1099",element:p&&r?l.jsx(mt,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx($,{to:"../opex"})}),l.jsx(B,{path:"/filing_1099/:vendorId",element:p&&r?l.jsx(mt,{vendorTabsToShow:x,previousTabPosition:n,setPreviousTabPosition:o}):l.jsx($,{to:"../opex"})}),l.jsx(B,{path:"/filing_1099/upload/:vendorId/edit",element:p&&r?l.jsx(ht,{appContent:l.jsx(Ys,{}),showFullScreenSkeletonWhileLoading:!0}):l.jsx($,{to:"../opex"})}),l.jsx(B,{path:"/filing_1099/upload/:vendorId/edit/new/:addressType",element:p&&r?l.jsx(ht,{appContent:l.jsx(Nn,{isSubPage:!0,hideAddressBackButton:!0,hideAddressSubTitle:!0})}):l.jsx($,{to:"../opex"})}),l.jsx(B,{path:"/summary/:vendorId/:qboId",element:l.jsx(ut,{referrerType:a,isFiling1099FeatureEnabled:p&&r})}),l.jsx(B,{path:"/summary/:vendorId/:qboId/:timeframe/:startDate/:endDate",element:l.jsx(ut,{referrerType:a,isFiling1099FeatureEnabled:p&&r})}),l.jsx(B,{path:"/review",element:i===!0?l.jsx(pt,{}):l.jsx(le,{})}),l.jsx(B,{path:"/review/vendor/:vendorId",element:i?l.jsx(pt,{}):l.jsx(le,{})}),l.jsx(B,{path:"/",element:l.jsx($,{to:"summary"})}),l.jsx(B,{path:"*",element:l.jsx(le,{})})]})}export{bo as default};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import{j as o}from"./liveblocks-BFnsX8B0.js";import{a as l}from"./sentry-BReBlZug.js";import{q as u,h,g as y,N as I}from"./core-kd_mEvMc.js";import{ID as w,eO as b,yY as x}from"./zeni-epic-state-B5rZ-c32.js";import{z as f,w as j,F as S,G as D}from"./index-DzAxH0sX.js";import{n as c}from"./mui-HcBIKYw3.js";import"./recharts-Td_75k_G.js";import"./analytics-D1ODE1Ix.js";import"./plaid-B2FXOAMc.js";import"./dnd-64rfSyZU.js";import"./stripe-DMRn4zHo.js";import"./lottie-cF0OZPLg.js";import"./lexical--COyOM8W.js";import"./pdf-C7R1L7h-.js";import"./utils-B46LtKXi.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]="4c0958ee-ac1d-4e6e-9736-5ee5cb08e5a1",e._sentryDebugIdIdentifier="sentry-dbid-4c0958ee-ac1d-4e6e-9736-5ee5cb08e5a1")}catch{}})();const W=()=>{const[e]=u(),t=e.get("code")??"",s=e.get("state")??"",g=e.get("profileId")??"",[n,p]=l.useState(!1),a=h(),i=y(m=>w(m)),r=f.getSignedInUser(),d=f.getSignedInUserTenantWithId(s);if(r==null||d==null)return o.jsx(I,{to:"/signin/auth",replace:!0});if(r==null)throw Error("Can't access this page without signing in...");return b(r.userId,r.zeniSessionId,d?.tenantId),l.useEffect(()=>{n||(p(!0),a(x(t,g,s)))},[n,a]),i.fetchState==="Error"?o.jsx(E,{children:o.jsx(_,{children:i.error?.message??""})}):(i.fetchState==="Completed"&&window.close(),o.jsx(j,{fetchState:"In-Progress"}))},E=c.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
width: 100%;
|
|
4
|
+
height: 100vh;
|
|
5
|
+
flex-direction: row;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${e=>e.theme.colors.grey5};
|
|
9
|
+
`,_=c(D.LargeRegular)`
|
|
10
|
+
display: flex;
|
|
11
|
+
color: ${S.important};
|
|
12
|
+
`;export{W as default};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import{j as n}from"./liveblocks-BFnsX8B0.js";import{j as Y,u as J,h as z,l as Z,g as w,k as Q,N as ne,n as _e,o as k}from"./core-kd_mEvMc.js";import{eN as M,Nq as Ce,Nr as Ve,cj as te,ck as $e,fa as Ze,w9 as ke,Am as Ge,w3 as Tn,Ns as Bn,Nt as Fn,w6 as On,wd as fe,w0 as Rn,vZ as Ln,Md as le,Nu as Un,DG as zn,Jj as Mn,DI as Nn,k7 as Be,Nv as _n,pE as He,ps as We,j_ as Ye,k1 as Fe,Jk as Oe,Jl as Vn,Nw as $n,k0 as Zn,kn as Gn,jR as Hn,io as Wn,im as Yn,Nx as Jn,Ny as ye,Dn as Qn,Nz as qn,NA as Xn,M6 as we,NB as Re,NC as Kn,DT as et,MQ as nt,Bg as Je,s5 as Qe,ND as tt,DQ as at,NE as qe,cL as De,DX as Xe,fb as ot,eR as Ke,eT as Ae,DV as st,Ba as rt,DN as it,NF as en,NG as nn,Dp as tn,Dz as Le,NH as ct,Dt as lt,NI as dt,MF as ut,DY as pt,bv as mt,bD as ht,cv as gt,bE as ft,bs as yt,Ik as xt}from"./zeni-epic-state-B5rZ-c32.js";import{j as ae,a as V,z as A,p as B,h as N,w as de,bP as Ct,Q as Ie,q as _,C as q,r as an,am as kt,ab as Ue,d as R,bQ as wt,ap as Se,bR as Dt,y as ue,bS as At,f as be,aJ as W,bT as It,M as St,a8 as bt,bU as ze,bV as vt,s as ee,bW as Et,bX as jt,bY as Pt,bZ as Tt,a5 as Bt,o as Ft}from"./index-DzAxH0sX.js";import{n as L,D as X,S as K}from"./mui-HcBIKYw3.js";import ce from"./NotFoundScreen-BRSAD1CL.js";import{S as Me}from"./SetupPagesScreen-DVBuL6-C.js";import{F as on}from"./FeaturePreviewScreen-BLkw206M.js";import{a as u}from"./sentry-BReBlZug.js";import{M as pe}from"./MobileAppDrawer-B4YhcBfV.js";import{A as Ot,D as Rt,V as Lt}from"./DomesticWireDetailScreen-Dmty-wcu.js";import{A as Ut}from"./AddressScreen-e0Pj7PP8.js";import{u as sn}from"./useAskAiCfoHostNavButtonProps-vEeThjOY.js";import{c as rn}from"./useFetchSuggestedQuestionsWhenReady-CqXHVPRH.js";import{Z as zt}from"./ZeniAccountStatementScreen-CAtmURw3.js";import"./recharts-Td_75k_G.js";import"./analytics-D1ODE1Ix.js";import"./plaid-B2FXOAMc.js";import"./dnd-64rfSyZU.js";import"./stripe-DMRn4zHo.js";import"./lottie-cF0OZPLg.js";import"./lexical--COyOM8W.js";import"./pdf-C7R1L7h-.js";import"./utils-B46LtKXi.js";import"./analyticsHelper-DL8E6jB6.js";import"./routePaths-DTjzb3UO.js";import"./BusinessVerificationPageScreen-Cd40kgea.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]="095a739e-ef80-4cd3-b77b-4e73675529dd",e._sentryDebugIdIdentifier="sentry-dbid-095a739e-ef80-4cd3-b77b-4e73675529dd")}catch{}})();const Mt=L.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
+
`,Nt=Q(function(e){return{autoTransferRuleView:Ce(e),downloadAccountDetailEndPoint:`${Ie}/account_details`,transferLimit:5e5,depositAccountListView:Ge(e.depositAccountState,e.depositAccountListState)}},function(e,t){const{navigate:s,handleDrawerToggle:o}=t;return{onBackClick:()=>{s("..")},onClickMenuIcon:()=>{o(!0)},onFetchAutoTransferRules:a=>{e(ke(a))},onCreateRule:()=>{e(Ln())},onUpdateRule:a=>{e(fe(a))},onDeleteClick:a=>{e(Rn(a))},onPauseClick:a=>{e(fe(a,!0,!1))},onResumeClick:a=>{e(fe(a,!1,!0))},onActivityClick:(a,r)=>{e(On(a,r))},onUpdateRuleLocalData:a=>{e(Fn(a))},clearRuleLocalData:()=>{e(Bn())},onEditClick:a=>{s(`./${a}/edit`)},onEditDrawerClose:()=>{s("../../",{relative:"path"})},onReviewClick:()=>{e(Tn())}}})(Ct);function Ne({isEditDrawerOpen:e}){const t=Y(),s=J(),o=z(),a=ae(),{ruleId:r,tenantEmailDomain:d}=Z(),{useFeatureGate:c}=V(),[p,m]=u.useState(!1),[x,i]=u.useState(!1),l=w(y=>M(y)),h=w(y=>Ce(y)),C=h?.fetchState??"Not-Started",b=w(y=>Ve(y)),g=l?.companyId??A.getSignedInUserTenant(d)?.companyId,D=te(a?.loggedInUserRoleMap)||$e(a?.loggedInUserRoleMap),{isFeatureEnabled:I}=c(B.isTreasuryEnabled),f=l?.company!=null&&Ze(l.company),S=I&&f,F=A.getSignedInUser(),U=l.tenantId,P={userId:F?.userId??"",sessionId:F?.zeniSessionId??"",tenantId:U??""},E=l.companyName;u.useEffect(()=>{!x&&C==="Not-Started"&&g&&(i(!0),o(ke(!0)))},[x,C,g,o]);const v=y=>{m(y)},T=N(),j=!!s.state?.scrollToAddRule;return h?.fetchState!=="Completed"?n.jsx(de,{fetchState:"In-Progress",style:{backgroundColor:T.colors.grey5}}):n.jsxs(Mt,{children:[n.jsx(pe,{isAppContentDrawerOpen:p,handleDrawerToggle:v}),n.jsx(Nt,{navigate:t,location:s,currentTenant:l,companyName:E,handleDrawerToggle:v,isEditDrawerOpen:e,editingRuleId:r,authParams:P,includeTreasuryOption:S,hasAdminLevelAccess:D,zeniAccountsConfigDetail:b,scrollToAddRule:j})]})}const _t={overlayWidth:new q(100,100,58)},Vt=({vendorId:e,isDrawerOpen:t,closeDrawerHandler:s})=>{const o=z(),a=N(),r=_();if(A.getSignedInUser()==null)throw Error("Can't access ach account page without signing in...");return n.jsx(X,{onClose:()=>{s(!0),o(le())},anchor:"right",open:t,PaperProps:{style:{width:_t.overlayWidth.valuePercentage(r),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:a.colors.black,opacity:.75,cursor:"pointer"}}},children:n.jsx($t,{onClick:d=>d.stopPropagation(),children:n.jsx(Ot,{vendorIdParam:e,accountContext:"express-pay"})})})},$t=L(K)`
|
|
10
|
+
display: flex;
|
|
11
|
+
min-height: 100%;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
`,Zt={overlayWidth:new q(100,100,58)},Gt=({isDrawerOpen:e,closeDrawerHandler:t})=>{const s=z(),o=N(),a=_();if(A.getSignedInUser()==null)throw Error("Can't access address page without signing in...");return n.jsx(X,{onClose:()=>{t(!0),s(le())},anchor:"right",open:e,PaperProps:{style:{width:Zt.overlayWidth.valuePercentage(a),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.75,cursor:"pointer"}}},children:n.jsx(Ht,{onClick:r=>r.stopPropagation(),children:n.jsx(Ut,{accountContext:"express-pay",addressTypeParam:"vendor_address"})})})},Ht=L(K)`
|
|
14
|
+
display: flex;
|
|
15
|
+
min-height: 100%;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
`,Wt={overlayWidth:new q(100,100,58)},Yt=({vendorId:e,isDrawerOpen:t,closeDrawerHandler:s})=>{const o=z(),a=N(),r=_();if(A.getSignedInUser()==null)throw Error("Can't access ach account page without signing in...");return n.jsx(X,{onClose:()=>{s(!0),o(le())},anchor:"right",open:t,PaperProps:{style:{width:Wt.overlayWidth.valuePercentage(r),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:a.colors.black,opacity:.75,cursor:"pointer"}}},children:n.jsx(Jt,{onClick:d=>d.stopPropagation(),children:n.jsx(Rt,{vendorIdParam:e,accountContext:"express-pay"})})})},Jt=L(K)`
|
|
18
|
+
display: flex;
|
|
19
|
+
min-height: 100%;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
`,Qt=L.div`
|
|
22
|
+
display: flex;
|
|
23
|
+
height: 100vh;
|
|
24
|
+
width: 100%;
|
|
25
|
+
flex: 1 1 auto;
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
align-items: center;
|
|
28
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
29
|
+
`,qt=Q(function(e,t){const s=M(e),o=A.getSignedInUser(),a=s.tenantId,r={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:a??""},d=t.expressPayDetails,c=e.entityAutoCompleteState.autoCompleteText.common,p=Mn(e,"common");return{expressPayDetails:d,fileProps:{authParams:r,filesEndPoint:`${Se.fileMicroServiceBaseUrl}`},vendorSearchAutoCompleteData:{autoCompleteText:c,entityAutoCompleteView:p},analytics:t.analytics}},function(e,t){const{navigate:s}=t;return{onSaveVendor:o=>{e(Yn(o,void 0,void 0,!0))},saveVendorDetailLocalData:(o,a)=>{e(Fe({vendorId:a,localData:o}))},saveExpressPayLocalData:o=>{e(Wn({localData:o}))},onVendorSelected:o=>{o!=null&&e(Hn(o,!1))},updateSelectedVendorForCreate:o=>{e(Gn(o))},initializeVendorAddress:()=>{e(Zn())},resetVendorSaveStatus:o=>{e($n({vendorId:o}))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(o,a)=>{o.trim().length>=2?e(Vn({searchString:o,entityType:a,searchOrigin:"common"})):o.trim().length===0&&e(Oe("common"))},onCancelAutoComplete:()=>{e(Oe("common"))}},chooseNewVendor:o=>{e(Fe({localData:{vendorName:o}}))},onClickAddAccount:o=>{o.method.toLowerCase().indexOf("ach")!==-1?s("./add-ach",{relative:"path"}):o.method.toLowerCase().indexOf("wire")!==-1&&o.method.toLowerCase().indexOf("domestic")!==-1&&s("./add-wire",{relative:"path"})},updateFilesEntity:o=>{e(Ye({files:o}))},onDeleteFile:o=>{e(We(o))},onEditFileName:(o,a)=>{e(He(o,a.split(".")[0]))},onBackClick:o=>{o!=null&&e(Be(o)),e(Be()),e(_n()),e(le()),s("../",{relative:"path"})},onSchedulePayment:()=>{e(Nn())}}})(wt);function re({isAddACHDrawerOpen:e,isAddWireDrawerOpen:t,isAddAddressDrawerOpen:s}){const o=Y(),a=J(),r=z(),[d,c]=u.useState(!1),{tenantEmailDomain:p}=Z(),m=ae(),x=w(y=>y.expressPayState.fetchState),i=w(y=>M(y)),l=w(y=>Un(y)),h=l.expressPayLocalData?.vendorId,C=i.companyId??A.getSignedInUserTenant(p)?.companyId,[b,g]=u.useState(!1),[D,I]=u.useState(!1),[f,S]=u.useState(!1),F=an(a.state?.pathnameStackToGoBack),{poppedPathname:U}=F,P=U?.split("/"),E=P?.[P.length-1];u.useEffect(()=>{e===!0?g(!0):(g(!1),document.body.style.overflow="auto")},[e]),u.useEffect(()=>{t===!0?I(!0):(I(!1),document.body.style.overflow="auto")},[t]),u.useEffect(()=>{s===!0?S(!0):(S(!1),document.body.style.overflow="auto")},[s]),u.useEffect(()=>{x==="Not-Started"&&r(zn(!0,!0))},[x,r]);const v=kt(l.vendorViewDetails.bankAccountCreationState?.fetchState);if(u.useEffect(()=>{v==="In-Progress"&&l.vendorViewDetails.bankAccountCreationState?.fetchState==="Completed"&&j()},[v,l.vendorViewDetails.bankAccountCreationState?.fetchState]),A.getSignedInUser()==null)throw Error("Can't access express pay page without signing in...");const T=y=>{c(y)},j=()=>{g(!1),I(!1),o("../",{relative:"path"})};return n.jsxs(Qt,{children:[Ue(a)?n.jsx(pe,{isAppContentDrawerOpen:d,handleDrawerToggle:T}):null,b===!0?n.jsx(Vt,{vendorId:h,closeDrawerHandler:j,isDrawerOpen:b}):null,D===!0?n.jsx(Yt,{vendorId:h,closeDrawerHandler:j,isDrawerOpen:D}):null,f===!0?n.jsx(Gt,{closeDrawerHandler:j,isDrawerOpen:f}):null,n.jsx(Lt,{vendorId:h,isExpressPayPage:!0}),n.jsx(qt,{navigate:o,location:a,companyId:C,accountId:E,analytics:R,currentTenant:i,vendorId:h,roleMap:m?.loggedInUserRoleMap,isSettings:Ue(a),expressPayDetails:l,onClickMenuIcon:()=>{T(!0)}})]})}const Xt={overlayWidth:new q(100,100,58)},Kt=({authParams:e,downloadAccountDetailEndPoint:t,isAccountInfoDrawerOpen:s,zeniBankAccountDetail:o,closeDrawerHandler:a})=>{const r=N(),d=_(),c=w(i=>Ve(i)),p=w(i=>M(i));if(A.getSignedInUser()==null)throw Error("Can't access Account detail page without signing in...");const m=()=>{a(!0)},x={depositAccount:o,onDismissClick:m,zeniAccountsConfigDetail:c,authParams:e,downloadAccountDetailEndPoint:t,currentTenant:p};return n.jsx(X,{anchor:"right",open:s,PaperProps:{style:{width:Xt.overlayWidth.valuePercentage(d),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:r.colors.black,opacity:.75,cursor:"pointer"}}},onClose:()=>m(),children:n.jsx(ea,{onClick:i=>i.stopPropagation(),children:n.jsx(Dt,{...x})})})},ea=L(K)`
|
|
30
|
+
display: flex;
|
|
31
|
+
min-height: 100%;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
`,na={overlayWidth:new q(100,100,58)},cn=({isCheckDepositDrawerOpen:e,closeDrawerHandler:t})=>{const s=N(),o=_(),a=z(),r=w(i=>M(i)),d=A.getSignedInUser(),c=r.tenantId,p={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:c??""};if(d==null)throw Error("Can't access check deposit page without signing in...");const m=w(i=>Jn(i)),x={analytics:R,checkDeposit:m,filesEndPoint:`${Se.fileMicroServiceBaseUrl}`,authParams:p,onSaveChangesToLocalStore:i=>{a(qn(i))},updateFilesEntity:i=>{a(Ye({files:i}))},onAnotherTransferClick:()=>{a(ye())},onDeleteFile:i=>{a(We(i))},onEditFileName:(i,l)=>{a(He(i,l.split(".")[0]))},onCheckDpositClick:()=>{a(Qn())},onDismissClick:()=>{t(!0),a(ye())}};return n.jsxs(n.Fragment,{children:[n.jsx(ue,{analytics:R,onLoad:i=>(l=>l.trackPageLoaded(be.Event.accountsDepositCheckFormViewed))(i)}),n.jsx(X,{anchor:"right",open:e,PaperProps:{style:{width:na.overlayWidth.valuePercentage(o),boxShadow:"none",zIndex:8}},slotProps:{backdrop:{style:{backgroundColor:s.colors.black,opacity:.75,cursor:"pointer"}}},onClose:(i,l)=>(l==="backdropClick"||l==="escapeKeyDown")&&(t(!0),void a(ye())),children:n.jsx(ta,{onClick:i=>i.stopPropagation(),children:n.jsx(At,{...x})})})]})},ta=L(K)`
|
|
34
|
+
display: flex;
|
|
35
|
+
min-height: 100%;
|
|
36
|
+
flex-direction: column;
|
|
37
|
+
`,aa={overlayWidth:new q(100,100,58)},oa=Q(function(e,t){const s=t.currentTenant?.companyId;return{plaidConnectionDetails:nt(e,s,"zeni_accounts","external_account").plaidConnectionDetails,depositAccountListView:Ge(e.depositAccountState,e.depositAccountListState)}},function(e,t){return{onReviewClick:()=>e(at()),clearReviewTransferDetail:()=>e(tt()),onFetchLinkTokenClick:s=>{e(Qe("external_account",s))},onEstablishConnectionClick:s=>{e(Je(s,t.currentTenant?.companyId,"external_account",void 0,"link_external_account"))}}})(It),ln=({isTransferDrawerOpen:e,authParams:t,downloadAccountDetailEndPoint:s,closeDrawerHandler:o,zeniAccountsConfig:a})=>{const r=w(f=>Xn(f)),d=w(f=>M(f)),c=N(),p=_(),m=z(),{accountId:x}=Z(),[i,l]=u.useState("achTransfer"),[h,C]=u.useState(!1);if(A.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const{useDynamicConfig:b}=V(),{configValue:g}=b(W.zeniAccountsConfig),D=we(g),I=()=>{o(!0),m(Re())};return u.useEffect(()=>{r.reviewTransferDetail.fetchState==="Completed"&&C(!0)},[C,r.reviewTransferDetail.fetchState]),n.jsxs(n.Fragment,{children:[n.jsx(ue,{analytics:R,onLoad:f=>(S=>S.trackPageLoaded(be.Event.zeniAccountsTransferFormViewed))(f)}),n.jsx(X,{onClose:()=>{(i==="achTransfer"&&h===!1||i==="achTransfer"&&h&&r.fetchState==="Completed")&&I()},anchor:"right",open:e,PaperProps:{style:{width:aa.overlayWidth.valuePercentage(p),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:c.colors.black,opacity:.75,cursor:"pointer"}}},children:n.jsx(sa,{onClick:f=>f.stopPropagation(),children:n.jsx(oa,{analytics:R,transferDetails:r,authParams:t,downloadAccountDetailEndPoint:s,onTransferClick:()=>{R.trackTransferBetweenAccountsFormClicked("Transfer",r.reviewTransferDetail.reviewTransferMoney.isShowDailyAchLimitWarning?"Review Split Transfer":"Review Transfer",r.transferDetailLocalData.transferFrom?.label,r.transferDetailLocalData.transferTo?.label,r.transferDetailLocalData.amount.amount,r.reviewTransferDetail.reviewTransferMoney.isShowDailyAchLimitWarning,r.reviewTransferDetail.reviewTransferMoney.transferSchedules.length,r.transferDetailLocalData.transferFrom?.accType==="paymentAccount"&&r.transferDetailLocalData.transferTo?.accType==="depositAccount"&&a.zeniAccountsConfigDetail.depositProductConfig.depositProducts?.[0].range?.[1]!=null&&r.transferDetailLocalData.amount.amount>a.zeniAccountsConfigDetail.depositProductConfig.depositProducts[0].range[1]),m(et(x))},onDismissClick:I,onSaveChangesToLocalStore:f=>{m(Kn(f))},onAnotherTransferClick:()=>{C(!1),m(Re())},currentTenant:d,zeniAccountsConfigDetail:a,currentDrawerContent:i,setCurrentDrawerContent:l,showReviewContent:h,setShowReviewContent:C,onBackClick:()=>{},maxInsuredAmount:D.maxInsuredAmount})})})]})},sa=L(K)`
|
|
38
|
+
display: flex;
|
|
39
|
+
min-height: 100%;
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
`,ra=L.div`
|
|
42
|
+
display: flex;
|
|
43
|
+
min-height: 100%;
|
|
44
|
+
width: 100%;
|
|
45
|
+
flex: 1 1 auto;
|
|
46
|
+
flex-direction: column;
|
|
47
|
+
align-items: center;
|
|
48
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
49
|
+
`,ia=Q(function(e,t){return{zeniAccountListView:qe(e),isExpressPayEnabled:t.isExpressPayEnabled,analytics:t.analytics}},function(e,t){const{navigate:s,currentTenant:o,location:a,companyId:r,handleDrawerToggle:d,analytics:c,isBillPayEnabled:p,isDebitCardFeatureEnabled:m}=t,{tenantEmailDomain:x}=o;return{onZeniAccountClick:(i,l)=>{c.trackAccountsListPageClicked("Accounts Row Item Click",l,"active");const h=ca(x,i),C=ee(a.state?.pathnameStackToGoBack,a.pathname);s(h,{state:{pathnameStackToGoBack:C}})},onSettingsClick:()=>{c.trackAccountsListPageClicked("Settings Icon"),s("setup")},onReloadTransactions:()=>{e(Xe(!1))},handleMoveMoneyOptionSelection:(i,l)=>{let h="page-not-found";i==="sendMoney"&&(h=mn(x)),i==="payBill"?h=dn(o,p,m):i==="transfer"?(h=un(x),l!=null&&e(en(l))):i==="checkDeposit"&&(h=pn(x));const C=ee(a.state?.pathnameStackToGoBack,a.pathname);s(h,{state:{pathnameStackToGoBack:C}})},unlinkPaymentAccount:(i,l)=>{c.trackAccountsListPageClicked("Unlink Account",l),e(it(i))},onFetchLinkTokenClick:(i,l)=>{e(Qe("external_account",i,l))},onUpdatePaymentAccountStatus:(i,l,h)=>{e(rt(i,l,"zeni_accounts","external_account",h))},onEstablishConnectionClick:i=>{e(Je(i,r,"external_account",void 0,"link_external_account"))},onCreateCheckingClick:i=>{e(st(i))},onClickMenuIcon:()=>{d(!0)},onTreasuryGetStartedClick:()=>{s("../../treasury/promo")},onAutoTransferClick:i=>{i?s("./auto-transfer",{state:{...a.state,scrollToAddRule:!0}}):s("./auto-transfer")}}})(vt);function xe({isTransferDrawerOpen:e,isCheckDepositDrawerOpen:t}){const s=J(),o=Y(),a=z(),r=_(),{tenantEmailDomain:d}=Z(),{useDynamicConfig:c,useFeatureGate:p}=V(),m=N(),{configValue:x}=c(W.zeniAccountsConfig),{isFeatureEnabled:i}=p(B.isTreasuryEnabled),{isFeatureEnabled:l}=p(B.isDebitCardFeatureEnabled),{isFeatureEnabled:h}=p(B.isAutoTransferRuleEnabled),{isFeatureEnabled:C}=p(B.isCheckingCommentingEnabled),b=we(x),g=w(O=>M(O)),D=g.companyId??A.getSignedInUserTenant(d)?.companyId,{configValue:I}=c(W.expressPayConfig),f=I.is_enable_all_tenants===!0||I.tenant_ids!=null&&I.tenant_ids.includes(g.tenantId),[S,F]=u.useState(!1),[U,P]=u.useState(!1),[E,v]=u.useState(!1),[T,j]=u.useState(!1),y=w(O=>qe(O)),$=y.fetchState,oe=w(O=>Ce(O)),se=oe?.fetchState??"Not-Started",me=!!g.companyZeniAccountInfo?.info?.isZeniAccountEnabled,G=ae(),H=!!g.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted,hn=!!g.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,gn=te(G?.loggedInUserRoleMap),fn=De(G?.loggedInUserRoleMap),yn=!!g.companyBillPayInfo?.info?.isBillPayEnabled,ve=A.getSignedInUser(),xn={userId:ve?.userId??"",sessionId:ve?.zeniSessionId??"",tenantId:g.tenantId??""},Cn=`${Ie}/account_details`,{areTenantIdsInSync:Ee}=St();u.useEffect(()=>{!S&&Ee&&(F(!0),a(Xe(!1)))},[S,a,$,Ee]),u.useEffect(()=>{!U&&se==="Not-Started"&&D&&(P(!0),a(ke(!0)))},[U,se,D,a]),u.useEffect(()=>{e!=null&&e===!0?v(!0):(v(!1),document.body.style.overflow="auto")},[e]),u.useEffect(()=>{j(t!=null&&t===!0)},[t]);const je=()=>{v(!1),o("..")},[kn,wn]=u.useState(!1),Pe=O=>{wn(O)},{isAiCfoAccessEnabled:Dn,onAskAiCfoClick:An}=sn({mobileExploreReferrer:"Checking Accounts"});rn({isDataReady:$==="Completed"});const In=g.company!=null&&Ze(g.company),he=(i&&In)===!0&&!hn,[Sn,bn]=u.useState(!1),ge=w(O=>O.treasurySetupViewState.treasuryFundsDetails),vn=ge.fundsDetails,En=bt(vn);u.useEffect(()=>{he!==!0||Sn||ge?.fetchStatus.fetchState!=="Not-Started"||(bn(!0),a(ot()))},[ge.fetchStatus,a]);const jn=Ke(g),Pn=Ae(l,g);return jn===!0&&Pn!==!0?n.jsx(on,{}):me?n.jsxs(n.Fragment,{children:[y.fetchState==="Completed"&&E===!1&&T===!1?n.jsx(ue,{analytics:R,onLoad:O=>(Te=>{Te.trackAccountsListPageViewed(y.depositAccountsSelectorView.depositAccounts.length,y.externalAccountsSelectorView.paymentAccounts.length,ze(y.summary?.totalBalance.available.amount??0),ze(y.summary?.totalInterest.available.amount??0),y.zeniAccountsConfig.zeniAccountsConfigDetail.annualPercentageYield),he&&Te.trackTreasuryPromoView("Checking Promo Banner")})(O)}):null,E===!0?n.jsx(ln,{closeDrawerHandler:je,isTransferDrawerOpen:E,zeniAccountsConfig:y.zeniAccountsConfig,authParams:xn,downloadAccountDetailEndPoint:Cn}):null,T===!0?n.jsx(cn,{closeDrawerHandler:je,isCheckDepositDrawerOpen:T}):null,n.jsxs(ra,{windowSize:r,children:[n.jsx(pe,{isAppContentDrawerOpen:kn,handleDrawerToggle:Pe}),n.jsx(ia,{zeniBankListView:y,navigate:o,currentTenant:g,location:s,companyId:D,analytics:R,maxInsuredAmount:b.maxInsuredAmount,isExpressPayEnabled:f,isBillPayEnabled:yn,isCheckingCommentingEnabled:C,isDebitCardFeatureEnabled:l,isAutoTransferRuleEnabled:h,handleDrawerToggle:Pe,showTreasuryPromo:he,treasuryYieldPercentage:En,treasuryInsuredAmount:5e5,isAiCfoAccessEnabled:Dn,onAskAiCfoClick:An})]})]}):H&&gn?n.jsx(ne,{to:"../setup"}):g.companyZeniAccountInfo?.info&&!H&&fn?n.jsx(ne,{to:"../promo",state:s.state}):n.jsx(de,{fetchState:"In-Progress",style:{backgroundColor:m.colors.grey5}})}const dn=(e,t,s)=>{const o=Ae(s,e),{tenantEmailDomain:a}=e;return o===!0||t===!1?`/${a}/bills`:`/${a}/bill/new`},ca=(e,t)=>`/${e}/checking/${t}`,un=(e,t)=>t==null?`/${e}/checking/transfer`:`/${e}/checking/${t}/transfer`,pn=(e,t)=>t==null?`/${e}/checking/check-deposit`:`/${e}/checking/${t}/check-deposit`,mn=e=>`/${e}/checking/express-pay`,la=L.div`
|
|
50
|
+
display: flex;
|
|
51
|
+
width: 100%;
|
|
52
|
+
flex: 1 1 auto;
|
|
53
|
+
flex-direction: column;
|
|
54
|
+
align-items: center;
|
|
55
|
+
min-height: 100vh;
|
|
56
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
57
|
+
`,da=Q(function(e,t){const{currentTenant:s}=t,o=nn(e,t.accountId),a=A.getSignedInUser(),r=e.tenantState.currentTenantId,d={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:r??""},c=o.accountDetail?.id??"";return{currentTenantCompanyName:s.companyName??"",authParams:d,downloadEndPoint:`${Se.bankingMicroServiceBaseUrl}/1.0/deposit-accounts/${c}`,zeniAccountDetail:o,isExpressPayEnabled:t.isExpressPayEnabled,fetchState:o.fetchState}},function(e,t){const{navigate:s,currentTenant:o,location:a,accountId:r}=t,{tenantEmailDomain:d}=o;return{handleMoveMoneyOptionSelection:(c,p)=>{let m="page-not-found";c==="sendMoney"?m=mn(d):c==="payBill"?m=dn(o,t.isBillPayEnabled,t.isDebitCardFeatureEnabled):c==="transfer"?(m=un(d,r),p!=null&&e(en(p))):c==="checkDeposit"?(m=pn(d,r),p!=null&&e(ct(p))):c==="accountStatement"&&(m=ma(d,r));const x=ee(a.state?.pathnameStackToGoBack,a.pathname);s(m,{state:{pathnameStackToGoBack:x}})},onViewAllTransactionClick:()=>{const c=pa(d,r),p=ee(a.state?.pathnameStackToGoBack,a.pathname);s(c,{state:{pathnameStackToGoBack:p}})},onAccountDetailClick:()=>{const c=ua(d,r),p=ee(a.state?.pathnameStackToGoBack,a.pathname);s(c,{state:{pathnameStackToGoBack:p}})},onEditNameClick:c=>{e(Le(r,"editName",c))},onReloadZeniAccountDetailPage:()=>{e(tn(r,!1))},onCloseAccountClick:()=>{e(Le(r,"closeAccount",""))},onBackClick:()=>{s("../",{relative:"path"})}}})(Et);function ie({isTransferDrawerOpen:e,isCheckDepositDrawerOpen:t,isAccountInfoDrawerOpen:s}){const o=J(),a=Y(),r=z(),d=_(),{tenantEmailDomain:c,accountId:p}=Z(),{useDynamicConfig:m}=V(),{useFeatureGate:x}=V(),{isFeatureEnabled:i}=x(B.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=x(B.isCheckingCommentingEnabled),h=w(H=>M(H)),{configValue:C}=m(W.expressPayConfig),b=C.is_enable_all_tenants===!0||C.tenant_ids!=null&&C.tenant_ids.includes(h.tenantId),g=!!h.companyBillPayInfo?.info?.isBillPayEnabled,D=A.getSignedInUser(),I=h.companyId??A.getSignedInUserTenant(c)?.companyId,f={userId:D?.userId??"",sessionId:D?.zeniSessionId??"",tenantId:h.tenantId??""},S=`${Ie}/account_details`,[F,U]=u.useState(!1),[P,E]=u.useState(!1),[v,T]=u.useState(!1),[j,y]=u.useState(!1),$=w(H=>nn(H,p??"")),oe=$.fetchState,{isAiCfoAccessEnabled:se,onAskAiCfoClick:me}=sn({mobileExploreReferrer:"Checking Account Detail"});rn({isDataReady:oe==="Completed"}),u.useEffect(()=>{F||(r(tn(p??"",!1)),U(!0))},[F,r,oe]),u.useEffect(()=>{y(s!=null&&s===!0)},[s]),u.useEffect(()=>{e!=null&&e===!0?E(!0):(E(!1),document.body.style.overflow="auto")},[e]),u.useEffect(()=>{T(t!=null&&t===!0)},[t]);const G=()=>{y(!1),a("..")};return n.jsxs(n.Fragment,{children:[j===!0&&$.accountDetail!=null?n.jsx(Kt,{authParams:f,downloadAccountDetailEndPoint:S,closeDrawerHandler:G,isAccountInfoDrawerOpen:j,zeniBankAccountDetail:$.accountDetail}):null,P===!0?n.jsx(ln,{closeDrawerHandler:G,isTransferDrawerOpen:P,zeniAccountsConfig:$.zeniAccountsConfig,authParams:f,downloadAccountDetailEndPoint:S}):null,v===!0?n.jsx(cn,{closeDrawerHandler:G,isCheckDepositDrawerOpen:v}):null,n.jsx(la,{windowSize:d,children:n.jsx(da,{navigate:a,currentTenant:h,location:o,companyId:I,isDebitCardFeatureEnabled:i,accountId:p??"",isBillPayEnabled:g,isCheckingCommentingEnabled:l,isExpressPayEnabled:b,isAiCfoAccessEnabled:se,onAskAiCfoClick:me})})]})}const ua=(e,t)=>`/${e}/checking/${t}/account-info`,pa=(e,t)=>`/${e}/checking/${t}/transactions`,ma=(e,t)=>`/${e}/checking/${t}/statements`,ha=L.div`
|
|
58
|
+
display: flex;
|
|
59
|
+
height: 100vh;
|
|
60
|
+
width: 100%;
|
|
61
|
+
flex: 1 1 auto;
|
|
62
|
+
flex-direction: column;
|
|
63
|
+
overflow: auto;
|
|
64
|
+
align-items: center;
|
|
65
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
66
|
+
`;function ga(){const e=Y(),t=z(),s=_(),{accountId:o}=Z(),{useFeatureGate:a}=V(),{isFeatureEnabled:r}=a(B.isCheckingCommentingEnabled),[d,c]=u.useState(!1);u.useEffect(()=>{d||(c(!0),t(lt(o??"",!1)))},[d,t]);const p=w(m=>dt(m,o??""));if(A.getSignedInUser()==null)throw Error("Can't access address page without signing in...");return n.jsx(ha,{windowSize:s,children:n.jsx(jt,{transactionListView:p,depositAccountId:o??"",isCheckingCommentingEnabled:r,onBackClick:()=>{e("../")}})})}const fa=Q(function(e,t){const{companyId:s}=t;return{zeniAccountSetupView:ut(e,s),meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true"}},function(e,t){const{navigate:s,companyId:o}=t;return{onSetupButtonClick:()=>{R.trackAccountsPromoPageClicked("Setup Accounts"),e(pt(o))},onBackClick:()=>{s("../..",{relative:"path"})},onSetupZeniAccountSuccess:()=>{s("../setup",{relative:"path"})}}})(Tt),ya=()=>{const e=Y(),t=J(),{tenantEmailDomain:s}=Z(),{useDynamicConfig:o}=V(),a=N(),[r,d]=u.useState(!1),[c,p]=u.useState(!1),m=w(f=>M(f)),{configValue:x}=o(W.zeniAccountsConfig),i=we(x);u.useEffect(()=>{c===!1&&t.state?.message==="activation"&&p(!0)},[t.state]);const l=A.getSignedInUserTenant(s)?.companyId??m.companyId,h=A.getSignedInUser(),C=!!m.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted,b=f=>{d(f)};if(h==null)throw Error("Can't access Zeni account promo page without signing in...");const g=ae(),D=te(g?.loggedInUserRoleMap),I=De(g?.loggedInUserRoleMap);if(C&&D)return n.jsx(ne,{to:"../../checking/setup"});if(m.company?.companyZeniAccountInfo&&(!C&&D||I)){if(t.state?.message==="activation"){const f=an(t.state?.pathnameStackToGoBack);e(t.pathname,{state:{...t.state,message:void 0,pathnameStackToGoBack:f.newStack}})}return n.jsxs(n.Fragment,{children:[n.jsx(Pt,{showConfetti:c}),n.jsx(ue,{analytics:R,onLoad:f=>(S=>S.trackPageLoaded(be.Event.accountsPromoPageViewed))(f)}),n.jsx(pe,{isAppContentDrawerOpen:r,handleDrawerToggle:b}),n.jsx(fa,{analytics:R,navigate:e,companyId:l,onClickMenuIcon:()=>{b(!0)},maxAnnualPercentageYield:i.maxAnnualPercentageYield,maxInsuredAmount:i.maxInsuredAmount,exampleBankBalance:3e6})]})}return n.jsx(de,{fetchState:"In-Progress",style:{backgroundColor:a.colors.grey5}})};function Ha(){const e=J(),t=w(j=>M(j)),s=N(),{useFeatureGate:o,useDynamicConfig:a}=V(),r=ae(),d=te(r?.loggedInUserRoleMap),c=De(r?.loggedInUserRoleMap),p=!!t.company?.companyZeniAccountInfo.isZeniAccountEnabled,m=!!t.company?.companyZeniAccountInfo.isZeniAccountTOSAccepted,{isFeatureEnabled:x}=o(B.isChargeCardFeatureEnabled),{isFeatureEnabled:i}=o(B.isDebitCardFeatureEnabled),l=Ke(t),h=Ae(i,t),C=t?.userRole!=null&&mt(t?.userRole),b=(t?.company==null||t.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!C)&&ht(r?.loggedInUserRoleMap),g=gt(r?.loggedInUserRoleMap),D=(t?.company==null||t.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!C)&&ft(r?.loggedInUserRoleMap),{isFeatureEnabled:I}=o(B.isDepositAccountsFeatureEnabled),f=I&&!C,{configValue:S}=a(W.expressPayConfig),F=S.is_enable_all_tenants===!0||S.tenant_ids!=null&&S.tenant_ids.includes(t.tenantId),{isFeatureEnabled:U}=o(B.isAutoTransferRuleEnabled),P=Bt(t,x,i)&&!C&&yt(r?.loggedInUserRoleMap),E=xt(r?.loggedInUserRoleMap),v=f&&te(r?.loggedInUserRoleMap),T=v||$e(r?.loggedInUserRoleMap);return n.jsxs(_e,{children:[n.jsx(k,{path:"setup",element:n.jsx(Me,{isBillPayAdminLevelAccess:b,isUserHasOnlyBillPayAccess:g,isReimbursementAdminLevelAccess:D,isZeniAccountAdminLevelAccess:v,isChargeCardAdminLevelAccess:P,isUserHasOnlyCardAccess:E,productType:"zeni_accounts",type:"setup"})}),n.jsx(k,{path:"verification",element:n.jsx(Me,{isBillPayAdminLevelAccess:b,isUserHasOnlyBillPayAccess:g,isReimbursementAdminLevelAccess:D,isZeniAccountAdminLevelAccess:v,isChargeCardAdminLevelAccess:P,isUserHasOnlyCardAccess:E,productType:"zeni_accounts",type:"verification"})}),U?n.jsxs(n.Fragment,{children:[n.jsx(k,{path:"auto-transfer",element:n.jsx(Ne,{})}),T?n.jsx(k,{path:"auto-transfer/:ruleId/edit",element:n.jsx(Ne,{isEditDrawerOpen:!0})}):null]}):n.jsx(k,{path:"auto-transfer",element:n.jsx(ce,{})}),F&&d?n.jsxs(n.Fragment,{children:[n.jsx(k,{path:"express-pay",element:n.jsx(re,{})}),n.jsx(k,{path:"express-pay/add-ach",element:n.jsx(re,{isAddACHDrawerOpen:!0})}),n.jsx(k,{path:"express-pay/add-wire/add-address",element:n.jsx(re,{isAddAddressDrawerOpen:!0})}),n.jsx(k,{path:"express-pay/add-wire",element:n.jsx(re,{isAddWireDrawerOpen:!0})})]}):n.jsx(k,{path:"express-pay",element:n.jsx(ce,{})}),n.jsx(k,{path:"promo",element:n.jsx(ya,{})}),l&&!h?n.jsx(k,{path:"/*",element:n.jsx(on,{})}):p?n.jsxs(n.Fragment,{children:[n.jsx(k,{path:"/",element:n.jsx(xe,{})}),n.jsx(k,{path:"transfer",element:n.jsx(xe,{isTransferDrawerOpen:!0})}),n.jsx(k,{path:"check-deposit",element:n.jsx(xe,{isCheckDepositDrawerOpen:!0})}),n.jsx(k,{path:":accountId/*",element:n.jsx(xa,{})}),n.jsx(k,{path:"*",element:n.jsx(ce,{})})]}):m&&d?n.jsx(k,{path:"*",element:n.jsx(ne,{to:"../setup"})}):t.company?.companyZeniAccountInfo&&c?n.jsx(k,{path:"*",element:n.jsx(ne,{to:"../promo",state:e.state})}):n.jsx(k,{path:"*",element:n.jsx(de,{fetchState:"In-Progress",style:{backgroundColor:s.colors.grey5,boxShadow:`0px 2px ${Ft.sp1} ${s.colors.dropShadowNormal}`}})})]})}function xa(){return n.jsxs(_e,{children:[n.jsx(k,{path:"/",element:n.jsx(ie,{})}),n.jsx(k,{path:"account-info",element:n.jsx(ie,{isAccountInfoDrawerOpen:!0})}),n.jsx(k,{path:"transfer",element:n.jsx(ie,{isTransferDrawerOpen:!0})}),n.jsx(k,{path:"check-deposit",element:n.jsx(ie,{isCheckDepositDrawerOpen:!0})}),n.jsx(k,{path:"transactions",element:n.jsx(ga,{})}),n.jsx(k,{path:"statements",element:n.jsx(zt,{})}),n.jsx(k,{path:"*",element:n.jsx(ce,{})})]})}export{Ha as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{j as i}from"./liveblocks-BFnsX8B0.js";import{a as u}from"./sentry-BReBlZug.js";import{j as x,h as C,u as N,l as $,g as p}from"./core-kd_mEvMc.js";import{HD as s,HC as j,NJ as v,eN as B,NK as D}from"./zeni-epic-state-B5rZ-c32.js";import{q as T,ap as g,h as z,z as E,w as L,b_ as P,r as _}from"./index-DzAxH0sX.js";import{n as U}from"./mui-HcBIKYw3.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="01f7909a-c7f9-483b-a2cd-6410b3bdbcd0",e._sentryDebugIdIdentifier="sentry-dbid-01f7909a-c7f9-483b-a2cd-6410b3bdbcd0")}catch{}})();const G=U.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
height: 100vh;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
+
`;function V(){const e=x(),n=C(),d=T(),l=N();let{accountId:a}=$(),f=`${g.bankingMicroServiceBaseUrl}/1.0/deposit-accounts/${a}`;a==null&&l.pathname.includes(`${s}/statements`)&&(a=s,f=`${g.bankingMicroServiceBaseUrl}/1.0/${s}`);const[m,b]=u.useState(!1),h=z();u.useEffect(()=>{m||(b(!0),n(j(a??"",!1)))},[m,n]);const o=p(t=>v(t,a??"")),y=()=>{const t=_(l.state?.pathnameStackToGoBack),S=t.poppedPathname??"..";e(S,{state:{pathnameStackToGoBack:t.newStack}})},c=E.getSignedInUser(),r=p(t=>B(t)),I={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:r.tenantId??""},w=D(a??"")===!0?s:o.zeniAccountDetail?.accountLast4??"",k=r.company?.companyInfo.companyLegalName??r.companyName;if(c==null)throw Error("Can't access address page without signing in...");return o.fetchState!=="Completed"?i.jsx(L,{fetchState:"In-Progress",style:{backgroundColor:h.colors.grey5}}):i.jsx(G,{windowSize:d,children:i.jsx(P,{currentTenantCompanyName:k,statementListView:o,accountLast4:w,onBackClick:y,authParams:I,downloadEndPoint:f})})}export{V as Z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./sentry-
|
|
1
|
+
import"./sentry-BReBlZug.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]="aeade864-8999-4b65-a5fe-284d93c9cae4",e._sentryDebugIdIdentifier="sentry-dbid-aeade864-8999-4b65-a5fe-284d93c9cae4")}catch{}})();function d(e,t){if(t!=null)return e.find(n=>n.qboId===t)}function i(e,t){return e.filter(n=>n.qboId!=null&&t.includes(n.qboId))}function a(e,t){return t.map(n=>({accountId:d(e,n.accountId.selectedOption)?.accountId??"",expenseType:n.expenseType.selectedOption??"",type1099:n.type1099.selectedOption??"",boxType:n.boxType.selectedOption??""}))}export{d as a,i as g,a as m};
|