@zeniai/web-app-ui 5.4.21-qa → 5.4.22-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/{AccountMappingScreen-DSIWi6s5.js → AccountMappingScreen-C5mOiJ2U.js} +2 -2
- package/dist/assets/ActualMatchingMatchDetailScreen-wHD8fSWU.js +1 -0
- package/dist/assets/AddressRoutes-CVWN9CJv.js +1 -0
- package/dist/assets/AddressScreen-DgUwrml_.js +9 -0
- package/dist/assets/AiCfoScreen-yDQ2sphg.js +22 -0
- package/dist/assets/{AppDrawer-DXTltxSC.js → AppDrawer-DzYZBC2G.js} +3 -3
- package/dist/assets/{BillPayApprovalRoutes-B5OXFSfw.js → BillPayApprovalRoutes-BcCgse3-.js} +1 -1
- package/dist/assets/BillPayRoutes-HAS0-pNc.js +119 -0
- package/dist/assets/BusinessVerificationPageScreen-DM_jBIuD.js +9 -0
- package/dist/assets/CardsAiCfoScreen-yrI2CL7M.js +14 -0
- package/dist/assets/ChargeCardRoutes-DgtmFgR6.js +71 -0
- package/dist/assets/CompanyPassportScreen-BLtXgkEd.js +1 -0
- package/dist/assets/ConnectionAuthScreen-CuZmfRIp.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-BjmJLllh.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-CCsjVlGs.js → CustomerOnboardingRoutes-C0b805o-.js} +7 -7
- package/dist/assets/CustomersRoutes-DD5Gx1mW.js +8 -0
- package/dist/assets/DashboardRoutes-C8RZkkYj.js +20 -0
- package/dist/assets/DefaultTenantHome-C6Ygdgwt.js +1 -0
- package/dist/assets/DomesticWireDetailScreen-BxClNf2J.js +18 -0
- package/dist/assets/DrawerScreen-BHaectiO.js +1 -0
- package/dist/assets/EntityDetailRoutes-BJzuW7dq.js +1 -0
- package/dist/assets/ExpenseAutomationRoutes-BKrWZyYV.js +38 -0
- package/dist/assets/FallBackRoute-DuMHkNqk.js +2 -0
- package/dist/assets/FeaturePreviewScreen-DHt0WFS8.js +1 -0
- package/dist/assets/HubSpotOAuthCallbackScreen-Di0pbhHE.js +1 -0
- package/dist/assets/{InboxNotificationsProvider-CR8M19mz.js → InboxNotificationsProvider-CiKEEv6Q.js} +1 -1
- package/dist/assets/InvoicingRoutes-Bsq4ym98.js +3 -0
- package/dist/assets/MagicLinkRoutes-DJX5Nm1n.js +72 -0
- package/dist/assets/MagicLinkSignInScreen-CD7Pya_j.js +12 -0
- package/dist/assets/MobileAppDrawer-BWNb5zLN.js +1 -0
- package/dist/assets/NotFoundScreen-DXy-BCit.js +1 -0
- package/dist/assets/NotificationRoutes-B2xHVaqf.js +1 -0
- package/dist/assets/OAuthConsentScreen-BA2eBLib.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-Dm5Vnr71.js +1 -0
- package/dist/assets/PaymentLinkScreen-CndVAq3p.js +21 -0
- package/dist/assets/PeopleRoutes-kralZgbz.js +22 -0
- package/dist/assets/PerformanceRoutes-DJhuo9qY.js +1 -0
- package/dist/assets/{Preview-DY7J6hF2.js → Preview--c8D4GAG.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-CUY1FKXU.js → QBOConnectionScreen-DroXrkno.js} +2 -2
- package/dist/assets/ReimbursementApprovalRoutes-B2ftFL0O.js +1 -0
- package/dist/assets/ReimbursementApprovalRuleDetailScreen-CHTcY28V.js +1 -0
- package/dist/assets/{ReimbursementRoutes-BGuB1qNk.js → ReimbursementRoutes-CI3m7PHD.js} +9 -9
- package/dist/assets/ReportsRoutes-C7A0Ycu_.js +1 -0
- package/dist/assets/RewardsRoutes-Dkg4zGB8.js +1 -0
- package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-CY17Raf2.js → ScheduleDetailsPrepaidExpensesScreen-ZwdXW6K5.js} +5 -5
- package/dist/assets/ScreenRoutes-B_WT7FAm.js +2 -0
- package/dist/assets/{SettingsRoutes-ClmD3D2-.js → SettingsRoutes-_XBnyBgG.js} +6 -6
- package/dist/assets/{SetupPagesScreen-CZUQQDiy.js → SetupPagesScreen-D6ssIWb0.js} +5 -5
- package/dist/assets/SignInScreen-H_SOl_FQ.js +1 -0
- package/dist/assets/SignOutScreen-OFswrnt8.js +9 -0
- package/dist/assets/{TaskListScreen-DpbqjWaF.js → TaskListScreen-Bmj5V_dR.js} +2 -2
- package/dist/assets/TaskRoutes-D6cEqDZN.js +9 -0
- package/dist/assets/TransactionDetailRoutes-D-b6zdg4.js +1 -0
- package/dist/assets/TransactionDetailScreen-JBKbtouq.js +5 -0
- package/dist/assets/TransactionListRoutes-THtfycHC.js +1 -0
- package/dist/assets/TreasuryRoutes-CgHwdyKd.js +37 -0
- package/dist/assets/{VendorsRoutes-CyzrLUAk.js → VendorsRoutes-jETcYESc.js} +18 -18
- package/dist/assets/WiseConfirmationScreen-BpRHCykr.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-vedqKXJ2.js → ZeniAccountRoutes-C8cr5UMy.js} +11 -11
- package/dist/assets/ZeniAccountStatementScreen-DAs1_LIC.js +9 -0
- package/dist/assets/{accountMappingHelper-6DbklLyK.js → accountMappingHelper-DSd2V454.js} +1 -1
- package/dist/assets/{analytics-CFxWPAfp.js → analytics-Vgn85Ur_.js} +4 -4
- package/dist/assets/analyticsHelper-CWMk7_rd.js +1 -0
- package/dist/assets/{core-Dj_sc5JU.js → core-CbdTrw7T.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-CruFQaAA.js → decodeURIComponentSafe-D7APy95S.js} +1 -1
- package/dist/assets/{dnd-5Q4l7GBy.js → dnd-DuiAlI7w.js} +1 -1
- package/dist/assets/empty-B1nH_ieU.js +1 -0
- package/dist/assets/{empty-90bgzNqS.js → empty-CjoB5KP4.js} +1 -1
- package/dist/assets/{emptyVideoElement-CG1lrSja.js → emptyVideoElement-B6iUrc8S.js} +1 -1
- package/dist/assets/epic-CCMzkkv8.js +2 -0
- package/dist/assets/expenseAutomationHelper-CgTsmmCm.js +1 -0
- package/dist/assets/getLocaleForTenant-B8EqveGi.js +1 -0
- package/dist/assets/{index-CknpfAr_.js → index-BFdcFsSo.js} +1 -1
- package/dist/assets/index-BNFAuGus.js +1 -0
- package/dist/assets/{index-CY0VD1jn.js → index-CnIO6_IQ.js} +14764 -14764
- package/dist/assets/{index-D3GdhLCV.js → index-DjPsG1Xt.js} +1 -1
- package/dist/assets/{index-DgM5Gz01.js → index-LGKtWUy9.js} +1 -1
- package/dist/assets/{index-LWpD9GrX.js → index-naWU0Itr.js} +2 -2
- package/dist/assets/{empty-UDJfEj2S.js → index-pWh5QyXZ.js} +1 -1
- package/dist/assets/{index-CGFget0-.js → index-wSCaSCb5.js} +1 -1
- package/dist/assets/{lexical-BzjAp4AL.js → lexical-B-vxEaRQ.js} +1 -1
- package/dist/assets/{liveblocks-ByIxqWJk.js → liveblocks-BLpmr1Pv.js} +15 -15
- package/dist/assets/{lottie-CelagD5x.js → lottie-Lb1ftKY1.js} +1 -1
- package/dist/assets/{mui-BYXLmEqm.js → mui-DNGY4bFU.js} +2 -2
- package/dist/assets/{pathToGoBack-BzjAj2pA.js → pathToGoBack-CJCquoqC.js} +1 -1
- package/dist/assets/{pdf-Ctx2ExfD.js → pdf-B1uD4Ovv.js} +3 -3
- package/dist/assets/{pdf-lib-CZyWp-Tq.js → pdf-lib-BKN88Kre.js} +1 -1
- package/dist/assets/{plaid-CLiLant-.js → plaid-DhfTjhua.js} +1 -1
- package/dist/assets/{pusher-4U4JTU2d.js → pusher-BPtf_EL-.js} +1 -1
- package/dist/assets/{react-BEae2nKv.js → react-B10NZVQI.js} +1 -1
- package/dist/assets/{react-DsOnQCnT.js → react-BAEKpD-r.js} +1 -1
- package/dist/assets/{react-BzAF6y_Y.js → react-Bhjp4pzB.js} +1 -1
- package/dist/assets/{react-CB4BsLSa.js → react-DEDzyvMl.js} +1 -1
- package/dist/assets/{react-RNadsjUA.js → react-DGl2P4dK.js} +1 -1
- package/dist/assets/{react-BsM3F52d.js → react-arX5WESX.js} +1 -1
- package/dist/assets/{recharts-PGbaLytC.js → recharts-CTh_JhT_.js} +1 -1
- package/dist/assets/{reportTimeframe-Dl2MfTSY.js → reportTimeframe-DeLnONFM.js} +1 -1
- package/dist/assets/{routePaths-CsEd-Pbs.js → routePaths-CV12X_S-.js} +1 -1
- package/dist/assets/{sentry-9XsSr7sR.js → sentry-DWNq3t8E.js} +2 -2
- package/dist/assets/{stripSplatSuffix-BjmSkzFi.js → stripSplatSuffix-DP9nmQOu.js} +1 -1
- package/dist/assets/{url-CHBhwoFp.js → url-B2x9G6No.js} +4 -4
- package/dist/assets/{url-Bl9O_rxx.js → url-BqlXUDAr.js} +1 -1
- package/dist/assets/useActualMatchingMatchDetail-D-Ym3wTm.js +1 -0
- package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-Dqg5VVaq.js +1 -0
- package/dist/assets/useAskAiCfoHostNavButtonProps-DXFswt7R.js +1 -0
- package/dist/assets/useChargeCardPusherEvents-Cq6Y4mMW.js +1 -0
- package/dist/assets/{useDeviceId-D9z31npB.js → useDeviceId-dj9QS4Ga.js} +1 -1
- package/dist/assets/useEmailConnectResultRefresh-qgk6N8cm.js +1 -0
- package/dist/assets/useEnsureVendorListLoaded-CIShbpK4.js +1 -0
- package/dist/assets/useInitialThreadRequest-DAUsQlCl.js +1 -0
- package/dist/assets/useIsCustomersTabEnabled-C6mkabn2.js +1 -0
- package/dist/assets/useTaskManagerAccess-Cm5trA3i.js +1 -0
- package/dist/assets/useTaskManagerPusherEvents-C1gzc-aA.js +1 -0
- package/dist/assets/{utils-DI6OGGjP.js → utils-CrhrpmD8.js} +2 -2
- package/dist/assets/{withTransactionSidePanel-BoHm4v8l.js → withTransactionSidePanel-D-hDwbdr.js} +5 -5
- package/dist/assets/{zeni-epic-state-RN9etYeQ.js → zeni-epic-state-C5DO1jkr.js} +7 -7
- package/dist/index.html +1 -1
- package/package.json +4 -4
- package/dist/assets/ActualMatchingMatchDetailScreen-fiFb522S.js +0 -1
- package/dist/assets/AddressRoutes-CZXccJVo.js +0 -1
- package/dist/assets/AddressScreen-D9ytAzo4.js +0 -9
- package/dist/assets/AiCfoScreen-CkU9Vttb.js +0 -22
- package/dist/assets/BillPayRoutes-BdnvTGKc.js +0 -119
- package/dist/assets/BusinessVerificationPageScreen-IdWkVeTs.js +0 -9
- package/dist/assets/CardsAiCfoScreen-Cj86rJgb.js +0 -14
- package/dist/assets/ChargeCardRoutes-DcPAOx8X.js +0 -71
- package/dist/assets/CompanyPassportScreen-DqB5oBcd.js +0 -1
- package/dist/assets/ConnectionAuthScreen-2sFx8558.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-BZZUKU2D.js +0 -1
- package/dist/assets/CustomersRoutes-b_GBDyKW.js +0 -8
- package/dist/assets/DashboardRoutes-DpXCoqPl.js +0 -20
- package/dist/assets/DefaultTenantHome-IBYOPnwd.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-ClicUNfX.js +0 -18
- package/dist/assets/DrawerScreen-1iiJqYPf.js +0 -1
- package/dist/assets/EntityDetailRoutes-DGjLGj1f.js +0 -1
- package/dist/assets/ExpenseAutomationRoutes-nEe3PFTP.js +0 -38
- package/dist/assets/FeaturePreviewScreen-CWeorrAP.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-rjJ7of46.js +0 -1
- package/dist/assets/InvoicingRoutes-WYyYgKyd.js +0 -3
- package/dist/assets/MagicLinkRoutes-CxOsj948.js +0 -72
- package/dist/assets/MagicLinkSignInScreen-CMCs7o4p.js +0 -12
- package/dist/assets/MobileAppDrawer-B4DreqQy.js +0 -1
- package/dist/assets/NotFoundScreen-qzMvf835.js +0 -1
- package/dist/assets/NotificationRoutes-B5b-HM0B.js +0 -1
- package/dist/assets/OAuthConsentScreen-BSYOAgnX.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-BAqDgcrm.js +0 -1
- package/dist/assets/PaymentLinkScreen-uBCPj7U-.js +0 -21
- package/dist/assets/PeopleRoutes-CsLCmyJ2.js +0 -22
- package/dist/assets/PerformanceRoutes-DBaA-VPu.js +0 -1
- package/dist/assets/ReimbursementApprovalRoutes-BU3j473F.js +0 -1
- package/dist/assets/ReimbursementApprovalRuleDetailScreen-Cwcu8o11.js +0 -1
- package/dist/assets/ReportsRoutes-D3JsKyFt.js +0 -1
- package/dist/assets/RewardsRoutes-Y44oe2Vc.js +0 -1
- package/dist/assets/ScreenRoutes-DWsCKyWW.js +0 -2
- package/dist/assets/SignInScreen-D6NmDWFW.js +0 -1
- package/dist/assets/SignOutScreen-Bq9qzL9T.js +0 -9
- package/dist/assets/TaskRoutes-BF3MK68Y.js +0 -9
- package/dist/assets/TransactionDetailRoutes-B9-OGoe1.js +0 -1
- package/dist/assets/TransactionDetailScreen-P7tVSby5.js +0 -5
- package/dist/assets/TransactionListRoutes-rF93JJZz.js +0 -1
- package/dist/assets/TreasuryRoutes-CXZ3GK1g.js +0 -37
- package/dist/assets/WiseConfirmationScreen-B5Y7a2RT.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-BlGO2V-T.js +0 -9
- package/dist/assets/analyticsHelper-Cz_Jj03m.js +0 -1
- package/dist/assets/epic-COLv6VHe.js +0 -2
- package/dist/assets/expenseAutomationHelper-Cl03EVHW.js +0 -1
- package/dist/assets/getLocaleForTenant-Cb0gGUXK.js +0 -1
- package/dist/assets/index-CupGsprQ.js +0 -1
- package/dist/assets/index-fIzifU8E.js +0 -1
- package/dist/assets/useActualMatchingMatchDetail-B1mBWE-P.js +0 -1
- package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-BjbLlJPK.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-KhabBRdb.js +0 -1
- package/dist/assets/useChargeCardPusherEvents-CAaJDucS.js +0 -1
- package/dist/assets/useEmailConnectResultRefresh-h6IoQxvO.js +0 -1
- package/dist/assets/useEnsureVendorListLoaded-vYAJo8rK.js +0 -1
- package/dist/assets/useInitialThreadRequest-BsXsay8_.js +0 -1
- package/dist/assets/useIsCustomersTabEnabled-CjgNHh2z.js +0 -1
- package/dist/assets/useTaskManagerAccess-5u2jYjXE.js +0 -1
- package/dist/assets/useTaskManagerPusherEvents-BZR3VVVu.js +0 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{j as i}from"./liveblocks-BLpmr1Pv.js";import Te from"./NotFoundScreen-DXy-BCit.js";import{a as u}from"./sentry-DWNq3t8E.js";import{h as ee,u as ae,j as g,g as ge,i as he,N as Ee,l as be,n as De,o as h}from"./core-CbdTrw7T.js";import{QX as se,Q_ as Ie,QU as Re,a26 as Ce,fJ as te,a1Z as ne,Rm as b,Rc as E,QR as _e,RR as ye,RK as Ge,a27 as oe,gl as re,a28 as X,a29 as Ue,QN as Ae,QK as ve,vr as we,vf as xe,mL as Be,Ra as je,a2a as Pe,S1 as Ke,R6 as Le,Rw as Fe,Rt as Ne,R1 as $e,Rq as Ze,Rl as ze}from"./zeni-epic-state-C5DO1jkr.js";import{z as D,dj as Oe,j as Qe,p as Ve,_,a5 as ie,s as y,a9 as qe,c as J,R as Me,dk as We,W as Y,af as Xe}from"./index-CnIO6_IQ.js";import{n as Je}from"./mui-DNGY4bFU.js";import{u as Ye}from"./useInitialThreadRequest-DAUsQlCl.js";import{M as He}from"./MobileAppDrawer-BWNb5zLN.js";import{T as m,t as ea,b as aa,a as sa,c as ta,d as H,e as na}from"./TaskListScreen-Bmj5V_dR.js";import{u as oa}from"./useTaskManagerPusherEvents-C1gzc-aA.js";import"./recharts-CTh_JhT_.js";import"./analytics-Vgn85Ur_.js";import"./plaid-DhfTjhua.js";import"./dnd-DuiAlI7w.js";import"./stripe-cKAAJElX.js";import"./lottie-Lb1ftKY1.js";import"./lexical-B-vxEaRQ.js";import"./pdf-B1uD4Ovv.js";import"./utils-CrhrpmD8.js";import"./InboxNotificationsProvider-CiKEEv6Q.js";import"./useTaskManagerAccess-Cm5trA3i.js";import"./useIsCustomersTabEnabled-C6mkabn2.js";import"./useAskAiCfoHostNavButtonProps-DXFswt7R.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="67eb8f7f-d686-432c-82ce-bcfac5be1cc1",e._sentryDebugIdIdentifier="sentry-dbid-67eb8f7f-d686-432c-82ce-bcfac5be1cc1")}catch{}})();function ra(){const e=ee(),a=ae(),n=D.getSignedInUser(),{cannedResponses:c,fetchState:t,saveFetchState:l}=g((r=>r.cannedResponsesState)),d=u.useCallback((()=>{a(se())}),[a]),S=u.useCallback(((r,I,R)=>{a(Ie({name:r,content:I,cannedResponseId:R}))}),[a]),s=u.useCallback((r=>{a(Re({cannedResponseId:r}))}),[a]);if(n==null)throw Error("Can't access quick responses page without signing in...");return i.jsx(Oe,{cannedResponses:c,isLoading:t==="In-Progress"||t==="Not-Started",isSaving:l==="In-Progress",onBackClick:()=>e(-1),onDelete:s,onFetch:d,onSave:S})}const F=e=>e?.taskState?.taskByID,K=(e,a)=>{const n=F(e);if(a!=null&&n!=null)return n[a]?.parentTaskId??void 0},ia=Ce([K,(e,a)=>{const n=K(e,a),c=F(e);if(n!=null&&c!=null)return c[n]?.name},(e,a)=>{const n=K(e,a),c=F(e);return n!=null&&c!=null&&c[n]!=null}],((e,a,n)=>{if(e!=null&&n===!0)return{id:e,name:a??""}})),ca=be((function(e,a){const{location:n,taskGroupId:c}=a,t=oe(e,a.taskId),l=te(e),d=ia(e,a.taskId),S=t.taskGroupId??c,s=S!=null?X(e.taskGroupState,S):void 0,r=D.getSignedInUser(),I=l.tenantId,R={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:I??""},v=ne(e),{tenantEmailDomain:w}=l,G=t.recurringSourceTaskId,x=G!=null?`${Y.appUrl}/${w}/tasks/${encodeURIComponent(G)}`:void 0;return{taskDetailSelectorView:t,authParams:R,isZeniUser:D.isZeniUser(),userGroupList:Ue(e),isNewClicked:n.state?.message==="comingFromTaskListPage",filesEndPoint:Xe.fileMicroServiceBaseUrl,companyName:a.currentTenant.companyName,companyId:a.currentTenant.companyId,currentUrl:`${Y.appUrl}${a.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:x,tagListView:v,taskGroupName:S!=null&&s!=null&&s.isDefault===!1?s.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map((f=>X(e.taskGroupState,f))).filter((f=>f!=null&&!f.isDeleted)).map((f=>({id:f.id,name:f.name,isDefault:f.isDefault}))),subtasks:t.subtasks,parentTaskRef:d,subTaskCreateStatus:e.taskDetailState?.subTaskCreateStatus?.fetchState}}),(function(e,a){const{taskId:n,navigate:c,currentTenant:t,location:l,taskGroupId:d}=a,{tenantEmailDomain:S}=t;return{onSaveChangesToLocalStore:s=>{e(ze({taskDetailLocalData:s,taskId:n}))},onSaveDetailClick:s=>{e(Ze(n,s??d))},onArchiveTaskClick:()=>{a.taskId!=null&&e($e(a.taskId))},onSnoozeTask:(s,r)=>{e(Ne(s,r))},onUnsnoozeTask:s=>{e(Fe(s))},onCreateSubtask:(s,r)=>{e(Le({...r,parentTaskId:s}))},onSubtaskUpdate:(s,r)=>{e(Ke({task:s,updates:r}))},onShowToast:s=>{e(re(s))},onSubtaskRowClick:s=>{c(`/${S}/tasks/${s}`,{state:{pathnameStackToGoBack:y(l.state?.pathnameStackToGoBack,l.pathname)}})},onParentBreadcrumbClick:s=>{c(`/${S}/tasks/${s}`,{state:{pathnameStackToGoBack:y(l.state?.pathnameStackToGoBack,l.pathname)}})},onDismissClick:()=>{if(l.state?.message==="triggerBackClick"){const s=ie(l.state?.pathnameStackToGoBack),r=s.poppedPathname??"../../dashboard";c(r,{state:{pathnameStackToGoBack:s.newStack}})}else{const s=A(S),r=y(l.state?.pathnameStackToGoBack,l.pathname);c(s,{state:{pathnameStackToGoBack:r}})}e(Pe({taskId:n}))},onDeleteTaskClick:()=>{e(je(n))},updateFilesEntity:s=>{e(Be({files:s}))},onDeleteFile:s=>{e(xe(s))},onEditFileName:(s,r)=>{e(we(s,r.split(".")[0]))},onReloadTaskDetailPage:()=>{e(b(!1,n))},onCreateTagClick:s=>{e(ve(s,n))},onDeleteTagClick:s=>{e(Ae(s,n))},onFetchCannedResponses:()=>{e(se())},onManageTemplatesClick:()=>{c(`/${t.tenantEmailDomain}/tasks/quick-responses`)}}}))(We);function L(){const e=ee(),a=ae(),n=ge(),c=Qe(),{taskId:t,taskGroupId:l}=he(),d=g((o=>te(o))),S=Ye(d?.companyId),{useFeatureGate:s}=Ve(),{isFeatureEnabled:r}=s(_.isTaskSnoozeEnabled),{isFeatureEnabled:I}=s(_.isTaskVisibilityEnabled),{isFeatureEnabled:R}=s(_.isTaskCannedResponsesEnabled),{isFeatureEnabled:v}=s(_.isTaskRecurringParentEnabled),{isFeatureEnabled:w}=s(_.isTaskGroupAssigneesEnabled),[G,x]=u.useState(!1),[f,ce]=u.useState(!1),[N,le]=u.useState(!1),[$,B]=u.useState(!1),C=u.useRef(!1),U=g((o=>o.taskListState.updateTasksFetchState.fetchState)),Z=g((o=>ne(o))),z=g((o=>o.taskGroupViewState.fetchState));u.useEffect((()=>{a(b(!1,t)),t!=null&&a(E(t))}),[a,t]);const O=D.getSignedInUser()?.userId,de=D.isZeniUser(),ke=g((o=>t!=null?o.taskState.taskByID[t]?.syncToken:void 0)),Q=()=>{d?.tenantEmailDomain!=null&&e(A(d.tenantEmailDomain))},V=()=>{a(re({messageSection:"delete_task",messageText:"success",type:"success"})),Q()},ue=u.useMemo((()=>{const o=[m.TASK_CREATED,m.TASK_UPDATED,m.TASKS_BULK_UPDATED,m.TASKS_BULK_DELETED],k=[...o,m.TASK_SNOOZE_RESURFACED];return[...aa(d?.companyId,o),...sa(O,k)]}),[d?.companyId,O]);oa({events:ue,onSubscribed:()=>{t!=null&&(a(b(!0,t)),a(E(t)))},onEvent:(o,k)=>{if(t!=null)switch(o){case m.TASK_CREATED:case m.TASK_UPDATED:{const p=((P,me,{isZeniUser:Se,storedSyncToken:fe,taskId:W})=>{if(P!==m.TASK_CREATED&&P!==m.TASK_UPDATED)return"none";const T=ea(me);return T==null?"none":T.parent_task_id===W?"refreshSubtasks":P!==m.TASK_UPDATED||T.task_id!==W?"none":T.is_deleted===!0?"leaveDeleted":T.is_private!==!0||Se?T.sync_token!=null&&T.sync_token===fe?"none":"refreshTask":"leaveNoAccess"})(o,k,{isZeniUser:de,storedSyncToken:ke,taskId:t});p==="refreshTask"?(a(b(!0,t)),a(E(t))):p==="refreshSubtasks"?a(E(t)):p==="leaveDeleted"?V():p==="leaveNoAccess"&&Q();break}case m.TASKS_BULK_UPDATED:{const p=H(k);if(p==null)break;p.task_ids.includes(t)&&a(b(!0,t)),a(E(t));break}case m.TASKS_BULK_DELETED:{const p=H(k);if(p==null)break;if(p.task_ids.includes(t)){V();break}a(E(t));break}case m.TASK_SNOOZE_RESURFACED:{ta(k)?.task_id===t&&a(b(!0,t));break}}}}),u.useEffect((()=>{f||Z.fetchState==="Completed"||(ce(!0),a(_e()))}),[f,a,Z.fetchState]),u.useEffect((()=>{N||z==="Completed"||(le(!0),a(ye()))}),[N,a,z]);const pe=u.useCallback((()=>{t!=null&&(C.current=!1,a(Ge([t],null,{isArchived:!1})),B(!0))}),[a,t]);u.useEffect((()=>{if($)if(U!=="In-Progress"){if(C.current){if(U==="Error")return B(!1),void(C.current=!1);if(U==="Completed"){B(!1),C.current=!1;const{tenantEmailDomain:o}=d;if(n.state?.message==="triggerBackClick"){const k=ie(n.state?.pathnameStackToGoBack);e(k.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:k.newStack}})}else{const k=A(o);e(k,{state:{pathnameStackToGoBack:y(n.state?.pathnameStackToGoBack,n.pathname)}})}}}}else C.current=!0}),[$,U,d,n,e]);const q=g((o=>oe(o,t))),j=q.fetchState,M=D.getSignedInUser();if(M==null)throw Error("Can't access task detail page without signing in...");if(j==="Error"&&q.error?.code===400){const{tenantEmailDomain:o}=d,k=A(o),p=y(n.state?.pathnameStackToGoBack,n.pathname);return i.jsx(Ee,{to:k,state:{pathnameStackToGoBack:p}})}return i.jsxs(i.Fragment,{children:[j==="Completed"?i.jsx(qe,{analytics:J,onLoad:o=>(k=>k.trackPageLoaded(Me.Event.taskDetailPage))(o)}):null,i.jsxs(la,{children:[i.jsx(He,{isAppContentDrawerOpen:G,handleDrawerToggle:o=>{x(o)}}),i.jsx(ca,{analytics:J,currentTenant:d,handleZeniLogoClick:()=>{c.toggle()},initialOpenThreadRequest:S,location:n,loggedInUser:M,navigate:e,taskGroupId:l,taskId:t,taskDetailFetchState:j,onUnarchiveTaskClick:pe,isTaskSnoozeEnabled:r,isTaskVisibilityEnabled:I,isTaskCannedResponsesEnabled:R,isTaskRecurringParentEnabled:v,isTaskGroupAssigneesEnabled:w})]})]})}const la=Je.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
+
`,A=e=>`/${e}/tasks`;function Ba(){return i.jsxs(De,{children:[i.jsx(h,{path:"/new",element:i.jsx(L,{})}),i.jsx(h,{path:"/new/:taskGroupId",element:i.jsx(L,{})}),i.jsx(h,{path:"/group/:taskGroupId",element:i.jsx(na,{})}),i.jsx(h,{path:"/quick-responses",element:i.jsx(ra,{})}),i.jsx(h,{path:"/:taskId",element:i.jsx(L,{})}),i.jsx(h,{path:"*",element:i.jsx(Te,{})})]})}export{Ba as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as c}from"./liveblocks-BLpmr1Pv.js";import G from"./NotFoundScreen-DXy-BCit.js";import{a as n}from"./sentry-DWNq3t8E.js";import{u as ft,h as yt,g as bt,i as St,j as o,n as ht,o as f}from"./core-CbdTrw7T.js";import{fJ as It,g_ as Lt,mb as Tt,uG as jt,a2w as Ct,VY as Et,a2x as gt,Sm as At,Sn as kt,ib as L,m9 as vt,uH as xt,Sc as Dt,SN as _t,a2y as Nt,a2z as wt,Sj as Ft,Sg as Mt,a2A as Ht,a2B as Rt,a2C as zt}from"./zeni-epic-state-C5DO1jkr.js";import{p as Pt,V as Ut,_ as U,dt as qt,z as Bt,m as Vt,ci as Gt,c as q,du as $t,af as Ot,G as Jt}from"./index-CnIO6_IQ.js";import"./mui-DNGY4bFU.js";import{d as Qt}from"./decodeURIComponentSafe-D7APy95S.js";import{u as Wt}from"./useEnsureVendorListLoaded-CIShbpK4.js";import{a as Yt,i as T}from"./TransactionDetailScreen-JBKbtouq.js";import{t as Kt}from"./routePaths-CV12X_S-.js";import"./recharts-CTh_JhT_.js";import"./analytics-Vgn85Ur_.js";import"./plaid-DhfTjhua.js";import"./dnd-DuiAlI7w.js";import"./stripe-cKAAJElX.js";import"./lottie-Lb1ftKY1.js";import"./lexical-B-vxEaRQ.js";import"./pdf-B1uD4Ovv.js";import"./utils-CrhrpmD8.js";import"./useAskAiCfoHostNavButtonProps-DXFswt7R.js";import"./useInitialThreadRequest-DAUsQlCl.js";import"./expenseAutomationHelper-CgTsmmCm.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new e.Error().stack;d&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[d]="59be1240-177c-4557-adae-d1b9f879e74e",e._sentryDebugIdIdentifier="sentry-dbid-59be1240-177c-4557-adae-d1b9f879e74e")}catch{}})();const Xt=["bank","credit_card","other_current_assets"],B=e=>`/${e}/month_end_close_checks/review/transaction_categorization`,{common:{currency:V}}=Jt.getLocalizedStrings();function Zt(){const e=ft(),d=yt(),m=bt(),{tenantEmailDomain:u,transactionTypeEncoded:$}=St(),{useFeatureGate:j}=Pt(),O=Ut(),{isFeatureEnabled:J}=j(U.isCreateTransactionEnabled),{isFeatureEnabled:C}=j(U.isProjectsTransactionsEnabled),Q=Qt($??""),a=zt.find((t=>t===Q)),S=o((t=>It(t))),E=qt(S.companyId,a),g=o((t=>Lt(t.companyState,S.companyId)?.company.companyLocaleInfo)),W=g?.currencyCode??V.currencyCode,Y=g?.currencySymbol??V.currencySymbol,A=o((t=>t.tenantState.currentTenantId)),k=Bt.getSignedInUser(),v=k?.userId??"",x=k?.zeniSessionId??"",K=n.useMemo((()=>({userId:v,sessionId:x,tenantId:A??""})),[v,x,A]),X=o((t=>Tt(t))),D=o((t=>jt(t))),_=D&&C===!0,h=o((t=>t.projectListState)),N=o((t=>t.projectState)),Z=n.useMemo((()=>Ct(N,h).projects),[N,h]),I=o((t=>Et(t,"common"))),w=o((t=>t.accountListState.byReportId.accountList.fetchState)),F=o((t=>t.accountListState.byReportId.createTransactionLineAccountList.fetchState)),M=o((t=>t.accountListState.byReportId.createTransactionPaymentAccountList.fetchState)),H=o((t=>t.classListState.fetchState)),s=o((t=>a!=null?gt(t,a):void 0));n.useEffect((()=>{if(a!=null)return e(At(a)),()=>{e(kt(a))}}),[e,a]);const tt=Vt(),et=o((t=>{const{activeTenantFetchState:i,currentTenantId:b,fetchState:mt,tenantsById:pt}=t.tenantState;return b!=null&&pt[b]!=null&&(i.fetchState==="Completed"||mt==="Completed")})),r=tt&&et;n.useEffect((()=>{r&&a==="transfer"&&w==="Not-Started"&&e(L("accountList"))}),[e,r,a,w]),n.useEffect((()=>{r&&F==="Not-Started"&&e(L("createTransactionLineAccountList"))}),[e,r,F]),n.useEffect((()=>{r&&M==="Not-Started"&&e(L("createTransactionPaymentAccountList",!1,!1,!1,!1,Xt))}),[e,r,M]),n.useEffect((()=>{r&&H==="Not-Started"&&e(vt())}),[e,r,H]);const R=h.fetchState;n.useEffect((()=>{r&&_&&R==="Not-Started"&&e(xt())}),[e,r,_,R]),Wt(r),Yt(r&&a==="transfer",!1);const at=n.useCallback(((t,i=[])=>{if(i.length>0&&e(Dt(i)),u==null)return;const b=Gt(m.state)??[B(u)];d(Kt(t,u),{replace:!0,state:{pathnameStackToGoBack:b}})}),[e,u,d,m.state]),nt=n.useCallback((()=>{m.key==="default"?u!=null&&d(B(u)):d(-1)}),[m.key,d,u]),ot=n.useCallback((t=>{e(_t(t))}),[e]),z=n.useRef(void 0),p=s?.createStatus.error;n.useEffect((()=>{if(a==null||p==null)return;const t=`${p.code??""}-${p.message??""}`;z.current!==t&&(z.current=t,q.trackCreateTransactionFailed({transactionType:a,errorCode:p.code}))}),[p,a]);const y=n.useCallback((t=>t),[]),l=n.useMemo((()=>(s?.vendorList??[]).filter((t=>!t.isDeleted)).sort(((t,i)=>t.name.localeCompare(i.name)))),[s?.vendorList]),P=s?.localData.vendorId,st=n.useMemo((()=>{const t=l.find((i=>i.id===P));if(t!=null)return t.qboId!==""&&t.qboId!==t.name?t.qboId:t.name}),[l,P]),ct=o((t=>Nt(t,st))),rt=n.useMemo((()=>y(l.map((t=>({id:t.id,label:t.name}))))),[l,y]),it=n.useMemo((()=>({...I,vendor:[...l.map((t=>({id:t.id,name:t.name,qboId:t.qboId,type:"vendor",zeniId:t.id}))),...I.vendor]})),[I,l]),dt=n.useMemo((()=>y((s?.transferAccountsList??[]).map((t=>({id:t.accountId,label:t.accountName}))))),[s?.transferAccountsList,y]),ut=n.useCallback((t=>{a!=null&&e(wt(a,t))}),[e,a]),lt=n.useCallback(((t,i)=>{a!=null&&e(Ft(a,i,t))}),[e,a]);return E==null?null:a!=null&&s!=null&&J===!0&&E&&O?.connectionName!=="netsuite"?c.jsx($t,{analytics:q,attachmentUploadEndpoint:Ot.accountMicroServiceBaseUrl,authParams:K,createdTransactionId:s.createdTransactionId,transactionType:a,localData:s.localData,createStatus:s.createStatus,accountsHierarchyList:s.accountListNestedAccountHierarchy,paymentAccountsHierarchyList:s.paymentAccountListNestedAccountHierarchy,classHierarchyList:s.classListNestedAccountHierarchy,vendorOptions:rt,transferAccountOptions:dt,isAccountingClassesEnabled:X,isAccountingProjectsEnabled:D,isProjectsTransactionsEnabled:C===!0,projects:Z,currencyCode:W,currencySymbol:Y,bookCloseDate:S.bookCloseDate?.toDate(),entityAutoCompleteView:it,vendorRecommendationFetchState:ct.fetchState,onUpdateLocalData:ut,onAddLine:()=>e(Rt(a)),onRemoveLine:t=>e(Ht(a,t)),onSubmit:()=>e(Mt(a)),onCancel:nt,onCreateTransactionComplete:at,onUploadAttachmentAttachment:ot,onFetchRecommendationsForVendor:lt}):c.jsx(G,{})}function Ce(){return c.jsxs(ht,{children:[c.jsx(f,{path:"/new/:transactionTypeEncoded",element:c.jsx(Zt,{})}),c.jsx(f,{path:"/:transactionTypeEncoded/:transactionId",element:c.jsx(T,{})}),c.jsx(f,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:c.jsx(G,{})}),c.jsx(f,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:c.jsx(T,{})}),c.jsx(f,{path:"/*",element:c.jsx(T,{})})]})}export{Ce as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{j as _}from"./liveblocks-BLpmr1Pv.js";import{a as i}from"./sentry-DWNq3t8E.js";import{u as M,k as st,j as b,s as be,g as De,h as Ce,i as Ae,N as ct,l as it}from"./core-CbdTrw7T.js";import{pP as Ie,fJ as te,g_ as rt,YP as lt,oR as dt,on as ut,Eo as Q,a1A as mt,gl as pt,bm as ft,eh as _e,bp as Pe,tn as H,$_ as Y,a1B as Re,_V as le,a0k as we,mm as Fe,a1C as Ve,a0o as de,a0p as ue,nb as Ue,Tl as me,V_ as $,mg as xe,me as Le,mq as ht,pC as St,_W as yt,_X as Tt,Ef as X,ml as Be,SE as Oe,ce as gt,d7 as bt,a1D as It,VY as Et,a1E as vt,a1F as kt,a1G as Dt,a1H as Ct,Eb as At,a1I as _t,a1J as Pt,a1K as Rt,a1L as wt,$i as Ft,mp as Vt,a1M as Ut,a1N as xt,VZ as Lt,a1O as Bt,a1P as Ot,a1Q as Nt,Sy as zt,So as jt,SN as Mt,mr as Gt,Tm as Ee,pH as $t}from"./zeni-epic-state-C5DO1jkr.js";import{p as J,_ as R,c as q,dc as qt,z as Ne,a2 as Wt,dd as Ht,ac as Yt,a5 as ie,V as Jt,cg as Kt,s as re,al as Qt,ch as Xt,cj as Zt,de as en,af as tn,aj as ce}from"./index-CnIO6_IQ.js";import{n as nn,S as an,u as on,D as sn}from"./mui-DNGY4bFU.js";import{u as cn}from"./useAskAiCfoHostNavButtonProps-DXFswt7R.js";import{d as ze}from"./decodeURIComponentSafe-D7APy95S.js";import{u as rn}from"./useInitialThreadRequest-DAUsQlCl.js";import{h as je,t as Me,g as ln,j as dn}from"./routePaths-CV12X_S-.js";import{u as un}from"./expenseAutomationHelper-CgTsmmCm.js";import{B as mn}from"./utils-CrhrpmD8.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]="955d329c-bc21-4a79-9747-530fa6273018",t._sentryDebugIdIdentifier="sentry-dbid-955d329c-bc21-4a79-9747-530fa6273018")}catch{}})();function pn(t=!0,e=!0){const o=M(),n=st(),{useFeatureGate:a}=J(),{isFeatureEnabled:s}=a(R.isCreateTransferEntryFromExpenseEnabled);i.useEffect((()=>{if(!t||e&&s!==!0)return;const c=d=>{const f=n.getState().createTransferEntryState.transferAccountsByType[d].fetchState;return f!=="In-Progress"&&f!=="Completed"};c("transferEntryEligible")&&o(Ie({kind:"transferEntryEligible"})),c("creditCardOnlyEligible")&&o(Ie({kind:"creditCardOnlyEligible"}))}),[t,e,s,o,n])}function fn(t,e){const o=(function(){const d=M(),[f,h]=i.useState(!1),[D,p]=i.useState(null),[l,u]=i.useState(null),{useDynamicConfig:y}=J(),{configValue:E,isDynamicConfigLoading:S}=y("transaction_categorization_config"),T=!S&&E?.capitalization_enabled===!0,k=b((I=>te(I))),C=k.companyId,w=b((I=>rt(I.companyState,k.companyId)?.company.companyLocaleInfo?.currencySymbol??"$")),{capitalizableAccounts:A,capitalizableAccountOverrides:F,dismissedAccounts:V}=b((I=>{const g=I.tenantState.currentTenantId,P=g!=null?I.tenantState.tenantsById[g]:void 0;return{capitalizableAccounts:P?.capitalizableAccounts??null,capitalizableAccountOverrides:P?.capitalizableAccountOverrides??null,dismissedAccounts:P?.capitalizationOnboardingDismissedAccounts??null}}),be),L=i.useRef(A);L.current=A;const U=i.useRef(F);U.current=F;const B=i.useRef(V);B.current=V;const O=b((I=>lt(I.accountState)),be),G=i.useMemo((()=>{const I={};for(const g of O)g.accountId!=null&&g.accountName!=null&&(I[g.accountId]=g.accountName);return I}),[O]),W=l!=null?G[l]??null:null,N=i.useCallback((I=>{if(!T)return;const g=L.current;if(g==null)return;const P=g.accounts??[],K=new Set(I),ne=U.current??{},ae=B.current;for(const z of P)if(K.has(z.accountId)&&ne[z.accountId]==null&&ae?.[z.accountId]==null)return p(z.classificationType),u(z.accountId),void h(!0)}),[T]),v=i.useCallback(((I,g)=>{d(dt(C,I,g,!0)),h(!1),p(null),u(null)}),[d,C]),r=i.useCallback((()=>{l!=null&&(d(ut(C,l)),h(!1),p(null),u(null))}),[d,C,l]);return{showPopup:f&&T,popupType:D,popupAccountId:l,popupAccountName:W,currencySymbol:w,checkAndShowPopup:N,handleSubmit:v,handleDismiss:r}})(),n=i.useRef(void 0),a=i.useRef([]),s=i.useRef(o.checkAndShowPopup);s.current=o.checkAndShowPopup;const c=i.useRef(e);return c.current=e,i.useEffect((()=>{t==="In-Progress"&&(a.current=c.current()),t==="Completed"&&n.current==="In-Progress"&&a.current.length>0&&(s.current(a.current),a.current=[]),n.current=t}),[t]),o}const j=new Map,Ge=(t,e,o)=>`${t}|${e??""}|${o}`,Z=(t,e)=>{const[o,n]=t.shownRecommendations;return{recommendationFor:t.dimension,recommendation:o?.name??"",recommendationSource:o?.engine??null,recommendationConfidencePercentage:o?.confidencePercentage??null,alternativeRecommendation:n?.name??null,alternativeRecommendationSource:n?.engine??null,alternativeRecommendationConfidencePercentage:n?.confidencePercentage??null,selectedValue:t.selected.name,numberOfRecommendations:t.shownRecommendations.length,transactionId:e,lineId:t.lineId??null}},ee=(t,e,o)=>({transactionId:e,lineId:t.lineId,dimension:t.dimension,outcome:t.outcome,selected:{name:t.selected.name,id:t.selected.id},matchedSource:t.matchedSource,matchedRank:t.matchedRank,topPickSource:t.topPickSource,shownRecommendations:t.shownRecommendations.map((n=>({source:n.source,rank:n.rank,value:{name:n.name,id:n.id},confidence:n.confidencePercentage!=null?n.confidencePercentage/100:void 0}))),...o}),ve=(t,e)=>{j.set(Ge(e,t.lineId,t.dimension),{feedback:t,transactionId:e})},$e=(t,e,o)=>{q.trackRecommendationFeedbackRetracted(Z(e,o)),t(Q(ee(e,o,{outcome:"retracted"})))},Bn=(t,e)=>{const o=new Set(e.map(String));j.forEach(((n,a)=>{o.has(n.transactionId)&&(j.delete(a),$e(t,n.feedback,n.transactionId))}))},On=t=>{const e=new Set(t.map(String));j.forEach(((o,n)=>{e.has(o.transactionId)&&j.delete(n)}))};function hn(t){const e=M(),[o,n]=i.useState(null),[a,s]=i.useState(!1),{fetchState:c}=b(mt),{isEnabled:d,fallbackTransactionId:f}=t,h=i.useCallback((u=>u.transactionId??f??""),[f]),D=i.useCallback((u=>{if(!d)return;const y=h(u);if(y==="")return;if(u.outcome!=="accepted")return void n(u);((S,T,k,C)=>{const w=Ge(T,k,C),A=j.get(w);return A!=null&&(j.delete(w),$e(S,A.feedback,A.transactionId),!0)})(e,y,u.lineId,u.dimension)||(((S,T)=>{q.trackRecommendationAccepted(Z(S,T))})(u,y),e(Q(ee(u,y,{}))))}),[d,h,e]),p=i.useCallback((u=>{if(o==null)return;const y=h(o);((E,S,T)=>{q.trackRecommendationFeedbackSubmitted({...Z(E,S),feedbackReason:T})})(o,y,u),e(Q(ee(o,y,{reasonText:u,skipped:!1}))),ve(o,y),s(!0)}),[o,h,e]),l=i.useCallback((()=>{if(o==null)return;const u=h(o);((y,E)=>{q.trackRecommendationFeedbackSkipped(Z(y,E))})(o,u),e(Q(ee(o,u,{skipped:!0}))),ve(o,u),s(!1),n(null)}),[o,h,e]);return i.useEffect((()=>{if(!a||c!=="Completed"&&c!=="Error")return;s(!1),n(null);const u=c==="Completed";e(pt({messageSection:"recommendation_feedback",messageText:u?"success":"failed",type:u?"success":"error",showStatusIcon:!0}))}),[a,c,e]),{onRecommendationSelection:D,popup:o!=null?_.jsx(qt,{feedback:o,submitState:a?c:"Not-Started",onSubmit:p,onSkip:l}):null}}const pe=()=>{const t=Ne.getSignedInUser(),{useFeatureGate:e}=J(),{isFeatureEnabled:o}=e(R.isChainOfThoughtEnabled);return i.useMemo((()=>ft(t)&&o),[t,o])};function qe(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 Nn(t,e){const o=M(),{useFeatureGate:n}=J(),a=b((r=>te(r))),s=a.userRole.includes("charge_card_user")||a.userRole.includes("charge_card_admin"),c=a.userRole!=null&&_e(a.userRole),d=a.userRole!=null&&Pe(a.userRole),{isFeatureEnabled:f}=n(R.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:h}=n(R.isExpenseAutomationEnabled),D=pe(),p=i.useMemo((()=>({id:t,type:H(e)})),[t,e]),l=b((r=>Y(r,p))),u=l?.transactionDetailUpdateStatus?.fetchState,y=l?.transactionDetailLocalData?.lineItemById,E=b((r=>{const I=Y(r,p)?.transactionDetailLocalData.vendorUpdates?.id;return I==null?"Not-Started":r.transactionVendorViewState.editVendorStateById[I]?.saveStatus.fetchState??"Not-Started"})),S=i.useMemo((()=>l?.fetchState==="Completed"?qe(l?.transaction):void 0),[l?.fetchState,l?.transaction]),T=b((r=>{if(S!=null)return Re(r.customerIncomeState,r.vendorExpenseState,r.trendState,S,"month")})),k=b((r=>le(r))),C=b((r=>{if(S!=null)return we(r.trendWithTransactionsState,S,"TransactionDetail")})),w=a.company?.companyInfo.firstMonthOfFY??1,A=b((r=>Fe(r.accountState,r.accountListState,"accountList"))),[F,V]=i.useState(!1),[L,U]=i.useState(!1),[B,O]=i.useState(!1);i.useEffect((()=>{V(!1),U(!1),O(!1)}),[t,e]);const G=i.useCallback((()=>{V(!1),U(!1)}),[]),[W,N]=i.useState(!1),v=C?.selectedPeriod?.timePeriod;return i.useEffect((()=>{B||l==null||l.transaction==null||(o(Ve({id:l.transaction.id,type:l.transaction.type})),O(!0)),S!=null&&(!s||c&&d===!1)&&(F?L||T==null||(U(!0),o(me(S,"TransactionDetail",{timeframe:"month",timePeriod:v??T}))):(o(de()),o(ue()),V(!0),o(Ue(S))))}),[o,B,l?.fetchState,l?.transaction,S,s,c,d,F,L,T,v]),i.useEffect((()=>{k.newVendorState?.vendorDetailLocalData?.vendorName!=null?N(!0):N(!1)}),[k.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{o($("common"))}),[o]),{currentTenant:a,loggedInUserHasCardUserOrAdminRole:s,isUserHasDashboardAccess:c,isUserHasInvestorOrBankerAccess:d,isVendorBulkUpdateOnTransactionEnabled:f,isExpenseAutomationEnabled:h,isChainOfThoughtEnabled:D,selectedTransaction:p,transactionDetail:l,rawDetailSaveStatus:u,rawDetailLineItemById:y,vendorSaveStatus:E,tranEntity:S,defaultTrendTransactionTimePeriod:T,vendorViewDetails:k,uiState:C,firstMonthOfFY:w,uncategorizedAccounts:A,resetTrendIsFetchedStates:G,isCreateVendorDrawerOpen:W,setIsCreateVendorDrawerOpen:N}}const Sn={overlayWidth:new Yt(100,100,58)},yn=({isOpen:t,onSaveVendor:e,onSaveSuccess:o,onCancel:n,vendorViewDetails:a})=>{const s=on(),c=Wt(),d=M(),f=b((p=>le(p))),h=()=>{n()},D={vendorDetailView:a??f,onSaveSuccess:()=>{d(Le()),d(ht("Not-Started")),o()},onSaveVendor:e,onCancelClick:h,saveVendorDetailLocalData:p=>{d(xe({vendorId:void 0,localData:p}))}};return _.jsx(sn,{anchor:"right",open:t,PaperProps:{style:{width:Sn.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:s.colors.black,opacity:.4,cursor:"pointer"}}},onClose:h,children:_.jsx(Tn,{onClick:p=>p.stopPropagation(),children:_.jsx(Ht,{...D})})})},Tn=nn(an)`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
`;function gn(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 bn({currentTransactionId:t,enabled:e=!0,buildPath:o,beforeNavigate:n,navigate:a,navigateState:s}){const c=b((f=>f.createTransferEntryState.lastTransferEntryReplacement)),d=i.useRef(null);i.useEffect((()=>{if(!e||c==null||t==null||d.current===c)return;const{previousTransactionId:f,newTransactionId:h}=c;t.id===f.id&&t.type===f.type&&(d.current=c,n?.(),a(o(h),{replace:!0,state:s}))}),[e,c,t,o,n,a,s])}const In=({closeDrawerHandler:t,overrideTransactionId:e,overrideTransactionType:o})=>{const n=De(),a=Ce(),s=M(),c=pe(),{transactionTypeEncoded:d,transactionId:f}=Ae(),h=e??f,D=o??ze(d??"");let p;je(h,D)&&(p={id:h,type:H(D)});const l=p!=null?b((y=>Y(y,p))):void 0,u=()=>{const y=ie(n.state?.pathnameStackToGoBack),E=y.poppedPathname??((S=2)=>{let T="../";for(let k=0;k<S;k++)T=`${T}../`;return T})(1);a(E,{state:{pathnameStackToGoBack:y.newStack}})};return{transactionId:p,onSaveVendor:()=>{s(Be(p,void 0))},onSaveSuccess:()=>{if(l!=null&&l?.transaction&&l?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&l?.transactionDetailLocalData.vendorUpdates?.id!=null){const y=l?.transactionDetailLocalData.vendorUpdates,E={id:l?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:l?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:y?.name,qboId:l?.transactionDetailLocalData.vendorUpdates?.qboId??""},S={transactionId:{id:l?.transaction?.id,type:l?.transaction?.type},transaction:l?.transaction,lineIds:l?.transaction?.lines?.map((T=>T.id))??[]};s(X({entity:E,amount:l?.transaction?.amount.amount,transactionDetails:S,flowType:"detail",isFetchCOT:c}))}u()},onCancel:()=>{p!=null&&s(yt({transactionId:p})),s(Le()),s(Tt()),t(!0),u()}}},En=it((function(t,e){const o=Y(t,e.selectedTransaction);let n;o==null&&console.warn("Check if the you've selected the transaction before getting the details");const a=Ne.getSignedInUser(),s=t.tenantState.currentTenantId,c={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:s??""};o!=null&&o.fetchState==="Completed"&&o.transaction!=null&&e.entity!=null&&(n=It(t,e.entity,"TransactionDetail"));const d=t.entityAutoCompleteState.autoCompleteText.common,f=Et(t,"common"),h=te(t);return{transactionDetail:o,transactionAttachmentEndpointToDownload:`${ce}/transaction_attachment`,transactionAttachmentsEndpointToFetch:h.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${ce}/transaction_attachments_accounting_provider`:`${ce}/transaction_attachments`,attachmentUploadEndpoint:`${tn.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:c,trendReport:n,analytics:q,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:d,entityAutoCompleteView:f},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails"),isTransactionSplitEditMode:o?.transactionDetailLocalData?.editMode??!1}}),(function(t,e){const{isCOTEnabled:o}=e;return{onBackClick:()=>{if(t($("common")),e.onBackClick!=null)return void e.onBackClick();const n=ie(e.location.state?.pathnameStackToGoBack),a=n.poppedPathname??We(2);e.navigate(a,{state:{pathnameStackToGoBack:n.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(n,a)=>{e.transaction!=null&&t($t({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:n,customerId:a}))},onTransactionClick:n=>{e.resetTrendIsFetchedStates(),t(de()),t(ue());const a=re(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(Me(n,e.tenantEmailDomain),{state:{pathnameStackToGoBack:a}})},onTrendSelectedPeriodChange:n=>{if(n==null)e.defaultTrendTransactionTimePeriod!=null&&t(Ee(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const a=n.currentTimePeriod==null?n.addTimePeriod:{startDate:n.addTimePeriod.startDate,endDate:n.currentTimePeriod.endDate};t(me(e.entity,"TransactionDetail",{timeframe:n.timeframe,timePeriod:n.addTimePeriod})),t(Ee(e.entity,"TransactionDetail",{timeframe:n.timeframe,timePeriod:a}))}},onSaveUpdates:(n,a,s,c)=>{t(c===!0&&s!=null?Be(n,s,!0,e.isExpenseAutomationEnabled):Gt({transactionId:n,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:a})),t($("common"))},onUploadAttachmentAttachment:n=>{t(Mt(n))},onDeleteAttachment:n=>{e.transaction!=null&&t(jt(n,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(n,a)=>{t(zt({transactionId:n,transactionLocalData:a}))},onUpdateAllChecked:(n,a,s,c)=>{e.transaction!=null&&t(Nt(e.selectedTransaction,e.transaction,n,a,s,c))},onResetLineItemsCategoryClassInLocalData:(n,a,s,c,d,f)=>{t(Ot(n,a,s,c,d,f))},onChangeCategoryClassWhenUpdateAllIsChecked:(n,a)=>{e.transaction!=null&&t(Bt({id:e.transaction.id,type:e.transaction.type},e.transaction,n,a))},onSaveSuccess:()=>{const n=ie(e.location.state?.pathnameStackToGoBack);if(n.poppedPathname!=null){const a=mn(n.poppedPathname,"/").split("/"),s=a[a.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(s)&&e.navigate(n.poppedPathname,{state:{pathnameStackToGoBack:n.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const c=`${ln(e.tenantEmailDomain)}`;e.navigate(c)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const c=`${dn(e.tenantEmailDomain)}`;e.navigate(c)}}},onPageRefresh:()=>{t(Oe(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(n,a)=>{n.trim().length>=2?t(Lt({searchString:n,entityType:a,searchOrigin:"common"})):n.trim().length===0&&t($("common"))},onCancelAutoComplete:()=>{t($("common"))}},onFetchRecommendationsForEntity:(n,a,s,c)=>{t(X({entity:n,amount:a,transactionDetails:s,flowType:"detail",isBulkFetch:c,isFetchCOT:o}))},clearRecommendationForLineId:n=>{const{transactionId:a,transaction:s,lineId:c}=n;t(xt(a,s,c))},resetUpdateErrorState:()=>{const n={id:e.selectedTransaction.id,type:e.selectedTransaction.type};t(Ut(n))},onSaveVendorInLocalData:(n,a,s,c,d)=>{if(t(Vt({transactionId:n,vendorUpdates:a,entity:s})),a.id!=null&&s!=null&&c!=null&&d!=null&&t(X({entity:s,amount:c,transactionDetails:d,flowType:"detail",isFetchCOT:o})),t(xe({vendorId:a.id?a.id:void 0,localData:{vendorName:a.name,vendorId:a.id?a.id:void 0}})),!a.id&&e.transaction!=null){const f=e.transaction,h=re(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(f.type??"")}/${f.id}/vendor/create`,{state:{pathnameStackToGoBack:h}})}},onSaveCustomerInLocalData:(n,a,s,c,d)=>{t(Ft({transactionId:n,customerUpdates:a,entity:s})),a.id!=null&&s!=null&&c!=null&&d!=null&&t(X({entity:s,amount:c,transactionDetails:d,flowType:"detail",isFetchCOT:o}))},onUpdateAllTranactionsWithCurrentVendorChecked:n=>{t(wt({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:n}))},onClickUpdateVendorToAllLineItems:(n,a,s)=>{t(Rt(n,a,s))},onResetVendorToAllLineItems:(n,a,s)=>{t(Pt(n,a,s))},saveLatestSelectedEntity:(n,a,s)=>{t(_t({transactionId:n,lineId:a,entity:s}))},updateVendorBulkRecommendationsFetchStatus:(n,a)=>{t(At(n,a))},setIsVendorUpdateAllChecked:(n,a,s)=>{t(Ct(n,a,s))},onCreateTransferEntry:e.isCreateTransferEntryFromExpenseEnabled===!0?n=>gn(t,n):void 0,onLineAdd:()=>{if(e.transaction==null)return;const n={id:e.transaction.id,type:e.transaction.type},a=e.transaction.type==="journal_entry",s=e.transaction.amount?.currencyCode??"",c=e.transaction.amount?.currencySymbol??"",d=a?{amount:{amount:0,currencyCode:s,currencySymbol:c},id:crypto.randomUUID(),isCategoryMiscategorized:!1,isClassMiscategorized:!1,lineDescription:"",platformLineDetailType:"journal_entry_line_detail",type:"journal_entry_transaction_line",postingType:void 0,postingTypeName:"",lineTransactionType:"journal_entry"}:{amount:{amount:0,currencyCode:s,currencySymbol:c},id:crypto.randomUUID(),isCategoryMiscategorized:!1,isClassMiscategorized:!1,lineDescription:"",platformLineDetailType:"account_based_expense_line_detail",type:"transaction_with_account_and_class_line"};t(Dt(n,d))},onLineDelete:n=>{if(e.transaction==null)return;const a={id:e.transaction.id,type:e.transaction.type};t(kt(a,n))},onToggleSplitEditMode:n=>{if(e.transaction==null)return;const a={id:e.transaction.id,type:e.transaction.type};t(vt(a,n))}}}))(en);function zn(){const t=Ce(),e=M(),o=De(),{useFeatureGate:n}=J(),a=Jt(),s=b((m=>te(m))),c=s.userRole.includes("charge_card_user")||s.userRole.includes("charge_card_admin"),d=s.userRole!=null&&_e(s.userRole),f=s.userRole!=null&&Pe(s.userRole),{isFeatureEnabled:h}=n(R.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:D}=n(R.isExpenseAutomationEnabled),{tenantEmailDomain:p,transactionTypeEncoded:l,transactionId:u}=Ae(),[y,E]=i.useState(!1),S=ze(l??""),T=je(u,S),k=b((m=>m.transactionVendorViewState)),C=pe(),{isFeatureEnabled:w}=n(R.isRecommendationFeedbackEnabled),A=Kt(),{onRecommendationSelection:F,popup:V}=hn({isEnabled:w,fallbackTransactionId:u}),L=i.useMemo((()=>({...A,onRecommendationSelection:F})),[A,F]),{isFeatureEnabled:U}=n(R.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:B}=n(R.isProjectsTransactionsEnabled),{isFeatureEnabled:O}=n(R.isTransactionSplitEnabled),G=a?.currentTenant?.companyId,W=a?.currentTenant?.companyName,N=rn(G),v=i.useMemo((()=>{if(T)return{id:u,type:H(S)}}),[T,u,S]),r=v!=null?b((m=>Y(m,v))):void 0,I=r?.transactionDetailLocalData.vendorUpdates?.id!=null?k.editVendorStateById[r?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",g=r?.fetchState==="Completed"?qe(r?.transaction):void 0,P=b((m=>g!=null?Re(m.customerIncomeState,m.vendorExpenseState,m.trendState,g,"month"):void 0)),K=b((m=>le(m))),ne=b((m=>g!=null?we(m.trendWithTransactionsState,g,"TransactionDetail"):void 0)),ae=s.company?.companyInfo.firstMonthOfFY??1,z=b((m=>Fe(m.accountState,m.accountListState,"accountList"))),[He,fe]=i.useState(!1),[Ye,he]=i.useState(!1),[Je,Se]=i.useState(!1),Ke=i.useCallback((m=>Me(m,p??"")+o.search),[p,o.search]),Qe=i.useCallback((()=>{Se(!1)}),[]);bn({currentTransactionId:v,enabled:p!=null&&p!=="",buildPath:Ke,beforeNavigate:Qe,navigate:t,navigateState:o.state});const ye=()=>{fe(!1),he(!1)},Te=un();pn();const oe=i.useRef(r?.transaction);oe.current=r?.transaction;const Xe=r?.transactionDetailUpdateStatus?.fetchState,x=fn(Xe,(()=>{const m=[];if(oe.current!=null)for(const se of oe.current.lines??[])"account"in se&&se.account?.accountId!=null&&m.push(se.account.accountId);return m}));i.useEffect((()=>{v!=null&&r!=null&&r.fetchState==="Not-Started"&&(e(Oe(v,!1)),ye())}),[e,v,r?.fetchState]),i.useEffect((()=>{if(v!=null&&r?.fetchState==="Error"){const m=re(o.state?.pathnameStackToGoBack,o.pathname);t("page-not-found",{replace:!0,state:Te?{pathnameStackToGoBack:m,message:"expenseAutomation",origin:"transaction_categorization"}:{pathnameStackToGoBack:m,message:"pageNotFound",origin:"transaction_detail"}})}}),[v,r?.fetchState,t,o.state,o.pathname,Te]),i.useEffect((()=>{Je||r==null||r.transaction==null||(e(Ve({id:r.transaction.id,type:r.transaction.type})),Se(!0));const m=o.state?.searchContext;g==null&&r?.fetchState==="Completed"&&ke(r?.transaction,m),g!=null&&(!c||d&&f===!1)&&(He?Ye||P==null||(he(!0),e(me(g,"TransactionDetail",{timeframe:"month",timePeriod:ne?.selectedPeriod?.timePeriod??P}))):(e(de()),e(ue()),ke(r?.transaction,m),fe(!0),e(Ue(g))))}),[r?.fetchState,r?.transaction,P,c]),i.useEffect((()=>{K.newVendorState?.vendorDetailLocalData?.vendorName!=null?E(!0):E(!1)}),[K.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{e($("common"))}),[]);const Ze=[l,u].filter((m=>m!=null)),{transactionId:ge,onSaveVendor:et,onSaveSuccess:tt,onCancel:nt}=In({closeDrawerHandler:m=>{E(!1),t(m?"../":"../..")}}),{isAiCfoAccessEnabled:at,onAskAiCfoClick:ot}=cn({mobileExploreReferrer:"Transaction Details"});return Qt({isDataReady:r?.fetchState==="Completed"}),T?_.jsxs(_.Fragment,{children:[ge!=null&&y&&_.jsx(yn,{isOpen:y,transactionId:ge,onSaveVendor:et,onSaveSuccess:tt,onCancel:nt}),_.jsx(Xt,{toolkit:L,children:_.jsx(En,{hideDeleteAttachment:!0,firstMonthOfFY:ae,isDisabled:r?.transaction?.type==="transfer"&&a?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:p,location:o,navigate:t,selectedTransaction:v,entity:g,isCOTEnabled:C,defaultTrendTransactionTimePeriod:P,resetTrendIsFetchedStates:ye,transaction:r?.transaction,uncategorizedAccounts:z,vendorSaveStatus:I,isVendorBulkUpdateOnTransactionEnabled:h,isCreateTransferEntryFromExpenseEnabled:U,isExpenseAutomationEnabled:D,isAiCfoAccessEnabled:at,onAskAiCfoClick:ot,isProjectsTransactionsEnabled:B,isTransactionSplitEnabled:O,companyId:G,companyName:W,initialOpenThreadRequest:N})}),V,x.showPopup&&x.popupType!=null&&_.jsx(Zt,{popupType:x.popupType,currencySymbol:x.currencySymbol,accountId:x.popupAccountId??"",accountName:x.popupAccountName??"",onSubmit:x.handleSubmit,onDismiss:x.handleDismiss})]}):_.jsx(ct,{to:We(Ze.length)})}const We=(t=2)=>{let e="../";for(let o=0;o<t;o++)e=`${e}../`;return e},ke=(t,e)=>{if(t!=null){const{transactionCategory:o,transactionClass:n}=vn(t),a=kn(t);q.trackTransactionDetails(t.account?.accountId,t.account?.accountName,t.id,a,o.length>0?o:void 0,n.length>0?n:void 0,t.type,t.amount,t.memo,t.lines?.length??0,t.attachments?.map((s=>s.fileName)),e!=null?"Search":void 0,e?.searchTerm,e?.resultPosition,e?.resultsCount,e!=null?"search":void 0)}},vn=t=>{const e=[],o=[];return t.lines?.forEach((n=>{switch(n.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 a=n;a!=null&&a.account!=null&&a.account.accountName?.length>0&&e.push(a.account.accountName),a.class!=null&&a.class.className?.length>0&&o.push(a.class.className);break}}})),{transactionCategory:e,transactionClass:o}},kn=t=>gt(t)===!0?t.customer?.name??"":bt(t)===!0?t.vendor?.name??"":t.memo!=null?t.memo:t.type;export{yn as C,En as T,pn as a,fn as b,hn as c,gn as d,On as e,Nn as f,In as g,bn as h,zn as i,ke as l,Bn as r,pe as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-BLpmr1Pv.js";import{h as K,g as U,u as Q,i as W,j as g,N as q,l as X,n as Ce,o as C}from"./core-CbdTrw7T.js";import{fJ as J,uG as Z,lr as p,eJ as ee,Tb as Ae,bw as me,Y9 as Me,mb as te,Ya as ae,Yb as pe,Yc as Be,bF as Y,T7 as Se,Yd as Le,Ye as fe,Yf as Fe,Ta as he,Yg as Oe,Yh as Te,Yi as Ge,Yj as ge,Yk as ze,Yl as we,Ym as De,Up as $e}from"./zeni-epic-state-C5DO1jkr.js";import{p as ne,_ as ce,c as L,G as Ie,b6 as oe,s as R,a5 as se,aC as Re,h as _e}from"./index-CnIO6_IQ.js";import"./mui-DNGY4bFU.js";import{a as y}from"./sentry-DWNq3t8E.js";import{w as ie}from"./withTransactionSidePanel-D-hDwbdr.js";import{p as re,t as de}from"./routePaths-CV12X_S-.js";import{c as Ve}from"./utils-CrhrpmD8.js";import{d as j}from"./decodeURIComponentSafe-D7APy95S.js";import{Z as Ne}from"./ZeniAccountStatementScreen-DAs1_LIC.js";import"./recharts-CTh_JhT_.js";import"./analytics-Vgn85Ur_.js";import"./plaid-DhfTjhua.js";import"./dnd-DuiAlI7w.js";import"./stripe-cKAAJElX.js";import"./lottie-Lb1ftKY1.js";import"./lexical-B-vxEaRQ.js";import"./pdf-B1uD4Ovv.js";import"./useAskAiCfoHostNavButtonProps-DXFswt7R.js";import"./TransactionDetailScreen-JBKbtouq.js";import"./useInitialThreadRequest-DAUsQlCl.js";import"./expenseAutomationHelper-CgTsmmCm.js";import"./stripSplatSuffix-DP9nmQOu.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]="870a4ffe-eff0-48c3-93aa-b18bff7768a4",a._sentryDebugIdIdentifier="sentry-dbid-870a4ffe-eff0-48c3-93aa-b18bff7768a4")}catch{}})();const Ue=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],N=a=>Ve(a),Ye=()=>{const{common:a,uncategorizedTransactionList:e}=Ie.getLocalizedStrings();return{amount:e.missingReceipt.missingReceiptMinAmount.amount,currencyCode:a.currency.currencyCode,currencySymbol:a.currency.currencySymbol}},qe=X((function(a,e){const t=Me(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,N(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=N(e.selectedAccount.tranListType),d=Ke(t,n,c,o,e.bookCloseDate);L.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(pe({uiState:{dateRange:d},type:N(e.selectedAccount.tranListType)})),a(Ae(o,p(d),!1,o==="missingReceipts"?Ye():void 0)),e.onSelectedTimePeriodChange(p(d))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=R(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(pe({uiState:{scrollYOffset:t},type:N(e.selectedAccount.tranListType)}))}}}))(oe),V=ie((function({...a}){const e=K(),t=U(),n=Q(),c=t.pathname.split("/").find((l=>Ue.includes(l))),o=c??"uncategorized-expense",{tenantEmailDomain:d}=W(),{accountType:k,title:b,subTitle:A}=Je(o),f="month",T=g((l=>J(l))),v=T.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:S}=ne(),{isFeatureEnabled:h}=S(ce.isProjectsTransactionsEnabled),I=g((l=>Z(l)))&&h,{dataAvailable:x,initialTimeframeTick:F}=He(o,v,T.bookCloseDate),[P,O]=y.useState(!1),[E,G]=y.useState(void 0),u=y.useMemo((()=>{const l=p(F);return{tranListType:o,accountType:ee(k),title:b,subTitle:A,timeframe:f,period:l}}),[o,f,k,x]);y.useEffect((()=>{if(!P&&u!=null){O(!0),L.trackTransactionList(void 0,void 0,void 0,u.title);const l=N(u.tranListType);n(Ae(l,u.period,!0,l==="missingReceipts"?Ye():void 0))}}),[P,u,n]);let M=u;return u!=null&&E!=null&&(M={...u,period:E}),c==null||M==null?s.jsx(q,{to:"../"}):s.jsx(qe,{firstMonthOfFY:v,tenantEmailDomain:d,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:x,navigate:e,showProjectField:I,selectedAccount:M,referrerType:o,bookCloseDate:T.bookCloseDate,onSelectedTimePeriodChange:l=>G(l),...a})})),Je=a=>{let e="",t="";const n=Ie.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.common.texts.uncategorizedExpenses;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.common.texts.receipts}return{accountType:e,title:t,subTitle:""}},He=(a,e,t)=>{const n=me();let c=me().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:re(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Ke=(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},Qe=X((function(a,e){const t=Le(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:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??ke();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)}`),L.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(Se(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=R(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,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}}))(oe),We=ie((function({referrerType:a,...e}){const t=K(),n=U(),c=Q(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:k,classIdEncoded:b,timeframe:A,startDate:f,endDate:T,titleEncoded:v}=W(),S=j(d??""),h=j(k??""),I=j(b??""),x=j(v??""),F=g((r=>Be(r.transactionListState,h,S,I))),[P,O]=y.useState(!1),[E,G]=y.useState(void 0),u=g((r=>J(r))),M=u.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:l}=ne(),{isFeatureEnabled:m}=l(ce.isProjectsTransactionsEnabled),w=g((r=>Z(r)))&&m;let i;const z=Xe(S,h,I,A,f,T,x);if(z){const r={startDate:Y(f,"YYYY-MM-DD"),endDate:Y(T,"YYYY-MM-DD")},$=Ze(F?.dateRange,r);i={accountId:h,accountType:ee(S),classId:I,title:x,timeframe:A,period:$}}y.useEffect((()=>{P||i==null||(O(!0),L.trackTransactionList(i.accountId,void 0,a,i.title),c(Se(i.accountId,i.accountType,i.classId,i.period)))}),[P,i,c]);let B=i;i!=null&&E!=null&&(B={...i,period:E});const _=[d,k,b,A,f,T,v].filter((r=>r!=null));return z&&B!=null?s.jsx(Qe,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:B,referrerType:a,onSelectedTimePeriodChange:r=>G(r),...e}):s.jsx(q,{to:ke(_.length)})})),ke=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Xe=(a,e,t,n,c,o,d)=>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()&&d!=null,Ze=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),et=X((function(a,e){const t=Oe(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:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??be();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)}`),L.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(Te({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{dateRange:o}})),a(he(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=R(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(Te({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{scrollYOffset:t}}))}}}))(oe),tt=ie((function({referrerType:a,...e}){const t=K(),n=U(),c=Q(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:k,projectIdEncoded:b,timeframe:A,startDate:f,endDate:T,titleEncoded:v}=W(),S=j(d??""),h=j(k??""),I=j(b??""),x=j(v??""),F=g((r=>Fe(r.transactionListState,h,S,I))),[P,O]=y.useState(!1),[E,G]=y.useState(void 0),u=g((r=>J(r))),M=u.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:l}=ne(),{isFeatureEnabled:m}=l(ce.isProjectsTransactionsEnabled),w=g((r=>Z(r)))&&m;let i;const z=at(S,h,I,A,f,T,x);if(z){const r={startDate:Y(f,"YYYY-MM-DD"),endDate:Y(T,"YYYY-MM-DD")},$=nt(F?.dateRange,r);i={accountId:h,accountType:ee(S),projectId:I,title:x,timeframe:A,period:$}}y.useEffect((()=>{P||i==null||(O(!0),L.trackTransactionList(i.accountId,void 0,a,i.title),c(he(i.accountId,i.accountType,i.projectId,i.period)))}),[P,i,c]);let B=i;i!=null&&E!=null&&(B={...i,period:E});const _=[d,k,b,A,f,T,v].filter((r=>r!=null));return z&&B!=null?s.jsx(et,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:B,referrerType:a,onSelectedTimePeriodChange:r=>G(r),...e}):s.jsx(q,{to:be(_.length)})})),be=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},at=(a,e,t,n,c,o,d)=>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()&&d!=null,nt=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),ct=X((function(a,e){const t=ze(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&we(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??ve();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)}`),L.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(De({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(ge(e.selectedAccount.accountId,e.selectedAccount.accountType,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=R(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(De({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=it(e.tenantEmailDomain),n=R(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}}))(oe),ye=ie((function({referrerType:a,...e}){const t=K(),n=U(),c=Q(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:k,timeframe:b,startDate:A,endDate:f,titleEncoded:T,excludeSubAccounts:v}=W(),S=j(d??""),h=j(k??""),I=j(T??""),x=!(v!=null&&v==="exclude_subaccounts"),F=g((D=>Ge(D.transactionListState,h,S))),[P,O]=y.useState(!1),[E,G]=y.useState(void 0),u=g((D=>J(D))),M=u.company?.featuresActivationInfo.connectedAccountProvider==="unit",l=u.company?.companyInfo.firstMonthOfFY??1;let m;const w=ot(S,h,b,A,f,I);if(w){const D={startDate:Y(A,"YYYY-MM-DD"),endDate:Y(f,"YYYY-MM-DD")},le=st(F?.dateRange,D);m={accountId:h,accountType:ee(S),title:I,timeframe:b,period:le}}let i=m;m!=null&&E!=null&&(i={...m,period:E});const{useFeatureGate:z}=ne(),B=y.useCallback(((D,le)=>{if(o==null)return;const ue=D.url.split(`/${o}/`)[1];if(ue==null)return;const[Ee,je]=ue.split("?"),H=new URLSearchParams(je??"");H.set("view","full"),H.set("thread_id",le),H.set("entity_type",D.entityType);const xe=R(n.state?.pathnameStackToGoBack,n.pathname);t(`/${o}/${Ee}?${H.toString()}`,{state:{pathnameStackToGoBack:xe}})}),[t,o,n.state,n.pathname]),{isFeatureEnabled:_}=z(ce.isProjectsTransactionsEnabled),r=g((D=>Z(D)))&&_,{areTenantIdsInSync:$}=Re();y.useEffect((()=>{!P&&m!=null&&$&&(O(!0),L.trackTransactionList(m.accountId,void 0,a,m.title),c(ge(m.accountId,m.accountType,m.period,void 0,!1,x)))}),[P,m,c,$]);const Pe=[d,k,b,A,f,T].filter((D=>D!=null));return w&&i!=null?s.jsx(ct,{firstMonthOfFY:l,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:M,onCommentThreadClick:B,showProjectField:r,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:D=>G(D),...e}):s.jsx(q,{to:ve(Pe.length)})})),ve=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},ot=(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,st=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),it=a=>`/${a}/transactions/${$e}/statements`;function Mt(){const a=U().state?.referrer,e=g((n=>n.expenseAutomationViewState.selectedPeriodByTenantId))[g((n=>J(n))).tenantId],t=_e();return s.jsxs(Ce,{children:[s.jsx(C,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(ye,{referrerType:a})}),s.jsx(C,{path:"/zeni-clearing-account/statements",element:s.jsx(Ne,{})}),s.jsx(C,{path:"/*",element:s.jsx(ye,{referrerType:a})}),s.jsx(C,{path:"/uncategorized-income/*",element:s.jsx(V,{})}),s.jsx(C,{path:"/uncategorized-expense/*",element:s.jsx(V,{})}),s.jsx(C,{path:"/miscategorized-income/*",element:s.jsx(V,{})}),s.jsx(C,{path:"/miscategorized-expense/*",element:s.jsx(V,{})}),s.jsx(C,{path:"/missing-receipts/*",element:t?s.jsx(q,{to:`../../month_end_close_checks/review/missing_receipts/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(C,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(We,{referrerType:a})}),s.jsx(C,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(tt,{referrerType:a})})]})}export{Mt as default};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import{j as e}from"./liveblocks-BLpmr1Pv.js";import{h as P,g as L,u as U,i as M,j as y,N as D,l as O,n as xe,o as k}from"./core-CbdTrw7T.js";import{cn as N,fJ as E,$O as F,Po as ae,P5 as H,P6 as ne,$P as Te,Pr as Ie,$Q as we,$R as se,Yx as Ce,Ns as ke,CY as je,$S as be,Py as Ae,$T as oe,ef as Z,Hz as re,eq as ve,er as Ee,$U as De,$V as Pe,P7 as Le,$W as Ue,P8 as Fe,Ph as Be,bp as Re,bK as Ve,cz as Me,bL as Oe,cm as Ne,bs as $e,hb as ze,cl as _e}from"./zeni-epic-state-C5DO1jkr.js";import{V as $,o as Ge,z as v,a9 as z,c as b,co as He,cp as Ze,cq as G,a2 as q,aC as qe,al as Ke,p as ie,_ as V,ac as We,a8 as Je,cr as Ye,af as K,s as Qe,cs as Xe,a5 as W,ct as et,az as tt,a0 as Q,cu as at,i as nt}from"./index-CnIO6_IQ.js";import{u as st,D as ot,n as R,S as rt}from"./mui-DNGY4bFU.js";import it from"./NotFoundScreen-DXy-BCit.js";import{S as X}from"./SetupPagesScreen-D6ssIWb0.js";import{a as p}from"./sentry-DWNq3t8E.js";import{u as ct}from"./useAskAiCfoHostNavButtonProps-DXFswt7R.js";import{u as lt}from"./useInitialThreadRequest-DAUsQlCl.js";import{M as ce}from"./MobileAppDrawer-BWNb5zLN.js";import{F as ut}from"./FeaturePreviewScreen-DHt0WFS8.js";import{a as ee}from"./analyticsHelper-CWMk7_rd.js";import"./recharts-CTh_JhT_.js";import"./analytics-Vgn85Ur_.js";import"./plaid-DhfTjhua.js";import"./dnd-DuiAlI7w.js";import"./stripe-cKAAJElX.js";import"./lottie-Lb1ftKY1.js";import"./lexical-B-vxEaRQ.js";import"./pdf-B1uD4Ovv.js";import"./utils-CrhrpmD8.js";import"./BusinessVerificationPageScreen-DM_jBIuD.js";import"./routePaths-CV12X_S-.js";import"./InboxNotificationsProvider-CiKEEv6Q.js";import"./useTaskManagerAccess-Cm5trA3i.js";import"./useIsCustomersTabEnabled-C6mkabn2.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]="54318b24-e4f6-4b44-9e41-98c830b6b80b",t._sentryDebugIdIdentifier="sentry-dbid-54318b24-e4f6-4b44-9e41-98c830b6b80b")}catch{}})();const dt=O((function(t,a){const{companyId:n}=a;return{treasurySetupView:F(t,n),analytics:b}}),(function(t,a){const{navigate:n,analytics:r,treasurySetupView:i}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const o=i.fundAllocationLocalData;r.trackTreasuryPortfolioConfirm(o.riskScore,ee(o)),t(Ie(!0))},onUpdateFundAllocation:o=>{r.trackTreasuryAllocationAction("update",ee(o)),t(Te(o))}}}))(He);function pt(){const t=P(),a=L(),n=U(),{tenantEmailDomain:r}=M(),i=$(),o=y((w=>w.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState)),m=Ge(o),s=N(i?.loggedInUserRoleMap),[d,c]=p.useState(!1),[h,T]=p.useState(!1),[l,u]=p.useState(!1),x=y((w=>E(w))),f=v.getSignedInUserTenant(r)?.companyId??x.companyId,C=v.getSignedInUser(),S=y((w=>F(w,f))),g=y((w=>w.treasurySetupViewState.fetchState)),j=y((w=>w.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),I=y((w=>w.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState));if(C==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(p.useEffect((()=>{d||g!=="Not-Started"||f==null||(c(!0),n(ae(f,!0,!1)))}),[d,g,f,n]),p.useEffect((()=>{l||I!=="Not-Started"||f==null||(u(!0),n(H()))}),[l,I,f,n]),p.useEffect((()=>{h||j!=="Not-Started"||f==null||(T(!0),n(ne()))}),[h,j,f,n]),p.useEffect((()=>{m==="In-Progress"&&o==="Completed"&&t("../")}),[m,o,t]),x.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(D,{to:"../promo"});const B=x.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||g!=="Completed";return e.jsxs(e.Fragment,{children:[!B&&e.jsx(z,{analytics:b,onLoad:()=>{}}),e.jsx(dt,{navigate:t,location:a,companyId:f,isEditMode:!0,isLoading:B,isReadOnly:!s,treasurySetupView:S,analytics:b})]})}const mt=O((function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:Ce(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:F(t,n)}}),(function(t,a){const{navigate:n,transferDetails:r,treasurySetupView:i}=a,o=r.treasuryTransferMoneyLocalData,m=i.fundAllocationLocalData;return{onCancelClick:()=>{G(a.analytics,"cancel",o,m,"Transfer"),t(se()),n("../")},onTransferClick:()=>{G(a.analytics,"confirm",o,m,"Transfer"),t(Ae())},onSaveChangesToLocalStore:s=>{t(be(s))},onFetchLinkTokenClick:s=>{t(je("treasury_setup",s))},onEstablishConnectionClick:s=>{t(ke(s,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}}))(Ze),ft=({isFirstTransfer:t,isTransactionsLoaded:a})=>{const n=P(),{tenantEmailDomain:r}=M(),i=U(),[o,m]=p.useState(!1),[s,d]=p.useState(!1),[c,h]=p.useState(!1),[T,l]=p.useState(!1),u=y((I=>I.treasurySetupViewState.fetchState)),x=y((I=>I.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),f=y((I=>I.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),C=y((I=>E(I))),S=v.getSignedInUserTenant(r)?.companyId??C.companyId,g=y((I=>we(I))),j=y((I=>F(I,S)));if(v.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return p.useEffect((()=>{s||u!=="Not-Started"||S==null||(d(!0),i(ae(S,!0,!1)))}),[s,u,S,i]),p.useEffect((()=>{c||x!=="Not-Started"||S==null||(h(!0),i(H()))}),[c,x,S,i]),p.useEffect((()=>{T||f!=="Not-Started"||S==null||(l(!0),i(ne()))}),[T,f,S,i]),e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:b,onLoad:()=>{}}),e.jsx(mt,{analytics:b,navigate:n,transferDetails:g,onAnotherTransferClick:()=>{m(!1),i(se())},currentTenant:C,treasurySetupView:j,showReviewContent:o,maxInsuredAmount:5e5,onReviewClick:()=>{G(b,"review",g.treasuryTransferMoneyLocalData,j.fundAllocationLocalData,"Transfer"),m(!0)},isFirstTransfer:t,isTransactionsLoaded:a,setShowReviewContent:m,onBackClick:()=>{}})]})},yt=R.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${t=>t.theme.colors.grey4};
|
|
9
|
+
`,gt={overlayWidth:new We(100,100,48)},ht=O((function(t,a){const n=oe(t),{companyId:r}=a;return{treasuryDetail:n,treasurySetupView:F(t,r),downloadEndPoint:`${K.bankingMicroServiceBaseUrl}/1.0/treasury-account/statements?query={"statement_type":"tax_statement"}`}}),(function(t,a){const{navigate:n,currentTenant:r,location:i,handleDrawerToggle:o,analytics:m}=a,{tenantEmailDomain:s}=r;return{onSettingsClick:()=>{m.trackAccountsListPageClicked("Settings Icon"),n("setup")},onReloadTransactions:()=>{t(re(!0))},handleTreasuryOptionSelection:d=>{let c="page-not-found";d==="editPortfolio"?c=St(s):d==="statements"?c=xt(s):d==="taxLetter"?c=Tt(s):d==="settings"&&(c=It(s));const h=Qe(i.state?.pathnameStackToGoBack,i.pathname);n(c,{state:{pathnameStackToGoBack:h}})},onColumnSortConfigChanged:(d,c)=>{t(De({uiState:{sortKey:d,sortOrder:c}}))},onTransferClick:()=>{n("./transfer")},onBackClick:()=>{n("../../")},onClickMenuIcon:()=>{o(!0)},onAutoTransferClick:()=>{n("../../checking/auto-transfer")}}}))(Ye);function _({isTransferDrawerOpen:t,isEditPortfolioDrawerOpen:a}){const n=L(),r=P(),i=U(),o=q(),m=st(),s=y((A=>E(A))),{tenantEmailDomain:d}=M(),c=s.companyId??v.getSignedInUserTenant(d)?.companyId,[h,T]=p.useState(!1),l=y((A=>oe(A))),u=l.fetchState,x=l.accountSummary?.totalBalance?.amount,f=y((A=>A.treasurySetupViewState.treasuryFundsDetails?.fetchStatus)),C=s.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",S=$(),g=!!s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,j=N(S?.loggedInUserRoleMap),I=Z(S?.loggedInUserRoleMap),{areTenantIdsInSync:B}=qe();p.useEffect((()=>{u==="Not-Started"&&!h&&B&&(T(!0),i(re(!0)))}),[h,i,u,B]),p.useEffect((()=>{l.transactionsFetchState.fetchState==="Completed"&&l.transactions.length===0&&!n.pathname.includes("transfer")&&j&&r("./transfer")}),[l.transactionsFetchState.fetchState,l.transactions.length,n.pathname,j,r]);const w=()=>{r("..")},[le,ue]=p.useState(!1),J=A=>{ue(A)},{isAiCfoAccessEnabled:de,onAskAiCfoClick:pe}=ct({mobileExploreReferrer:"Treasury"});Ke({isDataReady:u==="Completed"});const{useFeatureGate:Y}=ie(),{isFeatureEnabled:me}=Y(V.isDebitCardFeatureEnabled),{isFeatureEnabled:fe}=Y(V.isAutoTransferRuleEnabled),ye=lt(c,{clearParams:u==="Completed"&&f?.fetchState==="Completed"}),ge=ve(s),he=Ee(me,s);if(ge===!0&&he!==!0)return e.jsx(ut,{});if(C){const A=f?.fetchState!=="Completed"||l.accountSummaryFetchState.fetchState!=="Completed";return e.jsxs(e.Fragment,{children:[l.accountSummaryFetchState.fetchState==="Completed"&&f?.fetchState==="Completed"&&t===!1&&a===!1?e.jsx(z,{analytics:b,onLoad:()=>{}}):null,e.jsx(ot,{onClose:w,anchor:"right",open:a||t,transitionDuration:250,PaperProps:{style:{width:gt.overlayWidth.valuePercentage(o),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:m.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsxs(wt,{onClick:Se=>Se.stopPropagation(),children:[t===!0?e.jsx(ft,{isFirstTransfer:l.transactions.length===0||x===0,isTransactionsLoaded:l.transactionsFetchState.fetchState!=="In-Progress"&&l.transactionsFetchState.fetchState!=="Not-Started"}):null,a===!0?e.jsx(pt,{}):null]})}),e.jsxs(yt,{windowSize:o,children:[e.jsx(ce,{isAppContentDrawerOpen:le,handleDrawerToggle:J}),e.jsx(ht,{treasuryDetailsView:l,isAutoTransferRuleEnabled:fe,navigate:r,currentTenant:s,location:n,companyId:c,analytics:b,handleDrawerToggle:J,initialOpenThreadRequest:ye,isLoading:A,isAiCfoAccessEnabled:de,onAskAiCfoClick:pe})]})]})}return g&&j?e.jsx(D,{to:"../setup"}):s.companyTreasuryInfo?.info&&!g&&I?e.jsx(D,{to:"../promo",state:n.state}):e.jsx(Je,{fetchState:"In-Progress",style:{backgroundColor:m.colors.grey5}})}const St=t=>`/${t}/treasury/edit-portfolio`,xt=t=>`/${t}/treasury/statements`,Tt=t=>`/${t}/treasury/tax-letter`,It=t=>`/${t}/treasury/setup`,wt=R(rt)`
|
|
10
|
+
display: flex;
|
|
11
|
+
min-height: 100%;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
`,Ct=R.div`
|
|
14
|
+
display: flex;
|
|
15
|
+
height: 100vh;
|
|
16
|
+
width: 100%;
|
|
17
|
+
flex: 1 1 auto;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
align-items: center;
|
|
20
|
+
background-color: ${t=>t.theme.colors.grey4};
|
|
21
|
+
`;function kt(){const t=P(),a=U(),n=q(),r=L(),i=`${K.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[o,m]=p.useState(!1),s=y((u=>Pe(u)));p.useEffect((()=>{o||s.fetchState!=="Not-Started"||(m(!0),a(Le(!1)))}),[o,s.fetchState,a]);const d=v.getSignedInUser(),c=y((u=>E(u))),h={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:c.tenantId??""},T=c.company?.companyInfo.companyLegalName??c.companyName;if(d==null)throw Error("Can't access statements page without signing in...");const l=s.fetchState!=="Completed";return e.jsx(Ct,{windowSize:n,children:e.jsx(Xe,{currentTenantCompanyName:T,statementListView:s,isLoading:l,onBackClick:()=>{const u=W(r.state?.pathnameStackToGoBack),x=u.poppedPathname??"..";t(x,{state:{pathnameStackToGoBack:u.newStack}})},authParams:h,downloadEndPoint:i})})}const jt=R.div`
|
|
22
|
+
display: flex;
|
|
23
|
+
height: 100vh;
|
|
24
|
+
width: 100%;
|
|
25
|
+
flex: 1 1 auto;
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
align-items: center;
|
|
28
|
+
background-color: ${t=>t.theme.colors.grey4};
|
|
29
|
+
`;function bt(){const t=P(),a=q(),n=L(),r=U(),i=`${K.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[o,m]=p.useState(!1),s=y((u=>Ue(u)));p.useEffect((()=>{o||s.fetchState!=="Not-Started"||(m(!0),r(Fe(!1)))}),[o,s.fetchState,r]);const d=v.getSignedInUser(),c=y((u=>E(u))),h={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:c.tenantId??""},T=c.company?.companyInfo.companyLegalName??c.companyName;if(d==null)throw Error("Can't access tax letter page without signing in...");const l=s.fetchState!=="Completed";return e.jsx(jt,{windowSize:a,children:e.jsx(et,{currentTenantCompanyName:T,taxLetterListView:s,isLoading:l,onBackClick:()=>{const u=W(n.state?.pathnameStackToGoBack),x=u.poppedPathname??"..";t(x,{state:{pathnameStackToGoBack:u.newStack}})},authParams:h,downloadEndPoint:i})})}const At=O((function(t,a){const{companyId:n}=a,r=F(t,n);return{treasurySetupView:r,isSetupComplete:r.companyTreasuryInfo?.businessVerificationStatus?.code==="verified",videoUrl:"https://www.youtube.com/watch?v=sqvJWKCMZgk"}}),(function(t,a){const{navigate:n,companyId:r}=a;return{onSetupButtonClick:()=>{t(Be(r))},onBackClick:()=>{n("../..",{relative:"path"})},onTreasurySetupSuccess:i=>{n(i?"..":"../setup",{relative:"path"})}}}))(at),vt=()=>{const t=tt(),a=P(),n=L(),r=U(),{tenantEmailDomain:i}=M(),[o,m]=p.useState(!1),s=y((g=>E(g))),[d,c]=p.useState(!1),h=y((g=>g.treasurySetupViewState.treasuryFundsDetails?.fetchStatus));p.useEffect((()=>{d||h?.fetchState!=="Not-Started"||T==null||(c(!0),r(H()))}),[h,r]);const T=v.getSignedInUserTenant(i)?.companyId??s.companyId,l=v.getSignedInUser(),u=!!s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,x=g=>{m(g)};if(l==null)throw Error("Can't access treasury promo page without signing in...");const f=$(),C=N(f?.loggedInUserRoleMap),S=Z(f?.loggedInUserRoleMap);if(u&&C)return e.jsx(D,{to:"../../treasury/setup"});if(s.company?.companyTreasuryInfo&&(!u&&C||S)){if(n.state?.message==="activation"){const g=W(n.state?.pathnameStackToGoBack);a(n.pathname,{state:{...n.state,message:void 0,pathnameStackToGoBack:g.newStack}})}return h?.fetchState!=="Completed"?e.jsx(te,{children:e.jsx(Q,{size:"ExtraLarge",start:!0})}):e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:b,onLoad:g=>(j=>j.trackTreasuryPromoView("Treasury Promo Page"))(g)}),e.jsx(ce,{isAppContentDrawerOpen:o,handleDrawerToggle:x}),e.jsx(At,{analytics:b,navigate:a,companyId:T,meetingUrl:t("treasury_promo"),onClickMenuIcon:()=>{x(!0)}})]})}return e.jsx(te,{children:e.jsx(Q,{size:"ExtraLarge",start:!0})})},te=R.div`
|
|
30
|
+
display: flex;
|
|
31
|
+
width: 100%;
|
|
32
|
+
height: 100%;
|
|
33
|
+
flex-direction: row;
|
|
34
|
+
justify-content: center;
|
|
35
|
+
align-items: center;
|
|
36
|
+
background-color: ${t=>t.theme.colors.grey5};
|
|
37
|
+
`;function aa(){const t=L(),a=y((g=>E(g))),{useFeatureGate:n}=ie(),r=a.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",i=!!a.company?.companyTreasuryInfo?.isTreasuryTOSAccepted,o=$(),m=Z(o?.loggedInUserRoleMap),s=a?.userRole!=null&&Re(a?.userRole),d=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!s)&&Ve(o?.loggedInUserRoleMap),c=Me(o?.loggedInUserRoleMap),h=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!s)&&Oe(o?.loggedInUserRoleMap),T=!!a.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!s&&Ne(o?.loggedInUserRoleMap),l=r&&!s&&N(o?.loggedInUserRoleMap),{isFeatureEnabled:u}=n(V.isChargeCardFeatureEnabled),{isFeatureEnabled:x}=n(V.isDebitCardFeatureEnabled),f=nt(a,u,x)&&!s&&$e(o?.loggedInUserRoleMap),C=ze(o?.loggedInUserRoleMap),S=_e(o?.loggedInUserRoleMap);return e.jsxs(xe,{children:[S?null:e.jsx(k,{path:"setup",element:e.jsx(X,{isBillPayAdminLevelAccess:d,isReimbursementAdminLevelAccess:h,isZeniAccountAdminLevelAccess:T,isChargeCardAdminLevelAccess:f,isTreasuryAdminLevelAccess:l,isUserHasOnlyCardAccess:C,isUserHasOnlyBillPayAccess:c,productType:"zeni_treasury",type:"setup"})}),S?null:e.jsx(k,{path:"verification",element:e.jsx(X,{isBillPayAdminLevelAccess:d,isUserHasOnlyBillPayAccess:c,isReimbursementAdminLevelAccess:h,isZeniAccountAdminLevelAccess:T,isChargeCardAdminLevelAccess:f,isTreasuryAdminLevelAccess:l,isUserHasOnlyCardAccess:C,productType:"zeni_treasury",type:"verification"})}),e.jsx(k,{path:"promo",element:e.jsx(vt,{})}),e.jsx(k,{path:"statements",element:e.jsx(kt,{})}),e.jsx(k,{path:"tax-letter",element:e.jsx(bt,{})}),r?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"/",element:e.jsx(_,{isTransferDrawerOpen:!1,isEditPortfolioDrawerOpen:!1})}),l?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(it,{})})]}):i&&l?e.jsx(k,{path:"*",element:e.jsx(D,{to:"../setup"})}):a.company?.companyZeniAccountInfo&&m?e.jsx(k,{path:"*",element:e.jsx(D,{to:"../promo",state:t.state})}):e.jsx(k,{path:"*",element:null})]})}export{aa as default};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{j as o}from"./liveblocks-
|
|
1
|
+
import{j as o}from"./liveblocks-BLpmr1Pv.js";import{a as u}from"./sentry-DWNq3t8E.js";import{h as G,u as N,i as Y,j as f,l as $,g as W,n as Me,o as P,N as L}from"./core-CbdTrw7T.js";import{$X as gt,$Y as Ze,SE as et,$Z as vt,fJ as U,h3 as ge,$_ as Tt,cw as xt,$$ as bt,Gw as yt,a00 as wt,a01 as oe,a02 as te,VK as ve,Ug as ue,Uh as ke,GM as pe,Uf as he,Gz as tt,G6 as Pe,a03 as It,Ui as J,mb as me,a04 as je,G0 as Ct,$q as Dt,$r as Et,a05 as _e,a06 as Ve,a07 as Ae,a08 as Re,GG as Te,a09 as nt,Gn as at,a0a as Ft,a0b as kt,a0c as Pt,a0d as jt,a0e as _t,a0f as Vt,a0g as At,a0h as Rt,D8 as Ut,Dg as Lt,D9 as Bt,Tm as we,a0i as Ot,a0j as Mt,lr as Ie,bw as Gt,VV as $t,a0k as Nt,n9 as zt,ni as Yt,Tl as Ce,bF as Ge,a0l as ot,SW as st,Ya as Jt,a0m as Kt,a0n as qt,nk as Wt,a0o as $e,a0p as Ne,a0q as ze,a0r as Ye,a0s as Ht,ng as Qt,a0t as Xt,nj as Zt,a0u as en,a0v as it,TI as rt,mz as tn,a0w as nn,a0x as De,a0y as dt,TG as lt,Je as an,a0z as on,a0A as sn,mT as ct,a0B as rn,a0C as dn,TU as ln,vM as cn,a0D as ut,a0E as Je,TR as Ee,a0F as Ke,a0G as un,TW as pn,a0H as hn,a0I as mn,a0J as fn,a0K as Sn,a0L as gn,vP as vn,a0M as Tn,Uj as xn,YR as bn,Tz as Fe,io as yn,YU as wn,YT as In,il as Cn,a0N as Dn,a0O as En,Jj as Fn,a0P as kn,a0Q as Pn,a0R as jn,a0S as _n,mD as Vn,bm as An,er as Rn,eq as Un}from"./zeni-epic-state-C5DO1jkr.js";import{a2 as ne,ac as Ue,p as H,_ as M,z as R,a8 as Ln,cv as Bn,c as j,W as Le,j as xe,aj as ee,al as se,cw as On,cx as pt,aC as Mn,a9 as Se,cy as Gn,s as q,V as $n,G as ht,cz as Nn,af as mt,a5 as zn,o as qe,cA as Yn,N as K,aa as Jn,ag as ft,ah as Kn,aM as qn,cB as Wn,R as Be,cC as Hn,cD as Qn,a4 as Xn,cE as Zn,cF as ea}from"./index-CnIO6_IQ.js";import{u as ta,D as na,n as B,S as St}from"./mui-DNGY4bFU.js";import{t as aa,A as oa}from"./AddressScreen-DgUwrml_.js";import fe from"./NotFoundScreen-DXy-BCit.js";import{F as sa}from"./FeaturePreviewScreen-DHt0WFS8.js";import{a as ia,b as ra,J as da,S as la,c as ca}from"./ScheduleDetailsPrepaidExpensesScreen-ZwdXW6K5.js";import{u as ie}from"./useAskAiCfoHostNavButtonProps-DXFswt7R.js";import{M as re}from"./MobileAppDrawer-BWNb5zLN.js";import{v as Oe,t as ua,d as pa}from"./routePaths-CV12X_S-.js";import{D as ha}from"./DrawerScreen-BHaectiO.js";import{a as ma,m as fa}from"./accountMappingHelper-DSd2V454.js";import"./recharts-CTh_JhT_.js";import"./analytics-Vgn85Ur_.js";import"./plaid-DhfTjhua.js";import"./dnd-DuiAlI7w.js";import"./stripe-cKAAJElX.js";import"./lottie-Lb1ftKY1.js";import"./lexical-B-vxEaRQ.js";import"./pdf-B1uD4Ovv.js";import"./utils-CrhrpmD8.js";import"./pathToGoBack-CJCquoqC.js";import"./useActualMatchingMatchDetail-D-Ym3wTm.js";import"./stripSplatSuffix-DP9nmQOu.js";import"./decodeURIComponentSafe-D7APy95S.js";import"./InboxNotificationsProvider-CiKEEv6Q.js";import"./useTaskManagerAccess-Cm5trA3i.js";import"./useIsCustomersTabEnabled-C6mkabn2.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="20d712fb-0239-49b7-bcfa-58f15b109dff",e._sentryDebugIdIdentifier="sentry-dbid-20d712fb-0239-49b7-bcfa-58f15b109dff")}catch{}})();const Sa={drawerLeftMargin:new Ue(0,0,100,200)},ga=$((function(e,a){const{jeScheduledTransaction:s,selectedJERow:t,scheduleType:n,isVendorBulkUpdateOnTransactionEnabled:i}=a,{scheduleDetailsLocalData:l,updateStatus:p}=Ze(e,a.scheduleType),h=U(e),v=l[n].jeScheduleDetails[t].jeLink,m=v.type==="recommended"?v.recommendedTransactionID:v.transactionDetailID,r=m!=null?Tt(e,m):void 0,d=R.getSignedInUser(),c=e.tenantState.currentTenantId,T={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:h.tenantId??c},x=h?.company?.companyInfo?.firstMonthOfFY??1;return{jeScheduledTransaction:s,transactionDetail:r,localData:l[n].jeScheduleDetails[t],saveStatus:p.fetchState,authParams:T,isVendorBulkUpdateOnTransactionEnabled:i,firstMonthOfFY:x,isDisabled:p.fetchState==="In-Progress"?"readonly":void 0,analytics:j,qboAppUrl:xt(Le.qboRedirectionUrl)}}),(function(e,a){const{selectedJERow:s,jeScheduleDetailId:t,navigate:n}=a;return{onUpdateLocalData:i=>{const l=i.linkJETransaction.qboURL;l!=null&&e(wt({scheduleType:a.scheduleType,jeScheduleDetailId:t,rowId:s,jeLink:l}))},onFetchTransactionClick:i=>{e(et(i))},onSaveClick:()=>{e(yt(a.scheduleType,t))},onBackClick:()=>{n("..",{relative:"path"})},onCancelClick:()=>{const i=a.jeScheduledTransaction.scheduledJournalEntry[s];e(bt({scheduleType:a.scheduleType,jeScheduleDetailId:t,rowId:s,originalScheduledJE:i})),n("..",{relative:"path"})}}}))(Bn),va=()=>{const e=ta(),a=G(),s=N(),{scheduleDetailId:t}=Y(),n=ne(),i=Sa.drawerLeftMargin.valuePx(n),{scheduleType:l}=Y(),{useFeatureGate:p}=H(),{isFeatureEnabled:h}=p(M.isVendorBulkUpdateOnTransactionEnabled),v=gt(l)??"prepaid_expenses",[m,r]=u.useState(!1);if(R.getSignedInUser()==null)throw Error("Can't access Account detail page without signing in...");if(t==null)throw Error("Invalid Schedule Detail Id");const d=f((b=>Ze(b,v)));u.useEffect((()=>{d.fetchState==="Not-Started"&&a("..",{relative:"path"})}),[]);const c=d.selectedJELinkRowIndex,T=c!=null?d.scheduleDetailsLocalData[v].jeScheduleDetails[c]?.jeLink:null,x=T?.type==="recommended"?T.recommendedTransactionID:T?.transactionDetailID;u.useEffect((()=>{x!=null&&s(et(x))}),[]),u.useEffect((()=>{T?.type==="recommended"&&m===!1&&c!=null&&(r(!0),s(vt({scheduleType:v,jeScheduleDetailId:t,rowId:c})))}));const g=f((b=>U(b))),y=f((b=>ge(b,g.companyId)));return o.jsx(na,{anchor:"right",open:!0,PaperProps:{style:{width:`calc(100% - ${i})`,boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:e.colors.black,opacity:.75,cursor:"pointer"}}},onClose:()=>a("..",{relative:"path"}),children:o.jsx(Ta,{onClick:b=>b.stopPropagation(),children:d.fetchState!=="Completed"||d.selectedJEScheduleTransaction==null||c==null?o.jsx(Ln,{fetchState:d.fetchState}):o.jsx(ga,{scheduleType:v,jeScheduleDetailId:t,selectedJERow:c,jeScheduledTransaction:d.selectedJEScheduleTransaction,isCOTEnabled:!1,navigate:a,scheduleTab:v,controllerUserDetails:y,isVendorBulkUpdateOnTransactionEnabled:h})})})},Ta=B(St)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|
|
5
|
-
`,de=e=>{switch(e){case"vendors_tab":return"../summary";case"filing_1099":return"../filing_1099";case"prepaid_expenses":return"../schedules/prepaid_expenses";case"fixed_assets":return"../schedules/fixed_assets";case"accrued_expenses":return"../schedules/accrued_expenses";default:return"../opex"}},le=e=>{switch(e){case"prepaid_expenses":return"prepaid_expenses";case"fixed_assets":return"fixed_assets";case"accrued_expenses":return"accrued_expenses";case"operating_expenses_by_vendor":return"operating_expenses";default:return"vendors_list"}},ce=()=>{const e=
|
|
5
|
+
`,de=e=>{switch(e){case"vendors_tab":return"../summary";case"filing_1099":return"../filing_1099";case"prepaid_expenses":return"../schedules/prepaid_expenses";case"fixed_assets":return"../schedules/fixed_assets";case"accrued_expenses":return"../schedules/accrued_expenses";default:return"../opex"}},le=e=>{switch(e){case"prepaid_expenses":return"prepaid_expenses";case"fixed_assets":return"fixed_assets";case"accrued_expenses":return"accrued_expenses";case"operating_expenses_by_vendor":return"operating_expenses";default:return"vendors_list"}},ce=()=>{const e=W(),a=N(),s=f((t=>oe(t)));return u.useEffect((()=>{const t=e.pathname.split("/").pop();if(t!=null){const n=(i=>{switch(i){case"prepaid_expenses":return"prepaid_expenses";case"fixed_assets":return"fixed_assets";case"accrued_expenses":return"accrued_expenses";case"opex":return"operating_expenses";case"filing_1099":return"filing_1099";default:return"vendors_list"}})(t);n!==s.currentTab&&a(te(n))}}),[e.pathname,s.currentTab,a]),s},Q="accrued_expenses",xa=$((function(e,a){const s=U(e),t=oe(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,vendorTabView:t,isAccountingClassesEnabled:me(e)}}),(function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=de(t);s(n),e(te(le(t)))},onSortOrderChanged:(t,n)=>{e(Re({scheduleType:Q,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(Ae({scheduleType:Q,subTab:t}))},onSearchTextChanged:t=>{e(Ve({scheduleType:Q,searchText:t}))},onReloadReport:()=>{e(tt(Q))},onScroll:t=>{e(_e({scheduleType:Q,scrollYOffset:t}))},onClickNewButton:()=>{e(Dt()),e(Et()),j.trackScheduleAccruedDetailsNewRequested({scheduleType:"accrued_expenses"}),s("details/new")},onClickSchedule:t=>{e(Ct({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeAccruedSchedules.find((i=>i.jeAccruedScheduleKey===t));s(`details/${n?.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(je({scheduleType:Q,fetchState:t}))}}}))(On),ba=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const[t,n]=u.useState(!1),[i,l]=u.useState(!1),p=G(),h=N(),{useFeatureGate:v}=H(),m=xe();ce();const{isFeatureEnabled:r,isFeatureGateLoading:d}=v(M.isOpexByVendorFeatureEnabled),c=R.getSignedInUser(),T=f((S=>U(S))),x={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:T.tenantId},g=u.useMemo((()=>({authParams:x,jeScheduleEndPoint:`${ee}/jeScheduleReports`,timezone:ve(),companyName:T.companyName})),[]),[y,b]=u.useState(!1),I=f((S=>ue(S))),E=f((S=>ke(S,"accrued_expenses"))),C=e.includes("prepaid_expenses"),w=e.includes("fixed_assets"),A=e.includes("accrued_expenses");u.useEffect((()=>{(C||w||A)&&y===!1&&I!=="Completed"&&(h(pe()),b(!0))}),[y]),u.useEffect((()=>{d===!1&&(h(he({shouldFetchAccruedExpenses:A,shouldFetchFixedAssets:!0,shouldFetchPrepaidExpenses:C,shouldFetchOpexByVendor:r,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),n(!0))}),[I,w,d,r]),u.useEffect((()=>{t===!1&&E==="Completed"&&h(tt("accrued_expenses",{selectedTimeframe:Pe("accrued_expenses"),selectedCategoryId:"all"},!0))}),[t,E]);const _=f((S=>It(S,Q))),{isAiCfoAccessEnabled:O,onAskAiCfoClick:F}=ie({mobileExploreReferrer:"Vendors — Accrued Expenses"});se({isDataReady:_.fetchState==="Completed"});const D=f((S=>J(S).isReportGenerated));f((S=>J(S).fetchState))!=="Completed"||D!==!0||r!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),A||p("../opex");const k=f((S=>ge(S,T.companyId))),z=S=>{l(S)};return o.jsxs(o.Fragment,{children:[o.jsx(re,{isAppContentDrawerOpen:i,handleDrawerToggle:z}),o.jsx(xa,{navigate:p,previousTabPosition:a,setPreviousTabPosition:s,scheduleListReport:_,downloadParams:g,themeState:m,vendorTabsToShow:e,analytics:j,controllerUserDetails:k,isAiCfoAccessEnabled:O,onAskAiCfoClick:F,onClickMenuIcon:()=>z(!0)})]})},X="fixed_assets",ya=$((function(e,a){const s=U(e),t=oe(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,controllerUserDetails:a.controllerUserDetails,vendorTabView:t,isAccountingClassesEnabled:me(e)}}),(function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=de(t);s(n),e(te(le(t)))},onSortOrderChanged:(t,n)=>{e(Re({scheduleType:X,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(Ae({scheduleType:X,subTab:t}))},onSearchTextChanged:t=>{e(Ve({scheduleType:X,searchText:t}))},onReloadReport:()=>{e(Te(X))},onScroll:t=>{e(_e({scheduleType:X,scrollYOffset:t}))},onClickSchedule:t=>{e(at({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeScheduledTransactions.find((i=>i.jeScheduleTransactionKey===t));s(n?.jeScheduleId==null?"details/new":`details/${n.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(je({scheduleType:X,fetchState:t}))}}}))(pt),wa=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const[t,n]=u.useState(!1),i=G(),l=N();ce();const{useFeatureGate:p}=H(),h=xe(),{isFeatureEnabled:v,isFeatureGateLoading:m}=p(M.isOpexByVendorFeatureEnabled),r=R.getSignedInUser(),d=f((S=>U(S))),c={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:d.tenantId},T=u.useMemo((()=>({authParams:c,jeScheduleEndPoint:`${ee}/jeScheduleReports`,timezone:ve(),companyName:d.companyName})),[]),[x,g]=u.useState(!1),y=f((S=>ue(S))),b=f((S=>ke(S,"fixed_assets"))),I=e.includes("prepaid_expenses"),E=e.includes("fixed_assets"),C=e.includes("accrued_expenses");u.useEffect((()=>{(I||E||C)&&x===!1&&y!=="Completed"&&(l(pe()),g(!0))}),[x]),u.useEffect((()=>{m===!1&&(l(he({shouldFetchAccruedExpenses:C,shouldFetchFixedAssets:!0,shouldFetchPrepaidExpenses:I,shouldFetchOpexByVendor:v,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),n(!0))}),[y,E,m,v]),u.useEffect((()=>{t===!1&&b==="Completed"&&l(Te("fixed_assets",{selectedTimeframe:Pe("fixed_assets"),selectedCategoryId:"all"},!0))}),[t,b]);const w=f((S=>nt(S,X))),{isAiCfoAccessEnabled:A,onAskAiCfoClick:_}=ie({mobileExploreReferrer:"Vendors — Fixed Assets"});se({isDataReady:w.fetchState==="Completed"});const O=f((S=>J(S).isReportGenerated));f((S=>J(S).fetchState))!=="Completed"||O!==!0||v!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),E||i("../opex");const F=f((S=>ge(S,d.companyId))),[D,k]=u.useState(!1),z=S=>{k(S)};return o.jsxs(o.Fragment,{children:[o.jsx(re,{isAppContentDrawerOpen:D,handleDrawerToggle:z}),o.jsx(ya,{navigate:i,scheduleListReport:w,downloadParams:T,previousTabPosition:a,setPreviousTabPosition:s,themeState:h,vendorTabsToShow:e,analytics:j,controllerUserDetails:F,isAiCfoAccessEnabled:A,onAskAiCfoClick:_,onClickMenuIcon:()=>{z(!0)}})]})},Ia=B.div`
|
|
6
6
|
display: flex;
|
|
7
7
|
min-height: 100%;
|
|
8
8
|
width: 100%;
|
|
@@ -10,7 +10,7 @@ import{j as o}from"./liveblocks-ByIxqWJk.js";import{a as u}from"./sentry-9XsSr7s
|
|
|
10
10
|
flex-direction: column;
|
|
11
11
|
align-items: center;
|
|
12
12
|
background-color: ${e=>e.theme.colors.grey4};
|
|
13
|
-
`,Ca
|
|
13
|
+
`,Ca=$((function(e,a){const s=R.getSignedInUser(),t=e.tenantState.currentTenantId,n=U(e),i=n?.companyName??"",l={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""},p=J(e),h=Ft(e);return{report:p,uiState:h,isAccountingClassesEnabled:me(e),analytics:j,vendorTabsToShow:a.vendorTabsToShow,downloadParams:{downloadState:h.downloadState,currentTenantCompanyName:i,statementEndPoint:`${ee}/opexByVendor`,authParams:l,timezone:ve()}}}),(function(e,a){const{navigate:s}=a;return{onFetchOpExByVendors:(t,n,i)=>{e(Bt(t,n,i))},onVendorNameAndBalanceClicked:(t,n)=>{if(a.tenantEmailDomain!=null){const i=Oe(t.id,t.qboId,a.tenantEmailDomain,n),l=q(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:l,referrer:"Operating Expenses By Vendor"}})}},onRefresh:()=>{e(Lt())},onReloadReport:()=>{e(Ut(!0))},onBackClick:()=>{s("../../dashboard")},onTimeframeSelectionChanged:t=>{e(Rt(t))},onAdditionalBalanceSelectionChanged:(t,n)=>{e(At({isCompareModeOn:t,additionalBalances:n}))},onSortOrderChanged:(t,n,i)=>{e(Vt({sortkey:n,sortOrder:t,timeframe:i}))},onVendorTabSelectionChanged:t=>{const n=de(t);s(n),e(te(le(t)))},onSortOrSearchStarted:t=>{e(_t(t))},onPageFetchStarted:()=>{e(jt(!0))},updateDownloadStateHandler:t=>{e(Pt(t))},onClearSearch:t=>{e(kt({timeframe:t}))}}}))(Gn);function Da({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const t=G(),n=N(),i=W(),{tenantEmailDomain:l}=Y(),p=ne(),h=R.getSignedInUser(),{useFeatureGate:v}=H(),{isFeatureEnabled:m,isFeatureGateLoading:r}=v(M.isOpexByVendorFeatureEnabled),d=f((F=>J(F)));if(h==null)throw Error("Can't access opex by vendor page without signing in...");ce();const[c,T]=u.useState(!1),x=f((F=>ue(F))),g=e.includes("prepaid_expenses"),y=e.includes("fixed_assets"),b=e.includes("accrued_expenses"),I=f((F=>oe(F))),{isAiCfoAccessEnabled:E,onAskAiCfoClick:C}=ie({mobileExploreReferrer:"Vendors — Operating Expenses by Vendor"});se({isDataReady:d.fetchState==="Completed"&&d.isReportGenerated===!0});const{areTenantIdsInSync:w}=Mn();u.useEffect((()=>{(g||y||b)&&c===!1&&x!=="Completed"&&w&&(n(pe()),T(!0))}),[c,w]),u.useEffect((()=>{w&&r===!1&&n(he({shouldFetchAccruedExpenses:b,shouldFetchFixedAssets:y,shouldFetchPrepaidExpenses:g,shouldFetchOpexByVendor:m===!0,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1}))}),[x,y,r,m,w]),d.fetchState!=="Completed"||d.isReportGenerated!==!0||m!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),u.useEffect((()=>{w&&(d.isReportGenerated===!1&&d.fetchState==="Completed"||m===!1&&r===!1)&&t("../summary")}),[w,d.isReportGenerated,d.fetchState,m,r,t]);const[A,_]=u.useState(!1),O=F=>{_(F)};return o.jsxs(Ia,{windowSize:p,children:[d.fetchState==="Completed"?o.jsx(Se,{analytics:j,onLoad:F=>{I.previousTab==null?F.trackVendorOperatingExpensesPageLoaded("Side Panel"):F.trackVendorOperatingExpenses(I.currentTab,I.previousTab??null)}}):null,o.jsx(re,{isAppContentDrawerOpen:A,handleDrawerToggle:O}),o.jsx(Ca,{location:i,navigate:t,previousTabPosition:a,setPreviousTabPosition:s,tenantEmailDomain:l,vendorTabsToShow:e,isAiCfoAccessEnabled:E,onAskAiCfoClick:C,onClickMenuIcon:()=>{O(!0)}})]})}const Z="prepaid_expenses",Ea=$((function(e,a){const s=U(e),t=oe(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,controllerUserDetails:a.controllerUserDetails,vendorTabView:t,isAccountingClassesEnabled:me(e)}}),(function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=de(t);s(n),e(te(le(t)))},onSortOrderChanged:(t,n)=>{e(Re({scheduleType:Z,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(Ae({scheduleType:Z,subTab:t}))},onSearchTextChanged:t=>{e(Ve({scheduleType:Z,searchText:t}))},onReloadReport:()=>{e(Te(Z))},onScroll:t=>{e(_e({scheduleType:Z,scrollYOffset:t}))},onClickSchedule:t=>{e(at({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeScheduledTransactions.find((i=>i.jeScheduleTransactionKey===t));s(n?.jeScheduleId==null?"details/new":`details/${n.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(je({scheduleType:Z,fetchState:t}))}}}))(pt),Fa=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const[t,n]=u.useState(!1),i=G(),l=N(),{useFeatureGate:p}=H(),h=xe();ce();const v=R.getSignedInUser(),{isFeatureEnabled:m,isFeatureGateLoading:r}=p(M.isOpexByVendorFeatureEnabled),d=f((S=>U(S))),c=f((S=>ke(S,"prepaid_expenses"))),T={userId:v?.userId??"",sessionId:v?.zeniSessionId??"",tenantId:d.tenantId},x=u.useMemo((()=>({authParams:T,jeScheduleEndPoint:`${ee}/jeScheduleReports`,timezone:ve(),companyName:d.companyName})),[]),[g,y]=u.useState(!1),b=f((S=>ue(S))),I=e.includes("prepaid_expenses"),E=e.includes("fixed_assets"),C=e.includes("accrued_expenses");u.useEffect((()=>{(I||E||C)&&g===!1&&b!=="Completed"&&(l(pe()),y(!0))}),[g]),u.useEffect((()=>{t===!1&&c==="Completed"&&l(Te("prepaid_expenses",{selectedTimeframe:Pe("prepaid_expenses"),selectedCategoryId:"all"},!0))}),[t,c]),u.useEffect((()=>{r===!1&&(l(he({shouldFetchAccruedExpenses:C,shouldFetchFixedAssets:E,shouldFetchPrepaidExpenses:!0,shouldFetchOpexByVendor:m,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),n(!0))}),[b,E,r,m]);const w=f((S=>nt(S,Z))),{isAiCfoAccessEnabled:A,onAskAiCfoClick:_}=ie({mobileExploreReferrer:"Vendors — Prepaid Expenses"});se({isDataReady:w.fetchState==="Completed"});const O=f((S=>J(S).isReportGenerated));f((S=>J(S).fetchState))!=="Completed"||O!==!0||m!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),I||i("../opex");const F=f((S=>ge(S,d.companyId))),[D,k]=u.useState(!1),z=S=>{k(S)};return o.jsxs(o.Fragment,{children:[o.jsx(re,{isAppContentDrawerOpen:D,handleDrawerToggle:z}),o.jsx(Ea,{navigate:i,previousTabPosition:a,setPreviousTabPosition:s,scheduleListReport:w,downloadParams:x,themeState:h,vendorTabsToShow:e,analytics:j,controllerUserDetails:F,isAiCfoAccessEnabled:A,onAskAiCfoClick:_,onClickMenuIcon:()=>{z(!0)}})]})},ka=B.div`
|
|
14
14
|
display: flex;
|
|
15
15
|
min-height: 100%;
|
|
16
16
|
width: 100%;
|
|
@@ -18,9 +18,9 @@ import{j as o}from"./liveblocks-ByIxqWJk.js";import{a as u}from"./sentry-9XsSr7s
|
|
|
18
18
|
flex-direction: column;
|
|
19
19
|
align-items: center;
|
|
20
20
|
background-color: ${e=>e.theme.colors.grey4};
|
|
21
|
-
`,Pa
|
|
22
|
-
width: ${
|
|
23
|
-
height: ${
|
|
21
|
+
`,Pa=$((function(e,a){const{isFiling1099FeatureEnabled:s,vendorDetailView:t,selectedVendor:n,firstMonthOfFY:i,currentTenant:l,currentUserRoleMap:p}=a,h=R.getSignedInUser(),v={userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:l.tenantId??""};return{firstMonthOfFY:i,isFiling1099FeatureEnabled:s,vendorDetailView:t,allTransactions:t?.allVendorTransactionsView,allTransactionsTabData:t?.allTransactionsTabData!=null?{timePeriod:Jt(t?.allTransactionsTabData.timePeriod),numberOfQuartersFetched:t?.allTransactionsTabData.numberOfQuartersFetched}:void 0,vendorLogo:n?.logo,readOnlyMode:p?.bookkeeping_user===!0,filesEndPoint:mt.fileMicroServiceBaseUrl,authParams:v,scrollToTrend:a.isTrendPeriodSelected}}),(function(e,a){const{navigate:s,vendorDetailView:t,vendorId:n,defaultTransactionTimePeriod:i,vendorEntity:l,tenantEmailDomain:p,location:h,firstMonthOfFY:v}=a,m=()=>{const r=zn(h.state?.pathnameStackToGoBack),d=r.poppedPathname??((c=2)=>{let T=c;a.isTrendPeriodSelected===!0&&(T=5);let x="../";for(let g=0;g<T;g++)x=`${x}../`;return x})(1);s(d,{state:{pathnameStackToGoBack:r.newStack}})};return{onSaveVendor:()=>{t!=null&&((r,d)=>{const{vendorId:c,vendorName:T,existingCategory:x,existingClass:g,existingOwner:y,selectedCategory:b,selectedClass:I,selectedOwner:E,isRecommendedCategorySelected:C,isRecommendedClassSelected:w,categoryRecommendationTypeSelected:A,classRecommendationTypeSelected:_}=en(r,d);c!=null&&j.trackVendorDetailsSave(c,T??"",x,g,y,b,I,E,C,w,A,_)})(t?.vendorViewDetails,t?.vendorViewDetails.ownerList),n!=null&&e(Zt(n,void 0))},onVendorSpendTrendFilterTabClick:r=>{e(Xt(r))},saveVendorDetailLocalData:r=>{n!=null&&e(Qt({vendorId:n,localData:r}))},saveContactsInVendorTabDetailLocalData:(r,d)=>{e(Ht({vendorId:r,localData:{contacts:d}}))},onCancelClick:()=>{var r;t?.vendorViewDetails.vendorView?.vendorBasic!=null&&(r=t.vendorViewDetails.vendorView.vendorBasic).id!=null&&j.trackVendorDetailsCancel(r.id??"",r.name,r.account?.accountName,r.class?.className,r.owner?.email),e($e()),e(Ne()),e(ze()),e(Ye()),m()},handleSpendTrendPercentChangeClick:()=>{var r;t?.vendorViewDetails.vendorView?.vendorBasic!=null&&(r=t.vendorViewDetails.vendorView?.vendorBasic,r.id!=null&&j.trackVendorDetailsSpendTrendHotlinkClicked(r.id??"",r.name,r.account?.accountName,r.class?.className,r.owner?.email))},onSaveSuccess:()=>{n!=null&&e(Wt("Not-Started",n)),e($e()),e(Ne()),e(ze()),e(Ye()),m()},onTrendSelectedPeriodChange:r=>{if(r==null)i!=null&&e(we(l,"EntityDetail",{timeframe:"quarter",timePeriod:i}));else{const d=r.currentTimePeriod==null?r.addTimePeriod:{startDate:r.addTimePeriod.startDate,endDate:r.currentTimePeriod.endDate};e(Ce(l,"EntityDetail",{timeframe:r.timeframe,timePeriod:r.addTimePeriod},v)),e(we(l,"EntityDetail",{timeframe:r.timeframe,timePeriod:d}))}},onVendorTabSelectionChanged:r=>{e(qt(r))},onAddressClick:(r,d)=>{if(p==null)return;const c=pa(p,r,d),T=q(h.state?.pathnameStackToGoBack,h.pathname);s(c,{state:{pathnameStackToGoBack:T}})},onVendorDetailUIChange:r=>{e(Kt({collapsableStatus:r}))},onTransactionItemClick:r=>{const d=`${ua(r,p)}`,c=q(h.state?.pathnameStackToGoBack,h.pathname);s(d,{state:{pathnameStackToGoBack:c}})},onLoadPreviousTransactionsClick:(r,d)=>{e(ot({timePeriod:Ie(r),numberOfQuartersFetched:d})),e(st(l,Ie(r),!0,!0))}}}))(Nn);function We({referrerType:e,isFiling1099FeatureEnabled:a}){const s=N(),t=W(),n=G(),i=$n(),[l,p]=u.useState(!1),[h,v]=u.useState(!1),[m,r]=u.useState(!1),d=Y(),c=d.vendorId,T=d.qboId,{tenantEmailDomain:x,timeframe:g,startDate:y,endDate:b}=d,I={id:T??"",name:"",type:"vendor",zeniId:c??"",qboId:T??""};u.useEffect((()=>{g!=null&&y!=null&&b!=null?p(!0):(p(!1),m===!1&&(r(!0),s(we(I,"EntityDetail"))))}),[g,y,b]);const E=ne(),C=f((V=>U(V))),w=f((V=>c!=null?Ot(V,c,I):void 0)),A=f((V=>V.vendorState.vendorByID[c??""])),_=f((V=>U(V).company?.companyInfo.firstMonthOfFY??1)),O=f((()=>Mt(_,2))),F=Ie({startDate:O.startDate,endDate:Gt()}),D=$t(_),k=f((V=>Nt(V.trendWithTransactionsState,I,"EntityDetail"))),[z,S]=u.useState(!1),be=l===!1&&m===!1?void 0:k?.selectedPeriod?.timePeriod??D;return u.useEffect((()=>(e==null&&w?.fetchState!=="Not-Started"||c==null||s(zt(c,I)),()=>{e!=null&&c!=null&&s(Yt(c))})),[c,t.state,s]),u.useEffect((()=>{w?.fetchState==="Completed"&&w?.vendorViewDetails.vendorView?.vendorBasic!=null&&((V,ae,ye)=>{V.id!=null&&j.trackVendorDetails(V.id,V.name,ye,V.account?.accountName,V.class?.className,V.owner?.email,ae.percentChange,ae.last30DaysSpend,ae.last90DaysSpend,ae.yearToDateSpend)})(w?.vendorViewDetails.vendorView?.vendorBasic,w?.vendorSpend,e),S(!1)}),[w?.fetchState]),u.useEffect((()=>{if(w?.fetchState==="Completed"&&z===!1){be!=null&&l===!1&&(s(Ce(I,"EntityDetail",{timeframe:k?.selectedPeriod?.timeframe??"quarter",timePeriod:be},_)),S(!0));const V=ht.getLocalizedStrings().dateFormat.analytics;if(l===!0&&g!=null&&y!=null&&b!=null){S(!0);const ae=g,ye={startDate:Ge(y,V.YYYYDashMMDashDDFormat),endDate:Ge(b,V.YYYYDashMMDashDDFormat)};s(Ce(I,"EntityDetail",{timeframe:ae,timePeriod:ye}))}}}),[w?.fetchState,be,k?.selectedPeriod?.timeframe,l,_]),u.useEffect((()=>{w?.fetchState==="Completed"&&h===!1&&(s(ot({timePeriod:F,numberOfQuartersFetched:3})),s(st(I,w.allTransactionsTabData?.timePeriod??F,!1,!0)),v(!0))}),[w?.fetchState,h]),c==null?o.jsx(fe,{}):o.jsx(ka,{windowSize:E,children:o.jsx(Pa,{location:t,navigate:n,isFiling1099FeatureEnabled:a,vendorDetailView:w,vendorId:c,currentTenant:C,selectedVendor:A,firstMonthOfFY:_,isTrendPeriodSelected:l,selectedPeriodTimePeriod:k?.selectedPeriod?.timePeriod,defaultTransactionTimePeriod:D,vendorEntity:I,currentUserRoleMap:i?.loggedInUserRoleMap,tenantEmailDomain:x})})}const ja=ht.getLocalizedStrings().spendManagement.billPay.vendorCreation.vendorDetails,_a={containerWidth:new Ue(100,58)},Va=B(Jn)`
|
|
22
|
+
width: ${K.sp4};
|
|
23
|
+
height: ${K.sp4};
|
|
24
24
|
cursor: pointer;
|
|
25
25
|
color: ${e=>e.theme.colors.brandColorJade};
|
|
26
26
|
`,Aa=B.div`
|
|
@@ -35,29 +35,29 @@ import{j as o}from"./liveblocks-ByIxqWJk.js";import{a as u}from"./sentry-9XsSr7s
|
|
|
35
35
|
flex-direction: column;
|
|
36
36
|
width: ${e=>`${_a.containerWidth.value(e.windowSize)}%`};
|
|
37
37
|
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
38
|
-
`,Ua
|
|
38
|
+
`,Ua=$((function(e,a){const s=R.getSignedInUser(),t=e.tenantState.currentTenantId,n={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""},i=e.vendorFiling1099UploadDetailsState,l=e.vendorFiling1099UploadDetailsState;let p={fetchState:"Not-Started",error:void 0};return a.vendorId!=null&&(p=e.vendorViewState.editVendorStateById[a.vendorId]?.fetchStatus),{uploadInvoiceEndPoint:`${mt.documentAIMicroServiceBaseUrl}`,vendorFiling1099UploadDetailsState:i,vendorFiling1099UploadDetailsViewState:l,uploadStaus:l.w9FormUploadStatus,authParams:n,billId:a.billId,vendorId:a.vendorId,file:a.file,showAutofill:a.showAutofill,type:a.type,analytics:j,entityId:a.billId,fetchVendorFetchStatus:p,vendorLegalName:a.vendorLegalName}}),(function(e,a){const s=a.vendorId;return{onInvoiceUpload:t=>{if((function(n){return n!=null&&"w9_form"in n})(t)&&(e(on({w9FormFile:t.files[0]})),t.w9_form[0]!=null)){e(sn({ocrData:t.w9_form[0],vendorId:s}));const n=(i=>({street:[i.street.join(" ")],city:i.city,state:i.state,postalCode:i.postal_code,countryCode:i.country_code??void 0,country:i.country??""}))(t.w9_form[0].address);e(ct({addressType:"vendor_address",addressToCreate:n}))}},updateInvoiceUploadFetchState:t=>{e(De({fetchState:t,error:void 0}))},onSkipAutofill:t=>{e(an(t))},onVendorFiling1099UploadDetailsSave:t=>{e(lt(t))},onDeleteClick:()=>{e(De({fetchState:"Not-Started",error:void 0})),e(dt({vendorId:s,w9Documents:[]}))}}}))(qn);function He({appContent:e,showFullScreenSkeletonWhileLoading:a}){const s=N(),t=G(),{vendorId:n}=Y(),i=ne(),l=xe(),p=R.getSignedInUser(),[h,v]=u.useState(!1),{useFeatureGate:m}=H(),{isFeatureEnabled:r}=m(M.isVendorRecommendationFeatureEnabled),d=f((D=>U(D))).companyName,c=new AbortController,T=c.signal;let x,g,y,b,I;if(n==null)throw new Error("Vendor ID not found for Vendor Filing 1099 Details Screen");x=f((D=>it(D,n))),g=f((D=>D.vendorFiling1099UploadDetailsState.vendor1099DetailsSaveStatus)),y=f((D=>D.vendorViewState.editVendorStateById[n]?.fetchStatus)),I=f((D=>D.vendorFiling1099UploadDetailsState.vendor1099DetailsLocalData.w9Documents?.[0])),b=f((D=>D.vendorFiling1099UploadDetailsState));const E=y?.fetchState==="In-Progress"||b?.w9FormUploadStatus?.fetchState==="In-Progress",C=()=>{l.toggle()};u.useEffect((()=>()=>{c.abort(),s(rt(n))}),[]),u.useEffect((()=>{h||n!=null&&(v(!0),s(tn(!1,n,T)))}),[n]);const w=qe(y?.fetchState),A=qe(g?.fetchState),_=x.vendor?.contactIds,O=_?.[_.length-1],F=f((D=>D.contactState.contactById[O]));if(u.useEffect((()=>{n!=null&&w==="In-Progress"&&y?.fetchState==="Completed"&&x?.vendor!=null&&(s(nn(n,x.vendor,F)),x?.vendor.filing1099W9Files?.[0]!=null&&s(De({fetchState:"Completed",error:void 0})))}),[n,x?.vendor]),u.useEffect((()=>{A==="In-Progress"&&g?.fetchState==="Completed"&&t("../../vendors/filing_1099")}),[g?.fetchState]),a===!0&&y?.fetchState!=="Completed"&&y?.fetchState!=="Error")return o.jsx(Ga,{children:o.jsx(Yn,{})});if(p==null)throw Error("Can't access VendorFiling1099UploadScreen without signing in...");return o.jsxs(Aa,{windowSize:i,children:[i!=="small"?o.jsxs(Ba,{children:[o.jsx(Va,{onClick:C}),o.jsxs(La,{showContent:p.userEmailDomain==="zeni.ai",children:[o.jsx(Oa,{showAutofill:!1}),o.jsx(Ma,{showAutofill:!1,children:d})]})]}):null,o.jsx(Ua,{vendorId:n,file:I,showAutofill:!1,type:"w9",isVendorRecommendationEnabled:r,pdfTitle:I?ja.w9FormTitle:void 0,showTitlebar:!0,showTitlebarIcon:!0,vendorLegalName:x?.vendor?.legalName,isLoading:E}),o.jsx(Ra,{windowSize:i,children:e})]})}const La=B.div`
|
|
39
39
|
display: ${e=>e.showContent?"flex":"none"};
|
|
40
40
|
align-items: center;
|
|
41
41
|
`,Ba=B.div`
|
|
42
|
-
margin-bottom: ${
|
|
43
|
-
margin-top: ${
|
|
44
|
-
margin-left: ${
|
|
42
|
+
margin-bottom: ${K.sp3};
|
|
43
|
+
margin-top: ${K.sp3};
|
|
44
|
+
margin-left: ${K.sp8};
|
|
45
45
|
position: absolute;
|
|
46
46
|
display: flex;
|
|
47
47
|
align-items: center;
|
|
48
48
|
`,Oa=B.div`
|
|
49
49
|
width: 1px;
|
|
50
|
-
height: ${
|
|
51
|
-
margin: ${
|
|
50
|
+
height: ${K.sp3};
|
|
51
|
+
margin: ${K.sp0} ${K.sp3};
|
|
52
52
|
background-color: ${e=>e.showAutofill?ft.neutralGrey1Light:e.theme.colors.hero};
|
|
53
|
-
`,Ma=B(
|
|
53
|
+
`,Ma=B(Kn.StandardMedium)`
|
|
54
54
|
color: ${e=>e.showAutofill?ft.neutralGrey5Light:e.theme.colors.primary};
|
|
55
55
|
`,Ga=B.div`
|
|
56
56
|
width: 100%;
|
|
57
57
|
height: 100vh;
|
|
58
58
|
overflow: hidden;
|
|
59
59
|
background-color: ${e=>e.theme.colors.grey4};
|
|
60
|
-
|
|
60
|
+
`,$a=$((function(e){const a=rn(e);return{vendorDetailView:dn(e),globalMerchantView:a}}),(function(e,a){const{navigate:s}=a;return{updateVendorDetailLocalData:t=>{e(ut({vendorDetails:t}))},fetchRecommendation:t=>{e(cn("tenant",t))},onSaveClick:()=>{e(ln())},onBackClick:()=>{s("../review")}}}))(Wn);function Na(){const e=G();return o.jsx($a,{navigate:e})}const za=B.div`
|
|
61
61
|
display: flex;
|
|
62
62
|
min-height: 100%;
|
|
63
63
|
width: 100%;
|
|
@@ -65,11 +65,11 @@ import{j as o}from"./liveblocks-ByIxqWJk.js";import{a as u}from"./sentry-9XsSr7s
|
|
|
65
65
|
flex-direction: column;
|
|
66
66
|
align-items: center;
|
|
67
67
|
background-color: ${e=>e.theme.colors.grey4};
|
|
68
|
-
`,
|
|
68
|
+
`,Ya=$((function(e,a){const{vendorFirstReviewDetails:s}=a,t=e.globalMerchantAutoCompleteState.autoCompleteText,n=R.getSignedInUser(),i=e.tenantState.currentTenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},p=U(e);return{vendorFirstReviewView:s,globalMerchantAutoCompleteData:{globalMerchantAutoCompleteView:s.globalMerchantAutoCompleteView,autoCompleteText:t},analytics:j,authParams:l,attachmentEndpoint:p.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${ee}/vendor_attachments_accounting_provider`:`${ee}/vendor_attachments`}}),(function(e,a){const{navigate:s}=a;return{onFetchVendorReviewView:(t,n,i)=>{e(Ee(t,n,i))},onGlobalMerchantAutoCompleteInputChange:(t,n)=>{t.trim().length>=2?e(vn({searchString:t,globalMerchantType:n??"vendor"})):t.trim().length===0&&e(Ke())},onUpdateLocalData:(t,n,i,l)=>{if(n!=null){const p=Ja(n);e(gn({vendorId:t,currentSelection:p,selectedGlobalMerchantId:i,vendorRenamedText:l}))}},onResetVendorLocalData:t=>{e(Sn({vendorId:t}))},onVendorNameClick:(t,n)=>{if(a.tenantEmailDomain!=null){const i=Oe(t,n,a.tenantEmailDomain),l=q(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:l}})}},onUpdatePageToken:t=>{e(fn({pageToken:t}))},onUpdateSortUiState:(t,n)=>{e(mn({sortOrder:t,sortKey:n}))},onUpdateScrollYOffset:t=>{e(hn({scrollYOffset:t}))},onClickSave:(t,n,i)=>{e(pn(t,n,i))},onClickCancelPopup:()=>{e(un())},onClearGlobalMerchantAutoCompleteResults:()=>{e(Ke())},onClickRedirectToQBO:()=>{window.open(`${Le.qboRedirectionUrl}/vendors`,"_blank")},updateVendorDetailLocalData:t=>{e(ut({vendorDetails:t})),s(`./vendor/${t.id}`)},onBackClick:()=>{s("../..")},onReloadList:()=>{e(Ee(null))}}}))(Hn);function Qe(){const e=G(),a=N(),s=W(),{tenantEmailDomain:t}=Y(),n=ne(),i=R.getSignedInUser(),{vendorId:l}=Y(),p=f((d=>Je(d))),[h,v]=u.useState(!1),m=f((d=>Je(d).fetchState));if(u.useEffect((()=>{m==="Not-Started"&&h===!1&&(a(Ee(null)),v(!0))}),[]),i==null)throw Error("Can't access first review page without signing in...");const r=d=>d.trackPageLoaded(Be.Event.vendorTenantReviewListPage);return o.jsxs(o.Fragment,{children:[m==="Completed"?o.jsx(Se,{analytics:j,onLoad:r}):null,o.jsx(Se,{analytics:j,onLoad:r}),o.jsx(ha,{isOpen:l!=null,drawerLeftMargin:new Ue(0,0,300,600),onClose:()=>{e("../review")},children:o.jsx(Ka,{onClick:d=>d.stopPropagation(),children:o.jsx(Na,{})})}),o.jsx(za,{windowSize:n,children:o.jsx(Ya,{location:s,navigate:e,vendorFirstReviewDetails:p,tenantEmailDomain:t})})]})}const Ja=e=>e.recommendedFirst===!0?"recommendedFirst":e.recommendedSecond===!0?"recommendedSecond":e.retain===!0?"retain":e.rename===!0?"rename":e.customMerchant===!0?"customMerchant":null,Ka=B(St)`
|
|
69
69
|
display: flex;
|
|
70
70
|
min-height: 100%;
|
|
71
71
|
flex-direction: column;
|
|
72
|
-
`,
|
|
72
|
+
`,qa=$((function(e,a){const s=R.getSignedInUser(),t=e.tenantState.currentTenantId,n=e.vendorFiling1099UploadDetailsState,i={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""};let l={fetchState:"Not-Started",error:void 0};return a.vendorId!=null&&(l=e.vendorViewState.editVendorStateById[a.vendorId]?.fetchStatus),{analytics:j,vendorFiling1099UploadDetailsViewState:n,authParams:i,googleAPIKey:Le.googleMapsAPIKey,vendorId:a.vendorId,fetchVendorFetchStatus:l,vendor:a.vendorFiling1099UploadDetails?.vendor}}),(function(e,a){const{currentTenant:s,navigate:t,location:n,vendorId:i,vendorFiling1099UploadDetails:l}=a,{tenantEmailDomain:p}=s;return{onVendorFiling1099UploadDetailsSave:h=>{e(lt(h)),j.trackVendor1099DetailSave(l.vendor.legalName??"")},onSaveChangesToLocalStore:h=>{e(dt(h))},onResetVendorFiling1099FormStatus:()=>{e(Tn())},onAddressEditHandler:h=>{const v=aa((m=>({street:m.vendor1099FilingSectionId.street,suite:m.vendor1099FilingSectionId.suite,city:m.vendor1099FilingSectionId.city,state:m.vendor1099FilingSectionId.state,country:m.vendor1099FilingSectionId.country,countryCode:m.vendor1099FilingSectionId.countryCode,postalCode:m.vendor1099FilingSectionId.postalCode,secondaryInfo:m.vendor1099FilingSectionId.secondaryInfo}))(h));e(ct({addressType:"vendor_address",addressToCreate:v}))},goBackToListPage:()=>{e(rt(i));const h=`/${p}/vendors/filing_1099/`,v=q(n.state?.pathnameStackToGoBack,n.pathname);t(h,{state:{pathnameStackToGoBack:v}})},onAddressClick:h=>{const v=(function(r,d,c){let T=`/${r}/vendors/filing_1099/upload/${c}/edit`;return T=T.concat(`/new/${d}`),T})(p,h,i),m=q(n.state?.pathnameStackToGoBack,n.pathname);t(v,{state:{pathnameStackToGoBack:m}})},AddressFormPage:Xn}}))(Qn);function Wa(){const e=G(),a=W(),{vendorId:s}=Y(),t=f((p=>U(p)));let n;if(s==null)throw new Error("Vendor ID not found for Vendor Filing 1099 Details Screen");n=f((p=>it(p,s)));const{tenantEmailDomain:i}=t,l=t.companyId??R.getSignedInUserTenant(i)?.companyId;if(l==null)throw new Error("Company ID not found for Vendor Filing 1099 Details Screen");return o.jsx(qa,{location:a,navigate:e,currentTenant:t,vendorId:s,vendorFiling1099UploadDetails:n,companyId:l})}const Ha=B.div`
|
|
73
73
|
display: flex;
|
|
74
74
|
min-height: 100%;
|
|
75
75
|
width: 100%;
|
|
@@ -77,7 +77,7 @@ import{j as o}from"./liveblocks-ByIxqWJk.js";import{a as u}from"./sentry-9XsSr7s
|
|
|
77
77
|
flex-direction: column;
|
|
78
78
|
align-items: center;
|
|
79
79
|
background-color: ${e=>e.theme.colors.grey4};
|
|
80
|
-
`,
|
|
80
|
+
`,Qa=$((function(e,a){const{vendorsFiling1099ListDetails:s,accountMappingView:t,analytics:n}=a;return{analytics:n,vendorsFiling1099List:s.vendors,isVendor1099Populated:s.isVendor1099Populated,accountMappingView:t,fetchState:s.fetchState,uiState:s.uiState,lastRefreshSuccessTime:s.lastRefreshSuccessTime,vendorTabsToShow:a.vendorTabsToShow}}),(function(e,a){const{navigate:s,analytics:t}=a;return{onUpdateSortUiState:(n,i)=>{e(En({sortOrder:n,sortKey:i}))},onUpdateSearchUiState:n=>{e(Dn({searchString:n}))},onVendorRowClick:n=>{if(a.tenantEmailDomain!=null){const i=`/${a.tenantEmailDomain}/vendors/filing_1099/upload/${encodeURIComponent(n)}/edit`,l=q(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:l}})}},onReloadVendors:()=>{e(Fe(!0))},onBackClick:()=>{e(In()),e(Cn())},onVendorTabSelectionChanged:n=>{const i=de(n);s(i),e(te(le(n)))},onAccountMappingChange:n=>{const{filing1099:i}=n,{bankAccount:l,expenseCategory1099:p}=i,h=ma(a.accountMappingView.bankAccounts1099FilingAccountList,l.selectedOptions),v=fa(a.accountMappingView.expenseAccounts1099FilingAccountList,p),m={selectedBankAccounts1099FilingAccountIds:h.map((r=>r.accountId)),selectedExpenseAccounts1099FilingAccountIds:v};e(wn({data:m}))},onSaveClick:()=>{e(yn()),t.track(Be.Event.vendor1099TabSettingsSave)}}}))(Zn);function Xe({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const t=G(),n=N(),i=W(),{tenantEmailDomain:l}=Y(),p=ne(),h=R.getSignedInUser(),[v,m]=u.useState(!1),[r,d]=u.useState(!1);if(h==null)throw Error("Can't access vendor filing 1099 page without signing in...");ce();const c=f((C=>xn(C))),T=f((C=>bn(C))),{isAiCfoAccessEnabled:x,onAskAiCfoClick:g}=ie({mobileExploreReferrer:"Vendors — 1099"});se({isDataReady:c.fetchState==="Completed"}),u.useEffect((()=>{r||(d(!0),n(Fe(!1)))}),[r,d]),u.useEffect((()=>{T.saveState.fetchState==="Completed"&&n(Fe(!1))}),[T.saveState.fetchState]);const y=C=>{m(C)},b=f((C=>U(C))),I={userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:b.tenantId},E=u.useMemo((()=>({authParams:I,tenantName:b.companyName,filing1099ReportEndPoint:`${ee}/filing1099Reports`})),[]);return o.jsxs(o.Fragment,{children:[c.fetchState==="Completed"?o.jsx(o.Fragment,{children:o.jsx(Se,{analytics:j,onLoad:()=>j.trackPageLoaded(Be.Event.vendor1099ListPage)})}):null,o.jsxs(Ha,{windowSize:p,children:[o.jsx(re,{isAppContentDrawerOpen:v,handleDrawerToggle:y}),o.jsx(Qa,{location:i,navigate:t,previousTabPosition:a,setPreviousTabPosition:s,analytics:j,vendorsFiling1099ListDetails:c,vendorTypeList:c.vendorTypeList,accountMappingView:T,downloadParams:E,tenantEmailDomain:l,vendorTabsToShow:e,isAiCfoAccessEnabled:x,onAskAiCfoClick:g,onClickMenuIcon:()=>{y(!0)}})]})]})}const Xa=B.div`
|
|
81
81
|
display: flex;
|
|
82
82
|
min-height: 100%;
|
|
83
83
|
width: 100%;
|
|
@@ -85,4 +85,4 @@ import{j as o}from"./liveblocks-ByIxqWJk.js";import{a as u}from"./sentry-9XsSr7s
|
|
|
85
85
|
flex-direction: column;
|
|
86
86
|
align-items: center;
|
|
87
87
|
background-color: ${e=>e.theme.colors.grey4};
|
|
88
|
-
`,Za
|
|
88
|
+
`,Za=$((function(e,a){const{vendorsListDetails:s}=a;return{vendorsList:s.vendors,totalVendorCount:s.totalVendorCount,fetchState:s.fetchState,uiState:s.uiState,searchText:s.searchString,lastRefreshSuccessTime:s.lastRefreshSuccessTime,vendorTabsToShow:a.vendorTabsToShow,isAccountingClassesEnabled:me(e),analytics:j}}),(function(e,a){const{navigate:s}=a;return{onFetchVendorsList:(t="",n,i)=>{e(Vn({searchString:t,keepExistingListItems:n,view:"vendorsTab",pageToken:i}))},onUpdatePageToken:t=>{e(_n({pageToken:t}))},onUpdateSortUiState:(t,n)=>{e(jn({sortOrder:t,sortkey:n}))},onUpdateCurrentYTDSelection:t=>{e(Pn({ytdSpendSelection:t}))},onVendorRowClick:(t,n)=>{if(a.tenantEmailDomain!=null){const i=Oe(t,n,a.tenantEmailDomain),l=q(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:l,referrer:"Vendor List"}})}},onReloadVendors:()=>{console.log("Reload vendors")},onUpdateScrollYOffset:t=>{e(kn({scrollYOffset:t}))},onBackClick:()=>{s("../..")},onVendorTabSelectionChanged:t=>{const n=de(t);s(n),e(te(le(t)))}}}))(ea);function eo({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const t=G(),n=N(),i=W(),{tenantEmailDomain:l}=Y(),p=ne(),h=R.getSignedInUser(),{useFeatureGate:v}=H(),{isFeatureEnabled:m,isFeatureGateLoading:r}=v(M.isOpexByVendorFeatureEnabled);ce();const d=e.includes("prepaid_expenses"),c=e.includes("fixed_assets"),T=e.includes("accrued_expenses"),x=f((k=>oe(k)));let g={};g=f((k=>Fn(k,"vendorsTab")));const[y,b]=u.useState(!1),{isAiCfoAccessEnabled:I,onAskAiCfoClick:E}=ie({mobileExploreReferrer:"Vendors Summary"});se({isDataReady:g.fetchState==="Completed"});const C=f((k=>ue(k))),w=f((k=>J(k).isReportGenerated));f((k=>J(k).fetchState))==="Completed"&&w&&m&&!e.includes("operating_expenses_by_vendor")&&e.splice(1,0,"operating_expenses_by_vendor");const[A,_]=u.useState(!1);if(u.useEffect((()=>{(d||c)&&A===!1&&C!=="Completed"&&(n(pe()),_(!0))}),[A]),u.useEffect((()=>{n(he({shouldFetchAccruedExpenses:T,shouldFetchFixedAssets:c,shouldFetchPrepaidExpenses:d,shouldFetchOpexByVendor:m&&r===!1,shouldFetchVendorsList:!0,shouldFetchFiling1099Vendor:!1}))}),[C,c,r,m]),u.useEffect((()=>{y||g.fetchState!=="Completed"||(b(!0),j.trackVendorList(x.currentTab,x.previousTab??null,g.totalVendorCount,g.uiState.sortKey,g.uiState.ytdSpendSelection))}),[g.fetchState]),h==null)throw Error("Can't access address page without signing in...");const[O,F]=u.useState(!1),D=k=>{F(k)};return o.jsxs(Xa,{windowSize:p,children:[o.jsx(re,{isAppContentDrawerOpen:O,handleDrawerToggle:D}),o.jsx(Za,{location:i,navigate:t,vendorsListDetails:g,tenantEmailDomain:l,vendorTabsToShow:e,onClickMenuIcon:()=>{D(!0)},previousTabPosition:a,setPreviousTabPosition:s,isAiCfoAccessEnabled:I,onAskAiCfoClick:E})]})}function Vo(){const{useFeatureGate:e}=H(),a=W().state?.referrer,[s,t]=u.useState(!1),[n,i]=u.useState(0),l=R.getSignedInUser(),p=An(l),{isFeatureEnabled:h}=e(M.isOpexByVendorFeatureEnabled),{isFeatureEnabled:v}=e(M.isVendorReviewFeatureEnabled),{isFeatureEnabled:m}=e(M.isScheduledJEPrepaidExpensesFeatureEnabled),{isFeatureEnabled:r}=e(M.isScheduledJEFixedAssetsFeatureEnabled),{isFeatureEnabled:d}=e(M.isScheduledJEAccruedExpensesFeatureEnabled),{isFeatureEnabled:c}=e(M.isFiling1099FeatureEnabled),T=f((E=>U(E))),x=T?.externalConnections?.accounting[0]?.connectionName,g=["vendors_tab"];x!=="netsuite"&&m===!0&&g.push("prepaid_expenses"),x!=="netsuite"&&r===!0&&g.push("fixed_assets"),x!=="netsuite"&&d===!0&&g.push("accrued_expenses"),x!=="netsuite"&&c&&p&&(g.push("filing_1099"),h&&g.splice(1,0,"operating_expenses_by_vendor"));const{isFeatureEnabled:y}=e(M.isDebitCardFeatureEnabled),b=Rn(y,T),I=Un(T);return b===!0||I===!0?o.jsx(Me,{children:o.jsx(P,{path:"/*",element:o.jsx(sa,{})})}):o.jsxs(Me,{children:[o.jsx(P,{path:"/opex",element:h===!0?o.jsx(Da,{previousTabPosition:n,setPreviousTabPosition:i,vendorTabsToShow:g}):o.jsx(L,{to:"../summary"})}),o.jsx(P,{path:"/summary",element:o.jsx(eo,{previousTabPosition:n,setPreviousTabPosition:i,vendorTabsToShow:g})}),o.jsx(P,{path:"schedules/fixed_assets/details/:scheduleDetailId",element:r===!0?o.jsx(ia,{}):o.jsx(L,{to:"../../vendors/opex"})}),o.jsx(P,{path:"schedules/accrued_expenses/details/:scheduleDetailId",element:r===!0?o.jsx(ra,{shouldNavigateBack:s,setShouldNavigateBack:t}):o.jsx(L,{to:"../../vendors/opex"})}),o.jsx(P,{path:"schedules/one_time_accrual/details/:accrualId",element:d===!0?o.jsx(da,{}):o.jsx(L,{to:"../../vendors/opex"})}),o.jsx(P,{path:"schedules/:scheduleType/details/:scheduleDetailId",element:m===!0?o.jsx(la,{}):o.jsx(L,{to:"../../vendors/opex"})}),o.jsx(P,{path:"schedules/:scheduleType/details/:scheduleDetailId/edit_link",element:m===!0||r===!0?o.jsx(va,{}):o.jsx(L,{to:"../../vendors/opex"})}),o.jsx(P,{path:"schedules/accrued_expenses/details/:scheduleDetailId/edit_link",element:d===!0?o.jsx(ca,{setShouldNavigateBack:t}):o.jsx(L,{to:"../../vendors/opex"})}),o.jsx(P,{path:"schedules/prepaid_expenses",element:m===!0?o.jsx(Fa,{previousTabPosition:n,setPreviousTabPosition:i,vendorTabsToShow:g}):o.jsx(L,{to:"../opex"})}),o.jsx(P,{path:"schedules/fixed_assets",element:r===!0?o.jsx(wa,{previousTabPosition:n,setPreviousTabPosition:i,vendorTabsToShow:g}):o.jsx(L,{to:"../opex"})}),o.jsx(P,{path:"schedules/accrued_expenses",element:d===!0?o.jsx(ba,{previousTabPosition:n,setPreviousTabPosition:i,vendorTabsToShow:g}):o.jsx(L,{to:"../opex"})}),o.jsx(P,{path:"/filing_1099",element:c&&p?o.jsx(Xe,{previousTabPosition:n,setPreviousTabPosition:i,vendorTabsToShow:g}):o.jsx(L,{to:"../opex"})}),o.jsx(P,{path:"/filing_1099/:vendorId",element:c&&p?o.jsx(Xe,{vendorTabsToShow:g,previousTabPosition:n,setPreviousTabPosition:i}):o.jsx(L,{to:"../opex"})}),o.jsx(P,{path:"/filing_1099/upload/:vendorId/edit",element:c&&p?o.jsx(He,{appContent:o.jsx(Wa,{}),showFullScreenSkeletonWhileLoading:!0}):o.jsx(L,{to:"../opex"})}),o.jsx(P,{path:"/filing_1099/upload/:vendorId/edit/new/:addressType",element:c&&p?o.jsx(He,{appContent:o.jsx(oa,{isSubPage:!0,hideAddressBackButton:!0,hideAddressSubTitle:!0})}):o.jsx(L,{to:"../opex"})}),o.jsx(P,{path:"/summary/:vendorId/:qboId",element:o.jsx(We,{referrerType:a,isFiling1099FeatureEnabled:c&&p})}),o.jsx(P,{path:"/summary/:vendorId/:qboId/:timeframe/:startDate/:endDate",element:o.jsx(We,{referrerType:a,isFiling1099FeatureEnabled:c&&p})}),o.jsx(P,{path:"/review",element:v===!0?o.jsx(Qe,{}):o.jsx(fe,{})}),o.jsx(P,{path:"/review/vendor/:vendorId",element:v?o.jsx(Qe,{}):o.jsx(fe,{})}),o.jsx(P,{path:"/",element:o.jsx(L,{to:"summary"})}),o.jsx(P,{path:"*",element:o.jsx(fe,{})})]})}export{Vo as default};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import{j as o}from"./liveblocks-BLpmr1Pv.js";import{a as f}from"./sentry-DWNq3t8E.js";import{t as u,u as h,j as y,N as b}from"./core-CbdTrw7T.js";import{VB as I,gm as w,Ks as j}from"./zeni-epic-state-C5DO1jkr.js";import{z as l,a8 as x,ag as S,ah as D}from"./index-CnIO6_IQ.js";import{n as g}from"./mui-DNGY4bFU.js";import"./recharts-CTh_JhT_.js";import"./analytics-Vgn85Ur_.js";import"./plaid-DhfTjhua.js";import"./dnd-DuiAlI7w.js";import"./stripe-cKAAJElX.js";import"./lottie-Lb1ftKY1.js";import"./lexical-B-vxEaRQ.js";import"./pdf-B1uD4Ovv.js";import"./utils-CrhrpmD8.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="58cc4def-01ea-4739-9f42-01bffd40488b",e._sentryDebugIdIdentifier="sentry-dbid-58cc4def-01ea-4739-9f42-01bffd40488b")}catch{}})();const q=()=>{const[e]=u(),t=e.get("code")??"",s=e.get("state")??"",c=e.get("profileId")??"",[n,p]=f.useState(!1),a=h(),i=y((m=>I(m))),r=l.getSignedInUser(),d=l.getSignedInUserTenantWithId(s);if(r==null||d==null)return o.jsx(b,{to:"/signin/auth",replace:!0});if(r==null)throw Error("Can't access this page without signing in...");return w(r.userId,r.zeniSessionId,d?.tenantId),f.useEffect((()=>{n||(p(!0),a(j(t,c,s)))}),[n,a]),i.fetchState==="Error"?o.jsx(E,{children:o.jsx(_,{children:i.error?.message??""})}):(i.fetchState==="Completed"&&window.close(),o.jsx(x,{fetchState:"In-Progress"}))},E=g.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
width: 100%;
|
|
4
|
+
height: 100vh;
|
|
5
|
+
flex-direction: row;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${e=>e.theme.colors.grey5};
|
|
9
|
+
`,_=g(D.LargeRegular)`
|
|
10
|
+
display: flex;
|
|
11
|
+
color: ${S.important};
|
|
12
|
+
`;export{q as default};
|