@zeniai/web-app-ui 5.0.5-dev → 5.0.5-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-BJ6qdoLD.js → AddressRoutes-Dg5wTso4.js} +1 -1
- package/dist/assets/{AddressScreen-CTET3dvy.js → AddressScreen-BmUTIXDQ.js} +1 -1
- package/dist/assets/{AiCfoScreen-C696xm-F.js → AiCfoScreen-DOESDB_y.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-D5NqeVu0.js → BillPayApprovalRoutes-Devc75aa.js} +1 -1
- package/dist/assets/{BillPayRoutes-Ck98EEir.js → BillPayRoutes-CVZSwrXO.js} +1 -1
- package/dist/assets/{BusinessVerificationPageScreen-Bp1i3y8M.js → BusinessVerificationPageScreen-rlQFJbcN.js} +1 -1
- package/dist/assets/{ChargeCardRoutes-Brqn9urb.js → ChargeCardRoutes-DhwHiThG.js} +1 -1
- package/dist/assets/{CompanyPassportScreen-Co-nMIHe.js → CompanyPassportScreen-OV_RlgTD.js} +1 -1
- package/dist/assets/{ConnectionAuthScreen-Y4nfaNNV.js → ConnectionAuthScreen-CXSm9A3K.js} +1 -1
- package/dist/assets/{CustomerOnboardingAuthScreen-gxNylpwG.js → CustomerOnboardingAuthScreen-kIRiytnK.js} +1 -1
- package/dist/assets/{CustomerOnboardingRoutes-BRWqx_0f.js → CustomerOnboardingRoutes-VbVi0pO3.js} +1 -1
- package/dist/assets/{DashboardRoutes-B3U1f4u1.js → DashboardRoutes-Djz9fKJS.js} +1 -1
- package/dist/assets/{DefaultTenantHome-C4r-hTkj.js → DefaultTenantHome-xquI5mdg.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-CzTl9QXc.js → DomesticWireDetailScreen-BPKqOjuc.js} +1 -1
- package/dist/assets/{DrawerScreen-Wjya0jbS.js → DrawerScreen-BAinUAiT.js} +1 -1
- package/dist/assets/{EntityDetailRoutes-BiBUkyBy.js → EntityDetailRoutes-C426Mprw.js} +1 -1
- package/dist/assets/{ExpenseAutomationRoutes-Mno1g-90.js → ExpenseAutomationRoutes-BLZeM7AE.js} +1 -1
- package/dist/assets/{FeaturePreviewScreen-DfsTuVkN.js → FeaturePreviewScreen-BOGEp7mZ.js} +1 -1
- package/dist/assets/{MagicLinkRoutes-BxQ-5ayp.js → MagicLinkRoutes-CFl_3geL.js} +1 -1
- package/dist/assets/{MagicLinkSignInScreen-DaLkRpCV.js → MagicLinkSignInScreen-BDCry5qq.js} +1 -1
- package/dist/assets/{MobileAppDrawer-Clk7FI85.js → MobileAppDrawer-DkCKi5Fn.js} +1 -1
- package/dist/assets/{NotFoundScreen-CAOLTLHp.js → NotFoundScreen-DPOmbROX.js} +1 -1
- package/dist/assets/{NotificationRoutes-Et6v_O-z.js → NotificationRoutes-DZhNQVLE.js} +1 -1
- package/dist/assets/{PandLWithForecastRoutes-PVFrj_hl.js → PandLWithForecastRoutes-DSOuY0Sq.js} +1 -1
- package/dist/assets/{PeopleRoutes-AzcRD0Yf.js → PeopleRoutes-DJ5vAQLD.js} +1 -1
- package/dist/assets/{PerformanceRoutes-GWU_y7En.js → PerformanceRoutes-B6wY-7PG.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-CcDeJYBx.js → QBOConnectionScreen-CaGgw5Mo.js} +1 -1
- package/dist/assets/{ReferralListScreen-DgyLr49m.js → ReferralListScreen-mDnpbI4k.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRoutes-D5db9hma.js → ReimbursementApprovalRoutes-CiEDO6E-.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-N-cMdQ-A.js → ReimbursementApprovalRuleDetailScreen-B4m_Prkq.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-JgtzXn1e.js → ReimbursementRoutes-DvqIKhWH.js} +1 -1
- package/dist/assets/{ReportsRoutes-Bzvx_8qb.js → ReportsRoutes-B55Mm_bZ.js} +1 -1
- package/dist/assets/{RewardsRoutes-DHQCeZWs.js → RewardsRoutes-D3siXOf6.js} +1 -1
- package/dist/assets/{ScreenRoutes-CsRNaB7V.js → ScreenRoutes-CR4LbxNH.js} +2 -2
- package/dist/assets/{SettingsRoutes-DNYnZ26G.js → SettingsRoutes-BAZtLZO7.js} +1 -1
- package/dist/assets/{SetupPagesScreen-CmJWX7Ir.js → SetupPagesScreen-Ck1fJ-gD.js} +1 -1
- package/dist/assets/{SignInScreen-DxjD1CPo.js → SignInScreen-BGmMngZm.js} +1 -1
- package/dist/assets/{SignOutScreen-tGSzKdMS.js → SignOutScreen-B7Ls3yjH.js} +1 -1
- package/dist/assets/{TaskListScreen-TQmA5ZGq.js → TaskListScreen-C_FkV4uq.js} +1 -1
- package/dist/assets/{TaskRoutes-DBh6aj7c.js → TaskRoutes-DubqoBe-.js} +1 -1
- package/dist/assets/{TransactionDetailRoutes-Cjt29p_e.js → TransactionDetailRoutes-BLrzFmca.js} +1 -1
- package/dist/assets/{TransactionDetailScreen-BQZTcMhs.js → TransactionDetailScreen-Dq4Bv7Yw.js} +1 -1
- package/dist/assets/{TransactionListRoutes-CcuSwiOJ.js → TransactionListRoutes-C4fPXh7s.js} +1 -1
- package/dist/assets/{TreasuryRoutes-DpMwhemK.js → TreasuryRoutes-CMZcHv3V.js} +1 -1
- package/dist/assets/{VendorsRoutes-frUR5tPv.js → VendorsRoutes-BlU_E8-4.js} +1 -1
- package/dist/assets/{WiseConfirmationScreen-B2x2znqS.js → WiseConfirmationScreen-DcnsS_39.js} +1 -1
- package/dist/assets/{ZeniAccountRoutes-D-YpoVj0.js → ZeniAccountRoutes-C1H652qU.js} +1 -1
- package/dist/assets/{ZeniAccountStatementScreen-C3hVq6G3.js → ZeniAccountStatementScreen-BUk4IFgX.js} +1 -1
- package/dist/assets/{analyticsHelper-MCISw32F.js → analyticsHelper-UdYvDCQO.js} +1 -1
- package/dist/assets/{getLocaleForTenant-C0C8sNl1.js → getLocaleForTenant-B5XIMdPl.js} +1 -1
- package/dist/assets/{index-CJiQhPf1.js → index-CtIv1cPm.js} +5 -5
- package/dist/assets/{routePaths-BJH4smh2.js → routePaths-CAPvhOau.js} +1 -1
- package/dist/assets/{useAskAiCfoHostNavButtonProps-YJt2mAQE.js → useAskAiCfoHostNavButtonProps-D6kPXOEr.js} +1 -1
- package/dist/assets/{useFetchSuggestedQuestionsWhenReady-bhvjxs2J.js → useFetchSuggestedQuestionsWhenReady-D_w411d6.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-zJW0Aqvd.js → useInitialThreadRequest-BTSPvXZ7.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-CslN6Fxb.js → withTransactionSidePanel-BRNXRpXy.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./liveblocks-ZAKgWoPK.js";import{A as i}from"./AddressScreen-
|
|
1
|
+
import{j as e}from"./liveblocks-ZAKgWoPK.js";import{A as i}from"./AddressScreen-BmUTIXDQ.js";import s from"./NotFoundScreen-DPOmbROX.js";import"./sentry-Bp45iw9z.js";import{n as d,o as r}from"./core-a8i-_0Kh.js";import"./zeni-epic-state-ZCc1K30S.js";import"./recharts-BhJEeZEG.js";import"./index-CtIv1cPm.js";import"./mui-B8yatdty.js";import"./lottie-DN0gYkdx.js";import"./analytics-vyykHm3I.js";import"./plaid-CP3hLhCR.js";import"./dnd-CDdU3ON0.js";import"./stripe-DMRn4zHo.js";import"./lexical-BzneVI9m.js";import"./pdf-C4rebPwh.js";import"./utils-ikosPjSL.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 r}from"./liveblocks-ZAKgWoPK.js";import{a as S}from"./sentry-Bp45iw9z.js";import{j as P,h as _,u as j,l as E,g as M,k as B}from"./core-a8i-_0Kh.js";import{Z as $,m as L,z as D,j as K,B as N,v as R,d as I,f as m,W as z,h,p as F}from"./index-
|
|
1
|
+
import{j as r}from"./liveblocks-ZAKgWoPK.js";import{a as S}from"./sentry-Bp45iw9z.js";import{j as P,h as _,u as j,l as E,g as M,k as B}from"./core-a8i-_0Kh.js";import{Z as $,m as L,z as D,j as K,B as N,v as R,d as I,f as m,W as z,h,p as F}from"./index-CtIv1cPm.js";import{IL as C,gI as U,eM as G,IM as O,b$ as V,IN as q,jQ as H}from"./zeni-epic-state-ZCc1K30S.js";import{n as Q}from"./mui-B8yatdty.js";import W from"./NotFoundScreen-DPOmbROX.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]="910d4bf2-82db-4cc9-ac6a-1b635b6bbb4c",e._sentryDebugIdIdentifier="sentry-dbid-910d4bf2-82db-4cc9-ac6a-1b635b6bbb4c")}catch{}})();const Z=Q.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as S}from"./liveblocks-ZAKgWoPK.js";import{a as i}from"./sentry-Bp45iw9z.js";import{h as ee,j as te,u as se,g as B,l as ae,k as ne}from"./core-a8i-_0Kh.js";import{I as oe,cB as ie,z as re,Z as le,cC as ce,cD as ue,cE as N,v as de,d as _,N as R,cF as me,cG as fe,f as pe,a1 as he,cH as Se,O as ge,q as Ce,p as Ie,cI as be,cJ as we}from"./index-
|
|
1
|
+
import{j as S}from"./liveblocks-ZAKgWoPK.js";import{a as i}from"./sentry-Bp45iw9z.js";import{h as ee,j as te,u as se,g as B,l as ae,k as ne}from"./core-a8i-_0Kh.js";import{I as oe,cB as ie,z as re,Z as le,cC as ce,cD as ue,cE as N,v as de,d as _,N as R,cF as me,cG as fe,f as pe,a1 as he,cH as Se,O as ge,q as Ce,p as Ie,cI as be,cJ as we}from"./index-CtIv1cPm.js";import{fE as ke,f3 as $,eM as Ee,h8 as ye,Ph as Pe,eL as Te,hi as _e,he as ve,fu as xe,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-ZCc1K30S.js";import{D as Ue,n as v,P as Be,S as Re}from"./mui-B8yatdty.js";import{p as je}from"./pathToGoBack-EHg1lj9D.js";import"./recharts-BhJEeZEG.js";import"./lottie-DN0gYkdx.js";import"./analytics-vyykHm3I.js";import"./plaid-CP3hLhCR.js";import"./dnd-CDdU3ON0.js";import"./stripe-DMRn4zHo.js";import"./lexical-BzneVI9m.js";import"./pdf-C4rebPwh.js";import"./utils-ikosPjSL.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]="0ea62731-4272-4f10-8783-7cbb8c0fbf06",a._sentryDebugIdIdentifier="sentry-dbid-0ea62731-4272-4f10-8783-7cbb8c0fbf06")}catch{}})();const q="chat-response-generated",Ne=ne(function(a,r){const n=$(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===q&&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}=N(g,u);m!=="answer"?_.trackAICFOChatResponseGenerated(m,C?.question.questionText??"",t.text,u,we(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&&be(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=Ie(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(ke())},[n]);const{customPageTitle:g}=ie(),e=B(l=>$(l)),o=re.getSignedInUser(),{session_id:t}=ae(),m=le(),u=B(l=>Ee(l)),s=e.uiState.currentChatSessionId,C=ce({currentTenant:u,currentChatSessionId:s,aiCfoView:e}),h=c.state,I=h?.aiCfoInitialQuestion,x=!!h?.aiCfoShouldSubmit,[G,k]=i.useState(null),[V,E]=i.useState(!1),Q=i.useRef(!1);i.useEffect(()=>{Q.current||I==null||I===""||(k(I),E(x),Q.current=!0)},[I,x]);const H=i.useCallback(()=>{k(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 b=e.uiState.lastContextMessage;i.useEffect(()=>{b!=null&&b!==""&&s!=null&&(k(b),E(!0),n(Pe()))},[b,s,n]);const W=u.masterTOSInfo,w=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),U=e.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:z}=N(U,s),J=z.length===0;i.useEffect(()=>{w||d("../dashboard",{state:{...c.state,message:"open_ai_cfo_drawer"}})},[w]),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}.${q}`),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(ve(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(qe,{children:[S.jsx(de,{analytics:_,onLoad:l=>l.trackPageLoaded(pe.Event.aiCFOPage)}),R(m)&&C.drawerElement,S.jsx(Ne,{...X,currentChatSessionId:s,allSessionsWithOrderedQuestionAnswers:U,openOnboardingPage:()=>p(!0),userId:o.userId,setIsAiCfoOpen:r,navigate:d,sessionFromUrl:t,location:c,isSubmitting:Y,isEmptyChatWithSession:J,customPageTitle:g,currentTenant:u,emailLinkQuestion:G??void 0,autoSubmitEmailLinkQuestion:V,onEmailLinkQuestionProcessed:H,onMenuClick:R(m)?C.open:void 0,isFileUploadEnabled:a}),S.jsx(Ue,{anchor:"right",open:f,transitionDuration:250,PaperProps:{component:Ge,style:{width:`${me}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>p(!1),children:S.jsx($e,{onClick:l=>l.stopPropagation(),children:S.jsx(fe,{isTOSAccepted:w,acceptMasterTOSState:e.masterTOSAcceptanceState,customPageTitle:g,onCloseClick:()=>p(!1),onCompleteClick:()=>{w||u.userRoleId==null||n(xe(u.userRoleId)),p(!1)}})})})]})},$e=v(Re)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as l}from"./liveblocks-ZAKgWoPK.js";import{a as f}from"./sentry-Bp45iw9z.js";import{j as U,u as B,h as T,g as v,N,k as j,l as $,n as L,o as h}from"./core-a8i-_0Kh.js";import{eM as O,M2 as A,LK as b,wT as w,wN as F,wR as I,wG as M,LM as W,wJ as q,wV as z,wU as C}from"./zeni-epic-state-ZCc1K30S.js";import{m as P,z as k,B as V,a1 as G,bu as J,aa as _,bv as K}from"./index-
|
|
1
|
+
import{j as l}from"./liveblocks-ZAKgWoPK.js";import{a as f}from"./sentry-Bp45iw9z.js";import{j as U,u as B,h as T,g as v,N,k as j,l as $,n as L,o as h}from"./core-a8i-_0Kh.js";import{eM as O,M2 as A,LK as b,wT as w,wN as F,wR as I,wG as M,LM as W,wJ as q,wV as z,wU as C}from"./zeni-epic-state-ZCc1K30S.js";import{m as P,z as k,B as V,a1 as G,bu as J,aa as _,bv as K}from"./index-CtIv1cPm.js";import"./mui-B8yatdty.js";import{i as H}from"./ReimbursementApprovalRuleDetailScreen-B4m_Prkq.js";import Q from"./NotFoundScreen-DPOmbROX.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]="92c86552-2b18-4ae4-97bb-c2f2cfdc1d67",e._sentryDebugIdIdentifier="sentry-dbid-92c86552-2b18-4ae4-97bb-c2f2cfdc1d67")}catch{}})();const R="bill-approval-rule-update",X=j(function(e){return{approvalView:A(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:t,location:p}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(R)&&e(W(!1))},onBackClick:()=>{_(p)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(M(a))},onEditRuleClick:a=>{a!=null?(e(I(a)),t(`./${a}/edit`)):(e(I()),t("./new"))}}})(G(J)),Y=()=>{const e=U(),o=B(),t=T(),[p,a]=f.useState(!1),[u,s]=f.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>O(i)),r=v(i=>A(i)),g=v(i=>b(i).billPaySetupApproverViewUpdateData);if(f.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(w())},[g]),f.useEffect(()=>{p||n!=="Not-Started"||(a(!0),t(F(!0)))},[p,n,t]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");f.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),t(I())),e("./new"))},[u,r,t]);const y={events:c.companyId!=null?[`private-${c.companyId}.${R}`]:[],eventCallback:(i,x,m)=>{i.endsWith(R)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx(N,{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(X,{currentTenant:c,location:o,navigate:e,...y})},Z=j(function(e,o){const t=b(e),p=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=p==="approval_create"&&t.allApprovalRules.length!==0;let u=t.allApprovalRules.length===0;return o.approvalRuleId&&(u=t.allApprovalRules.findIndex(s=>s.approvalRuleId===o.approvalRuleId)===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:u,approvalUpdateActionType:p}},function(e,o){const{navigate:t,approvalUpdateDataView:p,approverViewData:a,approvalRuleId:u}=o,s=p.billPaySetupApproverViewUpdateData?.type,d=_(o.location);return{onApprovalRuleDataUpdated:n=>{const c=r=>{const g=[];return r.forEach(y=>{const i=y.actors.selectedUsers.map(S=>({type:"user",userId:S.userId,isImplicitActor:!1})),x=y.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(x);g.push({action:y.stepType.selectedOption,actors:m,operator:m.length>1?y.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),g};if(s==="approval_create"){const r={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}},onResetClick:()=>{e(w()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(w()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(z())},onSaveRuleSuccess:()=>{t("../")}}})(K);function D(){const e=U(),o=T(),t=B(),{approvalRuleId:p}=$(),a=k.getSignedInUser(),u=P(),s=v(r=>b(r)),d=v(r=>A(r)),[n,c]=f.useState(!1);if(f.useEffect(()=>{n||(c(!0),o(q(!0)))}),f.useEffect(()=>{d.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[d,p]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?l.jsx(V,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:u.colors.grey5}}):l.jsx(Z,{navigate:e,approvalUpdateDataView:s,approvalRuleId:p,approverViewData:d,location:t})}function se(){return l.jsxs(L,{children:[l.jsx(h,{path:"/",element:l.jsx(Y,{})}),l.jsx(h,{path:"/new",element:l.jsx(D,{})}),l.jsx(h,{path:"/:approvalRuleId/edit",element:l.jsx(D,{})}),l.jsx(h,{path:"*",element:l.jsx(Q,{})})]})}export{se as B};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-ZAKgWoPK.js";import{j as K,h as re,u as Q,l as te,g as v,N as ee,k as Y,i as la,n as sa,o as S}from"./core-a8i-_0Kh.js";import{eM as Z,Lk as Me,bu as At,Gm as ra,bn as xt,bC as ue,Ll as Bt,wb as Et,xl as Ue,wK as ca,bm as je,Lm as da,Ln as pa,b$ as ua,Lo as ma,j8 as Dt,Lp as jt,Lq as Tt,xW as Oe,wq as Be,Lr as ba,v$ as it,Ls as ha,B6 as ga,w3 as ya,w9 as Pt,Lt as Ie,Lu as Ne,xm as ze,Lv as Sa,Lw as fa,xp as Ze,Lx as Ia,xC as va,Ly as Ft,x6 as ot,xb as ka,Lz as wa,LA as pe,LB as Lt,LC as Rt,LD as Vt,fG as Ca,wv as _e,ct as $t,LE as Aa,gy as xa,LF as Ba,LG as Ea,eT as Ut,eR as _t,LH as He,LI as Da,LJ as ja,J3 as We,LK as Ta,J4 as ie,J5 as qe,LL as Pa,LM as Fa,LN as La,xd as lt,xa as Ra,LO as Va,LP as $a,LQ as Ua,wY as _a,LR as Ga,LS as Ma,LT as Oa,cN as Gt,cJ as Mt,jj as Na,bI as za,bp as Ot,bJ as Nt,vh as Za,LU as Ha,AV as Wa,A$ as qa,rQ as Ja,xn as Ka,y1 as Qa,jw as fe,LV as Ya,LW as zt,j_ as Xa,jq as Zt,jL as Ht,jK as st,bB as be,bH as en,LX as tn,LY as ve,i1 as an,LZ as rt,L_ as nn,i5 as on,is as ln,yf as sn,L$ as rn,jT as cn,y5 as dn,M0 as ct,y9 as pn,ye as un,yb as mn,y3 as bn,M1 as Wt,wk as hn,M2 as gn,M3 as yn,fA as Sn,fz as fn,fy as In,jz as vn,jR as dt,k0 as kn,pn as wn,jI as Cn,y7 as An,ib as xn,k5 as Bn,M4 as En,i3 as Dn,pe as jn,M5 as Tn,x2 as Pn,bD as Fn,br as Ln,I2 as Rn,cL as Vn,cK as $n,cs as Un,cy as _n}from"./zeni-epic-state-ZCc1K30S.js";import{m as me,z as R,j as ke,I as Je,a as oe,i as y,aI as Ee,B as ce,o as E,v as Te,d as j,b1 as Gn,p as z,O as Ke,q as D,Z as we,b2 as pt,b3 as ut,b4 as Mn,af as On,E as Nn,aC as zn,w as qt,D as Qe,F as Ye,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 Qn,ba as Yn,bb as Xn,bc as ei,bd as ti,be as ai,bf as ni,Q as ii,bg as oi,aZ as li,bh as si,bi as ri,a4 as ci}from"./index-CJiQhPf1.js";import{n as V,S as di}from"./mui-B8yatdty.js";import{A as mt}from"./AddressScreen-CTET3dvy.js";import{g as ne,a as Pe,i as Qt,V as Xe,b as et,c as pi,v as ui,d as mi,A as he,D as ge}from"./DomesticWireDetailScreen-CzTl9QXc.js";import{a as f}from"./sentry-Bp45iw9z.js";import{u as tt}from"./useAskAiCfoHostNavButtonProps-YJt2mAQE.js";import{c as at}from"./useFetchSuggestedQuestionsWhenReady-bhvjxs2J.js";import{u as Yt}from"./useInitialThreadRequest-zJW0Aqvd.js";import De from"./NotFoundScreen-CAOLTLHp.js";import{D as bi}from"./DrawerScreen-Wjya0jbS.js";import{M as Xt}from"./MobileAppDrawer-Clk7FI85.js";import{F as ea}from"./FeaturePreviewScreen-DfsTuVkN.js";import{S as Le}from"./SetupPagesScreen-CmJWX7Ir.js";import{B as hi}from"./BillPayApprovalRoutes-D5NqeVu0.js";import{FallBackRoute as gi}from"./ScreenRoutes-CsRNaB7V.js";import"./recharts-BhJEeZEG.js";import"./lottie-DN0gYkdx.js";import"./analytics-vyykHm3I.js";import"./plaid-CP3hLhCR.js";import"./dnd-CDdU3ON0.js";import"./stripe-DMRn4zHo.js";import"./lexical-BzneVI9m.js";import"./pdf-C4rebPwh.js";import"./utils-ikosPjSL.js";import"./analyticsHelper-MCISw32F.js";import"./routePaths-BJH4smh2.js";import"./BusinessVerificationPageScreen-Bp1i3y8M.js";import"./ReimbursementApprovalRuleDetailScreen-N-cMdQ-A.js";import"./getLocaleForTenant-C0C8sNl1.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]="fc78ce94-96c2-4016-9cb6-c3dc7cda985b",e._sentryDebugIdIdentifier="sentry-dbid-fc78ce94-96c2-4016-9cb6-c3dc7cda985b")}catch{}})();const yi=Y(function(e,t){const l=Me(e,t.billId),n=R.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}))}}})(Gn);function Si(){const e=K(),t=re(),l=Q(),{billId:n}=te(),c=me(),r=R.getSignedInUser(),p=ke(),o=v(w=>Z(w)),s=v(w=>Me(w,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Yt(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),[k,H]=f.useState(!1),[_,G]=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),M=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?G(!1):G(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??"",$,M,!1)))},[T,s,n,t]),f.useEffect(()=>{k||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(H(!0),t(Ue(!1,$,M,X,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(ca()))},[k,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:_,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:le,hasZeniAssistAccess:M,isDetectInsufficientFundsEnabled:B,isAiCfoAccessEnabled:g,onAskAiCfoClick:m})]})}const ye=Qe.getLocalizedStrings().spendManagement.billPay.billDetails,fi={containerWidth:new qt(100,58)},bt=Y(function(e,t){const l=R.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=R.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(va({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=Q(),r=c.pathname,p=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),i=R.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=v(w=>Z(w)),[k,H]=f.useState(!1),[_,G]=f.useState(!1),[F,x]=f.useState(!1),[$,U]=f.useState(),B=v(w=>Ne(w,h,m,n));let O=B.fetchState,W=B.file,q=B.showAutofill;const J=v(w=>Me(w,n??""));p===!1&&(O=J.fetchState,W=J.transactionDetails?.attachments?.[0],q=!1);const M=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&&_?G(!1):!p&&k&&H(!1))},[n]),f.useEffect(()=>{k||n==null||p||(H(!0),t(Et(n,g,T,!1)),_||(G(!0),t(Ue(!1,g,T,b,n)))),p&&!_&&(G(!0),t(Ue(!1,g,T,b,n)))},[k,_,p,n,t]);const le={onOkClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(M??"",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(M??"",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(Re,{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:M}),a.jsx($e,{windowSize:o,children:a.jsx(ut,{})})]})}):a.jsxs(Re,{windowSize:o,children:[o==="small"||q?null:a.jsx(ht,{children:a.jsx(ta,{onClick:X})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(Mn,{}),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(Re,{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:vi(p,J,B),setShowConfirmationPopup:x,setPayload:U,showActionButtons:ki(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 vi(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-ZAKgWoPK.js";import{j as K,h as re,u as Q,l as te,g as v,N as ee,k as Y,i as la,n as sa,o as S}from"./core-a8i-_0Kh.js";import{eM as Z,Lk as Me,bu as At,Gm as ra,bn as xt,bC as ue,Ll as Bt,wb as Et,xl as Ue,wK as ca,bm as je,Lm as da,Ln as pa,b$ as ua,Lo as ma,j8 as Dt,Lp as jt,Lq as Tt,xW as Oe,wq as Be,Lr as ba,v$ as it,Ls as ha,B6 as ga,w3 as ya,w9 as Pt,Lt as Ie,Lu as Ne,xm as ze,Lv as Sa,Lw as fa,xp as Ze,Lx as Ia,xC as va,Ly as Ft,x6 as ot,xb as ka,Lz as wa,LA as pe,LB as Lt,LC as Rt,LD as Vt,fG as Ca,wv as _e,ct as $t,LE as Aa,gy as xa,LF as Ba,LG as Ea,eT as Ut,eR as _t,LH as He,LI as Da,LJ as ja,J3 as We,LK as Ta,J4 as ie,J5 as qe,LL as Pa,LM as Fa,LN as La,xd as lt,xa as Ra,LO as Va,LP as $a,LQ as Ua,wY as _a,LR as Ga,LS as Ma,LT as Oa,cN as Gt,cJ as Mt,jj as Na,bI as za,bp as Ot,bJ as Nt,vh as Za,LU as Ha,AV as Wa,A$ as qa,rQ as Ja,xn as Ka,y1 as Qa,jw as fe,LV as Ya,LW as zt,j_ as Xa,jq as Zt,jL as Ht,jK as st,bB as be,bH as en,LX as tn,LY as ve,i1 as an,LZ as rt,L_ as nn,i5 as on,is as ln,yf as sn,L$ as rn,jT as cn,y5 as dn,M0 as ct,y9 as pn,ye as un,yb as mn,y3 as bn,M1 as Wt,wk as hn,M2 as gn,M3 as yn,fA as Sn,fz as fn,fy as In,jz as vn,jR as dt,k0 as kn,pn as wn,jI as Cn,y7 as An,ib as xn,k5 as Bn,M4 as En,i3 as Dn,pe as jn,M5 as Tn,x2 as Pn,bD as Fn,br as Ln,I2 as Rn,cL as Vn,cK as $n,cs as Un,cy as _n}from"./zeni-epic-state-ZCc1K30S.js";import{m as me,z as R,j as ke,I as Je,a as oe,i as y,aI as Ee,B as ce,o as E,v as Te,d as j,b1 as Gn,p as z,O as Ke,q as D,Z as we,b2 as pt,b3 as ut,b4 as Mn,af as On,E as Nn,aC as zn,w as qt,D as Qe,F as Ye,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 Qn,ba as Yn,bb as Xn,bc as ei,bd as ti,be as ai,bf as ni,Q as ii,bg as oi,aZ as li,bh as si,bi as ri,a4 as ci}from"./index-CtIv1cPm.js";import{n as V,S as di}from"./mui-B8yatdty.js";import{A as mt}from"./AddressScreen-BmUTIXDQ.js";import{g as ne,a as Pe,i as Qt,V as Xe,b as et,c as pi,v as ui,d as mi,A as he,D as ge}from"./DomesticWireDetailScreen-BPKqOjuc.js";import{a as f}from"./sentry-Bp45iw9z.js";import{u as tt}from"./useAskAiCfoHostNavButtonProps-D6kPXOEr.js";import{c as at}from"./useFetchSuggestedQuestionsWhenReady-D_w411d6.js";import{u as Yt}from"./useInitialThreadRequest-BTSPvXZ7.js";import De from"./NotFoundScreen-DPOmbROX.js";import{D as bi}from"./DrawerScreen-BAinUAiT.js";import{M as Xt}from"./MobileAppDrawer-DkCKi5Fn.js";import{F as ea}from"./FeaturePreviewScreen-BOGEp7mZ.js";import{S as Le}from"./SetupPagesScreen-Ck1fJ-gD.js";import{B as hi}from"./BillPayApprovalRoutes-Devc75aa.js";import{FallBackRoute as gi}from"./ScreenRoutes-CR4LbxNH.js";import"./recharts-BhJEeZEG.js";import"./lottie-DN0gYkdx.js";import"./analytics-vyykHm3I.js";import"./plaid-CP3hLhCR.js";import"./dnd-CDdU3ON0.js";import"./stripe-DMRn4zHo.js";import"./lexical-BzneVI9m.js";import"./pdf-C4rebPwh.js";import"./utils-ikosPjSL.js";import"./analyticsHelper-UdYvDCQO.js";import"./routePaths-CAPvhOau.js";import"./BusinessVerificationPageScreen-rlQFJbcN.js";import"./ReimbursementApprovalRuleDetailScreen-B4m_Prkq.js";import"./getLocaleForTenant-B5XIMdPl.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]="fc78ce94-96c2-4016-9cb6-c3dc7cda985b",e._sentryDebugIdIdentifier="sentry-dbid-fc78ce94-96c2-4016-9cb6-c3dc7cda985b")}catch{}})();const yi=Y(function(e,t){const l=Me(e,t.billId),n=R.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}))}}})(Gn);function Si(){const e=K(),t=re(),l=Q(),{billId:n}=te(),c=me(),r=R.getSignedInUser(),p=ke(),o=v(w=>Z(w)),s=v(w=>Me(w,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Yt(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),[k,H]=f.useState(!1),[_,G]=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),M=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?G(!1):G(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??"",$,M,!1)))},[T,s,n,t]),f.useEffect(()=>{k||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(H(!0),t(Ue(!1,$,M,X,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(ca()))},[k,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:_,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:le,hasZeniAssistAccess:M,isDetectInsufficientFundsEnabled:B,isAiCfoAccessEnabled:g,onAskAiCfoClick:m})]})}const ye=Qe.getLocalizedStrings().spendManagement.billPay.billDetails,fi={containerWidth:new qt(100,58)},bt=Y(function(e,t){const l=R.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=R.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(va({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=Q(),r=c.pathname,p=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),i=R.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=v(w=>Z(w)),[k,H]=f.useState(!1),[_,G]=f.useState(!1),[F,x]=f.useState(!1),[$,U]=f.useState(),B=v(w=>Ne(w,h,m,n));let O=B.fetchState,W=B.file,q=B.showAutofill;const J=v(w=>Me(w,n??""));p===!1&&(O=J.fetchState,W=J.transactionDetails?.attachments?.[0],q=!1);const M=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&&_?G(!1):!p&&k&&H(!1))},[n]),f.useEffect(()=>{k||n==null||p||(H(!0),t(Et(n,g,T,!1)),_||(G(!0),t(Ue(!1,g,T,b,n)))),p&&!_&&(G(!0),t(Ue(!1,g,T,b,n)))},[k,_,p,n,t]);const le={onOkClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(M??"",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(M??"",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(Re,{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:M}),a.jsx($e,{windowSize:o,children:a.jsx(ut,{})})]})}):a.jsxs(Re,{windowSize:o,children:[o==="small"||q?null:a.jsx(ht,{children:a.jsx(ta,{onClick:X})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(Mn,{}),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(Re,{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:vi(p,J,B),setShowConfirmationPopup:x,setPayload:U,showActionButtons:ki(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 vi(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 ki(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-ZAKgWoPK.js";import{a as V}from"./sentry-Bp45iw9z.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-a8i-_0Kh.js";import{j as ce,a as ue,aI as de,z as M,v as pe,d as B,aa as x,f as z,bq as le,ao as me,q as E,ap as R}from"./index-
|
|
1
|
+
import{j as k}from"./liveblocks-ZAKgWoPK.js";import{a as V}from"./sentry-Bp45iw9z.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-a8i-_0Kh.js";import{j as ce,a as ue,aI as de,z as M,v as pe,d as B,aa as x,f as z,bq as le,ao as me,q as E,ap as R}from"./index-CtIv1cPm.js";import{LS as fe,eM as G,rf as ye,Gq as Se,wY as ge,zF as Ie,Cc as he,CR as be,DK as De,Md as Oe,Me as Te,Mf as ke,Mg as Ce,Mh as Ve,IM as we,Lf as Ae,IY as Ne,jQ as _e,fA as Fe,fz as ve,fy as xe,pn as ze,pe as Me,pb as Be,jI as Ee,ro as Re,rm as L,bB as P,rA as j,cr as Le}from"./zeni-epic-state-ZCc1K30S.js";import{n as Pe}from"./mui-B8yatdty.js";import{c as U}from"./routePaths-CAPvhOau.js";import{M as je}from"./MobileAppDrawer-DkCKi5Fn.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]="338aa00f-b4fc-4ee1-ae2a-923b9d910482",e._sentryDebugIdIdentifier="sentry-dbid-338aa00f-b4fc-4ee1-ae2a-923b9d910482")}catch{}})();const Ue=Pe.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-ZAKgWoPK.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 Qt,o as te}from"./core-a8i-_0Kh.js";import{eM as ie,br as Be,NJ as _a,eR as Se,eS as Ie,eT as Ae,fK as Me,co as ze,NK as $e,NL as $a,su as Sa,jg as Ia,NM as Aa,gy as ca,yY as aa,y_ as Ga,y$ as Ya,j6 as Ct,NN as Ge,yM as pt,NO as Jt,NP as Xt,yP as wa,NQ as en,Ma as Pa,qG as ht,yV as Za,gJ as an,NR as ft,NS as Ye,bp as tn,NT as nn,fA as Ta,fz as Fa,zt as rn,fy as va,LS as sn,NU as gt,cN as bt,cJ as on,M9 as ua,A3 as cn,NV as rt,zF as xa,NW as yt,A4 as dn,MA as ln,A5 as un,A$ as mn,rQ as Cn,AV as pn,ze as St,z7 as hn,NX as fn,fM as gn,zn as It,zr as At,fL as bn,NY as yn,zR as Et,NZ as Sn,N_ as In,N$ as An,zp as kt,za as Dt,yS as _t,zj as wt,zh as Pt,zl as En,yZ as st,O0 as Tt,O1 as La,zC as Ea,IR as Ft,cK as Ka,O2 as kn,O3 as Dn,O4 as _n,O5 as wn,zz as Ha,zY as Pn,zU as Tn,zv as Fn,zW as vn,zM as xn,zO as Ln,O6 as vt,A2 as xt,Gm as Bn,O7 as On,O8 as Rn,O9 as Un,Oa as Lt,Ob as Nn,Ap as jn,zE as Bt,zy as da,zD as Vn,Oc as Hn,Od as Mn,yJ as zn,Oe as Ot,Of as Rt,Og as $n,yL as Gn,yK as ot,Oh as Yn,Oi as Zn,Oj as Kn,IN as Wn,Ok as Wa,Ol as qn,vk as Ut,jQ as Qn,gz as Jn,Au as Xn,Om as Nt,On as er,Av as ar,Oo as tr,db as nr,so as rr,Ak as sr,Ae as Le,bu as or,bC as ir,ct as cr,bD as dr,I2 as lr}from"./zeni-epic-state-ZCc1K30S.js";import{z as X,j as Re,a as oe,i as Z,B as Ze,bU as Ba,c3 as ur,p as ve,c4 as mr,c5 as Cr,Z as ma,aI as Fe,q as be,bb as qa,c6 as pr,w as Ca,h as Oa,m as Qa,d as Q,D as Ja,c7 as hr,I as jt,al as Xa,bn as Xe,c8 as Ma,c9 as fr,v 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 Na,Q as _r,cj as wr,ck as Pr,cl as Tr,cm as Fr,a4 as vr}from"./index-CJiQhPf1.js";import{n as _e,D as zt,S as xr}from"./mui-B8yatdty.js";import{a as c}from"./sentry-Bp45iw9z.js";import{g as fe,a as pa,b as $t,c as Ee,d as ke,e as Oe,f as Ue,A as Lr,h as at,P as Br,i as tt,s as ea,j as Gt,k as He,l as Yt,m as Or,n as Zt,p as Rr,S as it}from"./SetupPagesScreen-CmJWX7Ir.js";import Ra from"./NotFoundScreen-CAOLTLHp.js";import{M as ha}from"./MobileAppDrawer-Clk7FI85.js";import{u as Kt}from"./useAskAiCfoHostNavButtonProps-YJt2mAQE.js";import{c as Wt}from"./useFetchSuggestedQuestionsWhenReady-bhvjxs2J.js";import{v as ct}from"./utils-ikosPjSL.js";import{t as Ur}from"./AddressScreen-CTET3dvy.js";import"./recharts-BhJEeZEG.js";import"./lottie-DN0gYkdx.js";import"./analytics-vyykHm3I.js";import"./plaid-CP3hLhCR.js";import"./dnd-CDdU3ON0.js";import"./stripe-DMRn4zHo.js";import"./lexical-BzneVI9m.js";import"./pdf-C4rebPwh.js";import"./analyticsHelper-MCISw32F.js";import"./routePaths-BJH4smh2.js";import"./BusinessVerificationPageScreen-Bp1i3y8M.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]="bc8c3001-f797-46c3-b52c-435862b78746",e._sentryDebugIdIdentifier="sentry-dbid-bc8c3001-f797-46c3-b52c-435862b78746")}catch{}})();function Nr(){const e=ue(),{cardId:t}=la(),a=me(),r=X.getSignedInUser(),n=S(G=>ie(G)),u=Re(),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,O=S(G=>Me(G,n.companyId)),N=ze(O.controllers),{creditAccount:T,creditAccountRepayment:P}=S(G=>$e(G)),j=S(G=>G.classListState.fetchState),p=!D&&l&&f,d=S(G=>$a(G,t,p,l)),[_,F]=c.useState(!1),U=d.chargeCard,M=U?.cardCreatedByUser?.userId,W=S(G=>M!=null?Sa(G.userRoleState,M):void 0),y=W?.accountingClassIDs[0],x=S(G=>y!=null?Ia(G.classState,{classId:y,reportId:"class_list"}):void 0),$=U?.cardHolderUser?.userId,R=S(G=>$!=null?Sa(G.userRoleState,$):void 0),Y=R?.accountingClassIDs[0],E=S(G=>Y!=null?Ia(G.classState,{classId:Y,reportId:"class_list"}):void 0),q=U?.type.code==="business_physical_credit_card"||U?.type.code==="business_physical_debit_card",K=U?.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&&U?.status?.code!=="active"||U?.cardHolderUserId!==r.userId||i===!1&&I===!1||U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card")){const G=fe(n.tenantEmailDomain,t,r,U,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()),j!=="Completed"&&j!=="In-Progress"&&a(Ct())},[T.fetchState,P.fetchState,a,l,f,m,j]);const z=()=>{if(r!=null&&t!=null){a(Aa());const G=fe(n.tenantEmailDomain,t,r);e(G)}},Ce=U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card",ae=Oe(l,g,w,f),L=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:U?.type.code==="business_physical_debit_card",controllerEmails:N,isChargeCardFeatureEnabled:l,isDebitCardFeatureEnabled:g,isDebitCardSetupEnabled:w,isChargeCardSetupEnabled:f,productInformation:ae,creditAccountInformation:L,debitAccountInformation:pe,chargeCardDetailView:d,creditAccount:T,classListFetchState:j,creditAccountRepayment:P,cardIssuedByRoles:W?.userRoles,cardIssuedByDepartmentName:x?.className,cardHolderRoles:R?.userRoles,cardHolderDepartmentName:E?.className})]})}const jr=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(Jt({uiState:{sortKey:t,sortOrder:a}}))}}})(Cr);function Vr(){const e=ue(),t=me(),a=ye(),r=X.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(Ra,{}):s.jsx(jr,{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=X.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=>Xt(E,n)),l=g.chargeCard,w=S(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:O}=oe(),{isFeatureEnabled:N}=O(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:T}=O(Z.isDebitCardFeatureEnabled),P=Ae(T,k),j=Ee({isDebitCardFeatureEnabled:T,isBankingOnlyTenant:P}),p=!!k.companyChargeCardInfo?.info?.isChargeCardEnabled,d=k.userRole.includes("charge_card_user"),_=Se(k),F=Ie(k),U=k.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,M=ke({isCardsOnlyTenant:_,isChargeCardFeatureEnabled:N,isBookKeepingTenant:F,isDebitCardProductVisible:j,chargeCardsCreditAccountLimit:U}),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 x=X.getZeniOtpTokenForCardHolder(n),$=S(E=>ht(E.userState,v.userId)),R=()=>{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(R,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:x,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:Oa.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&&X.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(nn({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),i=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Ue(I):o.poppedPathname;a(i,{state:{pathnameStackToGoBack:o.newStack}})}}})(pr),Gr=_e.div`
|
|
1
|
+
import{j as s}from"./liveblocks-ZAKgWoPK.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 Qt,o as te}from"./core-a8i-_0Kh.js";import{eM as ie,br as Be,NJ as _a,eR as Se,eS as Ie,eT as Ae,fK as Me,co as ze,NK as $e,NL as $a,su as Sa,jg as Ia,NM as Aa,gy as ca,yY as aa,y_ as Ga,y$ as Ya,j6 as Ct,NN as Ge,yM as pt,NO as Jt,NP as Xt,yP as wa,NQ as en,Ma as Pa,qG as ht,yV as Za,gJ as an,NR as ft,NS as Ye,bp as tn,NT as nn,fA as Ta,fz as Fa,zt as rn,fy as va,LS as sn,NU as gt,cN as bt,cJ as on,M9 as ua,A3 as cn,NV as rt,zF as xa,NW as yt,A4 as dn,MA as ln,A5 as un,A$ as mn,rQ as Cn,AV as pn,ze as St,z7 as hn,NX as fn,fM as gn,zn as It,zr as At,fL as bn,NY as yn,zR as Et,NZ as Sn,N_ as In,N$ as An,zp as kt,za as Dt,yS as _t,zj as wt,zh as Pt,zl as En,yZ as st,O0 as Tt,O1 as La,zC as Ea,IR as Ft,cK as Ka,O2 as kn,O3 as Dn,O4 as _n,O5 as wn,zz as Ha,zY as Pn,zU as Tn,zv as Fn,zW as vn,zM as xn,zO as Ln,O6 as vt,A2 as xt,Gm as Bn,O7 as On,O8 as Rn,O9 as Un,Oa as Lt,Ob as Nn,Ap as jn,zE as Bt,zy as da,zD as Vn,Oc as Hn,Od as Mn,yJ as zn,Oe as Ot,Of as Rt,Og as $n,yL as Gn,yK as ot,Oh as Yn,Oi as Zn,Oj as Kn,IN as Wn,Ok as Wa,Ol as qn,vk as Ut,jQ as Qn,gz as Jn,Au as Xn,Om as Nt,On as er,Av as ar,Oo as tr,db as nr,so as rr,Ak as sr,Ae as Le,bu as or,bC as ir,ct as cr,bD as dr,I2 as lr}from"./zeni-epic-state-ZCc1K30S.js";import{z as X,j as Re,a as oe,i as Z,B as Ze,bU as Ba,c3 as ur,p as ve,c4 as mr,c5 as Cr,Z as ma,aI as Fe,q as be,bb as qa,c6 as pr,w as Ca,h as Oa,m as Qa,d as Q,D as Ja,c7 as hr,I as jt,al as Xa,bn as Xe,c8 as Ma,c9 as fr,v 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 Na,Q as _r,cj as wr,ck as Pr,cl as Tr,cm as Fr,a4 as vr}from"./index-CtIv1cPm.js";import{n as _e,D as zt,S as xr}from"./mui-B8yatdty.js";import{a as c}from"./sentry-Bp45iw9z.js";import{g as fe,a as pa,b as $t,c as Ee,d as ke,e as Oe,f as Ue,A as Lr,h as at,P as Br,i as tt,s as ea,j as Gt,k as He,l as Yt,m as Or,n as Zt,p as Rr,S as it}from"./SetupPagesScreen-Ck1fJ-gD.js";import Ra from"./NotFoundScreen-DPOmbROX.js";import{M as ha}from"./MobileAppDrawer-DkCKi5Fn.js";import{u as Kt}from"./useAskAiCfoHostNavButtonProps-D6kPXOEr.js";import{c as Wt}from"./useFetchSuggestedQuestionsWhenReady-D_w411d6.js";import{v as ct}from"./utils-ikosPjSL.js";import{t as Ur}from"./AddressScreen-BmUTIXDQ.js";import"./recharts-BhJEeZEG.js";import"./lottie-DN0gYkdx.js";import"./analytics-vyykHm3I.js";import"./plaid-CP3hLhCR.js";import"./dnd-CDdU3ON0.js";import"./stripe-DMRn4zHo.js";import"./lexical-BzneVI9m.js";import"./pdf-C4rebPwh.js";import"./analyticsHelper-UdYvDCQO.js";import"./routePaths-CAPvhOau.js";import"./BusinessVerificationPageScreen-rlQFJbcN.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]="bc8c3001-f797-46c3-b52c-435862b78746",e._sentryDebugIdIdentifier="sentry-dbid-bc8c3001-f797-46c3-b52c-435862b78746")}catch{}})();function Nr(){const e=ue(),{cardId:t}=la(),a=me(),r=X.getSignedInUser(),n=S(G=>ie(G)),u=Re(),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,O=S(G=>Me(G,n.companyId)),N=ze(O.controllers),{creditAccount:T,creditAccountRepayment:P}=S(G=>$e(G)),j=S(G=>G.classListState.fetchState),p=!D&&l&&f,d=S(G=>$a(G,t,p,l)),[_,F]=c.useState(!1),U=d.chargeCard,M=U?.cardCreatedByUser?.userId,W=S(G=>M!=null?Sa(G.userRoleState,M):void 0),y=W?.accountingClassIDs[0],x=S(G=>y!=null?Ia(G.classState,{classId:y,reportId:"class_list"}):void 0),$=U?.cardHolderUser?.userId,R=S(G=>$!=null?Sa(G.userRoleState,$):void 0),Y=R?.accountingClassIDs[0],E=S(G=>Y!=null?Ia(G.classState,{classId:Y,reportId:"class_list"}):void 0),q=U?.type.code==="business_physical_credit_card"||U?.type.code==="business_physical_debit_card",K=U?.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&&U?.status?.code!=="active"||U?.cardHolderUserId!==r.userId||i===!1&&I===!1||U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card")){const G=fe(n.tenantEmailDomain,t,r,U,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()),j!=="Completed"&&j!=="In-Progress"&&a(Ct())},[T.fetchState,P.fetchState,a,l,f,m,j]);const z=()=>{if(r!=null&&t!=null){a(Aa());const G=fe(n.tenantEmailDomain,t,r);e(G)}},Ce=U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card",ae=Oe(l,g,w,f),L=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:U?.type.code==="business_physical_debit_card",controllerEmails:N,isChargeCardFeatureEnabled:l,isDebitCardFeatureEnabled:g,isDebitCardSetupEnabled:w,isChargeCardSetupEnabled:f,productInformation:ae,creditAccountInformation:L,debitAccountInformation:pe,chargeCardDetailView:d,creditAccount:T,classListFetchState:j,creditAccountRepayment:P,cardIssuedByRoles:W?.userRoles,cardIssuedByDepartmentName:x?.className,cardHolderRoles:R?.userRoles,cardHolderDepartmentName:E?.className})]})}const jr=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(Jt({uiState:{sortKey:t,sortOrder:a}}))}}})(Cr);function Vr(){const e=ue(),t=me(),a=ye(),r=X.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(Ra,{}):s.jsx(jr,{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=X.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=>Xt(E,n)),l=g.chargeCard,w=S(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:O}=oe(),{isFeatureEnabled:N}=O(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:T}=O(Z.isDebitCardFeatureEnabled),P=Ae(T,k),j=Ee({isDebitCardFeatureEnabled:T,isBankingOnlyTenant:P}),p=!!k.companyChargeCardInfo?.info?.isChargeCardEnabled,d=k.userRole.includes("charge_card_user"),_=Se(k),F=Ie(k),U=k.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,M=ke({isCardsOnlyTenant:_,isChargeCardFeatureEnabled:N,isBookKeepingTenant:F,isDebitCardProductVisible:j,chargeCardsCreditAccountLimit:U}),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 x=X.getZeniOtpTokenForCardHolder(n),$=S(E=>ht(E.userState,v.userId)),R=()=>{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(R,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:x,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:Oa.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&&X.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(nn({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),i=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Ue(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-ZAKgWoPK.js";import{a as g}from"./sentry-Bp45iw9z.js";import{j as w,h as k,u as x,l as T,g as O,k as E}from"./core-a8i-_0Kh.js";import{z as C,aZ as F,v as P,d as L,f as V,aa as N,a_ as j,ao as A,ap as M,q as U}from"./index-
|
|
1
|
+
import{j as m}from"./liveblocks-ZAKgWoPK.js";import{a as g}from"./sentry-Bp45iw9z.js";import{j as w,h as k,u as x,l as T,g as O,k as E}from"./core-a8i-_0Kh.js";import{z as C,aZ as F,v as P,d as L,f as V,aa as N,a_ as j,ao as A,ap as M,q as U}from"./index-CtIv1cPm.js";import{eM as D,fC as B,rf as _,fx as R,b$ as z,Lf as G,bm as Y,pn as Z,pb as $,jI as q,lc as S,Lg as H,bB as J,cr as b,lk as K,ln as Q}from"./zeni-epic-state-ZCc1K30S.js";import"./mui-B8yatdty.js";import{c as W}from"./routePaths-CAPvhOau.js";import{M as X}from"./MobileAppDrawer-DkCKi5Fn.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="b639a60f-642c-4d36-85d0-94d544c7dd3d",t._sentryDebugIdIdentifier="sentry-dbid-b639a60f-642c-4d36-85d0-94d544c7dd3d")}catch{}})();const ee=E(function(t){const a=R(t),i=C.getSignedInUser(),l=D(t),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=z(l?.userRole??[])&&a.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=G(t.companyConfigState),n=t.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:a.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:a,allIndustries:e.companyIndustries??[],allNationalityCountries:n,isDisabled:f,authParams:p,filesEndPoint:`${A.fileMicroServiceBaseUrl}`,isZeniUser:Y(i)}},function(t,a){const{companyId:i,currentTenant:l,navigate:c,location:p}=a,{tenantEmailDomain:f}=l;return{onScheduleClick:e=>{let n=e.href;n.includes("http")||(n="https://".concat(n)),window.open(n,"_blank")},onSaveAll:()=>{t(Q())},onAddressClick:e=>{const n=W(f,e),o=U(p.state?.pathnameStackToGoBack,p.pathname);c(n,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{t(K({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:n,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=n,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:h}=r,v={companyInfo:{...n,website:u!=""&&u!=null?b(u):void 0,meetingLink:y!=""&&y!=null?b(y):void 0,industry:n.industry.selectedOption,companyIndustryType:n.companyIndustryType?.selectedOption??void 0,companySubIndustry:n.subIndustry?.selectedOption??void 0,businessModel:n.businessModel.selectedOption??"",companySourceOfFunds:n.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:n.companySourceOfFundsDescription??void 0,countriesOfOperations:n.countriesOfOperations?.selectedOptions?.map(I=>I.length===2?I:M(I))??[],transactionVolume:n.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:n.transactionVolumeDescription??void 0,regulatedStatus:n.regulatedStatus??void 0,regulatedStatusDescription:n.regulatedStatusDescription??void 0,usNexus:n.usNexus??void 0,usNexusTypes:n.usNexusTypes?.selectedOptions??[],purposeOfAccount:n.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:n.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?J(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:h.selectedOptions.map(I=>parseInt(I)),fileId:r.fileIds[0]}};t(S({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{t(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{t(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:void 0}]}))},onNewCompanyOfficerRemoved:e=>{t(H(e))},onCompanyOfficerUpdated:e=>{t(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:e.userId}]}))},updateFilesEntity:e=>{t(q({files:e}))},onDeleteFile:e=>{t($(e))},onEditFileName:(e,n)=>{t(Z(e,n.split(".")[0]))}}})(j);function de(){const t=w(),a=k(),i=x(),{tenantEmailDomain:l}=T(),[c,p]=g.useState(!1),[f,e]=g.useState(!1),n=O(s=>s.companyViewState.passportView.fetchState),o=O(s=>s.companyConfigState.fetchState),r=O(s=>D(s)),d=r.companyId??C.getSignedInUserTenant(l)?.companyId;if(C.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||n!=="Not-Started"||d==null||(p(!0),a(B(d)))},[c,n,d,a]),g.useEffect(()=>{o==="Not-Started"&&a(_())},[o,a]);const u=s=>{e(s)},y=n==="Not-Started"||n==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&n==="Error"?m.jsx(F,{onGoHome:()=>t("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(P,{analytics:L,onLoad:s=>s.trackPageLoaded(V.Event.companyPassport,N(i)?"Settings":"Company Passport")}),N(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:t,location:i,isLoading:y,currentTenant:r,isSettings:N(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as C}from"./liveblocks-ZAKgWoPK.js";import{a}from"./sentry-Bp45iw9z.js";import{h as D,u as v,g as u,N as w}from"./core-a8i-_0Kh.js";import{H_ as _,eM as A,fj as O,m3 as j,fJ as h,fi as U,eN as L,I6 as F}from"./zeni-epic-state-ZCc1K30S.js";import{u as H,z as p,L as g,D as $,o as k}from"./index-
|
|
1
|
+
import{j as C}from"./liveblocks-ZAKgWoPK.js";import{a}from"./sentry-Bp45iw9z.js";import{h as D,u as v,g as u,N as w}from"./core-a8i-_0Kh.js";import{H_ as _,eM as A,fj as O,m3 as j,fJ as h,fi as U,eN as L,I6 as F}from"./zeni-epic-state-ZCc1K30S.js";import{u as H,z as p,L as g,D as $,o as k}from"./index-CtIv1cPm.js";import{n as z}from"./mui-B8yatdty.js";import{t as R}from"./getLocaleForTenant-B5XIMdPl.js";import{g as P,Q as G}from"./QBOConnectionScreen-CaGgw5Mo.js";import"./recharts-BhJEeZEG.js";import"./lottie-DN0gYkdx.js";import"./analytics-vyykHm3I.js";import"./plaid-CP3hLhCR.js";import"./dnd-CDdU3ON0.js";import"./stripe-DMRn4zHo.js";import"./lexical-BzneVI9m.js";import"./pdf-C4rebPwh.js";import"./utils-ikosPjSL.js";import"./empty-9qzWTKUd.js";import"./pdf-lib-OiZx9iEf.js";import"./index-DTPu_Uy6.js";import"./url-asQ2Q_hT.js";import"./index-DvmHdckU.js";import"./decodeURIComponentSafe-B_IVipCF.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]="90c8535a-7421-4913-8938-db06dfde49a0",t._sentryDebugIdIdentifier="sentry-dbid-90c8535a-7421-4913-8938-db06dfde49a0")}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-ZAKgWoPK.js";import{z as m}from"./index-
|
|
1
|
+
import{j as i}from"./liveblocks-ZAKgWoPK.js";import{z as m}from"./index-CtIv1cPm.js";import{g as n}from"./QBOConnectionScreen-CaGgw5Mo.js";import"./sentry-Bp45iw9z.js";import{u as p,N as a}from"./core-a8i-_0Kh.js";import"./zeni-epic-state-ZCc1K30S.js";import"./recharts-BhJEeZEG.js";import"./mui-B8yatdty.js";import"./lottie-DN0gYkdx.js";import"./analytics-vyykHm3I.js";import"./plaid-CP3hLhCR.js";import"./dnd-CDdU3ON0.js";import"./stripe-DMRn4zHo.js";import"./lexical-BzneVI9m.js";import"./pdf-C4rebPwh.js";import"./utils-ikosPjSL.js";import"./empty-9qzWTKUd.js";import"./pdf-lib-OiZx9iEf.js";import"./index-DTPu_Uy6.js";import"./url-asQ2Q_hT.js";import"./index-DvmHdckU.js";import"./decodeURIComponentSafe-B_IVipCF.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-BRWqx_0f.js → CustomerOnboardingRoutes-VbVi0pO3.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-ZAKgWoPK.js";import{t as $e,A as Ce}from"./AddressScreen-
|
|
1
|
+
import{j as a}from"./liveblocks-ZAKgWoPK.js";import{t as $e,A as Ce}from"./AddressScreen-BmUTIXDQ.js";import Me from"./NotFoundScreen-DPOmbROX.js";import{a as g}from"./sentry-Bp45iw9z.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 ze,n as Qe,o as z}from"./core-a8i-_0Kh.js";import{Q as de,j as le,z as B,a as ue,m as qe,i as _,q as V,v as W,d as N,B as we,f as Y,ak as Ke,Z as Ze,al as Ie,h as te,am as He,an as ke,o as We,ao as Xe,ap as Ee,aq as Ye}from"./index-CtIv1cPm.js";import{bm as Je,eM as ee,fb as et,eT as pe,eR as me,bu as tt,m1 as at,f7 as nt,bL as ot,iM as ae,iP as ve,IK as st,bQ as it,b$ as ge,rt as he,re as rt,IW as J,ru as _e,Gq as ct,jQ as Ue,IX as Ve,IY as dt,IZ as lt,I_ as ut,iK as pt,iN as mt,rg as Be,rs as gt,bB as Te,cr as ht,rG as xe,pn as ft,pb as yt,jI as bt,fA as St,fz as Ct,fy as It,I$ as kt,r8 as Et,rH as Tt,rK as xt,rN as Ot,rT as Pt,cR as At}from"./zeni-epic-state-ZCc1K30S.js";import{n as fe}from"./mui-B8yatdty.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-CaGgw5Mo.js";import"./recharts-BhJEeZEG.js";import"./lottie-DN0gYkdx.js";import"./analytics-vyykHm3I.js";import"./plaid-CP3hLhCR.js";import"./dnd-CDdU3ON0.js";import"./stripe-DMRn4zHo.js";import"./lexical-BzneVI9m.js";import"./pdf-C4rebPwh.js";import"./utils-ikosPjSL.js";import"./empty-9qzWTKUd.js";import"./pdf-lib-OiZx9iEf.js";import"./index-DTPu_Uy6.js";import"./url-asQ2Q_hT.js";import"./index-DvmHdckU.js";import"./decodeURIComponentSafe-B_IVipCF.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]="235e108f-1b5a-439c-9914-3cc8ea55eb4a",t._sentryDebugIdIdentifier="sentry-dbid-235e108f-1b5a-439c-9914-3cc8ea55eb4a")}catch{}})();const jt=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"}})}}})(Ke),wt=()=>{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(),h=Je(i),{useFeatureGate:m}=ue(),k=qe(),{isFeatureEnabled:T}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:x}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:I}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),$=C||U&&h,c=D(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),j=c.company!=null&&et(c.company),R=L&&j,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 w=pe(F,c),P=me(c),A=[],K=S?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,M=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(K===!1&&A.push("top_expenses"),M===!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"),f===!1&&A.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||w||P||(r(!0),s(at(i.userId,G,c.tenantId,!0,!1,A)))},[d,O,w,P,i,c.tenantId,s]),g.useEffect(()=>{(w||P)&&setTimeout(()=>{b(!0)},5e3)},[w,P]),O!=="Completed")return a.jsx(E,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(w)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(W,{analytics:N,onLoad:l=>(Z=>Z.trackPageLoaded(Y.Event.onboardingDashboardActivation))(l)}),a.jsx(jt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:T,isArAgingFeatureEnabled:x,shouldFetchZeniAccountsPromoCard:I,shouldFetchRewardsPlanCard:f,isExpenseAutomationEnabledForUser:$,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:R,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(we,{fetchState:"In-Progress",style:{backgroundColor:k.colors.grey5}})},Oe=fe.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-ZAKgWoPK.js";import{l as N,g as k,u as $,h as V,j as Z,k as q,n as Xe,o as D}from"./core-a8i-_0Kh.js";import{eM as j,Jf as Fe,bB as Ut,bp as de,Ks as Va,hA as Ga,Kt as wt,Ku as Na,hD as Qe,Kv as Te,Kw as za,hI as $a,Kx as Tt,Ky as Za,hM as et,Kz as xe,KA as qa,cN as at,KB as Ha,KC as Ja,Jz as Wa,iG as Xa,KD as Qa,bm as _e,KE as Kt,J3 as Q,bc as Yt,iU as Vt,mb as Gt,iD as Nt,J5 as ee,J4 as z,KF as en,KG as tn,KH as zt,KI as pe,tj as ke,tk as ye,tH as ue,tB as te,to as Se,KJ as an,KK as nn,KL as on,KM as $t,KN as he,KO as sn,dF as Oe,pX as Zt,KP as rn,KQ as cn,KR as ln,KS as nt,Iq as ot,j8 as st,tP as rt,q3 as dn,KT as un,tl as xt,p_ as ie,pW as qt,KU as oe,KV as mn,KW as ct,Ip as it,rX as Ht,KX as pn,KY as hn,KZ as fn,K_ as lt,s8 as gn,K$ as bn,tn as Dt,rW as Jt,L0 as se,L1 as Cn,bu as Wt,tT as Xt,L2 as _n,L3 as kn,L4 as yn,L5 as dt,tO as Sn,L6 as vn,tm as Ft,tS as Qt,L7 as re,L8 as In,L9 as An,La as ea,iZ as ta,m8 as aa,j2 as na,m6 as oa,m5 as sa,m4 as ra,rj as En,fb as wn,cK as Tn,cL as xn,m1 as Dn,f7 as Fn,mh as On,Lb as Pn,CX as Bn,Lc as Rn,Ld as jn,Le as Mn,b5 as ut,eZ as Ln,gw as Un,fC as Kn,mc as Yn,iw as Vn,m9 as Gn,m7 as Nn,eT as zn,eR as $n}from"./zeni-epic-state-ZCc1K30S.js";import{z as B,O as H,q as F,d as S,D as G,aP as Zn,I as Pe,v as ve,aQ as ca,f as K,aR as qn,j as Ie,aS as ia,a as mt,i as M,m as Hn,aT as Jn,aU as Wn,aV as Ae,aW as Xn,c as Qn,al as eo,aI as to,p as ao,J as no,aX as oo,aY as ge}from"./index-CJiQhPf1.js";import{n as pt}from"./mui-B8yatdty.js";import{a as _}from"./sentry-Bp45iw9z.js";import{w as la}from"./withTransactionSidePanel-CslN6Fxb.js";import{b as da,t as me,e as ae,a as ht,v as so}from"./routePaths-BJH4smh2.js";import{u as Be}from"./useAskAiCfoHostNavButtonProps-YJt2mAQE.js";import{c as Re}from"./useFetchSuggestedQuestionsWhenReady-bhvjxs2J.js";import Ce from"./NotFoundScreen-CAOLTLHp.js";import{t as ua}from"./analyticsHelper-MCISw32F.js";import{C as ro}from"./CompanyPassportScreen-Co-nMIHe.js";import{F as co}from"./FeaturePreviewScreen-DfsTuVkN.js";import{R as io}from"./ReferralListScreen-DgyLr49m.js";import"./recharts-BhJEeZEG.js";import"./lottie-DN0gYkdx.js";import"./analytics-vyykHm3I.js";import"./plaid-CP3hLhCR.js";import"./dnd-CDdU3ON0.js";import"./stripe-DMRn4zHo.js";import"./lexical-BzneVI9m.js";import"./pdf-C4rebPwh.js";import"./utils-ikosPjSL.js";import"./TransactionDetailScreen-BQZTcMhs.js";import"./decodeURIComponentSafe-B_IVipCF.js";import"./MobileAppDrawer-Clk7FI85.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]="b34a2ad0-5eb0-410e-a11c-b81f7fd73b2d",e._sentryDebugIdIdentifier="sentry-dbid-b34a2ad0-5eb0-410e-a11c-b81f7fd73b2d")}catch{}})();const lo=la(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=N(),s=B.getSignedInUser(),c=k(w=>w.tenantState.currentTenantId),u=k(w=>j(w)),{tenantEmailDomain:m}=N(),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=V(),g=Z(),f=k(w=>Va(w,d,o)),v=_.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&p(Ga(o,d))},[d]),E=_.useCallback(()=>{g("../../",{relative:"path"})},[]),R=_.useCallback((w,J)=>{p(wt({sortKey:w,sortOrder:J}))},[]),A=_.useCallback(w=>{p(wt({downloadState:w}))},[]),I=_.useCallback(w=>{if(e)e(w.transactionId,w.transactionType);else if(m!=null){const J=da({id:w.transactionId,type:w.transactionType},m);g(J);const Me=F(C.state?.pathnameStackToGoBack,C.pathname);g(J,{state:{pathnameStackToGoBack:Me}})}},[m,e]),x=_.useCallback(()=>{f.vendor!=null&&S.trackApAgingDetail("AP Aging",d.format(G.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(Zn,{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=V(),n=Z(),o=k(I=>Na(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(Te({searchString:I}))},[]),f=_.useCallback((I,x)=>{t(Te({sortKey:x,sortOrder:I}))},[]),v=_.useCallback(I=>{n(`./${I}/${l.format(G.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[l]),E=_.useCallback(I=>{t(Te({downloadState:I}))},[]),R=_.useCallback((I,x)=>{},[]),A=_.useCallback((I,x)=>{t(Te({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(K.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}=N(),s=B.getSignedInUser(),c=k(x=>j(x)),{tenantEmailDomain:u}=N(),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=V(),p=Z(),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,w)=>{d(Tt({sortKey:x,sortOrder:w}))},[]),R=_.useCallback(x=>{d(Tt({downloadState:x}))},[]),A=_.useCallback(x=>{if(e)e(x.transactionId,x.transactionType);else if(u!=null){const w=da({id:x.transactionId,type:x.transactionType},u);p(w);const J=F(m.state?.pathnameStackToGoBack,m.pathname);p(w,{state:{pathnameStackToGoBack:J}})}},[u,e]),I=_.useCallback(()=>{g.customer!=null&&S.trackArAgingDetail("AR Aging",l.format(G.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(qn,{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=V(),n=Z(),o=k(A=>Za(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(G.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(qa({nodeId:A,isCollapsed:I}))},[]);return i.jsxs(i.Fragment,{children:[o.fetchState==="Completed"?i.jsx(ve,{analytics:S,onLoad:A=>A.trackPageLoaded(K.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=Wa(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(Xa(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=q(function(e){const a=Ha(e).accountsInOrder.map((n,o)=>ma(n,o)),t=Ja(e);return{sectionTitle:G.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:S}},pa)(ia),fo=q(function(e){const a=Qa(e).accountsInOrder.map((o,r)=>ma(o,r)),t=B.getSignedInUser(),n=_e(t);return{sectionTitle:G.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:S}},pa)(ia);function go(){const e=Z(),a=$(),{tenantEmailDomain:t}=N(),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=Z(),a=$(),{tenantEmailDomain:t}=N(),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-ZAKgWoPK.js";import{l as N,g as k,u as $,h as V,j as Z,k as q,n as Xe,o as D}from"./core-a8i-_0Kh.js";import{eM as j,Jf as Fe,bB as Ut,bp as de,Ks as Va,hA as Ga,Kt as wt,Ku as Na,hD as Qe,Kv as Te,Kw as za,hI as $a,Kx as Tt,Ky as Za,hM as et,Kz as xe,KA as qa,cN as at,KB as Ha,KC as Ja,Jz as Wa,iG as Xa,KD as Qa,bm as _e,KE as Kt,J3 as Q,bc as Yt,iU as Vt,mb as Gt,iD as Nt,J5 as ee,J4 as z,KF as en,KG as tn,KH as zt,KI as pe,tj as ke,tk as ye,tH as ue,tB as te,to as Se,KJ as an,KK as nn,KL as on,KM as $t,KN as he,KO as sn,dF as Oe,pX as Zt,KP as rn,KQ as cn,KR as ln,KS as nt,Iq as ot,j8 as st,tP as rt,q3 as dn,KT as un,tl as xt,p_ as ie,pW as qt,KU as oe,KV as mn,KW as ct,Ip as it,rX as Ht,KX as pn,KY as hn,KZ as fn,K_ as lt,s8 as gn,K$ as bn,tn as Dt,rW as Jt,L0 as se,L1 as Cn,bu as Wt,tT as Xt,L2 as _n,L3 as kn,L4 as yn,L5 as dt,tO as Sn,L6 as vn,tm as Ft,tS as Qt,L7 as re,L8 as In,L9 as An,La as ea,iZ as ta,m8 as aa,j2 as na,m6 as oa,m5 as sa,m4 as ra,rj as En,fb as wn,cK as Tn,cL as xn,m1 as Dn,f7 as Fn,mh as On,Lb as Pn,CX as Bn,Lc as Rn,Ld as jn,Le as Mn,b5 as ut,eZ as Ln,gw as Un,fC as Kn,mc as Yn,iw as Vn,m9 as Gn,m7 as Nn,eT as zn,eR as $n}from"./zeni-epic-state-ZCc1K30S.js";import{z as B,O as H,q as F,d as S,D as G,aP as Zn,I as Pe,v as ve,aQ as ca,f as K,aR as qn,j as Ie,aS as ia,a as mt,i as M,m as Hn,aT as Jn,aU as Wn,aV as Ae,aW as Xn,c as Qn,al as eo,aI as to,p as ao,J as no,aX as oo,aY as ge}from"./index-CtIv1cPm.js";import{n as pt}from"./mui-B8yatdty.js";import{a as _}from"./sentry-Bp45iw9z.js";import{w as la}from"./withTransactionSidePanel-BRNXRpXy.js";import{b as da,t as me,e as ae,a as ht,v as so}from"./routePaths-CAPvhOau.js";import{u as Be}from"./useAskAiCfoHostNavButtonProps-D6kPXOEr.js";import{c as Re}from"./useFetchSuggestedQuestionsWhenReady-D_w411d6.js";import Ce from"./NotFoundScreen-DPOmbROX.js";import{t as ua}from"./analyticsHelper-UdYvDCQO.js";import{C as ro}from"./CompanyPassportScreen-OV_RlgTD.js";import{F as co}from"./FeaturePreviewScreen-BOGEp7mZ.js";import{R as io}from"./ReferralListScreen-mDnpbI4k.js";import"./recharts-BhJEeZEG.js";import"./lottie-DN0gYkdx.js";import"./analytics-vyykHm3I.js";import"./plaid-CP3hLhCR.js";import"./dnd-CDdU3ON0.js";import"./stripe-DMRn4zHo.js";import"./lexical-BzneVI9m.js";import"./pdf-C4rebPwh.js";import"./utils-ikosPjSL.js";import"./TransactionDetailScreen-Dq4Bv7Yw.js";import"./decodeURIComponentSafe-B_IVipCF.js";import"./MobileAppDrawer-DkCKi5Fn.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]="b34a2ad0-5eb0-410e-a11c-b81f7fd73b2d",e._sentryDebugIdIdentifier="sentry-dbid-b34a2ad0-5eb0-410e-a11c-b81f7fd73b2d")}catch{}})();const lo=la(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=N(),s=B.getSignedInUser(),c=k(w=>w.tenantState.currentTenantId),u=k(w=>j(w)),{tenantEmailDomain:m}=N(),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=V(),g=Z(),f=k(w=>Va(w,d,o)),v=_.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&p(Ga(o,d))},[d]),E=_.useCallback(()=>{g("../../",{relative:"path"})},[]),R=_.useCallback((w,J)=>{p(wt({sortKey:w,sortOrder:J}))},[]),A=_.useCallback(w=>{p(wt({downloadState:w}))},[]),I=_.useCallback(w=>{if(e)e(w.transactionId,w.transactionType);else if(m!=null){const J=da({id:w.transactionId,type:w.transactionType},m);g(J);const Me=F(C.state?.pathnameStackToGoBack,C.pathname);g(J,{state:{pathnameStackToGoBack:Me}})}},[m,e]),x=_.useCallback(()=>{f.vendor!=null&&S.trackApAgingDetail("AP Aging",d.format(G.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(Zn,{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=V(),n=Z(),o=k(I=>Na(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(Te({searchString:I}))},[]),f=_.useCallback((I,x)=>{t(Te({sortKey:x,sortOrder:I}))},[]),v=_.useCallback(I=>{n(`./${I}/${l.format(G.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[l]),E=_.useCallback(I=>{t(Te({downloadState:I}))},[]),R=_.useCallback((I,x)=>{},[]),A=_.useCallback((I,x)=>{t(Te({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(K.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}=N(),s=B.getSignedInUser(),c=k(x=>j(x)),{tenantEmailDomain:u}=N(),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=V(),p=Z(),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,w)=>{d(Tt({sortKey:x,sortOrder:w}))},[]),R=_.useCallback(x=>{d(Tt({downloadState:x}))},[]),A=_.useCallback(x=>{if(e)e(x.transactionId,x.transactionType);else if(u!=null){const w=da({id:x.transactionId,type:x.transactionType},u);p(w);const J=F(m.state?.pathnameStackToGoBack,m.pathname);p(w,{state:{pathnameStackToGoBack:J}})}},[u,e]),I=_.useCallback(()=>{g.customer!=null&&S.trackArAgingDetail("AR Aging",l.format(G.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(qn,{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=V(),n=Z(),o=k(A=>Za(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(G.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(qa({nodeId:A,isCollapsed:I}))},[]);return i.jsxs(i.Fragment,{children:[o.fetchState==="Completed"?i.jsx(ve,{analytics:S,onLoad:A=>A.trackPageLoaded(K.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=Wa(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(Xa(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=q(function(e){const a=Ha(e).accountsInOrder.map((n,o)=>ma(n,o)),t=Ja(e);return{sectionTitle:G.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:S}},pa)(ia),fo=q(function(e){const a=Qa(e).accountsInOrder.map((o,r)=>ma(o,r)),t=B.getSignedInUser(),n=_e(t);return{sectionTitle:G.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:S}},pa)(ia);function go(){const e=Z(),a=$(),{tenantEmailDomain:t}=N(),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=Z(),a=$(),{tenantEmailDomain:t}=N(),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-ZAKgWoPK.js";import{a as u}from"./sentry-Bp45iw9z.js";import{h as y,g as b,k as w,u as A,N as k}from"./core-a8i-_0Kh.js";import{H_ as N,eM as _,fj as U,H$ as L,m3 as R,I0 as z}from"./zeni-epic-state-ZCc1K30S.js";import{u as $,z as f,L as T,t as I,D as j,b as O}from"./index-
|
|
1
|
+
import{j as v}from"./liveblocks-ZAKgWoPK.js";import{a as u}from"./sentry-Bp45iw9z.js";import{h as y,g as b,k as w,u as A,N as k}from"./core-a8i-_0Kh.js";import{H_ as N,eM as _,fj as U,H$ as L,m3 as R,I0 as z}from"./zeni-epic-state-ZCc1K30S.js";import{u as $,z as f,L as T,t as I,D as j,b as O}from"./index-CtIv1cPm.js";import"./mui-B8yatdty.js";import{t as H}from"./getLocaleForTenant-B5XIMdPl.js";import"./recharts-BhJEeZEG.js";import"./lottie-DN0gYkdx.js";import"./analytics-vyykHm3I.js";import"./plaid-CP3hLhCR.js";import"./dnd-CDdU3ON0.js";import"./stripe-DMRn4zHo.js";import"./lexical-BzneVI9m.js";import"./pdf-C4rebPwh.js";import"./utils-ikosPjSL.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]="1e44250a-223f-4355-961d-2d4b3bbff7b1",t._sentryDebugIdIdentifier="sentry-dbid-1e44250a-223f-4355-961d-2d4b3bbff7b1")}catch{}})();const P=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,S=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,S=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=O(c,p);return v.jsx(k,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:S}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=$(),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&&I.shouldFetchActiveTenant(e)&&(h.current=!0,I.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,S=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&S&&I.shouldFetchAllTenants()&&(r.current=!0,I.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||(j.updateAppLocaleID(H(c)),o())},[n,a,c]),v.jsx(P,{})}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"],q={"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 q[s]}export{oe as default};
|
package/dist/assets/{DomesticWireDetailScreen-CzTl9QXc.js → DomesticWireDetailScreen-BPKqOjuc.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as l}from"./liveblocks-ZAKgWoPK.js";import{j as w,u as C,g as h,k as A,l as B}from"./core-a8i-_0Kh.js";import{LY as k,M3 as M,fA as _,fz as q,fy as J,i3 as W,J4 as Y,pe as K,eM as V,Lu as D,i1 as T,LZ as S,M6 as F,h$ as G,io as j}from"./zeni-epic-state-ZCc1K30S.js";import{bj as Q,Z as R,a as N,z as U,m as Z,p,i as v,B as z,bk as X,o as O,bl as ee,q as te}from"./index-
|
|
1
|
+
import{j as l}from"./liveblocks-ZAKgWoPK.js";import{j as w,u as C,g as h,k as A,l as B}from"./core-a8i-_0Kh.js";import{LY as k,M3 as M,fA as _,fz as q,fy as J,i3 as W,J4 as Y,pe as K,eM as V,Lu as D,i1 as T,LZ as S,M6 as F,h$ as G,io as j}from"./zeni-epic-state-ZCc1K30S.js";import{bj as Q,Z as R,a as N,z as U,m as Z,p,i as v,B as z,bk as X,o as O,bl as ee,q as te}from"./index-CtIv1cPm.js";import{n as H}from"./mui-B8yatdty.js";import"./sentry-Bp45iw9z.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]="36a5c6a4-7dc1-484e-a56e-6fb481f087c1",e._sentryDebugIdIdentifier="sentry-dbid-36a5c6a4-7dc1-484e-a56e-6fb481f087c1")}catch{}})();const ae=A(null,function(e,t){return{onSaveVendor:a=>{e(W(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(Y("common")),a!=null&&e(K(a))},onGetOtp:a=>{e(J(a,"BillPayVendor"))},onResendOtp:a=>{e(q(a,"BillPayVendor"))},onVerifyOtp:(a,n)=>{e(_(a,n,"BillPayVendor"))},onVerifyOtpSuccess:(a,n,o)=>{e(M(a,n,o))}}})(Q);function L({vendorId:e,billId:t,isExpressPayPage:a}){const n=w(),o=C(),s=h(r=>k(r,e));return l.jsx(ae,{location:o,navigate:n,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:a??!1})}const ne=H.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as i}from"./liveblocks-ZAKgWoPK.js";import{Z as l,w as c,m as f}from"./index-
|
|
1
|
+
import{j as i}from"./liveblocks-ZAKgWoPK.js";import{Z as l,w as c,m as f}from"./index-CtIv1cPm.js";import{D as p}from"./mui-B8yatdty.js";import"./sentry-Bp45iw9z.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]="b4cc9519-6a54-4b57-ae43-7dee2d554313",e._sentryDebugIdIdentifier="sentry-dbid-b4cc9519-6a54-4b57-ae43-7dee2d554313")}catch{}})();const b={drawerLeftMargin:new c(0,0,240)};function m(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:a}=e,n=l(),s=o?.valuePx(n)??b.drawerLeftMargin.valuePx(n),d=f();return i.jsx(p,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:d.colors.black,opacity:.8,cursor:"pointer"}}},onClose:a,children:t})}export{m as D};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-ZAKgWoPK.js";import{a as d}from"./sentry-Bp45iw9z.js";import{j as A,h as B,u as F,l as J,g as l,N as q,k as M,n as N,o as O}from"./core-a8i-_0Kh.js";import{Kb as _,eM as K,JA as R,k8 as W,Gi as k,Kg as Y,J3 as $,j8 as z,Gj as S,JF as V,JG as H,J5 as L,J4 as Q}from"./zeni-epic-state-ZCc1K30S.js";import{aM as U,d as X,p as Z,q as tt}from"./index-
|
|
1
|
+
import{j as s}from"./liveblocks-ZAKgWoPK.js";import{a as d}from"./sentry-Bp45iw9z.js";import{j as A,h as B,u as F,l as J,g as l,N as q,k as M,n as N,o as O}from"./core-a8i-_0Kh.js";import{Kb as _,eM as K,JA as R,k8 as W,Gi as k,Kg as Y,J3 as $,j8 as z,Gj as S,JF as V,JG as H,J5 as L,J4 as Q}from"./zeni-epic-state-ZCc1K30S.js";import{aM as U,d as X,p as Z,q as tt}from"./index-CtIv1cPm.js";import"./mui-B8yatdty.js";import{d as b}from"./decodeURIComponentSafe-B_IVipCF.js";import{w as et}from"./withTransactionSidePanel-BRNXRpXy.js";import{e as at,b as nt}from"./routePaths-CAPvhOau.js";import"./recharts-BhJEeZEG.js";import"./lottie-DN0gYkdx.js";import"./analytics-vyykHm3I.js";import"./plaid-CP3hLhCR.js";import"./dnd-CDdU3ON0.js";import"./stripe-DMRn4zHo.js";import"./lexical-BzneVI9m.js";import"./pdf-C4rebPwh.js";import"./utils-ikosPjSL.js";import"./useAskAiCfoHostNavButtonProps-D6kPXOEr.js";import"./useFetchSuggestedQuestionsWhenReady-D_w411d6.js";import"./TransactionDetailScreen-Dq4Bv7Yw.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]="d5f26bd0-13df-4277-a7c5-d32217bb2e02",a._sentryDebugIdIdentifier="sentry-dbid-d5f26bd0-13df-4277-a7c5-d32217bb2e02")}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)}`,c=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:c}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(L({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(Q("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(V()),a(H()),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(k(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(U),it=et(function({entityType:a,...t}){const e=A(),o=B(),c=F(),[m,T]=d.useState(!1),[h,g]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:j,entityNameEncoded:G}=J(),r=b(j??""),p=b(G??""),u=rt(r,p),w=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},D=l(n=>_(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),x=l(n=>K(n).company?.companyInfo.firstMonthOfFY??1),f=l(n=>R(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&u===!0&&(T(!0),o(W(i)))},[m,u,i]);const E=l(n=>n.trendState.fetchState),P=f?.selectedPeriod?.timePeriod??D,v=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(f?.selectedPeriod?.timePeriod,D);return d.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(g(!0),P!=null&&o(k(i,"EntityDetail",{timeframe:f?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),u?s.jsx(ot,{firstMonthOfFY:x,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:v,resetTrendIsFetchedStates:()=>{T(!1),g(!1)},...t}):s.jsx(q,{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 Gt({entityType:a}){return s.jsx(N,{children:s.jsx(O,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{Gt as EntityDetailRoutes,Gt as default};
|
package/dist/assets/{ExpenseAutomationRoutes-Mno1g-90.js → ExpenseAutomationRoutes-BLZeM7AE.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-ZAKgWoPK.js";import un from"./NotFoundScreen-
|
|
1
|
+
import{j as u}from"./liveblocks-ZAKgWoPK.js";import un from"./NotFoundScreen-DPOmbROX.js";import{a as l}from"./sentry-Bp45iw9z.js";import{n as Te,D as St,S as ze}from"./mui-B8yatdty.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 Ue}from"./core-a8i-_0Kh.js";import{eM as $e,Ou as pn,f0 as me,fe as gn,pR as Cn,Ov as je,mu as ft,mA as kt,Ow as Et,mZ as Sn,Ox as yt,mn as In,pn as fn,Oy as kn,jk as En,Oz as yn,Fj as vn,eY as Me,p2 as vt,Kc as at,Ke as bn,jb as Tn,Kf as An,ji as wn,cT as xn,sT as Le,J3 as Rn,jj as Pn,e_ as Dn,mB as bt,n2 as be,nZ as Tt,ow as On,e$ as At,n1 as ot,ms as ae,n4 as wt,n6 as Un,bB as Fn,kH as Bn,kE as _n,n5 as Ee,n3 as ue,OA as Vn,nm as st,A$ as xt,OB as Rt,rQ as Pt,os as jn,j8 as Mn,OC as Ln,J5 as ct,J4 as ke,OD as it,jz as zn,OE as $n,OF as Gn,OG as qn,OH as Jn,mK as Kn,OI as Yn,OJ as Nn,OK as Zn,nc as Hn,jm as Qn,jd as Wn,OL as Xn,jl as lt,Km as ea,OM as ta,ON as na,o_ as aa,oF as oa,oE as Fe,OO as sa,OP as ca,kS as ia,bp as la,kN as rt,kz as ra,OQ as da,gy as dt,fL as ua,kK as ma,uM as ha,OR as pa,nD as ga,ny as Ca,nC as Sa,nn as Ia,OS as fa,mS as ka,mH as Ea,ff as ut,n7 as ya,OT as va,OU as ba,OV as Ta,OW as Aa,OX as wa,OY as mt,pa as xa,on as Ra,o6 as ht,of as Pa,o2 as Da,ot as Oa,o7 as Ua,OZ as Fa,O_ as Ba,nM as _a,O$ as Va,nK as ja,nL as Ma,nI as La,oh as za}from"./zeni-epic-state-ZCc1K30S.js";import{I as Dt,a as Ot,i as ye,d as M,q as H,J as Ut,cq as $a,m as Ft,z as Ae,cr as Ga,ao as ve,cs as qa,B as Bt,ct as Ja,cu as Ka,al as Be,Q as Ya,j as Na,aI as Za,cv as Ha,aZ as Qa,w as Wa,D as Xa,cw as eo,O as to,cx as no}from"./index-CtIv1cPm.js";import{u as _t}from"./useAskAiCfoHostNavButtonProps-D6kPXOEr.js";import{c as Vt}from"./useFetchSuggestedQuestionsWhenReady-D_w411d6.js";import{c as pt,C as ao}from"./TransactionDetailScreen-Dq4Bv7Yw.js";import{w as oo}from"./withTransactionSidePanel-BRNXRpXy.js";import{h as so,v as co}from"./routePaths-CAPvhOau.js";import{g as _e}from"./accountMappingHelper-QKMWvJHt.js";import{D as io}from"./DrawerScreen-BAinUAiT.js";import"./recharts-BhJEeZEG.js";import"./lottie-DN0gYkdx.js";import"./analytics-vyykHm3I.js";import"./plaid-CP3hLhCR.js";import"./dnd-CDdU3ON0.js";import"./stripe-DMRn4zHo.js";import"./lexical-BzneVI9m.js";import"./pdf-C4rebPwh.js";import"./utils-ikosPjSL.js";import"./decodeURIComponentSafe-B_IVipCF.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]="02fbb218-cea8-4953-86b6-7563eb85452e",t._sentryDebugIdIdentifier="sentry-dbid-02fbb218-cea8-4953-86b6-7563eb85452e")}catch{}})();const lo=()=>{const{isAiCfoOpen:t,setIsAiCfoOpen:c}=Dt(),x=he(),A=It(),y=Ve(),r=V(p=>$e(p)),{useFeatureGate:m}=Ot(),{isFeatureEnabled:R}=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,O=!1)=>{x(me({tenantId:E,period:{month:p.month,year:p.year},refreshViewInBackground:O}))},[]),$=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),x(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),Y=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}=Ut();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&&x(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:R,onMonthEndCheckClick:p=>{A(`./${p}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:$,handleReviewButtonClick:Y,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 s}from"./liveblocks-ZAKgWoPK.js";import{a as r}from"./sentry-Bp45iw9z.js";import{V as c,X as d,Y as l,p}from"./index-
|
|
1
|
+
import{j as s}from"./liveblocks-ZAKgWoPK.js";import{a as r}from"./sentry-Bp45iw9z.js";import{V as c,X as d,Y as l,p}from"./index-CtIv1cPm.js";import"./mui-B8yatdty.js";import m from"./NotFoundScreen-DPOmbROX.js";import{j as u,u as b}from"./core-a8i-_0Kh.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]="eaf11e13-591f-4afe-82bb-7c7fc7a5da21",e._sentryDebugIdIdentifier="sentry-dbid-eaf11e13-591f-4afe-82bb-7c7fc7a5da21")}catch{}})();const D=()=>{const e=u(),a=b(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),f=r.useCallback(()=>{(()=>{const n=p(a.state?.pathnameStackToGoBack),i=n.poppedPathname??k();e(i,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=c(a.pathname);return o!=null?s.jsx(d,{menuItem:l(o),onDemoClick:t,onGoBack:f}):s.jsx(m,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{D as F};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as t}from"./liveblocks-ZAKgWoPK.js";import{l as b,k as g,j as I,u as y,h as Y,q as ee,g as A,N as te,n as ae,o as p}from"./core-a8i-_0Kh.js";import{Ig as S,Ih as k,Ii as N,yC as $,yo as L,Ij as C,Ik as ne,Il as oe,ys as ie,eN as j,yz as se,yw as le}from"./zeni-epic-state-ZCc1K30S.js";import{Z as x,o as r,x as re,d as v,h as E,W as de,p as ce,y as me,q as F,a as pe,i as ue,C as he,Q as ge,m as xe,B as fe,v as we,$ as be,S as ye,M as Se,w as ke,A as ve}from"./index-
|
|
1
|
+
import{j as t}from"./liveblocks-ZAKgWoPK.js";import{l as b,k as g,j as I,u as y,h as Y,q as ee,g as A,N as te,n as ae,o as p}from"./core-a8i-_0Kh.js";import{Ig as S,Ih as k,Ii as N,yC as $,yo as L,Ij as C,Ik as ne,Il as oe,ys as ie,eN as j,yz as se,yw as le}from"./zeni-epic-state-ZCc1K30S.js";import{Z as x,o as r,x as re,d as v,h as E,W as de,p as ce,y as me,q as F,a as pe,i as ue,C as he,Q as ge,m as xe,B as fe,v as we,$ as be,S as ye,M as Se,w as ke,A as ve}from"./index-CtIv1cPm.js";import{n as c}from"./mui-B8yatdty.js";import f from"./NotFoundScreen-DPOmbROX.js";import{a as P}from"./sentry-Bp45iw9z.js";import"./recharts-BhJEeZEG.js";import"./lottie-DN0gYkdx.js";import"./analytics-vyykHm3I.js";import"./plaid-CP3hLhCR.js";import"./dnd-CDdU3ON0.js";import"./stripe-DMRn4zHo.js";import"./lexical-BzneVI9m.js";import"./pdf-C4rebPwh.js";import"./utils-ikosPjSL.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]="b05961b4-e56b-4edf-9566-28f47ce155af",e._sentryDebugIdIdentifier="sentry-dbid-b05961b4-e56b-4edf-9566-28f47ce155af")}catch{}})();const je=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-ZAKgWoPK.js";import{a as f}from"./sentry-Bp45iw9z.js";import{h as U,u as _,j as w,q as M,g as l,N as T}from"./core-a8i-_0Kh.js";import{z as r,m as P,D as V,e as A,d as N,f as R,s as $,$ as q,g as W}from"./index-
|
|
1
|
+
import{j as u}from"./liveblocks-ZAKgWoPK.js";import{a as f}from"./sentry-Bp45iw9z.js";import{h as U,u as _,j as w,q as M,g as l,N as T}from"./core-a8i-_0Kh.js";import{z as r,m as P,D as V,e as A,d as N,f as R,s as $,$ as q,g as W}from"./index-CtIv1cPm.js";import{eM as B,I0 as G,Ib as H,I1 as J,eN as K,fi as Q,I7 as X,fF as Y,cR as Z,Ic as ee,Id as te}from"./zeni-epic-state-ZCc1K30S.js";import{n as ne}from"./mui-B8yatdty.js";import{u as se}from"./useDeviceId-AHvFaHki.js";import{f as ae}from"./analyticsHelper-UdYvDCQO.js";import{t as ie}from"./getLocaleForTenant-B5XIMdPl.js";import"./recharts-BhJEeZEG.js";import"./lottie-DN0gYkdx.js";import"./analytics-vyykHm3I.js";import"./plaid-CP3hLhCR.js";import"./dnd-CDdU3ON0.js";import"./stripe-DMRn4zHo.js";import"./lexical-BzneVI9m.js";import"./pdf-C4rebPwh.js";import"./utils-ikosPjSL.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="a56af1ff-d798-4cd2-9533-c65c1665dc5d",t._sentryDebugIdIdentifier="sentry-dbid-a56af1ff-d798-4cd2-9533-c65c1665dc5d")}catch{}})();const D=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function De(){const t=U(),a=_(),m=w(),[y]=M(),n=y.get("token"),p=y.get("stytch_token_type"),g=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:x,magicLinkEmail:c,verifyDeviceFetchState:z,resendVerifyDeviceOTPFetchState:C}=l(e=>e.tenantState),I=l(e=>e.tenantState.fetchState),b=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)),k=l(e=>G(e)),E=r.getSignedInUser(),v=P().mode;f.useEffect(()=>{s?.zeniSessionId==null&&n!=null&&D(n,p)&&i!=null&&g!=null&&(r.saveMagicLinkTriggered(n),t(H(n,i,g)))},[n,p,t,i,g,s?.zeniSessionId]),f.useEffect(()=>{S!=="In-Progress"||I!=="Completed"&&b!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(J(k.tenantsInOrder),s.zeniSessionId),K(s.userId,s.zeniSessionId,o.tenantId),t(Q(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(X("Completed")),V.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,k.tenantsInOrder),Y().then(()=>{const e=W();e!=null&&A(e)}),setTimeout(()=>{N.trackLogin(R.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[S,I,b,s,o,k,v,a.state,t]);const F=f.useCallback(()=>{m("/signin/auth")},[m]),j=f.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),O=f.useCallback(e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))},[i,n,t,c,d]);if(h==="Completed"&&d!=null)return u.jsx($,{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=a.state?.origin??"/";return u.jsx(T,{to:e,state:{...a.state,origin:""}})}if(!D(n,p)||g==null||h==="Error"){const e=a.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...a.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(q,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
|
|
2
2
|
position: fixed;
|
|
3
3
|
top: 0;
|
|
4
4
|
left: 0;
|