@zeniai/web-app-ui 5.0.7-dev → 5.0.7-qa
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AddressRoutes-OTib8mgj.js → AddressRoutes-DC-HB6RD.js} +1 -1
- package/dist/assets/{AddressScreen-BG3byVa4.js → AddressScreen-Dmce3A5k.js} +1 -1
- package/dist/assets/{AiCfoScreen-Bs4dotyZ.js → AiCfoScreen-DGvQvC7f.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-BAVXLwy0.js → BillPayApprovalRoutes-DGSGgIvj.js} +1 -1
- package/dist/assets/{BillPayRoutes-CSYQU0Zj.js → BillPayRoutes-B8LI_Qsf.js} +1 -1
- package/dist/assets/{BusinessVerificationPageScreen-XLAagbE1.js → BusinessVerificationPageScreen-ZnINyDEr.js} +1 -1
- package/dist/assets/{ChargeCardRoutes-DOffdLe0.js → ChargeCardRoutes-DqzoxnGl.js} +1 -1
- package/dist/assets/{CompanyPassportScreen-BfpIrB4f.js → CompanyPassportScreen-C4lx6LQP.js} +1 -1
- package/dist/assets/{ConnectionAuthScreen-W8FtnYT4.js → ConnectionAuthScreen-EO0dLpTq.js} +1 -1
- package/dist/assets/{CustomerOnboardingAuthScreen-CSgO_q9B.js → CustomerOnboardingAuthScreen-BXqLNxl6.js} +1 -1
- package/dist/assets/{CustomerOnboardingRoutes-BwLNXu73.js → CustomerOnboardingRoutes-Di5fRx2F.js} +1 -1
- package/dist/assets/{DashboardRoutes-SSoNO6Vm.js → DashboardRoutes-Z9v4dCYn.js} +1 -1
- package/dist/assets/{DefaultTenantHome-CQIDGSH9.js → DefaultTenantHome-BKfjimqs.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-DqwewpNJ.js → DomesticWireDetailScreen-ClnHC2ph.js} +1 -1
- package/dist/assets/{DrawerScreen-MCWu-b9d.js → DrawerScreen-Cdhf9aya.js} +1 -1
- package/dist/assets/{EntityDetailRoutes-BWUAYWEJ.js → EntityDetailRoutes-gLao7wuj.js} +1 -1
- package/dist/assets/{ExpenseAutomationRoutes-CbPl7htr.js → ExpenseAutomationRoutes-CrnR7Lrw.js} +1 -1
- package/dist/assets/{FeaturePreviewScreen-e6Ei2TQP.js → FeaturePreviewScreen-SnQ5YUgu.js} +1 -1
- package/dist/assets/{MagicLinkRoutes-BEyO4w65.js → MagicLinkRoutes-Cu7xGWkX.js} +1 -1
- package/dist/assets/{MagicLinkSignInScreen-BzJoblUZ.js → MagicLinkSignInScreen-DS36_WSc.js} +1 -1
- package/dist/assets/{MobileAppDrawer-XemkX8uu.js → MobileAppDrawer-Dr8YUpu7.js} +1 -1
- package/dist/assets/{NotFoundScreen-B0rK0orf.js → NotFoundScreen-LHqD0vPk.js} +1 -1
- package/dist/assets/{NotificationRoutes-D_Ku5KIw.js → NotificationRoutes-ClFpK-C6.js} +1 -1
- package/dist/assets/{PandLWithForecastRoutes-DehHga8X.js → PandLWithForecastRoutes-6a_QMlVa.js} +1 -1
- package/dist/assets/{PeopleRoutes-CEvybFgV.js → PeopleRoutes-DBRQVTVt.js} +1 -1
- package/dist/assets/{PerformanceRoutes-BkwXpXL3.js → PerformanceRoutes-ConFkznH.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-CPwnm8HA.js → QBOConnectionScreen-DK9wxn3B.js} +1 -1
- package/dist/assets/{ReferralListScreen-DujIrxLU.js → ReferralListScreen-D7D_U76W.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRoutes-BoDmbBBz.js → ReimbursementApprovalRoutes-DmHsyRFF.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-Dwom34dE.js → ReimbursementApprovalRuleDetailScreen-_vi0SnM7.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-BtA1h3M4.js → ReimbursementRoutes-BTbw2flH.js} +1 -1
- package/dist/assets/{ReportsRoutes-DGfKsmao.js → ReportsRoutes-CDPP5ySl.js} +1 -1
- package/dist/assets/{RewardsRoutes-Bk-Pnj5x.js → RewardsRoutes-GFb-ALSs.js} +1 -1
- package/dist/assets/{ScreenRoutes-C1mW9JyL.js → ScreenRoutes-159QKj4s.js} +2 -2
- package/dist/assets/{SettingsRoutes-BWPXEzUK.js → SettingsRoutes-BIVZr5DK.js} +1 -1
- package/dist/assets/{SetupPagesScreen-Dvz8sz6R.js → SetupPagesScreen-CVBxCxe5.js} +1 -1
- package/dist/assets/{SignInScreen-Cf0Mu6xq.js → SignInScreen-BK71j1jJ.js} +1 -1
- package/dist/assets/{SignOutScreen-D7VuNFMv.js → SignOutScreen-C00r1rFc.js} +1 -1
- package/dist/assets/{TaskListScreen-CkkI6nNr.js → TaskListScreen-MGrTepEx.js} +1 -1
- package/dist/assets/{TaskRoutes-DU_Wp0Og.js → TaskRoutes-BUbVAVTA.js} +1 -1
- package/dist/assets/{TransactionDetailRoutes-eVxJYxib.js → TransactionDetailRoutes-BovwacAn.js} +1 -1
- package/dist/assets/{TransactionDetailScreen-DnWD4Kai.js → TransactionDetailScreen-CrA3WsFF.js} +1 -1
- package/dist/assets/{TransactionListRoutes-Cn1NsJhz.js → TransactionListRoutes-DwX8e6Ks.js} +1 -1
- package/dist/assets/{TreasuryRoutes-CM8EhUUU.js → TreasuryRoutes-CdSpVWn2.js} +1 -1
- package/dist/assets/{VendorsRoutes-kyQq5JR0.js → VendorsRoutes-AINuWKjI.js} +1 -1
- package/dist/assets/{WiseConfirmationScreen-C6upjVa9.js → WiseConfirmationScreen-CZuME63P.js} +1 -1
- package/dist/assets/{ZeniAccountRoutes-B4Z3BIeG.js → ZeniAccountRoutes-DRN7QXep.js} +1 -1
- package/dist/assets/{ZeniAccountStatementScreen-BM4EXAms.js → ZeniAccountStatementScreen-BCOPxpUz.js} +1 -1
- package/dist/assets/{analyticsHelper-BLybaLjV.js → analyticsHelper-CeoHmyKo.js} +1 -1
- package/dist/assets/{getLocaleForTenant-CJe_mZF7.js → getLocaleForTenant-DU8HEeVi.js} +1 -1
- package/dist/assets/{index-Dqto2GR0.js → index-DnJYpNVb.js} +5 -5
- package/dist/assets/{routePaths-kOKVswwv.js → routePaths-D9iN1cLV.js} +1 -1
- package/dist/assets/{useAskAiCfoHostNavButtonProps-c3bUeFHf.js → useAskAiCfoHostNavButtonProps-DKLQyfUj.js} +1 -1
- package/dist/assets/{useFetchSuggestedQuestionsWhenReady-Cj4hvcAQ.js → useFetchSuggestedQuestionsWhenReady-B1Y3Jjir.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-DxWVeoqB.js → useInitialThreadRequest-CBft5O6R.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-BhvaYyJw.js → withTransactionSidePanel-13UAZ-FH.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./liveblocks-CiToer5R.js";import{A as i}from"./AddressScreen-
|
|
1
|
+
import{j as e}from"./liveblocks-CiToer5R.js";import{A as i}from"./AddressScreen-Dmce3A5k.js";import s from"./NotFoundScreen-LHqD0vPk.js";import"./sentry-8AfgzGIO.js";import{n as d,o as r}from"./core-DDvaTX37.js";import"./zeni-epic-state-D4vGt0eL.js";import"./recharts-CxZa6yMn.js";import"./index-DnJYpNVb.js";import"./mui-CP2KeZRM.js";import"./lottie-BsqqVDQp.js";import"./analytics-DVf_BIp2.js";import"./plaid-_EXcf3jJ.js";import"./dnd-V-MvMUKQ.js";import"./stripe-DMRn4zHo.js";import"./lexical-CxLnVFxa.js";import"./pdf-CZO_R6LN.js";import"./utils-DVMMWGFG.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]="339d6624-b51b-426b-a0cc-e8e8bd837ae0",t._sentryDebugIdIdentifier="sentry-dbid-339d6624-b51b-426b-a0cc-e8e8bd837ae0")}catch{}})();function _(){return e.jsxs(d,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(i,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(i,{})}),e.jsx(r,{path:"*",element:e.jsx(s,{})})]})}export{_ as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as d}from"./liveblocks-CiToer5R.js";import{a as h}from"./sentry-8AfgzGIO.js";import{j as P,h as _,u as j,l as E,g as $,k as B}from"./core-DDvaTX37.js";import{Z as M,h as D,z as L,j as K,B as U,x as z,d as I,f as m,U as F,p as b,r as N}from"./index-
|
|
1
|
+
import{j as d}from"./liveblocks-CiToer5R.js";import{a as h}from"./sentry-8AfgzGIO.js";import{j as P,h as _,u as j,l as E,g as $,k as B}from"./core-DDvaTX37.js";import{Z as M,h as D,z as L,j as K,B as U,x as z,d as I,f as m,U as F,p as b,r as N}from"./index-DnJYpNVb.js";import{IZ as C,gI as R,eM as G,I_ as O,b$ as V,I$ as Z,k2 as q}from"./zeni-epic-state-D4vGt0eL.js";import{n as H}from"./mui-CP2KeZRM.js";import J from"./NotFoundScreen-LHqD0vPk.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]="bf181289-10f3-40ff-9f72-3ece80ad1964",e._sentryDebugIdIdentifier="sentry-dbid-bf181289-10f3-40ff-9f72-3ece80ad1964")}catch{}})();const Q=H.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as S}from"./liveblocks-CiToer5R.js";import{a as i}from"./sentry-8AfgzGIO.js";import{h as ee,j as te,u as se,g as U,l as ae,k as ne}from"./core-DDvaTX37.js";import{G as oe,cB as ie,z as re,Z as le,cC as ce,cD as ue,cE as $,x as de,d as _,M as R,cF as me,cG as fe,f as pe,a1 as he,cH as Se,O as ge,s as Ce,r as we,cI as Ie,cJ as ke}from"./index-
|
|
1
|
+
import{j as S}from"./liveblocks-CiToer5R.js";import{a as i}from"./sentry-8AfgzGIO.js";import{h as ee,j as te,u as se,g as U,l as ae,k as ne}from"./core-DDvaTX37.js";import{G as oe,cB as ie,z as re,Z as le,cC as ce,cD as ue,cE as $,x as de,d as _,M as R,cF as me,cG as fe,f as pe,a1 as he,cH as Se,O as ge,s as Ce,r as we,cI as Ie,cJ as ke}from"./index-DnJYpNVb.js";import{fE as be,f3 as G,eM as Ee,hm as ye,Pv as Pe,eL as Te,hw as _e,hs as xe,fu as ve,fo as Qe,fh as Ae,fl as j,fp as Oe,fq as Fe,fr as De,fs as Le,ft as Me}from"./zeni-epic-state-D4vGt0eL.js";import{D as Be,n as x,P as Ue,S as Re}from"./mui-CP2KeZRM.js";import{p as je}from"./pathToGoBack-DbeVW-hw.js";import"./recharts-CxZa6yMn.js";import"./lottie-BsqqVDQp.js";import"./analytics-DVf_BIp2.js";import"./plaid-_EXcf3jJ.js";import"./dnd-V-MvMUKQ.js";import"./stripe-DMRn4zHo.js";import"./lexical-CxLnVFxa.js";import"./pdf-CZO_R6LN.js";import"./utils-DVMMWGFG.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new a.Error().stack;r&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[r]="4e74c835-33d8-43d3-94ca-a09682c69ffd",a._sentryDebugIdIdentifier="sentry-dbid-4e74c835-33d8-43d3-94ca-a09682c69ffd")}catch{}})();const N="chat-response-generated",$e=ne(function(a,r){const n=G(a),d=r.isSubmitting;return{showSampleQuestions:r.sessionFromUrl==="explore"&&n.uiState.currentChatSessionId==null,aiCfoView:n,isSubmitting:d,isNewChatSession:r.sessionFromUrl==="new_chat"||r.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${ge}/tableDownload`,emailLinkQuestion:r.emailLinkQuestion,autoSubmitEmailLinkQuestion:r.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:r.onEmailLinkQuestionProcessed,isFileUploadEnabled:r.isFileUploadEnabled}},function(a,r){const{location:n,currentTenant:d,userId:c,navigate:f,currentChatSessionId:p,allSessionsWithOrderedQuestionAnswers:g}=r;return{onEventReceived:(e,o)=>{if(e===N&&typeof o.text=="string"&&typeof o.metadata=="object"){const t=o,m=Fe(t.type),u=t.metadata.chat_session_id??null,{currentChatSession:s,currentQuestionAnswer:C,currentQuestionAnswerSummary:h}=$(g,u);m!=="answer"?_.trackAICFOChatResponseGenerated(m,C?.question.questionText??"",t.text,u,ke(h,s),t.metadata.message_id??null):_.trackAICFOChatAnswerGenerated(t.text,C?.question.questionText??"",(t.follow_up_questions?.length??0)>0,!!t.assumptions,!!t.insights,t.visualization!=null,De(t.visualization?.type??"")??null,u,t.summarized_title,t.metadata.message_id??null),a(Le({chatSessionId:t.metadata.chat_session_id,responseType:m,fetchState:{fetchState:"Completed",error:void 0}})),a(Me({chatSessionId:t.metadata.chat_session_id,answerPayload:t,userId:c}))}},onSubmit:(e,o,t,m)=>{e&&Ie(a,e,o,p,g,c,m,t)},updateCurrentInput:e=>{a(j(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{a(Oe(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{f(-1)},onCloseClick:()=>{const e=we(n.state?.pathnameStackToGoBack),o=e.poppedPathname??je(1);f(o,{state:{...n.state,pathnameStackToGoBack:e.newStack}}),a(j(""))},togglePageView:()=>{f(`/${d.tenantEmailDomain}/dashboard`,{state:{...n.state,message:"open_ai_cfo_drawer"}})},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{f(-1)},onNewChatClick:()=>{p!=null&&a(Ae());const e=Ce(n.state?.pathnameStackToGoBack,n.pathname);f(`/${d.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,o)=>{a(Qe({questionAnswerId:e,isCollapsed:o}))},onMenuClick:r.onMenuClick}})(he(Se)),rt=({isFileUploadEnabled:a})=>{const{setIsAiCfoOpen:r}=oe(),n=ee(),d=te(),c=se(),[f,p]=i.useState(!1);i.useEffect(()=>{n(be())},[n]);const{customPageTitle:g}=ie(),e=U(l=>G(l)),o=re.getSignedInUser(),{session_id:t}=ae(),m=le(),u=U(l=>Ee(l)),s=e.uiState.currentChatSessionId,C=ce({currentTenant:u,currentChatSessionId:s,aiCfoView:e}),h=c.state,w=h?.aiCfoInitialQuestion,v=!!h?.aiCfoShouldSubmit,[q,b]=i.useState(null),[V,E]=i.useState(!1),Q=i.useRef(!1);i.useEffect(()=>{Q.current||w==null||w===""||(b(w),E(v),Q.current=!0)},[w,v]);const H=i.useCallback(()=>{b(null),E(!1)},[]),A=i.useMemo(()=>new URLSearchParams(c.search),[c.search]),O=A.get("ref")??h?.aiCfoRef,y=A.get("emailRefId")??h?.aiCfoEmailRefId,F=i.useRef(!1);i.useEffect(()=>{F.current||O!=="month-end-email"||y==null||s!=null||o==null||(n(ye("controller",o.userId,y,"MONTH_END_EMAIL")),F.current=!0)},[O,y,s,n,o]);const I=e.uiState.lastContextMessage;i.useEffect(()=>{I!=null&&I!==""&&s!=null&&(b(I),E(!0),n(Pe()))},[I,s,n]);const W=u.masterTOSInfo,k=W?.isMasterTOSAccepted??!1,{visitedSessions:D}=ue(s),P=e.fetchState,T=e.uiState.chatSessionsNextPageToken.hasMore||!e.uiState.chatSessionsFirstPageFetched,L=s!=null?e.fetchChatSessionHistoryByChatSessionId?.[s]?.fetchState??"Not-Started":"Not-Started",M=s==null||(e.uiState.chatHistoryNextPageToken[s]?.hasMore??!0),B=e.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:z}=$(B,s),J=z.length===0;i.useEffect(()=>{k||d("../dashboard",{state:{...c.state,message:"open_ai_cfo_drawer"}})},[k]),i.useEffect(()=>{s!=null&&t!==s&&d(`../ai-cfo/${s}`,{state:{...c.state}})},[s,t]),i.useEffect(()=>{t!=null&&s==null&&t!=="new_chat"&&t!=="explore"&&n(Te({sessionId:t,agentId:"controller"}))},[]);const X=i.useMemo(()=>({events:D.map(l=>`private-chat-${l}.${N}`),eventCallback:(l,Z,K)=>K.onEventReceived(l,Z)}),[D]);if(i.useEffect(()=>{P!=="In-Progress"&&T&&n(_e())},[P,T,n]),i.useEffect(()=>{s!=null&&L!=="In-Progress"&&M&&o!=null&&P==="Completed"&&!T&&n(xe(s,o.userId))},[L,M,s,o,n]),o==null||t==null)throw Error("Can't access AI Controller page without signing in...");const Y=s!=null&&e.responseStateByChatSessionId?.[s]?.answer?.fetchState==="In-Progress";return S.jsxs(Ne,{children:[S.jsx(de,{analytics:_,onLoad:l=>l.trackPageLoaded(pe.Event.aiCFOPage)}),R(m)&&C.drawerElement,S.jsx($e,{...X,currentChatSessionId:s,allSessionsWithOrderedQuestionAnswers:B,openOnboardingPage:()=>p(!0),userId:o.userId,setIsAiCfoOpen:r,navigate:d,sessionFromUrl:t,location:c,isSubmitting:Y,isEmptyChatWithSession:J,customPageTitle:g,currentTenant:u,emailLinkQuestion:q??void 0,autoSubmitEmailLinkQuestion:V,onEmailLinkQuestionProcessed:H,onMenuClick:R(m)?C.open:void 0,isFileUploadEnabled:a}),S.jsx(Be,{anchor:"right",open:f,transitionDuration:250,PaperProps:{component:qe,style:{width:`${me}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>p(!1),children:S.jsx(Ge,{onClick:l=>l.stopPropagation(),children:S.jsx(fe,{isTOSAccepted:k,acceptMasterTOSState:e.masterTOSAcceptanceState,customPageTitle:g,onCloseClick:()=>p(!1),onCompleteClick:()=>{k||u.userRoleId==null||n(ve(u.userRoleId)),p(!1)}})})})]})},Ge=x(Re)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as l}from"./liveblocks-CiToer5R.js";import{a as y}from"./sentry-8AfgzGIO.js";import{j as U,u as B,h as j,g as v,N as $,k as T,l as L,n as O,o as h}from"./core-DDvaTX37.js";import{eM as N,Mg as R,LY as b,x5 as w,w$ as F,x3 as I,wU as M,L_ as W,wX as q,x7 as z,x6 as C}from"./zeni-epic-state-D4vGt0eL.js";import{h as P,z as k,B as V,a1 as X,bu as Y,aa as _,bv as G}from"./index-
|
|
1
|
+
import{j as l}from"./liveblocks-CiToer5R.js";import{a as y}from"./sentry-8AfgzGIO.js";import{j as U,u as B,h as j,g as v,N as $,k as T,l as L,n as O,o as h}from"./core-DDvaTX37.js";import{eM as N,Mg as R,LY as b,x5 as w,w$ as F,x3 as I,wU as M,L_ as W,wX as q,x7 as z,x6 as C}from"./zeni-epic-state-D4vGt0eL.js";import{h as P,z as k,B as V,a1 as X,bu as Y,aa as _,bv as G}from"./index-DnJYpNVb.js";import"./mui-CP2KeZRM.js";import{i as H}from"./ReimbursementApprovalRuleDetailScreen-_vi0SnM7.js";import J from"./NotFoundScreen-LHqD0vPk.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]="cee623a8-b41d-40b8-aae7-939f5ada85dd",e._sentryDebugIdIdentifier="sentry-dbid-cee623a8-b41d-40b8-aae7-939f5ada85dd")}catch{}})();const x="bill-approval-rule-update",K=T(function(e){return{approvalView:R(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:a,location:p}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(x)&&e(W(!1))},onBackClick:()=>{_(p)?a("../../"):a("../../../bills/setup")},onDeleteRuleClick:t=>{e(M(t))},onEditRuleClick:t=>{t!=null?(e(I(t)),a(`./${t}/edit`)):(e(I()),a("./new"))}}})(X(Y)),Q=()=>{const e=U(),o=B(),a=j(),[p,t]=y.useState(!1),[u,s]=y.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>N(i)),r=v(i=>R(i)),g=v(i=>b(i).billPaySetupApproverViewUpdateData);if(y.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&a(w())},[g]),y.useEffect(()=>{p||n!=="Not-Started"||(t(!0),a(F(!0)))},[p,n,a]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");y.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),a(I())),e("./new"))},[u,r,a]);const f={events:c.companyId!=null?[`private-${c.companyId}.${x}`]:[],eventCallback:(i,A,m)=>{i.endsWith(x)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx($,{to:"../../promo"}):c.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||r.fetchState!=="Completed"&&r.fetchState!=="Error"?l.jsx(V,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):l.jsx(K,{currentTenant:c,location:o,navigate:e,...f})},Z=T(function(e,o){const a=b(e),p=a.billPaySetupApproverViewUpdateData?.type??"approval_create",t=p==="approval_create"&&a.allApprovalRules.length!==0;let u=a.allApprovalRules.length===0;return o.approvalRuleId&&(u=a.allApprovalRules.findIndex(s=>s.approvalRuleId===o.approvalRuleId)===0),{localData:a,hideUpperBoundField:t,isLowerBoundDisabled:u,approvalUpdateActionType:p}},function(e,o){const{navigate:a,approvalUpdateDataView:p,approverViewData:t,approvalRuleId:u}=o,s=p.billPaySetupApproverViewUpdateData?.type,d=_(o.location);return{onApprovalRuleDataUpdated:n=>{const c=r=>{const g=[];return r.forEach(f=>{const i=f.actors.selectedUsers.map(S=>({type:"user",userId:S.userId,isImplicitActor:!1})),A=f.actors.selectedNonUsers.map(S=>{const E=!!H(S.value);return{type:E?"attribute":"role",subType:S.value,userId:void 0,idType:void 0,isImplicitActor:!E}}),m=i.concat(A);g.push({action:f.stepType.selectedOption,actors:m,operator:m.length>1?f.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),g};if(s==="approval_create"){const r={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}},onResetClick:()=>{e(w()),s==="approval_update"||d?a("../"):t.allApprovalRules.length===0&&t.fetchState==="Completed"?a("../../setup"):a("../")},onBackClick:()=>{e(w()),s==="approval_update"||d?a("../"):t.allApprovalRules.length===0&&t.fetchState==="Completed"?a("../../setup"):a("../")},onSaveRuleClick:()=>{e(z())},onSaveRuleSuccess:()=>{a("../")}}})(G);function D(){const e=U(),o=j(),a=B(),{approvalRuleId:p}=L(),t=k.getSignedInUser(),u=P(),s=v(r=>b(r)),d=v(r=>R(r)),[n,c]=y.useState(!1);if(y.useEffect(()=>{n||(c(!0),o(q(!0)))}),y.useEffect(()=>{d.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[d,p]),t==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?l.jsx(V,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:u.colors.grey5}}):l.jsx(Z,{navigate:e,approvalUpdateDataView:s,approvalRuleId:p,approverViewData:d,location:a})}function se(){return l.jsxs(O,{children:[l.jsx(h,{path:"/",element:l.jsx(Q,{})}),l.jsx(h,{path:"/new",element:l.jsx(D,{})}),l.jsx(h,{path:"/:approvalRuleId/edit",element:l.jsx(D,{})}),l.jsx(h,{path:"*",element:l.jsx(J,{})})]})}export{se as B};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-CiToer5R.js";import{j as K,h as re,u as Y,l as te,g as k,N as ee,k as Q,i as la,n as sa,o as S}from"./core-DDvaTX37.js";import{eM as Z,Ly as Ge,bu as At,GA as ra,bn as xt,bC as ue,Lz as Bt,wp as Et,xz as Ue,wY as ca,bm as je,LA as da,LB as pa,b$ as ua,LC as ma,jm as Dt,LD as jt,LE as Tt,y8 as Oe,wE as Be,LF as ba,wd as it,LG as ha,Bk as ga,wh as ya,wn as Pt,LH as Ie,LI as Ne,xA as ze,LJ as Sa,LK as fa,xD as Ze,LL as Ia,xQ as ka,LM as Ft,xk as ot,xp as va,LN as wa,LO as pe,LP as Rt,LQ as Lt,LR as Vt,fG as Ca,wJ as Me,ct as $t,LS as Aa,gy as xa,LT as Ba,LU as Ea,eT as Ut,eR as Mt,LV as He,LW as Da,LX as ja,Jh as We,LY as Ta,Ji as ie,Jj as qe,LZ as Pa,L_ as Fa,L$ as Ra,xr as lt,xo as La,M0 as Va,M1 as $a,M2 as Ua,xa as Ma,M3 as _a,M4 as Ga,M5 as Oa,cN as _t,cJ as Gt,jx as Na,bI as za,bp as Ot,bJ as Nt,vv as Za,M6 as Ha,B7 as Wa,Bd as qa,s2 as Ja,xB as Ka,yf as Ya,jK as fe,M7 as Qa,M8 as zt,kc as Xa,jE as Zt,jZ as Ht,jY as st,bB as be,bH as en,M9 as tn,Ma as ke,ig as an,Mb as rt,Mc as nn,ik as on,iG as ln,yt as sn,Md as rn,k5 as cn,yj as dn,Me as ct,yn as pn,ys as un,yp as mn,yh as bn,Mf as Wt,wy as hn,Mg as gn,Mh as yn,fA as Sn,fz as fn,fy as In,jN as kn,k3 as dt,ke as vn,pB as wn,jW as Cn,yl as An,ir as xn,kj as Bn,Mi as En,ii as Dn,ps as jn,Mj as Tn,xg as Pn,bD as Fn,br as Rn,Ig as Ln,cL as Vn,cK as $n,cs as Un,cy as Mn}from"./zeni-epic-state-D4vGt0eL.js";import{h as me,z as L,j as ve,G as Je,n as oe,i as y,aI as Ee,B as ce,o as E,x as Te,d as j,b1 as _n,r as z,O as Ke,s as D,Z as we,b2 as pt,b3 as ut,b4 as Gn,af as On,A as Nn,aC as zn,y as qt,D as Ye,C as Qe,b5 as Zn,ao as Jt,b6 as Hn,J as Wn,f as Kt,a1 as qn,b7 as Jn,b8 as Kn,b9 as Yn,ba as Qn,bb as Xn,bc as ei,bd as ti,be as ai,bf as ni,Y as ii,bg as oi,aZ as li,bh as si,bi as ri,a4 as ci}from"./index-Dqto2GR0.js";import{n as V,S as di}from"./mui-CP2KeZRM.js";import{A as mt}from"./AddressScreen-BG3byVa4.js";import{g as ne,a as Pe,i as Yt,V as Xe,b as et,c as pi,v as ui,d as mi,A as he,D as ge}from"./DomesticWireDetailScreen-DqwewpNJ.js";import{a as f}from"./sentry-8AfgzGIO.js";import{u as tt}from"./useAskAiCfoHostNavButtonProps-c3bUeFHf.js";import{c as at}from"./useFetchSuggestedQuestionsWhenReady-Cj4hvcAQ.js";import{u as Qt}from"./useInitialThreadRequest-DxWVeoqB.js";import De from"./NotFoundScreen-B0rK0orf.js";import{D as bi}from"./DrawerScreen-MCWu-b9d.js";import{M as Xt}from"./MobileAppDrawer-XemkX8uu.js";import{F as ea}from"./FeaturePreviewScreen-e6Ei2TQP.js";import{S as Re}from"./SetupPagesScreen-Dvz8sz6R.js";import{B as hi}from"./BillPayApprovalRoutes-BAVXLwy0.js";import{FallBackRoute as gi}from"./ScreenRoutes-C1mW9JyL.js";import"./recharts-CxZa6yMn.js";import"./lottie-BsqqVDQp.js";import"./analytics-DVf_BIp2.js";import"./plaid-_EXcf3jJ.js";import"./dnd-V-MvMUKQ.js";import"./stripe-DMRn4zHo.js";import"./lexical-CxLnVFxa.js";import"./pdf-CZO_R6LN.js";import"./utils-DVMMWGFG.js";import"./analyticsHelper-BLybaLjV.js";import"./routePaths-kOKVswwv.js";import"./BusinessVerificationPageScreen-XLAagbE1.js";import"./ReimbursementApprovalRuleDetailScreen-Dwom34dE.js";import"./getLocaleForTenant-CJe_mZF7.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]="bd721267-150c-490b-99f3-492f41475f5a",e._sentryDebugIdIdentifier="sentry-dbid-bd721267-150c-490b-99f3-492f41475f5a")}catch{}})();const yi=Q(function(e,t){const l=Ge(e,t.billId),n=L.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},p=z(t.location.state?.pathnameStackToGoBack);let o=!0;p.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const i=je(n);i||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,u=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:m,isMarkAsPaidBtnVisible:b}=da(l.billActivities,pa(t.currentTenant),n);d=m,u=b}const h=ua(t.currentTenant?.userRole??[]),g=l.transactionDetails!=null&&ma(l.transactionDetails,h,n);return{billDetails:l,isAccountingClassesEnabled:Dt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${Ke}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:h,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:u,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:j,showMarkAsPaidButtonToCreator:g,isZeniUser:i}},function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:p}=n;return{redirectToBillsScreen:()=>{const o=ne(p),s=D(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(Ie({}))},deleteBill:o=>{j.trackBillPayDeleteBill(l,o),e(Pt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?j.trackBillPayCancelAndDeleteBill(l,o):j.trackBillPayCancelBill(l),e(ya(l,s))},onSaveRealTimeApprovals:o=>{e(ga(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(ha({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(it(l,o.type,"")):e(it(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Be(l,"retry")):e(Be(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Pe(p,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ne(p);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ba({billId:t.billId}))},onRefundPaymentClick:()=>{e(Be(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Tt({data:i,billId:l})),e(Oe(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(jt({billId:l}))}}})(_n);function Si(){const e=K(),t=re(),l=Y(),{billId:n}=te(),c=me(),r=L.getSignedInUser(),p=ve(),o=k(w=>Z(w)),s=k(w=>Ge(w,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Qt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoOpen:u,setIsAiCfoOpen:h}=Je(),{isAiCfoAccessEnabled:g,onAskAiCfoClick:m}=tt({isAiCfoOpen:u,setIsAiCfoOpen:h,mobileExploreReferrer:"Bill Details"});at({isDataReady:s.fetchState==="Completed"});const b=o?.userRole!=null&&At(o?.userRole),A=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b,[T,I]=f.useState(!1),[v,H]=f.useState(!1),[M,_]=f.useState(!1),{useFeatureGate:F,useDynamicConfig:x}=oe(),{isFeatureEnabled:$}=F(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:U}=F(y.isBillPayCommentingEnabled),{isFeatureEnabled:B}=F(y.isBillPayDetectInsufficientFundsEnabled),{configValue:O}=x(Ee.zeniAssistConfig),W=ra(o),q=xt(o.userRole),J=A&&ue(p?.loggedInUserRoleMap),G=O.user_ids!=null&&r?.userId!=null&&O.user_ids.includes(r?.userId),{isFeatureEnabled:le}=F(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:X}=F(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&W===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||J||s.allApprovers.find(w=>w.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,J,o.isZeni,W,r]),f.useEffect(()=>{n!=null&&t(Bt(n))},[n]),f.useEffect(()=>{T||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(I(!0),t(Et(n??"",$,G,!1)))},[T,s,n,t]),f.useEffect(()=>{v||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(H(!0),t(Ue(!1,$,G,X,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(ca()))},[v,s,n,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(ee,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(ce,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${E.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Te,{analytics:j,onLoad:w=>(se=>{n!=null&&se.trackBillPayBillDetails(n,s.isRecurring)})(w)}),a.jsx(yi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:U,isRealTimeApprovalEnabled:M,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:le,hasZeniAssistAccess:G,isDetectInsufficientFundsEnabled:B,isAiCfoAccessEnabled:g,onAskAiCfoClick:m})]})}const ye=Ye.getLocalizedStrings().spendManagement.billPay.billDetails,fi={containerWidth:new qt(100,58)},bt=Q(function(e,t){const l=L.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,p=r&&t.file==null;return{uploadInvoiceEndPoint:`${Jt.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:j,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:p,style:{paddingTop:E.sp10,paddingRight:E.sp3,paddingBottom:"15px",paddingLeft:E.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=L.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(Ze(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(ka({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{j?.trackBillPaySkipAutofill(),e(ze(n))},onDeleteClick:()=>{e(Ia({billId:t.billId})),j?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(zn);function C({appContent:e}){const t=re(),l=K(),{billId:n}=te(),c=Y(),r=c.pathname,p=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),i=L.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:u}=oe(),{isFeatureEnabled:h}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:m}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:A}=u(Ee.zeniAssistConfig),T=A.user_ids!=null&&i?.userId!=null&&A.user_ids.includes(i?.userId),I=k(w=>Z(w)),[v,H]=f.useState(!1),[M,_]=f.useState(!1),[F,x]=f.useState(!1),[$,U]=f.useState(),B=k(w=>Ne(w,h,m,n));let O=B.fetchState,W=B.file,q=B.showAutofill;const J=k(w=>Ge(w,n??""));p===!1&&(O=J.fetchState,W=J.transactionDetails?.attachments?.[0],q=!1);const G=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;f.useEffect(()=>{n==null&&t(ze(!0))},[n,t]),f.useEffect(()=>{O==="Not-Started"&&(p&&M?_(!1):!p&&v&&H(!1))},[n]),f.useEffect(()=>{v||n==null||p||(H(!0),t(Et(n,g,T,!1)),M||(_(!0),t(Ue(!1,g,T,b,n)))),p&&!M&&(_(!0),t(Ue(!1,g,T,b,n)))},[v,M,p,n,t]);const le={onOkClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","yes"),t(fa({replaceBillData:!0,billId:n})),t(Ze($,h,n))},onCancelClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","no"),t(Sa({file:$,billId:n}))}},X=f.useCallback(()=>{const w=z(c.state?.pathnameStackToGoBack),se=w.poppedPathname??ne(I.tenantEmailDomain);t(Ie({billId:n})),l(se,{state:{pathnameStackToGoBack:w.newStack}})},[c.state,I.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(O==="Error"||J.fetchState==="Error")return a.jsx(De,{});if(O!="Completed")return n==null&&o!=="small"?a.jsx(pt,{fallback:X,children:a.jsxs(Le,{windowSize:o,children:[a.jsx(gt,{}),a.jsx(Ve,{}),a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:!0,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:void 0,setShowConfirmationPopup:x,setPayload:U,showActionButtons:!1,isInitialEdit:!!B.isInitialEdit,billStage:G}),a.jsx($e,{windowSize:o,children:a.jsx(ut,{})})]})}):a.jsxs(Le,{windowSize:o,children:[o==="small"||q?null:a.jsx(ht,{children:a.jsx(ta,{onClick:X})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(Gn,{}),a.jsx($e,{windowSize:o,children:a.jsx(ut,{})})]});{const w=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(pt,{fallback:X,children:a.jsxs(Le,{windowSize:o,children:[q&&o!=="small"?a.jsx(gt,{}):null,F?a.jsx(On,{titleComponent:a.jsx(xi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(Bi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:le,isEditPopup:!0}):null,o==="small"||q?null:a.jsx(ht,{children:a.jsx(Ii,{})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:q,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:ki(p,J,B),setShowConfirmationPopup:x,setPayload:U,showActionButtons:vi(p,B),isInitialEdit:!!B.isInitialEdit,billStage:w}),a.jsx($e,{windowSize:o,children:e})]})})}}function Ii(){const{triggerBack:e}=Zn();return a.jsx(ta,{onClick:e})}function ki(e,t,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(wi,{children:[a.jsx(Ci,{children:`${ye.recurringBill.recurringCycle}
|
|
1
|
+
import{j as a}from"./liveblocks-CiToer5R.js";import{j as K,h as re,u as Y,l as te,g as k,N as ee,k as Q,i as la,n as sa,o as S}from"./core-DDvaTX37.js";import{eM as Z,Ly as Ge,bu as At,GA as ra,bn as xt,bC as ue,Lz as Bt,wp as Et,xz as Ue,wY as ca,bm as je,LA as da,LB as pa,b$ as ua,LC as ma,jm as Dt,LD as jt,LE as Tt,y8 as Oe,wE as Be,LF as ba,wd as it,LG as ha,Bk as ga,wh as ya,wn as Pt,LH as Ie,LI as Ne,xA as ze,LJ as Sa,LK as fa,xD as Ze,LL as Ia,xQ as ka,LM as Ft,xk as ot,xp as va,LN as wa,LO as pe,LP as Rt,LQ as Lt,LR as Vt,fG as Ca,wJ as Me,ct as $t,LS as Aa,gy as xa,LT as Ba,LU as Ea,eT as Ut,eR as Mt,LV as He,LW as Da,LX as ja,Jh as We,LY as Ta,Ji as ie,Jj as qe,LZ as Pa,L_ as Fa,L$ as Ra,xr as lt,xo as La,M0 as Va,M1 as $a,M2 as Ua,xa as Ma,M3 as _a,M4 as Ga,M5 as Oa,cN as _t,cJ as Gt,jx as Na,bI as za,bp as Ot,bJ as Nt,vv as Za,M6 as Ha,B7 as Wa,Bd as qa,s2 as Ja,xB as Ka,yf as Ya,jK as fe,M7 as Qa,M8 as zt,kc as Xa,jE as Zt,jZ as Ht,jY as st,bB as be,bH as en,M9 as tn,Ma as ke,ig as an,Mb as rt,Mc as nn,ik as on,iG as ln,yt as sn,Md as rn,k5 as cn,yj as dn,Me as ct,yn as pn,ys as un,yp as mn,yh as bn,Mf as Wt,wy as hn,Mg as gn,Mh as yn,fA as Sn,fz as fn,fy as In,jN as kn,k3 as dt,ke as vn,pB as wn,jW as Cn,yl as An,ir as xn,kj as Bn,Mi as En,ii as Dn,ps as jn,Mj as Tn,xg as Pn,bD as Fn,br as Rn,Ig as Ln,cL as Vn,cK as $n,cs as Un,cy as Mn}from"./zeni-epic-state-D4vGt0eL.js";import{h as me,z as L,j as ve,G as Je,n as oe,i as y,aI as Ee,B as ce,o as E,x as Te,d as j,b1 as _n,r as z,O as Ke,s as D,Z as we,b2 as pt,b3 as ut,b4 as Gn,af as On,A as Nn,aC as zn,y as qt,D as Ye,C as Qe,b5 as Zn,ao as Jt,b6 as Hn,J as Wn,f as Kt,a1 as qn,b7 as Jn,b8 as Kn,b9 as Yn,ba as Qn,bb as Xn,bc as ei,bd as ti,be as ai,bf as ni,Y as ii,bg as oi,aZ as li,bh as si,bi as ri,a4 as ci}from"./index-DnJYpNVb.js";import{n as V,S as di}from"./mui-CP2KeZRM.js";import{A as mt}from"./AddressScreen-Dmce3A5k.js";import{g as ne,a as Pe,i as Yt,V as Xe,b as et,c as pi,v as ui,d as mi,A as he,D as ge}from"./DomesticWireDetailScreen-ClnHC2ph.js";import{a as f}from"./sentry-8AfgzGIO.js";import{u as tt}from"./useAskAiCfoHostNavButtonProps-DKLQyfUj.js";import{c as at}from"./useFetchSuggestedQuestionsWhenReady-B1Y3Jjir.js";import{u as Qt}from"./useInitialThreadRequest-CBft5O6R.js";import De from"./NotFoundScreen-LHqD0vPk.js";import{D as bi}from"./DrawerScreen-Cdhf9aya.js";import{M as Xt}from"./MobileAppDrawer-Dr8YUpu7.js";import{F as ea}from"./FeaturePreviewScreen-SnQ5YUgu.js";import{S as Re}from"./SetupPagesScreen-CVBxCxe5.js";import{B as hi}from"./BillPayApprovalRoutes-DGSGgIvj.js";import{FallBackRoute as gi}from"./ScreenRoutes-159QKj4s.js";import"./recharts-CxZa6yMn.js";import"./lottie-BsqqVDQp.js";import"./analytics-DVf_BIp2.js";import"./plaid-_EXcf3jJ.js";import"./dnd-V-MvMUKQ.js";import"./stripe-DMRn4zHo.js";import"./lexical-CxLnVFxa.js";import"./pdf-CZO_R6LN.js";import"./utils-DVMMWGFG.js";import"./analyticsHelper-CeoHmyKo.js";import"./routePaths-D9iN1cLV.js";import"./BusinessVerificationPageScreen-ZnINyDEr.js";import"./ReimbursementApprovalRuleDetailScreen-_vi0SnM7.js";import"./getLocaleForTenant-DU8HEeVi.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]="bd721267-150c-490b-99f3-492f41475f5a",e._sentryDebugIdIdentifier="sentry-dbid-bd721267-150c-490b-99f3-492f41475f5a")}catch{}})();const yi=Q(function(e,t){const l=Ge(e,t.billId),n=L.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},p=z(t.location.state?.pathnameStackToGoBack);let o=!0;p.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const i=je(n);i||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,u=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:m,isMarkAsPaidBtnVisible:b}=da(l.billActivities,pa(t.currentTenant),n);d=m,u=b}const h=ua(t.currentTenant?.userRole??[]),g=l.transactionDetails!=null&&ma(l.transactionDetails,h,n);return{billDetails:l,isAccountingClassesEnabled:Dt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${Ke}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:h,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:u,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:j,showMarkAsPaidButtonToCreator:g,isZeniUser:i}},function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:p}=n;return{redirectToBillsScreen:()=>{const o=ne(p),s=D(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(Ie({}))},deleteBill:o=>{j.trackBillPayDeleteBill(l,o),e(Pt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?j.trackBillPayCancelAndDeleteBill(l,o):j.trackBillPayCancelBill(l),e(ya(l,s))},onSaveRealTimeApprovals:o=>{e(ga(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(ha({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(it(l,o.type,"")):e(it(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Be(l,"retry")):e(Be(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Pe(p,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ne(p);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ba({billId:t.billId}))},onRefundPaymentClick:()=>{e(Be(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Tt({data:i,billId:l})),e(Oe(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(jt({billId:l}))}}})(_n);function Si(){const e=K(),t=re(),l=Y(),{billId:n}=te(),c=me(),r=L.getSignedInUser(),p=ve(),o=k(w=>Z(w)),s=k(w=>Ge(w,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Qt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoOpen:u,setIsAiCfoOpen:h}=Je(),{isAiCfoAccessEnabled:g,onAskAiCfoClick:m}=tt({isAiCfoOpen:u,setIsAiCfoOpen:h,mobileExploreReferrer:"Bill Details"});at({isDataReady:s.fetchState==="Completed"});const b=o?.userRole!=null&&At(o?.userRole),A=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b,[T,I]=f.useState(!1),[v,H]=f.useState(!1),[M,_]=f.useState(!1),{useFeatureGate:F,useDynamicConfig:x}=oe(),{isFeatureEnabled:$}=F(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:U}=F(y.isBillPayCommentingEnabled),{isFeatureEnabled:B}=F(y.isBillPayDetectInsufficientFundsEnabled),{configValue:O}=x(Ee.zeniAssistConfig),W=ra(o),q=xt(o.userRole),J=A&&ue(p?.loggedInUserRoleMap),G=O.user_ids!=null&&r?.userId!=null&&O.user_ids.includes(r?.userId),{isFeatureEnabled:le}=F(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:X}=F(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&W===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||J||s.allApprovers.find(w=>w.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,J,o.isZeni,W,r]),f.useEffect(()=>{n!=null&&t(Bt(n))},[n]),f.useEffect(()=>{T||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(I(!0),t(Et(n??"",$,G,!1)))},[T,s,n,t]),f.useEffect(()=>{v||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(H(!0),t(Ue(!1,$,G,X,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(ca()))},[v,s,n,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(ee,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(ce,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${E.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Te,{analytics:j,onLoad:w=>(se=>{n!=null&&se.trackBillPayBillDetails(n,s.isRecurring)})(w)}),a.jsx(yi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:U,isRealTimeApprovalEnabled:M,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:le,hasZeniAssistAccess:G,isDetectInsufficientFundsEnabled:B,isAiCfoAccessEnabled:g,onAskAiCfoClick:m})]})}const ye=Ye.getLocalizedStrings().spendManagement.billPay.billDetails,fi={containerWidth:new qt(100,58)},bt=Q(function(e,t){const l=L.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,p=r&&t.file==null;return{uploadInvoiceEndPoint:`${Jt.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:j,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:p,style:{paddingTop:E.sp10,paddingRight:E.sp3,paddingBottom:"15px",paddingLeft:E.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=L.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(Ze(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(ka({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{j?.trackBillPaySkipAutofill(),e(ze(n))},onDeleteClick:()=>{e(Ia({billId:t.billId})),j?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(zn);function C({appContent:e}){const t=re(),l=K(),{billId:n}=te(),c=Y(),r=c.pathname,p=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),i=L.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:u}=oe(),{isFeatureEnabled:h}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:m}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:A}=u(Ee.zeniAssistConfig),T=A.user_ids!=null&&i?.userId!=null&&A.user_ids.includes(i?.userId),I=k(w=>Z(w)),[v,H]=f.useState(!1),[M,_]=f.useState(!1),[F,x]=f.useState(!1),[$,U]=f.useState(),B=k(w=>Ne(w,h,m,n));let O=B.fetchState,W=B.file,q=B.showAutofill;const J=k(w=>Ge(w,n??""));p===!1&&(O=J.fetchState,W=J.transactionDetails?.attachments?.[0],q=!1);const G=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;f.useEffect(()=>{n==null&&t(ze(!0))},[n,t]),f.useEffect(()=>{O==="Not-Started"&&(p&&M?_(!1):!p&&v&&H(!1))},[n]),f.useEffect(()=>{v||n==null||p||(H(!0),t(Et(n,g,T,!1)),M||(_(!0),t(Ue(!1,g,T,b,n)))),p&&!M&&(_(!0),t(Ue(!1,g,T,b,n)))},[v,M,p,n,t]);const le={onOkClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","yes"),t(fa({replaceBillData:!0,billId:n})),t(Ze($,h,n))},onCancelClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","no"),t(Sa({file:$,billId:n}))}},X=f.useCallback(()=>{const w=z(c.state?.pathnameStackToGoBack),se=w.poppedPathname??ne(I.tenantEmailDomain);t(Ie({billId:n})),l(se,{state:{pathnameStackToGoBack:w.newStack}})},[c.state,I.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(O==="Error"||J.fetchState==="Error")return a.jsx(De,{});if(O!="Completed")return n==null&&o!=="small"?a.jsx(pt,{fallback:X,children:a.jsxs(Le,{windowSize:o,children:[a.jsx(gt,{}),a.jsx(Ve,{}),a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:!0,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:void 0,setShowConfirmationPopup:x,setPayload:U,showActionButtons:!1,isInitialEdit:!!B.isInitialEdit,billStage:G}),a.jsx($e,{windowSize:o,children:a.jsx(ut,{})})]})}):a.jsxs(Le,{windowSize:o,children:[o==="small"||q?null:a.jsx(ht,{children:a.jsx(ta,{onClick:X})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(Gn,{}),a.jsx($e,{windowSize:o,children:a.jsx(ut,{})})]});{const w=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(pt,{fallback:X,children:a.jsxs(Le,{windowSize:o,children:[q&&o!=="small"?a.jsx(gt,{}):null,F?a.jsx(On,{titleComponent:a.jsx(xi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(Bi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:le,isEditPopup:!0}):null,o==="small"||q?null:a.jsx(ht,{children:a.jsx(Ii,{})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:q,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:ki(p,J,B),setShowConfirmationPopup:x,setPayload:U,showActionButtons:vi(p,B),isInitialEdit:!!B.isInitialEdit,billStage:w}),a.jsx($e,{windowSize:o,children:e})]})})}}function Ii(){const{triggerBack:e}=Zn();return a.jsx(ta,{onClick:e})}function ki(e,t,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(wi,{children:[a.jsx(Ci,{children:`${ye.recurringBill.recurringCycle}
|
|
2
2
|
${n}/${c}`}),a.jsx(Ai,{})]}):void 0}function vi(e,t){const l=t.billActivities?.[0],n=t.billStage==="pending_approval"&&l?.areApprovalsSerialized===!0&&l?.currentPendingStepIndex===0;return e&&(t.billStage==="draft"||n)}const ht=V.div`
|
|
3
3
|
margin-bottom: 20px;
|
|
4
4
|
margin-top: 20px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as k}from"./liveblocks-CiToer5R.js";import{a as V}from"./sentry-8AfgzGIO.js";import{j as ae,u as ne,h as se,l as ie,g as C,N as oe,k as re}from"./core-DDvaTX37.js";import{j as ce,n as ue,aI as de,z as B,x as pe,d as M,aa as x,f as z,bq as le,ao as me,s as E,ap as P}from"./index-
|
|
1
|
+
import{j as k}from"./liveblocks-CiToer5R.js";import{a as V}from"./sentry-8AfgzGIO.js";import{j as ae,u as ne,h as se,l as ie,g as C,N as oe,k as re}from"./core-DDvaTX37.js";import{j as ce,n as ue,aI as de,z as B,x as pe,d as M,aa as x,f as z,bq as le,ao as me,s as E,ap as P}from"./index-DnJYpNVb.js";import{M4 as fe,eM as G,rt as ye,GE as Se,xa as ge,zT as Ie,Cq as be,D3 as he,DY as De,Mr as Oe,Ms as Te,Mt as ke,Mu as Ce,Mv as Ve,I_ as we,Lt as Ae,Ja as Ne,k2 as _e,fA as ve,fz as Fe,fy as xe,pB as ze,ps as Be,pp as Me,jW as Ee,rC as Pe,rA as R,bB as L,rO as j,cr as Re}from"./zeni-epic-state-D4vGt0eL.js";import{n as Le}from"./mui-CP2KeZRM.js";import{c as U}from"./routePaths-D9iN1cLV.js";import{M as je}from"./MobileAppDrawer-Dr8YUpu7.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new e.Error().stack;d&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[d]="4ba4096b-28fe-49c0-91a8-1fdbbf2cf442",e._sentryDebugIdIdentifier="sentry-dbid-4ba4096b-28fe-49c0-91a8-1fdbbf2cf442")}catch{}})();const Ue=Le.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-CiToer5R.js";import{j as ue,l as la,h as me,g as S,u as ye,k as ge,N as ya,q as mt,n as Jt,o as te}from"./core-DDvaTX37.js";import{eM as ie,br as Be,NX as _a,eR as Se,eS as Ie,eT as Ae,fK as Me,co as ze,NY as $e,NZ as $a,sI as Sa,ju as Ia,N_ as Aa,gy as ca,za as aa,zc as Ga,zd as Ya,jk as Ct,N$ as Ge,y_ as pt,O0 as Xt,O1 as Qt,z1 as wa,O2 as en,Mo as Pa,qU as ht,z7 as Za,gJ as an,O3 as ft,O4 as Ye,bp as tn,O5 as nn,fA as Ta,fz as Fa,zH as rn,fy as va,M4 as sn,O6 as gt,cN as bt,cJ as on,Mn as ua,Ah as cn,O7 as rt,zT as Oa,O8 as yt,Ai as dn,MO as ln,Aj as un,Bd as mn,s2 as Cn,B7 as pn,zs as St,zl as hn,O9 as fn,fM as gn,zB as It,zF as At,fL as bn,Oa as yn,A3 as Et,Ob as Sn,Oc as In,Od as An,zD as kt,zo as Dt,z4 as _t,zx as wt,zv as Pt,zz as En,zb as st,Oe as Tt,Of as xa,zQ as Ea,J3 as Ft,cK as Ka,Og as kn,Oh as Dn,Oi as _n,Oj as wn,zN as Ha,Aa as Pn,A6 as Tn,zJ as Fn,A8 as vn,z_ as On,A0 as xn,Ok as vt,Ag as Ot,GA as Bn,Ol as Ln,Om as Un,On as Rn,Oo as xt,Op as jn,AD as Nn,zS as Bt,zM as da,zR as Vn,Oq as Hn,Or as Mn,yX as zn,Os as Lt,Ot as Ut,Ou as $n,yZ as Gn,yY as ot,Ov as Yn,Ow as Zn,Ox as Kn,I$ as Wn,Oy as Wa,Oz as qn,vy as Rt,k2 as Jn,gz as Xn,AI as Qn,OA as jt,OB as er,AJ as ar,OC as tr,db as nr,sC as rr,Ay as sr,As as xe,bu as or,bC as ir,ct as cr,bD as dr,Ig as lr}from"./zeni-epic-state-D4vGt0eL.js";import{z as Q,j as Ue,n as oe,i as Z,B as Ze,bU as Ba,c3 as ur,r as ve,c4 as mr,c5 as Cr,Z as ma,aI as Fe,s as be,bb as qa,c6 as pr,y as Ca,p as La,h as Ja,d as J,D as Xa,c7 as hr,G as Nt,al as Qa,bn as Qe,c8 as Ma,c9 as fr,x as et,a1 as gr,ca as br,ao as Vt,O as za,J as Ht,f as Mt,cb as yr,cc as Sr,cd as Ir,ce as Ar,cf as Er,o as ka,cg as kr,ch as Dr,ci as ja,Y as _r,cj as wr,ck as Pr,cl as Tr,cm as Fr,a4 as vr}from"./index-Dqto2GR0.js";import{n as _e,D as zt,S as Or}from"./mui-CP2KeZRM.js";import{a as c}from"./sentry-8AfgzGIO.js";import{g as fe,a as pa,b as $t,c as Ee,d as ke,e as Le,f as Re,A as xr,h as at,P as Br,i as tt,s as ea,j as Gt,k as He,l as Yt,m as Lr,n as Zt,p as Ur,S as it}from"./SetupPagesScreen-Dvz8sz6R.js";import Ua from"./NotFoundScreen-B0rK0orf.js";import{M as ha}from"./MobileAppDrawer-XemkX8uu.js";import{u as Kt}from"./useAskAiCfoHostNavButtonProps-c3bUeFHf.js";import{c as Wt}from"./useFetchSuggestedQuestionsWhenReady-Cj4hvcAQ.js";import{v as ct}from"./utils-DVMMWGFG.js";import{t as Rr}from"./AddressScreen-BG3byVa4.js";import"./recharts-CxZa6yMn.js";import"./lottie-BsqqVDQp.js";import"./analytics-DVf_BIp2.js";import"./plaid-_EXcf3jJ.js";import"./dnd-V-MvMUKQ.js";import"./stripe-DMRn4zHo.js";import"./lexical-CxLnVFxa.js";import"./pdf-CZO_R6LN.js";import"./analyticsHelper-BLybaLjV.js";import"./routePaths-kOKVswwv.js";import"./BusinessVerificationPageScreen-XLAagbE1.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]="637d8d30-d5c4-4016-904e-4c27b22beeaa",e._sentryDebugIdIdentifier="sentry-dbid-637d8d30-d5c4-4016-904e-4c27b22beeaa")}catch{}})();function jr(){const e=ue(),{cardId:t}=la(),a=me(),r=Q.getSignedInUser(),n=S(G=>ie(G)),u=Ue(),m=Be(u?.loggedInUserRoleMap),{useFeatureGate:C}=oe();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[I,o]=c.useState(!1),i=S(G=>_a(G).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const D=n.userRole.includes("charge_card_user"),{isFeatureEnabled:A}=C(Z.isChargeCardFeatureEnabled),f=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:B}=C(Z.isDebitCardFeatureEnabled),v=Se(n),k=Ie(n),h=Ae(B,n),b=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,g=Ee({isDebitCardFeatureEnabled:B,isBankingOnlyTenant:h}),l=ke({isCardsOnlyTenant:v,isChargeCardFeatureEnabled:A,isBookKeepingTenant:k,isDebitCardProductVisible:g,chargeCardsCreditAccountLimit:b}),w=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,L=S(G=>Me(G,n.companyId)),j=ze(L.controllers),{creditAccount:T,creditAccountRepayment:P}=S(G=>$e(G)),N=S(G=>G.classListState.fetchState),p=!D&&l&&f,d=S(G=>$a(G,t,p,l)),[_,F]=c.useState(!1),R=d.chargeCard,M=R?.cardCreatedByUser?.userId,W=S(G=>M!=null?Sa(G.userRoleState,M):void 0),y=W?.accountingClassIDs[0],O=S(G=>y!=null?Ia(G.classState,{classId:y,reportId:"class_list"}):void 0),$=R?.cardHolderUser?.userId,U=S(G=>$!=null?Sa(G.userRoleState,$):void 0),Y=U?.accountingClassIDs[0],E=S(G=>Y!=null?Ia(G.classState,{classId:Y,reportId:"class_list"}):void 0),q=R?.type.code==="business_physical_credit_card"||R?.type.code==="business_physical_debit_card",K=R?.type.code==="business_physical_debit_card";c.useEffect(()=>{i&&I===!1&&q&&(o(!0),setTimeout(()=>{a(Aa()),K&&a(ca({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[i,I,q,K]),c.useEffect(()=>{_||d.fetchState==="Completed"||d.fetchState==="In-Progress"||t==null||(F(!0),a(aa(t,p,!1)))},[_,d,t,a]),c.useEffect(()=>{if(d.fetchState==="Completed"&&(q===!1||q&&R?.status?.code!=="active"||R?.cardHolderUserId!==r.userId||i===!1&&I===!1||R?.type.code==="business_physical_debit_card"||R?.type.code==="business_virtual_debit_card")){const G=fe(n.tenantEmailDomain,t,r,R,i);e(G)}},[d.fetchState,i,q]),c.useEffect(()=>{T.fetchState!=="Completed"&&T.fetchState!=="In-Progress"&&l&&f&&m&&a(Ga()),P.fetchState!=="Completed"&&P.fetchState!=="In-Progress"&&l&&f&&m&&a(Ya()),N!=="Completed"&&N!=="In-Progress"&&a(Ct())},[T.fetchState,P.fetchState,a,l,f,m,N]);const z=()=>{if(r!=null&&t!=null){a(Aa());const G=fe(n.tenantEmailDomain,t,r);e(G)}},Ce=R?.type.code==="business_physical_debit_card"||R?.type.code==="business_virtual_debit_card",ae=Le(l,g,w,f),x=pa(l,f,m,T,P),pe=$t(Ce,d);return d.fetchState!=="Completed"?s.jsx(Ze,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(Ba,{showConfetti:i}),s.jsx(ur,{onGotItClick:z,isDebitCard:R?.type.code==="business_physical_debit_card",controllerEmails:j,isChargeCardFeatureEnabled:l,isDebitCardFeatureEnabled:g,isDebitCardSetupEnabled:w,isChargeCardSetupEnabled:f,productInformation:ae,creditAccountInformation:x,debitAccountInformation:pe,chargeCardDetailView:d,creditAccount:T,classListFetchState:N,creditAccountRepayment:P,cardIssuedByRoles:W?.userRoles,cardIssuedByDepartmentName:O?.className,cardHolderRoles:U?.userRoles,cardHolderDepartmentName:E?.className})]})}const Nr=ge(function(e){const t=Ge(e);return{insightsData:t.insight,cashbackByPeriod:t.cashbackByPeriod,uiState:t.uiState,cashbackSummary:t.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(t,a)=>{e(Xt({uiState:{sortKey:t,sortOrder:a}}))}}})(Cr);function Vr(){const e=ue(),t=me(),a=ye(),r=Q.getSignedInUser(),n=S(o=>ie(o)),[u,m]=c.useState(!1),C=S(o=>Ge(o)),I=c.useCallback(()=>{const o=ve(a.state?.pathnameStackToGoBack),i=o.poppedPathname??Hr(n.tenantEmailDomain);e(i,{state:{pathnameStackToGoBack:o.newStack}})},[e,a,n.tenantEmailDomain]);if(c.useEffect(()=>{u||C.fetchState==="Completed"||C.fetchState==="In-Progress"||(m(!0),t(pt()))},[u,C,t]),r==null)throw Error("Can't access cashback detail page without signing in...");return C.fetchState==="In-Progress"?s.jsx(mr,{onBackClick:I}):C.cashbackSummary.cashbackEarned.amount===0&&C.fetchState==="Completed"?s.jsx(Ua,{}):s.jsx(Nr,{onBackClick:I})}const Hr=e=>`/${e}/cards`,Mr={containerWidth:new Ca(100,58)},zr=({appContent:e})=>{const t=ma(),a=me(),r=ue(),{cardId:n}=la(),u=ye(),{useDynamicConfig:m}=oe(),[C,I]=c.useState(!1),[o,i]=c.useState(!1),[D,A]=c.useState(!1),[f,B]=c.useState(!1),v=Q.getSignedInUser();if(v==null)throw Error("Can't access onboarding card page without signing in...");const k=S(E=>ie(E));if(n==null)throw Error("Empty card id is not valid...");const{configValue:h}=m(Fe.zeniCardsConfig),b=h.max_charge_card_activation_attempts_by_card_id,g=S(E=>Qt(E,n)),l=g.chargeCard,w=S(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:L}=oe(),{isFeatureEnabled:j}=L(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:T}=L(Z.isDebitCardFeatureEnabled),P=Ae(T,k),N=Ee({isDebitCardFeatureEnabled:T,isBankingOnlyTenant:P}),p=!!k.companyChargeCardInfo?.info?.isChargeCardEnabled,d=k.userRole.includes("charge_card_user"),_=Se(k),F=Ie(k),R=k.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,M=ke({isCardsOnlyTenant:_,isChargeCardFeatureEnabled:j,isBookKeepingTenant:F,isDebitCardProductVisible:N,chargeCardsCreditAccountLimit:R}),W=!d&&M&&p;c.useEffect(()=>{C===!1&&w!=="In-Progress"&&w!=="Completed"&&(a(wa()),I(!0)),o===!1&&g.fetchState==="Not-Started"&&(i(!0),a(aa(n,W,M)))},[o,g.fetchState,C,w]);const y=l?.type.code==="business_physical_credit_card"||l?.type.code==="business_physical_debit_card";c.useEffect(()=>{if(g.fetchState==="Completed"){if(D===!1&&(y===!1||y&&l?.status?.code!=="inactive"||l?.cardHolderUserId!==v.userId)){const E=fe(k.tenantEmailDomain,n,v,l,!0),q=be(u.state?.pathnameStackToGoBack,u.pathname);r(E,{state:{pathnameStackToGoBack:q}})}else if(D&&g.isRefreshingViewInBackground===!1&&l?.status?.code==="active"){a(en({chargeCardId:n}));const E=fe(k.tenantEmailDomain,n,v,l,!0),q=be(u.state?.pathnameStackToGoBack,u.pathname);a(Pa()),r(E,{state:{pathnameStackToGoBack:q}})}}},[g.fetchState,l?.type.code,D,g.isRefreshingViewInBackground]);const O=Q.getZeniOtpTokenForCardHolder(n),$=S(E=>ht(E.userState,v.userId)),U=()=>{l?.status?.code!=="active"&&a(Za(n,!0))};c.useEffect(()=>{g.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&l?.cardActivationAttemptHistory.some(E=>E.statusCode==="success")===!0&&D===!1&&(setTimeout(U,3e3),A(!0))},[g.updatePhysicalChargeCardAttemptFetchState.fetchState,l?.cardActivationAttemptHistory]);const Y=E=>{B(E)};if(w!=="Completed"||l==null)return s.jsx(Ze,{fetchState:"In-Progress"});if(l.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if($?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Yr,{children:[s.jsx(ha,{isAppContentDrawerOpen:f,handleDrawerToggle:Y}),s.jsx($r,{cardId:n,card:l,shippingAddressId:l.shippingAddressId,phone:$.phone,signedInUser:v,isSandboxEnv:qa(),chargeCardDetailState:g,signedInUserToken:O,navigate:r,currentTenant:k,location:u,maxChargeCardActivationAttempts:b[n]!=null?b[n]:h.default_max_charge_card_activation_attempts!=null?h.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{Y(!0)}}),e!=null?s.jsx(Gr,{windowSize:t,children:e}):null]})},$r=ge(function(e,{chargeCardDetailState:t,shippingAddressId:a,location:r,cardId:n}){const u=an(e.addressState,a);if(u==null)throw Error("Can't access shippingAddress.");const m=ft(e,n),C=t.updateStatus,I=Ye(e,!1,!1,!1);let o=!1;I.fetchState==="Completed"&&I.cards.length<=1&&(o=!0);const i=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:t.chargeCard?.providerCardCreateTime!=null&&t.chargeCard.providerCardCreateTime.add(24,"h").isBefore(tn())||i,showMenuIcon:o,shippingAddress:u,vgsVaultId:La.cardVaultId,twoFAView:m,activationWaitStatus:C,isRefreshingViewInBackground:t.isRefreshingViewInBackground}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:u,chargeCardDetailState:m}=t,C=m.chargeCard?.cardProviderID,{tenantEmailDomain:I}=u;return{onGetOtp:o=>{C!=null&&e(va(o,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:o=>{e(rn(r,o))},onResendOtp:o=>{C!=null&&e(Fa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,i)=>{C!=null&&e(Ta(o,i,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&Q.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(nn({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),i=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Re(I):o.poppedPathname;a(i,{state:{pathnameStackToGoBack:o.newStack}})}}})(pr),Gr=_e.div`
|
|
1
|
+
import{j as s}from"./liveblocks-CiToer5R.js";import{j as ue,l as la,h as me,g as S,u as ye,k as ge,N as ya,q as mt,n as Jt,o as te}from"./core-DDvaTX37.js";import{eM as ie,br as Be,NX as _a,eR as Se,eS as Ie,eT as Ae,fK as Me,co as ze,NY as $e,NZ as $a,sI as Sa,ju as Ia,N_ as Aa,gy as ca,za as aa,zc as Ga,zd as Ya,jk as Ct,N$ as Ge,y_ as pt,O0 as Xt,O1 as Qt,z1 as wa,O2 as en,Mo as Pa,qU as ht,z7 as Za,gJ as an,O3 as ft,O4 as Ye,bp as tn,O5 as nn,fA as Ta,fz as Fa,zH as rn,fy as va,M4 as sn,O6 as gt,cN as bt,cJ as on,Mn as ua,Ah as cn,O7 as rt,zT as Oa,O8 as yt,Ai as dn,MO as ln,Aj as un,Bd as mn,s2 as Cn,B7 as pn,zs as St,zl as hn,O9 as fn,fM as gn,zB as It,zF as At,fL as bn,Oa as yn,A3 as Et,Ob as Sn,Oc as In,Od as An,zD as kt,zo as Dt,z4 as _t,zx as wt,zv as Pt,zz as En,zb as st,Oe as Tt,Of as xa,zQ as Ea,J3 as Ft,cK as Ka,Og as kn,Oh as Dn,Oi as _n,Oj as wn,zN as Ha,Aa as Pn,A6 as Tn,zJ as Fn,A8 as vn,z_ as On,A0 as xn,Ok as vt,Ag as Ot,GA as Bn,Ol as Ln,Om as Un,On as Rn,Oo as xt,Op as jn,AD as Nn,zS as Bt,zM as da,zR as Vn,Oq as Hn,Or as Mn,yX as zn,Os as Lt,Ot as Ut,Ou as $n,yZ as Gn,yY as ot,Ov as Yn,Ow as Zn,Ox as Kn,I$ as Wn,Oy as Wa,Oz as qn,vy as Rt,k2 as Jn,gz as Xn,AI as Qn,OA as jt,OB as er,AJ as ar,OC as tr,db as nr,sC as rr,Ay as sr,As as xe,bu as or,bC as ir,ct as cr,bD as dr,Ig as lr}from"./zeni-epic-state-D4vGt0eL.js";import{z as Q,j as Ue,n as oe,i as Z,B as Ze,bU as Ba,c3 as ur,r as ve,c4 as mr,c5 as Cr,Z as ma,aI as Fe,s as be,bb as qa,c6 as pr,y as Ca,p as La,h as Ja,d as J,D as Xa,c7 as hr,G as Nt,al as Qa,bn as Qe,c8 as Ma,c9 as fr,x as et,a1 as gr,ca as br,ao as Vt,O as za,J as Ht,f as Mt,cb as yr,cc as Sr,cd as Ir,ce as Ar,cf as Er,o as ka,cg as kr,ch as Dr,ci as ja,Y as _r,cj as wr,ck as Pr,cl as Tr,cm as Fr,a4 as vr}from"./index-DnJYpNVb.js";import{n as _e,D as zt,S as Or}from"./mui-CP2KeZRM.js";import{a as c}from"./sentry-8AfgzGIO.js";import{g as fe,a as pa,b as $t,c as Ee,d as ke,e as Le,f as Re,A as xr,h as at,P as Br,i as tt,s as ea,j as Gt,k as He,l as Yt,m as Lr,n as Zt,p as Ur,S as it}from"./SetupPagesScreen-CVBxCxe5.js";import Ua from"./NotFoundScreen-LHqD0vPk.js";import{M as ha}from"./MobileAppDrawer-Dr8YUpu7.js";import{u as Kt}from"./useAskAiCfoHostNavButtonProps-DKLQyfUj.js";import{c as Wt}from"./useFetchSuggestedQuestionsWhenReady-B1Y3Jjir.js";import{v as ct}from"./utils-DVMMWGFG.js";import{t as Rr}from"./AddressScreen-Dmce3A5k.js";import"./recharts-CxZa6yMn.js";import"./lottie-BsqqVDQp.js";import"./analytics-DVf_BIp2.js";import"./plaid-_EXcf3jJ.js";import"./dnd-V-MvMUKQ.js";import"./stripe-DMRn4zHo.js";import"./lexical-CxLnVFxa.js";import"./pdf-CZO_R6LN.js";import"./analyticsHelper-CeoHmyKo.js";import"./routePaths-D9iN1cLV.js";import"./BusinessVerificationPageScreen-ZnINyDEr.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]="637d8d30-d5c4-4016-904e-4c27b22beeaa",e._sentryDebugIdIdentifier="sentry-dbid-637d8d30-d5c4-4016-904e-4c27b22beeaa")}catch{}})();function jr(){const e=ue(),{cardId:t}=la(),a=me(),r=Q.getSignedInUser(),n=S(G=>ie(G)),u=Ue(),m=Be(u?.loggedInUserRoleMap),{useFeatureGate:C}=oe();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[I,o]=c.useState(!1),i=S(G=>_a(G).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const D=n.userRole.includes("charge_card_user"),{isFeatureEnabled:A}=C(Z.isChargeCardFeatureEnabled),f=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:B}=C(Z.isDebitCardFeatureEnabled),v=Se(n),k=Ie(n),h=Ae(B,n),b=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,g=Ee({isDebitCardFeatureEnabled:B,isBankingOnlyTenant:h}),l=ke({isCardsOnlyTenant:v,isChargeCardFeatureEnabled:A,isBookKeepingTenant:k,isDebitCardProductVisible:g,chargeCardsCreditAccountLimit:b}),w=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,L=S(G=>Me(G,n.companyId)),j=ze(L.controllers),{creditAccount:T,creditAccountRepayment:P}=S(G=>$e(G)),N=S(G=>G.classListState.fetchState),p=!D&&l&&f,d=S(G=>$a(G,t,p,l)),[_,F]=c.useState(!1),R=d.chargeCard,M=R?.cardCreatedByUser?.userId,W=S(G=>M!=null?Sa(G.userRoleState,M):void 0),y=W?.accountingClassIDs[0],O=S(G=>y!=null?Ia(G.classState,{classId:y,reportId:"class_list"}):void 0),$=R?.cardHolderUser?.userId,U=S(G=>$!=null?Sa(G.userRoleState,$):void 0),Y=U?.accountingClassIDs[0],E=S(G=>Y!=null?Ia(G.classState,{classId:Y,reportId:"class_list"}):void 0),q=R?.type.code==="business_physical_credit_card"||R?.type.code==="business_physical_debit_card",K=R?.type.code==="business_physical_debit_card";c.useEffect(()=>{i&&I===!1&&q&&(o(!0),setTimeout(()=>{a(Aa()),K&&a(ca({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[i,I,q,K]),c.useEffect(()=>{_||d.fetchState==="Completed"||d.fetchState==="In-Progress"||t==null||(F(!0),a(aa(t,p,!1)))},[_,d,t,a]),c.useEffect(()=>{if(d.fetchState==="Completed"&&(q===!1||q&&R?.status?.code!=="active"||R?.cardHolderUserId!==r.userId||i===!1&&I===!1||R?.type.code==="business_physical_debit_card"||R?.type.code==="business_virtual_debit_card")){const G=fe(n.tenantEmailDomain,t,r,R,i);e(G)}},[d.fetchState,i,q]),c.useEffect(()=>{T.fetchState!=="Completed"&&T.fetchState!=="In-Progress"&&l&&f&&m&&a(Ga()),P.fetchState!=="Completed"&&P.fetchState!=="In-Progress"&&l&&f&&m&&a(Ya()),N!=="Completed"&&N!=="In-Progress"&&a(Ct())},[T.fetchState,P.fetchState,a,l,f,m,N]);const z=()=>{if(r!=null&&t!=null){a(Aa());const G=fe(n.tenantEmailDomain,t,r);e(G)}},Ce=R?.type.code==="business_physical_debit_card"||R?.type.code==="business_virtual_debit_card",ae=Le(l,g,w,f),x=pa(l,f,m,T,P),pe=$t(Ce,d);return d.fetchState!=="Completed"?s.jsx(Ze,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(Ba,{showConfetti:i}),s.jsx(ur,{onGotItClick:z,isDebitCard:R?.type.code==="business_physical_debit_card",controllerEmails:j,isChargeCardFeatureEnabled:l,isDebitCardFeatureEnabled:g,isDebitCardSetupEnabled:w,isChargeCardSetupEnabled:f,productInformation:ae,creditAccountInformation:x,debitAccountInformation:pe,chargeCardDetailView:d,creditAccount:T,classListFetchState:N,creditAccountRepayment:P,cardIssuedByRoles:W?.userRoles,cardIssuedByDepartmentName:O?.className,cardHolderRoles:U?.userRoles,cardHolderDepartmentName:E?.className})]})}const Nr=ge(function(e){const t=Ge(e);return{insightsData:t.insight,cashbackByPeriod:t.cashbackByPeriod,uiState:t.uiState,cashbackSummary:t.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(t,a)=>{e(Xt({uiState:{sortKey:t,sortOrder:a}}))}}})(Cr);function Vr(){const e=ue(),t=me(),a=ye(),r=Q.getSignedInUser(),n=S(o=>ie(o)),[u,m]=c.useState(!1),C=S(o=>Ge(o)),I=c.useCallback(()=>{const o=ve(a.state?.pathnameStackToGoBack),i=o.poppedPathname??Hr(n.tenantEmailDomain);e(i,{state:{pathnameStackToGoBack:o.newStack}})},[e,a,n.tenantEmailDomain]);if(c.useEffect(()=>{u||C.fetchState==="Completed"||C.fetchState==="In-Progress"||(m(!0),t(pt()))},[u,C,t]),r==null)throw Error("Can't access cashback detail page without signing in...");return C.fetchState==="In-Progress"?s.jsx(mr,{onBackClick:I}):C.cashbackSummary.cashbackEarned.amount===0&&C.fetchState==="Completed"?s.jsx(Ua,{}):s.jsx(Nr,{onBackClick:I})}const Hr=e=>`/${e}/cards`,Mr={containerWidth:new Ca(100,58)},zr=({appContent:e})=>{const t=ma(),a=me(),r=ue(),{cardId:n}=la(),u=ye(),{useDynamicConfig:m}=oe(),[C,I]=c.useState(!1),[o,i]=c.useState(!1),[D,A]=c.useState(!1),[f,B]=c.useState(!1),v=Q.getSignedInUser();if(v==null)throw Error("Can't access onboarding card page without signing in...");const k=S(E=>ie(E));if(n==null)throw Error("Empty card id is not valid...");const{configValue:h}=m(Fe.zeniCardsConfig),b=h.max_charge_card_activation_attempts_by_card_id,g=S(E=>Qt(E,n)),l=g.chargeCard,w=S(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:L}=oe(),{isFeatureEnabled:j}=L(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:T}=L(Z.isDebitCardFeatureEnabled),P=Ae(T,k),N=Ee({isDebitCardFeatureEnabled:T,isBankingOnlyTenant:P}),p=!!k.companyChargeCardInfo?.info?.isChargeCardEnabled,d=k.userRole.includes("charge_card_user"),_=Se(k),F=Ie(k),R=k.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,M=ke({isCardsOnlyTenant:_,isChargeCardFeatureEnabled:j,isBookKeepingTenant:F,isDebitCardProductVisible:N,chargeCardsCreditAccountLimit:R}),W=!d&&M&&p;c.useEffect(()=>{C===!1&&w!=="In-Progress"&&w!=="Completed"&&(a(wa()),I(!0)),o===!1&&g.fetchState==="Not-Started"&&(i(!0),a(aa(n,W,M)))},[o,g.fetchState,C,w]);const y=l?.type.code==="business_physical_credit_card"||l?.type.code==="business_physical_debit_card";c.useEffect(()=>{if(g.fetchState==="Completed"){if(D===!1&&(y===!1||y&&l?.status?.code!=="inactive"||l?.cardHolderUserId!==v.userId)){const E=fe(k.tenantEmailDomain,n,v,l,!0),q=be(u.state?.pathnameStackToGoBack,u.pathname);r(E,{state:{pathnameStackToGoBack:q}})}else if(D&&g.isRefreshingViewInBackground===!1&&l?.status?.code==="active"){a(en({chargeCardId:n}));const E=fe(k.tenantEmailDomain,n,v,l,!0),q=be(u.state?.pathnameStackToGoBack,u.pathname);a(Pa()),r(E,{state:{pathnameStackToGoBack:q}})}}},[g.fetchState,l?.type.code,D,g.isRefreshingViewInBackground]);const O=Q.getZeniOtpTokenForCardHolder(n),$=S(E=>ht(E.userState,v.userId)),U=()=>{l?.status?.code!=="active"&&a(Za(n,!0))};c.useEffect(()=>{g.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&l?.cardActivationAttemptHistory.some(E=>E.statusCode==="success")===!0&&D===!1&&(setTimeout(U,3e3),A(!0))},[g.updatePhysicalChargeCardAttemptFetchState.fetchState,l?.cardActivationAttemptHistory]);const Y=E=>{B(E)};if(w!=="Completed"||l==null)return s.jsx(Ze,{fetchState:"In-Progress"});if(l.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if($?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Yr,{children:[s.jsx(ha,{isAppContentDrawerOpen:f,handleDrawerToggle:Y}),s.jsx($r,{cardId:n,card:l,shippingAddressId:l.shippingAddressId,phone:$.phone,signedInUser:v,isSandboxEnv:qa(),chargeCardDetailState:g,signedInUserToken:O,navigate:r,currentTenant:k,location:u,maxChargeCardActivationAttempts:b[n]!=null?b[n]:h.default_max_charge_card_activation_attempts!=null?h.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{Y(!0)}}),e!=null?s.jsx(Gr,{windowSize:t,children:e}):null]})},$r=ge(function(e,{chargeCardDetailState:t,shippingAddressId:a,location:r,cardId:n}){const u=an(e.addressState,a);if(u==null)throw Error("Can't access shippingAddress.");const m=ft(e,n),C=t.updateStatus,I=Ye(e,!1,!1,!1);let o=!1;I.fetchState==="Completed"&&I.cards.length<=1&&(o=!0);const i=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:t.chargeCard?.providerCardCreateTime!=null&&t.chargeCard.providerCardCreateTime.add(24,"h").isBefore(tn())||i,showMenuIcon:o,shippingAddress:u,vgsVaultId:La.cardVaultId,twoFAView:m,activationWaitStatus:C,isRefreshingViewInBackground:t.isRefreshingViewInBackground}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:u,chargeCardDetailState:m}=t,C=m.chargeCard?.cardProviderID,{tenantEmailDomain:I}=u;return{onGetOtp:o=>{C!=null&&e(va(o,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:o=>{e(rn(r,o))},onResendOtp:o=>{C!=null&&e(Fa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,i)=>{C!=null&&e(Ta(o,i,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&Q.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(nn({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),i=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Re(I):o.poppedPathname;a(i,{state:{pathnameStackToGoBack:o.newStack}})}}})(pr),Gr=_e.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
width: ${e=>`${Mr.containerWidth.value(e.windowSize)}%`};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as m}from"./liveblocks-CiToer5R.js";import{a as g}from"./sentry-8AfgzGIO.js";import{j as w,h as x,u as k,l as T,g as O,k as E}from"./core-DDvaTX37.js";import{z as N,aZ as F,x as P,d as L,f as V,aa as b,a_ as j,ao as A,ap as B,s as U}from"./index-
|
|
1
|
+
import{j as m}from"./liveblocks-CiToer5R.js";import{a as g}from"./sentry-8AfgzGIO.js";import{j as w,h as x,u as k,l as T,g as O,k as E}from"./core-DDvaTX37.js";import{z as N,aZ as F,x as P,d as L,f as V,aa as b,a_ as j,ao as A,ap as B,s as U}from"./index-DnJYpNVb.js";import{eM as D,fC as M,rt as _,fx as R,b$ as z,Lt as G,bm as Y,pB as Z,pp as $,jW as q,lq as S,Lu as H,bB as W,cr as C,ly as J,lB as K}from"./zeni-epic-state-D4vGt0eL.js";import"./mui-CP2KeZRM.js";import{c as Q}from"./routePaths-D9iN1cLV.js";import{M as X}from"./MobileAppDrawer-Dr8YUpu7.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new a.Error().stack;n&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[n]="be98c0fd-c7ff-44ba-9003-39b20d48e144",a._sentryDebugIdIdentifier="sentry-dbid-be98c0fd-c7ff-44ba-9003-39b20d48e144")}catch{}})();const ee=E(function(a){const n=R(a),i=N.getSignedInUser(),l=D(a),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=z(l?.userRole??[])&&n.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=G(a.companyConfigState),t=a.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:n.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:n,allIndustries:e.companyIndustries??[],allNationalityCountries:t,isDisabled:f,authParams:p,filesEndPoint:`${A.fileMicroServiceBaseUrl}`,isZeniUser:Y(i)}},function(a,n){const{companyId:i,currentTenant:l,navigate:c,location:p}=n,{tenantEmailDomain:f}=l;return{onScheduleClick:e=>{let t=e.href;t.includes("http")||(t="https://".concat(t)),window.open(t,"_blank")},onSaveAll:()=>{a(K())},onAddressClick:e=>{const t=Q(f,e),o=U(p.state?.pathnameStackToGoBack,p.pathname);c(t,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{a(J({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:t,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=t,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:h}=r,v={companyInfo:{...t,website:u!=""&&u!=null?C(u):void 0,meetingLink:y!=""&&y!=null?C(y):void 0,industry:t.industry.selectedOption,companyIndustryType:t.companyIndustryType?.selectedOption??void 0,companySubIndustry:t.subIndustry?.selectedOption??void 0,businessModel:t.businessModel.selectedOption??"",companySourceOfFunds:t.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:t.companySourceOfFundsDescription??void 0,countriesOfOperations:t.countriesOfOperations?.selectedOptions?.map(I=>I.length===2?I:B(I))??[],transactionVolume:t.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:t.transactionVolumeDescription??void 0,regulatedStatus:t.regulatedStatus??void 0,regulatedStatusDescription:t.regulatedStatusDescription??void 0,usNexus:t.usNexus??void 0,usNexusTypes:t.usNexusTypes?.selectedOptions??[],purposeOfAccount:t.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:t.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?W(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]}};a(S({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{a(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{a(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=>{a(H(e))},onCompanyOfficerUpdated:e=>{a(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=>{a(q({files:e}))},onDeleteFile:e=>{a($(e))},onEditFileName:(e,t)=>{a(Z(e,t.split(".")[0]))}}})(j);function de(){const a=w(),n=x(),i=k(),{tenantEmailDomain:l}=T(),[c,p]=g.useState(!1),[f,e]=g.useState(!1),t=O(s=>s.companyViewState.passportView.fetchState),o=O(s=>s.companyConfigState.fetchState),r=O(s=>D(s)),d=r.companyId??N.getSignedInUserTenant(l)?.companyId;if(N.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||t!=="Not-Started"||d==null||(p(!0),n(M(d)))},[c,t,d,n]),g.useEffect(()=>{o==="Not-Started"&&n(_())},[o,n]);const u=s=>{e(s)},y=t==="Not-Started"||t==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&t==="Error"?m.jsx(F,{onGoHome:()=>a("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(P,{analytics:L,onLoad:s=>s.trackPageLoaded(V.Event.companyPassport,b(i)?"Settings":"Company Passport")}),b(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:a,location:i,isLoading:y,currentTenant:r,isSettings:b(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as C}from"./liveblocks-CiToer5R.js";import{a}from"./sentry-8AfgzGIO.js";import{h as D,u as v,g as m,N as w}from"./core-DDvaTX37.js";import{Ic as A,eM as O,fj as _,mh as j,fJ as b,fi as U,eN as L,Ik as k}from"./zeni-epic-state-D4vGt0eL.js";import{u as F,z as u,L as g,D as $,o as H}from"./index-
|
|
1
|
+
import{j as C}from"./liveblocks-CiToer5R.js";import{a}from"./sentry-8AfgzGIO.js";import{h as D,u as v,g as m,N as w}from"./core-DDvaTX37.js";import{Ic as A,eM as O,fj as _,mh as j,fJ as b,fi as U,eN as L,Ik as k}from"./zeni-epic-state-D4vGt0eL.js";import{u as F,z as u,L as g,D as $,o as H}from"./index-DnJYpNVb.js";import{n as z}from"./mui-CP2KeZRM.js";import{t as R}from"./getLocaleForTenant-DU8HEeVi.js";import{g as P,Q as G}from"./QBOConnectionScreen-DK9wxn3B.js";import"./recharts-CxZa6yMn.js";import"./lottie-BsqqVDQp.js";import"./analytics-DVf_BIp2.js";import"./plaid-_EXcf3jJ.js";import"./dnd-V-MvMUKQ.js";import"./stripe-DMRn4zHo.js";import"./lexical-CxLnVFxa.js";import"./pdf-CZO_R6LN.js";import"./utils-DVMMWGFG.js";import"./empty-BH3HNirl.js";import"./pdf-lib-DHbUCXaf.js";import"./index-Dw_Cve7-.js";import"./url-DV5smE06.js";import"./index-DVaIp1ct.js";import"./decodeURIComponentSafe-CFMDmh9m.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]="0b123673-fd7f-4059-bf31-bb5ce4328808",t._sentryDebugIdIdentifier="sentry-dbid-0b123673-fd7f-4059-bf31-bb5ce4328808")}catch{}})();const J=z.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex: 1 1 auto;
|
|
4
4
|
flex-direction: row;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as i}from"./liveblocks-CiToer5R.js";import{z as m}from"./index-
|
|
1
|
+
import{j as i}from"./liveblocks-CiToer5R.js";import{z as m}from"./index-DnJYpNVb.js";import{g as n}from"./QBOConnectionScreen-DK9wxn3B.js";import"./sentry-8AfgzGIO.js";import{u as p,N as a}from"./core-DDvaTX37.js";import"./zeni-epic-state-D4vGt0eL.js";import"./recharts-CxZa6yMn.js";import"./mui-CP2KeZRM.js";import"./lottie-BsqqVDQp.js";import"./analytics-DVf_BIp2.js";import"./plaid-_EXcf3jJ.js";import"./dnd-V-MvMUKQ.js";import"./stripe-DMRn4zHo.js";import"./lexical-CxLnVFxa.js";import"./pdf-CZO_R6LN.js";import"./utils-DVMMWGFG.js";import"./empty-BH3HNirl.js";import"./pdf-lib-DHbUCXaf.js";import"./index-Dw_Cve7-.js";import"./url-DV5smE06.js";import"./index-DVaIp1ct.js";import"./decodeURIComponentSafe-CFMDmh9m.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]="34360189-ad08-40f6-93e1-76035a2c6a6d",t._sentryDebugIdIdentifier="sentry-dbid-34360189-ad08-40f6-93e1-76035a2c6a6d")}catch{}})();const U=()=>{const t=p(),{code:o,realmId:r,state:e}=n(t.search),s=m.getSignedInUser()?.userId??"";if(f(o,r,e,s)===!0){const d=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return i.jsx(a,{to:d})}return i.jsx(a,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
|
package/dist/assets/{CustomerOnboardingRoutes-BwLNXu73.js → CustomerOnboardingRoutes-Di5fRx2F.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-CiToer5R.js";import{t as $e,A as Ce}from"./AddressScreen-
|
|
1
|
+
import{j as a}from"./liveblocks-CiToer5R.js";import{t as $e,A as Ce}from"./AddressScreen-Dmce3A5k.js";import ze from"./NotFoundScreen-LHqD0vPk.js";import{a as g}from"./sentry-8AfgzGIO.js";import{j as oe,u as se,h as ie,l as re,g as D,N as E,k as ce,i as Me,n as Qe,o as M}from"./core-DDvaTX37.js";import{Y as de,j as le,z as B,n as ue,h as qe,i as _,s as V,x as Y,d as N,B as je,f as W,ak as Je,Z as Ke,al as Ie,p as te,am as Ze,an as ke,o as Ye,ao as He,ap as Ee,aq as We}from"./index-DnJYpNVb.js";import{bm as Xe,eM as ee,fb as et,eT as pe,eR as me,bu as tt,mf as at,f7 as nt,bL as ot,i_ as ae,j1 as ve,IY as st,bQ as it,b$ as ge,rH as fe,rs as rt,J8 as X,rI as _e,GE as ct,k2 as Ue,J9 as Ve,Ja as dt,Jb as lt,Jc as ut,iY as pt,i$ as mt,ru as Be,rG as gt,bB as Te,cr as ft,rU as xe,pB as ht,pp as yt,jW as bt,fA as St,fz as Ct,fy as It,Jd as kt,rm as Et,rV as Tt,rY as xt,r$ as Ot,s5 as Pt,cR as At}from"./zeni-epic-state-D4vGt0eL.js";import{n as he}from"./mui-CP2KeZRM.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-DK9wxn3B.js";import"./recharts-CxZa6yMn.js";import"./lottie-BsqqVDQp.js";import"./analytics-DVf_BIp2.js";import"./plaid-_EXcf3jJ.js";import"./dnd-V-MvMUKQ.js";import"./stripe-DMRn4zHo.js";import"./lexical-CxLnVFxa.js";import"./pdf-CZO_R6LN.js";import"./utils-DVMMWGFG.js";import"./empty-BH3HNirl.js";import"./pdf-lib-DHbUCXaf.js";import"./index-Dw_Cve7-.js";import"./url-DV5smE06.js";import"./index-DVaIp1ct.js";import"./decodeURIComponentSafe-CFMDmh9m.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]="bf4c7c96-1436-4e68-ab3e-fc497b30ea92",t._sentryDebugIdIdentifier="sentry-dbid-bf4c7c96-1436-4e68-ab3e-fc497b30ea92")}catch{}})();const wt=ce(function(t,o){const s=[];o.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),o.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),o.shouldFetchZeniAccountsPromoCard===!1&&s.push("zeni_accounts_promo_card"),o.shouldFetchRewardsPlanCard===!1&&s.push("rewards_card"),o.isExpenseAutomationEnabledForUser===!1&&s.push("expense_automation_card");const u=nt(t,s,o.signedInUser,o.isExpenseAutomationFeatureEnabledV2,o.isExpenseAutomationEnabledForUser,o.isTreasuryEnabled);return{dashboardFetchState:ot(u.reportsInOrder.map(d=>({fetchState:d.fetchState,error:d.error}))).fetchState}},function(t,o){const{themeState:s,navigate:u,location:d}=o;return{onZeniLogoClick:()=>{s.toggle()},onDashboardFetchDone:()=>{const r=V(d.state?.pathnameStackToGoBack,d.pathname);u("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Je),jt=()=>{const t=oe(),o=se(),s=ie(),u=de(),[d,r]=g.useState(!1),[p,b]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),f=Xe(i),{useFeatureGate:m}=ue(),k=qe(),{isFeatureEnabled:T}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:x}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:I}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:h}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),$=C||U&&f,c=D(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),w=c.company!=null&&et(c.company),R=L&&w,O=D(l=>l.onboardingCustomerViewState.fetchState),S=c.excludedResources,G=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const j=pe(F,c),P=me(c),A=[],J=S?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,z=S?.resources?.find(l=>l.resource==="/reports/task_card")==null,Q=c?.userRole!=null&&tt(c?.userRole),v=S?.resources?.find(l=>l.resource==="/bills")==null&&!Q,q=S?.resources?.find(l=>l.resource==="/reimbursements")==null;if(J===!1&&A.push("top_expenses"),z===!1&&A.push("task_card"),v===!1&&A.push("bill_pay_card","bill_pay_promo_card"),q===!1&&A.push("reimbursement_card","reimbursement_promo_card"),I===!1&&A.push("zeni_accounts_promo_card"),h===!1&&A.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||j||P||(r(!0),s(at(i.userId,G,c.tenantId,!0,!1,A)))},[d,O,j,P,i,c.tenantId,s]),g.useEffect(()=>{(j||P)&&setTimeout(()=>{b(!0)},5e3)},[j,P]),O!=="Completed")return a.jsx(E,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(j)return a.jsx(E,{to:"../../checking",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}});if(P)return a.jsx(E,{to:"../../cards",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(Y,{analytics:N,onLoad:l=>(K=>K.trackPageLoaded(W.Event.onboardingDashboardActivation))(l)}),a.jsx(wt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:T,isArAgingFeatureEnabled:x,shouldFetchZeniAccountsPromoCard:I,shouldFetchRewardsPlanCard:h,isExpenseAutomationEnabledForUser:$,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:R,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(je,{fetchState:"In-Progress",style:{backgroundColor:k.colors.grey5}})},Oe=he.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 i}from"./liveblocks-CiToer5R.js";import{l as G,g as k,u as $,h as K,j as q,k as Z,n as We,o as D}from"./core-DDvaTX37.js";import{eM as j,Jt as Fe,bB as Ut,bp as de,KG as Ka,hO as Na,KH as Tt,KI as Ga,hR as Qe,KJ as we,KK as za,hW as $a,KL as wt,KM as qa,h_ as et,KN as xe,KO as Za,cN as at,KP as Ha,KQ as Ja,JN as Xa,iU as Wa,KR as Qa,bm as _e,KS as Yt,Jh as Q,bc as Vt,j6 as Kt,mp as Nt,iR as Gt,Jj as ee,Ji as z,KT as en,KU as tn,KV as zt,KW as pe,tx as ke,ty as ye,tV as ue,tP as te,tC as Se,KX as an,KY as nn,KZ as on,K_ as $t,K$ as he,L0 as sn,dF as Oe,q9 as qt,L1 as rn,L2 as cn,L3 as ln,L4 as nt,IE as ot,jm as st,u1 as rt,qh as dn,L5 as un,tz as xt,qc as ie,q8 as Zt,L6 as oe,L7 as mn,L8 as ct,ID as it,s9 as Ht,L9 as pn,La as hn,Lb as fn,Lc as lt,sm as gn,Ld as bn,tB as Dt,s8 as Jt,Le as se,Lf as Cn,bu as Xt,u5 as Wt,Lg as _n,Lh as kn,Li as yn,Lj as dt,u0 as Sn,Lk as vn,tA as Ft,u4 as Qt,Ll as re,Lm as In,Ln as An,Lo as ea,jb as ta,mm as aa,jg as na,mk as oa,mj as sa,mi as ra,rx as En,fb as Tn,cK as wn,cL as xn,mf as Dn,f7 as Fn,mv as On,Lp as Pn,D9 as Bn,Lq as Rn,Lr as jn,Ls as Ln,b5 as ut,eZ as Mn,gw as Un,fC as Yn,mq as Vn,iK as Kn,mn as Nn,ml as Gn,eT as zn,eR as $n}from"./zeni-epic-state-D4vGt0eL.js";import{z as B,O as H,s as F,d as S,D as N,aP as qn,G as Pe,x as ve,aQ as ca,f as Y,aR as Zn,j as Ie,aS as ia,n as mt,i as L,h as Hn,aT as Jn,aU as Xn,aV as Ae,aW as Wn,a as Qn,al as eo,aI as to,r as ao,J as no,aX as oo,aY as ge}from"./index-Dqto2GR0.js";import{n as pt}from"./mui-CP2KeZRM.js";import{a as _}from"./sentry-8AfgzGIO.js";import{w as la}from"./withTransactionSidePanel-BhvaYyJw.js";import{b as da,t as me,e as ae,a as ht,v as so}from"./routePaths-kOKVswwv.js";import{u as Be}from"./useAskAiCfoHostNavButtonProps-c3bUeFHf.js";import{c as Re}from"./useFetchSuggestedQuestionsWhenReady-Cj4hvcAQ.js";import Ce from"./NotFoundScreen-B0rK0orf.js";import{t as ua}from"./analyticsHelper-BLybaLjV.js";import{C as ro}from"./CompanyPassportScreen-BfpIrB4f.js";import{F as co}from"./FeaturePreviewScreen-e6Ei2TQP.js";import{R as io}from"./ReferralListScreen-DujIrxLU.js";import"./recharts-CxZa6yMn.js";import"./lottie-BsqqVDQp.js";import"./analytics-DVf_BIp2.js";import"./plaid-_EXcf3jJ.js";import"./dnd-V-MvMUKQ.js";import"./stripe-DMRn4zHo.js";import"./lexical-CxLnVFxa.js";import"./pdf-CZO_R6LN.js";import"./utils-DVMMWGFG.js";import"./TransactionDetailScreen-DnWD4Kai.js";import"./decodeURIComponentSafe-CFMDmh9m.js";import"./MobileAppDrawer-XemkX8uu.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]="24ce2be4-3a9b-4d16-b7c6-1a6ba0d9fb13",e._sentryDebugIdIdentifier="sentry-dbid-24ce2be4-3a9b-4d16-b7c6-1a6ba0d9fb13")}catch{}})();const lo=la(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=G(),s=B.getSignedInUser(),c=k(T=>T.tenantState.currentTenantId),u=k(T=>j(T)),{tenantEmailDomain:m}=G(),C=$(),b=u?.companyName??"",h={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:c??""},l=_.useMemo(()=>({authParams:h,companyName:b,downloadEndPoint:`${H}/agingDetailedReport`,timezone:Fe()}),[]),d=_.useMemo(()=>r!=null?Ut(r):de(),[r]),p=K(),g=q(),f=k(T=>Ka(T,d,o)),v=_.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&p(Na(o,d))},[d]),E=_.useCallback(()=>{g("../../",{relative:"path"})},[]),R=_.useCallback((T,J)=>{p(Tt({sortKey:T,sortOrder:J}))},[]),A=_.useCallback(T=>{p(Tt({downloadState:T}))},[]),I=_.useCallback(T=>{if(e)e(T.transactionId,T.transactionType);else if(m!=null){const J=da({id:T.transactionId,type:T.transactionType},m);g(J);const Le=F(C.state?.pathnameStackToGoBack,C.pathname);g(J,{state:{pathnameStackToGoBack:Le}})}},[m,e]),x=_.useCallback(()=>{f.vendor!=null&&S.trackApAgingDetail("AP Aging",d.format(N.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.vendor.id,f.vendor.name)},[f.vendor,d]);return _.useEffect(()=>{v()},[]),_.useEffect(()=>{f.fetchState==="Completed"&&x()},[x,f.fetchState]),i.jsx(qn,{apAgingDetail:f,downloadParams:l,reportDate:d,analytics:S,onTransactionClick:I,onReload:v,onBackClick:E,onColumnSortConfigChanged:R,updateDownloadStateHandler:A,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),uo=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Pe(),t=K(),n=q(),o=k(I=>Ga(I)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Be({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AP Aging"});Re({isDataReady:o.fetchState==="Completed"});const c=B.getSignedInUser(),u=k(I=>I.tenantState.currentTenantId),m=k(I=>j(I)),C=m?.companyName??"",b={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:u??""},h=_.useMemo(()=>({authParams:b,companyName:C,downloadEndPoint:`${H}/agingReport`,timezone:Fe()}),[]),l=o.apAgingUIState.selectedDate??de(),d=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(Qe(l))},[]);_.useEffect(()=>{d()},[]);const p=_.useCallback(()=>{n("../",{relative:"path"})},[]),g=_.useCallback(I=>{t(we({searchString:I}))},[]),f=_.useCallback((I,x)=>{t(we({sortKey:x,sortOrder:I}))},[]),v=_.useCallback(I=>{n(`./${I}/${l.format(N.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[l]),E=_.useCallback(I=>{t(we({downloadState:I}))},[]),R=_.useCallback((I,x)=>{},[]),A=_.useCallback((I,x)=>{t(we({selectedDate:I,agingDateSelectionType:x})),t(Qe(I))},[]);return i.jsxs(i.Fragment,{children:[o.fetchState==="Completed"?i.jsx(ve,{analytics:S,onLoad:I=>I.trackPageLoaded(Y.Event.agingReport,"AP Aging")}):null,i.jsx(ca,{uiState:o.apAgingUIState,report:o,downloadParams:h,analytics:S,onReloadReport:d,onBackClick:p,onSearchTextChange:g,onSortOrderChange:f,onEntityNameClick:v,updateDownloadStateHandler:E,onSelectedDateChanged:A,onNodeCollapseToggled:R,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},mo=la(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=G(),s=B.getSignedInUser(),c=k(x=>j(x)),{tenantEmailDomain:u}=G(),m=$(),C=c.companyName,b={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:c.tenantId},h=_.useMemo(()=>({authParams:b,companyName:C,downloadEndPoint:`${H}/agingDetailedReport`,timezone:Fe()}),[]),l=_.useMemo(()=>r!=null?Ut(r):de(),[r]),d=K(),p=q(),g=k(x=>za(x,l,o)),f=_.useCallback(()=>{o!=null&&g.fetchState!=="In-Progress"&&g.fetchState!=="Completed"&&d($a(o,l))},[l]),v=_.useCallback(()=>{p("../../",{relative:"path"})},[]),E=_.useCallback((x,T)=>{d(wt({sortKey:x,sortOrder:T}))},[]),R=_.useCallback(x=>{d(wt({downloadState:x}))},[]),A=_.useCallback(x=>{if(e)e(x.transactionId,x.transactionType);else if(u!=null){const T=da({id:x.transactionId,type:x.transactionType},u);p(T);const J=F(m.state?.pathnameStackToGoBack,m.pathname);p(T,{state:{pathnameStackToGoBack:J}})}},[u,e]),I=_.useCallback(()=>{g.customer!=null&&S.trackArAgingDetail("AR Aging",l.format(N.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),g.customer.id,g.customer.name)},[g.customer,l]);return _.useEffect(()=>{f()},[]),_.useEffect(()=>{g.fetchState==="Completed"&&I()},[g.fetchState,I]),i.jsx(Zn,{arAgingDetail:g,downloadParams:h,reportDate:l,analytics:S,onTransactionClick:A,onReload:f,onBackClick:v,onColumnSortConfigChanged:E,updateDownloadStateHandler:R,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),po=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Pe(),t=K(),n=q(),o=k(A=>qa(A)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Be({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AR Aging"});Re({isDataReady:o.fetchState==="Completed"});const c=B.getSignedInUser(),u=k(A=>j(A)),m=u.companyName,C={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:u.tenantId},b=_.useMemo(()=>({authParams:C,companyName:m,downloadEndPoint:`${H}/agingReport`,timezone:Fe()}),[]),h=o.arAgingUIState.selectedDate??de(),l=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(et(h))},[]);_.useEffect(()=>{l()},[]);const d=_.useCallback(()=>{n("../",{relative:"path"})},[]),p=_.useCallback(A=>{t(xe({searchString:A}))},[]),g=_.useCallback((A,I)=>{t(xe({sortKey:I,sortOrder:A}))},[]),f=_.useCallback(A=>{n(`./${A}/${h.format(N.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[h]),v=_.useCallback(A=>{t(xe({downloadState:A}))},[]),E=_.useCallback((A,I)=>{t(xe({selectedDate:A,agingDateSelectionType:I})),t(et(A))},[]),R=_.useCallback((A,I)=>{t(Za({nodeId:A,isCollapsed:I}))},[]);return i.jsxs(i.Fragment,{children:[o.fetchState==="Completed"?i.jsx(ve,{analytics:S,onLoad:A=>A.trackPageLoaded(Y.Event.agingReport,"AR Aging")}):null,i.jsx(ca,{uiState:o.arAgingUIState,report:o,downloadParams:b,analytics:S,onReloadReport:l,onBackClick:d,onSearchTextChange:p,onSortOrderChange:g,onEntityNameClick:f,updateDownloadStateHandler:v,onSelectedDateChanged:E,onNodeCollapseToggled:R,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},ma=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function pa(e,a){const t=Xa(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=me(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),c=F(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:c,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Wa(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?S.trackZeniAccountsCashBalancePromoClicked("Move Money"):(S.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=F(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else S.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const ho=Z(function(e){const a=Ha(e).accountsInOrder.map((n,o)=>ma(n,o)),t=Ja(e);return{sectionTitle:N.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:S}},pa)(ia),fo=Z(function(e){const a=Qa(e).accountsInOrder.map((o,r)=>ma(o,r)),t=B.getSignedInUser(),n=_e(t);return{sectionTitle:N.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:S}},pa)(ia);function go(){const e=q(),a=$(),{tenantEmailDomain:t}=G(),n=Ie(),o=k(s=>j(s).company?.companyInfo.firstMonthOfFY??1),r=at(n?.loggedInUserRoleMap);return k(s=>s.cashBalanceState.fetchState)==="Error"?i.jsx(Ce,{}):i.jsx(ho,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function bo(){const e=q(),a=$(),{tenantEmailDomain:t}=G(),n=Ie(),o=at(n?.loggedInUserRoleMap),r=k(s=>j(s).company?.companyInfo.firstMonthOfFY??1);return k(s=>s.cardBalanceState.fetchState)==="Error"?i.jsx(Ce,{}):i.jsx(fo,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const Co=pt.div`
|
|
1
|
+
import{j as i}from"./liveblocks-CiToer5R.js";import{l as G,g as k,u as $,h as K,j as q,k as Z,n as We,o as D}from"./core-DDvaTX37.js";import{eM as j,Jt as Fe,bB as Ut,bp as de,KG as Ka,hO as Na,KH as Tt,KI as Ga,hR as Qe,KJ as we,KK as za,hW as $a,KL as wt,KM as qa,h_ as et,KN as xe,KO as Za,cN as at,KP as Ha,KQ as Ja,JN as Xa,iU as Wa,KR as Qa,bm as _e,KS as Yt,Jh as Q,bc as Vt,j6 as Kt,mp as Nt,iR as Gt,Jj as ee,Ji as z,KT as en,KU as tn,KV as zt,KW as pe,tx as ke,ty as ye,tV as ue,tP as te,tC as Se,KX as an,KY as nn,KZ as on,K_ as $t,K$ as he,L0 as sn,dF as Oe,q9 as qt,L1 as rn,L2 as cn,L3 as ln,L4 as nt,IE as ot,jm as st,u1 as rt,qh as dn,L5 as un,tz as xt,qc as ie,q8 as Zt,L6 as oe,L7 as mn,L8 as ct,ID as it,s9 as Ht,L9 as pn,La as hn,Lb as fn,Lc as lt,sm as gn,Ld as bn,tB as Dt,s8 as Jt,Le as se,Lf as Cn,bu as Xt,u5 as Wt,Lg as _n,Lh as kn,Li as yn,Lj as dt,u0 as Sn,Lk as vn,tA as Ft,u4 as Qt,Ll as re,Lm as In,Ln as An,Lo as ea,jb as ta,mm as aa,jg as na,mk as oa,mj as sa,mi as ra,rx as En,fb as Tn,cK as wn,cL as xn,mf as Dn,f7 as Fn,mv as On,Lp as Pn,D9 as Bn,Lq as Rn,Lr as jn,Ls as Ln,b5 as ut,eZ as Mn,gw as Un,fC as Yn,mq as Vn,iK as Kn,mn as Nn,ml as Gn,eT as zn,eR as $n}from"./zeni-epic-state-D4vGt0eL.js";import{z as B,O as H,s as F,d as S,D as N,aP as qn,G as Pe,x as ve,aQ as ca,f as Y,aR as Zn,j as Ie,aS as ia,n as mt,i as L,h as Hn,aT as Jn,aU as Xn,aV as Ae,aW as Wn,a as Qn,al as eo,aI as to,r as ao,J as no,aX as oo,aY as ge}from"./index-DnJYpNVb.js";import{n as pt}from"./mui-CP2KeZRM.js";import{a as _}from"./sentry-8AfgzGIO.js";import{w as la}from"./withTransactionSidePanel-13UAZ-FH.js";import{b as da,t as me,e as ae,a as ht,v as so}from"./routePaths-D9iN1cLV.js";import{u as Be}from"./useAskAiCfoHostNavButtonProps-DKLQyfUj.js";import{c as Re}from"./useFetchSuggestedQuestionsWhenReady-B1Y3Jjir.js";import Ce from"./NotFoundScreen-LHqD0vPk.js";import{t as ua}from"./analyticsHelper-CeoHmyKo.js";import{C as ro}from"./CompanyPassportScreen-C4lx6LQP.js";import{F as co}from"./FeaturePreviewScreen-SnQ5YUgu.js";import{R as io}from"./ReferralListScreen-D7D_U76W.js";import"./recharts-CxZa6yMn.js";import"./lottie-BsqqVDQp.js";import"./analytics-DVf_BIp2.js";import"./plaid-_EXcf3jJ.js";import"./dnd-V-MvMUKQ.js";import"./stripe-DMRn4zHo.js";import"./lexical-CxLnVFxa.js";import"./pdf-CZO_R6LN.js";import"./utils-DVMMWGFG.js";import"./TransactionDetailScreen-CrA3WsFF.js";import"./decodeURIComponentSafe-CFMDmh9m.js";import"./MobileAppDrawer-Dr8YUpu7.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]="24ce2be4-3a9b-4d16-b7c6-1a6ba0d9fb13",e._sentryDebugIdIdentifier="sentry-dbid-24ce2be4-3a9b-4d16-b7c6-1a6ba0d9fb13")}catch{}})();const lo=la(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=G(),s=B.getSignedInUser(),c=k(T=>T.tenantState.currentTenantId),u=k(T=>j(T)),{tenantEmailDomain:m}=G(),C=$(),b=u?.companyName??"",h={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:c??""},l=_.useMemo(()=>({authParams:h,companyName:b,downloadEndPoint:`${H}/agingDetailedReport`,timezone:Fe()}),[]),d=_.useMemo(()=>r!=null?Ut(r):de(),[r]),p=K(),g=q(),f=k(T=>Ka(T,d,o)),v=_.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&p(Na(o,d))},[d]),E=_.useCallback(()=>{g("../../",{relative:"path"})},[]),R=_.useCallback((T,J)=>{p(Tt({sortKey:T,sortOrder:J}))},[]),A=_.useCallback(T=>{p(Tt({downloadState:T}))},[]),I=_.useCallback(T=>{if(e)e(T.transactionId,T.transactionType);else if(m!=null){const J=da({id:T.transactionId,type:T.transactionType},m);g(J);const Le=F(C.state?.pathnameStackToGoBack,C.pathname);g(J,{state:{pathnameStackToGoBack:Le}})}},[m,e]),x=_.useCallback(()=>{f.vendor!=null&&S.trackApAgingDetail("AP Aging",d.format(N.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.vendor.id,f.vendor.name)},[f.vendor,d]);return _.useEffect(()=>{v()},[]),_.useEffect(()=>{f.fetchState==="Completed"&&x()},[x,f.fetchState]),i.jsx(qn,{apAgingDetail:f,downloadParams:l,reportDate:d,analytics:S,onTransactionClick:I,onReload:v,onBackClick:E,onColumnSortConfigChanged:R,updateDownloadStateHandler:A,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),uo=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Pe(),t=K(),n=q(),o=k(I=>Ga(I)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Be({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AP Aging"});Re({isDataReady:o.fetchState==="Completed"});const c=B.getSignedInUser(),u=k(I=>I.tenantState.currentTenantId),m=k(I=>j(I)),C=m?.companyName??"",b={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:u??""},h=_.useMemo(()=>({authParams:b,companyName:C,downloadEndPoint:`${H}/agingReport`,timezone:Fe()}),[]),l=o.apAgingUIState.selectedDate??de(),d=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(Qe(l))},[]);_.useEffect(()=>{d()},[]);const p=_.useCallback(()=>{n("../",{relative:"path"})},[]),g=_.useCallback(I=>{t(we({searchString:I}))},[]),f=_.useCallback((I,x)=>{t(we({sortKey:x,sortOrder:I}))},[]),v=_.useCallback(I=>{n(`./${I}/${l.format(N.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[l]),E=_.useCallback(I=>{t(we({downloadState:I}))},[]),R=_.useCallback((I,x)=>{},[]),A=_.useCallback((I,x)=>{t(we({selectedDate:I,agingDateSelectionType:x})),t(Qe(I))},[]);return i.jsxs(i.Fragment,{children:[o.fetchState==="Completed"?i.jsx(ve,{analytics:S,onLoad:I=>I.trackPageLoaded(Y.Event.agingReport,"AP Aging")}):null,i.jsx(ca,{uiState:o.apAgingUIState,report:o,downloadParams:h,analytics:S,onReloadReport:d,onBackClick:p,onSearchTextChange:g,onSortOrderChange:f,onEntityNameClick:v,updateDownloadStateHandler:E,onSelectedDateChanged:A,onNodeCollapseToggled:R,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},mo=la(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=G(),s=B.getSignedInUser(),c=k(x=>j(x)),{tenantEmailDomain:u}=G(),m=$(),C=c.companyName,b={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:c.tenantId},h=_.useMemo(()=>({authParams:b,companyName:C,downloadEndPoint:`${H}/agingDetailedReport`,timezone:Fe()}),[]),l=_.useMemo(()=>r!=null?Ut(r):de(),[r]),d=K(),p=q(),g=k(x=>za(x,l,o)),f=_.useCallback(()=>{o!=null&&g.fetchState!=="In-Progress"&&g.fetchState!=="Completed"&&d($a(o,l))},[l]),v=_.useCallback(()=>{p("../../",{relative:"path"})},[]),E=_.useCallback((x,T)=>{d(wt({sortKey:x,sortOrder:T}))},[]),R=_.useCallback(x=>{d(wt({downloadState:x}))},[]),A=_.useCallback(x=>{if(e)e(x.transactionId,x.transactionType);else if(u!=null){const T=da({id:x.transactionId,type:x.transactionType},u);p(T);const J=F(m.state?.pathnameStackToGoBack,m.pathname);p(T,{state:{pathnameStackToGoBack:J}})}},[u,e]),I=_.useCallback(()=>{g.customer!=null&&S.trackArAgingDetail("AR Aging",l.format(N.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),g.customer.id,g.customer.name)},[g.customer,l]);return _.useEffect(()=>{f()},[]),_.useEffect(()=>{g.fetchState==="Completed"&&I()},[g.fetchState,I]),i.jsx(Zn,{arAgingDetail:g,downloadParams:h,reportDate:l,analytics:S,onTransactionClick:A,onReload:f,onBackClick:v,onColumnSortConfigChanged:E,updateDownloadStateHandler:R,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),po=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Pe(),t=K(),n=q(),o=k(A=>qa(A)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Be({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AR Aging"});Re({isDataReady:o.fetchState==="Completed"});const c=B.getSignedInUser(),u=k(A=>j(A)),m=u.companyName,C={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:u.tenantId},b=_.useMemo(()=>({authParams:C,companyName:m,downloadEndPoint:`${H}/agingReport`,timezone:Fe()}),[]),h=o.arAgingUIState.selectedDate??de(),l=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(et(h))},[]);_.useEffect(()=>{l()},[]);const d=_.useCallback(()=>{n("../",{relative:"path"})},[]),p=_.useCallback(A=>{t(xe({searchString:A}))},[]),g=_.useCallback((A,I)=>{t(xe({sortKey:I,sortOrder:A}))},[]),f=_.useCallback(A=>{n(`./${A}/${h.format(N.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[h]),v=_.useCallback(A=>{t(xe({downloadState:A}))},[]),E=_.useCallback((A,I)=>{t(xe({selectedDate:A,agingDateSelectionType:I})),t(et(A))},[]),R=_.useCallback((A,I)=>{t(Za({nodeId:A,isCollapsed:I}))},[]);return i.jsxs(i.Fragment,{children:[o.fetchState==="Completed"?i.jsx(ve,{analytics:S,onLoad:A=>A.trackPageLoaded(Y.Event.agingReport,"AR Aging")}):null,i.jsx(ca,{uiState:o.arAgingUIState,report:o,downloadParams:b,analytics:S,onReloadReport:l,onBackClick:d,onSearchTextChange:p,onSortOrderChange:g,onEntityNameClick:f,updateDownloadStateHandler:v,onSelectedDateChanged:E,onNodeCollapseToggled:R,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},ma=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function pa(e,a){const t=Xa(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=me(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),c=F(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:c,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Wa(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?S.trackZeniAccountsCashBalancePromoClicked("Move Money"):(S.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=F(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else S.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const ho=Z(function(e){const a=Ha(e).accountsInOrder.map((n,o)=>ma(n,o)),t=Ja(e);return{sectionTitle:N.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:S}},pa)(ia),fo=Z(function(e){const a=Qa(e).accountsInOrder.map((o,r)=>ma(o,r)),t=B.getSignedInUser(),n=_e(t);return{sectionTitle:N.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:S}},pa)(ia);function go(){const e=q(),a=$(),{tenantEmailDomain:t}=G(),n=Ie(),o=k(s=>j(s).company?.companyInfo.firstMonthOfFY??1),r=at(n?.loggedInUserRoleMap);return k(s=>s.cashBalanceState.fetchState)==="Error"?i.jsx(Ce,{}):i.jsx(ho,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function bo(){const e=q(),a=$(),{tenantEmailDomain:t}=G(),n=Ie(),o=at(n?.loggedInUserRoleMap),r=k(s=>j(s).company?.companyInfo.firstMonthOfFY??1);return k(s=>s.cardBalanceState.fetchState)==="Error"?i.jsx(Ce,{}):i.jsx(fo,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const Co=pt.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex: 1 1 auto;
|
|
4
4
|
min-height: 100%;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as v}from"./liveblocks-CiToer5R.js";import{a as u}from"./sentry-8AfgzGIO.js";import{h as y,g as b,k as w,u as A,N as k}from"./core-DDvaTX37.js";import{Ic as N,eM as _,fj as U,Id as L,mh as R,Ie as z}from"./zeni-epic-state-D4vGt0eL.js";import{u as j,z as f,L as T,t as S,D as O,b as $}from"./index-
|
|
1
|
+
import{j as v}from"./liveblocks-CiToer5R.js";import{a as u}from"./sentry-8AfgzGIO.js";import{h as y,g as b,k as w,u as A,N as k}from"./core-DDvaTX37.js";import{Ic as N,eM as _,fj as U,Id as L,mh as R,Ie as z}from"./zeni-epic-state-D4vGt0eL.js";import{u as j,z as f,L as T,t as S,D as O,b as $}from"./index-DnJYpNVb.js";import"./mui-CP2KeZRM.js";import{t as P}from"./getLocaleForTenant-DU8HEeVi.js";import"./recharts-CxZa6yMn.js";import"./lottie-BsqqVDQp.js";import"./analytics-DVf_BIp2.js";import"./plaid-_EXcf3jJ.js";import"./dnd-V-MvMUKQ.js";import"./stripe-DMRn4zHo.js";import"./lexical-CxLnVFxa.js";import"./pdf-CZO_R6LN.js";import"./utils-DVMMWGFG.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="c5ddc2e8-487e-4727-8560-cdf08fb4394f",t._sentryDebugIdIdentifier="sentry-dbid-c5ddc2e8-487e-4727-8560-cdf08fb4394f")}catch{}})();const Q=w(function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:z(t).tenantsInOrder}})(function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=A(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map(l=>l.tenantEmailDomain),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,I=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce((l,F)=>l||i.split("/").find(D=>D===F)!=null,!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,I=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=$(c,p);return v.jsx(k,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:I}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=j(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b(e=>N(e)),n=b(e=>e.tenantState.fetchState),i=b(e=>e.tenantState.error),a=b(e=>e.tenantState.activeTenantFetchState.fetchState),c=b(e=>_(e)),d=f.getSignedInUser();return u.useLayoutEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,h.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)},[a,n]),u.useEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&S.shouldFetchActiveTenant(e)&&(h.current=!0,S.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(U(d.userId,e))))},[n,a,d,t]),u.useEffect(()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,I=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&I&&S.shouldFetchAllTenants()&&(r.current=!0,S.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!L(i))&&t(R(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(O.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(Q,{})}const q=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],G={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of q)if(t.toLocaleLowerCase().includes(s))return G[s]}export{oe as default};
|
package/dist/assets/{DomesticWireDetailScreen-DqwewpNJ.js → DomesticWireDetailScreen-ClnHC2ph.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as l}from"./liveblocks-CiToer5R.js";import{j as w,u as C,g as h,k as A,l as B}from"./core-DDvaTX37.js";import{Ma as k,Mh as _,fA as J,fz as L,fy as W,ii as q,Ji as K,ps as Q,eM as V,LI as D,ig as T,Mb as S,Mk as F,id as G,iC as j}from"./zeni-epic-state-D4vGt0eL.js";import{bj as X,Z as R,n as N,z as U,h as M,r as p,i as v,B as Z,bk as Y,o as z,bl as ee,s as te}from"./index-
|
|
1
|
+
import{j as l}from"./liveblocks-CiToer5R.js";import{j as w,u as C,g as h,k as A,l as B}from"./core-DDvaTX37.js";import{Ma as k,Mh as _,fA as J,fz as L,fy as W,ii as q,Ji as K,ps as Q,eM as V,LI as D,ig as T,Mb as S,Mk as F,id as G,iC as j}from"./zeni-epic-state-D4vGt0eL.js";import{bj as X,Z as R,n as N,z as U,h as M,r as p,i as v,B as Z,bk as Y,o as z,bl as ee,s as te}from"./index-DnJYpNVb.js";import{n as O}from"./mui-CP2KeZRM.js";import"./sentry-8AfgzGIO.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]="d5255cb3-6bea-4e34-9e2a-555db0f13c13",e._sentryDebugIdIdentifier="sentry-dbid-d5255cb3-6bea-4e34-9e2a-555db0f13c13")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(q(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(K("common")),n!=null&&e(Q(n))},onGetOtp:n=>{e(W(n,"BillPayVendor"))},onResendOtp:n=>{e(L(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(J(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(_(n,a,o))}}})(X);function H({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(r=>k(r,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=O.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as i}from"./liveblocks-CiToer5R.js";import{Z as f,y as l,h as c}from"./index-
|
|
1
|
+
import{j as i}from"./liveblocks-CiToer5R.js";import{Z as f,y as l,h as c}from"./index-DnJYpNVb.js";import{D as b}from"./mui-CP2KeZRM.js";import"./sentry-8AfgzGIO.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="7fcde72f-e252-4f4d-801f-b7b68711bcb2",e._sentryDebugIdIdentifier="sentry-dbid-7fcde72f-e252-4f4d-801f-b7b68711bcb2")}catch{}})();const p={drawerLeftMargin:new l(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:s}=e,n=f(),d=o?.valuePx(n)??p.drawerLeftMargin.valuePx(n),a=c();return i.jsx(b,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${d})`}},slotProps:{backdrop:{style:{backgroundColor:a.colors.black,opacity:.8,cursor:"pointer"}}},onClose:s,children:t})}export{h as D};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-CiToer5R.js";import{a as d}from"./sentry-8AfgzGIO.js";import{j as A,h as B,u as J,l as q,g as c,N as F,k as M,n as O,o as N}from"./core-DDvaTX37.js";import{Kp as _,eM as K,JO as R,km as W,Gw as b,Ku as Y,Jh as $,jm as z,Gx as S,JT as U,JU as V,Jj as H,Ji as L}from"./zeni-epic-state-D4vGt0eL.js";import{aM as Q,d as X,r as Z,s as tt}from"./index-
|
|
1
|
+
import{j as s}from"./liveblocks-CiToer5R.js";import{a as d}from"./sentry-8AfgzGIO.js";import{j as A,h as B,u as J,l as q,g as c,N as F,k as M,n as O,o as N}from"./core-DDvaTX37.js";import{Kp as _,eM as K,JO as R,km as W,Gw as b,Ku as Y,Jh as $,jm as z,Gx as S,JT as U,JU as V,Jj as H,Ji as L}from"./zeni-epic-state-D4vGt0eL.js";import{aM as Q,d as X,r as Z,s as tt}from"./index-DnJYpNVb.js";import"./mui-CP2KeZRM.js";import{d as k}from"./decodeURIComponentSafe-CFMDmh9m.js";import{w as et}from"./withTransactionSidePanel-13UAZ-FH.js";import{e as at,b as nt}from"./routePaths-D9iN1cLV.js";import"./recharts-CxZa6yMn.js";import"./lottie-BsqqVDQp.js";import"./analytics-DVf_BIp2.js";import"./plaid-_EXcf3jJ.js";import"./dnd-V-MvMUKQ.js";import"./stripe-DMRn4zHo.js";import"./lexical-CxLnVFxa.js";import"./pdf-CZO_R6LN.js";import"./utils-DVMMWGFG.js";import"./useAskAiCfoHostNavButtonProps-DKLQyfUj.js";import"./useFetchSuggestedQuestionsWhenReady-B1Y3Jjir.js";import"./TransactionDetailScreen-CrA3WsFF.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="3607bd46-cea6-4587-baf2-30e0ec529d3c",a._sentryDebugIdIdentifier="sentry-dbid-3607bd46-cea6-4587-baf2-30e0ec529d3c")}catch{}})();const ot=M(function(a,t){const e=t.entity,o=Y(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:$(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:z(a)}},function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,l=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:l}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(H({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(L("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(U()),a(V()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??I();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(b(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(Q),it=et(function({entityType:a,...t}){const e=A(),o=B(),l=J(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:j,entityNameEncoded:x}=q(),r=k(j??""),p=k(x??""),u=rt(r,p),w=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=c(n=>_(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),G=c(n=>K(n).company?.companyInfo.firstMonthOfFY??1),f=c(n=>R(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&u===!0&&(T(!0),o(W(i)))},[m,u,i]);const E=c(n=>n.trendState.fetchState),P=f?.selectedPeriod?.timePeriod??g,v=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(f?.selectedPeriod?.timePeriod,g);return d.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&o(b(i,"EntityDetail",{timeframe:f?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),u?s.jsx(ot,{firstMonthOfFY:G,tenantEmailDomain:C,location:l,navigate:e,entity:i,defaultTransactionTimePeriod:v,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(F,{to:I(w.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,I=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function xt({entityType:a}){return s.jsx(O,{children:s.jsx(N,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{xt as EntityDetailRoutes,xt as default};
|
package/dist/assets/{ExpenseAutomationRoutes-CbPl7htr.js → ExpenseAutomationRoutes-CrnR7Lrw.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-CiToer5R.js";import un from"./NotFoundScreen-
|
|
1
|
+
import{j as u}from"./liveblocks-CiToer5R.js";import un from"./NotFoundScreen-LHqD0vPk.js";import{a as l}from"./sentry-8AfgzGIO.js";import{n as Te,D as St,S as ze}from"./mui-CP2KeZRM.js";import{h as he,j as It,u as Ve,g as V,l as nt,k as mn,n as hn,o as Be}from"./core-DDvaTX37.js";import{eM as $e,OI as pn,f0 as me,fe as gn,q3 as Cn,OJ as je,mI as ft,mO as kt,OK as Et,nb as Sn,OL as yt,mB as In,pB as fn,OM as kn,jy as En,ON as yn,Fx as vn,eY as Me,pg as vt,Kq as at,Ks as bn,jp as Tn,Kt as An,jw as Pn,cT as wn,t5 as Le,Jh as xn,jx as Rn,e_ as Dn,mP as bt,ng as be,ob as Tt,oK as Un,e$ as At,nf as ot,mG as ae,ni as Pt,nk as Bn,bB as On,kV as Fn,kS as _n,nj as Ee,nh as ue,OO as Vn,nA as st,Bd as wt,OP as xt,s2 as Rt,oG as jn,jm as Mn,OQ as Ln,Jj as ct,Ji as ke,OR as it,jN as zn,OS as $n,OT as Gn,OU as qn,OV as Jn,mY as Yn,OW as Kn,OX as Nn,OY as Zn,nq as Hn,jA as Qn,jr as Wn,OZ as Xn,jz as lt,KA as ea,O_ as ta,O$ as na,pc as aa,oT as oa,oS as Oe,P0 as sa,P1 as ca,l4 as ia,bp as la,k$ as rt,kN as ra,P2 as da,gy as dt,fL as ua,kY as ma,u_ as ha,P3 as pa,nR as ga,nM as Ca,nQ as Sa,nB as Ia,P4 as fa,n4 as ka,mV as Ea,ff as ut,nl as ya,P5 as va,P6 as ba,P7 as Ta,P8 as Aa,P9 as Pa,Pa as mt,po as wa,oB as xa,ok as ht,ot as Ra,og as Da,oH as Ua,ol as Ba,Pb as Oa,Pc as Fa,n_ as _a,Pd as Va,nY as ja,nZ as Ma,nW as La,ov as za}from"./zeni-epic-state-D4vGt0eL.js";import{G as Dt,n as Ut,i as ye,d as M,s as H,J as Bt,cq as $a,h as Ot,z as Ae,cr as Ga,ao as ve,cs as qa,B as Ft,ct as Ja,cu as Ya,al as Fe,Y as Ka,j as Na,aI as Za,cv as Ha,aZ as Qa,y as Wa,D as Xa,cw as eo,O as to,cx as no}from"./index-DnJYpNVb.js";import{u as _t}from"./useAskAiCfoHostNavButtonProps-DKLQyfUj.js";import{c as Vt}from"./useFetchSuggestedQuestionsWhenReady-B1Y3Jjir.js";import{c as pt,C as ao}from"./TransactionDetailScreen-CrA3WsFF.js";import{w as oo}from"./withTransactionSidePanel-13UAZ-FH.js";import{h as so,v as co}from"./routePaths-D9iN1cLV.js";import{g as _e}from"./accountMappingHelper-C7lhn2QG.js";import{D as io}from"./DrawerScreen-Cdhf9aya.js";import"./recharts-CxZa6yMn.js";import"./lottie-BsqqVDQp.js";import"./analytics-DVf_BIp2.js";import"./plaid-_EXcf3jJ.js";import"./dnd-V-MvMUKQ.js";import"./stripe-DMRn4zHo.js";import"./lexical-CxLnVFxa.js";import"./pdf-CZO_R6LN.js";import"./utils-DVMMWGFG.js";import"./decodeURIComponentSafe-CFMDmh9m.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},c=new t.Error().stack;c&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[c]="a8d6af4b-ccae-4fc0-ace5-79e0c09f6222",t._sentryDebugIdIdentifier="sentry-dbid-a8d6af4b-ccae-4fc0-ace5-79e0c09f6222")}catch{}})();const lo=()=>{const{isAiCfoOpen:t,setIsAiCfoOpen:c}=Dt(),w=he(),A=It(),y=Ve(),r=V(p=>$e(p)),{useFeatureGate:m}=Ut(),{isFeatureEnabled:x}=m(ye.isRealtimeInsightsFeatureEnabled),g=V(p=>p.expenseAutomationViewState.selectedPeriodByTenantId),a=V(p=>pn(p,r.tenantId)),{isAiCfoAccessEnabled:j,onAskAiCfoClick:v}=_t({isAiCfoOpen:t,setIsAiCfoOpen:c,mobileExploreReferrer:"Month-End Close Overview"}),I=l.useCallback((p,E,U=!1)=>{w(me({tenantId:E,period:{month:p.month,year:p.year},refreshViewInBackground:U}))},[]),$=l.useCallback(p=>{const E=y.state?.referrer;a.monthEndCloseChecks?.auditSummary!=null&&M.trackMonthCloseAuditPage(p.month,p.year,a.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",a.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,E??null),w(gn(r.tenantId,p))},[r.tenantId,a.monthEndCloseChecks?.auditSummary,a.monthEndCloseChecks?.reportEmailSentDate]),S=g[r.tenantId],k=l.useCallback(()=>{const p=y.state?.referrer;a.monthEndCloseChecks?.auditSummary!=null&&M.trackMonthCloseAuditPage(S.month,S.year,a.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",a.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,p??null),I(S,r.tenantId,!0)},[I,S,r.tenantId,a.monthEndCloseChecks?.auditSummary,a.monthEndCloseChecks?.reportEmailSentDate]),L=H(y.state?.pathnameStackToGoBack,y.pathname),K=l.useCallback(()=>{if(a.monthEndCloseChecks!=null&&S!=null){const p=a.monthEndCloseChecks.monthEndCloseCheckList.find(E=>E.progress<100);if(p!=null)return void A(`./${p.id}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview"}});A(`./month_end_insights/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview"}})}},[a.monthEndCloseChecks,S]),{areTenantIdsInSync:d}=Bt();return Vt({isDataReady:a.fetchState==="Completed"}),l.useEffect(()=>{S!=null&&a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&d&&I(S,r.tenantId)},[I,S,a.fetchState,r.tenantId,d]),l.useEffect(()=>{S!=null&&a.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&a.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&d&&w(Cn(S))},[S,a.monthClosePerformanceTrendFetchStatus.fetchState,d]),l.useEffect(()=>{const p=setInterval(()=>{a.fetchState!=="In-Progress"&&a.fetchState==="Completed"&&k()},3e5);return()=>clearInterval(p)},[a.fetchState]),l.useEffect(()=>{if(a.fetchState==="Completed"&&a.monthEndCloseChecks?.auditSummary!=null){const p=y.state?.referrer;M.trackMonthCloseAuditPage(a.selectedPeriod.month,a.selectedPeriod.year,a.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",a.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,p??null)}},[a.fetchState,a.selectedPeriod,a.monthEndCloseChecks?.auditSummary,a.monthEndCloseChecks?.reportEmailSentDate]),u.jsx(ro,{children:u.jsx($a,{monthEndCloseChecksView:a,isRealtimeInsightsFeatureEnabled:x,onMonthEndCheckClick:p=>{A(`./${p}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:$,handleReviewButtonClick:K,onBackClick:()=>{A("../../dashboard")},onReload:k,isAiCfoAccessEnabled:j,onAskAiCfoClick:v})})},ro=Te.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as d}from"./liveblocks-CiToer5R.js";import{a as s}from"./sentry-8AfgzGIO.js";import{W as l,X as p,_ as f,r as m}from"./index-
|
|
1
|
+
import{j as d}from"./liveblocks-CiToer5R.js";import{a as s}from"./sentry-8AfgzGIO.js";import{W as l,X as p,_ as f,r as m}from"./index-DnJYpNVb.js";import"./mui-CP2KeZRM.js";import u from"./NotFoundScreen-LHqD0vPk.js";import{j as c,u as b}from"./core-DDvaTX37.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]="d50dd50f-35b4-47d0-8d32-31d09751e61d",e._sentryDebugIdIdentifier="sentry-dbid-d50dd50f-35b4-47d0-8d32-31d09751e61d")}catch{}})();const j=()=>{const e=c(),t=b(),o=s.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),r=s.useCallback(()=>{(()=>{const n=m(t.state?.pathnameStackToGoBack),i=n.poppedPathname??k();e(i,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),a=l(t.pathname);return a!=null?d.jsx(p,{menuItem:f(a),onDemoClick:o,onGoBack:r}):d.jsx(u,{})},k=(e=2)=>{let t="../";for(let o=0;o<e;o++)t=`${t}../`;return t};export{j as F};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as t}from"./liveblocks-CiToer5R.js";import{l as b,k as x,j,u as y,h as X,q as ee,g as A,N as te,n as ae,o as p}from"./core-DDvaTX37.js";import{Iu as S,Iv as k,Iw as z,yQ as $,yC as L,Ix as C,Iy as ne,Iz as oe,yG as ie,eN as I,yN as se,yK as le}from"./zeni-epic-state-D4vGt0eL.js";import{Z as g,o as r,q as re,d as v,p as E,U as de,r as ce,F as me,s as F,n as pe,i as ue,N as he,Y as xe,h as ge,B as fe,x as we,w as be,S as ye,Q as Se,y as ke,H as ve}from"./index-
|
|
1
|
+
import{j as t}from"./liveblocks-CiToer5R.js";import{l as b,k as x,j,u as y,h as X,q as ee,g as A,N as te,n as ae,o as p}from"./core-DDvaTX37.js";import{Iu as S,Iv as k,Iw as z,yQ as $,yC as L,Ix as C,Iy as ne,Iz as oe,yG as ie,eN as I,yN as se,yK as le}from"./zeni-epic-state-D4vGt0eL.js";import{Z as g,o as r,q as re,d as v,p as E,U as de,r as ce,F as me,s as F,n as pe,i as ue,N as he,Y as xe,h as ge,B as fe,x as we,w as be,S as ye,Q as Se,y as ke,H as ve}from"./index-DnJYpNVb.js";import{n as c}from"./mui-CP2KeZRM.js";import f from"./NotFoundScreen-LHqD0vPk.js";import{a as N}from"./sentry-8AfgzGIO.js";import"./recharts-CxZa6yMn.js";import"./lottie-BsqqVDQp.js";import"./analytics-DVf_BIp2.js";import"./plaid-_EXcf3jJ.js";import"./dnd-V-MvMUKQ.js";import"./stripe-DMRn4zHo.js";import"./lexical-CxLnVFxa.js";import"./pdf-CZO_R6LN.js";import"./utils-DVMMWGFG.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]="c7cc0d97-5083-4f47-be81-c7290d2e8156",e._sentryDebugIdIdentifier="sentry-dbid-c7cc0d97-5083-4f47-be81-c7290d2e8156")}catch{}})();const Ie=c.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-CiToer5R.js";import{a as g}from"./sentry-8AfgzGIO.js";import{h as U,u as w,j as _,q as M,g as l,N as T}from"./core-DDvaTX37.js";import{z as r,h as P,D as V,e as A,d as N,f as q,I as R,w as W,g as $}from"./index-
|
|
1
|
+
import{j as u}from"./liveblocks-CiToer5R.js";import{a as g}from"./sentry-8AfgzGIO.js";import{h as U,u as w,j as _,q as M,g as l,N as T}from"./core-DDvaTX37.js";import{z as r,h as P,D as V,e as A,d as N,f as q,I as R,w as W,g as $}from"./index-DnJYpNVb.js";import{eM as B,Ie as G,Ip as H,If as J,eN as K,fi as Q,Il as X,fF as Y,cR as Z,Iq as ee,Ir as te}from"./zeni-epic-state-D4vGt0eL.js";import{n as ne}from"./mui-CP2KeZRM.js";import{u as se}from"./useDeviceId-C9CFDiHV.js";import{f as ie}from"./analyticsHelper-CeoHmyKo.js";import{t as ae}from"./getLocaleForTenant-DU8HEeVi.js";import"./recharts-CxZa6yMn.js";import"./lottie-BsqqVDQp.js";import"./analytics-DVf_BIp2.js";import"./plaid-_EXcf3jJ.js";import"./dnd-V-MvMUKQ.js";import"./stripe-DMRn4zHo.js";import"./lexical-CxLnVFxa.js";import"./pdf-CZO_R6LN.js";import"./utils-DVMMWGFG.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]="ae0f57db-3595-4505-b4ed-b80e467265dc",t._sentryDebugIdIdentifier="sentry-dbid-ae0f57db-3595-4505-b4ed-b80e467265dc")}catch{}})();const D=(t,i)=>t!=null&&t.length>0&&i==="magic_links";function De(){const t=U(),i=w(),m=_(),[k]=M(),n=k.get("token"),p=k.get("stytch_token_type"),f=r.getMagicLinkCodeVerifier(),a=se(),{otpChallenge:d,twoFAPhoneNumber:x,magicLinkEmail:c,verifyDeviceFetchState:z,resendVerifyDeviceOTPFetchState:C}=l(e=>e.tenantState),I=l(e=>e.tenantState.fetchState),y=l(e=>e.tenantState.activeTenantFetchState.fetchState),S=l(e=>e.tenantState.signInState),h=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),s=l(e=>e.tenantState.loggedInUser),o=l(e=>B(e)),b=l(e=>G(e)),E=r.getSignedInUser(),v=P().mode;g.useEffect(()=>{s?.zeniSessionId==null&&n!=null&&D(n,p)&&a!=null&&f!=null&&(r.saveMagicLinkTriggered(n),t(H(n,a,f)))},[n,p,t,a,f,s?.zeniSessionId]),g.useEffect(()=>{S!=="In-Progress"||I!=="Completed"&&y!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(J(b.tenantsInOrder),s.zeniSessionId),K(s.userId,s.zeniSessionId,o.tenantId),t(Q(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(X("Completed")),V.updateAppLocaleID(ae(o)),ie(s,o,v,void 0,b.tenantsInOrder),Y().then(()=>{const e=$();e!=null&&A(e)}),setTimeout(()=>{N.trackLogin(q.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[S,I,y,s,o,b,v,i.state,t]);const F=g.useCallback(()=>{m("/signin/auth")},[m]),j=g.useCallback(()=>{a!=null&&d!=null&&c!=null&&t(ee(a,c,d))},[a,d,t,c]),O=g.useCallback(e=>{a!=null&&n!=null&&c!=null&&d!=null&&t(te(e,a,c,d))},[a,n,t,c,d]);if(h==="Completed"&&d!=null)return u.jsx(R,{phoneNumber:x,verifyOtpFetchState:z.fetchState,resendVerifyDeviceOTPFetchState:C,onResendOtp:j,onVerifyOtp:O,onCancelVerifyDevice:F});if(S==="In-Progress"&&I==="Completed"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=i.state?.origin??"/";return u.jsx(T,{to:e,state:{...i.state,origin:""}})}if(!D(n,p)||f==null||h==="Error"){const e=i.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...i.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(W,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
|
|
2
2
|
position: fixed;
|
|
3
3
|
top: 0;
|
|
4
4
|
left: 0;
|