@zeniai/web-app-ui 5.1.52-qa → 5.1.53-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AddressRoutes-Ct2UHIee.js +1 -0
- package/dist/assets/AddressScreen-DzlfvttE.js +9 -0
- package/dist/assets/{AiCfoScreen-CRoxnDRU.js → AiCfoScreen-D83FklRr.js} +5 -5
- package/dist/assets/{BillPayApprovalRoutes-BWlPp4gg.js → BillPayApprovalRoutes-Dh8a42Hh.js} +1 -1
- package/dist/assets/{BillPayRoutes-BcERL4gz.js → BillPayRoutes-C6_AK3AV.js} +1 -1
- package/dist/assets/{BusinessVerificationPageScreen-DWX7ySZI.js → BusinessVerificationPageScreen-6o8gENq-.js} +2 -2
- package/dist/assets/{CardsAiCfoScreen-DEKa5Xew.js → CardsAiCfoScreen-D5tWDH0n.js} +1 -1
- package/dist/assets/{ChargeCardRoutes-FSWFOO49.js → ChargeCardRoutes-2ad2KSI-.js} +10 -10
- package/dist/assets/CompanyPassportScreen-DBpHUeez.js +1 -0
- package/dist/assets/{ConnectionAuthScreen-DDK9ow_u.js → ConnectionAuthScreen-BDQnLY2-.js} +1 -1
- package/dist/assets/CustomerOnboardingAuthScreen-Yzg3cHZm.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-BdqZkh_s.js → CustomerOnboardingRoutes-Cd6aEpRT.js} +5 -5
- package/dist/assets/{DashboardRoutes-BGmqy8sI.js → DashboardRoutes-BqteLe-_.js} +3 -3
- package/dist/assets/{DefaultTenantHome-dUxiOroS.js → DefaultTenantHome-BmKNJTAE.js} +1 -1
- package/dist/assets/DomesticWireDetailScreen-ByI1UAeb.js +18 -0
- package/dist/assets/DrawerScreen-CVn6NI6C.js +1 -0
- package/dist/assets/{EntityDetailRoutes-VUYCsTyx.js → EntityDetailRoutes-CJCW4lau.js} +1 -1
- package/dist/assets/{ExpenseAutomationRoutes-Baf_deUk.js → ExpenseAutomationRoutes-Bw8DwzWR.js} +3 -3
- package/dist/assets/FeaturePreviewScreen-D7L8dftQ.js +1 -0
- package/dist/assets/{HubSpotOAuthCallbackScreen-DLXvcbO1.js → HubSpotOAuthCallbackScreen-BhR_n_gC.js} +1 -1
- package/dist/assets/MagicLinkRoutes-GquONAuy.js +72 -0
- package/dist/assets/MagicLinkSignInScreen-D99xSkpp.js +12 -0
- package/dist/assets/{MobileAppDrawer-BzOopfIc.js → MobileAppDrawer-CzOm0Sxs.js} +1 -1
- package/dist/assets/NotFoundScreen-D51sUkWb.js +1 -0
- package/dist/assets/{NotificationRoutes-BfWTxi_L.js → NotificationRoutes-Bk-3HBBq.js} +1 -1
- package/dist/assets/OAuthConsentScreen-CnnMYT9D.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-Cmu8H8NO.js +1 -0
- package/dist/assets/{PeopleRoutes-Cd2xa-tF.js → PeopleRoutes-BW2q_Dmg.js} +4 -4
- package/dist/assets/PerformanceRoutes-B6NZ0t5W.js +1 -0
- package/dist/assets/{Preview-BBgrn4cd.js → Preview-L8h-Ibqx.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-DiXbUmxS.js → QBOConnectionScreen-BTT5tOv0.js} +1 -1
- package/dist/assets/{ReferralListScreen-BFHfgY0C.js → ReferralListScreen-xE93Ck03.js} +2 -2
- package/dist/assets/{ReimbursementApprovalRoutes-BYBFJrYx.js → ReimbursementApprovalRoutes-D2Kon39b.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-DiIBy_Kn.js → ReimbursementApprovalRuleDetailScreen-CEzdk50o.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-Byj4p7dn.js → ReimbursementRoutes-BJgLWv6y.js} +4 -4
- package/dist/assets/{ReportsRoutes-urJtOHDo.js → ReportsRoutes-ImAHwLCG.js} +1 -1
- package/dist/assets/RewardsRoutes-BQc5zm_c.js +1 -0
- package/dist/assets/{ScreenRoutes-DgHGyuTa.js → ScreenRoutes-BSFeQNd5.js} +2 -2
- package/dist/assets/{SettingsRoutes-B9XEOz3c.js → SettingsRoutes-CAmtpUik.js} +1 -1
- package/dist/assets/{SetupPagesScreen-DiqU6iZv.js → SetupPagesScreen-BEBa0Bcm.js} +4 -4
- package/dist/assets/SignInScreen-CoLktDu5.js +1 -0
- package/dist/assets/{SignOutScreen-BcKxVgCr.js → SignOutScreen-DR8PJ_Dr.js} +1 -1
- package/dist/assets/{TaskListScreen-CIIrTWF0.js → TaskListScreen-B0DRrcBn.js} +2 -2
- package/dist/assets/{TaskRoutes-C3BwKdkV.js → TaskRoutes-46kHJnwt.js} +2 -2
- package/dist/assets/{TransactionDetailRoutes-L60jmvh4.js → TransactionDetailRoutes-B7idB5XF.js} +1 -1
- package/dist/assets/{TransactionDetailScreen-BHKf3UvG.js → TransactionDetailScreen-DhBRM2u-.js} +2 -2
- package/dist/assets/{TransactionListRoutes-B8V8eaVr.js → TransactionListRoutes-Bmu0vt6n.js} +1 -1
- package/dist/assets/{TreasuryRoutes-BIv9NJIQ.js → TreasuryRoutes-BqzqJLAw.js} +5 -5
- package/dist/assets/{VendorsRoutes-CInyDoSC.js → VendorsRoutes-DnOFtiAo.js} +1 -1
- package/dist/assets/WiseConfirmationScreen-f5jOSttP.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-CbhJXy_a.js → ZeniAccountRoutes-Bl_KyIZU.js} +13 -13
- package/dist/assets/ZeniAccountStatementScreen-BhYmNPRG.js +9 -0
- package/dist/assets/{accountMappingHelper-DoYWzqd9.js → accountMappingHelper-BwC4ZXQT.js} +1 -1
- package/dist/assets/{analytics-DVTbnjlr.js → analytics-BpWjaxbv.js} +1 -1
- package/dist/assets/{analyticsHelper-CfMFPPIh.js → analyticsHelper-B5EDEZrW.js} +1 -1
- package/dist/assets/{core-k_c8SCBE.js → core-Cj3sxYL7.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-ClSfwHJC.js → decodeURIComponentSafe-CyYkfiHv.js} +1 -1
- package/dist/assets/{dnd-CKEs-Nbe.js → dnd-WLAr-qfO.js} +1 -1
- package/dist/assets/{empty-rBU__xZH.js → empty-DFc-bsca.js} +1 -1
- package/dist/assets/{empty-CaaFsHZq.js → empty-rEpgHEWF.js} +1 -1
- package/dist/assets/{emptyVideoElement-BiPjnR5F.js → emptyVideoElement-ClAxGPrQ.js} +1 -1
- package/dist/assets/{epic-BY3t4hzo.js → epic-B2EfNSKx.js} +1 -1
- package/dist/assets/getLocaleForTenant-DI_-EIej.js +1 -0
- package/dist/assets/{index-C9JBC9EP.js → index-2KyAy7Zy.js} +1 -1
- package/dist/assets/{index-B0M_M2si.js → index-B5wYRZoC.js} +1 -1
- package/dist/assets/{index-B4wUHn-k.js → index-BHgTWK3A.js} +1752 -1762
- package/dist/assets/{index-D7n4W-6R.js → index-BW1XqAyr.js} +1 -1
- package/dist/assets/{index-CrxfuqRy.js → index-BftEKN_-.js} +2 -2
- package/dist/assets/{index-CBl-jehm.js → index-BhXRaXnd.js} +1 -1
- package/dist/assets/{index-_Ds-L3qG.js → index-DUBqop-_.js} +1 -1
- package/dist/assets/{index-CAPOi0Fj.js → index-e7I5m4bW.js} +1 -1
- package/dist/assets/{lexical-k-PQZXkn.js → lexical--OluaPRa.js} +1 -1
- package/dist/assets/{liveblocks-D3ESVZyk.js → liveblocks-DmbDY3sa.js} +1 -1
- package/dist/assets/{lottie-BYni7Ovk.js → lottie-W8sR2m8i.js} +1 -1
- package/dist/assets/{mui-UJrLjp1k.js → mui-1V4hRqCa.js} +1 -1
- package/dist/assets/{pathToGoBack-D0Z5Ycmy.js → pathToGoBack-PTW4YbNu.js} +1 -1
- package/dist/assets/{pdf-CaeTpLUv.js → pdf-aJCOHARS.js} +3 -3
- package/dist/assets/{pdf-lib-Cgly_u4z.js → pdf-lib-ovfXHDuI.js} +1 -1
- package/dist/assets/{plaid-B1j5PXHV.js → plaid-JtkXopjw.js} +1 -1
- package/dist/assets/{pusher-IzmLENf0.js → pusher-CHPQmkEo.js} +1 -1
- package/dist/assets/{react-RV2byy3l.js → react-6mQxD1Me.js} +1 -1
- package/dist/assets/{react-BPazXlgj.js → react-BdMLdzsp.js} +1 -1
- package/dist/assets/{react-BhDdWL-M.js → react-CA6ko42q.js} +1 -1
- package/dist/assets/{react-Cbn9UGi3.js → react-CU-y_lik.js} +1 -1
- package/dist/assets/{react-iNsCZPRe.js → react-Ch-GNhUs.js} +1 -1
- package/dist/assets/{react-D9CNJCXY.js → react-GL1Pyhji.js} +1 -1
- package/dist/assets/{recharts-Q-kkTNuO.js → recharts-mFhBBFnU.js} +1 -1
- package/dist/assets/{routePaths-ooqctjvV.js → routePaths-CKR4MRfB.js} +1 -1
- package/dist/assets/{sentry-B_92GPgU.js → sentry--Yi43Gx7.js} +1 -1
- package/dist/assets/{url-CGw_V4gG.js → url-10vNaoth.js} +1 -1
- package/dist/assets/{url-DLQKrj-e.js → url-C6HCkI0M.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-Cx3WWldL.js → useAiCfoDashboardSuggestedQuestionsChips-C8eUPCD2.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-DvB8uvB7.js +1 -0
- package/dist/assets/useCashManagementBanner-WDwkWALo.js +1 -0
- package/dist/assets/{useDeviceId-BE1s-3Wf.js → useDeviceId-n-Ow0WdN.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-C_cJhQDA.js → useInitialThreadRequest-ITLu-S1Q.js} +1 -1
- package/dist/assets/{utils-Mjhh9T8E.js → utils-Bt5dYICv.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-3cc8um6s.js → withTransactionSidePanel-txS5Vf1E.js} +2 -2
- package/dist/assets/{zeni-epic-state-C3zBO1No.js → zeni-epic-state-BG_x9wwl.js} +5 -5
- package/dist/index.html +1 -1
- package/package.json +3 -3
- package/dist/assets/AddressRoutes-odXkPzQ0.js +0 -1
- package/dist/assets/AddressScreen-BJ-IOcKb.js +0 -9
- package/dist/assets/CompanyPassportScreen-CrpUoXvt.js +0 -1
- package/dist/assets/CustomerOnboardingAuthScreen-CDJwl_XS.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-BA2EKhEI.js +0 -18
- package/dist/assets/DrawerScreen-BSfM66hM.js +0 -1
- package/dist/assets/FeaturePreviewScreen-DoKDdD4M.js +0 -1
- package/dist/assets/MagicLinkRoutes-NK00hAHs.js +0 -72
- package/dist/assets/MagicLinkSignInScreen-DnxlEFNW.js +0 -12
- package/dist/assets/NotFoundScreen-6vyCFr5S.js +0 -1
- package/dist/assets/OAuthConsentScreen-DKtWI-tp.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-DgT8jx_6.js +0 -1
- package/dist/assets/PerformanceRoutes-xYB_POFo.js +0 -1
- package/dist/assets/RewardsRoutes-CHiDiriW.js +0 -1
- package/dist/assets/SignInScreen-DqVi8QMM.js +0 -1
- package/dist/assets/WiseConfirmationScreen-DmiV73IN.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-BuDvio8F.js +0 -9
- package/dist/assets/getLocaleForTenant-CTwYyvWj.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-BJGg886y.js +0 -1
- package/dist/assets/useCashManagementBanner-Cjm3Ayi5.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./liveblocks-DmbDY3sa.js";import{A as d}from"./AddressScreen-DzlfvttE.js";import i from"./NotFoundScreen-D51sUkWb.js";import"./sentry--Yi43Gx7.js";import{o as s,p as r}from"./core-Cj3sxYL7.js";import"./zeni-epic-state-BG_x9wwl.js";import"./recharts-mFhBBFnU.js";import"./index-BHgTWK3A.js";import"./mui-1V4hRqCa.js";import"./analytics-BpWjaxbv.js";import"./plaid-JtkXopjw.js";import"./dnd-WLAr-qfO.js";import"./stripe-DMRn4zHo.js";import"./lottie-W8sR2m8i.js";import"./lexical--OluaPRa.js";import"./pdf-aJCOHARS.js";import"./utils-Bt5dYICv.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="cd0ff2b4-1e27-4329-addf-f475e5a9db34",t._sentryDebugIdIdentifier="sentry-dbid-cd0ff2b4-1e27-4329-addf-f475e5a9db34")}catch{}})();function _(){return e.jsxs(s,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(d,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(d,{})}),e.jsx(r,{path:"*",element:e.jsx(i,{})})]})}export{_ as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{j as r}from"./liveblocks-DmbDY3sa.js";import{a as h}from"./sentry--Yi43Gx7.js";import{h as T,u as _,g as j,i as M,j as E,n as B}from"./core-Cj3sxYL7.js";import{K as $,m as D,z as K,j as L,B as R,A as z,c as C,e as S,k as F,h as b,n as N}from"./index-BHgTWK3A.js";import{Ml as k,hP as U,eW as G,Mm as O,c7 as V,Mn as q,l8 as H}from"./zeni-epic-state-BG_x9wwl.js";import{n as W}from"./mui-1V4hRqCa.js";import J from"./NotFoundScreen-D51sUkWb.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]="47fbef4e-0ebd-40df-8adb-3f9ed1436452",e._sentryDebugIdIdentifier="sentry-dbid-47fbef4e-0ebd-40df-8adb-3f9ed1436452")}catch{}})();const Q=W.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=B(function(e,t){const{addressId:o,isSubPage:i,addressType:c}=t,l=G(e),a=t.roleMap!=null&&O(t.roleMap),d=i||c==="user_address"||V(l?.userRole??[])||a?void 0:"readonly";if(o==null){const s=q(c,e);return{addressToEdit:s?.addressToCreate,loadingState:s?.status?.fetchState,googleAPIKey:b.googleMapsAPIKey,isDisabled: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=N(d?.pathnameStackToGoBack);let s=n.poppedPathname??w();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(H({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)}}})(F);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}=M(),f=$(),A=D(),I=K.getSignedInUser(),[g,v]=h.useState(s==null),p=E(m=>s!=null?k(m,s).fetchState:"Not-Started"),x=L();if(I==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(R,{fetchState:p,style:{backgroundColor:A.colors.grey5}}):s!=null&&p==="Error"?(a(`${w(1)}/new`,{replace:!0}),r.jsx(r.Fragment,{})):r.jsxs(r.Fragment,{children:[r.jsx(z,{analytics:C,onLoad:P}),r.jsx(Q,{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:x?.loggedInUserRoleMap})})]}):r.jsx(J,{})}const w=(e=2)=>{let t="../";for(let o=0;o<e;o++)t=`${t}../`;return t},Y=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng});export{re as A,Y as t};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import{j as d}from"./liveblocks-
|
|
1
|
+
import{j as d}from"./liveblocks-DmbDY3sa.js";import{a as l}from"./sentry--Yi43Gx7.js";import{u as ge,h as Ce,g as Ie,j as K,i as ke,n as be}from"./core-Cj3sxYL7.js";import{W as we,z as xe,K as Pe,d9 as Ee,da as ye,b6 as X,db as Te,b5 as Y,n as D,A as F,c as I,dc as L,dd as ve,de as Qe,a1 as _e,e as Ae,a7 as Oe,df as je,a2 as Ue,dg as Fe,dh as Le,r as Be,b1 as De,di as Re}from"./index-BHgTWK3A.js";import{gk as Me,eV as ee,eW as Ge,iv as Ve,Ts as $e,f0 as Ne,iF as qe,iB as We,eX as B,f7 as ze,fZ as He,fC as Ke,fG as Z,f_ as Xe,f$ as Ze,g0 as Je,g1 as Ye,g2 as et}from"./zeni-epic-state-BG_x9wwl.js";import{D as tt,n as k,S as st,P as ot}from"./mui-1V4hRqCa.js";import{u as at}from"./useAiCfoDashboardSuggestedQuestionsChips-C8eUPCD2.js";import{p as nt}from"./pathToGoBack-PTW4YbNu.js";import"./recharts-mFhBBFnU.js";import"./analytics-BpWjaxbv.js";import"./plaid-JtkXopjw.js";import"./dnd-WLAr-qfO.js";import"./stripe-DMRn4zHo.js";import"./lottie-W8sR2m8i.js";import"./lexical--OluaPRa.js";import"./pdf-aJCOHARS.js";import"./utils-Bt5dYICv.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new t.Error().stack;r&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[r]="9c632d24-86a1-4617-bf8e-e5e613a29380",t._sentryDebugIdIdentifier="sentry-dbid-9c632d24-86a1-4617-bf8e-e5e613a29380")}catch{}})();const te="chat-response-generated",it=be(function(t,r){const s=ee(t),m=r.isSubmitting,n=s.uiState?.currentChatSessionId,p=n!=null?ze(t.aiCfoState,n):[];return{showSampleQuestions:r.sessionFromUrl==="explore"&&s.uiState.currentChatSessionId==null,aiCfoView:s,isSubmitting:m,isNewChatSession:r.sessionFromUrl==="new_chat"||r.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${Ue}/tableDownload`,emailLinkQuestion:r.emailLinkQuestion,autoSubmitEmailLinkQuestion:r.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:r.onEmailLinkQuestionProcessed,routedInitialQuestionSource:r.routedInitialQuestionSource,routedInitialQuestionSuggestionIndex:r.routedInitialQuestionSuggestionIndex,exploreSuggestedPromptQuestions:r.exploreSuggestedPromptQuestions,exploreSuggestedPromptQuestionsLoading:r.exploreSuggestedPromptQuestionsLoading,isFileUploadEnabled:r.isFileUploadEnabled,isUploadPromoVisible:r.isUploadPromoVisible,onUploadPromoClose:r.onUploadPromoClose,syntheticAnswers:p,resolveSyntheticAnswerCardTile:Le(t),resolveSyntheticAnswerPolicyTile:Fe(t)}},function(t,r){const{location:s,currentTenant:m,userId:n,navigate:p,currentChatSessionId:S,allSessionsWithOrderedQuestionAnswers:c,setIsAiCfoOpen:f}=r;return{onEventReceived:(e,h)=>{if(e===te&&typeof h.text=="string"&&typeof h.metadata=="object"){const a=h,u=Ze(a.type),o=a.metadata.chat_session_id??null,{currentChatSession:E,currentQuestionAnswer:b,currentQuestionAnswerSummary:y}=Y(c,o);u!=="answer"?I.trackAICFOChatResponseGenerated(u,b?.question.questionText??"",a.text,o,Re(y,E),a.metadata.message_id??null):I.trackAICFOChatAnswerGenerated(a.text,b?.question.questionText??"",(a.follow_up_questions?.length??0)>0,!!a.assumptions,!!a.insights,a.visualization!=null,Je(a.visualization?.type??"")??null,o,a.summarized_title,a.metadata.message_id??null),t(Ye({chatSessionId:a.metadata.chat_session_id,responseType:u,fetchState:{fetchState:"Completed",error:void 0}})),t(et({chatSessionId:a.metadata.chat_session_id,answerPayload:a,userId:n}))}},onSubmit:(e,h,a,u)=>{e&&De(t,e,h,S,c,n,u,a)},updateCurrentInput:e=>{t(Z(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{t(Xe(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{p(-1)},onCloseClick:()=>{const e=D(s.state?.pathnameStackToGoBack),h=e.poppedPathname??nt(1);p(h,{state:{...s.state,pathnameStackToGoBack:e.newStack}}),t(Z(""))},togglePageView:()=>{const e=D(s.state?.pathnameStackToGoBack),h=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;p(h,{state:{...s.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),f(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{p(-1)},onNewChatClick:()=>{S!=null&&t(Ke());const e=Be(s.state?.pathnameStackToGoBack,s.pathname);p(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,h)=>{t(He({questionAnswerId:e,isCollapsed:h}))},onMenuClick:r.onMenuClick}})(Oe(je)),vt=({isFileUploadEnabled:t})=>{const{setIsAiCfoOpen:r}=we(),s=ge(),m=Ce(),n=Ie(),[p,S]=l.useState(!1);l.useEffect(()=>{s(Me())},[s]);const c=K(i=>ee(i)),f=xe.getSignedInUser(),{session_id:e}=ke(),h=Pe(),a=_e(h),u=K(i=>Ge(i)),o=c.uiState.currentChatSessionId,E=u.tenantEmailDomain,{handleUploadPromoClose:b,isUploadPromoVisible:y}=Ee({isFileUploadEnabled:t,tenantEmailDomain:E}),T=ye({currentTenant:u,currentChatSessionId:o,aiCfoView:c}),{isSuggestedQuestionsLoading:se,suggestedPromptQuestions:oe}=at(),w=n.state,x=w?.aiCfoInitialQuestion,R=!!w?.aiCfoShouldSubmit;l.useEffect(()=>{const i=n.state;if(i?.[X]!==!0)return;S(!0);const g={...i};delete g[X],m(n,{replace:!0,state:g})},[n.pathname,n.search,n.state,m]);const[ae,v]=l.useState(null),[ne,Q]=l.useState(!1),[ie,_]=l.useState(void 0),[re,A]=l.useState(void 0),M=l.useRef(!1);l.useEffect(()=>{if(!M.current&&x!=null&&x!==""){const i=n.state;v(x),Q(R),_(i?.aiCfoInitialSubmissionSource!=null?i.aiCfoInitialSubmissionSource:void 0);const g=i?.aiCfoSuggestionIndex;A(typeof g=="number"?g:void 0),M.current=!0}},[x,R,n.state]);const le=l.useCallback(()=>{v(null),Q(!1),_(void 0),A(void 0)},[]),G=l.useMemo(()=>new URLSearchParams(n.search),[n.search]),V=G.get("ref")??w?.aiCfoRef,O=G.get("emailRefId")??w?.aiCfoEmailRefId,$=l.useRef(!1);l.useEffect(()=>{$.current||V!=="month-end-email"||O==null||o!=null||f==null||(s(Ve("controller",f.userId,O,"MONTH_END_EMAIL")),$.current=!0)},[V,O,o,s,f]);const P=c.uiState.lastContextMessage;l.useEffect(()=>{P!=null&&P!==""&&o!=null&&(v(P),Q(!0),_(void 0),A(void 0),s($e()))},[P,o,s]);const de=u.masterTOSInfo,C=de?.isMasterTOSAccepted??!1,{visitedSessions:N}=Te(o),j=c.fetchState,U=c.uiState.chatSessionsNextPageToken.hasMore||!c.uiState.chatSessionsFirstPageFetched,q=o!=null?c.fetchChatSessionHistoryByChatSessionId?.[o]?.fetchState??"Not-Started":"Not-Started",W=o==null||(c.uiState.chatHistoryNextPageToken[o]?.hasMore??!0),z=c.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:ue}=Y(z,o),ce=ue.length===0;l.useEffect(()=>{C||a||m("../dashboard",{state:{...n.state,message:"open_ai_cfo_drawer"}})},[C,a,m,n.state]);const me=l.useCallback(()=>{const i=D(n.state?.pathnameStackToGoBack),g=u.tenantEmailDomain;m(i.poppedPathname??(g!=null?`/${g}/dashboard`:".."),{state:{...n.state,pathnameStackToGoBack:i.newStack}})},[u.tenantEmailDomain,n.state,m]);l.useEffect(()=>{o!=null&&e!==o&&m(`../ai-cfo/${o}`,{state:{...n.state}})},[o,e]),l.useEffect(()=>{e!=null&&o==null&&e!=="new_chat"&&e!=="explore"&&s(Ne({sessionId:e,agentId:"controller"}))},[]);const pe=l.useMemo(()=>({events:N.map(i=>`private-encrypted-chat-${i}.${te}`),eventCallback:(i,g,fe)=>fe.onEventReceived(i,g)}),[N]);l.useEffect(()=>{j!=="In-Progress"&&U&&s(qe())},[j,U,s]),l.useEffect(()=>{o!=null&&q!=="In-Progress"&&W&&f!=null&&j==="Completed"&&!U&&s(We(o,f.userId))},[q,W,o,f,s]);const H=i=>i.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(f==null||e==null)throw Error("Can't access AI Controller page without signing in...");const he=o!=null&&c.responseStateByChatSessionId?.[o]?.answer?.fetchState==="In-Progress";if(!C&&a)return d.jsxs(lt,{children:[d.jsx(F,{analytics:I,onLoad:H}),T.drawerElement,d.jsx(dt,{children:d.jsx(J,{children:d.jsx(L,{isTOSAccepted:!1,acceptMasterTOSState:c.masterTOSAcceptanceState,onCloseClick:me,onCompleteClick:()=>{u.userRoleId!=null&&s(B(u.userRoleId))}})})})]});const Se=d.jsxs(d.Fragment,{children:[p&&!C?d.jsx(F,{analytics:I,onLoad:H}):null,d.jsx(L,{isTOSAccepted:C,acceptMasterTOSState:c.masterTOSAcceptanceState,showHeader:!1,togglePageView:C?()=>S(!1):void 0,onCloseClick:()=>S(!1),onCompleteClick:()=>{C||u.userRoleId==null||s(B(u.userRoleId)),S(!1)}})]});return d.jsxs(d.Fragment,{children:[d.jsxs(rt,{children:[d.jsx(F,{analytics:I,onLoad:i=>i.trackPageLoaded(Ae.Event.aiCFOPage)}),a&&T.drawerElement,d.jsx(it,{...pe,currentChatSessionId:o,allSessionsWithOrderedQuestionAnswers:z,openOnboardingPage:()=>S(!0),userId:f.userId,setIsAiCfoOpen:r,navigate:m,sessionFromUrl:e,location:n,isSubmitting:he,isEmptyChatWithSession:ce,currentTenant:u,emailLinkQuestion:ae??void 0,autoSubmitEmailLinkQuestion:ne,onEmailLinkQuestionProcessed:le,routedInitialQuestionSource:ie,routedInitialQuestionSuggestionIndex:re,onMenuClick:a?T.open:void 0,isFileUploadEnabled:t,isUploadPromoVisible:y,onUploadPromoClose:b,exploreSuggestedPromptQuestions:oe,exploreSuggestedPromptQuestionsLoading:se}),p&&a?d.jsx(tt,{anchor:"right",open:p,transitionDuration:250,PaperProps:{component:ut,style:{width:"100%"}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>S(!1),children:d.jsx(J,{onClick:i=>i.stopPropagation(),children:d.jsx(L,{isTOSAccepted:C,acceptMasterTOSState:c.masterTOSAcceptanceState,onCloseClick:()=>S(!1),onCompleteClick:()=>{C||u.userRoleId==null||s(B(u.userRoleId)),S(!1)}})})}):null]}),p&&!a?d.jsx(ve,{open:p,onClose:()=>S(!1),children:d.jsx(Qe,{children:Se})}):null]})},J=k(st)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|
|
5
|
-
`,rt=
|
|
5
|
+
`,rt=k.div`
|
|
6
6
|
height: 100vh;
|
|
7
7
|
width: 100%;
|
|
8
|
-
`,lt=
|
|
8
|
+
`,lt=k.div`
|
|
9
9
|
height: 100vh;
|
|
10
10
|
width: 100%;
|
|
11
11
|
display: flex;
|
|
12
12
|
flex-direction: column;
|
|
13
13
|
min-height: 0;
|
|
14
|
-
`,dt=
|
|
14
|
+
`,dt=k.div`
|
|
15
15
|
flex: 1;
|
|
16
16
|
min-height: 0;
|
|
17
17
|
display: flex;
|
|
18
18
|
flex-direction: column;
|
|
19
|
-
`,ut=
|
|
19
|
+
`,ut=k(ot)`
|
|
20
20
|
box-shadow: ${({theme:t})=>t.colors.elevation2};
|
|
21
21
|
color: ${({theme:t})=>t.colors.grey4};
|
|
22
22
|
`;export{vt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as c}from"./liveblocks-D3ESVZyk.js";import{a as v}from"./sentry-B_92GPgU.js";import{h as B,g as j,u as P,j as y,N as q,n as U,i as K,o as ee,p as C}from"./core-k_c8SCBE.js";import{eW as k,PD as A,Pj as g,zf as E,z3 as J,zb as R,yZ as Z,Pl as G,z0 as te,z4 as H,zh as M,zg as D}from"./zeni-epic-state-C3zBO1No.js";import{m as O,z as V,B as T,a7 as Q,bI as ae,af as _,bz as X,bJ as oe,bK as le,bL as pe}from"./index-B4wUHn-k.js";import"./mui-UJrLjp1k.js";import{i as se}from"./ReimbursementApprovalRuleDetailScreen-DiIBy_Kn.js";import re from"./NotFoundScreen-6vyCFr5S.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},p=new e.Error().stack;p&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[p]="15370c6a-8e77-4b0f-ba16-4832451bac94",e._sentryDebugIdIdentifier="sentry-dbid-15370c6a-8e77-4b0f-ba16-4832451bac94")}catch{}})();const N="bill-approval-rule-update",ne=U(function(e){return{approvalView:A(e),billPaySetupApproverViewUpdateData:g(e).billPaySetupApproverViewUpdateData}},function(e,p){const{navigate:t,location:s}=p;return{onApprovalRulesEventReceived:a=>{a.endsWith(N)&&e(G(!1))},onBackClick:()=>{_(s)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(Z(a,!1))},onEditRuleClick:a=>{a!=null?(e(R(a)),t(`./${a}/edit`)):(e(R()),t("./new"))}}})(Q(ae)),ie=()=>{const e=B(),p=j(),t=P(),[s,a]=v.useState(!1),[i,r]=v.useState(!1),d=O(),o=y(l=>l.billPaySetupApproverViewState.fetchState),u=y(l=>k(l)),n=y(l=>A(l)),f=y(l=>g(l).billPaySetupApproverViewUpdateData);if(v.useEffect(()=>{f?.updateStatus.fetchState==="Completed"&&t(E())},[f]),v.useEffect(()=>{s||o!=="Not-Started"||(a(!0),t(J(!0,!0,!1)))},[s,o,t]),V.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");v.useEffect(()=>{n.allApprovalRules.length===0&&n.fetchState==="Completed"&&(i||(r(!0),t(R())),e("./new"))},[i,n,t]);const m={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${N}`]:[],eventCallback:(l,w,h)=>{l.endsWith(N)&&h.onApprovalRulesEventReceived(l)}};return u.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?c.jsx(q,{to:"../../promo"}):u.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||n.fetchState!=="Completed"&&n.fetchState!=="Error"?c.jsx(T,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):c.jsx(ne,{currentTenant:u,location:p,navigate:e,...m})},F="bill-approval-rule-update",ce=U(function(e){const p=A(e),t=g(e).billPaySetupApproverViewUpdateData,s={};for(const i of Object.values(e.contactState.contactById))i?.id!=null&&(s[i.id]=i.fullName);const a={};for(const i of Object.values(e.classState.classesByKey))i?.classId!=null&&(a[i.classId]=i.className);return{approvalView:p,billPaySetupApproverViewUpdateData:t,vendorNamesById:s,departmentNamesById:a}},function(e,p){const{navigate:t,location:s}=p;return{onApprovalRulesEventReceived:a=>{a.endsWith(F)&&e(G(!1))},onBackClick:()=>{_(s)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(Z(a,!0))},onEditRuleClick:a=>{a!=null?(e(R(a)),t(`./${a}/edit`)):(e(R()),t("./new"))},onReorderRules:a=>{e(te(a,!0))}}})(Q(oe)),ue=()=>{const e=y(t=>k(t)),{isApprovalRulesV3Enabled:p}=X(e?.tenantId);return p?c.jsx(de,{}):c.jsx(ie,{})},de=()=>{const e=B(),p=j(),t=P(),[s,a]=v.useState(!1),[i,r]=v.useState(!1),d=O(),o=y(l=>l.billPaySetupApproverViewState.fetchState),u=y(l=>k(l)),n=y(l=>A(l)),f=y(l=>g(l).billPaySetupApproverViewUpdateData);if(v.useEffect(()=>{f?.updateStatus.fetchState==="Completed"&&t(E())},[f]),v.useEffect(()=>{s||o!=="Not-Started"||(a(!0),t(J(!0,!0,!0)))},[s,o,t]),V.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");v.useEffect(()=>{n.allApprovalRules.length===0&&n.fetchState==="Completed"&&(i||(r(!0),t(R())),e("./new"))},[i,n,t]);const m={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${F}`]:[],eventCallback:(l,w,h)=>{l.endsWith(F)&&h.onApprovalRulesEventReceived(l)}};return u.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?c.jsx(q,{to:"../../promo"}):u.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||n.fetchState!=="Completed"&&n.fetchState!=="Error"?c.jsx(T,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):c.jsx(ce,{currentTenant:u,location:p,navigate:e,...m})},ve=U(function(e,p){const t=g(e),s=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=s==="approval_create"&&t.allApprovalRules.length!==0;let i=t.allApprovalRules.length===0;return p.approvalRuleId&&(i=t.allApprovalRules.findIndex(r=>r.approvalRuleId===p.approvalRuleId)===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:i,approvalUpdateActionType:s}},function(e,p){const{navigate:t,approvalUpdateDataView:s,approverViewData:a,approvalRuleId:i}=p,r=s.billPaySetupApproverViewUpdateData?.type,d=_(p.location);return{onApprovalRuleDataUpdated:o=>{const u=f=>{const m=[];return f.forEach(l=>{const w=l.actors.selectedUsers.map(b=>({type:"user",userId:b.userId,isImplicitActor:!1})),h=l.actors.selectedNonUsers.map(b=>{const I=!!se(b.value);return{type:I?"attribute":"role",subType:b.value,userId:void 0,idType:void 0,isImplicitActor:!I}}),S=w.concat(h);m.push({action:l.stepType.selectedOption,actors:S,operator:S.length>1?l.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),m},n={amount:{type:"amount",comparator:"range",min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const f={criteria:n,steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingBills.includes("applyToExistingBills")};e(D(f))}else{const f={approvalRuleId:i,criteria:n,steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingBills.includes("applyToExistingBills")};e(D(f))}},onResetClick:()=>{e(E()),r==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),r==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(M(!1))},onSaveRuleSuccess:()=>{t("../")}}})(le);function fe(){const e=B(),p=P(),t=j(),{approvalRuleId:s}=K(),a=V.getSignedInUser(),i=O(),r=y(n=>g(n)),d=y(n=>A(n)),[o,u]=v.useState(!1);if(v.useEffect(()=>{o||(u(!0),p(H(!0)))}),v.useEffect(()=>{d.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[d,s]),a==null)throw Error("Can't access address page without signing in...");return r.approverListFetchStatus.fetchState=="Not-Started"||r.approverListFetchStatus.fetchState==="In-Progress"?c.jsx(T,{fetchState:r.approverListFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):c.jsx(ve,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:d,location:t})}const ye=U(function(e,p){const t=g(e),s=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=[],i={};for(const r of Object.values(e.contactState.contactById))r?.id!=null&&(a.push(r.id),i[r.id]=r.fullName);return{localData:t,approvalUpdateActionType:s,allVendorIds:a,vendorNamesById:i,editingRuleId:s==="approval_update"?p.approvalRuleId:void 0,allApprovalRulesWithUser:A(e).allApprovalRules}},function(e,p){const{navigate:t,approvalUpdateDataView:s,approverViewData:a,approvalRuleId:i}=p,r=s.billPaySetupApproverViewUpdateData?.type,d=_(p.location);return{onApprovalRuleDataUpdated:o=>{const u=S=>{const b=[];return S.forEach(I=>{const $=I.actorKind?.selectedOption,z=I.selectedRole?.selectedOption;let x=[];$==="role"&&z!=null?x=[{type:"attribute",subType:z,userId:void 0,idType:void 0,isImplicitActor:!1}]:$==="specific_person"&&(x=(I.persons?.selectedUsers??[]).map(Y=>({type:"user",userId:Y.userId,isImplicitActor:!1})));const L=I.action??"require_approval";b.push({action:L,actors:x,operator:x.length>1?L==="require_approval"?"or":"and":"is"})}),b},n=o.amountCriteria,f=o.vendorCriteria,m=o.departmentCriteria,l={};if(n!=null&&n.comparator.selectedOption!=null){const S=n.comparator.selectedOption;l.amount={type:"amount",comparator:S,min:S==="less_than"?void 0:n.min,max:S==="greater_than"?void 0:n.max}}const w=f?.selection.selectedOptions??[];w.length>0&&(l.vendor={type:"vendor",operator:f?.operator.selectedOption??"is",vendorIds:w});const h=m?.selection.selectedOptions??[];if(h.length>0&&(l.department={type:"department",operator:m?.operator.selectedOption??"is",departmentIds:h}),r==="approval_create"){const S={name:o.name,description:o.description,separationOfDuties:o.separationOfDuties,isFallback:o.isFallback,criteria:l,steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingBills.includes("applyToExistingBills")};e(D(S))}else{const S={approvalRuleId:i,name:o.name,description:o.description,separationOfDuties:o.separationOfDuties,isFallback:o.isFallback,criteria:l,steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingBills.includes("applyToExistingBills")};e(D(S))}},onResetClick:()=>{e(E()),r==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),r==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(M(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:o=>{e(R(o)),t(r==="approval_update"?`../../${o}/edit`:`../${o}/edit`)}}})(pe);function W(){const e=y(t=>k(t)),{isApprovalRulesV3Enabled:p}=X(e?.tenantId);return p?c.jsx(Se,{}):c.jsx(fe,{})}function Se(){const e=B(),p=P(),t=j(),{approvalRuleId:s}=K(),a=V.getSignedInUser(),i=O(),r=y(n=>g(n)),d=y(n=>A(n)),[o,u]=v.useState(!1);if(v.useEffect(()=>{o||(u(!0),p(H(!0)))}),v.useEffect(()=>{d.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[d,s]),a==null)throw Error("Can't access address page without signing in...");return r.approverListFetchStatus.fetchState=="Not-Started"||r.approverListFetchStatus.fetchState==="In-Progress"?c.jsx(T,{fetchState:r.approverListFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):c.jsx(ye,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:d,location:t},s??"new")}function Ee(){return c.jsxs(ee,{children:[c.jsx(C,{path:"/",element:c.jsx(ue,{})}),c.jsx(C,{path:"/new",element:c.jsx(W,{})}),c.jsx(C,{path:"/:approvalRuleId/edit",element:c.jsx(W,{})}),c.jsx(C,{path:"*",element:c.jsx(re,{})})]})}export{Ee as B};
|
|
1
|
+
import{j as c}from"./liveblocks-DmbDY3sa.js";import{a as v}from"./sentry--Yi43Gx7.js";import{h as B,g as j,u as P,j as y,N as q,n as U,i as K,o as ee,p as C}from"./core-Cj3sxYL7.js";import{eW as k,PD as A,Pj as g,zc as E,z4 as J,z8 as R,yZ as Z,Pl as G,ze as te,z0 as H,zh as M,zd as D}from"./zeni-epic-state-BG_x9wwl.js";import{m as O,z as V,B as T,a7 as Q,bI as ae,af as _,bz as X,bJ as oe,bK as le,bL as pe}from"./index-BHgTWK3A.js";import"./mui-1V4hRqCa.js";import{i as se}from"./ReimbursementApprovalRuleDetailScreen-CEzdk50o.js";import re from"./NotFoundScreen-D51sUkWb.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},p=new e.Error().stack;p&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[p]="2f0e600b-b782-48b4-a04e-a3b7d7ed0043",e._sentryDebugIdIdentifier="sentry-dbid-2f0e600b-b782-48b4-a04e-a3b7d7ed0043")}catch{}})();const N="bill-approval-rule-update",ne=U(function(e){return{approvalView:A(e),billPaySetupApproverViewUpdateData:g(e).billPaySetupApproverViewUpdateData}},function(e,p){const{navigate:t,location:s}=p;return{onApprovalRulesEventReceived:a=>{a.endsWith(N)&&e(G(!1))},onBackClick:()=>{_(s)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(Z(a,!1))},onEditRuleClick:a=>{a!=null?(e(R(a)),t(`./${a}/edit`)):(e(R()),t("./new"))}}})(Q(ae)),ie=()=>{const e=B(),p=j(),t=P(),[s,a]=v.useState(!1),[i,r]=v.useState(!1),d=O(),o=y(l=>l.billPaySetupApproverViewState.fetchState),u=y(l=>k(l)),n=y(l=>A(l)),f=y(l=>g(l).billPaySetupApproverViewUpdateData);if(v.useEffect(()=>{f?.updateStatus.fetchState==="Completed"&&t(E())},[f]),v.useEffect(()=>{s||o!=="Not-Started"||(a(!0),t(J(!0,!0,!1)))},[s,o,t]),V.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");v.useEffect(()=>{n.allApprovalRules.length===0&&n.fetchState==="Completed"&&(i||(r(!0),t(R())),e("./new"))},[i,n,t]);const m={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${N}`]:[],eventCallback:(l,w,h)=>{l.endsWith(N)&&h.onApprovalRulesEventReceived(l)}};return u.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?c.jsx(q,{to:"../../promo"}):u.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||n.fetchState!=="Completed"&&n.fetchState!=="Error"?c.jsx(T,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):c.jsx(ne,{currentTenant:u,location:p,navigate:e,...m})},F="bill-approval-rule-update",ce=U(function(e){const p=A(e),t=g(e).billPaySetupApproverViewUpdateData,s={};for(const i of Object.values(e.contactState.contactById))i?.id!=null&&(s[i.id]=i.fullName);const a={};for(const i of Object.values(e.classState.classesByKey))i?.classId!=null&&(a[i.classId]=i.className);return{approvalView:p,billPaySetupApproverViewUpdateData:t,vendorNamesById:s,departmentNamesById:a}},function(e,p){const{navigate:t,location:s}=p;return{onApprovalRulesEventReceived:a=>{a.endsWith(F)&&e(G(!1))},onBackClick:()=>{_(s)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(Z(a,!0))},onEditRuleClick:a=>{a!=null?(e(R(a)),t(`./${a}/edit`)):(e(R()),t("./new"))},onReorderRules:a=>{e(te(a,!0))}}})(Q(oe)),ue=()=>{const e=y(t=>k(t)),{isApprovalRulesV3Enabled:p}=X(e?.tenantId);return p?c.jsx(de,{}):c.jsx(ie,{})},de=()=>{const e=B(),p=j(),t=P(),[s,a]=v.useState(!1),[i,r]=v.useState(!1),d=O(),o=y(l=>l.billPaySetupApproverViewState.fetchState),u=y(l=>k(l)),n=y(l=>A(l)),f=y(l=>g(l).billPaySetupApproverViewUpdateData);if(v.useEffect(()=>{f?.updateStatus.fetchState==="Completed"&&t(E())},[f]),v.useEffect(()=>{s||o!=="Not-Started"||(a(!0),t(J(!0,!0,!0)))},[s,o,t]),V.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");v.useEffect(()=>{n.allApprovalRules.length===0&&n.fetchState==="Completed"&&(i||(r(!0),t(R())),e("./new"))},[i,n,t]);const m={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${F}`]:[],eventCallback:(l,w,h)=>{l.endsWith(F)&&h.onApprovalRulesEventReceived(l)}};return u.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?c.jsx(q,{to:"../../promo"}):u.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||n.fetchState!=="Completed"&&n.fetchState!=="Error"?c.jsx(T,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):c.jsx(ce,{currentTenant:u,location:p,navigate:e,...m})},ve=U(function(e,p){const t=g(e),s=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=s==="approval_create"&&t.allApprovalRules.length!==0;let i=t.allApprovalRules.length===0;return p.approvalRuleId&&(i=t.allApprovalRules.findIndex(r=>r.approvalRuleId===p.approvalRuleId)===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:i,approvalUpdateActionType:s}},function(e,p){const{navigate:t,approvalUpdateDataView:s,approverViewData:a,approvalRuleId:i}=p,r=s.billPaySetupApproverViewUpdateData?.type,d=_(p.location);return{onApprovalRuleDataUpdated:o=>{const u=f=>{const m=[];return f.forEach(l=>{const w=l.actors.selectedUsers.map(b=>({type:"user",userId:b.userId,isImplicitActor:!1})),h=l.actors.selectedNonUsers.map(b=>{const I=!!se(b.value);return{type:I?"attribute":"role",subType:b.value,userId:void 0,idType:void 0,isImplicitActor:!I}}),S=w.concat(h);m.push({action:l.stepType.selectedOption,actors:S,operator:S.length>1?l.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),m},n={amount:{type:"amount",comparator:"range",min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const f={criteria:n,steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingBills.includes("applyToExistingBills")};e(D(f))}else{const f={approvalRuleId:i,criteria:n,steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingBills.includes("applyToExistingBills")};e(D(f))}},onResetClick:()=>{e(E()),r==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),r==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(M(!1))},onSaveRuleSuccess:()=>{t("../")}}})(le);function fe(){const e=B(),p=P(),t=j(),{approvalRuleId:s}=K(),a=V.getSignedInUser(),i=O(),r=y(n=>g(n)),d=y(n=>A(n)),[o,u]=v.useState(!1);if(v.useEffect(()=>{o||(u(!0),p(H(!0)))}),v.useEffect(()=>{d.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[d,s]),a==null)throw Error("Can't access address page without signing in...");return r.approverListFetchStatus.fetchState=="Not-Started"||r.approverListFetchStatus.fetchState==="In-Progress"?c.jsx(T,{fetchState:r.approverListFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):c.jsx(ve,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:d,location:t})}const ye=U(function(e,p){const t=g(e),s=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=[],i={};for(const r of Object.values(e.contactState.contactById))r?.id!=null&&(a.push(r.id),i[r.id]=r.fullName);return{localData:t,approvalUpdateActionType:s,allVendorIds:a,vendorNamesById:i,editingRuleId:s==="approval_update"?p.approvalRuleId:void 0,allApprovalRulesWithUser:A(e).allApprovalRules}},function(e,p){const{navigate:t,approvalUpdateDataView:s,approverViewData:a,approvalRuleId:i}=p,r=s.billPaySetupApproverViewUpdateData?.type,d=_(p.location);return{onApprovalRuleDataUpdated:o=>{const u=S=>{const b=[];return S.forEach(I=>{const $=I.actorKind?.selectedOption,z=I.selectedRole?.selectedOption;let x=[];$==="role"&&z!=null?x=[{type:"attribute",subType:z,userId:void 0,idType:void 0,isImplicitActor:!1}]:$==="specific_person"&&(x=(I.persons?.selectedUsers??[]).map(Y=>({type:"user",userId:Y.userId,isImplicitActor:!1})));const L=I.action??"require_approval";b.push({action:L,actors:x,operator:x.length>1?L==="require_approval"?"or":"and":"is"})}),b},n=o.amountCriteria,f=o.vendorCriteria,m=o.departmentCriteria,l={};if(n!=null&&n.comparator.selectedOption!=null){const S=n.comparator.selectedOption;l.amount={type:"amount",comparator:S,min:S==="less_than"?void 0:n.min,max:S==="greater_than"?void 0:n.max}}const w=f?.selection.selectedOptions??[];w.length>0&&(l.vendor={type:"vendor",operator:f?.operator.selectedOption??"is",vendorIds:w});const h=m?.selection.selectedOptions??[];if(h.length>0&&(l.department={type:"department",operator:m?.operator.selectedOption??"is",departmentIds:h}),r==="approval_create"){const S={name:o.name,description:o.description,separationOfDuties:o.separationOfDuties,isFallback:o.isFallback,criteria:l,steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingBills.includes("applyToExistingBills")};e(D(S))}else{const S={approvalRuleId:i,name:o.name,description:o.description,separationOfDuties:o.separationOfDuties,isFallback:o.isFallback,criteria:l,steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingBills.includes("applyToExistingBills")};e(D(S))}},onResetClick:()=>{e(E()),r==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),r==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(M(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:o=>{e(R(o)),t(r==="approval_update"?`../../${o}/edit`:`../${o}/edit`)}}})(pe);function W(){const e=y(t=>k(t)),{isApprovalRulesV3Enabled:p}=X(e?.tenantId);return p?c.jsx(Se,{}):c.jsx(fe,{})}function Se(){const e=B(),p=P(),t=j(),{approvalRuleId:s}=K(),a=V.getSignedInUser(),i=O(),r=y(n=>g(n)),d=y(n=>A(n)),[o,u]=v.useState(!1);if(v.useEffect(()=>{o||(u(!0),p(H(!0)))}),v.useEffect(()=>{d.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[d,s]),a==null)throw Error("Can't access address page without signing in...");return r.approverListFetchStatus.fetchState=="Not-Started"||r.approverListFetchStatus.fetchState==="In-Progress"?c.jsx(T,{fetchState:r.approverListFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):c.jsx(ye,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:d,location:t},s??"new")}function Ee(){return c.jsxs(ee,{children:[c.jsx(C,{path:"/",element:c.jsx(ue,{})}),c.jsx(C,{path:"/new",element:c.jsx(W,{})}),c.jsx(C,{path:"/:approvalRuleId/edit",element:c.jsx(W,{})}),c.jsx(C,{path:"*",element:c.jsx(re,{})})]})}export{Ee as B};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-D3ESVZyk.js";import{h as K,u as se,g as Q,i as ae,j as v,N as te,n as X,l as na,o as ia,p as S}from"./core-k_c8SCBE.js";import{eW as Z,OV as Ue,bt as It,JS as oa,bo as wt,bJ as pe,OW as At,yu as Bt,zJ as $e,z5 as la,bn as De,OX as sa,OY as ra,c7 as ca,OZ as da,ks as Ct,O_ as xt,O$ as Et,Ai as Ge,yJ as Ce,P0 as ua,yi as tt,P1 as pa,Ee as ma,ym as ba,ys as Dt,P2 as ke,P3 as Me,zK as Oe,P4 as ha,P5 as ga,zN as Ne,P6 as ya,z_ as Sa,P7 as Pt,zu as at,zz as fa,P8 as ka,P9 as ue,Pa as jt,Pb as Tt,Pc as Ft,go as va,yO as Le,cB as Rt,Pd as Ia,f9 as wa,Pe as Aa,Pf as Ba,fe as Vt,fc as $t,Pg as ze,Ph as Ca,Pi as xa,ME as Ze,Pj as Ea,MF as oe,MG as He,Pk as Da,Pl as Pa,Pm as ja,zB as nt,zy as Ta,Pn as Fa,Po as Ra,Pp as Va,zk as $a,Pq as La,Pr as _a,Ps as Ua,cp as Lt,cR as _t,kD as Ga,bP as Ma,bq as Ut,bQ as Gt,xA as Oa,Pt as Na,E1 as za,E7 as Za,t_ as Ha,zL as Wa,Ap as qa,kQ as fe,Pu as Ja,Pv as Mt,li as Ka,kK as Ot,l3 as Nt,l2 as it,bE as be,bO as Qa,Pw as Xa,Px as ve,jn as Ya,Py as ot,Pz as en,jr as tn,jM as an,AD as nn,PA as on,lb as ln,At as sn,PB as lt,Ax as rn,AC as cn,Az as dn,Ar as un,PC as zt,yD as pn,PD as mn,PE as bn,gg as hn,gf as gn,ge as yn,kT as Sn,l9 as st,lk as fn,ry as kn,l0 as vn,Av as In,jx as wn,lp as An,PF as Bn,jp as Cn,rp as xn,PG as En,zq as Dn,bK as Pn,bs as jn,LA as Tn,cT as Fn,cS as Rn,cA as Vn,cH as $n}from"./zeni-epic-state-C3zBO1No.js";import{m as me,z as V,j as Ie,_ as We,N as le,x as y,aN as xe,B as re,o as x,r as Pe,c as D,be as Ln,p as z,a2 as qe,n as E,h as we,bf as rt,bg as ct,bh as _n,ak as Un,E as Gn,aH as Mn,w as Zt,D as Je,Q as Ke,bi as On,at as Ht,bj as Nn,X as zn,e as Wt,a7 as Zn,bk as Hn,bl as Wn,bm as qn,bn as Jn,bo as Kn,bp as Qn,bq as Xn,br as Yn,bs as ei,Y as ti,bt as ai,b9 as ni,bu as ii,bv as oi,a9 as li}from"./index-B4wUHn-k.js";import{n as _,S as si}from"./mui-UJrLjp1k.js";import{A as dt}from"./AddressScreen-BJ-IOcKb.js";import{g as ie,a as je,i as qt,V as Qe,b as Xe,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-BA2EKhEI.js";import{a as f}from"./sentry-B_92GPgU.js";import{u as Ye}from"./useAskAiCfoHostNavButtonProps-BJGg886y.js";import{u as Jt}from"./useInitialThreadRequest-C_cJhQDA.js";import Ee from"./NotFoundScreen-6vyCFr5S.js";import{D as ui}from"./DrawerScreen-BSfM66hM.js";import{M as Kt}from"./MobileAppDrawer-BzOopfIc.js";import{F as Qt}from"./FeaturePreviewScreen-DoKDdD4M.js";import{S as Te}from"./SetupPagesScreen-DiqU6iZv.js";import{B as pi}from"./BillPayApprovalRoutes-BWlPp4gg.js";import{FallBackRoute as mi}from"./ScreenRoutes-DgHGyuTa.js";import"./recharts-Q-kkTNuO.js";import"./analytics-DVTbnjlr.js";import"./plaid-B1j5PXHV.js";import"./dnd-CKEs-Nbe.js";import"./stripe-DMRn4zHo.js";import"./lottie-BYni7Ovk.js";import"./lexical-k-PQZXkn.js";import"./pdf-CaeTpLUv.js";import"./utils-Mjhh9T8E.js";import"./analyticsHelper-CfMFPPIh.js";import"./routePaths-ooqctjvV.js";import"./BusinessVerificationPageScreen-DWX7ySZI.js";import"./ReimbursementApprovalRuleDetailScreen-DiIBy_Kn.js";import"./getLocaleForTenant-CTwYyvWj.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="164acd8f-6c59-4d05-b41d-7578b34d59c2",e._sentryDebugIdIdentifier="sentry-dbid-164acd8f-6c59-4d05-b41d-7578b34d59c2")}catch{}})();const bi=X(function(e,t){const l=Ue(e,t.billId),n=V.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},u=z(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const i=De(n);i||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:g,isMarkAsPaidBtnVisible:b}=sa(l.billActivities,ra(t.currentTenant),n);d=g,p=b}const m=ca(t.currentTenant?.userRole??[]),h=l.transactionDetails!=null&&da(l.transactionDetails,m,n);return{billDetails:l,isAccountingClassesEnabled:Ct(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${qe}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:m,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:D,showMarkAsPaidButtonToCreator:h,isZeniUser:i}},function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:u}=n;return{redirectToBillsScreen:()=>{const o=ie(u),s=E(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(ke({}))},deleteBill:o=>{D.trackBillPayDeleteBill(l,o),e(Dt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?D.trackBillPayCancelAndDeleteBill(l,o):D.trackBillPayCancelBill(l),e(ba(l,s))},onSaveRealTimeApprovals:o=>{e(ma(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(pa({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(tt(l,o.type,"")):e(tt(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Ce(l,"retry")):e(Ce(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=je(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ie(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ua({billId:t.billId}))},onRefundPaymentClick:()=>{e(Ce(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Et({data:i,billId:l})),e(Ge(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(xt({billId:l}))}}})(Ln);function hi(){const e=K(),t=se(),l=Q(),{billId:n}=ae(),c=me(),r=V.getSignedInUser(),u=Ie(),o=v(O=>Z(O)),s=v(O=>Ue(O,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Jt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Ye({mobileExploreReferrer:"Bill Details"});We({isDataReady:s.fetchState==="Completed"});const h=o?.userRole!=null&&It(o?.userRole),g=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!h,[b,k]=f.useState(!1),[P,A]=f.useState(!1),[B,G]=f.useState(!1),{useFeatureGate:j,useDynamicConfig:U}=le(),{isFeatureEnabled:$}=j(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=j(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=j(y.isBillPayDetectInsufficientFundsEnabled),{configValue:M}=U(xe.zeniAssistConfig),C=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),L=M.user_ids!=null&&r?.userId!=null&&M.user_ids.includes(r?.userId),{isFeatureEnabled:J}=j(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Y}=j(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&C===!1?G(!1):G(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||W||s.allApprovers.find(O=>O.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,W,o.isZeni,C,r]),f.useEffect(()=>{n!=null&&t(At(n))},[n]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(Bt(n??"",$,L,!1)))},[b,s,n,t]),f.useEffect(()=>{P||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(A(!0),t($e(!1,$,L,Y,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(la()))},[P,s,n,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(te,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${x.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Pe,{analytics:D,onLoad:O=>(ee=>{n!=null&&ee.trackBillPayBillDetails(n,s.isRecurring)})(O)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:B,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:J,hasZeniAssistAccess:L,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const ye=Je.getLocalizedStrings().spendManagement.billPay.billDetails,gi={containerWidth:new Zt(100,58)},ut=X(function(e,t){const l=V.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Ht.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:D,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:x.sp10,paddingRight:x.sp3,paddingBottom:"15px",paddingLeft:x.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=V.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(Ne(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(Sa({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{D?.trackBillPaySkipAutofill(),e(Oe(n))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(Mn);function w({appContent:e}){const t=se(),l=K(),{billId:n}=ae(),c=Q(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),i=V.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=le(),{isFeatureEnabled:m}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:g}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:k}=p(xe.zeniAssistConfig),P=k.user_ids!=null&&i?.userId!=null&&k.user_ids.includes(i?.userId),A=v(F=>Z(F)),[B,G]=f.useState(!1),[j,U]=f.useState(!1),[$,I]=f.useState(!1),[H,M]=f.useState(),C=v(F=>Me(F,m,g,n));let q=C.fetchState,W=C.file,L=C.showAutofill;const J=v(F=>Ue(F,n??""));u===!1&&(q=J.fetchState,W=J.transactionDetails?.attachments?.[0],L=!1);const Y=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;f.useEffect(()=>{n==null&&t(Oe(!0))},[n,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&j?U(!1):!u&&B&&G(!1))},[n]),f.useEffect(()=>{B||n==null||u||(G(!0),t(Bt(n,h,P,!1)),j||(U(!0),t($e(!1,h,P,b,n)))),u&&!j&&(U(!0),t($e(!1,h,P,b,n)))},[B,j,u,n,t]);const O={onOkClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Y??"",F,i?.userEmail??"","yes"),t(ga({replaceBillData:!0,billId:n})),t(Ne(H,m,n))},onCancelClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Y??"",F,i?.userEmail??"","no"),t(ha({file:H,billId:n}))}},ee=f.useCallback(()=>{const F=z(c.state?.pathnameStackToGoBack),ce=F.poppedPathname??ie(A.tenantEmailDomain);t(ke({billId:n})),l(ce,{state:{pathnameStackToGoBack:F.newStack}})},[c.state,A.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(q==="Error"||J.fetchState==="Error")return a.jsx(Ee,{});if(q!="Completed")return n==null&&o!=="small"?a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[a.jsx(mt,{}),a.jsx(Re,{}),a.jsx(ut,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:!0,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:M,showActionButtons:!1,isInitialEdit:!!C.isInitialEdit,billStage:Y}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||L?null:a.jsx(pt,{children:a.jsx(Xt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(_n,{}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:n==null})})]});{const F=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[L&&o!=="small"?a.jsx(mt,{}):null,$?a.jsx(Un,{titleComponent:a.jsx(wi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(Ai,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:O,isEditPopup:!0}):null,o==="small"||L?null:a.jsx(pt,{children:a.jsx(yi,{})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(ut,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:L,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,J,C),setShowConfirmationPopup:I,setPayload:M,showActionButtons:fi(u,C),isInitialEdit:!!C.isInitialEdit,billStage:F}),a.jsx(Ve,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=On();return a.jsx(Xt,{onClick:e,"data-testid":"nav-bar-back-click"})}function Si(e,t,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(ki,{children:[a.jsx(vi,{children:`${ye.recurringBill.recurringCycle}
|
|
1
|
+
import{j as a}from"./liveblocks-DmbDY3sa.js";import{h as K,u as se,g as Q,i as ae,j as v,N as te,n as X,l as na,o as ia,p as S}from"./core-Cj3sxYL7.js";import{eW as Z,OV as Ue,bt as It,JS as oa,bo as wt,bJ as pe,OW as At,yu as Bt,zJ as $e,z1 as la,bn as De,OX as sa,OY as ra,c7 as ca,OZ as da,ks as Ct,O_ as xt,O$ as Et,Ai as Ge,yJ as Ce,P0 as ua,yi as tt,P1 as pa,Ee as ma,ym as ba,ys as Dt,P2 as ke,P3 as Me,zK as Oe,P4 as ha,P5 as ga,zN as Ne,P6 as ya,z_ as Sa,P7 as Pt,zu as at,zz as fa,P8 as ka,P9 as ue,Pa as jt,Pb as Tt,Pc as Ft,go as va,yO as Le,cB as Rt,Pd as Ia,f9 as wa,Pe as Aa,Pf as Ba,fe as Vt,fc as $t,Pg as ze,Ph as Ca,Pi as xa,ME as Ze,Pj as Ea,MF as oe,MG as He,Pk as Da,Pl as Pa,Pm as ja,zB as nt,zy as Ta,Pn as Fa,Po as Ra,Pp as Va,zk as $a,Pq as La,Pr as _a,Ps as Ua,cp as Lt,cR as _t,kD as Ga,bP as Ma,bq as Ut,bQ as Gt,xA as Oa,Pt as Na,E1 as za,E7 as Za,t_ as Ha,zL as Wa,Ap as qa,kQ as fe,Pu as Ja,Pv as Mt,li as Ka,kK as Ot,l3 as Nt,l2 as it,bE as be,bO as Qa,Pw as Xa,Px as ve,jn as Ya,Py as ot,Pz as en,jr as tn,jM as an,AD as nn,PA as on,lb as ln,At as sn,PB as lt,Ax as rn,AC as cn,Az as dn,Ar as un,PC as zt,yD as pn,PD as mn,PE as bn,gg as hn,gf as gn,ge as yn,kT as Sn,l9 as st,lk as fn,ry as kn,l0 as vn,Av as In,jx as wn,lp as An,PF as Bn,jp as Cn,rp as xn,PG as En,zq as Dn,bK as Pn,bs as jn,LA as Tn,cT as Fn,cS as Rn,cA as Vn,cH as $n}from"./zeni-epic-state-BG_x9wwl.js";import{m as me,z as V,j as Ie,_ as We,F as le,x as y,aN as xe,B as re,o as x,A as Pe,c as D,be as Ln,n as z,a2 as qe,r as E,K as we,bf as rt,bg as ct,bh as _n,ak as Un,I as Gn,aH as Mn,E as Zt,D as Je,N as Ke,bi as On,at as Ht,bj as Nn,X as zn,e as Wt,a7 as Zn,bk as Hn,bl as Wn,bm as qn,bn as Jn,bo as Kn,bp as Qn,bq as Xn,br as Yn,bs as ei,w as ti,bt as ai,b9 as ni,bu as ii,bv as oi,a9 as li}from"./index-BHgTWK3A.js";import{n as _,S as si}from"./mui-1V4hRqCa.js";import{A as dt}from"./AddressScreen-DzlfvttE.js";import{g as ie,a as je,i as qt,V as Qe,b as Xe,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-ByI1UAeb.js";import{a as f}from"./sentry--Yi43Gx7.js";import{u as Ye}from"./useAskAiCfoHostNavButtonProps-DvB8uvB7.js";import{u as Jt}from"./useInitialThreadRequest-ITLu-S1Q.js";import Ee from"./NotFoundScreen-D51sUkWb.js";import{D as ui}from"./DrawerScreen-CVn6NI6C.js";import{M as Kt}from"./MobileAppDrawer-CzOm0Sxs.js";import{F as Qt}from"./FeaturePreviewScreen-D7L8dftQ.js";import{S as Te}from"./SetupPagesScreen-BEBa0Bcm.js";import{B as pi}from"./BillPayApprovalRoutes-Dh8a42Hh.js";import{FallBackRoute as mi}from"./ScreenRoutes-BSFeQNd5.js";import"./recharts-mFhBBFnU.js";import"./analytics-BpWjaxbv.js";import"./plaid-JtkXopjw.js";import"./dnd-WLAr-qfO.js";import"./stripe-DMRn4zHo.js";import"./lottie-W8sR2m8i.js";import"./lexical--OluaPRa.js";import"./pdf-aJCOHARS.js";import"./utils-Bt5dYICv.js";import"./analyticsHelper-B5EDEZrW.js";import"./routePaths-CKR4MRfB.js";import"./BusinessVerificationPageScreen-6o8gENq-.js";import"./ReimbursementApprovalRuleDetailScreen-CEzdk50o.js";import"./getLocaleForTenant-DI_-EIej.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]="14c1f230-843d-4ffe-adb2-b98e45ab4bf7",e._sentryDebugIdIdentifier="sentry-dbid-14c1f230-843d-4ffe-adb2-b98e45ab4bf7")}catch{}})();const bi=X(function(e,t){const l=Ue(e,t.billId),n=V.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},u=z(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const i=De(n);i||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:g,isMarkAsPaidBtnVisible:b}=sa(l.billActivities,ra(t.currentTenant),n);d=g,p=b}const m=ca(t.currentTenant?.userRole??[]),h=l.transactionDetails!=null&&da(l.transactionDetails,m,n);return{billDetails:l,isAccountingClassesEnabled:Ct(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${qe}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:m,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:D,showMarkAsPaidButtonToCreator:h,isZeniUser:i}},function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:u}=n;return{redirectToBillsScreen:()=>{const o=ie(u),s=E(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(ke({}))},deleteBill:o=>{D.trackBillPayDeleteBill(l,o),e(Dt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?D.trackBillPayCancelAndDeleteBill(l,o):D.trackBillPayCancelBill(l),e(ba(l,s))},onSaveRealTimeApprovals:o=>{e(ma(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(pa({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(tt(l,o.type,"")):e(tt(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Ce(l,"retry")):e(Ce(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=je(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ie(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ua({billId:t.billId}))},onRefundPaymentClick:()=>{e(Ce(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Et({data:i,billId:l})),e(Ge(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(xt({billId:l}))}}})(Ln);function hi(){const e=K(),t=se(),l=Q(),{billId:n}=ae(),c=me(),r=V.getSignedInUser(),u=Ie(),o=v(O=>Z(O)),s=v(O=>Ue(O,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Jt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Ye({mobileExploreReferrer:"Bill Details"});We({isDataReady:s.fetchState==="Completed"});const h=o?.userRole!=null&&It(o?.userRole),g=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!h,[b,k]=f.useState(!1),[P,A]=f.useState(!1),[B,G]=f.useState(!1),{useFeatureGate:j,useDynamicConfig:U}=le(),{isFeatureEnabled:$}=j(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=j(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=j(y.isBillPayDetectInsufficientFundsEnabled),{configValue:M}=U(xe.zeniAssistConfig),C=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),L=M.user_ids!=null&&r?.userId!=null&&M.user_ids.includes(r?.userId),{isFeatureEnabled:J}=j(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Y}=j(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&C===!1?G(!1):G(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||W||s.allApprovers.find(O=>O.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,W,o.isZeni,C,r]),f.useEffect(()=>{n!=null&&t(At(n))},[n]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(Bt(n??"",$,L,!1)))},[b,s,n,t]),f.useEffect(()=>{P||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(A(!0),t($e(!1,$,L,Y,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(la()))},[P,s,n,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(te,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${x.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Pe,{analytics:D,onLoad:O=>(ee=>{n!=null&&ee.trackBillPayBillDetails(n,s.isRecurring)})(O)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:B,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:J,hasZeniAssistAccess:L,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const ye=Je.getLocalizedStrings().spendManagement.billPay.billDetails,gi={containerWidth:new Zt(100,58)},ut=X(function(e,t){const l=V.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Ht.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:D,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:x.sp10,paddingRight:x.sp3,paddingBottom:"15px",paddingLeft:x.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=V.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(Ne(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(Sa({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{D?.trackBillPaySkipAutofill(),e(Oe(n))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(Mn);function w({appContent:e}){const t=se(),l=K(),{billId:n}=ae(),c=Q(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),i=V.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=le(),{isFeatureEnabled:m}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:g}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:k}=p(xe.zeniAssistConfig),P=k.user_ids!=null&&i?.userId!=null&&k.user_ids.includes(i?.userId),A=v(F=>Z(F)),[B,G]=f.useState(!1),[j,U]=f.useState(!1),[$,I]=f.useState(!1),[H,M]=f.useState(),C=v(F=>Me(F,m,g,n));let q=C.fetchState,W=C.file,L=C.showAutofill;const J=v(F=>Ue(F,n??""));u===!1&&(q=J.fetchState,W=J.transactionDetails?.attachments?.[0],L=!1);const Y=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;f.useEffect(()=>{n==null&&t(Oe(!0))},[n,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&j?U(!1):!u&&B&&G(!1))},[n]),f.useEffect(()=>{B||n==null||u||(G(!0),t(Bt(n,h,P,!1)),j||(U(!0),t($e(!1,h,P,b,n)))),u&&!j&&(U(!0),t($e(!1,h,P,b,n)))},[B,j,u,n,t]);const O={onOkClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Y??"",F,i?.userEmail??"","yes"),t(ga({replaceBillData:!0,billId:n})),t(Ne(H,m,n))},onCancelClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Y??"",F,i?.userEmail??"","no"),t(ha({file:H,billId:n}))}},ee=f.useCallback(()=>{const F=z(c.state?.pathnameStackToGoBack),ce=F.poppedPathname??ie(A.tenantEmailDomain);t(ke({billId:n})),l(ce,{state:{pathnameStackToGoBack:F.newStack}})},[c.state,A.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(q==="Error"||J.fetchState==="Error")return a.jsx(Ee,{});if(q!="Completed")return n==null&&o!=="small"?a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[a.jsx(mt,{}),a.jsx(Re,{}),a.jsx(ut,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:!0,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:M,showActionButtons:!1,isInitialEdit:!!C.isInitialEdit,billStage:Y}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||L?null:a.jsx(pt,{children:a.jsx(Xt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(_n,{}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:n==null})})]});{const F=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[L&&o!=="small"?a.jsx(mt,{}):null,$?a.jsx(Un,{titleComponent:a.jsx(wi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(Ai,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:O,isEditPopup:!0}):null,o==="small"||L?null:a.jsx(pt,{children:a.jsx(yi,{})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(ut,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:L,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,J,C),setShowConfirmationPopup:I,setPayload:M,showActionButtons:fi(u,C),isInitialEdit:!!C.isInitialEdit,billStage:F}),a.jsx(Ve,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=On();return a.jsx(Xt,{onClick:e,"data-testid":"nav-bar-back-click"})}function Si(e,t,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(ki,{children:[a.jsx(vi,{children:`${ye.recurringBill.recurringCycle}
|
|
2
2
|
${n}/${c}`}),a.jsx(Ii,{})]}):void 0}function fi(e,t){const l=t.billActivities?.[0],n=t.billStage==="pending_approval"&&l?.areApprovalsSerialized===!0&&l?.currentPendingStepIndex===0;return e&&(t.billStage==="draft"||n)}const pt=_.div`
|
|
3
3
|
margin-bottom: 20px;
|
|
4
4
|
margin-top: 20px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as k}from"./liveblocks-
|
|
1
|
+
import{j as k}from"./liveblocks-DmbDY3sa.js";import{a as V}from"./sentry--Yi43Gx7.js";import{h as ae,g as ne,u as se,i as ie,j as C,N as oe,n as re}from"./core-Cj3sxYL7.js";import{j as ce,F as ue,aN as de,z,A as pe,c as E,af as x,e as P,bE as le,at as me,r as B,au as R}from"./index-BHgTWK3A.js";import{Pr as fe,eW as G,tp as ye,JV as Se,zk as ge,CL as Ie,Fn as he,G0 as be,H0 as Oe,PO as Te,PP as De,PQ as ke,PR as Ce,PS as Ve,Mm as we,OQ as Ae,Mx as Ne,l8 as Fe,gg as _e,gf as ve,ge as xe,ry as Pe,rp as ze,rm as Ee,l0 as Be,ty as Re,tw as M,bE as L,tK as j,cz as Me}from"./zeni-epic-state-BG_x9wwl.js";import{n as Le}from"./mui-1V4hRqCa.js";import{d as U}from"./routePaths-CKR4MRfB.js";import{M as je}from"./MobileAppDrawer-CzOm0Sxs.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]="746cf1de-8f00-4a6e-8c0a-5e6d44053b89",e._sentryDebugIdIdentifier="sentry-dbid-746cf1de-8f00-4a6e-8c0a-5e6d44053b89")}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-D3ESVZyk.js";import{a as V}from"./sentry-B_92GPg
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,Ge=re(function(e,d){const{businessVerificationDetails:i}=d,r=G(e),y=z.getSignedInUser(),S=r.tenantId,l={userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:S??""},b=we(d.roleMap)&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",t=
|
|
9
|
+
`,Ge=re(function(e,d){const{businessVerificationDetails:i}=d,r=G(e),y=z.getSignedInUser(),S=r.tenantId,l={userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:S??""},b=we(d.roleMap)&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",t=Ae(e.companyConfigState),s=Ne(e.userRoleConfigState);return{businessVerificationDetails:i,verficationDetailsFetchState:i.fetchState,isRefreshingViewInBackground:i.isRefreshingViewInBackground,allNationalityCountries:i.allNationalityCountries,filesEndPoint:`${me.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:b,allIndustries:t.companyIndustries??[],companyTitles:s.companyTitles}},function(e,d){const{companyId:i,productType:r,currentTenant:y,navigate:S,location:l}=d,{tenantEmailDomain:b}=y;return{onCompanyDetailsChanged:t=>{const{companyDescription:s,companyIndustry:p,companyIndustryType:T,companyLegalName:D,companyTaxId:g,companyWebsite:m,companyPhone:I,primaryContactEmail:c,primaryContactName:n,primaryContactUserId:u,primaryContactSyncToken:O,syncToken:f,fileIds:a,incDate:o,typeOfIncorporation:w,stateOfIncorporation:A,sourceOfFunds:N,companySubIndustry:F,countriesOfOperations:h,companySourceOfFunds:q,companySourceOfFundsDescription:Q,transactionVolume:W,transactionVolumeDescription:Z,purposeOfAccount:$,purposeOfAccountDescription:H,regulatedStatus:J,regulatedStatusDescription:K,usNexus:X,usNexusTypes:Y}=t,_=T?.selectedOption,ee={companyId:i,companyDescription:s,companyIndustry:p.selectedOption,companyIndustryType:_==null||_===""?void 0:_,companyLegalName:D,taxIdOrEIN:g,website:m!=""&&m!=null?Me(m):void 0,phone:I,syncToken:f,fileIds:a,incDate:o!=null?L(o?.toString()):o,typeOfIncorporation:w?.selectedOption??"",stateOfIncorporation:A?.selectedOption??"",sourceOfFunds:N?.selectedOption??"",companySubIndustry:F?.selectedOption??"",countriesOfOperations:h?.selectedOptions.map(v=>v.length===2?v:R(v))??[],companySourceOfFunds:q?.selectedOption??"",companySourceOfFundsDescription:Q,transactionVolume:W?.selectedOption??"",transactionVolumeDescription:Z,purposeOfAccount:$?.selectedOption??"",purposeOfAccountDescription:H,regulatedStatus:J??"",regulatedStatusDescription:K,usNexus:X,usNexusTypes:Y?.selectedOptions??[]},te={userId:u,firstName:n.firstName,lastName:n.lastName,email:c,syncToken:O};e(j({companyDetails:ee,primaryContactDetails:te}))},onCompanyOfficerUpdated:t=>{const s=t.map(p=>{const{officerType:T,userId:D,name:g,email:m,nationalityCountryCode:I,ssn:c,dob:n,phone:u,syncToken:O,selectDocument:f,role:a,ownership:o,isSelectedForVerification:w,userVerificationStatus:A,treasuryUserVerificationStatus:N,fileIds:F}=p;let h;return f.selectDocumentType==="driverLicense"?h="driving_license":f.selectDocumentType==="passport"?h="passport":f.selectDocumentType==="stateId"?h="id_document":f.selectDocumentType==="ssnCard"&&(h="social_security_card"),{officerType:T,userId:D,firstName:g.firstName,lastName:g.lastName,email:m,ssn:c,nationalityCountryCode:I?.selectedOption!=null?R(I.selectedOption):void 0,phone:u,birthday:n!=null?L(n?.toString()):n,syncToken:O,titleAtCompany:a.selectedOption,ownershipInCompany:o,documentTypeSelectedForVerification:h,isSelectedForVerification:w,userVerificationStatus:A,treasuryUserVerificationStatus:N,fileIds:F,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(j({officers:s}))},onSaveDetailsClick:t=>{e(M(i,t,r))},onSendForVerificationClick:t=>{e(M(i,t,r,!0))},onAddressClick:t=>{const s=U(b,t),p=B(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onRegisteredAddressClick:t=>{const s=U(b,t),p=B(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onBackClick:()=>{e(Re({companyId:i})),S("../setup")},updateFilesEntity:t=>{e(Be({files:t}))},onDeleteFile:t=>{e(Ee(t))},onDeleteFileList:t=>{e(ze(t))},onEditFileName:(t,s)=>{e(Pe(t,s.split(".")[0]))},onGetOtp:t=>{e(xe(t,"SpendManagementSetup"))},onResendOtp:t=>{e(ve(t,"SpendManagementSetup"))},onVerifyOtp:(t,s)=>{e(_e(t,s,"SpendManagementSetup"))},saveNewAddressInLocalStore:(t,s)=>{e(Fe({addressType:t,addressToCreate:s}))}}})(le),Xe=({productType:e})=>{const d=ae(),i=ne(),r=se(),[y,S]=V.useState(!1),[l,b]=V.useState(!1),{tenantEmailDomain:t}=ie(),s=ce(),{useDynamicConfig:p}=ue(),{configValue:T}=p(de.zeniAccountsConfig),D=fe(T),g=C(a=>{switch(e){case"zeni_accounts":return a.zeniAccountSetupViewState.fetchState;case"reimbursement":return a.remiSetupViewState.fetchState;case"charge_cards":return a.chargeCardSetupViewState.fetchState;case"zeni_treasury":return a.treasurySetupViewState.fetchState;default:return a.billPaySetupViewState.fetchState}}),m=C(a=>a.companyConfigState.fetchState),I=C(a=>a.userRoleConfigState.fetchState),c=C(a=>G(a)),n=c.companyId??z.getSignedInUserTenant(t)?.companyId;if(V.useEffect(()=>{m==="Not-Started"&&r(ye()),I==="Not-Started"&&r(Se(!0))},[m,I,r]),V.useEffect(()=>{if(!y&&g==="Not-Started"&&n!=null)switch(S(!0),e){case"zeni_accounts":r(Oe(n,!0));break;case"zeni_treasury":r(be(n,!0));break;case"reimbursement":r(he(n,!0));break;case"charge_cards":r(Ie(n,!0));break;default:r(ge(n,!0))}},[y,g,n,r]),z.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let u;switch(e){case"zeni_accounts":u=c.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":u=c.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":u=c.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||c.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":u=c.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:u=c.companyBillPayInfo?.info?.isBillPayTOSAccepted}const O=a=>{b(a)},f=C(a=>{let o;switch(e){case"zeni_accounts":o=Ve(a,n);break;case"zeni_treasury":o=Ce(a,n);break;case"charge_cards":o=ke(a,n);break;case"reimbursement":o=De(a,n);break;default:o=Te(a,n)}return o});return u===!1?k.jsx(oe,{to:"../promo"}):k.jsxs(Ue,{children:[k.jsx(pe,{analytics:E,onLoad:a=>(o=>{switch(e){case"zeni_accounts":return o.trackPageLoaded(P.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return o.trackPageLoaded(P.Event.reimbursementBusinessVerification);default:return o.trackPageLoaded(P.Event.billPayBusinessVerification,x(i)?"Settings":void 0)}})(a)}),x(i)?k.jsx(je,{isAppContentDrawerOpen:l,handleDrawerToggle:O}):null,k.jsx(Ge,{businessVerificationDetails:f,navigate:d,location:i,companyId:n,analytics:E,currentTenant:c,productType:e,isSettings:x(i),roleMap:s?.loggedInUserRoleMap??{},onClickMenuIcon:()=>{O(!0)},maxInsuredAmount:D.maxInsuredAmount})]})};export{Xe as B};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as b}from"./liveblocks-
|
|
1
|
+
import{j as b}from"./liveblocks-DmbDY3sa.js";import{a as i}from"./sentry--Yi43Gx7.js";import{n as W}from"./utils-Bt5dYICv.js";import{u as Ie,h as we,g as Ee,j as T,i as ke,n as Ae}from"./core-Cj3sxYL7.js";import{W as ve,F as Te,x as z,z as Fe,d9 as Oe,db as Ue,b5 as ee,A as _e,c as V,dc as G,dj as xe,D as Qe,e as De,a7 as Le,df as $e,a2 as Ve,dk as je,b1 as Re,di as Me}from"./index-BHgTWK3A.js";import{gk as He,g5 as Ne,g6 as X,g7 as qe,fQ as te,g8 as Be,g9 as We,eV as se,eW as ze,ga as Ge,f0 as Xe,iF as Ye,iB as Je,eX as Y,fJ as Ke,fK as Ze,fL as et,fM as tt,fN as st,fO as at,fP as ot,fR as nt,fS as it,fT as J,bE as K,fU as rt,fV as lt,fW as dt,fX as ct,fY as ut,fZ as mt,fC as ft,fG as Z,f_ as pt,f$ as Ct,g0 as ht,g1 as St,g2 as gt,g3 as bt,g4 as Pt}from"./zeni-epic-state-BG_x9wwl.js";import{D as yt,n as R,P as It,S as wt}from"./mui-1V4hRqCa.js";import{d as Et}from"./recharts-mFhBBFnU.js";import"./analytics-BpWjaxbv.js";import"./plaid-JtkXopjw.js";import"./dnd-WLAr-qfO.js";import"./stripe-DMRn4zHo.js";import"./lottie-W8sR2m8i.js";import"./lexical--OluaPRa.js";import"./pdf-aJCOHARS.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="2f12563a-fef6-4423-9168-50dec7a260d1",e._sentryDebugIdIdentifier="sentry-dbid-2f12563a-fef6-4423-9168-50dec7a260d1")}catch{}})();const kt=e=>Pt(e,!1),At=e=>bt(e.name,!1),ae="chat-response-generated",oe="cards/ask",ne="card_policy_hero";function j(e){return`/${e}/cards`}function ie(e){return`/${e}/cards/policy`}const vt=Ae(function(e,r){const s=se(e),C=r.isSubmitting,c=e.cardPolicyState,m=Ke(c),d=Ze(c),h=et(c);return{showSampleQuestions:r.sessionFromUrl==="new_chat"&&s.uiState.currentChatSessionId==null,aiCfoView:s,isSubmitting:C,isNewChatSession:r.sessionFromUrl==="new_chat",isFullView:!0,tableDownloadEndPoint:`${Ve}/tableDownload`,emailLinkQuestion:r.emailLinkQuestion,autoSubmitEmailLinkQuestion:r.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:r.onEmailLinkQuestionProcessed,isFileUploadEnabled:r.isFileUploadEnabled,isUploadPromoVisible:r.isUploadPromoVisible,onUploadPromoClose:r.onUploadPromoClose,allUsers:r.allUsers,cardPolicyCategorySearchOptions:m.map(kt),cardPolicyVendorSearchOptions:d.map(At),cardPolicyIsVendorSearchLoading:h==="In-Progress",cardPolicyDocumentUploadState:ot(c),cardPolicyUploadedFileName:at(c),cardPolicyFormDraft:st(e.createCardPolicyState),cardsCreationFormDraft:tt(e)}},function(e,r){const{location:s,currentTenant:C,userId:c,navigate:m,currentChatSessionId:d,allSessionsWithOrderedQuestionAnswers:h,isAiCardCreationEnabled:E,isCardPolicyEnabled:P,cardPolicyPageContext:k}=r,f=C.tenantEmailDomain,O=s.state?.referrer,u=O===ne?ie(f):j(f);return{onEventReceived:(a,l)=>{if(a===ae&&typeof l.text=="string"&&typeof l.metadata=="object"){const t=l,n=Ct(t.type),p=t.metadata.chat_session_id??null,{currentChatSession:U,currentQuestionAnswer:A,currentQuestionAnswerSummary:y}=ee(h,p);n!=="answer"?V.trackAICFOChatResponseGenerated(n,A?.question.questionText??"",t.text,p,Me(y,U),t.metadata.message_id??null):V.trackAICFOChatAnswerGenerated(t.text,A?.question.questionText??"",(t.follow_up_questions?.length??0)>0,!!t.assumptions,!!t.insights,t.visualization!=null,ht(t.visualization?.type??"")??null,p,t.summarized_title,t.metadata.message_id??null),e(St({chatSessionId:t.metadata.chat_session_id,responseType:n,fetchState:{fetchState:"Completed",error:void 0}})),e(gt({chatSessionId:t.metadata.chat_session_id,answerPayload:t,userId:c}))}},onSubmit:(a,l,t,n)=>{a&&Re(e,a,l,d,h,c,n,t,k)},updateCurrentInput:a=>{e(Z(a))},onStopSubmit:()=>{},onUpdateScrollYOffset:a=>{e(pt(a))},onSelectSampleQuestion:()=>{},onBackClick:()=>{m(-1)},onCloseClick:()=>{m(u,{state:{...s.state}}),e(Z(""))},togglePageView:()=>{m(u,{state:{...s.state}}),r.setIsAiCfoOpen(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{m(-1)},onNewChatClick:()=>{d!=null&&e(ft()),m(function(a){return`/${a}/${oe}`}(f),{state:{...s.state}})},onToggleCotCollapsed:(a,l)=>{e(mt({questionAnswerId:a,isCollapsed:l}))},onCardsCreationFormChange:E?a=>{e(ut(a))}:void 0,onCardsCreationFormSubmit:E?(a,l)=>{const t=lt(a);t.length!==0&&(e(dt(t)),e(ct({sourceChatSessionId:d??void 0})),d!=null&&e(J({chatSessionId:d,id:W(),kind:"creating_cards",createdAt:K(""),sourceQuestionAnswerId:l})),r.setIsAiCfoOpen(!0),m(j(f),{state:{...s.state}}))}:void 0,onCardPolicyFormChange:P?a=>{e(rt(a))}:void 0,onCardPolicyFormSubmit:P?(a,l)=>{const t=je({values:a});e(it({templates:[t],sourceChatSessionId:d})),d!=null&&e(J({chatSessionId:d,id:W(),kind:"creating_policy",createdAt:K(""),sourceQuestionAnswerId:l})),r.setIsAiCfoOpen(!0),m(`/${f}/cards/policy`,{state:{...s.state}})}:void 0,onCardPolicyUploadDocument:P?(a,l,t)=>{a.length!==0&&e(nt(a,l,t))}:void 0,onCardPolicyRemoveDocument:P?()=>{e(te())}:void 0}})(Le($e)),{spendManagement:{chargeCard:{cardsAiCfoHero:re,cardPolicyAiCfoHero:le}}}=Qe.getLocalizedStrings(),F=re.pageTitle,Tt=le.pageTitle,Ft=re.chatHeaderSubtitle,Ot=le.chatHeaderSubtitle,Xt=({isFileUploadEnabled:e})=>{const{setIsAiCfoOpen:r}=ve(),s=Ie(),C=we(),c=Ee(),[m,d]=i.useState(!1),{useFeatureGate:h}=Te(),{isFeatureEnabled:E}=h(z.isAiCardCreationEnabled),{isFeatureEnabled:P}=h(z.isCardPolicyEnabled);i.useEffect(()=>{s(He())},[s]),i.useEffect(()=>(s(Ne()),s(X()),s(qe("cardHolderCandidate",!1)),()=>{s(te())}),[s]);const k=T(o=>Be(o).fetchState);i.useEffect(()=>{k==="Not-Started"&&s(We(!1,!1,!1))},[k,s]);const f=i.useMemo(()=>Et(o=>{s(X(o))},250),[s]);i.useEffect(()=>()=>{f.cancel()},[f]);const O=i.useCallback(o=>{f(o)},[f]),u=T(o=>se(o)),a=Fe.getSignedInUser(),{session_id:l}=ke(),t=T(o=>ze(o)),n=u.uiState.currentChatSessionId,p=t.tenantEmailDomain,{handleUploadPromoClose:U,isUploadPromoVisible:A}=Oe({isFileUploadEnabled:e,tenantEmailDomain:p}),y=c.state,S=y?.aiCfoInitialQuestion??null,_=!!y?.aiCfoShouldSubmit,I=y?.referrer===ne,de=I?"card_policy":void 0,ce=i.useMemo(()=>({title:I?Tt:F,subtitle:I?Ot:Ft}),[I]),[ue,x]=i.useState(null),[me,Q]=i.useState(!1),D=i.useRef(!1);i.useEffect(()=>{D.current||S==null||S===""||(x(S),Q(_),D.current=!0)},[S,_]);const fe=i.useCallback(()=>{x(null),Q(!1)},[]),pe=t.masterTOSInfo,g=pe?.isMasterTOSAccepted??!1,v=i.useRef(null);i.useEffect(()=>{if(g&&v.current!=null){const{question:o,shouldSubmit:w}=v.current;v.current=null,x(o),Q(w),D.current=!1}},[g]);const{visitedSessions:M}=Ue(n),L=u.fetchState,$=u.uiState.chatSessionsNextPageToken.hasMore||!u.uiState.chatSessionsFirstPageFetched,H=n!=null?u.fetchChatSessionHistoryByChatSessionId?.[n]?.fetchState??"Not-Started":"Not-Started",N=n==null||(u.uiState.chatHistoryNextPageToken[n]?.hasMore??!0),q=u.allSessionsWithOrderedQuestionAnswers,B=T(o=>Ge(o.userState,o.userRoleState,o.userListViewState,"cardHolderCandidate")).users,Ce=i.useMemo(()=>B.map(o=>o.user).filter(o=>o!=null),[B]),{currentSessionQuestionAnswers:he}=ee(q,n),Se=he.length===0;i.useEffect(()=>{n!=null&&l!==n&&C(function(o,w){return`/${o}/${oe}/${w}`}(p,n),{state:{...c.state},replace:!0})},[n,l,p,C,c.state]),i.useEffect(()=>{l!=null&&n==null&&l!=="new_chat"&&s(Xe({sessionId:l,agentId:"controller"}))},[]);const ge=i.useMemo(()=>({events:M.map(o=>`private-encrypted-chat-${o}.${ae}`),eventCallback:(o,w,ye)=>ye.onEventReceived(o,w)}),[M]);if(i.useEffect(()=>{L!=="In-Progress"&&$&&s(Ye())},[L,$,s]),i.useEffect(()=>{n!=null&&H!=="In-Progress"&&N&&a!=null&&L==="Completed"&&!$&&s(Je(n,a.userId))},[H,N,n,a,s]),a==null)throw Error("Can't access Cards AI CFO page without signing in...");const be=l??"new_chat",Pe=n!=null&&u.responseStateByChatSessionId?.[n]?.answer?.fetchState==="In-Progress";return b.jsxs(_t,{children:[b.jsx(_e,{analytics:V,onLoad:o=>o.trackPageLoaded(De.Event.aiCFOPage)}),g?b.jsx(vt,{...ge,currentChatSessionId:n,allSessionsWithOrderedQuestionAnswers:q,allUsers:Ce,isAiCardCreationEnabled:E,isCardPolicyEnabled:P,openOnboardingPage:()=>d(!0),userId:a.userId,setIsAiCfoOpen:r,navigate:C,sessionFromUrl:be,location:c,isSubmitting:Pe,isEmptyChatWithSession:Se,customPageTitle:F,chatHeader:ce,currentTenant:t,emailLinkQuestion:ue??void 0,autoSubmitEmailLinkQuestion:me,onEmailLinkQuestionProcessed:fe,isFileUploadEnabled:e,isUploadPromoVisible:A,onUploadPromoClose:U,onCardPolicyVendorSearchTextChange:O,cardPolicyPageContext:de}):b.jsx(G,{isTOSAccepted:g,acceptMasterTOSState:u.masterTOSAcceptanceState,customPageTitle:F,onCloseClick:()=>{C(I?ie(p):j(p),{state:{...c.state}})},onCompleteClick:()=>{g||t.userRoleId==null||(S!=null&&S!==""&&(v.current={question:S,shouldSubmit:_}),s(Y(t.userRoleId)))}}),b.jsx(yt,{anchor:"right",open:m,transitionDuration:250,PaperProps:{component:xt,style:{width:`${xe}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>d(!1),children:b.jsx(Ut,{onClick:o=>o.stopPropagation(),children:b.jsx(G,{isTOSAccepted:g,acceptMasterTOSState:u.masterTOSAcceptanceState,customPageTitle:F,onCloseClick:()=>d(!1),onCompleteClick:()=>{g||t.userRoleId==null||s(Y(t.userRoleId)),d(!1)}})})})]})},Ut=R(wt)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|