@zeniai/web-app-ui 5.1.78-dev → 5.1.79-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-CHi1bYm0.js +1 -0
- package/dist/assets/{AddressScreen-CLqHIzyX.js → AddressScreen-CTBC0Okq.js} +1 -1
- package/dist/assets/{AiCfoScreen-qoxT0tW7.js → AiCfoScreen-x1Oi51Ut.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-CZBhRNrs.js → BillPayApprovalRoutes-9GXjYr7v.js} +1 -1
- package/dist/assets/{BillPayRoutes-C6exGqkN.js → BillPayRoutes-DPLojII-.js} +1 -1
- package/dist/assets/{BusinessVerificationPageScreen-BN8pHa0i.js → BusinessVerificationPageScreen-BdbkgyBr.js} +1 -1
- package/dist/assets/{CardsAiCfoScreen-B0XBkar3.js → CardsAiCfoScreen-CLB3BiHA.js} +1 -1
- package/dist/assets/{ChargeCardRoutes-DE9-vLEE.js → ChargeCardRoutes-Bwf4CcTM.js} +1 -1
- package/dist/assets/{CompanyPassportScreen-3yTQ9U1p.js → CompanyPassportScreen-CjdWLPz5.js} +1 -1
- package/dist/assets/{ConnectionAuthScreen-Cj6ASnFW.js → ConnectionAuthScreen-Cmelc6Zc.js} +1 -1
- package/dist/assets/CustomerOnboardingAuthScreen-BpL3zZse.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-BbhWhhzo.js → CustomerOnboardingRoutes-DTma2BUp.js} +1 -1
- package/dist/assets/{DashboardRoutes-BcHQSPfi.js → DashboardRoutes-BGnEeitI.js} +1 -1
- package/dist/assets/{DefaultTenantHome-gaEkRiQO.js → DefaultTenantHome-CvDWaxl3.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-DeiqcEkq.js → DomesticWireDetailScreen-DJE27dHB.js} +1 -1
- package/dist/assets/{DrawerScreen-BkDOJtg1.js → DrawerScreen-B0i0-mAL.js} +1 -1
- package/dist/assets/{EntityDetailRoutes-VjvPi57p.js → EntityDetailRoutes-DnUjXeeA.js} +1 -1
- package/dist/assets/{ExpenseAutomationRoutes-B6hzZS_w.js → ExpenseAutomationRoutes-QaHNAt9Q.js} +1 -1
- package/dist/assets/{FeaturePreviewScreen-CW2ZZwGb.js → FeaturePreviewScreen-DX1SEz5-.js} +1 -1
- package/dist/assets/{HubSpotOAuthCallbackScreen-C0zLWVIW.js → HubSpotOAuthCallbackScreen-CuoQj9Vm.js} +1 -1
- package/dist/assets/{MagicLinkRoutes-DTr6uAW9.js → MagicLinkRoutes-C6P79S3d.js} +1 -1
- package/dist/assets/{MagicLinkSignInScreen-FAIwPzgV.js → MagicLinkSignInScreen-q9-rqQ_q.js} +1 -1
- package/dist/assets/{MobileAppDrawer-DXoZqPdU.js → MobileAppDrawer-DTNaBxxF.js} +1 -1
- package/dist/assets/NotFoundScreen-Dx10N2h0.js +1 -0
- package/dist/assets/{NotificationRoutes-D79yRJe0.js → NotificationRoutes-BN6OJ0Ma.js} +1 -1
- package/dist/assets/{OAuthConsentScreen-DOLoK6bY.js → OAuthConsentScreen-VJ6Sktnu.js} +1 -1
- package/dist/assets/{PandLWithForecastRoutes-lKoniDxv.js → PandLWithForecastRoutes-BZKucbK0.js} +1 -1
- package/dist/assets/{PeopleRoutes-CBv7SQ8D.js → PeopleRoutes-LWJ1c2L8.js} +1 -1
- package/dist/assets/{PerformanceRoutes-DOGdmtlY.js → PerformanceRoutes-CMz9oUub.js} +1 -1
- package/dist/assets/{Preview-OwLuXuSq.js → Preview-BSxhdK03.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-BlVFH5zG.js → QBOConnectionScreen-C7D9h41-.js} +1 -1
- package/dist/assets/{ReferralListScreen-8JSWVt-7.js → ReferralListScreen-DP-BxHNx.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRoutes-CgceXA7l.js → ReimbursementApprovalRoutes-Dh7-DoxZ.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BImN24-1.js → ReimbursementApprovalRuleDetailScreen-C4Af9N6W.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-BeU8Hdsy.js → ReimbursementRoutes-DGGbUeoK.js} +1 -1
- package/dist/assets/{ReportsRoutes-BuuKCsLq.js → ReportsRoutes-Bbkrsvwd.js} +1 -1
- package/dist/assets/{RewardsRoutes-CcenAkjt.js → RewardsRoutes-DUcsMUDG.js} +1 -1
- package/dist/assets/{ScreenRoutes-IcWHAutY.js → ScreenRoutes-B4ZOmjm0.js} +2 -2
- package/dist/assets/{SettingsRoutes-CH1mDc7s.js → SettingsRoutes-wNec9IzJ.js} +1 -1
- package/dist/assets/{SetupPagesScreen-C_NeLXz4.js → SetupPagesScreen-BgC6pVZV.js} +1 -1
- package/dist/assets/{SignInScreen-BIhK8HqQ.js → SignInScreen-DDpTBOid.js} +1 -1
- package/dist/assets/{SignOutScreen-2bXu_Cpe.js → SignOutScreen-C6dCYibK.js} +1 -1
- package/dist/assets/{TaskListScreen-CUCFe3fy.js → TaskListScreen-De7F5XEz.js} +1 -1
- package/dist/assets/{TaskRoutes-DCWybM7c.js → TaskRoutes-DRSaoggV.js} +1 -1
- package/dist/assets/{TransactionDetailRoutes-nODyFQ1G.js → TransactionDetailRoutes-DkVFZAWc.js} +1 -1
- package/dist/assets/{TransactionDetailScreen-BFCNfSuj.js → TransactionDetailScreen-Bqvo1ABZ.js} +1 -1
- package/dist/assets/{TransactionListRoutes-CyMeQZ7M.js → TransactionListRoutes-RHP59t0s.js} +1 -1
- package/dist/assets/{TreasuryRoutes-BhnV8hs8.js → TreasuryRoutes-DCe5LWRM.js} +1 -1
- package/dist/assets/{VendorsRoutes-C8TiJ3ID.js → VendorsRoutes-Ylebkz2L.js} +1 -1
- package/dist/assets/{WiseConfirmationScreen-UeyKmLiH.js → WiseConfirmationScreen-esZTs404.js} +1 -1
- package/dist/assets/{ZeniAccountRoutes-EJgKENeX.js → ZeniAccountRoutes-CZHZE2g-.js} +1 -1
- package/dist/assets/{ZeniAccountStatementScreen-B7tQCRYA.js → ZeniAccountStatementScreen-B1d8fGk2.js} +1 -1
- package/dist/assets/{accountMappingHelper-xxDKbgY6.js → accountMappingHelper-CniQ3k48.js} +1 -1
- package/dist/assets/{analytics-D9LLahJK.js → analytics-o8UTT6MT.js} +1 -1
- package/dist/assets/{analyticsHelper-BA_yiiPD.js → analyticsHelper-38O5wjc-.js} +1 -1
- package/dist/assets/{core-BXHWSH6o.js → core-D5--W5Ul.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-DEgBTC44.js → decodeURIComponentSafe-6nN4Z37l.js} +1 -1
- package/dist/assets/{dnd-D1FusWvE.js → dnd-1wW2WkhB.js} +1 -1
- package/dist/assets/{empty-rUUW8qXy.js → empty-Bk31eo62.js} +1 -1
- package/dist/assets/{empty-D3a7Terp.js → empty-CRAz5wn0.js} +1 -1
- package/dist/assets/{emptyVideoElement-ByolhRbs.js → emptyVideoElement-C2pq8Y9-.js} +1 -1
- package/dist/assets/{epic-BZy2OdlW.js → epic-BWRxG2kL.js} +1 -1
- package/dist/assets/{getLocaleForTenant-DXvFXHW9.js → getLocaleForTenant-B0LCd9Bs.js} +1 -1
- package/dist/assets/{index-CdUum8m9.js → index-9bugaiEb.js} +2 -2
- package/dist/assets/{index-BSQcTnEi.js → index-B5amnot8.js} +1 -1
- package/dist/assets/{index-CMicf90d.js → index-BbrjBaX2.js} +5 -5
- package/dist/assets/{index-CrFsG-Kl.js → index-BfiHGKlE.js} +1 -1
- package/dist/assets/{index-DFuZY6AH.js → index-D9AS3zec.js} +1 -1
- package/dist/assets/{index-CqsQnZaN.js → index-DPzXwri2.js} +1 -1
- package/dist/assets/{index-DkEoBUP0.js → index-ISnn6fcT.js} +1 -1
- package/dist/assets/{index-BPjVdT23.js → index-kETFnDPM.js} +1 -1
- package/dist/assets/{lexical-M5lTJAid.js → lexical-MdJnvG5R.js} +1 -1
- package/dist/assets/{liveblocks-CIemOhG-.js → liveblocks-BfjqeyQ7.js} +1 -1
- package/dist/assets/{lottie-B2gqVn8r.js → lottie-CY-jVQNU.js} +1 -1
- package/dist/assets/{mui-CDOihXSU.js → mui-BkqswRey.js} +1 -1
- package/dist/assets/{pathToGoBack-CtOd2xg3.js → pathToGoBack-BWtOfbl6.js} +1 -1
- package/dist/assets/{pdf-NpxYPuZF.js → pdf-C9g_mgTQ.js} +3 -3
- package/dist/assets/{pdf-lib-DWrkZXLc.js → pdf-lib-aYi4dqlc.js} +1 -1
- package/dist/assets/{plaid-DnBvUvOI.js → plaid-Dly6vYcb.js} +1 -1
- package/dist/assets/{pusher-BFMykl2k.js → pusher-CDvGiAUt.js} +1 -1
- package/dist/assets/{react-Dy_Hydyd.js → react-B7JnRvNA.js} +1 -1
- package/dist/assets/{react-CLF6YQJD.js → react-BZe3XwC-.js} +1 -1
- package/dist/assets/{react-DkRh_xsn.js → react-C-da2rpv.js} +1 -1
- package/dist/assets/{react-D0hKuvBj.js → react-CiSEBace.js} +1 -1
- package/dist/assets/{react-I9iDEUuR.js → react-DkP-Jf6c.js} +1 -1
- package/dist/assets/{react-CLIVy0Jg.js → react-DvolHBoA.js} +1 -1
- package/dist/assets/{recharts-D7dc1KPB.js → recharts--lP9DGTY.js} +1 -1
- package/dist/assets/{routePaths-CIGM6tzV.js → routePaths-YPF0RRmf.js} +1 -1
- package/dist/assets/{sentry-238zX06J.js → sentry-NLHTFHKl.js} +1 -1
- package/dist/assets/{url-Duo8Rf1y.js → url-BRmvV6sG.js} +1 -1
- package/dist/assets/{url-BN4Uf0Cp.js → url-lDawWlh-.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-CDMT-TGN.js → useAiCfoDashboardSuggestedQuestionsChips-CkuoZ_6p.js} +1 -1
- package/dist/assets/{useAskAiCfoHostNavButtonProps-QHf32w33.js → useAskAiCfoHostNavButtonProps-DWeS72rU.js} +1 -1
- package/dist/assets/{useCashManagementBanner-CwqRCL0P.js → useCashManagementBanner-DpX2hg9r.js} +1 -1
- package/dist/assets/{useChargeCardPusherEvents-B0-Of6tK.js → useChargeCardPusherEvents-DsNcb67V.js} +1 -1
- package/dist/assets/{useDeviceId-CbBc59Iy.js → useDeviceId-CwDMFFV3.js} +1 -1
- package/dist/assets/{useEmailConnectResultRefresh-DiBfHc_1.js → useEmailConnectResultRefresh-B-l5KqUX.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-B2VhczBO.js → useInitialThreadRequest-Crst1isw.js} +1 -1
- package/dist/assets/{utils-BaZQaz5F.js → utils-DKA4xBgw.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-Bmg5vkAc.js → withTransactionSidePanel-Boj3VpnD.js} +1 -1
- package/dist/assets/{zeni-epic-state-Xn27LBb6.js → zeni-epic-state-CP708m5a.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +4 -4
- package/dist/assets/AddressRoutes-D0r3QPI4.js +0 -1
- package/dist/assets/CustomerOnboardingAuthScreen-D3_jNbPY.js +0 -1
- package/dist/assets/NotFoundScreen-BPydeesy.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./liveblocks-BfjqeyQ7.js";import{A as d}from"./AddressScreen-CTBC0Okq.js";import i from"./NotFoundScreen-Dx10N2h0.js";import"./sentry-NLHTFHKl.js";import{o as s,p as r}from"./core-D5--W5Ul.js";import"./zeni-epic-state-CP708m5a.js";import"./recharts--lP9DGTY.js";import"./index-BbrjBaX2.js";import"./mui-BkqswRey.js";import"./analytics-o8UTT6MT.js";import"./plaid-Dly6vYcb.js";import"./dnd-1wW2WkhB.js";import"./stripe-DMRn4zHo.js";import"./lottie-CY-jVQNU.js";import"./lexical-MdJnvG5R.js";import"./pdf-C9g_mgTQ.js";import"./utils-DKA4xBgw.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="cd0ff2b4-1e27-4329-addf-f475e5a9db34",t._sentryDebugIdIdentifier="sentry-dbid-cd0ff2b4-1e27-4329-addf-f475e5a9db34")}catch{}})();function _(){return e.jsxs(s,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(d,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(d,{})}),e.jsx(r,{path:"*",element:e.jsx(i,{})})]})}export{_ as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as d}from"./liveblocks-
|
|
1
|
+
import{j as d}from"./liveblocks-BfjqeyQ7.js";import{a as h}from"./sentry-NLHTFHKl.js";import{h as T,u as _,g as M,i as j,j as E,n as B}from"./core-D5--W5Ul.js";import{Z as L,m as $,z as D,I as K,y as R,J as z,f as C,h as S,r as F,n as b,s as N}from"./index-BbrjBaX2.js";import{MJ as I,hV as U,eX as V,MK as G,c6 as J,ML as O,le as q}from"./zeni-epic-state-CP708m5a.js";import{n as H}from"./mui-BkqswRey.js";import X from"./NotFoundScreen-Dx10N2h0.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]="d349d864-7bfc-4bee-8f9e-ec40836ec5f9",e._sentryDebugIdIdentifier="sentry-dbid-d349d864-7bfc-4bee-8f9e-ec40836ec5f9")}catch{}})();const Z=H.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as c}from"./liveblocks-CIemOhG-.js";import{a as r}from"./sentry-238zX06J.js";import{u as xe,h as Pe,g as we,j as Z,i as ye,n as Ee}from"./core-BXHWSH6o.js";import{X as Te,db as ve,z as Ae,Z as Qe,dc as _e,dd as Oe,ba as K,de as ae,df as Ue,b9 as se,s as M,J as B,f as I,dg as R,dh as je,di as Le,a2 as Fe,h as De,a8 as Be,dj as Re,dk as Ve,a3 as Me,dl as $e,dm as Ge,dn as qe,v as Ne,b5 as He,dp as We}from"./index-CMicf90d.js";import{gm as ze,eW as oe,eX as Xe,iB as Ye,TV as Je,fq as Ze,iL as Ke,iH as et,eY as V,fx as tt,g7 as at,g0 as st,g4 as ee,g8 as ot,g9 as nt,ga as it,gb as rt,gc as lt}from"./zeni-epic-state-Xn27LBb6.js";import{D as dt,n as k,S as ct,P as ut}from"./mui-CDOihXSU.js";import{u as mt}from"./useAiCfoDashboardSuggestedQuestionsChips-CDMT-TGN.js";import{p as pt}from"./pathToGoBack-CtOd2xg3.js";import"./recharts-D7dc1KPB.js";import"./analytics-D9LLahJK.js";import"./plaid-DnBvUvOI.js";import"./dnd-D1FusWvE.js";import"./stripe-DMRn4zHo.js";import"./lottie-B2gqVn8r.js";import"./lexical-M5lTJAid.js";import"./pdf-NpxYPuZF.js";import"./utils-BaZQaz5F.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]="c5573de6-0059-484b-9d9a-90eacaa58cab",e._sentryDebugIdIdentifier="sentry-dbid-c5573de6-0059-484b-9d9a-90eacaa58cab")}catch{}})();const ne="chat-response-generated",ht=Ee(function(e,o){const t=oe(e),u=o.isSubmitting,a=t.uiState?.currentChatSessionId,h=a!=null?tt(e.aiCfoState,a):[],S=Ve(e,{allUsers:o.allUsers,onCardPolicyVendorSearchTextChange:o.onCardPolicyVendorSearchTextChange});return{showSampleQuestions:o.sessionFromUrl==="explore"&&t.uiState.currentChatSessionId==null,aiCfoView:t,isSubmitting:u,isNewChatSession:o.sessionFromUrl==="new_chat"||o.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${Me}/tableDownload`,emailLinkQuestion:o.emailLinkQuestion,autoSubmitEmailLinkQuestion:o.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:o.onEmailLinkQuestionProcessed,routedInitialQuestionSource:o.routedInitialQuestionSource,routedInitialQuestionSuggestionIndex:o.routedInitialQuestionSuggestionIndex,exploreSuggestedPromptQuestions:o.exploreSuggestedPromptQuestions,exploreSuggestedPromptQuestionsLoading:o.exploreSuggestedPromptQuestionsLoading,isFileUploadEnabled:o.isFileUploadEnabled,isUploadPromoVisible:o.isUploadPromoVisible,onUploadPromoClose:o.onUploadPromoClose,syntheticAnswers:h,resolveSyntheticAnswerCardTile:Ge(e),resolveSyntheticAnswerPolicyTile:$e(e),...S}},function(e,o){const{location:t,currentTenant:u,userId:a,navigate:h,currentChatSessionId:S,allSessionsWithOrderedQuestionAnswers:x,isAiCardCreationEnabled:T,isCardPolicyEnabled:v,setIsAiCfoOpen:b}=o,m=u.tenantEmailDomain;return{onEventReceived:(s,l)=>{if(s===ne&&typeof l.text=="string"&&typeof l.metadata=="object"){const d=l,g=nt(d.type),p=d.metadata.chat_session_id??null,{currentChatSession:n,currentQuestionAnswer:P,currentQuestionAnswerSummary:A}=se(x,p);g!=="answer"?I.trackAICFOChatResponseGenerated(g,P?.question.questionText??"",d.text,p,We(A,n),d.metadata.message_id??null):I.trackAICFOChatAnswerGenerated(d.text,P?.question.questionText??"",(d.follow_up_questions?.length??0)>0,!!d.assumptions,!!d.insights,d.visualization!=null,it(d.visualization?.type??"")??null,p,d.summarized_title,d.metadata.message_id??null),e(rt({chatSessionId:d.metadata.chat_session_id,responseType:g,fetchState:{fetchState:"Completed",error:void 0}})),e(lt({chatSessionId:d.metadata.chat_session_id,answerPayload:d,userId:a}))}},onSubmit:(s,l,d,g)=>{s&&He(e,s,l,S,x,a,g,d)},updateCurrentInput:s=>{e(ee(s))},onStopSubmit:()=>{},onUpdateScrollYOffset:s=>{e(ot(s))},onSelectSampleQuestion:()=>{},onBackClick:()=>{h(-1)},onCloseClick:()=>{const s=M(t.state?.pathnameStackToGoBack),l=s.poppedPathname??pt(1);h(l,{state:{...t.state,pathnameStackToGoBack:s.newStack}}),e(ee(""))},togglePageView:()=>{const s=M(t.state?.pathnameStackToGoBack),l=s.poppedPathname??`/${u.tenantEmailDomain}/dashboard`;h(l,{state:{...ae(t.state),pathnameStackToGoBack:s.newStack,message:"open_ai_cfo_drawer"}}),b(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{h(-1)},onNewChatClick:()=>{S!=null&&e(st());const s=Ne(t.state?.pathnameStackToGoBack,t.pathname);h(`/${u.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:s.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(s,l)=>{e(at({questionAnswerId:s,isCollapsed:l}))},onMenuClick:o.onMenuClick,...qe(e,{isAiCardCreationEnabled:T,isCardPolicyEnabled:v,currentChatSessionId:S,onAfterCardsCreationSubmit:()=>{b(!0),h(`/${m}/cards`,{state:{...t.state}})},onAfterCardPolicySubmit:()=>{b(!0),h(`/${m}/cards/policy`,{state:{...t.state}})}})}})(Be(Re)),Ft=({isFileUploadEnabled:e})=>{const{setIsAiCfoOpen:o}=Te(),t=xe(),u=Pe(),a=we(),[h,S]=r.useState(!1),{allUsers:x,isAiCardCreationEnabled:T,isCardPolicyEnabled:v,onCardPolicyVendorSearchTextChange:b}=ve();r.useEffect(()=>{t(ze())},[t]);const m=Z(i=>oe(i)),s=Ae.getSignedInUser(),{session_id:l}=ye(),d=Qe(),g=Fe(d),p=Z(i=>Xe(i)),n=m.uiState.currentChatSessionId,P=p.tenantEmailDomain,{handleUploadPromoClose:A,isUploadPromoVisible:ie}=_e({isFileUploadEnabled:e,tenantEmailDomain:P}),Q=Oe({currentTenant:p,currentChatSessionId:n,aiCfoView:m}),{isSuggestedQuestionsLoading:re,suggestedPromptQuestions:le}=mt(),w=a.state,y=w?.aiCfoInitialQuestion,$=!!w?.aiCfoShouldSubmit;r.useEffect(()=>{const i=a.state;if(i?.[K]!==!0)return;S(!0);const f={...i};delete f[K],u(a,{replace:!0,state:f})},[a.pathname,a.search,a.state,u]);const[de,_]=r.useState(null),[ce,O]=r.useState(!1),[ue,U]=r.useState(void 0),[me,j]=r.useState(void 0),G=r.useRef(!1);r.useEffect(()=>{if(!G.current&&y!=null&&y!==""){const i=a.state;_(y),O($),U(i?.aiCfoInitialSubmissionSource!=null?i.aiCfoInitialSubmissionSource:void 0);const f=i?.aiCfoSuggestionIndex;j(typeof f=="number"?f:void 0),G.current=!0}},[y,$,a.state]);const pe=r.useCallback(()=>{_(null),O(!1),U(void 0),j(void 0),u(a.pathname,{replace:!0,state:ae(a.state)})},[a.pathname,a.state,u]),q=r.useMemo(()=>new URLSearchParams(a.search),[a.search]),N=q.get("ref")??w?.aiCfoRef,L=q.get("emailRefId")??w?.aiCfoEmailRefId,H=r.useRef(!1);r.useEffect(()=>{H.current||N!=="month-end-email"||L==null||n!=null||s==null||(t(Ye("controller",s.userId,L,"MONTH_END_EMAIL")),H.current=!0)},[N,L,n,t,s]);const E=m.uiState.lastContextMessage;r.useEffect(()=>{E!=null&&E!==""&&n!=null&&(_(E),O(!0),U(void 0),j(void 0),t(Je()))},[E,n,t]);const he=p.masterTOSInfo,C=he?.isMasterTOSAccepted??!1,{visitedSessions:W}=Ue(n),F=m.fetchState,D=m.uiState.chatSessionsNextPageToken.hasMore||!m.uiState.chatSessionsFirstPageFetched,z=n!=null?m.fetchChatSessionHistoryByChatSessionId?.[n]?.fetchState??"Not-Started":"Not-Started",X=n==null||(m.uiState.chatHistoryNextPageToken[n]?.hasMore??!0),Y=m.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:Se}=se(Y,n),ge=Se.length===0;r.useEffect(()=>{C||g||u("../dashboard",{state:{...a.state,message:"open_ai_cfo_drawer"}})},[C,g,u,a.state]);const fe=r.useCallback(()=>{const i=M(a.state?.pathnameStackToGoBack),f=p.tenantEmailDomain;u(i.poppedPathname??(f!=null?`/${f}/dashboard`:".."),{state:{...a.state,pathnameStackToGoBack:i.newStack}})},[p.tenantEmailDomain,a.state,u]);r.useEffect(()=>{n!=null&&l!==n&&u(`../ai-cfo/${n}`,{state:{...a.state}})},[n,l]),r.useEffect(()=>{l!=null&&n==null&&l!=="new_chat"&&l!=="explore"&&t(Ze({sessionId:l,agentId:"controller"}))},[]);const Ce=r.useMemo(()=>({events:W.map(i=>`private-encrypted-chat-${i}.${ne}`),eventCallback:(i,f,ke)=>ke.onEventReceived(i,f)}),[W]);r.useEffect(()=>{F!=="In-Progress"&&D&&t(Ke())},[F,D,t]),r.useEffect(()=>{n!=null&&z!=="In-Progress"&&X&&s!=null&&F==="Completed"&&!D&&t(et(n,s.userId))},[z,X,n,s,t]);const J=i=>i.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(s==null||l==null)throw Error("Can't access AI Controller page without signing in...");const be=n!=null&&m.responseStateByChatSessionId?.[n]?.answer?.fetchState==="In-Progress";if(!C&&g)return c.jsxs(gt,{children:[c.jsx(B,{analytics:I,onLoad:J}),Q.drawerElement,c.jsx(ft,{children:c.jsx(te,{children:c.jsx(R,{isTOSAccepted:!1,acceptMasterTOSState:m.masterTOSAcceptanceState,onCloseClick:fe,onCompleteClick:()=>{p.userRoleId!=null&&t(V(p.userRoleId))}})})})]});const Ie=c.jsxs(c.Fragment,{children:[h&&!C?c.jsx(B,{analytics:I,onLoad:J}):null,c.jsx(R,{isTOSAccepted:C,acceptMasterTOSState:m.masterTOSAcceptanceState,showHeader:!1,togglePageView:C?()=>S(!1):void 0,onCloseClick:()=>S(!1),onCompleteClick:()=>{C||p.userRoleId==null||t(V(p.userRoleId)),S(!1)}})]});return c.jsxs(c.Fragment,{children:[c.jsxs(St,{children:[c.jsx(B,{analytics:I,onLoad:i=>i.trackPageLoaded(De.Event.aiCFOPage)}),g&&Q.drawerElement,c.jsx(ht,{...Ce,currentChatSessionId:n,allSessionsWithOrderedQuestionAnswers:Y,allUsers:x,isAiCardCreationEnabled:T,isCardPolicyEnabled:v,openOnboardingPage:()=>S(!0),userId:s.userId,setIsAiCfoOpen:o,navigate:u,sessionFromUrl:l,location:a,isSubmitting:be,isEmptyChatWithSession:ge,currentTenant:p,emailLinkQuestion:de??void 0,autoSubmitEmailLinkQuestion:ce,onEmailLinkQuestionProcessed:pe,routedInitialQuestionSource:ue,routedInitialQuestionSuggestionIndex:me,onCardPolicyVendorSearchTextChange:b,onMenuClick:g?Q.open:void 0,isFileUploadEnabled:e,isUploadPromoVisible:ie,onUploadPromoClose:A,exploreSuggestedPromptQuestions:le,exploreSuggestedPromptQuestionsLoading:re}),h&&g?c.jsx(dt,{anchor:"right",open:h,transitionDuration:250,PaperProps:{component:Ct,style:{width:"100%"}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>S(!1),children:c.jsx(te,{onClick:i=>i.stopPropagation(),children:c.jsx(R,{isTOSAccepted:C,acceptMasterTOSState:m.masterTOSAcceptanceState,onCloseClick:()=>S(!1),onCompleteClick:()=>{C||p.userRoleId==null||t(V(p.userRoleId)),S(!1)}})})}):null]}),h&&!g?c.jsx(je,{open:h,onClose:()=>S(!1),children:c.jsx(Le,{children:Ie})}):null]})},te=k(ct)`
|
|
1
|
+
import{j as c}from"./liveblocks-BfjqeyQ7.js";import{a as r}from"./sentry-NLHTFHKl.js";import{u as xe,h as Pe,g as we,j as Z,i as ye,n as Ee}from"./core-D5--W5Ul.js";import{X as Te,db as ve,z as Ae,Z as Qe,dc as _e,dd as Oe,ba as K,de as ae,df as Ue,b9 as se,s as M,J as B,f as I,dg as R,dh as je,di as Le,a2 as Fe,h as De,a8 as Be,dj as Re,dk as Ve,a3 as Me,dl as $e,dm as Ge,dn as qe,v as Ne,b5 as He,dp as We}from"./index-BbrjBaX2.js";import{gm as ze,eW as oe,eX as Xe,iB as Ye,TV as Je,fq as Ze,iL as Ke,iH as et,eY as V,fx as tt,g7 as at,g0 as st,g4 as ee,g8 as ot,g9 as nt,ga as it,gb as rt,gc as lt}from"./zeni-epic-state-CP708m5a.js";import{D as dt,n as k,S as ct,P as ut}from"./mui-BkqswRey.js";import{u as mt}from"./useAiCfoDashboardSuggestedQuestionsChips-CkuoZ_6p.js";import{p as pt}from"./pathToGoBack-BWtOfbl6.js";import"./recharts--lP9DGTY.js";import"./analytics-o8UTT6MT.js";import"./plaid-Dly6vYcb.js";import"./dnd-1wW2WkhB.js";import"./stripe-DMRn4zHo.js";import"./lottie-CY-jVQNU.js";import"./lexical-MdJnvG5R.js";import"./pdf-C9g_mgTQ.js";import"./utils-DKA4xBgw.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]="c5573de6-0059-484b-9d9a-90eacaa58cab",e._sentryDebugIdIdentifier="sentry-dbid-c5573de6-0059-484b-9d9a-90eacaa58cab")}catch{}})();const ne="chat-response-generated",ht=Ee(function(e,o){const t=oe(e),u=o.isSubmitting,a=t.uiState?.currentChatSessionId,h=a!=null?tt(e.aiCfoState,a):[],S=Ve(e,{allUsers:o.allUsers,onCardPolicyVendorSearchTextChange:o.onCardPolicyVendorSearchTextChange});return{showSampleQuestions:o.sessionFromUrl==="explore"&&t.uiState.currentChatSessionId==null,aiCfoView:t,isSubmitting:u,isNewChatSession:o.sessionFromUrl==="new_chat"||o.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${Me}/tableDownload`,emailLinkQuestion:o.emailLinkQuestion,autoSubmitEmailLinkQuestion:o.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:o.onEmailLinkQuestionProcessed,routedInitialQuestionSource:o.routedInitialQuestionSource,routedInitialQuestionSuggestionIndex:o.routedInitialQuestionSuggestionIndex,exploreSuggestedPromptQuestions:o.exploreSuggestedPromptQuestions,exploreSuggestedPromptQuestionsLoading:o.exploreSuggestedPromptQuestionsLoading,isFileUploadEnabled:o.isFileUploadEnabled,isUploadPromoVisible:o.isUploadPromoVisible,onUploadPromoClose:o.onUploadPromoClose,syntheticAnswers:h,resolveSyntheticAnswerCardTile:Ge(e),resolveSyntheticAnswerPolicyTile:$e(e),...S}},function(e,o){const{location:t,currentTenant:u,userId:a,navigate:h,currentChatSessionId:S,allSessionsWithOrderedQuestionAnswers:x,isAiCardCreationEnabled:T,isCardPolicyEnabled:v,setIsAiCfoOpen:b}=o,m=u.tenantEmailDomain;return{onEventReceived:(s,l)=>{if(s===ne&&typeof l.text=="string"&&typeof l.metadata=="object"){const d=l,g=nt(d.type),p=d.metadata.chat_session_id??null,{currentChatSession:n,currentQuestionAnswer:P,currentQuestionAnswerSummary:A}=se(x,p);g!=="answer"?I.trackAICFOChatResponseGenerated(g,P?.question.questionText??"",d.text,p,We(A,n),d.metadata.message_id??null):I.trackAICFOChatAnswerGenerated(d.text,P?.question.questionText??"",(d.follow_up_questions?.length??0)>0,!!d.assumptions,!!d.insights,d.visualization!=null,it(d.visualization?.type??"")??null,p,d.summarized_title,d.metadata.message_id??null),e(rt({chatSessionId:d.metadata.chat_session_id,responseType:g,fetchState:{fetchState:"Completed",error:void 0}})),e(lt({chatSessionId:d.metadata.chat_session_id,answerPayload:d,userId:a}))}},onSubmit:(s,l,d,g)=>{s&&He(e,s,l,S,x,a,g,d)},updateCurrentInput:s=>{e(ee(s))},onStopSubmit:()=>{},onUpdateScrollYOffset:s=>{e(ot(s))},onSelectSampleQuestion:()=>{},onBackClick:()=>{h(-1)},onCloseClick:()=>{const s=M(t.state?.pathnameStackToGoBack),l=s.poppedPathname??pt(1);h(l,{state:{...t.state,pathnameStackToGoBack:s.newStack}}),e(ee(""))},togglePageView:()=>{const s=M(t.state?.pathnameStackToGoBack),l=s.poppedPathname??`/${u.tenantEmailDomain}/dashboard`;h(l,{state:{...ae(t.state),pathnameStackToGoBack:s.newStack,message:"open_ai_cfo_drawer"}}),b(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{h(-1)},onNewChatClick:()=>{S!=null&&e(st());const s=Ne(t.state?.pathnameStackToGoBack,t.pathname);h(`/${u.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:s.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(s,l)=>{e(at({questionAnswerId:s,isCollapsed:l}))},onMenuClick:o.onMenuClick,...qe(e,{isAiCardCreationEnabled:T,isCardPolicyEnabled:v,currentChatSessionId:S,onAfterCardsCreationSubmit:()=>{b(!0),h(`/${m}/cards`,{state:{...t.state}})},onAfterCardPolicySubmit:()=>{b(!0),h(`/${m}/cards/policy`,{state:{...t.state}})}})}})(Be(Re)),Ft=({isFileUploadEnabled:e})=>{const{setIsAiCfoOpen:o}=Te(),t=xe(),u=Pe(),a=we(),[h,S]=r.useState(!1),{allUsers:x,isAiCardCreationEnabled:T,isCardPolicyEnabled:v,onCardPolicyVendorSearchTextChange:b}=ve();r.useEffect(()=>{t(ze())},[t]);const m=Z(i=>oe(i)),s=Ae.getSignedInUser(),{session_id:l}=ye(),d=Qe(),g=Fe(d),p=Z(i=>Xe(i)),n=m.uiState.currentChatSessionId,P=p.tenantEmailDomain,{handleUploadPromoClose:A,isUploadPromoVisible:ie}=_e({isFileUploadEnabled:e,tenantEmailDomain:P}),Q=Oe({currentTenant:p,currentChatSessionId:n,aiCfoView:m}),{isSuggestedQuestionsLoading:re,suggestedPromptQuestions:le}=mt(),w=a.state,y=w?.aiCfoInitialQuestion,$=!!w?.aiCfoShouldSubmit;r.useEffect(()=>{const i=a.state;if(i?.[K]!==!0)return;S(!0);const f={...i};delete f[K],u(a,{replace:!0,state:f})},[a.pathname,a.search,a.state,u]);const[de,_]=r.useState(null),[ce,O]=r.useState(!1),[ue,U]=r.useState(void 0),[me,j]=r.useState(void 0),G=r.useRef(!1);r.useEffect(()=>{if(!G.current&&y!=null&&y!==""){const i=a.state;_(y),O($),U(i?.aiCfoInitialSubmissionSource!=null?i.aiCfoInitialSubmissionSource:void 0);const f=i?.aiCfoSuggestionIndex;j(typeof f=="number"?f:void 0),G.current=!0}},[y,$,a.state]);const pe=r.useCallback(()=>{_(null),O(!1),U(void 0),j(void 0),u(a.pathname,{replace:!0,state:ae(a.state)})},[a.pathname,a.state,u]),q=r.useMemo(()=>new URLSearchParams(a.search),[a.search]),N=q.get("ref")??w?.aiCfoRef,L=q.get("emailRefId")??w?.aiCfoEmailRefId,H=r.useRef(!1);r.useEffect(()=>{H.current||N!=="month-end-email"||L==null||n!=null||s==null||(t(Ye("controller",s.userId,L,"MONTH_END_EMAIL")),H.current=!0)},[N,L,n,t,s]);const E=m.uiState.lastContextMessage;r.useEffect(()=>{E!=null&&E!==""&&n!=null&&(_(E),O(!0),U(void 0),j(void 0),t(Je()))},[E,n,t]);const he=p.masterTOSInfo,C=he?.isMasterTOSAccepted??!1,{visitedSessions:W}=Ue(n),F=m.fetchState,D=m.uiState.chatSessionsNextPageToken.hasMore||!m.uiState.chatSessionsFirstPageFetched,z=n!=null?m.fetchChatSessionHistoryByChatSessionId?.[n]?.fetchState??"Not-Started":"Not-Started",X=n==null||(m.uiState.chatHistoryNextPageToken[n]?.hasMore??!0),Y=m.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:Se}=se(Y,n),ge=Se.length===0;r.useEffect(()=>{C||g||u("../dashboard",{state:{...a.state,message:"open_ai_cfo_drawer"}})},[C,g,u,a.state]);const fe=r.useCallback(()=>{const i=M(a.state?.pathnameStackToGoBack),f=p.tenantEmailDomain;u(i.poppedPathname??(f!=null?`/${f}/dashboard`:".."),{state:{...a.state,pathnameStackToGoBack:i.newStack}})},[p.tenantEmailDomain,a.state,u]);r.useEffect(()=>{n!=null&&l!==n&&u(`../ai-cfo/${n}`,{state:{...a.state}})},[n,l]),r.useEffect(()=>{l!=null&&n==null&&l!=="new_chat"&&l!=="explore"&&t(Ze({sessionId:l,agentId:"controller"}))},[]);const Ce=r.useMemo(()=>({events:W.map(i=>`private-encrypted-chat-${i}.${ne}`),eventCallback:(i,f,ke)=>ke.onEventReceived(i,f)}),[W]);r.useEffect(()=>{F!=="In-Progress"&&D&&t(Ke())},[F,D,t]),r.useEffect(()=>{n!=null&&z!=="In-Progress"&&X&&s!=null&&F==="Completed"&&!D&&t(et(n,s.userId))},[z,X,n,s,t]);const J=i=>i.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(s==null||l==null)throw Error("Can't access AI Controller page without signing in...");const be=n!=null&&m.responseStateByChatSessionId?.[n]?.answer?.fetchState==="In-Progress";if(!C&&g)return c.jsxs(gt,{children:[c.jsx(B,{analytics:I,onLoad:J}),Q.drawerElement,c.jsx(ft,{children:c.jsx(te,{children:c.jsx(R,{isTOSAccepted:!1,acceptMasterTOSState:m.masterTOSAcceptanceState,onCloseClick:fe,onCompleteClick:()=>{p.userRoleId!=null&&t(V(p.userRoleId))}})})})]});const Ie=c.jsxs(c.Fragment,{children:[h&&!C?c.jsx(B,{analytics:I,onLoad:J}):null,c.jsx(R,{isTOSAccepted:C,acceptMasterTOSState:m.masterTOSAcceptanceState,showHeader:!1,togglePageView:C?()=>S(!1):void 0,onCloseClick:()=>S(!1),onCompleteClick:()=>{C||p.userRoleId==null||t(V(p.userRoleId)),S(!1)}})]});return c.jsxs(c.Fragment,{children:[c.jsxs(St,{children:[c.jsx(B,{analytics:I,onLoad:i=>i.trackPageLoaded(De.Event.aiCFOPage)}),g&&Q.drawerElement,c.jsx(ht,{...Ce,currentChatSessionId:n,allSessionsWithOrderedQuestionAnswers:Y,allUsers:x,isAiCardCreationEnabled:T,isCardPolicyEnabled:v,openOnboardingPage:()=>S(!0),userId:s.userId,setIsAiCfoOpen:o,navigate:u,sessionFromUrl:l,location:a,isSubmitting:be,isEmptyChatWithSession:ge,currentTenant:p,emailLinkQuestion:de??void 0,autoSubmitEmailLinkQuestion:ce,onEmailLinkQuestionProcessed:pe,routedInitialQuestionSource:ue,routedInitialQuestionSuggestionIndex:me,onCardPolicyVendorSearchTextChange:b,onMenuClick:g?Q.open:void 0,isFileUploadEnabled:e,isUploadPromoVisible:ie,onUploadPromoClose:A,exploreSuggestedPromptQuestions:le,exploreSuggestedPromptQuestionsLoading:re}),h&&g?c.jsx(dt,{anchor:"right",open:h,transitionDuration:250,PaperProps:{component:Ct,style:{width:"100%"}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>S(!1),children:c.jsx(te,{onClick:i=>i.stopPropagation(),children:c.jsx(R,{isTOSAccepted:C,acceptMasterTOSState:m.masterTOSAcceptanceState,onCloseClick:()=>S(!1),onCompleteClick:()=>{C||p.userRoleId==null||t(V(p.userRoleId)),S(!1)}})})}):null]}),h&&!g?c.jsx(je,{open:h,onClose:()=>S(!1),children:c.jsx(Le,{children:Ie})}):null]})},te=k(ct)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as c}from"./liveblocks-CIemOhG-.js";import{a as v}from"./sentry-238zX06J.js";import{h as U,g as j,u as B,j as y,N as z,n as P,i as W,o as te,p as x}from"./core-BXHWSH6o.js";import{eX as k,Q7 as A,PP as h,zr as E,zj as q,zn as R,zc as K,PR as M,zt as ae,zf as Q,zw as X,zs as C}from"./zeni-epic-state-Xn27LBb6.js";import{z as V,a8 as G,bM as oe,af as O,bD as H,bN as le,m as J,y as Y,bO as pe,bP as se}from"./index-CMicf90d.js";import"./mui-CDOihXSU.js";import{u as Z,i as ne}from"./ReimbursementApprovalRuleDetailScreen-BImN24-1.js";import re from"./NotFoundScreen-BPydeesy.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]="481592ee-5d72-455c-a4b9-654554e88cb0",e._sentryDebugIdIdentifier="sentry-dbid-481592ee-5d72-455c-a4b9-654554e88cb0")}catch{}})();const T="bill-approval-rule-update",ie=P(function(e){return{approvalView:A(e),billPaySetupApproverViewUpdateData:h(e).billPaySetupApproverViewUpdateData}},function(e,p){const{navigate:t,location:o}=p;return{onApprovalRulesEventReceived:a=>{a.endsWith(T)&&e(M(!1))},onBackClick:()=>{O(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(K(a,!1))},onEditRuleClick:a=>{a!=null?(e(R(a)),t(`./${a}/edit`)):(e(R()),t("./new"))}}})(G(oe)),ce=({isLoading:e})=>{const p=U(),t=j(),o=B(),[a,r]=v.useState(!1),[n,d]=v.useState(!1),l=y(s=>s.billPaySetupApproverViewState.fetchState),u=y(s=>k(s)),i=y(s=>A(s)),f=y(s=>h(s).billPaySetupApproverViewUpdateData);if(v.useEffect(()=>{f?.updateStatus.fetchState==="Completed"&&o(E())},[f]),v.useEffect(()=>{a||l!=="Not-Started"||e||(r(!0),o(q(!0,!0,!1)))},[a,l,e,o]),V.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");v.useEffect(()=>{i.allApprovalRules.length===0&&i.fetchState==="Completed"&&(n||(d(!0),o(R())),p("./new"))},[n,i,o]);const m={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${T}`]:[],eventCallback:(s,w,S)=>{s.endsWith(T)&&S.onApprovalRulesEventReceived(s)}};return u?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?c.jsx(z,{to:"../../promo"}):c.jsx(ie,{currentTenant:u,location:t,navigate:p,...m})},_="bill-approval-rule-update",ue=P(function(e){const p=A(e),t=h(e).billPaySetupApproverViewUpdateData,o={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o[r.id]=r.name);const a={};for(const r of Object.values(e.classState.classesByKey))r?.classId!=null&&(a[r.classId]=r.className);return{approvalView:p,billPaySetupApproverViewUpdateData:t,vendorNamesById:o,departmentNamesById:a}},function(e,p){const{navigate:t,location:o}=p;return{onApprovalRulesEventReceived:a=>{a.endsWith(_)&&e(M(!1))},onBackClick:()=>{O(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(K(a,!0))},onEditRuleClick:a=>{a!=null?(e(R(a)),t(`./${a}/edit`)):(e(R()),t("./new"))},onReorderRules:a=>{e(ae(a,!0))}}})(G(le)),de=()=>{const e=y(o=>k(o)),{isApprovalRulesV3Enabled:p,isLoading:t}=H(e?.tenantId);return p?c.jsx(ve,{isLoading:t}):c.jsx(ce,{isLoading:t})},ve=({isLoading:e})=>{const p=U(),t=j(),o=B(),[a,r]=v.useState(!1),[n,d]=v.useState(!1),l=y(s=>s.billPaySetupApproverViewState.fetchState),u=y(s=>k(s));Z();const i=y(s=>A(s)),f=y(s=>h(s).billPaySetupApproverViewUpdateData);if(v.useEffect(()=>{f?.updateStatus.fetchState==="Completed"&&o(E())},[f]),v.useEffect(()=>{a||l!=="Not-Started"||e||(r(!0),o(q(!0,!0,!0)))},[a,l,e,o]),V.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");v.useEffect(()=>{i.allApprovalRules.length===0&&i.fetchState==="Completed"&&(n||(d(!0),o(R())),p("./new"))},[n,i,o]);const m={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${_}`]:[],eventCallback:(s,w,S)=>{s.endsWith(_)&&S.onApprovalRulesEventReceived(s)}};return u?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?c.jsx(z,{to:"../../promo"}):c.jsx(ue,{currentTenant:u,location:t,navigate:p,isLoading:e,...m})},fe=P(function(e,p){const t=h(e),o=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=o==="approval_create"&&t.allApprovalRules.length!==0;let r=t.allApprovalRules.length===0;return p.approvalRuleId&&(r=t.allApprovalRules.findIndex(n=>n.approvalRuleId===p.approvalRuleId)===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:r,approvalUpdateActionType:o}},function(e,p){const{navigate:t,approvalUpdateDataView:o,approverViewData:a,approvalRuleId:r}=p,n=o.billPaySetupApproverViewUpdateData?.type,d=O(p.location);return{onApprovalRuleDataUpdated:l=>{const u=f=>{const m=[];return f.forEach(s=>{const w=s.actors.selectedUsers.map(b=>({type:"user",userId:b.userId,isImplicitActor:!1})),S=s.actors.selectedNonUsers.map(b=>{const I=!!ne(b.value);return{type:I?"attribute":"role",subType:b.value,userId:void 0,idType:void 0,isImplicitActor:!I}}),g=w.concat(S);m.push({action:s.stepType.selectedOption,actors:g,operator:g.length>1?s.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),m},i={amount:{type:"amount",comparator:"range",min:{amount:l.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:l.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(n==="approval_create"){const f={criteria:i,steps:u(l.steps),isApplicableOnPendingApprovalEntity:l.applyToExistingBills.includes("applyToExistingBills")};e(C(f))}else{const f={approvalRuleId:r,criteria:i,steps:u(l.steps),isApplicableOnPendingApprovalEntity:l.applyToExistingBills.includes("applyToExistingBills")};e(C(f))}},onResetClick:()=>{e(E()),n==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),n==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(X(!1))},onSaveRuleSuccess:()=>{t("../")}}})(pe);function ye(){const e=U(),p=B(),t=j(),{approvalRuleId:o}=W(),a=V.getSignedInUser(),r=J(),n=y(i=>h(i)),d=y(i=>A(i)),[l,u]=v.useState(!1);if(v.useEffect(()=>{l||(u(!0),p(Q(!0)))}),v.useEffect(()=>{d.fetchState==="Not-Started"&&e(o!=null?"../../":"../")},[d,o]),a==null)throw Error("Can't access address page without signing in...");return n.approverListFetchStatus.fetchState=="Not-Started"||n.approverListFetchStatus.fetchState==="In-Progress"?c.jsx(Y,{fetchState:n.approverListFetchStatus.fetchState,style:{backgroundColor:r.colors.grey5}}):c.jsx(fe,{navigate:e,approvalUpdateDataView:n,approvalRuleId:o,approverViewData:d,location:t})}const ge=P(function(e,p){const t=h(e),o=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=[],r={};for(const n of Object.values(e.vendorState.vendorByID))n?.id!=null&&(a.push(n.id),r[n.id]=n.name);return{localData:t,approvalUpdateActionType:o,allVendorIds:a,vendorNamesById:r,editingRuleId:o==="approval_update"?p.approvalRuleId:void 0,allApprovalRulesWithUser:A(e).allApprovalRules}},function(e,p){const{navigate:t,approvalUpdateDataView:o,approverViewData:a,approvalRuleId:r}=p,n=o.billPaySetupApproverViewUpdateData?.type,d=O(p.location);return{onApprovalRuleDataUpdated:l=>{const u=g=>{const b=[];return g.forEach(I=>{const L=I.actorKind?.selectedOption,N=I.selectedRole?.selectedOption;let D=[];L==="role"&&N!=null?D=[{type:"attribute",subType:N,userId:void 0,idType:void 0,isImplicitActor:!1}]:L==="specific_person"&&(D=(I.persons?.selectedUsers??[]).map(ee=>({type:"user",userId:ee.userId,isImplicitActor:!1})));const F=I.action??"require_approval";b.push({action:F,actors:D,operator:D.length>1?F==="require_approval"?"or":"and":"is"})}),b},i=l.amountCriteria,f=l.vendorCriteria,m=l.departmentCriteria,s={};if(i!=null&&i.comparator.selectedOption!=null){const g=i.comparator.selectedOption;s.amount={type:"amount",comparator:g,min:g==="less_than"?void 0:i.min,max:g==="greater_than"?void 0:i.max}}const w=f?.selection.selectedOptions??[];w.length>0&&(s.vendor={type:"vendor",operator:f?.operator.selectedOption??"is",vendorIds:w});const S=m?.selection.selectedOptions??[];if(S.length>0&&(s.department={type:"department",operator:m?.operator.selectedOption??"is",departmentIds:S}),n==="approval_create"){const g={name:l.name,description:l.description,separationOfDuties:l.separationOfDuties,isFallback:l.isFallback,criteria:s,steps:u(l.steps),isApplicableOnPendingApprovalEntity:l.applyToExistingBills.includes("applyToExistingBills")};e(C(g))}else{const g={approvalRuleId:r,name:l.name,description:l.description,separationOfDuties:l.separationOfDuties,isFallback:l.isFallback,criteria:s,steps:u(l.steps),isApplicableOnPendingApprovalEntity:l.applyToExistingBills.includes("applyToExistingBills")};e(C(g))}},onResetClick:()=>{e(E()),n==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),n==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(X(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:l=>{e(R(l)),t(n==="approval_update"?`../../${l}/edit`:`../${l}/edit`)}}})(se);function $(){const e=y(t=>k(t)),{isApprovalRulesV3Enabled:p}=H(e?.tenantId);return p?c.jsx(me,{}):c.jsx(ye,{})}function me(){const e=U(),p=B(),t=j(),{approvalRuleId:o}=W(),a=V.getSignedInUser(),r=J(),n=y(i=>h(i)),d=y(i=>A(i)),[l,u]=v.useState(!1);if(Z(),v.useEffect(()=>{l||(u(!0),p(Q(!0)))}),v.useEffect(()=>{d.fetchState==="Not-Started"&&e(o!=null?"../../":"../")},[d,o]),a==null)throw Error("Can't access address page without signing in...");return n.approverListFetchStatus.fetchState=="Not-Started"||n.approverListFetchStatus.fetchState==="In-Progress"?c.jsx(Y,{fetchState:n.approverListFetchStatus.fetchState,style:{backgroundColor:r.colors.grey5}}):c.jsx(ge,{navigate:e,approvalUpdateDataView:n,approvalRuleId:o,approverViewData:d,location:t},o??"new")}function De(){return c.jsxs(te,{children:[c.jsx(x,{path:"/",element:c.jsx(de,{})}),c.jsx(x,{path:"/new",element:c.jsx($,{})}),c.jsx(x,{path:"/:approvalRuleId/edit",element:c.jsx($,{})}),c.jsx(x,{path:"*",element:c.jsx(re,{})})]})}export{De as B};
|
|
1
|
+
import{j as c}from"./liveblocks-BfjqeyQ7.js";import{a as v}from"./sentry-NLHTFHKl.js";import{h as U,g as j,u as B,j as y,N as z,n as P,i as W,o as te,p as x}from"./core-D5--W5Ul.js";import{eX as k,Q7 as A,PP as h,zr as E,zj as q,zn as R,zc as K,PR as M,zt as ae,zf as Q,zw as X,zs as C}from"./zeni-epic-state-CP708m5a.js";import{z as V,a8 as G,bM as oe,af as O,bD as H,bN as le,m as J,y as Y,bO as pe,bP as se}from"./index-BbrjBaX2.js";import"./mui-BkqswRey.js";import{u as Z,i as ne}from"./ReimbursementApprovalRuleDetailScreen-C4Af9N6W.js";import re from"./NotFoundScreen-Dx10N2h0.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]="481592ee-5d72-455c-a4b9-654554e88cb0",e._sentryDebugIdIdentifier="sentry-dbid-481592ee-5d72-455c-a4b9-654554e88cb0")}catch{}})();const T="bill-approval-rule-update",ie=P(function(e){return{approvalView:A(e),billPaySetupApproverViewUpdateData:h(e).billPaySetupApproverViewUpdateData}},function(e,p){const{navigate:t,location:o}=p;return{onApprovalRulesEventReceived:a=>{a.endsWith(T)&&e(M(!1))},onBackClick:()=>{O(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(K(a,!1))},onEditRuleClick:a=>{a!=null?(e(R(a)),t(`./${a}/edit`)):(e(R()),t("./new"))}}})(G(oe)),ce=({isLoading:e})=>{const p=U(),t=j(),o=B(),[a,r]=v.useState(!1),[n,d]=v.useState(!1),l=y(s=>s.billPaySetupApproverViewState.fetchState),u=y(s=>k(s)),i=y(s=>A(s)),f=y(s=>h(s).billPaySetupApproverViewUpdateData);if(v.useEffect(()=>{f?.updateStatus.fetchState==="Completed"&&o(E())},[f]),v.useEffect(()=>{a||l!=="Not-Started"||e||(r(!0),o(q(!0,!0,!1)))},[a,l,e,o]),V.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");v.useEffect(()=>{i.allApprovalRules.length===0&&i.fetchState==="Completed"&&(n||(d(!0),o(R())),p("./new"))},[n,i,o]);const m={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${T}`]:[],eventCallback:(s,w,S)=>{s.endsWith(T)&&S.onApprovalRulesEventReceived(s)}};return u?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?c.jsx(z,{to:"../../promo"}):c.jsx(ie,{currentTenant:u,location:t,navigate:p,...m})},_="bill-approval-rule-update",ue=P(function(e){const p=A(e),t=h(e).billPaySetupApproverViewUpdateData,o={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o[r.id]=r.name);const a={};for(const r of Object.values(e.classState.classesByKey))r?.classId!=null&&(a[r.classId]=r.className);return{approvalView:p,billPaySetupApproverViewUpdateData:t,vendorNamesById:o,departmentNamesById:a}},function(e,p){const{navigate:t,location:o}=p;return{onApprovalRulesEventReceived:a=>{a.endsWith(_)&&e(M(!1))},onBackClick:()=>{O(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(K(a,!0))},onEditRuleClick:a=>{a!=null?(e(R(a)),t(`./${a}/edit`)):(e(R()),t("./new"))},onReorderRules:a=>{e(ae(a,!0))}}})(G(le)),de=()=>{const e=y(o=>k(o)),{isApprovalRulesV3Enabled:p,isLoading:t}=H(e?.tenantId);return p?c.jsx(ve,{isLoading:t}):c.jsx(ce,{isLoading:t})},ve=({isLoading:e})=>{const p=U(),t=j(),o=B(),[a,r]=v.useState(!1),[n,d]=v.useState(!1),l=y(s=>s.billPaySetupApproverViewState.fetchState),u=y(s=>k(s));Z();const i=y(s=>A(s)),f=y(s=>h(s).billPaySetupApproverViewUpdateData);if(v.useEffect(()=>{f?.updateStatus.fetchState==="Completed"&&o(E())},[f]),v.useEffect(()=>{a||l!=="Not-Started"||e||(r(!0),o(q(!0,!0,!0)))},[a,l,e,o]),V.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");v.useEffect(()=>{i.allApprovalRules.length===0&&i.fetchState==="Completed"&&(n||(d(!0),o(R())),p("./new"))},[n,i,o]);const m={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${_}`]:[],eventCallback:(s,w,S)=>{s.endsWith(_)&&S.onApprovalRulesEventReceived(s)}};return u?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?c.jsx(z,{to:"../../promo"}):c.jsx(ue,{currentTenant:u,location:t,navigate:p,isLoading:e,...m})},fe=P(function(e,p){const t=h(e),o=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=o==="approval_create"&&t.allApprovalRules.length!==0;let r=t.allApprovalRules.length===0;return p.approvalRuleId&&(r=t.allApprovalRules.findIndex(n=>n.approvalRuleId===p.approvalRuleId)===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:r,approvalUpdateActionType:o}},function(e,p){const{navigate:t,approvalUpdateDataView:o,approverViewData:a,approvalRuleId:r}=p,n=o.billPaySetupApproverViewUpdateData?.type,d=O(p.location);return{onApprovalRuleDataUpdated:l=>{const u=f=>{const m=[];return f.forEach(s=>{const w=s.actors.selectedUsers.map(b=>({type:"user",userId:b.userId,isImplicitActor:!1})),S=s.actors.selectedNonUsers.map(b=>{const I=!!ne(b.value);return{type:I?"attribute":"role",subType:b.value,userId:void 0,idType:void 0,isImplicitActor:!I}}),g=w.concat(S);m.push({action:s.stepType.selectedOption,actors:g,operator:g.length>1?s.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),m},i={amount:{type:"amount",comparator:"range",min:{amount:l.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:l.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(n==="approval_create"){const f={criteria:i,steps:u(l.steps),isApplicableOnPendingApprovalEntity:l.applyToExistingBills.includes("applyToExistingBills")};e(C(f))}else{const f={approvalRuleId:r,criteria:i,steps:u(l.steps),isApplicableOnPendingApprovalEntity:l.applyToExistingBills.includes("applyToExistingBills")};e(C(f))}},onResetClick:()=>{e(E()),n==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),n==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(X(!1))},onSaveRuleSuccess:()=>{t("../")}}})(pe);function ye(){const e=U(),p=B(),t=j(),{approvalRuleId:o}=W(),a=V.getSignedInUser(),r=J(),n=y(i=>h(i)),d=y(i=>A(i)),[l,u]=v.useState(!1);if(v.useEffect(()=>{l||(u(!0),p(Q(!0)))}),v.useEffect(()=>{d.fetchState==="Not-Started"&&e(o!=null?"../../":"../")},[d,o]),a==null)throw Error("Can't access address page without signing in...");return n.approverListFetchStatus.fetchState=="Not-Started"||n.approverListFetchStatus.fetchState==="In-Progress"?c.jsx(Y,{fetchState:n.approverListFetchStatus.fetchState,style:{backgroundColor:r.colors.grey5}}):c.jsx(fe,{navigate:e,approvalUpdateDataView:n,approvalRuleId:o,approverViewData:d,location:t})}const ge=P(function(e,p){const t=h(e),o=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=[],r={};for(const n of Object.values(e.vendorState.vendorByID))n?.id!=null&&(a.push(n.id),r[n.id]=n.name);return{localData:t,approvalUpdateActionType:o,allVendorIds:a,vendorNamesById:r,editingRuleId:o==="approval_update"?p.approvalRuleId:void 0,allApprovalRulesWithUser:A(e).allApprovalRules}},function(e,p){const{navigate:t,approvalUpdateDataView:o,approverViewData:a,approvalRuleId:r}=p,n=o.billPaySetupApproverViewUpdateData?.type,d=O(p.location);return{onApprovalRuleDataUpdated:l=>{const u=g=>{const b=[];return g.forEach(I=>{const L=I.actorKind?.selectedOption,N=I.selectedRole?.selectedOption;let D=[];L==="role"&&N!=null?D=[{type:"attribute",subType:N,userId:void 0,idType:void 0,isImplicitActor:!1}]:L==="specific_person"&&(D=(I.persons?.selectedUsers??[]).map(ee=>({type:"user",userId:ee.userId,isImplicitActor:!1})));const F=I.action??"require_approval";b.push({action:F,actors:D,operator:D.length>1?F==="require_approval"?"or":"and":"is"})}),b},i=l.amountCriteria,f=l.vendorCriteria,m=l.departmentCriteria,s={};if(i!=null&&i.comparator.selectedOption!=null){const g=i.comparator.selectedOption;s.amount={type:"amount",comparator:g,min:g==="less_than"?void 0:i.min,max:g==="greater_than"?void 0:i.max}}const w=f?.selection.selectedOptions??[];w.length>0&&(s.vendor={type:"vendor",operator:f?.operator.selectedOption??"is",vendorIds:w});const S=m?.selection.selectedOptions??[];if(S.length>0&&(s.department={type:"department",operator:m?.operator.selectedOption??"is",departmentIds:S}),n==="approval_create"){const g={name:l.name,description:l.description,separationOfDuties:l.separationOfDuties,isFallback:l.isFallback,criteria:s,steps:u(l.steps),isApplicableOnPendingApprovalEntity:l.applyToExistingBills.includes("applyToExistingBills")};e(C(g))}else{const g={approvalRuleId:r,name:l.name,description:l.description,separationOfDuties:l.separationOfDuties,isFallback:l.isFallback,criteria:s,steps:u(l.steps),isApplicableOnPendingApprovalEntity:l.applyToExistingBills.includes("applyToExistingBills")};e(C(g))}},onResetClick:()=>{e(E()),n==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),n==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(X(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:l=>{e(R(l)),t(n==="approval_update"?`../../${l}/edit`:`../${l}/edit`)}}})(se);function $(){const e=y(t=>k(t)),{isApprovalRulesV3Enabled:p}=H(e?.tenantId);return p?c.jsx(me,{}):c.jsx(ye,{})}function me(){const e=U(),p=B(),t=j(),{approvalRuleId:o}=W(),a=V.getSignedInUser(),r=J(),n=y(i=>h(i)),d=y(i=>A(i)),[l,u]=v.useState(!1);if(Z(),v.useEffect(()=>{l||(u(!0),p(Q(!0)))}),v.useEffect(()=>{d.fetchState==="Not-Started"&&e(o!=null?"../../":"../")},[d,o]),a==null)throw Error("Can't access address page without signing in...");return n.approverListFetchStatus.fetchState=="Not-Started"||n.approverListFetchStatus.fetchState==="In-Progress"?c.jsx(Y,{fetchState:n.approverListFetchStatus.fetchState,style:{backgroundColor:r.colors.grey5}}):c.jsx(ge,{navigate:e,approvalUpdateDataView:n,approvalRuleId:o,approverViewData:d,location:t},o??"new")}function De(){return c.jsxs(te,{children:[c.jsx(x,{path:"/",element:c.jsx(de,{})}),c.jsx(x,{path:"/new",element:c.jsx($,{})}),c.jsx(x,{path:"/:approvalRuleId/edit",element:c.jsx($,{})}),c.jsx(x,{path:"*",element:c.jsx(re,{})})]})}export{De as B};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-CIemOhG-.js";import{h as J,u as se,g as K,i as ae,j as k,N as te,n as Y,l as na,o as ia,p as y}from"./core-BXHWSH6o.js";import{eX as H,Pp as _e,bs as It,Ke as oa,bq as wt,bJ as pe,Pq as At,yJ as Ct,zY as $e,zg as la,bn as De,Pr as sa,Ps as ra,c6 as ca,Pt as da,ky as Bt,Pu as xt,Pv as Et,Ax as Ge,yY as Be,Pw as ua,yx as tt,Px as pa,EC as ma,yB as ba,yH as Dt,Py as ve,Pz as Me,zZ as Oe,PA as ha,PB as ga,A0 as Ne,PC as Sa,Ad as ya,PD as Pt,zJ as at,zO as fa,PE as va,PF as ue,PG as jt,PH as Tt,PI as Ft,gq as ka,z1 as Le,cA as Rt,PJ as Ia,fz as wa,PK as Aa,PL as Ca,fE as Vt,fC as $t,PM as ze,PN as Ba,PO as xa,N8 as Ze,PP as Ea,N9 as oe,Na as He,PQ as Da,PR as Pa,PS as ja,zQ as nt,zN as Ta,PT as Fa,PU as Ra,PV as Va,zz as $a,PW as La,PX as Ua,PY as _a,co as Lt,cQ as Ut,kJ as Ga,bP as Ma,bo as _t,bQ as Gt,xP as Oa,PZ as Na,Ep as za,Ev as Za,uc as Ha,z_ as Wa,AE as qa,kW as fe,P_ as Qa,P$ as Mt,lo as Ja,kQ as Ot,l9 as Nt,l8 as it,bE as be,bO as Ka,Q0 as Ya,Q1 as ke,jt as Xa,Q2 as ot,Q3 as en,jx as tn,jS as an,AS as nn,Q4 as on,lh as ln,AI as sn,Q5 as lt,AM as rn,AR as cn,AO as dn,AG as un,Q6 as zt,yS as pn,Q7 as mn,Q8 as bn,gi as hn,gh as gn,gg as Sn,kZ as yn,lf as st,lq as fn,rD as vn,l6 as kn,AK as In,jD as wn,lv as An,Q9 as Cn,jv as Bn,ru as xn,Qa as En,zF as Dn,bK as Pn,bt as jn,LY as Tn,cT as Fn,cS as Rn,cz as Vn,cG as $n}from"./zeni-epic-state-Xn27LBb6.js";import{m as me,z as V,I as Ie,$ as We,Q as le,e as S,aR as xe,y as re,o as x,J as Pe,f as D,bi as Ln,s as Z,a3 as qe,v as E,Z as we,bj as rt,bk as ct,bl as Un,ak as _n,H as Gn,aL as Mn,D as Zt,a as Qe,K as Je,bm as On,at as Ht,bn as Nn,Y as zn,h as Wt,a8 as Zn,bo as Hn,bp as Wn,bq as qn,br as Qn,bs as Jn,bt as Kn,bu as Yn,bv as Xn,bw as ei,A as ti,bx as ai,bd as ni,by as ii,bz as oi,i as li}from"./index-CMicf90d.js";import{n as U,S as si}from"./mui-CDOihXSU.js";import{A as dt}from"./AddressScreen-CLqHIzyX.js";import{g as ie,a as je,i as qt,V as Ke,b as Ye,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-DeiqcEkq.js";import{a as f}from"./sentry-238zX06J.js";import{u as Xe}from"./useAskAiCfoHostNavButtonProps-QHf32w33.js";import{u as Qt}from"./useInitialThreadRequest-B2VhczBO.js";import Ee from"./NotFoundScreen-BPydeesy.js";import{D as ui}from"./DrawerScreen-BkDOJtg1.js";import{M as Jt}from"./MobileAppDrawer-DXoZqPdU.js";import{F as Kt}from"./FeaturePreviewScreen-CW2ZZwGb.js";import{S as Te}from"./SetupPagesScreen-C_NeLXz4.js";import{B as pi}from"./BillPayApprovalRoutes-CZBhRNrs.js";import{FallBackRoute as mi}from"./ScreenRoutes-IcWHAutY.js";import"./recharts-D7dc1KPB.js";import"./analytics-D9LLahJK.js";import"./plaid-DnBvUvOI.js";import"./dnd-D1FusWvE.js";import"./stripe-DMRn4zHo.js";import"./lottie-B2gqVn8r.js";import"./lexical-M5lTJAid.js";import"./pdf-NpxYPuZF.js";import"./utils-BaZQaz5F.js";import"./analyticsHelper-BA_yiiPD.js";import"./routePaths-CIGM6tzV.js";import"./BusinessVerificationPageScreen-BN8pHa0i.js";import"./ReimbursementApprovalRuleDetailScreen-BImN24-1.js";import"./getLocaleForTenant-DXvFXHW9.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]="d00da465-c935-4798-a34a-9b803b647e1c",e._sentryDebugIdIdentifier="sentry-dbid-d00da465-c935-4798-a34a-9b803b647e1c")}catch{}})();const bi=Y(function(e,t){const l=_e(e,t.billId),n=V.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},u=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:Bt(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(ve({}))},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(Be(l,"retry")):e(Be(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(Be(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=J(),t=se(),l=K(),{billId:n}=ae(),c=me(),r=V.getSignedInUser(),u=Ie(),o=k(N=>H(N)),s=k(N=>_e(N,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Qt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Xe({mobileExploreReferrer:"Bill Details"});We({isDataReady:s.fetchState==="Completed"});const h=o?.userRole!=null&&It(o?.userRole),g=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!h,[b,v]=f.useState(!1),[P,C]=f.useState(!1),[B,_]=f.useState(!1),{useFeatureGate:j,useDynamicConfig:G}=le(),{isFeatureEnabled:$}=j(S.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=j(S.isBillPayCommentingEnabled),{isFeatureEnabled:W}=j(S.isBillPayDetectInsufficientFundsEnabled),{configValue:M}=G(xe.zeniAssistConfig),w=oa(o),O=wt(o.userRole),q=g&&pe(u?.loggedInUserRoleMap),L=M.user_ids!=null&&r?.userId!=null&&M.user_ids.includes(r?.userId),{isFeatureEnabled:Q}=j(S.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:X}=j(S.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&w===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(O||q||s.allApprovers.find(N=>N.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,O,q,o.isZeni,w,r]),f.useEffect(()=>{n!=null&&t(At(n))},[n]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(v(!0),t(Ct(n??"",$,L,!1)))},[b,s,n,t]),f.useEffect(()=>{P||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(C(!0),t($e(!1,$,L,X,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(la()))},[P,s,n,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(te,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${x.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Pe,{analytics:D,onLoad:N=>(ee=>{n!=null&&ee.trackBillPayBillDetails(n,s.isRecurring)})(N)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:B,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:Q,hasZeniAssistAccess:L,isDetectInsufficientFundsEnabled:W,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const Se=Qe.getLocalizedStrings().spendManagement.billPay.billDetails,gi={containerWidth:new Zt(100,58)},ut=Y(function(e,t){const l=V.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Ht.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:D,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:x.sp10,paddingRight:x.sp3,paddingBottom:"15px",paddingLeft:x.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=V.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(Ne(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(ya({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{D?.trackBillPaySkipAutofill(),e(Oe(n))},onDeleteClick:()=>{e(Sa({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(Mn);function A({appContent:e}){const t=se(),l=J(),{billId:n}=ae(),c=K(),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(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=d(S.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:g}=d(S.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(S.billPaySetupShowInternationalPaymentByWise),{configValue:v}=p(xe.zeniAssistConfig),P=v.user_ids!=null&&i?.userId!=null&&v.user_ids.includes(i?.userId),C=k(F=>H(F)),[B,_]=f.useState(!1),[j,G]=f.useState(!1),[$,I]=f.useState(!1),[W,M]=f.useState(),w=k(F=>Me(F,m,g,n));let O=w.fetchState,q=w.file,L=w.showAutofill;const Q=k(F=>_e(F,n??""));u===!1&&(O=Q.fetchState,q=Q.transactionDetails?.attachments?.[0],L=!1);const X=w.billPayInfo!=null&&w.billPayInfo.stage.code==="pending_approval"?w.billPayInfo.billStatus.code:w.billStage;f.useEffect(()=>{n==null&&t(Oe(!0))},[n,t]),f.useEffect(()=>{O==="Not-Started"&&(u&&j?G(!1):!u&&B&&_(!1))},[n]),f.useEffect(()=>{B||n==null||u||(_(!0),t(Ct(n,h,P,!1)),j||(G(!0),t($e(!1,h,P,b,n)))),u&&!j&&(G(!0),t($e(!1,h,P,b,n)))},[B,j,u,n,t]);const N={onOkClick:()=>{if(I(!1),!W)return;const F=q!=null?"replace":"upload";D?.trackInvoiceActionClick(X??"",F,i?.userEmail??"","yes"),t(ga({replaceBillData:!0,billId:n})),t(Ne(W,m,n))},onCancelClick:()=>{if(I(!1),!W)return;const F=q!=null?"replace":"upload";D?.trackInvoiceActionClick(X??"",F,i?.userEmail??"","no"),t(ha({file:W,billId:n}))}},ee=f.useCallback(()=>{const F=Z(c.state?.pathnameStackToGoBack),ce=F.poppedPathname??ie(C.tenantEmailDomain);t(ve({billId:n})),l(ce,{state:{pathnameStackToGoBack:F.newStack}})},[c.state,C.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(O==="Error"||Q.fetchState==="Error")return a.jsx(Ee,{});if(O!="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:q,showAutofill:!0,uploadStatus:w.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:M,showActionButtons:!1,isInitialEdit:!!w.isInitialEdit,billStage:X}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||L?null:a.jsx(pt,{children:a.jsx(Yt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(Un,{}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:n==null})})]});{const F=w.billPayInfo!=null&&w.billPayInfo.stage.code==="pending_approval"?w.billPayInfo.billStatus.code:w.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[L&&o!=="small"?a.jsx(mt,{}):null,$?a.jsx(_n,{titleComponent:a.jsx(wi,{children:Se.overwriteTitle}),descriptionComponent:a.jsx(Ai,{children:Se.overwriteDescription}),primaryButtonText:Se.buttons.yes,secondaryButtonText:Se.buttons.no,action:N,isEditPopup:!0}):null,o==="small"||L?null:a.jsx(pt,{children:a.jsx(Si,{})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(ut,{backgroundColor:s.colors.grey4,billId:n,file:q,showAutofill:L,uploadStatus:w.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:yi(u,Q,w),setShowConfirmationPopup:I,setPayload:M,showActionButtons:fi(u,w),isInitialEdit:!!w.isInitialEdit,billStage:F}),a.jsx(Ve,{windowSize:o,children:e})]})})}}function Si(){const{triggerBack:e}=On();return a.jsx(Yt,{onClick:e,"data-testid":"nav-bar-back-click"})}function yi(e,t,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(vi,{children:[a.jsx(ki,{children:`${Se.recurringBill.recurringCycle}
|
|
1
|
+
import{j as a}from"./liveblocks-BfjqeyQ7.js";import{h as J,u as se,g as K,i as ae,j as k,N as te,n as Y,l as na,o as ia,p as y}from"./core-D5--W5Ul.js";import{eX as H,Pp as _e,bs as It,Ke as oa,bq as wt,bJ as pe,Pq as At,yJ as Ct,zY as $e,zg as la,bn as De,Pr as sa,Ps as ra,c6 as ca,Pt as da,ky as Bt,Pu as xt,Pv as Et,Ax as Ge,yY as Be,Pw as ua,yx as tt,Px as pa,EC as ma,yB as ba,yH as Dt,Py as ve,Pz as Me,zZ as Oe,PA as ha,PB as ga,A0 as Ne,PC as Sa,Ad as ya,PD as Pt,zJ as at,zO as fa,PE as va,PF as ue,PG as jt,PH as Tt,PI as Ft,gq as ka,z1 as Le,cA as Rt,PJ as Ia,fz as wa,PK as Aa,PL as Ca,fE as Vt,fC as $t,PM as ze,PN as Ba,PO as xa,N8 as Ze,PP as Ea,N9 as oe,Na as He,PQ as Da,PR as Pa,PS as ja,zQ as nt,zN as Ta,PT as Fa,PU as Ra,PV as Va,zz as $a,PW as La,PX as Ua,PY as _a,co as Lt,cQ as Ut,kJ as Ga,bP as Ma,bo as _t,bQ as Gt,xP as Oa,PZ as Na,Ep as za,Ev as Za,uc as Ha,z_ as Wa,AE as qa,kW as fe,P_ as Qa,P$ as Mt,lo as Ja,kQ as Ot,l9 as Nt,l8 as it,bE as be,bO as Ka,Q0 as Ya,Q1 as ke,jt as Xa,Q2 as ot,Q3 as en,jx as tn,jS as an,AS as nn,Q4 as on,lh as ln,AI as sn,Q5 as lt,AM as rn,AR as cn,AO as dn,AG as un,Q6 as zt,yS as pn,Q7 as mn,Q8 as bn,gi as hn,gh as gn,gg as Sn,kZ as yn,lf as st,lq as fn,rD as vn,l6 as kn,AK as In,jD as wn,lv as An,Q9 as Cn,jv as Bn,ru as xn,Qa as En,zF as Dn,bK as Pn,bt as jn,LY as Tn,cT as Fn,cS as Rn,cz as Vn,cG as $n}from"./zeni-epic-state-CP708m5a.js";import{m as me,z as V,I as Ie,$ as We,Q as le,e as S,aR as xe,y as re,o as x,J as Pe,f as D,bi as Ln,s as Z,a3 as qe,v as E,Z as we,bj as rt,bk as ct,bl as Un,ak as _n,H as Gn,aL as Mn,D as Zt,a as Qe,K as Je,bm as On,at as Ht,bn as Nn,Y as zn,h as Wt,a8 as Zn,bo as Hn,bp as Wn,bq as qn,br as Qn,bs as Jn,bt as Kn,bu as Yn,bv as Xn,bw as ei,A as ti,bx as ai,bd as ni,by as ii,bz as oi,i as li}from"./index-BbrjBaX2.js";import{n as U,S as si}from"./mui-BkqswRey.js";import{A as dt}from"./AddressScreen-CTBC0Okq.js";import{g as ie,a as je,i as qt,V as Ke,b as Ye,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-DJE27dHB.js";import{a as f}from"./sentry-NLHTFHKl.js";import{u as Xe}from"./useAskAiCfoHostNavButtonProps-DWeS72rU.js";import{u as Qt}from"./useInitialThreadRequest-Crst1isw.js";import Ee from"./NotFoundScreen-Dx10N2h0.js";import{D as ui}from"./DrawerScreen-B0i0-mAL.js";import{M as Jt}from"./MobileAppDrawer-DTNaBxxF.js";import{F as Kt}from"./FeaturePreviewScreen-DX1SEz5-.js";import{S as Te}from"./SetupPagesScreen-BgC6pVZV.js";import{B as pi}from"./BillPayApprovalRoutes-9GXjYr7v.js";import{FallBackRoute as mi}from"./ScreenRoutes-B4ZOmjm0.js";import"./recharts--lP9DGTY.js";import"./analytics-o8UTT6MT.js";import"./plaid-Dly6vYcb.js";import"./dnd-1wW2WkhB.js";import"./stripe-DMRn4zHo.js";import"./lottie-CY-jVQNU.js";import"./lexical-MdJnvG5R.js";import"./pdf-C9g_mgTQ.js";import"./utils-DKA4xBgw.js";import"./analyticsHelper-38O5wjc-.js";import"./routePaths-YPF0RRmf.js";import"./BusinessVerificationPageScreen-BdbkgyBr.js";import"./ReimbursementApprovalRuleDetailScreen-C4Af9N6W.js";import"./getLocaleForTenant-B0LCd9Bs.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]="d00da465-c935-4798-a34a-9b803b647e1c",e._sentryDebugIdIdentifier="sentry-dbid-d00da465-c935-4798-a34a-9b803b647e1c")}catch{}})();const bi=Y(function(e,t){const l=_e(e,t.billId),n=V.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},u=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:Bt(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(ve({}))},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(Be(l,"retry")):e(Be(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(Be(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=J(),t=se(),l=K(),{billId:n}=ae(),c=me(),r=V.getSignedInUser(),u=Ie(),o=k(N=>H(N)),s=k(N=>_e(N,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Qt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Xe({mobileExploreReferrer:"Bill Details"});We({isDataReady:s.fetchState==="Completed"});const h=o?.userRole!=null&&It(o?.userRole),g=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!h,[b,v]=f.useState(!1),[P,C]=f.useState(!1),[B,_]=f.useState(!1),{useFeatureGate:j,useDynamicConfig:G}=le(),{isFeatureEnabled:$}=j(S.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=j(S.isBillPayCommentingEnabled),{isFeatureEnabled:W}=j(S.isBillPayDetectInsufficientFundsEnabled),{configValue:M}=G(xe.zeniAssistConfig),w=oa(o),O=wt(o.userRole),q=g&&pe(u?.loggedInUserRoleMap),L=M.user_ids!=null&&r?.userId!=null&&M.user_ids.includes(r?.userId),{isFeatureEnabled:Q}=j(S.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:X}=j(S.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&w===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(O||q||s.allApprovers.find(N=>N.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,O,q,o.isZeni,w,r]),f.useEffect(()=>{n!=null&&t(At(n))},[n]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(v(!0),t(Ct(n??"",$,L,!1)))},[b,s,n,t]),f.useEffect(()=>{P||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(C(!0),t($e(!1,$,L,X,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(la()))},[P,s,n,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(te,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${x.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Pe,{analytics:D,onLoad:N=>(ee=>{n!=null&&ee.trackBillPayBillDetails(n,s.isRecurring)})(N)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:B,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:Q,hasZeniAssistAccess:L,isDetectInsufficientFundsEnabled:W,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const Se=Qe.getLocalizedStrings().spendManagement.billPay.billDetails,gi={containerWidth:new Zt(100,58)},ut=Y(function(e,t){const l=V.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Ht.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:D,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:x.sp10,paddingRight:x.sp3,paddingBottom:"15px",paddingLeft:x.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=V.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(Ne(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(ya({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{D?.trackBillPaySkipAutofill(),e(Oe(n))},onDeleteClick:()=>{e(Sa({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(Mn);function A({appContent:e}){const t=se(),l=J(),{billId:n}=ae(),c=K(),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(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=d(S.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:g}=d(S.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(S.billPaySetupShowInternationalPaymentByWise),{configValue:v}=p(xe.zeniAssistConfig),P=v.user_ids!=null&&i?.userId!=null&&v.user_ids.includes(i?.userId),C=k(F=>H(F)),[B,_]=f.useState(!1),[j,G]=f.useState(!1),[$,I]=f.useState(!1),[W,M]=f.useState(),w=k(F=>Me(F,m,g,n));let O=w.fetchState,q=w.file,L=w.showAutofill;const Q=k(F=>_e(F,n??""));u===!1&&(O=Q.fetchState,q=Q.transactionDetails?.attachments?.[0],L=!1);const X=w.billPayInfo!=null&&w.billPayInfo.stage.code==="pending_approval"?w.billPayInfo.billStatus.code:w.billStage;f.useEffect(()=>{n==null&&t(Oe(!0))},[n,t]),f.useEffect(()=>{O==="Not-Started"&&(u&&j?G(!1):!u&&B&&_(!1))},[n]),f.useEffect(()=>{B||n==null||u||(_(!0),t(Ct(n,h,P,!1)),j||(G(!0),t($e(!1,h,P,b,n)))),u&&!j&&(G(!0),t($e(!1,h,P,b,n)))},[B,j,u,n,t]);const N={onOkClick:()=>{if(I(!1),!W)return;const F=q!=null?"replace":"upload";D?.trackInvoiceActionClick(X??"",F,i?.userEmail??"","yes"),t(ga({replaceBillData:!0,billId:n})),t(Ne(W,m,n))},onCancelClick:()=>{if(I(!1),!W)return;const F=q!=null?"replace":"upload";D?.trackInvoiceActionClick(X??"",F,i?.userEmail??"","no"),t(ha({file:W,billId:n}))}},ee=f.useCallback(()=>{const F=Z(c.state?.pathnameStackToGoBack),ce=F.poppedPathname??ie(C.tenantEmailDomain);t(ve({billId:n})),l(ce,{state:{pathnameStackToGoBack:F.newStack}})},[c.state,C.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(O==="Error"||Q.fetchState==="Error")return a.jsx(Ee,{});if(O!="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:q,showAutofill:!0,uploadStatus:w.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:M,showActionButtons:!1,isInitialEdit:!!w.isInitialEdit,billStage:X}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||L?null:a.jsx(pt,{children:a.jsx(Yt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(Un,{}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:n==null})})]});{const F=w.billPayInfo!=null&&w.billPayInfo.stage.code==="pending_approval"?w.billPayInfo.billStatus.code:w.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[L&&o!=="small"?a.jsx(mt,{}):null,$?a.jsx(_n,{titleComponent:a.jsx(wi,{children:Se.overwriteTitle}),descriptionComponent:a.jsx(Ai,{children:Se.overwriteDescription}),primaryButtonText:Se.buttons.yes,secondaryButtonText:Se.buttons.no,action:N,isEditPopup:!0}):null,o==="small"||L?null:a.jsx(pt,{children:a.jsx(Si,{})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(ut,{backgroundColor:s.colors.grey4,billId:n,file:q,showAutofill:L,uploadStatus:w.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:yi(u,Q,w),setShowConfirmationPopup:I,setPayload:M,showActionButtons:fi(u,w),isInitialEdit:!!w.isInitialEdit,billStage:F}),a.jsx(Ve,{windowSize:o,children:e})]})})}}function Si(){const{triggerBack:e}=On();return a.jsx(Yt,{onClick:e,"data-testid":"nav-bar-back-click"})}function yi(e,t,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(vi,{children:[a.jsx(ki,{children:`${Se.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=U.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-BfjqeyQ7.js";import{a as V}from"./sentry-NLHTFHKl.js";import{h as ae,g as ne,u as se,i as oe,j as C,N as ie,n as re}from"./core-D5--W5Ul.js";import{I as ce,Q as ue,aR as de,z as E,J as le,f as B,af as x,h as z,bI as pe,at as me,v as M,au as P}from"./index-BbrjBaX2.js";import{PX as fe,eX as G,tD as ye,Kh as Se,zz as ge,C_ as Ie,FL as he,Go as be,Ho as Te,Qi as De,Qj as Oe,Qk as ke,Ql as Ce,Qm as Ve,MK as we,Pk as Ae,MZ as Ne,E2 as _e,M_ as Fe,E6 as ve,le as xe,gi as ze,gh as Ee,gg as Be,rD as Me,ru as Pe,rr as Re,l6 as Ue,tM as Le,tK as R,bE as U,tY as L,cy as je}from"./zeni-epic-state-CP708m5a.js";import{n as Ge}from"./mui-BkqswRey.js";import{d as j}from"./routePaths-YPF0RRmf.js";import{M as Qe}from"./MobileAppDrawer-DTNaBxxF.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new t.Error().stack;d&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[d]="f4a6f867-f526-4b5d-a44c-8304f72e996e",t._sentryDebugIdIdentifier="sentry-dbid-f4a6f867-f526-4b5d-a44c-8304f72e996e")}catch{}})();const Ke=Ge.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as g}from"./liveblocks-
|
|
1
|
+
import{j as g}from"./liveblocks-BfjqeyQ7.js";import{a as l}from"./sentry-NLHTFHKl.js";import{u as pe,h as he,g as fe,j as H,i as Ce,n as Se}from"./core-D5--W5Ul.js";import{X as ge,db as be,z as ye,dc as Pe,de as z,df as Ie,b9 as W,J as we,f as $,dg as B,dq as Ee,a as ke,h as Ae,a8 as Te,dj as xe,dk as Ue,a3 as _e,dn as Oe,b5 as ve,dp as Qe}from"./index-BbrjBaX2.js";import{gm as Fe,eW as G,eX as $e,fq as Le,iL as De,iH as Ve,eY as M,g7 as je,g0 as qe,g4 as N,g8 as Re,g9 as He,ga as Be,gb as Me,gc as Ne}from"./zeni-epic-state-CP708m5a.js";import{D as ze,n as D,P as We,S as Ge}from"./mui-BkqswRey.js";import"./recharts--lP9DGTY.js";import"./analytics-o8UTT6MT.js";import"./plaid-Dly6vYcb.js";import"./dnd-1wW2WkhB.js";import"./stripe-DMRn4zHo.js";import"./lottie-CY-jVQNU.js";import"./lexical-MdJnvG5R.js";import"./pdf-C9g_mgTQ.js";import"./utils-DKA4xBgw.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="777a2d14-3ff2-4704-b837-394d954ffda4",e._sentryDebugIdIdentifier="sentry-dbid-777a2d14-3ff2-4704-b837-394d954ffda4")}catch{}})();const X="chat-response-generated",Y="cards/ask",J="card_policy_hero";function L(e){return`/${e}/cards`}function Z(e){return`/${e}/cards/policy`}const Xe=Se(function(e,a){const o=G(e),c=a.isSubmitting,d=Ue(e,{allUsers:a.allUsers,onCardPolicyVendorSearchTextChange:a.onCardPolicyVendorSearchTextChange});return{showSampleQuestions:a.sessionFromUrl==="new_chat"&&o.uiState.currentChatSessionId==null,aiCfoView:o,isSubmitting:c,isNewChatSession:a.sessionFromUrl==="new_chat",isFullView:!0,tableDownloadEndPoint:`${_e}/tableDownload`,emailLinkQuestion:a.emailLinkQuestion,autoSubmitEmailLinkQuestion:a.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:a.onEmailLinkQuestionProcessed,isFileUploadEnabled:a.isFileUploadEnabled,isUploadPromoVisible:a.isUploadPromoVisible,onUploadPromoClose:a.onUploadPromoClose,...d}},function(e,a){const{location:o,currentTenant:c,userId:d,navigate:m,currentChatSessionId:h,allSessionsWithOrderedQuestionAnswers:E,isAiCardCreationEnabled:T,isCardPolicyEnabled:x,cardPolicyPageContext:U}=a,i=c.tenantEmailDomain,f=o.state?.referrer,p=f===J?Z(i):L(i);return{onEventReceived:(n,t)=>{if(n===X&&typeof t.text=="string"&&typeof t.metadata=="object"){const s=t,C=He(s.type),b=s.metadata.chat_session_id??null,{currentChatSession:y,currentQuestionAnswer:u,currentQuestionAnswerSummary:P}=W(E,b);C!=="answer"?$.trackAICFOChatResponseGenerated(C,u?.question.questionText??"",s.text,b,Qe(P,y),s.metadata.message_id??null):$.trackAICFOChatAnswerGenerated(s.text,u?.question.questionText??"",(s.follow_up_questions?.length??0)>0,!!s.assumptions,!!s.insights,s.visualization!=null,Be(s.visualization?.type??"")??null,b,s.summarized_title,s.metadata.message_id??null),e(Me({chatSessionId:s.metadata.chat_session_id,responseType:C,fetchState:{fetchState:"Completed",error:void 0}})),e(Ne({chatSessionId:s.metadata.chat_session_id,answerPayload:s,userId:d}))}},onSubmit:(n,t,s,C)=>{n&&ve(e,n,t,h,E,d,C,s,U)},updateCurrentInput:n=>{e(N(n))},onStopSubmit:()=>{},onUpdateScrollYOffset:n=>{e(Re(n))},onSelectSampleQuestion:()=>{},onBackClick:()=>{m(-1)},onCloseClick:()=>{m(p,{state:{...o.state}}),e(N(""))},togglePageView:()=>{m(p,{state:z(o.state)}),a.setIsAiCfoOpen(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{m(-1)},onNewChatClick:()=>{h!=null&&e(qe()),m(function(n){return`/${n}/${Y}`}(i),{state:{...o.state}})},onToggleCotCollapsed:(n,t)=>{e(je({questionAnswerId:n,isCollapsed:t}))},...Oe(e,{isAiCardCreationEnabled:T,isCardPolicyEnabled:x,currentChatSessionId:h,onAfterCardsCreationSubmit:()=>{a.setIsAiCfoOpen(!0),m(L(i),{state:{...o.state}})},onAfterCardPolicySubmit:()=>{a.setIsAiCfoOpen(!0),m(`/${i}/cards/policy`,{state:{...o.state}})}})}})(Te(xe)),{spendManagement:{chargeCard:{cardsAiCfoHero:K,cardPolicyAiCfoHero:ee}}}=ke.getLocalizedStrings(),A=K.pageTitle,Ye=ee.pageTitle,Je=K.chatHeaderSubtitle,Ze=ee.chatHeaderSubtitle,St=({isFileUploadEnabled:e})=>{const{setIsAiCfoOpen:a}=ge(),o=pe(),c=he(),d=fe(),[m,h]=l.useState(!1),{allUsers:E,isAiCardCreationEnabled:T,isCardPolicyEnabled:x,onCardPolicyVendorSearchTextChange:U}=be();l.useEffect(()=>{o(Fe())},[o]);const i=H(r=>G(r)),f=ye.getSignedInUser(),{session_id:p}=Ce(),n=H(r=>$e(r)),t=i.uiState.currentChatSessionId,s=n.tenantEmailDomain,{handleUploadPromoClose:C,isUploadPromoVisible:b}=Pe({isFileUploadEnabled:e,tenantEmailDomain:s}),y=d.state,u=y?.aiCfoInitialQuestion??null,P=!!y?.aiCfoShouldSubmit,I=y?.referrer===J,te=I?"card_policy":void 0,se=l.useMemo(()=>({title:I?Ye:A,subtitle:I?Ze:Je}),[I]),[ae,_]=l.useState(null),[oe,O]=l.useState(!1),v=l.useRef(!1);l.useEffect(()=>{v.current||u==null||u===""||(_(u),O(P),v.current=!0)},[u,P]);const ne=l.useCallback(()=>{_(null),O(!1),c(d.pathname,{replace:!0,state:z(d.state)})},[d.pathname,d.state,c]),ie=n.masterTOSInfo,S=ie?.isMasterTOSAccepted??!1,k=l.useRef(null);l.useEffect(()=>{if(S&&k.current!=null){const{question:r,shouldSubmit:w}=k.current;k.current=null,_(r),O(w),v.current=!1}},[S]);const{visitedSessions:V}=Ie(t),Q=i.fetchState,F=i.uiState.chatSessionsNextPageToken.hasMore||!i.uiState.chatSessionsFirstPageFetched,j=t!=null?i.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",q=t==null||(i.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),R=i.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:re}=W(R,t),le=re.length===0;l.useEffect(()=>{t!=null&&p!==t&&c(function(r,w){return`/${r}/${Y}/${w}`}(s,t),{state:{...d.state},replace:!0})},[t,p,s,c,d.state]),l.useEffect(()=>{p!=null&&t==null&&p!=="new_chat"&&o(Le({sessionId:p,agentId:"controller"}))},[]);const de=l.useMemo(()=>({events:V.map(r=>`private-encrypted-chat-${r}.${X}`),eventCallback:(r,w,me)=>me.onEventReceived(r,w)}),[V]);if(l.useEffect(()=>{Q!=="In-Progress"&&F&&o(De())},[Q,F,o]),l.useEffect(()=>{t!=null&&j!=="In-Progress"&&q&&f!=null&&Q==="Completed"&&!F&&o(Ve(t,f.userId))},[j,q,t,f,o]),f==null)throw Error("Can't access Cards AI CFO page without signing in...");const ce=p??"new_chat",ue=t!=null&&i.responseStateByChatSessionId?.[t]?.answer?.fetchState==="In-Progress";return g.jsxs(et,{children:[g.jsx(we,{analytics:$,onLoad:r=>r.trackPageLoaded(Ae.Event.aiCFOPage)}),S?g.jsx(Xe,{...de,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:R,allUsers:E,isAiCardCreationEnabled:T,isCardPolicyEnabled:x,openOnboardingPage:()=>h(!0),userId:f.userId,setIsAiCfoOpen:a,navigate:c,sessionFromUrl:ce,location:d,isSubmitting:ue,isEmptyChatWithSession:le,customPageTitle:A,chatHeader:se,currentTenant:n,emailLinkQuestion:ae??void 0,autoSubmitEmailLinkQuestion:oe,onEmailLinkQuestionProcessed:ne,isFileUploadEnabled:e,isUploadPromoVisible:b,onUploadPromoClose:C,onCardPolicyVendorSearchTextChange:U,cardPolicyPageContext:te}):g.jsx(B,{isTOSAccepted:S,acceptMasterTOSState:i.masterTOSAcceptanceState,customPageTitle:A,onCloseClick:()=>{c(I?Z(s):L(s),{state:{...d.state}})},onCompleteClick:()=>{S||n.userRoleId==null||(u!=null&&u!==""&&(k.current={question:u,shouldSubmit:P}),o(M(n.userRoleId)))}}),g.jsx(ze,{anchor:"right",open:m,transitionDuration:250,PaperProps:{component:tt,style:{width:`${Ee}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>h(!1),children:g.jsx(Ke,{onClick:r=>r.stopPropagation(),children:g.jsx(B,{isTOSAccepted:S,acceptMasterTOSState:i.masterTOSAcceptanceState,customPageTitle:A,onCloseClick:()=>h(!1),onCompleteClick:()=>{S||n.userRoleId==null||o(M(n.userRoleId)),h(!1)}})})})]})},Ke=D(Ge)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as c}from"./liveblocks-CIemOhG-.js";import{u as me,j as i,h as le,g as he,i as Ve,N as oa,s as _t,n as Pe,t as An,o as ts,p as ce}from"./core-BXHWSH6o.js";import{f8 as Pt,RU as ns,fk as wt,bt as Te,RV as rs,RW as ss,eZ as pn,RX as Dn,f6 as _n,RY as Pn,RZ as wn,R_ as vn,R$ as Fn,f7 as Tn,fj as xn,S0 as Bn,S1 as cs,fd as os,fc as is,S2 as ds,C3 as Rn,fm as ia,S3 as ls,S4 as us,e$ as ms,e_ as Cs,fz as Ze,ff as Ln,fe as On,S5 as ps,fg as hs,BA as fs,Bz as gs,BD as Ss,BF as bs,fs as ys,eW as Un,S6 as Is,S7 as ks,fx as jn,S8 as Es,fy as yt,BL as As,BI as Ds,eX as ge,S9 as qa,fC as xe,fD as Be,fE as Re,gx as da,cv as la,Sa as ua,Sb as vt,uR as $a,kG as za,Sc as Za,Cj as ka,fn as Qe,Cl as Ft,kw as Mn,Sd as ma,C7 as _a,Se as _s,Sf as Ps,Ca as Qa,Sg as ws,Qf as Ja,fi as Nn,Cg as Sa,hW as vs,Sh as Vn,f9 as Ca,bo as Fs,Si as Ts,gi as Xa,gh as et,CP as xs,gg as at,PX as Bs,Sj as Hn,co as Gn,cQ as Rs,Qe as wa,Do as $n,Sk as hn,C_ as Pa,Sl as zn,Dp as Ls,QE as Os,Dq as Us,Ev as js,uc as Ms,Ep as Ns,Sm as Vs,Ck as sa,Sn as Hs,So as Gs,Sp as $s,Sq as zs,Sr as Zs,Ss as Tt,St as Ys,CA as Zn,Ct as Ks,Su as Ws,gz as qs,CJ as Yn,CN as Kn,gy as Qs,Sv as Js,Da as Wn,Sw as Xs,Sx as ec,Sy as ac,CL as qn,Cw as Qn,Cd as Jn,CF as Xn,CD as er,CH as tc,Sz as ar,SA as nc,fu as rc,fv as sc,fw as cc,SB as tt,fo as tr,cS as xt,SC as oc,SD as ic,SE as dc,SF as lc,CV as It,Dh as uc,Dd as mc,CR as Cc,Df as pc,D5 as hc,D7 as fc,SG as nr,Dn as Ga,Ke as gc,SH as Sc,SI as bc,SJ as yc,SK as rr,SL as Ic,DK as kc,CZ as sr,CU as Ne,CY as Ec,SM as Ac,SN as Dc,C4 as _c,SO as cr,fh as or,SP as Pc,C6 as wc,C5 as fn,SQ as vc,SR as Fc,SS as Tc,ML as xc,ST as Bt,SU as Bc,xS as ir,le as Rc,hM as Lc,DP as Oc,SV as dr,f3 as Uc,f4 as jc,SW as Mc,dj as Nc,fl as Vc,DF as Hc,Dz as qe,bs as Gc,bJ as $c,cA as zc,bK as Zc,LY as Yc}from"./zeni-epic-state-Xn27LBb6.js";import{I as Le,cq as lr,s as we,cr as ur,cs as mr,ct as Kc,a as Xe,$ as Rt,cu as Wc,cv as qc,X as Cr,c as pr,_ as hr,v as ye,Q as ue,e as Y,aq as ya,cw as fr,cx as Qc,cy as Jc,z as te,y as va,cf as nt,cz as Xc,cA as eo,cB as ao,Z as Fa,aR as Ye,bs as Lt,cC as to,D as Ta,n as rt,m as Ot,f as X,a8 as st,cD as no,bF as ba,cE as kt,cF as ro,J as Ut,cG as so,at as gr,a3 as Et,cH as co,Y as Sr,h as br,cI as oo,cJ as io,cK as lo,cL as uo,cM as mo,cN as Co,o as Ya,cO as po,cP as ho,cQ as ht,A as fo,cR as go,cS as So,cT as bo,cU as yo,cV as Io,i as ko}from"./index-CMicf90d.js";import{n as He,D as yr,S as Eo}from"./mui-CDOihXSU.js";import{a as r}from"./sentry-238zX06J.js";import{u as xa}from"./useAskAiCfoHostNavButtonProps-QHf32w33.js";import{M as Ie}from"./MobileAppDrawer-DXoZqPdU.js";import{d as jt}from"./recharts-D7dc1KPB.js";import{g as _e,a as Ba,b as Ir,c as Oe,d as Ue,e as Je,f as ea,h as aa,A as Ao,i as Mt,P as Do,j as Nt,s as Ia,k as kr,l as ca,m as Er,n as _o,o as Ar,p as Po,S as gn}from"./SetupPagesScreen-C_NeLXz4.js";import{u as Dr}from"./useInitialThreadRequest-B2VhczBO.js";import ct from"./NotFoundScreen-BPydeesy.js";import{u as Vt}from"./useChargeCardPusherEvents-B0-Of6tK.js";import{n as Sn}from"./utils-BaZQaz5F.js";import{t as wo}from"./AddressScreen-CLqHIzyX.js";import"./analytics-D9LLahJK.js";import"./plaid-DnBvUvOI.js";import"./dnd-D1FusWvE.js";import"./stripe-DMRn4zHo.js";import"./lottie-B2gqVn8r.js";import"./lexical-M5lTJAid.js";import"./pdf-NpxYPuZF.js";import"./analyticsHelper-BA_yiiPD.js";import"./routePaths-CIGM6tzV.js";import"./BusinessVerificationPageScreen-BN8pHa0i.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="f3a81f9f-dd27-4f82-a839-a704e335abc1",e._sentryDebugIdIdentifier="sentry-dbid-f3a81f9f-dd27-4f82-a839-a704e335abc1")}catch{}})();const vo=e=>{const n=e.cardHolderUser,t=`${n.firstName??""} ${n.lastName??""}`.trim()||n.email||n.userId;return{userId:n.userId,displayName:t,roleLabel:e.cardHolderRoles?.titleAtCompany}},_r=e=>({id:e.id,isChecked:!1,cardName:e.cardName,last4:e.accountLast4,limitAmount:e.limit?.amount??0,limitCadence:e.creditLimitFrequency?.code,owner:vo(e),utilizationAmount:(e.limit?.amount??0)-(e.available?.amount??0)});function Pr(){const e=me(),n=i(a=>Pt(a.cardPolicyState)),t=i(a=>ns(a.cardPolicyState));r.useEffect(()=>{t!==""||n==="Completed"&&t===""||n==="In-Progress"||e(wt())},[e,n,t])}const{spendManagement:{chargeCard:{cardPolicyPage:bn}}}=Xe.getLocalizedStrings(),Fo=e=>Ln(e,!1),To=e=>On(e.name,!1);function xo(){const e=le(),n=he(),{tenantEmailDomain:t}=Ve(),a=me(),s=Le(),b=Te(s?.loggedInUserRoleMap),[g,S]=r.useState(!1),P=r.useCallback(A=>{S(A)},[]),u=r.useCallback(()=>{P(!0)},[P]),{isAiCfoAccessEnabled:C,onAskAiCfoClick:T}=xa({mobileExploreReferrer:"Card Policy"});r.useEffect(()=>()=>{a(rs()),a(ss()),a(pn())},[a]);const v=i(A=>Dn(A.cardPolicyState)),m=i(A=>_n(A.cardPolicyState)),M=i(A=>Pn(A.cardPolicyState)),B=i(A=>wn(A.cardPolicyState)),R=i(A=>vn(A.cardPolicyState)),p=i(A=>Fn(A.cardPolicyState)),h=i(A=>Tn(A.cardPolicyState)),F=i(A=>Pt(A.cardPolicyState)),l=i(A=>A.chargeCardConfigState.receiptRequiredAboveAmount.amount),w=i(A=>A.chargeCardConfigState.fetchState);r.useEffect(()=>{v!=="Completed"&&v!=="In-Progress"&&a(xn())},[a,v]),Pr();const E=i(A=>Bn(A.createCardPolicyState)),U=i(A=>cs(A.createCardPolicyState)),y=i(A=>os(A.cardPolicyState)),k=i(A=>is(A.cardPolicyState)),x=i(A=>ds(A.createCardPolicyState)),d=i(A=>Rn(A));r.useEffect(()=>{d.fetchState==="Not-Started"&&a(ia(!1,!1,!1))},[d.fetchState,a]);const f=r.useMemo(()=>m.map(Fo),[m]),j=r.useMemo(()=>h.map(To),[h]),H=r.useMemo(()=>d.cards.filter(A=>!lr(A.status.code)).map(_r),[d.cards]),O=v==="Completed"&&d.fetchState==="Completed"&&w==="Completed";r.useEffect(()=>{O&&x==null&&a(ls({cardsMasterList:H,defaultRequireReceiptAmount:l,suggestedAllowMerchants:M,suggestedBlockMerchants:B,suggestedAllowCategories:R,suggestedBlockCategories:p}))},[w,a,O,x,H,l,M,B,R,p]);const L=r.useMemo(()=>jt(A=>{a(wt(A))},250),[a]);r.useEffect(()=>()=>{L.cancel()},[L]);const z=r.useCallback(A=>{L(A)},[L]),$=E.fetchState,_=t!=null?`/${t}/cards/policy`:"..",D=r.useCallback(()=>{const A=we(n.state?.pathnameStackToGoBack),W=A.poppedPathname??_;e(W,{state:{pathnameStackToGoBack:A.newStack}})},[n.state,e,_]),G=r.useCallback(()=>{e(_)},[e,_]),Q=r.useCallback(A=>{a(us(A))},[a]),I=r.useCallback(A=>{const W=ur(A);a(ms({templates:[W]}))},[a]),N=r.useCallback(A=>{A.length!==0&&a(Cs(A))},[a]),K=r.useCallback(()=>{a(pn())},[a]),J=r.useRef($);r.useEffect(()=>{const A=J.current;J.current=$,$==="Completed"&&A!=="Completed"&&U!=null&&(a(Ze({messageSection:"card_policy_created",messageText:"success",type:"success"})),e(_))},[a,$,U,e,_]);const o=$==="Error"?E.error?.message??bn.createPolicyGenericErrorMessage:void 0;return b&&t!=null?x==null?c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:g,handleDrawerToggle:P}),c.jsx(mr,{showUploadDocumentSection:!0,navBarTitle:bn.createPageTitle,onBackClick:D,onClickMenuIcon:u,isAiCfoAccessEnabled:C,onAskAiCfoClick:T})]}):c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:g,handleDrawerToggle:P}),c.jsx(Kc,{formDraft:x,vendorSearchOptions:j,categorySearchOptions:f,isVendorSearchLoading:F==="In-Progress",onVendorSearchTextChange:z,submitState:$,submitErrorMessage:o,documentUploadState:y,uploadedFileName:k,isAiCfoAccessEnabled:C,onAskAiCfoClick:T,onBackClick:D,onCancelClick:G,onClickMenuIcon:u,onFormChange:Q,onSubmit:I,onUploadDocument:N,onRemoveDocument:K})]}):c.jsx(oa,{to:"..",replace:!0})}const{spendManagement:{chargeCard:{cardPolicyPage:Bo}}}=Xe.getLocalizedStrings(),Ro=e=>Ln(e,!1),Lo=e=>On(e.name,!1);function Oo(){const e=le(),n=he(),{tenantEmailDomain:t,templateId:a}=Ve(),s=me(),b=Le(),g=Te(b?.loggedInUserRoleMap),[S,P]=r.useState(!1),u=r.useCallback(o=>{P(o)},[]),C=r.useCallback(()=>{u(!0)},[u]),{isAiCfoAccessEnabled:T,onAskAiCfoClick:v}=xa({mobileExploreReferrer:"Card Policy"}),m=i(o=>ps(o)),M=i(o=>Dn(o.cardPolicyState)),B=i(o=>_n(o.cardPolicyState)),R=i(o=>Pn(o.cardPolicyState)),p=i(o=>wn(o.cardPolicyState)),h=i(o=>vn(o.cardPolicyState)),F=i(o=>Fn(o.cardPolicyState)),l=i(o=>Tn(o.cardPolicyState)),w=i(o=>Pt(o.cardPolicyState)),E=i(o=>Rn(o)),U=i(o=>a!=null?hs(o.cardPolicyState,a):void 0),y=r.useMemo(()=>m.templateId===a&&m.formDraft!=null?m.formDraft:U!=null?fs(U):void 0,[m.templateId,m.formDraft,U,a]);r.useEffect(()=>{if(a==null)return;const o=m.detailFetchState.fetchState;m.templateId===a&&(o==="Completed"||o==="In-Progress")||U!=null||s(gs(a))},[s,a,m.templateId,m.detailFetchState.fetchState,U]),r.useEffect(()=>{M!=="Completed"&&M!=="In-Progress"&&s(xn())},[s,M]),Pr();const k=i(o=>o.chargeCardConfigState.receiptRequiredAboveAmount.amount);r.useEffect(()=>{E.fetchState==="Not-Started"&&s(ia(!1,!1,!1))},[E.fetchState,s]);const x=r.useMemo(()=>B.map(Ro),[B]),d=r.useMemo(()=>l.map(Lo),[l]),f=r.useMemo(()=>E.cards.filter(o=>!lr(o.status.code)).map(_r),[E.cards]);Rt({isDataReady:y!=null});const j=r.useMemo(()=>{if(y!=null)return Wc({draft:y,cardRows:f,categorySearchOptions:x,vendorSearchOptions:d,defaultRequireReceiptAmount:k,suggestedAllowMerchants:R,suggestedBlockMerchants:p,suggestedAllowCategories:h,suggestedBlockCategories:F})},[y,f,x,d,k,R,p,h,F]),[H,O]=r.useState(void 0),L=r.useRef(!1);r.useEffect(()=>{L.current||H!=null||j==null||(L.current=!0,O(j))},[H,j]);const z=r.useCallback(o=>{O(o)},[]),$=r.useMemo(()=>jt(o=>{s(wt(o))},250),[s]);r.useEffect(()=>()=>{$.cancel()},[$]);const _=r.useCallback(o=>{$(o)},[$]),D=m.updateFetchState.fetchState,G=t!=null?`/${t}/cards/policy`:"..",Q=r.useCallback(()=>{const o=we(n.state?.pathnameStackToGoBack),A=o.poppedPathname??G;e(A,{state:{pathnameStackToGoBack:o.newStack}})},[n.state,e,G]),I=r.useCallback(()=>{e(G)},[e,G]),N=r.useCallback(o=>{if(a==null)return;const A=ur(o);s(Ss(A)),s(bs(a))},[s,a]),K=r.useRef(D);r.useEffect(()=>{const o=K.current;K.current=D,D==="Completed"&&o!=="Completed"&&(s(Ze({messageSection:"card_policy_updated",messageText:"success",type:"success"})),e(G))},[s,D,e,G]);const J=D==="Error"?m.updateFetchState.error?.message??Bo.updatePolicyGenericErrorMessage:void 0;return!g||t==null||a==null?c.jsx(oa,{to:"..",replace:!0}):H!=null&&M==="Completed"&&E.fetchState==="Completed"?c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:S,handleDrawerToggle:u}),c.jsx(qc,{templateName:m.template?.name??"",formDraft:H,vendorSearchOptions:d,categorySearchOptions:x,isVendorSearchLoading:w==="In-Progress",onVendorSearchTextChange:_,submitState:D,submitErrorMessage:J,isAiCfoAccessEnabled:T,onAskAiCfoClick:v,onBackClick:Q,onCancelClick:I,onClickMenuIcon:C,onFormChange:z,onSubmit:N})]}):c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:S,handleDrawerToggle:u}),c.jsx(mr,{showUploadDocumentSection:!1,navBarTitle:m.template?.name,onBackClick:Q,onClickMenuIcon:C,isAiCfoAccessEnabled:T,onAskAiCfoClick:v})]})}function wr(e,n,t){return n?e.filter(a=>a!=null&&a.trim().length>0).slice(0,t):[]}function vr(e){return i(n=>e==null||e===""?{chips:ft,isResolved:!1}:function(t){const a=t?.fetchState,s=a==="Completed"||a==="Error";return{chips:a==="Completed"?t?.suggestedQuestions??ft:ft,isResolved:s}}(ys(n,e)),_t)}const ft=[],{spendManagement:{chargeCard:{cardPolicyAiCfoHero:{headline:Uo,subheadline:jo,pageTitle:Mo}}}}=Xe.getLocalizedStrings(),No=e=>{const n=e.cardsCount>0?e.cardsCount:e.appliedCards.length,t=e.allowedEntity.merchantNames.length+e.blockedEntity.merchantNames.length,a=e.allowedEntity.categoryCodes.length+e.blockedEntity.categoryCodes.length;return{templateId:e.templateId,name:e.name,description:e.description,mode:e.mode==="flexible"?"flexible":"strict",createdAtFormatted:e.createdAt.format("ll"),cardsCount:n,vendorRestrictionsCount:t,categoryRestrictionsCount:a}};function Vo(){const e=le(),n=he(),{tenantEmailDomain:t}=Ve(),a=me(),s=Le(),b=Te(s?.loggedInUserRoleMap),[g,S]=r.useState(!1),P=r.useCallback(_=>{S(_)},[]),u=r.useCallback(()=>{P(!0)},[P]),{useFeatureGate:C}=ue(),{isFeatureEnabled:T}=C(Y.isAiCfoFileUploadEnabled),{isFeatureEnabled:v}=C(Y.isCardPolicyEnabled),{isAiCfoAccessEnabled:m,onAskAiCfoClick:M}=xa({mobileExploreReferrer:"Card Policy"}),B=i(_=>Is(_)),R=i(_=>Bn(_.createCardPolicyState)),p=i(_=>ks(_.createCardPolicyState)),h=i(_=>p==null?[]:jn(_.aiCfoState,p).filter(D=>D.kind==="creating_policy"),_t),F=R.fetchState==="In-Progress"?Math.max(h.length,1):0,l=i(_=>Es(_.createCardPolicyState)),w=ya(R.fetchState);r.useEffect(()=>{if(w==="In-Progress"&&R.fetchState==="Completed"&&p!=null)h.forEach(_=>{a(yt({chatSessionId:p,id:_.id,entityIds:l,kind:"created_policy"}))});else if(w==="In-Progress"&&R.fetchState==="Error"&&p!=null){h.forEach(D=>{a(yt({chatSessionId:p,id:D.id,kind:"errored_policy"}))});const _=R.error?.message!=null&&R.error.message.length>0?R.error.message:Xe.getLocalizedStrings().common.errorMessage.somethingWentWrongPleaseTryAgain;a(Ze({messageSection:"card_policy_created",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"_api-error_",variableValue:_}]}))}},[R.error?.message,R.fetchState,a,p,l,h,w]);const E=B.fetchState.fetchState;r.useEffect(()=>{E!=="Not-Started"&&E!=="Error"||a(As())},[a,E]);const U=B.archiveFetchState.fetchState,y=ya(U);r.useEffect(()=>{y==="In-Progress"&&U==="Completed"&&a(Ze({messageSection:"card_policy_deleted",messageText:"success",type:"success"}))},[U,a,y]);const k=r.useMemo(()=>B.templates.map(No),[B.templates]);Rt({isDataReady:B.fetchState.fetchState==="Completed"});const x=k.length>0||F>0,d=function(_){const{hasAnyPolicies:D,isChargeCardAdmin:G,isFileUploadEnabled:Q}=_,I=le(),N=he(),{tenantEmailDomain:K}=Ve(),{isAiCfoOpen:J,setIsAiCfoOpen:o}=Cr(),A=pr(),W=hr(),ne=i(oe=>Un(oe)).createSessionAndSubmitState.fetchState==="In-Progress",{chips:q,isResolved:ke}=vr("card_policy"),ve=r.useMemo(()=>wr(q,ke,3),[q,ke]),[fe,se]=r.useState(""),Ee=W&&A&&K!=null&&!J,re=r.useCallback(oe=>{if(K==null)return;const fa=ye(N.state?.pathnameStackToGoBack,N.pathname);I(`/${K}/cards/ask`,{state:{message:"",origin:"",pathnameStackToGoBack:fa,referrer:"card_policy_hero",aiCfoInitialQuestion:oe,aiCfoShouldSubmit:oe!=null&&oe.trim().length>0}})},[N.pathname,N.state,I,K]),Ce=r.useCallback(oe=>{oe.trim().length!==0&&(se(""),re(oe))},[re]),Ae=r.useCallback(()=>{const oe=fe.trim();oe.length!==0&&(se(""),re(oe))},[fe,re]),ee=r.useCallback(()=>{},[]),Fe=r.useCallback(oe=>{se(oe)},[]),De=r.useCallback(()=>{o(!0)},[o]),ae=r.useCallback(()=>{re(void 0)},[re]);return r.useMemo(()=>{if(Ee&&!D&&G)return{aiAgentName:Mo,headline:Uo,subheadline:jo,promptChips:ve,composer:{currentInput:fe,isSubmitting:ne,isFileUploadEnabled:Q,onInputChange:Fe,onSubmit:Ae,onStopSubmit:ee},onPromptClick:Ce,onOpenSidePanel:De,onOpenFullView:ae,dataTestIdPrefix:"card-policy-ai-cfo-hero"}},[fe,D,Ee,G,Q,ne,Fe,ae,De,Ce,ee,Ae,ve])}({hasAnyPolicies:x,isChargeCardAdmin:b,isFileUploadEnabled:T}),f=v&&d!=null?c.jsx(fr,{...d}):null,j=m&&f==null,H=r.useCallback(()=>{const _=we(n.state?.pathnameStackToGoBack),D=_.poppedPathname??"..";e(D,{state:{pathnameStackToGoBack:_.newStack}})},[n.state,e]),O=r.useCallback(()=>{t!=null&&e(`/${t}/cards/policy/new`)},[e,t]),L=r.useCallback(_=>{t!=null&&e(`/${t}/cards/policy/${_}/edit`)},[e,t]),z=r.useCallback(_=>{a(Ds(_))},[a]),$=B.fetchState.fetchState;return!x&&$!=="Completed"&&$!=="Error"?c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:g,handleDrawerToggle:P}),c.jsx(Qc,{onBackClick:H,onNewPolicyClick:O,onClickMenuIcon:u,isAiCfoAccessEnabled:m,onAskAiCfoClick:M})]}):c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:g,handleDrawerToggle:P}),c.jsx(Jc,{policies:k,archivingTemplateId:B.archiveTargetTemplateId,pendingCreationCount:F,onBackClick:H,onNewPolicyClick:O,onEditPolicyClick:L,onArchivePolicyClick:z,onClickMenuIcon:u,policyAiCfoHero:f,isAiCfoAccessEnabled:j,onAskAiCfoClick:M})]})}function Ho(){const e=le(),{cardId:n}=Ve(),t=me(),a=te.getSignedInUser(),s=i(q=>ge(q)),b=Le(),g=Te(b?.loggedInUserRoleMap),{useFeatureGate:S}=ue();if(a==null)throw Error("Can't access Add To Wallet Page without signing in...");const[P,u]=r.useState(!1),C=i(q=>qa(q).firstViewAfterActivation);if(n==null)throw Error("Empty card id is not valid...");const T=s.userRole.includes("charge_card_user"),{isFeatureEnabled:v}=S(Y.isChargeCardFeatureEnabled),m=!!s.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:M}=S(Y.isDebitCardFeatureEnabled),B=xe(s),R=Be(s),p=Re(M,s),h=s.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,F=Oe({isDebitCardFeatureEnabled:M,isBankingOnlyTenant:p}),l=Ue({isCardsOnlyTenant:B,isChargeCardFeatureEnabled:v,isBookKeepingTenant:R,isDebitCardProductVisible:F,chargeCardsCreditAccountLimit:h}),w=!!s.companyDebitCardInfo?.info?.isDebitCardEnabled,E=i(q=>da(q,s.companyId)),U=la(E.controllers),{creditAccount:y,creditAccountRepayment:k}=i(q=>ua(q)),x=i(q=>q.classListState.fetchState),d=!T&&l&&m,f=i(q=>vt(q,n,d,l)),[j,H]=r.useState(!1),O=f.chargeCard,L=O?.cardCreatedByUser?.userId,z=i(q=>L!=null?$a(q.userRoleState,L):void 0),$=z?.accountingClassIDs[0],_=i(q=>$!=null?za(q.classState,{classId:$,reportId:"class_list"}):void 0),D=O?.cardHolderUser?.userId,G=i(q=>D!=null?$a(q.userRoleState,D):void 0),Q=G?.accountingClassIDs[0],I=i(q=>Q!=null?za(q.classState,{classId:Q,reportId:"class_list"}):void 0),N=O?.type.code==="business_physical_credit_card"||O?.type.code==="business_physical_debit_card",K=O?.type.code==="business_physical_debit_card";r.useEffect(()=>{C&&P===!1&&N&&(u(!0),setTimeout(()=>{t(Za()),K&&t(Ze({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[C,P,N,K]),r.useEffect(()=>{j||f.fetchState==="Completed"||f.fetchState==="In-Progress"||n==null||(H(!0),t(ka(n,d,!1)))},[j,f,n,t]),r.useEffect(()=>{if(f.fetchState==="Completed"&&(N===!1||N&&O?.status?.code!=="active"||O?.cardHolderUserId!==a.userId||C===!1&&P===!1||O?.type.code==="business_physical_debit_card"||O?.type.code==="business_virtual_debit_card")){const q=_e(s.tenantEmailDomain,n,a,O,C);e(q)}},[f.fetchState,C,N]),r.useEffect(()=>{y.fetchState!=="Completed"&&y.fetchState!=="In-Progress"&&l&&m&&g&&t(Qe()),k.fetchState!=="Completed"&&k.fetchState!=="In-Progress"&&l&&m&&g&&t(Ft()),x!=="Completed"&&x!=="In-Progress"&&t(Mn())},[y.fetchState,k.fetchState,t,l,m,g,x]);const J=()=>{if(a!=null&&n!=null){t(Za());const q=_e(s.tenantEmailDomain,n,a);e(q)}},o=O?.type.code==="business_physical_debit_card"||O?.type.code==="business_virtual_debit_card",A=Je(l,F,w,m),W=Ba(l,m,g,y,k),ne=Ir(o,f);return f.fetchState!=="Completed"?c.jsx(va,{fetchState:"In-Progress"}):c.jsxs(c.Fragment,{children:[c.jsx(nt,{showConfetti:C}),c.jsx(Xc,{onGotItClick:J,isDebitCard:O?.type.code==="business_physical_debit_card",controllerEmails:U,isChargeCardFeatureEnabled:l,isDebitCardFeatureEnabled:F,isDebitCardSetupEnabled:w,isChargeCardSetupEnabled:m,productInformation:A,creditAccountInformation:W,debitAccountInformation:ne,chargeCardDetailView:f,creditAccount:y,classListFetchState:x,creditAccountRepayment:k,cardIssuedByRoles:z?.userRoles,cardIssuedByDepartmentName:_?.className,cardHolderRoles:G?.userRoles,cardHolderDepartmentName:I?.className})]})}const Fr="charge-card-transaction-update",Tr="charge-card-transaction-created",xr="charge-card-transaction-declined",Br="charge-card-transaction-updated",Rr="charge-card-transaction-receipt-uploaded",pa="charge-card-status-update",Ht="charge-card-spending-updated",ot="credit-account-balance-updated",it="charge-card-created",Gt="charge-card-limit-updated",$t="charge-card-limit-reset",zt="charge-card-renamed",Go="charge-card-department-updated",Lr="charge-card-repayment-completed",Or="charge-card-payment-date-updated",Ra="charge-card-cashback-redeemed",La="charge-card-cashback-earned",ha=(e,n)=>e==null||e===""?[]:n.map(t=>`private-encrypted-${e}.${t}`),$o=[La,Ra],zo=Pe(function(e){const n=ma(e);return{insightsData:n.insight,cashbackByPeriod:n.cashbackByPeriod,uiState:n.uiState,cashbackSummary:n.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(n,t)=>{e(_s({uiState:{sortKey:n,sortOrder:t}}))}}})(ao);function Zo(){const e=le(),n=me(),t=he(),a=te.getSignedInUser(),s=i(M=>ge(M)),{useFeatureGate:b}=ue(),{isFeatureEnabled:g}=b(Y.isCardsCommentingEnabled),[S,P]=r.useState(!1),u=i(M=>ma(M)),C=Dr(s.companyId,{clearParams:u.fetchState==="Completed"}),T=r.useCallback(()=>{const M=we(t.state?.pathnameStackToGoBack),B=M.poppedPathname??Yo(s.tenantEmailDomain);e(B,{state:{pathnameStackToGoBack:M.newStack}})},[e,t,s.tenantEmailDomain]),v=ea(s);if(Vt({events:ha(v,$o),onEvent:M=>{switch(M){case La:case Ra:return void n(_a(!0))}},onSubscribed:()=>{n(_a(!0))}}),r.useEffect(()=>{S||u.fetchState==="Completed"||u.fetchState==="In-Progress"||(P(!0),n(_a()))},[S,u,n]),a==null)throw Error("Can't access cashback detail page without signing in...");const m=u.cashbackSummary?.cashbackEarned?.amount!=null&&u.fetchState!=="Not-Started";return u.fetchState!=="In-Progress"||m?(u.cashbackSummary?.cashbackEarned?.amount??0)===0&&u.fetchState==="Completed"?c.jsx(ct,{}):c.jsx(zo,{onBackClick:T,isCardsCommentingEnabled:g,initialOpenThreadRequest:C}):c.jsx(eo,{onBackClick:T})}const Yo=e=>`/${e}/cards`,Ko={containerWidth:new Ta(100,58)},Wo=({appContent:e})=>{const n=Fa(),t=me(),a=le(),{cardId:s}=Ve(),b=he(),{useDynamicConfig:g}=ue(),[S,P]=r.useState(!1),[u,C]=r.useState(!1),[T,v]=r.useState(!1),[m,M]=r.useState(!1),B=te.getSignedInUser();if(B==null)throw Error("Can't access onboarding card page without signing in...");const R=i(I=>ge(I));if(s==null)throw Error("Empty card id is not valid...");const{configValue:p}=g(Ye.zeniCardsConfig),h=p.max_charge_card_activation_attempts_by_card_id,F=i(I=>Ps(I,s)),l=F.chargeCard,w=i(I=>I.chargeCardConfigState.fetchState),{useFeatureGate:E}=ue(),{isFeatureEnabled:U}=E(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:y}=E(Y.isDebitCardFeatureEnabled),k=Re(y,R),x=Oe({isDebitCardFeatureEnabled:y,isBankingOnlyTenant:k}),d=!!R.companyChargeCardInfo?.info?.isChargeCardEnabled,f=R.userRole.includes("charge_card_user"),j=xe(R),H=Be(R),O=R.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,L=Ue({isCardsOnlyTenant:j,isChargeCardFeatureEnabled:U,isBookKeepingTenant:H,isDebitCardProductVisible:x,chargeCardsCreditAccountLimit:O}),z=!f&&L&&d;r.useEffect(()=>{S===!1&&w!=="In-Progress"&&w!=="Completed"&&(t(Qa()),P(!0)),u===!1&&F.fetchState==="Not-Started"&&(C(!0),t(ka(s,z,L)))},[u,F.fetchState,S,w]);const $=l?.type.code==="business_physical_credit_card"||l?.type.code==="business_physical_debit_card";r.useEffect(()=>{if(F.fetchState==="Completed"){if(T===!1&&($===!1||$&&l?.status?.code!=="inactive"||l?.cardHolderUserId!==B.userId)){const I=_e(R.tenantEmailDomain,s,B,l,!0),N=ye(b.state?.pathnameStackToGoBack,b.pathname);a(I,{state:{pathnameStackToGoBack:N}})}else if(T&&F.isRefreshingViewInBackground===!1&&l?.status?.code==="active"){t(ws({chargeCardId:s}));const I=_e(R.tenantEmailDomain,s,B,l,!0),N=ye(b.state?.pathnameStackToGoBack,b.pathname);t(Ja()),a(I,{state:{pathnameStackToGoBack:N}})}}},[F.fetchState,l?.type.code,T,F.isRefreshingViewInBackground]);const _=te.getZeniOtpTokenForCardHolder(s),D=i(I=>Nn(I.userState,B.userId)),G=()=>{l?.status?.code!=="active"&&t(Sa(s,!0))};r.useEffect(()=>{F.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&l?.cardActivationAttemptHistory.some(I=>I.statusCode==="success")===!0&&T===!1&&(setTimeout(G,3e3),v(!0))},[F.updatePhysicalChargeCardAttemptFetchState.fetchState,l?.cardActivationAttemptHistory]);const Q=I=>{M(I)};if(w!=="Completed"||l==null)return c.jsx(va,{fetchState:"In-Progress"});if(l.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(D?.phone==null)throw Error("Can't access user phone number.");return c.jsxs(Jo,{children:[c.jsx(Ie,{isAppContentDrawerOpen:m,handleDrawerToggle:Q}),c.jsx(qo,{cardId:s,card:l,shippingAddressId:l.shippingAddressId,phone:D.phone,signedInUser:B,isSandboxEnv:Lt(),chargeCardDetailState:F,signedInUserToken:_,navigate:a,currentTenant:R,location:b,maxChargeCardActivationAttempts:h[s]!=null?h[s]:p.default_max_charge_card_activation_attempts!=null?p.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:p.charge_card_cashback_rate_per_transaction!=null?p.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{Q(!0)}}),e!=null?c.jsx(Qo,{windowSize:n,children:e}):null]})},qo=Pe(function(e,{chargeCardDetailState:n,shippingAddressId:t,location:a,cardId:s}){const b=vs(e.addressState,t);if(b==null)throw Error("Can't access shippingAddress.");const g=Vn(e,s),S=n.updateStatus,P=Ca(e,!1,!1,!1);let u=!1;P.fetchState==="Completed"&&P.cards.length<=1&&(u=!0);const C=a.state?.message==="comingFromV2UrlPath";return{showActivatePage:n.chargeCard?.providerCardCreateTime!=null&&n.chargeCard.providerCardCreateTime.add(24,"h").isBefore(Fs())||C,showMenuIcon:u,shippingAddress:b,vgsVaultId:rt.cardVaultId,twoFAView:g,activationWaitStatus:S,isRefreshingViewInBackground:n.isRefreshingViewInBackground}},function(e,n){const{navigate:t,cardId:a,location:s,currentTenant:b,chargeCardDetailState:g}=n,S=g.chargeCard?.cardProviderID,{tenantEmailDomain:P}=b;return{onGetOtp:u=>{S!=null&&e(at(u,"ChargeCardHolder",a))},onUpdatePhysicalChargeCardAttempt:u=>{e(xs(a,u))},onResendOtp:u=>{S!=null&&e(et(u,"ChargeCardHolder",a))},onVerifyOtp:(u,C)=>{S!=null&&e(Xa(u,C,"ChargeCardHolder",a))},onVerifyOtpSuccess:u=>{u!=null&&te.saveZeniOtpTokenForCardHolder(u,a)},onCVVActivateSuccess:()=>{e(Ts({chargeCardId:a}))},onBackClick:()=>{const u=we(s.state?.pathnameStackToGoBack),C=u.poppedPathname==null||u.poppedPathname.includes("onboard")===!0?aa(P):u.poppedPathname;t(C,{state:{pathnameStackToGoBack:u.newStack}})}}})(to),Qo=He.div`
|
|
1
|
+
import{j as c}from"./liveblocks-BfjqeyQ7.js";import{u as me,j as i,h as le,g as he,i as Ve,N as oa,s as _t,n as Pe,t as An,o as ts,p as ce}from"./core-D5--W5Ul.js";import{f8 as Pt,RU as ns,fk as wt,bt as Te,RV as rs,RW as ss,eZ as pn,RX as Dn,f6 as _n,RY as Pn,RZ as wn,R_ as vn,R$ as Fn,f7 as Tn,fj as xn,S0 as Bn,S1 as cs,fd as os,fc as is,S2 as ds,C3 as Rn,fm as ia,S3 as ls,S4 as us,e$ as ms,e_ as Cs,fz as Ze,ff as Ln,fe as On,S5 as ps,fg as hs,BA as fs,Bz as gs,BD as Ss,BF as bs,fs as ys,eW as Un,S6 as Is,S7 as ks,fx as jn,S8 as Es,fy as yt,BL as As,BI as Ds,eX as ge,S9 as qa,fC as xe,fD as Be,fE as Re,gx as da,cv as la,Sa as ua,Sb as vt,uR as $a,kG as za,Sc as Za,Cj as ka,fn as Qe,Cl as Ft,kw as Mn,Sd as ma,C7 as _a,Se as _s,Sf as Ps,Ca as Qa,Sg as ws,Qf as Ja,fi as Nn,Cg as Sa,hW as vs,Sh as Vn,f9 as Ca,bo as Fs,Si as Ts,gi as Xa,gh as et,CP as xs,gg as at,PX as Bs,Sj as Hn,co as Gn,cQ as Rs,Qe as wa,Do as $n,Sk as hn,C_ as Pa,Sl as zn,Dp as Ls,QE as Os,Dq as Us,Ev as js,uc as Ms,Ep as Ns,Sm as Vs,Ck as sa,Sn as Hs,So as Gs,Sp as $s,Sq as zs,Sr as Zs,Ss as Tt,St as Ys,CA as Zn,Ct as Ks,Su as Ws,gz as qs,CJ as Yn,CN as Kn,gy as Qs,Sv as Js,Da as Wn,Sw as Xs,Sx as ec,Sy as ac,CL as qn,Cw as Qn,Cd as Jn,CF as Xn,CD as er,CH as tc,Sz as ar,SA as nc,fu as rc,fv as sc,fw as cc,SB as tt,fo as tr,cS as xt,SC as oc,SD as ic,SE as dc,SF as lc,CV as It,Dh as uc,Dd as mc,CR as Cc,Df as pc,D5 as hc,D7 as fc,SG as nr,Dn as Ga,Ke as gc,SH as Sc,SI as bc,SJ as yc,SK as rr,SL as Ic,DK as kc,CZ as sr,CU as Ne,CY as Ec,SM as Ac,SN as Dc,C4 as _c,SO as cr,fh as or,SP as Pc,C6 as wc,C5 as fn,SQ as vc,SR as Fc,SS as Tc,ML as xc,ST as Bt,SU as Bc,xS as ir,le as Rc,hM as Lc,DP as Oc,SV as dr,f3 as Uc,f4 as jc,SW as Mc,dj as Nc,fl as Vc,DF as Hc,Dz as qe,bs as Gc,bJ as $c,cA as zc,bK as Zc,LY as Yc}from"./zeni-epic-state-CP708m5a.js";import{I as Le,cq as lr,s as we,cr as ur,cs as mr,ct as Kc,a as Xe,$ as Rt,cu as Wc,cv as qc,X as Cr,c as pr,_ as hr,v as ye,Q as ue,e as Y,aq as ya,cw as fr,cx as Qc,cy as Jc,z as te,y as va,cf as nt,cz as Xc,cA as eo,cB as ao,Z as Fa,aR as Ye,bs as Lt,cC as to,D as Ta,n as rt,m as Ot,f as X,a8 as st,cD as no,bF as ba,cE as kt,cF as ro,J as Ut,cG as so,at as gr,a3 as Et,cH as co,Y as Sr,h as br,cI as oo,cJ as io,cK as lo,cL as uo,cM as mo,cN as Co,o as Ya,cO as po,cP as ho,cQ as ht,A as fo,cR as go,cS as So,cT as bo,cU as yo,cV as Io,i as ko}from"./index-BbrjBaX2.js";import{n as He,D as yr,S as Eo}from"./mui-BkqswRey.js";import{a as r}from"./sentry-NLHTFHKl.js";import{u as xa}from"./useAskAiCfoHostNavButtonProps-DWeS72rU.js";import{M as Ie}from"./MobileAppDrawer-DTNaBxxF.js";import{d as jt}from"./recharts--lP9DGTY.js";import{g as _e,a as Ba,b as Ir,c as Oe,d as Ue,e as Je,f as ea,h as aa,A as Ao,i as Mt,P as Do,j as Nt,s as Ia,k as kr,l as ca,m as Er,n as _o,o as Ar,p as Po,S as gn}from"./SetupPagesScreen-BgC6pVZV.js";import{u as Dr}from"./useInitialThreadRequest-Crst1isw.js";import ct from"./NotFoundScreen-Dx10N2h0.js";import{u as Vt}from"./useChargeCardPusherEvents-DsNcb67V.js";import{n as Sn}from"./utils-DKA4xBgw.js";import{t as wo}from"./AddressScreen-CTBC0Okq.js";import"./analytics-o8UTT6MT.js";import"./plaid-Dly6vYcb.js";import"./dnd-1wW2WkhB.js";import"./stripe-DMRn4zHo.js";import"./lottie-CY-jVQNU.js";import"./lexical-MdJnvG5R.js";import"./pdf-C9g_mgTQ.js";import"./analyticsHelper-38O5wjc-.js";import"./routePaths-YPF0RRmf.js";import"./BusinessVerificationPageScreen-BdbkgyBr.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="f3a81f9f-dd27-4f82-a839-a704e335abc1",e._sentryDebugIdIdentifier="sentry-dbid-f3a81f9f-dd27-4f82-a839-a704e335abc1")}catch{}})();const vo=e=>{const n=e.cardHolderUser,t=`${n.firstName??""} ${n.lastName??""}`.trim()||n.email||n.userId;return{userId:n.userId,displayName:t,roleLabel:e.cardHolderRoles?.titleAtCompany}},_r=e=>({id:e.id,isChecked:!1,cardName:e.cardName,last4:e.accountLast4,limitAmount:e.limit?.amount??0,limitCadence:e.creditLimitFrequency?.code,owner:vo(e),utilizationAmount:(e.limit?.amount??0)-(e.available?.amount??0)});function Pr(){const e=me(),n=i(a=>Pt(a.cardPolicyState)),t=i(a=>ns(a.cardPolicyState));r.useEffect(()=>{t!==""||n==="Completed"&&t===""||n==="In-Progress"||e(wt())},[e,n,t])}const{spendManagement:{chargeCard:{cardPolicyPage:bn}}}=Xe.getLocalizedStrings(),Fo=e=>Ln(e,!1),To=e=>On(e.name,!1);function xo(){const e=le(),n=he(),{tenantEmailDomain:t}=Ve(),a=me(),s=Le(),b=Te(s?.loggedInUserRoleMap),[g,S]=r.useState(!1),P=r.useCallback(A=>{S(A)},[]),u=r.useCallback(()=>{P(!0)},[P]),{isAiCfoAccessEnabled:C,onAskAiCfoClick:T}=xa({mobileExploreReferrer:"Card Policy"});r.useEffect(()=>()=>{a(rs()),a(ss()),a(pn())},[a]);const v=i(A=>Dn(A.cardPolicyState)),m=i(A=>_n(A.cardPolicyState)),M=i(A=>Pn(A.cardPolicyState)),B=i(A=>wn(A.cardPolicyState)),R=i(A=>vn(A.cardPolicyState)),p=i(A=>Fn(A.cardPolicyState)),h=i(A=>Tn(A.cardPolicyState)),F=i(A=>Pt(A.cardPolicyState)),l=i(A=>A.chargeCardConfigState.receiptRequiredAboveAmount.amount),w=i(A=>A.chargeCardConfigState.fetchState);r.useEffect(()=>{v!=="Completed"&&v!=="In-Progress"&&a(xn())},[a,v]),Pr();const E=i(A=>Bn(A.createCardPolicyState)),U=i(A=>cs(A.createCardPolicyState)),y=i(A=>os(A.cardPolicyState)),k=i(A=>is(A.cardPolicyState)),x=i(A=>ds(A.createCardPolicyState)),d=i(A=>Rn(A));r.useEffect(()=>{d.fetchState==="Not-Started"&&a(ia(!1,!1,!1))},[d.fetchState,a]);const f=r.useMemo(()=>m.map(Fo),[m]),j=r.useMemo(()=>h.map(To),[h]),H=r.useMemo(()=>d.cards.filter(A=>!lr(A.status.code)).map(_r),[d.cards]),O=v==="Completed"&&d.fetchState==="Completed"&&w==="Completed";r.useEffect(()=>{O&&x==null&&a(ls({cardsMasterList:H,defaultRequireReceiptAmount:l,suggestedAllowMerchants:M,suggestedBlockMerchants:B,suggestedAllowCategories:R,suggestedBlockCategories:p}))},[w,a,O,x,H,l,M,B,R,p]);const L=r.useMemo(()=>jt(A=>{a(wt(A))},250),[a]);r.useEffect(()=>()=>{L.cancel()},[L]);const z=r.useCallback(A=>{L(A)},[L]),$=E.fetchState,_=t!=null?`/${t}/cards/policy`:"..",D=r.useCallback(()=>{const A=we(n.state?.pathnameStackToGoBack),W=A.poppedPathname??_;e(W,{state:{pathnameStackToGoBack:A.newStack}})},[n.state,e,_]),G=r.useCallback(()=>{e(_)},[e,_]),Q=r.useCallback(A=>{a(us(A))},[a]),I=r.useCallback(A=>{const W=ur(A);a(ms({templates:[W]}))},[a]),N=r.useCallback(A=>{A.length!==0&&a(Cs(A))},[a]),K=r.useCallback(()=>{a(pn())},[a]),J=r.useRef($);r.useEffect(()=>{const A=J.current;J.current=$,$==="Completed"&&A!=="Completed"&&U!=null&&(a(Ze({messageSection:"card_policy_created",messageText:"success",type:"success"})),e(_))},[a,$,U,e,_]);const o=$==="Error"?E.error?.message??bn.createPolicyGenericErrorMessage:void 0;return b&&t!=null?x==null?c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:g,handleDrawerToggle:P}),c.jsx(mr,{showUploadDocumentSection:!0,navBarTitle:bn.createPageTitle,onBackClick:D,onClickMenuIcon:u,isAiCfoAccessEnabled:C,onAskAiCfoClick:T})]}):c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:g,handleDrawerToggle:P}),c.jsx(Kc,{formDraft:x,vendorSearchOptions:j,categorySearchOptions:f,isVendorSearchLoading:F==="In-Progress",onVendorSearchTextChange:z,submitState:$,submitErrorMessage:o,documentUploadState:y,uploadedFileName:k,isAiCfoAccessEnabled:C,onAskAiCfoClick:T,onBackClick:D,onCancelClick:G,onClickMenuIcon:u,onFormChange:Q,onSubmit:I,onUploadDocument:N,onRemoveDocument:K})]}):c.jsx(oa,{to:"..",replace:!0})}const{spendManagement:{chargeCard:{cardPolicyPage:Bo}}}=Xe.getLocalizedStrings(),Ro=e=>Ln(e,!1),Lo=e=>On(e.name,!1);function Oo(){const e=le(),n=he(),{tenantEmailDomain:t,templateId:a}=Ve(),s=me(),b=Le(),g=Te(b?.loggedInUserRoleMap),[S,P]=r.useState(!1),u=r.useCallback(o=>{P(o)},[]),C=r.useCallback(()=>{u(!0)},[u]),{isAiCfoAccessEnabled:T,onAskAiCfoClick:v}=xa({mobileExploreReferrer:"Card Policy"}),m=i(o=>ps(o)),M=i(o=>Dn(o.cardPolicyState)),B=i(o=>_n(o.cardPolicyState)),R=i(o=>Pn(o.cardPolicyState)),p=i(o=>wn(o.cardPolicyState)),h=i(o=>vn(o.cardPolicyState)),F=i(o=>Fn(o.cardPolicyState)),l=i(o=>Tn(o.cardPolicyState)),w=i(o=>Pt(o.cardPolicyState)),E=i(o=>Rn(o)),U=i(o=>a!=null?hs(o.cardPolicyState,a):void 0),y=r.useMemo(()=>m.templateId===a&&m.formDraft!=null?m.formDraft:U!=null?fs(U):void 0,[m.templateId,m.formDraft,U,a]);r.useEffect(()=>{if(a==null)return;const o=m.detailFetchState.fetchState;m.templateId===a&&(o==="Completed"||o==="In-Progress")||U!=null||s(gs(a))},[s,a,m.templateId,m.detailFetchState.fetchState,U]),r.useEffect(()=>{M!=="Completed"&&M!=="In-Progress"&&s(xn())},[s,M]),Pr();const k=i(o=>o.chargeCardConfigState.receiptRequiredAboveAmount.amount);r.useEffect(()=>{E.fetchState==="Not-Started"&&s(ia(!1,!1,!1))},[E.fetchState,s]);const x=r.useMemo(()=>B.map(Ro),[B]),d=r.useMemo(()=>l.map(Lo),[l]),f=r.useMemo(()=>E.cards.filter(o=>!lr(o.status.code)).map(_r),[E.cards]);Rt({isDataReady:y!=null});const j=r.useMemo(()=>{if(y!=null)return Wc({draft:y,cardRows:f,categorySearchOptions:x,vendorSearchOptions:d,defaultRequireReceiptAmount:k,suggestedAllowMerchants:R,suggestedBlockMerchants:p,suggestedAllowCategories:h,suggestedBlockCategories:F})},[y,f,x,d,k,R,p,h,F]),[H,O]=r.useState(void 0),L=r.useRef(!1);r.useEffect(()=>{L.current||H!=null||j==null||(L.current=!0,O(j))},[H,j]);const z=r.useCallback(o=>{O(o)},[]),$=r.useMemo(()=>jt(o=>{s(wt(o))},250),[s]);r.useEffect(()=>()=>{$.cancel()},[$]);const _=r.useCallback(o=>{$(o)},[$]),D=m.updateFetchState.fetchState,G=t!=null?`/${t}/cards/policy`:"..",Q=r.useCallback(()=>{const o=we(n.state?.pathnameStackToGoBack),A=o.poppedPathname??G;e(A,{state:{pathnameStackToGoBack:o.newStack}})},[n.state,e,G]),I=r.useCallback(()=>{e(G)},[e,G]),N=r.useCallback(o=>{if(a==null)return;const A=ur(o);s(Ss(A)),s(bs(a))},[s,a]),K=r.useRef(D);r.useEffect(()=>{const o=K.current;K.current=D,D==="Completed"&&o!=="Completed"&&(s(Ze({messageSection:"card_policy_updated",messageText:"success",type:"success"})),e(G))},[s,D,e,G]);const J=D==="Error"?m.updateFetchState.error?.message??Bo.updatePolicyGenericErrorMessage:void 0;return!g||t==null||a==null?c.jsx(oa,{to:"..",replace:!0}):H!=null&&M==="Completed"&&E.fetchState==="Completed"?c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:S,handleDrawerToggle:u}),c.jsx(qc,{templateName:m.template?.name??"",formDraft:H,vendorSearchOptions:d,categorySearchOptions:x,isVendorSearchLoading:w==="In-Progress",onVendorSearchTextChange:_,submitState:D,submitErrorMessage:J,isAiCfoAccessEnabled:T,onAskAiCfoClick:v,onBackClick:Q,onCancelClick:I,onClickMenuIcon:C,onFormChange:z,onSubmit:N})]}):c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:S,handleDrawerToggle:u}),c.jsx(mr,{showUploadDocumentSection:!1,navBarTitle:m.template?.name,onBackClick:Q,onClickMenuIcon:C,isAiCfoAccessEnabled:T,onAskAiCfoClick:v})]})}function wr(e,n,t){return n?e.filter(a=>a!=null&&a.trim().length>0).slice(0,t):[]}function vr(e){return i(n=>e==null||e===""?{chips:ft,isResolved:!1}:function(t){const a=t?.fetchState,s=a==="Completed"||a==="Error";return{chips:a==="Completed"?t?.suggestedQuestions??ft:ft,isResolved:s}}(ys(n,e)),_t)}const ft=[],{spendManagement:{chargeCard:{cardPolicyAiCfoHero:{headline:Uo,subheadline:jo,pageTitle:Mo}}}}=Xe.getLocalizedStrings(),No=e=>{const n=e.cardsCount>0?e.cardsCount:e.appliedCards.length,t=e.allowedEntity.merchantNames.length+e.blockedEntity.merchantNames.length,a=e.allowedEntity.categoryCodes.length+e.blockedEntity.categoryCodes.length;return{templateId:e.templateId,name:e.name,description:e.description,mode:e.mode==="flexible"?"flexible":"strict",createdAtFormatted:e.createdAt.format("ll"),cardsCount:n,vendorRestrictionsCount:t,categoryRestrictionsCount:a}};function Vo(){const e=le(),n=he(),{tenantEmailDomain:t}=Ve(),a=me(),s=Le(),b=Te(s?.loggedInUserRoleMap),[g,S]=r.useState(!1),P=r.useCallback(_=>{S(_)},[]),u=r.useCallback(()=>{P(!0)},[P]),{useFeatureGate:C}=ue(),{isFeatureEnabled:T}=C(Y.isAiCfoFileUploadEnabled),{isFeatureEnabled:v}=C(Y.isCardPolicyEnabled),{isAiCfoAccessEnabled:m,onAskAiCfoClick:M}=xa({mobileExploreReferrer:"Card Policy"}),B=i(_=>Is(_)),R=i(_=>Bn(_.createCardPolicyState)),p=i(_=>ks(_.createCardPolicyState)),h=i(_=>p==null?[]:jn(_.aiCfoState,p).filter(D=>D.kind==="creating_policy"),_t),F=R.fetchState==="In-Progress"?Math.max(h.length,1):0,l=i(_=>Es(_.createCardPolicyState)),w=ya(R.fetchState);r.useEffect(()=>{if(w==="In-Progress"&&R.fetchState==="Completed"&&p!=null)h.forEach(_=>{a(yt({chatSessionId:p,id:_.id,entityIds:l,kind:"created_policy"}))});else if(w==="In-Progress"&&R.fetchState==="Error"&&p!=null){h.forEach(D=>{a(yt({chatSessionId:p,id:D.id,kind:"errored_policy"}))});const _=R.error?.message!=null&&R.error.message.length>0?R.error.message:Xe.getLocalizedStrings().common.errorMessage.somethingWentWrongPleaseTryAgain;a(Ze({messageSection:"card_policy_created",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"_api-error_",variableValue:_}]}))}},[R.error?.message,R.fetchState,a,p,l,h,w]);const E=B.fetchState.fetchState;r.useEffect(()=>{E!=="Not-Started"&&E!=="Error"||a(As())},[a,E]);const U=B.archiveFetchState.fetchState,y=ya(U);r.useEffect(()=>{y==="In-Progress"&&U==="Completed"&&a(Ze({messageSection:"card_policy_deleted",messageText:"success",type:"success"}))},[U,a,y]);const k=r.useMemo(()=>B.templates.map(No),[B.templates]);Rt({isDataReady:B.fetchState.fetchState==="Completed"});const x=k.length>0||F>0,d=function(_){const{hasAnyPolicies:D,isChargeCardAdmin:G,isFileUploadEnabled:Q}=_,I=le(),N=he(),{tenantEmailDomain:K}=Ve(),{isAiCfoOpen:J,setIsAiCfoOpen:o}=Cr(),A=pr(),W=hr(),ne=i(oe=>Un(oe)).createSessionAndSubmitState.fetchState==="In-Progress",{chips:q,isResolved:ke}=vr("card_policy"),ve=r.useMemo(()=>wr(q,ke,3),[q,ke]),[fe,se]=r.useState(""),Ee=W&&A&&K!=null&&!J,re=r.useCallback(oe=>{if(K==null)return;const fa=ye(N.state?.pathnameStackToGoBack,N.pathname);I(`/${K}/cards/ask`,{state:{message:"",origin:"",pathnameStackToGoBack:fa,referrer:"card_policy_hero",aiCfoInitialQuestion:oe,aiCfoShouldSubmit:oe!=null&&oe.trim().length>0}})},[N.pathname,N.state,I,K]),Ce=r.useCallback(oe=>{oe.trim().length!==0&&(se(""),re(oe))},[re]),Ae=r.useCallback(()=>{const oe=fe.trim();oe.length!==0&&(se(""),re(oe))},[fe,re]),ee=r.useCallback(()=>{},[]),Fe=r.useCallback(oe=>{se(oe)},[]),De=r.useCallback(()=>{o(!0)},[o]),ae=r.useCallback(()=>{re(void 0)},[re]);return r.useMemo(()=>{if(Ee&&!D&&G)return{aiAgentName:Mo,headline:Uo,subheadline:jo,promptChips:ve,composer:{currentInput:fe,isSubmitting:ne,isFileUploadEnabled:Q,onInputChange:Fe,onSubmit:Ae,onStopSubmit:ee},onPromptClick:Ce,onOpenSidePanel:De,onOpenFullView:ae,dataTestIdPrefix:"card-policy-ai-cfo-hero"}},[fe,D,Ee,G,Q,ne,Fe,ae,De,Ce,ee,Ae,ve])}({hasAnyPolicies:x,isChargeCardAdmin:b,isFileUploadEnabled:T}),f=v&&d!=null?c.jsx(fr,{...d}):null,j=m&&f==null,H=r.useCallback(()=>{const _=we(n.state?.pathnameStackToGoBack),D=_.poppedPathname??"..";e(D,{state:{pathnameStackToGoBack:_.newStack}})},[n.state,e]),O=r.useCallback(()=>{t!=null&&e(`/${t}/cards/policy/new`)},[e,t]),L=r.useCallback(_=>{t!=null&&e(`/${t}/cards/policy/${_}/edit`)},[e,t]),z=r.useCallback(_=>{a(Ds(_))},[a]),$=B.fetchState.fetchState;return!x&&$!=="Completed"&&$!=="Error"?c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:g,handleDrawerToggle:P}),c.jsx(Qc,{onBackClick:H,onNewPolicyClick:O,onClickMenuIcon:u,isAiCfoAccessEnabled:m,onAskAiCfoClick:M})]}):c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:g,handleDrawerToggle:P}),c.jsx(Jc,{policies:k,archivingTemplateId:B.archiveTargetTemplateId,pendingCreationCount:F,onBackClick:H,onNewPolicyClick:O,onEditPolicyClick:L,onArchivePolicyClick:z,onClickMenuIcon:u,policyAiCfoHero:f,isAiCfoAccessEnabled:j,onAskAiCfoClick:M})]})}function Ho(){const e=le(),{cardId:n}=Ve(),t=me(),a=te.getSignedInUser(),s=i(q=>ge(q)),b=Le(),g=Te(b?.loggedInUserRoleMap),{useFeatureGate:S}=ue();if(a==null)throw Error("Can't access Add To Wallet Page without signing in...");const[P,u]=r.useState(!1),C=i(q=>qa(q).firstViewAfterActivation);if(n==null)throw Error("Empty card id is not valid...");const T=s.userRole.includes("charge_card_user"),{isFeatureEnabled:v}=S(Y.isChargeCardFeatureEnabled),m=!!s.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:M}=S(Y.isDebitCardFeatureEnabled),B=xe(s),R=Be(s),p=Re(M,s),h=s.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,F=Oe({isDebitCardFeatureEnabled:M,isBankingOnlyTenant:p}),l=Ue({isCardsOnlyTenant:B,isChargeCardFeatureEnabled:v,isBookKeepingTenant:R,isDebitCardProductVisible:F,chargeCardsCreditAccountLimit:h}),w=!!s.companyDebitCardInfo?.info?.isDebitCardEnabled,E=i(q=>da(q,s.companyId)),U=la(E.controllers),{creditAccount:y,creditAccountRepayment:k}=i(q=>ua(q)),x=i(q=>q.classListState.fetchState),d=!T&&l&&m,f=i(q=>vt(q,n,d,l)),[j,H]=r.useState(!1),O=f.chargeCard,L=O?.cardCreatedByUser?.userId,z=i(q=>L!=null?$a(q.userRoleState,L):void 0),$=z?.accountingClassIDs[0],_=i(q=>$!=null?za(q.classState,{classId:$,reportId:"class_list"}):void 0),D=O?.cardHolderUser?.userId,G=i(q=>D!=null?$a(q.userRoleState,D):void 0),Q=G?.accountingClassIDs[0],I=i(q=>Q!=null?za(q.classState,{classId:Q,reportId:"class_list"}):void 0),N=O?.type.code==="business_physical_credit_card"||O?.type.code==="business_physical_debit_card",K=O?.type.code==="business_physical_debit_card";r.useEffect(()=>{C&&P===!1&&N&&(u(!0),setTimeout(()=>{t(Za()),K&&t(Ze({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[C,P,N,K]),r.useEffect(()=>{j||f.fetchState==="Completed"||f.fetchState==="In-Progress"||n==null||(H(!0),t(ka(n,d,!1)))},[j,f,n,t]),r.useEffect(()=>{if(f.fetchState==="Completed"&&(N===!1||N&&O?.status?.code!=="active"||O?.cardHolderUserId!==a.userId||C===!1&&P===!1||O?.type.code==="business_physical_debit_card"||O?.type.code==="business_virtual_debit_card")){const q=_e(s.tenantEmailDomain,n,a,O,C);e(q)}},[f.fetchState,C,N]),r.useEffect(()=>{y.fetchState!=="Completed"&&y.fetchState!=="In-Progress"&&l&&m&&g&&t(Qe()),k.fetchState!=="Completed"&&k.fetchState!=="In-Progress"&&l&&m&&g&&t(Ft()),x!=="Completed"&&x!=="In-Progress"&&t(Mn())},[y.fetchState,k.fetchState,t,l,m,g,x]);const J=()=>{if(a!=null&&n!=null){t(Za());const q=_e(s.tenantEmailDomain,n,a);e(q)}},o=O?.type.code==="business_physical_debit_card"||O?.type.code==="business_virtual_debit_card",A=Je(l,F,w,m),W=Ba(l,m,g,y,k),ne=Ir(o,f);return f.fetchState!=="Completed"?c.jsx(va,{fetchState:"In-Progress"}):c.jsxs(c.Fragment,{children:[c.jsx(nt,{showConfetti:C}),c.jsx(Xc,{onGotItClick:J,isDebitCard:O?.type.code==="business_physical_debit_card",controllerEmails:U,isChargeCardFeatureEnabled:l,isDebitCardFeatureEnabled:F,isDebitCardSetupEnabled:w,isChargeCardSetupEnabled:m,productInformation:A,creditAccountInformation:W,debitAccountInformation:ne,chargeCardDetailView:f,creditAccount:y,classListFetchState:x,creditAccountRepayment:k,cardIssuedByRoles:z?.userRoles,cardIssuedByDepartmentName:_?.className,cardHolderRoles:G?.userRoles,cardHolderDepartmentName:I?.className})]})}const Fr="charge-card-transaction-update",Tr="charge-card-transaction-created",xr="charge-card-transaction-declined",Br="charge-card-transaction-updated",Rr="charge-card-transaction-receipt-uploaded",pa="charge-card-status-update",Ht="charge-card-spending-updated",ot="credit-account-balance-updated",it="charge-card-created",Gt="charge-card-limit-updated",$t="charge-card-limit-reset",zt="charge-card-renamed",Go="charge-card-department-updated",Lr="charge-card-repayment-completed",Or="charge-card-payment-date-updated",Ra="charge-card-cashback-redeemed",La="charge-card-cashback-earned",ha=(e,n)=>e==null||e===""?[]:n.map(t=>`private-encrypted-${e}.${t}`),$o=[La,Ra],zo=Pe(function(e){const n=ma(e);return{insightsData:n.insight,cashbackByPeriod:n.cashbackByPeriod,uiState:n.uiState,cashbackSummary:n.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(n,t)=>{e(_s({uiState:{sortKey:n,sortOrder:t}}))}}})(ao);function Zo(){const e=le(),n=me(),t=he(),a=te.getSignedInUser(),s=i(M=>ge(M)),{useFeatureGate:b}=ue(),{isFeatureEnabled:g}=b(Y.isCardsCommentingEnabled),[S,P]=r.useState(!1),u=i(M=>ma(M)),C=Dr(s.companyId,{clearParams:u.fetchState==="Completed"}),T=r.useCallback(()=>{const M=we(t.state?.pathnameStackToGoBack),B=M.poppedPathname??Yo(s.tenantEmailDomain);e(B,{state:{pathnameStackToGoBack:M.newStack}})},[e,t,s.tenantEmailDomain]),v=ea(s);if(Vt({events:ha(v,$o),onEvent:M=>{switch(M){case La:case Ra:return void n(_a(!0))}},onSubscribed:()=>{n(_a(!0))}}),r.useEffect(()=>{S||u.fetchState==="Completed"||u.fetchState==="In-Progress"||(P(!0),n(_a()))},[S,u,n]),a==null)throw Error("Can't access cashback detail page without signing in...");const m=u.cashbackSummary?.cashbackEarned?.amount!=null&&u.fetchState!=="Not-Started";return u.fetchState!=="In-Progress"||m?(u.cashbackSummary?.cashbackEarned?.amount??0)===0&&u.fetchState==="Completed"?c.jsx(ct,{}):c.jsx(zo,{onBackClick:T,isCardsCommentingEnabled:g,initialOpenThreadRequest:C}):c.jsx(eo,{onBackClick:T})}const Yo=e=>`/${e}/cards`,Ko={containerWidth:new Ta(100,58)},Wo=({appContent:e})=>{const n=Fa(),t=me(),a=le(),{cardId:s}=Ve(),b=he(),{useDynamicConfig:g}=ue(),[S,P]=r.useState(!1),[u,C]=r.useState(!1),[T,v]=r.useState(!1),[m,M]=r.useState(!1),B=te.getSignedInUser();if(B==null)throw Error("Can't access onboarding card page without signing in...");const R=i(I=>ge(I));if(s==null)throw Error("Empty card id is not valid...");const{configValue:p}=g(Ye.zeniCardsConfig),h=p.max_charge_card_activation_attempts_by_card_id,F=i(I=>Ps(I,s)),l=F.chargeCard,w=i(I=>I.chargeCardConfigState.fetchState),{useFeatureGate:E}=ue(),{isFeatureEnabled:U}=E(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:y}=E(Y.isDebitCardFeatureEnabled),k=Re(y,R),x=Oe({isDebitCardFeatureEnabled:y,isBankingOnlyTenant:k}),d=!!R.companyChargeCardInfo?.info?.isChargeCardEnabled,f=R.userRole.includes("charge_card_user"),j=xe(R),H=Be(R),O=R.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,L=Ue({isCardsOnlyTenant:j,isChargeCardFeatureEnabled:U,isBookKeepingTenant:H,isDebitCardProductVisible:x,chargeCardsCreditAccountLimit:O}),z=!f&&L&&d;r.useEffect(()=>{S===!1&&w!=="In-Progress"&&w!=="Completed"&&(t(Qa()),P(!0)),u===!1&&F.fetchState==="Not-Started"&&(C(!0),t(ka(s,z,L)))},[u,F.fetchState,S,w]);const $=l?.type.code==="business_physical_credit_card"||l?.type.code==="business_physical_debit_card";r.useEffect(()=>{if(F.fetchState==="Completed"){if(T===!1&&($===!1||$&&l?.status?.code!=="inactive"||l?.cardHolderUserId!==B.userId)){const I=_e(R.tenantEmailDomain,s,B,l,!0),N=ye(b.state?.pathnameStackToGoBack,b.pathname);a(I,{state:{pathnameStackToGoBack:N}})}else if(T&&F.isRefreshingViewInBackground===!1&&l?.status?.code==="active"){t(ws({chargeCardId:s}));const I=_e(R.tenantEmailDomain,s,B,l,!0),N=ye(b.state?.pathnameStackToGoBack,b.pathname);t(Ja()),a(I,{state:{pathnameStackToGoBack:N}})}}},[F.fetchState,l?.type.code,T,F.isRefreshingViewInBackground]);const _=te.getZeniOtpTokenForCardHolder(s),D=i(I=>Nn(I.userState,B.userId)),G=()=>{l?.status?.code!=="active"&&t(Sa(s,!0))};r.useEffect(()=>{F.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&l?.cardActivationAttemptHistory.some(I=>I.statusCode==="success")===!0&&T===!1&&(setTimeout(G,3e3),v(!0))},[F.updatePhysicalChargeCardAttemptFetchState.fetchState,l?.cardActivationAttemptHistory]);const Q=I=>{M(I)};if(w!=="Completed"||l==null)return c.jsx(va,{fetchState:"In-Progress"});if(l.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(D?.phone==null)throw Error("Can't access user phone number.");return c.jsxs(Jo,{children:[c.jsx(Ie,{isAppContentDrawerOpen:m,handleDrawerToggle:Q}),c.jsx(qo,{cardId:s,card:l,shippingAddressId:l.shippingAddressId,phone:D.phone,signedInUser:B,isSandboxEnv:Lt(),chargeCardDetailState:F,signedInUserToken:_,navigate:a,currentTenant:R,location:b,maxChargeCardActivationAttempts:h[s]!=null?h[s]:p.default_max_charge_card_activation_attempts!=null?p.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:p.charge_card_cashback_rate_per_transaction!=null?p.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{Q(!0)}}),e!=null?c.jsx(Qo,{windowSize:n,children:e}):null]})},qo=Pe(function(e,{chargeCardDetailState:n,shippingAddressId:t,location:a,cardId:s}){const b=vs(e.addressState,t);if(b==null)throw Error("Can't access shippingAddress.");const g=Vn(e,s),S=n.updateStatus,P=Ca(e,!1,!1,!1);let u=!1;P.fetchState==="Completed"&&P.cards.length<=1&&(u=!0);const C=a.state?.message==="comingFromV2UrlPath";return{showActivatePage:n.chargeCard?.providerCardCreateTime!=null&&n.chargeCard.providerCardCreateTime.add(24,"h").isBefore(Fs())||C,showMenuIcon:u,shippingAddress:b,vgsVaultId:rt.cardVaultId,twoFAView:g,activationWaitStatus:S,isRefreshingViewInBackground:n.isRefreshingViewInBackground}},function(e,n){const{navigate:t,cardId:a,location:s,currentTenant:b,chargeCardDetailState:g}=n,S=g.chargeCard?.cardProviderID,{tenantEmailDomain:P}=b;return{onGetOtp:u=>{S!=null&&e(at(u,"ChargeCardHolder",a))},onUpdatePhysicalChargeCardAttempt:u=>{e(xs(a,u))},onResendOtp:u=>{S!=null&&e(et(u,"ChargeCardHolder",a))},onVerifyOtp:(u,C)=>{S!=null&&e(Xa(u,C,"ChargeCardHolder",a))},onVerifyOtpSuccess:u=>{u!=null&&te.saveZeniOtpTokenForCardHolder(u,a)},onCVVActivateSuccess:()=>{e(Ts({chargeCardId:a}))},onBackClick:()=>{const u=we(s.state?.pathnameStackToGoBack),C=u.poppedPathname==null||u.poppedPathname.includes("onboard")===!0?aa(P):u.poppedPathname;t(C,{state:{pathnameStackToGoBack:u.newStack}})}}})(to),Qo=He.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
width: ${e=>`${Ko.containerWidth.value(e.windowSize)}%`};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as m}from"./liveblocks-
|
|
1
|
+
import{j as m}from"./liveblocks-BfjqeyQ7.js";import{a as g}from"./sentry-NLHTFHKl.js";import{h as w,u as k,g as x,i as T,j as O,n as E}from"./core-D5--W5Ul.js";import{z as C,bd as P,J as F,f as V,h as j,af as D,be as A,at as L,au as U,v as B}from"./index-BbrjBaX2.js";import{eX as b,gk as M,tD as R,gf as _,c6 as z,Pk as G,bn as H,rD as Y,rr as J,l6 as X,mH as S,Pl as Z,bE as $,cy as N,mR as q,mU as K}from"./zeni-epic-state-CP708m5a.js";import"./mui-BkqswRey.js";import{d as Q}from"./routePaths-YPF0RRmf.js";import{M as W}from"./MobileAppDrawer-DTNaBxxF.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="9484c77a-4668-4943-ba3d-11691c95ce2e",t._sentryDebugIdIdentifier="sentry-dbid-9484c77a-4668-4943-ba3d-11691c95ce2e")}catch{}})();const ee=E(function(t){const a=_(t),i=C.getSignedInUser(),l=b(t),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=z(l?.userRole??[])&&a.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=G(t.companyConfigState),n=t.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:a.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:a,allIndustries:e.companyIndustries??[],allNationalityCountries:n,isDisabled:f,authParams:p,filesEndPoint:`${L.fileMicroServiceBaseUrl}`,isZeniUser:H(i)}},function(t,a){const{companyId:i,currentTenant:l,navigate:c,location:p}=a,{tenantEmailDomain:f}=l;return{onScheduleClick:e=>{let n=e.href;n.includes("http")||(n="https://".concat(n)),window.open(n,"_blank")},onSaveAll:()=>{t(K())},onAddressClick:e=>{const n=Q(f,e),o=B(p.state?.pathnameStackToGoBack,p.pathname);c(n,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{t(q({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:n,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=n,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:h}=r,v={companyInfo:{...n,website:u!=""&&u!=null?N(u):void 0,meetingLink:y!=""&&y!=null?N(y):void 0,industry:n.industry.selectedOption,companyIndustryType:n.companyIndustryType?.selectedOption??void 0,companySubIndustry:n.companySubIndustry?.selectedOption??void 0,businessModel:n.businessModel.selectedOption??"",companySourceOfFunds:n.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:n.companySourceOfFundsDescription??void 0,countriesOfOperations:n.countriesOfOperations?.selectedOptions?.map(I=>I.length===2?I:U(I))??[],transactionVolume:n.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:n.transactionVolumeDescription??void 0,regulatedStatus:n.regulatedStatus??void 0,regulatedStatusDescription:n.regulatedStatusDescription??void 0,usNexus:n.usNexus??void 0,usNexusTypes:n.usNexusTypes?.selectedOptions??[],purposeOfAccount:n.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:n.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?$(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:h.selectedOptions.map(I=>parseInt(I)),fileId:r.fileIds[0]}};t(S({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{t(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{t(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:void 0}]}))},onNewCompanyOfficerRemoved:e=>{t(Z(e))},onCompanyOfficerUpdated:e=>{t(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:e.userId}]}))},updateFilesEntity:e=>{t(X({files:e}))},onDeleteFile:e=>{t(J(e))},onEditFileName:(e,n)=>{t(Y(e,n.split(".")[0]))}}})(A);function de(){const t=w(),a=k(),i=x(),{tenantEmailDomain:l}=T(),[c,p]=g.useState(!1),[f,e]=g.useState(!1),n=O(s=>s.companyViewState.passportView.fetchState),o=O(s=>s.companyConfigState.fetchState),r=O(s=>b(s)),d=r.companyId??C.getSignedInUserTenant(l)?.companyId;if(C.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||n!=="Not-Started"||d==null||(p(!0),a(M(d)))},[c,n,d,a]),g.useEffect(()=>{o==="Not-Started"&&a(R())},[o,a]);const u=s=>{e(s)},y=n==="Not-Started"||n==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&n==="Error"?m.jsx(P,{onGoHome:()=>t("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(F,{analytics:V,onLoad:s=>s.trackPageLoaded(j.Event.companyPassport,D(i)?"Settings":"Company Passport")}),D(i)?m.jsx(W,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:t,location:i,isLoading:y,currentTenant:r,isSettings:D(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as g}from"./liveblocks-
|
|
1
|
+
import{j as g}from"./liveblocks-BfjqeyQ7.js";import{a}from"./sentry-NLHTFHKl.js";import{u as D,g as v,j as m,N as w}from"./core-D5--W5Ul.js";import{LU as A,eX as L,g2 as O,oa as U,gt as h,g1 as _,fA as j,L$ as $}from"./zeni-epic-state-CP708m5a.js";import{u as F,z as p,L as C,a as k,o as H}from"./index-BbrjBaX2.js";import{n as z}from"./mui-BkqswRey.js";import{t as R}from"./getLocaleForTenant-B0LCd9Bs.js";import{g as P,Q as G}from"./QBOConnectionScreen-C7D9h41-.js";import"./recharts--lP9DGTY.js";import"./analytics-o8UTT6MT.js";import"./plaid-Dly6vYcb.js";import"./dnd-1wW2WkhB.js";import"./stripe-DMRn4zHo.js";import"./lottie-CY-jVQNU.js";import"./lexical-MdJnvG5R.js";import"./pdf-C9g_mgTQ.js";import"./utils-DKA4xBgw.js";import"./empty-Bk31eo62.js";import"./pdf-lib-aYi4dqlc.js";import"./index-ISnn6fcT.js";import"./url-lDawWlh-.js";import"./index-DPzXwri2.js";import"./decodeURIComponentSafe-6nN4Z37l.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="dad4a187-9239-434c-933d-12986b03509f",t._sentryDebugIdIdentifier="sentry-dbid-dad4a187-9239-434c-933d-12986b03509f")}catch{}})();const Q=z.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex: 1 1 auto;
|
|
4
4
|
flex-direction: row;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as i}from"./liveblocks-BfjqeyQ7.js";import{z as n}from"./index-BbrjBaX2.js";import{g as d}from"./QBOConnectionScreen-C7D9h41-.js";import"./sentry-NLHTFHKl.js";import{g as p,N as s}from"./core-D5--W5Ul.js";import"./zeni-epic-state-CP708m5a.js";import"./recharts--lP9DGTY.js";import"./mui-BkqswRey.js";import"./analytics-o8UTT6MT.js";import"./plaid-Dly6vYcb.js";import"./dnd-1wW2WkhB.js";import"./stripe-DMRn4zHo.js";import"./lottie-CY-jVQNU.js";import"./lexical-MdJnvG5R.js";import"./pdf-C9g_mgTQ.js";import"./utils-DKA4xBgw.js";import"./empty-Bk31eo62.js";import"./pdf-lib-aYi4dqlc.js";import"./index-ISnn6fcT.js";import"./url-lDawWlh-.js";import"./index-DPzXwri2.js";import"./decodeURIComponentSafe-6nN4Z37l.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]="817363c8-7f1d-4590-b58b-cef70b99ca15",t._sentryDebugIdIdentifier="sentry-dbid-817363c8-7f1d-4590-b58b-cef70b99ca15")}catch{}})();const U=()=>{const t=p(),{code:o,realmId:r,state:e}=d(t.search),m=n.getSignedInUser()?.userId??"";if(f(o,r,e,m)===!0){const a=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return i.jsx(s,{to:a})}return i.jsx(s,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
|
package/dist/assets/{CustomerOnboardingRoutes-BbhWhhzo.js → CustomerOnboardingRoutes-DTma2BUp.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-
|
|
1
|
+
import{j as a}from"./liveblocks-BfjqeyQ7.js";import{t as yt,A as Ve}from"./AddressScreen-CTBC0Okq.js";import ht from"./NotFoundScreen-Dx10N2h0.js";import{a as c}from"./sentry-NLHTFHKl.js";import{h as be,g as ke,u as ne,i as Ie,j as _,N as U,l as St,n as et,o as Ct,p as q}from"./core-D5--W5Ul.js";import{z as R,Q as _e,e as H,d as bt,v as Q,J as ae,f as N,h as de,ap as kt,Z as It,A as tt,I as nt,aq as Le,n as Se,ar as _t,o as Re,as as Ne,at as vt,au as Me,av as Ot,aw as Tt}from"./index-BbrjBaX2.js";import{eX as J,fE as ve,fC as Oe,bs as Et,fS as wt,bS as xt,o8 as At,tn as Pt,tq as Dt,MT as jt,MU as Ft,ka as Ce,kd as at,Mo as Bt,bY as Ut,c6 as le,tR as Te,tC as Vt,MV as ue,tS as ot,Kh as Lt,le as st,MW as Rt,MX as Nt,rk as Mt,hr as $t,Mg as ge,ho as Gt,Mh as zt,x$ as Qt,ro as Kt,hg as qt,hj as $e,MY as it,MZ as Ht,E2 as Zt,M_ as Yt,E6 as Jt,tt as Wt,M$ as Xt,N0 as en,k8 as tn,kb as nn,u2 as an,tE as rt,tQ as on,bE as Ge,cy as sn,u1 as ze,rD as rn,rr as cn,l6 as dn,gi as un,gh as ln,gg as pn,N1 as mn,tw as gn,u3 as fn,u6 as yn,u9 as hn,uf as Sn,cY as Cn}from"./zeni-epic-state-CP708m5a.js";import{n as Ee}from"./mui-BkqswRey.js";import{g as bn,h as kn,q as oe}from"./QBOConnectionScreen-C7D9h41-.js";import{u as In,a as _n}from"./useEmailConnectResultRefresh-B-l5KqUX.js";import{u as vn}from"./useChargeCardPusherEvents-DsNcb67V.js";import"./recharts--lP9DGTY.js";import"./analytics-o8UTT6MT.js";import"./plaid-Dly6vYcb.js";import"./dnd-1wW2WkhB.js";import"./stripe-DMRn4zHo.js";import"./lottie-CY-jVQNU.js";import"./lexical-MdJnvG5R.js";import"./pdf-C9g_mgTQ.js";import"./utils-DKA4xBgw.js";import"./empty-Bk31eo62.js";import"./pdf-lib-aYi4dqlc.js";import"./index-ISnn6fcT.js";import"./url-lDawWlh-.js";import"./index-DPzXwri2.js";import"./decodeURIComponentSafe-6nN4Z37l.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},u=new t.Error().stack;u&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[u]="9087193a-be54-4f53-96de-a78641a12224",t._sentryDebugIdIdentifier="sentry-dbid-9087193a-be54-4f53-96de-a78641a12224")}catch{}})();const On=()=>{const t=be(),u=ke(),s=ne(),[o,l]=c.useState(!1),[r,f]=c.useState(!1),{tenantEmailDomain:C}=Ie(),e=R.getSignedInUser(),{useFeatureGate:n}=_e(),{isFeatureEnabled:d}=n(H.isApAgingFeatureEnabled),{isFeatureEnabled:b}=n(H.isArAgingFeatureEnabled),{isFeatureEnabled:S}=n(H.isReferralFeatureEnabled),{isFeatureEnabled:v}=n(H.isExpenseAutomationEnabledV2),{isFeatureEnabled:i}=n(H.isDebitCardFeatureEnabled),I=bt(),y=_(h=>J(h)),m=_(h=>h.onboardingCustomerViewState.fetchState),E=y.excludedResources,w=y.companyId??R.getSignedInUserTenant(C)?.companyId;if(e==null)throw Error("Can't access onboarding flow without signing in...");const O=ve(i,y),P=Oe(y),p=[],M=E?.resources?.find(h=>h.resource==="/reports/top_expenses")==null,j=E?.resources?.find(h=>h.resource==="/reports/task_card")==null,$=y?.userRole!=null&&Et(y?.userRole),G=E?.resources?.find(h=>h.resource==="/bills")==null&&!$,x=E?.resources?.find(h=>h.resource==="/reimbursements")==null;M===!1&&p.push("top_expenses"),j===!1&&p.push("task_card"),G===!1&&p.push("bill_pay_card","bill_pay_promo_card"),x===!1&&p.push("reimbursement_card","reimbursement_promo_card"),p.push("zeni_accounts_promo_card","treasury_promo_card"),S===!1&&p.push("rewards_card");const F=_(h=>{const D=[];d===!1&&D.push("accounts_payable_aging"),b===!1&&D.push("accounts_receivable_aging"),D.push("zeni_accounts_promo_card","treasury_promo_card"),S===!1&&D.push("rewards_card"),I===!1&&D.push("expense_automation_card");const Z=wt(h,D,e,v,I);return xt(Z.reportsInOrder.map(A=>({fetchState:A.fetchState,error:A.error}))).fetchState});c.useEffect(()=>{m!=="Completed"||o||O||P||(l(!0),s(At(e.userId,w,y.tenantId,!0,!1,p)))},[o,m,O,P,e,y.tenantId,s]);const K=c.useRef(!1),z=c.useCallback(()=>{const h={pathnameStackToGoBack:Q(u.state?.pathnameStackToGoBack,u.pathname),message:"activation"};t(O?"../../checking":P?"../../cards":"../../dashboard",{state:h})},[t,u,O,P]),V=c.useCallback(()=>{K.current||(K.current=!0,z())},[z]);return c.useEffect(()=>{const h=setTimeout(()=>f(!0),3e3);return()=>clearTimeout(h)},[]),c.useEffect(()=>{const h=setTimeout(V,6e3);return()=>clearTimeout(h)},[V]),c.useEffect(()=>{O||P||!r||F!=="Completed"&&F!=="Error"||V()},[r,F,O,P,V]),m!=="Completed"?a.jsx(U,{to:"../"}):a.jsxs(a.Fragment,{children:[a.jsx(ae,{analytics:N,onLoad:h=>h.trackPageLoaded(de.Event.onboardingDashboardActivation)}),a.jsx(kt,{show:!0,onComplete:V})]})},fe=["reading_books","finance_graph","reconciliation","cfo_foundation"],ye=["llm_fine_tuning","rag_knowledge_graph","personalized_context"],Qe=(t,u)=>{const s=new Map(t.map(o=>[o.key,o]));return u.map(o=>{return l=s.get(o)?.status,l==="starting"||l==="building"?l:"idle";var l})},Ke=(t,u)=>{if(t.length===0)return!1;const s=new Map(t.map(o=>[o.key,o]));return u.every(o=>s.get(o)?.status==="ready")},qe=Ee.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
background-color: ${t=>t.theme.colors.grey4};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as d}from"./liveblocks-CIemOhG-.js";import{i as K,j as _,g as H,u as $,h as W,n as ee,k as ra,o as bt,p as O}from"./core-BXHWSH6o.js";import{eX as U,Nk as We,bE as ia,bo as De,Oy as Pn,j0 as On,Oz as Kt,OA as Fn,j3 as Ct,OB as Ze,OC as Rn,j8 as Bn,OD as qt,OE as jn,jc as kt,OF as Qe,OG as Mn,co as yt,OH as Ln,OI as Un,NE as Gn,k4 as Vn,OJ as Yn,bn as Xe,OK as ca,N8 as ce,bc as la,ki as da,oi as ua,k1 as ma,Na as le,N9 as J,eW as pa,fs as Nn,g4 as _t,OL as $n,OM as zn,ON as ha,OO as Oe,vR as Me,vS as Le,wd as xe,w7 as de,vW as Ue,OP as Kn,OQ as qn,OR as Zn,OS as fa,OT as Fe,OU as Qn,dK as Je,sb as ga,OV as Hn,OW as Wn,OX as Xn,OY as vt,Mq as At,ky as we,wl as It,sj as Jn,OZ as eo,vT as Zt,se as Ee,sa as ba,O_ as ge,O$ as to,P0 as Et,Mp as Tt,uj as Ca,P1 as ao,P2 as no,P3 as oo,P4 as Dt,uw as so,P5 as ro,vV as Qt,ui as ka,P6 as be,P7 as io,bs as _a,wp as Sa,P8 as co,P9 as lo,Pa as uo,Pb as xt,wk as mo,Pc as po,vU as Ht,wo as ya,Pd as Ce,Pe as ho,Pf as fo,Pg as va,kn as Aa,of as Ia,ks as Ea,od as Ta,oc as Da,ob as xa,tH as go,fW as bo,cS as Co,cT as ko,o8 as _o,fS as So,op as yo,GC as dt,Gu as vo,Gy as Ao,Ph as Io,Pi as Eo,Pj as To,b5 as et,fK as Do,hK as xo,gk as wo,oj as Po,jW as Oo,og as Fo,oe as Ro,fE as Bo,fC as jo}from"./zeni-epic-state-Xn27LBb6.js";import{z as M,a3 as te,v as x,f as T,a as q,aZ as Mo,$ as Ge,J as Ve,a_ as wa,h as Y,a$ as Lo,I as _e,b0 as Pa,Q as Se,e as B,m as Uo,b1 as Go,b2 as Vo,X as Oa,Z as Fa,c as Ra,_ as Yo,b3 as No,V as $o,aR as Ba,a0 as se,b4 as ja,b5 as Ma,a2 as La,b6 as zo,b7 as Ko,d as qo,aq as Zo,s as Qo,Y as Ho,b8 as Wo,b9 as Xo,ba as Jo,bb as es,bc as ke}from"./index-CMicf90d.js";import{n as wt}from"./mui-CDOihXSU.js";import{a as b}from"./sentry-238zX06J.js";import{w as Ua}from"./withTransactionSidePanel-Bmg5vkAc.js";import{c as Ga,t as Pe,f as ue,a as Pt,v as ts}from"./routePaths-CIGM6tzV.js";import{u as ae}from"./useAskAiCfoHostNavButtonProps-QHf32w33.js";import je from"./NotFoundScreen-BPydeesy.js";import{u as Ot}from"./useInitialThreadRequest-B2VhczBO.js";import{t as Va}from"./analyticsHelper-BA_yiiPD.js";import{C as as}from"./CompanyPassportScreen-3yTQ9U1p.js";import{u as ns}from"./useAiCfoDashboardSuggestedQuestionsChips-CDMT-TGN.js";import{F as os}from"./FeaturePreviewScreen-CW2ZZwGb.js";import{R as ss}from"./ReferralListScreen-8JSWVt-7.js";import"./recharts-D7dc1KPB.js";import"./analytics-D9LLahJK.js";import"./plaid-DnBvUvOI.js";import"./dnd-D1FusWvE.js";import"./stripe-DMRn4zHo.js";import"./lottie-B2gqVn8r.js";import"./lexical-M5lTJAid.js";import"./pdf-NpxYPuZF.js";import"./utils-BaZQaz5F.js";import"./TransactionDetailScreen-BFCNfSuj.js";import"./decodeURIComponentSafe-DEgBTC44.js";import"./MobileAppDrawer-DXoZqPdU.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="83c694dc-7023-4362-ae54-749e7b745a47",e._sentryDebugIdIdentifier="sentry-dbid-83c694dc-7023-4362-ae54-749e7b745a47")}catch{}})();const rs=Ua(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=M.getSignedInUser(),i=_(I=>I.tenantState.currentTenantId),c=_(I=>U(I)),{tenantEmailDomain:m}=K(),g=H(),C=c?.companyName??"",u={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},l=b.useMemo(()=>({authParams:u,companyName:C,downloadEndPoint:`${te}/agingDetailedReport`,timezone:We()}),[]),h=b.useMemo(()=>r!=null?ia(r):De(),[r]),p=$(),f=W(),S=_(I=>Pn(I,h,o)),E=b.useCallback(()=>{o!=null&&S.fetchState!=="In-Progress"&&S.fetchState!=="Completed"&&p(On(o,h))},[h]),v=b.useCallback(()=>{f("../../",{relative:"path"})},[]),k=b.useCallback((I,L)=>{p(Kt({sortKey:I,sortOrder:L}))},[]),D=b.useCallback(I=>{p(Kt({downloadState:I}))},[]),w=b.useCallback(I=>{if(e)e(I.transactionId,I.transactionType);else if(m!=null){const L=Ga({id:I.transactionId,type:I.transactionType},m);f(L);const ne=x(g.state?.pathnameStackToGoBack,g.pathname);f(L,{state:{pathnameStackToGoBack:ne}})}},[m,e]),y=b.useCallback(()=>{S.vendor!=null&&T.trackApAgingDetail("AP Aging",h.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),S.vendor.id,S.vendor.name)},[S.vendor,h]);return b.useEffect(()=>{E()},[]),b.useEffect(()=>{S.fetchState==="Completed"&&y()},[y,S.fetchState]),d.jsx(Mo,{apAgingDetail:S,downloadParams:l,reportDate:h,analytics:T,onTransactionClick:w,onReload:E,onBackClick:v,onColumnSortConfigChanged:k,updateDownloadStateHandler:D,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),is=()=>{const e=$(),a=W(),t=_(k=>Fn(k)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ae({mobileExploreReferrer:"AP Aging"});Ge({isDataReady:t.fetchState==="Completed"});const r=M.getSignedInUser(),s=_(k=>k.tenantState.currentTenantId),i=_(k=>U(k)),c=i?.companyName??"",m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},g=b.useMemo(()=>({authParams:m,companyName:c,downloadEndPoint:`${te}/agingReport`,timezone:We()}),[]),C=t.apAgingUIState.selectedDate??De(),u=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(Ct(C))},[]);b.useEffect(()=>{u()},[]);const l=b.useCallback(()=>{a("../",{relative:"path"})},[]),h=b.useCallback(k=>{e(Ze({searchString:k}))},[]),p=b.useCallback((k,D)=>{e(Ze({sortKey:D,sortOrder:k}))},[]),f=b.useCallback(k=>{a(`./${k}/${C.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[C]),S=b.useCallback(k=>{e(Ze({downloadState:k}))},[]),E=b.useCallback((k,D)=>{},[]),v=b.useCallback((k,D)=>{e(Ze({selectedDate:k,agingDateSelectionType:D})),e(Ct(k))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ve,{analytics:T,onLoad:k=>k.trackPageLoaded(Y.Event.agingReport,"AP Aging")}):null,d.jsx(wa,{uiState:t.apAgingUIState,report:t,downloadParams:g,analytics:T,onReloadReport:u,onBackClick:l,onSearchTextChange:h,onSortOrderChange:p,onEntityNameClick:f,updateDownloadStateHandler:S,onSelectedDateChanged:v,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},cs=Ua(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=M.getSignedInUser(),i=_(y=>U(y)),{tenantEmailDomain:c}=K(),m=H(),g=i.companyName,C={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},u=b.useMemo(()=>({authParams:C,companyName:g,downloadEndPoint:`${te}/agingDetailedReport`,timezone:We()}),[]),l=b.useMemo(()=>r!=null?ia(r):De(),[r]),h=$(),p=W(),f=_(y=>Rn(y,l,o)),S=b.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&h(Bn(o,l))},[l]),E=b.useCallback(()=>{p("../../",{relative:"path"})},[]),v=b.useCallback((y,I)=>{h(qt({sortKey:y,sortOrder:I}))},[]),k=b.useCallback(y=>{h(qt({downloadState:y}))},[]),D=b.useCallback(y=>{if(e)e(y.transactionId,y.transactionType);else if(c!=null){const I=Ga({id:y.transactionId,type:y.transactionType},c);p(I);const L=x(m.state?.pathnameStackToGoBack,m.pathname);p(I,{state:{pathnameStackToGoBack:L}})}},[c,e]),w=b.useCallback(()=>{f.customer!=null&&T.trackArAgingDetail("AR Aging",l.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)},[f.customer,l]);return b.useEffect(()=>{S()},[]),b.useEffect(()=>{f.fetchState==="Completed"&&w()},[f.fetchState,w]),d.jsx(Lo,{arAgingDetail:f,downloadParams:u,reportDate:l,analytics:T,onTransactionClick:D,onReload:S,onBackClick:E,onColumnSortConfigChanged:v,updateDownloadStateHandler:k,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),ls=()=>{const e=$(),a=W(),t=_(v=>jn(v)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ae({mobileExploreReferrer:"AR Aging"});Ge({isDataReady:t.fetchState==="Completed"});const r=M.getSignedInUser(),s=_(v=>U(v)),i=s.companyName,c={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},m=b.useMemo(()=>({authParams:c,companyName:i,downloadEndPoint:`${te}/agingReport`,timezone:We()}),[]),g=t.arAgingUIState.selectedDate??De(),C=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(kt(g))},[]);b.useEffect(()=>{C()},[]);const u=b.useCallback(()=>{a("../",{relative:"path"})},[]),l=b.useCallback(v=>{e(Qe({searchString:v}))},[]),h=b.useCallback((v,k)=>{e(Qe({sortKey:k,sortOrder:v}))},[]),p=b.useCallback(v=>{a(`./${v}/${g.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[g]),f=b.useCallback(v=>{e(Qe({downloadState:v}))},[]),S=b.useCallback((v,k)=>{e(Qe({selectedDate:v,agingDateSelectionType:k})),e(kt(v))},[]),E=b.useCallback((v,k)=>{e(Mn({nodeId:v,isCollapsed:k}))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ve,{analytics:T,onLoad:v=>v.trackPageLoaded(Y.Event.agingReport,"AR Aging")}):null,d.jsx(wa,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:T,onReloadReport:C,onBackClick:u,onSearchTextChange:l,onSortOrderChange:h,onEntityNameClick:p,updateDownloadStateHandler:f,onSelectedDateChanged:S,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Ya=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function Na(e,a){const t=Gn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=Pe(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=x(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Vn(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?T.trackZeniAccountsCashBalancePromoClicked("Move Money"):(T.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=x(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else T.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const ds=ee(function(e){const a=Ln(e).accountsInOrder.map((n,o)=>Ya(n,o)),t=Un(e);return{sectionTitle:q.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:T}},Na)(Pa),us=ee(function(e){const a=Yn(e).accountsInOrder.map((o,r)=>Ya(o,r)),t=M.getSignedInUser(),n=Xe(t);return{sectionTitle:q.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:T}},Na)(Pa);function ms(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=_e(),o=_(s=>U(s).company?.companyInfo.firstMonthOfFY??1),r=yt(n?.loggedInUserRoleMap);return _(s=>s.cashBalanceState.fetchState)==="Error"?d.jsx(je,{}):d.jsx(ds,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function ps(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=_e(),o=yt(n?.loggedInUserRoleMap),r=_(s=>U(s).company?.companyInfo.firstMonthOfFY??1);return _(s=>s.cardBalanceState.fetchState)==="Error"?d.jsx(je,{}):d.jsx(us,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const hs=wt.div`
|
|
1
|
+
import{j as d}from"./liveblocks-BfjqeyQ7.js";import{i as K,j as _,g as H,u as $,h as W,n as ee,k as ra,o as bt,p as O}from"./core-D5--W5Ul.js";import{eX as U,Nk as We,bE as ia,bo as De,Oy as Pn,j0 as On,Oz as Kt,OA as Fn,j3 as Ct,OB as Ze,OC as Rn,j8 as Bn,OD as qt,OE as jn,jc as kt,OF as Qe,OG as Mn,co as yt,OH as Ln,OI as Un,NE as Gn,k4 as Vn,OJ as Yn,bn as Xe,OK as ca,N8 as ce,bc as la,ki as da,oi as ua,k1 as ma,Na as le,N9 as J,eW as pa,fs as Nn,g4 as _t,OL as $n,OM as zn,ON as ha,OO as Oe,vR as Me,vS as Le,wd as xe,w7 as de,vW as Ue,OP as Kn,OQ as qn,OR as Zn,OS as fa,OT as Fe,OU as Qn,dK as Je,sb as ga,OV as Hn,OW as Wn,OX as Xn,OY as vt,Mq as At,ky as we,wl as It,sj as Jn,OZ as eo,vT as Zt,se as Ee,sa as ba,O_ as ge,O$ as to,P0 as Et,Mp as Tt,uj as Ca,P1 as ao,P2 as no,P3 as oo,P4 as Dt,uw as so,P5 as ro,vV as Qt,ui as ka,P6 as be,P7 as io,bs as _a,wp as Sa,P8 as co,P9 as lo,Pa as uo,Pb as xt,wk as mo,Pc as po,vU as Ht,wo as ya,Pd as Ce,Pe as ho,Pf as fo,Pg as va,kn as Aa,of as Ia,ks as Ea,od as Ta,oc as Da,ob as xa,tH as go,fW as bo,cS as Co,cT as ko,o8 as _o,fS as So,op as yo,GC as dt,Gu as vo,Gy as Ao,Ph as Io,Pi as Eo,Pj as To,b5 as et,fK as Do,hK as xo,gk as wo,oj as Po,jW as Oo,og as Fo,oe as Ro,fE as Bo,fC as jo}from"./zeni-epic-state-CP708m5a.js";import{z as M,a3 as te,v as x,f as T,a as q,aZ as Mo,$ as Ge,J as Ve,a_ as wa,h as Y,a$ as Lo,I as _e,b0 as Pa,Q as Se,e as B,m as Uo,b1 as Go,b2 as Vo,X as Oa,Z as Fa,c as Ra,_ as Yo,b3 as No,V as $o,aR as Ba,a0 as se,b4 as ja,b5 as Ma,a2 as La,b6 as zo,b7 as Ko,d as qo,aq as Zo,s as Qo,Y as Ho,b8 as Wo,b9 as Xo,ba as Jo,bb as es,bc as ke}from"./index-BbrjBaX2.js";import{n as wt}from"./mui-BkqswRey.js";import{a as b}from"./sentry-NLHTFHKl.js";import{w as Ua}from"./withTransactionSidePanel-Boj3VpnD.js";import{c as Ga,t as Pe,f as ue,a as Pt,v as ts}from"./routePaths-YPF0RRmf.js";import{u as ae}from"./useAskAiCfoHostNavButtonProps-DWeS72rU.js";import je from"./NotFoundScreen-Dx10N2h0.js";import{u as Ot}from"./useInitialThreadRequest-Crst1isw.js";import{t as Va}from"./analyticsHelper-38O5wjc-.js";import{C as as}from"./CompanyPassportScreen-CjdWLPz5.js";import{u as ns}from"./useAiCfoDashboardSuggestedQuestionsChips-CkuoZ_6p.js";import{F as os}from"./FeaturePreviewScreen-DX1SEz5-.js";import{R as ss}from"./ReferralListScreen-DP-BxHNx.js";import"./recharts--lP9DGTY.js";import"./analytics-o8UTT6MT.js";import"./plaid-Dly6vYcb.js";import"./dnd-1wW2WkhB.js";import"./stripe-DMRn4zHo.js";import"./lottie-CY-jVQNU.js";import"./lexical-MdJnvG5R.js";import"./pdf-C9g_mgTQ.js";import"./utils-DKA4xBgw.js";import"./TransactionDetailScreen-Bqvo1ABZ.js";import"./decodeURIComponentSafe-6nN4Z37l.js";import"./MobileAppDrawer-DTNaBxxF.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="83c694dc-7023-4362-ae54-749e7b745a47",e._sentryDebugIdIdentifier="sentry-dbid-83c694dc-7023-4362-ae54-749e7b745a47")}catch{}})();const rs=Ua(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=M.getSignedInUser(),i=_(I=>I.tenantState.currentTenantId),c=_(I=>U(I)),{tenantEmailDomain:m}=K(),g=H(),C=c?.companyName??"",u={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},l=b.useMemo(()=>({authParams:u,companyName:C,downloadEndPoint:`${te}/agingDetailedReport`,timezone:We()}),[]),h=b.useMemo(()=>r!=null?ia(r):De(),[r]),p=$(),f=W(),S=_(I=>Pn(I,h,o)),E=b.useCallback(()=>{o!=null&&S.fetchState!=="In-Progress"&&S.fetchState!=="Completed"&&p(On(o,h))},[h]),v=b.useCallback(()=>{f("../../",{relative:"path"})},[]),k=b.useCallback((I,L)=>{p(Kt({sortKey:I,sortOrder:L}))},[]),D=b.useCallback(I=>{p(Kt({downloadState:I}))},[]),w=b.useCallback(I=>{if(e)e(I.transactionId,I.transactionType);else if(m!=null){const L=Ga({id:I.transactionId,type:I.transactionType},m);f(L);const ne=x(g.state?.pathnameStackToGoBack,g.pathname);f(L,{state:{pathnameStackToGoBack:ne}})}},[m,e]),y=b.useCallback(()=>{S.vendor!=null&&T.trackApAgingDetail("AP Aging",h.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),S.vendor.id,S.vendor.name)},[S.vendor,h]);return b.useEffect(()=>{E()},[]),b.useEffect(()=>{S.fetchState==="Completed"&&y()},[y,S.fetchState]),d.jsx(Mo,{apAgingDetail:S,downloadParams:l,reportDate:h,analytics:T,onTransactionClick:w,onReload:E,onBackClick:v,onColumnSortConfigChanged:k,updateDownloadStateHandler:D,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),is=()=>{const e=$(),a=W(),t=_(k=>Fn(k)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ae({mobileExploreReferrer:"AP Aging"});Ge({isDataReady:t.fetchState==="Completed"});const r=M.getSignedInUser(),s=_(k=>k.tenantState.currentTenantId),i=_(k=>U(k)),c=i?.companyName??"",m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},g=b.useMemo(()=>({authParams:m,companyName:c,downloadEndPoint:`${te}/agingReport`,timezone:We()}),[]),C=t.apAgingUIState.selectedDate??De(),u=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(Ct(C))},[]);b.useEffect(()=>{u()},[]);const l=b.useCallback(()=>{a("../",{relative:"path"})},[]),h=b.useCallback(k=>{e(Ze({searchString:k}))},[]),p=b.useCallback((k,D)=>{e(Ze({sortKey:D,sortOrder:k}))},[]),f=b.useCallback(k=>{a(`./${k}/${C.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[C]),S=b.useCallback(k=>{e(Ze({downloadState:k}))},[]),E=b.useCallback((k,D)=>{},[]),v=b.useCallback((k,D)=>{e(Ze({selectedDate:k,agingDateSelectionType:D})),e(Ct(k))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ve,{analytics:T,onLoad:k=>k.trackPageLoaded(Y.Event.agingReport,"AP Aging")}):null,d.jsx(wa,{uiState:t.apAgingUIState,report:t,downloadParams:g,analytics:T,onReloadReport:u,onBackClick:l,onSearchTextChange:h,onSortOrderChange:p,onEntityNameClick:f,updateDownloadStateHandler:S,onSelectedDateChanged:v,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},cs=Ua(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=M.getSignedInUser(),i=_(y=>U(y)),{tenantEmailDomain:c}=K(),m=H(),g=i.companyName,C={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},u=b.useMemo(()=>({authParams:C,companyName:g,downloadEndPoint:`${te}/agingDetailedReport`,timezone:We()}),[]),l=b.useMemo(()=>r!=null?ia(r):De(),[r]),h=$(),p=W(),f=_(y=>Rn(y,l,o)),S=b.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&h(Bn(o,l))},[l]),E=b.useCallback(()=>{p("../../",{relative:"path"})},[]),v=b.useCallback((y,I)=>{h(qt({sortKey:y,sortOrder:I}))},[]),k=b.useCallback(y=>{h(qt({downloadState:y}))},[]),D=b.useCallback(y=>{if(e)e(y.transactionId,y.transactionType);else if(c!=null){const I=Ga({id:y.transactionId,type:y.transactionType},c);p(I);const L=x(m.state?.pathnameStackToGoBack,m.pathname);p(I,{state:{pathnameStackToGoBack:L}})}},[c,e]),w=b.useCallback(()=>{f.customer!=null&&T.trackArAgingDetail("AR Aging",l.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)},[f.customer,l]);return b.useEffect(()=>{S()},[]),b.useEffect(()=>{f.fetchState==="Completed"&&w()},[f.fetchState,w]),d.jsx(Lo,{arAgingDetail:f,downloadParams:u,reportDate:l,analytics:T,onTransactionClick:D,onReload:S,onBackClick:E,onColumnSortConfigChanged:v,updateDownloadStateHandler:k,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),ls=()=>{const e=$(),a=W(),t=_(v=>jn(v)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ae({mobileExploreReferrer:"AR Aging"});Ge({isDataReady:t.fetchState==="Completed"});const r=M.getSignedInUser(),s=_(v=>U(v)),i=s.companyName,c={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},m=b.useMemo(()=>({authParams:c,companyName:i,downloadEndPoint:`${te}/agingReport`,timezone:We()}),[]),g=t.arAgingUIState.selectedDate??De(),C=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(kt(g))},[]);b.useEffect(()=>{C()},[]);const u=b.useCallback(()=>{a("../",{relative:"path"})},[]),l=b.useCallback(v=>{e(Qe({searchString:v}))},[]),h=b.useCallback((v,k)=>{e(Qe({sortKey:k,sortOrder:v}))},[]),p=b.useCallback(v=>{a(`./${v}/${g.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[g]),f=b.useCallback(v=>{e(Qe({downloadState:v}))},[]),S=b.useCallback((v,k)=>{e(Qe({selectedDate:v,agingDateSelectionType:k})),e(kt(v))},[]),E=b.useCallback((v,k)=>{e(Mn({nodeId:v,isCollapsed:k}))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ve,{analytics:T,onLoad:v=>v.trackPageLoaded(Y.Event.agingReport,"AR Aging")}):null,d.jsx(wa,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:T,onReloadReport:C,onBackClick:u,onSearchTextChange:l,onSortOrderChange:h,onEntityNameClick:p,updateDownloadStateHandler:f,onSelectedDateChanged:S,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Ya=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function Na(e,a){const t=Gn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=Pe(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=x(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Vn(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?T.trackZeniAccountsCashBalancePromoClicked("Move Money"):(T.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=x(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else T.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const ds=ee(function(e){const a=Ln(e).accountsInOrder.map((n,o)=>Ya(n,o)),t=Un(e);return{sectionTitle:q.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:T}},Na)(Pa),us=ee(function(e){const a=Yn(e).accountsInOrder.map((o,r)=>Ya(o,r)),t=M.getSignedInUser(),n=Xe(t);return{sectionTitle:q.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:T}},Na)(Pa);function ms(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=_e(),o=_(s=>U(s).company?.companyInfo.firstMonthOfFY??1),r=yt(n?.loggedInUserRoleMap);return _(s=>s.cashBalanceState.fetchState)==="Error"?d.jsx(je,{}):d.jsx(ds,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function ps(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=_e(),o=yt(n?.loggedInUserRoleMap),r=_(s=>U(s).company?.companyInfo.firstMonthOfFY??1);return _(s=>s.cardBalanceState.fetchState)==="Error"?d.jsx(je,{}):d.jsx(us,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const hs=wt.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex: 1 1 auto;
|
|
4
4
|
min-height: 100%;
|