@zeniai/web-app-ui 5.0.55-qa → 5.0.56-qa
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-Ct22cch9.js +1 -0
- package/dist/assets/AddressScreen-BZLn4WXp.js +9 -0
- package/dist/assets/{AiCfoScreen-twy_oEHo.js → AiCfoScreen-O3ZQKZZv.js} +3 -3
- package/dist/assets/{BillPayApprovalRoutes-2MMsFms-.js → BillPayApprovalRoutes-BR7zuPpx.js} +1 -1
- package/dist/assets/{BillPayRoutes-DabCBXCD.js → BillPayRoutes-BEElHUA2.js} +4 -4
- package/dist/assets/{BusinessVerificationPageScreen-DY36UKxh.js → BusinessVerificationPageScreen-rFNtUgWM.js} +2 -2
- package/dist/assets/{ChargeCardRoutes-BKvKKz6Y.js → ChargeCardRoutes-DmaCLBqf.js} +8 -8
- package/dist/assets/CompanyPassportScreen-CPhtVigG.js +1 -0
- package/dist/assets/{ConnectionAuthScreen-AkiKcrRN.js → ConnectionAuthScreen-HA-Pe0hW.js} +1 -1
- package/dist/assets/CustomerOnboardingAuthScreen-DccrP6Ii.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-reDt__4U.js → CustomerOnboardingRoutes-WWiZNAQF.js} +4 -4
- package/dist/assets/{DashboardRoutes-B6YOY8LT.js → DashboardRoutes-CYUHs4DQ.js} +3 -3
- package/dist/assets/{DefaultTenantHome-CG3A8Zld.js → DefaultTenantHome-DLHNOHLk.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-CHZr0Rwr.js → DomesticWireDetailScreen-_XVPNAtR.js} +3 -3
- package/dist/assets/DrawerScreen-Lpd7yHHT.js +1 -0
- package/dist/assets/{EntityDetailRoutes-BJ_l6xDX.js → EntityDetailRoutes-ekN9KSvw.js} +1 -1
- package/dist/assets/{ExpenseAutomationRoutes-jv6wUEHc.js → ExpenseAutomationRoutes-BWA0VeqR.js} +4 -4
- package/dist/assets/FeaturePreviewScreen-CXPzFCOG.js +1 -0
- package/dist/assets/{MagicLinkRoutes-DHuoixGe.js → MagicLinkRoutes-BM5EBV4g.js} +18 -18
- package/dist/assets/MagicLinkSignInScreen-CUpAMwgA.js +12 -0
- package/dist/assets/{MobileAppDrawer-BCaWgXZQ.js → MobileAppDrawer-4e3Dnoyk.js} +1 -1
- package/dist/assets/NotFoundScreen-D9IauLgD.js +1 -0
- package/dist/assets/{NotificationRoutes-CzsQHWBP.js → NotificationRoutes-Y7mMfA0c.js} +1 -1
- package/dist/assets/{PandLWithForecastRoutes-rl7st3Iq.js → PandLWithForecastRoutes-Oi34FulL.js} +1 -1
- package/dist/assets/{PeopleRoutes-BGm45BRK.js → PeopleRoutes-BvoQnuNu.js} +5 -5
- package/dist/assets/PerformanceRoutes-BF5xhlzy.js +1 -0
- package/dist/assets/{Preview-CPDm5N-k.js → Preview-CktKjgWY.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-DYw5d1DS.js → QBOConnectionScreen-DJquJzTz.js} +1 -1
- package/dist/assets/{ReferralListScreen-B2bhjkxb.js → ReferralListScreen-CdcLyZxu.js} +2 -2
- package/dist/assets/{ReimbursementApprovalRoutes-C_ldCyqW.js → ReimbursementApprovalRoutes-qRkSf3Jp.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BM0wb7RO.js → ReimbursementApprovalRuleDetailScreen-cDRgJHyb.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-C1eoHxke.js → ReimbursementRoutes-CilgOLR3.js} +4 -4
- package/dist/assets/{ReportsRoutes-aH8NyeQL.js → ReportsRoutes-BYbURSgw.js} +1 -1
- package/dist/assets/RewardsRoutes-B01_JIOc.js +1 -0
- package/dist/assets/{ScreenRoutes-Be433Rce.js → ScreenRoutes-DabvobX8.js} +2 -2
- package/dist/assets/{SettingsRoutes-Dkedlq8H.js → SettingsRoutes-OqTPOlbr.js} +4 -4
- package/dist/assets/{SetupPagesScreen-DrXS3IRK.js → SetupPagesScreen-DbbCxfjw.js} +1 -1
- package/dist/assets/{SignInScreen-B584l1AV.js → SignInScreen-jrrIh9b0.js} +1 -1
- package/dist/assets/{SignOutScreen--i7fPI83.js → SignOutScreen-DJFswWiT.js} +1 -1
- package/dist/assets/{TaskListScreen-CbCuzBgx.js → TaskListScreen-Bzrucczg.js} +2 -2
- package/dist/assets/{TaskRoutes-C6JGvbta.js → TaskRoutes-BQtLZoYh.js} +2 -2
- package/dist/assets/TransactionDetailRoutes-oxE-1NtY.js +1 -0
- package/dist/assets/{TransactionDetailScreen-B0sPog3q.js → TransactionDetailScreen-BzK7FXm-.js} +2 -2
- package/dist/assets/{TransactionListRoutes-DbOVYmb-.js → TransactionListRoutes-4Rg7SF_b.js} +1 -1
- package/dist/assets/{TreasuryRoutes-Bw9U7ZrB.js → TreasuryRoutes-C1PdE97m.js} +5 -5
- package/dist/assets/{VendorsRoutes-CYu2rHMN.js → VendorsRoutes-5lt5Cpm-.js} +1 -1
- package/dist/assets/WiseConfirmationScreen-BnyC9-LE.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-C-OLyEIo.js → ZeniAccountRoutes-DG2kQIui.js} +10 -10
- package/dist/assets/ZeniAccountStatementScreen-3oBNuFw5.js +9 -0
- package/dist/assets/{accountMappingHelper-CQSFsM6N.js → accountMappingHelper-BOSY12FJ.js} +1 -1
- package/dist/assets/{analytics-ByrfXPqG.js → analytics-CcGmsyc8.js} +1 -1
- package/dist/assets/{analyticsHelper-xeJXIGDO.js → analyticsHelper-wMrdFRpH.js} +1 -1
- package/dist/assets/{core-DcM32IW_.js → core-DkPdadc6.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-mAxyJdJ8.js → decodeURIComponentSafe-h3wJzOm1.js} +1 -1
- package/dist/assets/{dnd-36WXho_9.js → dnd-D-YvLFfj.js} +1 -1
- package/dist/assets/{empty-GSTAUqhH.js → empty-C7PzWdR6.js} +1 -1
- package/dist/assets/{empty-lHXrwReA.js → empty-ohi5JxHm.js} +1 -1
- package/dist/assets/{emptyVideoElement-Bsa6If51.js → emptyVideoElement-B09QwhYv.js} +1 -1
- package/dist/assets/epic-DC-PDk7m.js +2 -0
- package/dist/assets/getLocaleForTenant-U9nBzLWh.js +1 -0
- package/dist/assets/{index-Bw9qJkeB.js → index-8VSOxL6k.js} +1 -1
- package/dist/assets/{index-BZDuIo7x.js → index-B5LlGXSS.js} +12483 -12422
- package/dist/assets/{index-CR2DVZE0.js → index-BIUa1dNl.js} +2 -2
- package/dist/assets/{index-Dq0r4E9j.js → index-BVoPsTXN.js} +1 -1
- package/dist/assets/{index-p7Us2Fcf.js → index-CxVN3Ojx.js} +1 -1
- package/dist/assets/{index-DTGcnfLC.js → index-DHz0Faq_.js} +1 -1
- package/dist/assets/{index-CjaQ8-D2.js → index-ufE2I9Jb.js} +1 -1
- package/dist/assets/{lexical-CYAYrhLa.js → lexical-Sc7rk4Y7.js} +1 -1
- package/dist/assets/{liveblocks-BeS4QmMp.js → liveblocks-tcXs1fes.js} +1 -1
- package/dist/assets/{lottie-Bdncx-qB.js → lottie-CwApzZxI.js} +1 -1
- package/dist/assets/{mui--qrGbwFJ.js → mui-DbdGpDJj.js} +1 -1
- package/dist/assets/{pathToGoBack-Cn4t6MOa.js → pathToGoBack-D9y2NyzP.js} +1 -1
- package/dist/assets/{pdf-6nmWWkz8.js → pdf-DG2fyOfp.js} +4 -4
- package/dist/assets/{pdf-lib-rQgtUIvp.js → pdf-lib-fmjHY_Su.js} +1 -1
- package/dist/assets/{plaid-BZ0BFqP0.js → plaid-UeHpA8su.js} +1 -1
- package/dist/assets/{pusher-4QLniNXV.js → pusher-CH-5kFcN.js} +1 -1
- package/dist/assets/{react-DKUlDjBa.js → react-BTMxDr8F.js} +1 -1
- package/dist/assets/{react-DCTwOcr5.js → react-CAp_bFar.js} +1 -1
- package/dist/assets/{react-BszWSDWQ.js → react-CFEMacjg.js} +1 -1
- package/dist/assets/{react-BOWjwOm8.js → react-CjW2GUTT.js} +1 -1
- package/dist/assets/{react-C3zOniDH.js → react-D3qpynvt.js} +1 -1
- package/dist/assets/{react-BFaux__7.js → react-P8ikJhK3.js} +1 -1
- package/dist/assets/{recharts-DoWl4vaN.js → recharts-D0a4NFa9.js} +1 -1
- package/dist/assets/{routePaths-DLti7tZb.js → routePaths-DLaKTtZ1.js} +1 -1
- package/dist/assets/{sentry-BlmJH5WH.js → sentry-DNuKG-9f.js} +1 -1
- package/dist/assets/{url-BG92tf7R.js → url-Bxb4Dr7g.js} +1 -1
- package/dist/assets/{url-AJ2wpRsW.js → url-EFuL_PC5.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-CPSMuZiJ.js +1 -0
- package/dist/assets/{useDeviceId-DaD3aMiS.js → useDeviceId-DoEHbao8.js} +1 -1
- package/dist/assets/useFetchSuggestedQuestionsWhenReady-Btx9ztNW.js +1 -0
- package/dist/assets/{useInitialThreadRequest-CV6--y9X.js → useInitialThreadRequest-BgK6IHKx.js} +1 -1
- package/dist/assets/{utils-RmRP6xA4.js → utils-BmJyX3cx.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-BOlkvwMK.js → withTransactionSidePanel-D6IjOlY9.js} +1 -1
- package/dist/assets/{zeni-epic-state-ChnjRetZ.js → zeni-epic-state-CSoWjbAn.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +3 -3
- package/dist/assets/AddressRoutes-DmNqU45X.js +0 -1
- package/dist/assets/AddressScreen-CD02bE7U.js +0 -9
- package/dist/assets/CompanyPassportScreen-Deb1Mskj.js +0 -1
- package/dist/assets/CustomerOnboardingAuthScreen-B7puRRld.js +0 -1
- package/dist/assets/DrawerScreen-C9oSGPfX.js +0 -1
- package/dist/assets/FeaturePreviewScreen-Dvylx-Wk.js +0 -1
- package/dist/assets/MagicLinkSignInScreen-Cy0ox9On.js +0 -12
- package/dist/assets/NotFoundScreen-B8ppov_c.js +0 -1
- package/dist/assets/PerformanceRoutes-5okn2Dl7.js +0 -1
- package/dist/assets/RewardsRoutes-BG1TYOwi.js +0 -1
- package/dist/assets/TransactionDetailRoutes-DWhYtS5p.js +0 -1
- package/dist/assets/WiseConfirmationScreen-CT1Vk2du.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-Dufb_RXJ.js +0 -9
- package/dist/assets/epic-DhZTt5cl.js +0 -2
- package/dist/assets/getLocaleForTenant-Fu8c_Haa.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-CHoGbMpp.js +0 -1
- package/dist/assets/useFetchSuggestedQuestionsWhenReady-DVUj1bst.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./liveblocks-tcXs1fes.js";import{A as d}from"./AddressScreen-BZLn4WXp.js";import i from"./NotFoundScreen-D9IauLgD.js";import"./sentry-DNuKG-9f.js";import{n as s,o as r}from"./core-DkPdadc6.js";import"./zeni-epic-state-CSoWjbAn.js";import"./recharts-D0a4NFa9.js";import"./index-B5LlGXSS.js";import"./mui-DbdGpDJj.js";import"./analytics-CcGmsyc8.js";import"./plaid-UeHpA8su.js";import"./dnd-D-YvLFfj.js";import"./stripe-DMRn4zHo.js";import"./lottie-CwApzZxI.js";import"./lexical-Sc7rk4Y7.js";import"./pdf-DG2fyOfp.js";import"./utils-BmJyX3cx.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]="4bd15e18-5b5f-4be1-8d33-8bd696c76da2",t._sentryDebugIdIdentifier="sentry-dbid-4bd15e18-5b5f-4be1-8d33-8bd696c76da2")}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};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{j as r}from"./liveblocks-tcXs1fes.js";import{a as h}from"./sentry-DNuKG-9f.js";import{j as T,h as _,u as j,l as E,g as B,k as M}from"./core-DkPdadc6.js";import{q as $,h as D,z as L,j as K,B as N,x as R,d as C,f as S,k as z,i as b,m as F}from"./index-B5LlGXSS.js";import{I$ as k,gM as U,eN as q,J0 as G,c0 as J,J1 as O,k6 as V}from"./zeni-epic-state-CSoWjbAn.js";import{n as H}from"./mui-DbdGpDJj.js";import Q from"./NotFoundScreen-D9IauLgD.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]="f6623bad-3ee1-49d5-8fa5-a23c5d18e5f6",e._sentryDebugIdIdentifier="sentry-dbid-f6623bad-3ee1-49d5-8fa5-a23c5d18e5f6")}catch{}})();const W=H.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
height: 100vh;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
+
`,X=M(function(e,t){const{addressId:o,isSubPage:i,addressType:c}=t,l=q(e),a=t.roleMap!=null&&G(t.roleMap),d=i||c==="user_address"||J(l?.userRole??[])||a?void 0:"readonly";if(o==null){const s=O(c,e);return{addressToEdit:s?.addressToCreate,loadingState:s?.status?.fetchState,googleAPIKey:b.googleMapsAPIKey,isDisabled:d,isSubPage:i,dontShowSaveConfirmationPopup:t.dontShowSaveConfirmation}}const n=k(e,o);return{addressToEdit:n.address,loadingState:n.fetchState,googleAPIKey:b.googleMapsAPIKey,isDisabled:d}},function(e,t){const{navigate:o,location:i,addressType:c}=t,l=a=>{if(a==="express-pay")o("../express-pay/add-wire");else{const d=i.state,n=F(d?.pathnameStackToGoBack);let s=n.poppedPathname??I();const u=d?.queryParams;if(u){const f=new URLSearchParams(u).toString();f&&(s=`${s}?${f}`)}o(s,{state:{pathnameStackToGoBack:n.newStack}})}};return{onSubmitHandler:a=>{const d=Y(a);e(V({addressType:c,addressToCreate:d})),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)}}})(z);function re({isSubPage:e,hideAddressSubTitle:t=!1,hideAddressBackButton:o=!1,dontShowSaveConfirmation:i,accountContext:c,addressTypeParam:l}){const a=T(),d=_(),n=j(),{addressId:s,addressType:u}=E(),f=$(),w=D(),x=L.getSignedInUser(),[g,v]=h.useState(s==null),p=B(m=>s!=null?k(m,s).fetchState:"Not-Started"),A=K();if(x==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||(v(!0),d(U(s,!1)))},[g,s,d]),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"?r.jsx(N,{fetchState:p,style:{backgroundColor:w.colors.grey5}}):s!=null&&p==="Error"?(a(`${I(1)}/new`,{replace:!0}),r.jsx(r.Fragment,{})):r.jsxs(r.Fragment,{children:[r.jsx(R,{analytics:C,onLoad:P}),r.jsx(W,{windowSize:f,children:r.jsx(X,{location:n,navigate:a,isSubPage:e===!0,hideAddressBackButton:o,hideAddressSubTitle:t,addressId:s,addressType:y,dontShowSaveConfirmation:i,bankAccountContext:c,roleMap:A?.loggedInUserRoleMap})})]}):r.jsx(Q,{})}const I=(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{re as A,Y as t};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{j as h}from"./liveblocks-
|
|
1
|
+
import{j as h}from"./liveblocks-tcXs1fes.js";import{a as r}from"./sentry-DNuKG-9f.js";import{h as oe,j as ne,u as ie,g as j,l as re,k as le}from"./core-DkPdadc6.js";import{M as ce,cG as ue,z as de,q as me,cH as pe,cI as fe,cJ as he,cK as $,x as Se,d as U,T as q,cL as ge,cM as Ce,f as be,a2 as ke,cN as we,U as Ie,r as Pe,m as G,aY as Ee,cO as Te}from"./index-B5LlGXSS.js";import{fD as ye,f2 as H,eN as _e,hq as xe,Px as Ue,eM as ve,hA as Ae,hw as Oe,ft as Qe,fn as De,fg as Fe,fk as V,fo as Le,fp as Me,fq as Be,fr as Re,fs as Ne}from"./zeni-epic-state-CSoWjbAn.js";import{D as je,n as v,P as qe,S as Ge}from"./mui-DbdGpDJj.js";import{p as Ve}from"./pathToGoBack-D9y2NyzP.js";import"./recharts-D0a4NFa9.js";import"./analytics-CcGmsyc8.js";import"./plaid-UeHpA8su.js";import"./dnd-D-YvLFfj.js";import"./stripe-DMRn4zHo.js";import"./lottie-CwApzZxI.js";import"./lexical-Sc7rk4Y7.js";import"./pdf-DG2fyOfp.js";import"./utils-BmJyX3cx.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new s.Error().stack;i&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[i]="54050c29-a81b-4553-a3db-354f0079a230",s._sentryDebugIdIdentifier="sentry-dbid-54050c29-a81b-4553-a3db-354f0079a230")}catch{}})();const W="chat-response-generated",$e=le(function(s,i){const a=H(s),m=i.isSubmitting;return{showSampleQuestions:i.sessionFromUrl==="explore"&&a.uiState.currentChatSessionId==null,aiCfoView:a,isSubmitting:m,isNewChatSession:i.sessionFromUrl==="new_chat"||i.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${Ie}/tableDownload`,emailLinkQuestion:i.emailLinkQuestion,autoSubmitEmailLinkQuestion:i.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:i.onEmailLinkQuestionProcessed,isFileUploadEnabled:i.isFileUploadEnabled,isUploadPromoVisible:i.isUploadPromoVisible,onUploadPromoClose:i.onUploadPromoClose}},function(s,i){const{location:a,currentTenant:m,userId:d,navigate:p,currentChatSessionId:f,allSessionsWithOrderedQuestionAnswers:S,setIsAiCfoOpen:l}=i;return{onEventReceived:(e,o)=>{if(e===W&&typeof o.text=="string"&&typeof o.metadata=="object"){const n=o,c=Me(n.type),t=n.metadata.chat_session_id??null,{currentChatSession:I,currentQuestionAnswer:g,currentQuestionAnswerSummary:P}=$(S,t);c!=="answer"?U.trackAICFOChatResponseGenerated(c,g?.question.questionText??"",n.text,t,Te(P,I),n.metadata.message_id??null):U.trackAICFOChatAnswerGenerated(n.text,g?.question.questionText??"",(n.follow_up_questions?.length??0)>0,!!n.assumptions,!!n.insights,n.visualization!=null,Be(n.visualization?.type??"")??null,t,n.summarized_title,n.metadata.message_id??null),s(Re({chatSessionId:n.metadata.chat_session_id,responseType:c,fetchState:{fetchState:"Completed",error:void 0}})),s(Ne({chatSessionId:n.metadata.chat_session_id,answerPayload:n,userId:d}))}},onSubmit:(e,o,n,c)=>{e&&Ee(s,e,o,f,S,d,c,n)},updateCurrentInput:e=>{s(V(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{s(Le(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{p(-1)},onCloseClick:()=>{const e=G(a.state?.pathnameStackToGoBack),o=e.poppedPathname??Ve(1);p(o,{state:{...a.state,pathnameStackToGoBack:e.newStack}}),s(V(""))},togglePageView:()=>{const e=G(a.state?.pathnameStackToGoBack),o=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;p(o,{state:{...a.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),l(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{p(-1)},onNewChatClick:()=>{f!=null&&s(Fe());const e=Pe(a.state?.pathnameStackToGoBack,a.pathname);p(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,o)=>{s(De({questionAnswerId:e,isCollapsed:o}))},onMenuClick:i.onMenuClick}})(ke(we)),dt=({isFileUploadEnabled:s})=>{const{setIsAiCfoOpen:i}=ce(),a=oe(),m=ne(),d=ie(),[p,f]=r.useState(!1);r.useEffect(()=>{a(ye())},[a]);const{customPageTitle:S}=ue(),l=j(u=>H(u)),e=de.getSignedInUser(),{session_id:o}=re(),n=me(),c=j(u=>_e(u)),t=l.uiState.currentChatSessionId,I=c.tenantEmailDomain,{handleUploadPromoClose:g,isUploadPromoVisible:P}=pe({isFileUploadEnabled:s,tenantEmailDomain:I}),A=fe({currentTenant:c,currentChatSessionId:t,aiCfoView:l}),C=d.state,b=C?.aiCfoInitialQuestion,O=!!C?.aiCfoShouldSubmit,[z,E]=r.useState(null),[Y,T]=r.useState(!1),Q=r.useRef(!1);r.useEffect(()=>{Q.current||b==null||b===""||(E(b),T(O),Q.current=!0)},[b,O]);const J=r.useCallback(()=>{E(null),T(!1)},[]),D=r.useMemo(()=>new URLSearchParams(d.search),[d.search]),F=D.get("ref")??C?.aiCfoRef,y=D.get("emailRefId")??C?.aiCfoEmailRefId,L=r.useRef(!1);r.useEffect(()=>{L.current||F!=="month-end-email"||y==null||t!=null||e==null||(a(xe("controller",e.userId,y,"MONTH_END_EMAIL")),L.current=!0)},[F,y,t,a,e]);const k=l.uiState.lastContextMessage;r.useEffect(()=>{k!=null&&k!==""&&t!=null&&(E(k),T(!0),a(Ue()))},[k,t,a]);const K=c.masterTOSInfo,w=K?.isMasterTOSAccepted??!1,{visitedSessions:M}=he(t),_=l.fetchState,x=l.uiState.chatSessionsNextPageToken.hasMore||!l.uiState.chatSessionsFirstPageFetched,B=t!=null?l.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",R=t==null||(l.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),N=l.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:Z}=$(N,t),X=Z.length===0;r.useEffect(()=>{w||m("../dashboard",{state:{...d.state,message:"open_ai_cfo_drawer"}})},[w]),r.useEffect(()=>{t!=null&&o!==t&&m(`../ai-cfo/${t}`,{state:{...d.state}})},[t,o]),r.useEffect(()=>{o!=null&&t==null&&o!=="new_chat"&&o!=="explore"&&a(ve({sessionId:o,agentId:"controller"}))},[]);const ee=r.useMemo(()=>({events:M.map(u=>`private-chat-${u}.${W}`),eventCallback:(u,se,ae)=>ae.onEventReceived(u,se)}),[M]);if(r.useEffect(()=>{_!=="In-Progress"&&x&&a(Ae())},[_,x,a]),r.useEffect(()=>{t!=null&&B!=="In-Progress"&&R&&e!=null&&_==="Completed"&&!x&&a(Oe(t,e.userId))},[B,R,t,e,a]),e==null||o==null)throw Error("Can't access AI Controller page without signing in...");const te=t!=null&&l.responseStateByChatSessionId?.[t]?.answer?.fetchState==="In-Progress";return h.jsxs(We,{children:[h.jsx(Se,{analytics:U,onLoad:u=>u.trackPageLoaded(be.Event.aiCFOPage)}),q(n)&&A.drawerElement,h.jsx($e,{...ee,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:N,openOnboardingPage:()=>f(!0),userId:e.userId,setIsAiCfoOpen:i,navigate:m,sessionFromUrl:o,location:d,isSubmitting:te,isEmptyChatWithSession:X,customPageTitle:S,currentTenant:c,emailLinkQuestion:z??void 0,autoSubmitEmailLinkQuestion:Y,onEmailLinkQuestionProcessed:J,onMenuClick:q(n)?A.open:void 0,isFileUploadEnabled:s,isUploadPromoVisible:P,onUploadPromoClose:g}),h.jsx(je,{anchor:"right",open:p,transitionDuration:250,PaperProps:{component:ze,style:{width:`${ge}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>f(!1),children:h.jsx(He,{onClick:u=>u.stopPropagation(),children:h.jsx(Ce,{isTOSAccepted:w,acceptMasterTOSState:l.masterTOSAcceptanceState,customPageTitle:S,onCloseClick:()=>f(!1),onCompleteClick:()=>{w||c.userRoleId==null||a(Qe(c.userRoleId)),f(!1)}})})})]})},He=v(Ge)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|
|
5
|
-
`,We=
|
|
5
|
+
`,We=v.div`
|
|
6
6
|
height: 100vh;
|
|
7
7
|
width: 100%;
|
|
8
|
-
`,ze=
|
|
8
|
+
`,ze=v(qe)`
|
|
9
9
|
box-shadow: ${({theme:s})=>s.colors.elevation2};
|
|
10
10
|
color: ${({theme:s})=>s.colors.grey4};
|
|
11
11
|
`;export{dt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as l}from"./liveblocks-
|
|
1
|
+
import{j as l}from"./liveblocks-tcXs1fes.js";import{a as f}from"./sentry-DNuKG-9f.js";import{j as B,u as U,h as j,g as v,N as $,k as T,l as N,n as O,o as h}from"./core-DkPdadc6.js";import{eN as L,Mi as A,L_ as b,x8 as w,x2 as F,x6 as x,wX as z,M0 as M,w_ as W,xa as q,x9 as C}from"./zeni-epic-state-CSoWjbAn.js";import{h as P,z as k,B as _,a2 as X,by as G,ab as V,bz as H}from"./index-B5LlGXSS.js";import"./mui-DbdGpDJj.js";import{i as J}from"./ReimbursementApprovalRuleDetailScreen-cDRgJHyb.js";import K from"./NotFoundScreen-D9IauLgD.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="c113ef80-a8f3-492a-b8c6-9c83162f369b",e._sentryDebugIdIdentifier="sentry-dbid-c113ef80-a8f3-492a-b8c6-9c83162f369b")}catch{}})();const I="bill-approval-rule-update",Q=T(function(e){return{approvalView:A(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:t,location:p}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(I)&&e(M(!1))},onBackClick:()=>{V(p)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(z(a))},onEditRuleClick:a=>{a!=null?(e(x(a)),t(`./${a}/edit`)):(e(x()),t("./new"))}}})(X(G)),Y=()=>{const e=B(),o=U(),t=j(),[p,a]=f.useState(!1),[u,s]=f.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>L(i)),r=v(i=>A(i)),g=v(i=>b(i).billPaySetupApproverViewUpdateData);if(f.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(w())},[g]),f.useEffect(()=>{p||n!=="Not-Started"||(a(!0),t(F(!0)))},[p,n,t]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");f.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),t(x())),e("./new"))},[u,r,t]);const y={events:c.companyId!=null?[`private-${c.companyId}.${I}`]:[],eventCallback:(i,R,m)=>{i.endsWith(I)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx($,{to:"../../promo"}):c.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||r.fetchState!=="Completed"&&r.fetchState!=="Error"?l.jsx(_,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):l.jsx(Q,{currentTenant:c,location:o,navigate:e,...y})},Z=T(function(e,o){const t=b(e),p=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=p==="approval_create"&&t.allApprovalRules.length!==0;let u=t.allApprovalRules.length===0;return o.approvalRuleId&&(u=t.allApprovalRules.findIndex(s=>s.approvalRuleId===o.approvalRuleId)===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:u,approvalUpdateActionType:p}},function(e,o){const{navigate:t,approvalUpdateDataView:p,approverViewData:a,approvalRuleId:u}=o,s=p.billPaySetupApproverViewUpdateData?.type,d=V(o.location);return{onApprovalRuleDataUpdated:n=>{const c=r=>{const g=[];return r.forEach(y=>{const i=y.actors.selectedUsers.map(S=>({type:"user",userId:S.userId,isImplicitActor:!1})),R=y.actors.selectedNonUsers.map(S=>{const E=!!J(S.value);return{type:E?"attribute":"role",subType:S.value,userId:void 0,idType:void 0,isImplicitActor:!E}}),m=i.concat(R);g.push({action:y.stepType.selectedOption,actors:m,operator:m.length>1?y.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),g};if(s==="approval_create"){const r={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}},onResetClick:()=>{e(w()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(w()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(q())},onSaveRuleSuccess:()=>{t("../")}}})(H);function D(){const e=B(),o=j(),t=U(),{approvalRuleId:p}=N(),a=k.getSignedInUser(),u=P(),s=v(r=>b(r)),d=v(r=>A(r)),[n,c]=f.useState(!1);if(f.useEffect(()=>{n||(c(!0),o(W(!0)))}),f.useEffect(()=>{d.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[d,p]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?l.jsx(_,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:u.colors.grey5}}):l.jsx(Z,{navigate:e,approvalUpdateDataView:s,approvalRuleId:p,approverViewData:d,location:t})}function se(){return l.jsxs(O,{children:[l.jsx(h,{path:"/",element:l.jsx(Y,{})}),l.jsx(h,{path:"/new",element:l.jsx(D,{})}),l.jsx(h,{path:"/:approvalRuleId/edit",element:l.jsx(D,{})}),l.jsx(h,{path:"*",element:l.jsx(K,{})})]})}export{se as B};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-BeS4QmMp.js";import{j as K,h as re,u as Q,l as te,g as I,N as ee,k as X,i as la,n as sa,o as S}from"./core-DcM32IW_.js";import{eN as Z,LA as Ge,bv as At,GD as ra,bo as xt,bD as pe,LB as Bt,ws as Et,xC as Me,w$ as ca,bn as je,LC as da,LD as ua,c0 as pa,LE as ma,jq as Dt,LF as jt,LG as Tt,yb as Oe,wH as Be,LH as ba,wg as it,LI as ha,Bn as ga,wk as ya,wq as Pt,LJ as ke,LK as Ne,xD as ze,LL as Sa,LM as fa,xG as Ze,LN as ka,xT as Ia,LO as Ft,xn as ot,xs as va,LP as wa,LQ as ue,LR as Rt,LS as Lt,LT as Vt,fH as Ca,wM as Ue,cv as $t,LU as Aa,gC as xa,LV as Ba,LW as Ea,eT as Mt,eR as Ut,LX as He,LY as Da,LZ as ja,Jj as We,L_ as Ta,Jk as ie,Jl as qe,L$ as Pa,M0 as Fa,M1 as Ra,xu as lt,xr as La,M2 as Va,M3 as $a,M4 as Ma,xd as Ua,M5 as _a,M6 as Ga,M7 as Oa,cj as _t,cL as Gt,jB as Na,bJ as za,bq as Ot,bK as Nt,vy as Za,M8 as Ha,Ba as Wa,Bg as qa,s5 as Ja,xE as Ka,yi as Qa,jO as fe,M9 as Xa,Ma as zt,kg as Ya,jI as Zt,k1 as Ht,k0 as st,bC as be,bI as en,Mb as tn,Mc as Ie,ik as an,Md as rt,Me as nn,ip as on,iK as ln,yw as sn,Mf as rn,k9 as cn,ym as dn,Mg as ct,yq as un,yv as pn,ys as mn,yk as bn,Mh as Wt,wB as hn,Mi as gn,Mj as yn,fz as Sn,fy as fn,fx as kn,jR as In,k7 as dt,ki as vn,pE as wn,j_ as Cn,yo as An,iv as xn,kn as Bn,Mk as En,im as Dn,pv as jn,Ml as Tn,xj as Pn,bE as Fn,bs as Rn,Ik as Ln,cN as Vn,cM as $n,cu as Mn,cA as Un}from"./zeni-epic-state-ChnjRetZ.js";import{h as me,z as L,k as ve,M as Je,a as oe,p as y,aJ as Ee,B as ce,o as E,C as Te,d as j,b5 as _n,r as z,R as Ke,v as D,q as we,b6 as ut,b7 as pt,b8 as Gn,ag as On,H as Nn,aD as zn,F as qt,D as Qe,J as Xe,b9 as Zn,ap as Jt,ba as Hn,N as Wn,f as Kt,a2 as qn,bb as Jn,bc as Kn,bd as Qn,be as Xn,bf as Yn,bg as ei,bh as ti,bi as ai,bj as ni,y as ii,bk as oi,b1 as li,bl as si,bm as ri,a5 as ci}from"./index-BZDuIo7x.js";import{n as V,S as di}from"./mui--qrGbwFJ.js";import{A as mt}from"./AddressScreen-CD02bE7U.js";import{g as ne,a as Pe,i as Qt,V as Ye,b as et,c as ui,v as pi,d as mi,A as he,D as ge}from"./DomesticWireDetailScreen-CHZr0Rwr.js";import{a as f}from"./sentry-BlmJH5WH.js";import{u as tt}from"./useAskAiCfoHostNavButtonProps-CHoGbMpp.js";import{c as at}from"./useFetchSuggestedQuestionsWhenReady-DVUj1bst.js";import{u as Xt}from"./useInitialThreadRequest-CV6--y9X.js";import De from"./NotFoundScreen-B8ppov_c.js";import{D as bi}from"./DrawerScreen-C9oSGPfX.js";import{M as Yt}from"./MobileAppDrawer-BCaWgXZQ.js";import{F as ea}from"./FeaturePreviewScreen-Dvylx-Wk.js";import{S as Re}from"./SetupPagesScreen-DrXS3IRK.js";import{B as hi}from"./BillPayApprovalRoutes-2MMsFms-.js";import{FallBackRoute as gi}from"./ScreenRoutes-Be433Rce.js";import"./recharts-DoWl4vaN.js";import"./analytics-ByrfXPqG.js";import"./plaid-BZ0BFqP0.js";import"./dnd-36WXho_9.js";import"./stripe-DMRn4zHo.js";import"./lottie-Bdncx-qB.js";import"./lexical-CYAYrhLa.js";import"./pdf-6nmWWkz8.js";import"./utils-RmRP6xA4.js";import"./analyticsHelper-xeJXIGDO.js";import"./routePaths-DLti7tZb.js";import"./BusinessVerificationPageScreen-DY36UKxh.js";import"./ReimbursementApprovalRuleDetailScreen-BM0wb7RO.js";import"./getLocaleForTenant-Fu8c_Haa.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]="682c7223-7274-433f-9605-4749629f4ddb",e._sentryDebugIdIdentifier="sentry-dbid-682c7223-7274-433f-9605-4749629f4ddb")}catch{}})();const yi=X(function(e,t){const l=Ge(e,t.billId),n=L.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=je(n);i||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:m,isMarkAsPaidBtnVisible:b}=da(l.billActivities,ua(t.currentTenant),n);d=m,p=b}const h=pa(t.currentTenant?.userRole??[]),g=l.transactionDetails!=null&&ma(l.transactionDetails,h,n);return{billDetails:l,isAccountingClassesEnabled:Dt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${Ke}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:h,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:j,showMarkAsPaidButtonToCreator:g,isZeniUser:i}},function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:u}=n;return{redirectToBillsScreen:()=>{const o=ne(u),s=D(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(ke({}))},deleteBill:o=>{j.trackBillPayDeleteBill(l,o),e(Pt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?j.trackBillPayCancelAndDeleteBill(l,o):j.trackBillPayCancelBill(l),e(ya(l,s))},onSaveRealTimeApprovals:o=>{e(ga(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(ha({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(it(l,o.type,"")):e(it(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Be(l,"retry")):e(Be(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Pe(u,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ne(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ba({billId:t.billId}))},onRefundPaymentClick:()=>{e(Be(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Tt({data:i,billId:l})),e(Oe(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(jt({billId:l}))}}})(_n);function Si(){const e=K(),t=re(),l=Q(),{billId:n}=te(),c=me(),r=L.getSignedInUser(),u=ve(),o=I(w=>Z(w)),s=I(w=>Ge(w,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Xt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoOpen:p,setIsAiCfoOpen:h}=Je(),{isAiCfoAccessEnabled:g,onAskAiCfoClick:m}=tt({isAiCfoOpen:p,setIsAiCfoOpen:h,mobileExploreReferrer:"Bill Details"});at({isDataReady:s.fetchState==="Completed"});const b=o?.userRole!=null&&At(o?.userRole),A=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b,[T,k]=f.useState(!1),[v,H]=f.useState(!1),[U,_]=f.useState(!1),{useFeatureGate:F,useDynamicConfig:x}=oe(),{isFeatureEnabled:$}=F(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:M}=F(y.isBillPayCommentingEnabled),{isFeatureEnabled:B}=F(y.isBillPayDetectInsufficientFundsEnabled),{configValue:O}=x(Ee.zeniAssistConfig),W=ra(o),q=xt(o.userRole),J=A&&pe(u?.loggedInUserRoleMap),G=O.user_ids!=null&&r?.userId!=null&&O.user_ids.includes(r?.userId),{isFeatureEnabled:le}=F(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Y}=F(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&W===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||J||s.allApprovers.find(w=>w.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,J,o.isZeni,W,r]),f.useEffect(()=>{n!=null&&t(Bt(n))},[n]),f.useEffect(()=>{T||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(Et(n??"",$,G,!1)))},[T,s,n,t]),f.useEffect(()=>{v||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(H(!0),t(Me(!1,$,G,Y,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(ca()))},[v,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(ee,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(ce,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${E.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Te,{analytics:j,onLoad:w=>(se=>{n!=null&&se.trackBillPayBillDetails(n,s.isRecurring)})(w)}),a.jsx(yi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:M,isRealTimeApprovalEnabled:U,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:le,hasZeniAssistAccess:G,isDetectInsufficientFundsEnabled:B,isAiCfoAccessEnabled:g,onAskAiCfoClick:m})]})}const ye=Qe.getLocalizedStrings().spendManagement.billPay.billDetails,fi={containerWidth:new qt(100,58)},bt=X(function(e,t){const l=L.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Jt.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:j,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:E.sp10,paddingRight:E.sp3,paddingBottom:"15px",paddingLeft:E.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=L.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(Ze(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(Ia({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{j?.trackBillPaySkipAutofill(),e(ze(n))},onDeleteClick:()=>{e(ka({billId:t.billId})),j?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(zn);function C({appContent:e}){const t=re(),l=K(),{billId:n}=te(),c=Q(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),i=L.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=oe(),{isFeatureEnabled:h}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:m}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:A}=p(Ee.zeniAssistConfig),T=A.user_ids!=null&&i?.userId!=null&&A.user_ids.includes(i?.userId),k=I(w=>Z(w)),[v,H]=f.useState(!1),[U,_]=f.useState(!1),[F,x]=f.useState(!1),[$,M]=f.useState(),B=I(w=>Ne(w,h,m,n));let O=B.fetchState,W=B.file,q=B.showAutofill;const J=I(w=>Ge(w,n??""));u===!1&&(O=J.fetchState,W=J.transactionDetails?.attachments?.[0],q=!1);const G=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;f.useEffect(()=>{n==null&&t(ze(!0))},[n,t]),f.useEffect(()=>{O==="Not-Started"&&(u&&U?_(!1):!u&&v&&H(!1))},[n]),f.useEffect(()=>{v||n==null||u||(H(!0),t(Et(n,g,T,!1)),U||(_(!0),t(Me(!1,g,T,b,n)))),u&&!U&&(_(!0),t(Me(!1,g,T,b,n)))},[v,U,u,n,t]);const le={onOkClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","yes"),t(fa({replaceBillData:!0,billId:n})),t(Ze($,h,n))},onCancelClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","no"),t(Sa({file:$,billId:n}))}},Y=f.useCallback(()=>{const w=z(c.state?.pathnameStackToGoBack),se=w.poppedPathname??ne(k.tenantEmailDomain);t(ke({billId:n})),l(se,{state:{pathnameStackToGoBack:w.newStack}})},[c.state,k.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(O==="Error"||J.fetchState==="Error")return a.jsx(De,{});if(O!="Completed")return n==null&&o!=="small"?a.jsx(ut,{fallback:Y,children:a.jsxs(Le,{windowSize:o,children:[a.jsx(gt,{}),a.jsx(Ve,{}),a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:!0,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:void 0,setShowConfirmationPopup:x,setPayload:M,showActionButtons:!1,isInitialEdit:!!B.isInitialEdit,billStage:G}),a.jsx($e,{windowSize:o,children:a.jsx(pt,{isNewBill:!0})})]})}):a.jsxs(Le,{windowSize:o,children:[o==="small"||q?null:a.jsx(ht,{children:a.jsx(ta,{onClick:Y,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(Gn,{}),a.jsx($e,{windowSize:o,children:a.jsx(pt,{isNewBill:n==null})})]});{const w=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(ut,{fallback:Y,children:a.jsxs(Le,{windowSize:o,children:[q&&o!=="small"?a.jsx(gt,{}):null,F?a.jsx(On,{titleComponent:a.jsx(xi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(Bi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:le,isEditPopup:!0}):null,o==="small"||q?null:a.jsx(ht,{children:a.jsx(ki,{})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:q,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:Ii(u,J,B),setShowConfirmationPopup:x,setPayload:M,showActionButtons:vi(u,B),isInitialEdit:!!B.isInitialEdit,billStage:w}),a.jsx($e,{windowSize:o,children:e})]})})}}function ki(){const{triggerBack:e}=Zn();return a.jsx(ta,{onClick:e,"data-testid":"nav-bar-back-click"})}function Ii(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(wi,{children:[a.jsx(Ci,{children:`${ye.recurringBill.recurringCycle}
|
|
1
|
+
import{j as a}from"./liveblocks-tcXs1fes.js";import{j as K,h as re,u as Q,l as te,g as I,N as ee,k as X,i as la,n as sa,o as S}from"./core-DkPdadc6.js";import{eN as Z,LA as Ge,bv as At,GD as ra,bo as xt,bD as pe,LB as Bt,ws as Et,xC as Ue,w$ as ca,bn as je,LC as da,LD as ua,c0 as pa,LE as ma,jq as Dt,LF as jt,LG as Tt,yb as Oe,wH as Be,LH as ba,wg as it,LI as ha,Bn as ga,wk as ya,wq as Pt,LJ as ke,LK as Ne,xD as ze,LL as Sa,LM as fa,xG as Ze,LN as ka,xT as Ia,LO as Ft,xn as ot,xs as va,LP as wa,LQ as ue,LR as Rt,LS as Lt,LT as Vt,fH as Ca,wM as Me,cv as $t,LU as Aa,gC as xa,LV as Ba,LW as Ea,eT as Ut,eR as Mt,LX as He,LY as Da,LZ as ja,Jj as We,L_ as Ta,Jk as ie,Jl as qe,L$ as Pa,M0 as Fa,M1 as Ra,xu as lt,xr as La,M2 as Va,M3 as $a,M4 as Ua,xd as Ma,M5 as _a,M6 as Ga,M7 as Oa,cj as _t,cL as Gt,jB as Na,bJ as za,bq as Ot,bK as Nt,vy as Za,M8 as Ha,Ba as Wa,Bg as qa,s5 as Ja,xE as Ka,yi as Qa,jO as fe,M9 as Xa,Ma as zt,kg as Ya,jI as Zt,k1 as Ht,k0 as st,bC as be,bI as en,Mb as tn,Mc as Ie,ik as an,Md as rt,Me as nn,ip as on,iK as ln,yw as sn,Mf as rn,k9 as cn,ym as dn,Mg as ct,yq as un,yv as pn,ys as mn,yk as bn,Mh as Wt,wB as hn,Mi as gn,Mj as yn,fz as Sn,fy as fn,fx as kn,jR as In,k7 as dt,ki as vn,pE as wn,j_ as Cn,yo as An,iv as xn,kn as Bn,Mk as En,im as Dn,pv as jn,Ml as Tn,xj as Pn,bE as Fn,bs as Rn,Ik as Ln,cN as Vn,cM as $n,cu as Un,cA as Mn}from"./zeni-epic-state-CSoWjbAn.js";import{h as me,z as L,j as ve,M as Je,a as oe,p as y,aJ as Ee,B as ce,o as E,x as Te,d as j,b5 as _n,m as z,U as Ke,r as D,q as we,b6 as ut,b7 as pt,b8 as Gn,ag as On,G as Nn,aD as zn,E as qt,D as Qe,J as Xe,b9 as Zn,ap as Jt,ba as Hn,Q as Wn,f as Kt,a2 as qn,bb as Jn,bc as Kn,bd as Qn,be as Xn,bf as Yn,bg as ei,bh as ti,bi as ai,bj as ni,$ as ii,bk as oi,b1 as li,bl as si,bm as ri,a5 as ci}from"./index-B5LlGXSS.js";import{n as V,S as di}from"./mui-DbdGpDJj.js";import{A as mt}from"./AddressScreen-BZLn4WXp.js";import{g as ne,a as Pe,i as Qt,V as Ye,b as et,c as ui,v as pi,d as mi,A as he,D as ge}from"./DomesticWireDetailScreen-_XVPNAtR.js";import{a as f}from"./sentry-DNuKG-9f.js";import{u as tt}from"./useAskAiCfoHostNavButtonProps-CPSMuZiJ.js";import{c as at}from"./useFetchSuggestedQuestionsWhenReady-Btx9ztNW.js";import{u as Xt}from"./useInitialThreadRequest-BgK6IHKx.js";import De from"./NotFoundScreen-D9IauLgD.js";import{D as bi}from"./DrawerScreen-Lpd7yHHT.js";import{M as Yt}from"./MobileAppDrawer-4e3Dnoyk.js";import{F as ea}from"./FeaturePreviewScreen-CXPzFCOG.js";import{S as Re}from"./SetupPagesScreen-DbbCxfjw.js";import{B as hi}from"./BillPayApprovalRoutes-BR7zuPpx.js";import{FallBackRoute as gi}from"./ScreenRoutes-DabvobX8.js";import"./recharts-D0a4NFa9.js";import"./analytics-CcGmsyc8.js";import"./plaid-UeHpA8su.js";import"./dnd-D-YvLFfj.js";import"./stripe-DMRn4zHo.js";import"./lottie-CwApzZxI.js";import"./lexical-Sc7rk4Y7.js";import"./pdf-DG2fyOfp.js";import"./utils-BmJyX3cx.js";import"./analyticsHelper-wMrdFRpH.js";import"./routePaths-DLaKTtZ1.js";import"./BusinessVerificationPageScreen-rFNtUgWM.js";import"./ReimbursementApprovalRuleDetailScreen-cDRgJHyb.js";import"./getLocaleForTenant-U9nBzLWh.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]="abc33ebc-32b0-44f9-be75-501c07890bb7",e._sentryDebugIdIdentifier="sentry-dbid-abc33ebc-32b0-44f9-be75-501c07890bb7")}catch{}})();const yi=X(function(e,t){const l=Ge(e,t.billId),n=L.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=je(n);i||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:m,isMarkAsPaidBtnVisible:b}=da(l.billActivities,ua(t.currentTenant),n);d=m,p=b}const h=pa(t.currentTenant?.userRole??[]),g=l.transactionDetails!=null&&ma(l.transactionDetails,h,n);return{billDetails:l,isAccountingClassesEnabled:Dt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${Ke}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:h,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:j,showMarkAsPaidButtonToCreator:g,isZeniUser:i}},function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:u}=n;return{redirectToBillsScreen:()=>{const o=ne(u),s=D(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(ke({}))},deleteBill:o=>{j.trackBillPayDeleteBill(l,o),e(Pt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?j.trackBillPayCancelAndDeleteBill(l,o):j.trackBillPayCancelBill(l),e(ya(l,s))},onSaveRealTimeApprovals:o=>{e(ga(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(ha({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(it(l,o.type,"")):e(it(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Be(l,"retry")):e(Be(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Pe(u,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ne(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ba({billId:t.billId}))},onRefundPaymentClick:()=>{e(Be(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Tt({data:i,billId:l})),e(Oe(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(jt({billId:l}))}}})(_n);function Si(){const e=K(),t=re(),l=Q(),{billId:n}=te(),c=me(),r=L.getSignedInUser(),u=ve(),o=I(w=>Z(w)),s=I(w=>Ge(w,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Xt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoOpen:p,setIsAiCfoOpen:h}=Je(),{isAiCfoAccessEnabled:g,onAskAiCfoClick:m}=tt({isAiCfoOpen:p,setIsAiCfoOpen:h,mobileExploreReferrer:"Bill Details"});at({isDataReady:s.fetchState==="Completed"});const b=o?.userRole!=null&&At(o?.userRole),A=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b,[T,k]=f.useState(!1),[v,H]=f.useState(!1),[M,_]=f.useState(!1),{useFeatureGate:F,useDynamicConfig:x}=oe(),{isFeatureEnabled:$}=F(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:U}=F(y.isBillPayCommentingEnabled),{isFeatureEnabled:B}=F(y.isBillPayDetectInsufficientFundsEnabled),{configValue:O}=x(Ee.zeniAssistConfig),W=ra(o),q=xt(o.userRole),J=A&&pe(u?.loggedInUserRoleMap),G=O.user_ids!=null&&r?.userId!=null&&O.user_ids.includes(r?.userId),{isFeatureEnabled:le}=F(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Y}=F(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&W===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||J||s.allApprovers.find(w=>w.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,J,o.isZeni,W,r]),f.useEffect(()=>{n!=null&&t(Bt(n))},[n]),f.useEffect(()=>{T||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(Et(n??"",$,G,!1)))},[T,s,n,t]),f.useEffect(()=>{v||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(H(!0),t(Ue(!1,$,G,Y,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(ca()))},[v,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(ee,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(ce,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${E.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Te,{analytics:j,onLoad:w=>(se=>{n!=null&&se.trackBillPayBillDetails(n,s.isRecurring)})(w)}),a.jsx(yi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:U,isRealTimeApprovalEnabled:M,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:le,hasZeniAssistAccess:G,isDetectInsufficientFundsEnabled:B,isAiCfoAccessEnabled:g,onAskAiCfoClick:m})]})}const ye=Qe.getLocalizedStrings().spendManagement.billPay.billDetails,fi={containerWidth:new qt(100,58)},bt=X(function(e,t){const l=L.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Jt.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:j,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:E.sp10,paddingRight:E.sp3,paddingBottom:"15px",paddingLeft:E.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=L.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(Ze(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(Ia({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{j?.trackBillPaySkipAutofill(),e(ze(n))},onDeleteClick:()=>{e(ka({billId:t.billId})),j?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(zn);function C({appContent:e}){const t=re(),l=K(),{billId:n}=te(),c=Q(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),i=L.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=oe(),{isFeatureEnabled:h}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:m}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:A}=p(Ee.zeniAssistConfig),T=A.user_ids!=null&&i?.userId!=null&&A.user_ids.includes(i?.userId),k=I(w=>Z(w)),[v,H]=f.useState(!1),[M,_]=f.useState(!1),[F,x]=f.useState(!1),[$,U]=f.useState(),B=I(w=>Ne(w,h,m,n));let O=B.fetchState,W=B.file,q=B.showAutofill;const J=I(w=>Ge(w,n??""));u===!1&&(O=J.fetchState,W=J.transactionDetails?.attachments?.[0],q=!1);const G=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;f.useEffect(()=>{n==null&&t(ze(!0))},[n,t]),f.useEffect(()=>{O==="Not-Started"&&(u&&M?_(!1):!u&&v&&H(!1))},[n]),f.useEffect(()=>{v||n==null||u||(H(!0),t(Et(n,g,T,!1)),M||(_(!0),t(Ue(!1,g,T,b,n)))),u&&!M&&(_(!0),t(Ue(!1,g,T,b,n)))},[v,M,u,n,t]);const le={onOkClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","yes"),t(fa({replaceBillData:!0,billId:n})),t(Ze($,h,n))},onCancelClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","no"),t(Sa({file:$,billId:n}))}},Y=f.useCallback(()=>{const w=z(c.state?.pathnameStackToGoBack),se=w.poppedPathname??ne(k.tenantEmailDomain);t(ke({billId:n})),l(se,{state:{pathnameStackToGoBack:w.newStack}})},[c.state,k.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(O==="Error"||J.fetchState==="Error")return a.jsx(De,{});if(O!="Completed")return n==null&&o!=="small"?a.jsx(ut,{fallback:Y,children:a.jsxs(Le,{windowSize:o,children:[a.jsx(gt,{}),a.jsx(Ve,{}),a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:!0,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:void 0,setShowConfirmationPopup:x,setPayload:U,showActionButtons:!1,isInitialEdit:!!B.isInitialEdit,billStage:G}),a.jsx($e,{windowSize:o,children:a.jsx(pt,{isNewBill:!0})})]})}):a.jsxs(Le,{windowSize:o,children:[o==="small"||q?null:a.jsx(ht,{children:a.jsx(ta,{onClick:Y,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(Gn,{}),a.jsx($e,{windowSize:o,children:a.jsx(pt,{isNewBill:n==null})})]});{const w=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(ut,{fallback:Y,children:a.jsxs(Le,{windowSize:o,children:[q&&o!=="small"?a.jsx(gt,{}):null,F?a.jsx(On,{titleComponent:a.jsx(xi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(Bi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:le,isEditPopup:!0}):null,o==="small"||q?null:a.jsx(ht,{children:a.jsx(ki,{})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:q,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:Ii(u,J,B),setShowConfirmationPopup:x,setPayload:U,showActionButtons:vi(u,B),isInitialEdit:!!B.isInitialEdit,billStage:w}),a.jsx($e,{windowSize:o,children:e})]})})}}function ki(){const{triggerBack:e}=Zn();return a.jsx(ta,{onClick:e,"data-testid":"nav-bar-back-click"})}function Ii(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(wi,{children:[a.jsx(Ci,{children:`${ye.recurringBill.recurringCycle}
|
|
2
2
|
${n}/${c}`}),a.jsx(Ai,{})]}):void 0}function vi(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 ht=V.div`
|
|
3
3
|
margin-bottom: 20px;
|
|
4
4
|
margin-top: 20px;
|
|
@@ -85,11 +85,11 @@ import{j as a}from"./liveblocks-BeS4QmMp.js";import{j as K,h as re,u as Q,l as t
|
|
|
85
85
|
flex-direction: column;
|
|
86
86
|
align-items: center;
|
|
87
87
|
background-color: ${e=>e.theme.colors.grey4};
|
|
88
|
-
`,Pi=X(function(e,t){const l=L.getSignedInUser(),n=je(l),c=Vt(e,ae,t.isBulkActionEnabled,l?.userId);let r=c.allSubTabs;t.isUserHasOnlyBillpayAccess&&t.roleMap&&c.currentTab==="pending_approval"&&(t.roleMap.bill_pay_analyst?r=r.filter(b=>b==="all"||b==="overdue"||b==="rejected"||b==="deleted"):t.roleMap.bill_pay_approver&&(r=r.filter(b=>b==="all"||b==="awaiting_my_approval"||b==="overdue"||b==="rejected"||b==="deleted"))),t.isShowDeletedBillsEnabled===!1&&(r=r.filter(b=>b!=="deleted"));const u=e.entityAutoCompleteState.autoCompleteText.common,o=We(e,"common"),s=e.tenantState.currentTenantId,i=Z(e),d=i?.companyName??"",p={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},h=e.billListState.downloadUIState.downloadState,g=c.fetchState,m=Ta(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:g,analytics:j,botEmail:c.billPayBotEmail,searchText:c.searchText,filters:c.filters,vendorSearchAutoCompleteData:{autoCompleteText:u,entityAutoCompleteView:o},downloadParams:{authParams:p,companyName:d,timePeriod:ae,spendManagementEndPoint:`${Ke}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:h,isBulkActionAllowed:c.billListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:c.billListBulkActionInfo?.billsSelectedForBulkAction,allowedBulkActions:c.billListBulkActionInfo?.allowedBulkActions,isZeniUser:n,billPayApprovalRulesAffectedEntityIds:m.affectedEntityIds}},function(e,t){const{navigate:l,currentTenant:n,location:c,period:r}=t,{tenantEmailDomain:u}=n;return{updateTabToState:o=>{e(ue()),e(Rt(o))},onSubtabChange:o=>{e(ue()),e(Lt(o))},onTransactionClick:(o,s)=>{const i=Pe(u,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);l(i,{state:{pathnameStackToGoBack:d}})},onClickSetupIcon:()=>{const o=Ri(u),s=D(c.state?.pathnameStackToGoBack,c.pathname);l(o,{state:{pathnameStackToGoBack:s}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;j?.trackBillPayNewBill();const s=`/${o}/bill/new`,i=D(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(s,{state:{pathnameStackToGoBack:i}})},onSearchTextChanged:o=>{e(_a(o))},onReloadTransactions:()=>{e(
|
|
88
|
+
`,Pi=X(function(e,t){const l=L.getSignedInUser(),n=je(l),c=Vt(e,ae,t.isBulkActionEnabled,l?.userId);let r=c.allSubTabs;t.isUserHasOnlyBillpayAccess&&t.roleMap&&c.currentTab==="pending_approval"&&(t.roleMap.bill_pay_analyst?r=r.filter(b=>b==="all"||b==="overdue"||b==="rejected"||b==="deleted"):t.roleMap.bill_pay_approver&&(r=r.filter(b=>b==="all"||b==="awaiting_my_approval"||b==="overdue"||b==="rejected"||b==="deleted"))),t.isShowDeletedBillsEnabled===!1&&(r=r.filter(b=>b!=="deleted"));const u=e.entityAutoCompleteState.autoCompleteText.common,o=We(e,"common"),s=e.tenantState.currentTenantId,i=Z(e),d=i?.companyName??"",p={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},h=e.billListState.downloadUIState.downloadState,g=c.fetchState,m=Ta(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:g,analytics:j,botEmail:c.billPayBotEmail,searchText:c.searchText,filters:c.filters,vendorSearchAutoCompleteData:{autoCompleteText:u,entityAutoCompleteView:o},downloadParams:{authParams:p,companyName:d,timePeriod:ae,spendManagementEndPoint:`${Ke}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:h,isBulkActionAllowed:c.billListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:c.billListBulkActionInfo?.billsSelectedForBulkAction,allowedBulkActions:c.billListBulkActionInfo?.allowedBulkActions,isZeniUser:n,billPayApprovalRulesAffectedEntityIds:m.affectedEntityIds}},function(e,t){const{navigate:l,currentTenant:n,location:c,period:r}=t,{tenantEmailDomain:u}=n;return{updateTabToState:o=>{e(ue()),e(Rt(o))},onSubtabChange:o=>{e(ue()),e(Lt(o))},onTransactionClick:(o,s)=>{const i=Pe(u,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);l(i,{state:{pathnameStackToGoBack:d}})},onClickSetupIcon:()=>{const o=Ri(u),s=D(c.state?.pathnameStackToGoBack,c.pathname);l(o,{state:{pathnameStackToGoBack:s}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;j?.trackBillPayNewBill();const s=`/${o}/bill/new`,i=D(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(s,{state:{pathnameStackToGoBack:i}})},onSearchTextChanged:o=>{e(_a(o))},onReloadTransactions:()=>{e(Me(r,!0,t.isShowDeletedBillsEnabled,t.isInternationalWireEnabled)),e(Ma(n.companyId,!0))},onNavigateToSettings:()=>{l("../bills/setup")},onBackClick:()=>{l("../",{relative:"path"})},onFiltersChange:o=>{e(Ua({filters:o})),o.categories.every(s=>s.field!=null&&s.values?.length!==0)&&j.trackSpendManagmentFilterChange("bill_pay",o.categories.map(s=>`${s.field}-${JSON.stringify(s.values)}`))},updateDownloadStateHandler:o=>{o==="In-Progress"&&j.trackSpendManagementDownloadClick("bill_pay"),e($a({uiState:{downloadState:o}}))},updateBulkActionList:o=>{e(Va(o))},removeAllTransactionsFromBulkActionList:()=>{e(ue())},onProceedForBulkActionClick:(o,s)=>{switch(o){case"delete":case"cancel":e(La(o,s??""));break;case"send_for_approval":e(lt("send_for_approval")),t.navigate("./bulk-review");break;case"approve":e(lt("approve")),t.navigate("./bulk-review");break;case"review":e(Ra()),t.navigate("./bulk-review")}},onBillPayApprovalRulesEventReceived:o=>{o.endsWith(_e)&&e(Fa(!1))},onEventReceived:o=>{o===aa&&e(Pa())},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:o=>{o.trim().length>=2?e(qe({searchString:o,entityType:"vendor",searchOrigin:"common"})):o.trim().length===0&&e(ie("common"))},onCancelAutoComplete:()=>{e(ie("common"))}}}})(qn(Jn));function Fi(){const{isAiCfoOpen:e,setIsAiCfoOpen:t}=Je(),l=K(),n=re(),c=Q(),r=we(),u=c.state,o=ve(),[s,i]=f.useState(!1),[d,p]=f.useState(null),h=la("/:tenantEmailDomain/bills/bulk-review")!=null;f.useEffect(()=>(u?.tab!=null&&u?.subTab!=null&&(n(Rt(u?.tab)),n(Lt(u?.subTab))),()=>{n(ue())}),[]);const g=L.getSignedInUser(),m=I(P=>Z(P)),{areTenantIdsInSync:b}=Wn(),[A,T]=f.useState(!1),{useFeatureGate:k}=oe(),{isFeatureEnabled:v}=k(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:H}=k(y.isBillPayCommentingEnabled),{isFeatureEnabled:M}=k(y.isReimbursementCommentingEnabled),{isFeatureEnabled:_}=k(y.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:F}=k(y.isBillPayBulkActionEnabled),{isFeatureEnabled:x}=k(y.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:$}=k(y.isBillPayDetectInsufficientFundsEnabled),U=I(P=>Vt(P,ae,F,g?.userId)),{isFeatureEnabled:B}=k(y.isDebitCardFeatureEnabled),O=U.fetchState,{isAiCfoAccessEnabled:W,onAskAiCfoClick:q}=tt({isAiCfoOpen:e,setIsAiCfoOpen:t,mobileExploreReferrer:"Bills List"});at({isDataReady:O==="Completed"});const J=!!m.companyBillPayInfo?.info?.isBillPayTOSAccepted,G=!!m.companyBillPayInfo?.info?.isBillPayEnabled,le=I(P=>Ca(P.companyState,m.companyId)),Y=le?.company.featuresActivationInfo.connectedAccountProvider;if(f.useEffect(()=>{!A&&G&&b&&(T(!0),n(Me(ae,!0,v,x)))},[A,ae,b,n]),g==null)throw Error("Can't access address page without signing in...");const w=(P,de)=>{n(Da({uiState:{sortKey:P,sortOrder:de},period:ae}))},se=$t(o?.loggedInUserRoleMap),Fe=pe(o?.loggedInUserRoleMap),Ce=P=>{i(P)},{billsProcessed:N,billsProcessing:Ae}=I(P=>Aa(P));f.useEffect(()=>{N===Ae&&d!=null&&(n(xa({messageSection:"bill_pay_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_bill_",variableValue:N>1?St.bills:St.bill},{variableName:"_has_",variableValue:N>1?yt.texts.have:yt.texts.has},{variableName:"_action_",variableValue:Ba(d)}]})),n(Ea()),setTimeout(()=>{n(Me(ae,!0,v,!0,x))},3e3),p(null))},[N,Ae]);const na={events:m.companyId!=null?[`private-${m.companyId}.${aa}`,`private-${m.companyId}.${_e}`]:[],eventCallback:(P,de,nt)=>{P.endsWith(_e)?nt.onBillPayApprovalRulesEventReceived?.(P):de?.entity_type==="bill"&&(p(de.operation_type),nt.onEventReceived(P))}},ia=Ut(B,m),oa=Mt(m);return c.pathname.endsWith("/bills/")||c.pathname.endsWith("/bills")||c.pathname.endsWith("/bills/bulk-review")?ia===!0||oa===!0?a.jsx(ea,{}):G?a.jsxs(a.Fragment,{children:[O==="Completed"?a.jsx(Te,{analytics:j,onLoad:P=>(de=>de.trackPageLoaded(Kt.Event.billPayHome))(P)}):null,a.jsxs(Ti,{windowSize:r,children:[a.jsx(Yt,{isAppContentDrawerOpen:s,handleDrawerToggle:Ce}),a.jsx(bi,{isOpen:h,drawerLeftMargin:new qt(0,0,300,600),onClose:()=>{l("./"),n(ue())},children:a.jsx(Li,{onClick:P=>P.stopPropagation(),children:a.jsx(Di,{})})}),a.jsx(Pi,{location:c,navigate:l,currentTenant:m,entity:"bill_pay",isBillPayCommentingEnabled:H,isReimbursementCommentingEnabled:M,period:ae,isAdmin:!1,uiState:U.uiState,onColumnSortConfigChanged:w,isUserHasOnlyBillpayAccess:se,isShowDeletedBillsEnabled:v,isShowDeletedReimbursementEnabled:_,isBulkActionEnabled:F,roleMap:o?.loggedInUserRoleMap,onClickMenuIcon:()=>{Ce(!0)},isDownloadEnabled:U.isDownloadEnabled,connectedAccountProvider:Y,bulkSubmissionLimit:U.billBulkSubmissionLimit,bulkSubmissionFetchState:U.billListBulkActionInfo.bulkSubmissionFetchState,isRecurringBillInBulkActionList:U.billListBulkActionInfo.isRecurringBillInBulkActionList,isInternationalWireEnabled:x,isDetectInsufficientFundsEnabled:$,isAiCfoAccessEnabled:W,onAskAiCfoClick:q,...na})]})]}):J===!0&&Fe===!0?a.jsx(ee,{to:"../setup"}):o!=null&&He(m,o.loggedInUserRoleMap)?a.jsx(ee,{to:"../promo"}):a.jsx(ce,{fetchState:O}):a.jsx(De,{})}const Ri=e=>`/${e}/bills/setup`,Li=V(di)`
|
|
89
89
|
display: flex;
|
|
90
90
|
min-height: 100%;
|
|
91
91
|
flex-direction: column;
|
|
92
|
-
`,{common:{currency:Se},spendManagement:{billPay:{billDetails:Vi}},appName:$i}=Qe.getLocalizedStrings(),Mi=X(function(e,t){const l=L.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=We(e,"common");let i=`${l?.firstName} ${l?.lastName}`;const d=je(l);t.billId!=null&&t.billDetailsView!=null&&(i=`${t.billDetailsView.createdBy?.firstName??$i} ${t.billDetailsView.createdBy?.lastName??""}`),d||!t.billDetailsView.createdBy?.email?.includes("zeni.ai")||(i="Zeni");const p=t.billDetailsView.editBillInitialDetails?.totalAmount?.amount,h=za(t.billDetailsView.paymentDetailsSection?.paymentType?.method),g=t.currentTenant.createTime,m=Ot(),b=t.sameDayAchDisablementConfig.newTenantTenureLimitMonths,A=g.add(b,"month").isAfter(m),T=!!(t.billDetailsView.billStage==="draft"&&h&&p!=null&&p>0)&&!Nt(p,t.billDetailsView.approvalRules.allApprovalRules,l),k=Z(e);return{billDetails:t.billDetailsView,isAccountingClassesEnabled:Dt(e),billId:t.billId,createdBy:i,createTime:t.billDetailsView?.createTime,authParams:c,transactionAttachmentEndpoint:`${Ke}/transaction_attachment`,analytics:j,showBackButton:u,isAdmin:t.isBillPayAdmin,isSuperAdmin:t.isSuperAdmin,connectedAccountProvider:k.company?.featuresActivationInfo.connectedAccountProvider??"",customerSearchAutoCompleteData:{autoCompleteText:o,entityAutoCompleteView:s},showMarkAsPaidInfo:T,isZeniUser:d,isNewUser:A,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(st(i));const d=kt(s,i,l),p=D(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},chooseNewVendor:i=>{const d=i??t.billDetailsView.addBillAutoFields.tentativeVendorName;d!=null&&e(Zt(d,!1)),e(Ht({localData:{vendorName:i??t.billDetailsView.addBillAutoFields.tentativeVendorName}})),e(st());const p=kt(s,void 0,l),h=D(r.state?.pathnameStackToGoBack,r.pathname);u(p,{state:{pathnameStackToGoBack:h}})},onInvoiceUpload:i=>{i!=null&&e(Ze(i,t.isVendorRecommendationEnabled))},updateShowAutofill:i=>{e(ze(i))},onSaveChangesToLocalStore:(i,d,p,h,g)=>{const m=Oi(t.billDetailsView,{...i,paymentDetails:{...i?.paymentDetails,paymentDate:g}},p,d,t.isInternationalPaymentShaVsOurEnabled,h,t.vendor);e(Ya({billDetailLocalData:m,billId:l}))},saveBillDetails:()=>{e(Oe("draft",!1,!1,l)),e(ie("common"))},updateBillDetailSaveBillCode:()=>{e(zt("draft"))},reviewBillDetails:()=>{const i=Ui(s,l),d=D(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d,message:"coming_from_edit_page"}})},discardBillDetailsFromLocalStore:({billId:i})=>{e(ke({billId:i}))},clearBillPayReviewLocalState:()=>e(Xa()),onClickDismiss:()=>{const i=ne(s),d=D(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d}})},onClickDiscard:()=>{const i=ne(s),d=D(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d}})},setBillDetailPageMode:i=>{if(i==="edit_bill"){let d=window.location.pathname;d=d.concat("/edit");const p=D(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})}},redirectToACHScreen:i=>{e(fe(!1,i));const d=_i(s,i,l),p=D(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToWireScreen:i=>{e(fe(!1,i));const d=Gi(s,i,l),p=D(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToInternationalScreen:i=>{e(fe(!1,i));const d=Qt(s,l,i),p=D(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToBillsScreen:()=>{const i=ne(s),d=D(r.state?.pathnameStackToGoBack,r.pathname);e(ke({})),u(i,{state:{pathnameStackToGoBack:d}})},redirectToBillDetailPage:()=>{t.navigate("../")},deleteBill:()=>{l!=null&&e(Pt(l))},onAttachmentClick:(i,d)=>{const p=Pe(s,i,d);window.open(`${p}`,"_blank")},onBackClick:()=>{const i=z(t.location.state?.pathnameStackToGoBack),d=i.poppedPathname??ne(s);u(d,{state:{pathnameStackToGoBack:i.newStack}})},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,d)=>{i.trim().length>=2?e(qe({searchString:i,entityType:d,searchOrigin:"common"})):i.trim().length===0&&e(ie("common"))},onCancelAutoComplete:()=>{e(ie("common"))}},addVendorContactEmail(i,d){e(Qa(i,d,l))},onWiseVerifyClick:()=>{let i="";i=Yn()?"https://sandbox.transferwise.tech":"https://wise.com";const d=`${i}/login`;window.open(d,"_blank")},onVendorSelected:i=>{e(Ka(!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(Ja("bill_pay_detail",i,d))},onEstablishConnectionClick:i=>{e(qa(i,n,"bill_pay_detail","bill_pay"))},onUpdatePaymentAccountStatus:(i,d,p)=>{e(Wa(i,d,"bill_pay","bill_pay_detail",p))},onEstablishConnectionSuccess:()=>{e(Za("bill_pay","bill_pay_detail")),e(Ha({billId:l,withdrawFromAccountId:o.newAddedBillPaymentAccountId,withdrawFromList:o.withdrawFromList}))}}})(Kn);function ft(){const e=K(),t=Q(),l=re(),{billId:n,tenantEmailDomain:c}=te(),{useFeatureGate:r,useDynamicConfig:u}=oe(),{isFeatureEnabled:o,isFeatureGateLoading:s}=r(y.isVendorMagicLinkFeatureEnabled),{isFeatureEnabled:i}=r(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:d}=r(y.isBillPayCommentingEnabled),{isFeatureEnabled:p}=r(y.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:h}=r(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=r(y.isRecurringBillsFeatureEnabled),{isFeatureEnabled:m}=r(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=r(y.isShaDisabled),{isFeatureEnabled:A}=r(y.isOurDisabled),{isFeatureEnabled:T}=r(y.isBillPayDetectInsufficientFundsEnabled),{configValue:k}=u(Ee.zeniAccountsConfig),v=Ga(k),{configValue:H}=u(Ee.sameDayAchDisablementConfig),U=Oa(H),_=L.getSignedInUser(),F=I(N=>Z(N)),x=I(N=>Ne(N,h,m,n)),$=Xt(F?.companyId,{clearParams:x.fetchState==="Completed"}),{isAiCfoOpen:M,setIsAiCfoOpen:B}=Je(),{isAiCfoAccessEnabled:O,onAskAiCfoClick:W}=tt({isAiCfoOpen:M,setIsAiCfoOpen:B,mobileExploreReferrer:"Bill Details"});at({isDataReady:x.fetchState==="Completed"});const q=F.companyId??L.getSignedInUserTenant(c)?.companyId,J=!!F.companyZeniAccountInfo?.info?.isZeniAccountEnabled,G=ve(),le=_t(G?.loggedInUserRoleMap),Y=Gt(G?.loggedInUserRoleMap),w=pe(G?.loggedInUserRoleMap),se=xt(F.userRole);if(f.useEffect(()=>{n!=null&&l(Bt(n))},[n]),_==null)throw Error("Can't access address page without signing in...");const Fe=I(N=>Na(N.accountState,N.accountListState,"billPayAccountList")),Ce={pathname:"../",search:t.search};return x.isDeleted===!0||x.billStage=="paid"||x.fetchState=="Not-Started"?a.jsx(ee,{to:Ce}):x.deleteStatus.fetchState==="In-Progress"||s?a.jsx(ce,{fetchState:x.deleteStatus.fetchState}):a.jsxs(a.Fragment,{children:[a.jsx(Te,{analytics:j,onLoad:N=>(Ae=>{n!=null&&x.deleteStatus.fetchState!=="Completed"&&Ae.trackBillPayEditBill(n,x.isRecurring)})(N)}),a.jsx(Mi,{initialOpenThreadRequest:$??void 0,location:t,navigate:e,currentTenant:F,billId:n,companyId:q,billDetailsView:x,isMagicLinkEnabled:o,isVendorRecommendationEnabled:h,isLocalCurrencyEnabled:p,uncategorizedAccounts:Fe,isInternationalPaymentShaVsOurEnabled:i,vendor:x.vendor,isBillPayCommentingEnabled:d,isShaDisabled:b,isOurDisabled:A,isRecurringBillsFeatureEnabled:g,isAccountsEnabled:J,hasZeniAccountsAdminAccess:le,isZeniAccountsUser:Y,isBillPayAdmin:w,isSuperAdmin:se,accountsPromoConfig:v,isDetectInsufficientFundsEnabled:T,sameDayAchDisablementConfig:U,isAiCfoAccessEnabled:O,onAskAiCfoClick:W})]})}const kt=(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},Ui=(e,t)=>{let l=`/${e}/bill/`;return l=t===void 0?l.concat("new/review"):l.concat(`${t}/edit/review`),l},_i=(e,t,l)=>{let n=`/${e}/bill/`;return n=l!=null?n.concat(`${encodeURIComponent(l)}/edit/`):n.concat("new/"),n=n.concat(`vendor/${encodeURIComponent(t)}/edit/ach`),n},Gi=(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",Oi=(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()):Ot(),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(en)&&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===Vi.recurringBill.paymentTypeOptions[1],h={isActive:e.recurringConfig?.isActive??!1,currentInstance:e.recurringConfig?.currentInstance,isApprovalRequired:t[R]?.recurringPaymentDetails?.requireApproval?.selectedOption==="all",frequency:tn(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},g=Ni(e.accountList.accounts,e.classList.classes,e.lineDetailSection,t.lineItems,n,l),m=Object.keys(g).length>0?Qn(g):e.editBillInitialDetails?.recipientTotalAmount;return{showVendorGptRecommendationText:e.showVendorGptRecommendationText,vendor:u,whatForSection:o,paymentDetailsSection:s,isCancelled:e.isCancelled,totalAmount:m,recipientTotalAmount:m,file:e.file,updatesByLineId:g,toAccountVendorEmail:i,isCollectToAccountInfoFromVendorContact:d,isRecurring:p,recurringConfig:h}},Ni=(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=Xn(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},zi=V.div`
|
|
92
|
+
`,{common:{currency:Se},spendManagement:{billPay:{billDetails:Vi}},appName:$i}=Qe.getLocalizedStrings(),Ui=X(function(e,t){const l=L.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=We(e,"common");let i=`${l?.firstName} ${l?.lastName}`;const d=je(l);t.billId!=null&&t.billDetailsView!=null&&(i=`${t.billDetailsView.createdBy?.firstName??$i} ${t.billDetailsView.createdBy?.lastName??""}`),d||!t.billDetailsView.createdBy?.email?.includes("zeni.ai")||(i="Zeni");const p=t.billDetailsView.editBillInitialDetails?.totalAmount?.amount,h=za(t.billDetailsView.paymentDetailsSection?.paymentType?.method),g=t.currentTenant.createTime,m=Ot(),b=t.sameDayAchDisablementConfig.newTenantTenureLimitMonths,A=g.add(b,"month").isAfter(m),T=!!(t.billDetailsView.billStage==="draft"&&h&&p!=null&&p>0)&&!Nt(p,t.billDetailsView.approvalRules.allApprovalRules,l),k=Z(e);return{billDetails:t.billDetailsView,isAccountingClassesEnabled:Dt(e),billId:t.billId,createdBy:i,createTime:t.billDetailsView?.createTime,authParams:c,transactionAttachmentEndpoint:`${Ke}/transaction_attachment`,analytics:j,showBackButton:u,isAdmin:t.isBillPayAdmin,isSuperAdmin:t.isSuperAdmin,connectedAccountProvider:k.company?.featuresActivationInfo.connectedAccountProvider??"",customerSearchAutoCompleteData:{autoCompleteText:o,entityAutoCompleteView:s},showMarkAsPaidInfo:T,isZeniUser:d,isNewUser:A,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(st(i));const d=kt(s,i,l),p=D(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},chooseNewVendor:i=>{const d=i??t.billDetailsView.addBillAutoFields.tentativeVendorName;d!=null&&e(Zt(d,!1)),e(Ht({localData:{vendorName:i??t.billDetailsView.addBillAutoFields.tentativeVendorName}})),e(st());const p=kt(s,void 0,l),h=D(r.state?.pathnameStackToGoBack,r.pathname);u(p,{state:{pathnameStackToGoBack:h}})},onInvoiceUpload:i=>{i!=null&&e(Ze(i,t.isVendorRecommendationEnabled))},updateShowAutofill:i=>{e(ze(i))},onSaveChangesToLocalStore:(i,d,p,h,g)=>{const m=Oi(t.billDetailsView,{...i,paymentDetails:{...i?.paymentDetails,paymentDate:g}},p,d,t.isInternationalPaymentShaVsOurEnabled,h,t.vendor);e(Ya({billDetailLocalData:m,billId:l}))},saveBillDetails:()=>{e(Oe("draft",!1,!1,l)),e(ie("common"))},updateBillDetailSaveBillCode:()=>{e(zt("draft"))},reviewBillDetails:()=>{const i=Mi(s,l),d=D(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d,message:"coming_from_edit_page"}})},discardBillDetailsFromLocalStore:({billId:i})=>{e(ke({billId:i}))},clearBillPayReviewLocalState:()=>e(Xa()),onClickDismiss:()=>{const i=ne(s),d=D(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d}})},onClickDiscard:()=>{const i=ne(s),d=D(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d}})},setBillDetailPageMode:i=>{if(i==="edit_bill"){let d=window.location.pathname;d=d.concat("/edit");const p=D(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})}},redirectToACHScreen:i=>{e(fe(!1,i));const d=_i(s,i,l),p=D(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToWireScreen:i=>{e(fe(!1,i));const d=Gi(s,i,l),p=D(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToInternationalScreen:i=>{e(fe(!1,i));const d=Qt(s,l,i),p=D(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToBillsScreen:()=>{const i=ne(s),d=D(r.state?.pathnameStackToGoBack,r.pathname);e(ke({})),u(i,{state:{pathnameStackToGoBack:d}})},redirectToBillDetailPage:()=>{t.navigate("../")},deleteBill:()=>{l!=null&&e(Pt(l))},onAttachmentClick:(i,d)=>{const p=Pe(s,i,d);window.open(`${p}`,"_blank")},onBackClick:()=>{const i=z(t.location.state?.pathnameStackToGoBack),d=i.poppedPathname??ne(s);u(d,{state:{pathnameStackToGoBack:i.newStack}})},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,d)=>{i.trim().length>=2?e(qe({searchString:i,entityType:d,searchOrigin:"common"})):i.trim().length===0&&e(ie("common"))},onCancelAutoComplete:()=>{e(ie("common"))}},addVendorContactEmail(i,d){e(Qa(i,d,l))},onWiseVerifyClick:()=>{let i="";i=Yn()?"https://sandbox.transferwise.tech":"https://wise.com";const d=`${i}/login`;window.open(d,"_blank")},onVendorSelected:i=>{e(Ka(!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(Ja("bill_pay_detail",i,d))},onEstablishConnectionClick:i=>{e(qa(i,n,"bill_pay_detail","bill_pay"))},onUpdatePaymentAccountStatus:(i,d,p)=>{e(Wa(i,d,"bill_pay","bill_pay_detail",p))},onEstablishConnectionSuccess:()=>{e(Za("bill_pay","bill_pay_detail")),e(Ha({billId:l,withdrawFromAccountId:o.newAddedBillPaymentAccountId,withdrawFromList:o.withdrawFromList}))}}})(Kn);function ft(){const e=K(),t=Q(),l=re(),{billId:n,tenantEmailDomain:c}=te(),{useFeatureGate:r,useDynamicConfig:u}=oe(),{isFeatureEnabled:o,isFeatureGateLoading:s}=r(y.isVendorMagicLinkFeatureEnabled),{isFeatureEnabled:i}=r(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:d}=r(y.isBillPayCommentingEnabled),{isFeatureEnabled:p}=r(y.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:h}=r(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=r(y.isRecurringBillsFeatureEnabled),{isFeatureEnabled:m}=r(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=r(y.isShaDisabled),{isFeatureEnabled:A}=r(y.isOurDisabled),{isFeatureEnabled:T}=r(y.isBillPayDetectInsufficientFundsEnabled),{configValue:k}=u(Ee.zeniAccountsConfig),v=Ga(k),{configValue:H}=u(Ee.sameDayAchDisablementConfig),M=Oa(H),_=L.getSignedInUser(),F=I(N=>Z(N)),x=I(N=>Ne(N,h,m,n)),$=Xt(F?.companyId,{clearParams:x.fetchState==="Completed"}),{isAiCfoOpen:U,setIsAiCfoOpen:B}=Je(),{isAiCfoAccessEnabled:O,onAskAiCfoClick:W}=tt({isAiCfoOpen:U,setIsAiCfoOpen:B,mobileExploreReferrer:"Bill Details"});at({isDataReady:x.fetchState==="Completed"});const q=F.companyId??L.getSignedInUserTenant(c)?.companyId,J=!!F.companyZeniAccountInfo?.info?.isZeniAccountEnabled,G=ve(),le=_t(G?.loggedInUserRoleMap),Y=Gt(G?.loggedInUserRoleMap),w=pe(G?.loggedInUserRoleMap),se=xt(F.userRole);if(f.useEffect(()=>{n!=null&&l(Bt(n))},[n]),_==null)throw Error("Can't access address page without signing in...");const Fe=I(N=>Na(N.accountState,N.accountListState,"billPayAccountList")),Ce={pathname:"../",search:t.search};return x.isDeleted===!0||x.billStage=="paid"||x.fetchState=="Not-Started"?a.jsx(ee,{to:Ce}):x.deleteStatus.fetchState==="In-Progress"||s?a.jsx(ce,{fetchState:x.deleteStatus.fetchState}):a.jsxs(a.Fragment,{children:[a.jsx(Te,{analytics:j,onLoad:N=>(Ae=>{n!=null&&x.deleteStatus.fetchState!=="Completed"&&Ae.trackBillPayEditBill(n,x.isRecurring)})(N)}),a.jsx(Ui,{initialOpenThreadRequest:$??void 0,location:t,navigate:e,currentTenant:F,billId:n,companyId:q,billDetailsView:x,isMagicLinkEnabled:o,isVendorRecommendationEnabled:h,isLocalCurrencyEnabled:p,uncategorizedAccounts:Fe,isInternationalPaymentShaVsOurEnabled:i,vendor:x.vendor,isBillPayCommentingEnabled:d,isShaDisabled:b,isOurDisabled:A,isRecurringBillsFeatureEnabled:g,isAccountsEnabled:J,hasZeniAccountsAdminAccess:le,isZeniAccountsUser:Y,isBillPayAdmin:w,isSuperAdmin:se,accountsPromoConfig:v,isDetectInsufficientFundsEnabled:T,sameDayAchDisablementConfig:M,isAiCfoAccessEnabled:O,onAskAiCfoClick:W})]})}const kt=(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},Mi=(e,t)=>{let l=`/${e}/bill/`;return l=t===void 0?l.concat("new/review"):l.concat(`${t}/edit/review`),l},_i=(e,t,l)=>{let n=`/${e}/bill/`;return n=l!=null?n.concat(`${encodeURIComponent(l)}/edit/`):n.concat("new/"),n=n.concat(`vendor/${encodeURIComponent(t)}/edit/ach`),n},Gi=(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",Oi=(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()):Ot(),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(en)&&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===Vi.recurringBill.paymentTypeOptions[1],h={isActive:e.recurringConfig?.isActive??!1,currentInstance:e.recurringConfig?.currentInstance,isApprovalRequired:t[R]?.recurringPaymentDetails?.requireApproval?.selectedOption==="all",frequency:tn(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},g=Ni(e.accountList.accounts,e.classList.classes,e.lineDetailSection,t.lineItems,n,l),m=Object.keys(g).length>0?Qn(g):e.editBillInitialDetails?.recipientTotalAmount;return{showVendorGptRecommendationText:e.showVendorGptRecommendationText,vendor:u,whatForSection:o,paymentDetailsSection:s,isCancelled:e.isCancelled,totalAmount:m,recipientTotalAmount:m,file:e.file,updatesByLineId:g,toAccountVendorEmail:i,isCollectToAccountInfoFromVendorContact:d,isRecurring:p,recurringConfig:h}},Ni=(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=Xn(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},zi=V.div`
|
|
93
93
|
display: flex;
|
|
94
94
|
height: 100vh;
|
|
95
95
|
width: 100%;
|
|
@@ -116,4 +116,4 @@ import{j as a}from"./liveblocks-BeS4QmMp.js";import{j as K,h as re,u as Q,l as t
|
|
|
116
116
|
align-items: center;
|
|
117
117
|
background-color: ${e=>e.theme.colors.grey4};
|
|
118
118
|
box-shadow: ${e=>`0px 2px ${E.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
119
|
-
`,Ki=X(function(e,t){const l=L.getSignedInUser(),n=Wt(e,t.billId),c=gn(e),r=je(l),u=n.totalAmount.amount,o=n.billPayInfo?.stage.code!=="scheduled"&&c.allApprovalRules.length>0&&!Nt(u,c.allApprovalRules,l);return{billDetails:n,billId:t.billId,billpayApprovalView:c,analytics:j,isApprovalRequiredForMarkAsPaid:o,isZeniUser:r}},function(e,t){const{location:l,billId:n,currentTenant:c,navigate:r}=t,{tenantEmailDomain:u}=c;return{redirectToBillsScreen:()=>{const o=ne(c.tenantEmailDomain),s=D(l.state?.pathnameStackToGoBack,l.pathname);r(o,{state:{pathnameStackToGoBack:s}})},discardBillDetailsFromLocalStore:()=>{e(ke({}))},saveBillDetails:(o,s)=>{o&&e(Tt({billId:n,data:s})),e(Oe(o?"paid":"pending_approval",o,!1,n))},discardOutsideZeniPaymentData:()=>{e(jt({billId:n}))},updateBillDetailSaveBillCode:()=>{e(zt("pending_approval"))},onClickEdit:()=>{t.navigate("../",{relative:"path"})},onAttachmentClick:(o,s)=>{const i=Pe(u,o,s);window.open(`${i}`,"_blank")},retryPayment:()=>{t.billId!=null&&e(Be(t.billId,"retry"))}}})(ni);function Ct(){const e=K(),t=re(),l=Q(),{billId:n}=te(),{useFeatureGate:c}=oe(),{isFeatureEnabled:r}=c(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:u}=c(y.isBillPayDetectInsufficientFundsEnabled),o=we(),s=L.getSignedInUser(),{isFeatureEnabled:i}=c(y.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:d}=c(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:p}=c(y.isBillPayCommentingEnabled),h=z(l.state?.pathnameStackToGoBack),{poppedPathname:g}=h,{isFeatureEnabled:m}=c(y.isRecurringBillsFeatureEnabled),b=I(k=>Z(k)),A=I(k=>Wt(k,n)),T=A.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 k=A.vendor?.name,v=A.vendor?.id,H=A.totalAmount.amount,U=A.recipientTotalAmount.amount,_=A.invoiceNumber;k&&v&&t(hn(k,v,H,U,_,n))},[]),g==null)return a.jsx(ee,{to:`../${n}`});if(s==null)throw Error("Can't access address page without signing in...");return T==="In-Progress"?a.jsx(wt,{windowSize:o,children:a.jsx(ai,{})}):a.jsx(wt,{windowSize:o,children:a.jsx(Ki,{location:l,navigate:e,currentTenant:b,billId:n,isBillPayCommentingEnabled:p,isLocalCurrencyEnabled:i,isVendorRecommendationEnabled:d,isInternationalPaymentShaVsOurEnabled:r,isRecurringBillsFeatureEnabled:m,isDetectInsufficientFundsEnabled:u})})}const Qi=X(function(e,t){const{vendorId:l}=t,n=e.entityAutoCompleteState.autoCompleteText.common,c=We(e,"common"),r=l!=null?"edit":"create",u=Z(e),o=L.getSignedInUser(),s=u.tenantId,i={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:s??""};return{vendorViewDetails:t.vendorViewDetails,screenType:r,filesEndPoint:`${Jt.fileMicroServiceBaseUrl}`,authParams:i,analytics:j,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(Dn(u??void 0,t.billId)),i!=null&&e(jn(i))},saveVendorDetailLocalData:i=>{e(Ht({vendorId:u,localData:i}))},saveContactsInVendorDetailLocalData:i=>{e(En({vendorId:u,contacts:i}))},resetVendorDetailLocalData:()=>{e(dt(u))},updateSelectedVendorForCreate:i=>{e(Bn(i))},navigateToBankDetailPage:(i,d)=>{let p;i==="wire"?p=d==="international"?Qt(s,t.billId,u):mi(s,t.billId,u):p=pi(s,t.billId,u);const h=D(r.state?.pathnameStackToGoBack,r.pathname);c(p,{state:{pathnameStackToGoBack:h}})},onRemoveBankAccount:(i,d)=>{e(d===!0?An(i,"vendor",u):xn(i,"vendor",u))},navigateToMailingAddressPage:i=>{const d=et(s,i,l),p=D(r.state?.pathnameStackToGoBack,r.pathname);c(d,{state:{pathnameStackToGoBack:p}})},updateFilesEntity:i=>{e(Cn({files:i}))},onEditFileName:(i,d)=>{e(wn(i,d.split(".")[0]))},handleZeniLogoClick:()=>{o.toggle()},updateSaveFetchState:()=>{u==null&&e(dt(t.vendorViewDetails.newVendorState?.vendorBasic?.id)),e(vn("Not-Started",u))},onVendorSelected:i=>{i!=null&&e(In(i,!0))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,d)=>{i.trim().length>=2?e(qe({searchString:i,entityType:d,searchOrigin:"common"})):i.trim().length===0&&e(ie("common"))},onCancelAutoComplete:()=>{e(ie("common"))}},onBackClick:()=>{e(ie("common"));const i=z(t.location.state?.pathnameStackToGoBack),d=i.poppedPathname??ui(n.tenantEmailDomain,t.billId);c(d,{state:{pathnameStackToGoBack:i.newStack}})},onGetOtp:i=>{e(kn(i,"BillPayVendor"))},onResendOtp:i=>{e(fn(i,"BillPayVendor"))},onVerifyOtp:(i,d)=>{e(Sn(i,d,"BillPayVendor"))},onVerifyOtpSuccess:(i,d,p)=>{e(yn(i,d,p))},onFetchAndUpdateVendorRecommendations:i=>{e(Zt(i,!1))}}})(si),xe=()=>{const e=K(),t=re(),l=ii(),n=Q(),{billId:c,vendorId:r}=te(),u=I(b=>Z(b)),{useFeatureGate:o}=oe(),{isFeatureEnabled:s}=o(y.isBillPayLocalCurrencyFeatureEnabled),[i,d]=f.useState(!1),p=I(b=>b.vendorViewState.newVendorState.fetchStatus.fetchState),h=I(b=>Ie(b,r)),g=I(b=>r!==void 0?b.vendorViewState.editVendorStateById[r]?.fetchStatus??"Not-Started":"Not-Started"),m=r!==void 0?g:p;return f.useEffect(()=>{i===!1&&m==="Not-Started"&&r!=null&&(t(fe(!1,r)),d(!0))},[i,m,r]),h.fetchState==="Not-Started"||h.fetchState==="In-Progress"?a.jsx(oi,{}):m==="Error"?a.jsx(li,{onGoHome:()=>e("../",{replace:!0}),onReload:()=>window.location.reload()}):a.jsxs(a.Fragment,{children:[a.jsx(Ye,{vendorId:r,billId:c}),a.jsx(Qi,{navigate:e,location:n,themeState:l,currentTenant:u,vendorId:r,billId:c,vendorViewDetails:h,isLocalCurrencyEnabled:s})]})},Xi=X(function(e,t){const{companyId:l}=t;return{billPaySetupView:Tn(e,l),analytics:j,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(Pn(l))},onBackClick:()=>{n("../..",{relative:"path"})},onSetupBillPaySuccess:()=>{n("../bills/setup",{relative:"path"})}}})(ri),Yi=()=>{const e=K(),t=Q(),{tenantEmailDomain:l}=te(),[n,c]=f.useState(!1),r=me(),u=I(g=>Z(g)),o=u.companyId??L.getSignedInUserTenant(l)?.companyId,s=L.getSignedInUser(),i=ve(),d=!!u.companyBillPayInfo?.info?.isBillPayTOSAccepted,p=pe(i?.loggedInUserRoleMap),h=g=>{c(g)};if(s==null)throw Error("Can't access bill pay promo page without signing in...");return u.companyBillPayInfo?.info?.isBillPayEnabled===!0?a.jsx(ee,{to:"../../../bills"}):d===!0&&p===!0?a.jsx(ee,{to:"../../bills/setup"}):d===!1||i!=null&&He(u,i.loggedInUserRoleMap)?a.jsxs(a.Fragment,{children:[a.jsx(Te,{analytics:j,onLoad:g=>(m=>m.trackPageLoaded(Kt.Event.billPayPromoPage))(g)}),a.jsx(Yt,{isAppContentDrawerOpen:n,handleDrawerToggle:h}),a.jsx(Xi,{companyId:o,navigate:e,location:t,onClickMenuIcon:()=>{h(!0)}})]}):a.jsx(ce,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function Fo(){const e=I(M=>Z(M)),t=ve(),l=pe(t?.loggedInUserRoleMap),n=me(),{useFeatureGate:c}=oe(),{isFeatureEnabled:r}=c(y.isBillPayLocalCurrencyFeatureEnabled),u=r===!0?Ji:Hi,{isFeatureEnabled:o}=c(y.isDebitCardFeatureEnabled),s=Mt(o,e),i=Ut(e),d=Q(),p=e?.userRole!=null&&At(e?.userRole),h=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!p)&&pe(t?.loggedInUserRoleMap),g=$t(t?.loggedInUserRoleMap),m=(e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!p)&&Fn(t?.loggedInUserRoleMap),{isFeatureEnabled:b}=c(y.isDepositAccountsFeatureEnabled),A=b&&!p&&_t(t?.loggedInUserRoleMap),{isFeatureEnabled:T}=c(y.isChargeCardFeatureEnabled),k=ci(e,T,o)&&!p&&Rn(t?.loggedInUserRoleMap),v=Ln(t?.loggedInUserRoleMap),H=Gt(t?.loggedInUserRoleMap),U=Vn(t?.loggedInUserRoleMap),_=$n(t?.loggedInUserRoleMap),F=Mn(t?.loggedInUserRoleMap),x=Un(t?.loggedInUserRoleMap),{tenantEmailDomain:$}=te();return a.jsxs(sa,{children:[d.pathname.includes("/bills")?a.jsxs(a.Fragment,{children:[a.jsx(S,{path:"setup",element:a.jsx(Re,{isBillPayAdminLevelAccess:h,isUserHasOnlyBillPayAccess:g,isReimbursementAdminLevelAccess:m,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:k,isUserHasOnlyCardAccess:v,productType:"bill_pay",type:"setup"})}),a.jsx(S,{path:"verification",element:a.jsx(Re,{isBillPayAdminLevelAccess:h,isUserHasOnlyBillPayAccess:g,isReimbursementAdminLevelAccess:m,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:k,isUserHasOnlyCardAccess:v,productType:"bill_pay",type:"verification"})}),a.jsx(S,{path:"promo",element:a.jsx(Yi,{})}),a.jsx(S,{path:"approval-rules/*",element:h?a.jsx(hi,{}):a.jsx(gi,{isUserHasZeniAccountsAccess:H,isUserHasChargeCardAccess:_,isUserHasBillPayAccess:F,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:U,isTenantBankingOnly:s,tenantEmailDomain:$??""})}),a.jsx(S,{path:"international-wire",element:a.jsx(Re,{isBillPayAdminLevelAccess:h,isUserHasOnlyBillPayAccess:g,isReimbursementAdminLevelAccess:m,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:k,isUserHasOnlyCardAccess:v,productType:"bill_pay",type:"international-wire"})}),e.companyBillPayInfo?.info?.isBillPayEnabled===!0&&a.jsx(S,{path:"*",element:a.jsx(Fi,{})}),(s===!0||i===!0)&&a.jsx(S,{path:"/*",element:a.jsx(ea,{})}),e.companyBillPayInfo?.info?.isBillPayTOSAccepted===!0&&l&&a.jsx(S,{path:"*",element:a.jsx(ee,{to:"../setup"})}),t!=null&&He(e,t.loggedInUserRoleMap)&&a.jsx(S,{path:"*",element:a.jsx(ee,{to:"../promo"})})]}):d.pathname.includes("/bill")?a.jsxs(a.Fragment,{children:[a.jsx(S,{path:"new",element:a.jsx(C,{appContent:a.jsx(ft,{})})}),a.jsx(S,{path:":billId",element:a.jsx(C,{appContent:a.jsx(Si,{})})}),a.jsx(S,{path:":billId/edit",element:a.jsx(C,{appContent:a.jsx(ft,{})})}),a.jsx(S,{path:"new/review",element:a.jsx(C,{appContent:a.jsx(Ct,{})})}),a.jsx(S,{path:":billId/edit/review",element:a.jsx(C,{appContent:a.jsx(Ct,{})})}),a.jsx(S,{path:"/:billId/:addressType",element:a.jsx(C,{appContent:a.jsx(mt,{isSubPage:!0})})}),a.jsx(S,{path:"/new/:addressType",element:a.jsx(C,{appContent:a.jsx(mt,{isSubPage:!0})})}),a.jsx(S,{path:"new/vendor/create",element:a.jsx(C,{appContent:a.jsx(xe,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit",element:a.jsx(C,{appContent:a.jsx(xe,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/ach",element:a.jsx(C,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/domestic",element:a.jsx(C,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/international",element:a.jsx(C,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:"new/vendor/create/ach",element:a.jsx(C,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:"new/vendor/create/domestic",element:a.jsx(C,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:"new/vendor/create/international",element:a.jsx(C,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/ach",element:a.jsx(C,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/domestic",element:a.jsx(C,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/international",element:a.jsx(C,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:":billId/edit/vendor/create",element:a.jsx(C,{appContent:a.jsx(xe,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit",element:a.jsx(C,{appContent:a.jsx(xe,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/ach",element:a.jsx(C,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/domestic",element:a.jsx(C,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/international",element:a.jsx(C,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/ach",element:a.jsx(C,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/domestic",element:a.jsx(C,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/international",element:a.jsx(C,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:"*",element:a.jsx(De,{})})]}):a.jsx(S,{path:"*",element:a.jsx(ce,{fetchState:"In-Progress",style:{backgroundColor:n.colors.grey5,boxShadow:`0px 2px ${E.sp1} ${n.colors.dropShadowNormal}`}})}),a.jsx(S,{path:"*",element:a.jsx(De,{})})]})}export{Fo as default};
|
|
119
|
+
`,Ki=X(function(e,t){const l=L.getSignedInUser(),n=Wt(e,t.billId),c=gn(e),r=je(l),u=n.totalAmount.amount,o=n.billPayInfo?.stage.code!=="scheduled"&&c.allApprovalRules.length>0&&!Nt(u,c.allApprovalRules,l);return{billDetails:n,billId:t.billId,billpayApprovalView:c,analytics:j,isApprovalRequiredForMarkAsPaid:o,isZeniUser:r}},function(e,t){const{location:l,billId:n,currentTenant:c,navigate:r}=t,{tenantEmailDomain:u}=c;return{redirectToBillsScreen:()=>{const o=ne(c.tenantEmailDomain),s=D(l.state?.pathnameStackToGoBack,l.pathname);r(o,{state:{pathnameStackToGoBack:s}})},discardBillDetailsFromLocalStore:()=>{e(ke({}))},saveBillDetails:(o,s)=>{o&&e(Tt({billId:n,data:s})),e(Oe(o?"paid":"pending_approval",o,!1,n))},discardOutsideZeniPaymentData:()=>{e(jt({billId:n}))},updateBillDetailSaveBillCode:()=>{e(zt("pending_approval"))},onClickEdit:()=>{t.navigate("../",{relative:"path"})},onAttachmentClick:(o,s)=>{const i=Pe(u,o,s);window.open(`${i}`,"_blank")},retryPayment:()=>{t.billId!=null&&e(Be(t.billId,"retry"))}}})(ni);function Ct(){const e=K(),t=re(),l=Q(),{billId:n}=te(),{useFeatureGate:c}=oe(),{isFeatureEnabled:r}=c(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:u}=c(y.isBillPayDetectInsufficientFundsEnabled),o=we(),s=L.getSignedInUser(),{isFeatureEnabled:i}=c(y.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:d}=c(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:p}=c(y.isBillPayCommentingEnabled),h=z(l.state?.pathnameStackToGoBack),{poppedPathname:g}=h,{isFeatureEnabled:m}=c(y.isRecurringBillsFeatureEnabled),b=I(k=>Z(k)),A=I(k=>Wt(k,n)),T=A.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 k=A.vendor?.name,v=A.vendor?.id,H=A.totalAmount.amount,M=A.recipientTotalAmount.amount,_=A.invoiceNumber;k&&v&&t(hn(k,v,H,M,_,n))},[]),g==null)return a.jsx(ee,{to:`../${n}`});if(s==null)throw Error("Can't access address page without signing in...");return T==="In-Progress"?a.jsx(wt,{windowSize:o,children:a.jsx(ai,{})}):a.jsx(wt,{windowSize:o,children:a.jsx(Ki,{location:l,navigate:e,currentTenant:b,billId:n,isBillPayCommentingEnabled:p,isLocalCurrencyEnabled:i,isVendorRecommendationEnabled:d,isInternationalPaymentShaVsOurEnabled:r,isRecurringBillsFeatureEnabled:m,isDetectInsufficientFundsEnabled:u})})}const Qi=X(function(e,t){const{vendorId:l}=t,n=e.entityAutoCompleteState.autoCompleteText.common,c=We(e,"common"),r=l!=null?"edit":"create",u=Z(e),o=L.getSignedInUser(),s=u.tenantId,i={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:s??""};return{vendorViewDetails:t.vendorViewDetails,screenType:r,filesEndPoint:`${Jt.fileMicroServiceBaseUrl}`,authParams:i,analytics:j,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(Dn(u??void 0,t.billId)),i!=null&&e(jn(i))},saveVendorDetailLocalData:i=>{e(Ht({vendorId:u,localData:i}))},saveContactsInVendorDetailLocalData:i=>{e(En({vendorId:u,contacts:i}))},resetVendorDetailLocalData:()=>{e(dt(u))},updateSelectedVendorForCreate:i=>{e(Bn(i))},navigateToBankDetailPage:(i,d)=>{let p;i==="wire"?p=d==="international"?Qt(s,t.billId,u):mi(s,t.billId,u):p=pi(s,t.billId,u);const h=D(r.state?.pathnameStackToGoBack,r.pathname);c(p,{state:{pathnameStackToGoBack:h}})},onRemoveBankAccount:(i,d)=>{e(d===!0?An(i,"vendor",u):xn(i,"vendor",u))},navigateToMailingAddressPage:i=>{const d=et(s,i,l),p=D(r.state?.pathnameStackToGoBack,r.pathname);c(d,{state:{pathnameStackToGoBack:p}})},updateFilesEntity:i=>{e(Cn({files:i}))},onEditFileName:(i,d)=>{e(wn(i,d.split(".")[0]))},handleZeniLogoClick:()=>{o.toggle()},updateSaveFetchState:()=>{u==null&&e(dt(t.vendorViewDetails.newVendorState?.vendorBasic?.id)),e(vn("Not-Started",u))},onVendorSelected:i=>{i!=null&&e(In(i,!0))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,d)=>{i.trim().length>=2?e(qe({searchString:i,entityType:d,searchOrigin:"common"})):i.trim().length===0&&e(ie("common"))},onCancelAutoComplete:()=>{e(ie("common"))}},onBackClick:()=>{e(ie("common"));const i=z(t.location.state?.pathnameStackToGoBack),d=i.poppedPathname??ui(n.tenantEmailDomain,t.billId);c(d,{state:{pathnameStackToGoBack:i.newStack}})},onGetOtp:i=>{e(kn(i,"BillPayVendor"))},onResendOtp:i=>{e(fn(i,"BillPayVendor"))},onVerifyOtp:(i,d)=>{e(Sn(i,d,"BillPayVendor"))},onVerifyOtpSuccess:(i,d,p)=>{e(yn(i,d,p))},onFetchAndUpdateVendorRecommendations:i=>{e(Zt(i,!1))}}})(si),xe=()=>{const e=K(),t=re(),l=ii(),n=Q(),{billId:c,vendorId:r}=te(),u=I(b=>Z(b)),{useFeatureGate:o}=oe(),{isFeatureEnabled:s}=o(y.isBillPayLocalCurrencyFeatureEnabled),[i,d]=f.useState(!1),p=I(b=>b.vendorViewState.newVendorState.fetchStatus.fetchState),h=I(b=>Ie(b,r)),g=I(b=>r!==void 0?b.vendorViewState.editVendorStateById[r]?.fetchStatus??"Not-Started":"Not-Started"),m=r!==void 0?g:p;return f.useEffect(()=>{i===!1&&m==="Not-Started"&&r!=null&&(t(fe(!1,r)),d(!0))},[i,m,r]),h.fetchState==="Not-Started"||h.fetchState==="In-Progress"?a.jsx(oi,{}):m==="Error"?a.jsx(li,{onGoHome:()=>e("../",{replace:!0}),onReload:()=>window.location.reload()}):a.jsxs(a.Fragment,{children:[a.jsx(Ye,{vendorId:r,billId:c}),a.jsx(Qi,{navigate:e,location:n,themeState:l,currentTenant:u,vendorId:r,billId:c,vendorViewDetails:h,isLocalCurrencyEnabled:s})]})},Xi=X(function(e,t){const{companyId:l}=t;return{billPaySetupView:Tn(e,l),analytics:j,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(Pn(l))},onBackClick:()=>{n("../..",{relative:"path"})},onSetupBillPaySuccess:()=>{n("../bills/setup",{relative:"path"})}}})(ri),Yi=()=>{const e=K(),t=Q(),{tenantEmailDomain:l}=te(),[n,c]=f.useState(!1),r=me(),u=I(g=>Z(g)),o=u.companyId??L.getSignedInUserTenant(l)?.companyId,s=L.getSignedInUser(),i=ve(),d=!!u.companyBillPayInfo?.info?.isBillPayTOSAccepted,p=pe(i?.loggedInUserRoleMap),h=g=>{c(g)};if(s==null)throw Error("Can't access bill pay promo page without signing in...");return u.companyBillPayInfo?.info?.isBillPayEnabled===!0?a.jsx(ee,{to:"../../../bills"}):d===!0&&p===!0?a.jsx(ee,{to:"../../bills/setup"}):d===!1||i!=null&&He(u,i.loggedInUserRoleMap)?a.jsxs(a.Fragment,{children:[a.jsx(Te,{analytics:j,onLoad:g=>(m=>m.trackPageLoaded(Kt.Event.billPayPromoPage))(g)}),a.jsx(Yt,{isAppContentDrawerOpen:n,handleDrawerToggle:h}),a.jsx(Xi,{companyId:o,navigate:e,location:t,onClickMenuIcon:()=>{h(!0)}})]}):a.jsx(ce,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function Fo(){const e=I(U=>Z(U)),t=ve(),l=pe(t?.loggedInUserRoleMap),n=me(),{useFeatureGate:c}=oe(),{isFeatureEnabled:r}=c(y.isBillPayLocalCurrencyFeatureEnabled),u=r===!0?Ji:Hi,{isFeatureEnabled:o}=c(y.isDebitCardFeatureEnabled),s=Ut(o,e),i=Mt(e),d=Q(),p=e?.userRole!=null&&At(e?.userRole),h=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!p)&&pe(t?.loggedInUserRoleMap),g=$t(t?.loggedInUserRoleMap),m=(e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!p)&&Fn(t?.loggedInUserRoleMap),{isFeatureEnabled:b}=c(y.isDepositAccountsFeatureEnabled),A=b&&!p&&_t(t?.loggedInUserRoleMap),{isFeatureEnabled:T}=c(y.isChargeCardFeatureEnabled),k=ci(e,T,o)&&!p&&Rn(t?.loggedInUserRoleMap),v=Ln(t?.loggedInUserRoleMap),H=Gt(t?.loggedInUserRoleMap),M=Vn(t?.loggedInUserRoleMap),_=$n(t?.loggedInUserRoleMap),F=Un(t?.loggedInUserRoleMap),x=Mn(t?.loggedInUserRoleMap),{tenantEmailDomain:$}=te();return a.jsxs(sa,{children:[d.pathname.includes("/bills")?a.jsxs(a.Fragment,{children:[a.jsx(S,{path:"setup",element:a.jsx(Re,{isBillPayAdminLevelAccess:h,isUserHasOnlyBillPayAccess:g,isReimbursementAdminLevelAccess:m,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:k,isUserHasOnlyCardAccess:v,productType:"bill_pay",type:"setup"})}),a.jsx(S,{path:"verification",element:a.jsx(Re,{isBillPayAdminLevelAccess:h,isUserHasOnlyBillPayAccess:g,isReimbursementAdminLevelAccess:m,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:k,isUserHasOnlyCardAccess:v,productType:"bill_pay",type:"verification"})}),a.jsx(S,{path:"promo",element:a.jsx(Yi,{})}),a.jsx(S,{path:"approval-rules/*",element:h?a.jsx(hi,{}):a.jsx(gi,{isUserHasZeniAccountsAccess:H,isUserHasChargeCardAccess:_,isUserHasBillPayAccess:F,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:M,isTenantBankingOnly:s,tenantEmailDomain:$??""})}),a.jsx(S,{path:"international-wire",element:a.jsx(Re,{isBillPayAdminLevelAccess:h,isUserHasOnlyBillPayAccess:g,isReimbursementAdminLevelAccess:m,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:k,isUserHasOnlyCardAccess:v,productType:"bill_pay",type:"international-wire"})}),e.companyBillPayInfo?.info?.isBillPayEnabled===!0&&a.jsx(S,{path:"*",element:a.jsx(Fi,{})}),(s===!0||i===!0)&&a.jsx(S,{path:"/*",element:a.jsx(ea,{})}),e.companyBillPayInfo?.info?.isBillPayTOSAccepted===!0&&l&&a.jsx(S,{path:"*",element:a.jsx(ee,{to:"../setup"})}),t!=null&&He(e,t.loggedInUserRoleMap)&&a.jsx(S,{path:"*",element:a.jsx(ee,{to:"../promo"})})]}):d.pathname.includes("/bill")?a.jsxs(a.Fragment,{children:[a.jsx(S,{path:"new",element:a.jsx(C,{appContent:a.jsx(ft,{})})}),a.jsx(S,{path:":billId",element:a.jsx(C,{appContent:a.jsx(Si,{})})}),a.jsx(S,{path:":billId/edit",element:a.jsx(C,{appContent:a.jsx(ft,{})})}),a.jsx(S,{path:"new/review",element:a.jsx(C,{appContent:a.jsx(Ct,{})})}),a.jsx(S,{path:":billId/edit/review",element:a.jsx(C,{appContent:a.jsx(Ct,{})})}),a.jsx(S,{path:"/:billId/:addressType",element:a.jsx(C,{appContent:a.jsx(mt,{isSubPage:!0})})}),a.jsx(S,{path:"/new/:addressType",element:a.jsx(C,{appContent:a.jsx(mt,{isSubPage:!0})})}),a.jsx(S,{path:"new/vendor/create",element:a.jsx(C,{appContent:a.jsx(xe,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit",element:a.jsx(C,{appContent:a.jsx(xe,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/ach",element:a.jsx(C,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/domestic",element:a.jsx(C,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/international",element:a.jsx(C,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:"new/vendor/create/ach",element:a.jsx(C,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:"new/vendor/create/domestic",element:a.jsx(C,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:"new/vendor/create/international",element:a.jsx(C,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/ach",element:a.jsx(C,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/domestic",element:a.jsx(C,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/international",element:a.jsx(C,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:":billId/edit/vendor/create",element:a.jsx(C,{appContent:a.jsx(xe,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit",element:a.jsx(C,{appContent:a.jsx(xe,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/ach",element:a.jsx(C,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/domestic",element:a.jsx(C,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/international",element:a.jsx(C,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/ach",element:a.jsx(C,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/domestic",element:a.jsx(C,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/international",element:a.jsx(C,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:"*",element:a.jsx(De,{})})]}):a.jsx(S,{path:"*",element:a.jsx(ce,{fetchState:"In-Progress",style:{backgroundColor:n.colors.grey5,boxShadow:`0px 2px ${E.sp1} ${n.colors.dropShadowNormal}`}})}),a.jsx(S,{path:"*",element:a.jsx(De,{})})]})}export{Fo as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as k}from"./liveblocks-
|
|
1
|
+
import{j as k}from"./liveblocks-tcXs1fes.js";import{a as V}from"./sentry-DNuKG-9f.js";import{j as ae,u as ne,h as se,l as ie,g as C,N as oe,k as re}from"./core-DkPdadc6.js";import{j as ce,a as ue,aJ as de,z as E,x as pe,d as M,ab as F,f as z,bu as le,ap as me,r as B,aq as R}from"./index-B5LlGXSS.js";import{M6 as fe,eN as G,rw as ye,GH as Se,xd as ge,zW as Ie,Ct as he,D6 as be,D$ as De,Mt as Oe,Mu as Te,Mv as ke,Mw as Ce,Mx as Ve,J0 as we,Lv as Ne,Jc as Ae,k6 as _e,fz as ve,fy as xe,fx as Fe,pE as ze,pv as Ee,ps as Me,j_ as Be,rF as Re,rD as P,bC as L,rR as j,ct as Pe}from"./zeni-epic-state-CSoWjbAn.js";import{n as Le}from"./mui-DbdGpDJj.js";import{c as U}from"./routePaths-DLaKTtZ1.js";import{M as je}from"./MobileAppDrawer-4e3Dnoyk.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]="2b758604-3383-4ed1-83f7-30cd4a9e9c62",e._sentryDebugIdIdentifier="sentry-dbid-2b758604-3383-4ed1-83f7-30cd4a9e9c62")}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-BeS4QmMp.js";import{a as V}from"./sentry-BlmJH5W
|
|
|
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=E.getSignedInUser(),S=r.tenantId,l={userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:S??""},
|
|
9
|
+
`,Ge=re(function(e,d){const{businessVerificationDetails:i}=d,r=G(e),y=E.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:O,companyLegalName:T,companyTaxId:g,companyWebsite:m,companyPhone:I,primaryContactEmail:c,primaryContactName:n,primaryContactUserId:u,primaryContactSyncToken:D,syncToken:f,fileIds:a,incDate:o,typeOfIncorporation:w,stateOfIncorporation:N,sourceOfFunds:A,companySubIndustry:_,countriesOfOperations:h,companySourceOfFunds:q,companySourceOfFundsDescription:J,transactionVolume:$,transactionVolumeDescription:W,purposeOfAccount:Z,purposeOfAccountDescription:H,regulatedStatus:K,regulatedStatusDescription:Q,usNexus:X,usNexusTypes:Y}=t,v=O?.selectedOption,ee={companyId:i,companyDescription:s,companyIndustry:p.selectedOption,companyIndustryType:v==null||v===""?void 0:v,companyLegalName:T,taxIdOrEIN:g,website:m!=""&&m!=null?Pe(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(x=>x.length===2?x:R(x))??[],companySourceOfFunds:q?.selectedOption??"",companySourceOfFundsDescription:J,transactionVolume:$?.selectedOption??"",transactionVolumeDescription:W,purposeOfAccount:Z?.selectedOption??"",purposeOfAccountDescription:H,regulatedStatus:K??"",regulatedStatusDescription:Q,usNexus:X,usNexusTypes:Y?.selectedOptions??[]},te={userId:u,firstName:n.firstName,lastName:n.lastName,email:c,syncToken:D};e(j({companyDetails:ee,primaryContactDetails:te}))},onCompanyOfficerUpdated:t=>{const s=t.map(p=>{const{officerType:O,userId:T,name:g,email:m,nationalityCountryCode:I,ssn:c,dob:n,phone:u,syncToken:D,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:O,userId:T,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:D,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(P(i,t,r))},onSendForVerificationClick:t=>{e(P(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(Me(t))},onDeleteFileList:t=>{e(Ee(t))},onEditFileName:(t,s)=>{e(ze(t,s.split(".")[0]))},onGetOtp:t=>{e(Fe(t,"SpendManagementSetup"))},onResendOtp:t=>{e(xe(t,"SpendManagementSetup"))},onVerifyOtp:(t,s)=>{e(ve(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:O}=p(de.zeniAccountsConfig),T=fe(O),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??E.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(De(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]),E.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 D=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=Te(a,n);break;default:o=Oe(a,n)}return o});return u===!1?k.jsx(oe,{to:"../promo"}):k.jsxs(Ue,{children:[k.jsx(pe,{analytics:M,onLoad:a=>(o=>{switch(e){case"zeni_accounts":return o.trackPageLoaded(z.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return o.trackPageLoaded(z.Event.reimbursementBusinessVerification);default:return o.trackPageLoaded(z.Event.billPayBusinessVerification,F(i)?"Settings":void 0)}})(a)}),F(i)?k.jsx(je,{isAppContentDrawerOpen:l,handleDrawerToggle:D}):null,k.jsx(Ge,{businessVerificationDetails:f,navigate:d,location:i,companyId:n,analytics:M,currentTenant:c,productType:e,isSettings:F(i),roleMap:s?.loggedInUserRoleMap??{},onClickMenuIcon:()=>{D(!0)},maxInsuredAmount:T.maxInsuredAmount})]})};export{Xe as B};
|