@zeniai/web-app-ui 5.4.7-dev → 5.4.8-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AccountMappingScreen-D6HgzjWo.js → AccountMappingScreen-DxODZ1Nk.js} +2 -2
- package/dist/assets/ActualMatchingMatchDetailScreen-CpFxldZX.js +1 -0
- package/dist/assets/AddressRoutes-K7qFYU4Q.js +1 -0
- package/dist/assets/AddressScreen-B7HfNJJM.js +9 -0
- package/dist/assets/{AiCfoScreen-C95CmuT8.js → AiCfoScreen-D0ryurTs.js} +1 -1
- package/dist/assets/{AppDrawer-wuSLq_GC.js → AppDrawer-Bz9R1SRM.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-Cz4FnR8k.js → BillPayApprovalRoutes-CUhlkbFZ.js} +1 -1
- package/dist/assets/{BillPayRoutes-lBcH3kG4.js → BillPayRoutes-Cq7a-pm7.js} +18 -18
- package/dist/assets/{BusinessVerificationPageScreen-CNBsygLT.js → BusinessVerificationPageScreen-YH2iMYXG.js} +2 -2
- package/dist/assets/CardsAiCfoScreen-i0herVW8.js +14 -0
- package/dist/assets/{ChargeCardRoutes-BebvufWC.js → ChargeCardRoutes-DKqAyC6V.js} +7 -7
- package/dist/assets/CompanyPassportScreen-B28ZIQmd.js +1 -0
- package/dist/assets/ConnectionAuthScreen-cnuYO2ir.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-BugwGIlC.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-07XvuYSy.js → CustomerOnboardingRoutes-CGeTdTAp.js} +3 -3
- package/dist/assets/{DashboardRoutes-DtOF4t57.js → DashboardRoutes-Cwe3Vuyf.js} +4 -4
- package/dist/assets/{DefaultTenantHome-CweSG_GQ.js → DefaultTenantHome-Y19U_bWi.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-jf25UFiV.js → DomesticWireDetailScreen-C3Fvc0vh.js} +4 -4
- package/dist/assets/{DrawerScreen-5p-VaDVX.js → DrawerScreen-BiLnsYxr.js} +1 -1
- package/dist/assets/{EntityDetailRoutes-CacM-JPm.js → EntityDetailRoutes-DiWWQPIS.js} +1 -1
- package/dist/assets/ExpenseAutomationRoutes-CwVf58CT.js +38 -0
- package/dist/assets/FeaturePreviewScreen-CVxHNITI.js +1 -0
- package/dist/assets/{HubSpotOAuthCallbackScreen-BLlIOZQ7.js → HubSpotOAuthCallbackScreen-D5mS9Mm3.js} +1 -1
- package/dist/assets/{InboxNotificationsProvider-yzTJ7wEQ.js → InboxNotificationsProvider-Lon_JjZI.js} +1 -1
- package/dist/assets/{InvoicingRoutes-D2PWzI_4.js → InvoicingRoutes-CEhIyfKx.js} +2 -2
- package/dist/assets/{MagicLinkRoutes-CaOpn3qT.js → MagicLinkRoutes-Bbw6eA7p.js} +19 -19
- package/dist/assets/MagicLinkSignInScreen-CMSV3Ecy.js +12 -0
- package/dist/assets/{MobileAppDrawer-BixbLTmv.js → MobileAppDrawer-D95K9MWM.js} +1 -1
- package/dist/assets/NotFoundScreen-ngkmWfLO.js +1 -0
- package/dist/assets/{NotificationRoutes-BdD13Onr.js → NotificationRoutes-OU4hmCU4.js} +1 -1
- package/dist/assets/{OAuthConsentScreen-NFsa-sgn.js → OAuthConsentScreen-BfPvpIZK.js} +1 -1
- package/dist/assets/{PandLWithForecastRoutes-Bm0J5IMo.js → PandLWithForecastRoutes-D5OxnQT-.js} +1 -1
- package/dist/assets/{PaymentLinkScreen-CVV3tuZg.js → PaymentLinkScreen-Cu5uQlbD.js} +5 -5
- package/dist/assets/PeopleRoutes-CRBdsznQ.js +22 -0
- package/dist/assets/PerformanceRoutes-D57LkbmT.js +1 -0
- package/dist/assets/{Preview-C1srXT8b.js → Preview-B_x0UYXC.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-CMu1wr6r.js → QBOConnectionScreen-B_jTzA2E.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRoutes-DPr_Xw2e.js → ReimbursementApprovalRoutes-D9UKdBqr.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-B-Gs9TwE.js → ReimbursementApprovalRuleDetailScreen-CdBqEWoC.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-C5mKxHY0.js → ReimbursementRoutes-DqKBNzYH.js} +4 -4
- package/dist/assets/{ReportsRoutes-rLspO2bh.js → ReportsRoutes-97Pz3_w0.js} +1 -1
- package/dist/assets/RewardsRoutes-CP48quzG.js +1 -0
- package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-CUlxxOT4.js → ScheduleDetailsPrepaidExpensesScreen-CXq4al_v.js} +5 -5
- package/dist/assets/ScreenRoutes-EZYd0oGd.js +2 -0
- package/dist/assets/{SettingsRoutes-BafV6BMK.js → SettingsRoutes-CXOUMEST.js} +4 -4
- package/dist/assets/{SetupPagesScreen-CYo2TZ1p.js → SetupPagesScreen-DT18jEZS.js} +5 -5
- package/dist/assets/{SignInScreen-CT-WoxFu.js → SignInScreen-D_kJ7A6-.js} +1 -1
- package/dist/assets/SignOutScreen-Hgz5ILuE.js +9 -0
- package/dist/assets/TaskListScreen-PbWxRl0T.js +9 -0
- package/dist/assets/{TaskRoutes-BeXt3gMh.js → TaskRoutes-8igPnZpC.js} +2 -2
- package/dist/assets/TransactionDetailRoutes-BkrhGwVi.js +1 -0
- package/dist/assets/{TransactionDetailScreen-D3daFCwt.js → TransactionDetailScreen-CUF4XJ-a.js} +2 -2
- package/dist/assets/{TransactionListRoutes-Cp-cSB8W.js → TransactionListRoutes-DFYIfVzR.js} +1 -1
- package/dist/assets/{TreasuryRoutes-DnPKaz7R.js → TreasuryRoutes-DweO_eX_.js} +5 -5
- package/dist/assets/{VendorsRoutes-CY-uooJs.js → VendorsRoutes-CtkEV-aM.js} +7 -7
- package/dist/assets/{WiseConfirmationScreen-CdXrY5Nn.js → WiseConfirmationScreen-Cvz0_zLL.js} +1 -1
- package/dist/assets/{ZeniAccountRoutes-CaWZaYnh.js → ZeniAccountRoutes-ulGvqG-O.js} +11 -11
- package/dist/assets/ZeniAccountStatementScreen-Dff7TUu2.js +9 -0
- package/dist/assets/{accountMappingHelper-HDztJioo.js → accountMappingHelper-CCESaK7R.js} +1 -1
- package/dist/assets/{analytics-D7SbUCRL.js → analytics-BSYXJeF4.js} +1 -1
- package/dist/assets/{analyticsHelper-BNh1_jfv.js → analyticsHelper-w2YkQjq1.js} +1 -1
- package/dist/assets/{core-Bc2mnalE.js → core-k1hJbZ6L.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-addd21BI.js → decodeURIComponentSafe-CKsYKxPJ.js} +1 -1
- package/dist/assets/{dnd-B0zyAl0s.js → dnd-CiTl8J_b.js} +1 -1
- package/dist/assets/{empty-CHx0Pvbk.js → empty-Bzngm89v.js} +1 -1
- package/dist/assets/{empty-Nco5SaTV.js → empty-DXUNZiQh.js} +1 -1
- package/dist/assets/{emptyVideoElement-B-mo7W39.js → emptyVideoElement-qNZVYRIB.js} +1 -1
- package/dist/assets/{epic-BS7m068w.js → epic-BVcu5QEC.js} +1 -1
- package/dist/assets/{expenseAutomationHelper-6llqwO2d.js → expenseAutomationHelper-BfCR3sLm.js} +1 -1
- package/dist/assets/{getLocaleForTenant-D-baUPRb.js → getLocaleForTenant-Bok1bQNl.js} +1 -1
- package/dist/assets/{index-Dv6pUA2Y.js → index-B1EgaaVs.js} +1 -1
- package/dist/assets/{index-D3o0K0j9.js → index-BKGXj7ws.js} +1 -1
- package/dist/assets/{index-DLOd76r9.js → index-BYIWMErm.js} +1 -1
- package/dist/assets/{index-L7bL_O40.js → index-CdAfnjbO.js} +1 -1
- package/dist/assets/{index-DcKiQFzt.js → index-Ce30h5vk.js} +1 -1
- package/dist/assets/{index-CtE8HnsY.js → index-Cjqi6Pkt.js} +13151 -13127
- package/dist/assets/{index-CyFWesiE.js → index-DGy3NvOY.js} +1 -1
- package/dist/assets/{index-DLaXtkBa.js → index-iZXXuKOD.js} +2 -2
- package/dist/assets/{lexical-CCch0Fzo.js → lexical-YTMAFU1j.js} +1 -1
- package/dist/assets/{liveblocks-CevUFagi.js → liveblocks-oxGmLiGE.js} +1 -1
- package/dist/assets/{lottie-Dhd_0CJG.js → lottie-DXQhXtqa.js} +1 -1
- package/dist/assets/{mui-CUsYvTMG.js → mui-D8QuRJEy.js} +1 -1
- package/dist/assets/{pathToGoBack-h9zXpfmB.js → pathToGoBack-BvtdrmIA.js} +1 -1
- package/dist/assets/{pdf-CuegwamZ.js → pdf-QcH92u4w.js} +4 -4
- package/dist/assets/{pdf-lib-C0hF4MJX.js → pdf-lib-CmPW-Sf3.js} +1 -1
- package/dist/assets/{plaid-Dxz6lSJz.js → plaid-CbZCK8Pe.js} +1 -1
- package/dist/assets/{pusher-Dov6Wpsh.js → pusher-DrskEKGJ.js} +1 -1
- package/dist/assets/{react-2Pr1ccsY.js → react-BFUAIjFB.js} +1 -1
- package/dist/assets/{react-M3pe5IMI.js → react-BdEbM4Cv.js} +1 -1
- package/dist/assets/{react-1IBu4NKN.js → react-CTz3hOfW.js} +1 -1
- package/dist/assets/{react-CuKi_1_s.js → react-DI5Tj1pD.js} +1 -1
- package/dist/assets/{react-kEWOHePJ.js → react-DLwkwTYN.js} +1 -1
- package/dist/assets/{react-VbHSu8I-.js → react-bRbgXAqh.js} +1 -1
- package/dist/assets/{recharts-BjkXpBn6.js → recharts-DZG9umMy.js} +1 -1
- package/dist/assets/{reportTimeframe-CmNj9zQY.js → reportTimeframe-BoyB48qP.js} +1 -1
- package/dist/assets/{routePaths-Dv28cYw1.js → routePaths-BQiUfv8Y.js} +1 -1
- package/dist/assets/{sentry-BrSPpZKf.js → sentry-CYolppN9.js} +1 -1
- package/dist/assets/{stripSplatSuffix-wwIiiS3L.js → stripSplatSuffix-yEJV_xmD.js} +1 -1
- package/dist/assets/{url-2Ybk2sxg.js → url-BJMHxMoG.js} +1 -1
- package/dist/assets/{url-IFQJDLIg.js → url-Dvn7w47g.js} +1 -1
- package/dist/assets/useActualMatchingMatchDetail-BRI2b5oS.js +1 -0
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-C7G9HKEb.js → useAiCfoDashboardSuggestedQuestionsChips-BBN3Q32c.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-BETiKk63.js +1 -0
- package/dist/assets/{useChargeCardPusherEvents-D_qYIckD.js → useChargeCardPusherEvents-DEUPC1vA.js} +1 -1
- package/dist/assets/{useDeviceId-7gkngZ73.js → useDeviceId-BqvO5dq-.js} +1 -1
- package/dist/assets/{useEmailConnectResultRefresh-aPg3qWb4.js → useEmailConnectResultRefresh-8S-s2Qbg.js} +1 -1
- package/dist/assets/{useEnsureVendorListLoaded-nIoTpKXy.js → useEnsureVendorListLoaded-CbkO2307.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-gQdpW0fv.js → useInitialThreadRequest-DKk3Gbri.js} +1 -1
- package/dist/assets/{useTaskManagerAccess-94Xv3cKO.js → useTaskManagerAccess-CbR2C9f7.js} +1 -1
- package/dist/assets/{useTaskManagerPusherEvents-CdVgZy4d.js → useTaskManagerPusherEvents-CULNono8.js} +1 -1
- package/dist/assets/{utils-BKSIhN7N.js → utils-CZxvf1-B.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-DDzMeSLR.js → withTransactionSidePanel-zjTjrZrt.js} +5 -5
- package/dist/assets/{zeni-epic-state-VmxO3Mnv.js → zeni-epic-state-C2CKsxzr.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +3 -3
- package/dist/assets/ActualMatchingMatchDetailScreen-DrT4wLj3.js +0 -1
- package/dist/assets/AddressRoutes-D7_KsY7f.js +0 -1
- package/dist/assets/AddressScreen-yLBHCU8H.js +0 -9
- package/dist/assets/CardsAiCfoScreen-Dnj7L-Aq.js +0 -14
- package/dist/assets/CompanyPassportScreen-CWQymYC0.js +0 -1
- package/dist/assets/ConnectionAuthScreen-CTDny4hz.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-CIry93lh.js +0 -1
- package/dist/assets/ExpenseAutomationRoutes-Byqo8eZZ.js +0 -38
- package/dist/assets/FeaturePreviewScreen-CCuIxuhc.js +0 -1
- package/dist/assets/MagicLinkSignInScreen-DiZU5_QE.js +0 -12
- package/dist/assets/NotFoundScreen-BkN7W6JR.js +0 -1
- package/dist/assets/PeopleRoutes-I7YtZIOQ.js +0 -22
- package/dist/assets/PerformanceRoutes-Bh2GJMgS.js +0 -1
- package/dist/assets/RewardsRoutes-BAg5LFP3.js +0 -1
- package/dist/assets/ScreenRoutes-B27hAn5a.js +0 -2
- package/dist/assets/SignOutScreen-CUkfHzEK.js +0 -9
- package/dist/assets/TaskListScreen-CNDqJnu1.js +0 -9
- package/dist/assets/TransactionDetailRoutes-CSoIoyzR.js +0 -1
- package/dist/assets/ZeniAccountStatementScreen-C3LaZbC9.js +0 -9
- package/dist/assets/useActualMatchingMatchDetail-CZpCt66v.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-JRFYPtx4.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-
|
|
1
|
+
import{j as a}from"./liveblocks-oxGmLiGE.js";import{a as d}from"./sentry-CYolppN9.js";import{h as F,g as H,u as U,i as L,j as C,l as K,n as J,o as k}from"./core-k1hJbZ6L.js";import{fI as v,_t as Pe,Oe as je,_0 as ve,_9 as we,ca as Y,cV as Ae,cW as De,bq as Ue,dg as Re,Gw as Te,_u as Me,PH as Be,N5 as Ne,MY as de,MV as Oe,GA as ue,M$ as pe,N2 as ge,N8 as X,CE as ee,Gz as Ve,ly as Z,lB as me,_v as Fe,mL as Le,GR as Ge,Wu as $e,Wv as Ze,lw as He,_w as Ke,lz as We,uP as ze,Wp as qe,Wq as Je,uT as Qe,hZ as Ye,Vm as q,hR as ae,hO as Xe,hW as en,Vn as nn,GO as tn,_x as an,_y as on,Nm as sn,m3 as rn,e0 as fe,e1 as he,_z as ln,gF as cn,VD as dn,GN as oe,gK as se,gJ as un,GM as pn,gI as gn,gH as mn,_A as fn,UO as Ce,_B as hn,_C as Cn,_D as yn,_E as Sn,_F as bn,_G as In,GU as xn,_H as En,GL as ie,GF as $,_I as kn,_J as _n,_K as re,_L as Pn,dV as jn,_M as vn,_N as wn,_O as An,U_ as Dn,c2 as Un,c9 as Rn,c8 as Tn,c3 as Mn,_P as Bn,c6 as Nn,c5 as On,c7 as Vn,c4 as Fn}from"./zeni-epic-state-C2CKsxzr.js";import{bU as Ln,z as j,V as G,a5 as ne,c4 as Gn,k as W,p as te,d as O,h as ye,K as Se,c5 as $n,j as Zn,W as be,c6 as Hn,ag as Kn,c7 as Wn,c8 as zn,ao as qn,c9 as Jn,l as Qn,e as Ie,ca as Yn}from"./index-Cjqi6Pkt.js";import{n as B}from"./mui-D8QuRJEy.js";import{u as xe}from"./useTaskManagerAccess-CbR2C9f7.js";import{U as Xn}from"./AccountMappingScreen-DxODZ1Nk.js";import{t as et,A as nt}from"./AddressScreen-B7HfNJJM.js";import V from"./NotFoundScreen-ngkmWfLO.js";import{g as tt}from"./analyticsHelper-w2YkQjq1.js";import{u as at,B as ot}from"./BusinessVerificationPageScreen-YH2iMYXG.js";import{C as st}from"./CompanyPassportScreen-B28ZIQmd.js";import{M as T}from"./MobileAppDrawer-D95K9MWM.js";import{u as it,a as rt}from"./useEmailConnectResultRefresh-8S-s2Qbg.js";import{q as le}from"./QBOConnectionScreen-B_jTzA2E.js";import{B as lt}from"./BillPayApprovalRoutes-CUhlkbFZ.js";import{R as ct}from"./ReimbursementApprovalRoutes-D9UKdBqr.js";import"./recharts-DZG9umMy.js";import"./analytics-BSYXJeF4.js";import"./plaid-CbZCK8Pe.js";import"./dnd-CiTl8J_b.js";import"./stripe-cKAAJElX.js";import"./lottie-DXQhXtqa.js";import"./lexical-YTMAFU1j.js";import"./pdf-QcH92u4w.js";import"./utils-CZxvf1-B.js";import"./accountMappingHelper-CCESaK7R.js";import"./routePaths-BQiUfv8Y.js";import"./InboxNotificationsProvider-Lon_JjZI.js";import"./empty-DXUNZiQh.js";import"./pdf-lib-CmPW-Sf3.js";import"./index-DGy3NvOY.js";import"./url-BJMHxMoG.js";import"./index-B1EgaaVs.js";import"./decodeURIComponentSafe-CKsYKxPJ.js";import"./useEnsureVendorListLoaded-CbkO2307.js";import"./ReimbursementApprovalRuleDetailScreen-CdBqEWoC.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new e.Error().stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="d3550452-3a46-4437-8c5d-994dae6b85c4",e._sentryDebugIdIdentifier="sentry-dbid-d3550452-3a46-4437-8c5d-994dae6b85c4")}catch{}})();const dt=B.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,7 +6,7 @@ import{j as a}from"./liveblocks-CevUFagi.js";import{a as d}from"./sentry-BrSPpZK
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,ut=
|
|
9
|
+
`,ut=K((function(e,l){const o=v(e),i=ve(e),r=we(e),n=l.roleMap.bill_pay_admin;return{isDisabled:(Y(o?.userRole??[])||n)&&"readonly",billpayApprovalView:i,remiApproverView:r,analytics:W}}),(function(e,l){const{navigate:o,currentTenant:i}=l;return{onSetupApprovalRulesBillPaySectionClick:()=>{o("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{o("reimbursements/approval-rules")},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))(Gn),pt=()=>{const e=F(),l=H(),o=U(),{tenantEmailDomain:i}=L(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),c=C((g=>v(g)));at();const u=C((g=>g.remiSetupApproverViewState.fetchState)),h=C((g=>Pe(g))),{isApprovalRulesV3Enabled:S,isLoading:m}=Ln(c?.tenantId),p=c.companyId??j.getSignedInUserTenant(i)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const b=G();d.useEffect((()=>{t||u!=="Not-Started"||m||c?.tenantId==null||(s(!0),o(je(!0,!1,!1,S)))}),[t,u,m,S,c?.tenantId,o]);const E=g=>{n(g)};return b?.loggedInUserRoleMap!=null?a.jsxs(dt,{children:[a.jsx(T,{isAppContentDrawerOpen:r,handleDrawerToggle:E}),a.jsx(ut,{navigate:e,location:l,companyId:p,currentTenant:c,roleMap:b.loggedInUserRoleMap,onClickMenuIcon:()=>{E(!0)}})]}):a.jsx(ne,{fetchState:h.fetchState})},gt=B.div`
|
|
10
10
|
display: flex;
|
|
11
11
|
height: 100%;
|
|
12
12
|
width: 100%;
|
|
@@ -14,7 +14,7 @@ import{j as a}from"./liveblocks-CevUFagi.js";import{a as d}from"./sentry-BrSPpZK
|
|
|
14
14
|
flex-direction: column;
|
|
15
15
|
align-items: center;
|
|
16
16
|
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
-
`,mt=
|
|
17
|
+
`,mt=K((function(e,l){const{companyId:o,isZeniAccountEnabled:i,isChargeCardEnabled:r,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:s}=l,c=v(e);return{bankSetupView:Me(e,o,n,t,i,r,s),connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:W}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t,s)=>{e(ee(t,n,s))},onEstablishConnectionClick:(n,t,s)=>{e(X(n,r,t,s))},onUpdatePaymentAccountStatus:(n,t,s,c,u)=>{e(ge(n,t,u,c,s))},onUpdatePaymentAccountLoginStatus:(n,t,s,c)=>{e(pe(!1,n,c,s,t))},onEstablishConnectionSuccess:(n,t)=>{e(ue(t,n))},onUpdateAccountClick:(n,t,s,c,u)=>{e(u==="paymentAccount"?de(n,t,s,c):Oe(c,n,t))},onUpdatePrimaryFundingAccount:(n,t,s)=>{e(Ne(r,t,n,s))},onRemoveConnection:n=>{e(Be(n))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))($n),ft=()=>{const e=F(),l=H(),o=U(),{tenantEmailDomain:i}=L(),r=G(),{useFeatureGate:n}=te(),{isFeatureEnabled:t}=n(O.isChargeCardFeatureEnabled),{isFeatureEnabled:s}=n(O.isDebitCardFeatureEnabled),[c,u]=d.useState(!1),[h,S]=d.useState(!1),m=C((w=>v(w))),p=C((w=>w.settingsViewState.bankConnection.fetchState)),b=Ae(m,r?.loggedInUserRoleMap),E=De(m,r?.loggedInUserRoleMap),g=m?.userRole!=null&&Ue(m.userRole),P=!!m.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!g,_=m.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!g,R=ye(m,t,s),A=Re(m,r?.loggedInUserRoleMap)&&R,{isCardsHidden:I}=Se(m?.tenantId),x=m.companyId??j.getSignedInUserTenant(i)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");d.useEffect((()=>{h||p==="Completed"||(S(!0),o(Te(!1)))}),[h,o,p]);const M=w=>{u(w)};return b||P||E||A?a.jsxs(gt,{children:[a.jsx(T,{isAppContentDrawerOpen:c,handleDrawerToggle:M}),a.jsx(mt,{navigate:e,location:l,companyId:x,currentTenant:m,roleMap:r.loggedInUserRoleMap,isBillPayEnabled:b,isRemiEnabled:E,isZeniAccountEnabled:P,isChargeCardEnabled:A,isChargeCardsHidden:I,isTreasuryEnabled:_,onClickMenuIcon:()=>{M(!0)}})]}):a.jsx(V,{})},ht=B.div`
|
|
18
18
|
display: flex;
|
|
19
19
|
height: 100%;
|
|
20
20
|
width: 100%;
|
|
@@ -22,7 +22,7 @@ import{j as a}from"./liveblocks-CevUFagi.js";import{a as d}from"./sentry-BrSPpZK
|
|
|
22
22
|
flex-direction: column;
|
|
23
23
|
align-items: center;
|
|
24
24
|
background-color: ${e=>e.theme.colors.grey4};
|
|
25
|
-
`,Ct=
|
|
25
|
+
`,Ct=K((function(e,l){const{companyId:o}=l,i=v(e),r=l.roleMap.bill_pay_admin,n=Fe(e,o),{uiState:t}=n,s=(Y(i?.userRole??[])||r)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:t,stripeKey:be.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:s,analytics:W}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t)=>{e(ee("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(X(n,r,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ue("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,s)=>{e(ge(n,t,"billing","billing_setup",s))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(pe(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(de(n,t,"billing","billing_setup"))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")},handleCreateCardSetupIntent:n=>{e(me(n))},handleConfirmCardSetupIntent:n=>{e(We(n))},updateCardPaymentModalState:n=>{e(Ke({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,s)=>{e(He(n,t,s))},handleFetchPaymentSources:()=>{e(Z())},resetCardPaymentViewState:()=>{e(Ze())},handleResetCardPaymentErrorStatuses:()=>{e($e())},onBillingAddressSave:n=>{e(Ge(n))},onAddressEditHandler:n=>{if(n!=null){const t=et(n);e(Le({addressType:"subscription_billing_address",addressToCreate:t}))}}}}))(Hn),yt=()=>{const e=F(),l=H(),o=U(),{tenantEmailDomain:i}=L(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),[c,u]=d.useState(!1),h=C((_=>v(_))),S=C((_=>_.cardPaymentViewState)),m=C((_=>_.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState)),p=Zn(S.addCardPaymentSourceStatus.fetchState),b=S.addCardPaymentSourceStatus.fetchState,E=h.companyId??j.getSignedInUserTenant(i)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const g=G();d.useEffect((()=>{E!=null&&o(Ve(E,!1))}),[E,o]),d.useEffect((()=>{t||(s(!0),o(Z()))}),[t,o]),d.useEffect((()=>{c||(me(["card"]),u(!0))}),[c]),d.useEffect((()=>{p==="In-Progress"&&b==="Completed"&&o(Z())}),[p,b]);const P=_=>{n(_)};return g?.loggedInUserRoleMap!=null?a.jsxs(ht,{children:[a.jsx(T,{isAppContentDrawerOpen:r,handleDrawerToggle:P}),a.jsx(Ct,{navigate:e,location:l,companyId:E,currentTenant:h,roleMap:g.loggedInUserRoleMap,onClickMenuIcon:()=>{P(!0)},googleAPIKey:be.googleMapsAPIKey})]}):a.jsx(ne,{fetchState:m})},Q="external_integrations",St=K((function(e){const l=Je(e,Q);return{notifyMeRegisteredSlugs:new Set(l.map((o=>o.additionalInfo)).filter((o=>o!=null)))}}),(function(e,l){const{navigate:o,integrationsView:i,signedInUserEmail:r,tenantEmailDomain:n,tenantId:t}=l;return{onBackClick:()=>{o("../")},onNavigateToDashboard:()=>{o("../dashboard")},onReconnectQBO:()=>{le.init("/connection/auth",n),le.handleClick()},onRefreshClick:()=>{i.integrations.refreshQBO.fetchState!=="In-Progress"&&e(tn())},onSaveChargeBeeCredentials:(s,c)=>{const u=i.externalConnections?.revenue?.find((h=>h.connectionName==="chargebee"))?.connectionId;u!=null&&e(en(t,u,q("revenue"),nn("chargebee"),{api_key:s,site:c}))},onConnectHubSpot:(s,c)=>{const u=i.externalConnections?.revenue?.find((h=>h.connectionName==="hubspot"))?.connectionId;if(u!=null){const h=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:s,client_secret:c,connection_id:u,redirect_uri:h,tenant_id:t}));const S="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(s)}&scope=${encodeURIComponent(S)}&redirect_uri=${encodeURIComponent(h)}`}},onDisconnect:(s,c)=>{e(Xe(t,s,q(c)))},onConnectGmail:()=>{e(ae(t,"gmail",window.location.href))},onConnectOutlook:()=>{e(ae(t,"outlook",window.location.href))},onSaveConnectorCredentials:s=>{e(Ye(t,q("payments"),s))},onNotifyMe:s=>{W.trackIntegrationsNotifyMeClicked("Settings",s),e(Qe(Q,s,r))}}}))(Wn),bt=()=>{const e=Kn(),l=F(),o=U(),{tenantEmailDomain:i}=L(),{pendingAutoFocusTabId:r}=it(),[n,t]=d.useState(!1),s=C((I=>I.tenantState.fetchState)),c=C((I=>v(I))),u=c.companyId??j.getSignedInUserTenant(i)?.companyId,h=j.getSignedInUser(),S=G(),m=Y(c.userRole??[]);if(h==null)throw Error("Can't access Integrations page without signing in...");d.useEffect((()=>{o(ze(Q))}),[o]);const[p,b]=d.useState(!1);d.useEffect((()=>{p||(b(!0),o(Z()))}),[p,o]);const E=I=>{t(I)},g=C((I=>qe(I,u))),P=C((I=>I.plaidAccountViewState.external_account.plaidConnectionDetails)),{plaidAccounts:_,onAddPlaidAccount:R,onReLoginPlaidAccount:A}=rt({companyId:u??c.companyId});return S?.loggedInUserRoleMap!=null?a.jsxs(It,{children:[a.jsx(T,{isAppContentDrawerOpen:n,handleDrawerToggle:E}),a.jsx(St,{navigate:l,meetingUrl:e("settings_integrations"),onClickMenuIcon:()=>{E(!0)},isAdmin:m,integrationsView:g,signedInUserEmail:h.userEmail??"",tenantEmailDomain:c.tenantEmailDomain??i??"",tenantId:c.tenantId,saveChargeBeeState:g.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:g.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:g.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:g.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:g.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(g.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map((([I,x])=>[I,x?.message]))),deleteConnectionState:g.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:g.externalConnections?.deleteConnectionError?.message,isLoading:s==="In-Progress",autoFocusTabId:r??void 0,plaidAccounts:_,onAddPlaidAccount:R,onReLoginPlaidAccount:A,plaidConnectionDetails:P})]}):a.jsx(ne,{fetchState:s})},It=B.div`
|
|
26
26
|
display: flex;
|
|
27
27
|
height: 100%;
|
|
28
28
|
width: 100%;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-
|
|
1
|
+
import{j as u}from"./liveblocks-oxGmLiGE.js";import{h as X,g as Q,u as ee,i as W,j as k,N as R,l as G,t as en}from"./core-k1hJbZ6L.js";import{bL as nn,fI as V,cI as tn,Io as J,_0 as an,_3 as sn,v6 as ne,uW as te,mD as ae,Ca as L,_5 as be,gJ as Ge,gI as He,gH as qe,_6 as on,Ix as cn,N5 as Ce,MY as he,MV as Ie,MA as Y,M$ as Ae,N2 as _e,N8 as ke,CE as ve,h2 as rn,cD as un,e1 as dn,e0 as ln,dk as pn,bu as mn,cw as Fe,_7 as yn,LA as fe,Mc as fn,_8 as gn,bM as Sn,Oq as ge,Oe as bn,_9 as Cn,_a as hn,Ou as In,Oy as An,_b as je,C3 as _n,T7 as kn,_c as vn,_d as Pn,_e as Tn,_f as Ke,_g as En,_h as Dn,Wd as On,Zh as Un,Ws as wn,_i as Je,MM as Fn,ME as Vn,Wt as xn,MI as Bn,_j as Ue,Pe as Ye,mL as jn,uZ as Xe,Cc as Rn,bG as Re,Co as Ne,cG as Nn,_k as Qe,P4 as we,ON as Ln,OO as Mn,OS as zn,_l as Zn,P7 as Le,_m as $n,_n as Wn,_o as Gn,PV as Se,_p as Hn,gZ as qn,JJ as Kn,_q as Jn,JO as Yn,JN as Xn}from"./zeni-epic-state-C2CKsxzr.js";import{ag as Pe,V as ie,p as de,d as K,z as E,a6 as se,k as D,a5 as Te,O as $,bR as Qn,ac as oe,bS as x,bj as Ve,bT as et,bU as nt,bV as tt,q as Be,bW as at,l as Me,aE as ze,$ as it,a9 as st,bX as ot,bY as ct,bZ as rt,w as ut}from"./index-Cjqi6Pkt.js";import{a as h}from"./sentry-CYolppN9.js";import{u as Ee,n as xe,D as dt,S as lt}from"./mui-D8QuRJEy.js";import{u as pt,d as Ze,B as Oe}from"./BusinessVerificationPageScreen-YH2iMYXG.js";import{M as le}from"./MobileAppDrawer-D95K9MWM.js";import N from"./NotFoundScreen-ngkmWfLO.js";import{a as $e}from"./analyticsHelper-w2YkQjq1.js";import{d as We}from"./routePaths-BQiUfv8Y.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]="e57aa233-d145-4343-963c-d343ecad92fd",e._sentryDebugIdIdentifier="sentry-dbid-e57aa233-d145-4343-963c-d343ecad92fd")}catch{}})();const mt=xe.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,7 +6,7 @@ import{j as u}from"./liveblocks-CevUFagi.js";import{h as X,g as Q,u as ee,i as W
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,yt=G((function(e,o){const{isUserBillPayAdmin:a,companyId:t}=o,r=x(e),n=an(e),i=E.getSignedInUser(),l=r.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},c=sn(e,t),p=a&&c.updateStatus.fetchState!=="In-Progress"&&c.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&c.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&c.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{billPaySetupView:c,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",showIntlWiseWidget:o.showIntlWiseWidget,isDisabled:p,billpayApprovalView:n,analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:s}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r}=o;return{onBusinessVerificationSectionClick:()=>{a("../verification"),r?.company?.companyBillPayInfo!=null&&r?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(K(t,!1,!0))},onSetupApprovalRulesSectionClick:()=>{a("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(ve("bill_pay_setup",n,i))},onEstablishConnectionClick:n=>{e(ke(n,t,"bill_pay_setup","bill_pay"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(_e(n,i,"bill_pay","bill_pay_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Ae(!1,n,"bill_pay","bill_pay_setup",i))},onEstablishConnectionSuccess:()=>{e(K(t,!0))},onEnableBillPayClick:()=>{e(Y(t,"bill_pay"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?he(n,i,"bill_pay","bill_pay_setup"):Ie("reimbursement_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(Ce(t,"bill_pay_setup",n,i))},onEnableBillPaySuccess:()=>{a("../",{relative:"path"})},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?a("../.."):a("../",{relative:"path"})},onAcceptUpdatedTOS:()=>{e(cn(t))},onAcceptUpdatedTOSSuccess:()=>{e(K(t,!0))},onGetOtp:(n,i)=>{e(qe(n,"SpendManagementSetup")),i!=null&&e(on({officerType:i,phone:n}))},onResendOtp:n=>{e(He(n,"SpendManagementSetup"))},onVerifyOtp:(n,i)=>{e(Ge(n,i,"SpendManagementSetup"))},onVerifyOtpSuccess:(n,i)=>{n!=null&&i!=null&&e(L(t,n,"bill_pay",!0,!0))},onNavigateToDashboard:()=>{a("../../dashboard")},onNavigateToSettings:()=>{a("../bills/setup")},onInternationPaymentSetUpClick:()=>{a("../international-wire")},onCompanyOfficerUpdated:(n,i)=>{e(be({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(L(t,n,"bill_pay",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(n,i.split(".")[0]))}}}))(Qn),ft=()=>{const e=Pe(),o=X(),a=Q(),t=ee(),{tenantEmailDomain:r}=W(),n=ie(),i=nn(n?.loggedInUserRoleMap),{useFeatureGate:l}=de(),{isFeatureEnabled:s}=l(J.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:c}=l(J.isBillPayLocalCurrencyFeatureEnabled),p=Ee(),[g,S]=h.useState(!1),_=h.useRef(!1),I=k((m=>m.billPaySetupViewState.fetchState)),d=k((m=>x(m)));pt();const y=d.companyId??E.getSignedInUserTenant(r)?.companyId;if(E.getSignedInUser()==null)throw Error("Can't access bill pay setup page without signing in...");const f=!!d.companyBillPayInfo?.info?.isBillPayTOSAccepted,v=tn(n?.loggedInUserRoleMap);h.useEffect((()=>{_.current||I!=="Not-Started"||y==null?_.current||I!=="Completed"||y==null||d.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(_.current=!0,t(K(y,!1,!0))):(_.current=!0,t(K(y,!0)))}),[I,y,t]);const b=m=>{S(m)};if(f===!1||v&&!n?.loggedInUserRoleMap?.bill_pay_admin)return u.jsx(R,{to:"../promo"});if(f===!0&&n?.loggedInUserRoleMap!=null){const m=C=>C.trackPageLoaded($.Event.billPaySetup);return u.jsxs(mt,{children:[u.jsx(se,{analytics:D,onLoad:C=>m(C)}),u.jsx(le,{isAppContentDrawerOpen:g,handleDrawerToggle:b}),u.jsx(yt,{navigate:o,location:a,companyId:y,currentTenant:d,isUserBillPayAdmin:i,showIntlWiseWidget:s,meetingUrl:e("bill_pay_setup"),onClickMenuIcon:()=>{b(!0)},isLocalCurrencyEnabled:c})]})}return u.jsx(Te,{fetchState:"In-Progress",style:{backgroundColor:p.colors.grey5}})},Ht=(e,o)=>e!=null&&(function(a){return a==="debit"||a==="credit"||a==="debit_and_credit"})(e)?e:o,qt=e=>`/${e}/cards`,Jt=e=>`/${e}/cards/setup`,Kt=e=>`/${e}/cards/onboard`,Yt=(e,o,a,t,r=!1)=>{let n=`/${e}/cards/${encodeURIComponent(o)}`;return t==null||t.status.code!=="inactive"||t.cardHolderUserId!==a.userId||t.type.code!=="business_physical_credit_card"&&t.type.code!=="business_physical_debit_card"?t!=null&&t.status.code==="active"&&t.cardHolderUserId===a.userId&&t.type.code==="business_physical_credit_card"&&r===!0?n+="/addToWallet":t==null||t.type.code!=="business_physical_debit_card"&&t.type.code!=="business_virtual_debit_card"||t.status.code!=="active"||t.cardHolderUserId!==a.userId||t.isPinSet!==!1||(n+="/setPin"):n+="/activate",n},Xt=(e,o)=>e.find((a=>a.id===o)),Qt=(e,o,a)=>!e||!o||a.fetchState==="Completed",gt=(e,o,a,t)=>({isCreditCardOffered:e,isDebitCardOffered:o,isDebitCardEnabled:a,isCreditCardEnabled:t}),ea=(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,na=(e,o,a,t,r)=>e&&o&&a?{creditAccountId:t.id,creditAccountLimit:V(t.limit.amount),creditAccountAvailableAmount:V(t.available.amount),creditAccountSpentAmount:V(t.balance.amount+t.hold.amount),creditAccountStatus:t.status,outstandingBalance:V(r.remainingAmountDue.amount)}:void 0,ta=(e,o,a,t,r)=>e&&o&&a?{debitAccountId:t.depositAccounts.map((n=>n.id)),debitAccountName:t.depositAccounts.map((n=>n.accountName)),debitAccountBalance:t.depositAccounts.map((n=>V(n.accountBalance.available.amount))),debitCardsSpend:V(r?.currentMonthSpends.amount??0),debitAccountStatus:t.depositAccounts.map((n=>n.accountStatus))}:void 0,aa=(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,ia=80,sa=80,oa=e=>e.companyId??E.getSignedInUserTenant(e.tenantEmailDomain)?.companyId,St=({isBankingOnlyTenant:e,isDebitCardFeatureEnabled:o})=>o||e,bt=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:a,isDebitCardProductVisible:t,chargeCardsCreditAccountLimit:r})=>(e||o||a)&&(!t||r>0),ca=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:a})=>e||o||a,ra=({cardInfo:e,isProductVisible:o,isTOSAccepted:a,isSetupEnabled:t,isUserHasCardsAdminLevelAccess:r,isUserHasCardsAccess:n})=>!!e&&o&&(!a&&r||n&&!r&&!t),Ct=G((function(e,o){const{isUserChargeCardAdmin:a,chargeCardSetUpView:t,isDebitCardOnlyEnabled:r,isCreditCardOnlyEnabled:n}=o,i=x(e),l=E.getSignedInUser(),s=i.tenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},p=a&&t.updateStatus.fetchState!=="In-Progress"&&t.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&t.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&t.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{chargeCardSetUpView:t,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:p,analytics:D,isDebitCardOnlyEnabled:r,isCreditCardOnlyEnabled:n,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:c}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r,chargeCardSetUpView:n,isDebitCardTOSAccepted:i,isChargeCardTOSAccepted:l,isChargeCardSetupEnabled:s,isDebitCardSetupEnabled:c,productInformation:p,controllerEmails:g,businessVerificationStatus:S,isCardPolicyEnabled:_,isUserChargeCardAdmin:I}=o;return{onBusinessVerificationSectionClick:()=>{D.trackCardsVerifyIdentityCompanyDetailsClick(g,p,S?.code),a("../verification"),r?.company?.companyChargeCardInfo!=null&&r.company.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(fe(t,!1,!0))},...I&&_?{onCardPolicySectionClick:()=>{a("../policy")}}:{},onFetchLinkTokenClick:(d,y)=>{e(ve("charge_card_setup",d,y))},onEstablishConnectionClick:d=>{e(ke(d,t,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(d,y,f)=>{e(_e(d,y,"charge_cards","charge_card_setup",f))},onUpdatePaymentAccountLoginStatus:(d,y)=>{e(Ae(!1,d,"charge_cards","charge_card_setup",y))},onEstablishConnectionSuccess:()=>{e(fe(t,!0))},onEnableChargeCardClick:()=>{D.trackCardsEnableCardsClick(g,p,"Cards Card Setup"),l===!0&&i===!0&&s===!1&&c===!1?e(Y(t,"charge_cards__debit_cards")):l===!0&&s===!1?e(Y(t,"charge_cards")):i===!0&&c===!1&&e(Y(t,"debit_cards"))},onUpdateChargeCardClick:(d,y,f)=>{const v=n.allBankAccounts.find((m=>m.accountId===n.primaryFundingAccount?.zeniAccountId)),b=n.allBankAccounts.find((m=>m.accountId===d));D.trackCardsZeniCashAccountChangeClick(g,p,{oldZeniCashAccount:v?.accountName??"",newZeniCashAccount:b?.accountName??"",oldZeniCashAccountPosition:n.allBankAccounts.findIndex((m=>m.accountId===n.primaryFundingAccount?.zeniAccountId))+1,newZeniCashAccountPosition:n.allBankAccounts.findIndex((m=>m.accountId===d))+1,numberOfCashAccounts:n.allBankAccounts.length}),e(f==="paymentAccount"?he(d,y,"charge_cards","charge_card_setup"):Ie("charge_card_setup",d,y))},onUpdatePrimaryFundingAccount:(d,y)=>{const f=n.allFundingAccounts.find((m=>m.id===d)),v=n.allFundingAccounts.findIndex((m=>m.id===n.primaryFundingAccount?.id))+1,b=n.allFundingAccounts.findIndex((m=>m.id===d))+1;D.trackCardsPaymentAccountChangeClick(g,p,{oldPaymentAccountName:n.primaryFundingAccount?.label??"",oldPaymentAccountBalance:V(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:f?.label??"",newPaymentAccountBalance:V(f?.accountBalance?.available?.amount??0),isOldPaymentAccountRecommended:n.primaryFundingAccount?.accType==="depositAccount",isNewPaymentAccountRecommended:f?.accType==="depositAccount",oldPaymentAccountPosition:v,newPaymentAccountPosition:b,numberOfPaymentAccounts:n.allFundingAccounts.length}),e(Ce(t,"charge_card_setup",d,y))},onEnableChargeCardSuccess:()=>{e(gn()),a("../",{relative:"path"})},onBackClick:()=>{r?.companyChargeCardInfo?.info?.isChargeCardEnabled||r?.companyDebitCardInfo?.info?.isDebitCardEnabled?a("../",{relative:"path"}):a("../..",{relative:"path"})},onNavigateToDashboard:()=>{a("../../dashboard")},onCompanyOfficerUpdated:(d,y)=>{e(be({officerType:d,fileIds:y}))},onSendForVerificationClick:d=>{l===!0&&i===!0?e(L(t,d,"charge_cards__debit_cards",!0,!0,!0)):l===!0?e(L(t,d,"charge_cards",!0,!0,!0)):i===!0&&e(L(t,d,"debit_cards",!0,!0,!0))},updateFilesEntity:d=>{e(ae({files:d}))},onDeleteFile:d=>{e(te(d))},onEditFileName:(d,y)=>{e(ne(d,y.split(".")[0]))},onUpdateAutoPayClick:d=>{e(fn(t,d))}}}))(et),ht=()=>{const e=Pe(),o=X(),a=Q(),t=ee(),{tenantEmailDomain:r}=W(),n=ie(),i=k((M=>x(M))),{useDynamicConfig:l,useFeatureGate:s}=de(),c=a.state?.pathnameStackToGoBack?.[0],{configValue:p}=l(xe.zeniCardsConfig),g=p.credit_card_auto_pay_threshold_by_company_id?.[i.companyId]??p.default_credit_card_auto_pay_threshold??80,{isFeatureEnabled:S}=s(J.isDebitCardFeatureEnabled),{isFeatureEnabled:_}=s(J.isChargeCardFeatureEnabled),{isFeatureEnabled:I}=s(J.isEarlyPayFeatureEnabled),{isFeatureEnabled:d}=s(J.isCardPolicyEnabled),y=k((M=>rn(M,i.companyId))),f=un(y.controllers),v=!!i.company?.companyChargeCardInfo.isChargeCardEnabled,b=!!i.company?.companyDebitCardInfo.isDebitCardEnabled,m=dn(S,i),C=St({isDebitCardFeatureEnabled:S,isBankingOnlyTenant:m}),P=ln(i),T=pn(i),O=i.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,A=bt({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:_,isBookKeepingTenant:T,isDebitCardProductVisible:C,chargeCardsCreditAccountLimit:O}),U=C&&A===!1,B=C===!1&&A,z=mn(n?.loggedInUserRoleMap),F=Fe(n?.loggedInUserRoleMap),[ce,H]=h.useState(!1),[q,re]=h.useState(!1),Z=k((M=>M.chargeCardSetupViewState.fetchState)),j=E.getSignedInUserTenant(r)?.companyId??i.companyId,w=E.getSignedInUser(),De=M=>{H(M)},pe=k((M=>yn(M,j)));if(w==null)throw Error("Can't access charge card setup page without signing in...");h.useEffect((()=>{q||Z!=="Not-Started"||j==null?q||Z!=="Completed"||j==null||i.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(fe(j,!1,!0)):(re(!0),t(fe(j,!0)))}),[q,Z,j,t]);const me=!!i.company?.companyChargeCardInfo.isChargeCardTOSAccepted,ye=!!i.company?.companyDebitCardInfo.isDebitCardTOSAccepted,ue=gt(A,C,b,v);return me||ye?me||ye?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:()=>{D.trackPageLoaded($.Event.cardsSetupVisited),D.trackCardsCardSetupView(f,ue,c==null?"Cards Setup":c.includes("cards/promo")?"Promo":c.includes("cards")?"Settings":"Cards Tab")}}),u.jsx(le,{isAppContentDrawerOpen:ce,handleDrawerToggle:De}),u.jsx(Ct,{autoPayThreshold:g,navigate:o,meetingUrl:e("charge_card_setup"),location:a,companyId:j,currentTenant:i,isEarlyPayEnabled:I,isChargeCardTOSAccepted:me,isDebitCardTOSAccepted:ye,isUserChargeCardAdmin:z,isCardPolicyEnabled:d,isDebitCardOnlyEnabled:U,isCreditCardOnlyEnabled:B,chargeCardSetUpView:pe,isCreditCardProductVisible:A,isDebitCardFeatureEnabled:C,isChargeCardSetupEnabled:v,isDebitCardSetupEnabled:b,businessVerificationStatus:i.companyBillPayInfo?.info?.businessVerificationStatus,controllerEmails:f,productInformation:ue,onClickMenuIcon:()=>{De(!0)},hasZeniAccountsAdminAccess:F})]}):u.jsx(Te,{fetchState:"Not-Started"}):u.jsx(R,{to:"../promo"})},It=Ve.div`
|
|
9
|
+
`,yt=G((function(e,o){const{isUserBillPayAdmin:a,companyId:t}=o,r=V(e),n=an(e),i=E.getSignedInUser(),l=r.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},c=sn(e,t),p=a&&c.updateStatus.fetchState!=="In-Progress"&&c.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&c.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&c.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{billPaySetupView:c,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",showIntlWiseWidget:o.showIntlWiseWidget,isDisabled:p,billpayApprovalView:n,analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:s}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r}=o;return{onBusinessVerificationSectionClick:()=>{a("../verification"),r?.company?.companyBillPayInfo!=null&&r?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(J(t,!1,!0))},onSetupApprovalRulesSectionClick:()=>{a("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(ve("bill_pay_setup",n,i))},onEstablishConnectionClick:n=>{e(ke(n,t,"bill_pay_setup","bill_pay"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(_e(n,i,"bill_pay","bill_pay_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Ae(!1,n,"bill_pay","bill_pay_setup",i))},onEstablishConnectionSuccess:()=>{e(J(t,!0))},onEnableBillPayClick:()=>{e(Y(t,"bill_pay"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?he(n,i,"bill_pay","bill_pay_setup"):Ie("reimbursement_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(Ce(t,"bill_pay_setup",n,i))},onEnableBillPaySuccess:()=>{a("../",{relative:"path"})},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?a("../.."):a("../",{relative:"path"})},onAcceptUpdatedTOS:()=>{e(cn(t))},onAcceptUpdatedTOSSuccess:()=>{e(J(t,!0))},onGetOtp:(n,i)=>{e(qe(n,"SpendManagementSetup")),i!=null&&e(on({officerType:i,phone:n}))},onResendOtp:n=>{e(He(n,"SpendManagementSetup"))},onVerifyOtp:(n,i)=>{e(Ge(n,i,"SpendManagementSetup"))},onVerifyOtpSuccess:(n,i)=>{n!=null&&i!=null&&e(L(t,n,"bill_pay",!0,!0))},onNavigateToDashboard:()=>{a("../../dashboard")},onNavigateToSettings:()=>{a("../bills/setup")},onInternationPaymentSetUpClick:()=>{a("../international-wire")},onCompanyOfficerUpdated:(n,i)=>{e(be({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(L(t,n,"bill_pay",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(n,i.split(".")[0]))}}}))(Qn),ft=()=>{const e=Pe(),o=X(),a=Q(),t=ee(),{tenantEmailDomain:r}=W(),n=ie(),i=nn(n?.loggedInUserRoleMap),{useFeatureGate:l}=de(),{isFeatureEnabled:s}=l(K.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:c}=l(K.isBillPayLocalCurrencyFeatureEnabled),p=Ee(),[g,S]=h.useState(!1),_=h.useRef(!1),I=k((m=>m.billPaySetupViewState.fetchState)),d=k((m=>V(m)));pt();const y=d.companyId??E.getSignedInUserTenant(r)?.companyId;if(E.getSignedInUser()==null)throw Error("Can't access bill pay setup page without signing in...");const f=!!d.companyBillPayInfo?.info?.isBillPayTOSAccepted,v=tn(n?.loggedInUserRoleMap);h.useEffect((()=>{_.current||I!=="Not-Started"||y==null?_.current||I!=="Completed"||y==null||d.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(_.current=!0,t(J(y,!1,!0))):(_.current=!0,t(J(y,!0)))}),[I,y,t]);const b=m=>{S(m)};if(f===!1||v&&!n?.loggedInUserRoleMap?.bill_pay_admin)return u.jsx(R,{to:"../promo"});if(f===!0&&n?.loggedInUserRoleMap!=null){const m=C=>C.trackPageLoaded($.Event.billPaySetup);return u.jsxs(mt,{children:[u.jsx(se,{analytics:D,onLoad:C=>m(C)}),u.jsx(le,{isAppContentDrawerOpen:g,handleDrawerToggle:b}),u.jsx(yt,{navigate:o,location:a,companyId:y,currentTenant:d,isUserBillPayAdmin:i,showIntlWiseWidget:s,meetingUrl:e("bill_pay_setup"),onClickMenuIcon:()=>{b(!0)},isLocalCurrencyEnabled:c})]})}return u.jsx(Te,{fetchState:"In-Progress",style:{backgroundColor:p.colors.grey5}})},Ht=(e,o)=>e!=null&&(function(a){return a==="debit"||a==="credit"||a==="debit_and_credit"})(e)?e:o,qt=e=>`/${e}/cards`,Kt=e=>`/${e}/cards/setup`,Jt=e=>`/${e}/cards/onboard`,Yt=(e,o,a,t,r=!1)=>{let n=`/${e}/cards/${encodeURIComponent(o)}`;return t==null||t.status.code!=="inactive"||t.cardHolderUserId!==a.userId||t.type.code!=="business_physical_credit_card"&&t.type.code!=="business_physical_debit_card"?t!=null&&t.status.code==="active"&&t.cardHolderUserId===a.userId&&t.type.code==="business_physical_credit_card"&&r===!0?n+="/addToWallet":t==null||t.type.code!=="business_physical_debit_card"&&t.type.code!=="business_virtual_debit_card"||t.status.code!=="active"||t.cardHolderUserId!==a.userId||t.isPinSet!==!1||(n+="/setPin"):n+="/activate",n},Xt=(e,o)=>e.find((a=>a.id===o)),Qt=(e,o,a)=>!e||!o||a.fetchState==="Completed",gt=(e,o,a,t)=>({isCreditCardOffered:e,isDebitCardOffered:o,isDebitCardEnabled:a,isCreditCardEnabled:t}),ea=(e,o)=>e?{creditCardCashbackOffer:`${o.cashbackAnalytics.creditCardCashbackOffer}%`,debitCardCashbackOffer:`${o.cashbackAnalytics.debitCardCashbackOffer}%`,totalEarnedCashback:x(o.cashbackSummary.cashbackEarned.amount),redeemedCashback:x(o.cashbackSummary.cashbackRedeemed.amount),availableCashback:x(o.cashbackSummary.cashbackAvailable.amount),creditCardCashbackRedemptionMode:o.cashbackAnalytics.creditCardCashbackRedemptionMode,debitCardCashbackRedemptionMode:o.cashbackAnalytics.debitCardCashbackRedemptionMode}:void 0,na=(e,o,a,t,r)=>e&&o&&a?{creditAccountId:t.id,creditAccountLimit:x(t.limit.amount),creditAccountAvailableAmount:x(t.available.amount),creditAccountSpentAmount:x(t.balance.amount+t.hold.amount),creditAccountStatus:t.status,outstandingBalance:x(r.remainingAmountDue.amount)}:void 0,ta=(e,o,a,t,r)=>e&&o&&a?{debitAccountId:t.depositAccounts.map((n=>n.id)),debitAccountName:t.depositAccounts.map((n=>n.accountName)),debitAccountBalance:t.depositAccounts.map((n=>x(n.accountBalance.available.amount))),debitCardsSpend:x(r?.currentMonthSpends.amount??0),debitAccountStatus:t.depositAccounts.map((n=>n.accountStatus))}:void 0,aa=(e,o)=>e&&o.depositAccountLimit!=null&&o.chargeCard!=null?{debitAccountId:o.depositAccountLimit.id,debitAccountName:o.depositAccountLimit?.accountName??o.connectedAccount?.accountName,debitAccountBalance:x(o.depositAccountLimit?.accountBalance.available.amount),debitCardsSpend:x(o.chargeCard.limit.amount-o.chargeCard.available.amount),debitAccountStatus:o.depositAccountLimit?.accountStatus??o.connectedAccount?.accountStatus}:void 0,ia=80,sa=80,oa=e=>e.companyId??E.getSignedInUserTenant(e.tenantEmailDomain)?.companyId,St=({isBankingOnlyTenant:e,isDebitCardFeatureEnabled:o})=>o||e,bt=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:a,isDebitCardProductVisible:t,chargeCardsCreditAccountLimit:r})=>(e||o||a)&&(!t||r>0),ca=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:a})=>e||o||a,ra=({cardInfo:e,isProductVisible:o,isTOSAccepted:a,isSetupEnabled:t,isUserHasCardsAdminLevelAccess:r,isUserHasCardsAccess:n})=>!!e&&o&&(!a&&r||n&&!r&&!t),Ct=G((function(e,o){const{isUserChargeCardAdmin:a,chargeCardSetUpView:t,isDebitCardOnlyEnabled:r,isCreditCardOnlyEnabled:n}=o,i=V(e),l=E.getSignedInUser(),s=i.tenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},p=a&&t.updateStatus.fetchState!=="In-Progress"&&t.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&t.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&t.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{chargeCardSetUpView:t,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:p,analytics:D,isDebitCardOnlyEnabled:r,isCreditCardOnlyEnabled:n,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:c}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r,chargeCardSetUpView:n,isDebitCardTOSAccepted:i,isChargeCardTOSAccepted:l,isChargeCardSetupEnabled:s,isDebitCardSetupEnabled:c,productInformation:p,controllerEmails:g,businessVerificationStatus:S,isCardPolicyEnabled:_,isUserChargeCardAdmin:I}=o;return{onBusinessVerificationSectionClick:()=>{D.trackCardsVerifyIdentityCompanyDetailsClick(g,p,S?.code),a("../verification"),r?.company?.companyChargeCardInfo!=null&&r.company.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(fe(t,!1,!0))},...I&&_?{onCardPolicySectionClick:()=>{a("../policy")}}:{},onFetchLinkTokenClick:(d,y)=>{e(ve("charge_card_setup",d,y))},onEstablishConnectionClick:d=>{e(ke(d,t,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(d,y,f)=>{e(_e(d,y,"charge_cards","charge_card_setup",f))},onUpdatePaymentAccountLoginStatus:(d,y)=>{e(Ae(!1,d,"charge_cards","charge_card_setup",y))},onEstablishConnectionSuccess:()=>{e(fe(t,!0))},onEnableChargeCardClick:()=>{D.trackCardsEnableCardsClick(g,p,"Cards Card Setup"),l===!0&&i===!0&&s===!1&&c===!1?e(Y(t,"charge_cards__debit_cards")):l===!0&&s===!1?e(Y(t,"charge_cards")):i===!0&&c===!1&&e(Y(t,"debit_cards"))},onUpdateChargeCardClick:(d,y,f)=>{const v=n.allBankAccounts.find((m=>m.accountId===n.primaryFundingAccount?.zeniAccountId)),b=n.allBankAccounts.find((m=>m.accountId===d));D.trackCardsZeniCashAccountChangeClick(g,p,{oldZeniCashAccount:v?.accountName??"",newZeniCashAccount:b?.accountName??"",oldZeniCashAccountPosition:n.allBankAccounts.findIndex((m=>m.accountId===n.primaryFundingAccount?.zeniAccountId))+1,newZeniCashAccountPosition:n.allBankAccounts.findIndex((m=>m.accountId===d))+1,numberOfCashAccounts:n.allBankAccounts.length}),e(f==="paymentAccount"?he(d,y,"charge_cards","charge_card_setup"):Ie("charge_card_setup",d,y))},onUpdatePrimaryFundingAccount:(d,y)=>{const f=n.allFundingAccounts.find((m=>m.id===d)),v=n.allFundingAccounts.findIndex((m=>m.id===n.primaryFundingAccount?.id))+1,b=n.allFundingAccounts.findIndex((m=>m.id===d))+1;D.trackCardsPaymentAccountChangeClick(g,p,{oldPaymentAccountName:n.primaryFundingAccount?.label??"",oldPaymentAccountBalance:x(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:f?.label??"",newPaymentAccountBalance:x(f?.accountBalance?.available?.amount??0),isOldPaymentAccountRecommended:n.primaryFundingAccount?.accType==="depositAccount",isNewPaymentAccountRecommended:f?.accType==="depositAccount",oldPaymentAccountPosition:v,newPaymentAccountPosition:b,numberOfPaymentAccounts:n.allFundingAccounts.length}),e(Ce(t,"charge_card_setup",d,y))},onEnableChargeCardSuccess:()=>{e(gn()),a("../",{relative:"path"})},onBackClick:()=>{r?.companyChargeCardInfo?.info?.isChargeCardEnabled||r?.companyDebitCardInfo?.info?.isDebitCardEnabled?a("../",{relative:"path"}):a("../..",{relative:"path"})},onNavigateToDashboard:()=>{a("../../dashboard")},onCompanyOfficerUpdated:(d,y)=>{e(be({officerType:d,fileIds:y}))},onSendForVerificationClick:d=>{l===!0&&i===!0?e(L(t,d,"charge_cards__debit_cards",!0,!0,!0)):l===!0?e(L(t,d,"charge_cards",!0,!0,!0)):i===!0&&e(L(t,d,"debit_cards",!0,!0,!0))},updateFilesEntity:d=>{e(ae({files:d}))},onDeleteFile:d=>{e(te(d))},onEditFileName:(d,y)=>{e(ne(d,y.split(".")[0]))},onUpdateAutoPayClick:d=>{e(fn(t,d))}}}))(et),ht=()=>{const e=Pe(),o=X(),a=Q(),t=ee(),{tenantEmailDomain:r}=W(),n=ie(),i=k((M=>V(M))),{useDynamicConfig:l,useFeatureGate:s}=de(),c=a.state?.pathnameStackToGoBack?.[0],{configValue:p}=l(Ve.zeniCardsConfig),g=p.credit_card_auto_pay_threshold_by_company_id?.[i.companyId]??p.default_credit_card_auto_pay_threshold??80,{isFeatureEnabled:S}=s(K.isDebitCardFeatureEnabled),{isFeatureEnabled:_}=s(K.isChargeCardFeatureEnabled),{isFeatureEnabled:I}=s(K.isEarlyPayFeatureEnabled),{isFeatureEnabled:d}=s(K.isCardPolicyEnabled),y=k((M=>rn(M,i.companyId))),f=un(y.controllers),v=!!i.company?.companyChargeCardInfo.isChargeCardEnabled,b=!!i.company?.companyDebitCardInfo.isDebitCardEnabled,m=dn(S,i),C=St({isDebitCardFeatureEnabled:S,isBankingOnlyTenant:m}),P=ln(i),T=pn(i),O=i.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,A=bt({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:_,isBookKeepingTenant:T,isDebitCardProductVisible:C,chargeCardsCreditAccountLimit:O}),U=C&&A===!1,B=C===!1&&A,z=mn(n?.loggedInUserRoleMap),F=Fe(n?.loggedInUserRoleMap),[ce,H]=h.useState(!1),[q,re]=h.useState(!1),Z=k((M=>M.chargeCardSetupViewState.fetchState)),j=E.getSignedInUserTenant(r)?.companyId??i.companyId,w=E.getSignedInUser(),De=M=>{H(M)},pe=k((M=>yn(M,j)));if(w==null)throw Error("Can't access charge card setup page without signing in...");h.useEffect((()=>{q||Z!=="Not-Started"||j==null?q||Z!=="Completed"||j==null||i.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(fe(j,!1,!0)):(re(!0),t(fe(j,!0)))}),[q,Z,j,t]);const me=!!i.company?.companyChargeCardInfo.isChargeCardTOSAccepted,ye=!!i.company?.companyDebitCardInfo.isDebitCardTOSAccepted,ue=gt(A,C,b,v);return me||ye?me||ye?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:()=>{D.trackPageLoaded($.Event.cardsSetupVisited),D.trackCardsCardSetupView(f,ue,c==null?"Cards Setup":c.includes("cards/promo")?"Promo":c.includes("cards")?"Settings":"Cards Tab")}}),u.jsx(le,{isAppContentDrawerOpen:ce,handleDrawerToggle:De}),u.jsx(Ct,{autoPayThreshold:g,navigate:o,meetingUrl:e("charge_card_setup"),location:a,companyId:j,currentTenant:i,isEarlyPayEnabled:I,isChargeCardTOSAccepted:me,isDebitCardTOSAccepted:ye,isUserChargeCardAdmin:z,isCardPolicyEnabled:d,isDebitCardOnlyEnabled:U,isCreditCardOnlyEnabled:B,chargeCardSetUpView:pe,isCreditCardProductVisible:A,isDebitCardFeatureEnabled:C,isChargeCardSetupEnabled:v,isDebitCardSetupEnabled:b,businessVerificationStatus:i.companyBillPayInfo?.info?.businessVerificationStatus,controllerEmails:f,productInformation:ue,onClickMenuIcon:()=>{De(!0)},hasZeniAccountsAdminAccess:F})]}):u.jsx(Te,{fetchState:"Not-Started"}):u.jsx(R,{to:"../promo"})},It=xe.div`
|
|
10
10
|
display: flex;
|
|
11
11
|
height: 100%;
|
|
12
12
|
width: 100%;
|
|
@@ -14,11 +14,11 @@ import{j as u}from"./liveblocks-CevUFagi.js";import{h as X,g as Q,u as ee,i as W
|
|
|
14
14
|
flex-direction: column;
|
|
15
15
|
align-items: center;
|
|
16
16
|
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
-
`,At=G((function(e,o){const{isUserRemiAdmin:a,companyId:t}=o,r=x(e),n=Cn(e),i=hn(e,t),l=E.getSignedInUser(),s=r.tenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""};return{remiSetupView:i,isDisabled:a&&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",remiApprovalView:n,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:c}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r}=o;return{updateMileageDetails:n=>{const{mileageAmount:i,mileageUnit:l,mileageCurrencyCode:s,mileageCurrencySymbol:c,denomination:p,denominationSymbol:g,mileageAmountInDenomination:S,description:_}=n;e(An({mileageDetails:{mileageUnitAmount:{amount:i,currencyCode:s,currencySymbol:c},denomination:p,denominationSymbol:g,mileageAmountInDenomination:S,mileageCurrencyCode:s,mileageCurrencySymbol:c,mileageUnit:l,description:_}}))},onSaveMileageClick:n=>{e(In(t)),D.trackReimbursementMileageRateSave(n)},onBusinessVerificationSectionClick:()=>{a("../verification"),r?.company?.companyReimbursementInfo!=null&&r?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(ge(t,!1,!0))},onSetupApprovalRulesSectionClick:()=>{a("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(ve("reimbursement_setup",n,i))},onEstablishConnectionClick:n=>{e(ke(n,t,"reimbursement_setup","reimbursement"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(_e(n,i,"reimbursement","reimbursement_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Ae(!1,n,"reimbursement","reimbursement_setup",i))},onEstablishConnectionSuccess:()=>{e(ge(t,!0))},onEnableRemiClick:()=>{e(Y(t,"reimbursement"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?he(n,i,"reimbursement","reimbursement_setup"):Ie("reimbursement_setup",n,i))},onEnableRemiSuccess:()=>{a("../",{relative:"path"})},onBackClick:()=>{r?.companyReimbursementInfo?.info?.isReimbursementEnabled!=null&&r.companyReimbursementInfo.info.isReimbursementEnabled===!1?a("../.."):a("../",{relative:"path"})},onCompanyOfficerUpdated:(n,i)=>{e(be({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(L(t,n,"reimbursement",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(n,i.split(".")[0]))},onUpdatePrimaryFundingAccount:(n,i)=>{e(Ce(t,"reimbursement_setup",n,i))}}}))(tt),_t=()=>{const e=Pe(),o=X(),a=Q(),t=ee(),{tenantEmailDomain:r}=W(),n=ie(),i=Ee(),l=Sn(n?.loggedInUserRoleMap),s=Fe(n?.loggedInUserRoleMap),[c,p]=h.useState(!1),g=h.useRef(!1),[S,_]=h.useState(!1),I=k((P=>P.remiSetupViewState.fetchState)),d=k((P=>x(P))),y=k((P=>P.remiSetupApproverViewState.fetchState)),{isApprovalRulesV3Enabled:f,isLoading:v}=nt(d?.tenantId),b=E.getSignedInUserTenant(r)?.companyId??d.companyId,m=E.getSignedInUser(),C=P=>{p(P)};if(m==null)throw Error("Can't access reimbursement setup page without signing in...");if(h.useEffect((()=>{g.current||I!=="Not-Started"||b==null?g.current||I!=="Completed"||b==null||d.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(g.current=!0,t(ge(b,!1,!0))):(g.current=!0,t(ge(b,!0)))}),[I,b,t]),h.useEffect((()=>{S||y!=="Not-Started"||v||(_(!0),t(bn(!0,!1,!1,f)))}),[S,y,v,f,t]),d.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1)return u.jsx(R,{to:"../promo"});if(d.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!0){const P=T=>T.trackPageLoaded($.Event.reimbursementSetup);return u.jsxs(It,{children:[u.jsx(se,{analytics:D,onLoad:T=>P(T)}),u.jsx(le,{isAppContentDrawerOpen:c,handleDrawerToggle:C}),u.jsx(At,{navigate:o,location:a,companyId:b,currentTenant:d,isUserRemiAdmin:l,meetingUrl:e("reimbursement_setup"),onClickMenuIcon:()=>{C(!0)},hasZeniAccountsAdminAccess:s})]})}return u.jsx(Te,{fetchState:"In-Progress",style:{backgroundColor:i.colors.grey5}})},kt=G((function(e,o){const{businessVerificationDetails:a,productType:t}=o,r=x(e),n=E.getSignedInUser(),i=r.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=On(o.roleMap)&&a.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",c=Un(e.companyConfigState),p=wn(e.userRoleConfigState),g=t==="zeni_treasury"?Ke(e):void 0;return{businessVerificationDetails:a,verficationDetailsFetchState:a.fetchState,isRefreshingViewInBackground:a.isRefreshingViewInBackground,allNationalityCountries:a.allNationalityCountries,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:s,allIndustries:c.companyIndustries??[],companyTitles:p.companyTitles,transferDetails:g}}),(function(e,o){const{companyId:a,productType:t,currentTenant:r,navigate:n,location:i}=o,{tenantEmailDomain:l}=r;return{onCompanyDetailsChanged:s=>{const{companyDescription:c,companyIndustry:p,companyIndustryType:g,companyLegalName:S,companyTaxId:_,companyWebsite:I,companyPhone:d,primaryContactEmail:y,primaryContactName:f,primaryContactUserId:v,primaryContactSyncToken:b,syncToken:m,fileIds:C,incDate:P,typeOfIncorporation:T,stateOfIncorporation:O,sourceOfFunds:A,companySubIndustry:U,countriesOfOperations:B,companySourceOfFunds:z,companySourceOfFundsDescription:F,transactionVolume:ce,transactionVolumeDescription:H,purposeOfAccount:q,purposeOfAccountDescription:re,regulatedStatus:Z,regulatedStatusDescription:j,usNexus:w,usNexusTypes:De}=s,pe=g?.selectedOption,me={companyId:a,companyDescription:c,companyIndustry:p.selectedOption,companyIndustryType:pe==null||pe===""?void 0:pe,companyLegalName:S,taxIdOrEIN:_,website:I!=""&&I!=null?Nn(I):void 0,phone:d,syncToken:m,fileIds:C,incDate:P!=null?Re(P?.toString()):P,typeOfIncorporation:T?.selectedOption??"",stateOfIncorporation:O?.selectedOption??"",sourceOfFunds:A?.selectedOption??"",companySubIndustry:U?.selectedOption??"",countriesOfOperations:B?.selectedOptions.map((ue=>ue.length===2?ue:ze(ue)))??[],companySourceOfFunds:z?.selectedOption??"",companySourceOfFundsDescription:F,transactionVolume:ce?.selectedOption??"",transactionVolumeDescription:H,purposeOfAccount:q?.selectedOption??"",purposeOfAccountDescription:re,regulatedStatus:Z??"",regulatedStatusDescription:j,usNexus:w,usNexusTypes:De?.selectedOptions??[]},ye={userId:v,firstName:f.firstName,lastName:f.lastName,email:y,syncToken:b};e(Ne({companyDetails:me,primaryContactDetails:ye}))},onCompanyOfficerUpdated:s=>{const c=s.map((p=>{const{officerType:g,userId:S,name:_,email:I,nationalityCountryCode:d,ssn:y,dob:f,phone:v,syncToken:b,selectDocument:m,role:C,ownership:P,isSelectedForVerification:T,userVerificationStatus:O,treasuryUserVerificationStatus:A,fileIds:U}=p;let B;return m.selectDocumentType==="driverLicense"?B="driving_license":m.selectDocumentType==="passport"?B="passport":m.selectDocumentType==="stateId"?B="id_document":m.selectDocumentType==="ssnCard"&&(B="social_security_card"),{officerType:g,userId:S,firstName:_.firstName,lastName:_.lastName,email:I,ssn:y,nationalityCountryCode:d?.selectedOption!=null?ze(d.selectedOption):void 0,phone:v,birthday:f!=null?Re(f?.toString()):f,syncToken:b,titleAtCompany:C.selectedOption,ownershipInCompany:P,documentTypeSelectedForVerification:B,isSelectedForVerification:T,userVerificationStatus:O,treasuryUserVerificationStatus:A,fileIds:U,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}}));e(Ne({officers:c}))},onSaveDetailsClick:s=>{e(L(a,s,t))},onSendForVerificationClick:s=>{e(L(a,s,t,!0))},onAddressClick:s=>{const c=We(l,s),p=Me(i.state?.pathnameStackToGoBack,i.pathname),g=new URLSearchParams(i.search),S={};g.forEach(((_,I)=>{S[I]=_})),n(c,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(S).length>0?S:void 0}})},onRegisteredAddressClick:s=>{const c=We(l,s),p=Me(i.state?.pathnameStackToGoBack,i.pathname),g=new URLSearchParams(i.search),S=Object.fromEntries(g.entries());n(c,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(S).length>0?S:void 0}})},onBackClick:()=>{e(Rn({companyId:a})),n("../setup")},updateFilesEntity:s=>{e(ae({files:s}))},onDeleteFile:s=>{e(te(s))},onDeleteFileList:s=>{e(Xe(s))},onEditFileName:(s,c)=>{e(ne(s,c.split(".")[0]))},onGetOtp:s=>{e(qe(s,"SpendManagementSetup"))},onResendOtp:s=>{e(He(s,"SpendManagementSetup"))},onVerifyOtp:(s,c)=>{e(Ge(s,c,"SpendManagementSetup"))},saveNewAddressInLocalStore:(s,c)=>{e(jn({addressType:s,addressToCreate:c}))},onExecuteTreasuryTransfer:()=>{e(Ye())},onOverlayClose:()=>{e(Ue())},onIdentityDocumentUploadedForAutofill:s=>{if(a==null)return;const c=Vn(s.documentType);c!=null&&e(Bn({target:"setup",companyId:a,officerType:s.officerType,fileId:s.fileId,documentType:c}))},onCompanyDocumentUploadedForAutofill:s=>{a!=null&&e(xn({target:"setup",companyId:a,fileId:s.fileId,documentType:s.documentType}))},onResetKycKybClick:()=>{e(Fn())}}}))(at),vt=({productType:e,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:a})=>{const t=X(),r=Q(),n=ee(),[i]=en(),l=i.get("showStepProgress"),s=i.get("isTransferInitiated"),[c,p]=h.useState(!1),{tenantEmailDomain:g}=W(),S=ie(),{useDynamicConfig:_}=de(),I=Ee(),{configValue:d}=_(xe.zeniAccountsConfig),y=je(d),f=k((A=>{switch(e){case"zeni_accounts":return A.zeniAccountSetupViewState.fetchState;case"reimbursement":return A.remiSetupViewState.fetchState;case"charge_cards":return A.chargeCardSetupViewState.fetchState;case"zeni_treasury":return A.treasurySetupViewState.fetchState;default:return A.billPaySetupViewState.fetchState}})),v=k((A=>A.companyConfigState.fetchState)),b=k((A=>A.userRoleConfigState.fetchState)),m=k((A=>x(A))),C=m.companyId??E.getSignedInUserTenant(g)?.companyId;h.useEffect((()=>{v==="Not-Started"&&n(_n()),b==="Not-Started"&&n(kn(!0))}),[v,b,n]),h.useEffect((()=>{c||f!=="Not-Started"||C==null||(p(!0),Ze(n,e,C))}),[c,f,C,n]);const P=k((A=>{let U;switch(e){case"zeni_accounts":U=En(A,C);break;case"zeni_treasury":U=Je(A,C);break;case"charge_cards":U=Tn(A,C);break;case"reimbursement":U=Pn(A,C);break;default:U=vn(A,C)}return U})),T=P.kycKybResetStatus.fetchState;if(h.useEffect((()=>{T==="Completed"&&C!=null&&(Ze(n,e,C,!0),n(Dn()))}),[T,C,e,n]),E.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let O;switch(e){case"zeni_accounts":O=m.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":O=m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":O=m.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||m.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":O=m.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:O=m.companyBillPayInfo?.info?.isBillPayTOSAccepted}return O===!1?null:P.fetchState==="Completed"&&O===!0&&S?.loggedInUserRoleMap!=null?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:A=>(U=>{switch(e){case"zeni_accounts":return U.trackPageLoaded($.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return U.trackPageLoaded($.Event.reimbursementBusinessVerification);default:return U.trackPageLoaded($.Event.billPayBusinessVerification,Be(r)?"Settings":void 0)}})(A)}),u.jsx(kt,{businessVerificationDetails:P,navigate:t,location:r,companyId:C,analytics:D,currentTenant:m,productType:e,roleMap:S.loggedInUserRoleMap,isSettings:Be(r),isOverlay:!0,isStepInProgress:l!=null,isTreasuryTransferInitiated:s!=null,onClickMenuIcon:()=>{},maxInsuredAmount:y.maxInsuredAmount,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:a})]}):u.jsx(Te,{fetchState:"In-Progress",style:{backgroundColor:I.colors.grey5}})},Pt={overlayWidth:new st(100,100,59)},Tt=G((function(e,o){const{isUserZeniAccountsAdmin:a,companyId:t}=o,r=x(e),n=E.getSignedInUser(),i=r.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Qe(e,t),c=Je(e,t),p=a&&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",g=Zn(e),S=g.transactions,_=Ke(e),I=g.accountSummary?.totalBalance?.amount,d=S.length===0||I===0;return{treasurySetupView:s,businessVerificationDetails:c,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",transactions:S,transferDetails:_,isFirstTransfer:d,isDisabled:p,analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l,isOnSetup:!0,maxInsuredAmount:o.maxInsuredAmount}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r,isAllocationDone:n,analytics:i,treasurySetupView:l}=o;return{onTransferSaveChangesToLocalStore:s=>{e(Gn(s))},onBusinessVerificationSectionClick:(s,c)=>{let p="../verification";s&&(p+="?showStepProgress=true",c&&(p+="&isTransferInitiated=true")),a(p),r?.company?.companyTreasuryInfo!=null&&r?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="pending_review"&&e(we(t,!1,!0))},onFetchLinkTokenClick:(s,c)=>{e(ve("treasury_setup",s,c))},onEstablishConnectionClick:s=>{e(ke(s,t,"treasury_setup","zeni_treasury"))},onUpdatePaymentAccountStatus:(s,c,p)=>{e(_e(s,c,"zeni_treasury","treasury_setup",p))},onUpdatePaymentAccountLoginStatus:(s,c)=>{e(Ae(!1,s,"zeni_treasury","treasury_setup",c))},onEstablishConnectionSuccess:()=>{e(we(t,!0))},onEnableTreasuryClick:()=>{e(Y(t,"zeni_treasury"))},onUpdateTreasuryClick:(s,c,p)=>{e(p==="paymentAccount"?he(s,c,"zeni_treasury","treasury_setup"):Ie("treasury_setup",s,c))},onUpdatePrimaryFundingAccount:(s,c)=>{e(Ce(t,"treasury_setup",s,c))},onNavigateToDashboard:()=>{a(r?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="verified"?"../":"../../")},onCompanyOfficerUpdated:(s,c)=>{e(be({officerType:s,fileIds:c}))},onSendForVerificationClick:(s,c)=>{if(e(L(t,s,"zeni_treasury",!0,!0,!0)),!n){const p=l.fundAllocationLocalData;i.trackTreasuryPortfolioConfirm(p.riskScore,$e(p)),e(Le(!1))}c===!0&&e(Ye())},updateFilesEntity:s=>{e(ae({files:s}))},onDeleteFile:s=>{e(te(s))},onEditFileName:(s,c)=>{e(ne(s,c.split(".")[0]))},onAdditionalVerificationFieldsChanged:s=>{const{sourceOfFunds:c}=s;e(Wn({sourceOfFunds:c?.selectedOption??""}))},onUpdateFundAllocation:s=>{i.trackTreasuryAllocationAction("update",$e(s)),e($n(s))},onConfirmFundAllocation:()=>{e(Le(n))},onOverlayClose:()=>{e(Ue())}}}))(ot),Et=()=>{const e=Pe(),o=X(),a=Q(),t=ee(),r=Ee(),n=it(),{tenantEmailDomain:i}=W(),{useDynamicConfig:l}=de(),s=ie(),[c,p]=h.useState(!1),g=Fe(s?.loggedInUserRoleMap),{configValue:S}=l(xe.zeniAccountsConfig),_=je(S),[I,d]=h.useState(!1),[y,f]=h.useState(!1),[v,b]=h.useState(!1),[m,C]=h.useState(!1),[P,T]=h.useState(!1),O=k((w=>w.treasurySetupViewState.fetchState)),A=k((w=>w.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),U=k((w=>w.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),B=k((w=>w.treasuryDetailState.transactionsState?.fetchState)),z=k((w=>x(w))),F=E.getSignedInUserTenant(i)?.companyId??z.companyId,ce=k((w=>Qe(w,F))),H=ce.isAtomicAccountExists,q=E.getSignedInUser(),re=w=>{d(w)};if(q==null)throw Error("Can't access treasury setup page without signing in...");h.useEffect((()=>{y||O!=="Not-Started"||F==null||(f(!0),t(we(F,!0,!1)))}),[y,O,F,t]),h.useEffect((()=>{v||A!=="Not-Started"||F==null||(b(!0),t(Ln()))}),[v,A,F,t]),h.useEffect((()=>{m||U!=="Not-Started"||F==null||(C(!0),t(Mn()))}),[m,U,F,t]),h.useEffect((()=>{P||B!=="Not-Started"||F==null||(T(!0),t(zn(!0)))}),[P,B,F,t]);const Z=z.companyTreasuryInfo?.info?.businessVerificationStatus?.code,j=Z==="pending_review"||Z==="verified";return h.useEffect((()=>{c||O!=="Completed"||H||j||!a.pathname.includes("setup")||p(!0)}),[O,H,j]),z.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1?u.jsx(R,{to:"../promo"}):u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:()=>{}}),u.jsx(le,{isAppContentDrawerOpen:I,handleDrawerToggle:re}),u.jsx(dt,{onClose:()=>{t(Ue()),o("../setup")},anchor:"right",open:a.pathname.includes("verification"),transitionDuration:c?0:250,PaperProps:{style:{width:Pt.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:c?"transparent":r.colors.black,opacity:.75,cursor:"pointer"}}},children:u.jsx(Dt,{onClick:w=>w.stopPropagation(),children:u.jsx(vt,{productType:"zeni_treasury",isBusinessVerificationDrawerOpen:!0,closeDrawerHandler:()=>{t(Ue()),o("../setup")}})})}),u.jsx(Tt,{navigate:o,location:a,companyId:F,currentTenant:z,isUserZeniAccountsAdmin:g,meetingUrl:e("treasury_setup"),maxInsuredAmount:_.maxInsuredAmount,isAllocationDone:H,analytics:D,treasurySetupView:ce,onClickMenuIcon:()=>{re(!0)},showTreasurySetupOverlay:c,setShowTreasurySetupOverlay:p})]})},Dt=Ve(lt)`
|
|
17
|
+
`,At=G((function(e,o){const{isUserRemiAdmin:a,companyId:t}=o,r=V(e),n=Cn(e),i=hn(e,t),l=E.getSignedInUser(),s=r.tenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""};return{remiSetupView:i,isDisabled:a&&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",remiApprovalView:n,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:c}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r}=o;return{updateMileageDetails:n=>{const{mileageAmount:i,mileageUnit:l,mileageCurrencyCode:s,mileageCurrencySymbol:c,denomination:p,denominationSymbol:g,mileageAmountInDenomination:S,description:_}=n;e(An({mileageDetails:{mileageUnitAmount:{amount:i,currencyCode:s,currencySymbol:c},denomination:p,denominationSymbol:g,mileageAmountInDenomination:S,mileageCurrencyCode:s,mileageCurrencySymbol:c,mileageUnit:l,description:_}}))},onSaveMileageClick:n=>{e(In(t)),D.trackReimbursementMileageRateSave(n)},onBusinessVerificationSectionClick:()=>{a("../verification"),r?.company?.companyReimbursementInfo!=null&&r?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(ge(t,!1,!0))},onSetupApprovalRulesSectionClick:()=>{a("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(ve("reimbursement_setup",n,i))},onEstablishConnectionClick:n=>{e(ke(n,t,"reimbursement_setup","reimbursement"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(_e(n,i,"reimbursement","reimbursement_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Ae(!1,n,"reimbursement","reimbursement_setup",i))},onEstablishConnectionSuccess:()=>{e(ge(t,!0))},onEnableRemiClick:()=>{e(Y(t,"reimbursement"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?he(n,i,"reimbursement","reimbursement_setup"):Ie("reimbursement_setup",n,i))},onEnableRemiSuccess:()=>{a("../",{relative:"path"})},onBackClick:()=>{r?.companyReimbursementInfo?.info?.isReimbursementEnabled!=null&&r.companyReimbursementInfo.info.isReimbursementEnabled===!1?a("../.."):a("../",{relative:"path"})},onCompanyOfficerUpdated:(n,i)=>{e(be({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(L(t,n,"reimbursement",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(n,i.split(".")[0]))},onUpdatePrimaryFundingAccount:(n,i)=>{e(Ce(t,"reimbursement_setup",n,i))}}}))(tt),_t=()=>{const e=Pe(),o=X(),a=Q(),t=ee(),{tenantEmailDomain:r}=W(),n=ie(),i=Ee(),l=Sn(n?.loggedInUserRoleMap),s=Fe(n?.loggedInUserRoleMap),[c,p]=h.useState(!1),g=h.useRef(!1),[S,_]=h.useState(!1),I=k((P=>P.remiSetupViewState.fetchState)),d=k((P=>V(P))),y=k((P=>P.remiSetupApproverViewState.fetchState)),{isApprovalRulesV3Enabled:f,isLoading:v}=nt(d?.tenantId),b=E.getSignedInUserTenant(r)?.companyId??d.companyId,m=E.getSignedInUser(),C=P=>{p(P)};if(m==null)throw Error("Can't access reimbursement setup page without signing in...");if(h.useEffect((()=>{g.current||I!=="Not-Started"||b==null?g.current||I!=="Completed"||b==null||d.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(g.current=!0,t(ge(b,!1,!0))):(g.current=!0,t(ge(b,!0)))}),[I,b,t]),h.useEffect((()=>{S||y!=="Not-Started"||v||(_(!0),t(bn(!0,!1,!1,f)))}),[S,y,v,f,t]),d.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1)return u.jsx(R,{to:"../promo"});if(d.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!0){const P=T=>T.trackPageLoaded($.Event.reimbursementSetup);return u.jsxs(It,{children:[u.jsx(se,{analytics:D,onLoad:T=>P(T)}),u.jsx(le,{isAppContentDrawerOpen:c,handleDrawerToggle:C}),u.jsx(At,{navigate:o,location:a,companyId:b,currentTenant:d,isUserRemiAdmin:l,meetingUrl:e("reimbursement_setup"),onClickMenuIcon:()=>{C(!0)},hasZeniAccountsAdminAccess:s})]})}return u.jsx(Te,{fetchState:"In-Progress",style:{backgroundColor:i.colors.grey5}})},kt=G((function(e,o){const{businessVerificationDetails:a,productType:t}=o,r=V(e),n=E.getSignedInUser(),i=r.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=On(o.roleMap)&&a.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",c=Un(e.companyConfigState),p=wn(e.userRoleConfigState),g=t==="zeni_treasury"?Je(e):void 0;return{businessVerificationDetails:a,verficationDetailsFetchState:a.fetchState,isRefreshingViewInBackground:a.isRefreshingViewInBackground,allNationalityCountries:a.allNationalityCountries,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:s,allIndustries:c.companyIndustries??[],companyTitles:p.companyTitles,transferDetails:g}}),(function(e,o){const{companyId:a,productType:t,currentTenant:r,navigate:n,location:i}=o,{tenantEmailDomain:l}=r;return{onCompanyDetailsChanged:s=>{const{companyDescription:c,companyIndustry:p,companyIndustryType:g,companyLegalName:S,companyTaxId:_,companyWebsite:I,companyPhone:d,primaryContactEmail:y,primaryContactName:f,primaryContactUserId:v,primaryContactSyncToken:b,syncToken:m,fileIds:C,incDate:P,typeOfIncorporation:T,stateOfIncorporation:O,sourceOfFunds:A,companySubIndustry:U,countriesOfOperations:B,companySourceOfFunds:z,companySourceOfFundsDescription:F,transactionVolume:ce,transactionVolumeDescription:H,purposeOfAccount:q,purposeOfAccountDescription:re,regulatedStatus:Z,regulatedStatusDescription:j,usNexus:w,usNexusTypes:De}=s,pe=g?.selectedOption,me={companyId:a,companyDescription:c,companyIndustry:p.selectedOption,companyIndustryType:pe==null||pe===""?void 0:pe,companyLegalName:S,taxIdOrEIN:_,website:I!=""&&I!=null?Nn(I):void 0,phone:d,syncToken:m,fileIds:C,incDate:P!=null?Re(P?.toString()):P,typeOfIncorporation:T?.selectedOption??"",stateOfIncorporation:O?.selectedOption??"",sourceOfFunds:A?.selectedOption??"",companySubIndustry:U?.selectedOption??"",countriesOfOperations:B?.selectedOptions.map((ue=>ue.length===2?ue:ze(ue)))??[],companySourceOfFunds:z?.selectedOption??"",companySourceOfFundsDescription:F,transactionVolume:ce?.selectedOption??"",transactionVolumeDescription:H,purposeOfAccount:q?.selectedOption??"",purposeOfAccountDescription:re,regulatedStatus:Z??"",regulatedStatusDescription:j,usNexus:w,usNexusTypes:De?.selectedOptions??[]},ye={userId:v,firstName:f.firstName,lastName:f.lastName,email:y,syncToken:b};e(Ne({companyDetails:me,primaryContactDetails:ye}))},onCompanyOfficerUpdated:s=>{const c=s.map((p=>{const{officerType:g,userId:S,name:_,email:I,nationalityCountryCode:d,ssn:y,dob:f,phone:v,syncToken:b,selectDocument:m,role:C,ownership:P,isSelectedForVerification:T,userVerificationStatus:O,treasuryUserVerificationStatus:A,fileIds:U}=p;let B;return m.selectDocumentType==="driverLicense"?B="driving_license":m.selectDocumentType==="passport"?B="passport":m.selectDocumentType==="stateId"?B="id_document":m.selectDocumentType==="ssnCard"&&(B="social_security_card"),{officerType:g,userId:S,firstName:_.firstName,lastName:_.lastName,email:I,ssn:y,nationalityCountryCode:d?.selectedOption!=null?ze(d.selectedOption):void 0,phone:v,birthday:f!=null?Re(f?.toString()):f,syncToken:b,titleAtCompany:C.selectedOption,ownershipInCompany:P,documentTypeSelectedForVerification:B,isSelectedForVerification:T,userVerificationStatus:O,treasuryUserVerificationStatus:A,fileIds:U,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}}));e(Ne({officers:c}))},onSaveDetailsClick:s=>{e(L(a,s,t))},onSendForVerificationClick:s=>{e(L(a,s,t,!0))},onAddressClick:s=>{const c=We(l,s),p=Me(i.state?.pathnameStackToGoBack,i.pathname),g=new URLSearchParams(i.search),S={};g.forEach(((_,I)=>{S[I]=_})),n(c,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(S).length>0?S:void 0}})},onRegisteredAddressClick:s=>{const c=We(l,s),p=Me(i.state?.pathnameStackToGoBack,i.pathname),g=new URLSearchParams(i.search),S=Object.fromEntries(g.entries());n(c,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(S).length>0?S:void 0}})},onBackClick:()=>{e(Rn({companyId:a})),n("../setup")},updateFilesEntity:s=>{e(ae({files:s}))},onDeleteFile:s=>{e(te(s))},onDeleteFileList:s=>{e(Xe(s))},onEditFileName:(s,c)=>{e(ne(s,c.split(".")[0]))},onGetOtp:s=>{e(qe(s,"SpendManagementSetup"))},onResendOtp:s=>{e(He(s,"SpendManagementSetup"))},onVerifyOtp:(s,c)=>{e(Ge(s,c,"SpendManagementSetup"))},saveNewAddressInLocalStore:(s,c)=>{e(jn({addressType:s,addressToCreate:c}))},onExecuteTreasuryTransfer:()=>{e(Ye())},onOverlayClose:()=>{e(Ue())},onIdentityDocumentUploadedForAutofill:s=>{if(a==null)return;const c=xn(s.documentType);c!=null&&e(Bn({target:"setup",companyId:a,officerType:s.officerType,fileId:s.fileId,documentType:c}))},onCompanyDocumentUploadedForAutofill:s=>{a!=null&&e(Vn({target:"setup",companyId:a,fileId:s.fileId,documentType:s.documentType}))},onResetKycKybClick:()=>{e(Fn())}}}))(at),vt=({productType:e,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:a})=>{const t=X(),r=Q(),n=ee(),[i]=en(),l=i.get("showStepProgress"),s=i.get("isTransferInitiated"),[c,p]=h.useState(!1),{tenantEmailDomain:g}=W(),S=ie(),{useDynamicConfig:_}=de(),I=Ee(),{configValue:d}=_(Ve.zeniAccountsConfig),y=je(d),f=k((A=>{switch(e){case"zeni_accounts":return A.zeniAccountSetupViewState.fetchState;case"reimbursement":return A.remiSetupViewState.fetchState;case"charge_cards":return A.chargeCardSetupViewState.fetchState;case"zeni_treasury":return A.treasurySetupViewState.fetchState;default:return A.billPaySetupViewState.fetchState}})),v=k((A=>A.companyConfigState.fetchState)),b=k((A=>A.userRoleConfigState.fetchState)),m=k((A=>V(A))),C=m.companyId??E.getSignedInUserTenant(g)?.companyId;h.useEffect((()=>{v==="Not-Started"&&n(_n()),b==="Not-Started"&&n(kn(!0))}),[v,b,n]),h.useEffect((()=>{c||f!=="Not-Started"||C==null||(p(!0),Ze(n,e,C))}),[c,f,C,n]);const P=k((A=>{let U;switch(e){case"zeni_accounts":U=En(A,C);break;case"zeni_treasury":U=Ke(A,C);break;case"charge_cards":U=Tn(A,C);break;case"reimbursement":U=Pn(A,C);break;default:U=vn(A,C)}return U})),T=P.kycKybResetStatus.fetchState;if(h.useEffect((()=>{T==="Completed"&&C!=null&&(Ze(n,e,C,!0),n(Dn()))}),[T,C,e,n]),E.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let O;switch(e){case"zeni_accounts":O=m.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":O=m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":O=m.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||m.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":O=m.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:O=m.companyBillPayInfo?.info?.isBillPayTOSAccepted}return O===!1?null:P.fetchState==="Completed"&&O===!0&&S?.loggedInUserRoleMap!=null?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:A=>(U=>{switch(e){case"zeni_accounts":return U.trackPageLoaded($.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return U.trackPageLoaded($.Event.reimbursementBusinessVerification);default:return U.trackPageLoaded($.Event.billPayBusinessVerification,Be(r)?"Settings":void 0)}})(A)}),u.jsx(kt,{businessVerificationDetails:P,navigate:t,location:r,companyId:C,analytics:D,currentTenant:m,productType:e,roleMap:S.loggedInUserRoleMap,isSettings:Be(r),isOverlay:!0,isStepInProgress:l!=null,isTreasuryTransferInitiated:s!=null,onClickMenuIcon:()=>{},maxInsuredAmount:y.maxInsuredAmount,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:a})]}):u.jsx(Te,{fetchState:"In-Progress",style:{backgroundColor:I.colors.grey5}})},Pt={overlayWidth:new st(100,100,59)},Tt=G((function(e,o){const{isUserZeniAccountsAdmin:a,companyId:t}=o,r=V(e),n=E.getSignedInUser(),i=r.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Qe(e,t),c=Ke(e,t),p=a&&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",g=Zn(e),S=g.transactions,_=Je(e),I=g.accountSummary?.totalBalance?.amount,d=S.length===0||I===0;return{treasurySetupView:s,businessVerificationDetails:c,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",transactions:S,transferDetails:_,isFirstTransfer:d,isDisabled:p,analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l,isOnSetup:!0,maxInsuredAmount:o.maxInsuredAmount}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r,isAllocationDone:n,analytics:i,treasurySetupView:l}=o;return{onTransferSaveChangesToLocalStore:s=>{e(Gn(s))},onBusinessVerificationSectionClick:(s,c)=>{let p="../verification";s&&(p+="?showStepProgress=true",c&&(p+="&isTransferInitiated=true")),a(p),r?.company?.companyTreasuryInfo!=null&&r?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="pending_review"&&e(we(t,!1,!0))},onFetchLinkTokenClick:(s,c)=>{e(ve("treasury_setup",s,c))},onEstablishConnectionClick:s=>{e(ke(s,t,"treasury_setup","zeni_treasury"))},onUpdatePaymentAccountStatus:(s,c,p)=>{e(_e(s,c,"zeni_treasury","treasury_setup",p))},onUpdatePaymentAccountLoginStatus:(s,c)=>{e(Ae(!1,s,"zeni_treasury","treasury_setup",c))},onEstablishConnectionSuccess:()=>{e(we(t,!0))},onEnableTreasuryClick:()=>{e(Y(t,"zeni_treasury"))},onUpdateTreasuryClick:(s,c,p)=>{e(p==="paymentAccount"?he(s,c,"zeni_treasury","treasury_setup"):Ie("treasury_setup",s,c))},onUpdatePrimaryFundingAccount:(s,c)=>{e(Ce(t,"treasury_setup",s,c))},onNavigateToDashboard:()=>{a(r?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="verified"?"../":"../../")},onCompanyOfficerUpdated:(s,c)=>{e(be({officerType:s,fileIds:c}))},onSendForVerificationClick:(s,c)=>{if(e(L(t,s,"zeni_treasury",!0,!0,!0)),!n){const p=l.fundAllocationLocalData;i.trackTreasuryPortfolioConfirm(p.riskScore,$e(p)),e(Le(!1))}c===!0&&e(Ye())},updateFilesEntity:s=>{e(ae({files:s}))},onDeleteFile:s=>{e(te(s))},onEditFileName:(s,c)=>{e(ne(s,c.split(".")[0]))},onAdditionalVerificationFieldsChanged:s=>{const{sourceOfFunds:c}=s;e(Wn({sourceOfFunds:c?.selectedOption??""}))},onUpdateFundAllocation:s=>{i.trackTreasuryAllocationAction("update",$e(s)),e($n(s))},onConfirmFundAllocation:()=>{e(Le(n))},onOverlayClose:()=>{e(Ue())}}}))(ot),Et=()=>{const e=Pe(),o=X(),a=Q(),t=ee(),r=Ee(),n=it(),{tenantEmailDomain:i}=W(),{useDynamicConfig:l}=de(),s=ie(),[c,p]=h.useState(!1),g=Fe(s?.loggedInUserRoleMap),{configValue:S}=l(Ve.zeniAccountsConfig),_=je(S),[I,d]=h.useState(!1),[y,f]=h.useState(!1),[v,b]=h.useState(!1),[m,C]=h.useState(!1),[P,T]=h.useState(!1),O=k((w=>w.treasurySetupViewState.fetchState)),A=k((w=>w.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),U=k((w=>w.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),B=k((w=>w.treasuryDetailState.transactionsState?.fetchState)),z=k((w=>V(w))),F=E.getSignedInUserTenant(i)?.companyId??z.companyId,ce=k((w=>Qe(w,F))),H=ce.isAtomicAccountExists,q=E.getSignedInUser(),re=w=>{d(w)};if(q==null)throw Error("Can't access treasury setup page without signing in...");h.useEffect((()=>{y||O!=="Not-Started"||F==null||(f(!0),t(we(F,!0,!1)))}),[y,O,F,t]),h.useEffect((()=>{v||A!=="Not-Started"||F==null||(b(!0),t(Ln()))}),[v,A,F,t]),h.useEffect((()=>{m||U!=="Not-Started"||F==null||(C(!0),t(Mn()))}),[m,U,F,t]),h.useEffect((()=>{P||B!=="Not-Started"||F==null||(T(!0),t(zn(!0)))}),[P,B,F,t]);const Z=z.companyTreasuryInfo?.info?.businessVerificationStatus?.code,j=Z==="pending_review"||Z==="verified";return h.useEffect((()=>{c||O!=="Completed"||H||j||!a.pathname.includes("setup")||p(!0)}),[O,H,j]),z.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1?u.jsx(R,{to:"../promo"}):u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:()=>{}}),u.jsx(le,{isAppContentDrawerOpen:I,handleDrawerToggle:re}),u.jsx(dt,{onClose:()=>{t(Ue()),o("../setup")},anchor:"right",open:a.pathname.includes("verification"),transitionDuration:c?0:250,PaperProps:{style:{width:Pt.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:c?"transparent":r.colors.black,opacity:.75,cursor:"pointer"}}},children:u.jsx(Dt,{onClick:w=>w.stopPropagation(),children:u.jsx(vt,{productType:"zeni_treasury",isBusinessVerificationDrawerOpen:!0,closeDrawerHandler:()=>{t(Ue()),o("../setup")}})})}),u.jsx(Tt,{navigate:o,location:a,companyId:F,currentTenant:z,isUserZeniAccountsAdmin:g,meetingUrl:e("treasury_setup"),maxInsuredAmount:_.maxInsuredAmount,isAllocationDone:H,analytics:D,treasurySetupView:ce,onClickMenuIcon:()=>{re(!0)},showTreasurySetupOverlay:c,setShowTreasurySetupOverlay:p})]})},Dt=xe(lt)`
|
|
18
18
|
display: flex;
|
|
19
19
|
min-height: 100%;
|
|
20
20
|
flex-direction: column;
|
|
21
|
-
`,Ot=G((function(e,o){const{isUserZeniAccountsAdmin:a,companyId:t}=o,r=
|
|
21
|
+
`,Ot=G((function(e,o){const{isUserZeniAccountsAdmin:a,companyId:t}=o,r=V(e),n=E.getSignedInUser(),i=r.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Hn(e,t),c=a&&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:r.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:c,analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r}=o;return{onBusinessVerificationSectionClick:()=>{a("../verification"),r?.company?.companyZeniAccountInfo!=null&&r?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(Se(t,!1,!0))},onFetchLinkTokenClick:(n,i)=>{e(ve("account_setup",n,i))},onEstablishConnectionClick:n=>{e(ke(n,t,"account_setup","zeni_accounts"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(_e(n,i,"zeni_accounts","account_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Ae(!1,n,"zeni_accounts","account_setup",i))},onEstablishConnectionSuccess:()=>{e(Se(t,!0))},onEnableZeniAccountClick:()=>{e(Y(t,"zeni_accounts"))},onUpdateZeniAccountClick:(n,i,l)=>{e(l==="paymentAccount"?he(n,i,"zeni_accounts","account_setup"):Ie("account_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(Ce(t,"account_setup",n,i))},onEnableZeniAccountSuccess:()=>{a("../",{relative:"path"})},onBackClick:()=>{r?.companyZeniAccountInfo?.info?.isZeniAccountEnabled?a("../"):a("../../")},onNavigateToDashboard:()=>{a("../../dashboard")},onCompanyOfficerUpdated:(n,i)=>{e(be({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(L(t,n,"zeni_accounts",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(n,i.split(".")[0]))}}}))(ct),Ut=()=>{const e=Pe(),o=X(),a=Q(),t=ee(),{tenantEmailDomain:r}=W(),{useDynamicConfig:n}=de(),i=ie(),l=Fe(i?.loggedInUserRoleMap),{configValue:s}=n(Ve.zeniAccountsConfig),c=je(s),[p,g]=h.useState(!1),[S,_]=h.useState(!1),I=k((b=>b.zeniAccountSetupViewState.fetchState)),d=k((b=>V(b))),y=E.getSignedInUserTenant(r)?.companyId??d.companyId,f=E.getSignedInUser(),v=b=>{g(b)};if(f==null)throw Error("Can't access zeni bank account setup page without signing in...");if(h.useEffect((()=>{S||I!=="Not-Started"||y==null?S||I!=="Completed"||y==null||d.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(Se(y,!1,!0)):(_(!0),t(Se(y,!0)))}),[S,I,y,t]),d.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted===!1)return u.jsx(R,{to:"../promo"});{const b=m=>m.trackPageLoaded($.Event.zeniAccountsSetup);return u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:m=>b(m)}),u.jsx(le,{isAppContentDrawerOpen:p,handleDrawerToggle:v}),u.jsx(Ot,{navigate:o,location:a,companyId:y,currentTenant:d,isUserZeniAccountsAdmin:l,accountsPromoConfig:c,meetingUrl:e("zeni_accounts_setup"),onClickMenuIcon:()=>{v(!0)}})]})}},wt=xe.div`
|
|
22
22
|
display: flex;
|
|
23
23
|
height: 100vh;
|
|
24
24
|
width: 100%;
|
|
@@ -26,4 +26,4 @@ import{j as u}from"./liveblocks-CevUFagi.js";import{h as X,g as Q,u as ee,i as W
|
|
|
26
26
|
flex-direction: column;
|
|
27
27
|
align-items: center;
|
|
28
28
|
background-color: ${e=>e.theme.colors.grey4};
|
|
29
|
-
`,Ft=G((function(e,o){const a=
|
|
29
|
+
`,Ft=G((function(e,o){const a=V(e),t=E.getSignedInUser(),r=a.tenantId,n={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:r??""};return{internationalOnboardingDetails:Jn(e),isReadonly:o.isFormReadonly,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:n,analytics:D}}),(function(e,o){const{navigate:a}=o;return{onFormDataChange:t=>{e(Xn(t))},onSubmitClick:()=>{e(Yn(o.companyId))},onCancelClick:()=>{a("../setup")},updateFilesEntity:t=>{e(ae({files:t}))},onDeleteFile:t=>{e(te(t))},onDeleteFileList:t=>{e(Xe(t))},onEditFileName:(t,r)=>{e(ne(t,r.split(".")[0]))}}}))(rt),Vt=()=>{const e=X(),o=Q(),a=ee(),[t,r]=h.useState(!1),[n,i]=h.useState(!1),[l,s]=h.useState(!1),{tenantEmailDomain:c}=W(),p=ie(),{useFeatureGate:g}=de(),{isFeatureEnabled:S}=g(K.isBillPayLocalCurrencyFeatureEnabled),_=k((T=>T.internationalWireVerificationState.verificationFormFetchState.fetchState)),I=k((T=>T.billPaySetupViewState.fetchState)),d=k((T=>V(T))),y=Ee(),f=d.companyId??E.getSignedInUserTenant(c)?.companyId,v=k((T=>qn(T.companyState,d.companyId))),b=v?.company.companyBillPayInfo.internationalWireOnboardingStatus,m=b?.code==="onboarding_status_not_started"?void 0:"readonly";if(h.useEffect((()=>{t||_!=="Not-Started"||f==null||(r(!0),a(Kn(f)))}),[t,_,f,a]),h.useEffect((()=>{n||I!=="Not-Started"||f==null||(i(!0),a(J(f,!0)))}),[I,n,f,a]),E.getSignedInUser()==null)throw Error("Can't access international verification without signing in...");const C=d.companyBillPayInfo?.info?.isBillPayTOSAccepted,P=T=>{s(T)};return C===!1?u.jsx(R,{to:"../promo"}):C===!0&&p?.loggedInUserRoleMap!=null?u.jsxs(wt,{children:[u.jsx(se,{analytics:D,onLoad:T=>(O=>O.trackPageLoaded($.Event.billPayBusinessVerification,void 0))(T)}),Be(o)?u.jsx(le,{isAppContentDrawerOpen:l,handleDrawerToggle:P}):null,u.jsx(Ft,{navigate:e,location:o,companyId:f,analytics:D,currentTenant:d,roleMap:p.loggedInUserRoleMap,isFormReadonly:m,isLocalCurrencyEnabled:S})]}):u.jsx(Te,{fetchState:"In-Progress",style:{backgroundColor:y.colors.grey5}})},xt=G((function(){return{}}),(function(e,o){const{companyId:a,productType:t}=o;return{onEventReceived:r=>{switch(r){case"bill-pay-set-up-verification-update":case"bill-pay-wise-setup":switch(t){case"reimbursement":e(ge(a,!0,!0));break;case"zeni_accounts":e(Se(a,!0,!0));break;case"charge_cards":e(fe(a,!0,!0));break;case"zeni_treasury":e(we(a,!0,!0));break;default:e(J(a,!0,!0))}}}}}))(ut((e=>{const{isBillPayAdminLevelAccess:o,isUserHasOnlyBillPayAccess:a,isReimbursementAdminLevelAccess:t,isZeniAccountAdminLevelAccess:r,isTreasuryAdminLevelAccess:n,isChargeCardAdminLevelAccess:i,isUserHasOnlyCardAccess:l,productType:s,type:c}=e;switch(s){case"bill_pay":switch(c){case"verification":return o?u.jsx(Oe,{productType:s}):a?u.jsx(R,{to:"../"}):u.jsx(N,{});case"international-wire":return o?u.jsx(Vt,{}):a?u.jsx(R,{to:"../"}):u.jsx(N,{});default:return o?u.jsx(ft,{}):a?u.jsx(R,{to:"../"}):u.jsx(N,{})}case"reimbursement":return c==="verification"?t?u.jsx(Oe,{productType:s}):u.jsx(N,{}):t?u.jsx(_t,{}):u.jsx(N,{});case"zeni_accounts":return c==="verification"?r?u.jsx(Oe,{productType:"zeni_accounts"}):u.jsx(N,{}):r?u.jsx(Ut,{}):u.jsx(N,{});case"zeni_treasury":return n===!0?u.jsx(Et,{}):u.jsx(N,{});case"charge_cards":return c==="verification"?i?u.jsx(Oe,{productType:"charge_cards"}):l?u.jsx(R,{to:"../"}):u.jsx(N,{}):i?u.jsx(ht,{}):l?u.jsx(R,{to:"../"}):u.jsx(N,{})}})));function ua(e){const{tenantEmailDomain:o}=W(),a=k((r=>V(r))).companyId??E.getSignedInUserTenant(o)?.companyId,t={events:a!=null?[`private-encrypted-${a}.bill-pay-set-up-verification-update`,`private-encrypted-${a}.bill-pay-wise-setup`]:[],eventCallback:(r,n,i)=>{i.onEventReceived(r)}};if(E.getSignedInUser()==null)throw Error("Can't access setup details page without signing in...");return u.jsx(xt,{...e,companyId:a,...t})}export{ia as A,sa as P,ua as S,na as a,aa as b,St as c,bt as d,gt as e,oa as f,Yt as g,qt as h,ea as i,ta as j,ca as k,Qt as l,Xt as m,Kt as n,Jt as o,Ht as p,ra as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as f}from"./liveblocks-
|
|
1
|
+
import{j as f}from"./liveblocks-oxGmLiGE.js";import{a as u,R as b,t as A}from"./sentry-CYolppN9.js";import{u as z,h as D,j as d,g as M,N as O,l as V}from"./core-k1hJbZ6L.js";import{u as j,z as s,k as E,G as F,N as P,O as N,S as _,R as B,T as R,W as v}from"./index-Cjqi6Pkt.js";import{fI as W,UK as $,V2 as J,gl as K,gn as Y,V7 as G,gY as H,dl as q,V8 as U,V9 as Q,Va as X,c1 as y}from"./zeni-epic-state-C2CKsxzr.js";import{u as Z}from"./mui-D8QuRJEy.js";import{u as ee}from"./useDeviceId-BqvO5dq-.js";import{f as te}from"./analyticsHelper-w2YkQjq1.js";import{t as ne}from"./getLocaleForTenant-Bok1bQNl.js";import"./recharts-DZG9umMy.js";import"./analytics-BSYXJeF4.js";import"./plaid-CbZCK8Pe.js";import"./dnd-CiTl8J_b.js";import"./stripe-cKAAJElX.js";import"./lottie-DXQhXtqa.js";import"./lexical-YTMAFU1j.js";import"./pdf-QcH92u4w.js";import"./utils-CZxvf1-B.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]="9c12789f-46f1-43e6-8418-a30c03200c47",t._sentryDebugIdIdentifier="sentry-dbid-9c12789f-46f1-43e6-8418-a30c03200c47")}catch{}})();const ie=V((function(t,i){const c=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:c,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}}),(function(t,i){const{location:c,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(X({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(l),sourceUri:y(c.state!=null?c.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=c.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(Q(n,a)))},clearSignInError:()=>{t(U())}}}))(R),ae=b.memo(ie);function ve({setTenantEmailDomain:t}){const i=z(),c=D(),{clearAllLoading:g}=j(),n=s.getSignedInUser();u.useLayoutEffect((()=>{g()}),[g]);const a=ee(),l=d((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:k,accountLocked:C,accountUnlockTime:L}=d((e=>e.tenantState)),p=d((e=>e.tenantState.fetchState)),h=d((e=>e.tenantState.activeTenantFetchState.fetchState)),S=d((e=>e.tenantState.signInState)),o=d((e=>e.tenantState.loggedInUser)),r=d((e=>W(e))),I=d((e=>$(e))),m=M(),w=Z().mode,x=m.state?.magicLinkExpired,T=m.state?.magicLinkAlreadyUsed;if(u.useEffect((()=>{k.fetchState==="Completed"&&l!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(l))}),[k.fetchState,l]),u.useEffect((()=>{t(void 0)}),[]),u.useEffect((()=>{S!=="In-Progress"||p!=="Completed"&&h!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(J(I.tenantsInOrder),o.zeniSessionId),K(o.userId,o.zeniSessionId,r.tenantId),i(Y(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(G("Completed")),F.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),H().then((()=>{const e=B();e!=null&&P(e)})),setTimeout((()=>{E.trackLogin(N.Event.loginSuccess,o.authProvider??"google",q(r.productSettings))}),2e3))}),[S,p,h,o,r,I,w,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(O,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!x,magicLinkAlreadyUsed:!!T,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:c,deviceId:a??void 0,showEmailLogin:!0}),C===!0&&L!=null?f.jsx(_,{onClose:()=>i(U()),unlockDate:L}):null]})}export{ve as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-oxGmLiGE.js";import{a as i}from"./sentry-CYolppN9.js";import{u as l,g as d,N as u}from"./core-k1hJbZ6L.js";import{z as n,k as f,O as m,a5 as p}from"./index-Cjqi6Pkt.js";import{g$ as g,Vo as y}from"./zeni-epic-state-C2CKsxzr.js";import{n as h}from"./mui-D8QuRJEy.js";import"./recharts-DZG9umMy.js";import"./analytics-BSYXJeF4.js";import"./plaid-CbZCK8Pe.js";import"./dnd-CiTl8J_b.js";import"./stripe-cKAAJElX.js";import"./lottie-DXQhXtqa.js";import"./lexical-YTMAFU1j.js";import"./pdf-QcH92u4w.js";import"./utils-CZxvf1-B.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]="574f85ef-4f5c-43c4-8ece-23963f12f852",e._sentryDebugIdIdentifier="sentry-dbid-574f85ef-4f5c-43c4-8ece-23963f12f852")}catch{}})();function N(){const e=l(),t=d(),o=i.useRef(!1),a=n.isSignedIn(),r=t.state?.message==="logout"||a;return i.useEffect((()=>{if(r&&!o.current){o.current=!0;try{e(g()),y(),f.trackLogout(m.Event.logoutSuccess),f.resetUserIdentity(),n.clearAll()}catch(c){console.error("Error during sign out:",c)}finally{window.location.replace("/signin/auth")}}}),[r,e]),r?s.jsx(b,{children:s.jsx(p,{fetchState:"In-Progress"})}):s.jsx(u,{to:"../",replace:!0})}const b=h.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{N as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{j as A}from"./liveblocks-oxGmLiGE.js";import{a as u}from"./sentry-CYolppN9.js";import{u as J,k as H,j as G,h as ma,g as Sa,i as ya,l as ba}from"./core-k1hJbZ6L.js";import{z as M,p as Da,d as I,aq as Ea,a6 as ha,k as Ga,O as Ca,e9 as Aa,l as F,a2 as Ia}from"./index-Cjqi6Pkt.js";import{QM as Ra,Rx as va,fI as Ba,a3b as na,gQ as Q,a3c as ra,a36 as La,R1 as X,a3d as Ka,Rd as Y,QO as wa,Qq as Ua,RJ as aa,a3e as ea,gk as Pa,RA as Fa,RF as ja,Rs as xa,Rq as ta,RG as Oa,Rn as $a,a3f as Na,a3g as za,a3h as qa,a3i as Ma,a3j as R,dz as Qa,dy as Za,a3k as Va,QL as Wa}from"./zeni-epic-state-C2CKsxzr.js";import{n as Ja}from"./mui-D8QuRJEy.js";import{u as Ha}from"./useAskAiCfoHostNavButtonProps-BETiKk63.js";import{M as Xa}from"./MobileAppDrawer-D95K9MWM.js";import{u as Ya}from"./useTaskManagerPusherEvents-CULNono8.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="c29b1529-4c33-4656-a00a-ba917221ba5f",a._sentryDebugIdIdentifier="sentry-dbid-c29b1529-4c33-4656-a00a-ba917221ba5f")}catch{}})();const _={TASK_CREATED:"task-created",TASK_UPDATED:"task-updated",TASK_SNOOZE_RESURFACED:"task-snooze-resurfaced",TASKS_BULK_UPDATED:"tasks-bulk-updated",TASKS_BULK_DELETED:"tasks-bulk-deleted"},ae=(a,t)=>a==null||a===""?[]:t.map((n=>`private-encrypted-${a}.${n}`)),ee=(a,t)=>a==null||a===""?[]:t.map((n=>`private-encrypted-${a}.${n}`)),j=a=>Array.isArray(a)&&a.every((t=>typeof t=="string")),oa=a=>typeof a.task_id=="string"?a.task_id:typeof a.id=="string"?a.id:null,ge=a=>{if(a==null||typeof a!="object")return null;const t=a,n=oa(t);if(n==null)return null;const c={task_id:n};return typeof t.parent_task_id=="string"&&(c.parent_task_id=t.parent_task_id),typeof t.sync_token=="string"&&(c.sync_token=t.sync_token),typeof t.is_deleted=="boolean"&&(c.is_deleted=t.is_deleted),typeof t.is_private=="boolean"&&(c.is_private=t.is_private),c},te=a=>{if(a==null||typeof a!="object")return null;const t=a;return j(t.task_ids)?{task_ids:t.task_ids}:null},_e=a=>{if(a==null||typeof a!="object")return null;const t=a;return typeof t.task_id!="string"?null:{task_id:t.task_id}},se=Ja.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: ${a=>a.theme.colors.grey4};
|
|
9
|
+
`,ne=ba((function(a,t){const n=na(a,t.isTaskTemplatesEnabled),{taskGroupId:c}=t,p=c!=null&&c!==""?{...n,taskGroupsWithTasksList:n.taskGroupsWithTasksList.map((e=>({...e,tasks:e.tasks.filter((s=>s.taskGroupIds.includes(c)))}))).filter((e=>e.tasks.length>0))}:n,y=La(a),f=M.isZeniUser(),v=a.taskDetailState?.subTaskCreateStatus?.fetchState;return{taskListView:p,tagListView:y,localData:p.localData,isTaskTemplatesEnabled:t.isTaskTemplatesEnabled,isZeniUser:f,subTaskCreateStatus:v}}),(function(a,t){const{navigate:n,currentTenant:c,location:p,isTaskTemplatesEnabled:y}=t,{tenantEmailDomain:f}=c,{groupByKey:v}=t.uiState;return{onTaskManagementRowClick:e=>{const s=sa(f,e),b=F(p.state?.pathnameStackToGoBack,p.pathname);n(s,{state:{pathnameStackToGoBack:b}})},onReloadTasks:()=>{a(Q(!0,y))},onTabChange:e=>{a(Ma(e))},onParentTaskClick:e=>{const s=sa(f,e);window.open(s,"_blank","noopener")},bulkUpdateTasks:(e,s)=>{a(ta(e,null,s))},onNewTaskClick:()=>{if(t.localData.defaultTaskGroupId!=null){const e=q(f,t.localData.defaultTaskGroupId),s=F(p.state?.pathnameStackToGoBack,p.pathname);n(e,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(e,s)=>{a(ea({uiState:{sortKey:e,sortOrder:s}}))},onFiltersChange:e=>{a(qa({filters:e}))},onSearchTextChanged:e=>{a(za({searchText:e}))},onReloadCards:()=>{a(Q(!0,y))},onBackClick:()=>{if(p.state?.message==="triggerBackClick"){const e=Ia(p.state?.pathnameStackToGoBack),s=e.poppedPathname??"../";n(s,{state:{pathnameStackToGoBack:e.newStack}})}else n("../")},updateLocalData:e=>{a(Na({localData:e}))},resetLocalData:()=>{a(ra({taskGroupById:t.taskGroupState.taskGroupById}))},handleCreateGroup:e=>{a($a(t.localData.newTaskGroupName,e))},assignGroupToTasks:e=>{a(ta(t.localData.selectedTaskIds,e,Oa(t.uiState.groupByKey,e)))},onDeleteTaskGroup:e=>{a(xa(e))},onAddNewTaskToTaskGroup:e=>{if(t.localData.defaultTaskGroupId!=null){const s=oe(v,e);a(X({taskDetailLocalData:s}));const b=q(f,t.uiState.groupByKey==="groupName"?e:t.localData.defaultTaskGroupId),x=F(p.state?.pathnameStackToGoBack,p.pathname);n(b,{state:{pathnameStackToGoBack:x,message:"comingFromTaskListPage"}})}},onDragNDrop:(e,s)=>{a(ja(t.localData.selectedTaskIds.length>0?t.localData.selectedTaskIds:[e],s))},onTaskGroupRename:(e,s)=>{a(Fa(e,s))},onTimeSpentUpdate:(e,s)=>{a(aa({task:e,updates:s}))},onShowToast:e=>{a(Pa(e))},onGroupByFilterChange:e=>{a(ea({uiState:{groupByKey:e}}))},updateTask:(e,s)=>{a(aa({task:e,updates:s}))},onCreateTagClick:(e,s)=>{a(Ua(e,s))},onSubtaskCreation:(e,s)=>{a(wa({...s,parentTaskId:e}))},handleGroupTemplateClick:e=>{a(Y(e,[]))},handleGroupTemplateTaskClick:(e,s)=>{a(Y(e,[s]))},handleNewTaskInitialization:e=>{if(a(X({taskDetailLocalData:{...Ka,name:e}})),t.localData.defaultTaskGroupId!=null){const s=q(f,t.localData.defaultTaskGroupId),b=F(p.state?.pathnameStackToGoBack,p.pathname);n(s,{state:{pathnameStackToGoBack:b,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:e=>{n(`/${f}/tasks/group/${e}`)},onQuickResponsesClick:()=>{n(`/${f}/tasks/quick-responses`)}}}))(Aa);function re(){const a=ma(),t=J(),n=Sa(),c=M.getSignedInUser(),p=M.isZeniUser(),y=H(),f=G((d=>Ba(d))),{taskGroupId:v}=ya(),{useFeatureGate:e}=Da(),{isFeatureEnabled:s}=e(I.isTaskTemplatesEnabled),{isFeatureEnabled:b}=e(I.isTaskCannedResponsesEnabled),{isFeatureEnabled:x}=e(I.isTaskCategorizationEnabled),{isFeatureEnabled:ia}=e(I.isTaskBulkResolutionEnabled),{isFeatureEnabled:la}=e(I.isTaskGroupAssigneesEnabled),{isFeatureEnabled:ua}=e(I.isTaskRecurringParentEnabled),[ca,da]=u.useState(!1),O=G((d=>na(d,s))),$=G((d=>d.taskGroupState)),B=O.fetchState,{isAiCfoAccessEnabled:ka,onAskAiCfoClick:pa}=Ha({mobileExploreReferrer:"Task Checklist"});Ea({isDataReady:B==="Completed"});const{markBoardFetchInFlight:Z,requestTaskRefetch:N}=(function(d){const m=J(),r=H(),T=u.useRef(!1),o=u.useRef(!1),k=u.useRef(!1),g=u.useRef(),l=u.useRef(),S=u.useRef(!1),L=u.useRef(),K=u.useCallback((()=>{L.current=r.getState().taskListState.byTab.live,S.current=!0}),[r]),w=u.useCallback((()=>{K(),m(Ra())}),[m,K]),D=u.useCallback((()=>{g.current=r.getState().taskGroupState.taskGroupById,k.current=!0,m(va())}),[m,r]),E=u.useCallback((()=>{T.current=!1,l.current!=null&&(clearTimeout(l.current),l.current=void 0),w(),k.current||r.getState().taskGroupViewState.fetchState==="In-Progress"?o.current=!0:D()}),[w,D,r]),z=u.useCallback((()=>{S.current?(T.current=!0,l.current==null&&(l.current=setTimeout((()=>{l.current=void 0,T.current&&r.getState().taskListState.fetchState!=="In-Progress"&&(S.current=!1,E())}),6e3))):E()}),[E,r]);u.useEffect((()=>{l.current!=null&&(clearTimeout(l.current),l.current=void 0),T.current=!1,o.current=!1,k.current=!1}),[d]);const h=G((i=>i.taskListState.fetchState)),C=G((i=>i.taskGroupViewState.fetchState)),U=G((i=>i.taskListState.byTab.live)),P=G((i=>i.taskGroupState.taskGroupById));return u.useEffect((()=>{h!=="In-Progress"&&(!S.current||U!==L.current||h==="Error")&&(S.current=!1,T.current&&(h!=="Completed"?h==="Error"&&(T.current=!1,l.current!=null&&(clearTimeout(l.current),l.current=void 0)):E()))}),[h,U,E]),u.useEffect((()=>{C!=="In-Progress"&&(!k.current||P!==g.current||C==="Error")&&(k.current=!1,o.current&&(o.current=!1,C!=="Error"&&D()))}),[C,P,D]),u.useEffect((()=>()=>{l.current!=null&&(clearTimeout(l.current),l.current=void 0)}),[]),{markBoardFetchInFlight:K,requestTaskRefetch:z}})(f?.tenantId);u.useEffect((()=>{y.getState().taskListState.hasValidState()||Z(),t(Q(!1,s))}),[f?.tenantId,t,s,Z,y]);const fa=u.useMemo((()=>{const d=[_.TASK_CREATED,_.TASK_UPDATED,_.TASKS_BULK_UPDATED,_.TASKS_BULK_DELETED],m=[_.TASK_CREATED,_.TASK_UPDATED,_.TASK_SNOOZE_RESURFACED,_.TASKS_BULK_UPDATED];return[...ae(f?.companyId,d),...ee(c?.userId,m)]}),[f?.companyId,c?.userId]);if(Ya({events:fa,onEvent:(d,m)=>{switch(d){case _.TASK_CREATED:case _.TASK_UPDATED:{const r=(T=>{if(T==null||typeof T!="object")return null;const o=T,k=oa(o);if(k==null||typeof o.tenant_id!="string"||typeof o.event_type!="string")return null;const g={task_id:k,tenant_id:o.tenant_id,event_type:o.event_type};return typeof o.is_private=="boolean"&&(g.is_private=o.is_private),j(o.assignees)&&(g.assignees=o.assignees),j(o.direct_assignees)&&(g.direct_assignees=o.direct_assignees),typeof o.created_by=="string"&&(g.created_by=o.created_by),j(o.task_group_ids)&&(g.task_group_ids=o.task_group_ids),typeof o.name=="string"&&(g.name=o.name),typeof o.parent_task_id=="string"&&(g.parent_task_id=o.parent_task_id),g})(m);if(r!=null){const T=y.getState(),o=r.task_id,k=o!=null?T.taskState.taskByID?.[o]:void 0,g=k!=null;if(!p)if(r.is_private===!0){if(!g)return}else{const l=c?.userId,S=new Set([...r.assignees??[],...r.direct_assignees??[]]);if(r.created_by!=null&&r.created_by!==""&&S.add(r.created_by),!(l!=null&&S.has(l))&&!g)return}if(d===_.TASK_UPDATED&&g&&k!=null&&Array.isArray(r.task_group_ids)){const l=new Set(Object.values(T.taskGroupState.taskGroupById??{}).filter((i=>i!=null&&!i.isDeleted)).map((i=>i.id))),S=(k.taskGroupIds??[]).filter((i=>l.has(i))),L=(r.task_group_ids??[]).filter((i=>l.has(i))),K=S.length===L.length&&S.every((i=>L.includes(i))),w=k.taskGroupIds??[],D=r.task_group_ids??[],E=w.length!==D.length||!w.every((i=>D.includes(i))),z=(i,Ta)=>{const V=i??[],W=Ta??[];if(V.length!==W.length)return!1;const ga=new Set(W);return V.every((_a=>ga.has(_a)))},h=r.name==null||r.name===k.name,C=r.is_private==null||r.is_private===k.isPrivate,U=r.assignees==null||z(r.assignees,k.assignees),P=r.direct_assignees==null;if(K&&E&&h&&C&&U&&P)return}}return void N()}case _.TASKS_BULK_DELETED:{const r=te(m);return r==null?void 0:void r.task_ids.forEach((T=>t(Wa(T))))}case _.TASKS_BULK_UPDATED:case _.TASK_SNOOZE_RESURFACED:return void N()}},onSubscribed:()=>{N()}}),u.useEffect((()=>{B==="Completed"&&t(ra({taskGroupById:$.taskGroupById}))}),[B,$.taskGroupById]),c==null)throw Error("Can't access task list page without signing in...");return A.jsxs(A.Fragment,{children:[B==="Completed"?A.jsx(ha,{analytics:Ga,onLoad:d=>(m=>m.trackPageLoaded(Ca.Event.taskListPage))(d)}):null,A.jsxs(se,{children:[A.jsx(Xa,{isAppContentDrawerOpen:ca,handleDrawerToggle:d=>{da(d)}}),A.jsx(ne,{location:n,navigate:a,currentTenant:f,taskGroupId:v,taskGroupState:$,localData:O.localData,uiState:O.uiState,isTaskTemplatesEnabled:s,taskListFetchState:B,isTaskCategorizationEnabled:x,isTaskCannedResponsesEnabled:b,isTaskBulkResolutionEnabled:ia,isTaskGroupAssigneesEnabled:la,isTaskRecurringParentEnabled:ua,isAiCfoAccessEnabled:ka,onAskAiCfoClick:pa})]})]})}const sa=(a,t)=>`/${a}/tasks/${encodeURIComponent(t)}`,q=(a,t)=>`/${a}/tasks/new/${t}`,oe=(a,t)=>{if(a==="assignee"){const n=t.split(",");return{...R.taskDetailLocalData,assignee:n}}if(a==="priority"){const n=Qa(t);return{...R.taskDetailLocalData,priority:n}}if(a==="status"){const n=Za(t);return{...R.taskDetailLocalData,status:n}}if(a==="tag"){const n=t.split(",");return{...R.taskDetailLocalData,tagIds:n}}if(a==="dueDate"){const n=Va(t);return{...R.taskDetailLocalData,dueDate:n}}return{...R.taskDetailLocalData}},me=Object.freeze(Object.defineProperty({__proto__:null,default:re},Symbol.toStringTag,{value:"Module"}));export{_ as T,ee as a,ae as b,_e as c,te as d,re as e,me as f,ge as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as r}from"./liveblocks-
|
|
1
|
+
import{j as r}from"./liveblocks-oxGmLiGE.js";import Te from"./NotFoundScreen-ngkmWfLO.js";import{a as u}from"./sentry-CYolppN9.js";import{h as ee,u as ae,j as g,g as ge,i as he,N as Ee,l as be,n as De,o as h}from"./core-k1hJbZ6L.js";import{QD as se,QG as Ie,QA as Ce,a35 as Re,fI as te,a36 as ne,R2 as b,QU as E,Qx as _e,Rx as Ge,Rq as ye,a37 as oe,gk as ie,a38 as W,a39 as Ae,Qt as Ue,Qq as ve,v6 as xe,uW as Be,mD as we,QS as je,a3a as Pe,RJ as Fe,QO as Le,Rc as Ke,R9 as Ne,QJ as $e,R6 as Qe,R1 as Oe}from"./zeni-epic-state-C2CKsxzr.js";import{z as D,e7 as Ze,c as qe,p as ze,d as _,a2 as re,l as G,a6 as Ve,k as H,O as Me,e8 as Je,W as X,ac as We}from"./index-Cjqi6Pkt.js";import{n as He}from"./mui-D8QuRJEy.js";import{u as Xe}from"./useInitialThreadRequest-DKk3Gbri.js";import{M as Ye}from"./MobileAppDrawer-D95K9MWM.js";import{T as m,t as ea,b as aa,a as sa,c as ta,d as Y,e as na}from"./TaskListScreen-PbWxRl0T.js";import{u as oa}from"./useTaskManagerPusherEvents-CULNono8.js";import"./recharts-DZG9umMy.js";import"./analytics-BSYXJeF4.js";import"./plaid-CbZCK8Pe.js";import"./dnd-CiTl8J_b.js";import"./stripe-cKAAJElX.js";import"./lottie-DXQhXtqa.js";import"./lexical-YTMAFU1j.js";import"./pdf-QcH92u4w.js";import"./utils-CZxvf1-B.js";import"./InboxNotificationsProvider-Lon_JjZI.js";import"./useTaskManagerAccess-CbR2C9f7.js";import"./useAskAiCfoHostNavButtonProps-BETiKk63.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="5bf3a674-f5b3-4a54-9328-62589138bf7f",e._sentryDebugIdIdentifier="sentry-dbid-5bf3a674-f5b3-4a54-9328-62589138bf7f")}catch{}})();function ia(){const e=ee(),a=ae(),n=D.getSignedInUser(),{cannedResponses:c,fetchState:t,saveFetchState:l}=g((i=>i.cannedResponsesState)),d=u.useCallback((()=>{a(se())}),[a]),S=u.useCallback(((i,I,C)=>{a(Ie({name:i,content:I,cannedResponseId:C}))}),[a]),s=u.useCallback((i=>{a(Ce({cannedResponseId:i}))}),[a]);if(n==null)throw Error("Can't access quick responses page without signing in...");return r.jsx(Ze,{cannedResponses:c,isLoading:t==="In-Progress"||t==="Not-Started",isSaving:l==="In-Progress",onBackClick:()=>e(-1),onDelete:s,onFetch:d,onSave:S})}const K=e=>e?.taskState?.taskByID,F=(e,a)=>{const n=K(e);if(a!=null&&n!=null)return n[a]?.parentTaskId??void 0},ra=Re([F,(e,a)=>{const n=F(e,a),c=K(e);if(n!=null&&c!=null)return c[n]?.name},(e,a)=>{const n=F(e,a),c=K(e);return n!=null&&c!=null&&c[n]!=null}],((e,a,n)=>{if(e!=null&&n===!0)return{id:e,name:a??""}})),ca=be((function(e,a){const{location:n,taskGroupId:c}=a,t=oe(e,a.taskId),l=te(e),d=ra(e,a.taskId),S=t.taskGroupId??c,s=S!=null?W(e.taskGroupState,S):void 0,i=D.getSignedInUser(),I=l.tenantId,C={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:I??""},v=ne(e),{tenantEmailDomain:x}=l,y=t.recurringSourceTaskId,B=y!=null?`${X.appUrl}/${x}/tasks/${encodeURIComponent(y)}`:void 0;return{taskDetailSelectorView:t,authParams:C,isZeniUser:D.isZeniUser(),userGroupList:Ae(e),isNewClicked:n.state?.message==="comingFromTaskListPage",filesEndPoint:We.fileMicroServiceBaseUrl,companyName:a.currentTenant.companyName,companyId:a.currentTenant.companyId,currentUrl:`${X.appUrl}${a.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:B,tagListView:v,taskGroupName:S!=null&&s!=null&&s.isDefault===!1?s.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map((f=>W(e.taskGroupState,f))).filter((f=>f!=null&&!f.isDeleted)).map((f=>({id:f.id,name:f.name,isDefault:f.isDefault}))),subtasks:t.subtasks,parentTaskRef:d,subTaskCreateStatus:e.taskDetailState?.subTaskCreateStatus?.fetchState}}),(function(e,a){const{taskId:n,navigate:c,currentTenant:t,location:l,taskGroupId:d}=a,{tenantEmailDomain:S}=t;return{onSaveChangesToLocalStore:s=>{e(Oe({taskDetailLocalData:s,taskId:n}))},onSaveDetailClick:s=>{e(Qe(n,s??d))},onArchiveTaskClick:()=>{a.taskId!=null&&e($e(a.taskId))},onSnoozeTask:(s,i)=>{e(Ne(s,i))},onUnsnoozeTask:s=>{e(Ke(s))},onCreateSubtask:(s,i)=>{e(Le({...i,parentTaskId:s}))},onSubtaskUpdate:(s,i)=>{e(Fe({task:s,updates:i}))},onShowToast:s=>{e(ie(s))},onSubtaskRowClick:s=>{c(`/${S}/tasks/${s}`,{state:{pathnameStackToGoBack:G(l.state?.pathnameStackToGoBack,l.pathname)}})},onParentBreadcrumbClick:s=>{c(`/${S}/tasks/${s}`,{state:{pathnameStackToGoBack:G(l.state?.pathnameStackToGoBack,l.pathname)}})},onDismissClick:()=>{if(l.state?.message==="triggerBackClick"){const s=re(l.state?.pathnameStackToGoBack),i=s.poppedPathname??"../../dashboard";c(i,{state:{pathnameStackToGoBack:s.newStack}})}else{const s=U(S),i=G(l.state?.pathnameStackToGoBack,l.pathname);c(s,{state:{pathnameStackToGoBack:i}})}e(Pe({taskId:n}))},onDeleteTaskClick:()=>{e(je(n))},updateFilesEntity:s=>{e(we({files:s}))},onDeleteFile:s=>{e(Be(s))},onEditFileName:(s,i)=>{e(xe(s,i.split(".")[0]))},onReloadTaskDetailPage:()=>{e(b(!1,n))},onCreateTagClick:s=>{e(ve(s,n))},onDeleteTagClick:s=>{e(Ue(s,n))},onFetchCannedResponses:()=>{e(se())},onManageTemplatesClick:()=>{c(`/${t.tenantEmailDomain}/tasks/quick-responses`)}}}))(Je);function L(){const e=ee(),a=ae(),n=ge(),c=qe(),{taskId:t,taskGroupId:l}=he(),d=g((o=>te(o))),S=Xe(d?.companyId),{useFeatureGate:s}=ze(),{isFeatureEnabled:i}=s(_.isTaskSnoozeEnabled),{isFeatureEnabled:I}=s(_.isTaskVisibilityEnabled),{isFeatureEnabled:C}=s(_.isTaskCannedResponsesEnabled),{isFeatureEnabled:v}=s(_.isTaskRecurringParentEnabled),{isFeatureEnabled:x}=s(_.isTaskGroupAssigneesEnabled),[y,B]=u.useState(!1),[f,ce]=u.useState(!1),[N,le]=u.useState(!1),[$,w]=u.useState(!1),R=u.useRef(!1),A=g((o=>o.taskListState.updateTasksFetchState.fetchState)),Q=g((o=>ne(o))),O=g((o=>o.taskGroupViewState.fetchState));u.useEffect((()=>{a(b(!1,t)),t!=null&&a(E(t))}),[a,t]);const Z=D.getSignedInUser()?.userId,de=D.isZeniUser(),ke=g((o=>t!=null?o.taskState.taskByID[t]?.syncToken:void 0)),q=()=>{d?.tenantEmailDomain!=null&&e(U(d.tenantEmailDomain))},z=()=>{a(ie({messageSection:"delete_task",messageText:"success",type:"success"})),q()},ue=u.useMemo((()=>{const o=[m.TASK_CREATED,m.TASK_UPDATED,m.TASKS_BULK_UPDATED,m.TASKS_BULK_DELETED],k=[...o,m.TASK_SNOOZE_RESURFACED];return[...aa(d?.companyId,o),...sa(Z,k)]}),[d?.companyId,Z]);oa({events:ue,onSubscribed:()=>{t!=null&&(a(b(!0,t)),a(E(t)))},onEvent:(o,k)=>{if(t!=null)switch(o){case m.TASK_CREATED:case m.TASK_UPDATED:{const p=((P,me,{isZeniUser:Se,storedSyncToken:fe,taskId:J})=>{if(P!==m.TASK_CREATED&&P!==m.TASK_UPDATED)return"none";const T=ea(me);return T==null?"none":T.parent_task_id===J?"refreshSubtasks":P!==m.TASK_UPDATED||T.task_id!==J?"none":T.is_deleted===!0?"leaveDeleted":T.is_private!==!0||Se?T.sync_token!=null&&T.sync_token===fe?"none":"refreshTask":"leaveNoAccess"})(o,k,{isZeniUser:de,storedSyncToken:ke,taskId:t});p==="refreshTask"?(a(b(!0,t)),a(E(t))):p==="refreshSubtasks"?a(E(t)):p==="leaveDeleted"?z():p==="leaveNoAccess"&&q();break}case m.TASKS_BULK_UPDATED:{const p=Y(k);if(p==null)break;p.task_ids.includes(t)&&a(b(!0,t)),a(E(t));break}case m.TASKS_BULK_DELETED:{const p=Y(k);if(p==null)break;if(p.task_ids.includes(t)){z();break}a(E(t));break}case m.TASK_SNOOZE_RESURFACED:{ta(k)?.task_id===t&&a(b(!0,t));break}}}}),u.useEffect((()=>{f||Q.fetchState==="Completed"||(ce(!0),a(_e()))}),[f,a,Q.fetchState]),u.useEffect((()=>{N||O==="Completed"||(le(!0),a(Ge()))}),[N,a,O]);const pe=u.useCallback((()=>{t!=null&&(R.current=!1,a(ye([t],null,{isArchived:!1})),w(!0))}),[a,t]);u.useEffect((()=>{if($)if(A!=="In-Progress"){if(R.current){if(A==="Error")return w(!1),void(R.current=!1);if(A==="Completed"){w(!1),R.current=!1;const{tenantEmailDomain:o}=d;if(n.state?.message==="triggerBackClick"){const k=re(n.state?.pathnameStackToGoBack);e(k.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:k.newStack}})}else{const k=U(o);e(k,{state:{pathnameStackToGoBack:G(n.state?.pathnameStackToGoBack,n.pathname)}})}}}}else R.current=!0}),[$,A,d,n,e]);const V=g((o=>oe(o,t))),j=V.fetchState,M=D.getSignedInUser();if(M==null)throw Error("Can't access task detail page without signing in...");if(j==="Error"&&V.error?.code===400){const{tenantEmailDomain:o}=d,k=U(o),p=G(n.state?.pathnameStackToGoBack,n.pathname);return r.jsx(Ee,{to:k,state:{pathnameStackToGoBack:p}})}return r.jsxs(r.Fragment,{children:[j==="Completed"?r.jsx(Ve,{analytics:H,onLoad:o=>(k=>k.trackPageLoaded(Me.Event.taskDetailPage))(o)}):null,r.jsxs(la,{children:[r.jsx(Ye,{isAppContentDrawerOpen:y,handleDrawerToggle:o=>{B(o)}}),r.jsx(ca,{analytics:H,currentTenant:d,handleZeniLogoClick:()=>{c.toggle()},initialOpenThreadRequest:S,location:n,loggedInUser:M,navigate:e,taskGroupId:l,taskId:t,taskDetailFetchState:j,onUnarchiveTaskClick:pe,isTaskSnoozeEnabled:i,isTaskVisibilityEnabled:I,isTaskCannedResponsesEnabled:C,isTaskRecurringParentEnabled:v,isTaskGroupAssigneesEnabled:x})]})]})}const la=He.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,4 +6,4 @@ import{j as r}from"./liveblocks-CevUFagi.js";import fe from"./NotFoundScreen-BkN
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,U=e=>`/${e}/tasks`;function Ba(){return r.jsxs(De,{children:[r.jsx(h,{path:"/new",element:r.jsx(L,{})}),r.jsx(h,{path:"/new/:taskGroupId",element:r.jsx(L,{})}),r.jsx(h,{path:"/group/:taskGroupId",element:r.jsx(na,{})}),r.jsx(h,{path:"/quick-responses",element:r.jsx(ia,{})}),r.jsx(h,{path:"/:taskId",element:r.jsx(L,{})}),r.jsx(h,{path:"*",element:r.jsx(
|
|
9
|
+
`,U=e=>`/${e}/tasks`;function Ba(){return r.jsxs(De,{children:[r.jsx(h,{path:"/new",element:r.jsx(L,{})}),r.jsx(h,{path:"/new/:taskGroupId",element:r.jsx(L,{})}),r.jsx(h,{path:"/group/:taskGroupId",element:r.jsx(na,{})}),r.jsx(h,{path:"/quick-responses",element:r.jsx(ia,{})}),r.jsx(h,{path:"/:taskId",element:r.jsx(L,{})}),r.jsx(h,{path:"*",element:r.jsx(Te,{})})]})}export{Ba as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as c}from"./liveblocks-oxGmLiGE.js";import B from"./NotFoundScreen-ngkmWfLO.js";import{a as n}from"./sentry-CYolppN9.js";import{u as ft,h as yt,g as bt,i as St,j as o,n as ht,o as f}from"./core-k1hJbZ6L.js";import{fI as It,gZ as Lt,m3 as Tt,ul as jt,XR as Ct,XG as Et,XS as gt,S2 as At,S3 as kt,i3 as L,m1 as vt,um as xt,RU as Dt,St as Rt,XT as _t,XU as Nt,R$ as Xt,RY as wt,XV as Ft,XW as Mt,XX as Ut}from"./zeni-epic-state-C2CKsxzr.js";import{p as zt,V as Ht,d as H,b0 as Pt,z as qt,g as Vt,b1 as Bt,k as P,b2 as Gt,ac as $t,G as Ot}from"./index-Cjqi6Pkt.js";import"./mui-D8QuRJEy.js";import{d as Yt}from"./decodeURIComponentSafe-CKsYKxPJ.js";import{u as Zt}from"./useEnsureVendorListLoaded-CbkO2307.js";import{u as Wt,T}from"./TransactionDetailScreen-CUF4XJ-a.js";import{c as Jt}from"./routePaths-BQiUfv8Y.js";import"./recharts-DZG9umMy.js";import"./analytics-BSYXJeF4.js";import"./plaid-CbZCK8Pe.js";import"./dnd-CiTl8J_b.js";import"./stripe-cKAAJElX.js";import"./lottie-DXQhXtqa.js";import"./lexical-YTMAFU1j.js";import"./pdf-QcH92u4w.js";import"./utils-CZxvf1-B.js";import"./useAskAiCfoHostNavButtonProps-BETiKk63.js";import"./useInitialThreadRequest-DKk3Gbri.js";import"./expenseAutomationHelper-BfCR3sLm.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new e.Error().stack;d&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[d]="0a6f0b63-baee-4af4-bf81-4c4d9ad766a4",e._sentryDebugIdIdentifier="sentry-dbid-0a6f0b63-baee-4af4-bf81-4c4d9ad766a4")}catch{}})();const Kt=["bank","credit_card","other_current_assets"],q=e=>`/${e}/month_end_close_checks/review/transaction_categorization`,{common:{currency:V}}=Ot.getLocalizedStrings();function Qt(){const e=ft(),d=yt(),m=bt(),{tenantEmailDomain:u,transactionTypeEncoded:G}=St(),{useFeatureGate:j}=zt(),$=Ht(),{isFeatureEnabled:O}=j(H.isCreateTransactionEnabled),{isFeatureEnabled:C}=j(H.isProjectsTransactionsEnabled),Y=Yt(G??""),a=Ut.find((t=>t===Y)),S=o((t=>It(t))),E=Pt(S.companyId,a),g=o((t=>Lt(t.companyState,S.companyId)?.company.companyLocaleInfo)),Z=g?.currencyCode??V.currencyCode,W=g?.currencySymbol??V.currencySymbol,A=o((t=>t.tenantState.currentTenantId)),k=qt.getSignedInUser(),v=k?.userId??"",x=k?.zeniSessionId??"",J=n.useMemo((()=>({userId:v,sessionId:x,tenantId:A??""})),[v,x,A]),K=o((t=>Tt(t))),D=o((t=>jt(t))),R=D&&C===!0,h=o((t=>t.projectListState)),_=o((t=>t.projectState)),Q=n.useMemo((()=>Ct(_,h).projects),[_,h]),I=o((t=>Et(t,"common"))),N=o((t=>t.accountListState.byReportId.accountList.fetchState)),X=o((t=>t.accountListState.byReportId.createTransactionLineAccountList.fetchState)),w=o((t=>t.accountListState.byReportId.createTransactionPaymentAccountList.fetchState)),F=o((t=>t.classListState.fetchState)),s=o((t=>a!=null?gt(t,a):void 0));n.useEffect((()=>{if(a!=null)return e(At(a)),()=>{e(kt(a))}}),[e,a]);const tt=Vt(),et=o((t=>{const{activeTenantFetchState:i,currentTenantId:b,fetchState:mt,tenantsById:pt}=t.tenantState;return b!=null&&pt[b]!=null&&(i.fetchState==="Completed"||mt==="Completed")})),r=tt&&et;n.useEffect((()=>{r&&a==="transfer"&&N==="Not-Started"&&e(L("accountList"))}),[e,r,a,N]),n.useEffect((()=>{r&&X==="Not-Started"&&e(L("createTransactionLineAccountList"))}),[e,r,X]),n.useEffect((()=>{r&&w==="Not-Started"&&e(L("createTransactionPaymentAccountList",!1,!1,!1,!1,Kt))}),[e,r,w]),n.useEffect((()=>{r&&F==="Not-Started"&&e(vt())}),[e,r,F]);const M=h.fetchState;n.useEffect((()=>{r&&R&&M==="Not-Started"&&e(xt())}),[e,r,R,M]),Zt(r),Wt(r&&a==="transfer",!1);const at=n.useCallback(((t,i=[])=>{if(i.length>0&&e(Dt(i)),u==null)return;const b=Bt(m.state)??[q(u)];d(Jt(t,u),{replace:!0,state:{pathnameStackToGoBack:b}})}),[e,u,d,m.state]),nt=n.useCallback((()=>{m.key==="default"?u!=null&&d(q(u)):d(-1)}),[m.key,d,u]),ot=n.useCallback((t=>{e(Rt(t))}),[e]),U=n.useRef(void 0),p=s?.createStatus.error;n.useEffect((()=>{if(a==null||p==null)return;const t=`${p.code??""}-${p.message??""}`;U.current!==t&&(U.current=t,P.trackCreateTransactionFailed({transactionType:a,errorCode:p.code}))}),[p,a]);const y=n.useCallback((t=>t),[]),l=n.useMemo((()=>(s?.vendorList??[]).filter((t=>!t.isDeleted)).sort(((t,i)=>t.name.localeCompare(i.name)))),[s?.vendorList]),z=s?.localData.vendorId,st=n.useMemo((()=>{const t=l.find((i=>i.id===z));if(t!=null)return t.qboId!==""&&t.qboId!==t.name?t.qboId:t.name}),[l,z]),ct=o((t=>_t(t,st))),rt=n.useMemo((()=>y(l.map((t=>({id:t.id,label:t.name}))))),[l,y]),it=n.useMemo((()=>({...I,vendor:[...l.map((t=>({id:t.id,name:t.name,qboId:t.qboId,type:"vendor",zeniId:t.id}))),...I.vendor]})),[I,l]),dt=n.useMemo((()=>y((s?.transferAccountsList??[]).map((t=>({id:t.accountId,label:t.accountName}))))),[s?.transferAccountsList,y]),ut=n.useCallback((t=>{a!=null&&e(Nt(a,t))}),[e,a]),lt=n.useCallback(((t,i)=>{a!=null&&e(Xt(a,i,t))}),[e,a]);return E==null?null:a!=null&&s!=null&&O===!0&&E&&$?.connectionName!=="netsuite"?c.jsx(Gt,{analytics:P,attachmentUploadEndpoint:$t.accountMicroServiceBaseUrl,authParams:J,createdTransactionId:s.createdTransactionId,transactionType:a,localData:s.localData,createStatus:s.createStatus,accountsHierarchyList:s.accountListNestedAccountHierarchy,paymentAccountsHierarchyList:s.paymentAccountListNestedAccountHierarchy,classHierarchyList:s.classListNestedAccountHierarchy,vendorOptions:rt,transferAccountOptions:dt,isAccountingClassesEnabled:K,isAccountingProjectsEnabled:D,isProjectsTransactionsEnabled:C===!0,projects:Q,currencyCode:Z,currencySymbol:W,bookCloseDate:S.bookCloseDate?.toDate(),entityAutoCompleteView:it,vendorRecommendationFetchState:ct.fetchState,onUpdateLocalData:ut,onAddLine:()=>e(Mt(a)),onRemoveLine:t=>e(Ft(a,t)),onSubmit:()=>e(wt(a)),onCancel:nt,onCreateTransactionComplete:at,onUploadAttachmentAttachment:ot,onFetchRecommendationsForVendor:lt}):c.jsx(B,{})}function Ce(){return c.jsxs(ht,{children:[c.jsx(f,{path:"/new/:transactionTypeEncoded",element:c.jsx(Qt,{})}),c.jsx(f,{path:"/:transactionTypeEncoded/:transactionId",element:c.jsx(T,{})}),c.jsx(f,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:c.jsx(B,{})}),c.jsx(f,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:c.jsx(T,{})}),c.jsx(f,{path:"/*",element:c.jsx(T,{})})]})}export{Ce as default};
|