@zeniai/web-app-ui 5.0.46-qa → 5.0.47-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-DEffjM4V.js +1 -0
- package/dist/assets/AddressScreen-C0TWVvXe.js +9 -0
- package/dist/assets/{AiCfoScreen-BR2gI7w1.js → AiCfoScreen-B8ap6-MG.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-DHFtncme.js → BillPayApprovalRoutes-Xw8257ml.js} +1 -1
- package/dist/assets/{BillPayRoutes-hXAlOtj4.js → BillPayRoutes-luhlQpKC.js} +1 -1
- package/dist/assets/{BusinessVerificationPageScreen-BqUT0xD4.js → BusinessVerificationPageScreen-CqQ_omUW.js} +2 -2
- package/dist/assets/{ChargeCardRoutes-Cno91O0n.js → ChargeCardRoutes-Bs8iaCmn.js} +8 -8
- package/dist/assets/{CompanyPassportScreen-_blyJsgr.js → CompanyPassportScreen-DyU_ZDQx.js} +1 -1
- package/dist/assets/{ConnectionAuthScreen-CiXFjvbJ.js → ConnectionAuthScreen-Dm-PlDJC.js} +1 -1
- package/dist/assets/CustomerOnboardingAuthScreen-CqNEbjm6.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-BFn72jKd.js → CustomerOnboardingRoutes-CvugmrGw.js} +3 -3
- package/dist/assets/{DashboardRoutes-Blg4Eagn.js → DashboardRoutes-BaDlv1ui.js} +3 -3
- package/dist/assets/{DefaultTenantHome-D-YzLiVe.js → DefaultTenantHome-Bjb_ZrgN.js} +1 -1
- package/dist/assets/DomesticWireDetailScreen-NYijI56R.js +18 -0
- package/dist/assets/DrawerScreen-DOMIjFSz.js +1 -0
- package/dist/assets/EntityDetailRoutes-CeS1kRSx.js +1 -0
- package/dist/assets/{ExpenseAutomationRoutes-jL6xIMea.js → ExpenseAutomationRoutes-ByG8iQUP.js} +4 -4
- package/dist/assets/FeaturePreviewScreen-DoT3E5vI.js +1 -0
- package/dist/assets/MagicLinkRoutes-C9jnlzdC.js +72 -0
- package/dist/assets/MagicLinkSignInScreen-ay7Jnk9U.js +12 -0
- package/dist/assets/{MobileAppDrawer--SYgHMNh.js → MobileAppDrawer-D3j8weyp.js} +1 -1
- package/dist/assets/NotFoundScreen-De47ajWC.js +1 -0
- package/dist/assets/{NotificationRoutes-fy3UiaKC.js → NotificationRoutes-Dkf2EPbj.js} +1 -1
- package/dist/assets/PandLWithForecastRoutes-Dgml3Nhq.js +1 -0
- package/dist/assets/PeopleRoutes-CPUEKeFO.js +22 -0
- package/dist/assets/PerformanceRoutes-DcAu4Gtb.js +1 -0
- package/dist/assets/{Preview-D9rr53Ca.js → Preview-CVbnKD-z.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-Dsf7wMD-.js → QBOConnectionScreen-mXYDBBvY.js} +1 -1
- package/dist/assets/{ReferralListScreen-ChSQha9w.js → ReferralListScreen-xYIRVuW3.js} +2 -2
- package/dist/assets/ReimbursementApprovalRoutes-bRgvAbbT.js +1 -0
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BBDkJxY1.js → ReimbursementApprovalRuleDetailScreen-xEaP92yk.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-DtqGfZQO.js → ReimbursementRoutes-B4T4iEWF.js} +4 -4
- package/dist/assets/{ReportsRoutes-DOniso1Y.js → ReportsRoutes-tOmX5q9K.js} +1 -1
- package/dist/assets/RewardsRoutes-GQdJVaGO.js +1 -0
- package/dist/assets/ScreenRoutes-BA781Aca.js +2 -0
- package/dist/assets/{SettingsRoutes-CTPtYOB2.js → SettingsRoutes-Cf5O-2xb.js} +7 -7
- package/dist/assets/{SetupPagesScreen-0rmf93Dt.js → SetupPagesScreen-DyO-IN3i.js} +5 -5
- package/dist/assets/SignInScreen-DVG7wK-9.js +1 -0
- package/dist/assets/SignOutScreen-C9tnVdG5.js +9 -0
- package/dist/assets/{TaskListScreen-BKUzMmyi.js → TaskListScreen-cDk45jDj.js} +2 -2
- package/dist/assets/TaskRoutes-_thiA5bv.js +9 -0
- package/dist/assets/TransactionDetailRoutes-DJjUAxdE.js +1 -0
- package/dist/assets/{TransactionDetailScreen-C45CSgCt.js → TransactionDetailScreen-DOVDrZxO.js} +2 -2
- package/dist/assets/{TransactionListRoutes-Dy4eFzUa.js → TransactionListRoutes-BJePRZ2k.js} +1 -1
- package/dist/assets/{TreasuryRoutes-BdDX9ZLB.js → TreasuryRoutes-DCl94cwV.js} +5 -5
- package/dist/assets/{VendorsRoutes-Dl02Llav.js → VendorsRoutes-DMmLVIo7.js} +1 -1
- package/dist/assets/WiseConfirmationScreen-CJMrB6jj.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-D-9zCZjc.js → ZeniAccountRoutes-C6v8u1LY.js} +10 -10
- package/dist/assets/ZeniAccountStatementScreen-6YxM0wYY.js +9 -0
- package/dist/assets/{accountMappingHelper-11rWzEVK.js → accountMappingHelper-BIVTEgcE.js} +1 -1
- package/dist/assets/{analytics-G2IGQMBx.js → analytics-CgBmxqZY.js} +1 -1
- package/dist/assets/{analyticsHelper-Ba1CWpbC.js → analyticsHelper-BsvvXvsU.js} +1 -1
- package/dist/assets/{core-wdixcJGy.js → core-C4fxU83C.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-C5AZz8lB.js → decodeURIComponentSafe-B_w_tz2w.js} +1 -1
- package/dist/assets/{dnd-zypUBS1u.js → dnd-DoZPzASs.js} +1 -1
- package/dist/assets/{empty-qVO6jyU-.js → empty-DcuTv7hF.js} +1 -1
- package/dist/assets/{empty-BXcIqiuj.js → empty-DsiUKQ52.js} +1 -1
- package/dist/assets/{emptyVideoElement-bCayGK6i.js → emptyVideoElement-Dj7Nh9SQ.js} +1 -1
- package/dist/assets/{epic-DmxT1xya.js → epic-HjZn06SY.js} +1 -1
- package/dist/assets/getLocaleForTenant-eE3oogFE.js +1 -0
- package/dist/assets/{index-Bn0uHJTn.js → index--Cd35uEM.js} +2 -2
- package/dist/assets/{index-CFqhhpoy.js → index-6F_6XQcw.js} +1 -1
- package/dist/assets/{index-jrt3mMuz.js → index-CR-fdld5.js} +1 -1
- package/dist/assets/{index-D6oL4m6Q.js → index-CeIn9Zfj.js} +1 -1
- package/dist/assets/{index-DKtQQWiY.js → index-Ckao8u8S.js} +11825 -11809
- package/dist/assets/{index-CnhOhawg.js → index-CylxtI7w.js} +1 -1
- package/dist/assets/{index-WZzhu4Px.js → index-Djb1CWmh.js} +1 -1
- package/dist/assets/{lexical-C-QOY2-d.js → lexical-jcYOTomA.js} +1 -1
- package/dist/assets/{liveblocks-Dg-fyTMV.js → liveblocks-DOxb6osM.js} +1 -1
- package/dist/assets/{lottie-CwpADPvV.js → lottie-BW8IlxIq.js} +1 -1
- package/dist/assets/{mui-DJdtEuia.js → mui-CJ5-H5s3.js} +1 -1
- package/dist/assets/{pathToGoBack-DIssYx7R.js → pathToGoBack-BE3rDbiw.js} +1 -1
- package/dist/assets/{pdf-BJH97oh9.js → pdf-CSGP82Vc.js} +4 -4
- package/dist/assets/{pdf-lib-CrnNGODm.js → pdf-lib-C3yO76xY.js} +1 -1
- package/dist/assets/{plaid-Bjhyc1hA.js → plaid-B0tTAlSw.js} +1 -1
- package/dist/assets/{pusher-CD1J3iFt.js → pusher-XKENRp06.js} +1 -1
- package/dist/assets/{react-D_kI0eWa.js → react-BcsqJL6E.js} +1 -1
- package/dist/assets/{react-DYmbAUbW.js → react-Bq8DAh0P.js} +1 -1
- package/dist/assets/{react-BhXZbE7u.js → react-CaM8HYf7.js} +1 -1
- package/dist/assets/{react-nVm5lYAO.js → react-DEZPWQD-.js} +1 -1
- package/dist/assets/{react-DpgEVvlZ.js → react-DIMSn83_.js} +1 -1
- package/dist/assets/{react-BgTSDFYk.js → react-DWgyx8QG.js} +1 -1
- package/dist/assets/{recharts-eHKNWuPW.js → recharts-95y0DFZP.js} +1 -1
- package/dist/assets/{routePaths-D74B3ANG.js → routePaths-Dxwhh-fn.js} +1 -1
- package/dist/assets/{sentry-CNayqfac.js → sentry-CRdlKM_1.js} +1 -1
- package/dist/assets/{url-BCEr2WPz.js → url-CqWxRgdR.js} +1 -1
- package/dist/assets/{url-wKh_L2kf.js → url-UTVlotdk.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-BGS1w2nN.js +1 -0
- package/dist/assets/{useDeviceId-DUb-oUrb.js → useDeviceId-DUeztkWP.js} +1 -1
- package/dist/assets/useFetchSuggestedQuestionsWhenReady-DxGAt9QA.js +1 -0
- package/dist/assets/{useInitialThreadRequest-Bo086y1W.js → useInitialThreadRequest-cTEqQuCA.js} +1 -1
- package/dist/assets/{utils-CTYAiaC-.js → utils-CLosk-TB.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-CAGurxbY.js → withTransactionSidePanel-DQtRQJvv.js} +3 -3
- package/dist/assets/{zeni-epic-state-CMWGtUDg.js → zeni-epic-state-Ba45HhdX.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +2 -2
- package/dist/assets/AddressRoutes-CCjTOVG4.js +0 -1
- package/dist/assets/AddressScreen-D6PcPZrO.js +0 -9
- package/dist/assets/CustomerOnboardingAuthScreen-BnOmXpvP.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-Cy7TeR7U.js +0 -18
- package/dist/assets/DrawerScreen-D8OAj20r.js +0 -1
- package/dist/assets/EntityDetailRoutes-DPg6P695.js +0 -1
- package/dist/assets/FeaturePreviewScreen-DIoGwyd-.js +0 -1
- package/dist/assets/MagicLinkRoutes-CG3qwGNE.js +0 -72
- package/dist/assets/MagicLinkSignInScreen-D1W0gjWT.js +0 -12
- package/dist/assets/NotFoundScreen-CMvG7XF_.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-DJGktc7W.js +0 -1
- package/dist/assets/PeopleRoutes-B7I7Z6Cn.js +0 -22
- package/dist/assets/PerformanceRoutes-B5T0Ypve.js +0 -1
- package/dist/assets/ReimbursementApprovalRoutes-Dy5divoy.js +0 -1
- package/dist/assets/RewardsRoutes-Ddoi6BMb.js +0 -1
- package/dist/assets/ScreenRoutes-Doocxquy.js +0 -2
- package/dist/assets/SignInScreen-Cs2_uCY4.js +0 -1
- package/dist/assets/SignOutScreen-BPZN73S_.js +0 -9
- package/dist/assets/TaskRoutes-Uyg1VY9p.js +0 -9
- package/dist/assets/TransactionDetailRoutes-BxiAre5t.js +0 -1
- package/dist/assets/WiseConfirmationScreen-CtXZS3c0.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-CLegG4Iq.js +0 -9
- package/dist/assets/getLocaleForTenant-C-xfjETB.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-D_rHUMYx.js +0 -1
- package/dist/assets/useFetchSuggestedQuestionsWhenReady-D-ilcAbE.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-
|
|
1
|
+
import{j as u}from"./liveblocks-DOxb6osM.js";import{j as X,u as Q,h as Y,l as G,g as E,N as M,k as W,q as Qe}from"./core-C4fxU83C.js";import{bD as Ye,cj as Ie,M7 as ye,eN as x,cv as en,xe as Z,x3 as nn,Mj as tn,Mm as an,pF as ee,pt as ne,j$ as te,rE as z,Mo as Ae,fA as $e,fz as Ge,fy as We,Mp as sn,xn as on,Be as ke,B5 as _e,B2 as ve,AV as K,B8 as Pe,Bb as Ee,Bh as we,s6 as Te,fP as cn,cq as rn,eT as un,eR as dn,eS as ln,bs as pn,Mq as mn,zX as le,Az as yn,Mr as fn,bE as gn,Cu as pe,By as Sn,Ms as bn,Mt as hn,Cy as Cn,CC as In,rx as An,GI as kn,D7 as Ce,E0 as me,Mu as _n,Mv as vn,Mw as Pn,Mx as He,My as En,J1 as wn,Lw as Tn,Jd as Dn,Mz as qe,MA as Fe,Dl as Ke,k7 as Un,pw as Je,rG as On,bC as je,rS as Me,ct as Bn,MB as Xe,fc as Fn,CR as xn,CV as Vn,MC as jn,Da as Re,MD as Mn,ME as Rn,MF as zn,MG as Nn,fI as Ln,yy as Zn,MH as $n,yD as Gn,yC as Wn}from"./zeni-epic-state-Ba45HhdX.js";import{A as ae,a as ie,d as de,h as De,aI as J,z as T,y as se,e as w,x as Ue,g as $,bp as Hn,ao as oe,bq as V,br as qn,bs as Kn,aa as Ve,bt as Jn,s as ze,ap as Ne,k as Xn,F as Qn,bu as Yn,bv as et,bw as nt,a1 as tt}from"./index-Ckao8u8S.js";import{a as C}from"./sentry-CRdlKM_1.js";import{n as xe,D as at,S as it}from"./mui-CJ5-H5s3.js";import{M as fe}from"./MobileAppDrawer-D3j8weyp.js";import R from"./NotFoundScreen-De47ajWC.js";import{a as Le}from"./analyticsHelper-BsvvXvsU.js";import{c as Ze}from"./routePaths-Dxwhh-fn.js";import{B as Be}from"./BusinessVerificationPageScreen-CqQ_omUW.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]="8ab0a9d9-2a90-426f-a59a-fe85a7642600",e._sentryDebugIdIdentifier="sentry-dbid-8ab0a9d9-2a90-426f-a59a-fe85a7642600")}catch{}})();const st=xe.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,7 +6,7 @@ import{j as u}from"./liveblocks-Dg-fyTMV.js";import{j as X,u as Q,h as Y,l as G,
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,ot=W(function(e,o){const{isUserBillPayAdmin:t,companyId:a}=o,c=F(e),n=tn(e),i=T.getSignedInUser(),l=c.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},r=an(e,a),p=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",y=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{billPaySetupView:r,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:y,showIntlWiseWidget:o.showIntlWiseWidget,isDisabled:p,billpayApprovalView:n,meetingUrl:"https://meetings.hubspot.com/snehals/demo-bill-pay?embed=true",analytics:E,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:s}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyBillPayInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(Z(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(Te("bill_pay_setup",n,i))},onEstablishConnectionClick:n=>{e(Ee(n,a,"bill_pay_setup","bill_pay"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(we(n,i,"bill_pay","bill_pay_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Pe(!1,n,"bill_pay","bill_pay_setup",i))},onEstablishConnectionSuccess:()=>{e(Z(a,!0))},onEnableBillPayClick:()=>{e(K(a,"bill_pay"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?_e(n,i,"bill_pay","bill_pay_setup"):ve("reimbursement_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(ke(a,"bill_pay_setup",n,i))},onEnableBillPaySuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?t("../.."):t("../",{relative:"path"})},onAcceptUpdatedTOS:()=>{e(on(a))},onAcceptUpdatedTOSSuccess:()=>{e(Z(a,!0))},onGetOtp:(n,i)=>{e(We(n,"SpendManagementSetup")),i!=null&&e(sn({officerType:i,phone:n}))},onResendOtp:n=>{e(Ge(n,"SpendManagementSetup"))},onVerifyOtp:(n,i)=>{e($e(n,i,"SpendManagementSetup"))},onVerifyOtpSuccess:(n,i)=>{n!=null&&i!=null&&e(z(a,n,"bill_pay",!0,!0))},onNavigateToDashboard:()=>{t("../../dashboard")},onNavigateToSettings:()=>{t("../bills/setup")},onInternationPaymentSetUpClick:()=>{t("../international-wire")},onCompanyOfficerUpdated:(n,i)=>{e(Ae({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(z(a,n,"bill_pay",!0,!0,!0))},updateFilesEntity:n=>{e(te({files:n}))},onDeleteFile:n=>{e(ne(n))},onEditFileName:(n,i)=>{e(ee(n,i.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(Hn),ct=()=>{const e=X(),o=Q(),t=Y(),{tenantEmailDomain:a}=G(),c=ae(),n=Ye(c?.loggedInUserRoleMap),i=Ie(c?.loggedInUserRoleMap),{useFeatureGate:l,useDynamicConfig:s}=ie(),{isFeatureEnabled:r}=l(de.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:p}=l(de.isBillPayLocalCurrencyFeatureEnabled),y=De(),{configValue:I}=s(J.zeniAccountsConfig),d=ye(I),[m,S]=C.useState(!1),v=C.useRef(!1),[g,f]=C.useState(!1),P=w(B=>B.billPaySetupViewState.fetchState),A=w(B=>F(B)),_=w(B=>B.billPaySetupApproverViewState.fetchState),b=A.companyId??T.getSignedInUserTenant(a)?.companyId;if(T.getSignedInUser()==null)throw Error("Can't access bill pay setup page without signing in...");const k=!!A.companyBillPayInfo?.info?.isBillPayTOSAccepted,h=en(c?.loggedInUserRoleMap);C.useEffect(()=>{v.current||P!=="Not-Started"||b==null?v.current||P!=="Completed"||b==null||A.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(v.current=!0,t(Z(b,!1,!0))):(v.current=!0,t(Z(b,!0)))},[P,b,t]),C.useEffect(()=>{g||_!=="Not-Started"||(f(!0),t(nn(!0)))},[g,_,t]);const D=B=>{S(B)};if(k===!1||h&&!c?.loggedInUserRoleMap?.bill_pay_admin)return u.jsx(M,{to:"../promo"});if(k===!0&&c?.loggedInUserRoleMap!=null){const B=U=>U.trackPageLoaded($.Event.billPaySetup);return u.jsxs(st,{children:[u.jsx(se,{analytics:E,onLoad:U=>B(U)}),u.jsx(fe,{isAppContentDrawerOpen:m,handleDrawerToggle:D}),u.jsx(ot,{navigate:e,location:o,companyId:b,currentTenant:A,isUserBillPayAdmin:n,showIntlWiseWidget:r,onClickMenuIcon:()=>{D(!0)},hasZeniAccountsAdminAccess:i,accountsPromoConfig:d,isLocalCurrencyEnabled:p})]})}return u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:y.colors.grey5}})},Rt=(e,o)=>e!=null&&function(t){return t==="debit"||t==="credit"||t==="debit_and_credit"}(e)?e:o,zt=e=>`/${e}/cards`,Nt=e=>`/${e}/cards/setup`,Lt=e=>`/${e}/cards/onboard`,Zt=(e,o,t,a,c=!1)=>{let n=`/${e}/cards/${encodeURIComponent(o)}`;return a==null||a.status.code!=="inactive"||a.cardHolderUserId!==t.userId||a.type.code!=="business_physical_credit_card"&&a.type.code!=="business_physical_debit_card"?a!=null&&a.status.code==="active"&&a.cardHolderUserId===t.userId&&a.type.code==="business_physical_credit_card"&&c===!0?n+="/addToWallet":a==null||a.type.code!=="business_physical_debit_card"&&a.type.code!=="business_virtual_debit_card"||a.status.code!=="active"||a.cardHolderUserId!==t.userId||a.isPinSet!==!1||(n+="/setPin"):n+="/activate",n},$t=(e,o)=>e.find(t=>t.id===o),Gt=(e,o,t)=>!e||!o||t.fetchState==="Completed",rt=(e,o,t,a)=>({isCreditCardOffered:e,isDebitCardOffered:o,isDebitCardEnabled:t,isCreditCardEnabled:a}),Wt=(e,o)=>e?{creditCardCashbackOffer:`${o.cashbackAnalytics.creditCardCashbackOffer}%`,debitCardCashbackOffer:`${o.cashbackAnalytics.debitCardCashbackOffer}%`,totalEarnedCashback:V(o.cashbackSummary.cashbackEarned.amount),redeemedCashback:V(o.cashbackSummary.cashbackRedeemed.amount),availableCashback:V(o.cashbackSummary.cashbackAvailable.amount),creditCardCashbackRedemptionMode:o.cashbackAnalytics.creditCardCashbackRedemptionMode,debitCardCashbackRedemptionMode:o.cashbackAnalytics.debitCardCashbackRedemptionMode}:void 0,Ht=(e,o,t,a,c)=>e&&o&&t?{creditAccountId:a.id,creditAccountLimit:V(a.limit.amount),creditAccountAvailableAmount:V(a.available.amount),creditAccountSpentAmount:V(a.balance.amount+a.hold.amount),creditAccountStatus:a.status,outstandingBalance:V(c.remainingAmountDue.amount)}:void 0,qt=(e,o,t,a,c)=>e&&o&&t?{debitAccountId:a.depositAccounts.map(n=>n.id),debitAccountName:a.depositAccounts.map(n=>n.accountName),debitAccountBalance:a.depositAccounts.map(n=>V(n.accountBalance.available.amount)),debitCardsSpend:V(c?.currentMonthSpends.amount??0),debitAccountStatus:a.depositAccounts.map(n=>n.accountStatus)}:void 0,Kt=(e,o)=>e&&o.depositAccountLimit!=null&&o.chargeCard!=null?{debitAccountId:o.depositAccountLimit.id,debitAccountName:o.depositAccountLimit?.accountName??o.connectedAccount?.accountName,debitAccountBalance:V(o.depositAccountLimit?.accountBalance.available.amount),debitCardsSpend:V(o.chargeCard.limit.amount-o.chargeCard.available.amount),debitAccountStatus:o.depositAccountLimit?.accountStatus??o.connectedAccount?.accountStatus}:void 0,Jt=80,Xt=80,ut=({isBankingOnlyTenant:e,isDebitCardFeatureEnabled:o})=>o||e,dt=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t,isDebitCardProductVisible:a,chargeCardsCreditAccountLimit:c})=>(e||o||t)&&(!a||c>0),Qt=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t})=>e||o||t,Yt=({cardInfo:e,isProductVisible:o,isTOSAccepted:t,isSetupEnabled:a,isUserHasCardsAdminLevelAccess:c,isUserHasCardsAccess:n})=>!!e&&o&&(!t&&c||n&&!c&&!a),lt=W(function(e,o){const{isUserChargeCardAdmin:t,chargeCardSetUpView:a,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n}=o,i=F(e),l=T.getSignedInUser(),s=i.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},p=t&&a.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&a.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",y=!!i.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{chargeCardSetUpView:a,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:y,isDisabled:p,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:E,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:r}},function(e,o){const{navigate:t,companyId:a,currentTenant:c,chargeCardSetUpView:n,isDebitCardTOSAccepted:i,isChargeCardTOSAccepted:l,isChargeCardSetupEnabled:s,isDebitCardSetupEnabled:r,productInformation:p,controllerEmails:y,businessVerificationStatus:I}=o;return{onBusinessVerificationSectionClick:()=>{E.trackCardsVerifyIdentityCompanyDetailsClick(y,p,I?.code),t("../verification"),c?.company?.companyChargeCardInfo!=null&&c.company.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(le(a,!1,!0))},onFetchLinkTokenClick:(d,m)=>{e(Te("charge_card_setup",d,m))},onEstablishConnectionClick:d=>{e(Ee(d,a,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(d,m,S)=>{e(we(d,m,"charge_cards","charge_card_setup",S))},onUpdatePaymentAccountLoginStatus:(d,m)=>{e(Pe(!1,d,"charge_cards","charge_card_setup",m))},onEstablishConnectionSuccess:()=>{e(le(a,!0))},onEnableChargeCardClick:()=>{E.trackCardsEnableCardsClick(y,p,"Cards Card Setup"),l===!0&&i===!0&&s===!1&&r===!1?e(K(a,"charge_cards__debit_cards")):l===!0&&s===!1?e(K(a,"charge_cards")):i===!0&&r===!1&&e(K(a,"debit_cards"))},onUpdateChargeCardClick:(d,m,S)=>{const v=n.allBankAccounts.find(f=>f.accountId===n.primaryFundingAccount?.zeniAccountId),g=n.allBankAccounts.find(f=>f.accountId===d);E.trackCardsZeniCashAccountChangeClick(y,p,{oldZeniCashAccount:v?.accountName??"",newZeniCashAccount:g?.accountName??"",oldZeniCashAccountPosition:n.allBankAccounts.findIndex(f=>f.accountId===n.primaryFundingAccount?.zeniAccountId)+1,newZeniCashAccountPosition:n.allBankAccounts.findIndex(f=>f.accountId===d)+1,numberOfCashAccounts:n.allBankAccounts.length}),e(S==="paymentAccount"?_e(d,m,"charge_cards","charge_card_setup"):ve("charge_card_setup",d,m))},onUpdatePrimaryFundingAccount:(d,m)=>{const S=n.allFundingAccounts.find(f=>f.id===d),v=n.allFundingAccounts.findIndex(f=>f.id===n.primaryFundingAccount?.id)+1,g=n.allFundingAccounts.findIndex(f=>f.id===d)+1;E.trackCardsPaymentAccountChangeClick(y,p,{oldPaymentAccountName:n.primaryFundingAccount?.label??"",oldPaymentAccountBalance:V(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:S?.label??"",newPaymentAccountBalance:V(S?.accountBalance?.available?.amount??0),isOldPaymentAccountRecommended:n.primaryFundingAccount?.accType==="depositAccount",isNewPaymentAccountRecommended:S?.accType==="depositAccount",oldPaymentAccountPosition:v,newPaymentAccountPosition:g,numberOfPaymentAccounts:n.allFundingAccounts.length}),e(ke(a,"charge_card_setup",d,m))},onEnableChargeCardSuccess:()=>{e(fn()),t("../",{relative:"path"})},onBackClick:()=>{c?.companyChargeCardInfo?.info?.isChargeCardEnabled||c?.companyDebitCardInfo?.info?.isDebitCardEnabled?t("../",{relative:"path"}):t("../..",{relative:"path"})},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(d,m)=>{e(Ae({officerType:d,fileIds:m}))},onSendForVerificationClick:d=>{l===!0&&i===!0?e(z(a,d,"charge_cards__debit_cards",!0,!0,!0)):l===!0?e(z(a,d,"charge_cards",!0,!0,!0)):i===!0&&e(z(a,d,"debit_cards",!0,!0,!0))},updateFilesEntity:d=>{e(te({files:d}))},onDeleteFile:d=>{e(ne(d))},onEditFileName:(d,m)=>{e(ee(d,m.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onUpdateAutoPayClick:d=>{e(yn(a,d))}}})(qn),pt=()=>{const e=X(),o=Q(),t=Y(),{tenantEmailDomain:a}=G(),c=ae(),n=w(N=>F(N)),{useDynamicConfig:i,useFeatureGate:l}=ie(),s=o.state?.pathnameStackToGoBack?.[0],{configValue:r}=i(J.zeniAccountsConfig),{configValue:p}=i(J.zeniCardsConfig),y=p.credit_card_auto_pay_threshold_by_company_id?.[n.companyId]??p.default_credit_card_auto_pay_threshold??80,{isFeatureEnabled:I}=l(de.isDebitCardFeatureEnabled),{isFeatureEnabled:d}=l(de.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=l(de.isEarlyPayFeatureEnabled),S=w(N=>cn(N,n.companyId)),v=rn(S.controllers),g=!!n.company?.companyChargeCardInfo.isChargeCardEnabled,f=!!n.company?.companyDebitCardInfo.isDebitCardEnabled,P=un(I,n),A=ut({isDebitCardFeatureEnabled:I,isBankingOnlyTenant:P}),_=dn(n),b=ln(n),k=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,h=dt({isCardsOnlyTenant:_,isChargeCardFeatureEnabled:d,isBookKeepingTenant:b,isDebitCardProductVisible:A,chargeCardsCreditAccountLimit:k}),D=A&&h===!1,B=A===!1&&h,U=ye(r),x=pn(c?.loggedInUserRoleMap),ce=Ie(c?.loggedInUserRoleMap),[H,ge]=C.useState(!1),[q,re]=C.useState(!1),L=w(N=>N.chargeCardSetupViewState.fetchState),j=T.getSignedInUserTenant(a)?.companyId??n.companyId,O=T.getSignedInUser(),Oe=N=>{ge(N)},Se=w(N=>mn(N,j));if(O==null)throw Error("Can't access charge card setup page without signing in...");C.useEffect(()=>{q||L!=="Not-Started"||j==null?q||L!=="Completed"||j==null||n.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(le(j,!1,!0)):(re(!0),t(le(j,!0)))},[q,L,j,t]);const be=!!n.company?.companyChargeCardInfo.isChargeCardTOSAccepted,he=!!n.company?.companyDebitCardInfo.isDebitCardTOSAccepted,ue=rt(h,A,f,g);return be||he?be||he?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:E,onLoad:()=>{E.trackPageLoaded($.Event.cardsSetupVisited),E.trackCardsCardSetupView(v,ue,s==null?"Cards Setup":s.includes("cards/promo")?"Promo":s.includes("cards")?"Settings":"Cards Tab")}}),u.jsx(fe,{isAppContentDrawerOpen:H,handleDrawerToggle:Oe}),u.jsx(lt,{autoPayThreshold:y,navigate:e,location:o,companyId:j,currentTenant:n,isEarlyPayEnabled:m,isChargeCardTOSAccepted:be,isDebitCardTOSAccepted:he,isUserChargeCardAdmin:x,isDebitCardOnlyEnabled:D,isCreditCardOnlyEnabled:B,chargeCardSetUpView:Se,isCreditCardProductVisible:h,isDebitCardFeatureEnabled:A,isChargeCardSetupEnabled:g,isDebitCardSetupEnabled:f,businessVerificationStatus:n.companyBillPayInfo?.info?.businessVerificationStatus,controllerEmails:v,productInformation:ue,onClickMenuIcon:()=>{Oe(!0)},hasZeniAccountsAdminAccess:ce,accountsPromoConfig:U})]}):u.jsx(Ue,{fetchState:"Not-Started"}):u.jsx(M,{to:"../promo"})},mt=Fe.div`
|
|
9
|
+
`,ot=W(function(e,o){const{isUserBillPayAdmin:t,companyId:a}=o,c=x(e),n=tn(e),i=T.getSignedInUser(),l=c.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},r=an(e,a),p=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",y=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{billPaySetupView:r,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:y,showIntlWiseWidget:o.showIntlWiseWidget,isDisabled:p,billpayApprovalView:n,meetingUrl:"https://meetings.hubspot.com/snehals/demo-bill-pay?embed=true",analytics:w,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:s}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyBillPayInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(Z(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(Te("bill_pay_setup",n,i))},onEstablishConnectionClick:n=>{e(we(n,a,"bill_pay_setup","bill_pay"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(Ee(n,i,"bill_pay","bill_pay_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Pe(!1,n,"bill_pay","bill_pay_setup",i))},onEstablishConnectionSuccess:()=>{e(Z(a,!0))},onEnableBillPayClick:()=>{e(K(a,"bill_pay"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?_e(n,i,"bill_pay","bill_pay_setup"):ve("reimbursement_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(ke(a,"bill_pay_setup",n,i))},onEnableBillPaySuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?t("../.."):t("../",{relative:"path"})},onAcceptUpdatedTOS:()=>{e(on(a))},onAcceptUpdatedTOSSuccess:()=>{e(Z(a,!0))},onGetOtp:(n,i)=>{e(We(n,"SpendManagementSetup")),i!=null&&e(sn({officerType:i,phone:n}))},onResendOtp:n=>{e(Ge(n,"SpendManagementSetup"))},onVerifyOtp:(n,i)=>{e($e(n,i,"SpendManagementSetup"))},onVerifyOtpSuccess:(n,i)=>{n!=null&&i!=null&&e(z(a,n,"bill_pay",!0,!0))},onNavigateToDashboard:()=>{t("../../dashboard")},onNavigateToSettings:()=>{t("../bills/setup")},onInternationPaymentSetUpClick:()=>{t("../international-wire")},onCompanyOfficerUpdated:(n,i)=>{e(Ae({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(z(a,n,"bill_pay",!0,!0,!0))},updateFilesEntity:n=>{e(te({files:n}))},onDeleteFile:n=>{e(ne(n))},onEditFileName:(n,i)=>{e(ee(n,i.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(Hn),ct=()=>{const e=X(),o=Q(),t=Y(),{tenantEmailDomain:a}=G(),c=ae(),n=Ye(c?.loggedInUserRoleMap),i=Ie(c?.loggedInUserRoleMap),{useFeatureGate:l,useDynamicConfig:s}=ie(),{isFeatureEnabled:r}=l(de.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:p}=l(de.isBillPayLocalCurrencyFeatureEnabled),y=De(),{configValue:I}=s(J.zeniAccountsConfig),d=ye(I),[m,S]=C.useState(!1),v=C.useRef(!1),[g,f]=C.useState(!1),P=E(B=>B.billPaySetupViewState.fetchState),A=E(B=>x(B)),_=E(B=>B.billPaySetupApproverViewState.fetchState),b=A.companyId??T.getSignedInUserTenant(a)?.companyId;if(T.getSignedInUser()==null)throw Error("Can't access bill pay setup page without signing in...");const k=!!A.companyBillPayInfo?.info?.isBillPayTOSAccepted,h=en(c?.loggedInUserRoleMap);C.useEffect(()=>{v.current||P!=="Not-Started"||b==null?v.current||P!=="Completed"||b==null||A.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(v.current=!0,t(Z(b,!1,!0))):(v.current=!0,t(Z(b,!0)))},[P,b,t]),C.useEffect(()=>{g||_!=="Not-Started"||(f(!0),t(nn(!0)))},[g,_,t]);const D=B=>{S(B)};if(k===!1||h&&!c?.loggedInUserRoleMap?.bill_pay_admin)return u.jsx(M,{to:"../promo"});if(k===!0&&c?.loggedInUserRoleMap!=null){const B=U=>U.trackPageLoaded($.Event.billPaySetup);return u.jsxs(st,{children:[u.jsx(se,{analytics:w,onLoad:U=>B(U)}),u.jsx(fe,{isAppContentDrawerOpen:m,handleDrawerToggle:D}),u.jsx(ot,{navigate:e,location:o,companyId:b,currentTenant:A,isUserBillPayAdmin:n,showIntlWiseWidget:r,onClickMenuIcon:()=>{D(!0)},hasZeniAccountsAdminAccess:i,accountsPromoConfig:d,isLocalCurrencyEnabled:p})]})}return u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:y.colors.grey5}})},Rt=(e,o)=>e!=null&&function(t){return t==="debit"||t==="credit"||t==="debit_and_credit"}(e)?e:o,zt=e=>`/${e}/cards`,Nt=e=>`/${e}/cards/setup`,Lt=e=>`/${e}/cards/onboard`,Zt=(e,o,t,a,c=!1)=>{let n=`/${e}/cards/${encodeURIComponent(o)}`;return a==null||a.status.code!=="inactive"||a.cardHolderUserId!==t.userId||a.type.code!=="business_physical_credit_card"&&a.type.code!=="business_physical_debit_card"?a!=null&&a.status.code==="active"&&a.cardHolderUserId===t.userId&&a.type.code==="business_physical_credit_card"&&c===!0?n+="/addToWallet":a==null||a.type.code!=="business_physical_debit_card"&&a.type.code!=="business_virtual_debit_card"||a.status.code!=="active"||a.cardHolderUserId!==t.userId||a.isPinSet!==!1||(n+="/setPin"):n+="/activate",n},$t=(e,o)=>e.find(t=>t.id===o),Gt=(e,o,t)=>!e||!o||t.fetchState==="Completed",rt=(e,o,t,a)=>({isCreditCardOffered:e,isDebitCardOffered:o,isDebitCardEnabled:t,isCreditCardEnabled:a}),Wt=(e,o)=>e?{creditCardCashbackOffer:`${o.cashbackAnalytics.creditCardCashbackOffer}%`,debitCardCashbackOffer:`${o.cashbackAnalytics.debitCardCashbackOffer}%`,totalEarnedCashback:V(o.cashbackSummary.cashbackEarned.amount),redeemedCashback:V(o.cashbackSummary.cashbackRedeemed.amount),availableCashback:V(o.cashbackSummary.cashbackAvailable.amount),creditCardCashbackRedemptionMode:o.cashbackAnalytics.creditCardCashbackRedemptionMode,debitCardCashbackRedemptionMode:o.cashbackAnalytics.debitCardCashbackRedemptionMode}:void 0,Ht=(e,o,t,a,c)=>e&&o&&t?{creditAccountId:a.id,creditAccountLimit:V(a.limit.amount),creditAccountAvailableAmount:V(a.available.amount),creditAccountSpentAmount:V(a.balance.amount+a.hold.amount),creditAccountStatus:a.status,outstandingBalance:V(c.remainingAmountDue.amount)}:void 0,qt=(e,o,t,a,c)=>e&&o&&t?{debitAccountId:a.depositAccounts.map(n=>n.id),debitAccountName:a.depositAccounts.map(n=>n.accountName),debitAccountBalance:a.depositAccounts.map(n=>V(n.accountBalance.available.amount)),debitCardsSpend:V(c?.currentMonthSpends.amount??0),debitAccountStatus:a.depositAccounts.map(n=>n.accountStatus)}:void 0,Kt=(e,o)=>e&&o.depositAccountLimit!=null&&o.chargeCard!=null?{debitAccountId:o.depositAccountLimit.id,debitAccountName:o.depositAccountLimit?.accountName??o.connectedAccount?.accountName,debitAccountBalance:V(o.depositAccountLimit?.accountBalance.available.amount),debitCardsSpend:V(o.chargeCard.limit.amount-o.chargeCard.available.amount),debitAccountStatus:o.depositAccountLimit?.accountStatus??o.connectedAccount?.accountStatus}:void 0,Jt=80,Xt=80,ut=({isBankingOnlyTenant:e,isDebitCardFeatureEnabled:o})=>o||e,dt=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t,isDebitCardProductVisible:a,chargeCardsCreditAccountLimit:c})=>(e||o||t)&&(!a||c>0),Qt=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t})=>e||o||t,Yt=({cardInfo:e,isProductVisible:o,isTOSAccepted:t,isSetupEnabled:a,isUserHasCardsAdminLevelAccess:c,isUserHasCardsAccess:n})=>!!e&&o&&(!t&&c||n&&!c&&!a),lt=W(function(e,o){const{isUserChargeCardAdmin:t,chargeCardSetUpView:a,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n}=o,i=x(e),l=T.getSignedInUser(),s=i.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},p=t&&a.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&a.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",y=!!i.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{chargeCardSetUpView:a,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:y,isDisabled:p,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:w,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:r}},function(e,o){const{navigate:t,companyId:a,currentTenant:c,chargeCardSetUpView:n,isDebitCardTOSAccepted:i,isChargeCardTOSAccepted:l,isChargeCardSetupEnabled:s,isDebitCardSetupEnabled:r,productInformation:p,controllerEmails:y,businessVerificationStatus:I}=o;return{onBusinessVerificationSectionClick:()=>{w.trackCardsVerifyIdentityCompanyDetailsClick(y,p,I?.code),t("../verification"),c?.company?.companyChargeCardInfo!=null&&c.company.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(le(a,!1,!0))},onFetchLinkTokenClick:(d,m)=>{e(Te("charge_card_setup",d,m))},onEstablishConnectionClick:d=>{e(we(d,a,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(d,m,S)=>{e(Ee(d,m,"charge_cards","charge_card_setup",S))},onUpdatePaymentAccountLoginStatus:(d,m)=>{e(Pe(!1,d,"charge_cards","charge_card_setup",m))},onEstablishConnectionSuccess:()=>{e(le(a,!0))},onEnableChargeCardClick:()=>{w.trackCardsEnableCardsClick(y,p,"Cards Card Setup"),l===!0&&i===!0&&s===!1&&r===!1?e(K(a,"charge_cards__debit_cards")):l===!0&&s===!1?e(K(a,"charge_cards")):i===!0&&r===!1&&e(K(a,"debit_cards"))},onUpdateChargeCardClick:(d,m,S)=>{const v=n.allBankAccounts.find(f=>f.accountId===n.primaryFundingAccount?.zeniAccountId),g=n.allBankAccounts.find(f=>f.accountId===d);w.trackCardsZeniCashAccountChangeClick(y,p,{oldZeniCashAccount:v?.accountName??"",newZeniCashAccount:g?.accountName??"",oldZeniCashAccountPosition:n.allBankAccounts.findIndex(f=>f.accountId===n.primaryFundingAccount?.zeniAccountId)+1,newZeniCashAccountPosition:n.allBankAccounts.findIndex(f=>f.accountId===d)+1,numberOfCashAccounts:n.allBankAccounts.length}),e(S==="paymentAccount"?_e(d,m,"charge_cards","charge_card_setup"):ve("charge_card_setup",d,m))},onUpdatePrimaryFundingAccount:(d,m)=>{const S=n.allFundingAccounts.find(f=>f.id===d),v=n.allFundingAccounts.findIndex(f=>f.id===n.primaryFundingAccount?.id)+1,g=n.allFundingAccounts.findIndex(f=>f.id===d)+1;w.trackCardsPaymentAccountChangeClick(y,p,{oldPaymentAccountName:n.primaryFundingAccount?.label??"",oldPaymentAccountBalance:V(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:S?.label??"",newPaymentAccountBalance:V(S?.accountBalance?.available?.amount??0),isOldPaymentAccountRecommended:n.primaryFundingAccount?.accType==="depositAccount",isNewPaymentAccountRecommended:S?.accType==="depositAccount",oldPaymentAccountPosition:v,newPaymentAccountPosition:g,numberOfPaymentAccounts:n.allFundingAccounts.length}),e(ke(a,"charge_card_setup",d,m))},onEnableChargeCardSuccess:()=>{e(fn()),t("../",{relative:"path"})},onBackClick:()=>{c?.companyChargeCardInfo?.info?.isChargeCardEnabled||c?.companyDebitCardInfo?.info?.isDebitCardEnabled?t("../",{relative:"path"}):t("../..",{relative:"path"})},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(d,m)=>{e(Ae({officerType:d,fileIds:m}))},onSendForVerificationClick:d=>{l===!0&&i===!0?e(z(a,d,"charge_cards__debit_cards",!0,!0,!0)):l===!0?e(z(a,d,"charge_cards",!0,!0,!0)):i===!0&&e(z(a,d,"debit_cards",!0,!0,!0))},updateFilesEntity:d=>{e(te({files:d}))},onDeleteFile:d=>{e(ne(d))},onEditFileName:(d,m)=>{e(ee(d,m.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onUpdateAutoPayClick:d=>{e(yn(a,d))}}})(qn),pt=()=>{const e=X(),o=Q(),t=Y(),{tenantEmailDomain:a}=G(),c=ae(),n=E(N=>x(N)),{useDynamicConfig:i,useFeatureGate:l}=ie(),s=o.state?.pathnameStackToGoBack?.[0],{configValue:r}=i(J.zeniAccountsConfig),{configValue:p}=i(J.zeniCardsConfig),y=p.credit_card_auto_pay_threshold_by_company_id?.[n.companyId]??p.default_credit_card_auto_pay_threshold??80,{isFeatureEnabled:I}=l(de.isDebitCardFeatureEnabled),{isFeatureEnabled:d}=l(de.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=l(de.isEarlyPayFeatureEnabled),S=E(N=>cn(N,n.companyId)),v=rn(S.controllers),g=!!n.company?.companyChargeCardInfo.isChargeCardEnabled,f=!!n.company?.companyDebitCardInfo.isDebitCardEnabled,P=un(I,n),A=ut({isDebitCardFeatureEnabled:I,isBankingOnlyTenant:P}),_=dn(n),b=ln(n),k=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,h=dt({isCardsOnlyTenant:_,isChargeCardFeatureEnabled:d,isBookKeepingTenant:b,isDebitCardProductVisible:A,chargeCardsCreditAccountLimit:k}),D=A&&h===!1,B=A===!1&&h,U=ye(r),F=pn(c?.loggedInUserRoleMap),ce=Ie(c?.loggedInUserRoleMap),[H,ge]=C.useState(!1),[q,re]=C.useState(!1),L=E(N=>N.chargeCardSetupViewState.fetchState),j=T.getSignedInUserTenant(a)?.companyId??n.companyId,O=T.getSignedInUser(),Oe=N=>{ge(N)},Se=E(N=>mn(N,j));if(O==null)throw Error("Can't access charge card setup page without signing in...");C.useEffect(()=>{q||L!=="Not-Started"||j==null?q||L!=="Completed"||j==null||n.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(le(j,!1,!0)):(re(!0),t(le(j,!0)))},[q,L,j,t]);const be=!!n.company?.companyChargeCardInfo.isChargeCardTOSAccepted,he=!!n.company?.companyDebitCardInfo.isDebitCardTOSAccepted,ue=rt(h,A,f,g);return be||he?be||he?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:w,onLoad:()=>{w.trackPageLoaded($.Event.cardsSetupVisited),w.trackCardsCardSetupView(v,ue,s==null?"Cards Setup":s.includes("cards/promo")?"Promo":s.includes("cards")?"Settings":"Cards Tab")}}),u.jsx(fe,{isAppContentDrawerOpen:H,handleDrawerToggle:Oe}),u.jsx(lt,{autoPayThreshold:y,navigate:e,location:o,companyId:j,currentTenant:n,isEarlyPayEnabled:m,isChargeCardTOSAccepted:be,isDebitCardTOSAccepted:he,isUserChargeCardAdmin:F,isDebitCardOnlyEnabled:D,isCreditCardOnlyEnabled:B,chargeCardSetUpView:Se,isCreditCardProductVisible:h,isDebitCardFeatureEnabled:A,isChargeCardSetupEnabled:g,isDebitCardSetupEnabled:f,businessVerificationStatus:n.companyBillPayInfo?.info?.businessVerificationStatus,controllerEmails:v,productInformation:ue,onClickMenuIcon:()=>{Oe(!0)},hasZeniAccountsAdminAccess:ce,accountsPromoConfig:U})]}):u.jsx(Ue,{fetchState:"Not-Started"}):u.jsx(M,{to:"../promo"})},mt=xe.div`
|
|
10
10
|
display: flex;
|
|
11
11
|
height: 100%;
|
|
12
12
|
width: 100%;
|
|
@@ -14,11 +14,11 @@ import{j as u}from"./liveblocks-Dg-fyTMV.js";import{j as X,u as Q,h as Y,l as G,
|
|
|
14
14
|
flex-direction: column;
|
|
15
15
|
align-items: center;
|
|
16
16
|
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
-
`,yt=W(function(e,o){const{isUserRemiAdmin:t,companyId:a}=o,c=F(e),n=bn(e),i=hn(e,a),l=T.getSignedInUser(),s=c.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},p=t&&i.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&i.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",y=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{remiSetupView:i,isDisabled:p,remiApprovalView:n,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:y,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",analytics:E,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:r}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{updateMileageDetails:n=>{const{mileageAmount:i,mileageUnit:l,mileageCurrencyCode:s,mileageCurrencySymbol:r,denomination:p,denominationSymbol:y,mileageAmountInDenomination:I,description:d}=n;e(In({mileageDetails:{mileageUnitAmount:{amount:i,currencyCode:s,currencySymbol:r},denomination:p,denominationSymbol:y,mileageAmountInDenomination:I,mileageCurrencyCode:s,mileageCurrencySymbol:r,mileageUnit:l,description:d}}))},onSaveMileageClick:n=>{e(Cn(a)),E.trackReimbursementMileageRateSave(n)},onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyReimbursementInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(pe(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(Te("reimbursement_setup",n,i))},onEstablishConnectionClick:n=>{e(Ee(n,a,"reimbursement_setup","reimbursement"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(we(n,i,"reimbursement","reimbursement_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Pe(!1,n,"reimbursement","reimbursement_setup",i))},onEstablishConnectionSuccess:()=>{e(pe(a,!0))},onEnableRemiClick:()=>{e(K(a,"reimbursement"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?_e(n,i,"reimbursement","reimbursement_setup"):ve("reimbursement_setup",n,i))},onEnableRemiSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyReimbursementInfo?.info?.isReimbursementEnabled!=null&&c.companyReimbursementInfo.info.isReimbursementEnabled===!1?t("../.."):t("../",{relative:"path"})},onCompanyOfficerUpdated:(n,i)=>{e(Ae({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(z(a,n,"reimbursement",!0,!0,!0))},updateFilesEntity:n=>{e(te({files:n}))},onDeleteFile:n=>{e(ne(n))},onEditFileName:(n,i)=>{e(ee(n,i.split(".")[0]))},onUpdatePrimaryFundingAccount:(n,i)=>{e(ke(a,"reimbursement_setup",n,i))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(Kn),ft=()=>{const e=X(),o=Q(),t=Y(),{tenantEmailDomain:a}=G(),c=ae(),{useDynamicConfig:n}=ie(),i=De(),{configValue:l}=n(J.zeniAccountsConfig),s=ye(l),r=gn(c?.loggedInUserRoleMap),p=Ie(c?.loggedInUserRoleMap),[y,I]=C.useState(!1),d=C.useRef(!1),[m,S]=C.useState(!1),v=w(b=>b.remiSetupViewState.fetchState),g=w(b=>F(b)),f=w(b=>b.remiSetupApproverViewState.fetchState),P=T.getSignedInUserTenant(a)?.companyId??g.companyId,A=T.getSignedInUser(),_=b=>{I(b)};if(A==null)throw Error("Can't access reimbursement setup page without signing in...");if(C.useEffect(()=>{d.current||v!=="Not-Started"||P==null?d.current||v!=="Completed"||P==null||g.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(d.current=!0,t(pe(P,!1,!0))):(d.current=!0,t(pe(P,!0)))},[v,P,t]),C.useEffect(()=>{m||f!=="Not-Started"||(S(!0),t(Sn(!0)))},[m,f,t]),g.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1)return u.jsx(M,{to:"../promo"});if(g.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!0){const b=k=>k.trackPageLoaded($.Event.reimbursementSetup);return u.jsxs(mt,{children:[u.jsx(se,{analytics:E,onLoad:k=>b(k)}),u.jsx(fe,{isAppContentDrawerOpen:y,handleDrawerToggle:_}),u.jsx(yt,{navigate:e,location:o,companyId:P,currentTenant:g,isUserRemiAdmin:r,onClickMenuIcon:()=>{_(!0)},hasZeniAccountsAdminAccess:p,accountsPromoConfig:s})]})}return u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:i.colors.grey5}})},gt=W(function(e,o){const{businessVerificationDetails:t,productType:a}=o,c=F(e),n=T.getSignedInUser(),i=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=En(o.roleMap)&&t.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",r=Tn(e.companyConfigState),p=Dn(e.userRoleConfigState),y=a==="zeni_treasury"?qe(e):void 0;return{businessVerificationDetails:t,verficationDetailsFetchState:t.fetchState,isRefreshingViewInBackground:t.isRefreshingViewInBackground,allNationalityCountries:t.allNationalityCountries,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:s,allIndustries:r.companyIndustries??[],companyTitles:p.companyTitles,transferDetails:y}},function(e,o){const{companyId:t,productType:a,currentTenant:c,navigate:n,location:i}=o,{tenantEmailDomain:l}=c;return{onCompanyDetailsChanged:s=>{const{companyDescription:r,companyIndustry:p,companyIndustryType:y,companyLegalName:I,companyTaxId:d,companyWebsite:m,companyPhone:S,primaryContactEmail:v,primaryContactName:g,primaryContactUserId:f,primaryContactSyncToken:P,syncToken:A,fileIds:_,incDate:b,typeOfIncorporation:k,stateOfIncorporation:h,sourceOfFunds:D,companySubIndustry:B,countriesOfOperations:U,companySourceOfFunds:x,companySourceOfFundsDescription:ce,transactionVolume:H,transactionVolumeDescription:ge,purposeOfAccount:q,purposeOfAccountDescription:re,regulatedStatus:L,regulatedStatusDescription:j,usNexus:O,usNexusTypes:Oe}=s,Se=y?.selectedOption,be={companyId:t,companyDescription:r,companyIndustry:p.selectedOption,companyIndustryType:Se==null||Se===""?void 0:Se,companyLegalName:I,taxIdOrEIN:d,website:m!=""&&m!=null?Bn(m):void 0,phone:S,syncToken:A,fileIds:_,incDate:b!=null?je(b?.toString()):b,typeOfIncorporation:k?.selectedOption??"",stateOfIncorporation:h?.selectedOption??"",sourceOfFunds:D?.selectedOption??"",companySubIndustry:B?.selectedOption??"",countriesOfOperations:U?.selectedOptions.map(ue=>ue.length===2?ue:Ne(ue))??[],companySourceOfFunds:x?.selectedOption??"",companySourceOfFundsDescription:ce,transactionVolume:H?.selectedOption??"",transactionVolumeDescription:ge,purposeOfAccount:q?.selectedOption??"",purposeOfAccountDescription:re,regulatedStatus:L??"",regulatedStatusDescription:j,usNexus:O,usNexusTypes:Oe?.selectedOptions??[]},he={userId:f,firstName:g.firstName,lastName:g.lastName,email:v,syncToken:P};e(Me({companyDetails:be,primaryContactDetails:he}))},onCompanyOfficerUpdated:s=>{const r=s.map(p=>{const{officerType:y,userId:I,name:d,email:m,nationalityCountryCode:S,ssn:v,dob:g,phone:f,syncToken:P,selectDocument:A,role:_,ownership:b,isSelectedForVerification:k,userVerificationStatus:h,treasuryUserVerificationStatus:D,fileIds:B}=p;let U;return A.selectDocumentType==="driverLicense"?U="driving_license":A.selectDocumentType==="passport"?U="passport":A.selectDocumentType==="stateId"?U="id_document":A.selectDocumentType==="ssnCard"&&(U="social_security_card"),{officerType:y,userId:I,firstName:d.firstName,lastName:d.lastName,email:m,ssn:v,nationalityCountryCode:S?.selectedOption!=null?Ne(S.selectedOption):void 0,phone:f,birthday:g!=null?je(g?.toString()):g,syncToken:P,titleAtCompany:_.selectedOption,ownershipInCompany:b,documentTypeSelectedForVerification:U,isSelectedForVerification:k,userVerificationStatus:h,treasuryUserVerificationStatus:D,fileIds:B,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(Me({officers:r}))},onSaveDetailsClick:s=>{e(z(t,s,a))},onSendForVerificationClick:s=>{e(z(t,s,a,!0))},onAddressClick:s=>{const r=Ze(l,s),p=ze(i.state?.pathnameStackToGoBack,i.pathname),y=new URLSearchParams(i.search),I={};y.forEach((d,m)=>{I[m]=d}),n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(I).length>0?I:void 0}})},onRegisteredAddressClick:s=>{const r=Ze(l,s),p=ze(i.state?.pathnameStackToGoBack,i.pathname),y=new URLSearchParams(i.search),I=Object.fromEntries(y.entries());n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(I).length>0?I:void 0}})},onBackClick:()=>{e(On({companyId:t})),n("../setup")},updateFilesEntity:s=>{e(te({files:s}))},onDeleteFile:s=>{e(ne(s))},onDeleteFileList:s=>{e(Je(s))},onEditFileName:(s,r)=>{e(ee(s,r.split(".")[0]))},onGetOtp:s=>{e(We(s,"SpendManagementSetup"))},onResendOtp:s=>{e(Ge(s,"SpendManagementSetup"))},onVerifyOtp:(s,r)=>{e($e(s,r,"SpendManagementSetup"))},saveNewAddressInLocalStore:(s,r)=>{e(Un({addressType:s,addressToCreate:r}))},onExecuteTreasuryTransfer:()=>{e(Ke())},onOverlayClose:()=>{e(xe())}}})(Jn),St=({productType:e,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})=>{const a=X(),c=Q(),n=Y(),[i]=Qe(),l=i.get("showStepProgress"),s=i.get("isTransferInitiated"),[r,p]=C.useState(!1),{tenantEmailDomain:y}=G(),I=ae(),{useDynamicConfig:d}=ie(),m=De(),{configValue:S}=d(J.zeniAccountsConfig),v=ye(S),g=w(h=>{switch(e){case"zeni_accounts":return h.zeniAccountSetupViewState.fetchState;case"reimbursement":return h.remiSetupViewState.fetchState;case"charge_cards":return h.chargeCardSetupViewState.fetchState;case"zeni_treasury":return h.treasurySetupViewState.fetchState;default:return h.billPaySetupViewState.fetchState}}),f=w(h=>h.companyConfigState.fetchState),P=w(h=>h.userRoleConfigState.fetchState),A=w(h=>F(h)),_=A.companyId??T.getSignedInUserTenant(y)?.companyId;if(C.useEffect(()=>{f==="Not-Started"&&n(An()),P==="Not-Started"&&n(kn(!0))},[f,P,n]),C.useEffect(()=>{if(!r&&g==="Not-Started"&&_!=null)switch(p(!0),e){case"zeni_accounts":n(me(_,!0));break;case"zeni_treasury":n(Ce(_,!0));break;case"reimbursement":n(pe(_,!0));break;case"charge_cards":n(le(_,!0));break;default:n(Z(_,!0))}},[r,g,_,n]),T.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let b;switch(e){case"zeni_accounts":b=A.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":b=A.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":b=A.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||A.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":b=A.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:b=A.companyBillPayInfo?.info?.isBillPayTOSAccepted}const k=w(h=>{let D;switch(e){case"zeni_accounts":D=wn(h,_);break;case"zeni_treasury":D=He(h,_);break;case"charge_cards":D=Pn(h,_);break;case"reimbursement":D=vn(h,_);break;default:D=_n(h,_)}return D});return b===!1?null:k.fetchState==="Completed"&&b===!0&&I?.loggedInUserRoleMap!=null?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:E,onLoad:h=>(D=>{switch(e){case"zeni_accounts":return D.trackPageLoaded($.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return D.trackPageLoaded($.Event.reimbursementBusinessVerification);default:return D.trackPageLoaded($.Event.billPayBusinessVerification,Ve(c)?"Settings":void 0)}})(h)}),u.jsx(gt,{businessVerificationDetails:k,navigate:a,location:c,companyId:_,analytics:E,currentTenant:A,productType:e,roleMap:I.loggedInUserRoleMap,isSettings:Ve(c),isOverlay:!0,isStepInProgress:l!=null,isTreasuryTransferInitiated:s!=null,onClickMenuIcon:()=>{},maxInsuredAmount:v.maxInsuredAmount,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})]}):u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:m.colors.grey5}})},bt={overlayWidth:new Qn(100,100,59)},ht=W(function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a,accountsPromoConfig:c}=o,n=F(e),i=T.getSignedInUser(),l=n.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},r=Xe(e,a),p=He(e,a),y=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",I=jn(e),d=I.transactions,m=qe(e),S=I.accountSummary?.totalBalance?.amount,v=d.length===0||S===0;return{treasurySetupView:r,businessVerificationDetails:p,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",transactions:d,transferDetails:m,isFirstTransfer:v,isDisabled:y,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:E,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:s,isOnSetup:!0,maxInsuredAmount:c.maxInsuredAmount}},function(e,o){const{navigate:t,companyId:a,currentTenant:c,isAllocationDone:n,analytics:i,treasurySetupView:l}=o;return{onTransferSaveChangesToLocalStore:s=>{e(zn(s))},onBusinessVerificationSectionClick:(s,r)=>{let p="../verification";s&&(p+="?showStepProgress=true",r&&(p+="&isTransferInitiated=true")),t(p),c?.company?.companyTreasuryInfo!=null&&c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="pending_review"&&e(Ce(a,!1,!0))},onFetchLinkTokenClick:(s,r)=>{e(Te("treasury_setup",s,r))},onEstablishConnectionClick:s=>{e(Ee(s,a,"treasury_setup","zeni_treasury"))},onUpdatePaymentAccountStatus:(s,r,p)=>{e(we(s,r,"zeni_treasury","treasury_setup",p))},onUpdatePaymentAccountLoginStatus:(s,r)=>{e(Pe(!1,s,"zeni_treasury","treasury_setup",r))},onEstablishConnectionSuccess:()=>{e(Ce(a,!0))},onEnableTreasuryClick:()=>{e(K(a,"zeni_treasury"))},onUpdateTreasuryClick:(s,r,p)=>{e(p==="paymentAccount"?_e(s,r,"zeni_treasury","treasury_setup"):ve("treasury_setup",s,r))},onUpdatePrimaryFundingAccount:(s,r)=>{e(ke(a,"treasury_setup",s,r))},onNavigateToDashboard:()=>{t(c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="verified"?"../":"../../")},onCompanyOfficerUpdated:(s,r)=>{e(Ae({officerType:s,fileIds:r}))},onSendForVerificationClick:(s,r)=>{if(e(z(a,s,"zeni_treasury",!0,!0,!0)),!n){const p=l.fundAllocationLocalData;i.trackTreasuryPortfolioConfirm(p.riskScore,Le(p)),e(Re(!1))}r===!0&&e(Ke())},updateFilesEntity:s=>{e(te({files:s}))},onDeleteFile:s=>{e(ne(s))},onEditFileName:(s,r)=>{e(ee(s,r.split(".")[0]))},onAdditionalVerificationFieldsChanged:s=>{const{sourceOfFunds:r}=s;e(Rn({sourceOfFunds:r?.selectedOption??""}))},onUpdateFundAllocation:s=>{i.trackTreasuryAllocationAction("update",Le(s)),e(Mn(s))},onConfirmFundAllocation:()=>{e(Re(n))},onSignUpClick:()=>{o.isUserZeniAccountsAdmin?window.open("../checking/promo","_blank","noopener,noreferrer"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank","noopener,noreferrer")},onOverlayClose:()=>{e(xe())}}})(Yn),Ct=()=>{const e=X(),o=Q(),t=Y(),a=De(),c=Xn(),{tenantEmailDomain:n}=G(),{useDynamicConfig:i}=ie(),l=ae(),[s,r]=C.useState(!1),p=Ie(l?.loggedInUserRoleMap),{configValue:y}=i(J.zeniAccountsConfig),I=ye(y),[d,m]=C.useState(!1),[S,v]=C.useState(!1),[g,f]=C.useState(!1),[P,A]=C.useState(!1),[_,b]=C.useState(!1),k=w(O=>O.treasurySetupViewState.fetchState),h=w(O=>O.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),D=w(O=>O.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),B=w(O=>O.treasuryDetailState.transactionsState?.fetchState),U=w(O=>F(O)),x=T.getSignedInUserTenant(n)?.companyId??U.companyId,ce=w(O=>Xe(O,x)),H=ce.isAtomicAccountExists,ge=!!U.companyZeniAccountInfo?.info?.isZeniAccountEnabled,q=T.getSignedInUser(),re=O=>{m(O)};if(q==null)throw Error("Can't access treasury setup page without signing in...");C.useEffect(()=>{S||k!=="Not-Started"||x==null||(v(!0),t(Ce(x,!0,!1)))},[S,k,x,t]),C.useEffect(()=>{g||h!=="Not-Started"||x==null||(f(!0),t(xn()))},[g,h,x,t]),C.useEffect(()=>{P||D!=="Not-Started"||x==null||(A(!0),t(Fn()))},[P,D,x,t]),C.useEffect(()=>{_||B!=="Not-Started"||x==null||(b(!0),t(Vn(!0)))},[_,B,x,t]);const L=U.companyTreasuryInfo?.info?.businessVerificationStatus?.code,j=L==="pending_review"||L==="verified";return C.useEffect(()=>{s||k!=="Completed"||H||j||!o.pathname.includes("setup")||r(!0)},[k,H,j]),U.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1?u.jsx(M,{to:"../promo"}):u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:E,onLoad:()=>{}}),u.jsx(fe,{isAppContentDrawerOpen:d,handleDrawerToggle:re}),u.jsx(at,{onClose:()=>{t(xe()),e("../setup")},anchor:"right",open:o.pathname.includes("verification"),transitionDuration:s?0:250,PaperProps:{style:{width:bt.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:s?"transparent":a.colors.black,opacity:.75,cursor:"pointer"}}},children:u.jsx(It,{onClick:O=>O.stopPropagation(),children:u.jsx(St,{productType:"zeni_treasury",isBusinessVerificationDrawerOpen:!0,closeDrawerHandler:()=>{t(xe()),e("../setup")}})})}),u.jsx(ht,{navigate:e,location:o,companyId:x,currentTenant:U,isUserZeniAccountsAdmin:p,accountsPromoConfig:I,isAccountsEnabled:ge,isAllocationDone:H,analytics:E,treasurySetupView:ce,onClickMenuIcon:()=>{re(!0)},showTreasurySetupOverlay:s,setShowTreasurySetupOverlay:r})]})},It=Fe(it)`
|
|
17
|
+
`,yt=W(function(e,o){const{isUserRemiAdmin:t,companyId:a}=o,c=x(e),n=bn(e),i=hn(e,a),l=T.getSignedInUser(),s=c.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},p=t&&i.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&i.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",y=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{remiSetupView:i,isDisabled:p,remiApprovalView:n,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:y,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",analytics:w,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:r}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{updateMileageDetails:n=>{const{mileageAmount:i,mileageUnit:l,mileageCurrencyCode:s,mileageCurrencySymbol:r,denomination:p,denominationSymbol:y,mileageAmountInDenomination:I,description:d}=n;e(In({mileageDetails:{mileageUnitAmount:{amount:i,currencyCode:s,currencySymbol:r},denomination:p,denominationSymbol:y,mileageAmountInDenomination:I,mileageCurrencyCode:s,mileageCurrencySymbol:r,mileageUnit:l,description:d}}))},onSaveMileageClick:n=>{e(Cn(a)),w.trackReimbursementMileageRateSave(n)},onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyReimbursementInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(pe(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(Te("reimbursement_setup",n,i))},onEstablishConnectionClick:n=>{e(we(n,a,"reimbursement_setup","reimbursement"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(Ee(n,i,"reimbursement","reimbursement_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Pe(!1,n,"reimbursement","reimbursement_setup",i))},onEstablishConnectionSuccess:()=>{e(pe(a,!0))},onEnableRemiClick:()=>{e(K(a,"reimbursement"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?_e(n,i,"reimbursement","reimbursement_setup"):ve("reimbursement_setup",n,i))},onEnableRemiSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyReimbursementInfo?.info?.isReimbursementEnabled!=null&&c.companyReimbursementInfo.info.isReimbursementEnabled===!1?t("../.."):t("../",{relative:"path"})},onCompanyOfficerUpdated:(n,i)=>{e(Ae({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(z(a,n,"reimbursement",!0,!0,!0))},updateFilesEntity:n=>{e(te({files:n}))},onDeleteFile:n=>{e(ne(n))},onEditFileName:(n,i)=>{e(ee(n,i.split(".")[0]))},onUpdatePrimaryFundingAccount:(n,i)=>{e(ke(a,"reimbursement_setup",n,i))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(Kn),ft=()=>{const e=X(),o=Q(),t=Y(),{tenantEmailDomain:a}=G(),c=ae(),{useDynamicConfig:n}=ie(),i=De(),{configValue:l}=n(J.zeniAccountsConfig),s=ye(l),r=gn(c?.loggedInUserRoleMap),p=Ie(c?.loggedInUserRoleMap),[y,I]=C.useState(!1),d=C.useRef(!1),[m,S]=C.useState(!1),v=E(b=>b.remiSetupViewState.fetchState),g=E(b=>x(b)),f=E(b=>b.remiSetupApproverViewState.fetchState),P=T.getSignedInUserTenant(a)?.companyId??g.companyId,A=T.getSignedInUser(),_=b=>{I(b)};if(A==null)throw Error("Can't access reimbursement setup page without signing in...");if(C.useEffect(()=>{d.current||v!=="Not-Started"||P==null?d.current||v!=="Completed"||P==null||g.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(d.current=!0,t(pe(P,!1,!0))):(d.current=!0,t(pe(P,!0)))},[v,P,t]),C.useEffect(()=>{m||f!=="Not-Started"||(S(!0),t(Sn(!0)))},[m,f,t]),g.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1)return u.jsx(M,{to:"../promo"});if(g.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!0){const b=k=>k.trackPageLoaded($.Event.reimbursementSetup);return u.jsxs(mt,{children:[u.jsx(se,{analytics:w,onLoad:k=>b(k)}),u.jsx(fe,{isAppContentDrawerOpen:y,handleDrawerToggle:_}),u.jsx(yt,{navigate:e,location:o,companyId:P,currentTenant:g,isUserRemiAdmin:r,onClickMenuIcon:()=>{_(!0)},hasZeniAccountsAdminAccess:p,accountsPromoConfig:s})]})}return u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:i.colors.grey5}})},gt=W(function(e,o){const{businessVerificationDetails:t,productType:a}=o,c=x(e),n=T.getSignedInUser(),i=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=wn(o.roleMap)&&t.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",r=Tn(e.companyConfigState),p=Dn(e.userRoleConfigState),y=a==="zeni_treasury"?qe(e):void 0;return{businessVerificationDetails:t,verficationDetailsFetchState:t.fetchState,isRefreshingViewInBackground:t.isRefreshingViewInBackground,allNationalityCountries:t.allNationalityCountries,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:s,allIndustries:r.companyIndustries??[],companyTitles:p.companyTitles,transferDetails:y}},function(e,o){const{companyId:t,productType:a,currentTenant:c,navigate:n,location:i}=o,{tenantEmailDomain:l}=c;return{onCompanyDetailsChanged:s=>{const{companyDescription:r,companyIndustry:p,companyIndustryType:y,companyLegalName:I,companyTaxId:d,companyWebsite:m,companyPhone:S,primaryContactEmail:v,primaryContactName:g,primaryContactUserId:f,primaryContactSyncToken:P,syncToken:A,fileIds:_,incDate:b,typeOfIncorporation:k,stateOfIncorporation:h,sourceOfFunds:D,companySubIndustry:B,countriesOfOperations:U,companySourceOfFunds:F,companySourceOfFundsDescription:ce,transactionVolume:H,transactionVolumeDescription:ge,purposeOfAccount:q,purposeOfAccountDescription:re,regulatedStatus:L,regulatedStatusDescription:j,usNexus:O,usNexusTypes:Oe}=s,Se=y?.selectedOption,be={companyId:t,companyDescription:r,companyIndustry:p.selectedOption,companyIndustryType:Se==null||Se===""?void 0:Se,companyLegalName:I,taxIdOrEIN:d,website:m!=""&&m!=null?Bn(m):void 0,phone:S,syncToken:A,fileIds:_,incDate:b!=null?je(b?.toString()):b,typeOfIncorporation:k?.selectedOption??"",stateOfIncorporation:h?.selectedOption??"",sourceOfFunds:D?.selectedOption??"",companySubIndustry:B?.selectedOption??"",countriesOfOperations:U?.selectedOptions.map(ue=>ue.length===2?ue:Ne(ue))??[],companySourceOfFunds:F?.selectedOption??"",companySourceOfFundsDescription:ce,transactionVolume:H?.selectedOption??"",transactionVolumeDescription:ge,purposeOfAccount:q?.selectedOption??"",purposeOfAccountDescription:re,regulatedStatus:L??"",regulatedStatusDescription:j,usNexus:O,usNexusTypes:Oe?.selectedOptions??[]},he={userId:f,firstName:g.firstName,lastName:g.lastName,email:v,syncToken:P};e(Me({companyDetails:be,primaryContactDetails:he}))},onCompanyOfficerUpdated:s=>{const r=s.map(p=>{const{officerType:y,userId:I,name:d,email:m,nationalityCountryCode:S,ssn:v,dob:g,phone:f,syncToken:P,selectDocument:A,role:_,ownership:b,isSelectedForVerification:k,userVerificationStatus:h,treasuryUserVerificationStatus:D,fileIds:B}=p;let U;return A.selectDocumentType==="driverLicense"?U="driving_license":A.selectDocumentType==="passport"?U="passport":A.selectDocumentType==="stateId"?U="id_document":A.selectDocumentType==="ssnCard"&&(U="social_security_card"),{officerType:y,userId:I,firstName:d.firstName,lastName:d.lastName,email:m,ssn:v,nationalityCountryCode:S?.selectedOption!=null?Ne(S.selectedOption):void 0,phone:f,birthday:g!=null?je(g?.toString()):g,syncToken:P,titleAtCompany:_.selectedOption,ownershipInCompany:b,documentTypeSelectedForVerification:U,isSelectedForVerification:k,userVerificationStatus:h,treasuryUserVerificationStatus:D,fileIds:B,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(Me({officers:r}))},onSaveDetailsClick:s=>{e(z(t,s,a))},onSendForVerificationClick:s=>{e(z(t,s,a,!0))},onAddressClick:s=>{const r=Ze(l,s),p=ze(i.state?.pathnameStackToGoBack,i.pathname),y=new URLSearchParams(i.search),I={};y.forEach((d,m)=>{I[m]=d}),n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(I).length>0?I:void 0}})},onRegisteredAddressClick:s=>{const r=Ze(l,s),p=ze(i.state?.pathnameStackToGoBack,i.pathname),y=new URLSearchParams(i.search),I=Object.fromEntries(y.entries());n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(I).length>0?I:void 0}})},onBackClick:()=>{e(On({companyId:t})),n("../setup")},updateFilesEntity:s=>{e(te({files:s}))},onDeleteFile:s=>{e(ne(s))},onDeleteFileList:s=>{e(Je(s))},onEditFileName:(s,r)=>{e(ee(s,r.split(".")[0]))},onGetOtp:s=>{e(We(s,"SpendManagementSetup"))},onResendOtp:s=>{e(Ge(s,"SpendManagementSetup"))},onVerifyOtp:(s,r)=>{e($e(s,r,"SpendManagementSetup"))},saveNewAddressInLocalStore:(s,r)=>{e(Un({addressType:s,addressToCreate:r}))},onExecuteTreasuryTransfer:()=>{e(Ke())},onOverlayClose:()=>{e(Fe())}}})(Jn),St=({productType:e,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})=>{const a=X(),c=Q(),n=Y(),[i]=Qe(),l=i.get("showStepProgress"),s=i.get("isTransferInitiated"),[r,p]=C.useState(!1),{tenantEmailDomain:y}=G(),I=ae(),{useDynamicConfig:d}=ie(),m=De(),{configValue:S}=d(J.zeniAccountsConfig),v=ye(S),g=E(h=>{switch(e){case"zeni_accounts":return h.zeniAccountSetupViewState.fetchState;case"reimbursement":return h.remiSetupViewState.fetchState;case"charge_cards":return h.chargeCardSetupViewState.fetchState;case"zeni_treasury":return h.treasurySetupViewState.fetchState;default:return h.billPaySetupViewState.fetchState}}),f=E(h=>h.companyConfigState.fetchState),P=E(h=>h.userRoleConfigState.fetchState),A=E(h=>x(h)),_=A.companyId??T.getSignedInUserTenant(y)?.companyId;if(C.useEffect(()=>{f==="Not-Started"&&n(An()),P==="Not-Started"&&n(kn(!0))},[f,P,n]),C.useEffect(()=>{if(!r&&g==="Not-Started"&&_!=null)switch(p(!0),e){case"zeni_accounts":n(me(_,!0));break;case"zeni_treasury":n(Ce(_,!0));break;case"reimbursement":n(pe(_,!0));break;case"charge_cards":n(le(_,!0));break;default:n(Z(_,!0))}},[r,g,_,n]),T.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let b;switch(e){case"zeni_accounts":b=A.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":b=A.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":b=A.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||A.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":b=A.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:b=A.companyBillPayInfo?.info?.isBillPayTOSAccepted}const k=E(h=>{let D;switch(e){case"zeni_accounts":D=En(h,_);break;case"zeni_treasury":D=He(h,_);break;case"charge_cards":D=Pn(h,_);break;case"reimbursement":D=vn(h,_);break;default:D=_n(h,_)}return D});return b===!1?null:k.fetchState==="Completed"&&b===!0&&I?.loggedInUserRoleMap!=null?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:w,onLoad:h=>(D=>{switch(e){case"zeni_accounts":return D.trackPageLoaded($.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return D.trackPageLoaded($.Event.reimbursementBusinessVerification);default:return D.trackPageLoaded($.Event.billPayBusinessVerification,Ve(c)?"Settings":void 0)}})(h)}),u.jsx(gt,{businessVerificationDetails:k,navigate:a,location:c,companyId:_,analytics:w,currentTenant:A,productType:e,roleMap:I.loggedInUserRoleMap,isSettings:Ve(c),isOverlay:!0,isStepInProgress:l!=null,isTreasuryTransferInitiated:s!=null,onClickMenuIcon:()=>{},maxInsuredAmount:v.maxInsuredAmount,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})]}):u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:m.colors.grey5}})},bt={overlayWidth:new Qn(100,100,59)},ht=W(function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a,accountsPromoConfig:c}=o,n=x(e),i=T.getSignedInUser(),l=n.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},r=Xe(e,a),p=He(e,a),y=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",I=jn(e),d=I.transactions,m=qe(e),S=I.accountSummary?.totalBalance?.amount,v=d.length===0||S===0;return{treasurySetupView:r,businessVerificationDetails:p,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",transactions:d,transferDetails:m,isFirstTransfer:v,isDisabled:y,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:w,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:s,isOnSetup:!0,maxInsuredAmount:c.maxInsuredAmount}},function(e,o){const{navigate:t,companyId:a,currentTenant:c,isAllocationDone:n,analytics:i,treasurySetupView:l}=o;return{onTransferSaveChangesToLocalStore:s=>{e(zn(s))},onBusinessVerificationSectionClick:(s,r)=>{let p="../verification";s&&(p+="?showStepProgress=true",r&&(p+="&isTransferInitiated=true")),t(p),c?.company?.companyTreasuryInfo!=null&&c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="pending_review"&&e(Ce(a,!1,!0))},onFetchLinkTokenClick:(s,r)=>{e(Te("treasury_setup",s,r))},onEstablishConnectionClick:s=>{e(we(s,a,"treasury_setup","zeni_treasury"))},onUpdatePaymentAccountStatus:(s,r,p)=>{e(Ee(s,r,"zeni_treasury","treasury_setup",p))},onUpdatePaymentAccountLoginStatus:(s,r)=>{e(Pe(!1,s,"zeni_treasury","treasury_setup",r))},onEstablishConnectionSuccess:()=>{e(Ce(a,!0))},onEnableTreasuryClick:()=>{e(K(a,"zeni_treasury"))},onUpdateTreasuryClick:(s,r,p)=>{e(p==="paymentAccount"?_e(s,r,"zeni_treasury","treasury_setup"):ve("treasury_setup",s,r))},onUpdatePrimaryFundingAccount:(s,r)=>{e(ke(a,"treasury_setup",s,r))},onNavigateToDashboard:()=>{t(c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="verified"?"../":"../../")},onCompanyOfficerUpdated:(s,r)=>{e(Ae({officerType:s,fileIds:r}))},onSendForVerificationClick:(s,r)=>{if(e(z(a,s,"zeni_treasury",!0,!0,!0)),!n){const p=l.fundAllocationLocalData;i.trackTreasuryPortfolioConfirm(p.riskScore,Le(p)),e(Re(!1))}r===!0&&e(Ke())},updateFilesEntity:s=>{e(te({files:s}))},onDeleteFile:s=>{e(ne(s))},onEditFileName:(s,r)=>{e(ee(s,r.split(".")[0]))},onAdditionalVerificationFieldsChanged:s=>{const{sourceOfFunds:r}=s;e(Rn({sourceOfFunds:r?.selectedOption??""}))},onUpdateFundAllocation:s=>{i.trackTreasuryAllocationAction("update",Le(s)),e(Mn(s))},onConfirmFundAllocation:()=>{e(Re(n))},onSignUpClick:()=>{o.isUserZeniAccountsAdmin?window.open("../checking/promo","_blank","noopener,noreferrer"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank","noopener,noreferrer")},onOverlayClose:()=>{e(Fe())}}})(Yn),Ct=()=>{const e=X(),o=Q(),t=Y(),a=De(),c=Xn(),{tenantEmailDomain:n}=G(),{useDynamicConfig:i}=ie(),l=ae(),[s,r]=C.useState(!1),p=Ie(l?.loggedInUserRoleMap),{configValue:y}=i(J.zeniAccountsConfig),I=ye(y),[d,m]=C.useState(!1),[S,v]=C.useState(!1),[g,f]=C.useState(!1),[P,A]=C.useState(!1),[_,b]=C.useState(!1),k=E(O=>O.treasurySetupViewState.fetchState),h=E(O=>O.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),D=E(O=>O.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),B=E(O=>O.treasuryDetailState.transactionsState?.fetchState),U=E(O=>x(O)),F=T.getSignedInUserTenant(n)?.companyId??U.companyId,ce=E(O=>Xe(O,F)),H=ce.isAtomicAccountExists,ge=!!U.companyZeniAccountInfo?.info?.isZeniAccountEnabled,q=T.getSignedInUser(),re=O=>{m(O)};if(q==null)throw Error("Can't access treasury setup page without signing in...");C.useEffect(()=>{S||k!=="Not-Started"||F==null||(v(!0),t(Ce(F,!0,!1)))},[S,k,F,t]),C.useEffect(()=>{g||h!=="Not-Started"||F==null||(f(!0),t(Fn()))},[g,h,F,t]),C.useEffect(()=>{P||D!=="Not-Started"||F==null||(A(!0),t(xn()))},[P,D,F,t]),C.useEffect(()=>{_||B!=="Not-Started"||F==null||(b(!0),t(Vn(!0)))},[_,B,F,t]);const L=U.companyTreasuryInfo?.info?.businessVerificationStatus?.code,j=L==="pending_review"||L==="verified";return C.useEffect(()=>{s||k!=="Completed"||H||j||!o.pathname.includes("setup")||r(!0)},[k,H,j]),U.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1?u.jsx(M,{to:"../promo"}):u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:w,onLoad:()=>{}}),u.jsx(fe,{isAppContentDrawerOpen:d,handleDrawerToggle:re}),u.jsx(at,{onClose:()=>{t(Fe()),e("../setup")},anchor:"right",open:o.pathname.includes("verification"),transitionDuration:s?0:250,PaperProps:{style:{width:bt.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:s?"transparent":a.colors.black,opacity:.75,cursor:"pointer"}}},children:u.jsx(It,{onClick:O=>O.stopPropagation(),children:u.jsx(St,{productType:"zeni_treasury",isBusinessVerificationDrawerOpen:!0,closeDrawerHandler:()=>{t(Fe()),e("../setup")}})})}),u.jsx(ht,{navigate:e,location:o,companyId:F,currentTenant:U,isUserZeniAccountsAdmin:p,accountsPromoConfig:I,isAccountsEnabled:ge,isAllocationDone:H,analytics:w,treasurySetupView:ce,onClickMenuIcon:()=>{re(!0)},showTreasurySetupOverlay:s,setShowTreasurySetupOverlay:r})]})},It=xe(it)`
|
|
18
18
|
display: flex;
|
|
19
19
|
min-height: 100%;
|
|
20
20
|
flex-direction: column;
|
|
21
|
-
`,At=W(function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a}=o,c=
|
|
21
|
+
`,At=W(function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a}=o,c=x(e),n=T.getSignedInUser(),i=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Nn(e,a),r=t&&s.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&s.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{zeniAccountSetUpView:s,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:r,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:w,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyZeniAccountInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(me(a,!1,!0))},onFetchLinkTokenClick:(n,i)=>{e(Te("account_setup",n,i))},onEstablishConnectionClick:n=>{e(we(n,a,"account_setup","zeni_accounts"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(Ee(n,i,"zeni_accounts","account_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Pe(!1,n,"zeni_accounts","account_setup",i))},onEstablishConnectionSuccess:()=>{e(me(a,!0))},onEnableZeniAccountClick:()=>{e(K(a,"zeni_accounts"))},onUpdateZeniAccountClick:(n,i,l)=>{e(l==="paymentAccount"?_e(n,i,"zeni_accounts","account_setup"):ve("account_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(ke(a,"account_setup",n,i))},onEnableZeniAccountSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyZeniAccountInfo?.info?.isZeniAccountEnabled?t("../"):t("../../")},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(n,i)=>{e(Ae({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(z(a,n,"zeni_accounts",!0,!0,!0))},updateFilesEntity:n=>{e(te({files:n}))},onDeleteFile:n=>{e(ne(n))},onEditFileName:(n,i)=>{e(ee(n,i.split(".")[0]))}}})(et),kt=()=>{const e=X(),o=Q(),t=Y(),{tenantEmailDomain:a}=G(),{useDynamicConfig:c}=ie(),n=ae(),i=Ie(n?.loggedInUserRoleMap),{configValue:l}=c(J.zeniAccountsConfig),s=ye(l),[r,p]=C.useState(!1),[y,I]=C.useState(!1),d=E(f=>f.zeniAccountSetupViewState.fetchState),m=E(f=>x(f)),S=T.getSignedInUserTenant(a)?.companyId??m.companyId,v=T.getSignedInUser(),g=f=>{p(f)};if(v==null)throw Error("Can't access zeni bank account setup page without signing in...");if(C.useEffect(()=>{y||d!=="Not-Started"||S==null?y||d!=="Completed"||S==null||m.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(me(S,!1,!0)):(I(!0),t(me(S,!0)))},[y,d,S,t]),m.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted===!1)return u.jsx(M,{to:"../promo"});{const f=P=>P.trackPageLoaded($.Event.zeniAccountsSetup);return u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:w,onLoad:P=>f(P)}),u.jsx(fe,{isAppContentDrawerOpen:r,handleDrawerToggle:g}),u.jsx(At,{navigate:e,location:o,companyId:S,currentTenant:m,isUserZeniAccountsAdmin:i,accountsPromoConfig:s,onClickMenuIcon:()=>{g(!0)}})]})}},_t=xe.div`
|
|
22
22
|
display: flex;
|
|
23
23
|
height: 100vh;
|
|
24
24
|
width: 100%;
|
|
@@ -26,4 +26,4 @@ import{j as u}from"./liveblocks-Dg-fyTMV.js";import{j as X,u as Q,h as Y,l as G,
|
|
|
26
26
|
flex-direction: column;
|
|
27
27
|
align-items: center;
|
|
28
28
|
background-color: ${e=>e.theme.colors.grey4};
|
|
29
|
-
`,vt=W(function(e,o){const t=
|
|
29
|
+
`,vt=W(function(e,o){const t=x(e),a=T.getSignedInUser(),c=t.tenantId,n={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:c??""};return{internationalOnboardingDetails:$n(e),isReadonly:o.isFormReadonly,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:n,analytics:w}},function(e,o){const{navigate:t}=o;return{onFormDataChange:a=>{e(Wn(a))},onSubmitClick:()=>{e(Gn(o.companyId))},onCancelClick:()=>{t("../setup")},updateFilesEntity:a=>{e(te({files:a}))},onDeleteFile:a=>{e(ne(a))},onDeleteFileList:a=>{e(Je(a))},onEditFileName:(a,c)=>{e(ee(a,c.split(".")[0]))}}})(nt),Pt=()=>{const e=X(),o=Q(),t=Y(),[a,c]=C.useState(!1),[n,i]=C.useState(!1),[l,s]=C.useState(!1),{tenantEmailDomain:r}=G(),p=ae(),{useFeatureGate:y}=ie(),{isFeatureEnabled:I}=y(de.isBillPayLocalCurrencyFeatureEnabled),d=E(k=>k.internationalWireVerificationState.verificationFormFetchState.fetchState),m=E(k=>k.billPaySetupViewState.fetchState),S=E(k=>x(k)),v=De(),g=S.companyId??T.getSignedInUserTenant(r)?.companyId,f=E(k=>Ln(k.companyState,S.companyId)),P=f?.company.companyBillPayInfo.internationalWireOnboardingStatus,A=P?.code==="onboarding_status_not_started"?void 0:"readonly";if(C.useEffect(()=>{a||d!=="Not-Started"||g==null||(c(!0),t(Zn(g)))},[a,d,g,t]),C.useEffect(()=>{n||m!=="Not-Started"||g==null||(i(!0),t(Z(g,!0)))},[m,n,g,t]),T.getSignedInUser()==null)throw Error("Can't access international verification without signing in...");const _=S.companyBillPayInfo?.info?.isBillPayTOSAccepted,b=k=>{s(k)};return _===!1?u.jsx(M,{to:"../promo"}):_===!0&&p?.loggedInUserRoleMap!=null?u.jsxs(_t,{children:[u.jsx(se,{analytics:w,onLoad:k=>(h=>h.trackPageLoaded($.Event.billPayBusinessVerification,void 0))(k)}),Ve(o)?u.jsx(fe,{isAppContentDrawerOpen:l,handleDrawerToggle:b}):null,u.jsx(vt,{navigate:e,location:o,companyId:g,analytics:w,currentTenant:S,roleMap:p.loggedInUserRoleMap,isFormReadonly:A,isLocalCurrencyEnabled:I})]}):u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:v.colors.grey5}})},Et=W(function(){return{}},function(e,o){const{companyId:t,productType:a}=o;return{onEventReceived:c=>{switch(c){case"bill-pay-set-up-verification-update":case"bill-pay-wise-setup":switch(a){case"reimbursement":e(pe(t,!0,!0));break;case"zeni_accounts":e(me(t,!0,!0));break;case"charge_cards":e(le(t,!0,!0));break;case"zeni_treasury":e(Ce(t,!0,!0));break;default:e(Z(t,!0,!0))}}}}})(tt(e=>{const{isBillPayAdminLevelAccess:o,isUserHasOnlyBillPayAccess:t,isReimbursementAdminLevelAccess:a,isZeniAccountAdminLevelAccess:c,isTreasuryAdminLevelAccess:n,isChargeCardAdminLevelAccess:i,isUserHasOnlyCardAccess:l,productType:s,type:r}=e;switch(s){case"bill_pay":switch(r){case"verification":return o?u.jsx(Be,{productType:s}):t?u.jsx(M,{to:"../"}):u.jsx(R,{});case"international-wire":return o?u.jsx(Pt,{}):t?u.jsx(M,{to:"../"}):u.jsx(R,{});default:return o?u.jsx(ct,{}):t?u.jsx(M,{to:"../"}):u.jsx(R,{})}case"reimbursement":return r==="verification"?a?u.jsx(Be,{productType:s}):u.jsx(R,{}):a?u.jsx(ft,{}):u.jsx(R,{});case"zeni_accounts":return r==="verification"?c?u.jsx(Be,{productType:"zeni_accounts"}):u.jsx(R,{}):c?u.jsx(kt,{}):u.jsx(R,{});case"zeni_treasury":return n===!0?u.jsx(Ct,{}):u.jsx(R,{});case"charge_cards":return r==="verification"?i?u.jsx(Be,{productType:"charge_cards"}):l?u.jsx(M,{to:"../"}):u.jsx(R,{}):i?u.jsx(pt,{}):l?u.jsx(M,{to:"../"}):u.jsx(R,{})}}));function ea(e){const{tenantEmailDomain:o}=G(),t=E(c=>x(c)).companyId??T.getSignedInUserTenant(o)?.companyId,a={events:t!=null?[`private-${t}.bill-pay-set-up-verification-update`,`private-${t}.bill-pay-wise-setup`]:[],eventCallback:(c,n,i)=>{i.onEventReceived(c)}};if(T.getSignedInUser()==null)throw Error("Can't access setup details page without signing in...");return u.jsx(Et,{...e,companyId:t,...a})}export{Jt as A,Xt as P,ea as S,Ht as a,Kt as b,ut as c,dt as d,rt as e,zt as f,Zt as g,Wt as h,qt as i,Qt as j,Gt as k,$t as l,Nt as m,Lt as n,Rt as p,Yt as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as f}from"./liveblocks-DOxb6osM.js";import{a as u,b as T,q as A}from"./sentry-CRdlKM_1.js";import{h as D,j as z,g as c,u as j,N as M,k as O}from"./core-C4fxU83C.js";import{u as F,z as s,h as P,e as w,D as N,f as _,g as q,q as B,i as V,E as $,j as v}from"./index-Ckao8u8S.js";import{eN as H,Ij as J,Ik as R,eO as W,fi as G,Ip as K,fH as Q,cS as X,Iq as b,Ir as Y,Is as Z,bR as y}from"./zeni-epic-state-Ba45HhdX.js";import"./mui-CJ5-H5s3.js";import{u as ee}from"./useDeviceId-DUeztkWP.js";import{f as te}from"./analyticsHelper-BsvvXvsU.js";import{t as ne}from"./getLocaleForTenant-eE3oogFE.js";import"./recharts-95y0DFZP.js";import"./analytics-CgBmxqZY.js";import"./plaid-B0tTAlSw.js";import"./dnd-DoZPzASs.js";import"./stripe-DMRn4zHo.js";import"./lottie-BW8IlxIq.js";import"./lexical-jcYOTomA.js";import"./pdf-CSGP82Vc.js";import"./utils-CLosk-TB.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]="9c6f5d06-a45f-460c-a022-f9baa6da9201",t._sentryDebugIdIdentifier="sentry-dbid-9c6f5d06-a45f-460c-a022-f9baa6da9201")}catch{}})();const ie=O(function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}},function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{A({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const l=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Z({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(l),sourceUri:y(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(Y(n,a)))},clearSignInError:()=>{t(b())}}})($),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=D(),d=z(),{clearAllLoading:g}=F(),n=s.getSignedInUser();u.useLayoutEffect(()=>{g()},[g]);const a=ee(),l=c(e=>e.tenantState.magicLinkCodeVerifier),{sendEmailMagicLinkFetchState:k,accountLocked:C,accountUnlockTime:h}=c(e=>e.tenantState),p=c(e=>e.tenantState.fetchState),L=c(e=>e.tenantState.activeTenantFetchState.fetchState),I=c(e=>e.tenantState.signInState),o=c(e=>e.tenantState.loggedInUser),r=c(e=>H(e)),S=c(e=>J(e)),m=j(),E=P().mode,U=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(u.useEffect(()=>{k.fetchState==="Completed"&&l!=null&&(w.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(l))},[k.fetchState,l]),u.useEffect(()=>{t(void 0)},[]),u.useEffect(()=>{I!=="In-Progress"||p!=="Completed"&&L!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(R(S.tenantsInOrder),o.zeniSessionId),W(o.userId,o.zeniSessionId,r.tenantId),i(G(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(K("Completed")),N.updateAppLocaleID(ne(r)),te(o,r,E,void 0,S.tenantsInOrder),Q().then(()=>{const e=V();e!=null&&_(e)}),setTimeout(()=>{w.trackLogin(q.Event.loginSuccess,o.authProvider??"google",X(r.productSettings))},2e3))},[I,p,L,o,r,S,E,m.state,i]),I==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(M,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!U,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),C===!0&&h!=null?f.jsx(B,{onClose:()=>i(b()),unlockDate:h}):null]})}export{ve as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-DOxb6osM.js";import{a as n}from"./sentry-CRdlKM_1.js";import{h as u,u as m,j as p,N as g}from"./core-C4fxU83C.js";import{z as f,x as y,t as h,e as l,g as b}from"./index-Ckao8u8S.js";import{fM as I,fN as x,IF as j}from"./zeni-epic-state-Ba45HhdX.js";import{n as w}from"./mui-CJ5-H5s3.js";import"./recharts-95y0DFZP.js";import"./analytics-CgBmxqZY.js";import"./plaid-B0tTAlSw.js";import"./dnd-DoZPzASs.js";import"./stripe-DMRn4zHo.js";import"./lottie-BW8IlxIq.js";import"./lexical-jcYOTomA.js";import"./pdf-CSGP82Vc.js";import"./utils-CLosk-TB.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]="aea47015-0aaf-4e90-8a30-0877330ca518",e._sentryDebugIdIdentifier="sentry-dbid-aea47015-0aaf-4e90-8a30-0877330ca518")}catch{}})();function $(){const e=u(),t=m(),a=p(),i=n.useRef(!1),c=f.isSignedIn(),r=t.state?.message==="logout",o=r||c;return n.useEffect(()=>{o&&!i.current&&(i.current=!0,setTimeout(()=>{try{f.clearAll(),e(I()),e(x(!1)),j(),h.reset(),l.trackLogout(b.Event.logoutSuccess),l.resetUserIdentity()}catch(d){console.error("Error during sign out:",d)}finally{r||a("/signin/auth",{replace:!0})}},0))},[o,r]),o?s.jsx(v,{children:s.jsx(y,{fetchState:"In-Progress"})}):s.jsx(g,{to:"../",replace:!0})}const v=w.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
height: 100vh;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
+
`;export{$ as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as k}from"./liveblocks-
|
|
1
|
+
import{j as k}from"./liveblocks-DOxb6osM.js";import{a as m}from"./sentry-CRdlKM_1.js";import{j,h as N,u as R,g as G,l as $,k as v}from"./core-C4fxU83C.js";import{J as O,z as K,a as U,d as _,y as z,e as M,g as V,cE as W,s as f,p as q}from"./index-Ckao8u8S.js";import{eN as J,Po as w,Ft as y,Pp as L,Pk as Y,EU as S,Pq as H,EY as I,Ex as Q,Fu as b,Pr as B,gD as X,Fj as Z,Fo as aa,Fb as ta,F9 as ea,Fp as sa,F6 as oa,Ps as na,Pt as ia,Pu as la,Pv as u,e9 as ra,Pw as ca,Px as pa}from"./zeni-epic-state-Ba45HhdX.js";import{n as ka}from"./mui-CJ5-H5s3.js";import{u as ua}from"./useAskAiCfoHostNavButtonProps-BGS1w2nN.js";import{c as da}from"./useFetchSuggestedQuestionsWhenReady-DxGAt9QA.js";import{M as ma}from"./MobileAppDrawer-D3j8weyp.js";import"./recharts-95y0DFZP.js";import"./analytics-CgBmxqZY.js";import"./plaid-B0tTAlSw.js";import"./dnd-DoZPzASs.js";import"./stripe-DMRn4zHo.js";import"./lottie-BW8IlxIq.js";import"./lexical-jcYOTomA.js";import"./pdf-CSGP82Vc.js";import"./utils-CLosk-TB.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="f06327bb-77e0-46e5-b58d-e02ed1ae77ec",t._sentryDebugIdIdentifier="sentry-dbid-f06327bb-77e0-46e5-b58d-e02ed1ae77ec")}catch{}})();const fa=ka.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,4 +6,4 @@ import{j as k}from"./liveblocks-Dg-fyTMV.js";import{a as m}from"./sentry-CNayqfa
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${t=>t.theme.colors.grey4};
|
|
9
|
-
`,
|
|
9
|
+
`,Ta=v(function(t,e){const o=w(t,e.isTaskTemplatesEnabled),{taskGroupId:i}=e,n=i!=null&&i!==""?{...o,taskGroupsWithTasksList:o.taskGroupsWithTasksList.map(l=>({...l,tasks:l.tasks.filter(r=>r.taskGroupIds.includes(i))})).filter(l=>l.tasks.length>0)}:o;return{taskListView:n,tagListView:Y(t),localData:n.localData,isTaskTemplatesEnabled:e.isTaskTemplatesEnabled}},function(t,e){const{navigate:o,currentTenant:i,location:n,isTaskTemplatesEnabled:l}=e,{tenantEmailDomain:r}=i,{groupByKey:T}=e.uiState;return{onTaskManagementRowClick:a=>{const s=ga(r,a),p=f(n.state?.pathnameStackToGoBack,n.pathname);o(s,{state:{pathnameStackToGoBack:p}})},onReloadTasks:()=>{t(y(!0,l))},onNewTaskClick:()=>{if(e.localData.defaultTaskGroupId!=null){const a=C(r,e.localData.defaultTaskGroupId),s=f(n.state?.pathnameStackToGoBack,n.pathname);o(a,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(a,s)=>{t(B({uiState:{sortKey:a,sortOrder:s}}))},onFiltersChange:a=>{t(la({filters:a}))},onSearchTextChanged:a=>{t(ia({searchText:a}))},onReloadCards:()=>{t(y(!0,l))},onBackClick:()=>{if(n.state?.message==="triggerBackClick"){const a=q(n.state?.pathnameStackToGoBack),s=a.poppedPathname??"../";o(s,{state:{pathnameStackToGoBack:a.newStack}})}else o("../")},updateLocalData:a=>{t(na({localData:a}))},resetLocalData:()=>{t(L({taskGroupById:e.taskGroupState.taskGroupById}))},handleCreateGroup:a=>{t(oa(e.localData.newTaskGroupName,a))},assignGroupToTasks:a=>{t(ea(e.localData.selectedTaskIds,a,sa(e.uiState.groupByKey,a)))},onDeleteTaskGroup:a=>{t(ta(a))},onAddNewTaskToTaskGroup:a=>{if(e.localData.defaultTaskGroupId!=null){const s=Da(T,a);t(S({taskDetailLocalData:s}));const p=C(r,e.uiState.groupByKey==="groupName"?a:e.localData.defaultTaskGroupId),g=f(n.state?.pathnameStackToGoBack,n.pathname);o(p,{state:{pathnameStackToGoBack:g,message:"comingFromTaskListPage"}})}},onDragNDrop:(a,s)=>{t(aa(e.localData.selectedTaskIds.length>0?e.localData.selectedTaskIds:[a],s))},onTaskGroupRename:(a,s)=>{t(Z(a,s))},onTimeSpentUpdate:(a,s)=>{t(b({task:a,updates:s}))},onShowToast:a=>{t(X(a))},onGroupByFilterChange:a=>{t(B({uiState:{groupByKey:a}}))},updateTask:(a,s)=>{t(b({task:a,updates:s}))},onCreateTagClick:(a,s)=>{t(Q(a,s))},handleGroupTemplateClick:a=>{t(I(a,[]))},handleGroupTemplateTaskClick:(a,s)=>{t(I(a,[s]))},handleNewTaskInitialization:a=>{if(t(S({taskDetailLocalData:{...H,name:a}})),e.localData.defaultTaskGroupId!=null){const s=C(r,e.localData.defaultTaskGroupId),p=f(n.state?.pathnameStackToGoBack,n.pathname);o(s,{state:{pathnameStackToGoBack:p,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:a=>{o(`/${r}/tasks/group/${a}`)}}})(W);function $a(){const{isAiCfoOpen:t,setIsAiCfoOpen:e}=O(),o=j(),i=N(),n=R(),l=K.getSignedInUser(),r=G(c=>J(c)),{taskGroupId:T}=$(),{useFeatureGate:a}=U(),{isFeatureEnabled:s}=a(_.isTaskTemplatesEnabled),[p,g]=m.useState(!1),[E,F]=m.useState(!1),D=G(c=>w(c,s)),h=G(c=>c.taskGroupState),d=D.fetchState,{isAiCfoAccessEnabled:P,onAskAiCfoClick:x}=ua({isAiCfoOpen:t,setIsAiCfoOpen:e,mobileExploreReferrer:"Task Checklist"});if(da({isDataReady:d==="Completed"}),m.useEffect(()=>{p||(g(!0),i(y(!1,s)))},[p,i]),m.useEffect(()=>{d==="Completed"&&i(L({taskGroupById:h.taskGroupById}))},[d,h.taskGroupById]),l==null)throw Error("Can't access task list page without signing in...");return k.jsxs(k.Fragment,{children:[d==="Completed"?k.jsx(z,{analytics:M,onLoad:c=>(A=>A.trackPageLoaded(V.Event.taskListPage))(c)}):null,k.jsxs(fa,{children:[k.jsx(ma,{isAppContentDrawerOpen:E,handleDrawerToggle:c=>{F(c)}}),k.jsx(Ta,{location:n,navigate:o,currentTenant:r,taskGroupId:T,taskGroupState:h,localData:D.localData,uiState:D.uiState,isTaskTemplatesEnabled:s,taskListFetchState:d,isAiCfoAccessEnabled:P,onAskAiCfoClick:x})]})]})}const ga=(t,e)=>`/${t}/tasks/${encodeURIComponent(e)}`,C=(t,e)=>`/${t}/tasks/new/${e}`,Da=(t,e)=>{if(t==="assignee"){const o=e.split(",");return{...u.taskDetailLocalData,assignee:o}}if(t==="priority"){const o=ra(e);return{...u.taskDetailLocalData,priority:o}}if(t==="status"){const o=ca(e);return{...u.taskDetailLocalData,status:o}}if(t==="tag"){const o=e.split(",");return{...u.taskDetailLocalData,tagIds:o}}if(t==="dueDate"){const o=pa(e);return{...u.taskDetailLocalData,dueDate:o}}return{...u.taskDetailLocalData}};export{$a as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-DOxb6osM.js";import $ from"./NotFoundScreen-De47ajWC.js";import{a as p}from"./sentry-CRdlKM_1.js";import{j as A,h as V,u as M,l as R,g as f,N as _,k as z,n as O,o as u}from"./core-C4fxU83C.js";import{w as q,z as w,s as b,y as H,e as T,g as K,cD as Q,j as Z,ao as J,p as W}from"./index-Ckao8u8S.js";import{eN as C,Pk as G,EQ as v,EE as X,Fg as Y,Pl as P,Pm as ee,EA as ae,Ex as te,pF as se,pt as ne,j$ as oe,EK as ie,Pn as re,EH as le,EV as ce,EU as me}from"./zeni-epic-state-Ba45HhdX.js";import{n as pe}from"./mui-CJ5-H5s3.js";import{u as de}from"./useInitialThreadRequest-cTEqQuCA.js";import{M as ue}from"./MobileAppDrawer-D3j8weyp.js";import ke from"./TaskListScreen-cDk45jDj.js";import"./recharts-95y0DFZP.js";import"./analytics-CgBmxqZY.js";import"./plaid-B0tTAlSw.js";import"./dnd-DoZPzASs.js";import"./stripe-DMRn4zHo.js";import"./lottie-BW8IlxIq.js";import"./lexical-jcYOTomA.js";import"./pdf-CSGP82Vc.js";import"./utils-CLosk-TB.js";import"./useAskAiCfoHostNavButtonProps-BGS1w2nN.js";import"./useFetchSuggestedQuestionsWhenReady-DxGAt9QA.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]="b745b4e4-1a11-47cc-8323-603679913398",e._sentryDebugIdIdentifier="sentry-dbid-b745b4e4-1a11-47cc-8323-603679913398")}catch{}})();const fe=z(function(e,t){const{location:n,taskGroupId:l}=t,m=P(e,t.taskId),c=C(e),i=l!=null?ee(e.taskGroupState,l):void 0,d=w.getSignedInUser(),a=c.tenantId,r={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},k=G(e);return{taskDetailSelectorView:m,authParams:r,isNewClicked:n.state?.message==="comingFromTaskListPage",filesEndPoint:J.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${Z.appUrl}${t.location.pathname}`,tagListView:k,taskGroupName:l!=null&&i!=null&&i.isDefault===!1?i.name:void 0}},function(e,t){const{taskId:n,navigate:l,currentTenant:m,location:c,taskGroupId:i}=t,{tenantEmailDomain:d}=m;return{onSaveChangesToLocalStore:a=>{e(me({taskDetailLocalData:a,taskId:n}))},onSaveDetailClick:()=>{e(ce(n,i))},onArchiveTaskClick:()=>{t.taskId!=null&&e(le(t.taskId))},onDismissClick:()=>{if(c.state?.message==="triggerBackClick"){const a=W(c.state?.pathnameStackToGoBack),r=a.poppedPathname??"../../dashboard";l(r,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=B(d),r=b(c.state?.pathnameStackToGoBack,c.pathname);l(a,{state:{pathnameStackToGoBack:r}})}e(re({taskId:n}))},onDeleteTaskClick:()=>{e(ie(n))},updateFilesEntity:a=>{e(oe({files:a}))},onDeleteFile:a=>{e(ne(a))},onEditFileName:(a,r)=>{e(se(a,r.split(".")[0]))},onReloadTaskDetailPage:()=>{e(v(!1,n))},onCreateTagClick:a=>{e(te(a,n))},onDeleteTagClick:a=>{e(ae(a,n))}}})(Q);function I(){const e=A(),t=V(),n=M(),l=q(),{taskId:m,taskGroupId:c}=R(),i=f(o=>C(o)),d=de(i?.companyId),[a,r]=p.useState(!1),[k,F]=p.useState(!1),[S,L]=p.useState(!1),[x,N]=p.useState(!1),y=f(o=>G(o)),j=f(o=>o.taskGroupViewState.fetchState);p.useEffect(()=>{k||(F(!0),t(v(!1,m)))},[k,t]),p.useEffect(()=>{S||y.fetchState==="Completed"||(L(!0),t(X()))},[S,t,y.fetchState]),p.useEffect(()=>{x||j==="Completed"||(N(!0),t(Y()))},[x,t,j]);const D=f(o=>P(o,m)),g=D.fetchState,E=w.getSignedInUser();if(E==null)throw Error("Can't access task detail page without signing in...");if(g==="Error"&&D.error?.code===400){const{tenantEmailDomain:o}=i,h=B(o),U=b(n.state?.pathnameStackToGoBack,n.pathname);return s.jsx(_,{to:h,state:{pathnameStackToGoBack:U}})}return s.jsxs(s.Fragment,{children:[g==="Completed"?s.jsx(H,{analytics:T,onLoad:o=>(h=>h.trackPageLoaded(K.Event.taskDetailPage))(o)}):null,s.jsxs(ge,{children:[s.jsx(ue,{isAppContentDrawerOpen:a,handleDrawerToggle:o=>{r(o)}}),s.jsx(fe,{analytics:T,currentTenant:i,handleZeniLogoClick:()=>{l.toggle()},initialOpenThreadRequest:d,location:n,loggedInUser:E,navigate:e,taskGroupId:c,taskId:m,taskDetailFetchState:g})]})]})}const ge=pe.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
+
`,B=e=>`/${e}/tasks`;function Ae(){return s.jsxs(O,{children:[s.jsx(u,{path:"/new",element:s.jsx(I,{})}),s.jsx(u,{path:"/new/:taskGroupId",element:s.jsx(I,{})}),s.jsx(u,{path:"/group/:taskGroupId",element:s.jsx(ke,{})}),s.jsx(u,{path:"/:taskId",element:s.jsx(I,{})}),s.jsx(u,{path:"*",element:s.jsx($,{})})]})}export{Ae as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as t}from"./liveblocks-DOxb6osM.js";import i from"./NotFoundScreen-De47ajWC.js";import{T as r}from"./TransactionDetailScreen-DOVDrZxO.js";import"./sentry-CRdlKM_1.js";import{n as d,o as e}from"./core-C4fxU83C.js";import"./zeni-epic-state-Ba45HhdX.js";import"./recharts-95y0DFZP.js";import"./index-Ckao8u8S.js";import"./mui-CJ5-H5s3.js";import"./analytics-CgBmxqZY.js";import"./plaid-B0tTAlSw.js";import"./dnd-DoZPzASs.js";import"./stripe-DMRn4zHo.js";import"./lottie-BW8IlxIq.js";import"./lexical-jcYOTomA.js";import"./pdf-CSGP82Vc.js";import"./utils-CLosk-TB.js";import"./useAskAiCfoHostNavButtonProps-BGS1w2nN.js";import"./useFetchSuggestedQuestionsWhenReady-DxGAt9QA.js";import"./decodeURIComponentSafe-B_w_tz2w.js";import"./routePaths-Dxwhh-fn.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new o.Error().stack;n&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[n]="256f287b-7a3d-4d6d-890e-a8cb9db8b86d",o._sentryDebugIdIdentifier="sentry-dbid-256f287b-7a3d-4d6d-890e-a8cb9db8b86d")}catch{}})();function q(){return t.jsxs(d,{children:[t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(e,{path:"/*",element:t.jsx(r,{})})]})}export{q as default};
|
package/dist/assets/{TransactionDetailScreen-C45CSgCt.js → TransactionDetailScreen-DOVDrZxO.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{j as I}from"./liveblocks-
|
|
1
|
+
import{j as I}from"./liveblocks-DOxb6osM.js";import{a as d}from"./sentry-CRdlKM_1.js";import{h as K,g as S,u as re,j as le,l as de,N as Ke,k as je}from"./core-C4fxU83C.js";import{bn as $e,eN as H,cO as ue,bv as me,pk as q,Jr as w,Ks as pe,Kt as Y,JR as he,jC as fe,Ku as ge,JW as X,JX as Q,kr as Se,GA as Z,Jl as _,jw as Te,ju as ye,jG as Je,Kv as Me,Kw as We,t9 as G,jB as ve,FX as Ee,cT as He,cU as qe,Kx as Ye,Jk as Xe,Ky as Qe,td as Ze,Kz as ea,KA as aa,KB as ta,KC as na,KD as oa,jF as sa,KE as ia,KF as ca,Jm as ra,KG as la,KH as da,KI as ua,FR as ma,FF as pa,G7 as ha,jH as fa,GB as ie,FO as ga}from"./zeni-epic-state-Ba45HhdX.js";import{z as Ce,a as ee,d as F,aI as De,h as Sa,k as Ta,aJ as ya,F as va,p as M,A as Ea,aK as Ca,s as W,J as Da,e as be,aL as ba,ao as Ia,O as J}from"./index-Ckao8u8S.js";import{n as ka,S as Aa,D as Ua}from"./mui-CJ5-H5s3.js";import{u as xa}from"./useAskAiCfoHostNavButtonProps-BGS1w2nN.js";import{c as _a}from"./useFetchSuggestedQuestionsWhenReady-DxGAt9QA.js";import{d as Ie}from"./decodeURIComponentSafe-B_w_tz2w.js";import{h as ke,g as Fa,d as Va,b as Ba}from"./routePaths-Dxwhh-fn.js";import{t as wa}from"./utils-CLosk-TB.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="99910b46-14c7-4cf3-b17f-152b43dccb68",a._sentryDebugIdIdentifier="sentry-dbid-99910b46-14c7-4cf3-b17f-152b43dccb68")}catch{}})();const ae=()=>{const a=Ce.getSignedInUser(),{useFeatureGate:e}=ee(),{isFeatureEnabled:s}=e(F.isChainOfThoughtEnabled);return d.useMemo(()=>$e(a)&&s,[a,s])};function Ae(a){if(a!=null){if("customer"in a&&a.customer!=null){const{customer:e}=a;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in a&&a.vendor!=null){const{vendor:e}=a;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function Za(a,e){const s=K(),{useFeatureGate:t,useDynamicConfig:n}=ee(),o=S(u=>H(u)),i=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),l=o.userRole!=null&&ue(o.userRole),g=o.userRole!=null&&me(o.userRole),{isFeatureEnabled:T}=t(F.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:b}=t(F.isExpenseAutomationEnabled),{configValue:h}=n(De.enableUncategorizedExpenseCategory),f=h?.uncategorized_expense_category_enabled===!0,k=ae(),y=d.useMemo(()=>({id:a,type:q(e)}),[a,e]),m=S(u=>w(u,y)),D=S(u=>{const z=w(u,y)?.transactionDetailLocalData.vendorUpdates?.id;return z==null?"Not-Started":u.transactionVendorViewState.editVendorStateById[z]?.saveStatus.fetchState??"Not-Started"}),p=d.useMemo(()=>m?.fetchState==="Completed"?Ae(m?.transaction):void 0,[m?.fetchState,m?.transaction]),E=S(u=>{if(p!=null)return pe(u.customerIncomeState,u.vendorExpenseState,u.trendState,p,"month")}),A=S(u=>Y(u)),V=S(u=>{if(p!=null)return he(u.trendWithTransactionsState,p,"TransactionDetail")}),j=o.company?.companyInfo.firstMonthOfFY??1,$=S(u=>fe(u.accountState,u.accountListState,"accountList")),[P,B]=d.useState(!1),[O,v]=d.useState(!1),[c,L]=d.useState(!1);d.useEffect(()=>{B(!1),v(!1),L(!1)},[a,e]);const C=d.useCallback(()=>{B(!1),v(!1)},[]),[U,x]=d.useState(!1),R=V?.selectedPeriod?.timePeriod;return d.useEffect(()=>{c||m==null||m.transaction==null||(s(ge({id:m.transaction.id,type:m.transaction.type})),L(!0)),p!=null&&(!i||l&&g===!1)&&(P?O||E==null||(v(!0),s(Z(p,"TransactionDetail",{timeframe:"month",timePeriod:R??E}))):(s(X()),s(Q()),B(!0),s(Se(p))))},[s,c,m?.fetchState,m?.transaction,p,i,l,g,P,O,E,R]),d.useEffect(()=>{A.newVendorState?.vendorDetailLocalData?.vendorName!=null?x(!0):x(!1)},[A.newVendorState?.vendorDetailLocalData?.vendorName]),d.useEffect(()=>()=>{s(_("common"))},[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:i,isUserHasDashboardAccess:l,isUserHasInvestorOrBankerAccess:g,isVendorBulkUpdateOnTransactionEnabled:T,isExpenseAutomationEnabled:b,isUncategorizedExpenseCategoryEnabled:f,isChainOfThoughtEnabled:k,selectedTransaction:y,transactionDetail:m,vendorSaveStatus:D,tranEntity:p,defaultTrendTransactionTimePeriod:E,vendorViewDetails:A,uiState:V,firstMonthOfFY:j,uncategorizedAccounts:$,resetTrendIsFetchedStates:C,isCreateVendorDrawerOpen:U,setIsCreateVendorDrawerOpen:x}}const Pa={overlayWidth:new va(100,100,58)},Oa=({isOpen:a,onSaveVendor:e,onSaveSuccess:s,onCancel:t,vendorViewDetails:n})=>{const o=Sa(),i=Ta(),l=K(),g=S(h=>Y(h)),T=()=>{t()},b={vendorDetailView:n??g,onSaveSuccess:()=>{l(ye()),l(Je("Not-Started")),s()},onSaveVendor:e,onCancelClick:T,saveVendorDetailLocalData:h=>{l(Te({vendorId:void 0,localData:h}))}};return I.jsx(Ua,{anchor:"right",open:a,PaperProps:{style:{width:Pa.overlayWidth.valuePercentage(i),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:T,children:I.jsx(La,{onClick:h=>h.stopPropagation(),children:I.jsx(ya,{...b})})})},La=ka(Aa)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|
|
5
|
-
`,Ra=({closeDrawerHandler:a,overrideTransactionId:e,overrideTransactionType:s})=>{const t=re(),n=le(),o=K(),i=ae(),{transactionTypeEncoded:l,transactionId:g}=de(),T=e??g,b=s??Ie(l??"");let h;ke(T,b)&&(h={id:T,type:q(b)});const f=h!=null?S(y=>w(y,h)):void 0,k=()=>{const y=J(t.state?.pathnameStackToGoBack),m=y.poppedPathname??((D=2)=>{let p="../";for(let E=0;E<D;E++)p=`${p}../`;return p})(1);n(m,{state:{pathnameStackToGoBack:y.newStack}})};return{transactionId:h,onSaveVendor:()=>{o(ve(h,void 0))},onSaveSuccess:()=>{if(f!=null&&f?.transaction&&f?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&f?.transactionDetailLocalData.vendorUpdates?.id!=null){const y=f?.transactionDetailLocalData.vendorUpdates,m={id:f?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:f?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:y?.name,qboId:f?.transactionDetailLocalData.vendorUpdates?.qboId??""},D={transactionId:{id:f?.transaction?.id,type:f?.transaction?.type},transaction:f?.transaction,lineIds:f?.transaction?.lines?.map(p=>p.id)??[]};o(G(m,f?.transaction?.amount.amount,D,!1,!1,i))}k()},onCancel:()=>{h!=null&&o(Je({transactionId:h})),o(ye()),o(Me()),a(!0),k()}}},za=je(function(a,e){const s=w(a,e.selectedTransaction);let t;s==null&&console.warn("Check if the you've selected the transaction before getting the details");const n=Ce.getSignedInUser(),o=a.tenantState.currentTenantId,i={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""};s!=null&&s.fetchState==="Completed"&&s.transaction!=null&&e.entity!=null&&(t=Ye(a,e.entity,"TransactionDetail"));const l=a.entityAutoCompleteState.autoCompleteText.common,g=Xe(a,"common"),T=W(a);return{transactionDetail:s,transactionAttachmentEndpointToDownload:`${H}/transaction_attachment`,transactionAttachmentsEndpointToFetch:T.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${H}/transaction_attachments_accounting_provider`:`${H}/transaction_attachments`,attachmentUploadEndpoint:`${Ia.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:i,trendReport:t,analytics:be,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:l,entityAutoCompleteView:g},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails")}},function(a,e){const{isCOTEnabled:s}=e;return{onBackClick:()=>{if(a(_("common")),e.onBackClick!=null)return void e.onBackClick();const t=J(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ue(2);e.navigate(n,{state:{pathnameStackToGoBack:t.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(t,n)=>{e.transaction!=null&&a(ga({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:t,customerId:n}))},onTransactionClick:t=>{e.resetTrendIsFetchedStates(),a(X()),a(Z());const n=M(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(Ba(t,e.tenantEmailDomain),{state:{pathnameStackToGoBack:n}})},onTrendSelectedPeriodChange:t=>{if(t==null)e.defaultTrendTransactionTimePeriod!=null&&a(ie(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const n=t.currentTimePeriod==null?t.addTimePeriod:{startDate:t.addTimePeriod.startDate,endDate:t.currentTimePeriod.endDate};a(Q(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:t.addTimePeriod})),a(ie(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:n}))}},onSaveUpdates:(t,n,o,i)=>{a(i===!0&&o!=null?ve(t,o,!0,e.isExpenseAutomationEnabled,e.isUncategorizedExpenseCategoryEnabled):fa({transactionId:t,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:n,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled})),a(_("common"))},onUploadAttachmentAttachment:t=>{a(ha(t))},onDeleteAttachment:t=>{e.transaction!=null&&a(pa(t,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(t,n)=>{a(ma({transactionId:t,transactionLocalData:n}))},onUpdateAllChecked:(t,n,o,i)=>{e.transaction!=null&&a(ua(e.selectedTransaction,e.transaction,t,n,o,i))},onResetLineItemsCategoryClassInLocalData:(t,n,o,i,l,g)=>{a(da(t,n,o,i,l,g))},onChangeCategoryClassWhenUpdateAllIsChecked:(t,n)=>{e.transaction!=null&&a(la({id:e.transaction.id,type:e.transaction.type},e.transaction,t,n))},onSaveSuccess:()=>{const t=J(e.location.state?.pathnameStackToGoBack);if(t.poppedPathname!=null){const n=wa(t.poppedPathname,"/").split("/"),o=n[n.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(o)&&e.navigate(t.poppedPathname,{state:{pathnameStackToGoBack:t.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const i=`${Fa(e.tenantEmailDomain)}`;e.navigate(i)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const i=`${Va(e.tenantEmailDomain)}`;e.navigate(i)}}},onPageRefresh:()=>{a(Ee(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(t,n)=>{t.trim().length>=2?a(ra({searchString:t,entityType:n,searchOrigin:"common"})):t.trim().length===0&&a(_("common"))},onCancelAutoComplete:()=>{a(_("common"))}},onFetchRecommendationsForEntity:(t,n,o,i)=>{a(G(t,n,o,i,!1,s))},clearRecommendationForLineId:t=>{const{transactionId:n,transaction:o,lineId:i}=t;a(ca(n,o,i))},resetUpdateErrorState:()=>{const t={id:e.selectedTransaction.id,type:e.selectedTransaction.type};a(ia(t))},onSaveVendorInLocalData:(t,n,o,i,l)=>{if(a(sa({transactionId:t,vendorUpdates:n,entity:o})),n.id!=null&&o!=null&&i!=null&&l!=null&&a(G(o,i,l,!1,!1,s)),a(Te({vendorId:n.id?n.id:void 0,localData:{vendorName:n.name,vendorId:n.id?n.id:void 0}})),!n.id&&e.transaction!=null){const g=e.transaction,T=M(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(g.type??"")}/${g.id}/vendor/create`,{state:{pathnameStackToGoBack:T}})}},onSaveCustomerInLocalData:(t,n,o,i,l)=>{a(oa({transactionId:t,customerUpdates:n,entity:o})),n.id!=null&&o!=null&&i!=null&&l!=null&&a(G(o,i,l,!1,!1,s))},onUpdateAllTranactionsWithCurrentVendorChecked:t=>{a(na({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:t}))},onClickUpdateVendorToAllLineItems:(t,n,o)=>{a(ta(t,n,o))},onResetVendorToAllLineItems:(t,n,o)=>{a(aa(t,n,o))},saveLatestSelectedEntity:(t,n,o)=>{a(ea({transactionId:t,lineId:n,entity:o}))},updateVendorBulkRecommendationsFetchStatus:(t,n)=>{a(Qe(t,n))},setIsVendorUpdateAllChecked:(t,n,o)=>{a(Ze(t,n,o))}}})(ba);function et(){const a=le(),e=K(),s=re(),{useFeatureGate:t,useDynamicConfig:n}=ee(),o=Ea(),i=S(r=>W(r)),l=i.userRole.includes("charge_card_user")||i.userRole.includes("charge_card_admin"),g=i.userRole!=null&&ue(i.userRole),T=i.userRole!=null&&me(i.userRole),{isFeatureEnabled:b}=t(F.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:h}=t(F.isExpenseAutomationEnabled),{configValue:f}=n(De.enableUncategorizedExpenseCategory),k=f?.uncategorized_expense_category_enabled===!0,{tenantEmailDomain:y,transactionTypeEncoded:m,transactionId:D}=de(),[p,E]=d.useState(!1),A=Ie(m??""),V=ke(D,A),j=S(r=>r.transactionVendorViewState),$=ae(),{isFeatureEnabled:P}=t(F.isTransactionCommentingEnabled),B=o?.currentTenant?.companyId,L=o?.currentTenant?.companyName;let v;V&&(v={id:D,type:q(A)});const c=v!=null?S(r=>w(r,v)):void 0,O=c?.transactionDetailLocalData.vendorUpdates?.id!=null?j.editVendorStateById[c?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",C=c?.fetchState==="Completed"?Ae(c?.transaction):void 0,U=S(r=>C!=null?pe(r.customerIncomeState,r.vendorExpenseState,r.trendState,C,"month"):void 0),x=S(r=>Y(r)),R=S(r=>C!=null?he(r.trendWithTransactionsState,C,"TransactionDetail"):void 0),u=i.company?.companyInfo.firstMonthOfFY??1,z=S(r=>fe(r.accountState,r.accountListState,"accountList")),[xe,te]=d.useState(!1),[_e,ne]=d.useState(!1),[Fe,Ve]=d.useState(!1),oe=()=>{te(!1),ne(!1)},Be=Ca();d.useEffect(()=>{if(v!=null&&c!=null&&c.fetchState==="Not-Started")e(Ee(v)),oe();else if(v!=null&&c!=null&&c.fetchState==="Error"){const r=M(s.state?.pathnameStackToGoBack,s.pathname),N={pathnameStackToGoBack:r,message:"pageNotFound",origin:"transaction_detail"};Be&&(N.message="expenseAutomation",N.origin="transaction_categorization",N.pathnameStackToGoBack=r),a("page-not-found",{replace:!0,state:N})}},[v]),d.useEffect(()=>{Fe||c==null||c.transaction==null||(e(ge({id:c.transaction.id,type:c.transaction.type})),Ve(!0)),C==null&&c?.fetchState==="Completed"&&ce(c?.transaction),C!=null&&(!l||g&&T===!1)&&(xe?_e||U==null||(ne(!0),e(Q(C,"TransactionDetail",{timeframe:"month",timePeriod:R?.selectedPeriod?.timePeriod??U}))):(e(X()),e(Z()),ce(c?.transaction),te(!0),e(Se(C))))},[c?.fetchState,c?.transaction,U,l]),d.useEffect(()=>{x.newVendorState?.vendorDetailLocalData?.vendorName!=null?E(!0):E(!1)},[x.newVendorState?.vendorDetailLocalData?.vendorName]),d.useEffect(()=>()=>{e(_("common"))},[]);const we=[m,D].filter(r=>r!=null),{transactionId:se,onSaveVendor:Pe,onSaveSuccess:Le,onCancel:Oe}=Ra({closeDrawerHandler:r=>{E(!1),a(r?"../":"../..")}}),{isAiCfoOpen:Re,setIsAiCfoOpen:ze}=Da(),{isAiCfoAccessEnabled:Ne,onAskAiCfoClick:Ge}=xa({isAiCfoOpen:Re,setIsAiCfoOpen:ze,mobileExploreReferrer:"Transaction Details"});return _a({isDataReady:c?.fetchState==="Completed"}),V?I.jsxs(I.Fragment,{children:[se!=null&&p&&I.jsx(La,{isOpen:p,transactionId:se,onSaveVendor:Pe,onSaveSuccess:Le,onCancel:Oe}),I.jsx(za,{hideDeleteAttachment:!0,firstMonthOfFY:u,isDisabled:c?.transaction?.type==="transfer"&&o?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:y,location:s,navigate:a,selectedTransaction:v,entity:C,isCOTEnabled:$,defaultTrendTransactionTimePeriod:U,resetTrendIsFetchedStates:oe,transaction:c?.transaction,uncategorizedAccounts:z,vendorSaveStatus:O,isVendorBulkUpdateOnTransactionEnabled:b,isExpenseAutomationEnabled:h,isUncategorizedExpenseCategoryEnabled:k,isAiCfoAccessEnabled:Ne,onAskAiCfoClick:Ge,isTransactionCommentingEnabled:P,companyId:B,companyName:L})]}):I.jsx(Ke,{to:Ue(we.length)})}const Ue=(a=2)=>{let e="../";for(let s=0;s<a;s++)e=`${e}../`;return e},ce=a=>{if(a!=null){const{transactionCategory:e,transactionClass:s}=Na(a),t=Ga(a);be.trackTransactionDetails(a.account?.accountId,a.account?.accountName,a.id,t,e.length>0?e:void 0,s.length>0?s:void 0,a.type,a.amount,a.memo,a.lines?.length??0,a.attachments?.map(n=>n.fileName))}},Na=a=>{const e=[],s=[];return a.lines?.forEach(t=>{switch(t.type){case"transaction_with_account_and_class_line":case"transaction_with_product_or_service_line":case"journal_entry_transaction_line":case"linked_transaction_line":{const n=t;n!=null&&n.account!=null&&n.account.accountName?.length>0&&e.push(n.account.accountName),n.class!=null&&n.class.className?.length>0&&s.push(n.class.className);break}}}),{transactionCategory:e,transactionClass:s}},Ga=a=>We(a)===!0?a.customer?.name??"":qe(a)===!0?a.vendor?.name??"":a.memo!=null?a.memo:a.type;export{La as C,et as T,Ra as a,za as b,ae as c,Qa as u};
|
|
5
|
+
`,Ra=({closeDrawerHandler:a,overrideTransactionId:e,overrideTransactionType:s})=>{const t=re(),n=le(),o=K(),i=ae(),{transactionTypeEncoded:l,transactionId:g}=de(),T=e??g,b=s??Ie(l??"");let h;ke(T,b)&&(h={id:T,type:q(b)});const f=h!=null?S(y=>w(y,h)):void 0,k=()=>{const y=M(t.state?.pathnameStackToGoBack),m=y.poppedPathname??((D=2)=>{let p="../";for(let E=0;E<D;E++)p=`${p}../`;return p})(1);n(m,{state:{pathnameStackToGoBack:y.newStack}})};return{transactionId:h,onSaveVendor:()=>{o(ve(h,void 0))},onSaveSuccess:()=>{if(f!=null&&f?.transaction&&f?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&f?.transactionDetailLocalData.vendorUpdates?.id!=null){const y=f?.transactionDetailLocalData.vendorUpdates,m={id:f?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:f?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:y?.name,qboId:f?.transactionDetailLocalData.vendorUpdates?.qboId??""},D={transactionId:{id:f?.transaction?.id,type:f?.transaction?.type},transaction:f?.transaction,lineIds:f?.transaction?.lines?.map(p=>p.id)??[]};o(G(m,f?.transaction?.amount.amount,D,!1,!1,i))}k()},onCancel:()=>{h!=null&&o(Me({transactionId:h})),o(ye()),o(We()),a(!0),k()}}},za=je(function(a,e){const s=w(a,e.selectedTransaction);let t;s==null&&console.warn("Check if the you've selected the transaction before getting the details");const n=Ce.getSignedInUser(),o=a.tenantState.currentTenantId,i={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""};s!=null&&s.fetchState==="Completed"&&s.transaction!=null&&e.entity!=null&&(t=Ye(a,e.entity,"TransactionDetail"));const l=a.entityAutoCompleteState.autoCompleteText.common,g=Xe(a,"common"),T=H(a);return{transactionDetail:s,transactionAttachmentEndpointToDownload:`${J}/transaction_attachment`,transactionAttachmentsEndpointToFetch:T.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${J}/transaction_attachments_accounting_provider`:`${J}/transaction_attachments`,attachmentUploadEndpoint:`${Ia.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:i,trendReport:t,analytics:be,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:l,entityAutoCompleteView:g},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails")}},function(a,e){const{isCOTEnabled:s}=e;return{onBackClick:()=>{if(a(_("common")),e.onBackClick!=null)return void e.onBackClick();const t=M(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ue(2);e.navigate(n,{state:{pathnameStackToGoBack:t.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(t,n)=>{e.transaction!=null&&a(ga({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:t,customerId:n}))},onTransactionClick:t=>{e.resetTrendIsFetchedStates(),a(X()),a(Q());const n=W(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(Ba(t,e.tenantEmailDomain),{state:{pathnameStackToGoBack:n}})},onTrendSelectedPeriodChange:t=>{if(t==null)e.defaultTrendTransactionTimePeriod!=null&&a(ie(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const n=t.currentTimePeriod==null?t.addTimePeriod:{startDate:t.addTimePeriod.startDate,endDate:t.currentTimePeriod.endDate};a(Z(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:t.addTimePeriod})),a(ie(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:n}))}},onSaveUpdates:(t,n,o,i)=>{a(i===!0&&o!=null?ve(t,o,!0,e.isExpenseAutomationEnabled,e.isUncategorizedExpenseCategoryEnabled):fa({transactionId:t,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:n,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled})),a(_("common"))},onUploadAttachmentAttachment:t=>{a(ha(t))},onDeleteAttachment:t=>{e.transaction!=null&&a(pa(t,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(t,n)=>{a(ma({transactionId:t,transactionLocalData:n}))},onUpdateAllChecked:(t,n,o,i)=>{e.transaction!=null&&a(ua(e.selectedTransaction,e.transaction,t,n,o,i))},onResetLineItemsCategoryClassInLocalData:(t,n,o,i,l,g)=>{a(da(t,n,o,i,l,g))},onChangeCategoryClassWhenUpdateAllIsChecked:(t,n)=>{e.transaction!=null&&a(la({id:e.transaction.id,type:e.transaction.type},e.transaction,t,n))},onSaveSuccess:()=>{const t=M(e.location.state?.pathnameStackToGoBack);if(t.poppedPathname!=null){const n=wa(t.poppedPathname,"/").split("/"),o=n[n.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(o)&&e.navigate(t.poppedPathname,{state:{pathnameStackToGoBack:t.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const i=`${Fa(e.tenantEmailDomain)}`;e.navigate(i)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const i=`${Va(e.tenantEmailDomain)}`;e.navigate(i)}}},onPageRefresh:()=>{a(Ee(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(t,n)=>{t.trim().length>=2?a(ra({searchString:t,entityType:n,searchOrigin:"common"})):t.trim().length===0&&a(_("common"))},onCancelAutoComplete:()=>{a(_("common"))}},onFetchRecommendationsForEntity:(t,n,o,i)=>{a(G(t,n,o,i,!1,s))},clearRecommendationForLineId:t=>{const{transactionId:n,transaction:o,lineId:i}=t;a(ca(n,o,i))},resetUpdateErrorState:()=>{const t={id:e.selectedTransaction.id,type:e.selectedTransaction.type};a(ia(t))},onSaveVendorInLocalData:(t,n,o,i,l)=>{if(a(sa({transactionId:t,vendorUpdates:n,entity:o})),n.id!=null&&o!=null&&i!=null&&l!=null&&a(G(o,i,l,!1,!1,s)),a(Te({vendorId:n.id?n.id:void 0,localData:{vendorName:n.name,vendorId:n.id?n.id:void 0}})),!n.id&&e.transaction!=null){const g=e.transaction,T=W(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(g.type??"")}/${g.id}/vendor/create`,{state:{pathnameStackToGoBack:T}})}},onSaveCustomerInLocalData:(t,n,o,i,l)=>{a(oa({transactionId:t,customerUpdates:n,entity:o})),n.id!=null&&o!=null&&i!=null&&l!=null&&a(G(o,i,l,!1,!1,s))},onUpdateAllTranactionsWithCurrentVendorChecked:t=>{a(na({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:t}))},onClickUpdateVendorToAllLineItems:(t,n,o)=>{a(ta(t,n,o))},onResetVendorToAllLineItems:(t,n,o)=>{a(aa(t,n,o))},saveLatestSelectedEntity:(t,n,o)=>{a(ea({transactionId:t,lineId:n,entity:o}))},updateVendorBulkRecommendationsFetchStatus:(t,n)=>{a(Ze(t,n))},setIsVendorUpdateAllChecked:(t,n,o)=>{a(Qe(t,n,o))}}})(ba);function et(){const a=le(),e=K(),s=re(),{useFeatureGate:t,useDynamicConfig:n}=ee(),o=Ea(),i=S(r=>H(r)),l=i.userRole.includes("charge_card_user")||i.userRole.includes("charge_card_admin"),g=i.userRole!=null&&ue(i.userRole),T=i.userRole!=null&&me(i.userRole),{isFeatureEnabled:b}=t(F.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:h}=t(F.isExpenseAutomationEnabled),{configValue:f}=n(De.enableUncategorizedExpenseCategory),k=f?.uncategorized_expense_category_enabled===!0,{tenantEmailDomain:y,transactionTypeEncoded:m,transactionId:D}=de(),[p,E]=d.useState(!1),A=Ie(m??""),V=ke(D,A),j=S(r=>r.transactionVendorViewState),$=ae(),{isFeatureEnabled:P}=t(F.isTransactionCommentingEnabled),B=o?.currentTenant?.companyId,O=o?.currentTenant?.companyName;let v;V&&(v={id:D,type:q(A)});const c=v!=null?S(r=>w(r,v)):void 0,L=c?.transactionDetailLocalData.vendorUpdates?.id!=null?j.editVendorStateById[c?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",C=c?.fetchState==="Completed"?Ae(c?.transaction):void 0,U=S(r=>C!=null?pe(r.customerIncomeState,r.vendorExpenseState,r.trendState,C,"month"):void 0),x=S(r=>Y(r)),R=S(r=>C!=null?he(r.trendWithTransactionsState,C,"TransactionDetail"):void 0),u=i.company?.companyInfo.firstMonthOfFY??1,z=S(r=>fe(r.accountState,r.accountListState,"accountList")),[xe,te]=d.useState(!1),[_e,ne]=d.useState(!1),[Fe,Ve]=d.useState(!1),oe=()=>{te(!1),ne(!1)},Be=Ca();d.useEffect(()=>{if(v!=null&&c!=null&&c.fetchState==="Not-Started")e(Ee(v)),oe();else if(v!=null&&c!=null&&c.fetchState==="Error"){const r=W(s.state?.pathnameStackToGoBack,s.pathname),N={pathnameStackToGoBack:r,message:"pageNotFound",origin:"transaction_detail"};Be&&(N.message="expenseAutomation",N.origin="transaction_categorization",N.pathnameStackToGoBack=r),a("page-not-found",{replace:!0,state:N})}},[v]),d.useEffect(()=>{Fe||c==null||c.transaction==null||(e(ge({id:c.transaction.id,type:c.transaction.type})),Ve(!0)),C==null&&c?.fetchState==="Completed"&&ce(c?.transaction),C!=null&&(!l||g&&T===!1)&&(xe?_e||U==null||(ne(!0),e(Z(C,"TransactionDetail",{timeframe:"month",timePeriod:R?.selectedPeriod?.timePeriod??U}))):(e(X()),e(Q()),ce(c?.transaction),te(!0),e(Se(C))))},[c?.fetchState,c?.transaction,U,l]),d.useEffect(()=>{x.newVendorState?.vendorDetailLocalData?.vendorName!=null?E(!0):E(!1)},[x.newVendorState?.vendorDetailLocalData?.vendorName]),d.useEffect(()=>()=>{e(_("common"))},[]);const we=[m,D].filter(r=>r!=null),{transactionId:se,onSaveVendor:Pe,onSaveSuccess:Oe,onCancel:Le}=Ra({closeDrawerHandler:r=>{E(!1),a(r?"../":"../..")}}),{isAiCfoOpen:Re,setIsAiCfoOpen:ze}=Da(),{isAiCfoAccessEnabled:Ne,onAskAiCfoClick:Ge}=xa({isAiCfoOpen:Re,setIsAiCfoOpen:ze,mobileExploreReferrer:"Transaction Details"});return _a({isDataReady:c?.fetchState==="Completed"}),V?I.jsxs(I.Fragment,{children:[se!=null&&p&&I.jsx(Oa,{isOpen:p,transactionId:se,onSaveVendor:Pe,onSaveSuccess:Oe,onCancel:Le}),I.jsx(za,{hideDeleteAttachment:!0,firstMonthOfFY:u,isDisabled:c?.transaction?.type==="transfer"&&o?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:y,location:s,navigate:a,selectedTransaction:v,entity:C,isCOTEnabled:$,defaultTrendTransactionTimePeriod:U,resetTrendIsFetchedStates:oe,transaction:c?.transaction,uncategorizedAccounts:z,vendorSaveStatus:L,isVendorBulkUpdateOnTransactionEnabled:b,isExpenseAutomationEnabled:h,isUncategorizedExpenseCategoryEnabled:k,isAiCfoAccessEnabled:Ne,onAskAiCfoClick:Ge,isTransactionCommentingEnabled:P,companyId:B,companyName:O})]}):I.jsx(Ke,{to:Ue(we.length)})}const Ue=(a=2)=>{let e="../";for(let s=0;s<a;s++)e=`${e}../`;return e},ce=a=>{if(a!=null){const{transactionCategory:e,transactionClass:s}=Na(a),t=Ga(a);be.trackTransactionDetails(a.account?.accountId,a.account?.accountName,a.id,t,e.length>0?e:void 0,s.length>0?s:void 0,a.type,a.amount,a.memo,a.lines?.length??0,a.attachments?.map(n=>n.fileName))}},Na=a=>{const e=[],s=[];return a.lines?.forEach(t=>{switch(t.type){case"transaction_with_account_and_class_line":case"transaction_with_product_or_service_line":case"journal_entry_transaction_line":case"linked_transaction_line":{const n=t;n!=null&&n.account!=null&&n.account.accountName?.length>0&&e.push(n.account.accountName),n.class!=null&&n.class.className?.length>0&&s.push(n.class.className);break}}}),{transactionCategory:e,transactionClass:s}},Ga=a=>He(a)===!0?a.customer?.name??"":qe(a)===!0?a.vendor?.name??"":a.memo!=null?a.memo:a.type;export{Oa as C,et as T,Ra as a,za as b,ae as c,Za as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as i}from"./liveblocks-Dg-fyTMV.js";import{j as J,u as w,h as U,l as Q,g as L,N as C,k as Z,n as Ae,o as v}from"./core-wdixcJGy.js";import{eN as R,iQ as T,NP as H,Gr as ue,bq as ie,NQ as he,jr as W,JT as X,NR as se,NS as Se,bC as x,Go as me,NT as ke,NU as re,NV as Ie,NW as pe,NX as be,NY as ve,NZ as de,HE as Ye,bn as xe}from"./zeni-epic-state-CMWGtUDg.js";import{D as K,e as B,c5 as ee,s as _,q as te,a as fe,d as q,I as Ee,z as Pe}from"./index-DKtQQWiY.js";import"./mui-DJdtEuia.js";import{a as A}from"./sentry-CNayqfac.js";import{w as ae}from"./withTransactionSidePanel-CAGurxbY.js";import{p as ne,b as ce}from"./routePaths-D74B3ANG.js";import{u as Le}from"./utils-CTYAiaC-.js";import{d as P}from"./decodeURIComponentSafe-C5AZz8lB.js";import{Z as je}from"./ZeniAccountStatementScreen-CLegG4Iq.js";import"./recharts-eHKNWuPW.js";import"./analytics-G2IGQMBx.js";import"./plaid-Bjhyc1hA.js";import"./dnd-zypUBS1u.js";import"./stripe-DMRn4zHo.js";import"./lottie-CwpADPvV.js";import"./lexical-C-QOY2-d.js";import"./pdf-BJH97oh9.js";import"./useAskAiCfoHostNavButtonProps-D_rHUMYx.js";import"./useFetchSuggestedQuestionsWhenReady-D-ilcAbE.js";import"./TransactionDetailScreen-C45CSgCt.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="a57f3eb9-dd19-4f31-ae01-7d9606d1bac0",a._sentryDebugIdIdentifier="sentry-dbid-a57f3eb9-dd19-4f31-ae01-7d9606d1bac0")}catch{}})();const G=a=>Le(a),ze=Z(function(a,e){const t=he(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,G(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:X(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:W(a)}},function(a,e){return{onBackClick:()=>{const t=te(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=K.getLocalizedStrings(),r=G(e.selectedAccount.tranListType),s=Be(t,n,c,r,e.bookCloseDate);B.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(se({uiState:{dateRange:s},type:G(e.selectedAccount.tranListType)})),a(ue(r,T(s),!1,r==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(T(s))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=ce(t,e.tenantEmailDomain),c=_(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(se({uiState:{scrollYOffset:t},type:G(e.selectedAccount.tranListType)}))}}})(ee),F=ae(function({...a}){const e=J(),t=w(),n=U(),c=t.pathname.substring(t.pathname.lastIndexOf("/")+1),{tenantEmailDomain:o}=Q(),r=K.getLocalizedStrings(),{accountType:s,title:u,subTitle:h}=Me(c),D="month",g=L(p=>R(p)),Y=g.company?.companyInfo.firstMonthOfFY??1,{dataAvailable:y,initialTimeframeTick:S}=Ce(c,Y,g.bookCloseDate),[k,j]=A.useState(!1),[z,E]=A.useState(void 0),m=A.useMemo(()=>{const p=T(S);return{tranListType:c,accountType:H(s),title:u,subTitle:h,timeframe:D,period:p}},[c,D,s,y]);A.useEffect(()=>{if(!k&&m!=null){j(!0),B.trackTransactionList(void 0,void 0,void 0,m.title);const p=G(m.tranListType);n(ue(p,m.period,!0,p==="missingReceipts"?r.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}},[k,m,n]);let I=m;return m!=null&&z!=null&&(I={...m,period:z}),I==null?i.jsx(C,{to:"../"}):i.jsx(ze,{firstMonthOfFY:Y,tenantEmailDomain:o,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:y,navigate:e,selectedAccount:I,referrerType:c,bookCloseDate:g.bookCloseDate,onSelectedTimePeriodChange:p=>E(p),...a})}),Me=a=>{let e="",t="",n="";const c=K.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=c.uncategorizedTransactionList.income.title,n=c.uncategorizedTransactionList.income.subTitle;break;case"uncategorized-expense":e="expenses",t=c.uncategorizedTransactionList.expense.title,n=c.uncategorizedTransactionList.expense.subTitle;break;case"miscategorized-expense":e="expenses",t=c.miscategorizedTransactionList.expense.title,n=c.miscategorizedTransactionList.expense.subTitle;break;case"miscategorized-income":e="income",t=c.miscategorizedTransactionList.income.title,n=c.miscategorizedTransactionList.income.subTitle;break;case"missing-receipts":t=c.uncategorizedTransactionList.missingReceipt.title,n=c.uncategorizedTransactionList.missingReceipt.subTitle}return{accountType:e,title:t,subTitle:n}},Ce=(a,e,t)=>{const n=ie();let c=ie().startOf("month").subtract(11,"month");return t!=null&&a!=="missing-receipts"?t.add(1,"day").isBefore(c)?{dataAvailable:{startDate:t.add(1,"day"),endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}:(c=t.add(1,"day"),{dataAvailable:{startDate:c,endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}):{dataAvailable:ne(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Be=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},Oe=Z(function(a,e){const t=ke(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:X(e.selectedAccount.period),dataAvailableForPeriod:ne(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:W(a)}},function(a,e){return{onBackClick:()=>{const t=te(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Te();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),B.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(re({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(me(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,T(o))),e.onSelectedTimePeriodChange(T(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=ce(t,e.tenantEmailDomain),c=_(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(re({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}})(ee),Fe=ae(function({referrerType:a,...e}){const t=J(),n=w(),c=U(),{tenantEmailDomain:o,accountTypeEncoded:r,accountIdEncoded:s,classIdEncoded:u,timeframe:h,startDate:D,endDate:g,titleEncoded:Y}=Q(),y=P(r??""),S=P(s??""),k=P(u??""),j=P(Y??""),z=L(f=>Se(f.transactionListState,S,y,k)),[E,m]=A.useState(!1),[I,p]=A.useState(void 0),N=L(f=>R(f)),$=N.company?.companyInfo.firstMonthOfFY??1;let d;const l=Ge(y,S,k,h,D,g,j);if(l){const f={startDate:x(D,"YYYY-MM-DD"),endDate:x(g,"YYYY-MM-DD")},V=Ne(z?.dateRange,f);d={accountId:S,accountType:H(y),classId:k,title:j,timeframe:h,period:V}}A.useEffect(()=>{E||d==null||(m(!0),B.trackTransactionList(d.accountId,void 0,a,d.title),c(me(d.accountId,d.accountType,d.classId,d.period)))},[E,d,c]);let M=d;d!=null&&I!=null&&(M={...d,period:I});const O=[r,s,u,h,D,g,Y].filter(f=>f!=null);return l&&M!=null?i.jsx(Oe,{firstMonthOfFY:$,tenantEmailDomain:o,location:n,navigate:t,selectedAccount:M,referrerType:a,onSelectedTimePeriodChange:f=>p(f),...e}):i.jsx(C,{to:Te(O.length)})}),Te=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ge=(a,e,t,n,c,o,r)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&x(c,"YYYY-MM-DD").isValid()&&x(o,"YYYY-MM-DD").isValid()&&r!=null,Ne=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?T(a):T(e),_e=Z(function(a,e){const t=be(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&ve(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:X(e.selectedAccount.period),dataAvailableForPeriod:ne(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:W(a)}},function(a,e){return{onBackClick:()=>{const t=te(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??De();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),B.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(de({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(pe(e.selectedAccount.accountId,e.selectedAccount.accountType,T(o))),e.onSelectedTimePeriodChange(T(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=ce(t,e.tenantEmailDomain),c=_(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(de({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=$e(e.tenantEmailDomain),n=_(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}})(ee),le=ae(function({referrerType:a,...e}){const t=J(),n=w(),c=U(),{tenantEmailDomain:o,accountTypeEncoded:r,accountIdEncoded:s,timeframe:u,startDate:h,endDate:D,titleEncoded:g,excludeSubAccounts:Y}=Q(),y=P(r??""),S=P(s??""),k=P(g??""),j=!(Y!=null&&Y==="exclude_subaccounts"),z=L(b=>Ie(b.transactionListState,S,y)),[E,m]=A.useState(!1),[I,p]=A.useState(void 0),N=L(b=>R(b)),$=N.company?.featuresActivationInfo.connectedAccountProvider==="unit",d=N.company?.companyInfo.firstMonthOfFY??1;let l;const M=we(y,S,u,h,D,k);if(M){const b={startDate:x(h,"YYYY-MM-DD"),endDate:x(D,"YYYY-MM-DD")},ye=Re(z?.dateRange,b);l={accountId:S,accountType:H(y),title:k,timeframe:u,period:ye}}let O=l;l!=null&&I!=null&&(O={...l,period:I});const{useFeatureGate:f}=fe(),{isFeatureEnabled:V}=f(q.isTransactionCommentingEnabled),{areTenantIdsInSync:oe}=Ee();A.useEffect(()=>{!E&&l!=null&&oe&&(m(!0),B.trackTransactionList(l.accountId,void 0,a,l.title),c(pe(l.accountId,l.accountType,l.period,void 0,!1,j)))},[E,l,c,oe]);const ge=[r,s,u,h,D,g].filter(b=>b!=null);return M&&O!=null?i.jsx(_e,{firstMonthOfFY:d,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:$,isTransactionCommentingEnabled:V,selectedAccount:O,referrerType:a,onSelectedTimePeriodChange:b=>p(b),...e}):i.jsx(C,{to:De(ge.length)})}),De=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},we=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&x(n,"YYYY-MM-DD").isValid()&&x(c,"YYYY-MM-DD").isValid()&&o!=null,Re=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?T(a):T(e),$e=a=>`/${a}/transactions/${Ye}/statements`;function mt(){const a=w().state?.referrer,e=Pe.getSignedInUser(),t=xe(e),{useFeatureGate:n}=fe(),{isFeatureEnabled:c}=n(q.isExpenseAutomationEnabled),o=L(u=>u.expenseAutomationViewState.selectedPeriodByTenantId)[L(u=>R(u)).tenantId],{isFeatureEnabled:r}=n(q.isExpenseAutomationEnabledV2),s=r||c&&t;return i.jsxs(Ae,{children:[i.jsx(v,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:i.jsx(le,{referrerType:a})}),i.jsx(v,{path:"/zeni-clearing-account/statements",element:i.jsx(je,{})}),i.jsx(v,{path:"/*",element:i.jsx(le,{referrerType:a})}),i.jsx(v,{path:"/uncategorized-income/*",element:i.jsx(F,{})}),i.jsx(v,{path:"/uncategorized-expense/*",element:s?i.jsx(C,{to:`../../month_end_close_checks/review/transaction_categorization/${o.month}-${o.year}`}):i.jsx(F,{})}),i.jsx(v,{path:"/miscategorized-income/*",element:i.jsx(F,{})}),i.jsx(v,{path:"/miscategorized-expense/*",element:s?i.jsx(C,{to:`../../month_end_close_checks/review/transaction_categorization/${o.month}-${o.year}`}):i.jsx(F,{})}),i.jsx(v,{path:"/missing-receipts/*",element:s?i.jsx(C,{to:`../../month_end_close_checks/review/missing_receipts/${o.month}-${o.year}`}):i.jsx(F,{})}),i.jsx(v,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:i.jsx(Fe,{referrerType:a})})]})}export{mt as default};
|
|
1
|
+
import{j as i}from"./liveblocks-DOxb6osM.js";import{j as q,u as w,h as U,l as Q,g as L,N as C,k as Z,n as Ae,o as v}from"./core-C4fxU83C.js";import{eN as R,iQ as T,NP as H,Gr as ue,bq as ie,NQ as he,jr as K,JT as W,NR as se,NS as Se,bC as x,Go as me,NT as ke,NU as re,NV as Ie,NW as pe,NX as be,NY as ve,NZ as de,HE as Ye,bn as xe}from"./zeni-epic-state-Ba45HhdX.js";import{D as X,e as B,c5 as ee,s as _,p as te,a as fe,d as J,K as Ee,z as Pe}from"./index-Ckao8u8S.js";import"./mui-CJ5-H5s3.js";import{a as A}from"./sentry-CRdlKM_1.js";import{w as ae}from"./withTransactionSidePanel-DQtRQJvv.js";import{p as ne,b as ce}from"./routePaths-Dxwhh-fn.js";import{u as Le}from"./utils-CLosk-TB.js";import{d as P}from"./decodeURIComponentSafe-B_w_tz2w.js";import{Z as je}from"./ZeniAccountStatementScreen-6YxM0wYY.js";import"./recharts-95y0DFZP.js";import"./analytics-CgBmxqZY.js";import"./plaid-B0tTAlSw.js";import"./dnd-DoZPzASs.js";import"./stripe-DMRn4zHo.js";import"./lottie-BW8IlxIq.js";import"./lexical-jcYOTomA.js";import"./pdf-CSGP82Vc.js";import"./useAskAiCfoHostNavButtonProps-BGS1w2nN.js";import"./useFetchSuggestedQuestionsWhenReady-DxGAt9QA.js";import"./TransactionDetailScreen-DOVDrZxO.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="e067adcb-e3ac-4838-8f93-c5d3f15719ab",a._sentryDebugIdIdentifier="sentry-dbid-e067adcb-e3ac-4838-8f93-c5d3f15719ab")}catch{}})();const G=a=>Le(a),ze=Z(function(a,e){const t=he(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,G(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:W(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:K(a)}},function(a,e){return{onBackClick:()=>{const t=te(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=X.getLocalizedStrings(),r=G(e.selectedAccount.tranListType),s=Be(t,n,c,r,e.bookCloseDate);B.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(se({uiState:{dateRange:s},type:G(e.selectedAccount.tranListType)})),a(ue(r,T(s),!1,r==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(T(s))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=ce(t,e.tenantEmailDomain),c=_(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(se({uiState:{scrollYOffset:t},type:G(e.selectedAccount.tranListType)}))}}})(ee),F=ae(function({...a}){const e=q(),t=w(),n=U(),c=t.pathname.substring(t.pathname.lastIndexOf("/")+1),{tenantEmailDomain:o}=Q(),r=X.getLocalizedStrings(),{accountType:s,title:u,subTitle:h}=Me(c),D="month",g=L(p=>R(p)),Y=g.company?.companyInfo.firstMonthOfFY??1,{dataAvailable:y,initialTimeframeTick:S}=Ce(c,Y,g.bookCloseDate),[k,j]=A.useState(!1),[z,E]=A.useState(void 0),m=A.useMemo(()=>{const p=T(S);return{tranListType:c,accountType:H(s),title:u,subTitle:h,timeframe:D,period:p}},[c,D,s,y]);A.useEffect(()=>{if(!k&&m!=null){j(!0),B.trackTransactionList(void 0,void 0,void 0,m.title);const p=G(m.tranListType);n(ue(p,m.period,!0,p==="missingReceipts"?r.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}},[k,m,n]);let I=m;return m!=null&&z!=null&&(I={...m,period:z}),I==null?i.jsx(C,{to:"../"}):i.jsx(ze,{firstMonthOfFY:Y,tenantEmailDomain:o,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:y,navigate:e,selectedAccount:I,referrerType:c,bookCloseDate:g.bookCloseDate,onSelectedTimePeriodChange:p=>E(p),...a})}),Me=a=>{let e="",t="",n="";const c=X.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=c.uncategorizedTransactionList.income.title,n=c.uncategorizedTransactionList.income.subTitle;break;case"uncategorized-expense":e="expenses",t=c.uncategorizedTransactionList.expense.title,n=c.uncategorizedTransactionList.expense.subTitle;break;case"miscategorized-expense":e="expenses",t=c.miscategorizedTransactionList.expense.title,n=c.miscategorizedTransactionList.expense.subTitle;break;case"miscategorized-income":e="income",t=c.miscategorizedTransactionList.income.title,n=c.miscategorizedTransactionList.income.subTitle;break;case"missing-receipts":t=c.uncategorizedTransactionList.missingReceipt.title,n=c.uncategorizedTransactionList.missingReceipt.subTitle}return{accountType:e,title:t,subTitle:n}},Ce=(a,e,t)=>{const n=ie();let c=ie().startOf("month").subtract(11,"month");return t!=null&&a!=="missing-receipts"?t.add(1,"day").isBefore(c)?{dataAvailable:{startDate:t.add(1,"day"),endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}:(c=t.add(1,"day"),{dataAvailable:{startDate:c,endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}):{dataAvailable:ne(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Be=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},Oe=Z(function(a,e){const t=ke(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:W(e.selectedAccount.period),dataAvailableForPeriod:ne(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:K(a)}},function(a,e){return{onBackClick:()=>{const t=te(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Te();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),B.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(re({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(me(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,T(o))),e.onSelectedTimePeriodChange(T(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=ce(t,e.tenantEmailDomain),c=_(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(re({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}})(ee),Fe=ae(function({referrerType:a,...e}){const t=q(),n=w(),c=U(),{tenantEmailDomain:o,accountTypeEncoded:r,accountIdEncoded:s,classIdEncoded:u,timeframe:h,startDate:D,endDate:g,titleEncoded:Y}=Q(),y=P(r??""),S=P(s??""),k=P(u??""),j=P(Y??""),z=L(f=>Se(f.transactionListState,S,y,k)),[E,m]=A.useState(!1),[I,p]=A.useState(void 0),N=L(f=>R(f)),$=N.company?.companyInfo.firstMonthOfFY??1;let d;const l=Ge(y,S,k,h,D,g,j);if(l){const f={startDate:x(D,"YYYY-MM-DD"),endDate:x(g,"YYYY-MM-DD")},V=Ne(z?.dateRange,f);d={accountId:S,accountType:H(y),classId:k,title:j,timeframe:h,period:V}}A.useEffect(()=>{E||d==null||(m(!0),B.trackTransactionList(d.accountId,void 0,a,d.title),c(me(d.accountId,d.accountType,d.classId,d.period)))},[E,d,c]);let M=d;d!=null&&I!=null&&(M={...d,period:I});const O=[r,s,u,h,D,g,Y].filter(f=>f!=null);return l&&M!=null?i.jsx(Oe,{firstMonthOfFY:$,tenantEmailDomain:o,location:n,navigate:t,selectedAccount:M,referrerType:a,onSelectedTimePeriodChange:f=>p(f),...e}):i.jsx(C,{to:Te(O.length)})}),Te=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ge=(a,e,t,n,c,o,r)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&x(c,"YYYY-MM-DD").isValid()&&x(o,"YYYY-MM-DD").isValid()&&r!=null,Ne=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?T(a):T(e),_e=Z(function(a,e){const t=be(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&ve(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:W(e.selectedAccount.period),dataAvailableForPeriod:ne(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:K(a)}},function(a,e){return{onBackClick:()=>{const t=te(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??De();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),B.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(de({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(pe(e.selectedAccount.accountId,e.selectedAccount.accountType,T(o))),e.onSelectedTimePeriodChange(T(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=ce(t,e.tenantEmailDomain),c=_(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(de({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=$e(e.tenantEmailDomain),n=_(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}})(ee),le=ae(function({referrerType:a,...e}){const t=q(),n=w(),c=U(),{tenantEmailDomain:o,accountTypeEncoded:r,accountIdEncoded:s,timeframe:u,startDate:h,endDate:D,titleEncoded:g,excludeSubAccounts:Y}=Q(),y=P(r??""),S=P(s??""),k=P(g??""),j=!(Y!=null&&Y==="exclude_subaccounts"),z=L(b=>Ie(b.transactionListState,S,y)),[E,m]=A.useState(!1),[I,p]=A.useState(void 0),N=L(b=>R(b)),$=N.company?.featuresActivationInfo.connectedAccountProvider==="unit",d=N.company?.companyInfo.firstMonthOfFY??1;let l;const M=we(y,S,u,h,D,k);if(M){const b={startDate:x(h,"YYYY-MM-DD"),endDate:x(D,"YYYY-MM-DD")},ye=Re(z?.dateRange,b);l={accountId:S,accountType:H(y),title:k,timeframe:u,period:ye}}let O=l;l!=null&&I!=null&&(O={...l,period:I});const{useFeatureGate:f}=fe(),{isFeatureEnabled:V}=f(J.isTransactionCommentingEnabled),{areTenantIdsInSync:oe}=Ee();A.useEffect(()=>{!E&&l!=null&&oe&&(m(!0),B.trackTransactionList(l.accountId,void 0,a,l.title),c(pe(l.accountId,l.accountType,l.period,void 0,!1,j)))},[E,l,c,oe]);const ge=[r,s,u,h,D,g].filter(b=>b!=null);return M&&O!=null?i.jsx(_e,{firstMonthOfFY:d,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:$,isTransactionCommentingEnabled:V,selectedAccount:O,referrerType:a,onSelectedTimePeriodChange:b=>p(b),...e}):i.jsx(C,{to:De(ge.length)})}),De=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},we=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&x(n,"YYYY-MM-DD").isValid()&&x(c,"YYYY-MM-DD").isValid()&&o!=null,Re=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?T(a):T(e),$e=a=>`/${a}/transactions/${Ye}/statements`;function mt(){const a=w().state?.referrer,e=Pe.getSignedInUser(),t=xe(e),{useFeatureGate:n}=fe(),{isFeatureEnabled:c}=n(J.isExpenseAutomationEnabled),o=L(u=>u.expenseAutomationViewState.selectedPeriodByTenantId)[L(u=>R(u)).tenantId],{isFeatureEnabled:r}=n(J.isExpenseAutomationEnabledV2),s=r||c&&t;return i.jsxs(Ae,{children:[i.jsx(v,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:i.jsx(le,{referrerType:a})}),i.jsx(v,{path:"/zeni-clearing-account/statements",element:i.jsx(je,{})}),i.jsx(v,{path:"/*",element:i.jsx(le,{referrerType:a})}),i.jsx(v,{path:"/uncategorized-income/*",element:i.jsx(F,{})}),i.jsx(v,{path:"/uncategorized-expense/*",element:s?i.jsx(C,{to:`../../month_end_close_checks/review/transaction_categorization/${o.month}-${o.year}`}):i.jsx(F,{})}),i.jsx(v,{path:"/miscategorized-income/*",element:i.jsx(F,{})}),i.jsx(v,{path:"/miscategorized-expense/*",element:s?i.jsx(C,{to:`../../month_end_close_checks/review/transaction_categorization/${o.month}-${o.year}`}):i.jsx(F,{})}),i.jsx(v,{path:"/missing-receipts/*",element:s?i.jsx(C,{to:`../../month_end_close_checks/review/missing_receipts/${o.month}-${o.year}`}):i.jsx(F,{})}),i.jsx(v,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:i.jsx(Fe,{referrerType:a})})]})}export{mt as default};
|