@zeniai/web-app-ui 5.2.14-dev → 5.2.15-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AddressRoutes-DKny58NT.js +1 -0
- package/dist/assets/AddressScreen-BVRFr_N1.js +9 -0
- package/dist/assets/{AiCfoScreen-Bq9qNM-U.js → AiCfoScreen-BN4QIEgB.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-Cgsqt2XF.js → BillPayApprovalRoutes-B_4hJ2pr.js} +1 -1
- package/dist/assets/{BillPayRoutes-D8ICOArG.js → BillPayRoutes-BJZymqmE.js} +1 -1
- package/dist/assets/{BusinessVerificationPageScreen-DlMhX3L_.js → BusinessVerificationPageScreen-DrCLmIxZ.js} +2 -2
- package/dist/assets/{CardsAiCfoScreen-evFd6UUn.js → CardsAiCfoScreen-Inv396bE.js} +3 -3
- package/dist/assets/{ChargeCardRoutes-czvHDNab.js → ChargeCardRoutes-DGEKzyzO.js} +10 -10
- package/dist/assets/CompanyPassportScreen-BsHZnsQV.js +1 -0
- package/dist/assets/{ConnectionAuthScreen-VR4MFOhW.js → ConnectionAuthScreen-CA8kXAT-.js} +1 -1
- package/dist/assets/CustomerOnboardingAuthScreen-DhhSBraP.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-CeoeigLq.js → CustomerOnboardingRoutes-Xm_O4AxR.js} +5 -5
- package/dist/assets/{DashboardRoutes-522JIWbO.js → DashboardRoutes-BsVesrb3.js} +1 -1
- package/dist/assets/{DefaultTenantHome-CBA28Llo.js → DefaultTenantHome-CrZNGTHj.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-C-1bKP7r.js → DomesticWireDetailScreen-C7-Ze-bQ.js} +3 -3
- package/dist/assets/{DrawerScreen-DAMt3OKh.js → DrawerScreen-D8laOuUr.js} +1 -1
- package/dist/assets/EntityDetailRoutes-BH66r_ba.js +1 -0
- package/dist/assets/{ExpenseAutomationRoutes-DcYqfqSi.js → ExpenseAutomationRoutes-NkkbpV7S.js} +1 -1
- package/dist/assets/FeaturePreviewScreen-BKSMrhrm.js +1 -0
- package/dist/assets/{HubSpotOAuthCallbackScreen-LTrYsA2J.js → HubSpotOAuthCallbackScreen-BpsDDDwu.js} +1 -1
- package/dist/assets/MagicLinkRoutes-pFkPSCAf.js +72 -0
- package/dist/assets/{MagicLinkSignInScreen-CC54CnuQ.js → MagicLinkSignInScreen-DJG_XhkF.js} +1 -1
- package/dist/assets/MobileAppDrawer-D_5ajcgl.js +1 -0
- package/dist/assets/NotFoundScreen-vodaR6J5.js +1 -0
- package/dist/assets/{NotificationRoutes-CLLE6idd.js → NotificationRoutes-b1ATX3hL.js} +1 -1
- package/dist/assets/{OAuthConsentScreen-D4soKi0X.js → OAuthConsentScreen-DTjj0EZW.js} +1 -1
- package/dist/assets/{PandLWithForecastRoutes-CLOwX80d.js → PandLWithForecastRoutes-BVouxwOp.js} +1 -1
- package/dist/assets/{PeopleRoutes-RKPAQcdN.js → PeopleRoutes-BB0mptER.js} +3 -3
- package/dist/assets/PerformanceRoutes-BSGtqYip.js +1 -0
- package/dist/assets/{Preview-Crb4CpIB.js → Preview-Q7E6grqg.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-Doubr8Lv.js → QBOConnectionScreen-CYvG88ne.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRoutes-CuXrRY6O.js → ReimbursementApprovalRoutes-CIZnVB8w.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-CxT_ZU1Q.js → ReimbursementApprovalRuleDetailScreen-Bj2gRsYN.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-B9v1csuM.js → ReimbursementRoutes-D8GfsHFS.js} +1 -1
- package/dist/assets/{ReportsRoutes-CYYBopNx.js → ReportsRoutes-DYUuIrA9.js} +1 -1
- package/dist/assets/RewardsRoutes-CESh4LSy.js +1 -0
- package/dist/assets/{ScreenRoutes-3ZRh9969.js → ScreenRoutes-DeIZgGFA.js} +2 -2
- package/dist/assets/{SettingsRoutes-CLHJHv6D.js → SettingsRoutes-BS_91kvY.js} +1 -1
- package/dist/assets/{SetupPagesScreen-D-KjoZ4s.js → SetupPagesScreen-Du6z7K4L.js} +5 -5
- package/dist/assets/{SignInScreen-DzUQQLWX.js → SignInScreen-DGJIVFjs.js} +1 -1
- package/dist/assets/SignOutScreen-B4fw6lrq.js +9 -0
- package/dist/assets/{TaskListScreen-D1GJ72DV.js → TaskListScreen-C1GpDMh9.js} +2 -2
- package/dist/assets/TaskRoutes-Bn-Ea5LE.js +9 -0
- package/dist/assets/{TransactionDetailRoutes-NBFzTv3J.js → TransactionDetailRoutes-DM262XtJ.js} +1 -1
- package/dist/assets/{TransactionDetailScreen-BXByY28g.js → TransactionDetailScreen-tCFIjsQZ.js} +2 -2
- package/dist/assets/{TransactionListRoutes-ClVpGZj3.js → TransactionListRoutes-q01ai3C8.js} +1 -1
- package/dist/assets/{TreasuryRoutes-CmxZydJL.js → TreasuryRoutes-C4C9GZ84.js} +4 -4
- package/dist/assets/{VendorsRoutes-caL_MoH5.js → VendorsRoutes-5HmjTAo1.js} +13 -13
- package/dist/assets/WiseConfirmationScreen-Cf2wKH5p.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-3mgFL_9o.js → ZeniAccountRoutes-DjosaDA2.js} +1 -1
- package/dist/assets/ZeniAccountStatementScreen-BBJfP9Ky.js +9 -0
- package/dist/assets/{accountMappingHelper-B0l8lAeR.js → accountMappingHelper-C5WHpsgJ.js} +1 -1
- package/dist/assets/{analytics-CO5gayAE.js → analytics-D_NuuF2U.js} +1 -1
- package/dist/assets/analyticsHelper-C7Ffbo_X.js +1 -0
- package/dist/assets/{core-DrRun-Wp.js → core-Da6TLrNx.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-BqXEXApE.js → decodeURIComponentSafe-B-r3T5bV.js} +1 -1
- package/dist/assets/{dnd-C7lg2kUY.js → dnd-DC_qF3Wr.js} +1 -1
- package/dist/assets/{empty-CcJKsg0A.js → empty-C73kmkO9.js} +1 -1
- package/dist/assets/{empty-BxU8KR-q.js → empty-s0Z9SHTS.js} +1 -1
- package/dist/assets/{emptyVideoElement-Jmh-gus6.js → emptyVideoElement-CUd0nWeJ.js} +1 -1
- package/dist/assets/{epic-CkW-Ur48.js → epic-DAjg0wXj.js} +1 -1
- package/dist/assets/getLocaleForTenant-CnNopwIO.js +1 -0
- package/dist/assets/{index-CdzL9szH.js → index-Bwczg7nO.js} +10593 -10593
- package/dist/assets/{index-T7IByhHr.js → index-COd9LNlP.js} +1 -1
- package/dist/assets/{index-2hIX2kLH.js → index-CWFrIv4j.js} +1 -1
- package/dist/assets/{index-DdvKvtaE.js → index-CsQZjvif.js} +1 -1
- package/dist/assets/{index-cnTKKS-Z.js → index-DAI9X2Zp.js} +2 -2
- package/dist/assets/{index-BJ6_cpY3.js → index-DykhB8j2.js} +1 -1
- package/dist/assets/{index-4Tf9Bt0i.js → index-XC9zB3-f.js} +1 -1
- package/dist/assets/{index-CfbU7SR1.js → index-b_fXiiPC.js} +1 -1
- package/dist/assets/{lexical-Cceo9d8G.js → lexical-CQoPutFC.js} +1 -1
- package/dist/assets/{liveblocks-0jcT8Dx_.js → liveblocks-C8AAaKDR.js} +1 -1
- package/dist/assets/{lottie-C4eBAM7n.js → lottie-B7_cpoe1.js} +1 -1
- package/dist/assets/{mui-BCzMCgwZ.js → mui-CosLSKUu.js} +1 -1
- package/dist/assets/{pathToGoBack-aFGIF63I.js → pathToGoBack-C_jELk-6.js} +1 -1
- package/dist/assets/{pdf-C1ioMmzA.js → pdf-CQB-J2hc.js} +3 -3
- package/dist/assets/{pdf-lib-gor9sGMc.js → pdf-lib-CscVz5ta.js} +1 -1
- package/dist/assets/{plaid-B0k6aBM1.js → plaid-2mv_ck83.js} +1 -1
- package/dist/assets/{pusher-CnlBFFea.js → pusher-DrRS7JyV.js} +1 -1
- package/dist/assets/{react-COTuHHMD.js → react-B42V2lQZ.js} +1 -1
- package/dist/assets/{react-CPmZ-IlI.js → react-B7r6-bpj.js} +1 -1
- package/dist/assets/{react-CeH9yclr.js → react-BmvpxDDj.js} +1 -1
- package/dist/assets/{react-C6dV2Ihe.js → react-C6MFx27g.js} +1 -1
- package/dist/assets/{react-CbFHkYXj.js → react-DJflHsBg.js} +1 -1
- package/dist/assets/{react-5qcvQnQi.js → react-DTDSsBUn.js} +1 -1
- package/dist/assets/{recharts-BJColP3b.js → recharts-9jMEgSjc.js} +1 -1
- package/dist/assets/{routePaths-CHhQNN3M.js → routePaths-Kh8F22Sq.js} +1 -1
- package/dist/assets/{sentry-Cix5j_Oe.js → sentry-DfheywaX.js} +1 -1
- package/dist/assets/{url-C58jRUwt.js → url-C-T2kMoW.js} +1 -1
- package/dist/assets/{url-C5XmMoE_.js → url-HWxh2lX9.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-rxliwAgH.js → useAiCfoDashboardSuggestedQuestionsChips-Dn_pRt3Y.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-vhjzTbBd.js +1 -0
- package/dist/assets/{useCashManagementBanner-BT0je4k3.js → useCashManagementBanner-DwoCHz3u.js} +1 -1
- package/dist/assets/{useChargeCardPusherEvents-BbwX5V1a.js → useChargeCardPusherEvents-B9JTMflJ.js} +1 -1
- package/dist/assets/{useDeviceId-34Upzybn.js → useDeviceId-COe_GzcU.js} +1 -1
- package/dist/assets/{useEmailConnectResultRefresh-BeuZj6XY.js → useEmailConnectResultRefresh-D4OTnNkO.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-E7aaQNIx.js → useInitialThreadRequest-CRJnx1_Z.js} +1 -1
- package/dist/assets/{utils-CvfvTDv6.js → utils-BykfwIo5.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-B_GhVWS9.js → withTransactionSidePanel-ZJmA3F8P.js} +2 -2
- package/dist/assets/{zeni-epic-state-D1OApLJ3.js → zeni-epic-state-BqRlfhza.js} +5 -5
- package/dist/index.html +1 -1
- package/package.json +3 -3
- package/dist/assets/AddressRoutes-C5ICjwhT.js +0 -1
- package/dist/assets/AddressScreen-DqXE5RDJ.js +0 -9
- package/dist/assets/CompanyPassportScreen-CzLA5zCy.js +0 -1
- package/dist/assets/CustomerOnboardingAuthScreen-B7Anpyxh.js +0 -1
- package/dist/assets/EntityDetailRoutes-CGG59Jmf.js +0 -1
- package/dist/assets/FeaturePreviewScreen-IYXzvJjG.js +0 -1
- package/dist/assets/MagicLinkRoutes-DzdDjge4.js +0 -72
- package/dist/assets/MobileAppDrawer-7KFASJmR.js +0 -1
- package/dist/assets/NotFoundScreen-1FWTFg5q.js +0 -1
- package/dist/assets/PerformanceRoutes-BL-ag8V3.js +0 -1
- package/dist/assets/RewardsRoutes-DQ-aEUje.js +0 -1
- package/dist/assets/SignOutScreen-CrFXavCN.js +0 -9
- package/dist/assets/TaskRoutes-BShsttwI.js +0 -9
- package/dist/assets/WiseConfirmationScreen-C_2P8pKj.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-B27kJkJn.js +0 -9
- package/dist/assets/analyticsHelper-BaOtwD25.js +0 -1
- package/dist/assets/getLocaleForTenant-C5iVY_JU.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-fe0P1a5j.js +0 -1
package/dist/assets/{TransactionDetailScreen-BXByY28g.js → TransactionDetailScreen-tCFIjsQZ.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{j as
|
|
1
|
+
import{j as x}from"./liveblocks-C8AAaKDR.js";import{a as i}from"./sentry-DfheywaX.js";import{u as W,k as Ye,j as S,s as fe,g as ge,h as Te,i as be,N as Qe,n as Xe}from"./core-Da6TLrNx.js";import{nX as he,eZ as Q,gt as Ze,OD as et,n8 as tt,mS as at,bn as nt,cW as Ee,bs as Ie,rw as H,NC as J,OE as ve,OF as oe,O0 as De,kR as Ce,OG as ke,O5 as se,O6 as ce,lG as Ae,Kx as ie,Nw as $,kL as Oe,kJ as Ue,kV as ot,nK as st,OH as ct,OI as it,vM as Y,kQ as xe,JS as we,cj as rt,c_ as lt,OJ as dt,Nv as ut,OK as mt,vI as pt,OL as ft,OM as ht,ON as yt,OO as St,OP as gt,kU as Tt,OQ as bt,OR as Et,Nx as It,OS as vt,OT as Dt,OU as Ct,JM as kt,JC as At,J$ as Ot,kW as Ut,Ky as ye,nP as xt}from"./zeni-epic-state-BqRlfhza.js";import{A as q,c as w,z as Pe,aS as _e,y as wt,J as Pt,aT as _t,H as Ft,r as ae,d as Vt,aU as Bt,v as ne,a0 as Lt,aV as Rt,e as Fe,aW as Nt,au as zt,a4 as te}from"./index-Bwczg7nO.js";import{n as Gt,S as jt,D as Mt}from"./mui-CosLSKUu.js";import{u as $t}from"./useAskAiCfoHostNavButtonProps-vhjzTbBd.js";import{d as Ve}from"./decodeURIComponentSafe-B-r3T5bV.js";import{h as Be,c as Le,g as Wt,e as Ht}from"./routePaths-Kh8F22Sq.js";import{u as Jt}from"./utils-BykfwIo5.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="08aaefbf-fe08-4665-b828-1ce40b2a7e38",t._sentryDebugIdIdentifier="sentry-dbid-08aaefbf-fe08-4665-b828-1ce40b2a7e38")}catch{}})();function qt(t=!0){const e=W(),s=Ye(),{useFeatureGate:a}=q(),{isFeatureEnabled:n}=a(w.isCreateTransferEntryFromExpenseEnabled);i.useEffect((()=>{if(!t||n!==!0)return;const o=c=>{const r=s.getState().createTransferEntryState.transferAccountsByType[c].fetchState;return r!=="In-Progress"&&r!=="Completed"};o("transferEntryEligible")&&e(he({kind:"transferEntryEligible"})),o("creditCardOnlyEligible")&&e(he({kind:"creditCardOnlyEligible"}))}),[t,n,e,s])}function Kt(t,e){const s=(function(){const r=W(),[p,g]=i.useState(!1),[A,y]=i.useState(null),[m,O]=i.useState(null),{useDynamicConfig:T}=q(),{configValue:f,isDynamicConfigLoading:C}=T("transaction_categorization_config"),v=!C&&f?.capitalization_enabled===!0,k=S((h=>Q(h))),b=k.companyId,U=S((h=>Ze(h.companyState,k.companyId)?.company.companyLocaleInfo?.currencySymbol??"$")),{capitalizableAccounts:P,capitalizableAccountOverrides:B,dismissedAccounts:z}=S((h=>{const E=h.tenantState.currentTenantId,u=E!=null?h.tenantState.tenantsById[E]:void 0;return{capitalizableAccounts:u?.capitalizableAccounts??null,capitalizableAccountOverrides:u?.capitalizableAccountOverrides??null,dismissedAccounts:u?.capitalizationOnboardingDismissedAccounts??null}}),fe),G=i.useRef(P);G.current=P;const L=i.useRef(B);L.current=B;const _=i.useRef(z);_.current=z;const R=S((h=>et(h.accountState)),fe),I=i.useMemo((()=>{const h={};for(const E of R)E.accountId!=null&&E.accountName!=null&&(h[E.accountId]=E.accountName);return h}),[R]),l=m!=null?I[m]??null:null,j=i.useCallback((h=>{if(!v)return;const E=G.current;if(E==null)return;const u=E.accounts??[],M=new Set(h),X=L.current??{},K=_.current;for(const N of u)if(M.has(N.accountId)&&X[N.accountId]==null&&K?.[N.accountId]==null)return y(N.classificationType),O(N.accountId),void g(!0)}),[v]),D=i.useCallback(((h,E)=>{r(tt(b,h,E,!0)),g(!1),y(null),O(null)}),[r,b]),F=i.useCallback((()=>{m!=null&&(r(at(b,m)),g(!1),y(null),O(null))}),[r,b,m]);return{showPopup:p&&v,popupType:A,popupAccountId:m,popupAccountName:l,currencySymbol:U,checkAndShowPopup:j,handleSubmit:D,handleDismiss:F}})(),a=i.useRef(void 0),n=i.useRef([]),o=i.useRef(s.checkAndShowPopup);o.current=s.checkAndShowPopup;const c=i.useRef(e);return c.current=e,i.useEffect((()=>{t==="In-Progress"&&(n.current=c.current()),t==="Completed"&&a.current==="In-Progress"&&n.current.length>0&&(o.current(n.current),n.current=[]),a.current=t}),[t]),s}const re=()=>{const t=Pe.getSignedInUser(),{useFeatureGate:e}=q(),{isFeatureEnabled:s}=e(w.isChainOfThoughtEnabled);return i.useMemo((()=>nt(t)&&s),[t,s])};function Re(t){if(t!=null){if("customer"in t&&t.customer!=null){const{customer:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in t&&t.vendor!=null){const{vendor:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function ha(t,e){const s=W(),{useFeatureGate:a,useDynamicConfig:n}=q(),o=S((u=>Q(u))),c=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),r=o.userRole!=null&&Ee(o.userRole),p=o.userRole!=null&&Ie(o.userRole),{isFeatureEnabled:g}=a(w.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:A}=a(w.isExpenseAutomationEnabled),{configValue:y}=n(_e.enableUncategorizedExpenseCategory),m=y?.uncategorized_expense_category_enabled===!0,O=re(),T=i.useMemo((()=>({id:t,type:H(e)})),[t,e]),f=S((u=>J(u,T))),C=f?.transactionDetailUpdateStatus?.fetchState,v=f?.transactionDetailLocalData?.lineItemById,k=S((u=>{const M=J(u,T)?.transactionDetailLocalData.vendorUpdates?.id;return M==null?"Not-Started":u.transactionVendorViewState.editVendorStateById[M]?.saveStatus.fetchState??"Not-Started"})),b=i.useMemo((()=>f?.fetchState==="Completed"?Re(f?.transaction):void 0),[f?.fetchState,f?.transaction]),U=S((u=>{if(b!=null)return ve(u.customerIncomeState,u.vendorExpenseState,u.trendState,b,"month")})),P=S((u=>oe(u))),B=S((u=>{if(b!=null)return De(u.trendWithTransactionsState,b,"TransactionDetail")})),z=o.company?.companyInfo.firstMonthOfFY??1,G=S((u=>Ce(u.accountState,u.accountListState,"accountList"))),[L,_]=i.useState(!1),[R,I]=i.useState(!1),[l,j]=i.useState(!1);i.useEffect((()=>{_(!1),I(!1),j(!1)}),[t,e]);const D=i.useCallback((()=>{_(!1),I(!1)}),[]),[F,h]=i.useState(!1),E=B?.selectedPeriod?.timePeriod;return i.useEffect((()=>{l||f==null||f.transaction==null||(s(ke({id:f.transaction.id,type:f.transaction.type})),j(!0)),b!=null&&(!c||r&&p===!1)&&(L?R||U==null||(I(!0),s(ie(b,"TransactionDetail",{timeframe:"month",timePeriod:E??U}))):(s(se()),s(ce()),_(!0),s(Ae(b))))}),[s,l,f?.fetchState,f?.transaction,b,c,r,p,L,R,U,E]),i.useEffect((()=>{P.newVendorState?.vendorDetailLocalData?.vendorName!=null?h(!0):h(!1)}),[P.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{s($("common"))}),[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:c,isUserHasDashboardAccess:r,isUserHasInvestorOrBankerAccess:p,isVendorBulkUpdateOnTransactionEnabled:g,isExpenseAutomationEnabled:A,isUncategorizedExpenseCategoryEnabled:m,isChainOfThoughtEnabled:O,selectedTransaction:T,transactionDetail:f,rawDetailSaveStatus:C,rawDetailLineItemById:v,vendorSaveStatus:k,tranEntity:b,defaultTrendTransactionTimePeriod:U,vendorViewDetails:P,uiState:B,firstMonthOfFY:z,uncategorizedAccounts:G,resetTrendIsFetchedStates:D,isCreateVendorDrawerOpen:F,setIsCreateVendorDrawerOpen:h}}const Yt={overlayWidth:new Ft(100,100,58)},Qt=({isOpen:t,onSaveVendor:e,onSaveSuccess:s,onCancel:a,vendorViewDetails:n})=>{const o=wt(),c=Pt(),r=W(),p=S((y=>oe(y))),g=()=>{a()},A={vendorDetailView:n??p,onSaveSuccess:()=>{r(Ue()),r(ot("Not-Started")),s()},onSaveVendor:e,onCancelClick:g,saveVendorDetailLocalData:y=>{r(Oe({vendorId:void 0,localData:y}))}};return x.jsx(Mt,{anchor:"right",open:t,PaperProps:{style:{width:Yt.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:g,children:x.jsx(Xt,{onClick:y=>y.stopPropagation(),children:x.jsx(_t,{...A})})})},Xt=Gt(jt)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|
|
5
|
-
`;function Zt(t,e){t(st({transactionId:e.transactionId,creditAccountIntegrationId:e.creditAccountIntegrationId,debitAccountIntegrationId:e.debitAccountIntegrationId,memo:e.memo,transactionType:H(e.transactionType),sourceTransactionType:H(e.sourceTransactionType)}))}function ea({currentTransactionId:t,enabled:e=!0,buildPath:s,beforeNavigate:a,navigate:n,navigateState:o}){const c=S((p=>p.createTransferEntryState.lastTransferEntryReplacement)),r=i.useRef(null);i.useEffect((()=>{if(!e||c==null||t==null||r.current===c)return;const{previousTransactionId:p,newTransactionId:g}=c;t.id===p.id&&t.type===p.type&&(r.current=c,a?.(),n(s(g),{replace:!0,state:o}))}),[e,c,t,s,a,n,o])}const ta=({closeDrawerHandler:t,overrideTransactionId:e,overrideTransactionType:s})=>{const a=ge(),n=Te(),o=W(),c=re(),{transactionTypeEncoded:r,transactionId:p}=Ee(),g=e??p,A=s??Ve(r??"");let y;Be(g,A)&&(y={id:g,type:H(A)});const m=y!=null?S((T=>J(T,y))):void 0,O=()=>{const T=ae(a.state?.pathnameStackToGoBack),f=T.poppedPathname??((C=2)=>{let v="../";for(let k=0;k<C;k++)v=`${v}../`;return v})(1);n(f,{state:{pathnameStackToGoBack:T.newStack}})};return{transactionId:y,onSaveVendor:()=>{o(we(y,void 0))},onSaveSuccess:()=>{if(m!=null&&m?.transaction&&m?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&m?.transactionDetailLocalData.vendorUpdates?.id!=null){const T=m?.transactionDetailLocalData.vendorUpdates,f={id:m?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:m?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:T?.name,qboId:m?.transactionDetailLocalData.vendorUpdates?.qboId??""},C={transactionId:{id:m?.transaction?.id,type:m?.transaction?.type},transaction:m?.transaction,lineIds:m?.transaction?.lines?.map((v=>v.id))??[]};o(Y({entity:f,amount:m?.transaction?.amount.amount,transactionDetails:C,flowType:"detail",isFetchCOT:c}))}O()},onCancel:()=>{y!=null&&o(ct({transactionId:y})),o(Ue()),o(it()),t(!0),O()}}},aa=Xe((function(t,e){const s=J(t,e.selectedTransaction);let a;s==null&&console.warn("Check if the you've selected the transaction before getting the details");const n=Pe.getSignedInUser(),o=t.tenantState.currentTenantId,c={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""};s!=null&&s.fetchState==="Completed"&&s.transaction!=null&&e.entity!=null&&(a=dt(t,e.entity,"TransactionDetail"));const r=t.entityAutoCompleteState.autoCompleteText.common,p=ut(t,"common"),g=Q(t);return{transactionDetail:s,transactionAttachmentEndpointToDownload:`${te}/transaction_attachment`,transactionAttachmentsEndpointToFetch:g.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${te}/transaction_attachments_accounting_provider`:`${te}/transaction_attachments`,attachmentUploadEndpoint:`${zt.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:c,trendReport:a,analytics:Fe,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:r,entityAutoCompleteView:p},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails")}}),(function(t,e){const{isCOTEnabled:s}=e;return{onBackClick:()=>{if(t($("common")),e.onBackClick!=null)return void e.onBackClick();const a=ae(e.location.state?.pathnameStackToGoBack),n=a.poppedPathname??Ne(2);e.navigate(n,{state:{pathnameStackToGoBack:a.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(a,n)=>{e.transaction!=null&&t(wt({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:a,customerId:n}))},onTransactionClick:a=>{e.resetTrendIsFetchedStates(),t(se()),t(ce());const n=ne(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(Le(a,e.tenantEmailDomain),{state:{pathnameStackToGoBack:n}})},onTrendSelectedPeriodChange:a=>{if(a==null)e.defaultTrendTransactionTimePeriod!=null&&t(ye(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const n=a.currentTimePeriod==null?a.addTimePeriod:{startDate:a.addTimePeriod.startDate,endDate:a.currentTimePeriod.endDate};t(ie(e.entity,"TransactionDetail",{timeframe:a.timeframe,timePeriod:a.addTimePeriod})),t(ye(e.entity,"TransactionDetail",{timeframe:a.timeframe,timePeriod:n}))}},onSaveUpdates:(a,n,o,c)=>{t(c===!0&&o!=null?we(a,o,!0,e.isExpenseAutomationEnabled,e.isUncategorizedExpenseCategoryEnabled):Ut({transactionId:a,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:n,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled})),t($("common"))},onUploadAttachmentAttachment:a=>{t(Ot(a))},onDeleteAttachment:a=>{e.transaction!=null&&t(At(a,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(a,n)=>{t(kt({transactionId:a,transactionLocalData:n}))},onUpdateAllChecked:(a,n,o,c)=>{e.transaction!=null&&t(Ct(e.selectedTransaction,e.transaction,a,n,o,c))},onResetLineItemsCategoryClassInLocalData:(a,n,o,c,r,p)=>{t(Dt(a,n,o,c,r,p))},onChangeCategoryClassWhenUpdateAllIsChecked:(a,n)=>{e.transaction!=null&&t(vt({id:e.transaction.id,type:e.transaction.type},e.transaction,a,n))},onSaveSuccess:()=>{const a=ae(e.location.state?.pathnameStackToGoBack);if(a.poppedPathname!=null){const n=Jt(a.poppedPathname,"/").split("/"),o=n[n.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(o)&&e.navigate(a.poppedPathname,{state:{pathnameStackToGoBack:a.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const c=`${Wt(e.tenantEmailDomain)}`;e.navigate(c)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const c=`${Ht(e.tenantEmailDomain)}`;e.navigate(c)}}},onPageRefresh:()=>{t(xe(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(a,n)=>{a.trim().length>=2?t(It({searchString:a,entityType:n,searchOrigin:"common"})):a.trim().length===0&&t($("common"))},onCancelAutoComplete:()=>{t($("common"))}},onFetchRecommendationsForEntity:(a,n,o,c)=>{t(Y({entity:a,amount:n,transactionDetails:o,flowType:"detail",isFetchCOT:s}))},clearRecommendationForLineId:a=>{const{transactionId:n,transaction:o,lineId:c}=a;t(bt(n,o,c))},resetUpdateErrorState:()=>{const a={id:e.selectedTransaction.id,type:e.selectedTransaction.type};t(Et(a))},onSaveVendorInLocalData:(a,n,o,c,r)=>{if(t(Tt({transactionId:a,vendorUpdates:n,entity:o})),n.id!=null&&o!=null&&c!=null&&r!=null&&t(Y({entity:o,amount:c,transactionDetails:r,flowType:"detail",isFetchCOT:s})),t(Oe({vendorId:n.id?n.id:void 0,localData:{vendorName:n.name,vendorId:n.id?n.id:void 0}})),!n.id&&e.transaction!=null){const p=e.transaction,g=ne(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(p.type??"")}/${p.id}/vendor/create`,{state:{pathnameStackToGoBack:g}})}},onSaveCustomerInLocalData:(a,n,o,c,r)=>{t(gt({transactionId:a,customerUpdates:n,entity:o})),n.id!=null&&o!=null&&c!=null&&r!=null&&t(Y({entity:o,amount:c,transactionDetails:r,flowType:"detail",isFetchCOT:s}))},onUpdateAllTranactionsWithCurrentVendorChecked:a=>{t(St({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:a}))},onClickUpdateVendorToAllLineItems:(a,n,o)=>{t(yt(a,n,o))},onResetVendorToAllLineItems:(a,n,o)=>{t(ht(a,n,o))},saveLatestSelectedEntity:(a,n,o)=>{t(ft({transactionId:a,lineId:n,entity:o}))},updateVendorBulkRecommendationsFetchStatus:(a,n)=>{t(pt(a,n))},setIsVendorUpdateAllChecked:(a,n,o)=>{t(mt(a,n,o))},onCreateTransferEntry:e.isCreateTransferEntryFromExpenseEnabled===!0?a=>Zt(t,a):void 0}}))(Nt);function ya(){const t=Te(),e=W(),s=ge(),{useFeatureGate:a,useDynamicConfig:n}=q(),o=Vt(),c=S((d=>Q(d))),r=c.userRole.includes("charge_card_user")||c.userRole.includes("charge_card_admin"),p=c.userRole!=null&&be(c.userRole),g=c.userRole!=null&&Ie(c.userRole),{isFeatureEnabled:A}=a(x.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:y}=a(x.isExpenseAutomationEnabled),{configValue:m}=n(_e.enableUncategorizedExpenseCategory),O=m?.uncategorized_expense_category_enabled===!0,{tenantEmailDomain:T,transactionTypeEncoded:f,transactionId:C}=Ee(),[v,k]=i.useState(!1),E=Ve(f??""),U=Be(C,E),P=S((d=>d.transactionVendorViewState)),B=re(),{isFeatureEnabled:z}=a(x.isTransactionCommentingEnabled),{isFeatureEnabled:G}=a(x.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:L}=a(x.isProjectsTransactionsEnabled),_=o?.currentTenant?.companyId,R=o?.currentTenant?.companyName,I=i.useMemo((()=>{if(U)return{id:C,type:H(E)}}),[U,C,E]),l=I!=null?S((d=>J(d,I))):void 0,j=l?.transactionDetailLocalData.vendorUpdates?.id!=null?P.editVendorStateById[l?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",D=l?.fetchState==="Completed"?Re(l?.transaction):void 0,F=S((d=>D!=null?ve(d.customerIncomeState,d.vendorExpenseState,d.trendState,D,"month"):void 0)),h=S((d=>oe(d))),b=S((d=>D!=null?De(d.trendWithTransactionsState,D,"TransactionDetail"):void 0)),u=c.company?.companyInfo.firstMonthOfFY??1,M=S((d=>Ce(d.accountState,d.accountListState,"accountList"))),[X,K]=i.useState(!1),[N,le]=i.useState(!1),[ze,de]=i.useState(!1),Ge=i.useCallback((d=>Le(d,T??"")+s.search),[T,s.search]),je=i.useCallback((()=>{de(!1)}),[]);ea({currentTransactionId:I,enabled:T!=null&&T!=="",buildPath:Ge,beforeNavigate:je,navigate:t,navigateState:s.state});const ue=()=>{K(!1),le(!1)},me=Bt();qt();const Z=i.useRef(l?.transaction);Z.current=l?.transaction;const Me=l?.transactionDetailUpdateStatus?.fetchState,V=Kt(Me,(()=>{const d=[];if(Z.current!=null)for(const ee of Z.current.lines??[])"account"in ee&&ee.account?.accountId!=null&&d.push(ee.account.accountId);return d}));i.useEffect((()=>{I!=null&&l!=null&&l.fetchState==="Not-Started"&&(e(xe(I,!1)),ue())}),[e,I,l?.fetchState]),i.useEffect((()=>{if(I!=null&&l?.fetchState==="Error"){const d=ne(s.state?.pathnameStackToGoBack,s.pathname);t("page-not-found",{replace:!0,state:me?{pathnameStackToGoBack:d,message:"expenseAutomation",origin:"transaction_categorization"}:{pathnameStackToGoBack:d,message:"pageNotFound",origin:"transaction_detail"}})}}),[I,l?.fetchState,t,s.state,s.pathname,me]),i.useEffect((()=>{ze||l==null||l.transaction==null||(e(ke({id:l.transaction.id,type:l.transaction.type})),de(!0)),D==null&&l?.fetchState==="Completed"&&Se(l?.transaction),D!=null&&(!r||p&&g===!1)&&(X?N||F==null||(le(!0),e(ie(D,"TransactionDetail",{timeframe:"month",timePeriod:b?.selectedPeriod?.timePeriod??F}))):(e(se()),e(ce()),Se(l?.transaction),K(!0),e(Ae(D))))}),[l?.fetchState,l?.transaction,F,r]),i.useEffect((()=>{h.newVendorState?.vendorDetailLocalData?.vendorName!=null?k(!0):k(!1)}),[h.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{e($("common"))}),[]);const $e=[f,C].filter((d=>d!=null)),{transactionId:pe,onSaveVendor:We,onSaveSuccess:He,onCancel:Je}=ta({closeDrawerHandler:d=>{k(!1),t(d?"../":"../..")}}),{isAiCfoAccessEnabled:qe,onAskAiCfoClick:Ke}=$t({mobileExploreReferrer:"Transaction Details"});return Lt({isDataReady:l?.fetchState==="Completed"}),U?w.jsxs(w.Fragment,{children:[pe!=null&&v&&w.jsx(Qt,{isOpen:v,transactionId:pe,onSaveVendor:We,onSaveSuccess:He,onCancel:Je}),w.jsx(aa,{hideDeleteAttachment:!0,firstMonthOfFY:u,isDisabled:l?.transaction?.type==="transfer"&&o?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:T,location:s,navigate:t,selectedTransaction:I,entity:D,isCOTEnabled:B,defaultTrendTransactionTimePeriod:F,resetTrendIsFetchedStates:ue,transaction:l?.transaction,uncategorizedAccounts:M,vendorSaveStatus:j,isVendorBulkUpdateOnTransactionEnabled:A,isCreateTransferEntryFromExpenseEnabled:G,isExpenseAutomationEnabled:y,isUncategorizedExpenseCategoryEnabled:O,isAiCfoAccessEnabled:qe,onAskAiCfoClick:Ke,isTransactionCommentingEnabled:z,isProjectsTransactionsEnabled:L,companyId:_,companyName:R}),V.showPopup&&V.popupType!=null&&w.jsx(Rt,{popupType:V.popupType,currencySymbol:V.currencySymbol,accountId:V.popupAccountId??"",accountName:V.popupAccountName??"",onSubmit:V.handleSubmit,onDismiss:V.handleDismiss})]}):w.jsx(Qe,{to:Ne($e.length)})}const Ne=(t=2)=>{let e="../";for(let s=0;s<t;s++)e=`${e}../`;return e},Se=t=>{if(t!=null){const{transactionCategory:e,transactionClass:s}=na(t),a=oa(t);Fe.trackTransactionDetails(t.account?.accountId,t.account?.accountName,t.id,a,e.length>0?e:void 0,s.length>0?s:void 0,t.type,t.amount,t.memo,t.lines?.length??0,t.attachments?.map((n=>n.fileName)))}},na=t=>{const e=[],s=[];return t.lines?.forEach((a=>{switch(a.type){case"transaction_with_account_and_class_line":case"transaction_with_product_or_service_line":case"journal_entry_transaction_line":case"linked_transaction_line":{const n=a;n!=null&&n.account!=null&&n.account.accountName?.length>0&&e.push(n.account.accountName),n.class!=null&&n.class.className?.length>0&&s.push(n.class.className);break}}})),{transactionCategory:e,transactionClass:s}},oa=t=>rt(t)===!0?t.customer?.name??"":lt(t)===!0?t.vendor?.name??"":t.memo!=null?t.memo:t.type;export{Qt as C,ya as T,qt as a,Kt as b,ta as c,aa as d,ea as e,re as f,Zt as g,ha as u};
|
|
5
|
+
`;function Zt(t,e){t(st({transactionId:e.transactionId,creditAccountIntegrationId:e.creditAccountIntegrationId,debitAccountIntegrationId:e.debitAccountIntegrationId,memo:e.memo,transactionType:H(e.transactionType),sourceTransactionType:H(e.sourceTransactionType)}))}function ea({currentTransactionId:t,enabled:e=!0,buildPath:s,beforeNavigate:a,navigate:n,navigateState:o}){const c=S((p=>p.createTransferEntryState.lastTransferEntryReplacement)),r=i.useRef(null);i.useEffect((()=>{if(!e||c==null||t==null||r.current===c)return;const{previousTransactionId:p,newTransactionId:g}=c;t.id===p.id&&t.type===p.type&&(r.current=c,a?.(),n(s(g),{replace:!0,state:o}))}),[e,c,t,s,a,n,o])}const ta=({closeDrawerHandler:t,overrideTransactionId:e,overrideTransactionType:s})=>{const a=ge(),n=Te(),o=W(),c=re(),{transactionTypeEncoded:r,transactionId:p}=be(),g=e??p,A=s??Ve(r??"");let y;Be(g,A)&&(y={id:g,type:H(A)});const m=y!=null?S((T=>J(T,y))):void 0,O=()=>{const T=ae(a.state?.pathnameStackToGoBack),f=T.poppedPathname??((C=2)=>{let v="../";for(let k=0;k<C;k++)v=`${v}../`;return v})(1);n(f,{state:{pathnameStackToGoBack:T.newStack}})};return{transactionId:y,onSaveVendor:()=>{o(xe(y,void 0))},onSaveSuccess:()=>{if(m!=null&&m?.transaction&&m?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&m?.transactionDetailLocalData.vendorUpdates?.id!=null){const T=m?.transactionDetailLocalData.vendorUpdates,f={id:m?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:m?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:T?.name,qboId:m?.transactionDetailLocalData.vendorUpdates?.qboId??""},C={transactionId:{id:m?.transaction?.id,type:m?.transaction?.type},transaction:m?.transaction,lineIds:m?.transaction?.lines?.map((v=>v.id))??[]};o(Y({entity:f,amount:m?.transaction?.amount.amount,transactionDetails:C,flowType:"detail",isFetchCOT:c}))}O()},onCancel:()=>{y!=null&&o(ct({transactionId:y})),o(Ue()),o(it()),t(!0),O()}}},aa=Xe((function(t,e){const s=J(t,e.selectedTransaction);let a;s==null&&console.warn("Check if the you've selected the transaction before getting the details");const n=Pe.getSignedInUser(),o=t.tenantState.currentTenantId,c={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""};s!=null&&s.fetchState==="Completed"&&s.transaction!=null&&e.entity!=null&&(a=dt(t,e.entity,"TransactionDetail"));const r=t.entityAutoCompleteState.autoCompleteText.common,p=ut(t,"common"),g=Q(t);return{transactionDetail:s,transactionAttachmentEndpointToDownload:`${te}/transaction_attachment`,transactionAttachmentsEndpointToFetch:g.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${te}/transaction_attachments_accounting_provider`:`${te}/transaction_attachments`,attachmentUploadEndpoint:`${zt.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:c,trendReport:a,analytics:Fe,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:r,entityAutoCompleteView:p},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails")}}),(function(t,e){const{isCOTEnabled:s}=e;return{onBackClick:()=>{if(t($("common")),e.onBackClick!=null)return void e.onBackClick();const a=ae(e.location.state?.pathnameStackToGoBack),n=a.poppedPathname??Ne(2);e.navigate(n,{state:{pathnameStackToGoBack:a.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(a,n)=>{e.transaction!=null&&t(xt({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:a,customerId:n}))},onTransactionClick:a=>{e.resetTrendIsFetchedStates(),t(se()),t(ce());const n=ne(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(Le(a,e.tenantEmailDomain),{state:{pathnameStackToGoBack:n}})},onTrendSelectedPeriodChange:a=>{if(a==null)e.defaultTrendTransactionTimePeriod!=null&&t(ye(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const n=a.currentTimePeriod==null?a.addTimePeriod:{startDate:a.addTimePeriod.startDate,endDate:a.currentTimePeriod.endDate};t(ie(e.entity,"TransactionDetail",{timeframe:a.timeframe,timePeriod:a.addTimePeriod})),t(ye(e.entity,"TransactionDetail",{timeframe:a.timeframe,timePeriod:n}))}},onSaveUpdates:(a,n,o,c)=>{t(c===!0&&o!=null?xe(a,o,!0,e.isExpenseAutomationEnabled,e.isUncategorizedExpenseCategoryEnabled):Ut({transactionId:a,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:n,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled})),t($("common"))},onUploadAttachmentAttachment:a=>{t(Ot(a))},onDeleteAttachment:a=>{e.transaction!=null&&t(At(a,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(a,n)=>{t(kt({transactionId:a,transactionLocalData:n}))},onUpdateAllChecked:(a,n,o,c)=>{e.transaction!=null&&t(Ct(e.selectedTransaction,e.transaction,a,n,o,c))},onResetLineItemsCategoryClassInLocalData:(a,n,o,c,r,p)=>{t(Dt(a,n,o,c,r,p))},onChangeCategoryClassWhenUpdateAllIsChecked:(a,n)=>{e.transaction!=null&&t(vt({id:e.transaction.id,type:e.transaction.type},e.transaction,a,n))},onSaveSuccess:()=>{const a=ae(e.location.state?.pathnameStackToGoBack);if(a.poppedPathname!=null){const n=Jt(a.poppedPathname,"/").split("/"),o=n[n.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(o)&&e.navigate(a.poppedPathname,{state:{pathnameStackToGoBack:a.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const c=`${Wt(e.tenantEmailDomain)}`;e.navigate(c)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const c=`${Ht(e.tenantEmailDomain)}`;e.navigate(c)}}},onPageRefresh:()=>{t(we(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(a,n)=>{a.trim().length>=2?t(It({searchString:a,entityType:n,searchOrigin:"common"})):a.trim().length===0&&t($("common"))},onCancelAutoComplete:()=>{t($("common"))}},onFetchRecommendationsForEntity:(a,n,o,c)=>{t(Y({entity:a,amount:n,transactionDetails:o,flowType:"detail",isFetchCOT:s}))},clearRecommendationForLineId:a=>{const{transactionId:n,transaction:o,lineId:c}=a;t(Et(n,o,c))},resetUpdateErrorState:()=>{const a={id:e.selectedTransaction.id,type:e.selectedTransaction.type};t(bt(a))},onSaveVendorInLocalData:(a,n,o,c,r)=>{if(t(Tt({transactionId:a,vendorUpdates:n,entity:o})),n.id!=null&&o!=null&&c!=null&&r!=null&&t(Y({entity:o,amount:c,transactionDetails:r,flowType:"detail",isFetchCOT:s})),t(Oe({vendorId:n.id?n.id:void 0,localData:{vendorName:n.name,vendorId:n.id?n.id:void 0}})),!n.id&&e.transaction!=null){const p=e.transaction,g=ne(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(p.type??"")}/${p.id}/vendor/create`,{state:{pathnameStackToGoBack:g}})}},onSaveCustomerInLocalData:(a,n,o,c,r)=>{t(gt({transactionId:a,customerUpdates:n,entity:o})),n.id!=null&&o!=null&&c!=null&&r!=null&&t(Y({entity:o,amount:c,transactionDetails:r,flowType:"detail",isFetchCOT:s}))},onUpdateAllTranactionsWithCurrentVendorChecked:a=>{t(St({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:a}))},onClickUpdateVendorToAllLineItems:(a,n,o)=>{t(yt(a,n,o))},onResetVendorToAllLineItems:(a,n,o)=>{t(ht(a,n,o))},saveLatestSelectedEntity:(a,n,o)=>{t(ft({transactionId:a,lineId:n,entity:o}))},updateVendorBulkRecommendationsFetchStatus:(a,n)=>{t(pt(a,n))},setIsVendorUpdateAllChecked:(a,n,o)=>{t(mt(a,n,o))},onCreateTransferEntry:e.isCreateTransferEntryFromExpenseEnabled===!0?a=>Zt(t,a):void 0}}))(Nt);function ya(){const t=Te(),e=W(),s=ge(),{useFeatureGate:a,useDynamicConfig:n}=q(),o=Vt(),c=S((d=>Q(d))),r=c.userRole.includes("charge_card_user")||c.userRole.includes("charge_card_admin"),p=c.userRole!=null&&Ee(c.userRole),g=c.userRole!=null&&Ie(c.userRole),{isFeatureEnabled:A}=a(w.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:y}=a(w.isExpenseAutomationEnabled),{configValue:m}=n(_e.enableUncategorizedExpenseCategory),O=m?.uncategorized_expense_category_enabled===!0,{tenantEmailDomain:T,transactionTypeEncoded:f,transactionId:C}=be(),[v,k]=i.useState(!1),b=Ve(f??""),U=Be(C,b),P=S((d=>d.transactionVendorViewState)),B=re(),{isFeatureEnabled:z}=a(w.isTransactionCommentingEnabled),{isFeatureEnabled:G}=a(w.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:L}=a(w.isProjectsTransactionsEnabled),_=o?.currentTenant?.companyId,R=o?.currentTenant?.companyName,I=i.useMemo((()=>{if(U)return{id:C,type:H(b)}}),[U,C,b]),l=I!=null?S((d=>J(d,I))):void 0,j=l?.transactionDetailLocalData.vendorUpdates?.id!=null?P.editVendorStateById[l?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",D=l?.fetchState==="Completed"?Re(l?.transaction):void 0,F=S((d=>D!=null?ve(d.customerIncomeState,d.vendorExpenseState,d.trendState,D,"month"):void 0)),h=S((d=>oe(d))),E=S((d=>D!=null?De(d.trendWithTransactionsState,D,"TransactionDetail"):void 0)),u=c.company?.companyInfo.firstMonthOfFY??1,M=S((d=>Ce(d.accountState,d.accountListState,"accountList"))),[X,K]=i.useState(!1),[N,le]=i.useState(!1),[ze,de]=i.useState(!1),Ge=i.useCallback((d=>Le(d,T??"")+s.search),[T,s.search]),je=i.useCallback((()=>{de(!1)}),[]);ea({currentTransactionId:I,enabled:T!=null&&T!=="",buildPath:Ge,beforeNavigate:je,navigate:t,navigateState:s.state});const ue=()=>{K(!1),le(!1)},me=Bt();qt();const Z=i.useRef(l?.transaction);Z.current=l?.transaction;const Me=l?.transactionDetailUpdateStatus?.fetchState,V=Kt(Me,(()=>{const d=[];if(Z.current!=null)for(const ee of Z.current.lines??[])"account"in ee&&ee.account?.accountId!=null&&d.push(ee.account.accountId);return d}));i.useEffect((()=>{I!=null&&l!=null&&l.fetchState==="Not-Started"&&(e(we(I,!1)),ue())}),[e,I,l?.fetchState]),i.useEffect((()=>{if(I!=null&&l?.fetchState==="Error"){const d=ne(s.state?.pathnameStackToGoBack,s.pathname);t("page-not-found",{replace:!0,state:me?{pathnameStackToGoBack:d,message:"expenseAutomation",origin:"transaction_categorization"}:{pathnameStackToGoBack:d,message:"pageNotFound",origin:"transaction_detail"}})}}),[I,l?.fetchState,t,s.state,s.pathname,me]),i.useEffect((()=>{ze||l==null||l.transaction==null||(e(ke({id:l.transaction.id,type:l.transaction.type})),de(!0)),D==null&&l?.fetchState==="Completed"&&Se(l?.transaction),D!=null&&(!r||p&&g===!1)&&(X?N||F==null||(le(!0),e(ie(D,"TransactionDetail",{timeframe:"month",timePeriod:E?.selectedPeriod?.timePeriod??F}))):(e(se()),e(ce()),Se(l?.transaction),K(!0),e(Ae(D))))}),[l?.fetchState,l?.transaction,F,r]),i.useEffect((()=>{h.newVendorState?.vendorDetailLocalData?.vendorName!=null?k(!0):k(!1)}),[h.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{e($("common"))}),[]);const $e=[f,C].filter((d=>d!=null)),{transactionId:pe,onSaveVendor:We,onSaveSuccess:He,onCancel:Je}=ta({closeDrawerHandler:d=>{k(!1),t(d?"../":"../..")}}),{isAiCfoAccessEnabled:qe,onAskAiCfoClick:Ke}=$t({mobileExploreReferrer:"Transaction Details"});return Lt({isDataReady:l?.fetchState==="Completed"}),U?x.jsxs(x.Fragment,{children:[pe!=null&&v&&x.jsx(Qt,{isOpen:v,transactionId:pe,onSaveVendor:We,onSaveSuccess:He,onCancel:Je}),x.jsx(aa,{hideDeleteAttachment:!0,firstMonthOfFY:u,isDisabled:l?.transaction?.type==="transfer"&&o?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:T,location:s,navigate:t,selectedTransaction:I,entity:D,isCOTEnabled:B,defaultTrendTransactionTimePeriod:F,resetTrendIsFetchedStates:ue,transaction:l?.transaction,uncategorizedAccounts:M,vendorSaveStatus:j,isVendorBulkUpdateOnTransactionEnabled:A,isCreateTransferEntryFromExpenseEnabled:G,isExpenseAutomationEnabled:y,isUncategorizedExpenseCategoryEnabled:O,isAiCfoAccessEnabled:qe,onAskAiCfoClick:Ke,isTransactionCommentingEnabled:z,isProjectsTransactionsEnabled:L,companyId:_,companyName:R}),V.showPopup&&V.popupType!=null&&x.jsx(Rt,{popupType:V.popupType,currencySymbol:V.currencySymbol,accountId:V.popupAccountId??"",accountName:V.popupAccountName??"",onSubmit:V.handleSubmit,onDismiss:V.handleDismiss})]}):x.jsx(Qe,{to:Ne($e.length)})}const Ne=(t=2)=>{let e="../";for(let s=0;s<t;s++)e=`${e}../`;return e},Se=t=>{if(t!=null){const{transactionCategory:e,transactionClass:s}=na(t),a=oa(t);Fe.trackTransactionDetails(t.account?.accountId,t.account?.accountName,t.id,a,e.length>0?e:void 0,s.length>0?s:void 0,t.type,t.amount,t.memo,t.lines?.length??0,t.attachments?.map((n=>n.fileName)))}},na=t=>{const e=[],s=[];return t.lines?.forEach((a=>{switch(a.type){case"transaction_with_account_and_class_line":case"transaction_with_product_or_service_line":case"journal_entry_transaction_line":case"linked_transaction_line":{const n=a;n!=null&&n.account!=null&&n.account.accountName?.length>0&&e.push(n.account.accountName),n.class!=null&&n.class.className?.length>0&&s.push(n.class.className);break}}})),{transactionCategory:e,transactionClass:s}},oa=t=>rt(t)===!0?t.customer?.name??"":lt(t)===!0?t.vendor?.name??"":t.memo!=null?t.memo:t.type;export{Qt as C,ya as T,qt as a,Kt as b,ta as c,aa as d,ea as e,re as f,Zt as g,ha as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-0jcT8Dx_.js";import{h as Z,g as N,u as H,i as Q,j as g,N as G,n as W,o as ve,p as j}from"./core-DrRun-Wp.js";import{eZ as U,rb as X,k3 as u,R_ as ee,Ko as De,bo as le,R$ as be,kG as te,O2 as ae,S0 as ue,S1 as Pe,bE as Y,Kk as ye,S2 as Ee,S3 as me,S4 as je,Kn as Ae,S5 as xe,S6 as pe,S7 as Me,S8 as Se,S9 as Le,Sa as Ce,Sb as fe,LA as Be}from"./zeni-epic-state-D1OApLJ3.js";import{O as de,A as ne,c as q,g as w,co as ce,w as K,s as oe,_ as Fe,i as Oe}from"./index-CdzL9szH.js";import"./mui-BCzMCgwZ.js";import{a as S}from"./sentry-Cix5j_Oe.js";import{w as se}from"./withTransactionSidePanel-B_GhVWS9.js";import{p as ie,c as re}from"./routePaths-CHhQNN3M.js";import{v as ze}from"./utils-CvfvTDv6.js";import{d as b}from"./decodeURIComponentSafe-BqXEXApE.js";import{Z as we}from"./ZeniAccountStatementScreen-B27kJkJn.js";import"./recharts-BJColP3b.js";import"./analytics-CO5gayAE.js";import"./plaid-B0k6aBM1.js";import"./dnd-C7lg2kUY.js";import"./stripe-cKAAJElX.js";import"./lottie-C4eBAM7n.js";import"./lexical-Cceo9d8G.js";import"./pdf-C1ioMmzA.js";import"./useAskAiCfoHostNavButtonProps-fe0P1a5j.js";import"./TransactionDetailScreen-BXByY28g.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]="ba176798-0363-46c0-a62a-084d7d65f468",a._sentryDebugIdIdentifier="sentry-dbid-ba176798-0363-46c0-a62a-084d7d65f468")}catch{}})();const Ge=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],J=a=>ze(a),Re=W((function(a,e){const t=be(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,J(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=de.getLocalizedStrings(),l=J(e.selectedAccount.tranListType),m=Ve(t,n,c,l,e.bookCloseDate);w.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(ue({uiState:{dateRange:m},type:J(e.selectedAccount.tranListType)})),a(De(l,u(m),!1,l==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(u(m))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=K(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ue({uiState:{scrollYOffset:t},type:J(e.selectedAccount.tranListType)}))}}}))(ce),V=se((function({...a}){const e=Z(),t=N(),n=H(),c=t.pathname.split("/").find((r=>Ge.includes(r))),o=c??"uncategorized-expense",{tenantEmailDomain:l}=Q(),m=de.getLocalizedStrings(),{accountType:h,title:T,subTitle:D}=_e(o),y="month",I=g((r=>U(r))),p=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:A}=ne(),{isFeatureEnabled:k}=A(q.isProjectsTransactionsEnabled),x=g((r=>X(r)))&&k,{dataAvailable:C,initialTimeframeTick:P}=$e(o,p,I.bookCloseDate),[B,E]=S.useState(!1),[F,O]=S.useState(void 0),f=S.useMemo((()=>{const r=u(P);return{tranListType:o,accountType:ee(h),title:T,subTitle:D,timeframe:y,period:r}}),[o,y,h,C]);S.useEffect((()=>{if(!B&&f!=null){E(!0),w.trackTransactionList(void 0,void 0,void 0,f.title);const r=J(f.tranListType);n(De(r,f.period,!0,r==="missingReceipts"?m.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}}),[B,f,n]);let M=f;return f!=null&&F!=null&&(M={...f,period:F}),c==null||M==null?s.jsx(G,{to:"../"}):s.jsx(Re,{firstMonthOfFY:p,tenantEmailDomain:l,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:C,navigate:e,showProjectField:x,selectedAccount:M,referrerType:o,bookCloseDate:I.bookCloseDate,onSelectedTimePeriodChange:r=>O(r),...a})})),_e=a=>{let e="",t="";const n=de.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.uncategorizedTransactionList.expense.title;break;case"miscategorized-expense":e="expenses",t=n.miscategorizedTransactionList.expense.title;break;case"miscategorized-income":e="income",t=n.miscategorizedTransactionList.income.title;break;case"missing-receipts":t=n.uncategorizedTransactionList.missingReceipt.title}return{accountType:e,title:t,subTitle:""}},$e=(a,e,t)=>{const n=le();let c=le().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:ie(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Ve=(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},Je=W((function(a,e){const t=Ee(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:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??ge();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)}`),w.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(ye(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=K(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}}))(ce),qe=se((function({referrerType:a,...e}){const t=Z(),n=N(),c=H(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,classIdEncoded:h,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=Q(),p=b(l??""),A=b(m??""),k=b(h??""),x=b(I??""),C=g((d=>Pe(d.transactionListState,A,p,k))),[P,B]=S.useState(!1),[E,F]=S.useState(void 0),O=g((d=>U(d))),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),R=g((d=>X(d)))&&r;let i;const z=Ke(p,A,k,T,D,y,x);if(z){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Ne(C?.dateRange,d);i={accountId:A,accountType:ee(p),classId:k,title:x,timeframe:T,period:_}}S.useEffect((()=>{P||i==null||(B(!0),w.trackTransactionList(i.accountId,void 0,a,i.title),c(ye(i.accountId,i.accountType,i.classId,i.period)))}),[P,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,h,T,D,y,I].filter((d=>d!=null));return z&&L!=null?s.jsx(Je,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:R,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(G,{to:ge($.length)})})),ge=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ke=(a,e,t,n,c,o,l)=>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()&&l!=null,Ne=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),Ue=W((function(a,e){const t=xe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??he();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)}`),w.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{dateRange:o}})),a(Ae(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=K(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{scrollYOffset:t}}))}}}))(ce),Ze=se((function({referrerType:a,...e}){const t=Z(),n=N(),c=H(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,projectIdEncoded:h,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=Q(),p=b(l??""),A=b(m??""),k=b(h??""),x=b(I??""),C=g((d=>je(d.transactionListState,A,p,k))),[P,B]=S.useState(!1),[E,F]=S.useState(void 0),O=g((d=>U(d))),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),R=g((d=>X(d)))&&r;let i;const z=He(p,A,k,T,D,y,x);if(z){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Qe(C?.dateRange,d);i={accountId:A,accountType:ee(p),projectId:k,title:x,timeframe:T,period:_}}S.useEffect((()=>{P||i==null||(B(!0),w.trackTransactionList(i.accountId,void 0,a,i.title),c(Ae(i.accountId,i.accountType,i.projectId,i.period)))}),[P,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,h,T,D,y,I].filter((d=>d!=null));return z&&L!=null?s.jsx(Ue,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:R,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(G,{to:he($.length)})})),he=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},He=(a,e,t,n,c,o,l)=>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()&&l!=null,Qe=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),We=W((function(a,e){const t=Le(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&Ce(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ie();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)}`),w.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(Se(e.selectedAccount.accountId,e.selectedAccount.accountType,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=K(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=tt(e.tenantEmailDomain),n=K(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}}))(ce),Te=se((function({referrerType:a,...e}){const t=Z(),n=N(),c=H(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,timeframe:h,startDate:T,endDate:D,titleEncoded:y,excludeSubAccounts:I}=Q(),p=b(l??""),A=b(m??""),k=b(y??""),x=!(I!=null&&I==="exclude_subaccounts"),C=g((v=>Me(v.transactionListState,A,p))),[P,B]=S.useState(!1),[E,F]=S.useState(void 0),O=g((v=>U(v))),f=O.company?.featuresActivationInfo.connectedAccountProvider==="unit",M=O.company?.companyInfo.firstMonthOfFY??1;let r;const R=Xe(p,A,h,T,D,k);if(R){const v={startDate:Y(T,"YYYY-MM-DD"),endDate:Y(D,"YYYY-MM-DD")},Ye=et(C?.dateRange,v);r={accountId:A,accountType:ee(p),title:k,timeframe:h,period:Ye}}let i=r;r!=null&&E!=null&&(i={...r,period:E});const{useFeatureGate:z}=ne(),{isFeatureEnabled:L}=z(q.isTransactionCommentingEnabled),{isFeatureEnabled:$}=z(q.isProjectsTransactionsEnabled),d=g((v=>X(v)))&&$,{areTenantIdsInSync:_}=Fe();S.useEffect((()=>{!P&&r!=null&&_&&(B(!0),w.trackTransactionList(r.accountId,void 0,a,r.title),c(Se(r.accountId,r.accountType,r.period,void 0,!1,x)))}),[P,r,c,_]);const ke=[l,m,h,T,D,y].filter((v=>v!=null));return R&&i!=null?s.jsx(We,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:f,isTransactionCommentingEnabled:L,showProjectField:d,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:v=>F(v),...e}):s.jsx(G,{to:Ie(ke.length)})})),Ie=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Xe=(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,et=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),tt=a=>`/${a}/transactions/${Be}/statements`;function kt(){const a=N().state?.referrer,e=g((n=>n.expenseAutomationViewState.selectedPeriodByTenantId))[g((n=>U(n))).tenantId],t=Oe();return s.jsxs(ve,{children:[s.jsx(j,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/zeni-clearing-account/statements",element:s.jsx(we,{})}),s.jsx(j,{path:"/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/uncategorized-income/*",element:s.jsx(V,{})}),s.jsx(j,{path:"/uncategorized-expense/*",element:t?s.jsx(G,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(j,{path:"/miscategorized-income/*",element:s.jsx(V,{})}),s.jsx(j,{path:"/miscategorized-expense/*",element:t?s.jsx(G,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(j,{path:"/missing-receipts/*",element:t?s.jsx(G,{to:`../../month_end_close_checks/review/missing_receipts/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(j,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(qe,{referrerType:a})}),s.jsx(j,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Ze,{referrerType:a})})]})}export{kt as default};
|
|
1
|
+
import{j as s}from"./liveblocks-C8AAaKDR.js";import{h as U,g as N,u as H,i as Q,j as g,N as G,n as W,o as ve,p as j}from"./core-Da6TLrNx.js";import{eZ as K,rb as X,k3 as u,R_ as ee,Ko as De,bo as le,R$ as be,kG as te,O2 as ae,S0 as ue,S1 as Pe,bE as Y,Kk as ye,S2 as Ee,S3 as me,S4 as je,Kn as Ae,S5 as xe,S6 as pe,S7 as Me,S8 as Se,S9 as Le,Sa as Ce,Sb as fe,LA as Be}from"./zeni-epic-state-BqRlfhza.js";import{O as de,A as ne,c as q,e as w,co as ce,v as Z,r as oe,Z as Fe,n as Oe}from"./index-Bwczg7nO.js";import"./mui-CosLSKUu.js";import{a as S}from"./sentry-DfheywaX.js";import{w as se}from"./withTransactionSidePanel-ZJmA3F8P.js";import{p as ie,c as re}from"./routePaths-Kh8F22Sq.js";import{v as ze}from"./utils-BykfwIo5.js";import{d as b}from"./decodeURIComponentSafe-B-r3T5bV.js";import{Z as we}from"./ZeniAccountStatementScreen-BBJfP9Ky.js";import"./recharts-9jMEgSjc.js";import"./analytics-D_NuuF2U.js";import"./plaid-2mv_ck83.js";import"./dnd-DC_qF3Wr.js";import"./stripe-cKAAJElX.js";import"./lottie-B7_cpoe1.js";import"./lexical-CQoPutFC.js";import"./pdf-CQB-J2hc.js";import"./useAskAiCfoHostNavButtonProps-vhjzTbBd.js";import"./TransactionDetailScreen-tCFIjsQZ.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]="e8ede515-265d-423d-ac91-284d5fcabc91",a._sentryDebugIdIdentifier="sentry-dbid-e8ede515-265d-423d-ac91-284d5fcabc91")}catch{}})();const Ge=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],J=a=>ze(a),Re=W((function(a,e){const t=be(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,J(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=de.getLocalizedStrings(),l=J(e.selectedAccount.tranListType),m=Ve(t,n,c,l,e.bookCloseDate);w.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(ue({uiState:{dateRange:m},type:J(e.selectedAccount.tranListType)})),a(De(l,u(m),!1,l==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(u(m))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=Z(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ue({uiState:{scrollYOffset:t},type:J(e.selectedAccount.tranListType)}))}}}))(ce),V=se((function({...a}){const e=U(),t=N(),n=H(),c=t.pathname.split("/").find((r=>Ge.includes(r))),o=c??"uncategorized-expense",{tenantEmailDomain:l}=Q(),m=de.getLocalizedStrings(),{accountType:h,title:T,subTitle:D}=_e(o),y="month",I=g((r=>K(r))),p=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:A}=ne(),{isFeatureEnabled:k}=A(q.isProjectsTransactionsEnabled),x=g((r=>X(r)))&&k,{dataAvailable:C,initialTimeframeTick:P}=$e(o,p,I.bookCloseDate),[B,E]=S.useState(!1),[F,O]=S.useState(void 0),f=S.useMemo((()=>{const r=u(P);return{tranListType:o,accountType:ee(h),title:T,subTitle:D,timeframe:y,period:r}}),[o,y,h,C]);S.useEffect((()=>{if(!B&&f!=null){E(!0),w.trackTransactionList(void 0,void 0,void 0,f.title);const r=J(f.tranListType);n(De(r,f.period,!0,r==="missingReceipts"?m.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}}),[B,f,n]);let M=f;return f!=null&&F!=null&&(M={...f,period:F}),c==null||M==null?s.jsx(G,{to:"../"}):s.jsx(Re,{firstMonthOfFY:p,tenantEmailDomain:l,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:C,navigate:e,showProjectField:x,selectedAccount:M,referrerType:o,bookCloseDate:I.bookCloseDate,onSelectedTimePeriodChange:r=>O(r),...a})})),_e=a=>{let e="",t="";const n=de.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.uncategorizedTransactionList.expense.title;break;case"miscategorized-expense":e="expenses",t=n.miscategorizedTransactionList.expense.title;break;case"miscategorized-income":e="income",t=n.miscategorizedTransactionList.income.title;break;case"missing-receipts":t=n.uncategorizedTransactionList.missingReceipt.title}return{accountType:e,title:t,subTitle:""}},$e=(a,e,t)=>{const n=le();let c=le().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:ie(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Ve=(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},Je=W((function(a,e){const t=Ee(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:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??ge();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)}`),w.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(ye(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=Z(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}}))(ce),qe=se((function({referrerType:a,...e}){const t=U(),n=N(),c=H(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,classIdEncoded:h,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=Q(),p=b(l??""),A=b(m??""),k=b(h??""),x=b(I??""),C=g((d=>Pe(d.transactionListState,A,p,k))),[P,B]=S.useState(!1),[E,F]=S.useState(void 0),O=g((d=>K(d))),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),R=g((d=>X(d)))&&r;let i;const z=Ze(p,A,k,T,D,y,x);if(z){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Ne(C?.dateRange,d);i={accountId:A,accountType:ee(p),classId:k,title:x,timeframe:T,period:_}}S.useEffect((()=>{P||i==null||(B(!0),w.trackTransactionList(i.accountId,void 0,a,i.title),c(ye(i.accountId,i.accountType,i.classId,i.period)))}),[P,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,h,T,D,y,I].filter((d=>d!=null));return z&&L!=null?s.jsx(Je,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:R,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(G,{to:ge($.length)})})),ge=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ze=(a,e,t,n,c,o,l)=>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()&&l!=null,Ne=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),Ke=W((function(a,e){const t=xe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??he();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)}`),w.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{dateRange:o}})),a(Ae(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=Z(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{scrollYOffset:t}}))}}}))(ce),Ue=se((function({referrerType:a,...e}){const t=U(),n=N(),c=H(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,projectIdEncoded:h,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=Q(),p=b(l??""),A=b(m??""),k=b(h??""),x=b(I??""),C=g((d=>je(d.transactionListState,A,p,k))),[P,B]=S.useState(!1),[E,F]=S.useState(void 0),O=g((d=>K(d))),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),R=g((d=>X(d)))&&r;let i;const z=He(p,A,k,T,D,y,x);if(z){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Qe(C?.dateRange,d);i={accountId:A,accountType:ee(p),projectId:k,title:x,timeframe:T,period:_}}S.useEffect((()=>{P||i==null||(B(!0),w.trackTransactionList(i.accountId,void 0,a,i.title),c(Ae(i.accountId,i.accountType,i.projectId,i.period)))}),[P,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,h,T,D,y,I].filter((d=>d!=null));return z&&L!=null?s.jsx(Ke,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:R,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(G,{to:he($.length)})})),he=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},He=(a,e,t,n,c,o,l)=>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()&&l!=null,Qe=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),We=W((function(a,e){const t=Le(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&Ce(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ie();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)}`),w.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(Se(e.selectedAccount.accountId,e.selectedAccount.accountType,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=Z(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=tt(e.tenantEmailDomain),n=Z(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}}))(ce),Te=se((function({referrerType:a,...e}){const t=U(),n=N(),c=H(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,timeframe:h,startDate:T,endDate:D,titleEncoded:y,excludeSubAccounts:I}=Q(),p=b(l??""),A=b(m??""),k=b(y??""),x=!(I!=null&&I==="exclude_subaccounts"),C=g((v=>Me(v.transactionListState,A,p))),[P,B]=S.useState(!1),[E,F]=S.useState(void 0),O=g((v=>K(v))),f=O.company?.featuresActivationInfo.connectedAccountProvider==="unit",M=O.company?.companyInfo.firstMonthOfFY??1;let r;const R=Xe(p,A,h,T,D,k);if(R){const v={startDate:Y(T,"YYYY-MM-DD"),endDate:Y(D,"YYYY-MM-DD")},Ye=et(C?.dateRange,v);r={accountId:A,accountType:ee(p),title:k,timeframe:h,period:Ye}}let i=r;r!=null&&E!=null&&(i={...r,period:E});const{useFeatureGate:z}=ne(),{isFeatureEnabled:L}=z(q.isTransactionCommentingEnabled),{isFeatureEnabled:$}=z(q.isProjectsTransactionsEnabled),d=g((v=>X(v)))&&$,{areTenantIdsInSync:_}=Fe();S.useEffect((()=>{!P&&r!=null&&_&&(B(!0),w.trackTransactionList(r.accountId,void 0,a,r.title),c(Se(r.accountId,r.accountType,r.period,void 0,!1,x)))}),[P,r,c,_]);const ke=[l,m,h,T,D,y].filter((v=>v!=null));return R&&i!=null?s.jsx(We,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:f,isTransactionCommentingEnabled:L,showProjectField:d,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:v=>F(v),...e}):s.jsx(G,{to:Ie(ke.length)})})),Ie=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Xe=(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,et=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),tt=a=>`/${a}/transactions/${Be}/statements`;function kt(){const a=N().state?.referrer,e=g((n=>n.expenseAutomationViewState.selectedPeriodByTenantId))[g((n=>K(n))).tenantId],t=Oe();return s.jsxs(ve,{children:[s.jsx(j,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/zeni-clearing-account/statements",element:s.jsx(we,{})}),s.jsx(j,{path:"/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/uncategorized-income/*",element:s.jsx(V,{})}),s.jsx(j,{path:"/uncategorized-expense/*",element:t?s.jsx(G,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(j,{path:"/miscategorized-income/*",element:s.jsx(V,{})}),s.jsx(j,{path:"/miscategorized-expense/*",element:t?s.jsx(G,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(j,{path:"/missing-receipts/*",element:t?s.jsx(G,{to:`../../month_end_close_checks/review/missing_receipts/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(j,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(qe,{referrerType:a})}),s.jsx(j,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Ue,{referrerType:a})})]})}export{kt as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e}from"./liveblocks-
|
|
1
|
+
import{j as e}from"./liveblocks-C8AAaKDR.js";import{h as F,g as L,u as B,i as O,j as g,N as D,n as N,o as Ie,p as k}from"./core-Da6TLrNx.js";import{cr as G,eZ as E,QK as U,GL as ae,fY as Q,Gt as ne,QM as Te,GO as ke,QI as je,QJ as se,QY as be,ES as Ae,uw as Ee,QO as ve,H5 as De,QL as re,cV as H,yP as oe,fE as Fe,fG as Le,RX as Be,RY as Ue,Gu as Pe,RZ as Re,Gv as Me,GE as Ve,bs as Oe,bJ as Ne,cC as Ge,bK as _e,cq as ze,bt as $e,Mj as Ze,cp as Qe}from"./zeni-epic-state-BqRlfhza.js";import{d as _,ar as He,z as A,E as z,e as j,ch as Je,ci as Ke,cj as Z,J,y as qe,Z as We,a0 as Ye,A as ie,c as v,H as Xe,D as et,ck as tt,au as K,v as at,cl as nt,r as q,cm as st,V as Y,cn as rt,i as ot}from"./index-Bwczg7nO.js";import{D as it,n as R,S as ct}from"./mui-CosLSKUu.js";import lt from"./NotFoundScreen-vodaR6J5.js";import{S as X}from"./SetupPagesScreen-Du6z7K4L.js";import{a as p}from"./sentry-DfheywaX.js";import{u as ut}from"./useAskAiCfoHostNavButtonProps-vhjzTbBd.js";import{u as dt}from"./useInitialThreadRequest-CRJnx1_Z.js";import{u as pt}from"./useCashManagementBanner-DwoCHz3u.js";import{M as ce}from"./MobileAppDrawer-D_5ajcgl.js";import{F as mt}from"./FeaturePreviewScreen-BKSMrhrm.js";import{a as ee}from"./analyticsHelper-C7Ffbo_X.js";import"./recharts-9jMEgSjc.js";import"./analytics-D_NuuF2U.js";import"./plaid-2mv_ck83.js";import"./dnd-DC_qF3Wr.js";import"./stripe-cKAAJElX.js";import"./lottie-B7_cpoe1.js";import"./lexical-CQoPutFC.js";import"./pdf-CQB-J2hc.js";import"./utils-BykfwIo5.js";import"./routePaths-Kh8F22Sq.js";import"./BusinessVerificationPageScreen-DrCLmIxZ.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]="0c3856cd-e33f-450d-bdbe-e36458e9ce70",t._sentryDebugIdIdentifier="sentry-dbid-0c3856cd-e33f-450d-bdbe-e36458e9ce70")}catch{}})();const ft=N((function(t,a){const{companyId:n}=a;return{treasurySetupView:U(t,n),analytics:j}}),(function(t,a){const{navigate:n,analytics:r,treasurySetupView:m}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const s=m.fundAllocationLocalData;r.trackTreasuryPortfolioConfirm(s.riskScore,ee(s)),t(ke(!0))},onUpdateFundAllocation:s=>{r.trackTreasuryAllocationAction("update",ee(s)),t(Te(s))}}}))(Je);function yt(){const t=F(),a=L(),n=B(),{tenantEmailDomain:r}=O(),m=_(),s=g((T=>T.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState)),f=He(s),o=G(m?.loggedInUserRoleMap),[u,i]=p.useState(!1),[d,w]=p.useState(!1),[c,l]=p.useState(!1),S=g((T=>E(T))),y=A.getSignedInUserTenant(r)?.companyId??S.companyId,x=A.getSignedInUser(),h=g((T=>U(T,y))),I=g((T=>T.treasurySetupViewState.fetchState)),C=g((T=>T.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),M=g((T=>T.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState));if(x==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(p.useEffect((()=>{u||I!=="Not-Started"||y==null||(i(!0),n(ae(y,!0,!1)))}),[u,I,y,n]),p.useEffect((()=>{c||M!=="Not-Started"||y==null||(l(!0),n(Q()))}),[c,M,y,n]),p.useEffect((()=>{d||C!=="Not-Started"||y==null||(w(!0),n(ne()))}),[d,C,y,n]),p.useEffect((()=>{f==="In-Progress"&&s==="Completed"&&t("../")}),[f,s,t]),S.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(D,{to:"../promo"});const P=S.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||I!=="Completed";return e.jsxs(e.Fragment,{children:[!P&&e.jsx(z,{analytics:j,onLoad:()=>{}}),e.jsx(ft,{navigate:t,location:a,companyId:y,isEditMode:!0,isLoading:P,isReadOnly:!o,treasurySetupView:h,analytics:j})]})}const gt=N((function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:be(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:U(t,n)}}),(function(t,a){const{navigate:n,transferDetails:r,treasurySetupView:m}=a,s=r.treasuryTransferMoneyLocalData,f=m.fundAllocationLocalData;return{onCancelClick:()=>{Z(a.analytics,"cancel",s,f,"Transfer"),t(se()),n("../")},onTransferClick:()=>{Z(a.analytics,"confirm",s,f,"Transfer"),t(De())},onSaveChangesToLocalStore:o=>{t(ve(o))},onFetchLinkTokenClick:o=>{t(Ee("treasury_setup",o))},onEstablishConnectionClick:o=>{t(Ae(o,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}}))(Ke),ht=({isFirstTransfer:t})=>{const a=F(),{tenantEmailDomain:n}=O(),r=B(),[m,s]=p.useState(!1),[f,o]=p.useState(!1),[u,i]=p.useState(!1),[d,w]=p.useState(!1),c=g((C=>C.treasurySetupViewState.fetchState)),l=g((C=>C.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),S=g((C=>C.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),y=g((C=>E(C))),x=A.getSignedInUserTenant(n)?.companyId??y.companyId,h=g((C=>je(C))),I=g((C=>U(C,x)));if(A.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return p.useEffect((()=>{f||c!=="Not-Started"||x==null||(o(!0),r(ae(x,!0,!1)))}),[f,c,x,r]),p.useEffect((()=>{u||l!=="Not-Started"||x==null||(i(!0),r(Q()))}),[u,l,x,r]),p.useEffect((()=>{d||S!=="Not-Started"||x==null||(w(!0),r(ne()))}),[d,S,x,r]),e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:j,onLoad:()=>{}}),e.jsx(gt,{analytics:j,navigate:a,transferDetails:h,onAnotherTransferClick:()=>{s(!1),r(se())},currentTenant:y,treasurySetupView:I,showReviewContent:m,maxInsuredAmount:5e5,onReviewClick:()=>{Z(j,"review",h.treasuryTransferMoneyLocalData,I.fundAllocationLocalData,"Transfer"),s(!0)},isFirstTransfer:t,setShowReviewContent:s,onBackClick:()=>{}})]})},St=R.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,7 +6,7 @@ import{j as e}from"./liveblocks-0jcT8Dx_.js";import{h as F,g as L,u as B,i as O,
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${t=>t.theme.colors.grey4};
|
|
9
|
-
`,xt={overlayWidth:new Xe(100,100,48)},Ct=N((function(t,a){const n=re(t),{companyId:r}=a;return{treasuryDetail:n,treasurySetupView:U(t,r),downloadEndPoint:`${K.bankingMicroServiceBaseUrl}/1.0/treasury-account/statements?query={"statement_type":"tax_statement"}`}}),(function(t,a){const{navigate:n,currentTenant:r,location:m,handleDrawerToggle:s,analytics:f,isCashManagementFeatureEnabled:o}=a,{tenantEmailDomain:u}=r;return{onSettingsClick:()=>{f.trackAccountsListPageClicked("Settings Icon"),n("setup")},onReloadTransactions:()=>{t(oe(!0))},handleTreasuryOptionSelection:i=>{let d="page-not-found";i==="editPortfolio"?d=wt(u):i==="statements"?d=It(u):i==="taxLetter"?d=Tt(u):i==="settings"&&(d=kt(u));const w=at(m.state?.pathnameStackToGoBack,m.pathname);n(d,{state:{pathnameStackToGoBack:w}})},onColumnSortConfigChanged:(i,d)=>{t(Be({uiState:{sortKey:i,sortOrder:d}}))},onTransferClick:()=>{n("./transfer")},onBackClick:()=>{n("../../")},onClickMenuIcon:()=>{s(!0)},onAutoTransferClick:()=>{n(o?"../../checking/cash_management/auto-transfer":"../../checking/auto-transfer")},onCashManagementClick:()=>{n(`/${u}/checking/cash_management`)}}}))(tt);function $({isTransferDrawerOpen:t,isEditPortfolioDrawerOpen:a}){const n=L(),r=F(),m=B(),s=J(),f=qe(),o=g((b=>E(b))),{tenantEmailDomain:u}=O(),i=o.companyId??A.getSignedInUserTenant(u)?.companyId,[d,w]=p.useState(!1),c=g((b=>re(b))),l=c.fetchState,S=c.accountSummary?.totalBalance?.amount,y=g((b=>b.treasurySetupViewState.treasuryFundsDetails?.fetchStatus)),x=o.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",h=_(),I=!!o.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,C=G(h?.loggedInUserRoleMap),M=
|
|
9
|
+
`,xt={overlayWidth:new Xe(100,100,48)},Ct=N((function(t,a){const n=re(t),{companyId:r}=a;return{treasuryDetail:n,treasurySetupView:U(t,r),downloadEndPoint:`${K.bankingMicroServiceBaseUrl}/1.0/treasury-account/statements?query={"statement_type":"tax_statement"}`}}),(function(t,a){const{navigate:n,currentTenant:r,location:m,handleDrawerToggle:s,analytics:f,isCashManagementFeatureEnabled:o}=a,{tenantEmailDomain:u}=r;return{onSettingsClick:()=>{f.trackAccountsListPageClicked("Settings Icon"),n("setup")},onReloadTransactions:()=>{t(oe(!0))},handleTreasuryOptionSelection:i=>{let d="page-not-found";i==="editPortfolio"?d=wt(u):i==="statements"?d=It(u):i==="taxLetter"?d=Tt(u):i==="settings"&&(d=kt(u));const w=at(m.state?.pathnameStackToGoBack,m.pathname);n(d,{state:{pathnameStackToGoBack:w}})},onColumnSortConfigChanged:(i,d)=>{t(Be({uiState:{sortKey:i,sortOrder:d}}))},onTransferClick:()=>{n("./transfer")},onBackClick:()=>{n("../../")},onClickMenuIcon:()=>{s(!0)},onAutoTransferClick:()=>{n(o?"../../checking/cash_management/auto-transfer":"../../checking/auto-transfer")},onCashManagementClick:()=>{n(`/${u}/checking/cash_management`)}}}))(tt);function $({isTransferDrawerOpen:t,isEditPortfolioDrawerOpen:a}){const n=L(),r=F(),m=B(),s=J(),f=qe(),o=g((b=>E(b))),{tenantEmailDomain:u}=O(),i=o.companyId??A.getSignedInUserTenant(u)?.companyId,[d,w]=p.useState(!1),c=g((b=>re(b))),l=c.fetchState,S=c.accountSummary?.totalBalance?.amount,y=g((b=>b.treasurySetupViewState.treasuryFundsDetails?.fetchStatus)),x=o.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",h=_(),I=!!o.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,C=G(h?.loggedInUserRoleMap),M=H(h?.loggedInUserRoleMap),{areTenantIdsInSync:P}=We();p.useEffect((()=>{l==="Not-Started"&&!d&&P&&(w(!0),m(oe(!0)))}),[d,m,l,P]),p.useEffect((()=>{c.transactionsFetchState.fetchState==="Completed"&&c.transactions.length===0&&!n.pathname.includes("transfer")&&C&&r("./transfer")}),[c.transactionsFetchState.fetchState,c.transactions.length]);const T=()=>{r("..")},[le,ue]=p.useState(!1),W=b=>{ue(b)},{isAiCfoAccessEnabled:de,onAskAiCfoClick:pe}=ut({mobileExploreReferrer:"Treasury"});Ye({isDataReady:l==="Completed"});const me=pt(),{useFeatureGate:V}=ie(),{isFeatureEnabled:fe}=V(v.isDebitCardFeatureEnabled),{isFeatureEnabled:ye}=V(v.isAutoTransferRuleEnabled),{isFeatureEnabled:ge}=V(v.isTreasuryCommentingEnabled),{isFeatureEnabled:he}=V(v.isCashManagementFeatureEnabled),Se=dt(i,{clearParams:l==="Completed"&&y?.fetchState==="Completed"}),xe=Fe(o),Ce=Le(fe,o);if(xe===!0&&Ce!==!0)return e.jsx(mt,{});if(x){const b=y?.fetchState!=="Completed"||c.accountSummaryFetchState.fetchState!=="Completed";return e.jsxs(e.Fragment,{children:[c.accountSummaryFetchState.fetchState==="Completed"&&y?.fetchState==="Completed"&&t===!1&&a===!1?e.jsx(z,{analytics:j,onLoad:()=>{}}):null,e.jsx(it,{onClose:T,anchor:"right",open:a||t,transitionDuration:250,PaperProps:{style:{width:xt.overlayWidth.valuePercentage(s),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:f.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsxs(jt,{onClick:we=>we.stopPropagation(),children:[t===!0?e.jsx(ht,{isFirstTransfer:c.transactions.length===0||S===0}):null,a===!0?e.jsx(yt,{}):null]})}),e.jsxs(St,{windowSize:s,children:[e.jsx(ce,{isAppContentDrawerOpen:le,handleDrawerToggle:W}),e.jsx(Ct,{treasuryDetailsView:c,isAutoTransferRuleEnabled:ye,navigate:r,currentTenant:o,location:n,companyId:i,analytics:j,cashManagementBannerProps:me,isCashManagementFeatureEnabled:he,isTreasuryCommentingEnabled:ge,handleDrawerToggle:W,initialOpenThreadRequest:Se,isLoading:b,isAiCfoAccessEnabled:de,onAskAiCfoClick:pe})]})]})}return I&&C?e.jsx(D,{to:"../setup"}):o.companyTreasuryInfo?.info&&!I&&M?e.jsx(D,{to:"../promo",state:n.state}):e.jsx(et,{fetchState:"In-Progress",style:{backgroundColor:f.colors.grey5}})}const wt=t=>`/${t}/treasury/edit-portfolio`,It=t=>`/${t}/treasury/statements`,Tt=t=>`/${t}/treasury/tax-letter`,kt=t=>`/${t}/treasury/setup`,jt=R(ct)`
|
|
10
10
|
display: flex;
|
|
11
11
|
min-height: 100%;
|
|
12
12
|
flex-direction: column;
|
|
@@ -26,7 +26,7 @@ import{j as e}from"./liveblocks-0jcT8Dx_.js";import{h as F,g as L,u as B,i as O,
|
|
|
26
26
|
flex-direction: column;
|
|
27
27
|
align-items: center;
|
|
28
28
|
background-color: ${t=>t.theme.colors.grey4};
|
|
29
|
-
`;function vt(){const t=F(),a=J(),n=L(),r=B(),m=`${K.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[s,f]=p.useState(!1),o=g((l=>Re(l)));p.useEffect((()=>{s||o.fetchState!=="Not-Started"||(f(!0),r(Me(!1)))}),[s,o.fetchState,r]);const u=A.getSignedInUser(),i=g((l=>E(l))),d={userId:u?.userId??"",sessionId:u?.zeniSessionId??"",tenantId:i.tenantId??""},w=i.company?.companyInfo.companyLegalName??i.companyName;if(u==null)throw Error("Can't access tax letter page without signing in...");const c=o.fetchState!=="Completed";return e.jsx(Et,{windowSize:a,children:e.jsx(st,{currentTenantCompanyName:w,taxLetterListView:o,isLoading:c,onBackClick:()=>{const l=q(n.state?.pathnameStackToGoBack),S=l.poppedPathname??"..";t(S,{state:{pathnameStackToGoBack:l.newStack}})},authParams:d,downloadEndPoint:m})})}const Dt=N((function(t,a){const{companyId:n}=a,r=U(t,n);return{treasurySetupView:r,isSetupComplete:r.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:r}=a;return{onSetupButtonClick:()=>{t(Ve(r))},onBackClick:()=>{n("../..",{relative:"path"})},onTreasurySetupSuccess:m=>{n(m?"..":"../setup",{relative:"path"})}}}))(rt),Ft=()=>{const t=F(),a=L(),n=B(),{tenantEmailDomain:r}=O(),[m,s]=p.useState(!1),f=g((h=>E(h))),[o,u]=p.useState(!1),i=g((h=>h.treasurySetupViewState.treasuryFundsDetails?.fetchStatus));p.useEffect((()=>{o||i?.fetchState!=="Not-Started"||d==null||(u(!0),n(
|
|
29
|
+
`;function vt(){const t=F(),a=J(),n=L(),r=B(),m=`${K.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[s,f]=p.useState(!1),o=g((l=>Re(l)));p.useEffect((()=>{s||o.fetchState!=="Not-Started"||(f(!0),r(Me(!1)))}),[s,o.fetchState,r]);const u=A.getSignedInUser(),i=g((l=>E(l))),d={userId:u?.userId??"",sessionId:u?.zeniSessionId??"",tenantId:i.tenantId??""},w=i.company?.companyInfo.companyLegalName??i.companyName;if(u==null)throw Error("Can't access tax letter page without signing in...");const c=o.fetchState!=="Completed";return e.jsx(Et,{windowSize:a,children:e.jsx(st,{currentTenantCompanyName:w,taxLetterListView:o,isLoading:c,onBackClick:()=>{const l=q(n.state?.pathnameStackToGoBack),S=l.poppedPathname??"..";t(S,{state:{pathnameStackToGoBack:l.newStack}})},authParams:d,downloadEndPoint:m})})}const Dt=N((function(t,a){const{companyId:n}=a,r=U(t,n);return{treasurySetupView:r,isSetupComplete:r.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:r}=a;return{onSetupButtonClick:()=>{t(Ve(r))},onBackClick:()=>{n("../..",{relative:"path"})},onTreasurySetupSuccess:m=>{n(m?"..":"../setup",{relative:"path"})}}}))(rt),Ft=()=>{const t=F(),a=L(),n=B(),{tenantEmailDomain:r}=O(),[m,s]=p.useState(!1),f=g((h=>E(h))),[o,u]=p.useState(!1),i=g((h=>h.treasurySetupViewState.treasuryFundsDetails?.fetchStatus));p.useEffect((()=>{o||i?.fetchState!=="Not-Started"||d==null||(u(!0),n(Q()))}),[i,n]);const d=A.getSignedInUserTenant(r)?.companyId??f.companyId,w=A.getSignedInUser(),c=!!f.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,l=h=>{s(h)};if(w==null)throw Error("Can't access treasury promo page without signing in...");const S=_(),y=G(S?.loggedInUserRoleMap),x=H(S?.loggedInUserRoleMap);if(c&&y)return e.jsx(D,{to:"../../treasury/setup"});if(f.company?.companyTreasuryInfo&&(!c&&y||x)){if(a.state?.message==="activation"){const h=q(a.state?.pathnameStackToGoBack);t(a.pathname,{state:{...a.state,message:void 0,pathnameStackToGoBack:h.newStack}})}return i?.fetchState!=="Completed"?e.jsx(te,{children:e.jsx(Y,{size:"ExtraLarge",start:!0})}):e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:j,onLoad:h=>(I=>I.trackTreasuryPromoView("Treasury Promo Page"))(h)}),e.jsx(ce,{isAppContentDrawerOpen:m,handleDrawerToggle:l}),e.jsx(Dt,{analytics:j,navigate:t,companyId:d,onClickMenuIcon:()=>{l(!0)}})]})}return e.jsx(te,{children:e.jsx(Y,{size:"ExtraLarge",start:!0})})},te=R.div`
|
|
30
30
|
display: flex;
|
|
31
31
|
width: 100%;
|
|
32
32
|
height: 100%;
|
|
@@ -34,4 +34,4 @@ import{j as e}from"./liveblocks-0jcT8Dx_.js";import{h as F,g as L,u as B,i as O,
|
|
|
34
34
|
justify-content: center;
|
|
35
35
|
align-items: center;
|
|
36
36
|
background-color: ${t=>t.theme.colors.grey5};
|
|
37
|
-
`;function na(){const t=L(),a=g((I=>E(I))),{useFeatureGate:n}=ie(),r=a.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",m=!!a.company?.companyTreasuryInfo?.isTreasuryTOSAccepted,s=_(),f=
|
|
37
|
+
`;function na(){const t=L(),a=g((I=>E(I))),{useFeatureGate:n}=ie(),r=a.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",m=!!a.company?.companyTreasuryInfo?.isTreasuryTOSAccepted,s=_(),f=H(s?.loggedInUserRoleMap),o=a?.userRole!=null&&Oe(a?.userRole),u=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!o)&&Ne(s?.loggedInUserRoleMap),i=Ge(s?.loggedInUserRoleMap),d=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!o)&&_e(s?.loggedInUserRoleMap),w=!!a.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!o&&ze(s?.loggedInUserRoleMap),c=r&&!o&&G(s?.loggedInUserRoleMap),{isFeatureEnabled:l}=n(v.isChargeCardFeatureEnabled),{isFeatureEnabled:S}=n(v.isDebitCardFeatureEnabled),y=ot(a,l,S)&&!o&&$e(s?.loggedInUserRoleMap),x=Ze(s?.loggedInUserRoleMap),h=Qe(s?.loggedInUserRoleMap);return e.jsxs(Ie,{children:[h?null:e.jsx(k,{path:"setup",element:e.jsx(X,{isBillPayAdminLevelAccess:u,isReimbursementAdminLevelAccess:d,isZeniAccountAdminLevelAccess:w,isChargeCardAdminLevelAccess:y,isTreasuryAdminLevelAccess:c,isUserHasOnlyCardAccess:x,isUserHasOnlyBillPayAccess:i,productType:"zeni_treasury",type:"setup"})}),h?null:e.jsx(k,{path:"verification",element:e.jsx(X,{isBillPayAdminLevelAccess:u,isUserHasOnlyBillPayAccess:i,isReimbursementAdminLevelAccess:d,isZeniAccountAdminLevelAccess:w,isChargeCardAdminLevelAccess:y,isTreasuryAdminLevelAccess:c,isUserHasOnlyCardAccess:x,productType:"zeni_treasury",type:"verification"})}),e.jsx(k,{path:"promo",element:e.jsx(Ft,{})}),e.jsx(k,{path:"statements",element:e.jsx(At,{})}),e.jsx(k,{path:"tax-letter",element:e.jsx(vt,{})}),r?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"/",element:e.jsx($,{isTransferDrawerOpen:!1,isEditPortfolioDrawerOpen:!1})}),c?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"edit-portfolio",element:e.jsx($,{isEditPortfolioDrawerOpen:!0,isTransferDrawerOpen:!1})}),e.jsx(k,{path:"transfer",element:e.jsx($,{isTransferDrawerOpen:!0,isEditPortfolioDrawerOpen:!1})})]}):null,e.jsx(k,{path:"*",element:e.jsx(lt,{})})]}):m&&c?e.jsx(k,{path:"*",element:e.jsx(D,{to:"../setup"})}):a.company?.companyZeniAccountInfo&&f?e.jsx(k,{path:"*",element:e.jsx(D,{to:"../promo",state:t.state})}):e.jsx(k,{path:"*",element:null})]})}export{na as default};
|