@zeniai/web-app-ui 5.3.96-dev → 5.3.97-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-BEj2Jzjh.js → AccountMappingScreen-pMoXS6Rn.js} +2 -2
- package/dist/assets/{ActualMatchingMatchDetailScreen-BhGe8oi6.js → ActualMatchingMatchDetailScreen-2j1MK1Cs.js} +1 -1
- package/dist/assets/AddressRoutes-tA_EPTQS.js +1 -0
- package/dist/assets/AddressScreen-YJZ3XLLs.js +9 -0
- package/dist/assets/{AiCfoScreen-T9wsddnc.js → AiCfoScreen-F0FnLHcN.js} +1 -1
- package/dist/assets/{AppDrawer-BO5m3PED.js → AppDrawer-DSRQq0gS.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-B8F3GVxs.js → BillPayApprovalRoutes-Bruhx8rE.js} +1 -1
- package/dist/assets/{BillPayRoutes-DcSqsOgQ.js → BillPayRoutes-DUQj1hx4.js} +24 -24
- package/dist/assets/{BusinessVerificationPageScreen-JarRxoSX.js → BusinessVerificationPageScreen-BiU68eTf.js} +2 -2
- package/dist/assets/{CardsAiCfoScreen-Cdz5Oqoj.js → CardsAiCfoScreen-CUaeuUnr.js} +1 -1
- package/dist/assets/{ChargeCardRoutes-fZYBlxkt.js → ChargeCardRoutes-ynRPxHBZ.js} +9 -9
- package/dist/assets/CompanyPassportScreen-BYufSIKe.js +1 -0
- package/dist/assets/ConnectionAuthScreen-DiTiPNDX.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-C5aUZCcK.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-D5GZ0VVR.js → CustomerOnboardingRoutes-CrsZJCTy.js} +3 -3
- package/dist/assets/DashboardRoutes-BRTIyx5r.js +20 -0
- package/dist/assets/{DefaultTenantHome-BcGsaBpe.js → DefaultTenantHome-BO7x19ip.js} +1 -1
- package/dist/assets/DomesticWireDetailScreen-KjWlwIBh.js +18 -0
- package/dist/assets/{DrawerScreen-37FDqOIx.js → DrawerScreen-DkAXkoMI.js} +1 -1
- package/dist/assets/EntityDetailRoutes-BzhW6WY7.js +1 -0
- package/dist/assets/{ExpenseAutomationRoutes-CxhAtnDQ.js → ExpenseAutomationRoutes-ZXNq7Qec.js} +4 -4
- package/dist/assets/FeaturePreviewScreen-BvZfqhwT.js +1 -0
- package/dist/assets/HubSpotOAuthCallbackScreen-DkrBLbDB.js +1 -0
- package/dist/assets/{InboxNotificationsProvider-C3xMqTmq.js → InboxNotificationsProvider-DbPSBd88.js} +1 -1
- package/dist/assets/{InvoicingRoutes-B-1POvyE.js → InvoicingRoutes-CuULXbYn.js} +2 -2
- package/dist/assets/{MagicLinkRoutes-PBem0q8b.js → MagicLinkRoutes-D2nRpQw1.js} +22 -22
- package/dist/assets/MagicLinkSignInScreen-2Zd1Nril.js +12 -0
- package/dist/assets/{MobileAppDrawer-DfWAieCr.js → MobileAppDrawer-oi_jxOPF.js} +1 -1
- package/dist/assets/NotFoundScreen-CFVOeV9b.js +1 -0
- package/dist/assets/{NotificationRoutes-DvSviwho.js → NotificationRoutes-DUQWlfCi.js} +1 -1
- package/dist/assets/OAuthConsentScreen-XOLntP64.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-D9xLpCAH.js +1 -0
- package/dist/assets/{PaymentLinkScreen-JV3evKRP.js → PaymentLinkScreen-DEK-zZGM.js} +5 -5
- package/dist/assets/PeopleRoutes-lW9xpnrb.js +22 -0
- package/dist/assets/PerformanceRoutes-C5ibwB0q.js +1 -0
- package/dist/assets/{Preview-DwgMDfYC.js → Preview-DBGhtaN7.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-D6uUWSjU.js → QBOConnectionScreen-DyZbiZk7.js} +1 -1
- package/dist/assets/ReimbursementApprovalRoutes-CUiLb34T.js +1 -0
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-meuFzn-o.js → ReimbursementApprovalRuleDetailScreen-WV0VKJY8.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-z4gQLteF.js → ReimbursementRoutes-CiCUWAKg.js} +9 -9
- package/dist/assets/{ReportsRoutes-S7M6Uyzv.js → ReportsRoutes-CXYlRE3O.js} +1 -1
- package/dist/assets/RewardsRoutes-gBJ6pm3X.js +1 -0
- package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-ByJabNd7.js → ScheduleDetailsPrepaidExpensesScreen-C-oJpxCF.js} +5 -5
- package/dist/assets/{ScreenRoutes-DxeRaGXX.js → ScreenRoutes-czg4LVOl.js} +2 -2
- package/dist/assets/{SettingsRoutes-BRlBwm37.js → SettingsRoutes-Brh5uqPV.js} +6 -6
- package/dist/assets/{SetupPagesScreen-D3fdAxOs.js → SetupPagesScreen-DAeMUdyW.js} +5 -5
- package/dist/assets/SignInScreen-DNDACP8F.js +1 -0
- package/dist/assets/SignOutScreen-Bdz6Ft6M.js +9 -0
- package/dist/assets/{TaskListScreen-BcmmmrTo.js → TaskListScreen-DgIXYUys.js} +2 -2
- package/dist/assets/TaskRoutes-B5nKYrwF.js +9 -0
- package/dist/assets/TransactionDetailRoutes-CWTTa-gP.js +1 -0
- package/dist/assets/{TransactionDetailScreen-Dpzd-yXF.js → TransactionDetailScreen-B_dUf7sV.js} +2 -2
- package/dist/assets/{TransactionListRoutes-Bu7PI8Rl.js → TransactionListRoutes-w-YEtt6F.js} +1 -1
- package/dist/assets/{TreasuryRoutes-D6tE6770.js → TreasuryRoutes-bD3OIF4R.js} +5 -5
- package/dist/assets/{VendorsRoutes-D_WhDWVM.js → VendorsRoutes-DTZh86cd.js} +18 -18
- package/dist/assets/WiseConfirmationScreen-DC5m1P5X.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-CtYkEuA8.js → ZeniAccountRoutes-Cp_GiZAn.js} +9 -9
- package/dist/assets/ZeniAccountStatementScreen-9zE8sMnF.js +9 -0
- package/dist/assets/{accountMappingHelper-BIdzFaKc.js → accountMappingHelper-BI6zMiQn.js} +1 -1
- package/dist/assets/{analytics-BreoHt0J.js → analytics-d11__KPJ.js} +1 -1
- package/dist/assets/{analyticsHelper-DbQsERTh.js → analyticsHelper-BWXp54-h.js} +1 -1
- package/dist/assets/{core-CSm69gJV.js → core-DN52-78R.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-DD9Neunj.js → decodeURIComponentSafe-B3iHpNbe.js} +1 -1
- package/dist/assets/{dnd-BvLWSTOT.js → dnd-DmRCPujN.js} +1 -1
- package/dist/assets/{empty-BPKm1KLs.js → empty-FXto4em_.js} +1 -1
- package/dist/assets/{empty-D-Gn9Jdo.js → empty-_U_x9V4F.js} +1 -1
- package/dist/assets/{emptyVideoElement-LUxShx9x.js → emptyVideoElement-CqNU05fB.js} +1 -1
- package/dist/assets/epic-o7-NdXGE.js +2 -0
- package/dist/assets/expenseAutomationHelper-BEXB3_j0.js +1 -0
- package/dist/assets/getLocaleForTenant-C4ctFsVy.js +1 -0
- package/dist/assets/{index-B-RYxEU1.js → index-BcXg2TkN.js} +1 -1
- package/dist/assets/{index-C6_y02Df.js → index-CItQR0iB.js} +2 -2
- package/dist/assets/{index-Di0x3KLC.js → index-CcTOsN6n.js} +12970 -12970
- package/dist/assets/{index-mW6D32De.js → index-Dc7Kl8xP.js} +1 -1
- package/dist/assets/{index-Bx0cVQTh.js → index-GfEl-Dfx.js} +1 -1
- package/dist/assets/{index-DfmKliEE.js → index-GhKP-ylz.js} +1 -1
- package/dist/assets/{index-t_yPrnJX.js → index-OGT-__nJ.js} +1 -1
- package/dist/assets/{index-CSw2zedd.js → index-eTMT6pHH.js} +1 -1
- package/dist/assets/{lexical-CC3pmboN.js → lexical-LEeCUpN7.js} +1 -1
- package/dist/assets/{liveblocks-Css5YxVy.js → liveblocks-9GmpXxpV.js} +1 -1
- package/dist/assets/{lottie-scQSn0xo.js → lottie-yPmCb5yH.js} +1 -1
- package/dist/assets/{mui-CgZjFJJF.js → mui-DhQvsLdn.js} +1 -1
- package/dist/assets/{pathToGoBack-Cx0NwHdB.js → pathToGoBack-DJTUj6Ze.js} +1 -1
- package/dist/assets/{pdf-DXPt-TDj.js → pdf-cTO9wAGA.js} +3 -3
- package/dist/assets/{pdf-lib-kfbS5Id9.js → pdf-lib-CF1yLptT.js} +1 -1
- package/dist/assets/{plaid-vksPD1j4.js → plaid-DKx0sbcX.js} +1 -1
- package/dist/assets/{pusher-BpFLgay1.js → pusher-BAaWw3wT.js} +1 -1
- package/dist/assets/{react-BpwHczl-.js → react-BcUp-j0h.js} +1 -1
- package/dist/assets/{react-iYq3GXPy.js → react-Bl63jZN7.js} +1 -1
- package/dist/assets/{react-mGF_kQSA.js → react-BqKaOlqR.js} +1 -1
- package/dist/assets/{react-rwzOK-1r.js → react-CDZLt83I.js} +1 -1
- package/dist/assets/{react-DBgZvtMG.js → react-CGDLhvO_.js} +1 -1
- package/dist/assets/{react-BFVWe54o.js → react-CTglmHXr.js} +1 -1
- package/dist/assets/{recharts-DQBC-7lc.js → recharts-D1kT0p-5.js} +1 -1
- package/dist/assets/{routePaths-DNuW5jQV.js → routePaths-Cf2lH5Cm.js} +1 -1
- package/dist/assets/{sentry-BBNrx1Ml.js → sentry-BjL01Z0h.js} +1 -1
- package/dist/assets/{stripSplatSuffix-L-JRH5Ri.js → stripSplatSuffix-CsMQFMU-.js} +1 -1
- package/dist/assets/{url-CiYRfW83.js → url-BaKy2r5z.js} +1 -1
- package/dist/assets/{url-D0TdjO3t.js → url-CGtBtyoL.js} +1 -1
- package/dist/assets/useActualMatchingMatchDetail-DkRrIUr5.js +1 -0
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-Dn4uN4J8.js → useAiCfoDashboardSuggestedQuestionsChips-CtcDCRqR.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-BzzTTT3R.js +1 -0
- package/dist/assets/{useChargeCardPusherEvents-Bc01kHYP.js → useChargeCardPusherEvents-BM2UpqSx.js} +1 -1
- package/dist/assets/{useDeviceId-ClCFOYOX.js → useDeviceId-YMqu84TU.js} +1 -1
- package/dist/assets/{useEmailConnectResultRefresh-DgdB9uv-.js → useEmailConnectResultRefresh-Dylp3fKb.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-2hi5iAsL.js → useInitialThreadRequest-CE-c1u_9.js} +1 -1
- package/dist/assets/useTaskManagerAccess-BxLSEWlO.js +1 -0
- package/dist/assets/{useTaskManagerPusherEvents-Ypcuts7J.js → useTaskManagerPusherEvents-DcBcCFgV.js} +1 -1
- package/dist/assets/{utils-B8asVtkx.js → utils-BoByipD1.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-Bb5FevX_.js → withTransactionSidePanel-O7185yBB.js} +2 -2
- package/dist/assets/{zeni-epic-state-CQbasAjU.js → zeni-epic-state-kN_H0ghW.js} +7 -7
- package/dist/index.html +1 -1
- package/package.json +4 -4
- package/dist/assets/AddressRoutes-BVSHrg7z.js +0 -1
- package/dist/assets/AddressScreen-Doe_aPe9.js +0 -9
- package/dist/assets/CompanyPassportScreen-CoIn2qzM.js +0 -1
- package/dist/assets/ConnectionAuthScreen-DYsUrO3M.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-cy1fiuJH.js +0 -1
- package/dist/assets/DashboardRoutes-DMdxy8l4.js +0 -20
- package/dist/assets/DomesticWireDetailScreen-BbDPbcRA.js +0 -18
- package/dist/assets/EntityDetailRoutes-DVrb6Fuj.js +0 -1
- package/dist/assets/FeaturePreviewScreen-yUa195bz.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen--RhQBan-.js +0 -1
- package/dist/assets/MagicLinkSignInScreen-BcCW10cQ.js +0 -12
- package/dist/assets/NotFoundScreen-Bowln8Np.js +0 -1
- package/dist/assets/OAuthConsentScreen-CY6jrUj6.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-Dhy9JC2p.js +0 -1
- package/dist/assets/PeopleRoutes-Cse3a3sb.js +0 -22
- package/dist/assets/PerformanceRoutes-CxRwjZ1i.js +0 -1
- package/dist/assets/ReimbursementApprovalRoutes-DHWyOWyD.js +0 -1
- package/dist/assets/RewardsRoutes-DjHnoowA.js +0 -1
- package/dist/assets/SignInScreen-Bq6wqyFV.js +0 -1
- package/dist/assets/SignOutScreen-CMyUFCH3.js +0 -9
- package/dist/assets/TaskRoutes-C4T84shI.js +0 -9
- package/dist/assets/TransactionDetailRoutes-BnJFdHti.js +0 -1
- package/dist/assets/WiseConfirmationScreen-BhYBEIyb.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-F5yZU3cz.js +0 -9
- package/dist/assets/epic-B1XMIJyC.js +0 -2
- package/dist/assets/expenseAutomationHelper-Djn6yrb_.js +0 -1
- package/dist/assets/getLocaleForTenant-uCoslywF.js +0 -1
- package/dist/assets/useActualMatchingMatchDetail-CekpYB8W.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-Ba1QPj42.js +0 -1
- package/dist/assets/useTaskManagerAccess-D_aPdTiN.js +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-Css5YxVy.js";import{h as Y,u as le,g as K,i as ee,j as v,N as Q,l as X,q as aa,n as na,o as y}from"./core-CSm69gJV.js";import{fI as q,YS as _e,bq as It,SR as ia,bo as vt,bK as de,YT as kt,Hr as wt,IQ as Re,I2 as oa,bn as Be,YU as la,YV as sa,c9 as ra,YW as ca,m3 as xt,YX as At,YY as Bt,Ji as Ue,HK as xe,YZ as da,Hf as et,Y_ as ua,Na as pa,Hj as ma,Hp as Ct,Y$ as Se,Z0 as Ge,IR as Ze,HH as Dt,Z1 as ba,Z2 as ha,IU as Me,Z3 as ga,I_ as Sa,Z4 as Et,It as tt,Iy as ya,Z5 as fa,Z6 as ce,Z7 as Tt,Z8 as jt,Z9 as Pt,gZ as Ia,HP as Ve,cH as Ft,Za as va,gk as ka,Zb as wa,Zc as xa,e0 as Rt,d$ as Vt,Zd as Oe,Ze as Aa,Zf as Ba,Xq as Ne,Zg as Ca,Xr as ie,Xs as ze,Zh as Da,Zi as Ea,Zj as Ta,IA as at,Ix as ja,Zk as Pa,Zl as Fa,Zm as Ra,Ij as Va,Zn as $a,Zo as La,cv as $t,db as Lt,me as _a,bP as Ua,br as _t,bQ as Ut,Gv as Ga,Zp as Za,MZ as Ma,N3 as Oa,CA as Na,IS as za,Jp as Ha,mr as ge,Zq as Wa,Zr as Gt,mV as qa,ml as Zt,mG as Mt,mF as nt,bF as pe,bO as Ja,Zs as Ya,Zt as ye,kR as Ka,Zu as it,Zv as Xa,kV as Qa,le as en,JD as tn,Zw as an,mO as nn,Jt as on,Zx as ot,Jx as ln,JC as sn,JA as rn,Jr as cn,Zy as Ot,HA as dn,Zz as un,ZA as pn,gJ as mn,gI as bn,gH as hn,mu as gn,mM as lt,mX as Sn,v2 as yn,mD as fn,Jv as In,k$ as vn,n0 as kn,ZB as wn,kT as xn,uV as An,ZC as Bn,Ip as Cn,bL as Dn,bu as En,UR as Tn,de as jn,dd as Pn,cG as Fn,cN as Rn}from"./zeni-epic-state-CQbasAjU.js";import{z as V,V as fe,aq as He,c as oe,$ as f,bg as We,a5 as se,D as C,a6 as Ce,k as E,bt as Vn,a2 as W,at as qe,p as D,_ as Ie,bu as st,bv as rt,bw as $n,ax as Ln,ad as _n,aQ as Un,a9 as Nt,G as De,ae as Je,bx as Gn,ac as zt,by as Zn,ao as Mn,K as Ht,w as On,bz as Nn,bA as zn,bB as Hn,bC as Wn,bD as qn,bE as Jn,bF as Yn,bG as Kn,bH as Xn,I as Qn,bI as ei,bq as ti,bJ as ai,ag as ni,bK as ii,h as oi}from"./index-Di0x3KLC.js";import{u as ue,n as _,S as li}from"./mui-CgZjFJJF.js";import{A as ct}from"./AddressScreen-Doe_aPe9.js";import{g as ne,a as Ee,i as Wt,V as Ye,b as Ke,c as si,v as ri,d as ci,A as me,D as be}from"./DomesticWireDetailScreen-BbDPbcRA.js";import{a as g}from"./sentry-BBNrx1Ml.js";import{u as Xe}from"./useAskAiCfoHostNavButtonProps-Ba1QPj42.js";import{u as qt}from"./useInitialThreadRequest-2hi5iAsL.js";import{u as di}from"./BusinessVerificationPageScreen-JarRxoSX.js";import Ae from"./NotFoundScreen-Bowln8Np.js";import{D as ui}from"./DrawerScreen-37FDqOIx.js";import{M as Jt}from"./MobileAppDrawer-DfWAieCr.js";import{F as Yt}from"./FeaturePreviewScreen-yUa195bz.js";import{S as Te}from"./SetupPagesScreen-D3fdAxOs.js";import{B as pi}from"./BillPayApprovalRoutes-B8F3GVxs.js";import{F as mi}from"./ScreenRoutes-DxeRaGXX.js";import"./recharts-DQBC-7lc.js";import"./analytics-BreoHt0J.js";import"./plaid-vksPD1j4.js";import"./dnd-BvLWSTOT.js";import"./stripe-cKAAJElX.js";import"./lottie-scQSn0xo.js";import"./lexical-CC3pmboN.js";import"./pdf-DXPt-TDj.js";import"./utils-B8asVtkx.js";import"./routePaths-DNuW5jQV.js";import"./InboxNotificationsProvider-C3xMqTmq.js";import"./useTaskManagerAccess-D_aPdTiN.js";import"./analyticsHelper-DbQsERTh.js";import"./ReimbursementApprovalRuleDetailScreen-meuFzn-o.js";import"./getLocaleForTenant-uCoslywF.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]="9105e2fe-73ea-40cb-9213-87aebf31b555",e._sentryDebugIdIdentifier="sentry-dbid-9105e2fe-73ea-40cb-9213-87aebf31b555")}catch{}})();const bi=X((function(e,t){const l=_e(e,t.billId),n=V.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},u=W(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;Be(n)||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let i=!1,d=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:S,isMarkAsPaidBtnVisible:h}=la(l.billActivities,sa(t.currentTenant),n);i=S,d=h}const p=ra(t.currentTenant?.userRole??[]),m=l.transactionDetails!=null&&ca(l.transactionDetails,p,n);return{billDetails:l,isAccountingClassesEnabled:xt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${qe}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:p,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:i,showMarkAsPaidButtonToApprover:d,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:E,showMarkAsPaidButtonToCreator:m}}),(function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:u}=n;return{redirectToBillsScreen:()=>{const o=ne(u),s=D(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(Se({}))},deleteBill:o=>{E.trackBillPayDeleteBill(l,o),e(Ct(l))},cancelAndDeleteBill:(o,s)=>{s===!0?E.trackBillPayCancelAndDeleteBill(l,o):E.trackBillPayCancelBill(l),e(ma(l,s))},onSaveRealTimeApprovals:o=>{e(pa(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(ua({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(et(l,o.type,"")):e(et(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(xe(l,"retry")):e(xe(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Ee(u,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=W(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ne(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(da({billId:t.billId}))},onRefundPaymentClick:()=>{e(xe(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Bt({data:i,billId:l})),e(Ue(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(At({billId:l}))}}}))(Vn);function hi(){const e=Y(),t=le(),l=K(),{billId:n}=ee(),c=ue(),r=V.getSignedInUser(),u=fe(),o=v((U=>q(U))),s=v((U=>_e(U,n??""))),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=qt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Xe({mobileExploreReferrer:"Bill Details"});He({isDataReady:s.fetchState==="Completed"});const S=o?.userRole!=null&&It(o?.userRole),h=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!S,[b,B]=g.useState(!1),[I,j]=g.useState(!1),[A,T]=g.useState(!1),{useFeatureGate:k,useDynamicConfig:$}=oe(),{isFeatureEnabled:O}=k(f.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:G}=k(f.isBillPayDetectInsufficientFundsEnabled),{configValue:N}=$(We.zeniAssistConfig),z=ia(o),w=vt(o.userRole),Z=h&&de(u?.loggedInUserRoleMap),L=N.user_ids!=null&&r?.userId!=null&&N.user_ids.includes(r?.userId),{isFeatureEnabled:H}=k(f.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:J}=k(f.billPaySetupShowInternationalPaymentByWise);if(g.useEffect((()=>{O&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&z===!1?T(!1):T(s.billActivities[0]?.isRealTimeApprovalEnabled&&(w||Z||s.allApprovers.find((U=>U.user.userId===r?.userId))!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))}),[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,w,Z,o.isZeni,z,r]),g.useEffect((()=>{n!=null&&t(kt(n))}),[n]),g.useEffect((()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(B(!0),t(wt(n??"",O,L,!1)))}),[b,s,n,t]),g.useEffect((()=>{I||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(j(!0),t(Re(!1,O,L,J,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(oa()))}),[I,s,n,t,O,L,J]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(Q,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(se,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${C.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Ce,{analytics:E,onLoad:U=>(M=>{n!=null&&M.trackBillPayBillDetails(n,s.isRecurring)})(U)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:O,location:l,navigate:e,isRealTimeApprovalEnabled:A,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:H,hasZeniAssistAccess:L,isDetectInsufficientFundsEnabled:G,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const $e=De.getLocalizedStrings().spendManagement.billPay.billDetails,dt=De.getLocalizedStrings().common,gi={containerWidth:new Nt(100,58)},ut=X((function(e,t){const l=V.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${zt.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:E,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:C.sp10,paddingRight:C.sp3,paddingBottom:"15px",paddingLeft:C.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}}),(function(e,t){const l=V.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(Me(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(Sa({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{E?.trackBillPaySkipAutofill(),e(Ze(n))},onDeleteClick:()=>{e(ga({billId:t.billId})),E?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}}))(Un);function x({appContent:e}){const t=le(),l=Y(),{billId:n}=ee(),c=K(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=Ie(),s=ue(),i=V.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=oe(),{isFeatureEnabled:m}=d(f.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:S}=d(f.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:h}=d(f.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(f.billPaySetupShowInternationalPaymentByWise),{configValue:B}=p(We.zeniAssistConfig),I=B.user_ids!=null&&i?.userId!=null&&B.user_ids.includes(i?.userId),j=v((P=>q(P)));di();const[A,T]=g.useState(!1),[k,$]=g.useState(!1),[O,G]=g.useState(!1),[N,z]=g.useState(),w=v((P=>Ge(P,m,h,n)));let Z=w.fetchState,L=w.file,H=w.showAutofill;const J=v((P=>_e(P,n??"")));u===!1&&(Z=J.fetchState,L=J.transactionDetails?.attachments?.[0],H=!1);const U=w.billPayInfo!=null&&w.billPayInfo.stage.code==="pending_approval"?w.billPayInfo.billStatus.code:w.billStage;g.useEffect((()=>{n==null&&t(Ze(!0))}),[n,t]),g.useEffect((()=>{Z==="Not-Started"&&(u&&k?$(!1):!u&&A&&T(!1))}),[n]),g.useEffect((()=>{A||n==null||u||(T(!0),t(wt(n,S,I,!1)),t(Dt(n)),k||($(!0),t(Re(!1,S,I,b,n)))),u&&!k&&($(!0),t(Re(!1,S,I,b,n)))}),[A,k,u,n,t,S,I,b]);const M={onOkClick:()=>{if(G(!1),!N)return;const P=L!=null?"replace":"upload";E?.trackInvoiceActionClick(U??"",P,i?.userEmail??"","yes"),t(ha({replaceBillData:!0,billId:n})),t(Me(N,m,n))},onCancelClick:()=>{if(G(!1),!N)return;const P=L!=null?"replace":"upload";E?.trackInvoiceActionClick(U??"",P,i?.userEmail??"","no"),t(ba({file:N,billId:n}))}},te=g.useCallback((()=>{const P=W(c.state?.pathnameStackToGoBack),ve=P.poppedPathname??ne(j.tenantEmailDomain);t(Se({billId:n})),l(ve,{state:{pathnameStackToGoBack:P.newStack}})}),[c.state,j.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(Z==="Error"||J.fetchState==="Error")return a.jsx(Ae,{});if(Z!="Completed")return n==null&&o!=="small"?a.jsx(st,{fallback:te,children:a.jsxs(je,{windowSize:o,children:[a.jsx(mt,{}),a.jsx(Pe,{}),a.jsx(ut,{backgroundColor:s.colors.grey4,billId:n,file:L,showAutofill:!0,uploadStatus:w.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:G,setPayload:z,showActionButtons:!1,isInitialEdit:!!w.isInitialEdit,billStage:U}),a.jsx(Fe,{windowSize:o,children:a.jsx(rt,{isNewBill:!0})})]})}):a.jsxs(je,{windowSize:o,children:[o==="small"||H?null:a.jsx(pt,{children:a.jsx(Kt,{onClick:te,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Pe,{}):null,a.jsx($n,{}),a.jsx(Fe,{windowSize:o,children:a.jsx(rt,{isNewBill:n==null})})]});{const P=w.billPayInfo!=null&&w.billPayInfo.stage.code==="pending_approval"?w.billPayInfo.billStatus.code:w.billStage;return a.jsx(st,{fallback:te,children:a.jsxs(je,{windowSize:o,children:[H&&o!=="small"?a.jsx(mt,{}):null,O?a.jsx(Ln,{titleComponent:a.jsx(wi,{children:$e.overwriteTitle}),descriptionComponent:a.jsx(xi,{children:$e.overwriteDescription}),primaryButtonText:dt.yes,secondaryButtonText:dt.no,action:M,isEditPopup:!0}):null,o==="small"||H?null:a.jsx(pt,{children:a.jsx(Si,{})}),o!=="small"?a.jsx(Pe,{}):null,a.jsx(ut,{backgroundColor:s.colors.grey4,billId:n,file:L,showAutofill:H,uploadStatus:w.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:yi(u,J,w),setShowConfirmationPopup:G,setPayload:z,showActionButtons:fi(u,w),isInitialEdit:!!w.isInitialEdit,billStage:P}),a.jsx(Fe,{windowSize:o,children:e})]})})}}function Si(){const{triggerBack:e}=Gn();return a.jsx(Kt,{onClick:e,"data-testid":"nav-bar-back-click"})}function yi(e,t,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(Ii,{children:[a.jsx(vi,{children:`${$e.recurringBill.recurringCycle}
|
|
1
|
+
import{j as a}from"./liveblocks-9GmpXxpV.js";import{h as Y,u as le,g as X,i as ee,j as v,N as Q,l as K,q as aa,n as na,o as y}from"./core-DN52-78R.js";import{fI as q,YT as _e,bq as It,SS as ia,bo as vt,bK as de,YU as kt,Hs as wt,IR as Re,I3 as oa,bn as Ce,YV as la,YW as sa,c9 as ra,YX as ca,m3 as xt,YY as Bt,YZ as Ct,Jj as Ge,HL as xe,Y_ as da,Hg as et,Y$ as ua,Nb as pa,Hk as ma,Hq as At,Z0 as Se,Z1 as Ue,IS as Ze,HI as Dt,Z2 as ba,Z3 as ha,IV as Me,Z4 as ga,I$ as Sa,Z5 as Et,Iu as tt,Iz as ya,Z6 as fa,Z7 as ce,Z8 as Tt,Z9 as jt,Za as Pt,gZ as Ia,HQ as Ve,cH as Ft,Zb as va,gk as ka,Zc as wa,Zd as xa,e0 as Rt,d$ as Vt,Ze as Oe,Zf as Ba,Zg as Ca,Xr as Ne,Zh as Aa,Xs as ie,Xt as ze,Zi as Da,Zj as Ea,Zk as Ta,IB as at,Iy as ja,Zl as Pa,Zm as Fa,Zn as Ra,Ik as Va,Zo as $a,Zp as La,cv as $t,db as Lt,me as _a,bP as Ga,br as _t,bQ as Gt,Gw as Ua,Zq as Za,M_ as Ma,N4 as Oa,CA as Na,IT as za,Jq as Ha,mr as ge,Zr as Wa,Zs as Ut,mV as qa,ml as Zt,mG as Mt,mF as nt,bF as pe,bO as Ja,Zt as Ya,Zu as ye,kR as Xa,Zv as it,Zw as Ka,kV as Qa,le as en,JE as tn,Zx as an,mO as nn,Ju as on,Zy as ot,Jy as ln,JD as sn,JB as rn,Js as cn,Zz as Ot,HB as dn,ZA as un,ZB as pn,gJ as mn,gI as bn,gH as hn,mu as gn,mM as lt,mX as Sn,v2 as yn,mD as fn,Jw as In,k$ as vn,n0 as kn,ZC as wn,kT as xn,uV as Bn,ZD as Cn,Iq as An,bL as Dn,bu as En,US as Tn,de as jn,dd as Pn,cG as Fn,cN as Rn}from"./zeni-epic-state-kN_H0ghW.js";import{z as V,V as fe,aq as He,q as oe,$ as f,bg as We,a5 as se,E as A,a6 as Ae,h as E,bt as Vn,a2 as W,at as qe,p as D,_ as Ie,bu as st,bv as rt,bw as $n,ax as Ln,ad as _n,aQ as Gn,a9 as Nt,G as De,ae as Je,bx as Un,ac as zt,by as Zn,ao as Mn,K as Ht,w as On,bz as Nn,bA as zn,bB as Hn,bC as Wn,bD as qn,bE as Jn,bF as Yn,bG as Xn,bH as Kn,k as Qn,bI as ei,bq as ti,bJ as ai,ag as ni,bK as ii,f as oi}from"./index-CcTOsN6n.js";import{u as ue,n as _,S as li}from"./mui-DhQvsLdn.js";import{A as ct}from"./AddressScreen-YJZ3XLLs.js";import{g as ne,a as Ee,i as Wt,V as Ye,b as Xe,c as si,v as ri,d as ci,A as me,D as be}from"./DomesticWireDetailScreen-KjWlwIBh.js";import{a as g}from"./sentry-BjL01Z0h.js";import{u as Ke}from"./useAskAiCfoHostNavButtonProps-BzzTTT3R.js";import{u as qt}from"./useInitialThreadRequest-CE-c1u_9.js";import{u as di}from"./BusinessVerificationPageScreen-BiU68eTf.js";import Be from"./NotFoundScreen-CFVOeV9b.js";import{D as ui}from"./DrawerScreen-DkAXkoMI.js";import{M as Jt}from"./MobileAppDrawer-oi_jxOPF.js";import{F as Yt}from"./FeaturePreviewScreen-BvZfqhwT.js";import{S as Te}from"./SetupPagesScreen-DAeMUdyW.js";import{B as pi}from"./BillPayApprovalRoutes-Bruhx8rE.js";import{F as mi}from"./ScreenRoutes-czg4LVOl.js";import"./recharts-D1kT0p-5.js";import"./analytics-d11__KPJ.js";import"./plaid-DKx0sbcX.js";import"./dnd-DmRCPujN.js";import"./stripe-cKAAJElX.js";import"./lottie-yPmCb5yH.js";import"./lexical-LEeCUpN7.js";import"./pdf-cTO9wAGA.js";import"./utils-BoByipD1.js";import"./routePaths-Cf2lH5Cm.js";import"./InboxNotificationsProvider-DbPSBd88.js";import"./useTaskManagerAccess-BxLSEWlO.js";import"./analyticsHelper-BWXp54-h.js";import"./ReimbursementApprovalRuleDetailScreen-WV0VKJY8.js";import"./getLocaleForTenant-C4ctFsVy.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]="2a7f196d-772b-463d-a56d-65734fd210e6",e._sentryDebugIdIdentifier="sentry-dbid-2a7f196d-772b-463d-a56d-65734fd210e6")}catch{}})();const bi=K((function(e,t){const l=_e(e,t.billId),n=V.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},u=W(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;Ce(n)||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let i=!1,d=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:S,isMarkAsPaidBtnVisible:h}=la(l.billActivities,sa(t.currentTenant),n);i=S,d=h}const p=ra(t.currentTenant?.userRole??[]),m=l.transactionDetails!=null&&ca(l.transactionDetails,p,n);return{billDetails:l,isAccountingClassesEnabled:xt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${qe}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:p,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:i,showMarkAsPaidButtonToApprover:d,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:E,showMarkAsPaidButtonToCreator:m}}),(function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:u}=n;return{redirectToBillsScreen:()=>{const o=ne(u),s=D(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(Se({}))},deleteBill:o=>{E.trackBillPayDeleteBill(l,o),e(At(l))},cancelAndDeleteBill:(o,s)=>{s===!0?E.trackBillPayCancelAndDeleteBill(l,o):E.trackBillPayCancelBill(l),e(ma(l,s))},onSaveRealTimeApprovals:o=>{e(pa(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(ua({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(et(l,o.type,"")):e(et(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(xe(l,"retry")):e(xe(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Ee(u,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=W(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ne(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(da({billId:t.billId}))},onRefundPaymentClick:()=>{e(xe(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Ct({data:i,billId:l})),e(Ge(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(Bt({billId:l}))}}}))(Vn);function hi(){const e=Y(),t=le(),l=X(),{billId:n}=ee(),c=ue(),r=V.getSignedInUser(),u=fe(),o=v((G=>q(G))),s=v((G=>_e(G,n??""))),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=qt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Ke({mobileExploreReferrer:"Bill Details"});He({isDataReady:s.fetchState==="Completed"});const S=o?.userRole!=null&&It(o?.userRole),h=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!S,[b,C]=g.useState(!1),[I,j]=g.useState(!1),[B,T]=g.useState(!1),{useFeatureGate:k,useDynamicConfig:$}=oe(),{isFeatureEnabled:O}=k(f.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:U}=k(f.isBillPayDetectInsufficientFundsEnabled),{configValue:N}=$(We.zeniAssistConfig),z=ia(o),w=vt(o.userRole),Z=h&&de(u?.loggedInUserRoleMap),L=N.user_ids!=null&&r?.userId!=null&&N.user_ids.includes(r?.userId),{isFeatureEnabled:H}=k(f.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:J}=k(f.billPaySetupShowInternationalPaymentByWise);if(g.useEffect((()=>{O&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&z===!1?T(!1):T(s.billActivities[0]?.isRealTimeApprovalEnabled&&(w||Z||s.allApprovers.find((G=>G.user.userId===r?.userId))!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))}),[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,w,Z,o.isZeni,z,r]),g.useEffect((()=>{n!=null&&t(kt(n))}),[n]),g.useEffect((()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(C(!0),t(wt(n??"",O,L,!1)))}),[b,s,n,t]),g.useEffect((()=>{I||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(j(!0),t(Re(!1,O,L,J,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(oa()))}),[I,s,n,t,O,L,J]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(Q,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(se,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${A.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Ae,{analytics:E,onLoad:G=>(M=>{n!=null&&M.trackBillPayBillDetails(n,s.isRecurring)})(G)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:O,location:l,navigate:e,isRealTimeApprovalEnabled:B,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:H,hasZeniAssistAccess:L,isDetectInsufficientFundsEnabled:U,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const $e=De.getLocalizedStrings().spendManagement.billPay.billDetails,dt=De.getLocalizedStrings().common,gi={containerWidth:new Nt(100,58)},ut=K((function(e,t){const l=V.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${zt.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:E,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:A.sp10,paddingRight:A.sp3,paddingBottom:"15px",paddingLeft:A.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}}),(function(e,t){const l=V.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(Me(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(Sa({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{E?.trackBillPaySkipAutofill(),e(Ze(n))},onDeleteClick:()=>{e(ga({billId:t.billId})),E?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}}))(Gn);function x({appContent:e}){const t=le(),l=Y(),{billId:n}=ee(),c=X(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=Ie(),s=ue(),i=V.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=oe(),{isFeatureEnabled:m}=d(f.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:S}=d(f.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:h}=d(f.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(f.billPaySetupShowInternationalPaymentByWise),{configValue:C}=p(We.zeniAssistConfig),I=C.user_ids!=null&&i?.userId!=null&&C.user_ids.includes(i?.userId),j=v((P=>q(P)));di();const[B,T]=g.useState(!1),[k,$]=g.useState(!1),[O,U]=g.useState(!1),[N,z]=g.useState(),w=v((P=>Ue(P,m,h,n)));let Z=w.fetchState,L=w.file,H=w.showAutofill;const J=v((P=>_e(P,n??"")));u===!1&&(Z=J.fetchState,L=J.transactionDetails?.attachments?.[0],H=!1);const G=w.billPayInfo!=null&&w.billPayInfo.stage.code==="pending_approval"?w.billPayInfo.billStatus.code:w.billStage;g.useEffect((()=>{n==null&&t(Ze(!0))}),[n,t]),g.useEffect((()=>{Z==="Not-Started"&&(u&&k?$(!1):!u&&B&&T(!1))}),[n]),g.useEffect((()=>{B||n==null||u||(T(!0),t(wt(n,S,I,!1)),t(Dt(n)),k||($(!0),t(Re(!1,S,I,b,n)))),u&&!k&&($(!0),t(Re(!1,S,I,b,n)))}),[B,k,u,n,t,S,I,b]);const M={onOkClick:()=>{if(U(!1),!N)return;const P=L!=null?"replace":"upload";E?.trackInvoiceActionClick(G??"",P,i?.userEmail??"","yes"),t(ha({replaceBillData:!0,billId:n})),t(Me(N,m,n))},onCancelClick:()=>{if(U(!1),!N)return;const P=L!=null?"replace":"upload";E?.trackInvoiceActionClick(G??"",P,i?.userEmail??"","no"),t(ba({file:N,billId:n}))}},te=g.useCallback((()=>{const P=W(c.state?.pathnameStackToGoBack),ve=P.poppedPathname??ne(j.tenantEmailDomain);t(Se({billId:n})),l(ve,{state:{pathnameStackToGoBack:P.newStack}})}),[c.state,j.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(Z==="Error"||J.fetchState==="Error")return a.jsx(Be,{});if(Z!="Completed")return n==null&&o!=="small"?a.jsx(st,{fallback:te,children:a.jsxs(je,{windowSize:o,children:[a.jsx(mt,{}),a.jsx(Pe,{}),a.jsx(ut,{backgroundColor:s.colors.grey4,billId:n,file:L,showAutofill:!0,uploadStatus:w.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:U,setPayload:z,showActionButtons:!1,isInitialEdit:!!w.isInitialEdit,billStage:G}),a.jsx(Fe,{windowSize:o,children:a.jsx(rt,{isNewBill:!0})})]})}):a.jsxs(je,{windowSize:o,children:[o==="small"||H?null:a.jsx(pt,{children:a.jsx(Xt,{onClick:te,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Pe,{}):null,a.jsx($n,{}),a.jsx(Fe,{windowSize:o,children:a.jsx(rt,{isNewBill:n==null})})]});{const P=w.billPayInfo!=null&&w.billPayInfo.stage.code==="pending_approval"?w.billPayInfo.billStatus.code:w.billStage;return a.jsx(st,{fallback:te,children:a.jsxs(je,{windowSize:o,children:[H&&o!=="small"?a.jsx(mt,{}):null,O?a.jsx(Ln,{titleComponent:a.jsx(wi,{children:$e.overwriteTitle}),descriptionComponent:a.jsx(xi,{children:$e.overwriteDescription}),primaryButtonText:dt.yes,secondaryButtonText:dt.no,action:M,isEditPopup:!0}):null,o==="small"||H?null:a.jsx(pt,{children:a.jsx(Si,{})}),o!=="small"?a.jsx(Pe,{}):null,a.jsx(ut,{backgroundColor:s.colors.grey4,billId:n,file:L,showAutofill:H,uploadStatus:w.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:yi(u,J,w),setShowConfirmationPopup:U,setPayload:z,showActionButtons:fi(u,w),isInitialEdit:!!w.isInitialEdit,billStage:P}),a.jsx(Fe,{windowSize:o,children:e})]})})}}function Si(){const{triggerBack:e}=Un();return a.jsx(Xt,{onClick:e,"data-testid":"nav-bar-back-click"})}function yi(e,t,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(Ii,{children:[a.jsx(vi,{children:`${$e.recurringBill.recurringCycle}
|
|
2
2
|
${n}/${c}`}),a.jsx(ki,{})]}):void 0}function fi(e,t){const l=t.billActivities?.[0],n=t.billStage==="pending_approval"&&l?.areApprovalsSerialized===!0&&l?.currentPendingStepIndex===0;return e&&(t.billStage==="draft"||n)}const pt=_.div`
|
|
3
3
|
margin-bottom: 20px;
|
|
4
4
|
margin-top: 20px;
|
|
5
|
-
margin-left: ${
|
|
5
|
+
margin-left: ${A.sp5};
|
|
6
6
|
position: absolute;
|
|
7
7
|
display: flex;
|
|
8
8
|
align-items: center;
|
|
@@ -11,15 +11,15 @@ import{j as a}from"./liveblocks-Css5YxVy.js";import{h as Y,u as le,g as K,i as e
|
|
|
11
11
|
justify-content: center;
|
|
12
12
|
align-items: center;
|
|
13
13
|
padding-top: 9px;
|
|
14
|
-
gap: ${
|
|
15
|
-
margin-bottom: -${
|
|
14
|
+
gap: ${A.sp2};
|
|
15
|
+
margin-bottom: -${A.sp2};
|
|
16
16
|
`,vi=_(Je.StandardMedium)``,ki=_((e=>g.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},g.createElement("path",{d:"M3.35001 15L3.35001 10.125C3.35001 6.81129 6.0363 4.125 9.35001 4.125H16.475M16.475 4.125L13.85 1.5M16.475 4.125L13.85 6.75",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),g.createElement("path",{d:"M20.6 9V13.875C20.6 17.1887 17.9137 19.875 14.6 19.875H7.47501M7.47501 19.875L10.1 22.5M7.47501 19.875L10.1 17.25",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}))))`
|
|
17
17
|
color: ${e=>e.theme.colors.hero};
|
|
18
|
-
height: ${
|
|
19
|
-
width: ${
|
|
20
|
-
`,
|
|
21
|
-
width: ${
|
|
22
|
-
height: ${
|
|
18
|
+
height: ${A.sp3};
|
|
19
|
+
width: ${A.sp3};
|
|
20
|
+
`,Xt=_((e=>g.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},g.createElement("path",{d:"M10 13L5 8L10 3",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}))))`
|
|
21
|
+
width: ${A.sp3};
|
|
22
|
+
height: ${A.sp3};
|
|
23
23
|
cursor: pointer;
|
|
24
24
|
color: ${e=>e.theme.colors.champion};
|
|
25
25
|
&:hover {
|
|
@@ -65,19 +65,19 @@ import{j as a}from"./liveblocks-Css5YxVy.js";import{h as Y,u as le,g as K,i as e
|
|
|
65
65
|
width: ${e=>`${gi.containerWidth.value(e.windowSize)}%`};
|
|
66
66
|
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
67
67
|
`,wi=_(Je.H6Regular)`
|
|
68
|
-
margin-top: ${
|
|
69
|
-
padding-left: ${
|
|
70
|
-
padding-right: ${
|
|
68
|
+
margin-top: ${A.sp7};
|
|
69
|
+
padding-left: ${A.sp8};
|
|
70
|
+
padding-right: ${A.sp8};
|
|
71
71
|
color: ${e=>e.theme.colors.primary};
|
|
72
72
|
word-break: break-word;
|
|
73
73
|
`,xi=_(Je.LargeRegularSp)`
|
|
74
74
|
color: ${e=>e.theme.colors.hero};
|
|
75
|
-
padding-left: ${
|
|
76
|
-
padding-right: ${
|
|
75
|
+
padding-left: ${A.sp8};
|
|
76
|
+
padding-right: ${A.sp8};
|
|
77
77
|
margin-bottom: 30px;
|
|
78
|
-
margin-top: ${
|
|
78
|
+
margin-top: ${A.sp4};
|
|
79
79
|
white-space: pre-line;
|
|
80
|
-
`,
|
|
80
|
+
`,Bi=K((function(e,t){return{billsReviewView:Et(e),analytics:t.analytics}}),(function(e,t){return{onCloseOverlay:()=>{t.navigate(`/${t.tenantEmailDomain}/bills`),e(ce())},onCloseReviewItem:l=>{e(fa(l))},onProceedForBulkActionClick:(l,n)=>{switch(l){case"send_for_approval":e(ya());break;case"approve":case"review":e(tt("approved",n??""));break;case"reject":e(tt("rejected",n??""))}}}}))(Zn);function Ci({tenantEmailDomain:e}){const t=Y(),l=v((c=>c.billsBulkActionViewState.bulkSubmissionFetchState.fetchState)),{billsForReview:n}=v((c=>Et(c)));return g.useEffect((()=>{l!=="Completed"&&n.length!==0||t(`/${e}/bills`)}),[l,n.length,e]),a.jsx(Bi,{navigate:t,analytics:E,tenantEmailDomain:e})}const ae=Ca(),Kt="bulk-operation-update",Le="bill-approval-rule-update",{common:ke}=De.getLocalizedStrings(),Ai=_.div`
|
|
81
81
|
display: flex;
|
|
82
82
|
min-height: 100%;
|
|
83
83
|
width: 100%;
|
|
@@ -85,11 +85,11 @@ import{j as a}from"./liveblocks-Css5YxVy.js";import{h as Y,u as le,g as K,i as e
|
|
|
85
85
|
flex-direction: column;
|
|
86
86
|
align-items: center;
|
|
87
87
|
background-color: ${e=>e.theme.colors.grey4};
|
|
88
|
-
`,Di=
|
|
88
|
+
`,Di=K((function(e,t){const l=V.getSignedInUser(),n=Ce(l),c=Pt(e,ae,t.isBulkActionEnabled,l?.userId);let r=c.allSubTabs;t.isUserHasOnlyBillpayAccess&&t.roleMap&&c.currentTab==="pending_approval"&&(t.roleMap.bill_pay_analyst?r=r.filter((b=>b==="all"||b==="overdue"||b==="rejected"||b==="deleted")):t.roleMap.bill_pay_approver&&(r=r.filter((b=>b==="all"||b==="awaiting_my_approval"||b==="overdue"||b==="rejected"||b==="deleted")))),t.isShowDeletedBillsEnabled===!1&&(r=r.filter((b=>b!=="deleted")));const u=e.entityAutoCompleteState.autoCompleteText.common,o=Ne(e,"common"),s=e.tenantState.currentTenantId,i=q(e),d=i?.companyName??"",p={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},m=e.billListState.downloadUIState.downloadState,S=c.fetchState,h=Aa(e);return{transactionList:t.isShowDeletedBillsEnabled?c.transactions:c.transactions.filter((b=>b.isDeleted===!1)),currentTab:c.currentTab,currentSubTab:c.currentSubTab,approvalCount:c.approvalCount,allSubTabs:r,fetchState:S,analytics:E,botEmail:c.billPayBotEmail,searchText:c.searchText,filters:c.filters,vendorSearchAutoCompleteData:{autoCompleteText:u,entityAutoCompleteView:o},downloadParams:{authParams:p,companyName:d,timePeriod:ae,spendManagementEndPoint:`${qe}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:m,isBulkActionAllowed:c.billListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:c.billListBulkActionInfo?.billsSelectedForBulkAction,allowedBulkActions:c.billListBulkActionInfo?.allowedBulkActions,isZeniUser:n,billPayApprovalRulesAffectedEntityIds:h.affectedEntityIds}}),(function(e,t){const{navigate:l,currentTenant:n,location:c,period:r}=t,{tenantEmailDomain:u}=n;return{updateTabToState:o=>{e(ce()),e(Tt(o))},onSubtabChange:o=>{e(ce()),e(jt(o))},onTransactionClick:(o,s)=>{const i=Ee(u,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);l(i,{state:{pathnameStackToGoBack:d}})},onClickSetupIcon:()=>{const o=Ti(u),s=D(c.state?.pathnameStackToGoBack,c.pathname);l(o,{state:{pathnameStackToGoBack:s}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;E?.trackBillPayNewBill();const s=`/${o}/bill/new`,i=D(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(s,{state:{pathnameStackToGoBack:i}})},onSearchTextChanged:o=>{e($a(o))},onReloadTransactions:()=>{e(Ve(r,!0,t.isShowDeletedBillsEnabled,t.isInternationalWireEnabled)),e(Va(n.companyId,!0))},onNavigateToSettings:()=>{l("../bills/setup")},onBackClick:()=>{l("../",{relative:"path"})},onFiltersChange:o=>{e(Ra({filters:o})),o.categories.every((s=>s.field!=null&&s.values?.length!==0))&&E.trackSpendManagmentFilterChange("bill_pay",o.categories.map((s=>`${s.field}-${JSON.stringify(s.values)}`)))},updateDownloadStateHandler:o=>{o==="In-Progress"&&E.trackSpendManagementDownloadClick("bill_pay"),e(Fa({uiState:{downloadState:o}}))},updateBulkActionList:o=>{e(Pa(o))},removeAllTransactionsFromBulkActionList:()=>{e(ce())},onProceedForBulkActionClick:(o,s)=>{switch(o){case"delete":case"cancel":e(ja(o,s??""));break;case"send_for_approval":e(at("send_for_approval")),t.navigate("./bulk-review");break;case"approve":e(at("approve")),t.navigate("./bulk-review");break;case"review":e(Ta()),t.navigate("./bulk-review")}},onBillPayApprovalRulesEventReceived:o=>{o.endsWith(Le)&&e(Ea(!1))},onEventReceived:o=>{o===Kt&&e(Da())},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:o=>{o.trim().length>=2?e(ze({searchString:o,entityType:"vendor",searchOrigin:"common"})):o.trim().length===0&&e(ie("common"))},onCancelAutoComplete:()=>{e(ie("common"))}}}}))(On(Nn));function Ei(){const e=Y(),t=le(),l=X(),n=Ie(),c=l.state,r=fe(),[u,o]=g.useState(!1),[s,i]=g.useState(null),d=aa("/:tenantEmailDomain/bills/bulk-review")!=null;g.useEffect((()=>(c?.tab!=null&&c?.subTab!=null&&(t(Tt(c?.tab)),t(jt(c?.subTab))),()=>{t(ce())})),[]);const p=V.getSignedInUser(),m=v((F=>q(F))),{areTenantIdsInSync:S}=Mn(),[h,b]=g.useState(!1),{useFeatureGate:C}=oe(),{isFeatureEnabled:I}=C(f.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:j}=C(f.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:B}=C(f.isBillPayBulkActionEnabled),{isFeatureEnabled:T}=C(f.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:k}=C(f.isBillPayDetectInsufficientFundsEnabled),$=v((F=>Pt(F,ae,B,p?.userId))),{isFeatureEnabled:O}=C(f.isDebitCardFeatureEnabled),U=$.fetchState,{isAiCfoAccessEnabled:N,onAskAiCfoClick:z}=Ke({mobileExploreReferrer:"Bills List"});He({isDataReady:U==="Completed"});const w=!!m.companyBillPayInfo?.info?.isBillPayTOSAccepted,Z=!!m.companyBillPayInfo?.info?.isBillPayEnabled,L=v((F=>Ia(F.companyState,m.companyId))),H=L?.company.featuresActivationInfo.connectedAccountProvider;if(g.useEffect((()=>{!h&&Z&&S&&(b(!0),t(Ve(ae,!0,I,T)))}),[h,ae,S,t]),p==null)throw Error("Can't access address page without signing in...");const J=(F,re)=>{t(Ba({uiState:{sortKey:F,sortOrder:re},period:ae}))},G=Ft(r?.loggedInUserRoleMap),M=de(r?.loggedInUserRoleMap),te=F=>{o(F)},{billsProcessed:P,billsProcessing:ve}=v((F=>va(F)));g.useEffect((()=>{P===ve&&s!=null&&(t(ka({messageSection:"bill_pay_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_bill_",variableValue:P>1?ke.headers.bills:ke.texts.bill2},{variableName:"_has_",variableValue:P>1?ke.texts.have:ke.texts.has},{variableName:"_action_",variableValue:wa(s)}]})),t(xa()),setTimeout((()=>{t(Ve(ae,!0,I,!0,T))}),3e3),i(null))}),[P,ve]);const Qt={events:m.companyId!=null?[`private-encrypted-${m.companyId}.${Kt}`,`private-encrypted-${m.companyId}.${Le}`]:[],eventCallback:(F,re,Qe)=>{F.endsWith(Le)?Qe.onBillPayApprovalRulesEventReceived?.(F):re?.entity_type==="bill"&&(i(re.operation_type),Qe.onEventReceived(F))}},ea=Rt(O,m),ta=Vt(m);return l.pathname.endsWith("/bills/")||l.pathname.endsWith("/bills")||l.pathname.endsWith("/bills/bulk-review")?ea===!0||ta===!0?a.jsx(Yt,{}):Z?a.jsxs(a.Fragment,{children:[U==="Completed"?a.jsx(Ae,{analytics:E,onLoad:F=>(re=>re.trackPageLoaded(Ht.Event.billPayHome))(F)}):null,a.jsxs(Ai,{windowSize:n,children:[a.jsx(Jt,{isAppContentDrawerOpen:u,handleDrawerToggle:te}),a.jsx(ui,{isOpen:d,drawerLeftMargin:new Nt(0,0,300,600),onClose:()=>{e(`/${m.tenantEmailDomain}/bills`),t(ce())},children:a.jsx(ji,{onClick:F=>F.stopPropagation(),children:a.jsx(Ci,{tenantEmailDomain:m.tenantEmailDomain})})}),a.jsx(Di,{location:l,navigate:e,currentTenant:m,entity:"bill_pay",period:ae,isAdmin:!1,uiState:$.uiState,onColumnSortConfigChanged:J,isUserHasOnlyBillpayAccess:G,isShowDeletedBillsEnabled:I,isShowDeletedReimbursementEnabled:j,isBulkActionEnabled:B,roleMap:r?.loggedInUserRoleMap,onClickMenuIcon:()=>{te(!0)},isDownloadEnabled:$.isDownloadEnabled,connectedAccountProvider:H,bulkSubmissionLimit:$.billBulkSubmissionLimit,bulkSubmissionFetchState:$.billListBulkActionInfo.bulkSubmissionFetchState,isRecurringBillInBulkActionList:$.billListBulkActionInfo.isRecurringBillInBulkActionList,isInternationalWireEnabled:T,isDetectInsufficientFundsEnabled:k,isAiCfoAccessEnabled:N,onAskAiCfoClick:z,...Qt})]})]}):w===!0&&M===!0?a.jsx(Q,{to:"../setup"}):r!=null&&Oe(m,r.loggedInUserRoleMap)?a.jsx(Q,{to:"../promo"}):a.jsx(se,{fetchState:U}):a.jsx(Be,{})}const Ti=e=>`/${e}/bills/setup`,ji=_(li)`
|
|
89
89
|
display: flex;
|
|
90
90
|
min-height: 100%;
|
|
91
91
|
flex-direction: column;
|
|
92
|
-
`,{common:{currency:he},spendManagement:{billPay:{billDetails:Pi}},appName:Fi}=De.getLocalizedStrings(),Ri=X((function(e,t){const l=V.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=W(t.location.state?.pathnameStackToGoBack);let u=!0;r.poppedPathname?.includes("bills")===!0&&(u=!1);const o=e.entityAutoCompleteState.autoCompleteText.common,s=Ne(e,"common");let i=`${l?.firstName} ${l?.lastName}`;const d=Be(l);t.billId!=null&&t.billDetailsView!=null&&(i=`${t.billDetailsView.createdBy?.firstName??Fi} ${t.billDetailsView.createdBy?.lastName??""}`),d||!t.billDetailsView.createdBy?.email?.includes("zeni.ai")||(i="Zeni");const p=t.billDetailsView.editBillInitialDetails?.totalAmount?.amount,m=Ua(t.billDetailsView.paymentDetailsSection?.paymentType?.method),S=t.currentTenant.createTime,h=_t(),b=t.sameDayAchDisablementConfig.newTenantTenureLimitMonths,B=S.add(b,"month").isAfter(h),I=!!(t.billDetailsView.billStage==="draft"&&m&&p!=null&&p>0)&&!Ut(p,t.billDetailsView.approvalRules.allApprovalRules,l,t.billDetailsView.vendor?.id,t.billDetailsView.classId),j=q(e);return{billDetails:t.billDetailsView,isAccountingClassesEnabled:xt(e),billId:t.billId,createdBy:i,createTime:t.billDetailsView?.createTime,authParams:c,transactionAttachmentEndpoint:`${qe}/transaction_attachment`,analytics:E,showBackButton:u,isAdmin:t.isBillPayAdmin,isSuperAdmin:t.isSuperAdmin,connectedAccountProvider:j.company?.featuresActivationInfo.connectedAccountProvider??"",customerSearchAutoCompleteData:{autoCompleteText:o,entityAutoCompleteView:s},showMarkAsPaidInfo:I,isZeniUser:d,isNewUser:B,sameDayAchDisablementConfig:t.sameDayAchDisablementConfig}}),(function(e,t){const{billId:l,companyId:n,currentTenant:c,location:r,navigate:u,billDetailsView:o}=t,{tenantEmailDomain:s}=c;return{editVendor:i=>{e(nt(i));const d=ht(s,i,l),p=D(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},chooseNewVendor:i=>{const d=i??t.billDetailsView.addBillAutoFields.tentativeVendorName;d!=null&&e(Zt(d,!1)),e(Mt({localData:{vendorName:i??t.billDetailsView.addBillAutoFields.tentativeVendorName}})),e(nt());const p=ht(s,void 0,l),m=D(r.state?.pathnameStackToGoBack,r.pathname);u(p,{state:{pathnameStackToGoBack:m}})},onInvoiceUpload:i=>{i!=null&&e(Me(i,t.isVendorRecommendationEnabled))},updateShowAutofill:i=>{e(Ze(i))},onSaveChangesToLocalStore:(i,d,p,m,S)=>{const h=_i(t.billDetailsView,{...i,paymentDetails:{...i?.paymentDetails,paymentDate:S}},p,d,t.isInternationalPaymentShaVsOurEnabled,m,t.vendor);e(qa({billDetailLocalData:h,billId:l}))},saveBillDetails:()=>{e(Ue("draft",!1,!1,l)),e(ie("common"))},updateBillDetailSaveBillCode:()=>{e(Gt("draft"))},reviewBillDetails:()=>{const i=Vi(s,l),d=D(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d,message:"coming_from_edit_page"}})},discardBillDetailsFromLocalStore:({billId:i})=>{e(Se({billId:i}))},clearBillPayReviewLocalState:()=>e(Wa()),onClickDismiss:()=>{const i=ne(s),d=D(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d}})},onClickDiscard:()=>{const i=ne(s),d=D(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d}})},setBillDetailPageMode:i=>{if(i==="edit_bill"){let d=window.location.pathname;d=d.concat("/edit");const p=D(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})}},redirectToACHScreen:i=>{e(ge(!1,i));const d=$i(s,i,l),p=D(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToWireScreen:i=>{e(ge(!1,i));const d=Li(s,i,l),p=D(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToInternationalScreen:i=>{e(ge(!1,i));const d=Wt(s,l,i),p=D(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToBillsScreen:()=>{const i=ne(s),d=D(r.state?.pathnameStackToGoBack,r.pathname);e(Se({})),u(i,{state:{pathnameStackToGoBack:d}})},redirectToBillDetailPage:()=>{t.navigate("../")},deleteBill:()=>{l!=null&&e(Ct(l))},onAttachmentClick:(i,d)=>{const p=Ee(s,i,d);window.open(`${p}`,"_blank")},onBackClick:()=>{const i=W(t.location.state?.pathnameStackToGoBack),d=i.poppedPathname??ne(s);u(d,{state:{pathnameStackToGoBack:i.newStack}})},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,d)=>{i.trim().length>=2?e(ze({searchString:i,entityType:d,searchOrigin:"common"})):i.trim().length===0&&e(ie("common"))},onCancelAutoComplete:()=>{e(ie("common"))}},addVendorContactEmail(i,d){e(Ha(i,d,l))},onWiseVerifyClick:()=>{let i="";i=qn()?"https://sandbox.transferwise.tech":"https://wise.com";const d=`${i}/login`;window.open(d,"_blank")},onVendorSelected:i=>{e(za(!0,i,l))},onInternationalWireVerifyClick:()=>{window.open(`/${s}/bills/international-wire`)},onFetchLinkTokenClick:(i,d)=>{e(Na("bill_pay_detail",i,d))},onEstablishConnectionClick:i=>{e(Oa(i,n,"bill_pay_detail","bill_pay"))},onUpdatePaymentAccountStatus:(i,d,p)=>{e(Ma(i,d,"bill_pay","bill_pay_detail",p))},onEstablishConnectionSuccess:()=>{e(Ga("bill_pay","bill_pay_detail")),e(Za({billId:l,withdrawFromAccountId:o.newAddedBillPaymentAccountId,withdrawFromList:o.withdrawFromList}))}}}))(zn);function bt(){const e=Y(),t=K(),l=le(),{billId:n,tenantEmailDomain:c}=ee(),{useFeatureGate:r,useDynamicConfig:u}=oe(),{isFeatureEnabled:o,isFeatureGateLoading:s}=r(f.isVendorMagicLinkFeatureEnabled),{isFeatureEnabled:i}=r(f.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:d}=r(f.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:p}=r(f.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:m}=r(f.isRecurringBillsFeatureEnabled),{isFeatureEnabled:S}=r(f.isDepositAccountsFeatureEnabled),{isFeatureEnabled:h}=r(f.isShaDisabled),{isFeatureEnabled:b}=r(f.isOurDisabled),{isFeatureEnabled:B}=r(f.isBillPayDetectInsufficientFundsEnabled),{configValue:I}=u(We.sameDayAchDisablementConfig),j=La(I),A=V.getSignedInUser(),T=v((M=>q(M))),k=v((M=>Ge(M,p,S,n))),$=qt(T?.companyId,{clearParams:k.fetchState==="Completed"}),{isAiCfoAccessEnabled:O,onAskAiCfoClick:G}=Xe({mobileExploreReferrer:"Bill Details"});He({isDataReady:k.fetchState==="Completed"});const N=T.companyId??V.getSignedInUserTenant(c)?.companyId,z=fe(),w=$t(z?.loggedInUserRoleMap),Z=Lt(z?.loggedInUserRoleMap),L=de(z?.loggedInUserRoleMap),H=vt(T.userRole);if(g.useEffect((()=>{n!=null&&l(kt(n))}),[n]),g.useEffect((()=>{n!=null&&l(Dt(n))}),[n,l]),A==null)throw Error("Can't access address page without signing in...");const J=v((M=>_a(M.accountState,M.accountListState,"billPayAccountList"))),U={pathname:"../",search:t.search};return k.isDeleted===!0||k.billStage=="paid"||k.fetchState=="Not-Started"?a.jsx(Q,{to:U}):k.deleteStatus.fetchState==="In-Progress"||s?a.jsx(se,{fetchState:k.deleteStatus.fetchState}):a.jsxs(a.Fragment,{children:[a.jsx(Ce,{analytics:E,onLoad:M=>(te=>{n!=null&&k.deleteStatus.fetchState!=="Completed"&&te.trackBillPayEditBill(n,k.isRecurring)})(M)}),a.jsx(Ri,{initialOpenThreadRequest:$??void 0,location:t,navigate:e,currentTenant:T,billId:n,companyId:N,billDetailsView:k,isMagicLinkEnabled:o,isVendorRecommendationEnabled:p,isLocalCurrencyEnabled:d,uncategorizedAccounts:J,isInternationalPaymentShaVsOurEnabled:i,vendor:k.vendor,isShaDisabled:h,isOurDisabled:b,isRecurringBillsFeatureEnabled:m,hasZeniAccountsAdminAccess:w,isZeniAccountsUser:Z,isBillPayAdmin:L,isSuperAdmin:H,isDetectInsufficientFundsEnabled:B,sameDayAchDisablementConfig:j,isAiCfoAccessEnabled:O,onAskAiCfoClick:G})]})}const ht=(e,t,l)=>{let n=`/${e}/bill/`;return l==null?n=t!=null?n.concat(`new/vendor/${encodeURIComponent(t)}/edit`):n.concat("new/vendor/create"):(n=n.concat(`${encodeURIComponent(l)}/edit/vendor/`),n=t!=null?n.concat(`${encodeURIComponent(t)}/edit`):n.concat("create")),n},Vi=(e,t)=>{let l=`/${e}/bill/`;return l=t===void 0?l.concat("new/review"):l.concat(`${t}/edit/review`),l},$i=(e,t,l)=>{let n=`/${e}/bill/`;return n=l!=null?n.concat(`${encodeURIComponent(l)}/edit/`):n.concat("new/"),n=n.concat(`vendor/${encodeURIComponent(t)}/edit/ach`),n},Li=(e,t,l)=>{let n=`/${e}/bill/`;return n=l!=null?n.concat(`${encodeURIComponent(l)}/edit/`):n.concat("new/"),n=n.concat(`vendor/${encodeURIComponent(t)}/edit/domestic`),n},R="paymentDetails",_i=(e,t,l,n,c,r,u)=>{const o={invoiceNumber:t.whatFor.invoiceNumber,memo:t.whatFor.memo,invoiceDate:t.whatFor.invoiceDate?pe(t.whatFor.invoiceDate.toString()):_t(),billDueDate:t.whatFor.billDueDate?pe(t.whatFor.billDueDate.toString()):void 0,currencyCode:t.whatFor.currency,recipientCurrencyCode:t.whatFor.recipientCurrency,isInvoiceDateAutoUpdated:t.whatFor.isInvoiceDateAutoUpdated},s={paymentDate:t[R]?.paymentDate?pe(t[R].paymentDate.toString()):void 0,paymentType:t[R]?.paymentType!=null?t[R]?.paymentType:void 0,paymentTo:r?.id,withdrawFrom:e.withdrawFromList.find((b=>b.id===t[R]?.withdrawFrom?.selectedOption)),internationalTransferFeeBearerPaymentMethod:t[R]?.paymentType?.method!=null&&t[R].paymentType.method.includes(Ja)&&u?.vendorCurrencyCode===he.currencyCode&&c?t[R]?.internationalTransferFeeBearerPaymentMethod:void 0,conversionRate:e.paymentDetailsSection?.conversionRate},i=r?.type==="Contact"?r?.email:void 0,d=!!i,p=t[R]?.recurringPaymentType?.selectedOption===Pi.recurringBill.paymentTypeOptions[1],m={isActive:e.recurringConfig?.isActive??!1,currentInstance:e.recurringConfig?.currentInstance,isApprovalRequired:t[R]?.recurringPaymentDetails?.requireApproval?.selectedOption==="all",frequency:Ya(t[R]?.recurringPaymentDetails?.frequency?.selectedOption),endDate:t[R]?.recurringPaymentDetails?.endDateSelector?.date!=null?pe(t[R]?.recurringPaymentDetails?.endDateSelector.date.toString()):void 0,startDate:t[R]?.recurringPaymentDetails?.startDate?pe(t[R]?.recurringPaymentDetails?.startDate.toString()):void 0,endDateSelectorOptionType:t[R]?.recurringPaymentDetails?.endDateSelector?.type,totalPaymentCycles:t[R]?.recurringPaymentDetails?.endDateSelector?.recurringCount??0,updateRecurringBills:t[R]?.recurringPaymentDetails?.updateRecurringBills},S=Ui(e.accountList.accounts,e.classList.classes,e.lineDetailSection,t.lineItems,n,l),h=Object.keys(S).length>0?Hn(S):e.editBillInitialDetails?.recipientTotalAmount;return{showVendorGptRecommendationText:e.showVendorGptRecommendationText,vendor:u,whatForSection:o,paymentDetailsSection:s,isCancelled:e.isCancelled,totalAmount:h,recipientTotalAmount:h,file:e.file,updatesByLineId:S,toAccountVendorEmail:i,isCollectToAccountInfoFromVendorContact:d,isRecurring:p,recurringConfig:m}},Ui=(e,t,l,n,c,r)=>{const u={};return n.forEach((o=>{let s,i;o.account.selectedOption!=null&&(s=e.find((p=>p.qboId===o.account.selectedOption||p.accountId===o.account.selectedOption))),o.class?.selectedOption!=null&&(i=t.find((p=>p.classId===o.class.selectedOption)));const d=Wn(l[o.lineId],o,c,r);u[o.lineId]={...l[o.lineId],...o,platformLineDetailType:l[o.lineId]?.platformLineDetailType??"account_based_expense_line_detail",amount:{amount:o.amount??0,currencyCode:o.currency?.currencyCode??he.currencyCode,currencySymbol:o.currency?.currencySymbol??he.currencySymbol},recipientAmount:{amount:o.recipientAmount??0,currencyCode:o.recipientCurrency?.currencyCode??he.currencyCode,currencySymbol:o.recipientCurrency?.currencySymbol??he.currencySymbol},id:o.lineId,lineDescription:o.lineDescription??"",account:s,class:i,billable:o.billable?.selectedOption??"not_billable",customer:{id:d?.id??"",name:d?.name??"",qboId:d?.qboId,logo:d?.logo},type:"journal_entry_transaction_line",isCategoryMiscategorized:!1,isClassMiscategorized:!1}})),u},Gi=_.div`
|
|
92
|
+
`,{common:{currency:he},spendManagement:{billPay:{billDetails:Pi}},appName:Fi}=De.getLocalizedStrings(),Ri=K((function(e,t){const l=V.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=W(t.location.state?.pathnameStackToGoBack);let u=!0;r.poppedPathname?.includes("bills")===!0&&(u=!1);const o=e.entityAutoCompleteState.autoCompleteText.common,s=Ne(e,"common");let i=`${l?.firstName} ${l?.lastName}`;const d=Ce(l);t.billId!=null&&t.billDetailsView!=null&&(i=`${t.billDetailsView.createdBy?.firstName??Fi} ${t.billDetailsView.createdBy?.lastName??""}`),d||!t.billDetailsView.createdBy?.email?.includes("zeni.ai")||(i="Zeni");const p=t.billDetailsView.editBillInitialDetails?.totalAmount?.amount,m=Ga(t.billDetailsView.paymentDetailsSection?.paymentType?.method),S=t.currentTenant.createTime,h=_t(),b=t.sameDayAchDisablementConfig.newTenantTenureLimitMonths,C=S.add(b,"month").isAfter(h),I=!!(t.billDetailsView.billStage==="draft"&&m&&p!=null&&p>0)&&!Gt(p,t.billDetailsView.approvalRules.allApprovalRules,l,t.billDetailsView.vendor?.id,t.billDetailsView.classId),j=q(e);return{billDetails:t.billDetailsView,isAccountingClassesEnabled:xt(e),billId:t.billId,createdBy:i,createTime:t.billDetailsView?.createTime,authParams:c,transactionAttachmentEndpoint:`${qe}/transaction_attachment`,analytics:E,showBackButton:u,isAdmin:t.isBillPayAdmin,isSuperAdmin:t.isSuperAdmin,connectedAccountProvider:j.company?.featuresActivationInfo.connectedAccountProvider??"",customerSearchAutoCompleteData:{autoCompleteText:o,entityAutoCompleteView:s},showMarkAsPaidInfo:I,isZeniUser:d,isNewUser:C,sameDayAchDisablementConfig:t.sameDayAchDisablementConfig}}),(function(e,t){const{billId:l,companyId:n,currentTenant:c,location:r,navigate:u,billDetailsView:o}=t,{tenantEmailDomain:s}=c;return{editVendor:i=>{e(nt(i));const d=ht(s,i,l),p=D(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},chooseNewVendor:i=>{const d=i??t.billDetailsView.addBillAutoFields.tentativeVendorName;d!=null&&e(Zt(d,!1)),e(Mt({localData:{vendorName:i??t.billDetailsView.addBillAutoFields.tentativeVendorName}})),e(nt());const p=ht(s,void 0,l),m=D(r.state?.pathnameStackToGoBack,r.pathname);u(p,{state:{pathnameStackToGoBack:m}})},onInvoiceUpload:i=>{i!=null&&e(Me(i,t.isVendorRecommendationEnabled))},updateShowAutofill:i=>{e(Ze(i))},onSaveChangesToLocalStore:(i,d,p,m,S)=>{const h=_i(t.billDetailsView,{...i,paymentDetails:{...i?.paymentDetails,paymentDate:S}},p,d,t.isInternationalPaymentShaVsOurEnabled,m,t.vendor);e(qa({billDetailLocalData:h,billId:l}))},saveBillDetails:()=>{e(Ge("draft",!1,!1,l)),e(ie("common"))},updateBillDetailSaveBillCode:()=>{e(Ut("draft"))},reviewBillDetails:()=>{const i=Vi(s,l),d=D(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d,message:"coming_from_edit_page"}})},discardBillDetailsFromLocalStore:({billId:i})=>{e(Se({billId:i}))},clearBillPayReviewLocalState:()=>e(Wa()),onClickDismiss:()=>{const i=ne(s),d=D(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d}})},onClickDiscard:()=>{const i=ne(s),d=D(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d}})},setBillDetailPageMode:i=>{if(i==="edit_bill"){let d=window.location.pathname;d=d.concat("/edit");const p=D(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})}},redirectToACHScreen:i=>{e(ge(!1,i));const d=$i(s,i,l),p=D(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToWireScreen:i=>{e(ge(!1,i));const d=Li(s,i,l),p=D(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToInternationalScreen:i=>{e(ge(!1,i));const d=Wt(s,l,i),p=D(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToBillsScreen:()=>{const i=ne(s),d=D(r.state?.pathnameStackToGoBack,r.pathname);e(Se({})),u(i,{state:{pathnameStackToGoBack:d}})},redirectToBillDetailPage:()=>{t.navigate("../")},deleteBill:()=>{l!=null&&e(At(l))},onAttachmentClick:(i,d)=>{const p=Ee(s,i,d);window.open(`${p}`,"_blank")},onBackClick:()=>{const i=W(t.location.state?.pathnameStackToGoBack),d=i.poppedPathname??ne(s);u(d,{state:{pathnameStackToGoBack:i.newStack}})},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,d)=>{i.trim().length>=2?e(ze({searchString:i,entityType:d,searchOrigin:"common"})):i.trim().length===0&&e(ie("common"))},onCancelAutoComplete:()=>{e(ie("common"))}},addVendorContactEmail(i,d){e(Ha(i,d,l))},onWiseVerifyClick:()=>{let i="";i=qn()?"https://sandbox.transferwise.tech":"https://wise.com";const d=`${i}/login`;window.open(d,"_blank")},onVendorSelected:i=>{e(za(!0,i,l))},onInternationalWireVerifyClick:()=>{window.open(`/${s}/bills/international-wire`)},onFetchLinkTokenClick:(i,d)=>{e(Na("bill_pay_detail",i,d))},onEstablishConnectionClick:i=>{e(Oa(i,n,"bill_pay_detail","bill_pay"))},onUpdatePaymentAccountStatus:(i,d,p)=>{e(Ma(i,d,"bill_pay","bill_pay_detail",p))},onEstablishConnectionSuccess:()=>{e(Ua("bill_pay","bill_pay_detail")),e(Za({billId:l,withdrawFromAccountId:o.newAddedBillPaymentAccountId,withdrawFromList:o.withdrawFromList}))}}}))(zn);function bt(){const e=Y(),t=X(),l=le(),{billId:n,tenantEmailDomain:c}=ee(),{useFeatureGate:r,useDynamicConfig:u}=oe(),{isFeatureEnabled:o,isFeatureGateLoading:s}=r(f.isVendorMagicLinkFeatureEnabled),{isFeatureEnabled:i}=r(f.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:d}=r(f.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:p}=r(f.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:m}=r(f.isRecurringBillsFeatureEnabled),{isFeatureEnabled:S}=r(f.isDepositAccountsFeatureEnabled),{isFeatureEnabled:h}=r(f.isShaDisabled),{isFeatureEnabled:b}=r(f.isOurDisabled),{isFeatureEnabled:C}=r(f.isBillPayDetectInsufficientFundsEnabled),{configValue:I}=u(We.sameDayAchDisablementConfig),j=La(I),B=V.getSignedInUser(),T=v((M=>q(M))),k=v((M=>Ue(M,p,S,n))),$=qt(T?.companyId,{clearParams:k.fetchState==="Completed"}),{isAiCfoAccessEnabled:O,onAskAiCfoClick:U}=Ke({mobileExploreReferrer:"Bill Details"});He({isDataReady:k.fetchState==="Completed"});const N=T.companyId??V.getSignedInUserTenant(c)?.companyId,z=fe(),w=$t(z?.loggedInUserRoleMap),Z=Lt(z?.loggedInUserRoleMap),L=de(z?.loggedInUserRoleMap),H=vt(T.userRole);if(g.useEffect((()=>{n!=null&&l(kt(n))}),[n]),g.useEffect((()=>{n!=null&&l(Dt(n))}),[n,l]),B==null)throw Error("Can't access address page without signing in...");const J=v((M=>_a(M.accountState,M.accountListState,"billPayAccountList"))),G={pathname:"../",search:t.search};return k.isDeleted===!0||k.billStage=="paid"||k.fetchState=="Not-Started"?a.jsx(Q,{to:G}):k.deleteStatus.fetchState==="In-Progress"||s?a.jsx(se,{fetchState:k.deleteStatus.fetchState}):a.jsxs(a.Fragment,{children:[a.jsx(Ae,{analytics:E,onLoad:M=>(te=>{n!=null&&k.deleteStatus.fetchState!=="Completed"&&te.trackBillPayEditBill(n,k.isRecurring)})(M)}),a.jsx(Ri,{initialOpenThreadRequest:$??void 0,location:t,navigate:e,currentTenant:T,billId:n,companyId:N,billDetailsView:k,isMagicLinkEnabled:o,isVendorRecommendationEnabled:p,isLocalCurrencyEnabled:d,uncategorizedAccounts:J,isInternationalPaymentShaVsOurEnabled:i,vendor:k.vendor,isShaDisabled:h,isOurDisabled:b,isRecurringBillsFeatureEnabled:m,hasZeniAccountsAdminAccess:w,isZeniAccountsUser:Z,isBillPayAdmin:L,isSuperAdmin:H,isDetectInsufficientFundsEnabled:C,sameDayAchDisablementConfig:j,isAiCfoAccessEnabled:O,onAskAiCfoClick:U})]})}const ht=(e,t,l)=>{let n=`/${e}/bill/`;return l==null?n=t!=null?n.concat(`new/vendor/${encodeURIComponent(t)}/edit`):n.concat("new/vendor/create"):(n=n.concat(`${encodeURIComponent(l)}/edit/vendor/`),n=t!=null?n.concat(`${encodeURIComponent(t)}/edit`):n.concat("create")),n},Vi=(e,t)=>{let l=`/${e}/bill/`;return l=t===void 0?l.concat("new/review"):l.concat(`${t}/edit/review`),l},$i=(e,t,l)=>{let n=`/${e}/bill/`;return n=l!=null?n.concat(`${encodeURIComponent(l)}/edit/`):n.concat("new/"),n=n.concat(`vendor/${encodeURIComponent(t)}/edit/ach`),n},Li=(e,t,l)=>{let n=`/${e}/bill/`;return n=l!=null?n.concat(`${encodeURIComponent(l)}/edit/`):n.concat("new/"),n=n.concat(`vendor/${encodeURIComponent(t)}/edit/domestic`),n},R="paymentDetails",_i=(e,t,l,n,c,r,u)=>{const o={invoiceNumber:t.whatFor.invoiceNumber,memo:t.whatFor.memo,invoiceDate:t.whatFor.invoiceDate?pe(t.whatFor.invoiceDate.toString()):_t(),billDueDate:t.whatFor.billDueDate?pe(t.whatFor.billDueDate.toString()):void 0,currencyCode:t.whatFor.currency,recipientCurrencyCode:t.whatFor.recipientCurrency,isInvoiceDateAutoUpdated:t.whatFor.isInvoiceDateAutoUpdated},s={paymentDate:t[R]?.paymentDate?pe(t[R].paymentDate.toString()):void 0,paymentType:t[R]?.paymentType!=null?t[R]?.paymentType:void 0,paymentTo:r?.id,withdrawFrom:e.withdrawFromList.find((b=>b.id===t[R]?.withdrawFrom?.selectedOption)),internationalTransferFeeBearerPaymentMethod:t[R]?.paymentType?.method!=null&&t[R].paymentType.method.includes(Ja)&&u?.vendorCurrencyCode===he.currencyCode&&c?t[R]?.internationalTransferFeeBearerPaymentMethod:void 0,conversionRate:e.paymentDetailsSection?.conversionRate},i=r?.type==="Contact"?r?.email:void 0,d=!!i,p=t[R]?.recurringPaymentType?.selectedOption===Pi.recurringBill.paymentTypeOptions[1],m={isActive:e.recurringConfig?.isActive??!1,currentInstance:e.recurringConfig?.currentInstance,isApprovalRequired:t[R]?.recurringPaymentDetails?.requireApproval?.selectedOption==="all",frequency:Ya(t[R]?.recurringPaymentDetails?.frequency?.selectedOption),endDate:t[R]?.recurringPaymentDetails?.endDateSelector?.date!=null?pe(t[R]?.recurringPaymentDetails?.endDateSelector.date.toString()):void 0,startDate:t[R]?.recurringPaymentDetails?.startDate?pe(t[R]?.recurringPaymentDetails?.startDate.toString()):void 0,endDateSelectorOptionType:t[R]?.recurringPaymentDetails?.endDateSelector?.type,totalPaymentCycles:t[R]?.recurringPaymentDetails?.endDateSelector?.recurringCount??0,updateRecurringBills:t[R]?.recurringPaymentDetails?.updateRecurringBills},S=Gi(e.accountList.accounts,e.classList.classes,e.lineDetailSection,t.lineItems,n,l),h=Object.keys(S).length>0?Hn(S):e.editBillInitialDetails?.recipientTotalAmount;return{showVendorGptRecommendationText:e.showVendorGptRecommendationText,vendor:u,whatForSection:o,paymentDetailsSection:s,isCancelled:e.isCancelled,totalAmount:h,recipientTotalAmount:h,file:e.file,updatesByLineId:S,toAccountVendorEmail:i,isCollectToAccountInfoFromVendorContact:d,isRecurring:p,recurringConfig:m}},Gi=(e,t,l,n,c,r)=>{const u={};return n.forEach((o=>{let s,i;o.account.selectedOption!=null&&(s=e.find((p=>p.qboId===o.account.selectedOption||p.accountId===o.account.selectedOption))),o.class?.selectedOption!=null&&(i=t.find((p=>p.classId===o.class.selectedOption)));const d=Wn(l[o.lineId],o,c,r);u[o.lineId]={...l[o.lineId],...o,platformLineDetailType:l[o.lineId]?.platformLineDetailType??"account_based_expense_line_detail",amount:{amount:o.amount??0,currencyCode:o.currency?.currencyCode??he.currencyCode,currencySymbol:o.currency?.currencySymbol??he.currencySymbol},recipientAmount:{amount:o.recipientAmount??0,currencyCode:o.recipientCurrency?.currencyCode??he.currencyCode,currencySymbol:o.recipientCurrency?.currencySymbol??he.currencySymbol},id:o.lineId,lineDescription:o.lineDescription??"",account:s,class:i,billable:o.billable?.selectedOption??"not_billable",customer:{id:d?.id??"",name:d?.name??"",qboId:d?.qboId,logo:d?.logo},type:"journal_entry_transaction_line",isCategoryMiscategorized:!1,isClassMiscategorized:!1}})),u},Ui=_.div`
|
|
93
93
|
display: flex;
|
|
94
94
|
height: 100vh;
|
|
95
95
|
width: 100%;
|
|
@@ -97,8 +97,8 @@ import{j as a}from"./liveblocks-Css5YxVy.js";import{h as Y,u as le,g as K,i as e
|
|
|
97
97
|
flex-direction: column;
|
|
98
98
|
align-items: center;
|
|
99
99
|
background-color: ${e=>e.theme.colors.grey4};
|
|
100
|
-
box-shadow: ${e=>`0px 2px ${
|
|
101
|
-
`,Zi=
|
|
100
|
+
box-shadow: ${e=>`0px 2px ${A.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
101
|
+
`,Zi=K((function(e,t){const{vendorId:l,billId:n}=t,c=ye(e,l),r=Ue(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,n);return{billId:n,isDisabled:c.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:c,file:r.file,bankAccountContext:t.bankAccountContext}}),(function(e,t){const{billId:l,navigate:n,location:c,vendorId:r,currentTenant:u}=t,{tenantEmailDomain:o}=u;return{onFetchBankNameBySwift:s=>{e(en(s))},onSaveHandler:()=>{e(Qa(t.bankAccountContext,r))},onBankDetailsUpdated:s=>{const{internationalWireSwiftAccountSection:i}=s;e(Ka({data:i}))},onCancel:()=>{(()=>{const s=W(c.state?.pathnameStackToGoBack),i=s.poppedPathname??gt();n(i,{state:{pathnameStackToGoBack:s.newStack}})})(),e(it())},onAddressClick:s=>{const i=Xe(o,s,l),d=D(c.state?.pathnameStackToGoBack,c.pathname);n(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{e(Xa({fetchState:"Not-Started"}));const s=W(t.location.state?.pathnameStackToGoBack),i=s.poppedPathname??gt(0);t.navigate(i,{state:{pathnameStackToGoBack:s.newStack}}),e(it())}}}))(Jn);function Mi(){const e=Y(),t=X(),l=Ie(),{vendorId:n,billId:c}=ee(),{useFeatureGate:r}=oe(),u=ue(),o=V.getSignedInUser(),s=v((h=>q(h))),i=W(t.state?.pathnameStackToGoBack),d=i.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail",p=v((h=>ye(h,n))),{isFeatureEnabled:m}=r(f.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:S}=r(f.isDepositAccountsFeatureEnabled);if(o==null)throw Error("Can't access address page without signing in...");return d==="billDetail"&&p.editVendorState?.saveStatus.fetchState==="In-Progress"?a.jsx(se,{fetchState:p.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:u.colors.grey5,boxShadow:`0px 2px ${A.sp1} ${u.colors.dropShadowNormal}`}}):a.jsxs(Ui,{windowSize:l,children:[a.jsx(Ye,{vendorId:n,billId:c}),a.jsx(Zi,{location:t,navigate:e,billId:c,vendorId:n,currentTenant:s,bankAccountContext:d,isVendorRecommendationEnabled:m,isZeniAccountsFeatureEnabled:S})]})}const gt=(e=2)=>{let t="../";for(let l=0;l<e;l++)t=`${t}../`;return t},Oi=_.div`
|
|
102
102
|
display: flex;
|
|
103
103
|
height: 100vh;
|
|
104
104
|
width: 100%;
|
|
@@ -106,8 +106,8 @@ import{j as a}from"./liveblocks-Css5YxVy.js";import{h as Y,u as le,g as K,i as e
|
|
|
106
106
|
flex-direction: column;
|
|
107
107
|
align-items: center;
|
|
108
108
|
background-color: ${e=>e.theme.colors.grey4};
|
|
109
|
-
box-shadow: ${e=>`0px 2px ${
|
|
110
|
-
`,Ni=
|
|
109
|
+
box-shadow: ${e=>`0px 2px ${A.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
110
|
+
`,Ni=K((function(e,t){const{vendorId:l}=t,n=ye(e,l),c=l!=null?n.editVendorState?.vendorDetailLocalData?.vendorType:n.newVendorState?.vendorDetailLocalData?.vendorType,r=an(e,c||"international_business",t.billId),u=n.editVendorState??n.newVendorState,o=t.billId!=null?e.editBillDetailViewState.editBillStateById[nn(t.billId)].billDetailLocalData.recipientTotalAmount?.amount:e.editBillDetailViewState.newBillState.billDetailLocalData.recipientTotalAmount?.amount;return{internationalWireView:r,vendorViewDetails:n,bankAccountContext:t.bankAccountContext,vendorType:c||"international_business",addressType:"vendor_address",addressToEdit:u?.vendorNewAddressStatus?.addressToCreate,mailingAddress:u?.vendorAddress,billAmount:o??0}}),(function(e,t){const{billId:l,navigate:n,location:c,vendorId:r,currentTenant:u}=t,{tenantEmailDomain:o}=u;return{onSaveHandler:()=>{e(cn(t.bankAccountContext,r))},onAccountDetailsUpdated:(s,i,d,p)=>{e(sn(s)),p&&e(rn(i,d))},onCurrencyUpdated:(s,i,d)=>{e(ln(s,i,d,!1))},onCancel:()=>{(()=>{const s=W(c.state?.pathnameStackToGoBack),i=s.poppedPathname??St();n(i,{state:{pathnameStackToGoBack:s.newStack}})})(),e(ot())},onAddressClick:s=>{const i=Xe(o,s,l),d=D(c.state?.pathnameStackToGoBack,c.pathname);n(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{e(on({fetchState:"Not-Started"}));const s=W(t.location.state?.pathnameStackToGoBack),i=s.poppedPathname??St(0);t.navigate(i,{state:{pathnameStackToGoBack:s.newStack}}),e(ot())}}}))(Yn);function zi(){const e=Y(),t=X(),l=Ie(),{vendorId:n,billId:c}=ee(),r=le(),u=ue(),o=V.getSignedInUser(),s=v((B=>q(B))),i=W(t.state?.pathnameStackToGoBack),[d,p]=g.useState(!1),m=v((B=>B.vendorViewState.newVendorState.fetchStatus.fetchState)),S=v((B=>n!=null?B.vendorViewState.editVendorStateById[n]?.fetchStatus.fetchState??"Not-Started":"Not-Started")),h=n!==void 0?S:m;g.useEffect((()=>{d===!1&&h==="Not-Started"&&n!=null&&(r(ge(!1,n)),p(!0))}),[d,h,n]);const[b,C]=g.useState(!1);g.useEffect((()=>{b||h==="In-Progress"||(C(!0),r(tn(c,n)))}),[b,h,r]);const I=i.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail",j=v((B=>ye(B,n)));if(o==null)throw Error("Can't access international wire page without signing in...");return I==="billDetail"&&j.editVendorState?.saveStatus.fetchState==="In-Progress"?a.jsx(se,{fetchState:j.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:u.colors.grey5,boxShadow:`0px 2px ${A.sp1} ${u.colors.dropShadowNormal}`}}):a.jsxs(Oi,{windowSize:l,children:[a.jsx(Ye,{vendorId:n,billId:c}),a.jsx(Ni,{location:t,navigate:e,billId:c,vendorId:n,currentTenant:s,bankAccountContext:I})]})}const St=(e=2)=>{let t="../";for(let l=0;l<e;l++)t=`${t}../`;return t},yt=_.div`
|
|
111
111
|
display: flex;
|
|
112
112
|
height: 100vh;
|
|
113
113
|
width: 100%;
|
|
@@ -115,5 +115,5 @@ import{j as a}from"./liveblocks-Css5YxVy.js";import{h as Y,u as le,g as K,i as e
|
|
|
115
115
|
flex-direction: column;
|
|
116
116
|
align-items: center;
|
|
117
117
|
background-color: ${e=>e.theme.colors.grey4};
|
|
118
|
-
box-shadow: ${e=>`0px 2px ${
|
|
119
|
-
`,Hi=X((function(e,t){const l=V.getSignedInUser(),n=Ot(e,t.billId),c=un(e),r=Be(l),u=n.totalAmount.amount,o=n.billPayInfo?.stage.code!=="scheduled"&&c.allApprovalRules.length>0&&!Ut(u,c.allApprovalRules,l,n.vendor?.id,n.classId);return{billDetails:n,billId:t.billId,billpayApprovalView:c,analytics:E,isApprovalRequiredForMarkAsPaid:o,isZeniUser:r}}),(function(e,t){const{location:l,billId:n,currentTenant:c,navigate:r}=t,{tenantEmailDomain:u}=c;return{redirectToBillsScreen:()=>{const o=ne(c.tenantEmailDomain),s=D(l.state?.pathnameStackToGoBack,l.pathname);r(o,{state:{pathnameStackToGoBack:s}})},discardBillDetailsFromLocalStore:()=>{e(Se({}))},saveBillDetails:(o,s)=>{o&&e(Bt({billId:n,data:s})),e(Ue(o?"paid":"pending_approval",o,!1,n))},discardOutsideZeniPaymentData:()=>{e(At({billId:n}))},updateBillDetailSaveBillCode:()=>{e(Gt("pending_approval"))},onClickEdit:()=>{t.navigate("../",{relative:"path"})},onAttachmentClick:(o,s)=>{const i=Ee(u,o,s);window.open(`${i}`,"_blank")},retryPayment:()=>{t.billId!=null&&e(xe(t.billId,"retry"))}}}))(Xn);function ft(){const e=Y(),t=le(),l=K(),{billId:n}=ee(),{useFeatureGate:c}=oe(),{isFeatureEnabled:r}=c(f.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:u}=c(f.isBillPayDetectInsufficientFundsEnabled),o=Ie(),s=V.getSignedInUser(),{isFeatureEnabled:i}=c(f.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:d}=c(f.isVendorRecommendationFeatureEnabled),p=W(l.state?.pathnameStackToGoBack),{poppedPathname:m}=p,{isFeatureEnabled:S}=c(f.isRecurringBillsFeatureEnabled),h=v((I=>q(I))),b=v((I=>Ot(I,n))),B=b.fetchState??"Not-Started";if(g.useEffect((()=>(window.onbeforeunload=function(){return e(l,{state:{message:""}}),!0},()=>{window.onbeforeunload=null})),[e]),g.useEffect((()=>{l.state?.message!=="coming_from_edit_page"&&e(`../${n}`)}),[]),g.useEffect((()=>{const I=b.vendor?.name,j=b.vendor?.id,A=b.totalAmount.amount,T=b.recipientTotalAmount.amount,k=b.invoiceNumber;I&&j&&t(dn(I,j,A,T,k,n))}),[]),m==null)return a.jsx(Q,{to:`../${n}`});if(s==null)throw Error("Can't access address page without signing in...");return B==="In-Progress"?a.jsx(yt,{windowSize:o,children:a.jsx(Kn,{})}):a.jsx(yt,{windowSize:o,children:a.jsx(Hi,{location:l,navigate:e,currentTenant:h,billId:n,isLocalCurrencyEnabled:i,isVendorRecommendationEnabled:d,isInternationalPaymentShaVsOurEnabled:r,isRecurringBillsFeatureEnabled:S,isDetectInsufficientFundsEnabled:u})})}const Wi=X((function(e,t){const{vendorId:l}=t,n=e.entityAutoCompleteState.autoCompleteText.common,c=Ne(e,"common"),r=l!=null?"edit":"create",u=q(e),o=V.getSignedInUser(),s=u.tenantId,i={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:s??""};return{vendorViewDetails:t.vendorViewDetails,screenType:r,filesEndPoint:`${zt.fileMicroServiceBaseUrl}`,authParams:i,analytics:E,vendorSearchAutoCompleteData:{autoCompleteText:n,entityAutoCompleteView:c}}}),(function(e,t){const{billId:l,currentTenant:n,navigate:c,location:r,vendorId:u,themeState:o}=t,{tenantEmailDomain:s}=n;return{onSaveVendor:i=>{e(xn(u??void 0,t.billId)),i!=null&&e(An(i))},saveVendorDetailLocalData:i=>{e(Mt({vendorId:u,localData:i}))},saveContactsInVendorDetailLocalData:i=>{e(wn({vendorId:u,contacts:i}))},resetVendorDetailLocalData:()=>{e(lt(u))},updateSelectedVendorForCreate:i=>{e(kn(i))},navigateToBankDetailPage:(i,d)=>{let p;i==="wire"?p=d==="international"?Wt(s,t.billId,u):ci(s,t.billId,u):p=ri(s,t.billId,u);const m=D(r.state?.pathnameStackToGoBack,r.pathname);c(p,{state:{pathnameStackToGoBack:m}})},onRemoveBankAccount:(i,d)=>{e(d===!0?In(i,"vendor",u):vn(i,"vendor",u))},navigateToMailingAddressPage:i=>{const d=Ke(s,i,l),p=D(r.state?.pathnameStackToGoBack,r.pathname);c(d,{state:{pathnameStackToGoBack:p}})},updateFilesEntity:i=>{e(fn({files:i}))},onEditFileName:(i,d)=>{e(yn(i,d.split(".")[0]))},handleZeniLogoClick:()=>{o.toggle()},updateSaveFetchState:()=>{u==null&&e(lt(t.vendorViewDetails.newVendorState?.vendorBasic?.id)),e(Sn("Not-Started",u))},onVendorSelected:i=>{i!=null&&e(gn(i,!0))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,d)=>{i.trim().length>=2?e(ze({searchString:i,entityType:d,searchOrigin:"common"})):i.trim().length===0&&e(ie("common"))},onCancelAutoComplete:()=>{e(ie("common"))}},onBackClick:()=>{e(ie("common"));const i=W(t.location.state?.pathnameStackToGoBack),d=i.poppedPathname??si(n.tenantEmailDomain,t.billId);c(d,{state:{pathnameStackToGoBack:i.newStack}})},onGetOtp:i=>{e(hn(i,"BillPayVendor"))},onResendOtp:i=>{e(bn(i,"BillPayVendor"))},onVerifyOtp:(i,d)=>{e(mn(i,d,"BillPayVendor"))},onVerifyOtpSuccess:(i,d,p)=>{e(pn(i,d,p))},onFetchAndUpdateVendorRecommendations:i=>{e(Zt(i,!1))}}}))(ai),we=()=>{const e=Y(),t=le(),l=Qn(),n=K(),{billId:c,vendorId:r}=ee(),u=v((b=>q(b))),{useFeatureGate:o}=oe(),{isFeatureEnabled:s}=o(f.isBillPayLocalCurrencyFeatureEnabled),[i,d]=g.useState(!1),p=v((b=>b.vendorViewState.newVendorState.fetchStatus.fetchState)),m=v((b=>ye(b,r))),S=v((b=>r!==void 0?b.vendorViewState.editVendorStateById[r]?.fetchStatus??"Not-Started":"Not-Started")),h=r!==void 0?S:p;return g.useEffect((()=>{i===!1&&h==="Not-Started"&&r!=null&&(t(ge(!1,r)),d(!0))}),[i,h,r]),m.fetchState==="Not-Started"||m.fetchState==="In-Progress"?a.jsx(ei,{}):h==="Error"?a.jsx(ti,{onGoHome:()=>e("../",{replace:!0}),onReload:()=>window.location.reload()}):a.jsxs(a.Fragment,{children:[a.jsx(Ye,{vendorId:r,billId:c}),a.jsx(Wi,{navigate:e,location:n,themeState:l,currentTenant:u,vendorId:r,billId:c,vendorViewDetails:m,isLocalCurrencyEnabled:s})]})},qi=X((function(e,t){const{companyId:l}=t;return{billPaySetupView:Bn(e,l),analytics:E,videoUrl:"https://player.vimeo.com/video/787873426?h=9d9389b1dc&badge=0&autopause=0&player_id=0&app_id=58479"}}),(function(e,t){const{companyId:l,navigate:n}=t;return{onButtonClick:()=>{e(Cn(l))},onBackClick:()=>{n("../..",{relative:"path"})},onSetupBillPaySuccess:()=>{n("../bills/setup",{relative:"path"})}}}))(ii),Ji=()=>{const e=ni(),t=Y(),l=K(),{tenantEmailDomain:n}=ee(),[c,r]=g.useState(!1),u=ue(),o=v((h=>q(h))),s=o.companyId??V.getSignedInUserTenant(n)?.companyId,i=V.getSignedInUser(),d=fe(),p=!!o.companyBillPayInfo?.info?.isBillPayTOSAccepted,m=de(d?.loggedInUserRoleMap),S=h=>{r(h)};if(i==null)throw Error("Can't access bill pay promo page without signing in...");return o.companyBillPayInfo?.info?.isBillPayEnabled===!0?a.jsx(Q,{to:"../../../bills"}):p===!0&&m===!0?a.jsx(Q,{to:"../../bills/setup"}):p===!1||d!=null&&Oe(o,d.loggedInUserRoleMap)?a.jsxs(a.Fragment,{children:[a.jsx(Ce,{analytics:E,onLoad:h=>(b=>b.trackPageLoaded(Ht.Event.billPayPromoPage))(h)}),a.jsx(Jt,{isAppContentDrawerOpen:c,handleDrawerToggle:S}),a.jsx(qi,{companyId:s,navigate:t,location:l,meetingUrl:e("bill_pay_promo"),onClickMenuIcon:()=>{S(!0)}})]}):a.jsx(se,{fetchState:"In-Progress",style:{backgroundColor:u.colors.grey5}})};function To(){const e=v((H=>q(H))),t=fe(),l=de(t?.loggedInUserRoleMap),n=ue(),{useFeatureGate:c}=oe(),{isFeatureEnabled:r}=c(f.isBillPayLocalCurrencyFeatureEnabled),u=r===!0?zi:Mi,{isFeatureEnabled:o}=c(f.isDebitCardFeatureEnabled),s=Rt(o,e),i=Vt(e),d=K(),p=e?.userRole!=null&&It(e?.userRole),m=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!p)&&de(t?.loggedInUserRoleMap),S=Ft(t?.loggedInUserRoleMap),h=(e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!p)&&Dn(t?.loggedInUserRoleMap),b=!!e.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!p,B=b&&$t(t?.loggedInUserRoleMap),{isFeatureEnabled:I}=c(f.isChargeCardFeatureEnabled),j=oi(e,I,o)&&!p,A=j&&En(t?.loggedInUserRoleMap),T=Tn(t?.loggedInUserRoleMap),k=Lt(t?.loggedInUserRoleMap),$=jn(t?.loggedInUserRoleMap),O=b&&k,G=e.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!p&&$,N=Pn(t?.loggedInUserRoleMap),z=Fn(t?.loggedInUserRoleMap),w=Rn(t?.loggedInUserRoleMap),Z=j&&N,{tenantEmailDomain:L}=ee();return a.jsxs(na,{children:[d.pathname.includes("/bills")?a.jsxs(a.Fragment,{children:[a.jsx(y,{path:"setup",element:a.jsx(Te,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:S,isReimbursementAdminLevelAccess:h,isZeniAccountAdminLevelAccess:B,isChargeCardAdminLevelAccess:A,isUserHasOnlyCardAccess:T,productType:"bill_pay",type:"setup"})}),a.jsx(y,{path:"verification",element:a.jsx(Te,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:S,isReimbursementAdminLevelAccess:h,isZeniAccountAdminLevelAccess:B,isChargeCardAdminLevelAccess:A,isUserHasOnlyCardAccess:T,productType:"bill_pay",type:"verification"})}),a.jsx(y,{path:"promo",element:a.jsx(Ji,{})}),a.jsx(y,{path:"approval-rules/*",element:m?a.jsx(pi,{}):a.jsx(mi,{showZeniAccountRoute:O,isUserHasBillPayAccess:z,isUserHasReimbursementAccess:w,showTreasuryRoute:G,isTenantBankingOnly:s,showChargeCardRoute:Z,tenantEmailDomain:L??""})}),a.jsx(y,{path:"international-wire",element:a.jsx(Te,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:S,isReimbursementAdminLevelAccess:h,isZeniAccountAdminLevelAccess:B,isChargeCardAdminLevelAccess:A,isUserHasOnlyCardAccess:T,productType:"bill_pay",type:"international-wire"})}),e.companyBillPayInfo?.info?.isBillPayEnabled===!0&&a.jsx(y,{path:"*",element:a.jsx(Ei,{})}),(s===!0||i===!0)&&a.jsx(y,{path:"/*",element:a.jsx(Yt,{})}),e.companyBillPayInfo?.info?.isBillPayTOSAccepted===!0&&l&&a.jsx(y,{path:"*",element:a.jsx(Q,{to:"../setup"})}),t!=null&&Oe(e,t.loggedInUserRoleMap)&&a.jsx(y,{path:"*",element:a.jsx(Q,{to:"../promo"})})]}):d.pathname.includes("/bill")?a.jsxs(a.Fragment,{children:[a.jsx(y,{path:"new",element:a.jsx(x,{appContent:a.jsx(bt,{})})}),a.jsx(y,{path:":billId",element:a.jsx(x,{appContent:a.jsx(hi,{})})}),a.jsx(y,{path:":billId/edit",element:a.jsx(x,{appContent:a.jsx(bt,{})})}),a.jsx(y,{path:"new/review",element:a.jsx(x,{appContent:a.jsx(ft,{})})}),a.jsx(y,{path:":billId/edit/review",element:a.jsx(x,{appContent:a.jsx(ft,{})})}),a.jsx(y,{path:"/:billId/:addressType",element:a.jsx(x,{appContent:a.jsx(ct,{isSubPage:!0})})}),a.jsx(y,{path:"/new/:addressType",element:a.jsx(x,{appContent:a.jsx(ct,{isSubPage:!0})})}),a.jsx(y,{path:"new/vendor/create",element:a.jsx(x,{appContent:a.jsx(we,{})})}),a.jsx(y,{path:"new/vendor/:vendorId/edit",element:a.jsx(x,{appContent:a.jsx(we,{})})}),a.jsx(y,{path:"new/vendor/:vendorId/edit/ach",element:a.jsx(x,{appContent:a.jsx(me,{})})}),a.jsx(y,{path:"new/vendor/:vendorId/edit/domestic",element:a.jsx(x,{appContent:a.jsx(be,{})})}),a.jsx(y,{path:"new/vendor/:vendorId/edit/international",element:a.jsx(x,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:"new/vendor/create/ach",element:a.jsx(x,{appContent:a.jsx(me,{})})}),a.jsx(y,{path:"new/vendor/create/domestic",element:a.jsx(x,{appContent:a.jsx(be,{})})}),a.jsx(y,{path:"new/vendor/create/international",element:a.jsx(x,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/ach",element:a.jsx(x,{appContent:a.jsx(me,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/domestic",element:a.jsx(x,{appContent:a.jsx(be,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/international",element:a.jsx(x,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:":billId/edit/vendor/create",element:a.jsx(x,{appContent:a.jsx(we,{})})}),a.jsx(y,{path:":billId/edit/vendor/:vendorId/edit",element:a.jsx(x,{appContent:a.jsx(we,{})})}),a.jsx(y,{path:":billId/edit/vendor/:vendorId/edit/ach",element:a.jsx(x,{appContent:a.jsx(me,{})})}),a.jsx(y,{path:":billId/edit/vendor/:vendorId/edit/domestic",element:a.jsx(x,{appContent:a.jsx(be,{})})}),a.jsx(y,{path:":billId/edit/vendor/:vendorId/edit/international",element:a.jsx(x,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/ach",element:a.jsx(x,{appContent:a.jsx(me,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/domestic",element:a.jsx(x,{appContent:a.jsx(be,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/international",element:a.jsx(x,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:"*",element:a.jsx(Ae,{})})]}):a.jsx(y,{path:"*",element:a.jsx(se,{fetchState:"In-Progress",style:{backgroundColor:n.colors.grey5,boxShadow:`0px 2px ${C.sp1} ${n.colors.dropShadowNormal}`}})}),a.jsx(y,{path:"*",element:a.jsx(Ae,{})})]})}export{To as default};
|
|
118
|
+
box-shadow: ${e=>`0px 2px ${A.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
119
|
+
`,Hi=K((function(e,t){const l=V.getSignedInUser(),n=Ot(e,t.billId),c=un(e),r=Ce(l),u=n.totalAmount.amount,o=n.billPayInfo?.stage.code!=="scheduled"&&c.allApprovalRules.length>0&&!Gt(u,c.allApprovalRules,l,n.vendor?.id,n.classId);return{billDetails:n,billId:t.billId,billpayApprovalView:c,analytics:E,isApprovalRequiredForMarkAsPaid:o,isZeniUser:r}}),(function(e,t){const{location:l,billId:n,currentTenant:c,navigate:r}=t,{tenantEmailDomain:u}=c;return{redirectToBillsScreen:()=>{const o=ne(c.tenantEmailDomain),s=D(l.state?.pathnameStackToGoBack,l.pathname);r(o,{state:{pathnameStackToGoBack:s}})},discardBillDetailsFromLocalStore:()=>{e(Se({}))},saveBillDetails:(o,s)=>{o&&e(Ct({billId:n,data:s})),e(Ge(o?"paid":"pending_approval",o,!1,n))},discardOutsideZeniPaymentData:()=>{e(Bt({billId:n}))},updateBillDetailSaveBillCode:()=>{e(Ut("pending_approval"))},onClickEdit:()=>{t.navigate("../",{relative:"path"})},onAttachmentClick:(o,s)=>{const i=Ee(u,o,s);window.open(`${i}`,"_blank")},retryPayment:()=>{t.billId!=null&&e(xe(t.billId,"retry"))}}}))(Kn);function ft(){const e=Y(),t=le(),l=X(),{billId:n}=ee(),{useFeatureGate:c}=oe(),{isFeatureEnabled:r}=c(f.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:u}=c(f.isBillPayDetectInsufficientFundsEnabled),o=Ie(),s=V.getSignedInUser(),{isFeatureEnabled:i}=c(f.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:d}=c(f.isVendorRecommendationFeatureEnabled),p=W(l.state?.pathnameStackToGoBack),{poppedPathname:m}=p,{isFeatureEnabled:S}=c(f.isRecurringBillsFeatureEnabled),h=v((I=>q(I))),b=v((I=>Ot(I,n))),C=b.fetchState??"Not-Started";if(g.useEffect((()=>(window.onbeforeunload=function(){return e(l,{state:{message:""}}),!0},()=>{window.onbeforeunload=null})),[e]),g.useEffect((()=>{l.state?.message!=="coming_from_edit_page"&&e(`../${n}`)}),[]),g.useEffect((()=>{const I=b.vendor?.name,j=b.vendor?.id,B=b.totalAmount.amount,T=b.recipientTotalAmount.amount,k=b.invoiceNumber;I&&j&&t(dn(I,j,B,T,k,n))}),[]),m==null)return a.jsx(Q,{to:`../${n}`});if(s==null)throw Error("Can't access address page without signing in...");return C==="In-Progress"?a.jsx(yt,{windowSize:o,children:a.jsx(Xn,{})}):a.jsx(yt,{windowSize:o,children:a.jsx(Hi,{location:l,navigate:e,currentTenant:h,billId:n,isLocalCurrencyEnabled:i,isVendorRecommendationEnabled:d,isInternationalPaymentShaVsOurEnabled:r,isRecurringBillsFeatureEnabled:S,isDetectInsufficientFundsEnabled:u})})}const Wi=K((function(e,t){const{vendorId:l}=t,n=e.entityAutoCompleteState.autoCompleteText.common,c=Ne(e,"common"),r=l!=null?"edit":"create",u=q(e),o=V.getSignedInUser(),s=u.tenantId,i={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:s??""};return{vendorViewDetails:t.vendorViewDetails,screenType:r,filesEndPoint:`${zt.fileMicroServiceBaseUrl}`,authParams:i,analytics:E,vendorSearchAutoCompleteData:{autoCompleteText:n,entityAutoCompleteView:c}}}),(function(e,t){const{billId:l,currentTenant:n,navigate:c,location:r,vendorId:u,themeState:o}=t,{tenantEmailDomain:s}=n;return{onSaveVendor:i=>{e(xn(u??void 0,t.billId)),i!=null&&e(Bn(i))},saveVendorDetailLocalData:i=>{e(Mt({vendorId:u,localData:i}))},saveContactsInVendorDetailLocalData:i=>{e(wn({vendorId:u,contacts:i}))},resetVendorDetailLocalData:()=>{e(lt(u))},updateSelectedVendorForCreate:i=>{e(kn(i))},navigateToBankDetailPage:(i,d)=>{let p;i==="wire"?p=d==="international"?Wt(s,t.billId,u):ci(s,t.billId,u):p=ri(s,t.billId,u);const m=D(r.state?.pathnameStackToGoBack,r.pathname);c(p,{state:{pathnameStackToGoBack:m}})},onRemoveBankAccount:(i,d)=>{e(d===!0?In(i,"vendor",u):vn(i,"vendor",u))},navigateToMailingAddressPage:i=>{const d=Xe(s,i,l),p=D(r.state?.pathnameStackToGoBack,r.pathname);c(d,{state:{pathnameStackToGoBack:p}})},updateFilesEntity:i=>{e(fn({files:i}))},onEditFileName:(i,d)=>{e(yn(i,d.split(".")[0]))},handleZeniLogoClick:()=>{o.toggle()},updateSaveFetchState:()=>{u==null&&e(lt(t.vendorViewDetails.newVendorState?.vendorBasic?.id)),e(Sn("Not-Started",u))},onVendorSelected:i=>{i!=null&&e(gn(i,!0))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,d)=>{i.trim().length>=2?e(ze({searchString:i,entityType:d,searchOrigin:"common"})):i.trim().length===0&&e(ie("common"))},onCancelAutoComplete:()=>{e(ie("common"))}},onBackClick:()=>{e(ie("common"));const i=W(t.location.state?.pathnameStackToGoBack),d=i.poppedPathname??si(n.tenantEmailDomain,t.billId);c(d,{state:{pathnameStackToGoBack:i.newStack}})},onGetOtp:i=>{e(hn(i,"BillPayVendor"))},onResendOtp:i=>{e(bn(i,"BillPayVendor"))},onVerifyOtp:(i,d)=>{e(mn(i,d,"BillPayVendor"))},onVerifyOtpSuccess:(i,d,p)=>{e(pn(i,d,p))},onFetchAndUpdateVendorRecommendations:i=>{e(Zt(i,!1))}}}))(ai),we=()=>{const e=Y(),t=le(),l=Qn(),n=X(),{billId:c,vendorId:r}=ee(),u=v((b=>q(b))),{useFeatureGate:o}=oe(),{isFeatureEnabled:s}=o(f.isBillPayLocalCurrencyFeatureEnabled),[i,d]=g.useState(!1),p=v((b=>b.vendorViewState.newVendorState.fetchStatus.fetchState)),m=v((b=>ye(b,r))),S=v((b=>r!==void 0?b.vendorViewState.editVendorStateById[r]?.fetchStatus??"Not-Started":"Not-Started")),h=r!==void 0?S:p;return g.useEffect((()=>{i===!1&&h==="Not-Started"&&r!=null&&(t(ge(!1,r)),d(!0))}),[i,h,r]),m.fetchState==="Not-Started"||m.fetchState==="In-Progress"?a.jsx(ei,{}):h==="Error"?a.jsx(ti,{onGoHome:()=>e("../",{replace:!0}),onReload:()=>window.location.reload()}):a.jsxs(a.Fragment,{children:[a.jsx(Ye,{vendorId:r,billId:c}),a.jsx(Wi,{navigate:e,location:n,themeState:l,currentTenant:u,vendorId:r,billId:c,vendorViewDetails:m,isLocalCurrencyEnabled:s})]})},qi=K((function(e,t){const{companyId:l}=t;return{billPaySetupView:Cn(e,l),analytics:E,videoUrl:"https://player.vimeo.com/video/787873426?h=9d9389b1dc&badge=0&autopause=0&player_id=0&app_id=58479"}}),(function(e,t){const{companyId:l,navigate:n}=t;return{onButtonClick:()=>{e(An(l))},onBackClick:()=>{n("../..",{relative:"path"})},onSetupBillPaySuccess:()=>{n("../bills/setup",{relative:"path"})}}}))(ii),Ji=()=>{const e=ni(),t=Y(),l=X(),{tenantEmailDomain:n}=ee(),[c,r]=g.useState(!1),u=ue(),o=v((h=>q(h))),s=o.companyId??V.getSignedInUserTenant(n)?.companyId,i=V.getSignedInUser(),d=fe(),p=!!o.companyBillPayInfo?.info?.isBillPayTOSAccepted,m=de(d?.loggedInUserRoleMap),S=h=>{r(h)};if(i==null)throw Error("Can't access bill pay promo page without signing in...");return o.companyBillPayInfo?.info?.isBillPayEnabled===!0?a.jsx(Q,{to:"../../../bills"}):p===!0&&m===!0?a.jsx(Q,{to:"../../bills/setup"}):p===!1||d!=null&&Oe(o,d.loggedInUserRoleMap)?a.jsxs(a.Fragment,{children:[a.jsx(Ae,{analytics:E,onLoad:h=>(b=>b.trackPageLoaded(Ht.Event.billPayPromoPage))(h)}),a.jsx(Jt,{isAppContentDrawerOpen:c,handleDrawerToggle:S}),a.jsx(qi,{companyId:s,navigate:t,location:l,meetingUrl:e("bill_pay_promo"),onClickMenuIcon:()=>{S(!0)}})]}):a.jsx(se,{fetchState:"In-Progress",style:{backgroundColor:u.colors.grey5}})};function To(){const e=v((H=>q(H))),t=fe(),l=de(t?.loggedInUserRoleMap),n=ue(),{useFeatureGate:c}=oe(),{isFeatureEnabled:r}=c(f.isBillPayLocalCurrencyFeatureEnabled),u=r===!0?zi:Mi,{isFeatureEnabled:o}=c(f.isDebitCardFeatureEnabled),s=Rt(o,e),i=Vt(e),d=X(),p=e?.userRole!=null&&It(e?.userRole),m=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!p)&&de(t?.loggedInUserRoleMap),S=Ft(t?.loggedInUserRoleMap),h=(e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!p)&&Dn(t?.loggedInUserRoleMap),b=!!e.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!p,C=b&&$t(t?.loggedInUserRoleMap),{isFeatureEnabled:I}=c(f.isChargeCardFeatureEnabled),j=oi(e,I,o)&&!p,B=j&&En(t?.loggedInUserRoleMap),T=Tn(t?.loggedInUserRoleMap),k=Lt(t?.loggedInUserRoleMap),$=jn(t?.loggedInUserRoleMap),O=b&&k,U=e.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!p&&$,N=Pn(t?.loggedInUserRoleMap),z=Fn(t?.loggedInUserRoleMap),w=Rn(t?.loggedInUserRoleMap),Z=j&&N,{tenantEmailDomain:L}=ee();return a.jsxs(na,{children:[d.pathname.includes("/bills")?a.jsxs(a.Fragment,{children:[a.jsx(y,{path:"setup",element:a.jsx(Te,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:S,isReimbursementAdminLevelAccess:h,isZeniAccountAdminLevelAccess:C,isChargeCardAdminLevelAccess:B,isUserHasOnlyCardAccess:T,productType:"bill_pay",type:"setup"})}),a.jsx(y,{path:"verification",element:a.jsx(Te,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:S,isReimbursementAdminLevelAccess:h,isZeniAccountAdminLevelAccess:C,isChargeCardAdminLevelAccess:B,isUserHasOnlyCardAccess:T,productType:"bill_pay",type:"verification"})}),a.jsx(y,{path:"promo",element:a.jsx(Ji,{})}),a.jsx(y,{path:"approval-rules/*",element:m?a.jsx(pi,{}):a.jsx(mi,{showZeniAccountRoute:O,isUserHasBillPayAccess:z,isUserHasReimbursementAccess:w,showTreasuryRoute:U,isTenantBankingOnly:s,showChargeCardRoute:Z,tenantEmailDomain:L??""})}),a.jsx(y,{path:"international-wire",element:a.jsx(Te,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:S,isReimbursementAdminLevelAccess:h,isZeniAccountAdminLevelAccess:C,isChargeCardAdminLevelAccess:B,isUserHasOnlyCardAccess:T,productType:"bill_pay",type:"international-wire"})}),e.companyBillPayInfo?.info?.isBillPayEnabled===!0&&a.jsx(y,{path:"*",element:a.jsx(Ei,{})}),(s===!0||i===!0)&&a.jsx(y,{path:"/*",element:a.jsx(Yt,{})}),e.companyBillPayInfo?.info?.isBillPayTOSAccepted===!0&&l&&a.jsx(y,{path:"*",element:a.jsx(Q,{to:"../setup"})}),t!=null&&Oe(e,t.loggedInUserRoleMap)&&a.jsx(y,{path:"*",element:a.jsx(Q,{to:"../promo"})})]}):d.pathname.includes("/bill")?a.jsxs(a.Fragment,{children:[a.jsx(y,{path:"new",element:a.jsx(x,{appContent:a.jsx(bt,{})})}),a.jsx(y,{path:":billId",element:a.jsx(x,{appContent:a.jsx(hi,{})})}),a.jsx(y,{path:":billId/edit",element:a.jsx(x,{appContent:a.jsx(bt,{})})}),a.jsx(y,{path:"new/review",element:a.jsx(x,{appContent:a.jsx(ft,{})})}),a.jsx(y,{path:":billId/edit/review",element:a.jsx(x,{appContent:a.jsx(ft,{})})}),a.jsx(y,{path:"/:billId/:addressType",element:a.jsx(x,{appContent:a.jsx(ct,{isSubPage:!0})})}),a.jsx(y,{path:"/new/:addressType",element:a.jsx(x,{appContent:a.jsx(ct,{isSubPage:!0})})}),a.jsx(y,{path:"new/vendor/create",element:a.jsx(x,{appContent:a.jsx(we,{})})}),a.jsx(y,{path:"new/vendor/:vendorId/edit",element:a.jsx(x,{appContent:a.jsx(we,{})})}),a.jsx(y,{path:"new/vendor/:vendorId/edit/ach",element:a.jsx(x,{appContent:a.jsx(me,{})})}),a.jsx(y,{path:"new/vendor/:vendorId/edit/domestic",element:a.jsx(x,{appContent:a.jsx(be,{})})}),a.jsx(y,{path:"new/vendor/:vendorId/edit/international",element:a.jsx(x,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:"new/vendor/create/ach",element:a.jsx(x,{appContent:a.jsx(me,{})})}),a.jsx(y,{path:"new/vendor/create/domestic",element:a.jsx(x,{appContent:a.jsx(be,{})})}),a.jsx(y,{path:"new/vendor/create/international",element:a.jsx(x,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/ach",element:a.jsx(x,{appContent:a.jsx(me,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/domestic",element:a.jsx(x,{appContent:a.jsx(be,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/international",element:a.jsx(x,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:":billId/edit/vendor/create",element:a.jsx(x,{appContent:a.jsx(we,{})})}),a.jsx(y,{path:":billId/edit/vendor/:vendorId/edit",element:a.jsx(x,{appContent:a.jsx(we,{})})}),a.jsx(y,{path:":billId/edit/vendor/:vendorId/edit/ach",element:a.jsx(x,{appContent:a.jsx(me,{})})}),a.jsx(y,{path:":billId/edit/vendor/:vendorId/edit/domestic",element:a.jsx(x,{appContent:a.jsx(be,{})})}),a.jsx(y,{path:":billId/edit/vendor/:vendorId/edit/international",element:a.jsx(x,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/ach",element:a.jsx(x,{appContent:a.jsx(me,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/domestic",element:a.jsx(x,{appContent:a.jsx(be,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/international",element:a.jsx(x,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:"*",element:a.jsx(Be,{})})]}):a.jsx(y,{path:"*",element:a.jsx(se,{fetchState:"In-Progress",style:{backgroundColor:n.colors.grey5,boxShadow:`0px 2px ${A.sp1} ${n.colors.dropShadowNormal}`}})}),a.jsx(y,{path:"*",element:a.jsx(Be,{})})]})}export{To as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as C}from"./sentry-
|
|
1
|
+
import{a as C}from"./sentry-BjL01Z0h.js";import{u as K,j as h,h as se,g as oe,i as ie,N as ce,l as re}from"./core-DN52-78R.js";import{fI as P,I6 as ue,Ik as de,Lw as le,Om as pe,P0 as me,PR as fe,ZL as ye,B$ as Se,SW as ge,ZM as Ie,ZN as he,ZO as be,ZP as Te,ZQ as De,ZR as Oe,V_ as Ce,YR as ke,Wd as Ve,MI as Ae,MA as we,We as Ne,ME as Fe,mL as _e,gJ as ve,gI as Ee,gH as xe,v2 as Re,uV as Pe,uS as ze,mD as Be,C8 as Le,C6 as z,bF as B,Ck as L,cF as Me}from"./zeni-epic-state-kN_H0ghW.js";import{bR as Ue,V as Ze,q as je,bg as Ge,z as R,a6 as Ke,h as M,n as E,K as x,bT as We,ac as qe,p as U,aE as Z}from"./index-CcTOsN6n.js";import{n as $e}from"./mui-DhQvsLdn.js";import{j as A}from"./liveblocks-9GmpXxpV.js";import{d as j}from"./routePaths-Cf2lH5Cm.js";import{M as He}from"./MobileAppDrawer-oi_jxOPF.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},c=new e.Error().stack;c&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[c]="59cc8e91-dc48-49ee-b284-e737190aebfc",e._sentryDebugIdIdentifier="sentry-dbid-59cc8e91-dc48-49ee-b284-e737190aebfc")}catch{}})();function it(){const e=K(),c=h((u=>P(u))),a=c?.tenantId,{isApprovalRulesV3Enabled:s,isLoading:l}=Ue(a),p=h((u=>u.billPaySetupApproverViewState.fetchState));C.useEffect((()=>{a==null||l||p==="Not-Started"&&e(ue(!0,!0,s))}),[a,l,s,p,e])}function G(e,c,a,s=!1){switch(c){case"zeni_accounts":e(fe(a,!0,s));break;case"zeni_treasury":e(me(a,!0,s));break;case"reimbursement":e(pe(a,!0,s));break;case"charge_cards":e(le(a,!0,s));break;default:e(de(a,!0,s))}}const Je=$e.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,4 +6,4 @@ import{a as C}from"./sentry-BBNrx1Ml.js";import{u as K,j as h,h as se,g as oe,i
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,
|
|
9
|
+
`,Qe=re((function(e,c){const{businessVerificationDetails:a}=c,s=P(e),l=R.getSignedInUser(),p=s.tenantId,u={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:p??""},b=Ce(c.roleMap)&&a.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",t=ke(e.companyConfigState),o=Ve(e.userRoleConfigState);return{businessVerificationDetails:a,verficationDetailsFetchState:a.fetchState,isRefreshingViewInBackground:a.isRefreshingViewInBackground,allNationalityCountries:a.allNationalityCountries,filesEndPoint:`${qe.fileMicroServiceBaseUrl}`,authParams:u,isDisabled:b,allIndustries:t.companyIndustries??[],companyTitles:o.companyTitles}}),(function(e,c){const{companyId:a,productType:s,currentTenant:l,navigate:p,location:u}=c,{tenantEmailDomain:b}=l;return{onCompanyDetailsChanged:t=>{const{companyDescription:o,companyIndustry:m,companyIndustryType:k,companyLegalName:V,companyTaxId:y,companyWebsite:f,companyPhone:S,primaryContactEmail:d,primaryContactName:i,primaryContactUserId:T,primaryContactSyncToken:D,syncToken:r,fileIds:O,incDate:n,typeOfIncorporation:g,stateOfIncorporation:w,sourceOfFunds:N,companySubIndustry:F,countriesOfOperations:I,companySourceOfFunds:W,companySourceOfFundsDescription:q,transactionVolume:$,transactionVolumeDescription:H,purposeOfAccount:J,purposeOfAccountDescription:Q,regulatedStatus:Y,regulatedStatusDescription:X,usNexus:ee,usNexusTypes:te}=t,_=k?.selectedOption,ae={companyId:a,companyDescription:o,companyIndustry:m.selectedOption,companyIndustryType:_==null||_===""?void 0:_,companyLegalName:V,taxIdOrEIN:y,website:f!=""&&f!=null?Me(f):void 0,phone:S,syncToken:r,fileIds:O,incDate:n!=null?B(n?.toString()):n,typeOfIncorporation:g?.selectedOption??"",stateOfIncorporation:w?.selectedOption??"",sourceOfFunds:N?.selectedOption??"",companySubIndustry:F?.selectedOption??"",countriesOfOperations:I?.selectedOptions.map((v=>v.length===2?v:Z(v)))??[],companySourceOfFunds:W?.selectedOption??"",companySourceOfFundsDescription:q,transactionVolume:$?.selectedOption??"",transactionVolumeDescription:H,purposeOfAccount:J?.selectedOption??"",purposeOfAccountDescription:Q,regulatedStatus:Y??"",regulatedStatusDescription:X,usNexus:ee,usNexusTypes:te?.selectedOptions??[]},ne={userId:T,firstName:i.firstName,lastName:i.lastName,email:d,syncToken:D};e(L({companyDetails:ae,primaryContactDetails:ne}))},onCompanyOfficerUpdated:t=>{const o=t.map((m=>{const{officerType:k,userId:V,name:y,email:f,nationalityCountryCode:S,ssn:d,dob:i,phone:T,syncToken:D,selectDocument:r,role:O,ownership:n,isSelectedForVerification:g,userVerificationStatus:w,treasuryUserVerificationStatus:N,fileIds:F}=m;let I;return r.selectDocumentType==="driverLicense"?I="driving_license":r.selectDocumentType==="passport"?I="passport":r.selectDocumentType==="stateId"?I="id_document":r.selectDocumentType==="ssnCard"&&(I="social_security_card"),{officerType:k,userId:V,firstName:y.firstName,lastName:y.lastName,email:f,ssn:d,nationalityCountryCode:S?.selectedOption!=null?Z(S.selectedOption):void 0,phone:T,birthday:i!=null?B(i?.toString()):i,syncToken:D,titleAtCompany:O.selectedOption,ownershipInCompany:n,documentTypeSelectedForVerification:I,isSelectedForVerification:g,userVerificationStatus:w,treasuryUserVerificationStatus:N,fileIds:F,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}}));e(L({officers:o}))},onSaveDetailsClick:t=>{e(z(a,t,s))},onSendForVerificationClick:t=>{e(z(a,t,s,!0))},onAddressClick:t=>{const o=j(b,t),m=U(u.state?.pathnameStackToGoBack,u.pathname);p(o,{state:{pathnameStackToGoBack:m}})},onRegisteredAddressClick:t=>{const o=j(b,t),m=U(u.state?.pathnameStackToGoBack,u.pathname);p(o,{state:{pathnameStackToGoBack:m}})},onBackClick:()=>{e(Le({companyId:a})),p("../setup")},updateFilesEntity:t=>{e(Be({files:t}))},onDeleteFile:t=>{e(ze(t))},onDeleteFileList:t=>{e(Pe(t))},onEditFileName:(t,o)=>{e(Re(t,o.split(".")[0]))},onGetOtp:t=>{e(xe(t,"SpendManagementSetup"))},onResendOtp:t=>{e(Ee(t,"SpendManagementSetup"))},onVerifyOtp:(t,o)=>{e(ve(t,o,"SpendManagementSetup"))},saveNewAddressInLocalStore:(t,o)=>{e(_e({addressType:t,addressToCreate:o}))},onIdentityDocumentUploadedForAutofill:t=>{if(a==null)return;const o=Ne(t.documentType);o!=null&&e(Fe({target:"setup",companyId:a,officerType:t.officerType,fileId:t.fileId,documentType:o}))},onCompanyDocumentUploadedForAutofill:t=>{a!=null&&e(we({target:"setup",companyId:a,fileId:t.fileId,documentType:t.documentType}))},onResetKycKybClick:()=>{e(Ae())}}}))(We),ct=({productType:e})=>{const c=se(),a=oe(),s=K(),[l,p]=C.useState(!1),[u,b]=C.useState(!1),{tenantEmailDomain:t}=ie(),o=Ze(),{useDynamicConfig:m}=je(),{configValue:k}=m(Ge.zeniAccountsConfig),V=ye(k),y=h((n=>{switch(e){case"zeni_accounts":return n.zeniAccountSetupViewState.fetchState;case"reimbursement":return n.remiSetupViewState.fetchState;case"charge_cards":return n.chargeCardSetupViewState.fetchState;case"zeni_treasury":return n.treasurySetupViewState.fetchState;default:return n.billPaySetupViewState.fetchState}})),f=h((n=>n.companyConfigState.fetchState)),S=h((n=>n.userRoleConfigState.fetchState)),d=h((n=>P(n))),i=d.companyId??R.getSignedInUserTenant(t)?.companyId;C.useEffect((()=>{f==="Not-Started"&&s(Se()),S==="Not-Started"&&s(ge(!0))}),[f,S,s]),C.useEffect((()=>{l||y!=="Not-Started"||i==null||(p(!0),G(s,e,i))}),[l,y,i,s]);const T=h((n=>{switch(e){case"zeni_accounts":return De(n,i);case"zeni_treasury":return Te(n,i);case"charge_cards":return be(n,i);case"reimbursement":return he(n,i);default:return Ie(n,i)}})),D=T.kycKybResetStatus.fetchState;if(C.useEffect((()=>{D==="Completed"&&i!=null&&(G(s,e,i,!0),s(Oe()))}),[D,i,e,s]),R.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let r;switch(e){case"zeni_accounts":r=d.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":r=d.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":r=d.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||d.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":r=d.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:r=d.companyBillPayInfo?.info?.isBillPayTOSAccepted}const O=n=>{b(n)};return r===!1?A.jsx(ce,{to:"../promo"}):A.jsxs(Je,{children:[A.jsx(Ke,{analytics:M,onLoad:n=>(g=>{switch(e){case"zeni_accounts":return g.trackPageLoaded(x.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return g.trackPageLoaded(x.Event.reimbursementBusinessVerification);default:return g.trackPageLoaded(x.Event.billPayBusinessVerification,E(a)?"Settings":void 0)}})(n)}),E(a)?A.jsx(He,{isAppContentDrawerOpen:u,handleDrawerToggle:O}):null,A.jsx(Qe,{businessVerificationDetails:T,navigate:c,location:a,companyId:i,analytics:M,currentTenant:d,productType:e,isSettings:E(a),roleMap:o?.loggedInUserRoleMap??{},onClickMenuIcon:()=>{O(!0)},maxInsuredAmount:V.maxInsuredAmount})]})};export{ct as B,G as d,it as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as S}from"./liveblocks-
|
|
1
|
+
import{j as S}from"./liveblocks-9GmpXxpV.js";import{a as r}from"./sentry-BjL01Z0h.js";import{u as he,h as fe,g as Ce,j as H,i as ge,l as Se}from"./core-DN52-78R.js";import{e5 as be,a as Pe,e6 as ye,z as Ie,e8 as we,ea as W,eb as Ee,bm as G,a6 as ke,h as F,ec as M,em as xe,G as Ae,K as Te,w as Ue,ef as Oe,eg as _e,at as ve,ej as Qe,ek as je,bi as De,el as Fe}from"./index-CcTOsN6n.js";import{gN as $e,fH as J,fI as Le,gb as Ve,jp as Re,jl as qe,fJ as N,gx as Be,gr as He,gt as z,gz as Me,gA as Ne,gB as ze,gC as We,gD as Ge}from"./zeni-epic-state-kN_H0ghW.js";import{D as Je,n as L,v as Ke,S as Ye}from"./mui-DhQvsLdn.js";import"./recharts-D1kT0p-5.js";import"./analytics-d11__KPJ.js";import"./plaid-DKx0sbcX.js";import"./dnd-DmRCPujN.js";import"./stripe-cKAAJElX.js";import"./lottie-yPmCb5yH.js";import"./lexical-LEeCUpN7.js";import"./pdf-cTO9wAGA.js";import"./utils-BoByipD1.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="b16ffdd6-3c54-48e1-88cb-d7b2ec4ffb9b",t._sentryDebugIdIdentifier="sentry-dbid-b16ffdd6-3c54-48e1-88cb-d7b2ec4ffb9b")}catch{}})();const K="chat-response-generated",Y="cards/ask",X="card_policy_hero";function $(t){return`/${t}/cards`}function Z(t){return`/${t}/cards/policy`}const Xe=Se((function(t,s){const d=J(t),l=s.isSubmitting,u=_e(t,{allUsers:s.allUsers,onCardPolicyVendorSearchTextChange:s.onCardPolicyVendorSearchTextChange});return{showSampleQuestions:s.sessionFromUrl==="new_chat"&&d.uiState.currentChatSessionId==null,aiCfoView:d,isSubmitting:l,isNewChatSession:s.sessionFromUrl==="new_chat",isFullView:!0,tableDownloadEndPoint:`${ve}/tableDownload`,exportDownloadEndPoint:Qe(),emailLinkQuestion:s.emailLinkQuestion,autoSubmitEmailLinkQuestion:s.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:s.onEmailLinkQuestionProcessed,isFileUploadEnabled:s.isFileUploadEnabled,isUploadPromoVisible:s.isUploadPromoVisible,onUploadPromoClose:s.onUploadPromoClose,...u}}),(function(t,s){const{location:d,currentTenant:l,userId:u,navigate:o,currentChatSessionId:P,allSessionsWithOrderedQuestionAnswers:f,isAiCardCreationEnabled:x,isCardPolicyEnabled:A,cardPolicyPageContext:T}=s,C=l.tenantEmailDomain,c=d.state?.referrer,h=c===X?Z(C):$(C);return{onEventReceived:(a,n)=>{if(a===K&&typeof n.text=="string"&&typeof n.metadata=="object"){const e=n,m=Ne(e.type),y=e.metadata.chat_session_id??null,{currentChatSession:U,currentQuestionAnswer:b,currentQuestionAnswerSummary:p}=G(f,y);m!=="answer"?F.trackAICFOChatResponseGenerated(m,b?.question.questionText??"",e.text,y,Fe(p,U),e.metadata.message_id??null):F.trackAICFOChatAnswerGenerated(e.text,b?.question.questionText??"",(e.follow_up_questions?.length??0)>0,!!e.assumptions,!!e.insights,e.visualization!=null,ze(e.visualization?.type??"")??null,y,e.summarized_title,e.metadata.message_id??null),t(We({chatSessionId:e.metadata.chat_session_id,responseType:m,fetchState:{fetchState:"Completed",error:void 0}})),t(Ge({chatSessionId:e.metadata.chat_session_id,answerPayload:e,userId:u}))}},onSubmit:(a,n,e,m)=>{a&&De(t,a,n,P,f,u,m,e,T)},updateCurrentInput:a=>{t(z(a))},onStopSubmit:()=>{},onUpdateScrollYOffset:a=>{t(Me(a))},onSelectSampleQuestion:()=>{},onBackClick:()=>{o(-1)},onCloseClick:()=>{o(h,{state:{...d.state}}),t(z(""))},togglePageView:()=>{o(h,{state:W(d.state)}),s.setIsAiCfoOpen(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{o(-1)},onNewChatClick:()=>{P!=null&&t(He()),o((function(a){return`/${a}/${Y}`})(C),{state:{...d.state}})},onToggleCotCollapsed:(a,n)=>{t(Be({questionAnswerId:a,isCollapsed:n}))},...je(t,{isAiCardCreationEnabled:x,isCardPolicyEnabled:A,currentChatSessionId:P,onAfterCardsCreationSubmit:()=>{s.setIsAiCfoOpen(!0),o($(C),{state:{...d.state}})},onAfterCardPolicySubmit:()=>{s.setIsAiCfoOpen(!0),o(`/${C}/cards/policy`,{state:{...d.state}})}})}}))(Ue(Oe)),{spendManagement:{chargeCard:{cardsAiCfoHero:ee,cardPolicyAiCfoHero:te}}}=Ae.getLocalizedStrings(),k=ee.pageTitle,Ze=te.pageTitle,et=ee.chatHeaderSubtitle,tt=te.chatHeaderSubtitle,Pt=({isFileUploadEnabled:t})=>{const s=be(),{setIsAiCfoOpen:d}=Pe(),l=he(),u=fe(),o=Ce(),[P,f]=r.useState(!1),{allUsers:x,isAiCardCreationEnabled:A,isCardPolicyEnabled:T,onCardPolicyVendorSearchTextChange:C}=ye();r.useEffect((()=>{l($e())}),[l]);const c=H((i=>J(i))),h=Ie.getSignedInUser(),{session_id:a}=ge(),n=H((i=>Le(i))),e=c.uiState.currentChatSessionId,m=n.tenantEmailDomain,{handleUploadPromoClose:y,isUploadPromoVisible:U}=we({isFileUploadEnabled:t,tenantEmailDomain:m}),b=o.state,p=b?.aiCfoInitialQuestion??null,O=!!b?.aiCfoShouldSubmit,I=b?.referrer===X,se=I?"card_policy":void 0,ae=r.useMemo((()=>({title:I?Ze:k,subtitle:I?tt:et})),[I]),[oe,_]=r.useState(null),[ne,v]=r.useState(!1),Q=r.useRef(!1);r.useEffect((()=>{Q.current||p==null||p===""||(_(p),v(O),Q.current=!0)}),[p,O]);const ie=r.useCallback((()=>{_(null),v(!1),u(o.pathname,{replace:!0,state:W(o.state)})}),[o.pathname,o.state,u]),re=n.masterTOSInfo,g=re?.isMasterTOSAccepted??!1,E=r.useRef(null);r.useEffect((()=>{if(g&&E.current!=null){const{question:i,shouldSubmit:w}=E.current;E.current=null,_(i),v(w),Q.current=!1}}),[g]);const{visitedSessions:V}=Ee(e),j=c.fetchState,D=c.uiState.chatSessionsNextPageToken.hasMore||!c.uiState.chatSessionsFirstPageFetched,R=e!=null?c.fetchChatSessionHistoryByChatSessionId?.[e]?.fetchState??"Not-Started":"Not-Started",q=e==null||(c.uiState.chatHistoryNextPageToken[e]?.hasMore??!0),B=c.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:le}=G(B,e),de=le.length===0;r.useEffect((()=>{e!=null&&a!==e&&u((function(i,w){return`/${i}/${Y}/${w}`})(m,e),{state:{...o.state},replace:!0})}),[e,a,m,u,o.state]),r.useEffect((()=>{a!=null&&e==null&&a!=="new_chat"&&l(Ve({sessionId:a,agentId:"controller"}))}),[]);const ce=r.useMemo((()=>({events:V.map((i=>`private-encrypted-chat-${i}.${K}`)),eventCallback:(i,w,pe)=>pe.onEventReceived(i,w)})),[V]);if(r.useEffect((()=>{j!=="In-Progress"&&D&&l(Re())}),[j,D,l]),r.useEffect((()=>{e!=null&&R!=="In-Progress"&&q&&h!=null&&j==="Completed"&&!D&&l(qe(e,h.userId))}),[R,q,e,h,l]),h==null)throw Error("Can't access Cards AI CFO page without signing in...");const ue=a??"new_chat",me=e!=null&&c.responseStateByChatSessionId?.[e]?.answer?.fetchState==="In-Progress";return S.jsxs(at,{children:[S.jsx(ke,{analytics:F,onLoad:i=>i.trackPageLoaded(Te.Event.aiCFOPage)}),g?S.jsx(Xe,{answerExportEndPoint:s,...ce,currentChatSessionId:e,allSessionsWithOrderedQuestionAnswers:B,allUsers:x,isAiCardCreationEnabled:A,isCardPolicyEnabled:T,openOnboardingPage:()=>f(!0),userId:h.userId,setIsAiCfoOpen:d,navigate:u,sessionFromUrl:ue,location:o,isSubmitting:me,isEmptyChatWithSession:de,customPageTitle:k,chatHeader:ae,currentTenant:n,emailLinkQuestion:oe??void 0,autoSubmitEmailLinkQuestion:ne,onEmailLinkQuestionProcessed:ie,isFileUploadEnabled:t,isUploadPromoVisible:U,onUploadPromoClose:y,onCardPolicyVendorSearchTextChange:C,cardPolicyPageContext:se}):S.jsx(M,{isTOSAccepted:g,acceptMasterTOSState:c.masterTOSAcceptanceState,customPageTitle:k,onCloseClick:()=>{u(I?Z(m):$(m),{state:{...o.state}})},onCompleteClick:()=>{g||n.userRoleId==null||(p!=null&&p!==""&&(E.current={question:p,shouldSubmit:O}),l(N(n.userRoleId)))}}),S.jsx(Je,{anchor:"right",open:P,transitionDuration:250,PaperProps:{component:ot,style:{width:`${xe}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>f(!1),children:S.jsx(st,{onClick:i=>i.stopPropagation(),children:S.jsx(M,{isTOSAccepted:g,acceptMasterTOSState:c.masterTOSAcceptanceState,customPageTitle:k,onCloseClick:()=>f(!1),onCompleteClick:()=>{g||n.userRoleId==null||l(N(n.userRoleId)),f(!1)}})})})]})},st=L(Ye)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|