@zeniai/web-app-ui 5.1.51-qa → 5.1.52-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AddressRoutes-Cg2gXbOf.js +1 -0
- package/dist/assets/{AddressScreen-DHENiPsE.js → AddressScreen-BBCv44qS.js} +2 -2
- package/dist/assets/{AiCfoScreen-BDeqJ8PX.js → AiCfoScreen-Da9zCyWe.js} +5 -5
- package/dist/assets/{BillPayApprovalRoutes-re8xxMBE.js → BillPayApprovalRoutes-TnPLWObs.js} +1 -1
- package/dist/assets/{BillPayRoutes-BKu8tYXF.js → BillPayRoutes-gRXPgRX3.js} +8 -8
- package/dist/assets/{BusinessVerificationPageScreen-7ydI8UR9.js → BusinessVerificationPageScreen-DWx2BUK6.js} +2 -2
- package/dist/assets/{CardsAiCfoScreen-QyowC-mN.js → CardsAiCfoScreen-BCU45aIH.js} +1 -1
- package/dist/assets/{ChargeCardRoutes-BbZEL-b5.js → ChargeCardRoutes-SrcIcjEg.js} +10 -10
- package/dist/assets/{CompanyPassportScreen-AZhDXSZE.js → CompanyPassportScreen-C2ZjBTtu.js} +1 -1
- package/dist/assets/{ConnectionAuthScreen-DDij7-L5.js → ConnectionAuthScreen-DQGgk8VQ.js} +1 -1
- package/dist/assets/CustomerOnboardingAuthScreen-DndbS7zx.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-COHKYeEq.js → CustomerOnboardingRoutes-BiJk8RGO.js} +4 -4
- package/dist/assets/{DashboardRoutes-B1cE2wJc.js → DashboardRoutes-C2R9sFOt.js} +1 -1
- package/dist/assets/{DefaultTenantHome-DivCz85L.js → DefaultTenantHome-Cs1fEcl7.js} +1 -1
- package/dist/assets/DomesticWireDetailScreen-D2sqfin3.js +18 -0
- package/dist/assets/DrawerScreen-BXWf7y4o.js +1 -0
- package/dist/assets/EntityDetailRoutes--LkTS4Lg.js +1 -0
- package/dist/assets/{ExpenseAutomationRoutes-pmgLYKV-.js → ExpenseAutomationRoutes-DN1VLKxs.js} +3 -3
- package/dist/assets/FeaturePreviewScreen-C_7xKfC9.js +1 -0
- package/dist/assets/{HubSpotOAuthCallbackScreen-BrjX8V0E.js → HubSpotOAuthCallbackScreen-BtgwDGFv.js} +1 -1
- package/dist/assets/{MagicLinkRoutes-Dn4g326h.js → MagicLinkRoutes-w9Xo_7JQ.js} +9 -9
- package/dist/assets/MagicLinkSignInScreen-_FORqdKk.js +12 -0
- package/dist/assets/{MobileAppDrawer-CjoW3Rax.js → MobileAppDrawer-B2Mj3GDG.js} +1 -1
- package/dist/assets/NotFoundScreen-DpHt-tQH.js +1 -0
- package/dist/assets/{NotificationRoutes-DE-Z8DSv.js → NotificationRoutes-Bd-2Em1h.js} +1 -1
- package/dist/assets/OAuthConsentScreen-DunOek_C.js +1 -0
- package/dist/assets/{PandLWithForecastRoutes-C3Yczwgv.js → PandLWithForecastRoutes-BnZrz52M.js} +1 -1
- package/dist/assets/{PeopleRoutes-ZidIbEdd.js → PeopleRoutes-tR11OG4C.js} +3 -3
- package/dist/assets/PerformanceRoutes-tqcqZlMe.js +1 -0
- package/dist/assets/{Preview-OiplHjn8.js → Preview-BBgrn4cd.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-B8QVReQm.js → QBOConnectionScreen-CWE_gavn.js} +1 -1
- package/dist/assets/{ReferralListScreen-Cnd7u4T9.js → ReferralListScreen-B51q6tuc.js} +2 -2
- package/dist/assets/ReimbursementApprovalRoutes-CX0ljo0U.js +1 -0
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BgYFphfr.js → ReimbursementApprovalRuleDetailScreen-BY8AWRBv.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-BeD0lwna.js → ReimbursementRoutes-BNT5fCZV.js} +5 -5
- package/dist/assets/{ReportsRoutes-CPI-jy1F.js → ReportsRoutes-BkcfE81W.js} +1 -1
- package/dist/assets/RewardsRoutes-Bp0jvJUz.js +1 -0
- package/dist/assets/{ScreenRoutes-B24ySlpK.js → ScreenRoutes-DzWi1qtt.js} +2 -2
- package/dist/assets/SettingsRoutes-C45RXj_4.js +57 -0
- package/dist/assets/{SetupPagesScreen-DtddTp_T.js → SetupPagesScreen-CnApuu2-.js} +5 -5
- package/dist/assets/SignInScreen-D4fYBdSr.js +1 -0
- package/dist/assets/{SignOutScreen-Djs9TXWR.js → SignOutScreen-scofbvIC.js} +1 -1
- package/dist/assets/{TaskListScreen-DMgU1v4z.js → TaskListScreen-5M_H_3yt.js} +2 -2
- package/dist/assets/{TaskRoutes-Cmtr7KFm.js → TaskRoutes-Bc8V0KLM.js} +2 -2
- package/dist/assets/{TransactionDetailRoutes-CjrDVjtT.js → TransactionDetailRoutes-lhjQfiA2.js} +1 -1
- package/dist/assets/TransactionDetailScreen-advW0sri.js +5 -0
- package/dist/assets/{TransactionListRoutes-uZihQK3F.js → TransactionListRoutes-BTVDW0ac.js} +1 -1
- package/dist/assets/{TreasuryRoutes-ZtY_hGM6.js → TreasuryRoutes-BlM-Juxy.js} +6 -6
- package/dist/assets/{VendorsRoutes-DcUkIEvd.js → VendorsRoutes-Db2Ed2Fz.js} +1 -1
- package/dist/assets/WiseConfirmationScreen-8khqAoaZ.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-Cbm2k-08.js → ZeniAccountRoutes-68W3Grg4.js} +11 -11
- package/dist/assets/ZeniAccountStatementScreen-CCwshkYl.js +9 -0
- package/dist/assets/{accountMappingHelper-DDqSB3xQ.js → accountMappingHelper-DoYWzqd9.js} +1 -1
- package/dist/assets/{analytics-DoyQ8ezf.js → analytics-DVTbnjlr.js} +1 -1
- package/dist/assets/{analyticsHelper-CvGdvadP.js → analyticsHelper-7imjYGd-.js} +1 -1
- package/dist/assets/{core-CQnSJ9vO.js → core-k_c8SCBE.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-BprI0TcI.js → decodeURIComponentSafe-ClSfwHJC.js} +1 -1
- package/dist/assets/{dnd-DoHm848q.js → dnd-CKEs-Nbe.js} +1 -1
- package/dist/assets/{empty-BZMPWXIo.js → empty-CaaFsHZq.js} +1 -1
- package/dist/assets/{empty-DjW_4H8B.js → empty-rBU__xZH.js} +1 -1
- package/dist/assets/{emptyVideoElement-CD9clJu_.js → emptyVideoElement-BiPjnR5F.js} +1 -1
- package/dist/assets/{epic-2G17lmbK.js → epic-BY3t4hzo.js} +2 -2
- package/dist/assets/getLocaleForTenant-BWdefIGu.js +1 -0
- package/dist/assets/{index-BtlQ6O6E.js → index-B0M_M2si.js} +1 -1
- package/dist/assets/{index-CF7DasjB.js → index-C9JBC9EP.js} +1 -1
- package/dist/assets/{index-Ci7GqulV.js → index-CAPOi0Fj.js} +1 -1
- package/dist/assets/{index-C6MtcitK.js → index-CBl-jehm.js} +1 -1
- package/dist/assets/{index-W83PhAZh.js → index-Cm2LZphQ.js} +12999 -13025
- package/dist/assets/{index-B6GtF9yZ.js → index-CrxfuqRy.js} +2 -2
- package/dist/assets/{index-DgHQU_66.js → index-D7n4W-6R.js} +1 -1
- package/dist/assets/{index-KsPtT3xm.js → index-_Ds-L3qG.js} +1 -1
- package/dist/assets/{lexical-WXHH1XHj.js → lexical-k-PQZXkn.js} +1 -1
- package/dist/assets/{liveblocks-DvKPzrwo.js → liveblocks-D3ESVZyk.js} +1 -1
- package/dist/assets/{lottie-DNsrs-P3.js → lottie-BYni7Ovk.js} +1 -1
- package/dist/assets/{mui-sKCdI-e6.js → mui-UJrLjp1k.js} +1 -1
- package/dist/assets/{pathToGoBack-DDBtlyQ4.js → pathToGoBack-D0Z5Ycmy.js} +1 -1
- package/dist/assets/{pdf-iXI4qQyj.js → pdf-CaeTpLUv.js} +4 -4
- package/dist/assets/{pdf-lib-C9eLuUx2.js → pdf-lib-Cgly_u4z.js} +1 -1
- package/dist/assets/{plaid-BOu_8LCE.js → plaid-B1j5PXHV.js} +1 -1
- package/dist/assets/{pusher-BxMucY8d.js → pusher-IzmLENf0.js} +1 -1
- package/dist/assets/{react-BfWAIeRe.js → react-BPazXlgj.js} +1 -1
- package/dist/assets/{react-Bfv7BUzV.js → react-BhDdWL-M.js} +1 -1
- package/dist/assets/{react-CHbhfie6.js → react-Cbn9UGi3.js} +1 -1
- package/dist/assets/{react-DW2tK8z_.js → react-D9CNJCXY.js} +1 -1
- package/dist/assets/{react-BY08R1tD.js → react-RV2byy3l.js} +1 -1
- package/dist/assets/{react-DVBLaOmV.js → react-iNsCZPRe.js} +1 -1
- package/dist/assets/{recharts-Cv5d-Vxs.js → recharts-Q-kkTNuO.js} +1 -1
- package/dist/assets/{routePaths-stnXzrYV.js → routePaths-d7Ok-gzv.js} +1 -1
- package/dist/assets/{sentry-Be8twC83.js → sentry-B_92GPgU.js} +1 -1
- package/dist/assets/{url-CuDHWvgT.js → url-CGw_V4gG.js} +1 -1
- package/dist/assets/{url-AlENSCVt.js → url-DLQKrj-e.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-CKfyn0VP.js → useAiCfoDashboardSuggestedQuestionsChips-D_8fZhjX.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-j-YNVdB5.js +1 -0
- package/dist/assets/useCashManagementBanner-Dq8PXuUm.js +1 -0
- package/dist/assets/{useDeviceId-KC-rY1dP.js → useDeviceId-BE1s-3Wf.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-BDAn-AM4.js → useInitialThreadRequest-DoCqWgSy.js} +1 -1
- package/dist/assets/{utils-BcJ2NV01.js → utils-Mjhh9T8E.js} +1 -1
- package/dist/assets/withTransactionSidePanel-AeDcEPW-.js +21 -0
- package/dist/assets/{zeni-epic-state-DKeO4Z0C.js → zeni-epic-state-C3zBO1No.js} +4 -4
- package/dist/index.html +1 -1
- package/package.json +3 -3
- package/dist/assets/AddressRoutes-gPXkxz7s.js +0 -1
- package/dist/assets/CustomerOnboardingAuthScreen-DO3NyaR6.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-Bx2DINVR.js +0 -18
- package/dist/assets/DrawerScreen-BtLrlXnn.js +0 -1
- package/dist/assets/EntityDetailRoutes-CTo7No6n.js +0 -1
- package/dist/assets/FeaturePreviewScreen-9NvuDbvP.js +0 -1
- package/dist/assets/MagicLinkSignInScreen-CTkVv0M2.js +0 -12
- package/dist/assets/NotFoundScreen-FcrdBNP0.js +0 -1
- package/dist/assets/OAuthConsentScreen-Swpq9wju.js +0 -1
- package/dist/assets/PerformanceRoutes-VzYGFOXy.js +0 -1
- package/dist/assets/ReimbursementApprovalRoutes-DOhkjING.js +0 -1
- package/dist/assets/RewardsRoutes-Vdol6ACr.js +0 -1
- package/dist/assets/SettingsRoutes-D7qVKl5_.js +0 -57
- package/dist/assets/SignInScreen-u3NwSgsj.js +0 -1
- package/dist/assets/TransactionDetailScreen-ABqf1zzA.js +0 -5
- package/dist/assets/WiseConfirmationScreen-DYcjQlfc.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-Ciuw5n7i.js +0 -9
- package/dist/assets/getLocaleForTenant-CAvD8CfA.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-DAlpTVgV.js +0 -1
- package/dist/assets/useCashManagementBanner-D8slgHwh.js +0 -1
- package/dist/assets/withTransactionSidePanel-B9fglQqM.js +0 -21
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./liveblocks-D3ESVZyk.js";import{A as d}from"./AddressScreen-BBCv44qS.js";import i from"./NotFoundScreen-DpHt-tQH.js";import"./sentry-B_92GPgU.js";import{o as s,p as r}from"./core-k_c8SCBE.js";import"./zeni-epic-state-C3zBO1No.js";import"./recharts-Q-kkTNuO.js";import"./index-Cm2LZphQ.js";import"./mui-UJrLjp1k.js";import"./analytics-DVTbnjlr.js";import"./plaid-B1j5PXHV.js";import"./dnd-CKEs-Nbe.js";import"./stripe-DMRn4zHo.js";import"./lottie-BYni7Ovk.js";import"./lexical-k-PQZXkn.js";import"./pdf-CaeTpLUv.js";import"./utils-Mjhh9T8E.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="cd0ff2b4-1e27-4329-addf-f475e5a9db34",t._sentryDebugIdIdentifier="sentry-dbid-cd0ff2b4-1e27-4329-addf-f475e5a9db34")}catch{}})();function _(){return e.jsxs(s,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(d,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(d,{})}),e.jsx(r,{path:"*",element:e.jsx(i,{})})]})}export{_ as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as
|
|
1
|
+
import{j as n}from"./liveblocks-D3ESVZyk.js";import{a as h}from"./sentry-B_92GPgU.js";import{h as T,u as _,g as j,i as M,j as E,n as B}from"./core-k_c8SCBE.js";import{h as $,m as D,z as L,j as K,B as R,r as z,c as C,e as S,k as F,f as b,p as N}from"./index-Cm2LZphQ.js";import{Ml as k,hP as U,eW as G,Mm as O,c7 as V,Mn as q,l8 as H}from"./zeni-epic-state-C3zBO1No.js";import{n as W}from"./mui-UJrLjp1k.js";import J from"./NotFoundScreen-DpHt-tQH.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]="043ef90f-e1af-499f-a723-bb865b3f03f1",e._sentryDebugIdIdentifier="sentry-dbid-043ef90f-e1af-499f-a723-bb865b3f03f1")}catch{}})();const Q=W.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|
|
@@ -6,4 +6,4 @@ import{j as d}from"./liveblocks-DvKPzrwo.js";import{a as h}from"./sentry-Be8twC8
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,X=B(function(e,t){const{addressId:o,isSubPage:i,addressType:c}=t,l=
|
|
9
|
+
`,X=B(function(e,t){const{addressId:o,isSubPage:i,addressType:c}=t,l=G(e),a=t.roleMap!=null&&O(t.roleMap),r=i||c==="user_address"||V(l?.userRole??[])||a?void 0:"readonly";if(o==null){const s=q(c,e);return{addressToEdit:s?.addressToCreate,loadingState:s?.status?.fetchState,googleAPIKey:b.googleMapsAPIKey,isDisabled:r,isSubPage:i,dontShowSaveConfirmationPopup:t.dontShowSaveConfirmation}}const d=k(e,o);return{addressToEdit:d.address,loadingState:d.fetchState,googleAPIKey:b.googleMapsAPIKey,isDisabled:r}},function(e,t){const{navigate:o,location:i,addressType:c}=t,l=a=>{if(a==="express-pay")o("../express-pay/add-wire");else{const r=i.state,d=N(r?.pathnameStackToGoBack);let s=d.poppedPathname??w();const u=r?.queryParams;if(u){const f=new URLSearchParams(u).toString();f&&(s=`${s}?${f}`)}o(s,{state:{pathnameStackToGoBack:d.newStack}})}};return{onSubmitHandler:a=>{const r=Y(a);e(H({addressType:c,addressToCreate:r})),C?.trackSaveAddressClicked(S.Event.saveAddressClicked,{street:a.street.addressString,city:a.city,state:a.state,country:a.country.selectedOption??"",postalCode:a.postalCode,suite:a.suite,secondaryInfo:a.secondaryInfo}),l(t.bankAccountContext)},onCancel:()=>{l(t.bankAccountContext)}}})(F);function ne({isSubPage:e,hideAddressSubTitle:t=!1,hideAddressBackButton:o=!1,dontShowSaveConfirmation:i,accountContext:c,addressTypeParam:l}){const a=T(),r=_(),d=j(),{addressId:s,addressType:u}=M(),f=$(),I=D(),v=L.getSignedInUser(),[g,x]=h.useState(s==null),p=E(m=>s!=null?k(m,s).fetchState:"Not-Started"),A=K();if(v==null)throw Error("Can't access address page without signing in...");const P=m=>m.trackPageLoaded(s!=null?S.Event.editAddress:S.Event.addAddress),y=l??u;return h.useEffect(()=>{g||s==null||(x(!0),r(U(s,!1)))},[g,s,r]),y==null||y.match(/(user_address|company_address|company_registered_address|vendor_address|officer_([1-9]|10)_address)$/g)?!g&&p==="Not-Started"||g&&p==="In-Progress"?n.jsx(R,{fetchState:p,style:{backgroundColor:I.colors.grey5}}):s!=null&&p==="Error"?(a(`${w(1)}/new`,{replace:!0}),n.jsx(n.Fragment,{})):n.jsxs(n.Fragment,{children:[n.jsx(z,{analytics:C,onLoad:P}),n.jsx(Q,{windowSize:f,children:n.jsx(X,{location:d,navigate:a,isSubPage:e===!0,hideAddressBackButton:o,hideAddressSubTitle:t,addressId:s,addressType:y,dontShowSaveConfirmation:i,bankAccountContext:c,roleMap:A?.loggedInUserRoleMap})})]}):n.jsx(J,{})}const w=(e=2)=>{let t="../";for(let o=0;o<e;o++)t=`${t}../`;return t},Y=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng});export{ne as A,Y as t};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import{j as d}from"./liveblocks-
|
|
1
|
+
import{j as d}from"./liveblocks-D3ESVZyk.js";import{a as l}from"./sentry-B_92GPgU.js";import{u as ge,h as Ce,g as be,j as X,i as Ie,n as ke}from"./core-k_c8SCBE.js";import{V as we,z as xe,h as Pe,d9 as Ee,da as ye,b6 as Z,db as Te,b5 as Y,p as D,r as F,c as b,dc as L,dd as ve,de as Qe,a1 as _e,e as Ae,a7 as Oe,df as je,a2 as Ue,dg as Fe,dh as Le,n as Be,b1 as De,di as Re}from"./index-Cm2LZphQ.js";import{gk as Me,eV as ee,eW as Ve,iv as Ge,Ts as $e,f0 as Ne,iF as qe,iB as We,eX as B,f7 as ze,fZ as He,fC as Xe,fG as J,f_ as Ze,f$ as Je,g0 as Ke,g1 as Ye,g2 as et}from"./zeni-epic-state-C3zBO1No.js";import{D as tt,n as I,S as st,P as ot}from"./mui-UJrLjp1k.js";import{u as at}from"./useAiCfoDashboardSuggestedQuestionsChips-D_8fZhjX.js";import{p as nt}from"./pathToGoBack-D0Z5Ycmy.js";import"./recharts-Q-kkTNuO.js";import"./analytics-DVTbnjlr.js";import"./plaid-B1j5PXHV.js";import"./dnd-CKEs-Nbe.js";import"./stripe-DMRn4zHo.js";import"./lottie-BYni7Ovk.js";import"./lexical-k-PQZXkn.js";import"./pdf-CaeTpLUv.js";import"./utils-Mjhh9T8E.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new t.Error().stack;r&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[r]="17d7fbf9-0a7d-46c5-bb32-fd88b19bef74",t._sentryDebugIdIdentifier="sentry-dbid-17d7fbf9-0a7d-46c5-bb32-fd88b19bef74")}catch{}})();const te="chat-response-generated",it=ke(function(t,r){const s=ee(t),m=r.isSubmitting,n=s.uiState?.currentChatSessionId,p=n!=null?ze(t.aiCfoState,n):[];return{showSampleQuestions:r.sessionFromUrl==="explore"&&s.uiState.currentChatSessionId==null,aiCfoView:s,isSubmitting:m,isNewChatSession:r.sessionFromUrl==="new_chat"||r.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${Ue}/tableDownload`,emailLinkQuestion:r.emailLinkQuestion,autoSubmitEmailLinkQuestion:r.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:r.onEmailLinkQuestionProcessed,routedInitialQuestionSource:r.routedInitialQuestionSource,routedInitialQuestionSuggestionIndex:r.routedInitialQuestionSuggestionIndex,exploreSuggestedPromptQuestions:r.exploreSuggestedPromptQuestions,exploreSuggestedPromptQuestionsLoading:r.exploreSuggestedPromptQuestionsLoading,isFileUploadEnabled:r.isFileUploadEnabled,isUploadPromoVisible:r.isUploadPromoVisible,onUploadPromoClose:r.onUploadPromoClose,syntheticAnswers:p,resolveSyntheticAnswerCardTile:Le(t),resolveSyntheticAnswerPolicyTile:Fe(t)}},function(t,r){const{location:s,currentTenant:m,userId:n,navigate:p,currentChatSessionId:S,allSessionsWithOrderedQuestionAnswers:c,setIsAiCfoOpen:f}=r;return{onEventReceived:(e,h)=>{if(e===te&&typeof h.text=="string"&&typeof h.metadata=="object"){const a=h,u=Je(a.type),o=a.metadata.chat_session_id??null,{currentChatSession:E,currentQuestionAnswer:k,currentQuestionAnswerSummary:y}=Y(c,o);u!=="answer"?b.trackAICFOChatResponseGenerated(u,k?.question.questionText??"",a.text,o,Re(y,E),a.metadata.message_id??null):b.trackAICFOChatAnswerGenerated(a.text,k?.question.questionText??"",(a.follow_up_questions?.length??0)>0,!!a.assumptions,!!a.insights,a.visualization!=null,Ke(a.visualization?.type??"")??null,o,a.summarized_title,a.metadata.message_id??null),t(Ye({chatSessionId:a.metadata.chat_session_id,responseType:u,fetchState:{fetchState:"Completed",error:void 0}})),t(et({chatSessionId:a.metadata.chat_session_id,answerPayload:a,userId:n}))}},onSubmit:(e,h,a,u)=>{e&&De(t,e,h,S,c,n,u,a)},updateCurrentInput:e=>{t(J(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{t(Ze(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{p(-1)},onCloseClick:()=>{const e=D(s.state?.pathnameStackToGoBack),h=e.poppedPathname??nt(1);p(h,{state:{...s.state,pathnameStackToGoBack:e.newStack}}),t(J(""))},togglePageView:()=>{const e=D(s.state?.pathnameStackToGoBack),h=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;p(h,{state:{...s.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),f(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{p(-1)},onNewChatClick:()=>{S!=null&&t(Xe());const e=Be(s.state?.pathnameStackToGoBack,s.pathname);p(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,h)=>{t(He({questionAnswerId:e,isCollapsed:h}))},onMenuClick:r.onMenuClick}})(Oe(je)),vt=({isFileUploadEnabled:t})=>{const{setIsAiCfoOpen:r}=we(),s=ge(),m=Ce(),n=be(),[p,S]=l.useState(!1);l.useEffect(()=>{s(Me())},[s]);const c=X(i=>ee(i)),f=xe.getSignedInUser(),{session_id:e}=Ie(),h=Pe(),a=_e(h),u=X(i=>Ve(i)),o=c.uiState.currentChatSessionId,E=u.tenantEmailDomain,{handleUploadPromoClose:k,isUploadPromoVisible:y}=Ee({isFileUploadEnabled:t,tenantEmailDomain:E}),T=ye({currentTenant:u,currentChatSessionId:o,aiCfoView:c}),{isSuggestedQuestionsLoading:se,suggestedPromptQuestions:oe}=at(),w=n.state,x=w?.aiCfoInitialQuestion,R=!!w?.aiCfoShouldSubmit;l.useEffect(()=>{const i=n.state;if(i?.[Z]!==!0)return;S(!0);const g={...i};delete g[Z],m(n,{replace:!0,state:g})},[n.pathname,n.search,n.state,m]);const[ae,v]=l.useState(null),[ne,Q]=l.useState(!1),[ie,_]=l.useState(void 0),[re,A]=l.useState(void 0),M=l.useRef(!1);l.useEffect(()=>{if(!M.current&&x!=null&&x!==""){const i=n.state;v(x),Q(R),_(i?.aiCfoInitialSubmissionSource!=null?i.aiCfoInitialSubmissionSource:void 0);const g=i?.aiCfoSuggestionIndex;A(typeof g=="number"?g:void 0),M.current=!0}},[x,R,n.state]);const le=l.useCallback(()=>{v(null),Q(!1),_(void 0),A(void 0)},[]),V=l.useMemo(()=>new URLSearchParams(n.search),[n.search]),G=V.get("ref")??w?.aiCfoRef,O=V.get("emailRefId")??w?.aiCfoEmailRefId,$=l.useRef(!1);l.useEffect(()=>{$.current||G!=="month-end-email"||O==null||o!=null||f==null||(s(Ge("controller",f.userId,O,"MONTH_END_EMAIL")),$.current=!0)},[G,O,o,s,f]);const P=c.uiState.lastContextMessage;l.useEffect(()=>{P!=null&&P!==""&&o!=null&&(v(P),Q(!0),_(void 0),A(void 0),s($e()))},[P,o,s]);const de=u.masterTOSInfo,C=de?.isMasterTOSAccepted??!1,{visitedSessions:N}=Te(o),j=c.fetchState,U=c.uiState.chatSessionsNextPageToken.hasMore||!c.uiState.chatSessionsFirstPageFetched,q=o!=null?c.fetchChatSessionHistoryByChatSessionId?.[o]?.fetchState??"Not-Started":"Not-Started",W=o==null||(c.uiState.chatHistoryNextPageToken[o]?.hasMore??!0),z=c.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:ue}=Y(z,o),ce=ue.length===0;l.useEffect(()=>{C||a||m("../dashboard",{state:{...n.state,message:"open_ai_cfo_drawer"}})},[C,a,m,n.state]);const me=l.useCallback(()=>{const i=D(n.state?.pathnameStackToGoBack),g=u.tenantEmailDomain;m(i.poppedPathname??(g!=null?`/${g}/dashboard`:".."),{state:{...n.state,pathnameStackToGoBack:i.newStack}})},[u.tenantEmailDomain,n.state,m]);l.useEffect(()=>{o!=null&&e!==o&&m(`../ai-cfo/${o}`,{state:{...n.state}})},[o,e]),l.useEffect(()=>{e!=null&&o==null&&e!=="new_chat"&&e!=="explore"&&s(Ne({sessionId:e,agentId:"controller"}))},[]);const pe=l.useMemo(()=>({events:N.map(i=>`private-encrypted-chat-${i}.${te}`),eventCallback:(i,g,fe)=>fe.onEventReceived(i,g)}),[N]);l.useEffect(()=>{j!=="In-Progress"&&U&&s(qe())},[j,U,s]),l.useEffect(()=>{o!=null&&q!=="In-Progress"&&W&&f!=null&&j==="Completed"&&!U&&s(We(o,f.userId))},[q,W,o,f,s]);const H=i=>i.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(f==null||e==null)throw Error("Can't access AI Controller page without signing in...");const he=o!=null&&c.responseStateByChatSessionId?.[o]?.answer?.fetchState==="In-Progress";if(!C&&a)return d.jsxs(lt,{children:[d.jsx(F,{analytics:b,onLoad:H}),T.drawerElement,d.jsx(dt,{children:d.jsx(K,{children:d.jsx(L,{isTOSAccepted:!1,acceptMasterTOSState:c.masterTOSAcceptanceState,onCloseClick:me,onCompleteClick:()=>{u.userRoleId!=null&&s(B(u.userRoleId))}})})})]});const Se=d.jsxs(d.Fragment,{children:[p&&!C?d.jsx(F,{analytics:b,onLoad:H}):null,d.jsx(L,{isTOSAccepted:C,acceptMasterTOSState:c.masterTOSAcceptanceState,showHeader:!1,togglePageView:C?()=>S(!1):void 0,onCloseClick:()=>S(!1),onCompleteClick:()=>{C||u.userRoleId==null||s(B(u.userRoleId)),S(!1)}})]});return d.jsxs(d.Fragment,{children:[d.jsxs(rt,{children:[d.jsx(F,{analytics:b,onLoad:i=>i.trackPageLoaded(Ae.Event.aiCFOPage)}),a&&T.drawerElement,d.jsx(it,{...pe,currentChatSessionId:o,allSessionsWithOrderedQuestionAnswers:z,openOnboardingPage:()=>S(!0),userId:f.userId,setIsAiCfoOpen:r,navigate:m,sessionFromUrl:e,location:n,isSubmitting:he,isEmptyChatWithSession:ce,currentTenant:u,emailLinkQuestion:ae??void 0,autoSubmitEmailLinkQuestion:ne,onEmailLinkQuestionProcessed:le,routedInitialQuestionSource:ie,routedInitialQuestionSuggestionIndex:re,onMenuClick:a?T.open:void 0,isFileUploadEnabled:t,isUploadPromoVisible:y,onUploadPromoClose:k,exploreSuggestedPromptQuestions:oe,exploreSuggestedPromptQuestionsLoading:se}),p&&a?d.jsx(tt,{anchor:"right",open:p,transitionDuration:250,PaperProps:{component:ut,style:{width:"100%"}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>S(!1),children:d.jsx(K,{onClick:i=>i.stopPropagation(),children:d.jsx(L,{isTOSAccepted:C,acceptMasterTOSState:c.masterTOSAcceptanceState,onCloseClick:()=>S(!1),onCompleteClick:()=>{C||u.userRoleId==null||s(B(u.userRoleId)),S(!1)}})})}):null]}),p&&!a?d.jsx(ve,{open:p,onClose:()=>S(!1),children:d.jsx(Qe,{children:Se})}):null]})},K=I(st)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|
|
5
|
-
`,rt=
|
|
5
|
+
`,rt=I.div`
|
|
6
6
|
height: 100vh;
|
|
7
7
|
width: 100%;
|
|
8
|
-
`,lt=
|
|
8
|
+
`,lt=I.div`
|
|
9
9
|
height: 100vh;
|
|
10
10
|
width: 100%;
|
|
11
11
|
display: flex;
|
|
12
12
|
flex-direction: column;
|
|
13
13
|
min-height: 0;
|
|
14
|
-
`,dt=
|
|
14
|
+
`,dt=I.div`
|
|
15
15
|
flex: 1;
|
|
16
16
|
min-height: 0;
|
|
17
17
|
display: flex;
|
|
18
18
|
flex-direction: column;
|
|
19
|
-
`,
|
|
19
|
+
`,ut=I(ot)`
|
|
20
20
|
box-shadow: ${({theme:t})=>t.colors.elevation2};
|
|
21
21
|
color: ${({theme:t})=>t.colors.grey4};
|
|
22
22
|
`;export{vt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as c}from"./liveblocks-DvKPzrwo.js";import{a as v}from"./sentry-Be8twC83.js";import{h as B,g as P,u as j,j as y,N as q,n as U,i as K,o as ee,p as x}from"./core-CQnSJ9vO.js";import{eW as k,PC as A,Pi as g,zf as E,z3 as J,zb as R,yZ as Z,Pk as G,z0 as te,z4 as H,zh as M,zg as D}from"./zeni-epic-state-DKeO4Z0C.js";import{m as O,z as V,B as T,a7 as Q,bI as ae,af as _,bz as X,bJ as oe,bK as le,bL as pe}from"./index-W83PhAZh.js";import"./mui-sKCdI-e6.js";import{i as se}from"./ReimbursementApprovalRuleDetailScreen-BgYFphfr.js";import re from"./NotFoundScreen-FcrdBNP0.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},p=new e.Error().stack;p&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[p]="cca95110-3b3b-4fe8-85a0-3054d7c07256",e._sentryDebugIdIdentifier="sentry-dbid-cca95110-3b3b-4fe8-85a0-3054d7c07256")}catch{}})();const N="bill-approval-rule-update",ne=U(function(e){return{approvalView:A(e),billPaySetupApproverViewUpdateData:g(e).billPaySetupApproverViewUpdateData}},function(e,p){const{navigate:t,location:s}=p;return{onApprovalRulesEventReceived:a=>{a.endsWith(N)&&e(G(!1))},onBackClick:()=>{_(s)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(Z(a,!1))},onEditRuleClick:a=>{a!=null?(e(R(a)),t(`./${a}/edit`)):(e(R()),t("./new"))}}})(Q(ae)),ie=()=>{const e=B(),p=P(),t=j(),[s,a]=v.useState(!1),[i,r]=v.useState(!1),d=O(),o=y(l=>l.billPaySetupApproverViewState.fetchState),u=y(l=>k(l)),n=y(l=>A(l)),f=y(l=>g(l).billPaySetupApproverViewUpdateData);if(v.useEffect(()=>{f?.updateStatus.fetchState==="Completed"&&t(E())},[f]),v.useEffect(()=>{s||o!=="Not-Started"||(a(!0),t(J(!0,!0,!1)))},[s,o,t]),V.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");v.useEffect(()=>{n.allApprovalRules.length===0&&n.fetchState==="Completed"&&(i||(r(!0),t(R())),e("./new"))},[i,n,t]);const m={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${N}`]:[],eventCallback:(l,w,h)=>{l.endsWith(N)&&h.onApprovalRulesEventReceived(l)}};return u.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?c.jsx(q,{to:"../../promo"}):u.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||n.fetchState!=="Completed"&&n.fetchState!=="Error"?c.jsx(T,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):c.jsx(ne,{currentTenant:u,location:p,navigate:e,...m})},F="bill-approval-rule-update",ce=U(function(e){const p=A(e),t=g(e).billPaySetupApproverViewUpdateData,s={};for(const i of Object.values(e.contactState.contactById))i?.id!=null&&(s[i.id]=i.fullName);const a={};for(const i of Object.values(e.classState.classesByKey))i?.classId!=null&&(a[i.classId]=i.className);return{approvalView:p,billPaySetupApproverViewUpdateData:t,vendorNamesById:s,departmentNamesById:a}},function(e,p){const{navigate:t,location:s}=p;return{onApprovalRulesEventReceived:a=>{a.endsWith(F)&&e(G(!1))},onBackClick:()=>{_(s)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(Z(a,!0))},onEditRuleClick:a=>{a!=null?(e(R(a)),t(`./${a}/edit`)):(e(R()),t("./new"))},onReorderRules:a=>{e(te(a,!0))}}})(Q(oe)),ue=()=>{const e=y(t=>k(t)),{isApprovalRulesV3Enabled:p}=X(e?.tenantId);return p?c.jsx(de,{}):c.jsx(ie,{})},de=()=>{const e=B(),p=P(),t=j(),[s,a]=v.useState(!1),[i,r]=v.useState(!1),d=O(),o=y(l=>l.billPaySetupApproverViewState.fetchState),u=y(l=>k(l)),n=y(l=>A(l)),f=y(l=>g(l).billPaySetupApproverViewUpdateData);if(v.useEffect(()=>{f?.updateStatus.fetchState==="Completed"&&t(E())},[f]),v.useEffect(()=>{s||o!=="Not-Started"||(a(!0),t(J(!0,!0,!0)))},[s,o,t]),V.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");v.useEffect(()=>{n.allApprovalRules.length===0&&n.fetchState==="Completed"&&(i||(r(!0),t(R())),e("./new"))},[i,n,t]);const m={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${F}`]:[],eventCallback:(l,w,h)=>{l.endsWith(F)&&h.onApprovalRulesEventReceived(l)}};return u.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?c.jsx(q,{to:"../../promo"}):u.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||n.fetchState!=="Completed"&&n.fetchState!=="Error"?c.jsx(T,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):c.jsx(ce,{currentTenant:u,location:p,navigate:e,...m})},ve=U(function(e,p){const t=g(e),s=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=s==="approval_create"&&t.allApprovalRules.length!==0;let i=t.allApprovalRules.length===0;return p.approvalRuleId&&(i=t.allApprovalRules.findIndex(r=>r.approvalRuleId===p.approvalRuleId)===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:i,approvalUpdateActionType:s}},function(e,p){const{navigate:t,approvalUpdateDataView:s,approverViewData:a,approvalRuleId:i}=p,r=s.billPaySetupApproverViewUpdateData?.type,d=_(p.location);return{onApprovalRuleDataUpdated:o=>{const u=f=>{const m=[];return f.forEach(l=>{const w=l.actors.selectedUsers.map(b=>({type:"user",userId:b.userId,isImplicitActor:!1})),h=l.actors.selectedNonUsers.map(b=>{const I=!!se(b.value);return{type:I?"attribute":"role",subType:b.value,userId:void 0,idType:void 0,isImplicitActor:!I}}),S=w.concat(h);m.push({action:l.stepType.selectedOption,actors:S,operator:S.length>1?l.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),m},n={amount:{type:"amount",comparator:"range",min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const f={criteria:n,steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingBills.includes("applyToExistingBills")};e(D(f))}else{const f={approvalRuleId:i,criteria:n,steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingBills.includes("applyToExistingBills")};e(D(f))}},onResetClick:()=>{e(E()),r==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),r==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(M(!1))},onSaveRuleSuccess:()=>{t("../")}}})(le);function fe(){const e=B(),p=j(),t=P(),{approvalRuleId:s}=K(),a=V.getSignedInUser(),i=O(),r=y(n=>g(n)),d=y(n=>A(n)),[o,u]=v.useState(!1);if(v.useEffect(()=>{o||(u(!0),p(H(!0)))}),v.useEffect(()=>{d.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[d,s]),a==null)throw Error("Can't access address page without signing in...");return r.approverListFetchStatus.fetchState=="Not-Started"||r.approverListFetchStatus.fetchState==="In-Progress"?c.jsx(T,{fetchState:r.approverListFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):c.jsx(ve,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:d,location:t})}const ye=U(function(e,p){const t=g(e),s=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=[],i={};for(const r of Object.values(e.contactState.contactById))r?.id!=null&&(a.push(r.id),i[r.id]=r.fullName);return{localData:t,approvalUpdateActionType:s,allVendorIds:a,vendorNamesById:i,editingRuleId:s==="approval_update"?p.approvalRuleId:void 0,allApprovalRulesWithUser:A(e).allApprovalRules}},function(e,p){const{navigate:t,approvalUpdateDataView:s,approverViewData:a,approvalRuleId:i}=p,r=s.billPaySetupApproverViewUpdateData?.type,d=_(p.location);return{onApprovalRuleDataUpdated:o=>{const u=S=>{const b=[];return S.forEach(I=>{const $=I.actorKind?.selectedOption,z=I.selectedRole?.selectedOption;let C=[];$==="role"&&z!=null?C=[{type:"attribute",subType:z,userId:void 0,idType:void 0,isImplicitActor:!1}]:$==="specific_person"&&(C=(I.persons?.selectedUsers??[]).map(Y=>({type:"user",userId:Y.userId,isImplicitActor:!1})));const L=I.action??"require_approval";b.push({action:L,actors:C,operator:C.length>1?L==="require_approval"?"or":"and":"is"})}),b},n=o.amountCriteria,f=o.vendorCriteria,m=o.departmentCriteria,l={};if(n!=null&&n.comparator.selectedOption!=null){const S=n.comparator.selectedOption;l.amount={type:"amount",comparator:S,min:S==="less_than"?void 0:n.min,max:S==="greater_than"?void 0:n.max}}const w=f?.selection.selectedOptions??[];w.length>0&&(l.vendor={type:"vendor",operator:f?.operator.selectedOption??"is",vendorIds:w});const h=m?.selection.selectedOptions??[];if(h.length>0&&(l.department={type:"department",operator:m?.operator.selectedOption??"is",departmentIds:h}),r==="approval_create"){const S={name:o.name,description:o.description,separationOfDuties:o.separationOfDuties,isFallback:o.isFallback,criteria:l,steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingBills.includes("applyToExistingBills")};e(D(S))}else{const S={approvalRuleId:i,name:o.name,description:o.description,separationOfDuties:o.separationOfDuties,isFallback:o.isFallback,criteria:l,steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingBills.includes("applyToExistingBills")};e(D(S))}},onResetClick:()=>{e(E()),r==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),r==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(M(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:o=>{e(R(o)),t(r==="approval_update"?`../../${o}/edit`:`../${o}/edit`)}}})(pe);function W(){const e=y(t=>k(t)),{isApprovalRulesV3Enabled:p}=X(e?.tenantId);return p?c.jsx(Se,{}):c.jsx(fe,{})}function Se(){const e=B(),p=j(),t=P(),{approvalRuleId:s}=K(),a=V.getSignedInUser(),i=O(),r=y(n=>g(n)),d=y(n=>A(n)),[o,u]=v.useState(!1);if(v.useEffect(()=>{o||(u(!0),p(H(!0)))}),v.useEffect(()=>{d.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[d,s]),a==null)throw Error("Can't access address page without signing in...");return r.approverListFetchStatus.fetchState=="Not-Started"||r.approverListFetchStatus.fetchState==="In-Progress"?c.jsx(T,{fetchState:r.approverListFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):c.jsx(ye,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:d,location:t},s??"new")}function Ee(){return c.jsxs(ee,{children:[c.jsx(x,{path:"/",element:c.jsx(ue,{})}),c.jsx(x,{path:"/new",element:c.jsx(W,{})}),c.jsx(x,{path:"/:approvalRuleId/edit",element:c.jsx(W,{})}),c.jsx(x,{path:"*",element:c.jsx(re,{})})]})}export{Ee as B};
|
|
1
|
+
import{j as c}from"./liveblocks-D3ESVZyk.js";import{a as v}from"./sentry-B_92GPgU.js";import{h as B,g as j,u as P,j as y,N as q,n as U,i as K,o as ee,p as C}from"./core-k_c8SCBE.js";import{eW as k,PD as A,Pj as g,zf as E,z3 as J,zb as R,yZ as Z,Pl as G,z0 as te,z4 as H,zh as M,zg as D}from"./zeni-epic-state-C3zBO1No.js";import{m as O,z as V,B as T,a7 as Q,bI as ae,af as _,bz as X,bJ as oe,bK as le,bL as pe}from"./index-Cm2LZphQ.js";import"./mui-UJrLjp1k.js";import{i as se}from"./ReimbursementApprovalRuleDetailScreen-BY8AWRBv.js";import re from"./NotFoundScreen-DpHt-tQH.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},p=new e.Error().stack;p&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[p]="15370c6a-8e77-4b0f-ba16-4832451bac94",e._sentryDebugIdIdentifier="sentry-dbid-15370c6a-8e77-4b0f-ba16-4832451bac94")}catch{}})();const N="bill-approval-rule-update",ne=U(function(e){return{approvalView:A(e),billPaySetupApproverViewUpdateData:g(e).billPaySetupApproverViewUpdateData}},function(e,p){const{navigate:t,location:s}=p;return{onApprovalRulesEventReceived:a=>{a.endsWith(N)&&e(G(!1))},onBackClick:()=>{_(s)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(Z(a,!1))},onEditRuleClick:a=>{a!=null?(e(R(a)),t(`./${a}/edit`)):(e(R()),t("./new"))}}})(Q(ae)),ie=()=>{const e=B(),p=j(),t=P(),[s,a]=v.useState(!1),[i,r]=v.useState(!1),d=O(),o=y(l=>l.billPaySetupApproverViewState.fetchState),u=y(l=>k(l)),n=y(l=>A(l)),f=y(l=>g(l).billPaySetupApproverViewUpdateData);if(v.useEffect(()=>{f?.updateStatus.fetchState==="Completed"&&t(E())},[f]),v.useEffect(()=>{s||o!=="Not-Started"||(a(!0),t(J(!0,!0,!1)))},[s,o,t]),V.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");v.useEffect(()=>{n.allApprovalRules.length===0&&n.fetchState==="Completed"&&(i||(r(!0),t(R())),e("./new"))},[i,n,t]);const m={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${N}`]:[],eventCallback:(l,w,h)=>{l.endsWith(N)&&h.onApprovalRulesEventReceived(l)}};return u.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?c.jsx(q,{to:"../../promo"}):u.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||n.fetchState!=="Completed"&&n.fetchState!=="Error"?c.jsx(T,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):c.jsx(ne,{currentTenant:u,location:p,navigate:e,...m})},F="bill-approval-rule-update",ce=U(function(e){const p=A(e),t=g(e).billPaySetupApproverViewUpdateData,s={};for(const i of Object.values(e.contactState.contactById))i?.id!=null&&(s[i.id]=i.fullName);const a={};for(const i of Object.values(e.classState.classesByKey))i?.classId!=null&&(a[i.classId]=i.className);return{approvalView:p,billPaySetupApproverViewUpdateData:t,vendorNamesById:s,departmentNamesById:a}},function(e,p){const{navigate:t,location:s}=p;return{onApprovalRulesEventReceived:a=>{a.endsWith(F)&&e(G(!1))},onBackClick:()=>{_(s)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(Z(a,!0))},onEditRuleClick:a=>{a!=null?(e(R(a)),t(`./${a}/edit`)):(e(R()),t("./new"))},onReorderRules:a=>{e(te(a,!0))}}})(Q(oe)),ue=()=>{const e=y(t=>k(t)),{isApprovalRulesV3Enabled:p}=X(e?.tenantId);return p?c.jsx(de,{}):c.jsx(ie,{})},de=()=>{const e=B(),p=j(),t=P(),[s,a]=v.useState(!1),[i,r]=v.useState(!1),d=O(),o=y(l=>l.billPaySetupApproverViewState.fetchState),u=y(l=>k(l)),n=y(l=>A(l)),f=y(l=>g(l).billPaySetupApproverViewUpdateData);if(v.useEffect(()=>{f?.updateStatus.fetchState==="Completed"&&t(E())},[f]),v.useEffect(()=>{s||o!=="Not-Started"||(a(!0),t(J(!0,!0,!0)))},[s,o,t]),V.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");v.useEffect(()=>{n.allApprovalRules.length===0&&n.fetchState==="Completed"&&(i||(r(!0),t(R())),e("./new"))},[i,n,t]);const m={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${F}`]:[],eventCallback:(l,w,h)=>{l.endsWith(F)&&h.onApprovalRulesEventReceived(l)}};return u.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?c.jsx(q,{to:"../../promo"}):u.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||n.fetchState!=="Completed"&&n.fetchState!=="Error"?c.jsx(T,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):c.jsx(ce,{currentTenant:u,location:p,navigate:e,...m})},ve=U(function(e,p){const t=g(e),s=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=s==="approval_create"&&t.allApprovalRules.length!==0;let i=t.allApprovalRules.length===0;return p.approvalRuleId&&(i=t.allApprovalRules.findIndex(r=>r.approvalRuleId===p.approvalRuleId)===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:i,approvalUpdateActionType:s}},function(e,p){const{navigate:t,approvalUpdateDataView:s,approverViewData:a,approvalRuleId:i}=p,r=s.billPaySetupApproverViewUpdateData?.type,d=_(p.location);return{onApprovalRuleDataUpdated:o=>{const u=f=>{const m=[];return f.forEach(l=>{const w=l.actors.selectedUsers.map(b=>({type:"user",userId:b.userId,isImplicitActor:!1})),h=l.actors.selectedNonUsers.map(b=>{const I=!!se(b.value);return{type:I?"attribute":"role",subType:b.value,userId:void 0,idType:void 0,isImplicitActor:!I}}),S=w.concat(h);m.push({action:l.stepType.selectedOption,actors:S,operator:S.length>1?l.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),m},n={amount:{type:"amount",comparator:"range",min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const f={criteria:n,steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingBills.includes("applyToExistingBills")};e(D(f))}else{const f={approvalRuleId:i,criteria:n,steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingBills.includes("applyToExistingBills")};e(D(f))}},onResetClick:()=>{e(E()),r==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),r==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(M(!1))},onSaveRuleSuccess:()=>{t("../")}}})(le);function fe(){const e=B(),p=P(),t=j(),{approvalRuleId:s}=K(),a=V.getSignedInUser(),i=O(),r=y(n=>g(n)),d=y(n=>A(n)),[o,u]=v.useState(!1);if(v.useEffect(()=>{o||(u(!0),p(H(!0)))}),v.useEffect(()=>{d.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[d,s]),a==null)throw Error("Can't access address page without signing in...");return r.approverListFetchStatus.fetchState=="Not-Started"||r.approverListFetchStatus.fetchState==="In-Progress"?c.jsx(T,{fetchState:r.approverListFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):c.jsx(ve,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:d,location:t})}const ye=U(function(e,p){const t=g(e),s=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=[],i={};for(const r of Object.values(e.contactState.contactById))r?.id!=null&&(a.push(r.id),i[r.id]=r.fullName);return{localData:t,approvalUpdateActionType:s,allVendorIds:a,vendorNamesById:i,editingRuleId:s==="approval_update"?p.approvalRuleId:void 0,allApprovalRulesWithUser:A(e).allApprovalRules}},function(e,p){const{navigate:t,approvalUpdateDataView:s,approverViewData:a,approvalRuleId:i}=p,r=s.billPaySetupApproverViewUpdateData?.type,d=_(p.location);return{onApprovalRuleDataUpdated:o=>{const u=S=>{const b=[];return S.forEach(I=>{const $=I.actorKind?.selectedOption,z=I.selectedRole?.selectedOption;let x=[];$==="role"&&z!=null?x=[{type:"attribute",subType:z,userId:void 0,idType:void 0,isImplicitActor:!1}]:$==="specific_person"&&(x=(I.persons?.selectedUsers??[]).map(Y=>({type:"user",userId:Y.userId,isImplicitActor:!1})));const L=I.action??"require_approval";b.push({action:L,actors:x,operator:x.length>1?L==="require_approval"?"or":"and":"is"})}),b},n=o.amountCriteria,f=o.vendorCriteria,m=o.departmentCriteria,l={};if(n!=null&&n.comparator.selectedOption!=null){const S=n.comparator.selectedOption;l.amount={type:"amount",comparator:S,min:S==="less_than"?void 0:n.min,max:S==="greater_than"?void 0:n.max}}const w=f?.selection.selectedOptions??[];w.length>0&&(l.vendor={type:"vendor",operator:f?.operator.selectedOption??"is",vendorIds:w});const h=m?.selection.selectedOptions??[];if(h.length>0&&(l.department={type:"department",operator:m?.operator.selectedOption??"is",departmentIds:h}),r==="approval_create"){const S={name:o.name,description:o.description,separationOfDuties:o.separationOfDuties,isFallback:o.isFallback,criteria:l,steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingBills.includes("applyToExistingBills")};e(D(S))}else{const S={approvalRuleId:i,name:o.name,description:o.description,separationOfDuties:o.separationOfDuties,isFallback:o.isFallback,criteria:l,steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingBills.includes("applyToExistingBills")};e(D(S))}},onResetClick:()=>{e(E()),r==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),r==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(M(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:o=>{e(R(o)),t(r==="approval_update"?`../../${o}/edit`:`../${o}/edit`)}}})(pe);function W(){const e=y(t=>k(t)),{isApprovalRulesV3Enabled:p}=X(e?.tenantId);return p?c.jsx(Se,{}):c.jsx(fe,{})}function Se(){const e=B(),p=P(),t=j(),{approvalRuleId:s}=K(),a=V.getSignedInUser(),i=O(),r=y(n=>g(n)),d=y(n=>A(n)),[o,u]=v.useState(!1);if(v.useEffect(()=>{o||(u(!0),p(H(!0)))}),v.useEffect(()=>{d.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[d,s]),a==null)throw Error("Can't access address page without signing in...");return r.approverListFetchStatus.fetchState=="Not-Started"||r.approverListFetchStatus.fetchState==="In-Progress"?c.jsx(T,{fetchState:r.approverListFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):c.jsx(ye,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:d,location:t},s??"new")}function Ee(){return c.jsxs(ee,{children:[c.jsx(C,{path:"/",element:c.jsx(ue,{})}),c.jsx(C,{path:"/new",element:c.jsx(W,{})}),c.jsx(C,{path:"/:approvalRuleId/edit",element:c.jsx(W,{})}),c.jsx(C,{path:"*",element:c.jsx(re,{})})]})}export{Ee as B};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-DvKPzrwo.js";import{h as K,u as se,g as Q,i as ae,j as v,N as te,n as Y,l as na,o as ia,p as S}from"./core-CQnSJ9vO.js";import{eW as Z,OU as Ue,bt as It,JS as oa,bo as wt,bJ as pe,OV as At,yu as Bt,zJ as $e,z5 as la,bn as De,OW as sa,OX as ra,c7 as ca,OY as da,ks as Ct,OZ as xt,O_ as Et,Ai as Ge,yJ as Ce,O$ as ua,yi as tt,P0 as pa,Ee as ma,ym as ba,ys as Dt,P1 as ke,P2 as Me,zK as Oe,P3 as ha,P4 as ga,zN as Ne,P5 as ya,z_ as Sa,P6 as Pt,zu as at,zz as fa,P7 as ka,P8 as ue,P9 as jt,Pa as Tt,Pb as Ft,go as va,yO as Le,cB as Rt,Pc as Ia,f9 as wa,Pd as Aa,Pe as Ba,fe as Vt,fc as $t,Pf as ze,Pg as Ca,Ph as xa,ME as Ze,Pi as Ea,MF as oe,MG as He,Pj as Da,Pk as Pa,Pl as ja,zB as nt,zy as Ta,Pm as Fa,Pn as Ra,Po as Va,zk as $a,Pp as La,Pq as _a,Pr as Ua,cp as Lt,cR as _t,kD as Ga,bP as Ma,bq as Ut,bQ as Gt,xA as Oa,Ps as Na,E1 as za,E7 as Za,t_ as Ha,zL as Wa,Ap as qa,kQ as fe,Pt as Ja,Pu as Mt,li as Ka,kK as Ot,l3 as Nt,l2 as it,bE as be,bO as Qa,Pv as Ya,Pw as ve,jn as Xa,Px as ot,Py as en,jr as tn,jM as an,AD as nn,Pz as on,lb as ln,At as sn,PA as lt,Ax as rn,AC as cn,Az as dn,Ar as un,PB as zt,yD as pn,PC as mn,PD as bn,gg as hn,gf as gn,ge as yn,kT as Sn,l9 as st,lk as fn,ry as kn,l0 as vn,Av as In,jx as wn,lp as An,PE as Bn,jp as Cn,rp as xn,PF as En,zq as Dn,bK as Pn,bs as jn,LA as Tn,cT as Fn,cS as Rn,cA as Vn,cH as $n}from"./zeni-epic-state-DKeO4Z0C.js";import{m as me,z as V,j as Ie,_ as We,H as le,x as y,aN as xe,B as re,o as x,w as Pe,c as D,be as Ln,q as z,a2 as qe,r as E,K as we,bf as rt,bg as ct,bh as _n,ak as Un,C as Gn,aH as Mn,A as Zt,D as Je,F as Ke,bi as On,at as Ht,bj as Nn,Y as zn,e as Wt,a7 as Zn,bk as Hn,bl as Wn,bm as qn,bn as Jn,bo as Kn,bp as Qn,bq as Yn,br as Xn,bs as ei,W as ti,bt as ai,b9 as ni,bu as ii,bv as oi,a9 as li}from"./index-W83PhAZh.js";import{n as _,S as si}from"./mui-sKCdI-e6.js";import{A as dt}from"./AddressScreen-DHENiPsE.js";import{g as ie,a as je,i as qt,V as Qe,b as Ye,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-Bx2DINVR.js";import{a as f}from"./sentry-Be8twC83.js";import{u as Xe}from"./useAskAiCfoHostNavButtonProps-DAlpTVgV.js";import{u as Jt}from"./useInitialThreadRequest-BDAn-AM4.js";import Ee from"./NotFoundScreen-FcrdBNP0.js";import{D as ui}from"./DrawerScreen-BtLrlXnn.js";import{M as Kt}from"./MobileAppDrawer-CjoW3Rax.js";import{F as Qt}from"./FeaturePreviewScreen-9NvuDbvP.js";import{S as Te}from"./SetupPagesScreen-DtddTp_T.js";import{B as pi}from"./BillPayApprovalRoutes-re8xxMBE.js";import{FallBackRoute as mi}from"./ScreenRoutes-B24ySlpK.js";import"./recharts-Cv5d-Vxs.js";import"./analytics-DoyQ8ezf.js";import"./plaid-BOu_8LCE.js";import"./dnd-DoHm848q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DNsrs-P3.js";import"./lexical-WXHH1XHj.js";import"./pdf-iXI4qQyj.js";import"./utils-BcJ2NV01.js";import"./analyticsHelper-CvGdvadP.js";import"./routePaths-stnXzrYV.js";import"./BusinessVerificationPageScreen-7ydI8UR9.js";import"./ReimbursementApprovalRuleDetailScreen-BgYFphfr.js";import"./getLocaleForTenant-CAvD8CfA.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]="facbf018-442c-4c8d-aac2-daa593751651",e._sentryDebugIdIdentifier="sentry-dbid-facbf018-442c-4c8d-aac2-daa593751651")}catch{}})();const bi=Y(function(e,t){const l=Ue(e,t.billId),n=V.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},u=z(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const i=De(n);i||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:g,isMarkAsPaidBtnVisible:b}=sa(l.billActivities,ra(t.currentTenant),n);d=g,p=b}const m=ca(t.currentTenant?.userRole??[]),h=l.transactionDetails!=null&&da(l.transactionDetails,m,n);return{billDetails:l,isAccountingClassesEnabled:Ct(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${qe}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:m,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:D,showMarkAsPaidButtonToCreator:h,isZeniUser:i}},function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:u}=n;return{redirectToBillsScreen:()=>{const o=ie(u),s=E(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(ke({}))},deleteBill:o=>{D.trackBillPayDeleteBill(l,o),e(Dt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?D.trackBillPayCancelAndDeleteBill(l,o):D.trackBillPayCancelBill(l),e(ba(l,s))},onSaveRealTimeApprovals:o=>{e(ma(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(pa({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(tt(l,o.type,"")):e(tt(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Ce(l,"retry")):e(Ce(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=je(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ie(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ua({billId:t.billId}))},onRefundPaymentClick:()=>{e(Ce(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Et({data:i,billId:l})),e(Ge(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(xt({billId:l}))}}})(Ln);function hi(){const e=K(),t=se(),l=Q(),{billId:n}=ae(),c=me(),r=V.getSignedInUser(),u=Ie(),o=v(O=>Z(O)),s=v(O=>Ue(O,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Jt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Xe({mobileExploreReferrer:"Bill Details"});We({isDataReady:s.fetchState==="Completed"});const h=o?.userRole!=null&&It(o?.userRole),g=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!h,[b,k]=f.useState(!1),[P,A]=f.useState(!1),[B,G]=f.useState(!1),{useFeatureGate:j,useDynamicConfig:U}=le(),{isFeatureEnabled:$}=j(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=j(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=j(y.isBillPayDetectInsufficientFundsEnabled),{configValue:M}=U(xe.zeniAssistConfig),C=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),L=M.user_ids!=null&&r?.userId!=null&&M.user_ids.includes(r?.userId),{isFeatureEnabled:J}=j(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:X}=j(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&C===!1?G(!1):G(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||W||s.allApprovers.find(O=>O.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,W,o.isZeni,C,r]),f.useEffect(()=>{n!=null&&t(At(n))},[n]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(Bt(n??"",$,L,!1)))},[b,s,n,t]),f.useEffect(()=>{P||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(A(!0),t($e(!1,$,L,X,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(la()))},[P,s,n,t]),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(te,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${x.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Pe,{analytics:D,onLoad:O=>(ee=>{n!=null&&ee.trackBillPayBillDetails(n,s.isRecurring)})(O)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:B,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:J,hasZeniAssistAccess:L,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const ye=Je.getLocalizedStrings().spendManagement.billPay.billDetails,gi={containerWidth:new Zt(100,58)},ut=Y(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:`${Ht.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:D,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:x.sp10,paddingRight:x.sp3,paddingBottom:"15px",paddingLeft:x.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(Ne(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(Sa({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{D?.trackBillPaySkipAutofill(),e(Oe(n))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(Mn);function w({appContent:e}){const t=se(),l=K(),{billId:n}=ae(),c=Q(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),i=V.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=le(),{isFeatureEnabled:m}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:g}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:k}=p(xe.zeniAssistConfig),P=k.user_ids!=null&&i?.userId!=null&&k.user_ids.includes(i?.userId),A=v(F=>Z(F)),[B,G]=f.useState(!1),[j,U]=f.useState(!1),[$,I]=f.useState(!1),[H,M]=f.useState(),C=v(F=>Me(F,m,g,n));let q=C.fetchState,W=C.file,L=C.showAutofill;const J=v(F=>Ue(F,n??""));u===!1&&(q=J.fetchState,W=J.transactionDetails?.attachments?.[0],L=!1);const X=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;f.useEffect(()=>{n==null&&t(Oe(!0))},[n,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&j?U(!1):!u&&B&&G(!1))},[n]),f.useEffect(()=>{B||n==null||u||(G(!0),t(Bt(n,h,P,!1)),j||(U(!0),t($e(!1,h,P,b,n)))),u&&!j&&(U(!0),t($e(!1,h,P,b,n)))},[B,j,u,n,t]);const O={onOkClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(X??"",F,i?.userEmail??"","yes"),t(ga({replaceBillData:!0,billId:n})),t(Ne(H,m,n))},onCancelClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(X??"",F,i?.userEmail??"","no"),t(ha({file:H,billId:n}))}},ee=f.useCallback(()=>{const F=z(c.state?.pathnameStackToGoBack),ce=F.poppedPathname??ie(A.tenantEmailDomain);t(ke({billId:n})),l(ce,{state:{pathnameStackToGoBack:F.newStack}})},[c.state,A.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(q==="Error"||J.fetchState==="Error")return a.jsx(Ee,{});if(q!="Completed")return n==null&&o!=="small"?a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[a.jsx(mt,{}),a.jsx(Re,{}),a.jsx(ut,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:!0,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:M,showActionButtons:!1,isInitialEdit:!!C.isInitialEdit,billStage:X}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||L?null:a.jsx(pt,{children:a.jsx(Yt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(_n,{}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:n==null})})]});{const F=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[L&&o!=="small"?a.jsx(mt,{}):null,$?a.jsx(Un,{titleComponent:a.jsx(wi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(Ai,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:O,isEditPopup:!0}):null,o==="small"||L?null:a.jsx(pt,{children:a.jsx(yi,{})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(ut,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:L,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,J,C),setShowConfirmationPopup:I,setPayload:M,showActionButtons:fi(u,C),isInitialEdit:!!C.isInitialEdit,billStage:F}),a.jsx(Ve,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=On();return a.jsx(Yt,{onClick:e,"data-testid":"nav-bar-back-click"})}function Si(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(ki,{children:[a.jsx(vi,{children:`${ye.recurringBill.recurringCycle}
|
|
1
|
+
import{j as a}from"./liveblocks-D3ESVZyk.js";import{h as K,u as se,g as Q,i as ae,j as v,N as te,n as X,l as na,o as ia,p as S}from"./core-k_c8SCBE.js";import{eW as Z,OV as Ue,bt as It,JS as oa,bo as wt,bJ as pe,OW as At,yu as Bt,zJ as $e,z5 as la,bn as De,OX as sa,OY as ra,c7 as ca,OZ as da,ks as Ct,O_ as xt,O$ as Et,Ai as Ge,yJ as Ce,P0 as ua,yi as tt,P1 as pa,Ee as ma,ym as ba,ys as Dt,P2 as ke,P3 as Me,zK as Oe,P4 as ha,P5 as ga,zN as Ne,P6 as ya,z_ as Sa,P7 as Pt,zu as at,zz as fa,P8 as ka,P9 as ue,Pa as jt,Pb as Tt,Pc as Ft,go as va,yO as Le,cB as Rt,Pd as Ia,f9 as wa,Pe as Aa,Pf as Ba,fe as Vt,fc as $t,Pg as ze,Ph as Ca,Pi as xa,ME as Ze,Pj as Ea,MF as oe,MG as He,Pk as Da,Pl as Pa,Pm as ja,zB as nt,zy as Ta,Pn as Fa,Po as Ra,Pp as Va,zk as $a,Pq as La,Pr as _a,Ps as Ua,cp as Lt,cR as _t,kD as Ga,bP as Ma,bq as Ut,bQ as Gt,xA as Oa,Pt as Na,E1 as za,E7 as Za,t_ as Ha,zL as Wa,Ap as qa,kQ as fe,Pu as Ja,Pv as Mt,li as Ka,kK as Ot,l3 as Nt,l2 as it,bE as be,bO as Qa,Pw as Xa,Px as ve,jn as Ya,Py as ot,Pz as en,jr as tn,jM as an,AD as nn,PA as on,lb as ln,At as sn,PB as lt,Ax as rn,AC as cn,Az as dn,Ar as un,PC as zt,yD as pn,PD as mn,PE as bn,gg as hn,gf as gn,ge as yn,kT as Sn,l9 as st,lk as fn,ry as kn,l0 as vn,Av as In,jx as wn,lp as An,PF as Bn,jp as Cn,rp as xn,PG as En,zq as Dn,bK as Pn,bs as jn,LA as Tn,cT as Fn,cS as Rn,cA as Vn,cH as $n}from"./zeni-epic-state-C3zBO1No.js";import{m as me,z as V,j as Ie,_ as We,N as le,x as y,aN as xe,B as re,o as x,r as Pe,c as D,be as Ln,p as z,a2 as qe,n as E,h as we,bf as rt,bg as ct,bh as _n,ak as Un,E as Gn,aH as Mn,w as Zt,D as Je,Q as Ke,bi as On,at as Ht,bj as Nn,X as zn,e as Wt,a7 as Zn,bk as Hn,bl as Wn,bm as qn,bn as Jn,bo as Kn,bp as Qn,bq as Xn,br as Yn,bs as ei,Y as ti,bt as ai,b9 as ni,bu as ii,bv as oi,a9 as li}from"./index-Cm2LZphQ.js";import{n as _,S as si}from"./mui-UJrLjp1k.js";import{A as dt}from"./AddressScreen-BBCv44qS.js";import{g as ie,a as je,i as qt,V as Qe,b as Xe,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-D2sqfin3.js";import{a as f}from"./sentry-B_92GPgU.js";import{u as Ye}from"./useAskAiCfoHostNavButtonProps-j-YNVdB5.js";import{u as Jt}from"./useInitialThreadRequest-DoCqWgSy.js";import Ee from"./NotFoundScreen-DpHt-tQH.js";import{D as ui}from"./DrawerScreen-BXWf7y4o.js";import{M as Kt}from"./MobileAppDrawer-B2Mj3GDG.js";import{F as Qt}from"./FeaturePreviewScreen-C_7xKfC9.js";import{S as Te}from"./SetupPagesScreen-CnApuu2-.js";import{B as pi}from"./BillPayApprovalRoutes-TnPLWObs.js";import{FallBackRoute as mi}from"./ScreenRoutes-DzWi1qtt.js";import"./recharts-Q-kkTNuO.js";import"./analytics-DVTbnjlr.js";import"./plaid-B1j5PXHV.js";import"./dnd-CKEs-Nbe.js";import"./stripe-DMRn4zHo.js";import"./lottie-BYni7Ovk.js";import"./lexical-k-PQZXkn.js";import"./pdf-CaeTpLUv.js";import"./utils-Mjhh9T8E.js";import"./analyticsHelper-7imjYGd-.js";import"./routePaths-d7Ok-gzv.js";import"./BusinessVerificationPageScreen-DWx2BUK6.js";import"./ReimbursementApprovalRuleDetailScreen-BY8AWRBv.js";import"./getLocaleForTenant-BWdefIGu.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]="164acd8f-6c59-4d05-b41d-7578b34d59c2",e._sentryDebugIdIdentifier="sentry-dbid-164acd8f-6c59-4d05-b41d-7578b34d59c2")}catch{}})();const bi=X(function(e,t){const l=Ue(e,t.billId),n=V.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},u=z(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const i=De(n);i||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:g,isMarkAsPaidBtnVisible:b}=sa(l.billActivities,ra(t.currentTenant),n);d=g,p=b}const m=ca(t.currentTenant?.userRole??[]),h=l.transactionDetails!=null&&da(l.transactionDetails,m,n);return{billDetails:l,isAccountingClassesEnabled:Ct(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${qe}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:m,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:D,showMarkAsPaidButtonToCreator:h,isZeniUser:i}},function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:u}=n;return{redirectToBillsScreen:()=>{const o=ie(u),s=E(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(ke({}))},deleteBill:o=>{D.trackBillPayDeleteBill(l,o),e(Dt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?D.trackBillPayCancelAndDeleteBill(l,o):D.trackBillPayCancelBill(l),e(ba(l,s))},onSaveRealTimeApprovals:o=>{e(ma(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(pa({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(tt(l,o.type,"")):e(tt(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Ce(l,"retry")):e(Ce(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=je(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ie(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ua({billId:t.billId}))},onRefundPaymentClick:()=>{e(Ce(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Et({data:i,billId:l})),e(Ge(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(xt({billId:l}))}}})(Ln);function hi(){const e=K(),t=se(),l=Q(),{billId:n}=ae(),c=me(),r=V.getSignedInUser(),u=Ie(),o=v(O=>Z(O)),s=v(O=>Ue(O,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Jt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Ye({mobileExploreReferrer:"Bill Details"});We({isDataReady:s.fetchState==="Completed"});const h=o?.userRole!=null&&It(o?.userRole),g=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!h,[b,k]=f.useState(!1),[P,A]=f.useState(!1),[B,G]=f.useState(!1),{useFeatureGate:j,useDynamicConfig:U}=le(),{isFeatureEnabled:$}=j(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=j(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=j(y.isBillPayDetectInsufficientFundsEnabled),{configValue:M}=U(xe.zeniAssistConfig),C=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),L=M.user_ids!=null&&r?.userId!=null&&M.user_ids.includes(r?.userId),{isFeatureEnabled:J}=j(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Y}=j(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&C===!1?G(!1):G(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||W||s.allApprovers.find(O=>O.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,W,o.isZeni,C,r]),f.useEffect(()=>{n!=null&&t(At(n))},[n]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(Bt(n??"",$,L,!1)))},[b,s,n,t]),f.useEffect(()=>{P||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(A(!0),t($e(!1,$,L,Y,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(la()))},[P,s,n,t]),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(te,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${x.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Pe,{analytics:D,onLoad:O=>(ee=>{n!=null&&ee.trackBillPayBillDetails(n,s.isRecurring)})(O)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:B,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:J,hasZeniAssistAccess:L,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const ye=Je.getLocalizedStrings().spendManagement.billPay.billDetails,gi={containerWidth:new Zt(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:`${Ht.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:D,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:x.sp10,paddingRight:x.sp3,paddingBottom:"15px",paddingLeft:x.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(Ne(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(Sa({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{D?.trackBillPaySkipAutofill(),e(Oe(n))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(Mn);function w({appContent:e}){const t=se(),l=K(),{billId:n}=ae(),c=Q(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),i=V.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=le(),{isFeatureEnabled:m}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:g}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:k}=p(xe.zeniAssistConfig),P=k.user_ids!=null&&i?.userId!=null&&k.user_ids.includes(i?.userId),A=v(F=>Z(F)),[B,G]=f.useState(!1),[j,U]=f.useState(!1),[$,I]=f.useState(!1),[H,M]=f.useState(),C=v(F=>Me(F,m,g,n));let q=C.fetchState,W=C.file,L=C.showAutofill;const J=v(F=>Ue(F,n??""));u===!1&&(q=J.fetchState,W=J.transactionDetails?.attachments?.[0],L=!1);const Y=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;f.useEffect(()=>{n==null&&t(Oe(!0))},[n,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&j?U(!1):!u&&B&&G(!1))},[n]),f.useEffect(()=>{B||n==null||u||(G(!0),t(Bt(n,h,P,!1)),j||(U(!0),t($e(!1,h,P,b,n)))),u&&!j&&(U(!0),t($e(!1,h,P,b,n)))},[B,j,u,n,t]);const O={onOkClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Y??"",F,i?.userEmail??"","yes"),t(ga({replaceBillData:!0,billId:n})),t(Ne(H,m,n))},onCancelClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Y??"",F,i?.userEmail??"","no"),t(ha({file:H,billId:n}))}},ee=f.useCallback(()=>{const F=z(c.state?.pathnameStackToGoBack),ce=F.poppedPathname??ie(A.tenantEmailDomain);t(ke({billId:n})),l(ce,{state:{pathnameStackToGoBack:F.newStack}})},[c.state,A.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(q==="Error"||J.fetchState==="Error")return a.jsx(Ee,{});if(q!="Completed")return n==null&&o!=="small"?a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[a.jsx(mt,{}),a.jsx(Re,{}),a.jsx(ut,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:!0,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:M,showActionButtons:!1,isInitialEdit:!!C.isInitialEdit,billStage:Y}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||L?null:a.jsx(pt,{children:a.jsx(Xt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(_n,{}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:n==null})})]});{const F=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[L&&o!=="small"?a.jsx(mt,{}):null,$?a.jsx(Un,{titleComponent:a.jsx(wi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(Ai,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:O,isEditPopup:!0}):null,o==="small"||L?null:a.jsx(pt,{children:a.jsx(yi,{})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(ut,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:L,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,J,C),setShowConfirmationPopup:I,setPayload:M,showActionButtons:fi(u,C),isInitialEdit:!!C.isInitialEdit,billStage:F}),a.jsx(Ve,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=On();return a.jsx(Xt,{onClick:e,"data-testid":"nav-bar-back-click"})}function Si(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(ki,{children:[a.jsx(vi,{children:`${ye.recurringBill.recurringCycle}
|
|
2
2
|
${n}/${c}`}),a.jsx(Ii,{})]}):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;
|
|
@@ -17,7 +17,7 @@ import{j as a}from"./liveblocks-DvKPzrwo.js";import{h as K,u as se,g as Q,i as a
|
|
|
17
17
|
color: ${e=>e.theme.colors.hero};
|
|
18
18
|
height: ${x.sp3};
|
|
19
19
|
width: ${x.sp3};
|
|
20
|
-
`,
|
|
20
|
+
`,Xt=_(e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M10 13L5 8L10 3",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})))`
|
|
21
21
|
width: ${x.sp3};
|
|
22
22
|
height: ${x.sp3};
|
|
23
23
|
cursor: pointer;
|
|
@@ -77,7 +77,7 @@ import{j as a}from"./liveblocks-DvKPzrwo.js";import{h as K,u as se,g as Q,i as a
|
|
|
77
77
|
margin-bottom: 30px;
|
|
78
78
|
margin-top: ${x.sp4};
|
|
79
79
|
white-space: pre-line;
|
|
80
|
-
`,Bi=
|
|
80
|
+
`,Bi=X(function(e,t){return{billsReviewView:Pt(e),analytics:t.analytics}},function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(ue())},onCloseReviewItem:l=>{e(ka(l))},onProceedForBulkActionClick:(l,n)=>{switch(l){case"send_for_approval":e(fa());break;case"approve":case"review":e(at("approved",n??""));break;case"reject":e(at("rejected",n??""))}}}})(Nn);function Ci(){const e=K(),t=v(n=>n.billsBulkActionViewState.bulkSubmissionFetchState.fetchState),{billsForReview:l}=v(n=>Pt(n));return f.useEffect(()=>{t!=="Completed"&&l.length!==0||e("./")},[t,l.length]),a.jsx(Bi,{navigate:e,analytics:D})}const ne=xa(),Yt="bulk-operation-update",_e="bill-approval-rule-update",{spendManagement:xi,common:bt}=Je.getLocalizedStrings(),ht=xi.billPay.bulkActions,Ei=_.div`
|
|
81
81
|
display: flex;
|
|
82
82
|
min-height: 100%;
|
|
83
83
|
width: 100%;
|
|
@@ -85,11 +85,11 @@ import{j as a}from"./liveblocks-DvKPzrwo.js";import{h as K,u as se,g as Q,i as a
|
|
|
85
85
|
flex-direction: column;
|
|
86
86
|
align-items: center;
|
|
87
87
|
background-color: ${e=>e.theme.colors.grey4};
|
|
88
|
-
`,Di=
|
|
88
|
+
`,Di=X(function(e,t){const l=V.getSignedInUser(),n=De(l),c=Ft(e,ne,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=Ze(e,"common"),s=e.tenantState.currentTenantId,i=Z(e),d=i?.companyName??"",p={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},m=e.billListState.downloadUIState.downloadState,h=c.fetchState,g=Ea(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:h,analytics:D,botEmail:c.billPayBotEmail,searchText:c.searchText,filters:c.filters,vendorSearchAutoCompleteData:{autoCompleteText:u,entityAutoCompleteView:o},downloadParams:{authParams:p,companyName:d,timePeriod:ne,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:g.affectedEntityIds}},function(e,t){const{navigate:l,currentTenant:n,location:c,period:r}=t,{tenantEmailDomain:u}=n;return{updateTabToState:o=>{e(ue()),e(jt(o))},onSubtabChange:o=>{e(ue()),e(Tt(o))},onTransactionClick:(o,s)=>{const i=je(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);l(i,{state:{pathnameStackToGoBack:d}})},onClickSetupIcon:()=>{const o=ji(u),s=E(c.state?.pathnameStackToGoBack,c.pathname);l(o,{state:{pathnameStackToGoBack:s}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;D?.trackBillPayNewBill();const s=`/${o}/bill/new`,i=E(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(s,{state:{pathnameStackToGoBack:i}})},onSearchTextChanged:o=>{e(La(o))},onReloadTransactions:()=>{e(Le(r,!0,t.isShowDeletedBillsEnabled,t.isInternationalWireEnabled)),e($a(n.companyId,!0))},onNavigateToSettings:()=>{l("../bills/setup")},onBackClick:()=>{l("../",{relative:"path"})},onFiltersChange:o=>{e(Va({filters:o})),o.categories.every(s=>s.field!=null&&s.values?.length!==0)&&D.trackSpendManagmentFilterChange("bill_pay",o.categories.map(s=>`${s.field}-${JSON.stringify(s.values)}`))},updateDownloadStateHandler:o=>{o==="In-Progress"&&D.trackSpendManagementDownloadClick("bill_pay"),e(Ra({uiState:{downloadState:o}}))},updateBulkActionList:o=>{e(Fa(o))},removeAllTransactionsFromBulkActionList:()=>{e(ue())},onProceedForBulkActionClick:(o,s)=>{switch(o){case"delete":case"cancel":e(Ta(o,s??""));break;case"send_for_approval":e(nt("send_for_approval")),t.navigate("./bulk-review");break;case"approve":e(nt("approve")),t.navigate("./bulk-review");break;case"review":e(ja()),t.navigate("./bulk-review")}},onBillPayApprovalRulesEventReceived:o=>{o.endsWith(_e)&&e(Pa(!1))},onEventReceived:o=>{o===Yt&&e(Da())},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:o=>{o.trim().length>=2?e(He({searchString:o,entityType:"vendor",searchOrigin:"common"})):o.trim().length===0&&e(oe("common"))},onCancelAutoComplete:()=>{e(oe("common"))}}}})(Zn(Hn));function Pi(){const e=K(),t=se(),l=Q(),n=we(),c=l.state,r=Ie(),[u,o]=f.useState(!1),[s,i]=f.useState(null),d=na("/:tenantEmailDomain/bills/bulk-review")!=null;f.useEffect(()=>(c?.tab!=null&&c?.subTab!=null&&(t(jt(c?.tab)),t(Tt(c?.subTab))),()=>{t(ue())}),[]);const p=V.getSignedInUser(),m=v(T=>Z(T)),{areTenantIdsInSync:h}=zn(),[g,b]=f.useState(!1),{useFeatureGate:k}=le(),{isFeatureEnabled:P}=k(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:A}=k(y.isBillPayCommentingEnabled),{isFeatureEnabled:B}=k(y.isReimbursementCommentingEnabled),{isFeatureEnabled:G}=k(y.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:j}=k(y.isBillPayBulkActionEnabled),{isFeatureEnabled:U}=k(y.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:$}=k(y.isBillPayDetectInsufficientFundsEnabled),I=v(T=>Ft(T,ne,j,p?.userId)),{isFeatureEnabled:H}=k(y.isDebitCardFeatureEnabled),M=I.fetchState,{isAiCfoAccessEnabled:C,onAskAiCfoClick:q}=Ye({mobileExploreReferrer:"Bills List"});We({isDataReady:M==="Completed"});const W=!!m.companyBillPayInfo?.info?.isBillPayTOSAccepted,L=!!m.companyBillPayInfo?.info?.isBillPayEnabled,J=v(T=>va(T.companyState,m.companyId)),Y=J?.company.featuresActivationInfo.connectedAccountProvider;if(f.useEffect(()=>{!g&&L&&h&&(b(!0),t(Le(ne,!0,P,U)))},[g,ne,h,t]),p==null)throw Error("Can't access address page without signing in...");const O=(T,de)=>{t(Ca({uiState:{sortKey:T,sortOrder:de},period:ne}))},ee=Rt(r?.loggedInUserRoleMap),F=pe(r?.loggedInUserRoleMap),ce=T=>{o(T)},{billsProcessed:N,billsProcessing:Ae}=v(T=>Ia(T));f.useEffect(()=>{N===Ae&&s!=null&&(t(wa({messageSection:"bill_pay_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_bill_",variableValue:N>1?ht.bills:ht.bill},{variableName:"_has_",variableValue:N>1?bt.texts.have:bt.texts.has},{variableName:"_action_",variableValue:Aa(s)}]})),t(Ba()),setTimeout(()=>{t(Le(ne,!0,P,!0,U))},3e3),i(null))},[N,Ae]);const ea={events:m.companyId!=null?[`private-encrypted-${m.companyId}.${Yt}`,`private-encrypted-${m.companyId}.${_e}`]:[],eventCallback:(T,de,et)=>{T.endsWith(_e)?et.onBillPayApprovalRulesEventReceived?.(T):de?.entity_type==="bill"&&(i(de.operation_type),et.onEventReceived(T))}},ta=Vt(H,m),aa=$t(m);return l.pathname.endsWith("/bills/")||l.pathname.endsWith("/bills")||l.pathname.endsWith("/bills/bulk-review")?ta===!0||aa===!0?a.jsx(Qt,{}):L?a.jsxs(a.Fragment,{children:[M==="Completed"?a.jsx(Pe,{analytics:D,onLoad:T=>(de=>de.trackPageLoaded(Wt.Event.billPayHome))(T)}):null,a.jsxs(Ei,{windowSize:n,children:[a.jsx(Kt,{isAppContentDrawerOpen:u,handleDrawerToggle:ce}),a.jsx(ui,{isOpen:d,drawerLeftMargin:new Zt(0,0,300,600),onClose:()=>{e("./"),t(ue())},children:a.jsx(Ti,{onClick:T=>T.stopPropagation(),children:a.jsx(Ci,{})})}),a.jsx(Di,{location:l,navigate:e,currentTenant:m,entity:"bill_pay",isBillPayCommentingEnabled:A,isReimbursementCommentingEnabled:B,period:ne,isAdmin:!1,uiState:I.uiState,onColumnSortConfigChanged:O,isUserHasOnlyBillpayAccess:ee,isShowDeletedBillsEnabled:P,isShowDeletedReimbursementEnabled:G,isBulkActionEnabled:j,roleMap:r?.loggedInUserRoleMap,onClickMenuIcon:()=>{ce(!0)},isDownloadEnabled:I.isDownloadEnabled,connectedAccountProvider:Y,bulkSubmissionLimit:I.billBulkSubmissionLimit,bulkSubmissionFetchState:I.billListBulkActionInfo.bulkSubmissionFetchState,isRecurringBillInBulkActionList:I.billListBulkActionInfo.isRecurringBillInBulkActionList,isInternationalWireEnabled:U,isDetectInsufficientFundsEnabled:$,isAiCfoAccessEnabled:C,onAskAiCfoClick:q,...ea})]})]}):W===!0&&F===!0?a.jsx(te,{to:"../setup"}):r!=null&&ze(m,r.loggedInUserRoleMap)?a.jsx(te,{to:"../promo"}):a.jsx(re,{fetchState:M}):a.jsx(Ee,{})}const ji=e=>`/${e}/bills/setup`,Ti=_(si)`
|
|
89
89
|
display: flex;
|
|
90
90
|
min-height: 100%;
|
|
91
91
|
flex-direction: column;
|
|
92
|
-
`,{common:{currency:Se},spendManagement:{billPay:{billDetails:Fi}},appName:Ri}=Je.getLocalizedStrings(),Vi=Y(function(e,t){const l=V.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=z(t.location.state?.pathnameStackToGoBack);let u=!0;r.poppedPathname?.includes("bills")===!0&&(u=!1);const o=e.entityAutoCompleteState.autoCompleteText.common,s=Ze(e,"common");let i=`${l?.firstName} ${l?.lastName}`;const d=De(l);t.billId!=null&&t.billDetailsView!=null&&(i=`${t.billDetailsView.createdBy?.firstName??Ri} ${t.billDetailsView.createdBy?.lastName??""}`),d||!t.billDetailsView.createdBy?.email?.includes("zeni.ai")||(i="Zeni");const p=t.billDetailsView.editBillInitialDetails?.totalAmount?.amount,m=Ma(t.billDetailsView.paymentDetailsSection?.paymentType?.method),h=t.currentTenant.createTime,g=Ut(),b=t.sameDayAchDisablementConfig.newTenantTenureLimitMonths,k=h.add(b,"month").isAfter(g),P=!!(t.billDetailsView.billStage==="draft"&&m&&p!=null&&p>0)&&!Gt(p,t.billDetailsView.approvalRules.allApprovalRules,l,t.billDetailsView.vendor?.id,t.billDetailsView.classId),A=Z(e);return{billDetails:t.billDetailsView,isAccountingClassesEnabled:Ct(e),billId:t.billId,createdBy:i,createTime:t.billDetailsView?.createTime,authParams:c,transactionAttachmentEndpoint:`${qe}/transaction_attachment`,analytics:D,showBackButton:u,isAdmin:t.isBillPayAdmin,isSuperAdmin:t.isSuperAdmin,connectedAccountProvider:A.company?.featuresActivationInfo.connectedAccountProvider??"",customerSearchAutoCompleteData:{autoCompleteText:o,entityAutoCompleteView:s},showMarkAsPaidInfo:P,isZeniUser:d,isNewUser:k,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(it(i));const d=yt(s,i,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},chooseNewVendor:i=>{const d=i??t.billDetailsView.addBillAutoFields.tentativeVendorName;d!=null&&e(Ot(d,!1)),e(Nt({localData:{vendorName:i??t.billDetailsView.addBillAutoFields.tentativeVendorName}})),e(it());const p=yt(s,void 0,l),m=E(r.state?.pathnameStackToGoBack,r.pathname);u(p,{state:{pathnameStackToGoBack:m}})},onInvoiceUpload:i=>{i!=null&&e(Ne(i,t.isVendorRecommendationEnabled))},updateShowAutofill:i=>{e(Oe(i))},onSaveChangesToLocalStore:(i,d,p,m,h)=>{const g=Ui(t.billDetailsView,{...i,paymentDetails:{...i?.paymentDetails,paymentDate:h}},p,d,t.isInternationalPaymentShaVsOurEnabled,m,t.vendor);e(Ka({billDetailLocalData:g,billId:l}))},saveBillDetails:()=>{e(Ge("draft",!1,!1,l)),e(oe("common"))},updateBillDetailSaveBillCode:()=>{e(Mt("draft"))},reviewBillDetails:()=>{const i=$i(s,l),d=E(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d,message:"coming_from_edit_page"}})},discardBillDetailsFromLocalStore:({billId:i})=>{e(ke({billId:i}))},clearBillPayReviewLocalState:()=>e(Ja()),onClickDismiss:()=>{const i=ie(s),d=E(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d}})},onClickDiscard:()=>{const i=ie(s),d=E(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=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})}},redirectToACHScreen:i=>{e(fe(!1,i));const d=Li(s,i,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToWireScreen:i=>{e(fe(!1,i));const d=_i(s,i,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToInternationalScreen:i=>{e(fe(!1,i));const d=qt(s,l,i),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToBillsScreen:()=>{const i=ie(s),d=E(r.state?.pathnameStackToGoBack,r.pathname);e(ke({})),u(i,{state:{pathnameStackToGoBack:d}})},redirectToBillDetailPage:()=>{t.navigate("../")},deleteBill:()=>{l!=null&&e(Dt(l))},onAttachmentClick:(i,d)=>{const p=je(s,i,d);window.open(`${p}`,"_blank")},onBackClick:()=>{const i=z(t.location.state?.pathnameStackToGoBack),d=i.poppedPathname??ie(s);u(d,{state:{pathnameStackToGoBack:i.newStack}})},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,d)=>{i.trim().length>=2?e(He({searchString:i,entityType:d,searchOrigin:"common"})):i.trim().length===0&&e(oe("common"))},onCancelAutoComplete:()=>{e(oe("common"))}},addVendorContactEmail(i,d){e(qa(i,d,l))},onWiseVerifyClick:()=>{let i="";i=Kn()?"https://sandbox.transferwise.tech":"https://wise.com";const d=`${i}/login`;window.open(d,"_blank")},onVendorSelected:i=>{e(Wa(!0,i,l))},onSignUpAccountClick:()=>{t.hasZeniAccountsAdminAccess?window.open(`/${s}/checking/promo`,"_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onMoveMoneyClick:()=>{t.isZeniAccountsUser?window.open(`/${s}/checking/transfer`):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onInternationalWireVerifyClick:()=>{window.open(`/${s}/bills/international-wire`)},onFetchLinkTokenClick:(i,d)=>{e(Ha("bill_pay_detail",i,d))},onEstablishConnectionClick:i=>{e(Za(i,n,"bill_pay_detail","bill_pay"))},onUpdatePaymentAccountStatus:(i,d,p)=>{e(za(i,d,"bill_pay","bill_pay_detail",p))},onEstablishConnectionSuccess:()=>{e(Oa("bill_pay","bill_pay_detail")),e(Na({billId:l,withdrawFromAccountId:o.newAddedBillPaymentAccountId,withdrawFromList:o.withdrawFromList}))}}})(Wn);function gt(){const e=K(),t=Q(),l=se(),{billId:n,tenantEmailDomain:c}=ae(),{useFeatureGate:r,useDynamicConfig:u}=le(),{isFeatureEnabled:o,isFeatureGateLoading:s}=r(y.isVendorMagicLinkFeatureEnabled),{isFeatureEnabled:i}=r(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:d}=r(y.isBillPayCommentingEnabled),{isFeatureEnabled:p}=r(y.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:m}=r(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=r(y.isRecurringBillsFeatureEnabled),{isFeatureEnabled:g}=r(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=r(y.isShaDisabled),{isFeatureEnabled:k}=r(y.isOurDisabled),{isFeatureEnabled:P}=r(y.isBillPayDetectInsufficientFundsEnabled),{configValue:A}=u(xe.zeniAccountsConfig),B=_a(A),{configValue:G}=u(xe.sameDayAchDisablementConfig),j=Ua(G),U=V.getSignedInUser(),$=v(N=>Z(N)),I=v(N=>Me(N,m,g,n)),H=Jt($?.companyId,{clearParams:I.fetchState==="Completed"}),{isAiCfoAccessEnabled:M,onAskAiCfoClick:C}=Xe({mobileExploreReferrer:"Bill Details"});We({isDataReady:I.fetchState==="Completed"});const q=$.companyId??V.getSignedInUserTenant(c)?.companyId,W=!!$.companyZeniAccountInfo?.info?.isZeniAccountEnabled,L=Ie(),J=Lt(L?.loggedInUserRoleMap),X=_t(L?.loggedInUserRoleMap),O=pe(L?.loggedInUserRoleMap),ee=wt($.userRole);if(f.useEffect(()=>{n!=null&&l(At(n))},[n]),U==null)throw Error("Can't access address page without signing in...");const F=v(N=>Ga(N.accountState,N.accountListState,"billPayAccountList")),ce={pathname:"../",search:t.search};return I.isDeleted===!0||I.billStage=="paid"||I.fetchState=="Not-Started"?a.jsx(te,{to:ce}):I.deleteStatus.fetchState==="In-Progress"||s?a.jsx(re,{fetchState:I.deleteStatus.fetchState}):a.jsxs(a.Fragment,{children:[a.jsx(Pe,{analytics:D,onLoad:N=>(Ae=>{n!=null&&I.deleteStatus.fetchState!=="Completed"&&Ae.trackBillPayEditBill(n,I.isRecurring)})(N)}),a.jsx(Vi,{initialOpenThreadRequest:H??void 0,location:t,navigate:e,currentTenant:$,billId:n,companyId:q,billDetailsView:I,isMagicLinkEnabled:o,isVendorRecommendationEnabled:m,isLocalCurrencyEnabled:p,uncategorizedAccounts:F,isInternationalPaymentShaVsOurEnabled:i,vendor:I.vendor,isBillPayCommentingEnabled:d,isShaDisabled:b,isOurDisabled:k,isRecurringBillsFeatureEnabled:h,isAccountsEnabled:W,hasZeniAccountsAdminAccess:J,isZeniAccountsUser:X,isBillPayAdmin:O,isSuperAdmin:ee,accountsPromoConfig:B,isDetectInsufficientFundsEnabled:P,sameDayAchDisablementConfig:j,isAiCfoAccessEnabled:M,onAskAiCfoClick:C})]})}const yt=(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},$i=(e,t)=>{let l=`/${e}/bill/`;return l=t===void 0?l.concat("new/review"):l.concat(`${t}/edit/review`),l},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/ach`),n},_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/domestic`),n},R="paymentDetails",Ui=(e,t,l,n,c,r,u)=>{const o={invoiceNumber:t.whatFor.invoiceNumber,memo:t.whatFor.memo,invoiceDate:t.whatFor.invoiceDate?be(t.whatFor.invoiceDate.toString()):Ut(),billDueDate:t.whatFor.billDueDate?be(t.whatFor.billDueDate.toString()):void 0,currencyCode:t.whatFor.currency,recipientCurrencyCode:t.whatFor.recipientCurrency,isInvoiceDateAutoUpdated:t.whatFor.isInvoiceDateAutoUpdated},s={paymentDate:t[R]?.paymentDate?be(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(Qa)&&u?.vendorCurrencyCode===Se.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===Fi.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?be(t[R]?.recurringPaymentDetails?.endDateSelector.date.toString()):void 0,startDate:t[R]?.recurringPaymentDetails?.startDate?be(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},h=Gi(e.accountList.accounts,e.classList.classes,e.lineDetailSection,t.lineItems,n,l),g=Object.keys(h).length>0?qn(h):e.editBillInitialDetails?.recipientTotalAmount;return{showVendorGptRecommendationText:e.showVendorGptRecommendationText,vendor:u,whatForSection:o,paymentDetailsSection:s,isCancelled:e.isCancelled,totalAmount:g,recipientTotalAmount:g,file:e.file,updatesByLineId:h,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=Jn(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??Se.currencyCode,currencySymbol:o.currency?.currencySymbol??Se.currencySymbol},recipientAmount:{amount:o.recipientAmount??0,currencyCode:o.recipientCurrency?.currencyCode??Se.currencyCode,currencySymbol:o.recipientCurrency?.currencySymbol??Se.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},Mi=_.div`
|
|
92
|
+
`,{common:{currency:Se},spendManagement:{billPay:{billDetails:Fi}},appName:Ri}=Je.getLocalizedStrings(),Vi=X(function(e,t){const l=V.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=z(t.location.state?.pathnameStackToGoBack);let u=!0;r.poppedPathname?.includes("bills")===!0&&(u=!1);const o=e.entityAutoCompleteState.autoCompleteText.common,s=Ze(e,"common");let i=`${l?.firstName} ${l?.lastName}`;const d=De(l);t.billId!=null&&t.billDetailsView!=null&&(i=`${t.billDetailsView.createdBy?.firstName??Ri} ${t.billDetailsView.createdBy?.lastName??""}`),d||!t.billDetailsView.createdBy?.email?.includes("zeni.ai")||(i="Zeni");const p=t.billDetailsView.editBillInitialDetails?.totalAmount?.amount,m=Ma(t.billDetailsView.paymentDetailsSection?.paymentType?.method),h=t.currentTenant.createTime,g=Ut(),b=t.sameDayAchDisablementConfig.newTenantTenureLimitMonths,k=h.add(b,"month").isAfter(g),P=!!(t.billDetailsView.billStage==="draft"&&m&&p!=null&&p>0)&&!Gt(p,t.billDetailsView.approvalRules.allApprovalRules,l,t.billDetailsView.vendor?.id,t.billDetailsView.classId),A=Z(e);return{billDetails:t.billDetailsView,isAccountingClassesEnabled:Ct(e),billId:t.billId,createdBy:i,createTime:t.billDetailsView?.createTime,authParams:c,transactionAttachmentEndpoint:`${qe}/transaction_attachment`,analytics:D,showBackButton:u,isAdmin:t.isBillPayAdmin,isSuperAdmin:t.isSuperAdmin,connectedAccountProvider:A.company?.featuresActivationInfo.connectedAccountProvider??"",customerSearchAutoCompleteData:{autoCompleteText:o,entityAutoCompleteView:s},showMarkAsPaidInfo:P,isZeniUser:d,isNewUser:k,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(it(i));const d=yt(s,i,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},chooseNewVendor:i=>{const d=i??t.billDetailsView.addBillAutoFields.tentativeVendorName;d!=null&&e(Ot(d,!1)),e(Nt({localData:{vendorName:i??t.billDetailsView.addBillAutoFields.tentativeVendorName}})),e(it());const p=yt(s,void 0,l),m=E(r.state?.pathnameStackToGoBack,r.pathname);u(p,{state:{pathnameStackToGoBack:m}})},onInvoiceUpload:i=>{i!=null&&e(Ne(i,t.isVendorRecommendationEnabled))},updateShowAutofill:i=>{e(Oe(i))},onSaveChangesToLocalStore:(i,d,p,m,h)=>{const g=Ui(t.billDetailsView,{...i,paymentDetails:{...i?.paymentDetails,paymentDate:h}},p,d,t.isInternationalPaymentShaVsOurEnabled,m,t.vendor);e(Ka({billDetailLocalData:g,billId:l}))},saveBillDetails:()=>{e(Ge("draft",!1,!1,l)),e(oe("common"))},updateBillDetailSaveBillCode:()=>{e(Mt("draft"))},reviewBillDetails:()=>{const i=$i(s,l),d=E(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d,message:"coming_from_edit_page"}})},discardBillDetailsFromLocalStore:({billId:i})=>{e(ke({billId:i}))},clearBillPayReviewLocalState:()=>e(Ja()),onClickDismiss:()=>{const i=ie(s),d=E(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d}})},onClickDiscard:()=>{const i=ie(s),d=E(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=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})}},redirectToACHScreen:i=>{e(fe(!1,i));const d=Li(s,i,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToWireScreen:i=>{e(fe(!1,i));const d=_i(s,i,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToInternationalScreen:i=>{e(fe(!1,i));const d=qt(s,l,i),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToBillsScreen:()=>{const i=ie(s),d=E(r.state?.pathnameStackToGoBack,r.pathname);e(ke({})),u(i,{state:{pathnameStackToGoBack:d}})},redirectToBillDetailPage:()=>{t.navigate("../")},deleteBill:()=>{l!=null&&e(Dt(l))},onAttachmentClick:(i,d)=>{const p=je(s,i,d);window.open(`${p}`,"_blank")},onBackClick:()=>{const i=z(t.location.state?.pathnameStackToGoBack),d=i.poppedPathname??ie(s);u(d,{state:{pathnameStackToGoBack:i.newStack}})},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,d)=>{i.trim().length>=2?e(He({searchString:i,entityType:d,searchOrigin:"common"})):i.trim().length===0&&e(oe("common"))},onCancelAutoComplete:()=>{e(oe("common"))}},addVendorContactEmail(i,d){e(qa(i,d,l))},onWiseVerifyClick:()=>{let i="";i=Kn()?"https://sandbox.transferwise.tech":"https://wise.com";const d=`${i}/login`;window.open(d,"_blank")},onVendorSelected:i=>{e(Wa(!0,i,l))},onSignUpAccountClick:()=>{t.hasZeniAccountsAdminAccess?window.open(`/${s}/checking/promo`,"_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onMoveMoneyClick:()=>{t.isZeniAccountsUser?window.open(`/${s}/checking/transfer`):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onInternationalWireVerifyClick:()=>{window.open(`/${s}/bills/international-wire`)},onFetchLinkTokenClick:(i,d)=>{e(Ha("bill_pay_detail",i,d))},onEstablishConnectionClick:i=>{e(Za(i,n,"bill_pay_detail","bill_pay"))},onUpdatePaymentAccountStatus:(i,d,p)=>{e(za(i,d,"bill_pay","bill_pay_detail",p))},onEstablishConnectionSuccess:()=>{e(Oa("bill_pay","bill_pay_detail")),e(Na({billId:l,withdrawFromAccountId:o.newAddedBillPaymentAccountId,withdrawFromList:o.withdrawFromList}))}}})(Wn);function gt(){const e=K(),t=Q(),l=se(),{billId:n,tenantEmailDomain:c}=ae(),{useFeatureGate:r,useDynamicConfig:u}=le(),{isFeatureEnabled:o,isFeatureGateLoading:s}=r(y.isVendorMagicLinkFeatureEnabled),{isFeatureEnabled:i}=r(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:d}=r(y.isBillPayCommentingEnabled),{isFeatureEnabled:p}=r(y.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:m}=r(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=r(y.isRecurringBillsFeatureEnabled),{isFeatureEnabled:g}=r(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=r(y.isShaDisabled),{isFeatureEnabled:k}=r(y.isOurDisabled),{isFeatureEnabled:P}=r(y.isBillPayDetectInsufficientFundsEnabled),{configValue:A}=u(xe.zeniAccountsConfig),B=_a(A),{configValue:G}=u(xe.sameDayAchDisablementConfig),j=Ua(G),U=V.getSignedInUser(),$=v(N=>Z(N)),I=v(N=>Me(N,m,g,n)),H=Jt($?.companyId,{clearParams:I.fetchState==="Completed"}),{isAiCfoAccessEnabled:M,onAskAiCfoClick:C}=Ye({mobileExploreReferrer:"Bill Details"});We({isDataReady:I.fetchState==="Completed"});const q=$.companyId??V.getSignedInUserTenant(c)?.companyId,W=!!$.companyZeniAccountInfo?.info?.isZeniAccountEnabled,L=Ie(),J=Lt(L?.loggedInUserRoleMap),Y=_t(L?.loggedInUserRoleMap),O=pe(L?.loggedInUserRoleMap),ee=wt($.userRole);if(f.useEffect(()=>{n!=null&&l(At(n))},[n]),U==null)throw Error("Can't access address page without signing in...");const F=v(N=>Ga(N.accountState,N.accountListState,"billPayAccountList")),ce={pathname:"../",search:t.search};return I.isDeleted===!0||I.billStage=="paid"||I.fetchState=="Not-Started"?a.jsx(te,{to:ce}):I.deleteStatus.fetchState==="In-Progress"||s?a.jsx(re,{fetchState:I.deleteStatus.fetchState}):a.jsxs(a.Fragment,{children:[a.jsx(Pe,{analytics:D,onLoad:N=>(Ae=>{n!=null&&I.deleteStatus.fetchState!=="Completed"&&Ae.trackBillPayEditBill(n,I.isRecurring)})(N)}),a.jsx(Vi,{initialOpenThreadRequest:H??void 0,location:t,navigate:e,currentTenant:$,billId:n,companyId:q,billDetailsView:I,isMagicLinkEnabled:o,isVendorRecommendationEnabled:m,isLocalCurrencyEnabled:p,uncategorizedAccounts:F,isInternationalPaymentShaVsOurEnabled:i,vendor:I.vendor,isBillPayCommentingEnabled:d,isShaDisabled:b,isOurDisabled:k,isRecurringBillsFeatureEnabled:h,isAccountsEnabled:W,hasZeniAccountsAdminAccess:J,isZeniAccountsUser:Y,isBillPayAdmin:O,isSuperAdmin:ee,accountsPromoConfig:B,isDetectInsufficientFundsEnabled:P,sameDayAchDisablementConfig:j,isAiCfoAccessEnabled:M,onAskAiCfoClick:C})]})}const yt=(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},$i=(e,t)=>{let l=`/${e}/bill/`;return l=t===void 0?l.concat("new/review"):l.concat(`${t}/edit/review`),l},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/ach`),n},_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/domestic`),n},R="paymentDetails",Ui=(e,t,l,n,c,r,u)=>{const o={invoiceNumber:t.whatFor.invoiceNumber,memo:t.whatFor.memo,invoiceDate:t.whatFor.invoiceDate?be(t.whatFor.invoiceDate.toString()):Ut(),billDueDate:t.whatFor.billDueDate?be(t.whatFor.billDueDate.toString()):void 0,currencyCode:t.whatFor.currency,recipientCurrencyCode:t.whatFor.recipientCurrency,isInvoiceDateAutoUpdated:t.whatFor.isInvoiceDateAutoUpdated},s={paymentDate:t[R]?.paymentDate?be(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(Qa)&&u?.vendorCurrencyCode===Se.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===Fi.recurringBill.paymentTypeOptions[1],m={isActive:e.recurringConfig?.isActive??!1,currentInstance:e.recurringConfig?.currentInstance,isApprovalRequired:t[R]?.recurringPaymentDetails?.requireApproval?.selectedOption==="all",frequency:Xa(t[R]?.recurringPaymentDetails?.frequency?.selectedOption),endDate:t[R]?.recurringPaymentDetails?.endDateSelector?.date!=null?be(t[R]?.recurringPaymentDetails?.endDateSelector.date.toString()):void 0,startDate:t[R]?.recurringPaymentDetails?.startDate?be(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},h=Gi(e.accountList.accounts,e.classList.classes,e.lineDetailSection,t.lineItems,n,l),g=Object.keys(h).length>0?qn(h):e.editBillInitialDetails?.recipientTotalAmount;return{showVendorGptRecommendationText:e.showVendorGptRecommendationText,vendor:u,whatForSection:o,paymentDetailsSection:s,isCancelled:e.isCancelled,totalAmount:g,recipientTotalAmount:g,file:e.file,updatesByLineId:h,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=Jn(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??Se.currencyCode,currencySymbol:o.currency?.currencySymbol??Se.currencySymbol},recipientAmount:{amount:o.recipientAmount??0,currencyCode:o.recipientCurrency?.currencyCode??Se.currencyCode,currencySymbol:o.recipientCurrency?.currencySymbol??Se.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},Mi=_.div`
|
|
93
93
|
display: flex;
|
|
94
94
|
height: 100vh;
|
|
95
95
|
width: 100%;
|
|
@@ -98,7 +98,7 @@ import{j as a}from"./liveblocks-DvKPzrwo.js";import{h as K,u as se,g as Q,i as a
|
|
|
98
98
|
align-items: center;
|
|
99
99
|
background-color: ${e=>e.theme.colors.grey4};
|
|
100
100
|
box-shadow: ${e=>`0px 2px ${x.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
101
|
-
`,Oi=
|
|
101
|
+
`,Oi=X(function(e,t){const{vendorId:l,billId:n}=t,c=ve(e,l),r=Me(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(an(s))},onSaveHandler:()=>{e(tn(t.bankAccountContext,r))},onBankDetailsUpdated:s=>{const{internationalWireSwiftAccountSection:i}=s;e(en({data:i}))},onCancel:()=>{(()=>{const s=z(c.state?.pathnameStackToGoBack),i=s.poppedPathname??St();n(i,{state:{pathnameStackToGoBack:s.newStack}})})(),e(ot())},onAddressClick:s=>{const i=Xe(o,s,l),d=E(c.state?.pathnameStackToGoBack,c.pathname);n(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{e(Ya({fetchState:"Not-Started"}));const s=z(t.location.state?.pathnameStackToGoBack),i=s.poppedPathname??St(0);t.navigate(i,{state:{pathnameStackToGoBack:s.newStack}}),e(ot())}}})(Qn);function Ni(){const e=K(),t=Q(),l=we(),{vendorId:n,billId:c}=ae(),{useFeatureGate:r}=le(),u=me(),o=V.getSignedInUser(),s=v(g=>Z(g)),i=z(t.state?.pathnameStackToGoBack),d=i.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail",p=v(g=>ve(g,n)),{isFeatureEnabled:m}=r(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=r(y.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(re,{fetchState:p.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:u.colors.grey5,boxShadow:`0px 2px ${x.sp1} ${u.colors.dropShadowNormal}`}}):a.jsxs(Mi,{windowSize:l,children:[a.jsx(Qe,{vendorId:n,billId:c}),a.jsx(Oi,{location:t,navigate:e,billId:c,vendorId:n,currentTenant:s,bankAccountContext:d,isVendorRecommendationEnabled:m,isZeniAccountsFeatureEnabled:h})]})}const St=(e=2)=>{let t="../";for(let l=0;l<e;l++)t=`${t}../`;return t},zi=_.div`
|
|
102
102
|
display: flex;
|
|
103
103
|
height: 100vh;
|
|
104
104
|
width: 100%;
|
|
@@ -107,7 +107,7 @@ import{j as a}from"./liveblocks-DvKPzrwo.js";import{h as K,u as se,g as Q,i as a
|
|
|
107
107
|
align-items: center;
|
|
108
108
|
background-color: ${e=>e.theme.colors.grey4};
|
|
109
109
|
box-shadow: ${e=>`0px 2px ${x.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
110
|
-
`,Zi=
|
|
110
|
+
`,Zi=X(function(e,t){const{vendorId:l}=t,n=ve(e,l),c=l!=null?n.editVendorState?.vendorDetailLocalData?.vendorType:n.newVendorState?.vendorDetailLocalData?.vendorType,r=on(e,c||"international_business",t.billId),u=n.editVendorState??n.newVendorState,o=t.billId!=null?e.editBillDetailViewState.editBillStateById[ln(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(un(t.bankAccountContext,r))},onAccountDetailsUpdated:(s,i,d,p)=>{e(cn(s)),p&&e(dn(i,d))},onCurrencyUpdated:(s,i,d)=>{e(rn(s,i,d,!1))},onCancel:()=>{(()=>{const s=z(c.state?.pathnameStackToGoBack),i=s.poppedPathname??ft();n(i,{state:{pathnameStackToGoBack:s.newStack}})})(),e(lt())},onAddressClick:s=>{const i=Xe(o,s,l),d=E(c.state?.pathnameStackToGoBack,c.pathname);n(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{e(sn({fetchState:"Not-Started"}));const s=z(t.location.state?.pathnameStackToGoBack),i=s.poppedPathname??ft(0);t.navigate(i,{state:{pathnameStackToGoBack:s.newStack}}),e(lt())}}})(Xn);function Hi(){const e=K(),t=Q(),l=we(),{vendorId:n,billId:c}=ae(),r=se(),u=me(),o=V.getSignedInUser(),s=v(B=>Z(B)),i=z(t.state?.pathnameStackToGoBack),[d,p]=f.useState(!1),m=v(B=>B.vendorViewState.newVendorState.fetchStatus.fetchState),h=v(B=>n!=null?B.vendorViewState.editVendorStateById[n]?.fetchStatus.fetchState??"Not-Started":"Not-Started"),g=n!==void 0?h:m;f.useEffect(()=>{d===!1&&g==="Not-Started"&&n!=null&&(r(fe(!1,n)),p(!0))},[d,g,n]);const[b,k]=f.useState(!1);f.useEffect(()=>{b||g==="In-Progress"||(k(!0),r(nn(c,n)))},[b,g,r]);const P=i.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail",A=v(B=>ve(B,n));if(o==null)throw Error("Can't access international wire page without signing in...");return P==="billDetail"&&A.editVendorState?.saveStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:A.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:u.colors.grey5,boxShadow:`0px 2px ${x.sp1} ${u.colors.dropShadowNormal}`}}):a.jsxs(zi,{windowSize:l,children:[a.jsx(Qe,{vendorId:n,billId:c}),a.jsx(Zi,{location:t,navigate:e,billId:c,vendorId:n,currentTenant:s,bankAccountContext:P})]})}const ft=(e=2)=>{let t="../";for(let l=0;l<e;l++)t=`${t}../`;return t},kt=_.div`
|
|
111
111
|
display: flex;
|
|
112
112
|
height: 100vh;
|
|
113
113
|
width: 100%;
|
|
@@ -116,4 +116,4 @@ import{j as a}from"./liveblocks-DvKPzrwo.js";import{h as K,u as se,g as Q,i as a
|
|
|
116
116
|
align-items: center;
|
|
117
117
|
background-color: ${e=>e.theme.colors.grey4};
|
|
118
118
|
box-shadow: ${e=>`0px 2px ${x.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
119
|
-
`,Wi=Y(function(e,t){const l=V.getSignedInUser(),n=zt(e,t.billId),c=mn(e),r=De(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:D,isApprovalRequiredForMarkAsPaid:o,isZeniUser:r}},function(e,t){const{location:l,billId:n,currentTenant:c,navigate:r}=t,{tenantEmailDomain:u}=c;return{redirectToBillsScreen:()=>{const o=ie(c.tenantEmailDomain),s=E(l.state?.pathnameStackToGoBack,l.pathname);r(o,{state:{pathnameStackToGoBack:s}})},discardBillDetailsFromLocalStore:()=>{e(ke({}))},saveBillDetails:(o,s)=>{o&&e(Et({billId:n,data:s})),e(Ge(o?"paid":"pending_approval",o,!1,n))},discardOutsideZeniPaymentData:()=>{e(xt({billId:n}))},updateBillDetailSaveBillCode:()=>{e(Mt("pending_approval"))},onClickEdit:()=>{t.navigate("../",{relative:"path"})},onAttachmentClick:(o,s)=>{const i=je(u,o,s);window.open(`${i}`,"_blank")},retryPayment:()=>{t.billId!=null&&e(Ce(t.billId,"retry"))}}})(ei);function vt(){const e=K(),t=se(),l=Q(),{billId:n}=ae(),{useFeatureGate:c}=le(),{isFeatureEnabled:r}=c(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:u}=c(y.isBillPayDetectInsufficientFundsEnabled),o=we(),s=V.getSignedInUser(),{isFeatureEnabled:i}=c(y.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:d}=c(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:p}=c(y.isBillPayCommentingEnabled),m=z(l.state?.pathnameStackToGoBack),{poppedPathname:h}=m,{isFeatureEnabled:g}=c(y.isRecurringBillsFeatureEnabled),b=v(A=>Z(A)),k=v(A=>zt(A,n)),P=k.fetchState??"Not-Started";if(f.useEffect(()=>(window.onbeforeunload=function(){return e(l,{state:{message:""}}),!0},()=>{window.onbeforeunload=null}),[e]),f.useEffect(()=>{l.state?.message!=="coming_from_edit_page"&&e(`../${n}`)},[]),f.useEffect(()=>{const A=k.vendor?.name,B=k.vendor?.id,G=k.totalAmount.amount,j=k.recipientTotalAmount.amount,U=k.invoiceNumber;A&&B&&t(pn(A,B,G,j,U,n))},[]),h==null)return a.jsx(te,{to:`../${n}`});if(s==null)throw Error("Can't access address page without signing in...");return P==="In-Progress"?a.jsx(kt,{windowSize:o,children:a.jsx(Xn,{})}):a.jsx(kt,{windowSize:o,children:a.jsx(Wi,{location:l,navigate:e,currentTenant:b,billId:n,isBillPayCommentingEnabled:p,isLocalCurrencyEnabled:i,isVendorRecommendationEnabled:d,isInternationalPaymentShaVsOurEnabled:r,isRecurringBillsFeatureEnabled:g,isDetectInsufficientFundsEnabled:u})})}const qi=Y(function(e,t){const{vendorId:l}=t,n=e.entityAutoCompleteState.autoCompleteText.common,c=Ze(e,"common"),r=l!=null?"edit":"create",u=Z(e),o=V.getSignedInUser(),s=u.tenantId,i={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:s??""};return{vendorViewDetails:t.vendorViewDetails,screenType:r,filesEndPoint:`${Ht.fileMicroServiceBaseUrl}`,authParams:i,analytics:D,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(Cn(u??void 0,t.billId)),i!=null&&e(xn(i))},saveVendorDetailLocalData:i=>{e(Nt({vendorId:u,localData:i}))},saveContactsInVendorDetailLocalData:i=>{e(Bn({vendorId:u,contacts:i}))},resetVendorDetailLocalData:()=>{e(st(u))},updateSelectedVendorForCreate:i=>{e(An(i))},navigateToBankDetailPage:(i,d)=>{let p;i==="wire"?p=d==="international"?qt(s,t.billId,u):di(s,t.billId,u):p=ci(s,t.billId,u);const m=E(r.state?.pathnameStackToGoBack,r.pathname);c(p,{state:{pathnameStackToGoBack:m}})},onRemoveBankAccount:(i,d)=>{e(d===!0?In(i,"vendor",u):wn(i,"vendor",u))},navigateToMailingAddressPage:i=>{const d=Ye(s,i,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);c(d,{state:{pathnameStackToGoBack:p}})},updateFilesEntity:i=>{e(vn({files:i}))},onEditFileName:(i,d)=>{e(kn(i,d.split(".")[0]))},handleZeniLogoClick:()=>{o.toggle()},updateSaveFetchState:()=>{u==null&&e(st(t.vendorViewDetails.newVendorState?.vendorBasic?.id)),e(fn("Not-Started",u))},onVendorSelected:i=>{i!=null&&e(Sn(i,!0))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,d)=>{i.trim().length>=2?e(He({searchString:i,entityType:d,searchOrigin:"common"})):i.trim().length===0&&e(oe("common"))},onCancelAutoComplete:()=>{e(oe("common"))}},onBackClick:()=>{e(oe("common"));const i=z(t.location.state?.pathnameStackToGoBack),d=i.poppedPathname??ri(n.tenantEmailDomain,t.billId);c(d,{state:{pathnameStackToGoBack:i.newStack}})},onGetOtp:i=>{e(yn(i,"BillPayVendor"))},onResendOtp:i=>{e(gn(i,"BillPayVendor"))},onVerifyOtp:(i,d)=>{e(hn(i,d,"BillPayVendor"))},onVerifyOtpSuccess:(i,d,p)=>{e(bn(i,d,p))},onFetchAndUpdateVendorRecommendations:i=>{e(Ot(i,!1))}}})(ii),Be=()=>{const e=K(),t=se(),l=ti(),n=Q(),{billId:c,vendorId:r}=ae(),u=v(b=>Z(b)),{useFeatureGate:o}=le(),{isFeatureEnabled:s}=o(y.isBillPayLocalCurrencyFeatureEnabled),[i,d]=f.useState(!1),p=v(b=>b.vendorViewState.newVendorState.fetchStatus.fetchState),m=v(b=>ve(b,r)),h=v(b=>r!==void 0?b.vendorViewState.editVendorStateById[r]?.fetchStatus??"Not-Started":"Not-Started"),g=r!==void 0?h:p;return f.useEffect(()=>{i===!1&&g==="Not-Started"&&r!=null&&(t(fe(!1,r)),d(!0))},[i,g,r]),m.fetchState==="Not-Started"||m.fetchState==="In-Progress"?a.jsx(ai,{}):g==="Error"?a.jsx(ni,{onGoHome:()=>e("../",{replace:!0}),onReload:()=>window.location.reload()}):a.jsxs(a.Fragment,{children:[a.jsx(Qe,{vendorId:r,billId:c}),a.jsx(qi,{navigate:e,location:n,themeState:l,currentTenant:u,vendorId:r,billId:c,vendorViewDetails:m,isLocalCurrencyEnabled:s})]})},Ji=Y(function(e,t){const{companyId:l}=t;return{billPaySetupView:En(e,l),analytics:D,meetingUrl:"https://meetings.hubspot.com/snehals/demo-bill-pay?embed=true",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(Dn(l))},onBackClick:()=>{n("../..",{relative:"path"})},onSetupBillPaySuccess:()=>{n("../bills/setup",{relative:"path"})}}})(oi),Ki=()=>{const e=K(),t=Q(),{tenantEmailDomain:l}=ae(),[n,c]=f.useState(!1),r=me(),u=v(h=>Z(h)),o=u.companyId??V.getSignedInUserTenant(l)?.companyId,s=V.getSignedInUser(),i=Ie(),d=!!u.companyBillPayInfo?.info?.isBillPayTOSAccepted,p=pe(i?.loggedInUserRoleMap),m=h=>{c(h)};if(s==null)throw Error("Can't access bill pay promo page without signing in...");return u.companyBillPayInfo?.info?.isBillPayEnabled===!0?a.jsx(te,{to:"../../../bills"}):d===!0&&p===!0?a.jsx(te,{to:"../../bills/setup"}):d===!1||i!=null&&ze(u,i.loggedInUserRoleMap)?a.jsxs(a.Fragment,{children:[a.jsx(Pe,{analytics:D,onLoad:h=>(g=>g.trackPageLoaded(Wt.Event.billPayPromoPage))(h)}),a.jsx(Kt,{isAppContentDrawerOpen:n,handleDrawerToggle:m}),a.jsx(Ji,{companyId:o,navigate:e,location:t,onClickMenuIcon:()=>{m(!0)}})]}):a.jsx(re,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function Do(){const e=v(M=>Z(M)),t=Ie(),l=pe(t?.loggedInUserRoleMap),n=me(),{useFeatureGate:c}=le(),{isFeatureEnabled:r}=c(y.isBillPayLocalCurrencyFeatureEnabled),u=r===!0?Hi:Ni,{isFeatureEnabled:o}=c(y.isDebitCardFeatureEnabled),s=Vt(o,e),i=$t(e),d=Q(),p=e?.userRole!=null&&It(e?.userRole),m=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!p)&&pe(t?.loggedInUserRoleMap),h=Rt(t?.loggedInUserRoleMap),g=(e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!p)&&Pn(t?.loggedInUserRoleMap),{isFeatureEnabled:b}=c(y.isDepositAccountsFeatureEnabled),k=b&&!p&&Lt(t?.loggedInUserRoleMap),{isFeatureEnabled:P}=c(y.isChargeCardFeatureEnabled),A=li(e,P,o)&&!p&&jn(t?.loggedInUserRoleMap),B=Tn(t?.loggedInUserRoleMap),G=_t(t?.loggedInUserRoleMap),j=Fn(t?.loggedInUserRoleMap),U=Rn(t?.loggedInUserRoleMap),$=Vn(t?.loggedInUserRoleMap),I=$n(t?.loggedInUserRoleMap),{tenantEmailDomain:H}=ae();return a.jsxs(ia,{children:[d.pathname.includes("/bills")?a.jsxs(a.Fragment,{children:[a.jsx(S,{path:"setup",element:a.jsx(Te,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:A,isUserHasOnlyCardAccess:B,productType:"bill_pay",type:"setup"})}),a.jsx(S,{path:"verification",element:a.jsx(Te,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:A,isUserHasOnlyCardAccess:B,productType:"bill_pay",type:"verification"})}),a.jsx(S,{path:"promo",element:a.jsx(Ki,{})}),a.jsx(S,{path:"approval-rules/*",element:m?a.jsx(pi,{}):a.jsx(mi,{isUserHasZeniAccountsAccess:G,isUserHasChargeCardAccess:U,isUserHasBillPayAccess:$,isUserHasReimbursementAccess:I,isUserHasTreasuryAccess:j,isTenantBankingOnly:s,tenantEmailDomain:H??""})}),a.jsx(S,{path:"international-wire",element:a.jsx(Te,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:A,isUserHasOnlyCardAccess:B,productType:"bill_pay",type:"international-wire"})}),e.companyBillPayInfo?.info?.isBillPayEnabled===!0&&a.jsx(S,{path:"*",element:a.jsx(Pi,{})}),(s===!0||i===!0)&&a.jsx(S,{path:"/*",element:a.jsx(Qt,{})}),e.companyBillPayInfo?.info?.isBillPayTOSAccepted===!0&&l&&a.jsx(S,{path:"*",element:a.jsx(te,{to:"../setup"})}),t!=null&&ze(e,t.loggedInUserRoleMap)&&a.jsx(S,{path:"*",element:a.jsx(te,{to:"../promo"})})]}):d.pathname.includes("/bill")?a.jsxs(a.Fragment,{children:[a.jsx(S,{path:"new",element:a.jsx(w,{appContent:a.jsx(gt,{})})}),a.jsx(S,{path:":billId",element:a.jsx(w,{appContent:a.jsx(hi,{})})}),a.jsx(S,{path:":billId/edit",element:a.jsx(w,{appContent:a.jsx(gt,{})})}),a.jsx(S,{path:"new/review",element:a.jsx(w,{appContent:a.jsx(vt,{})})}),a.jsx(S,{path:":billId/edit/review",element:a.jsx(w,{appContent:a.jsx(vt,{})})}),a.jsx(S,{path:"/:billId/:addressType",element:a.jsx(w,{appContent:a.jsx(dt,{isSubPage:!0})})}),a.jsx(S,{path:"/new/:addressType",element:a.jsx(w,{appContent:a.jsx(dt,{isSubPage:!0})})}),a.jsx(S,{path:"new/vendor/create",element:a.jsx(w,{appContent:a.jsx(Be,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit",element:a.jsx(w,{appContent:a.jsx(Be,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:"new/vendor/create/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:"new/vendor/create/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:"new/vendor/create/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:":billId/edit/vendor/create",element:a.jsx(w,{appContent:a.jsx(Be,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit",element:a.jsx(w,{appContent:a.jsx(Be,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:"*",element:a.jsx(Ee,{})})]}):a.jsx(S,{path:"*",element:a.jsx(re,{fetchState:"In-Progress",style:{backgroundColor:n.colors.grey5,boxShadow:`0px 2px ${x.sp1} ${n.colors.dropShadowNormal}`}})}),a.jsx(S,{path:"*",element:a.jsx(Ee,{})})]})}export{Do as default};
|
|
119
|
+
`,Wi=X(function(e,t){const l=V.getSignedInUser(),n=zt(e,t.billId),c=mn(e),r=De(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:D,isApprovalRequiredForMarkAsPaid:o,isZeniUser:r}},function(e,t){const{location:l,billId:n,currentTenant:c,navigate:r}=t,{tenantEmailDomain:u}=c;return{redirectToBillsScreen:()=>{const o=ie(c.tenantEmailDomain),s=E(l.state?.pathnameStackToGoBack,l.pathname);r(o,{state:{pathnameStackToGoBack:s}})},discardBillDetailsFromLocalStore:()=>{e(ke({}))},saveBillDetails:(o,s)=>{o&&e(Et({billId:n,data:s})),e(Ge(o?"paid":"pending_approval",o,!1,n))},discardOutsideZeniPaymentData:()=>{e(xt({billId:n}))},updateBillDetailSaveBillCode:()=>{e(Mt("pending_approval"))},onClickEdit:()=>{t.navigate("../",{relative:"path"})},onAttachmentClick:(o,s)=>{const i=je(u,o,s);window.open(`${i}`,"_blank")},retryPayment:()=>{t.billId!=null&&e(Ce(t.billId,"retry"))}}})(ei);function vt(){const e=K(),t=se(),l=Q(),{billId:n}=ae(),{useFeatureGate:c}=le(),{isFeatureEnabled:r}=c(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:u}=c(y.isBillPayDetectInsufficientFundsEnabled),o=we(),s=V.getSignedInUser(),{isFeatureEnabled:i}=c(y.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:d}=c(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:p}=c(y.isBillPayCommentingEnabled),m=z(l.state?.pathnameStackToGoBack),{poppedPathname:h}=m,{isFeatureEnabled:g}=c(y.isRecurringBillsFeatureEnabled),b=v(A=>Z(A)),k=v(A=>zt(A,n)),P=k.fetchState??"Not-Started";if(f.useEffect(()=>(window.onbeforeunload=function(){return e(l,{state:{message:""}}),!0},()=>{window.onbeforeunload=null}),[e]),f.useEffect(()=>{l.state?.message!=="coming_from_edit_page"&&e(`../${n}`)},[]),f.useEffect(()=>{const A=k.vendor?.name,B=k.vendor?.id,G=k.totalAmount.amount,j=k.recipientTotalAmount.amount,U=k.invoiceNumber;A&&B&&t(pn(A,B,G,j,U,n))},[]),h==null)return a.jsx(te,{to:`../${n}`});if(s==null)throw Error("Can't access address page without signing in...");return P==="In-Progress"?a.jsx(kt,{windowSize:o,children:a.jsx(Yn,{})}):a.jsx(kt,{windowSize:o,children:a.jsx(Wi,{location:l,navigate:e,currentTenant:b,billId:n,isBillPayCommentingEnabled:p,isLocalCurrencyEnabled:i,isVendorRecommendationEnabled:d,isInternationalPaymentShaVsOurEnabled:r,isRecurringBillsFeatureEnabled:g,isDetectInsufficientFundsEnabled:u})})}const qi=X(function(e,t){const{vendorId:l}=t,n=e.entityAutoCompleteState.autoCompleteText.common,c=Ze(e,"common"),r=l!=null?"edit":"create",u=Z(e),o=V.getSignedInUser(),s=u.tenantId,i={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:s??""};return{vendorViewDetails:t.vendorViewDetails,screenType:r,filesEndPoint:`${Ht.fileMicroServiceBaseUrl}`,authParams:i,analytics:D,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(Cn(u??void 0,t.billId)),i!=null&&e(xn(i))},saveVendorDetailLocalData:i=>{e(Nt({vendorId:u,localData:i}))},saveContactsInVendorDetailLocalData:i=>{e(Bn({vendorId:u,contacts:i}))},resetVendorDetailLocalData:()=>{e(st(u))},updateSelectedVendorForCreate:i=>{e(An(i))},navigateToBankDetailPage:(i,d)=>{let p;i==="wire"?p=d==="international"?qt(s,t.billId,u):di(s,t.billId,u):p=ci(s,t.billId,u);const m=E(r.state?.pathnameStackToGoBack,r.pathname);c(p,{state:{pathnameStackToGoBack:m}})},onRemoveBankAccount:(i,d)=>{e(d===!0?In(i,"vendor",u):wn(i,"vendor",u))},navigateToMailingAddressPage:i=>{const d=Xe(s,i,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);c(d,{state:{pathnameStackToGoBack:p}})},updateFilesEntity:i=>{e(vn({files:i}))},onEditFileName:(i,d)=>{e(kn(i,d.split(".")[0]))},handleZeniLogoClick:()=>{o.toggle()},updateSaveFetchState:()=>{u==null&&e(st(t.vendorViewDetails.newVendorState?.vendorBasic?.id)),e(fn("Not-Started",u))},onVendorSelected:i=>{i!=null&&e(Sn(i,!0))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,d)=>{i.trim().length>=2?e(He({searchString:i,entityType:d,searchOrigin:"common"})):i.trim().length===0&&e(oe("common"))},onCancelAutoComplete:()=>{e(oe("common"))}},onBackClick:()=>{e(oe("common"));const i=z(t.location.state?.pathnameStackToGoBack),d=i.poppedPathname??ri(n.tenantEmailDomain,t.billId);c(d,{state:{pathnameStackToGoBack:i.newStack}})},onGetOtp:i=>{e(yn(i,"BillPayVendor"))},onResendOtp:i=>{e(gn(i,"BillPayVendor"))},onVerifyOtp:(i,d)=>{e(hn(i,d,"BillPayVendor"))},onVerifyOtpSuccess:(i,d,p)=>{e(bn(i,d,p))},onFetchAndUpdateVendorRecommendations:i=>{e(Ot(i,!1))}}})(ii),Be=()=>{const e=K(),t=se(),l=ti(),n=Q(),{billId:c,vendorId:r}=ae(),u=v(b=>Z(b)),{useFeatureGate:o}=le(),{isFeatureEnabled:s}=o(y.isBillPayLocalCurrencyFeatureEnabled),[i,d]=f.useState(!1),p=v(b=>b.vendorViewState.newVendorState.fetchStatus.fetchState),m=v(b=>ve(b,r)),h=v(b=>r!==void 0?b.vendorViewState.editVendorStateById[r]?.fetchStatus??"Not-Started":"Not-Started"),g=r!==void 0?h:p;return f.useEffect(()=>{i===!1&&g==="Not-Started"&&r!=null&&(t(fe(!1,r)),d(!0))},[i,g,r]),m.fetchState==="Not-Started"||m.fetchState==="In-Progress"?a.jsx(ai,{}):g==="Error"?a.jsx(ni,{onGoHome:()=>e("../",{replace:!0}),onReload:()=>window.location.reload()}):a.jsxs(a.Fragment,{children:[a.jsx(Qe,{vendorId:r,billId:c}),a.jsx(qi,{navigate:e,location:n,themeState:l,currentTenant:u,vendorId:r,billId:c,vendorViewDetails:m,isLocalCurrencyEnabled:s})]})},Ji=X(function(e,t){const{companyId:l}=t;return{billPaySetupView:En(e,l),analytics:D,meetingUrl:"https://meetings.hubspot.com/snehals/demo-bill-pay?embed=true",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(Dn(l))},onBackClick:()=>{n("../..",{relative:"path"})},onSetupBillPaySuccess:()=>{n("../bills/setup",{relative:"path"})}}})(oi),Ki=()=>{const e=K(),t=Q(),{tenantEmailDomain:l}=ae(),[n,c]=f.useState(!1),r=me(),u=v(h=>Z(h)),o=u.companyId??V.getSignedInUserTenant(l)?.companyId,s=V.getSignedInUser(),i=Ie(),d=!!u.companyBillPayInfo?.info?.isBillPayTOSAccepted,p=pe(i?.loggedInUserRoleMap),m=h=>{c(h)};if(s==null)throw Error("Can't access bill pay promo page without signing in...");return u.companyBillPayInfo?.info?.isBillPayEnabled===!0?a.jsx(te,{to:"../../../bills"}):d===!0&&p===!0?a.jsx(te,{to:"../../bills/setup"}):d===!1||i!=null&&ze(u,i.loggedInUserRoleMap)?a.jsxs(a.Fragment,{children:[a.jsx(Pe,{analytics:D,onLoad:h=>(g=>g.trackPageLoaded(Wt.Event.billPayPromoPage))(h)}),a.jsx(Kt,{isAppContentDrawerOpen:n,handleDrawerToggle:m}),a.jsx(Ji,{companyId:o,navigate:e,location:t,onClickMenuIcon:()=>{m(!0)}})]}):a.jsx(re,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function Do(){const e=v(M=>Z(M)),t=Ie(),l=pe(t?.loggedInUserRoleMap),n=me(),{useFeatureGate:c}=le(),{isFeatureEnabled:r}=c(y.isBillPayLocalCurrencyFeatureEnabled),u=r===!0?Hi:Ni,{isFeatureEnabled:o}=c(y.isDebitCardFeatureEnabled),s=Vt(o,e),i=$t(e),d=Q(),p=e?.userRole!=null&&It(e?.userRole),m=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!p)&&pe(t?.loggedInUserRoleMap),h=Rt(t?.loggedInUserRoleMap),g=(e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!p)&&Pn(t?.loggedInUserRoleMap),{isFeatureEnabled:b}=c(y.isDepositAccountsFeatureEnabled),k=b&&!p&&Lt(t?.loggedInUserRoleMap),{isFeatureEnabled:P}=c(y.isChargeCardFeatureEnabled),A=li(e,P,o)&&!p&&jn(t?.loggedInUserRoleMap),B=Tn(t?.loggedInUserRoleMap),G=_t(t?.loggedInUserRoleMap),j=Fn(t?.loggedInUserRoleMap),U=Rn(t?.loggedInUserRoleMap),$=Vn(t?.loggedInUserRoleMap),I=$n(t?.loggedInUserRoleMap),{tenantEmailDomain:H}=ae();return a.jsxs(ia,{children:[d.pathname.includes("/bills")?a.jsxs(a.Fragment,{children:[a.jsx(S,{path:"setup",element:a.jsx(Te,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:A,isUserHasOnlyCardAccess:B,productType:"bill_pay",type:"setup"})}),a.jsx(S,{path:"verification",element:a.jsx(Te,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:A,isUserHasOnlyCardAccess:B,productType:"bill_pay",type:"verification"})}),a.jsx(S,{path:"promo",element:a.jsx(Ki,{})}),a.jsx(S,{path:"approval-rules/*",element:m?a.jsx(pi,{}):a.jsx(mi,{isUserHasZeniAccountsAccess:G,isUserHasChargeCardAccess:U,isUserHasBillPayAccess:$,isUserHasReimbursementAccess:I,isUserHasTreasuryAccess:j,isTenantBankingOnly:s,tenantEmailDomain:H??""})}),a.jsx(S,{path:"international-wire",element:a.jsx(Te,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:A,isUserHasOnlyCardAccess:B,productType:"bill_pay",type:"international-wire"})}),e.companyBillPayInfo?.info?.isBillPayEnabled===!0&&a.jsx(S,{path:"*",element:a.jsx(Pi,{})}),(s===!0||i===!0)&&a.jsx(S,{path:"/*",element:a.jsx(Qt,{})}),e.companyBillPayInfo?.info?.isBillPayTOSAccepted===!0&&l&&a.jsx(S,{path:"*",element:a.jsx(te,{to:"../setup"})}),t!=null&&ze(e,t.loggedInUserRoleMap)&&a.jsx(S,{path:"*",element:a.jsx(te,{to:"../promo"})})]}):d.pathname.includes("/bill")?a.jsxs(a.Fragment,{children:[a.jsx(S,{path:"new",element:a.jsx(w,{appContent:a.jsx(gt,{})})}),a.jsx(S,{path:":billId",element:a.jsx(w,{appContent:a.jsx(hi,{})})}),a.jsx(S,{path:":billId/edit",element:a.jsx(w,{appContent:a.jsx(gt,{})})}),a.jsx(S,{path:"new/review",element:a.jsx(w,{appContent:a.jsx(vt,{})})}),a.jsx(S,{path:":billId/edit/review",element:a.jsx(w,{appContent:a.jsx(vt,{})})}),a.jsx(S,{path:"/:billId/:addressType",element:a.jsx(w,{appContent:a.jsx(dt,{isSubPage:!0})})}),a.jsx(S,{path:"/new/:addressType",element:a.jsx(w,{appContent:a.jsx(dt,{isSubPage:!0})})}),a.jsx(S,{path:"new/vendor/create",element:a.jsx(w,{appContent:a.jsx(Be,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit",element:a.jsx(w,{appContent:a.jsx(Be,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:"new/vendor/create/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:"new/vendor/create/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:"new/vendor/create/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:":billId/edit/vendor/create",element:a.jsx(w,{appContent:a.jsx(Be,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit",element:a.jsx(w,{appContent:a.jsx(Be,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:"*",element:a.jsx(Ee,{})})]}):a.jsx(S,{path:"*",element:a.jsx(re,{fetchState:"In-Progress",style:{backgroundColor:n.colors.grey5,boxShadow:`0px 2px ${x.sp1} ${n.colors.dropShadowNormal}`}})}),a.jsx(S,{path:"*",element:a.jsx(Ee,{})})]})}export{Do as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as k}from"./liveblocks-
|
|
1
|
+
import{j as k}from"./liveblocks-D3ESVZyk.js";import{a as V}from"./sentry-B_92GPgU.js";import{h as ae,g as ne,u as se,i as ie,j as C,N as oe,n as re}from"./core-k_c8SCBE.js";import{j as ce,N as ue,aN as de,z,r as pe,c as E,af as x,e as P,bE as le,at as me,n as B,au as R}from"./index-Cm2LZphQ.js";import{Pr as fe,eW as G,tp as ye,JV as Se,zk as ge,CL as Ie,Fn as he,G0 as be,H0 as Oe,PO as Te,PP as De,PQ as ke,PR as Ce,PS as Ve,Mm as we,OQ as Ne,Mx as Ae,l8 as _e,gg as Fe,gf as ve,ge as xe,ry as Pe,rp as ze,rm as Ee,l0 as Be,ty as Re,tw as M,bE as L,tK as j,cz as Me}from"./zeni-epic-state-C3zBO1No.js";import{n as Le}from"./mui-UJrLjp1k.js";import{d as U}from"./routePaths-d7Ok-gzv.js";import{M as je}from"./MobileAppDrawer-B2Mj3GDG.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new e.Error().stack;d&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[d]="cef3976b-6649-4ff1-adb4-477d594fd78f",e._sentryDebugIdIdentifier="sentry-dbid-cef3976b-6649-4ff1-adb4-477d594fd78f")}catch{}})();const Ue=Le.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,4 +6,4 @@ import{j as k}from"./liveblocks-DvKPzrwo.js";import{a as V}from"./sentry-Be8twC8
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,Ge=re(function(e,d){const{businessVerificationDetails:i}=d,r=G(e),y=z.getSignedInUser(),S=r.tenantId,l={userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:S??""},b=we(d.roleMap)&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",t=Ne(e.companyConfigState),s=Ae(e.userRoleConfigState);return{businessVerificationDetails:i,verficationDetailsFetchState:i.fetchState,isRefreshingViewInBackground:i.isRefreshingViewInBackground,allNationalityCountries:i.allNationalityCountries,filesEndPoint:`${me.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:b,allIndustries:t.companyIndustries??[],companyTitles:s.companyTitles}},function(e,d){const{companyId:i,productType:r,currentTenant:y,navigate:S,location:l}=d,{tenantEmailDomain:b}=y;return{onCompanyDetailsChanged:t=>{const{companyDescription:s,companyIndustry:p,companyIndustryType:T,companyLegalName:D,companyTaxId:g,companyWebsite:m,companyPhone:I,primaryContactEmail:c,primaryContactName:n,primaryContactUserId:u,primaryContactSyncToken:O,syncToken:f,fileIds:a,incDate:o,typeOfIncorporation:w,stateOfIncorporation:N,sourceOfFunds:A,companySubIndustry:_,countriesOfOperations:h,companySourceOfFunds:q,companySourceOfFundsDescription:
|
|
9
|
+
`,Ge=re(function(e,d){const{businessVerificationDetails:i}=d,r=G(e),y=z.getSignedInUser(),S=r.tenantId,l={userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:S??""},b=we(d.roleMap)&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",t=Ne(e.companyConfigState),s=Ae(e.userRoleConfigState);return{businessVerificationDetails:i,verficationDetailsFetchState:i.fetchState,isRefreshingViewInBackground:i.isRefreshingViewInBackground,allNationalityCountries:i.allNationalityCountries,filesEndPoint:`${me.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:b,allIndustries:t.companyIndustries??[],companyTitles:s.companyTitles}},function(e,d){const{companyId:i,productType:r,currentTenant:y,navigate:S,location:l}=d,{tenantEmailDomain:b}=y;return{onCompanyDetailsChanged:t=>{const{companyDescription:s,companyIndustry:p,companyIndustryType:T,companyLegalName:D,companyTaxId:g,companyWebsite:m,companyPhone:I,primaryContactEmail:c,primaryContactName:n,primaryContactUserId:u,primaryContactSyncToken:O,syncToken:f,fileIds:a,incDate:o,typeOfIncorporation:w,stateOfIncorporation:N,sourceOfFunds:A,companySubIndustry:_,countriesOfOperations:h,companySourceOfFunds:q,companySourceOfFundsDescription:Q,transactionVolume:W,transactionVolumeDescription:Z,purposeOfAccount:$,purposeOfAccountDescription:H,regulatedStatus:J,regulatedStatusDescription:K,usNexus:X,usNexusTypes:Y}=t,F=T?.selectedOption,ee={companyId:i,companyDescription:s,companyIndustry:p.selectedOption,companyIndustryType:F==null||F===""?void 0:F,companyLegalName:D,taxIdOrEIN:g,website:m!=""&&m!=null?Me(m):void 0,phone:I,syncToken:f,fileIds:a,incDate:o!=null?L(o?.toString()):o,typeOfIncorporation:w?.selectedOption??"",stateOfIncorporation:N?.selectedOption??"",sourceOfFunds:A?.selectedOption??"",companySubIndustry:_?.selectedOption??"",countriesOfOperations:h?.selectedOptions.map(v=>v.length===2?v:R(v))??[],companySourceOfFunds:q?.selectedOption??"",companySourceOfFundsDescription:Q,transactionVolume:W?.selectedOption??"",transactionVolumeDescription:Z,purposeOfAccount:$?.selectedOption??"",purposeOfAccountDescription:H,regulatedStatus:J??"",regulatedStatusDescription:K,usNexus:X,usNexusTypes:Y?.selectedOptions??[]},te={userId:u,firstName:n.firstName,lastName:n.lastName,email:c,syncToken:O};e(j({companyDetails:ee,primaryContactDetails:te}))},onCompanyOfficerUpdated:t=>{const s=t.map(p=>{const{officerType:T,userId:D,name:g,email:m,nationalityCountryCode:I,ssn:c,dob:n,phone:u,syncToken:O,selectDocument:f,role:a,ownership:o,isSelectedForVerification:w,userVerificationStatus:N,treasuryUserVerificationStatus:A,fileIds:_}=p;let h;return f.selectDocumentType==="driverLicense"?h="driving_license":f.selectDocumentType==="passport"?h="passport":f.selectDocumentType==="stateId"?h="id_document":f.selectDocumentType==="ssnCard"&&(h="social_security_card"),{officerType:T,userId:D,firstName:g.firstName,lastName:g.lastName,email:m,ssn:c,nationalityCountryCode:I?.selectedOption!=null?R(I.selectedOption):void 0,phone:u,birthday:n!=null?L(n?.toString()):n,syncToken:O,titleAtCompany:a.selectedOption,ownershipInCompany:o,documentTypeSelectedForVerification:h,isSelectedForVerification:w,userVerificationStatus:N,treasuryUserVerificationStatus:A,fileIds:_,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(j({officers:s}))},onSaveDetailsClick:t=>{e(M(i,t,r))},onSendForVerificationClick:t=>{e(M(i,t,r,!0))},onAddressClick:t=>{const s=U(b,t),p=B(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onRegisteredAddressClick:t=>{const s=U(b,t),p=B(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onBackClick:()=>{e(Re({companyId:i})),S("../setup")},updateFilesEntity:t=>{e(Be({files:t}))},onDeleteFile:t=>{e(Ee(t))},onDeleteFileList:t=>{e(ze(t))},onEditFileName:(t,s)=>{e(Pe(t,s.split(".")[0]))},onGetOtp:t=>{e(xe(t,"SpendManagementSetup"))},onResendOtp:t=>{e(ve(t,"SpendManagementSetup"))},onVerifyOtp:(t,s)=>{e(Fe(t,s,"SpendManagementSetup"))},saveNewAddressInLocalStore:(t,s)=>{e(_e({addressType:t,addressToCreate:s}))}}})(le),Xe=({productType:e})=>{const d=ae(),i=ne(),r=se(),[y,S]=V.useState(!1),[l,b]=V.useState(!1),{tenantEmailDomain:t}=ie(),s=ce(),{useDynamicConfig:p}=ue(),{configValue:T}=p(de.zeniAccountsConfig),D=fe(T),g=C(a=>{switch(e){case"zeni_accounts":return a.zeniAccountSetupViewState.fetchState;case"reimbursement":return a.remiSetupViewState.fetchState;case"charge_cards":return a.chargeCardSetupViewState.fetchState;case"zeni_treasury":return a.treasurySetupViewState.fetchState;default:return a.billPaySetupViewState.fetchState}}),m=C(a=>a.companyConfigState.fetchState),I=C(a=>a.userRoleConfigState.fetchState),c=C(a=>G(a)),n=c.companyId??z.getSignedInUserTenant(t)?.companyId;if(V.useEffect(()=>{m==="Not-Started"&&r(ye()),I==="Not-Started"&&r(Se(!0))},[m,I,r]),V.useEffect(()=>{if(!y&&g==="Not-Started"&&n!=null)switch(S(!0),e){case"zeni_accounts":r(Oe(n,!0));break;case"zeni_treasury":r(be(n,!0));break;case"reimbursement":r(he(n,!0));break;case"charge_cards":r(Ie(n,!0));break;default:r(ge(n,!0))}},[y,g,n,r]),z.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let u;switch(e){case"zeni_accounts":u=c.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":u=c.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":u=c.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||c.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":u=c.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:u=c.companyBillPayInfo?.info?.isBillPayTOSAccepted}const O=a=>{b(a)},f=C(a=>{let o;switch(e){case"zeni_accounts":o=Ve(a,n);break;case"zeni_treasury":o=Ce(a,n);break;case"charge_cards":o=ke(a,n);break;case"reimbursement":o=De(a,n);break;default:o=Te(a,n)}return o});return u===!1?k.jsx(oe,{to:"../promo"}):k.jsxs(Ue,{children:[k.jsx(pe,{analytics:E,onLoad:a=>(o=>{switch(e){case"zeni_accounts":return o.trackPageLoaded(P.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return o.trackPageLoaded(P.Event.reimbursementBusinessVerification);default:return o.trackPageLoaded(P.Event.billPayBusinessVerification,x(i)?"Settings":void 0)}})(a)}),x(i)?k.jsx(je,{isAppContentDrawerOpen:l,handleDrawerToggle:O}):null,k.jsx(Ge,{businessVerificationDetails:f,navigate:d,location:i,companyId:n,analytics:E,currentTenant:c,productType:e,isSettings:x(i),roleMap:s?.loggedInUserRoleMap??{},onClickMenuIcon:()=>{O(!0)},maxInsuredAmount:D.maxInsuredAmount})]})};export{Xe as B};
|