@zeniai/web-app-ui 5.3.34-qa → 5.3.35-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-B3gERMwb.js → AccountMappingScreen-Cstuqkm7.js} +1 -1
- package/dist/assets/AddressRoutes-BzPUFFtF.js +1 -0
- package/dist/assets/AddressScreen-QJAFiZG_.js +9 -0
- package/dist/assets/{AiCfoScreen-DMq_5n3A.js → AiCfoScreen-DPeqmWFb.js} +1 -1
- package/dist/assets/{AppDrawer-CmIwyYxA.js → AppDrawer-BlydUldz.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-iNqdFuHr.js → BillPayApprovalRoutes-CkTXMOBL.js} +1 -1
- package/dist/assets/{BillPayRoutes-CxVV20eB.js → BillPayRoutes-DUJINxXM.js} +1 -1
- package/dist/assets/{BusinessVerificationPageScreen-CcdlEk-F.js → BusinessVerificationPageScreen-CcoSDt9H.js} +2 -2
- package/dist/assets/{CardsAiCfoScreen-CY8kuFBn.js → CardsAiCfoScreen-u0VpRiFW.js} +2 -2
- package/dist/assets/{ChargeCardRoutes-2l1CO_ZB.js → ChargeCardRoutes-BETe7cXe.js} +1 -1
- package/dist/assets/{CompanyPassportScreen-D0iwvjvi.js → CompanyPassportScreen-C6qEEMwh.js} +1 -1
- package/dist/assets/ConnectionAuthScreen-DA45ryKf.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-CXysDBns.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-DNGip8nR.js → CustomerOnboardingRoutes-D3ibVMNE.js} +3 -3
- package/dist/assets/{DashboardRoutes-WausKTZN.js → DashboardRoutes-DqBJNROk.js} +3 -3
- package/dist/assets/{DefaultTenantHome-DYJZWIVJ.js → DefaultTenantHome-3q80hQe7.js} +1 -1
- package/dist/assets/DomesticWireDetailScreen-nU_rLvRW.js +18 -0
- package/dist/assets/{DrawerScreen-BGFLKjZ4.js → DrawerScreen-J3wIMzJi.js} +1 -1
- package/dist/assets/{EntityDetailRoutes-dIhIGS0K.js → EntityDetailRoutes-Bs0Wld5V.js} +1 -1
- package/dist/assets/{ExpenseAutomationRoutes-2mQsPUHf.js → ExpenseAutomationRoutes-BAPJl7fK.js} +1 -1
- package/dist/assets/FeaturePreviewScreen-BhXxEutM.js +1 -0
- package/dist/assets/{HubSpotOAuthCallbackScreen-BAmofeTw.js → HubSpotOAuthCallbackScreen-DZPl-16d.js} +1 -1
- package/dist/assets/{InboxNotificationsProvider-C5ikUDhJ.js → InboxNotificationsProvider-B8bw_q0G.js} +1 -1
- package/dist/assets/{InvoicingRoutes-CCMsRJbo.js → InvoicingRoutes-5JvdRY8J.js} +1 -1
- package/dist/assets/{MagicLinkRoutes-CtU6Muc9.js → MagicLinkRoutes-CsQvAWAd.js} +5 -5
- package/dist/assets/MagicLinkSignInScreen-C6mdv4Cd.js +12 -0
- package/dist/assets/{MobileAppDrawer-CRL9dcOy.js → MobileAppDrawer-BAR65ADr.js} +1 -1
- package/dist/assets/NotFoundScreen-BkQQJnCX.js +1 -0
- package/dist/assets/{NotificationRoutes-YdUDNMEO.js → NotificationRoutes-DWTYgcPC.js} +1 -1
- package/dist/assets/{OAuthConsentScreen-dseY-frv.js → OAuthConsentScreen-rE7QFgmv.js} +1 -1
- package/dist/assets/{PandLWithForecastRoutes-fo_acE-Y.js → PandLWithForecastRoutes-BJdBoqtG.js} +1 -1
- package/dist/assets/{PaymentLinkScreen-Dmzw63Ry.js → PaymentLinkScreen-C-EPLfkH.js} +8 -8
- package/dist/assets/{PeopleRoutes-DYjiVo9L.js → PeopleRoutes-B9KZfXlk.js} +3 -3
- package/dist/assets/{PerformanceRoutes-Blu7VWI0.js → PerformanceRoutes-nuCcT1KG.js} +1 -1
- package/dist/assets/{Preview-DGkUqHej.js → Preview-Cx8KRaHy.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-B3L0biVT.js → QBOConnectionScreen-C-_Bc9aD.js} +23 -23
- package/dist/assets/{ReimbursementApprovalRoutes-BPS61Q6U.js → ReimbursementApprovalRoutes-DUDrQYUH.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-B4_P7371.js → ReimbursementApprovalRuleDetailScreen-TislSzXU.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-JKmd-RDh.js → ReimbursementRoutes-CThyOTqb.js} +1 -1
- package/dist/assets/{ReportsRoutes-CXTwauUR.js → ReportsRoutes-BUPOvhS1.js} +1 -1
- package/dist/assets/RewardsRoutes-DWovQii4.js +1 -0
- package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-DiGMBAm5.js → ScheduleDetailsPrepaidExpensesScreen-VjNep7ac.js} +1 -1
- package/dist/assets/ScreenRoutes-BBziyvzo.js +2 -0
- package/dist/assets/{SettingsRoutes-BuKUGcQL.js → SettingsRoutes-D0ZHopo2.js} +6 -6
- package/dist/assets/{SetupPagesScreen-C5BRh3XH.js → SetupPagesScreen-D464KhP2.js} +1 -1
- package/dist/assets/SignInScreen-I08IFPEY.js +1 -0
- package/dist/assets/SignOutScreen-qomjx9ip.js +9 -0
- package/dist/assets/{TaskListScreen-DY7UxmTl.js → TaskListScreen-DLU0EqVo.js} +1 -1
- package/dist/assets/{TaskRoutes-D9jm3Vx3.js → TaskRoutes-CzMzk7IA.js} +1 -1
- package/dist/assets/TransactionDetailRoutes-eMTqZPTp.js +1 -0
- package/dist/assets/TransactionDetailScreen-D_QMd7J1.js +5 -0
- package/dist/assets/{TransactionListRoutes-DlF9D1gA.js → TransactionListRoutes-BkyScEnr.js} +1 -1
- package/dist/assets/{TreasuryRoutes-B-vADZSw.js → TreasuryRoutes-DvNRUs_f.js} +1 -1
- package/dist/assets/{VendorsRoutes-BB7CHJb3.js → VendorsRoutes-D7mCPP8E.js} +7 -7
- package/dist/assets/{WiseConfirmationScreen-Un25bELv.js → WiseConfirmationScreen-D3NoMVAj.js} +1 -1
- package/dist/assets/{ZeniAccountRoutes-C4VQUVN_.js → ZeniAccountRoutes-Bf98cPGA.js} +9 -9
- package/dist/assets/{ZeniAccountStatementScreen-CX0ZvWif.js → ZeniAccountStatementScreen-CbAb9son.js} +1 -1
- package/dist/assets/{accountMappingHelper-CJL-kxIR.js → accountMappingHelper-DiD6kuzS.js} +1 -1
- package/dist/assets/analytics-qutbJJuo.js +68 -0
- package/dist/assets/{analyticsHelper-C7PuiJR9.js → analyticsHelper-Cioa7dQ6.js} +1 -1
- package/dist/assets/{core-CqflqGv9.js → core-cL-h_S3o.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-Bw5_joHN.js → decodeURIComponentSafe-DiZsTtnQ.js} +1 -1
- package/dist/assets/{dnd-OUjwZlfC.js → dnd-CvWVwn67.js} +1 -1
- package/dist/assets/{empty-BaQDcuze.js → empty-DSAj_JMj.js} +1 -1
- package/dist/assets/{empty-D2Qv8UjS.js → empty-Djzj0dHk.js} +1 -1
- package/dist/assets/{emptyVideoElement-CRjToyxO.js → emptyVideoElement-CeA_CN58.js} +1 -1
- package/dist/assets/{epic-6r2G7Ljw.js → epic-B0n7joLL.js} +1 -1
- package/dist/assets/{expenseAutomationHelper-BTi1SBkX.js → expenseAutomationHelper-DBhDJoc-.js} +1 -1
- package/dist/assets/{getLocaleForTenant-frknbVW9.js → getLocaleForTenant-DALQ36LB.js} +1 -1
- package/dist/assets/{index-BWWz0Sm7.js → index-B-uE4TWW.js} +1 -1
- package/dist/assets/{index-DjGdOTXi.js → index-BMzYYdV-.js} +1 -1
- package/dist/assets/{index-C-1mKpRP.js → index-Bme2F7Z-.js} +1 -1
- package/dist/assets/{index-CNoRQUH7.js → index-Bn5lBj-O.js} +1 -1
- package/dist/assets/{index-6X2hJC9C.js → index-D4ChxRFU.js} +6983 -6983
- package/dist/assets/{index-DFz0hCrW.js → index-DqoiIKM_.js} +1 -1
- package/dist/assets/{index-i9f1kxGC.js → index-RGg62zU1.js} +1 -1
- package/dist/assets/{index-B8Cs9uSY.js → index-YXuAyHdu.js} +2 -2
- package/dist/assets/{lexical-BHqkUsiS.js → lexical-fOKQwNUZ.js} +1 -1
- package/dist/assets/{liveblocks-B0EpRifM.js → liveblocks-DVe3Eena.js} +1 -1
- package/dist/assets/{lottie-x3DIllPk.js → lottie-MSaCuPby.js} +1 -1
- package/dist/assets/{mui-Splhybhe.js → mui-a6BeA4JD.js} +1 -1
- package/dist/assets/{pathToGoBack-LnL-ovI6.js → pathToGoBack-g9S0YvmK.js} +1 -1
- package/dist/assets/{pdf-BZfLFbU_.js → pdf-CurGQkyb.js} +3 -3
- package/dist/assets/{pdf-lib-CpxtL5pi.js → pdf-lib-D4BCwttf.js} +1 -1
- package/dist/assets/{plaid-D5Rs2Xbn.js → plaid-C5X1WR-a.js} +1 -1
- package/dist/assets/{pusher-9E3ynLMf.js → pusher-BAEnXzer.js} +1 -1
- package/dist/assets/{react-_LAOK0QT.js → react-BM46mFnY.js} +1 -1
- package/dist/assets/{react-Cdqh8MuG.js → react-BYcgSbTE.js} +1 -1
- package/dist/assets/{react-BHgTygpo.js → react-CtJLNNcb.js} +1 -1
- package/dist/assets/{react-BWMsOlMm.js → react-D5GF-zB3.js} +1 -1
- package/dist/assets/{react-bYlWEvlR.js → react-DFRbAeBc.js} +1 -1
- package/dist/assets/{react-DPAdkb-c.js → react-dqICH6I-.js} +1 -1
- package/dist/assets/{recharts-C-DOhwH-.js → recharts-BPDamcen.js} +1 -1
- package/dist/assets/{routePaths-vIHY-V28.js → routePaths-Dn5fef1Z.js} +1 -1
- package/dist/assets/{sentry-BefEASz6.js → sentry-DqMiDAOv.js} +1 -1
- package/dist/assets/{url-DGJ2AapT.js → url-Bog1JfMa.js} +1 -1
- package/dist/assets/{url-DWw1bUBN.js → url-DLaGwo5M.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-DCkiFTBp.js → useAiCfoDashboardSuggestedQuestionsChips-CkMy0l60.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-0oF2VYBt.js +1 -0
- package/dist/assets/{useChargeCardPusherEvents-CextOSJa.js → useChargeCardPusherEvents-B27Oy8LI.js} +1 -1
- package/dist/assets/{useDeviceId-C-MNChOb.js → useDeviceId-u80nXpjK.js} +1 -1
- package/dist/assets/{useEmailConnectResultRefresh-BNpn3T_H.js → useEmailConnectResultRefresh-CLBpIk_t.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-Ocoxr05G.js → useInitialThreadRequest-T-M769mk.js} +1 -1
- package/dist/assets/{useTaskManagerAccess-BTngy8S4.js → useTaskManagerAccess-BtoWhuis.js} +1 -1
- package/dist/assets/{utils-JmZUGXv-.js → utils-jUBXEI4l.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-C1SRvhe2.js → withTransactionSidePanel-CghfULxy.js} +1 -1
- package/dist/assets/{zeni-epic-state-Sf5HhdfR.js → zeni-epic-state-DMwHYs-L.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +3 -3
- package/dist/assets/AddressRoutes-ofjUZj67.js +0 -1
- package/dist/assets/AddressScreen-2Ll0sIt2.js +0 -9
- package/dist/assets/ConnectionAuthScreen-DISa934v.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-endMBMm7.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-ClypaxS0.js +0 -18
- package/dist/assets/FeaturePreviewScreen-Bw_lynVj.js +0 -1
- package/dist/assets/MagicLinkSignInScreen-Dmx8QuEo.js +0 -12
- package/dist/assets/NotFoundScreen-yHXIfv3c.js +0 -1
- package/dist/assets/RewardsRoutes-CrvPTVJy.js +0 -1
- package/dist/assets/ScreenRoutes-B9tAK3Rz.js +0 -2
- package/dist/assets/SignInScreen-Boe9M9a6.js +0 -1
- package/dist/assets/SignOutScreen-u27_Ol9O.js +0 -9
- package/dist/assets/TransactionDetailRoutes-D704rpNa.js +0 -1
- package/dist/assets/TransactionDetailScreen-3kh7GhKV.js +0 -5
- package/dist/assets/analytics-Bg9sHj4I.js +0 -68
- package/dist/assets/useAskAiCfoHostNavButtonProps-_aV90QuU.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as r}from"./liveblocks-
|
|
1
|
+
import{j as r}from"./liveblocks-DVe3Eena.js";import ue from"./NotFoundScreen-BkQQJnCX.js";import{a as k}from"./sentry-DqMiDAOv.js";import{h as H,u as ee,j as E,g as de,i as ke,N as pe,l as me,n as Se,o as b}from"./core-cL-h_S3o.js";import{Ph as ae,Pk as fe,Pe as Te,Z6 as ge,fE as te,a1a as se,PG as g,Py as T,Pb as he,Qa as be,Q3 as Ee,a1b as ne,gg as oe,a1c as q,P7 as Ie,P4 as De,ul as Ce,u9 as Ge,my as Pe,Pw as ye,a1d as _e,Qn as Re,Ps as Ue,PR as we,PO as xe,Pn as Be,PL as je,PK as ve}from"./zeni-epic-state-DMwHYs-L.js";import{z as y,e2 as Ae,q as Le,O as Fe,y as G,a4 as ie,p as P,a8 as Ke,j as M,T as $e,e3 as Ne,X as Q,ae as Oe}from"./index-D4ChxRFU.js";import{n as ze}from"./mui-a6BeA4JD.js";import{u as Ve}from"./useInitialThreadRequest-T-M769mk.js";import{M as Ze}from"./MobileAppDrawer-BAR65ADr.js";import{b as qe,a as Me,u as Qe,T as f,t as Xe,c as X,d as J,e as Je}from"./TaskListScreen-DLU0EqVo.js";import"./recharts-BPDamcen.js";import"./analytics-qutbJJuo.js";import"./plaid-C5X1WR-a.js";import"./dnd-CvWVwn67.js";import"./stripe-cKAAJElX.js";import"./lottie-MSaCuPby.js";import"./lexical-fOKQwNUZ.js";import"./pdf-CurGQkyb.js";import"./utils-jUBXEI4l.js";import"./InboxNotificationsProvider-B8bw_q0G.js";import"./useTaskManagerAccess-BtoWhuis.js";import"./useAskAiCfoHostNavButtonProps-0oF2VYBt.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]="a99f365d-89e5-4f69-8e5a-b3fc286875f2",e._sentryDebugIdIdentifier="sentry-dbid-a99f365d-89e5-4f69-8e5a-b3fc286875f2")}catch{}})();function We(){const e=H(),a=ee(),n=y.getSignedInUser(),{cannedResponses:c,fetchState:s,saveFetchState:u}=E((o=>o.cannedResponsesState)),d=k.useCallback((()=>{a(ae())}),[a]),m=k.useCallback(((o,I,D)=>{a(fe({name:o,content:I,cannedResponseId:D}))}),[a]),t=k.useCallback((o=>{a(Te({cannedResponseId:o}))}),[a]);if(n==null)throw Error("Can't access quick responses page without signing in...");return r.jsx(Ae,{cannedResponses:c,isLoading:s==="In-Progress"||s==="Not-Started",isSaving:u==="In-Progress",onBackClick:()=>e(-1),onDelete:t,onFetch:d,onSave:m})}const F=e=>e?.taskState?.taskByID,A=(e,a)=>{const n=F(e);if(a!=null&&n!=null)return n[a]?.parentTaskId??void 0},Ye=ge([A,(e,a)=>{const n=A(e,a),c=F(e);if(n!=null&&c!=null)return c[n]?.name},(e,a)=>{const n=A(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??""}}));let W,Y=[];const He=me((function(e,a){const{location:n,taskGroupId:c}=a,s=ne(e,a.taskId),u=te(e),d=Ye(e,a.taskId),m=s.taskGroupId??c,t=m!=null?q(e.taskGroupState,m):void 0,o=y.getSignedInUser(),I=u.tenantId,D={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:I??""},w=se(e),{tenantEmailDomain:x}=u,_=s.recurringSourceTaskId,B=_!=null?`${Q.appUrl}/${x}/tasks/${encodeURIComponent(_)}`:void 0;var h;return{taskDetailSelectorView:s,authParams:D,isZeniUser:y.isZeniUser(),userGroupList:((h=e.userGroupsState.userGroupByUserGroupId)!==W&&(W=h,Y=Object.values(h)),Y),isNewClicked:n.state?.message==="comingFromTaskListPage",filesEndPoint:Oe.fileMicroServiceBaseUrl,companyName:a.currentTenant.companyName,companyId:a.currentTenant.companyId,currentUrl:`${Q.appUrl}${a.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:B,tagListView:w,taskGroupName:m!=null&&t!=null&&t.isDefault===!1?t.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map((S=>q(e.taskGroupState,S))).filter((S=>S!=null&&!S.isDeleted)).map((S=>({id:S.id,name:S.name,isDefault:S.isDefault}))),subtasks:s.subtasks,parentTaskRef:d,subTaskCreateStatus:e.taskDetailState?.subTaskCreateStatus?.fetchState}}),(function(e,a){const{taskId:n,navigate:c,currentTenant:s,location:u,taskGroupId:d}=a,{tenantEmailDomain:m}=s;return{onSaveChangesToLocalStore:t=>{e(ve({taskDetailLocalData:t,taskId:n}))},onSaveDetailClick:t=>{e(je(n,t??d))},onArchiveTaskClick:()=>{a.taskId!=null&&e(Be(a.taskId))},onSnoozeTask:(t,o)=>{e(xe(t,o))},onUnsnoozeTask:t=>{e(we(t))},onCreateSubtask:(t,o)=>{e(Ue({...o,parentTaskId:t}))},onSubtaskUpdate:(t,o)=>{e(Re({task:t,updates:o}))},onShowToast:t=>{e(oe(t))},onSubtaskRowClick:t=>{c(`/${m}/tasks/${t}`,{state:{pathnameStackToGoBack:P(u.state?.pathnameStackToGoBack,u.pathname)}})},onParentBreadcrumbClick:t=>{c(`/${m}/tasks/${t}`,{state:{pathnameStackToGoBack:P(u.state?.pathnameStackToGoBack,u.pathname)}})},onDismissClick:()=>{if(u.state?.message==="triggerBackClick"){const t=ie(u.state?.pathnameStackToGoBack),o=t.poppedPathname??"../../dashboard";c(o,{state:{pathnameStackToGoBack:t.newStack}})}else{const t=U(m),o=P(u.state?.pathnameStackToGoBack,u.pathname);c(t,{state:{pathnameStackToGoBack:o}})}e(_e({taskId:n}))},onDeleteTaskClick:()=>{e(ye(n))},updateFilesEntity:t=>{e(Pe({files:t}))},onDeleteFile:t=>{e(Ge(t))},onEditFileName:(t,o)=>{e(Ce(t,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(g(!1,n))},onCreateTagClick:t=>{e(De(t,n))},onDeleteTagClick:t=>{e(Ie(t,n))},onFetchCannedResponses:()=>{e(ae())},onManageTemplatesClick:()=>{c(`/${s.tenantEmailDomain}/tasks/quick-responses`)}}}))(Ne);function L(){const e=H(),a=ee(),n=de(),c=Le(),{taskId:s,taskGroupId:u}=ke(),d=E((i=>te(i))),m=Ve(d?.companyId),{useFeatureGate:t}=Fe(),{isFeatureEnabled:o}=t(G.isTaskSnoozeEnabled),{isFeatureEnabled:I}=t(G.isTaskVisibilityEnabled),{isFeatureEnabled:D}=t(G.isTaskCannedResponsesEnabled),{isFeatureEnabled:w}=t(G.isTaskRecurringParentEnabled),{isFeatureEnabled:x}=t(G.isTaskGroupAssigneesEnabled),[_,B]=k.useState(!1),[h,S]=k.useState(!1),[K,re]=k.useState(!1),[$,j]=k.useState(!1),C=k.useRef(!1),R=E((i=>i.taskListState.updateTasksFetchState.fetchState)),N=E((i=>se(i))),O=E((i=>i.taskGroupViewState.fetchState));k.useEffect((()=>{a(g(!1,s)),s!=null&&a(T(s))}),[a,s]);const z=y.getSignedInUser()?.userId,ce=k.useMemo((()=>{const i=[f.TASK_CREATED,f.TASK_UPDATED,f.TASKS_BULK_UPDATED,f.TASKS_BULK_DELETED],l=[...i,f.TASK_SNOOZE_RESURFACED];return[...qe(d?.companyId,i),...Me(z,l)]}),[d?.companyId,z]);Qe({events:ce,onSubscribed:()=>{s!=null&&(a(g(!0,s)),a(T(s)))},onEvent:(i,l)=>{if(s!=null)switch(i){case f.TASK_CREATED:{J(l)?.parent_task_id===s&&(a(g(!0,s)),a(T(s)));break}case f.TASK_UPDATED:{const p=J(l);if(p==null)break;p.task_id===s?(a(g(!0,s)),a(T(s))):p.parent_task_id===s&&a(T(s));break}case f.TASKS_BULK_UPDATED:{const p=X(l);if(p==null)break;p.task_ids.includes(s)&&a(g(!0,s)),a(T(s));break}case f.TASKS_BULK_DELETED:{const p=X(l);if(p==null)break;if(p.task_ids.includes(s)){a(oe({messageSection:"delete_task",messageText:"success",type:"success"})),d?.tenantEmailDomain!=null&&e(U(d.tenantEmailDomain));break}a(T(s));break}case f.TASK_SNOOZE_RESURFACED:{Xe(l)?.task_id===s&&a(g(!0,s));break}}}}),k.useEffect((()=>{h||N.fetchState==="Completed"||(S(!0),a(he()))}),[h,a,N.fetchState]),k.useEffect((()=>{K||O==="Completed"||(re(!0),a(be()))}),[K,a,O]);const le=k.useCallback((()=>{s!=null&&(C.current=!1,a(Ee([s],null,{isArchived:!1})),j(!0))}),[a,s]);k.useEffect((()=>{if($)if(R!=="In-Progress"){if(C.current){if(R==="Error")return j(!1),void(C.current=!1);if(R==="Completed"){j(!1),C.current=!1;const{tenantEmailDomain:i}=d;if(n.state?.message==="triggerBackClick"){const l=ie(n.state?.pathnameStackToGoBack);e(l.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:l.newStack}})}else{const l=U(i);e(l,{state:{pathnameStackToGoBack:P(n.state?.pathnameStackToGoBack,n.pathname)}})}}}}else C.current=!0}),[$,R,d,n,e]);const V=E((i=>ne(i,s))),v=V.fetchState,Z=y.getSignedInUser();if(Z==null)throw Error("Can't access task detail page without signing in...");if(v==="Error"&&V.error?.code===400){const{tenantEmailDomain:i}=d,l=U(i),p=P(n.state?.pathnameStackToGoBack,n.pathname);return r.jsx(pe,{to:l,state:{pathnameStackToGoBack:p}})}return r.jsxs(r.Fragment,{children:[v==="Completed"?r.jsx(Ke,{analytics:M,onLoad:i=>(l=>l.trackPageLoaded($e.Event.taskDetailPage))(i)}):null,r.jsxs(ea,{children:[r.jsx(Ze,{isAppContentDrawerOpen:_,handleDrawerToggle:i=>{B(i)}}),r.jsx(He,{analytics:M,currentTenant:d,handleZeniLogoClick:()=>{c.toggle()},initialOpenThreadRequest:m,location:n,loggedInUser:Z,navigate:e,taskGroupId:u,taskId:s,taskDetailFetchState:v,onUnarchiveTaskClick:le,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:I,isTaskCannedResponsesEnabled:D,isTaskRecurringParentEnabled:w,isTaskGroupAssigneesEnabled:x})]})]})}const ea=ze.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as t}from"./liveblocks-DVe3Eena.js";import i from"./NotFoundScreen-BkQQJnCX.js";import{T as r}from"./TransactionDetailScreen-D_QMd7J1.js";import"./sentry-DqMiDAOv.js";import{n as d,o}from"./core-cL-h_S3o.js";import"./zeni-epic-state-DMwHYs-L.js";import"./recharts-BPDamcen.js";import"./index-D4ChxRFU.js";import"./mui-a6BeA4JD.js";import"./analytics-qutbJJuo.js";import"./plaid-C5X1WR-a.js";import"./dnd-CvWVwn67.js";import"./stripe-cKAAJElX.js";import"./lottie-MSaCuPby.js";import"./lexical-fOKQwNUZ.js";import"./pdf-CurGQkyb.js";import"./utils-jUBXEI4l.js";import"./useAskAiCfoHostNavButtonProps-0oF2VYBt.js";import"./decodeURIComponentSafe-DiZsTtnQ.js";import"./useInitialThreadRequest-T-M769mk.js";import"./routePaths-Dn5fef1Z.js";import"./expenseAutomationHelper-DBhDJoc-.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="07c2895c-270d-414b-a4ec-49ceb0cdd05a",e._sentryDebugIdIdentifier="sentry-dbid-07c2895c-270d-414b-a4ec-49ceb0cdd05a")}catch{}})();function z(){return t.jsxs(d,{children:[t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(o,{path:"/*",element:t.jsx(r,{})})]})}export{z as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{j as C}from"./liveblocks-DVe3Eena.js";import{a as i}from"./sentry-DqMiDAOv.js";import{u as W,k as sn,j as g,s as ge,g as De,h as Ce,i as Ae,N as cn,l as rn}from"./core-cL-h_S3o.js";import{pu as Ie,fE as ee,gU as ln,TX as dn,oA as un,oa as mn,CZ as se,bn as pn,de as Re,bq as _e,sg as Q,V1 as Y,W9 as we,Wa as le,Vr as Pe,m9 as Fe,Wb as Ue,Vw as de,Vx as ue,m_ as xe,Rt as me,W5 as G,m3 as Ve,m1 as Le,md as fn,ph as hn,Wc as Sn,Wd as yn,CQ as J,m8 as Oe,QO as Be,cm as Tn,dk as bn,We as gn,W4 as In,Wf as vn,Wg as En,Wh as kn,Wi as Dn,CM as Cn,Wj as An,Wk as Rn,Wl as _n,Wm as wn,Wn as Pn,mc as Fn,Wo as Un,Wp as xn,W6 as Vn,Wq as Ln,Wr as On,Ws as Bn,QI as Nn,Qy as Wn,QX as zn,me as jn,Ru as ve,pm as Mn}from"./zeni-epic-state-DMwHYs-L.js";import{O as X,y as A,j as $,b2 as Gn,z as Ne,E as $n,a1 as qn,b3 as Hn,ab as Qn,a4 as ce,V as Yn,b4 as Xn,p as ie,as as Zn,b5 as Jn,b6 as Kn,b7 as et,ae as nt,av as oe}from"./index-D4ChxRFU.js";import{n as tt,S as at,D as ot}from"./mui-a6BeA4JD.js";import{u as st}from"./useAskAiCfoHostNavButtonProps-0oF2VYBt.js";import{d as We}from"./decodeURIComponentSafe-DiZsTtnQ.js";import{u as ct}from"./useInitialThreadRequest-T-M769mk.js";import{h as ze,c as je,g as it,e as rt}from"./routePaths-Dn5fef1Z.js";import{u as lt}from"./expenseAutomationHelper-DBhDJoc-.js";import{v as dt}from"./utils-jUBXEI4l.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new n.Error().stack;e&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[e]="0ca2e747-3f70-40c5-9fce-bac5fc9eb322",n._sentryDebugIdIdentifier="sentry-dbid-0ca2e747-3f70-40c5-9fce-bac5fc9eb322")}catch{}})();function ut(n=!0){const e=W(),o=sn(),{useFeatureGate:t}=X(),{isFeatureEnabled:a}=t(A.isCreateTransferEntryFromExpenseEnabled);i.useEffect((()=>{if(!n||a!==!0)return;const s=c=>{const u=o.getState().createTransferEntryState.transferAccountsByType[c].fetchState;return u!=="In-Progress"&&u!=="Completed"};s("transferEntryEligible")&&e(Ie({kind:"transferEntryEligible"})),s("creditCardOnlyEligible")&&e(Ie({kind:"creditCardOnlyEligible"}))}),[n,a,e,o])}function mt(n,e){const o=(function(){const u=W(),[h,y]=i.useState(!1),[f,d]=i.useState(null),[r,S]=i.useState(null),{useDynamicConfig:I}=X(),{configValue:D,isDynamicConfigLoading:T}=I("transaction_categorization_config"),b=!T&&D?.capitalization_enabled===!0,v=g((l=>ee(l))),R=v.companyId,q=g((l=>ln(l.companyState,v.companyId)?.company.companyLocaleInfo?.currencySymbol??"$")),{capitalizableAccounts:U,capitalizableAccountOverrides:_,dismissedAccounts:w}=g((l=>{const E=l.tenantState.currentTenantId,k=E!=null?l.tenantState.tenantsById[E]:void 0;return{capitalizableAccounts:k?.capitalizableAccounts??null,capitalizableAccountOverrides:k?.capitalizableAccountOverrides??null,dismissedAccounts:k?.capitalizationOnboardingDismissedAccounts??null}}),ge),x=i.useRef(U);x.current=U;const P=i.useRef(_);P.current=_;const V=i.useRef(w);V.current=w;const L=g((l=>dn(l.accountState)),ge),H=i.useMemo((()=>{const l={};for(const E of L)E.accountId!=null&&E.accountName!=null&&(l[E.accountId]=E.accountName);return l}),[L]),z=r!=null?H[r]??null:null,O=i.useCallback((l=>{if(!b)return;const E=x.current;if(E==null)return;const k=E.accounts??[],M=new Set(l),Z=P.current??{},ne=V.current;for(const B of k)if(M.has(B.accountId)&&Z[B.accountId]==null&&ne?.[B.accountId]==null)return d(B.classificationType),S(B.accountId),void y(!0)}),[b]),j=i.useCallback(((l,E)=>{u(un(R,l,E,!0)),y(!1),d(null),S(null)}),[u,R]),p=i.useCallback((()=>{r!=null&&(u(mn(R,r)),y(!1),d(null),S(null))}),[u,R,r]);return{showPopup:h&&b,popupType:f,popupAccountId:r,popupAccountName:z,currencySymbol:q,checkAndShowPopup:O,handleSubmit:j,handleDismiss:p}})(),t=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((()=>{n==="In-Progress"&&(a.current=c.current()),n==="Completed"&&t.current==="In-Progress"&&a.current.length>0&&(s.current(a.current),a.current=[]),t.current=n}),[n]),o}const N=new Map,Ee=(n,e,o)=>`${n}|${e??""}|${o}`,K=(n,e)=>{const[o,t]=n.shownRecommendations;return{recommendationFor:n.dimension,recommendation:o?.name??"",recommendationSource:o?.engine??null,recommendationConfidencePercentage:o?.confidencePercentage??null,alternativeRecommendation:t?.name??null,alternativeRecommendationSource:t?.engine??null,alternativeRecommendationConfidencePercentage:t?.confidencePercentage??null,selectedValue:n.selected.name,numberOfRecommendations:n.shownRecommendations.length,transactionId:e,lineId:n.lineId??null}},re=(n,e,o)=>({transactionId:e,lineId:n.lineId,dimension:n.dimension,outcome:n.outcome,selected:{name:n.selected.name,id:n.selected.id},matchedSource:n.matchedSource,matchedRank:n.matchedRank,topPickSource:n.topPickSource,shownRecommendations:n.shownRecommendations.map((t=>({source:t.source,rank:t.rank,value:{name:t.name,id:t.id},confidence:t.confidencePercentage!=null?t.confidencePercentage/100:void 0}))),...o}),Me=(n,e,o)=>{$.trackRecommendationFeedbackRetracted(K(e,o)),n(se(re(e,o,{outcome:"retracted"})))},Vt=(n,e)=>{const o=new Set(e.map(String));N.forEach(((t,a)=>{o.has(t.transactionId)&&(N.delete(a),Me(n,t.feedback,t.transactionId))}))},Lt=n=>{const e=new Set(n.map(String));N.forEach(((o,t)=>{e.has(o.transactionId)&&N.delete(t)}))};function pt(n){const e=W(),[o,t]=i.useState(null),{isEnabled:a,fallbackTransactionId:s}=n,c=i.useCallback((f=>f.transactionId??s??""),[s]),u=i.useCallback((f=>{if(!a)return;const d=c(f);if(d==="")return;if(f.outcome!=="accepted")return void t(f);((S,I,D,T)=>{const b=Ee(I,D,T),v=N.get(b);return v!=null&&(N.delete(b),Me(S,v.feedback,v.transactionId),!0)})(e,d,f.lineId,f.dimension)||(((S,I)=>{$.trackRecommendationAccepted(K(S,I))})(f,d),e(se(re(f,d,{}))))}),[a,c,e]),h=i.useCallback((f=>{if(o==null)return;const d=c(o);((r,S,I)=>{$.trackRecommendationFeedbackSubmitted({...K(r,S),feedbackReason:I})})(o,d,f),e(se(re(o,d,{reasonText:f,skipped:!1}))),((r,S)=>{N.set(Ee(S,r.lineId,r.dimension),{feedback:r,transactionId:S})})(o,d),t(null)}),[o,c,e]),y=i.useCallback((()=>{var f,d;o!=null&&(f=o,d=c(o),$.trackRecommendationFeedbackSkipped(K(f,d)),t(null))}),[o,c]);return{onRecommendationSelection:u,popup:o!=null?C.jsx(Gn,{feedback:o,onSubmit:h,onSkip:y}):null}}const pe=()=>{const n=Ne.getSignedInUser(),{useFeatureGate:e}=X(),{isFeatureEnabled:o}=e(A.isChainOfThoughtEnabled);return i.useMemo((()=>pn(n)&&o),[n,o])};function Ge(n){if(n!=null){if("customer"in n&&n.customer!=null){const{customer:e}=n;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in n&&n.vendor!=null){const{vendor:e}=n;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function Ot(n,e){const o=W(),{useFeatureGate:t}=X(),a=g((p=>ee(p))),s=a.userRole.includes("charge_card_user")||a.userRole.includes("charge_card_admin"),c=a.userRole!=null&&Re(a.userRole),u=a.userRole!=null&&_e(a.userRole),{isFeatureEnabled:h}=t(A.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:y}=t(A.isExpenseAutomationEnabled),f=pe(),d=i.useMemo((()=>({id:n,type:Q(e)})),[n,e]),r=g((p=>Y(p,d))),S=r?.transactionDetailUpdateStatus?.fetchState,I=r?.transactionDetailLocalData?.lineItemById,D=g((p=>{const l=Y(p,d)?.transactionDetailLocalData.vendorUpdates?.id;return l==null?"Not-Started":p.transactionVendorViewState.editVendorStateById[l]?.saveStatus.fetchState??"Not-Started"})),T=i.useMemo((()=>r?.fetchState==="Completed"?Ge(r?.transaction):void 0),[r?.fetchState,r?.transaction]),b=g((p=>{if(T!=null)return we(p.customerIncomeState,p.vendorExpenseState,p.trendState,T,"month")})),v=g((p=>le(p))),R=g((p=>{if(T!=null)return Pe(p.trendWithTransactionsState,T,"TransactionDetail")})),q=a.company?.companyInfo.firstMonthOfFY??1,U=g((p=>Fe(p.accountState,p.accountListState,"accountList"))),[_,w]=i.useState(!1),[x,P]=i.useState(!1),[V,L]=i.useState(!1);i.useEffect((()=>{w(!1),P(!1),L(!1)}),[n,e]);const H=i.useCallback((()=>{w(!1),P(!1)}),[]),[z,O]=i.useState(!1),j=R?.selectedPeriod?.timePeriod;return i.useEffect((()=>{V||r==null||r.transaction==null||(o(Ue({id:r.transaction.id,type:r.transaction.type})),L(!0)),T!=null&&(!s||c&&u===!1)&&(_?x||b==null||(P(!0),o(me(T,"TransactionDetail",{timeframe:"month",timePeriod:j??b}))):(o(de()),o(ue()),w(!0),o(xe(T))))}),[o,V,r?.fetchState,r?.transaction,T,s,c,u,_,x,b,j]),i.useEffect((()=>{v.newVendorState?.vendorDetailLocalData?.vendorName!=null?O(!0):O(!1)}),[v.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{o(G("common"))}),[o]),{currentTenant:a,loggedInUserHasCardUserOrAdminRole:s,isUserHasDashboardAccess:c,isUserHasInvestorOrBankerAccess:u,isVendorBulkUpdateOnTransactionEnabled:h,isExpenseAutomationEnabled:y,isChainOfThoughtEnabled:f,selectedTransaction:d,transactionDetail:r,rawDetailSaveStatus:S,rawDetailLineItemById:I,vendorSaveStatus:D,tranEntity:T,defaultTrendTransactionTimePeriod:b,vendorViewDetails:v,uiState:R,firstMonthOfFY:q,uncategorizedAccounts:U,resetTrendIsFetchedStates:H,isCreateVendorDrawerOpen:z,setIsCreateVendorDrawerOpen:O}}const ft={overlayWidth:new Qn(100,100,58)},ht=({isOpen:n,onSaveVendor:e,onSaveSuccess:o,onCancel:t,vendorViewDetails:a})=>{const s=$n(),c=qn(),u=W(),h=g((d=>le(d))),y=()=>{t()},f={vendorDetailView:a??h,onSaveSuccess:()=>{u(Le()),u(fn("Not-Started")),o()},onSaveVendor:e,onCancelClick:y,saveVendorDetailLocalData:d=>{u(Ve({vendorId:void 0,localData:d}))}};return C.jsx(ot,{anchor:"right",open:n,PaperProps:{style:{width:ft.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:s.colors.black,opacity:.4,cursor:"pointer"}}},onClose:y,children:C.jsx(St,{onClick:d=>d.stopPropagation(),children:C.jsx(Hn,{...f})})})},St=tt(at)`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
`;function yt(n,e){n(hn({transactionId:e.transactionId,creditAccountIntegrationId:e.creditAccountIntegrationId,debitAccountIntegrationId:e.debitAccountIntegrationId,memo:e.memo,transactionType:Q(e.transactionType),sourceTransactionType:Q(e.sourceTransactionType)}))}function Tt({currentTransactionId:n,enabled:e=!0,buildPath:o,beforeNavigate:t,navigate:a,navigateState:s}){const c=g((h=>h.createTransferEntryState.lastTransferEntryReplacement)),u=i.useRef(null);i.useEffect((()=>{if(!e||c==null||n==null||u.current===c)return;const{previousTransactionId:h,newTransactionId:y}=c;n.id===h.id&&n.type===h.type&&(u.current=c,t?.(),a(o(y),{replace:!0,state:s}))}),[e,c,n,o,t,a,s])}const bt=({closeDrawerHandler:n,overrideTransactionId:e,overrideTransactionType:o})=>{const t=De(),a=Ce(),s=W(),c=pe(),{transactionTypeEncoded:u,transactionId:h}=Ae(),y=e??h,f=o??We(u??"");let d;ze(y,f)&&(d={id:y,type:Q(f)});const r=d!=null?g((I=>Y(I,d))):void 0,S=()=>{const I=ce(t.state?.pathnameStackToGoBack),D=I.poppedPathname??((T=2)=>{let b="../";for(let v=0;v<T;v++)b=`${b}../`;return b})(1);a(D,{state:{pathnameStackToGoBack:I.newStack}})};return{transactionId:d,onSaveVendor:()=>{s(Oe(d,void 0))},onSaveSuccess:()=>{if(r!=null&&r?.transaction&&r?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&r?.transactionDetailLocalData.vendorUpdates?.id!=null){const I=r?.transactionDetailLocalData.vendorUpdates,D={id:r?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:r?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:I?.name,qboId:r?.transactionDetailLocalData.vendorUpdates?.qboId??""},T={transactionId:{id:r?.transaction?.id,type:r?.transaction?.type},transaction:r?.transaction,lineIds:r?.transaction?.lines?.map((b=>b.id))??[]};s(J({entity:D,amount:r?.transaction?.amount.amount,transactionDetails:T,flowType:"detail",isFetchCOT:c}))}S()},onCancel:()=>{d!=null&&s(Sn({transactionId:d})),s(Le()),s(yn()),n(!0),S()}}},gt=rn((function(n,e){const o=Y(n,e.selectedTransaction);let t;o==null&&console.warn("Check if the you've selected the transaction before getting the details");const a=Ne.getSignedInUser(),s=n.tenantState.currentTenantId,c={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:s??""};o!=null&&o.fetchState==="Completed"&&o.transaction!=null&&e.entity!=null&&(t=gn(n,e.entity,"TransactionDetail"));const u=n.entityAutoCompleteState.autoCompleteText.common,h=In(n,"common"),y=ee(n);return{transactionDetail:o,transactionAttachmentEndpointToDownload:`${oe}/transaction_attachment`,transactionAttachmentsEndpointToFetch:y.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${oe}/transaction_attachments_accounting_provider`:`${oe}/transaction_attachments`,attachmentUploadEndpoint:`${nt.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:c,trendReport:t,analytics:$,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:u,entityAutoCompleteView:h},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails"),isTransactionSplitEditMode:o?.transactionDetailLocalData?.editMode??!1}}),(function(n,e){const{isCOTEnabled:o}=e;return{onBackClick:()=>{if(n(G("common")),e.onBackClick!=null)return void e.onBackClick();const t=ce(e.location.state?.pathnameStackToGoBack),a=t.poppedPathname??$e(2);e.navigate(a,{state:{pathnameStackToGoBack:t.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(t,a)=>{e.transaction!=null&&n(Mn({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:t,customerId:a}))},onTransactionClick:t=>{e.resetTrendIsFetchedStates(),n(de()),n(ue());const a=ie(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(je(t,e.tenantEmailDomain),{state:{pathnameStackToGoBack:a}})},onTrendSelectedPeriodChange:t=>{if(t==null)e.defaultTrendTransactionTimePeriod!=null&&n(ve(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const a=t.currentTimePeriod==null?t.addTimePeriod:{startDate:t.addTimePeriod.startDate,endDate:t.currentTimePeriod.endDate};n(me(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:t.addTimePeriod})),n(ve(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:a}))}},onSaveUpdates:(t,a,s,c)=>{n(c===!0&&s!=null?Oe(t,s,!0,e.isExpenseAutomationEnabled):jn({transactionId:t,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:a})),n(G("common"))},onUploadAttachmentAttachment:t=>{n(zn(t))},onDeleteAttachment:t=>{e.transaction!=null&&n(Wn(t,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(t,a)=>{n(Nn({transactionId:t,transactionLocalData:a}))},onUpdateAllChecked:(t,a,s,c)=>{e.transaction!=null&&n(Bn(e.selectedTransaction,e.transaction,t,a,s,c))},onResetLineItemsCategoryClassInLocalData:(t,a,s,c,u,h)=>{n(On(t,a,s,c,u,h))},onChangeCategoryClassWhenUpdateAllIsChecked:(t,a)=>{e.transaction!=null&&n(Ln({id:e.transaction.id,type:e.transaction.type},e.transaction,t,a))},onSaveSuccess:()=>{const t=ce(e.location.state?.pathnameStackToGoBack);if(t.poppedPathname!=null){const a=dt(t.poppedPathname,"/").split("/"),s=a[a.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(s)&&e.navigate(t.poppedPathname,{state:{pathnameStackToGoBack:t.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const c=`${it(e.tenantEmailDomain)}`;e.navigate(c)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const c=`${rt(e.tenantEmailDomain)}`;e.navigate(c)}}},onPageRefresh:()=>{n(Be(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(t,a)=>{t.trim().length>=2?n(Vn({searchString:t,entityType:a,searchOrigin:"common"})):t.trim().length===0&&n(G("common"))},onCancelAutoComplete:()=>{n(G("common"))}},onFetchRecommendationsForEntity:(t,a,s,c)=>{n(J({entity:t,amount:a,transactionDetails:s,flowType:"detail",isBulkFetch:c,isFetchCOT:o}))},clearRecommendationForLineId:t=>{const{transactionId:a,transaction:s,lineId:c}=t;n(xn(a,s,c))},resetUpdateErrorState:()=>{const t={id:e.selectedTransaction.id,type:e.selectedTransaction.type};n(Un(t))},onSaveVendorInLocalData:(t,a,s,c,u)=>{if(n(Fn({transactionId:t,vendorUpdates:a,entity:s})),a.id!=null&&s!=null&&c!=null&&u!=null&&n(J({entity:s,amount:c,transactionDetails:u,flowType:"detail",isFetchCOT:o})),n(Ve({vendorId:a.id?a.id:void 0,localData:{vendorName:a.name,vendorId:a.id?a.id:void 0}})),!a.id&&e.transaction!=null){const h=e.transaction,y=ie(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(h.type??"")}/${h.id}/vendor/create`,{state:{pathnameStackToGoBack:y}})}},onSaveCustomerInLocalData:(t,a,s,c,u)=>{n(Pn({transactionId:t,customerUpdates:a,entity:s})),a.id!=null&&s!=null&&c!=null&&u!=null&&n(J({entity:s,amount:c,transactionDetails:u,flowType:"detail",isFetchCOT:o}))},onUpdateAllTranactionsWithCurrentVendorChecked:t=>{n(wn({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:t}))},onClickUpdateVendorToAllLineItems:(t,a,s)=>{n(_n(t,a,s))},onResetVendorToAllLineItems:(t,a,s)=>{n(Rn(t,a,s))},saveLatestSelectedEntity:(t,a,s)=>{n(An({transactionId:t,lineId:a,entity:s}))},updateVendorBulkRecommendationsFetchStatus:(t,a)=>{n(Cn(t,a))},setIsVendorUpdateAllChecked:(t,a,s)=>{n(Dn(t,a,s))},onCreateTransferEntry:e.isCreateTransferEntryFromExpenseEnabled===!0?t=>yt(n,t):void 0,onLineAdd:()=>{if(e.transaction==null)return;const t={id:e.transaction.id,type:e.transaction.type},a=e.transaction.type==="journal_entry",s=e.transaction.amount?.currencyCode??"",c=e.transaction.amount?.currencySymbol??"",u=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"};n(kn(t,u))},onLineDelete:t=>{if(e.transaction==null)return;const a={id:e.transaction.id,type:e.transaction.type};n(En(a,t))},onToggleSplitEditMode:t=>{if(e.transaction==null)return;const a={id:e.transaction.id,type:e.transaction.type};n(vn(a,t))}}}))(et);function Bt(){const n=Ce(),e=W(),o=De(),{useFeatureGate:t}=X(),a=Yn(),s=g((m=>ee(m))),c=s.userRole.includes("charge_card_user")||s.userRole.includes("charge_card_admin"),u=s.userRole!=null&&Re(s.userRole),h=s.userRole!=null&&_e(s.userRole),{isFeatureEnabled:y}=t(A.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:f}=t(A.isExpenseAutomationEnabled),{tenantEmailDomain:d,transactionTypeEncoded:r,transactionId:S}=Ae(),[I,D]=i.useState(!1),T=We(r??""),b=ze(S,T),v=g((m=>m.transactionVendorViewState)),R=pe(),{isFeatureEnabled:q}=t(A.isRecommendationFeedbackEnabled),U=Xn(),{onRecommendationSelection:_,popup:w}=pt({isEnabled:q,fallbackTransactionId:S}),x=i.useMemo((()=>({...U,onRecommendationSelection:_})),[U,_]),{isFeatureEnabled:P}=t(A.isTransactionCommentingEnabled),{isFeatureEnabled:V}=t(A.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:L}=t(A.isProjectsTransactionsEnabled),{isFeatureEnabled:H}=t(A.isTransactionSplitEnabled),z=a?.currentTenant?.companyId,O=a?.currentTenant?.companyName,j=ct(z),p=i.useMemo((()=>{if(b)return{id:S,type:Q(T)}}),[b,S,T]),l=p!=null?g((m=>Y(m,p))):void 0,E=l?.transactionDetailLocalData.vendorUpdates?.id!=null?v.editVendorStateById[l?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",k=l?.fetchState==="Completed"?Ge(l?.transaction):void 0,M=g((m=>k!=null?we(m.customerIncomeState,m.vendorExpenseState,m.trendState,k,"month"):void 0)),Z=g((m=>le(m))),ne=g((m=>k!=null?Pe(m.trendWithTransactionsState,k,"TransactionDetail"):void 0)),B=s.company?.companyInfo.firstMonthOfFY??1,qe=g((m=>Fe(m.accountState,m.accountListState,"accountList"))),[He,fe]=i.useState(!1),[Qe,he]=i.useState(!1),[Ye,Se]=i.useState(!1),Xe=i.useCallback((m=>je(m,d??"")+o.search),[d,o.search]),Ze=i.useCallback((()=>{Se(!1)}),[]);Tt({currentTransactionId:p,enabled:d!=null&&d!=="",buildPath:Xe,beforeNavigate:Ze,navigate:n,navigateState:o.state});const ye=()=>{fe(!1),he(!1)},Te=lt();ut();const te=i.useRef(l?.transaction);te.current=l?.transaction;const Je=l?.transactionDetailUpdateStatus?.fetchState,F=mt(Je,(()=>{const m=[];if(te.current!=null)for(const ae of te.current.lines??[])"account"in ae&&ae.account?.accountId!=null&&m.push(ae.account.accountId);return m}));i.useEffect((()=>{p!=null&&l!=null&&l.fetchState==="Not-Started"&&(e(Be(p,!1)),ye())}),[e,p,l?.fetchState]),i.useEffect((()=>{if(p!=null&&l?.fetchState==="Error"){const m=ie(o.state?.pathnameStackToGoBack,o.pathname);n("page-not-found",{replace:!0,state:Te?{pathnameStackToGoBack:m,message:"expenseAutomation",origin:"transaction_categorization"}:{pathnameStackToGoBack:m,message:"pageNotFound",origin:"transaction_detail"}})}}),[p,l?.fetchState,n,o.state,o.pathname,Te]),i.useEffect((()=>{Ye||l==null||l.transaction==null||(e(Ue({id:l.transaction.id,type:l.transaction.type})),Se(!0));const m=o.state?.searchContext;k==null&&l?.fetchState==="Completed"&&ke(l?.transaction,m),k!=null&&(!c||u&&h===!1)&&(He?Qe||M==null||(he(!0),e(me(k,"TransactionDetail",{timeframe:"month",timePeriod:ne?.selectedPeriod?.timePeriod??M}))):(e(de()),e(ue()),ke(l?.transaction,m),fe(!0),e(xe(k))))}),[l?.fetchState,l?.transaction,M,c]),i.useEffect((()=>{Z.newVendorState?.vendorDetailLocalData?.vendorName!=null?D(!0):D(!1)}),[Z.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{e(G("common"))}),[]);const Ke=[r,S].filter((m=>m!=null)),{transactionId:be,onSaveVendor:en,onSaveSuccess:nn,onCancel:tn}=bt({closeDrawerHandler:m=>{D(!1),n(m?"../":"../..")}}),{isAiCfoAccessEnabled:an,onAskAiCfoClick:on}=st({mobileExploreReferrer:"Transaction Details"});return Zn({isDataReady:l?.fetchState==="Completed"}),b?C.jsxs(C.Fragment,{children:[be!=null&&I&&C.jsx(ht,{isOpen:I,transactionId:be,onSaveVendor:en,onSaveSuccess:nn,onCancel:tn}),C.jsx(Jn,{toolkit:x,children:C.jsx(gt,{hideDeleteAttachment:!0,firstMonthOfFY:B,isDisabled:l?.transaction?.type==="transfer"&&a?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:d,location:o,navigate:n,selectedTransaction:p,entity:k,isCOTEnabled:R,defaultTrendTransactionTimePeriod:M,resetTrendIsFetchedStates:ye,transaction:l?.transaction,uncategorizedAccounts:qe,vendorSaveStatus:E,isVendorBulkUpdateOnTransactionEnabled:y,isCreateTransferEntryFromExpenseEnabled:V,isExpenseAutomationEnabled:f,isAiCfoAccessEnabled:an,onAskAiCfoClick:on,isTransactionCommentingEnabled:P,isProjectsTransactionsEnabled:L,isTransactionSplitEnabled:H,companyId:z,companyName:O,initialOpenThreadRequest:j})}),w,F.showPopup&&F.popupType!=null&&C.jsx(Kn,{popupType:F.popupType,currencySymbol:F.currencySymbol,accountId:F.popupAccountId??"",accountName:F.popupAccountName??"",onSubmit:F.handleSubmit,onDismiss:F.handleDismiss})]}):C.jsx(cn,{to:$e(Ke.length)})}const $e=(n=2)=>{let e="../";for(let o=0;o<n;o++)e=`${e}../`;return e},ke=(n,e)=>{if(n!=null){const{transactionCategory:o,transactionClass:t}=It(n),a=vt(n);$.trackTransactionDetails(n.account?.accountId,n.account?.accountName,n.id,a,o.length>0?o:void 0,t.length>0?t:void 0,n.type,n.amount,n.memo,n.lines?.length??0,n.attachments?.map((s=>s.fileName)),e!=null?"Search":void 0,e?.searchTerm,e?.resultPosition,e?.resultsCount)}},It=n=>{const e=[],o=[];return n.lines?.forEach((t=>{switch(t.type){case"transaction_with_account_and_class_line":case"transaction_with_product_or_service_line":case"journal_entry_transaction_line":case"linked_transaction_line":{const a=t;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}},vt=n=>Tn(n)===!0?n.customer?.name??"":bn(n)===!0?n.vendor?.name??"":n.memo!=null?n.memo:n.type;export{ht as C,Bt as T,pt as a,ut as b,mt as c,bt as d,gt as e,Tt as f,pe as g,Lt as h,yt as i,ke as l,Vt as r,Ot as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-B0EpRifM.js";import{h as Q,g as U,u as W,i as X,j as g,N as q,l as H,n as Me,o as C}from"./core-CqflqGv9.js";import{fE as Z,tA as ee,le as p,ew as te,Rk as Se,br as pe,_Y as Be,l_ as ae,Vt as ne,_Z as fe,__ as Le,bE as k,Rg as he,_$ as Fe,$0 as Te,$1 as Oe,Rj as ge,$2 as Ge,$3 as De,$4 as we,$5 as Ie,$6 as $e,$7 as ze,$8 as ye,Sw as Re}from"./zeni-epic-state-Sf5HhdfR.js";import{O as ce,y as J,j as F,G as ke,dc as oe,p as z,a4 as se,aq as _e,e as Ve}from"./index-6X2hJC9C.js";import"./mui-Splhybhe.js";import{a as y}from"./sentry-BefEASz6.js";import{w as ie}from"./withTransactionSidePanel-C1SRvhe2.js";import{p as re,c as de}from"./routePaths-vIHY-V28.js";import{w as Ne}from"./utils-JmZUGXv-.js";import{d as j}from"./decodeURIComponentSafe-Bw5_joHN.js";import{Z as Je}from"./ZeniAccountStatementScreen-CX0ZvWif.js";import"./recharts-C-DOhwH-.js";import"./analytics-Bg9sHj4I.js";import"./plaid-D5Rs2Xbn.js";import"./dnd-OUjwZlfC.js";import"./stripe-cKAAJElX.js";import"./lottie-x3DIllPk.js";import"./lexical-BHqkUsiS.js";import"./pdf-BZfLFbU_.js";import"./useAskAiCfoHostNavButtonProps-_aV90QuU.js";import"./TransactionDetailScreen-3kh7GhKV.js";import"./useInitialThreadRequest-Ocoxr05G.js";import"./expenseAutomationHelper-BTi1SBkX.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]="8c77bc0a-4f62-46ca-be51-a06cbbcd53ec",a._sentryDebugIdIdentifier="sentry-dbid-8c77bc0a-4f62-46ca-be51-a06cbbcd53ec")}catch{}})();const Ue=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],N=a=>Ne(a),Ye=()=>{const{common:a,uncategorizedTransactionList:e}=ke.getLocalizedStrings();return{amount:e.missingReceipt.missingReceiptMinAmount.amount,currencyCode:a.currency.currencyCode,currencySymbol:a.currency.currencySymbol}},qe=H((function(a,e){const t=Be(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:ne(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(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=Qe(t,n,c,o,e.bookCloseDate);F.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(fe({uiState:{dateRange:d},type:N(e.selectedAccount.tranListType)})),a(Se(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=z(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(fe({uiState:{scrollYOffset:t},type:N(e.selectedAccount.tranListType)}))}}}))(oe),V=ie((function({...a}){const e=Q(),t=U(),n=W(),c=t.pathname.split("/").find((l=>Ue.includes(l))),o=c??"uncategorized-expense",{tenantEmailDomain:d}=X(),{accountType:Y,title:b,subTitle:A}=Ze(o),f="month",T=g((l=>Z(l))),v=T.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:S}=ce(),{isFeatureEnabled:h}=S(J.isProjectsTransactionsEnabled),I=g((l=>ee(l)))&&h,{dataAvailable:x,initialTimeframeTick:O}=Ke(o,v,T.bookCloseDate),[P,G]=y.useState(!1),[E,w]=y.useState(void 0),u=y.useMemo((()=>{const l=p(O);return{tranListType:o,accountType:te(Y),title:b,subTitle:A,timeframe:f,period:l}}),[o,f,Y,x]);y.useEffect((()=>{if(!P&&u!=null){G(!0),F.trackTransactionList(void 0,void 0,void 0,u.title);const l=N(u.tranListType);n(Se(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=>w(l),...a})})),Ze=a=>{let e="",t="";const n=ke.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:""}},Ke=(a,e,t)=>{const n=pe();let c=pe().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}}},Qe=(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},We=H((function(a,e){const t=Fe(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:ne(e.selectedAccount.period),dataAvailableForPeriod:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(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)}`),F.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(Te({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(he(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=z(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,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}}))(oe),Xe=ie((function({referrerType:a,...e}){const t=Q(),n=U(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:Y,classIdEncoded:b,timeframe:A,startDate:f,endDate:T,titleEncoded:v}=X(),S=j(d??""),h=j(Y??""),I=j(b??""),x=j(v??""),O=g((r=>Le(r.transactionListState,h,S,I))),[P,G]=y.useState(!1),[E,w]=y.useState(void 0),u=g((r=>Z(r))),M=u.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:l}=ce(),{isFeatureEnabled:m}=l(J.isProjectsTransactionsEnabled),$=g((r=>ee(r)))&&m;let i;const L=He(S,h,I,A,f,T,x);if(L){const r={startDate:k(f,"YYYY-MM-DD"),endDate:k(T,"YYYY-MM-DD")},_=et(O?.dateRange,r);i={accountId:h,accountType:te(S),classId:I,title:x,timeframe:A,period:_}}y.useEffect((()=>{P||i==null||(G(!0),F.trackTransactionList(i.accountId,void 0,a,i.title),c(he(i.accountId,i.accountType,i.classId,i.period)))}),[P,i,c]);let B=i;i!=null&&E!=null&&(B={...i,period:E});const R=[d,Y,b,A,f,T,v].filter((r=>r!=null));return L&&B!=null?s.jsx(We,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,showProjectField:$,selectedAccount:B,referrerType:a,onSelectedTimePeriodChange:r=>w(r),...e}):s.jsx(q,{to:be(R.length)})})),be=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},He=(a,e,t,n,c,o,d)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&k(c,"YYYY-MM-DD").isValid()&&k(o,"YYYY-MM-DD").isValid()&&d!=null,et=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),tt=H((function(a,e){const t=Ge(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:ne(e.selectedAccount.period),dataAvailableForPeriod:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(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)}`),F.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(De({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{dateRange:o}})),a(ge(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=z(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,projectId:e.selectedAccount.projectId,uiState:{scrollYOffset:t}}))}}}))(oe),at=ie((function({referrerType:a,...e}){const t=Q(),n=U(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:Y,projectIdEncoded:b,timeframe:A,startDate:f,endDate:T,titleEncoded:v}=X(),S=j(d??""),h=j(Y??""),I=j(b??""),x=j(v??""),O=g((r=>Oe(r.transactionListState,h,S,I))),[P,G]=y.useState(!1),[E,w]=y.useState(void 0),u=g((r=>Z(r))),M=u.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:l}=ce(),{isFeatureEnabled:m}=l(J.isProjectsTransactionsEnabled),$=g((r=>ee(r)))&&m;let i;const L=nt(S,h,I,A,f,T,x);if(L){const r={startDate:k(f,"YYYY-MM-DD"),endDate:k(T,"YYYY-MM-DD")},_=ct(O?.dateRange,r);i={accountId:h,accountType:te(S),projectId:I,title:x,timeframe:A,period:_}}y.useEffect((()=>{P||i==null||(G(!0),F.trackTransactionList(i.accountId,void 0,a,i.title),c(ge(i.accountId,i.accountType,i.projectId,i.period)))}),[P,i,c]);let B=i;i!=null&&E!=null&&(B={...i,period:E});const R=[d,Y,b,A,f,T,v].filter((r=>r!=null));return L&&B!=null?s.jsx(tt,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,showProjectField:$,selectedAccount:B,referrerType:a,onSelectedTimePeriodChange:r=>w(r),...e}):s.jsx(q,{to:ve(R.length)})})),ve=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},nt=(a,e,t,n,c,o,d)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&k(c,"YYYY-MM-DD").isValid()&&k(o,"YYYY-MM-DD").isValid()&&d!=null,ct=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),ot=H((function(a,e){const t=$e(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&ze(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:ae(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Pe();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)}`),F.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(ye({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(Ie(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=z(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ye({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=rt(e.tenantEmailDomain),n=z(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}}))(oe),Ae=ie((function({referrerType:a,...e}){const t=Q(),n=U(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:Y,timeframe:b,startDate:A,endDate:f,titleEncoded:T,excludeSubAccounts:v}=X(),S=j(d??""),h=j(Y??""),I=j(T??""),x=!(v!=null&&v==="exclude_subaccounts"),O=g((D=>we(D.transactionListState,h,S))),[P,G]=y.useState(!1),[E,w]=y.useState(void 0),u=g((D=>Z(D))),M=u.company?.featuresActivationInfo.connectedAccountProvider==="unit",l=u.company?.companyInfo.firstMonthOfFY??1;let m;const $=st(S,h,b,A,f,I);if($){const D={startDate:k(A,"YYYY-MM-DD"),endDate:k(f,"YYYY-MM-DD")},le=it(O?.dateRange,D);m={accountId:h,accountType:te(S),title:I,timeframe:b,period:le}}let i=m;m!=null&&E!=null&&(i={...m,period:E});const{useFeatureGate:L}=ce(),{isFeatureEnabled:B}=L(J.isTransactionCommentingEnabled),R=y.useCallback(((D,le)=>{if(o==null)return;const me=D.url.split(`/${o}/`)[1];if(me==null)return;const[je,xe]=me.split("?"),K=new URLSearchParams(xe??"");K.set("view","full"),K.set("thread_id",le),K.set("entity_type",D.entityType);const Ce=z(n.state?.pathnameStackToGoBack,n.pathname);t(`/${o}/${je}?${K.toString()}`,{state:{pathnameStackToGoBack:Ce}})}),[t,o,n.state,n.pathname]),{isFeatureEnabled:r}=L(J.isProjectsTransactionsEnabled),_=g((D=>ee(D)))&&r,{areTenantIdsInSync:ue}=_e();y.useEffect((()=>{!P&&m!=null&&ue&&(G(!0),F.trackTransactionList(m.accountId,void 0,a,m.title),c(Ie(m.accountId,m.accountType,m.period,void 0,!1,x)))}),[P,m,c,ue]);const Ee=[d,Y,b,A,f,T].filter((D=>D!=null));return $&&i!=null?s.jsx(ot,{firstMonthOfFY:l,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:M,isTransactionCommentingEnabled:B,onCommentThreadClick:R,showProjectField:_,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:D=>w(D),...e}):s.jsx(q,{to:Pe(Ee.length)})})),Pe=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},st=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&k(n,"YYYY-MM-DD").isValid()&&k(c,"YYYY-MM-DD").isValid()&&o!=null,it=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),rt=a=>`/${a}/transactions/${Re}/statements`;function Mt(){const a=U().state?.referrer,e=g((n=>n.expenseAutomationViewState.selectedPeriodByTenantId))[g((n=>Z(n))).tenantId],t=Ve();return s.jsxs(Me,{children:[s.jsx(C,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(Ae,{referrerType:a})}),s.jsx(C,{path:"/zeni-clearing-account/statements",element:s.jsx(Je,{})}),s.jsx(C,{path:"/*",element:s.jsx(Ae,{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(Xe,{referrerType:a})}),s.jsx(C,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(at,{referrerType:a})})]})}export{Mt as default};
|
|
1
|
+
import{j as s}from"./liveblocks-DVe3Eena.js";import{h as Q,g as U,u as W,i as X,j as g,N as q,l as H,n as Me,o as C}from"./core-cL-h_S3o.js";import{fE as Z,tA as ee,le as p,ew as te,Rk as Se,br as pe,_Y as Be,l_ as ae,Vt as ne,_Z as fe,__ as Le,bE as k,Rg as he,_$ as Fe,$0 as Te,$1 as Oe,Rj as ge,$2 as Ge,$3 as De,$4 as we,$5 as Ie,$6 as $e,$7 as ze,$8 as ye,Sw as Re}from"./zeni-epic-state-DMwHYs-L.js";import{O as ce,y as J,j as F,G as ke,dc as oe,p as z,a4 as se,aq as _e,s as Ve}from"./index-D4ChxRFU.js";import"./mui-a6BeA4JD.js";import{a as y}from"./sentry-DqMiDAOv.js";import{w as ie}from"./withTransactionSidePanel-CghfULxy.js";import{p as re,c as de}from"./routePaths-Dn5fef1Z.js";import{w as Ne}from"./utils-jUBXEI4l.js";import{d as j}from"./decodeURIComponentSafe-DiZsTtnQ.js";import{Z as Je}from"./ZeniAccountStatementScreen-CbAb9son.js";import"./recharts-BPDamcen.js";import"./analytics-qutbJJuo.js";import"./plaid-C5X1WR-a.js";import"./dnd-CvWVwn67.js";import"./stripe-cKAAJElX.js";import"./lottie-MSaCuPby.js";import"./lexical-fOKQwNUZ.js";import"./pdf-CurGQkyb.js";import"./useAskAiCfoHostNavButtonProps-0oF2VYBt.js";import"./TransactionDetailScreen-D_QMd7J1.js";import"./useInitialThreadRequest-T-M769mk.js";import"./expenseAutomationHelper-DBhDJoc-.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]="5d896c2e-e5ae-4ab1-8b57-6fa0dd50f889",a._sentryDebugIdIdentifier="sentry-dbid-5d896c2e-e5ae-4ab1-8b57-6fa0dd50f889")}catch{}})();const Ue=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],N=a=>Ne(a),Ye=()=>{const{common:a,uncategorizedTransactionList:e}=ke.getLocalizedStrings();return{amount:e.missingReceipt.missingReceiptMinAmount.amount,currencyCode:a.currency.currencyCode,currencySymbol:a.currency.currencySymbol}},qe=H((function(a,e){const t=Be(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:ne(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(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=Qe(t,n,c,o,e.bookCloseDate);F.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(fe({uiState:{dateRange:d},type:N(e.selectedAccount.tranListType)})),a(Se(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=z(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(fe({uiState:{scrollYOffset:t},type:N(e.selectedAccount.tranListType)}))}}}))(oe),V=ie((function({...a}){const e=Q(),t=U(),n=W(),c=t.pathname.split("/").find((l=>Ue.includes(l))),o=c??"uncategorized-expense",{tenantEmailDomain:d}=X(),{accountType:Y,title:b,subTitle:A}=Ze(o),f="month",T=g((l=>Z(l))),v=T.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:S}=ce(),{isFeatureEnabled:h}=S(J.isProjectsTransactionsEnabled),I=g((l=>ee(l)))&&h,{dataAvailable:x,initialTimeframeTick:O}=Ke(o,v,T.bookCloseDate),[P,G]=y.useState(!1),[E,w]=y.useState(void 0),u=y.useMemo((()=>{const l=p(O);return{tranListType:o,accountType:te(Y),title:b,subTitle:A,timeframe:f,period:l}}),[o,f,Y,x]);y.useEffect((()=>{if(!P&&u!=null){G(!0),F.trackTransactionList(void 0,void 0,void 0,u.title);const l=N(u.tranListType);n(Se(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=>w(l),...a})})),Ze=a=>{let e="",t="";const n=ke.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:""}},Ke=(a,e,t)=>{const n=pe();let c=pe().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}}},Qe=(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},We=H((function(a,e){const t=Fe(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:ne(e.selectedAccount.period),dataAvailableForPeriod:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(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)}`),F.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(Te({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(he(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=z(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,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}}))(oe),Xe=ie((function({referrerType:a,...e}){const t=Q(),n=U(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:Y,classIdEncoded:b,timeframe:A,startDate:f,endDate:T,titleEncoded:v}=X(),S=j(d??""),h=j(Y??""),I=j(b??""),x=j(v??""),O=g((r=>Le(r.transactionListState,h,S,I))),[P,G]=y.useState(!1),[E,w]=y.useState(void 0),u=g((r=>Z(r))),M=u.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:l}=ce(),{isFeatureEnabled:m}=l(J.isProjectsTransactionsEnabled),$=g((r=>ee(r)))&&m;let i;const L=He(S,h,I,A,f,T,x);if(L){const r={startDate:k(f,"YYYY-MM-DD"),endDate:k(T,"YYYY-MM-DD")},_=et(O?.dateRange,r);i={accountId:h,accountType:te(S),classId:I,title:x,timeframe:A,period:_}}y.useEffect((()=>{P||i==null||(G(!0),F.trackTransactionList(i.accountId,void 0,a,i.title),c(he(i.accountId,i.accountType,i.classId,i.period)))}),[P,i,c]);let B=i;i!=null&&E!=null&&(B={...i,period:E});const R=[d,Y,b,A,f,T,v].filter((r=>r!=null));return L&&B!=null?s.jsx(We,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,showProjectField:$,selectedAccount:B,referrerType:a,onSelectedTimePeriodChange:r=>w(r),...e}):s.jsx(q,{to:be(R.length)})})),be=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},He=(a,e,t,n,c,o,d)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&k(c,"YYYY-MM-DD").isValid()&&k(o,"YYYY-MM-DD").isValid()&&d!=null,et=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),tt=H((function(a,e){const t=Ge(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:ne(e.selectedAccount.period),dataAvailableForPeriod:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(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)}`),F.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(De({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{dateRange:o}})),a(ge(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=z(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,projectId:e.selectedAccount.projectId,uiState:{scrollYOffset:t}}))}}}))(oe),at=ie((function({referrerType:a,...e}){const t=Q(),n=U(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:Y,projectIdEncoded:b,timeframe:A,startDate:f,endDate:T,titleEncoded:v}=X(),S=j(d??""),h=j(Y??""),I=j(b??""),x=j(v??""),O=g((r=>Oe(r.transactionListState,h,S,I))),[P,G]=y.useState(!1),[E,w]=y.useState(void 0),u=g((r=>Z(r))),M=u.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:l}=ce(),{isFeatureEnabled:m}=l(J.isProjectsTransactionsEnabled),$=g((r=>ee(r)))&&m;let i;const L=nt(S,h,I,A,f,T,x);if(L){const r={startDate:k(f,"YYYY-MM-DD"),endDate:k(T,"YYYY-MM-DD")},_=ct(O?.dateRange,r);i={accountId:h,accountType:te(S),projectId:I,title:x,timeframe:A,period:_}}y.useEffect((()=>{P||i==null||(G(!0),F.trackTransactionList(i.accountId,void 0,a,i.title),c(ge(i.accountId,i.accountType,i.projectId,i.period)))}),[P,i,c]);let B=i;i!=null&&E!=null&&(B={...i,period:E});const R=[d,Y,b,A,f,T,v].filter((r=>r!=null));return L&&B!=null?s.jsx(tt,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,showProjectField:$,selectedAccount:B,referrerType:a,onSelectedTimePeriodChange:r=>w(r),...e}):s.jsx(q,{to:ve(R.length)})})),ve=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},nt=(a,e,t,n,c,o,d)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&k(c,"YYYY-MM-DD").isValid()&&k(o,"YYYY-MM-DD").isValid()&&d!=null,ct=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),ot=H((function(a,e){const t=$e(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&ze(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:ae(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Pe();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)}`),F.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(ye({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(Ie(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=z(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ye({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=rt(e.tenantEmailDomain),n=z(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}}))(oe),Ae=ie((function({referrerType:a,...e}){const t=Q(),n=U(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:Y,timeframe:b,startDate:A,endDate:f,titleEncoded:T,excludeSubAccounts:v}=X(),S=j(d??""),h=j(Y??""),I=j(T??""),x=!(v!=null&&v==="exclude_subaccounts"),O=g((D=>we(D.transactionListState,h,S))),[P,G]=y.useState(!1),[E,w]=y.useState(void 0),u=g((D=>Z(D))),M=u.company?.featuresActivationInfo.connectedAccountProvider==="unit",l=u.company?.companyInfo.firstMonthOfFY??1;let m;const $=st(S,h,b,A,f,I);if($){const D={startDate:k(A,"YYYY-MM-DD"),endDate:k(f,"YYYY-MM-DD")},le=it(O?.dateRange,D);m={accountId:h,accountType:te(S),title:I,timeframe:b,period:le}}let i=m;m!=null&&E!=null&&(i={...m,period:E});const{useFeatureGate:L}=ce(),{isFeatureEnabled:B}=L(J.isTransactionCommentingEnabled),R=y.useCallback(((D,le)=>{if(o==null)return;const me=D.url.split(`/${o}/`)[1];if(me==null)return;const[je,xe]=me.split("?"),K=new URLSearchParams(xe??"");K.set("view","full"),K.set("thread_id",le),K.set("entity_type",D.entityType);const Ce=z(n.state?.pathnameStackToGoBack,n.pathname);t(`/${o}/${je}?${K.toString()}`,{state:{pathnameStackToGoBack:Ce}})}),[t,o,n.state,n.pathname]),{isFeatureEnabled:r}=L(J.isProjectsTransactionsEnabled),_=g((D=>ee(D)))&&r,{areTenantIdsInSync:ue}=_e();y.useEffect((()=>{!P&&m!=null&&ue&&(G(!0),F.trackTransactionList(m.accountId,void 0,a,m.title),c(Ie(m.accountId,m.accountType,m.period,void 0,!1,x)))}),[P,m,c,ue]);const Ee=[d,Y,b,A,f,T].filter((D=>D!=null));return $&&i!=null?s.jsx(ot,{firstMonthOfFY:l,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:M,isTransactionCommentingEnabled:B,onCommentThreadClick:R,showProjectField:_,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:D=>w(D),...e}):s.jsx(q,{to:Pe(Ee.length)})})),Pe=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},st=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&k(n,"YYYY-MM-DD").isValid()&&k(c,"YYYY-MM-DD").isValid()&&o!=null,it=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),rt=a=>`/${a}/transactions/${Re}/statements`;function Mt(){const a=U().state?.referrer,e=g((n=>n.expenseAutomationViewState.selectedPeriodByTenantId))[g((n=>Z(n))).tenantId],t=Ve();return s.jsxs(Me,{children:[s.jsx(C,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(Ae,{referrerType:a})}),s.jsx(C,{path:"/zeni-clearing-account/statements",element:s.jsx(Je,{})}),s.jsx(C,{path:"/*",element:s.jsx(Ae,{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(Xe,{referrerType:a})}),s.jsx(C,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(at,{referrerType:a})})]})}export{Mt as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e}from"./liveblocks-
|
|
1
|
+
import{j as e}from"./liveblocks-DVe3Eena.js";import{h as L,g as F,u as U,i as V,j as y,N as D,l as O,n as Te,o as k}from"./core-cL-h_S3o.js";import{cv as M,fE as v,Yv as B,NK as ae,Nr as q,Ns as ne,Yx as we,NN as Ie,Yt as Ce,Yu as se,YJ as ke,LO as je,Bx as Ae,Yz as be,NU as Ee,Yw as re,dc as Z,G1 as oe,dX as ve,dY as De,_V as Le,_W as Fe,Nt as Ue,_X as Be,Nu as Pe,ND as Re,bq as Ne,bJ as Ve,cG as Oe,bK as Me,cu as _e,bt as ze,Tw as Ge,ct as $e}from"./zeni-epic-state-DMwHYs-L.js";import{V as _,h as Ye,z as E,a8 as z,j as A,d5 as qe,d6 as Ze,d7 as Y,a1 as H,E as He,aq as Ke,as as We,O as ie,y as R,ab as Je,a7 as Xe,d8 as Qe,ae as K,p as et,d9 as tt,a4 as W,da as at,ai as nt,$ as X,db as st,f as rt}from"./index-D4ChxRFU.js";import{D as ot,n as N,S as it}from"./mui-a6BeA4JD.js";import ct from"./NotFoundScreen-BkQQJnCX.js";import{S as Q}from"./SetupPagesScreen-D464KhP2.js";import{a as p}from"./sentry-DqMiDAOv.js";import{u as lt}from"./useAskAiCfoHostNavButtonProps-0oF2VYBt.js";import{u as ut}from"./useInitialThreadRequest-T-M769mk.js";import{M as ce}from"./MobileAppDrawer-BAR65ADr.js";import{F as dt}from"./FeaturePreviewScreen-BhXxEutM.js";import{a as ee}from"./analyticsHelper-Cioa7dQ6.js";import"./recharts-BPDamcen.js";import"./analytics-qutbJJuo.js";import"./plaid-C5X1WR-a.js";import"./dnd-CvWVwn67.js";import"./stripe-cKAAJElX.js";import"./lottie-MSaCuPby.js";import"./lexical-fOKQwNUZ.js";import"./pdf-CurGQkyb.js";import"./utils-jUBXEI4l.js";import"./BusinessVerificationPageScreen-CcoSDt9H.js";import"./routePaths-Dn5fef1Z.js";import"./InboxNotificationsProvider-B8bw_q0G.js";import"./useTaskManagerAccess-BtoWhuis.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]="e512620e-a875-40ca-b6d4-6e7639e84863",t._sentryDebugIdIdentifier="sentry-dbid-e512620e-a875-40ca-b6d4-6e7639e84863")}catch{}})();const pt=O((function(t,a){const{companyId:n}=a;return{treasurySetupView:B(t,n),analytics:A}}),(function(t,a){const{navigate:n,analytics:o,treasurySetupView:i}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const r=i.fundAllocationLocalData;o.trackTreasuryPortfolioConfirm(r.riskScore,ee(r)),t(Ie(!0))},onUpdateFundAllocation:r=>{o.trackTreasuryAllocationAction("update",ee(r)),t(we(r))}}}))(qe);function mt(){const t=L(),a=F(),n=U(),{tenantEmailDomain:o}=V(),i=_(),r=y((I=>I.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState)),m=Ye(r),s=M(i?.loggedInUserRoleMap),[d,c]=p.useState(!1),[S,T]=p.useState(!1),[l,u]=p.useState(!1),x=y((I=>v(I))),f=E.getSignedInUserTenant(o)?.companyId??x.companyId,C=E.getSignedInUser(),h=y((I=>B(I,f))),g=y((I=>I.treasurySetupViewState.fetchState)),j=y((I=>I.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),w=y((I=>I.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||w!=="Not-Started"||f==null||(u(!0),n(q()))}),[l,w,f,n]),p.useEffect((()=>{S||j!=="Not-Started"||f==null||(T(!0),n(ne()))}),[S,j,f,n]),p.useEffect((()=>{m==="In-Progress"&&r==="Completed"&&t("../")}),[m,r,t]),x.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(D,{to:"../promo"});const P=x.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||g!=="Completed";return e.jsxs(e.Fragment,{children:[!P&&e.jsx(z,{analytics:A,onLoad:()=>{}}),e.jsx(pt,{navigate:t,location:a,companyId:f,isEditMode:!0,isLoading:P,isReadOnly:!s,treasurySetupView:h,analytics:A})]})}const ft=O((function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:ke(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:B(t,n)}}),(function(t,a){const{navigate:n,transferDetails:o,treasurySetupView:i}=a,r=o.treasuryTransferMoneyLocalData,m=i.fundAllocationLocalData;return{onCancelClick:()=>{Y(a.analytics,"cancel",r,m,"Transfer"),t(se()),n("../")},onTransferClick:()=>{Y(a.analytics,"confirm",r,m,"Transfer"),t(Ee())},onSaveChangesToLocalStore:s=>{t(be(s))},onFetchLinkTokenClick:s=>{t(Ae("treasury_setup",s))},onEstablishConnectionClick:s=>{t(je(s,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}}))(Ze),yt=({isFirstTransfer:t,isTransactionsLoaded:a})=>{const n=L(),{tenantEmailDomain:o}=V(),i=U(),[r,m]=p.useState(!1),[s,d]=p.useState(!1),[c,S]=p.useState(!1),[T,l]=p.useState(!1),u=y((w=>w.treasurySetupViewState.fetchState)),x=y((w=>w.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),f=y((w=>w.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),C=y((w=>v(w))),h=E.getSignedInUserTenant(o)?.companyId??C.companyId,g=y((w=>Ce(w))),j=y((w=>B(w,h)));if(E.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return p.useEffect((()=>{s||u!=="Not-Started"||h==null||(d(!0),i(ae(h,!0,!1)))}),[s,u,h,i]),p.useEffect((()=>{c||x!=="Not-Started"||h==null||(S(!0),i(q()))}),[c,x,h,i]),p.useEffect((()=>{T||f!=="Not-Started"||h==null||(l(!0),i(ne()))}),[T,f,h,i]),e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:A,onLoad:()=>{}}),e.jsx(ft,{analytics:A,navigate:n,transferDetails:g,onAnotherTransferClick:()=>{m(!1),i(se())},currentTenant:C,treasurySetupView:j,showReviewContent:r,maxInsuredAmount:5e5,onReviewClick:()=>{Y(A,"review",g.treasuryTransferMoneyLocalData,j.fundAllocationLocalData,"Transfer"),m(!0)},isFirstTransfer:t,isTransactionsLoaded:a,setShowReviewContent:m,onBackClick:()=>{}})]})},gt=N.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{j as o}from"./liveblocks-
|
|
1
|
+
import{j as o}from"./liveblocks-DVe3Eena.js";import{a as u}from"./sentry-DqMiDAOv.js";import{h as N,u as $,i as Y,j as f,l as G,g as H,n as Me,o as k,N as L}from"./core-cL-h_S3o.js";import{U_ as gt,U$ as Ze,QO as et,V0 as vt,fE as U,gZ as ge,V1 as Tt,cE as xt,V2 as bt,EZ as yt,V3 as wt,V4 as oe,V5 as te,V6 as ve,Sn as ue,So as Fe,Fd as pe,Sm as he,F0 as tt,Ez as ke,V7 as It,Sp as J,l_ as me,V8 as Pe,Et as Ct,V9 as Dt,Va as Vt,Vb as je,Vc as _e,Vd as Ae,Ve as Re,F7 as Te,Vf as nt,EQ as at,Vg as Et,Vh as Ft,Vi as kt,Vj as Pt,Vk as jt,Vl as _t,Vm as At,Vn as Rt,BJ as Ut,BR as Lt,BK as Bt,Ru as we,Vo as Ot,Vp as Mt,le as Ie,br as Nt,Vq as Gt,Vr as $t,mY as zt,n5 as Yt,Rt as Ce,bE as Ne,Vs as ot,R4 as st,Vt as Jt,Vu as qt,Vv as Kt,n7 as Ht,Vw as Ge,Vx as $e,Vy as ze,Vz as Ye,VA as Qt,n3 as Wt,VB as Xt,n6 as Zt,VC as en,VD as it,RP as rt,mm as tn,VE as nn,VF as De,VG as dt,RN as lt,Hw as an,VH as on,VI as sn,mG as ct,VJ as rn,VK as dn,R$ as ln,uG as cn,VL as ut,VM as Je,RY as Ve,VN as qe,VO as un,S1 as pn,VP as hn,VQ as mn,VR as fn,VS as Sn,VT as gn,uJ as vn,VU as Tn,Sq as xn,TZ as bn,RG as Ee,i9 as yn,T$ as wn,T_ as In,i7 as Cn,VV as Dn,VW as Vn,HB as En,VX as Fn,VY as kn,VZ as Pn,V_ as jn,mq as _n,bn as An,dY as Rn,dX as Un}from"./zeni-epic-state-DMwHYs-L.js";import{E as Ln,a1 as ne,ab as Ue,O as Q,y as M,z as R,a7 as Bn,aM as On,j as P,X as Le,q as xe,av as ee,as as se,aN as Mn,aO as pt,aq as Nn,a8 as Se,aP as Gn,p as K,V as $n,G as ht,aQ as zn,ae as mt,a4 as Yn,h as Ke,aR as Jn,J as q,a9 as qn,af as ft,ag as Kn,aS as Hn,aT as Qn,T as Be,aU as Wn,aV as Xn,a3 as Zn,aW as ea,aX as ta}from"./index-D4ChxRFU.js";import{D as na,n as B,S as St}from"./mui-a6BeA4JD.js";import{t as aa,A as oa}from"./AddressScreen-QJAFiZG_.js";import fe from"./NotFoundScreen-BkQQJnCX.js";import{F as sa}from"./FeaturePreviewScreen-BhXxEutM.js";import{S as ia,a as ra,J as da,b as la,c as ca}from"./ScheduleDetailsPrepaidExpensesScreen-VjNep7ac.js";import{u as ie}from"./useAskAiCfoHostNavButtonProps-0oF2VYBt.js";import{M as re}from"./MobileAppDrawer-BAR65ADr.js";import{v as Oe,c as ua,d as pa}from"./routePaths-Dn5fef1Z.js";import{D as ha}from"./DrawerScreen-J3wIMzJi.js";import{a as ma,m as fa}from"./accountMappingHelper-DiD6kuzS.js";import"./recharts-BPDamcen.js";import"./analytics-qutbJJuo.js";import"./plaid-C5X1WR-a.js";import"./dnd-CvWVwn67.js";import"./stripe-cKAAJElX.js";import"./lottie-MSaCuPby.js";import"./lexical-fOKQwNUZ.js";import"./pdf-CurGQkyb.js";import"./utils-jUBXEI4l.js";import"./pathToGoBack-g9S0YvmK.js";import"./InboxNotificationsProvider-B8bw_q0G.js";import"./useTaskManagerAccess-BtoWhuis.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]="bee374f2-799d-410e-9150-174e2a979903",e._sentryDebugIdIdentifier="sentry-dbid-bee374f2-799d-410e-9150-174e2a979903")}catch{}})();const Sa={drawerLeftMargin:new Ue(0,0,100,200)},ga=G((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:P,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"})}}}))(On),va=()=>{const e=Ln(),a=N(),s=$(),{scheduleDetailId:t}=Y(),n=ne(),i=Sa.drawerLeftMargin.valuePx(n),{scheduleType:l}=Y(),{useFeatureGate:p}=Q(),{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(Bn,{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=H(),a=$(),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},W="accrued_expenses",xa=G((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:W,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(Ae({scheduleType:W,subTab:t}))},onSearchTextChanged:t=>{e(_e({scheduleType:W,searchText:t}))},onReloadReport:()=>{e(tt(W))},onScroll:t=>{e(je({scheduleType:W,scrollYOffset:t}))},onClickNewButton:()=>{e(Dt()),e(Vt()),P.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(Pe({scheduleType:W,fetchState:t}))}}}))(Mn),ba=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const[t,n]=u.useState(!1),[i,l]=u.useState(!1),p=N(),h=$(),{useFeatureGate:v}=Q(),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))),V=f((S=>Fe(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&&V==="Completed"&&h(tt("accrued_expenses",{selectedTimeframe:ke("accrued_expenses"),selectedCategoryId:"all"},!0))}),[t,V]);const j=f((S=>It(S,W))),{isAiCfoAccessEnabled:O,onAskAiCfoClick:E}=ie({mobileExploreReferrer:"Vendors — Accrued Expenses"});se({isDataReady:j.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 F=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:j,downloadParams:g,themeState:m,vendorTabsToShow:e,analytics:P,controllerUserDetails:F,isAiCfoAccessEnabled:O,onAskAiCfoClick:E,onClickMenuIcon:()=>z(!0)})]})},
|
|
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=H(),a=$(),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},W="accrued_expenses",xa=G((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:W,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(Ae({scheduleType:W,subTab:t}))},onSearchTextChanged:t=>{e(_e({scheduleType:W,searchText:t}))},onReloadReport:()=>{e(tt(W))},onScroll:t=>{e(je({scheduleType:W,scrollYOffset:t}))},onClickNewButton:()=>{e(Dt()),e(Vt()),P.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(Pe({scheduleType:W,fetchState:t}))}}}))(Mn),ba=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const[t,n]=u.useState(!1),[i,l]=u.useState(!1),p=N(),h=$(),{useFeatureGate:v}=Q(),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))),V=f((S=>Fe(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&&V==="Completed"&&h(tt("accrued_expenses",{selectedTimeframe:ke("accrued_expenses"),selectedCategoryId:"all"},!0))}),[t,V]);const j=f((S=>It(S,W))),{isAiCfoAccessEnabled:O,onAskAiCfoClick:E}=ie({mobileExploreReferrer:"Vendors — Accrued Expenses"});se({isDataReady:j.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 F=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:j,downloadParams:g,themeState:m,vendorTabsToShow:e,analytics:P,controllerUserDetails:F,isAiCfoAccessEnabled:O,onAskAiCfoClick:E,onClickMenuIcon:()=>z(!0)})]})},X="fixed_assets",ya=G((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(_e({scheduleType:X,searchText:t}))},onReloadReport:()=>{e(Te(X))},onScroll:t=>{e(je({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(Pe({scheduleType:X,fetchState:t}))}}}))(pt),wa=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const[t,n]=u.useState(!1),i=N(),l=$();ce();const{useFeatureGate:p}=Q(),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=>Fe(S,"fixed_assets"))),I=e.includes("prepaid_expenses"),V=e.includes("fixed_assets"),C=e.includes("accrued_expenses");u.useEffect((()=>{(I||V||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,V,m,v]),u.useEffect((()=>{t===!1&&b==="Completed"&&l(Te("fixed_assets",{selectedTimeframe:ke("fixed_assets"),selectedCategoryId:"all"},!0))}),[t,b]);const w=f((S=>nt(S,X))),{isAiCfoAccessEnabled:A,onAskAiCfoClick:j}=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"),V||i("../opex");const E=f((S=>ge(S,d.companyId))),[D,F]=u.useState(!1),z=S=>{F(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:P,controllerUserDetails:E,isAiCfoAccessEnabled:A,onAskAiCfoClick:j,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-B0EpRifM.js";import{a as u}from"./sentry-BefEASz
|
|
|
10
10
|
flex-direction: column;
|
|
11
11
|
align-items: center;
|
|
12
12
|
background-color: ${e=>e.theme.colors.grey4};
|
|
13
|
-
`,Ca=G((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=Et(e);return{report:p,uiState:h,isAccountingClassesEnabled:me(e),analytics:P,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=K(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(_t({sortkey:n,sortOrder:t,timeframe:i}))},onVendorTabSelectionChanged:t=>{const n=de(t);s(n),e(te(le(t)))},onSortOrSearchStarted:t=>{e(jt(t))},onPageFetchStarted:()=>{e(Pt(!0))},updateDownloadStateHandler:t=>{e(kt(t))},onClearSearch:t=>{e(Ft({timeframe:t}))}}}))(Gn);function Da({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const t=N(),n=$(),i=H(),{tenantEmailDomain:l}=Y(),p=ne(),h=R.getSignedInUser(),{useFeatureGate:v}=Q(),{isFeatureEnabled:m,isFeatureGateLoading:r}=v(M.isOpexByVendorFeatureEnabled),d=f((E=>J(E)));if(h==null)throw Error("Can't access opex by vendor page without signing in...");ce();const[c,T]=u.useState(!1),x=f((E=>ue(E))),g=e.includes("prepaid_expenses"),y=e.includes("fixed_assets"),b=e.includes("accrued_expenses"),I=f((E=>oe(E))),{isAiCfoAccessEnabled:V,onAskAiCfoClick:C}=ie({mobileExploreReferrer:"Vendors — Operating Expenses by Vendor"});se({isDataReady:d.fetchState==="Completed"&&d.isReportGenerated===!0});const{areTenantIdsInSync:w}=Nn();u.useEffect((()=>{(g||y||b)&&c===!1&&x!=="Completed"&&w&&(n(pe()),T(!0))}),[c,w]),u.useEffect((()=>{w&&n(he({shouldFetchAccruedExpenses:b,shouldFetchFixedAssets:y,shouldFetchPrepaidExpenses:g,shouldFetchOpexByVendor:m===!0&&r===!1,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,j]=u.useState(!1),O=E=>{j(E)};return o.jsxs(Ia,{windowSize:p,children:[d.fetchState==="Completed"?o.jsx(Se,{analytics:P,onLoad:E=>{I.previousTab==null?E.trackVendorOperatingExpensesPageLoaded("Side Panel"):E.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:V,onAskAiCfoClick:C,onClickMenuIcon:()=>{O(!0)}})]})}const
|
|
13
|
+
`,Ca=G((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=Et(e);return{report:p,uiState:h,isAccountingClassesEnabled:me(e),analytics:P,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=K(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(_t({sortkey:n,sortOrder:t,timeframe:i}))},onVendorTabSelectionChanged:t=>{const n=de(t);s(n),e(te(le(t)))},onSortOrSearchStarted:t=>{e(jt(t))},onPageFetchStarted:()=>{e(Pt(!0))},updateDownloadStateHandler:t=>{e(kt(t))},onClearSearch:t=>{e(Ft({timeframe:t}))}}}))(Gn);function Da({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const t=N(),n=$(),i=H(),{tenantEmailDomain:l}=Y(),p=ne(),h=R.getSignedInUser(),{useFeatureGate:v}=Q(),{isFeatureEnabled:m,isFeatureGateLoading:r}=v(M.isOpexByVendorFeatureEnabled),d=f((E=>J(E)));if(h==null)throw Error("Can't access opex by vendor page without signing in...");ce();const[c,T]=u.useState(!1),x=f((E=>ue(E))),g=e.includes("prepaid_expenses"),y=e.includes("fixed_assets"),b=e.includes("accrued_expenses"),I=f((E=>oe(E))),{isAiCfoAccessEnabled:V,onAskAiCfoClick:C}=ie({mobileExploreReferrer:"Vendors — Operating Expenses by Vendor"});se({isDataReady:d.fetchState==="Completed"&&d.isReportGenerated===!0});const{areTenantIdsInSync:w}=Nn();u.useEffect((()=>{(g||y||b)&&c===!1&&x!=="Completed"&&w&&(n(pe()),T(!0))}),[c,w]),u.useEffect((()=>{w&&n(he({shouldFetchAccruedExpenses:b,shouldFetchFixedAssets:y,shouldFetchPrepaidExpenses:g,shouldFetchOpexByVendor:m===!0&&r===!1,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,j]=u.useState(!1),O=E=>{j(E)};return o.jsxs(Ia,{windowSize:p,children:[d.fetchState==="Completed"?o.jsx(Se,{analytics:P,onLoad:E=>{I.previousTab==null?E.trackVendorOperatingExpensesPageLoaded("Side Panel"):E.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:V,onAskAiCfoClick:C,onClickMenuIcon:()=>{O(!0)}})]})}const Z="prepaid_expenses",Va=G((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(_e({scheduleType:Z,searchText:t}))},onReloadReport:()=>{e(Te(Z))},onScroll:t=>{e(je({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(Pe({scheduleType:Z,fetchState:t}))}}}))(pt),Ea=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const[t,n]=u.useState(!1),i=N(),l=$(),{useFeatureGate:p}=Q(),h=xe();ce();const v=R.getSignedInUser(),{isFeatureEnabled:m,isFeatureGateLoading:r}=p(M.isOpexByVendorFeatureEnabled),d=f((S=>U(S))),c=f((S=>Fe(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"),V=e.includes("fixed_assets"),C=e.includes("accrued_expenses");u.useEffect((()=>{(I||V||C)&&g===!1&&b!=="Completed"&&(l(pe()),y(!0))}),[g]),u.useEffect((()=>{t===!1&&c==="Completed"&&l(Te("prepaid_expenses",{selectedTimeframe:ke("prepaid_expenses"),selectedCategoryId:"all"},!0))}),[t,c]),u.useEffect((()=>{r===!1&&(l(he({shouldFetchAccruedExpenses:C,shouldFetchFixedAssets:V,shouldFetchPrepaidExpenses:!0,shouldFetchOpexByVendor:m,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),n(!0))}),[b,V,r,m]);const w=f((S=>nt(S,Z))),{isAiCfoAccessEnabled:A,onAskAiCfoClick:j}=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 E=f((S=>ge(S,d.companyId))),[D,F]=u.useState(!1),z=S=>{F(S)};return o.jsxs(o.Fragment,{children:[o.jsx(re,{isAppContentDrawerOpen:D,handleDrawerToggle:z}),o.jsx(Va,{navigate:i,previousTabPosition:a,setPreviousTabPosition:s,scheduleListReport:w,downloadParams:x,themeState:h,vendorTabsToShow:e,analytics:P,controllerUserDetails:E,isAiCfoAccessEnabled:A,onAskAiCfoClick:j,onClickMenuIcon:()=>{z(!0)}})]})},Fa=B.div`
|
|
14
14
|
display: flex;
|
|
15
15
|
min-height: 100%;
|
|
16
16
|
width: 100%;
|
|
@@ -18,7 +18,7 @@ import{j as o}from"./liveblocks-B0EpRifM.js";import{a as u}from"./sentry-BefEASz
|
|
|
18
18
|
flex-direction: column;
|
|
19
19
|
align-items: center;
|
|
20
20
|
background-color: ${e=>e.theme.colors.grey4};
|
|
21
|
-
`,ka=G((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=Yn(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:V,isRecommendedCategorySelected:C,isRecommendedClassSelected:w,categoryRecommendationTypeSelected:A,classRecommendationTypeSelected:j}=en(r,d);c!=null&&P.trackVendorDetailsSave(c,T??"",x,g,y,b,I,V,C,w,A,j)})(t?.vendorViewDetails,t?.vendorViewDetails.ownerList),n!=null&&e(
|
|
21
|
+
`,ka=G((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=Yn(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:V,isRecommendedCategorySelected:C,isRecommendedClassSelected:w,categoryRecommendationTypeSelected:A,classRecommendationTypeSelected:j}=en(r,d);c!=null&&P.trackVendorDetailsSave(c,T??"",x,g,y,b,I,V,C,w,A,j)})(t?.vendorViewDetails,t?.vendorViewDetails.ownerList),n!=null&&e(Zt(n,void 0))},onVendorSpendTrendFilterTabClick:r=>{e(Xt(r))},saveVendorDetailLocalData:r=>{n!=null&&e(Wt({vendorId:n,localData:r}))},saveContactsInVendorTabDetailLocalData:(r,d)=>{e(Qt({vendorId:r,localData:{contacts:d}}))},onCancelClick:()=>{var r;t?.vendorViewDetails.vendorView?.vendorBasic!=null&&(r=t.vendorViewDetails.vendorView.vendorBasic).id!=null&&P.trackVendorDetailsCancel(r.id??"",r.name,r.account?.accountName,r.class?.className,r.owner?.email),e(Ge()),e($e()),e(ze()),e(Ye()),m()},handleSpendTrendPercentChangeClick:()=>{var r;t?.vendorViewDetails.vendorView?.vendorBasic!=null&&(r=t.vendorViewDetails.vendorView?.vendorBasic,r.id!=null&&P.trackVendorDetailsSpendTrendHotlinkClicked(r.id??"",r.name,r.account?.accountName,r.class?.className,r.owner?.email))},onSaveSuccess:()=>{n!=null&&e(Ht("Not-Started",n)),e(Ge()),e($e()),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(Kt(r))},onAddressClick:(r,d)=>{if(p==null)return;const c=pa(p,r,d),T=K(h.state?.pathnameStackToGoBack,h.pathname);s(c,{state:{pathnameStackToGoBack:T}})},onVendorDetailUIChange:r=>{e(qt({collapsableStatus:r}))},onTransactionItemClick:r=>{const d=`${ua(r,p)}`,c=K(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))}}}))(zn);function He({referrerType:e,isFiling1099FeatureEnabled:a}){const s=$(),t=H(),n=N(),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 V=ne(),C=f((_=>U(_))),w=f((_=>c!=null?Ot(_,c,I):void 0)),A=f((_=>_.vendorState.vendorByID[c??""])),j=f((_=>U(_).company?.companyInfo.firstMonthOfFY??1)),O=f((()=>Mt(j,2))),E=Ie({startDate:O.startDate,endDate:Nt()}),D=Gt(j),F=f((_=>$t(_.trendWithTransactionsState,I,"EntityDetail"))),[z,S]=u.useState(!1),be=l===!1&&m===!1?void 0:F?.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&&((_,ae,ye)=>{_.id!=null&&P.trackVendorDetails(_.id,_.name,ye,_.account?.accountName,_.class?.className,_.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:F?.selectedPeriod?.timeframe??"quarter",timePeriod:be},j)),S(!0));const _=ht.getLocalizedStrings().dateFormat.analytics;if(l===!0&&g!=null&&y!=null&&b!=null){S(!0);const ae=g,ye={startDate:Ne(y,_.YYYYDashMMDashDDFormat),endDate:Ne(b,_.YYYYDashMMDashDDFormat)};s(Ce(I,"EntityDetail",{timeframe:ae,timePeriod:ye}))}}}),[w?.fetchState,be,F?.selectedPeriod?.timeframe,l,j]),u.useEffect((()=>{w?.fetchState==="Completed"&&h===!1&&(s(ot({timePeriod:E,numberOfQuartersFetched:3})),s(st(I,w.allTransactionsTabData?.timePeriod??E,!1,!0)),v(!0))}),[w?.fetchState,h]),c==null?o.jsx(fe,{}):o.jsx(Fa,{windowSize:V,children:o.jsx(ka,{location:t,navigate:n,isFiling1099FeatureEnabled:a,vendorDetailView:w,vendorId:c,currentTenant:C,selectedVendor:A,firstMonthOfFY:j,isTrendPeriodSelected:l,selectedPeriodTimePeriod:F?.selectedPeriod?.timePeriod,defaultTransactionTimePeriod:D,vendorEntity:I,currentUserRoleMap:i?.loggedInUserRoleMap,tenantEmailDomain:x})})}const Pa=ht.getLocalizedStrings().spendManagement.billPay.vendorCreation.vendorDetails,ja={containerWidth:new Ue(100,58)},_a=B(qn)`
|
|
22
22
|
width: ${q.sp4};
|
|
23
23
|
height: ${q.sp4};
|
|
24
24
|
cursor: pointer;
|
|
@@ -69,7 +69,7 @@ import{j as o}from"./liveblocks-B0EpRifM.js";import{a as u}from"./sentry-BefEASz
|
|
|
69
69
|
display: flex;
|
|
70
70
|
min-height: 100%;
|
|
71
71
|
flex-direction: column;
|
|
72
|
-
`,Ka=G((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:P,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)),P.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=K(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=K(n.state?.pathnameStackToGoBack,n.pathname);t(v,{state:{pathnameStackToGoBack:m}})},AddressFormPage:
|
|
72
|
+
`,Ka=G((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:P,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)),P.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=K(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=K(n.state?.pathnameStackToGoBack,n.pathname);t(v,{state:{pathnameStackToGoBack:m}})},AddressFormPage:Zn}}))(Xn);function Ha(){const e=N(),a=H(),{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(Ka,{location:a,navigate:e,currentTenant:t,vendorId:s,vendorFiling1099UploadDetails:n,companyId:l})}const Qa=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-B0EpRifM.js";import{a as u}from"./sentry-BefEASz
|
|
|
77
77
|
flex-direction: column;
|
|
78
78
|
align-items: center;
|
|
79
79
|
background-color: ${e=>e.theme.colors.grey4};
|
|
80
|
-
`,Wa=G((function(e,a){const{vendorsFiling1099ListDetails:s,accountMappingView:t,analytics:n}=a;return{analytics:n,vendorsFiling1099List:s.vendors,isVendor1099Populated:s.isVendor1099Populated,accountMappingView:t,fetchState:s.fetchState,uiState:s.uiState,lastRefreshSuccessTime:s.lastRefreshSuccessTime,vendorTabsToShow:a.vendorTabsToShow}}),(function(e,a){const{navigate:s,analytics:t}=a;return{onUpdateSortUiState:(n,i)=>{e(Vn({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=K(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:l}})}},onReloadVendors:()=>{e(Ee(!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)}}}))(ea);function
|
|
80
|
+
`,Wa=G((function(e,a){const{vendorsFiling1099ListDetails:s,accountMappingView:t,analytics:n}=a;return{analytics:n,vendorsFiling1099List:s.vendors,isVendor1099Populated:s.isVendor1099Populated,accountMappingView:t,fetchState:s.fetchState,uiState:s.uiState,lastRefreshSuccessTime:s.lastRefreshSuccessTime,vendorTabsToShow:a.vendorTabsToShow}}),(function(e,a){const{navigate:s,analytics:t}=a;return{onUpdateSortUiState:(n,i)=>{e(Vn({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=K(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:l}})}},onReloadVendors:()=>{e(Ee(!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)}}}))(ea);function Xe({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const t=N(),n=$(),i=H(),{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(Ee(!1)))}),[r,d]),u.useEffect((()=>{T.saveState.fetchState==="Completed"&&n(Ee(!1))}),[T.saveState.fetchState]);const y=C=>{m(C)},b=f((C=>U(C))),I={userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:b.tenantId},V=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:P,onLoad:()=>P.trackPageLoaded(Be.Event.vendor1099ListPage)})}):null,o.jsxs(Qa,{windowSize:p,children:[o.jsx(re,{isAppContentDrawerOpen:v,handleDrawerToggle:y}),o.jsx(Wa,{location:i,navigate:t,previousTabPosition:a,setPreviousTabPosition:s,analytics:P,vendorsFiling1099ListDetails:c,vendorTypeList:c.vendorTypeList,accountMappingView:T,downloadParams:V,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-B0EpRifM.js";import{a as u}from"./sentry-BefEASz
|
|
|
85
85
|
flex-direction: column;
|
|
86
86
|
align-items: center;
|
|
87
87
|
background-color: ${e=>e.theme.colors.grey4};
|
|
88
|
-
`,
|
|
88
|
+
`,Za=G((function(e,a){const{vendorsListDetails:s}=a;return{vendorsList:s.vendors,totalVendorCount:s.totalVendorCount,fetchState:s.fetchState,uiState:s.uiState,searchText:s.searchString,lastRefreshSuccessTime:s.lastRefreshSuccessTime,vendorTabsToShow:a.vendorTabsToShow,isAccountingClassesEnabled:me(e),analytics:P}}),(function(e,a){const{navigate:s}=a;return{onFetchVendorsList:(t="",n,i)=>{e(_n({searchString:t,keepExistingListItems:n,view:"vendorsTab",pageToken:i}))},onUpdatePageToken:t=>{e(jn({pageToken:t}))},onUpdateSortUiState:(t,n)=>{e(Pn({sortOrder:t,sortkey:n}))},onUpdateCurrentYTDSelection:t=>{e(kn({ytdSpendSelection:t}))},onVendorRowClick:(t,n)=>{if(a.tenantEmailDomain!=null){const i=Oe(t,n,a.tenantEmailDomain),l=K(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:l,referrer:"Vendor List"}})}},onReloadVendors:()=>{console.log("Reload vendors")},onUpdateScrollYOffset:t=>{e(Fn({scrollYOffset:t}))},onBackClick:()=>{s("../..")},onVendorTabSelectionChanged:t=>{const n=de(t);s(n),e(te(le(t)))}}}))(ta);function eo({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const t=N(),n=$(),i=H(),{tenantEmailDomain:l}=Y(),p=ne(),h=R.getSignedInUser(),{useFeatureGate:v}=Q(),{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((F=>oe(F)));let g={};g=f((F=>En(F,"vendorsTab")));const[y,b]=u.useState(!1),{isAiCfoAccessEnabled:I,onAskAiCfoClick:V}=ie({mobileExploreReferrer:"Vendors Summary"});se({isDataReady:g.fetchState==="Completed"});const C=f((F=>ue(F))),w=f((F=>J(F).isReportGenerated));f((F=>J(F).fetchState))==="Completed"&&w&&m&&!e.includes("operating_expenses_by_vendor")&&e.splice(1,0,"operating_expenses_by_vendor");const[A,j]=u.useState(!1);if(u.useEffect((()=>{(d||c)&&A===!1&&C!=="Completed"&&(n(pe()),j(!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),P.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,E]=u.useState(!1),D=F=>{E(F)};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:V})]})}function Fo(){const{useFeatureGate:e}=Q(),a=H().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((V=>U(V))),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(k,{path:"/*",element:o.jsx(sa,{})})}):o.jsxs(Me,{children:[o.jsx(k,{path:"/opex",element:h===!0?o.jsx(Da,{previousTabPosition:n,setPreviousTabPosition:i,vendorTabsToShow:g}):o.jsx(L,{to:"../summary"})}),o.jsx(k,{path:"/summary",element:o.jsx(eo,{previousTabPosition:n,setPreviousTabPosition:i,vendorTabsToShow:g})}),o.jsx(k,{path:"schedules/fixed_assets/details/:scheduleDetailId",element:r===!0?o.jsx(ia,{}):o.jsx(L,{to:"../../vendors/opex"})}),o.jsx(k,{path:"schedules/accrued_expenses/details/:scheduleDetailId",element:r===!0?o.jsx(ra,{shouldNavigateBack:s,setShouldNavigateBack:t}):o.jsx(L,{to:"../../vendors/opex"})}),o.jsx(k,{path:"schedules/one_time_accrual/details/:accrualId",element:d===!0?o.jsx(da,{}):o.jsx(L,{to:"../../vendors/opex"})}),o.jsx(k,{path:"schedules/:scheduleType/details/:scheduleDetailId",element:m===!0?o.jsx(la,{}):o.jsx(L,{to:"../../vendors/opex"})}),o.jsx(k,{path:"schedules/:scheduleType/details/:scheduleDetailId/edit_link",element:m===!0||r===!0?o.jsx(va,{}):o.jsx(L,{to:"../../vendors/opex"})}),o.jsx(k,{path:"schedules/accrued_expenses/details/:scheduleDetailId/edit_link",element:d===!0?o.jsx(ca,{setShouldNavigateBack:t}):o.jsx(L,{to:"../../vendors/opex"})}),o.jsx(k,{path:"schedules/prepaid_expenses",element:m===!0?o.jsx(Ea,{previousTabPosition:n,setPreviousTabPosition:i,vendorTabsToShow:g}):o.jsx(L,{to:"../opex"})}),o.jsx(k,{path:"schedules/fixed_assets",element:r===!0?o.jsx(wa,{previousTabPosition:n,setPreviousTabPosition:i,vendorTabsToShow:g}):o.jsx(L,{to:"../opex"})}),o.jsx(k,{path:"schedules/accrued_expenses",element:d===!0?o.jsx(ba,{previousTabPosition:n,setPreviousTabPosition:i,vendorTabsToShow:g}):o.jsx(L,{to:"../opex"})}),o.jsx(k,{path:"/filing_1099",element:c&&p?o.jsx(Xe,{previousTabPosition:n,setPreviousTabPosition:i,vendorTabsToShow:g}):o.jsx(L,{to:"../opex"})}),o.jsx(k,{path:"/filing_1099/:vendorId",element:c&&p?o.jsx(Xe,{vendorTabsToShow:g,previousTabPosition:n,setPreviousTabPosition:i}):o.jsx(L,{to:"../opex"})}),o.jsx(k,{path:"/filing_1099/upload/:vendorId/edit",element:c&&p?o.jsx(Qe,{appContent:o.jsx(Ha,{}),showFullScreenSkeletonWhileLoading:!0}):o.jsx(L,{to:"../opex"})}),o.jsx(k,{path:"/filing_1099/upload/:vendorId/edit/new/:addressType",element:c&&p?o.jsx(Qe,{appContent:o.jsx(oa,{isSubPage:!0,hideAddressBackButton:!0,hideAddressSubTitle:!0})}):o.jsx(L,{to:"../opex"})}),o.jsx(k,{path:"/summary/:vendorId/:qboId",element:o.jsx(He,{referrerType:a,isFiling1099FeatureEnabled:c&&p})}),o.jsx(k,{path:"/summary/:vendorId/:qboId/:timeframe/:startDate/:endDate",element:o.jsx(He,{referrerType:a,isFiling1099FeatureEnabled:c&&p})}),o.jsx(k,{path:"/review",element:v===!0?o.jsx(We,{}):o.jsx(fe,{})}),o.jsx(k,{path:"/review/vendor/:vendorId",element:v?o.jsx(We,{}):o.jsx(fe,{})}),o.jsx(k,{path:"/",element:o.jsx(L,{to:"summary"})}),o.jsx(k,{path:"*",element:o.jsx(fe,{})})]})}export{Fo as default};
|
package/dist/assets/{WiseConfirmationScreen-Un25bELv.js → WiseConfirmationScreen-D3NoMVAj.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as o}from"./liveblocks-
|
|
1
|
+
import{j as o}from"./liveblocks-DVe3Eena.js";import{a as f}from"./sentry-DqMiDAOv.js";import{t as u,u as h,j as y,N as I}from"./core-cL-h_S3o.js";import{TO as b,gh as w,IR as j}from"./zeni-epic-state-DMwHYs-L.js";import{z as l,a7 as x,af as S,ag as D}from"./index-D4ChxRFU.js";import{n as c}from"./mui-a6BeA4JD.js";import"./recharts-BPDamcen.js";import"./analytics-qutbJJuo.js";import"./plaid-C5X1WR-a.js";import"./dnd-CvWVwn67.js";import"./stripe-cKAAJElX.js";import"./lottie-MSaCuPby.js";import"./lexical-fOKQwNUZ.js";import"./pdf-CurGQkyb.js";import"./utils-jUBXEI4l.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]="41614c2c-2140-4e43-8f7e-1fe006b206d2",e._sentryDebugIdIdentifier="sentry-dbid-41614c2c-2140-4e43-8f7e-1fe006b206d2")}catch{}})();const B=()=>{const[e]=u(),t=e.get("code")??"",s=e.get("state")??"",g=e.get("profileId")??"",[n,p]=f.useState(!1),a=h(),i=y((m=>b(m))),r=l.getSignedInUser(),d=l.getSignedInUserTenantWithId(s);if(r==null||d==null)return o.jsx(I,{to:"/signin/auth",replace:!0});if(r==null)throw Error("Can't access this page without signing in...");return w(r.userId,r.zeniSessionId,d?.tenantId),f.useEffect((()=>{n||(p(!0),a(j(t,g,s)))}),[n,a]),i.fetchState==="Error"?o.jsx(E,{children:o.jsx(T,{children:i.error?.message??""})}):(i.fetchState==="Completed"&&window.close(),o.jsx(x,{fetchState:"In-Progress"}))},E=c.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
width: 100%;
|
|
4
4
|
height: 100vh;
|