@zeniai/web-app-ui 5.1.87-qa → 5.1.88-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AddressRoutes-D1WHvjaC.js +1 -0
- package/dist/assets/{AddressScreen-CFbhgIGJ.js → AddressScreen-BbyvVT6L.js} +2 -2
- package/dist/assets/{AiCfoScreen-B6zyicNm.js → AiCfoScreen-BirPn_Cp.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-Oi3BB9M7.js → BillPayApprovalRoutes-C4YPYgux.js} +1 -1
- package/dist/assets/{BillPayRoutes-BTW4JYZ5.js → BillPayRoutes-BzydmPHl.js} +9 -9
- package/dist/assets/{BusinessVerificationPageScreen-CL6awpAL.js → BusinessVerificationPageScreen-B4Sdru5b.js} +2 -2
- package/dist/assets/{CardsAiCfoScreen-Dxy9X1Bo.js → CardsAiCfoScreen-Btq4pG_T.js} +1 -1
- package/dist/assets/ChargeCardRoutes-Cgu4oIIL.js +71 -0
- package/dist/assets/{CompanyPassportScreen-DOFoT4Be.js → CompanyPassportScreen-mmNQvD1l.js} +1 -1
- package/dist/assets/{ConnectionAuthScreen-CQV2_OZ0.js → ConnectionAuthScreen-BbwnVeZh.js} +1 -1
- package/dist/assets/CustomerOnboardingAuthScreen-SlT1SgCd.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-BJZmmxt9.js → CustomerOnboardingRoutes-y0MRiG44.js} +4 -4
- package/dist/assets/{DashboardRoutes-BFMd-l1r.js → DashboardRoutes-3IVYIvWw.js} +1 -1
- package/dist/assets/{DefaultTenantHome-DJC12Cdo.js → DefaultTenantHome-Dqo0NCGe.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-Df55U56u.js → DomesticWireDetailScreen-pZjx01h5.js} +1 -1
- package/dist/assets/DrawerScreen-B64CuqJH.js +1 -0
- package/dist/assets/{EntityDetailRoutes-2UgBgIRu.js → EntityDetailRoutes-DVlzKwkA.js} +1 -1
- package/dist/assets/{ExpenseAutomationRoutes-BJ95ir7i.js → ExpenseAutomationRoutes-CmegspTp.js} +3 -3
- package/dist/assets/{FeaturePreviewScreen-DrK5iO4h.js → FeaturePreviewScreen-4JjThRQw.js} +1 -1
- package/dist/assets/{HubSpotOAuthCallbackScreen-DG2Q66fQ.js → HubSpotOAuthCallbackScreen-DTQ5dtHc.js} +1 -1
- package/dist/assets/MagicLinkRoutes-Bl3diPGV.js +72 -0
- package/dist/assets/MagicLinkSignInScreen-DtACNd4K.js +12 -0
- package/dist/assets/{MobileAppDrawer-lEpfHv06.js → MobileAppDrawer-DeAmBX6B.js} +1 -1
- package/dist/assets/NotFoundScreen--bQtpbnT.js +1 -0
- package/dist/assets/{NotificationRoutes-CB14J9aV.js → NotificationRoutes-BUUI2IcZ.js} +1 -1
- package/dist/assets/OAuthConsentScreen-BEbJa-tg.js +1 -0
- package/dist/assets/{PandLWithForecastRoutes-vM-uwzHf.js → PandLWithForecastRoutes-zl-ps-j_.js} +1 -1
- package/dist/assets/{PeopleRoutes-X5tb8lhO.js → PeopleRoutes-8nw8zuv-.js} +3 -3
- package/dist/assets/{PerformanceRoutes-CRU5xoU7.js → PerformanceRoutes-RLKuJkPs.js} +1 -1
- package/dist/assets/{Preview-Dva_bJum.js → Preview-Dg1ZSkBS.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-BlHRcpm3.js → QBOConnectionScreen-CxYyqia2.js} +1 -1
- package/dist/assets/ReferralListScreen-iQWpMF4X.js +5 -0
- package/dist/assets/{ReimbursementApprovalRoutes-BuZZL2vV.js → ReimbursementApprovalRoutes-BrWLOXin.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-aGD2Y8Qy.js → ReimbursementApprovalRuleDetailScreen-D-6Lutgq.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-D7LGMtpu.js → ReimbursementRoutes-7k16ZAgH.js} +1 -1
- package/dist/assets/{ReportsRoutes-CWHmiADl.js → ReportsRoutes-BK1o6TNN.js} +1 -1
- package/dist/assets/RewardsRoutes-DC51t0Yv.js +1 -0
- package/dist/assets/{ScreenRoutes-Cy4RnVLS.js → ScreenRoutes-CSQgFzeR.js} +2 -2
- package/dist/assets/{SettingsRoutes-CiHAUP6i.js → SettingsRoutes-hVxWlaAv.js} +1 -1
- package/dist/assets/{SetupPagesScreen-Xht4iwXu.js → SetupPagesScreen-BTuDl3Cv.js} +5 -5
- package/dist/assets/SignInScreen-Duv4SIzZ.js +1 -0
- package/dist/assets/SignOutScreen-Fwol25zL.js +9 -0
- package/dist/assets/{TaskListScreen-DX-JLRj3.js → TaskListScreen-TXdgCa5r.js} +2 -2
- package/dist/assets/{TaskRoutes-BpuZpme2.js → TaskRoutes-xVHfvGq2.js} +2 -2
- package/dist/assets/{TransactionDetailRoutes-eIr1TcUG.js → TransactionDetailRoutes-JaczX3m4.js} +1 -1
- package/dist/assets/{TransactionDetailScreen-BFbKNK0K.js → TransactionDetailScreen-BMeJP7Bk.js} +1 -1
- package/dist/assets/{TransactionListRoutes-CBsMtW5X.js → TransactionListRoutes-DBUsrkyG.js} +1 -1
- package/dist/assets/{TreasuryRoutes-ddHMPy4l.js → TreasuryRoutes-Xb2-ZHfI.js} +5 -5
- package/dist/assets/{VendorsRoutes-CGIr3vzC.js → VendorsRoutes-CGo4SIRt.js} +13 -13
- package/dist/assets/WiseConfirmationScreen-DfE4C1Lu.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-BLfJsnfm.js → ZeniAccountRoutes-BD0J62S-.js} +1 -1
- package/dist/assets/{ZeniAccountStatementScreen-1ZlbkGh4.js → ZeniAccountStatementScreen-Cwz87pc9.js} +1 -1
- package/dist/assets/{accountMappingHelper-Du8kIzw4.js → accountMappingHelper-dP4oYbsE.js} +1 -1
- package/dist/assets/{analytics-BY30ztud.js → analytics-C839ALjG.js} +1 -1
- package/dist/assets/{analyticsHelper-BHJAp8-8.js → analyticsHelper-BmqSI_Lf.js} +1 -1
- package/dist/assets/{core-FEzHdTwu.js → core-BE5sOaFh.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-_VO6ySKg.js → decodeURIComponentSafe-BQyheK0C.js} +1 -1
- package/dist/assets/{dnd-Cb_vPZwC.js → dnd-DTt7nnqm.js} +1 -1
- package/dist/assets/{empty-C5RcOwbi.js → empty-DHPjwnEd.js} +1 -1
- package/dist/assets/{empty-C8ieKMB7.js → empty-ifBS6vam.js} +1 -1
- package/dist/assets/{emptyVideoElement-BmUcQvfG.js → emptyVideoElement-C9FB-i06.js} +1 -1
- package/dist/assets/{epic-BNsbOFuA.js → epic-Dq2wg9A7.js} +1 -1
- package/dist/assets/{getLocaleForTenant-B8PdHxEZ.js → getLocaleForTenant-DrGyVJin.js} +1 -1
- package/dist/assets/{index-CVniyevN.js → index-BQAeQoiw.js} +1 -1
- package/dist/assets/{index-DgG7sdLK.js → index-Bo1J9dzX.js} +1 -1
- package/dist/assets/{index-jQssSn-J.js → index-BruA-v5x.js} +1 -1
- package/dist/assets/{index-B4FjCn1f.js → index-D3mkEg-D.js} +1 -1
- package/dist/assets/{index-C7vi0ZZK.js → index-DZVFFUA4.js} +1 -1
- package/dist/assets/{index-CkBh8V_t.js → index-Hu1Bm28Y.js} +2 -2
- package/dist/assets/{index-sOa-ivVp.js → index-j91BsX6x.js} +8230 -8214
- package/dist/assets/{index-CBsCykBf.js → index-tj0b7I6S.js} +1 -1
- package/dist/assets/{lexical-fJeYHrZP.js → lexical-BDIjEa69.js} +1 -1
- package/dist/assets/{liveblocks-B2D23g1h.js → liveblocks-CL8iYAR7.js} +1 -1
- package/dist/assets/{lottie-BKshFrBj.js → lottie-D6l1SNxh.js} +1 -1
- package/dist/assets/{mui-C754KMjM.js → mui-D8wN7E11.js} +1 -1
- package/dist/assets/{pathToGoBack-UuLm5E-W.js → pathToGoBack-D-zEeULy.js} +1 -1
- package/dist/assets/{pdf-BSvba1pn.js → pdf-B7aBqR_B.js} +3 -3
- package/dist/assets/{pdf-lib-DwZXgIAK.js → pdf-lib-2JemKW90.js} +1 -1
- package/dist/assets/{plaid--k8gbxl0.js → plaid-s-fzmMlM.js} +1 -1
- package/dist/assets/{pusher-DZSPU4Iz.js → pusher-X1OwuLGQ.js} +1 -1
- package/dist/assets/{react-CNLrYL7C.js → react-B3BGVicH.js} +1 -1
- package/dist/assets/{react-Bwb7DPQL.js → react-BBhlpvlC.js} +1 -1
- package/dist/assets/{react-DTEOm1rk.js → react-Ck9BtMog.js} +1 -1
- package/dist/assets/{react-_GRuT6vD.js → react-CpKmyb1T.js} +1 -1
- package/dist/assets/{react-Bv0wImI-.js → react-DOvITSOM.js} +1 -1
- package/dist/assets/{react-KlSSTbpt.js → react-PNq75kwF.js} +1 -1
- package/dist/assets/{recharts-CIXkvtnT.js → recharts-CEhf2Gm_.js} +1 -1
- package/dist/assets/{routePaths-C_agWIhF.js → routePaths-MNVfXbZw.js} +1 -1
- package/dist/assets/{sentry-BQ1KU1t3.js → sentry-CO5QdUHy.js} +1 -1
- package/dist/assets/{url-BWcieJIW.js → url-Bu3ZxsAs.js} +1 -1
- package/dist/assets/{url-DLepITYL.js → url-GWWGspl-.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-UyV5LaV3.js → useAiCfoDashboardSuggestedQuestionsChips-BYe9KDNy.js} +1 -1
- package/dist/assets/{useAskAiCfoHostNavButtonProps-ByAiXj6b.js → useAskAiCfoHostNavButtonProps-5B5IGvZZ.js} +1 -1
- package/dist/assets/{useCashManagementBanner-IspJUBVk.js → useCashManagementBanner-B-iQLyJE.js} +1 -1
- package/dist/assets/{useChargeCardPusherEvents-DKTUgdDs.js → useChargeCardPusherEvents-BckrLUOI.js} +1 -1
- package/dist/assets/{useDeviceId-C0O1xmgi.js → useDeviceId-C-ngzR5m.js} +1 -1
- package/dist/assets/{useEmailConnectResultRefresh-Capr7OcZ.js → useEmailConnectResultRefresh-CLY1bTNF.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-Bzg53f4k.js → useInitialThreadRequest-B6VWj1GW.js} +1 -1
- package/dist/assets/{utils-C8oTXAPM.js → utils-BqFxyIYL.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-BidzZJzq.js → withTransactionSidePanel-oRZAfGqS.js} +2 -2
- package/dist/assets/{zeni-epic-state-Bxb-N0Vf.js → zeni-epic-state-Cwuxiu06.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +4 -4
- package/dist/assets/AddressRoutes-U028ASzS.js +0 -1
- package/dist/assets/ChargeCardRoutes-7pOZH6XZ.js +0 -71
- package/dist/assets/CustomerOnboardingAuthScreen-LNleLdVj.js +0 -1
- package/dist/assets/DrawerScreen-CuGa-fYk.js +0 -1
- package/dist/assets/MagicLinkRoutes-DHtiC4OL.js +0 -72
- package/dist/assets/MagicLinkSignInScreen-BFWF0e4l.js +0 -12
- package/dist/assets/NotFoundScreen-DKRpU5d2.js +0 -1
- package/dist/assets/OAuthConsentScreen-DyHagxec.js +0 -1
- package/dist/assets/ReferralListScreen-CR-hF3FX.js +0 -5
- package/dist/assets/RewardsRoutes-k7gV7T8a.js +0 -1
- package/dist/assets/SignInScreen-DZAV_SQk.js +0 -1
- package/dist/assets/SignOutScreen-D-a-XJ-L.js +0 -9
- package/dist/assets/WiseConfirmationScreen-BADJXZJx.js +0 -12
package/dist/index.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang="en"><head><meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate"><meta http-equiv="expires" content="0"><meta http-equiv="pragma" content="no-cache"><meta charset="UTF-8"><link rel="icon" type="image/svg+xml" href="/assets/favicon-D56XvgAH.ico"><meta name="ROBOTS" content="NOINDEX, NOFOLLOW"><meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1"><meta name="theme-color" content="#000000"><meta name="description" content="Zeni - Modern Finance Team For Startups"><link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin><link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:wght@100;300;400;500;700;900&family=Manrope:wght@200..800&display=swap"><link rel="apple-touch-icon" href="/assets/logo192-CqcTe-t4.png"><link rel="manifest" href="/assets/manifest-icT4lOF5.json"><title>Zeni - Modern Finance Team For Startups</title><script src="/theme-detect.js"></script><style>:root{--logo-color-from:#D4DCDD;--logo-color-to:#E9F0F0;--bar-color-from:#E9F0F0;--bar-color-to:#D4DCDD;--sidebar-bg:#F3F7F7;--main-bg:#FAFCFC;--divider-color:#D4DCDD}html{background-color:#f3f7f7}html[data-theme=dark]{background-color:#1b1c1c;--logo-color-from:#545B5C;--logo-color-to:#3E4343;--bar-color-from:#3E4343;--bar-color-to:#545B5C;--sidebar-bg:#1B1C1C;--main-bg:#202222;--divider-color:#545B5C}.app-shell-loader{position:fixed;inset:0;display:flex;background-color:var(--sidebar-bg);z-index:9999}.app-shell-sidebar{width:210px;flex-shrink:0;background-color:var(--sidebar-bg);padding:16px 16px 0;display:flex;flex-direction:column;gap:36px;border-right:1px solid var(--divider-color);box-sizing:border-box}.app-shell-sidebar-group{display:flex;flex-direction:column;gap:10px}.app-shell-bar{height:10px;border-radius:5px;background-color:var(--bar-color-from);animation:app-shell-bar-shimmer 1.6s linear infinite}.app-shell-navbar{height:56px;display:flex;flex-direction:row;border-bottom:1px solid var(--divider-color);padding:0 32px;align-items:center;justify-content:space-between;box-sizing:border-box}@keyframes app-shell-bar-shimmer{0%,100%{background-color:var(--bar-color-from)}50%{background-color:var(--bar-color-to)}}.app-shell-main{flex:1;background-color:var(--main-bg)}.app-shell-logo{display:inline-flex;width:100%;height:calc(100vh - 56px);justify-content:center;align-items:center}.app-shell-logo svg path{animation:app-shell-color-cycle 1.6s linear infinite}@keyframes app-shell-color-cycle{0%,100%{fill:var(--logo-color-from)}50%{fill:var(--logo-color-to)}}@media (max-width:899px){.app-shell-sidebar{display:none}.app-shell-main{background-color:var(--sidebar-bg)}}</style><noscript><style>.app-shell-loader{display:none}</style></noscript><script async type="module" crossorigin src="/assets/index-
|
|
1
|
+
<!DOCTYPE html><html lang="en"><head><meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate"><meta http-equiv="expires" content="0"><meta http-equiv="pragma" content="no-cache"><meta charset="UTF-8"><link rel="icon" type="image/svg+xml" href="/assets/favicon-D56XvgAH.ico"><meta name="ROBOTS" content="NOINDEX, NOFOLLOW"><meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1"><meta name="theme-color" content="#000000"><meta name="description" content="Zeni - Modern Finance Team For Startups"><link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin><link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:wght@100;300;400;500;700;900&family=Manrope:wght@200..800&display=swap"><link rel="apple-touch-icon" href="/assets/logo192-CqcTe-t4.png"><link rel="manifest" href="/assets/manifest-icT4lOF5.json"><title>Zeni - Modern Finance Team For Startups</title><script src="/theme-detect.js"></script><style>:root{--logo-color-from:#D4DCDD;--logo-color-to:#E9F0F0;--bar-color-from:#E9F0F0;--bar-color-to:#D4DCDD;--sidebar-bg:#F3F7F7;--main-bg:#FAFCFC;--divider-color:#D4DCDD}html{background-color:#f3f7f7}html[data-theme=dark]{background-color:#1b1c1c;--logo-color-from:#545B5C;--logo-color-to:#3E4343;--bar-color-from:#3E4343;--bar-color-to:#545B5C;--sidebar-bg:#1B1C1C;--main-bg:#202222;--divider-color:#545B5C}.app-shell-loader{position:fixed;inset:0;display:flex;background-color:var(--sidebar-bg);z-index:9999}.app-shell-sidebar{width:210px;flex-shrink:0;background-color:var(--sidebar-bg);padding:16px 16px 0;display:flex;flex-direction:column;gap:36px;border-right:1px solid var(--divider-color);box-sizing:border-box}.app-shell-sidebar-group{display:flex;flex-direction:column;gap:10px}.app-shell-bar{height:10px;border-radius:5px;background-color:var(--bar-color-from);animation:app-shell-bar-shimmer 1.6s linear infinite}.app-shell-navbar{height:56px;display:flex;flex-direction:row;border-bottom:1px solid var(--divider-color);padding:0 32px;align-items:center;justify-content:space-between;box-sizing:border-box}@keyframes app-shell-bar-shimmer{0%,100%{background-color:var(--bar-color-from)}50%{background-color:var(--bar-color-to)}}.app-shell-main{flex:1;background-color:var(--main-bg)}.app-shell-logo{display:inline-flex;width:100%;height:calc(100vh - 56px);justify-content:center;align-items:center}.app-shell-logo svg path{animation:app-shell-color-cycle 1.6s linear infinite}@keyframes app-shell-color-cycle{0%,100%{fill:var(--logo-color-from)}50%{fill:var(--logo-color-to)}}@media (max-width:899px){.app-shell-sidebar{display:none}.app-shell-main{background-color:var(--sidebar-bg)}}</style><noscript><style>.app-shell-loader{display:none}</style></noscript><script async type="module" crossorigin src="/assets/index-j91BsX6x.js"></script><link rel="modulepreload" crossorigin href="/assets/sentry-CO5QdUHy.js"><link rel="modulepreload" crossorigin href="/assets/core-BE5sOaFh.js"><link rel="modulepreload" crossorigin href="/assets/zeni-epic-state-Cwuxiu06.js"><link rel="modulepreload" crossorigin href="/assets/mui-D8wN7E11.js"><link rel="modulepreload" crossorigin href="/assets/analytics-C839ALjG.js"><link rel="modulepreload" crossorigin href="/assets/utils-BqFxyIYL.js"><link rel="stylesheet" crossorigin href="/assets/index-BUmr5maU.css"></head><body style="margin:0"><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><div class="app-shell-loader" id="app-shell-loader"><div class="app-shell-sidebar"><div class="app-shell-sidebar-group"><div class="app-shell-bar zeni-logo" style="width:96px;height:20px"></div></div><div class="app-shell-sidebar-group"><div class="app-shell-bar" style="width:55px;height:12px"></div><div class="app-shell-bar" style="width:78px;height:16px"></div><div class="app-shell-bar" style="width:46px;height:16px"></div></div><div class="app-shell-sidebar-group"><div class="app-shell-bar" style="width:55px;height:12px"></div><div class="app-shell-bar" style="width:110px;height:16px"></div><div class="app-shell-bar" style="width:84px;height:16px"></div></div><div class="app-shell-sidebar-group"><div class="app-shell-bar" style="width:55px;height:12px"></div><div class="app-shell-bar" style="width:84px;height:16px"></div><div class="app-shell-bar" style="width:64px;height:16px"></div></div></div><div class="app-shell-main"><div class="app-shell-navbar"><div class="app-shell-bar" style="width:106px;height:27px"></div><div class="app-shell-bar" style="width:111px;height:32px"></div></div><div class="app-shell-logo"><svg width="96" height="96" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M16.768 0.0270284C16.571 -0.055168 16.348 0.0572476 16.2913 0.267574C16.2713 0.342517 16.2489 0.417461 16.2253 0.491196C16.0094 1.15723 15.6459 1.76645 15.148 2.27776C14.3056 3.14203 13.1847 3.61949 11.9918 3.6207H11.9883C10.7978 3.6207 9.67689 3.14565 8.83445 2.2838C8.33653 1.7737 7.97077 1.16448 7.75367 0.499657C7.73007 0.425922 7.70765 0.350979 7.68641 0.276035C7.62978 0.065709 7.40678 -0.0454978 7.20974 0.0366985C6.05463 0.522624 4.98565 1.17899 4.0323 1.97436C3.91195 2.07468 3.87301 2.24512 3.93083 2.39259C3.9792 2.51589 4.03112 2.63797 4.08539 2.75764C4.51133 3.70894 5.10364 4.5853 5.84815 5.34682C7.48937 7.0246 9.66863 7.9493 11.9871 7.9493H11.9954C14.3162 7.94689 16.4978 7.01855 18.1379 5.33595C18.8812 4.57321 19.4711 3.69564 19.8959 2.74434C19.9502 2.62347 20.0009 2.50138 20.0493 2.37809C20.1071 2.23062 20.0682 2.06018 19.9478 1.95985C18.9933 1.16569 17.9231 0.511745 16.768 0.0270284Z"/><path d="M19.9102 21.2422C19.4843 20.2933 18.8931 19.4194 18.151 18.6603C16.5086 16.9801 14.3223 16.053 12.0038 16.0578C8.50304 16.0614 5.48371 18.1961 4.11031 21.2603C4.05722 21.38 4.0053 21.5009 3.95575 21.623C3.89675 21.7704 3.93569 21.9421 4.05722 22.0436C5.01175 22.8366 6.08073 23.4893 7.23466 23.9728C7.4317 24.055 7.65352 23.9438 7.71134 23.7335C7.73139 23.6573 7.75381 23.5836 7.77859 23.5086C8.37207 21.6979 10.0416 20.3888 12.0073 20.3864H12.012C13.2025 20.3864 14.3234 20.8614 15.1659 21.7233C15.6626 22.231 16.026 22.8378 16.2431 23.5002C16.2679 23.5739 16.2903 23.6489 16.3104 23.7238C16.3682 23.9341 16.59 24.0453 16.787 23.9619C17.9422 23.476 19.01 22.8209 19.9633 22.0255C20.0837 21.9252 20.1226 21.7535 20.0648 21.606C20.0164 21.4828 19.9645 21.3631 19.9102 21.2422Z"/><path d="M0.132148 10.1666C0.158105 9.98769 0.305591 9.85352 0.482575 9.85352L23.5093 9.81726C23.6863 9.81726 23.8338 9.95022 23.8609 10.1291C23.9518 10.7347 23.999 11.3548 23.999 11.9858C24.0001 12.6131 23.9541 13.2284 23.8668 13.8292C23.8408 14.0081 23.6934 14.1422 23.5164 14.1422L0.489654 14.1773C0.312671 14.1773 0.165185 14.0443 0.138047 13.8654C0.0471956 13.2598 0 12.6397 0 12.0088C0 11.3826 0.0448358 10.7673 0.132148 10.1666Z"/></svg></div></div></div></body></html>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/web-app-ui",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.88-dev",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist/**/*"
|
|
6
6
|
],
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"@sentry/core": "^9.42.1",
|
|
28
28
|
"@sentry/react": "^9.42.1",
|
|
29
29
|
"@stripe/stripe-js": "^4.4.0",
|
|
30
|
-
"@zeniai/client-analytics": "2.0.
|
|
31
|
-
"@zeniai/client-epic-state": "5.1.
|
|
32
|
-
"@zeniai/web-components": "4.2.
|
|
30
|
+
"@zeniai/client-analytics": "2.0.31",
|
|
31
|
+
"@zeniai/client-epic-state": "5.1.24",
|
|
32
|
+
"@zeniai/web-components": "4.2.8",
|
|
33
33
|
"color": "3.1.3",
|
|
34
34
|
"cross-fetch": "^4.0.0",
|
|
35
35
|
"crypto-js": "4.2.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./liveblocks-B2D23g1h.js";import{A as d}from"./AddressScreen-CFbhgIGJ.js";import i from"./NotFoundScreen-DKRpU5d2.js";import"./sentry-BQ1KU1t3.js";import{o as s,p as r}from"./core-FEzHdTwu.js";import"./zeni-epic-state-Bxb-N0Vf.js";import"./recharts-CIXkvtnT.js";import"./index-sOa-ivVp.js";import"./mui-C754KMjM.js";import"./analytics-BY30ztud.js";import"./plaid--k8gbxl0.js";import"./dnd-Cb_vPZwC.js";import"./stripe-DMRn4zHo.js";import"./lottie-BKshFrBj.js";import"./lexical-fJeYHrZP.js";import"./pdf-BSvba1pn.js";import"./utils-C8oTXAPM.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="cd0ff2b4-1e27-4329-addf-f475e5a9db34",t._sentryDebugIdIdentifier="sentry-dbid-cd0ff2b4-1e27-4329-addf-f475e5a9db34")}catch{}})();function _(){return e.jsxs(s,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(d,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(d,{})}),e.jsx(r,{path:"*",element:e.jsx(i,{})})]})}export{_ as default};
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import{j as c}from"./liveblocks-B2D23g1h.js";import{u as me,j as i,h as le,g as he,i as Ve,N as oa,s as _t,n as Pe,t as Dn,o as ss,p as ce}from"./core-FEzHdTwu.js";import{f8 as Pt,RW as cs,fk as wt,bt as Fe,RX as os,RY as is,eZ as hn,RZ as _n,f6 as Pn,R_ as wn,R$ as vn,S0 as Tn,S1 as Fn,f7 as xn,fj as Bn,S2 as Ln,S3 as ds,fd as ls,fc as us,S4 as ms,C5 as Rn,fm as ia,S5 as Cs,S6 as ps,e$ as hs,e_ as fs,fz as Ye,ff as On,fe as Un,S7 as gs,fg as Ss,BC as bs,BB as ys,BF as Is,BH as ks,fs as Es,eW as jn,S8 as As,S9 as Ds,fx as Mn,Sa as _s,fy as yt,BN as Ps,BK as ws,eX as ge,Sb as qa,fC as xe,fD as Be,fE as Le,gw as da,cv as la,Sc as ua,Sd as vt,uT as $a,kF as za,Se as Ya,Cl as ka,fn as Qe,Cn as Tt,kv as Nn,Sf as ma,C9 as _a,Sg as vs,Sh as Ts,Cc as Qa,Si as Fs,Qi as Xa,fi as Vn,Ci as Sa,hV as xs,Sj as Hn,f9 as Ca,bo as Bs,Sk as Ls,gh as Ja,gg as et,CR as Rs,gf as at,P_ as Os,Sl as Gn,co as $n,cQ as Us,Qh as wa,Dq as zn,Sm as fn,D0 as Pa,Sn as Yn,Dr as js,QG as Ms,Ds as Ns,Ex as Vs,ub as Hs,Er as Gs,So as $s,Cm as sa,Sp as zs,Sq as Ys,Sr as Ws,Ss as Ks,St as Zs,Su as Ft,Sv as qs,CC as Wn,Cv as Qs,Sw as Xs,gy as Js,CL as Kn,CP as Zn,gx as ec,Sx as ac,Dc as qn,Sy as tc,Sz as nc,SA as rc,CN as Qn,Cy as Xn,Cf as Jn,CH as er,CF as ar,CJ as sc,SB as tr,SC as cc,fu as oc,fv as ic,fw as dc,SD as tt,fo as nr,cS as xt,SE as lc,SF as uc,SG as mc,SH as Cc,CX as It,Dj as pc,Df as hc,CT as fc,Dh as gc,D7 as Sc,D9 as bc,SI as rr,Dp as Ga,Kg as yc,SJ as Ic,SK as kc,SL as Ec,SM as sr,SN as Ac,DM as Dc,C$ as cr,CW as Ne,C_ as _c,SO as Pc,SP as wc,C6 as vc,SQ as or,fh as ir,SR as Tc,C8 as Fc,C7 as gn,SS as xc,ST as Bc,SU as Lc,MN as Rc,SV as Bt,SW as Oc,xU as dr,ld as Uc,hL as jc,DR as Mc,SX as lr,f3 as Nc,f4 as Vc,SY as Hc,dj as Gc,fl as $c,DH as zc,DB as qe,bs as Yc,bJ as Wc,cA as Kc,bK as Zc,L_ as qc}from"./zeni-epic-state-Bxb-N0Vf.js";import{j as Re,cr as ur,p as we,cs as mr,ct as Cr,cu as Qc,a as Je,a0 as Lt,cv as Xc,cw as Jc,Y as pr,c as hr,$ as fr,q as ye,C as ue,U as W,ar as ya,cx as gr,cy as eo,cz as ao,z as te,B as va,cg as nt,cA as to,cB as no,cC as ro,K as Ta,aS as We,bt as Rt,cD as so,E as Fa,h as rt,y as Ot,d as J,a9 as st,cE as co,bG as ba,cF as kt,cG as oo,x as Ut,cH as io,au as Sr,a4 as Et,cI as lo,Z as br,R as uo,f as yr,cJ as mo,cK as Co,cL as po,cM as ho,cN as fo,cO as go,cP as So,o as Wa,cQ as bo,cR as yo,cS as ht,v as Io,cT as ko,cU as Eo,cV as Ao,cW as Do,cX as _o,i as Po}from"./index-sOa-ivVp.js";import{n as He,D as Ir,S as wo}from"./mui-C754KMjM.js";import{a as r}from"./sentry-BQ1KU1t3.js";import{u as xa}from"./useAskAiCfoHostNavButtonProps-ByAiXj6b.js";import{M as Ie}from"./MobileAppDrawer-lEpfHv06.js";import{d as jt}from"./recharts-CIXkvtnT.js";import{g as _e,a as Ba,b as kr,c as Oe,d as Ue,e as Xe,f as ea,h as aa,A as vo,i as Mt,P as To,j as Nt,s as Ia,k as Er,l as ca,m as Ar,n as Fo,o as Dr,p as xo,S as Sn}from"./SetupPagesScreen-Xht4iwXu.js";import{u as _r}from"./useInitialThreadRequest-Bzg53f4k.js";import ct from"./NotFoundScreen-DKRpU5d2.js";import{u as Vt}from"./useChargeCardPusherEvents-DKTUgdDs.js";import{n as bn}from"./utils-C8oTXAPM.js";import{t as Bo}from"./AddressScreen-CFbhgIGJ.js";import"./analytics-BY30ztud.js";import"./plaid--k8gbxl0.js";import"./dnd-Cb_vPZwC.js";import"./stripe-DMRn4zHo.js";import"./lottie-BKshFrBj.js";import"./lexical-fJeYHrZP.js";import"./pdf-BSvba1pn.js";import"./analyticsHelper-BHJAp8-8.js";import"./routePaths-C_agWIhF.js";import"./BusinessVerificationPageScreen-CL6awpAL.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="ab8c60e7-5dc0-4c3f-8847-ef548174d076",e._sentryDebugIdIdentifier="sentry-dbid-ab8c60e7-5dc0-4c3f-8847-ef548174d076")}catch{}})();const Lo=e=>{const n=e.cardHolderUser,t=`${n.firstName??""} ${n.lastName??""}`.trim()||n.email||n.userId;return{userId:n.userId,displayName:t,roleLabel:e.cardHolderRoles?.titleAtCompany}},Pr=e=>({id:e.id,isChecked:!1,cardName:e.cardName,last4:e.accountLast4,limitAmount:e.limit?.amount??0,limitCadence:e.creditLimitFrequency?.code,owner:Lo(e),utilizationAmount:(e.limit?.amount??0)-(e.available?.amount??0)});function wr(){const e=me(),n=i(a=>Pt(a.cardPolicyState)),t=i(a=>cs(a.cardPolicyState));r.useEffect(()=>{t!==""||n==="Completed"&&t===""||n==="In-Progress"||e(wt())},[e,n,t])}const{spendManagement:{chargeCard:{cardPolicyPage:yn}}}=Je.getLocalizedStrings(),Ro=e=>On(e,!1),Oo=e=>Un(e.name,!1);function Uo(){const e=le(),n=he(),{tenantEmailDomain:t}=Ve(),a=me(),s=Re(),b=Fe(s?.loggedInUserRoleMap),[g,S]=r.useState(!1),P=r.useCallback(A=>{S(A)},[]),m=r.useCallback(()=>{P(!0)},[P]),{isAiCfoAccessEnabled:C,onAskAiCfoClick:F}=xa({mobileExploreReferrer:"Card Policy"});r.useEffect(()=>()=>{a(os()),a(is()),a(hn())},[a]);const v=i(A=>_n(A.cardPolicyState)),l=i(A=>Pn(A.cardPolicyState)),M=i(A=>wn(A.cardPolicyState)),B=i(A=>vn(A.cardPolicyState)),L=i(A=>Tn(A.cardPolicyState)),p=i(A=>Fn(A.cardPolicyState)),h=i(A=>xn(A.cardPolicyState)),T=i(A=>Pt(A.cardPolicyState)),u=i(A=>A.chargeCardConfigState.receiptRequiredAboveAmount.amount),w=i(A=>A.chargeCardConfigState.fetchState);r.useEffect(()=>{v!=="Completed"&&v!=="In-Progress"&&a(Bn())},[a,v]),wr();const E=i(A=>Ln(A.createCardPolicyState)),U=i(A=>ds(A.createCardPolicyState)),y=i(A=>ls(A.cardPolicyState)),k=i(A=>us(A.cardPolicyState)),x=i(A=>ms(A.createCardPolicyState)),d=i(A=>Rn(A));r.useEffect(()=>{d.fetchState==="Not-Started"&&a(ia(!1,!1,!1))},[d.fetchState,a]);const f=r.useMemo(()=>l.map(Ro),[l]),j=r.useMemo(()=>h.map(Oo),[h]),H=r.useMemo(()=>d.cards.filter(A=>!ur(A.status.code)).map(Pr),[d.cards]),O=v==="Completed"&&d.fetchState==="Completed"&&w==="Completed";r.useEffect(()=>{O&&x==null&&a(Cs({cardsMasterList:H,defaultRequireReceiptAmount:u,suggestedAllowMerchants:M,suggestedBlockMerchants:B,suggestedAllowCategories:L,suggestedBlockCategories:p}))},[w,a,O,x,H,u,M,B,L,p]);const R=r.useMemo(()=>jt(A=>{a(wt(A))},250),[a]);r.useEffect(()=>()=>{R.cancel()},[R]);const z=r.useCallback(A=>{R(A)},[R]),$=E.fetchState,_=t!=null?`/${t}/cards/policy`:"..",D=r.useCallback(()=>{const A=we(n.state?.pathnameStackToGoBack),Z=A.poppedPathname??_;e(Z,{state:{pathnameStackToGoBack:A.newStack}})},[n.state,e,_]),G=r.useCallback(()=>{e(_)},[e,_]),Q=r.useCallback(A=>{a(ps(A))},[a]),I=r.useCallback(A=>{const Z=mr(A);a(hs({templates:[Z]}))},[a]),N=r.useCallback(A=>{A.length!==0&&a(fs(A))},[a]),K=r.useCallback(()=>{a(hn())},[a]),X=r.useRef($);r.useEffect(()=>{const A=X.current;X.current=$,$==="Completed"&&A!=="Completed"&&U!=null&&(a(Ye({messageSection:"card_policy_created",messageText:"success",type:"success"})),e(_))},[a,$,U,e,_]);const o=$==="Error"?E.error?.message??yn.createPolicyGenericErrorMessage:void 0;return b&&t!=null?x==null?c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:g,handleDrawerToggle:P}),c.jsx(Cr,{showUploadDocumentSection:!0,navBarTitle:yn.createPageTitle,onBackClick:D,onClickMenuIcon:m,isAiCfoAccessEnabled:C,onAskAiCfoClick:F})]}):c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:g,handleDrawerToggle:P}),c.jsx(Qc,{formDraft:x,vendorSearchOptions:j,categorySearchOptions:f,isVendorSearchLoading:T==="In-Progress",onVendorSearchTextChange:z,submitState:$,submitErrorMessage:o,documentUploadState:y,uploadedFileName:k,isAiCfoAccessEnabled:C,onAskAiCfoClick:F,onBackClick:D,onCancelClick:G,onClickMenuIcon:m,onFormChange:Q,onSubmit:I,onUploadDocument:N,onRemoveDocument:K})]}):c.jsx(oa,{to:"..",replace:!0})}const{spendManagement:{chargeCard:{cardPolicyPage:jo}}}=Je.getLocalizedStrings(),Mo=e=>On(e,!1),No=e=>Un(e.name,!1);function Vo(){const e=le(),n=he(),{tenantEmailDomain:t,templateId:a}=Ve(),s=me(),b=Re(),g=Fe(b?.loggedInUserRoleMap),[S,P]=r.useState(!1),m=r.useCallback(o=>{P(o)},[]),C=r.useCallback(()=>{m(!0)},[m]),{isAiCfoAccessEnabled:F,onAskAiCfoClick:v}=xa({mobileExploreReferrer:"Card Policy"}),l=i(o=>gs(o)),M=i(o=>_n(o.cardPolicyState)),B=i(o=>Pn(o.cardPolicyState)),L=i(o=>wn(o.cardPolicyState)),p=i(o=>vn(o.cardPolicyState)),h=i(o=>Tn(o.cardPolicyState)),T=i(o=>Fn(o.cardPolicyState)),u=i(o=>xn(o.cardPolicyState)),w=i(o=>Pt(o.cardPolicyState)),E=i(o=>Rn(o)),U=i(o=>a!=null?Ss(o.cardPolicyState,a):void 0),y=r.useMemo(()=>l.templateId===a&&l.formDraft!=null?l.formDraft:U!=null?bs(U):void 0,[l.templateId,l.formDraft,U,a]);r.useEffect(()=>{if(a==null)return;const o=l.detailFetchState.fetchState;l.templateId===a&&(o==="Completed"||o==="In-Progress")||U!=null||s(ys(a))},[s,a,l.templateId,l.detailFetchState.fetchState,U]),r.useEffect(()=>{M!=="Completed"&&M!=="In-Progress"&&s(Bn())},[s,M]),wr();const k=i(o=>o.chargeCardConfigState.receiptRequiredAboveAmount.amount);r.useEffect(()=>{E.fetchState==="Not-Started"&&s(ia(!1,!1,!1))},[E.fetchState,s]);const x=r.useMemo(()=>B.map(Mo),[B]),d=r.useMemo(()=>u.map(No),[u]),f=r.useMemo(()=>E.cards.filter(o=>!ur(o.status.code)).map(Pr),[E.cards]);Lt({isDataReady:y!=null});const j=r.useMemo(()=>{if(y!=null)return Xc({draft:y,cardRows:f,categorySearchOptions:x,vendorSearchOptions:d,defaultRequireReceiptAmount:k,suggestedAllowMerchants:L,suggestedBlockMerchants:p,suggestedAllowCategories:h,suggestedBlockCategories:T})},[y,f,x,d,k,L,p,h,T]),[H,O]=r.useState(void 0),R=r.useRef(!1);r.useEffect(()=>{R.current||H!=null||j==null||(R.current=!0,O(j))},[H,j]);const z=r.useCallback(o=>{O(o)},[]),$=r.useMemo(()=>jt(o=>{s(wt(o))},250),[s]);r.useEffect(()=>()=>{$.cancel()},[$]);const _=r.useCallback(o=>{$(o)},[$]),D=l.updateFetchState.fetchState,G=t!=null?`/${t}/cards/policy`:"..",Q=r.useCallback(()=>{const o=we(n.state?.pathnameStackToGoBack),A=o.poppedPathname??G;e(A,{state:{pathnameStackToGoBack:o.newStack}})},[n.state,e,G]),I=r.useCallback(()=>{e(G)},[e,G]),N=r.useCallback(o=>{if(a==null)return;const A=mr(o);s(Is(A)),s(ks(a))},[s,a]),K=r.useRef(D);r.useEffect(()=>{const o=K.current;K.current=D,D==="Completed"&&o!=="Completed"&&(s(Ye({messageSection:"card_policy_updated",messageText:"success",type:"success"})),e(G))},[s,D,e,G]);const X=D==="Error"?l.updateFetchState.error?.message??jo.updatePolicyGenericErrorMessage:void 0;return!g||t==null||a==null?c.jsx(oa,{to:"..",replace:!0}):H!=null&&M==="Completed"&&E.fetchState==="Completed"?c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:S,handleDrawerToggle:m}),c.jsx(Jc,{templateName:l.template?.name??"",formDraft:H,vendorSearchOptions:d,categorySearchOptions:x,isVendorSearchLoading:w==="In-Progress",onVendorSearchTextChange:_,submitState:D,submitErrorMessage:X,isAiCfoAccessEnabled:F,onAskAiCfoClick:v,onBackClick:Q,onCancelClick:I,onClickMenuIcon:C,onFormChange:z,onSubmit:N})]}):c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:S,handleDrawerToggle:m}),c.jsx(Cr,{showUploadDocumentSection:!1,navBarTitle:l.template?.name,onBackClick:Q,onClickMenuIcon:C,isAiCfoAccessEnabled:F,onAskAiCfoClick:v})]})}function vr(e,n,t){return n?e.filter(a=>a!=null&&a.trim().length>0).slice(0,t):[]}function Tr(e){return i(n=>e==null||e===""?{chips:ft,isResolved:!1}:function(t){const a=t?.fetchState,s=a==="Completed"||a==="Error";return{chips:a==="Completed"?t?.suggestedQuestions??ft:ft,isResolved:s}}(Es(n,e)),_t)}const ft=[],{spendManagement:{chargeCard:{cardPolicyAiCfoHero:{headline:Ho,subheadline:Go,pageTitle:$o}}}}=Je.getLocalizedStrings(),zo=e=>{const n=e.cardsCount>0?e.cardsCount:e.appliedCards.length,t=e.allowedEntity.merchantNames.length+e.blockedEntity.merchantNames.length,a=e.allowedEntity.categoryCodes.length+e.blockedEntity.categoryCodes.length;return{templateId:e.templateId,name:e.name,description:e.description,mode:e.mode==="flexible"?"flexible":"strict",createdAtFormatted:e.createdAt.format("ll"),cardsCount:n,vendorRestrictionsCount:t,categoryRestrictionsCount:a}};function Yo(){const e=le(),n=he(),{tenantEmailDomain:t}=Ve(),a=me(),s=Re(),b=Fe(s?.loggedInUserRoleMap),[g,S]=r.useState(!1),P=r.useCallback(_=>{S(_)},[]),m=r.useCallback(()=>{P(!0)},[P]),{useFeatureGate:C}=ue(),{isFeatureEnabled:F}=C(W.isAiCfoFileUploadEnabled),{isFeatureEnabled:v}=C(W.isCardPolicyEnabled),{isAiCfoAccessEnabled:l,onAskAiCfoClick:M}=xa({mobileExploreReferrer:"Card Policy"}),B=i(_=>As(_)),L=i(_=>Ln(_.createCardPolicyState)),p=i(_=>Ds(_.createCardPolicyState)),h=i(_=>p==null?[]:Mn(_.aiCfoState,p).filter(D=>D.kind==="creating_policy"),_t),T=L.fetchState==="In-Progress"?Math.max(h.length,1):0,u=i(_=>_s(_.createCardPolicyState)),w=ya(L.fetchState);r.useEffect(()=>{if(w==="In-Progress"&&L.fetchState==="Completed"&&p!=null)h.forEach(_=>{a(yt({chatSessionId:p,id:_.id,entityIds:u,kind:"created_policy"}))});else if(w==="In-Progress"&&L.fetchState==="Error"&&p!=null){h.forEach(D=>{a(yt({chatSessionId:p,id:D.id,kind:"errored_policy"}))});const _=L.error?.message!=null&&L.error.message.length>0?L.error.message:Je.getLocalizedStrings().common.errorMessage.somethingWentWrongPleaseTryAgain;a(Ye({messageSection:"card_policy_created",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"_api-error_",variableValue:_}]}))}},[L.error?.message,L.fetchState,a,p,u,h,w]);const E=B.fetchState.fetchState;r.useEffect(()=>{E!=="Not-Started"&&E!=="Error"||a(Ps())},[a,E]);const U=B.archiveFetchState.fetchState,y=ya(U);r.useEffect(()=>{y==="In-Progress"&&U==="Completed"&&a(Ye({messageSection:"card_policy_deleted",messageText:"success",type:"success"}))},[U,a,y]);const k=r.useMemo(()=>B.templates.map(zo),[B.templates]);Lt({isDataReady:B.fetchState.fetchState==="Completed"});const x=k.length>0||T>0,d=function(_){const{hasAnyPolicies:D,isChargeCardAdmin:G,isFileUploadEnabled:Q}=_,I=le(),N=he(),{tenantEmailDomain:K}=Ve(),{isAiCfoOpen:X,setIsAiCfoOpen:o}=pr(),A=hr(),Z=fr(),ne=i(oe=>jn(oe)).createSessionAndSubmitState.fetchState==="In-Progress",{chips:q,isResolved:ke}=Tr("card_policy"),ve=r.useMemo(()=>vr(q,ke,3),[q,ke]),[fe,se]=r.useState(""),Ee=Z&&A&&K!=null&&!X,re=r.useCallback(oe=>{if(K==null)return;const fa=ye(N.state?.pathnameStackToGoBack,N.pathname);I(`/${K}/cards/ask`,{state:{message:"",origin:"",pathnameStackToGoBack:fa,referrer:"card_policy_hero",aiCfoInitialQuestion:oe,aiCfoShouldSubmit:oe!=null&&oe.trim().length>0}})},[N.pathname,N.state,I,K]),Ce=r.useCallback(oe=>{oe.trim().length!==0&&(se(""),re(oe))},[re]),Ae=r.useCallback(()=>{const oe=fe.trim();oe.length!==0&&(se(""),re(oe))},[fe,re]),ee=r.useCallback(()=>{},[]),Te=r.useCallback(oe=>{se(oe)},[]),De=r.useCallback(()=>{o(!0)},[o]),ae=r.useCallback(()=>{re(void 0)},[re]);return r.useMemo(()=>{if(Ee&&!D&&G)return{aiAgentName:$o,headline:Ho,subheadline:Go,promptChips:ve,composer:{currentInput:fe,isSubmitting:ne,isFileUploadEnabled:Q,onInputChange:Te,onSubmit:Ae,onStopSubmit:ee},onPromptClick:Ce,onOpenSidePanel:De,onOpenFullView:ae,dataTestIdPrefix:"card-policy-ai-cfo-hero"}},[fe,D,Ee,G,Q,ne,Te,ae,De,Ce,ee,Ae,ve])}({hasAnyPolicies:x,isChargeCardAdmin:b,isFileUploadEnabled:F}),f=v&&d!=null?c.jsx(gr,{...d}):null,j=l&&f==null,H=r.useCallback(()=>{const _=we(n.state?.pathnameStackToGoBack),D=_.poppedPathname??"..";e(D,{state:{pathnameStackToGoBack:_.newStack}})},[n.state,e]),O=r.useCallback(()=>{t!=null&&e(`/${t}/cards/policy/new`)},[e,t]),R=r.useCallback(_=>{t!=null&&e(`/${t}/cards/policy/${_}/edit`)},[e,t]),z=r.useCallback(_=>{a(ws(_))},[a]),$=B.fetchState.fetchState;return!x&&$!=="Completed"&&$!=="Error"?c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:g,handleDrawerToggle:P}),c.jsx(eo,{onBackClick:H,onNewPolicyClick:O,onClickMenuIcon:m,isAiCfoAccessEnabled:l,onAskAiCfoClick:M})]}):c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:g,handleDrawerToggle:P}),c.jsx(ao,{policies:k,archivingTemplateId:B.archiveTargetTemplateId,pendingCreationCount:T,onBackClick:H,onNewPolicyClick:O,onEditPolicyClick:R,onArchivePolicyClick:z,onClickMenuIcon:m,policyAiCfoHero:f,isAiCfoAccessEnabled:j,onAskAiCfoClick:M})]})}function Wo(){const e=le(),{cardId:n}=Ve(),t=me(),a=te.getSignedInUser(),s=i(q=>ge(q)),b=Re(),g=Fe(b?.loggedInUserRoleMap),{useFeatureGate:S}=ue();if(a==null)throw Error("Can't access Add To Wallet Page without signing in...");const[P,m]=r.useState(!1),C=i(q=>qa(q).firstViewAfterActivation);if(n==null)throw Error("Empty card id is not valid...");const F=s.userRole.includes("charge_card_user"),{isFeatureEnabled:v}=S(W.isChargeCardFeatureEnabled),l=!!s.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:M}=S(W.isDebitCardFeatureEnabled),B=xe(s),L=Be(s),p=Le(M,s),h=s.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,T=Oe({isDebitCardFeatureEnabled:M,isBankingOnlyTenant:p}),u=Ue({isCardsOnlyTenant:B,isChargeCardFeatureEnabled:v,isBookKeepingTenant:L,isDebitCardProductVisible:T,chargeCardsCreditAccountLimit:h}),w=!!s.companyDebitCardInfo?.info?.isDebitCardEnabled,E=i(q=>da(q,s.companyId)),U=la(E.controllers),{creditAccount:y,creditAccountRepayment:k}=i(q=>ua(q)),x=i(q=>q.classListState.fetchState),d=!F&&u&&l,f=i(q=>vt(q,n,d,u)),[j,H]=r.useState(!1),O=f.chargeCard,R=O?.cardCreatedByUser?.userId,z=i(q=>R!=null?$a(q.userRoleState,R):void 0),$=z?.accountingClassIDs[0],_=i(q=>$!=null?za(q.classState,{classId:$,reportId:"class_list"}):void 0),D=O?.cardHolderUser?.userId,G=i(q=>D!=null?$a(q.userRoleState,D):void 0),Q=G?.accountingClassIDs[0],I=i(q=>Q!=null?za(q.classState,{classId:Q,reportId:"class_list"}):void 0),N=O?.type.code==="business_physical_credit_card"||O?.type.code==="business_physical_debit_card",K=O?.type.code==="business_physical_debit_card";r.useEffect(()=>{C&&P===!1&&N&&(m(!0),setTimeout(()=>{t(Ya()),K&&t(Ye({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[C,P,N,K]),r.useEffect(()=>{j||f.fetchState==="Completed"||f.fetchState==="In-Progress"||n==null||(H(!0),t(ka(n,d,!1)))},[j,f,n,t]),r.useEffect(()=>{if(f.fetchState==="Completed"&&(N===!1||N&&O?.status?.code!=="active"||O?.cardHolderUserId!==a.userId||C===!1&&P===!1||O?.type.code==="business_physical_debit_card"||O?.type.code==="business_virtual_debit_card")){const q=_e(s.tenantEmailDomain,n,a,O,C);e(q)}},[f.fetchState,C,N]),r.useEffect(()=>{y.fetchState!=="Completed"&&y.fetchState!=="In-Progress"&&u&&l&&g&&t(Qe()),k.fetchState!=="Completed"&&k.fetchState!=="In-Progress"&&u&&l&&g&&t(Tt()),x!=="Completed"&&x!=="In-Progress"&&t(Nn())},[y.fetchState,k.fetchState,t,u,l,g,x]);const X=()=>{if(a!=null&&n!=null){t(Ya());const q=_e(s.tenantEmailDomain,n,a);e(q)}},o=O?.type.code==="business_physical_debit_card"||O?.type.code==="business_virtual_debit_card",A=Xe(u,T,w,l),Z=Ba(u,l,g,y,k),ne=kr(o,f);return f.fetchState!=="Completed"?c.jsx(va,{fetchState:"In-Progress"}):c.jsxs(c.Fragment,{children:[c.jsx(nt,{showConfetti:C}),c.jsx(to,{onGotItClick:X,isDebitCard:O?.type.code==="business_physical_debit_card",controllerEmails:U,isChargeCardFeatureEnabled:u,isDebitCardFeatureEnabled:T,isDebitCardSetupEnabled:w,isChargeCardSetupEnabled:l,productInformation:A,creditAccountInformation:Z,debitAccountInformation:ne,chargeCardDetailView:f,creditAccount:y,classListFetchState:x,creditAccountRepayment:k,cardIssuedByRoles:z?.userRoles,cardIssuedByDepartmentName:_?.className,cardHolderRoles:G?.userRoles,cardHolderDepartmentName:I?.className})]})}const Fr="charge-card-transaction-update",xr="charge-card-transaction-created",Br="charge-card-transaction-declined",Lr="charge-card-transaction-updated",Rr="charge-card-transaction-receipt-uploaded",pa="charge-card-status-update",Ht="charge-card-spending-updated",ot="credit-account-balance-updated",it="charge-card-created",Gt="charge-card-limit-updated",$t="charge-card-limit-reset",zt="charge-card-renamed",Ko="charge-card-department-updated",Or="charge-card-repayment-completed",Ur="charge-card-payment-date-updated",La="charge-card-cashback-redeemed",Ra="charge-card-cashback-earned",ha=(e,n)=>e==null||e===""?[]:n.map(t=>`private-encrypted-${e}.${t}`),Zo=[Ra,La],qo=Pe(function(e){const n=ma(e);return{insightsData:n.insight,cashbackByPeriod:n.cashbackByPeriod,uiState:n.uiState,cashbackSummary:n.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(n,t)=>{e(vs({uiState:{sortKey:n,sortOrder:t}}))}}})(ro);function Qo(){const e=le(),n=me(),t=he(),a=te.getSignedInUser(),s=i(M=>ge(M)),{useFeatureGate:b}=ue(),{isFeatureEnabled:g}=b(W.isCardsCommentingEnabled),[S,P]=r.useState(!1),m=i(M=>ma(M)),C=_r(s.companyId,{clearParams:m.fetchState==="Completed"}),F=r.useCallback(()=>{const M=we(t.state?.pathnameStackToGoBack),B=M.poppedPathname??Xo(s.tenantEmailDomain);e(B,{state:{pathnameStackToGoBack:M.newStack}})},[e,t,s.tenantEmailDomain]),v=ea(s);if(Vt({events:ha(v,Zo),onEvent:M=>{switch(M){case Ra:case La:return void n(_a(!0))}},onSubscribed:()=>{n(_a(!0))}}),r.useEffect(()=>{S||m.fetchState==="Completed"||m.fetchState==="In-Progress"||(P(!0),n(_a()))},[S,m,n]),a==null)throw Error("Can't access cashback detail page without signing in...");const l=m.cashbackSummary?.cashbackEarned?.amount!=null&&m.fetchState!=="Not-Started";return m.fetchState!=="In-Progress"||l?(m.cashbackSummary?.cashbackEarned?.amount??0)===0&&m.fetchState==="Completed"?c.jsx(ct,{}):c.jsx(qo,{onBackClick:F,isCardsCommentingEnabled:g,initialOpenThreadRequest:C}):c.jsx(no,{onBackClick:F})}const Xo=e=>`/${e}/cards`,Jo={containerWidth:new Fa(100,58)},ei=({appContent:e})=>{const n=Ta(),t=me(),a=le(),{cardId:s}=Ve(),b=he(),{useDynamicConfig:g}=ue(),[S,P]=r.useState(!1),[m,C]=r.useState(!1),[F,v]=r.useState(!1),[l,M]=r.useState(!1),B=te.getSignedInUser();if(B==null)throw Error("Can't access onboarding card page without signing in...");const L=i(I=>ge(I));if(s==null)throw Error("Empty card id is not valid...");const{configValue:p}=g(We.zeniCardsConfig),h=p.max_charge_card_activation_attempts_by_card_id,T=i(I=>Ts(I,s)),u=T.chargeCard,w=i(I=>I.chargeCardConfigState.fetchState),{useFeatureGate:E}=ue(),{isFeatureEnabled:U}=E(W.isChargeCardFeatureEnabled),{isFeatureEnabled:y}=E(W.isDebitCardFeatureEnabled),k=Le(y,L),x=Oe({isDebitCardFeatureEnabled:y,isBankingOnlyTenant:k}),d=!!L.companyChargeCardInfo?.info?.isChargeCardEnabled,f=L.userRole.includes("charge_card_user"),j=xe(L),H=Be(L),O=L.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,R=Ue({isCardsOnlyTenant:j,isChargeCardFeatureEnabled:U,isBookKeepingTenant:H,isDebitCardProductVisible:x,chargeCardsCreditAccountLimit:O}),z=!f&&R&&d;r.useEffect(()=>{S===!1&&w!=="In-Progress"&&w!=="Completed"&&(t(Qa()),P(!0)),m===!1&&T.fetchState==="Not-Started"&&(C(!0),t(ka(s,z,R)))},[m,T.fetchState,S,w]);const $=u?.type.code==="business_physical_credit_card"||u?.type.code==="business_physical_debit_card";r.useEffect(()=>{if(T.fetchState==="Completed"){if(F===!1&&($===!1||$&&u?.status?.code!=="inactive"||u?.cardHolderUserId!==B.userId)){const I=_e(L.tenantEmailDomain,s,B,u,!0),N=ye(b.state?.pathnameStackToGoBack,b.pathname);a(I,{state:{pathnameStackToGoBack:N}})}else if(F&&T.isRefreshingViewInBackground===!1&&u?.status?.code==="active"){t(Fs({chargeCardId:s}));const I=_e(L.tenantEmailDomain,s,B,u,!0),N=ye(b.state?.pathnameStackToGoBack,b.pathname);t(Xa()),a(I,{state:{pathnameStackToGoBack:N}})}}},[T.fetchState,u?.type.code,F,T.isRefreshingViewInBackground]);const _=te.getZeniOtpTokenForCardHolder(s),D=i(I=>Vn(I.userState,B.userId)),G=()=>{u?.status?.code!=="active"&&t(Sa(s,!0))};r.useEffect(()=>{T.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&u?.cardActivationAttemptHistory.some(I=>I.statusCode==="success")===!0&&F===!1&&(setTimeout(G,3e3),v(!0))},[T.updatePhysicalChargeCardAttemptFetchState.fetchState,u?.cardActivationAttemptHistory]);const Q=I=>{M(I)};if(w!=="Completed"||u==null)return c.jsx(va,{fetchState:"In-Progress"});if(u.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(D?.phone==null)throw Error("Can't access user phone number.");return c.jsxs(ni,{children:[c.jsx(Ie,{isAppContentDrawerOpen:l,handleDrawerToggle:Q}),c.jsx(ai,{cardId:s,card:u,shippingAddressId:u.shippingAddressId,phone:D.phone,signedInUser:B,isSandboxEnv:Rt(),chargeCardDetailState:T,signedInUserToken:_,navigate:a,currentTenant:L,location:b,maxChargeCardActivationAttempts:h[s]!=null?h[s]:p.default_max_charge_card_activation_attempts!=null?p.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:p.charge_card_cashback_rate_per_transaction!=null?p.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{Q(!0)}}),e!=null?c.jsx(ti,{windowSize:n,children:e}):null]})},ai=Pe(function(e,{chargeCardDetailState:n,shippingAddressId:t,location:a,cardId:s}){const b=xs(e.addressState,t);if(b==null)throw Error("Can't access shippingAddress.");const g=Hn(e,s),S=n.updateStatus,P=Ca(e,!1,!1,!1);let m=!1;P.fetchState==="Completed"&&P.cards.length<=1&&(m=!0);const C=a.state?.message==="comingFromV2UrlPath";return{showActivatePage:n.chargeCard?.providerCardCreateTime!=null&&n.chargeCard.providerCardCreateTime.add(24,"h").isBefore(Bs())||C,showMenuIcon:m,shippingAddress:b,vgsVaultId:rt.cardVaultId,twoFAView:g,activationWaitStatus:S,isRefreshingViewInBackground:n.isRefreshingViewInBackground}},function(e,n){const{navigate:t,cardId:a,location:s,currentTenant:b,chargeCardDetailState:g}=n,S=g.chargeCard?.cardProviderID,{tenantEmailDomain:P}=b;return{onGetOtp:m=>{S!=null&&e(at(m,"ChargeCardHolder",a))},onUpdatePhysicalChargeCardAttempt:m=>{e(Rs(a,m))},onResendOtp:m=>{S!=null&&e(et(m,"ChargeCardHolder",a))},onVerifyOtp:(m,C)=>{S!=null&&e(Ja(m,C,"ChargeCardHolder",a))},onVerifyOtpSuccess:m=>{m!=null&&te.saveZeniOtpTokenForCardHolder(m,a)},onCVVActivateSuccess:()=>{e(Ls({chargeCardId:a}))},onBackClick:()=>{const m=we(s.state?.pathnameStackToGoBack),C=m.poppedPathname==null||m.poppedPathname.includes("onboard")===!0?aa(P):m.poppedPathname;t(C,{state:{pathnameStackToGoBack:m.newStack}})}}})(so),ti=He.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
width: ${e=>`${Jo.containerWidth.value(e.windowSize)}%`};
|
|
5
|
-
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
6
|
-
`,ni=He.div`
|
|
7
|
-
display: flex;
|
|
8
|
-
min-height: 100%;
|
|
9
|
-
width: 100%;
|
|
10
|
-
flex: 1 1 auto;
|
|
11
|
-
flex-direction: column;
|
|
12
|
-
align-items: center;
|
|
13
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
14
|
-
`,Ka=Je.getLocalizedStrings().dateFormat,ri={overlayWidth:new Fa(100,100,58)},jr=[Or,ot],si=new Set(jr),ci=Pe(function(e,n){const t=n.currentTenant?.companyId;return{plaidConnectionDetails:Ms(e,t,"zeni_accounts","external_account").plaidConnectionDetails,depositAccountListView:Ns(e.depositAccountState,e.depositAccountListState)}},function(e,n){const{navigate:t,currentTenant:a,hasZeniAccountsAdminAccess:s,isZeniAccountsUser:b,isCashbackInfoFetchStateCompleted:g,isCreditCardInfoFetchStateCompleted:S,isDebitCardInfoFetchStateCompleted:P,controllerEmails:m,paymentDetails:C,productInformation:F,cashbackInformation:v,paymentSourceInformation:l,creditAccountInformation:M,debitAccountInformation:B,paymentInitiatedDate:L,sourcePage:p}=n,{tenantEmailDomain:h}=a,T=()=>{e(zn(!0));const u=ea(a);u!=null&&u!==""&&e(Pa(u,!0,!0)),e(Qe(!0))};return{onBackNavigation:()=>{if(g&&S&&P&&v!=null&&J.trackCardsPayEarlyFormClick(m,F,v,"Back",C.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:C.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:C.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:C.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:C.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:L?.add(3,"day").format(Ka.visual.MMMDCommaYYYYformat),paymentInitiatedDate:L?.format(Ka.visual.MMMDCommaYYYYformat)},l,M,B),p==="cardPaymentHistory")n.closeDrawerHandler(!0),e(Yn());else{const u=aa(h);t(u)}},onUpdatePaymentAccountStatus:(u,w,E)=>{e(Gs(u,w,"bill_pay","bill_pay_detail",E))},onEstablishConnectionSuccess:()=>{e(Pa(a.companyId,!0))},onFetchLinkTokenClick:u=>{e(Hs("external_account",u))},onEstablishConnectionClick:u=>{e(Vs(u,a.companyId,"charge_card_payment","charge_cards"))},onSignUpAccountClick:()=>{s?window.open(`/${h}/checking/promo`,"_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onMoveMoneyClick:()=>{b?window.open(`/${h}/checking/transfer`):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onEventReceived:u=>{si.has(u)&&T()},onPusherSubscribed:T}})(st(co)),Yt=({isPaymentDrawerOpen:e,closeDrawerHandler:n,pageName:t,creditAccountSpentAmount:a,productInformation:s,sourcePage:b,creditAccountInformation:g,debitAccountInformation:S,cashbackInformation:P,isDebitCardInfoFetchStateCompleted:m,isCreditCardInfoFetchStateCompleted:C,isCashbackInfoFetchStateCompleted:F,paymentInitiatedDate:v,retryRepayment:l})=>{const M=le(),{useDynamicConfig:B}=ue(),{configValue:L}=B(We.zeniAccountsConfig),p=Os(L),h=i(A=>Gn(A)),{creditAccount:T}=i(A=>ua(A)),u=i(A=>ge(A)),w=Ot(),E=Ta(),U=me(),y=te.getSignedInUser(),k=Re(),[x,d]=r.useState(!1),[f,j]=r.useState(!1),{configValue:H}=B(We.zeniCardsConfig),O=H.credit_card_auto_pay_threshold_by_company_id?.[u.companyId]??H.default_credit_card_auto_pay_threshold??vo,R=$n(k?.loggedInUserRoleMap),z=Us(k?.loggedInUserRoleMap),$=!!u.companyZeniAccountInfo?.info?.isZeniAccountEnabled,_=i(A=>wa(A,u.companyId)),D=_.companyChargeCardInfo?.primaryFundingAccount,G=_.allFundingAccounts.find(A=>A.id===D?.accountId),Q=i(A=>da(A,u.companyId)),I=la(Q.controllers);r.useEffect(()=>{if(h.fetchState!=="Completed"&&h.fetchState!=="In-Progress"&&U(zn()),h.fetchState==="Completed"&&!f){const A=u.companyChargeCardInfo?.info?.primaryFundingAccount?.accountId,Z=h.transferFromAccounts.find(q=>q.id===A);let ne;if(b==="cardPaymentHistory"&&l){const q=l.paymentAccountId!=null?h.transferFromAccounts.find(ke=>ke.id===l.paymentAccountId):void 0;ne={amount:l.amount,isAutoRepayment:u.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,idempotencyKey:bn(),transferFrom:q??Z}}else ne={amount:{amount:T.balance.amount+T.hold.amount,currencyCode:T.balance.currencyCode,currencySymbol:T.balance.currencySymbol},isAutoRepayment:u.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,idempotencyKey:bn(),transferFrom:Z};U(fn(ne)),j(!0)}},[h.fetchState,f,b,l,h.transferFromAccounts,u.companyChargeCardInfo?.info?.primaryFundingAccount?.accountId,u.companyChargeCardInfo?.info?.isAutoPayEnabled,T.balance.amount,T.balance.currencyCode,T.balance.currencySymbol,T.hold.amount,U]);const N={isZeniCheckingEnabled:u.companyZeniAccountInfo?.info?.isZeniAccountEnabled??!1,isZeniCheckingPaymentSource:G?.accType==="depositAccount",creditCardPaymentSourceAccountName:G?.label,creditCardPaymentSourceAccountType:G?.accType,creditCardPaymentSourceLastFourDigits:G?.accountLast4,creditCardPaymentSourceBalance:G?.accountBalance?.available?.amount??0};if(r.useEffect(()=>{_.fetchState!=="Completed"&&_.fetchState!=="In-Progress"&&U(Pa(u.companyId,!0))},[_.fetchState]),r.useEffect(()=>{h.updateStatus==="Completed"&&P!=null&&F&&C&&m&&J.trackCardsPayEarlyPayNowClick(I,s,P,h.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:h.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:h.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:h.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:h.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:v?.add(3,"day").format(Ka.visual.MMMDCommaYYYYformat),paymentInitiatedDate:v?.format(Ka.visual.MMMDCommaYYYYformat)},N,g,S)},[h.updateStatus,P,F,C,m,v]),r.useEffect(()=>{h.fetchState==="Completed"&&P!=null&&F&&C&&m&&!x&&e&&f&&P!=null&&(J.trackCardsPayEarlyFormView(I,s,P,t,u.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,T.balance.amount,N,g,S),d(!0))},[h,F,C,m,x,e,f]),y==null)throw Error("Can't access invite people page without signing in...");const K=()=>{n(!0),U(Yn())},X=ea(u),o={events:e?ha(X,jr):[],eventCallback:(A,Z,ne)=>{ne.onEventReceived(A)},onSubscribed:A=>{A.onPusherSubscribed()}};return c.jsx(c.Fragment,{children:c.jsx(Ir,{onClose:()=>{K()},anchor:"right",transitionDuration:250,open:e,PaperProps:{style:{width:ri.overlayWidth.valuePercentage(E),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:w.colors.black,opacity:.75,cursor:"pointer"}}},children:c.jsx(oi,{onClick:A=>A.stopPropagation(),children:c.jsx(ci,{...o,closeDrawerHandler:n,navigate:M,paymentDetails:h,creditAccountSpentAmount:a,onTransferClick:()=>{F&&C&&m&&P!=null&&J.trackCardsPayEarlyFormClick(I,s,P,"Pay Now",h.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:h.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:h.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:h.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:h.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:void 0,paymentInitiatedDate:void 0},N,g,S),U(js({companyId:u.companyId}))},onDismissClick:K,onSaveChangesToLocalStore:A=>{U(fn(A))},currentTenant:u,hasZeniAccountsAdminAccess:R,isZeniAccountsUser:z,isZeniAccountSetupEnabled:$,productInformation:s,sourcePage:b,controllerEmails:I,autoPayThreshold:O,paymentSourceInformation:N,creditAccountInformation:g,debitAccountInformation:S,cashbackInformation:P,isCashbackInfoFetchStateCompleted:F,isCreditCardInfoFetchStateCompleted:C,isDebitCardInfoFetchStateCompleted:m,paymentInitiatedDate:v,maxInsuredAmount:p.maxInsuredAmount})})})})},oi=He(wo)`
|
|
15
|
-
display: flex;
|
|
16
|
-
min-height: 100%;
|
|
17
|
-
flex-direction: column;
|
|
18
|
-
`,Wt=e=>e!=null&&typeof e=="object"?e:null,de=e=>typeof e=="string"?e:void 0,Me=e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,Za=e=>e!=null&&typeof e=="object"&&typeof e.code=="string"&&typeof e.name=="string",gt=e=>{if(e==null||typeof e!="object")return!1;const n=e;return typeof n.transaction_id=="string"&&typeof n.amount=="number"&&typeof n.currency_code=="string"&&typeof n.currency_symbol=="string"&&typeof n.direction=="string"&&!!Za(n.transaction_status)&&!!Za(n.transaction_type)},Kt=(e,n)=>{const t=e?.card_status;if(!Za(t))return null;const a=e?.is_locked_by_admin;return{cardId:n,cardStatus:t,isLockedByAdmin:typeof a=="boolean"?a:void 0}},At=[Fr,xr,Br,Lr,Rr,pa,Ht,ot,Gt,$t,zt],Mr=[Ra,La],ii=new Set([...At,...Mr]),St=Je.getLocalizedStrings().dateFormat,di=Pe(function(e,n){const{includeCreditAccountInfo:t,cardId:a,signedInUserToken:s,isChargeCardFeatureEnabled:b}=n,g=te.getSignedInUser(),S=e.tenantState.currentTenantId,P={userId:g?.userId??"",sessionId:g?.zeniSessionId??"",tenantId:S??""},m=vt(e,a,t,b),C=Xs(e,a),F=Js(e);return{chargeCardDetailView:m,chargeCardsRecurringExpensesState:C,vgsVaultId:rt.cardVaultId,transactionAttachmentsEndpointToFetch:`${Et}/card_transaction_attachments`,transactionAttachmentEndpointToDownload:`${Et}/card_transaction_attachment`,authParams:P,isSnackbarOpen:F.isSnackbarOpen,cardsEndPoint:`${Sr.cardMicroServiceBaseUrl}`,signedInUserToken:m.twoFAView.token??s}},function(e,n){const{cardId:t,currentTenant:a,navigate:s,location:b,cardProviderId:g,includeCreditAccountInfo:S,setIsPaymentOpen:P,controllerEmails:m,productInformation:C,cashbackInformation:F,primaryFundingAccountDetails:v,creditAccountInformation:l,debitAccountInformation:M,isChargeCardFeatureEnabled:B}=n,{tenantEmailDomain:L}=a;return{onEventReceived:(p,h)=>{(({event:T,data:u,cardId:w,dispatch:E,subscribedEvents:U})=>{const y=Wt(u);switch(T){case Ra:case La:return void E(_a(!0));case Fr:{const k=de(y?.card_id);if(k==null||k!==w)return;const x=de(y?.transaction_id),d=y?.transaction_status;return x!=null&&Za(d)?void E(qs({transactionId:x,transactionStatus:d})):void E(sa(w,null,null,!0))}case pa:{const k=de(y?.card_id)??w;if(k!==w)return;const x=Kt(y,k);return x!=null?void E(Ft(x)):void E(Sa(w,!0))}case Ht:{const k=de(y?.card_id)??w;if(k!==w)return;const x=de(y?.currency_code),d=de(y?.currency_symbol),f=Me(y?.balance);return x!=null&&d!=null&&f!=null?(E(Zs({cardId:k,currencyCode:x,currencySymbol:d,balance:f,hold:Me(y?.hold),dailyPurchaseSpends:Me(y?.daily_purchase_spends),monthlyPurchaseSpends:Me(y?.monthly_purchase_spends),dailyWithdrawals:Me(y?.daily_withdrawals),monthlyWithdrawals:Me(y?.monthly_withdrawals)})),void E(Qe(!0))):(E(Sa(w,!0)),void E(Qe(!0)))}case ot:{const k=de(y?.currency_code),x=de(y?.currency_symbol),d=Me(y?.available_amount),f=Me(y?.balance_amount);return k!=null&&x!=null&&d!=null&&f!=null?void E(Ks({currencyCode:k,currencySymbol:x,available:d,balance:f,hold:Me(y?.hold_amount),cashback:Me(y?.cashback_amount)})):void E(Qe(!0))}case xr:{const k=de(y?.card_id)??w;if(k!==w)return;const x=y?.transaction;return gt(x)?void E(Ws({cardId:k,transaction:x})):void E(sa(w,null,null,!0))}case Br:{const k=de(y?.card_id)??w;if(k!==w)return;const x=y?.transaction;return gt(x)?void E(Ys({cardId:k,declineReason:de(y?.decline_reason),transaction:x})):void E(sa(w,null,null,!0))}case Lr:{const k=de(y?.card_id)??w;if(k!==w)return;const x=y?.transaction;return gt(x)?void E(zs({cardId:k,transaction:x})):void E(sa(w,null,null,!0))}case Rr:{const k=de(y?.card_id)??w;if(k!==w)return;const x=de(y?.transaction_id),d=y?.attachment_file_paths;return x!=null&&Array.isArray(d)&&d.every(f=>typeof f=="string")?void E($s({cardId:k,transactionId:x,attachmentFilePaths:d})):void E(sa(w,null,null,!0))}case Gt:case $t:case zt:{const k=de(y?.card_id);if(k==null||k!==w)return;E(Sa(w,!0))}}})({event:p,data:h,cardId:t,dispatch:e,subscribedEvents:ii})},onPusherSubscribed:()=>{e(Sa(t,!0)),e(sa(t,null,null,!0)),e(Qe(!0))},onReloadTransactions:()=>{e(ka(t,S,B))},onFetchChargeCardTransactionList:(p,h)=>{e(sa(t,p,h))},onUpdateScrollYOffset:p=>{},onGetOtp:p=>{g!=null&&e(at(p,"ChargeCardHolder",t))},onResendOtp:p=>{g!=null&&e(et(p,"ChargeCardHolder",t))},onVerifyOtp:(p,h)=>{g!=null&&e(Ja(p,h,"ChargeCardHolder",t))},onVerifyOtpSuccess:p=>{p!=null&&te.saveZeniOtpTokenForCardHolder(p,t)},onColorCodeChange:p=>{e(sc(t,p))},onLockChargeCard:(p,h)=>{e(ar(p,t,h))},onUnlockChargeCard:p=>{e(er(p,t))},onCloseChargeCard:p=>{e(Jn(t,p))},onFetchChargeCardsRecurringExpenses:()=>{e(Xn([t]))},updateChargeCardName:(p,h)=>{e(Qn(p,t,h))},updateChargeCardTransactionAttachments:(p,h)=>{h!=null&&e(rc({transactionId:p,data:h}))},updateChargeCardTransactionUploadReceiptsFetchStatus:(p,h,T,u)=>{e(nc({chargeCardId:h,transactionId:p,fetchState:T,error:u}))},updateChargeCardTransactionReceiptsShowTick:(p,h,T)=>{e(tc({chargeCardId:h,transactionId:p,shouldShowTick:T}))},onChargeCardRevokeInviteClick:()=>{e(qn(t))},updateChargeCardTransactionIsViewReceiptClicked:(p,h,T)=>{e(ac({chargeCardId:h,transactionId:p,isViewReceiptClicked:T}))},onChargeCardTransactionRowClick:(p,h)=>{const T=ye(b.state?.pathnameStackToGoBack,b.pathname);s(`../../transaction/${p}/${h}`,{state:{pathnameStackToGoBack:T}})},onBackClick:()=>{const p=we(b.state?.pathnameStackToGoBack),h=aa(L);s(h,{state:{pathnameStackToGoBack:p.newStack,message:"comingFromCardDetail"}})},removeSnackbar:()=>{e(ec())},onUpdateDebitCardPinAttempt:p=>{e(Zn(t,p)),p==="success"&&e(Ye({messageSection:"update_debit_card_pin_attempt",messageText:"success",type:"success",showStatusIcon:!0}))},onUploadReceiptComplete:(p,h)=>{p?e(Ye({messageSection:"charge_card_receipt_upload",messageText:"success",type:"success",showStatusIcon:!0})):h!=null&&e(Ye({messageSection:"charge_card_receipt_upload",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"_api-error_",variableValue:h.message}]}))},updateSpendLimit(p,h,T,u){e(Kn(p,h,T.code,u))},shouldOpenCreditCardPaymentDrawer(p){p&&F!=null&&J.trackCardsPayEarlyClick(m,C,F,"Card Detail","Text Button","Pay Now",{isZeniCheckingEnabled:a.company?.companyZeniAccountInfo.isZeniAccountEnabled??!1,isZeniCheckingPaymentSource:v?.accType==="depositAccount",creditCardPaymentSourceAccountName:v?.label,creditCardPaymentSourceAccountType:v?.accType,creditCardPaymentSourceLastFourDigits:v?.accountLast4,creditCardPaymentSourceBalance:v?.accountBalance?.available?.amount??0},l,M),P(p)}}})(st(io));function li(){const e=le(),n=me(),t=he(),{cardId:a}=Ve(),[s,b]=r.useState(!1),[g,S]=r.useState(!1),{useDynamicConfig:P}=ue(),m=te.getSignedInUser(),C=i(Y=>ge(Y)),F=i(Y=>qa(Y).firstViewAfterActivation),v=i(Y=>Y.classListState.fetchState),{configValue:l}=P(We.documentAiReceiptMaxSizeLimitBytesConfig),{configValue:M}=P(We.zeniCardsConfig),B=M.enable_card_controls_for_company_ids,L=M.is_card_controls_enabled_for_all_tenants===!0||Array.isArray(B)&&B.includes(C.companyId),[p,h]=r.useState(!1),[T,u]=r.useState(!1),{useFeatureGate:w}=ue(),{isFeatureEnabled:E}=w(W.isChargeCardFeatureEnabled),{isFeatureEnabled:U}=w(W.isDebitCardFeatureEnabled),y=Le(U,C),k=Oe({isDebitCardFeatureEnabled:U,isBankingOnlyTenant:y}),{isFeatureEnabled:x}=w(W.isEarlyPayFeatureEnabled),{isFeatureEnabled:d}=w(W.isCardsCommentingEnabled),f=Be(C),j=xe(C),H=C.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,O=Ue({isCardsOnlyTenant:j,isChargeCardFeatureEnabled:E,isBookKeepingTenant:f,isDebitCardProductVisible:k,chargeCardsCreditAccountLimit:H}),R=!!C.companyDebitCardInfo?.info?.isDebitCardEnabled,z=!!C.companyChargeCardInfo?.info?.isChargeCardEnabled,$=!C.userRole.includes("charge_card_user")&&O&&z;if(a==null)throw Error("Empty card id is not valid...");const _=i(Y=>wa(Y,C.companyId)),{creditAccount:D,creditAccountRepayment:G}=i(Y=>ua(Y)),Q=te.getZeniOtpTokenForCardHolder(a),I=i(Y=>vt(Y,a,$,O)),{isAiCfoAccessEnabled:N,onAskAiCfoClick:K}=xa({mobileExploreReferrer:"Card Detail"});Lt({isDataReady:I.fetchState==="Completed"});const X=i(Y=>ma(Y)),o=I.chargeCard,A=Re(),Z=Fe(A?.loggedInUserRoleMap),ne=o?.type.code==="business_physical_debit_card"||o?.type.code==="business_virtual_debit_card",q=o?.type.code==="business_physical_debit_card"||o?.type.code==="business_physical_credit_card",ke=o?.type.code==="business_virtual_debit_card"||o?.type.code==="business_virtual_credit_card",ve=o?.type.code==="business_virtual_debit_card",fe=Ba(O,z,Z,D,G),se=kr(ne,I),Ee=Mt(Z,X),re=Xe(O,k,R,z),Ce=I.depositAccountLimitFetchState.fetchState!=="Completed"&&I.depositAccountLimitFetchState.fetchState!=="In-Progress",Ae=i(Y=>da(Y,C.companyId)),ee=la(Ae.controllers),Te=i(Y=>o?.cardCreatedByUser?.userId!=null?$a(Y.userRoleState,o?.cardCreatedByUser?.userId):void 0),De=i(Y=>Te?.accountingClassIDs[0]!=null?za(Y.classState,{classId:Te?.accountingClassIDs[0],reportId:"class_list"}):void 0),ae=i(Y=>o?.cardHolderUser?.userId!=null?$a(Y.userRoleState,o?.cardHolderUser?.userId):void 0),oe=i(Y=>ae?.accountingClassIDs[0]!=null?za(Y.classState,{classId:ae?.accountingClassIDs[0],reportId:"class_list"}):void 0),fa=C?.userRole,ta=i(Y=>Ca(Y,!1,k,E).revokeCardInvite),Oa=ya(ta.saveStatus.fetchState);if(r.useEffect(()=>{if(Oa==="In-Progress"&&ta.saveStatus.fetchState==="Completed"){const Y=aa(C.tenantEmailDomain);e(Y)}},[Oa,ta.saveStatus.fetchState,e,C.tenantEmailDomain]),r.useEffect(()=>{F&&s===!1&&ke&&(b(!0),setTimeout(()=>{n(Ya()),ve&&n(Ye({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[F,s,ke,ve]),r.useEffect(()=>{p||I.fetchState==="Completed"||I.fetchState==="In-Progress"||a==null||(h(!0),n(ka(a,$,O,!1)))},[p,I,a,n]),r.useEffect(()=>{!T&&I.fetchState==="Completed"&&I.chargeCard?.connectedAccountId!=null&&ne&&Ce&&Z&&(u(!0),n(Wn({depositAccountId:I.chargeCard?.connectedAccountId})))},[T,I,n,Ce,Z]),r.useEffect(()=>{X.fetchState!=="Completed"&&X.fetchState!=="In-Progress"&&Z&&n(_a()),v!=="Completed"&&v!=="In-Progress"&&n(Nn()),I.transactionStatistics.fetchState!=="Completed"&&I.transactionStatistics.fetchState!=="In-Progress"&&n(Qs({chargeCardId:a})),_.fetchState!=="Completed"&&_.fetchState!=="In-Progress"&&n(Pa(C.companyId,!0))},[X.fetchState,n,Z,v,I.transactionStatistics.fetchState,_.fetchState]),r.useEffect(()=>{if(!(I.fetchState!=="Completed"||O&&D.fetchState!=="Completed"||o==null||I.transactionStatistics.fetchState!=="Completed"||ne&&Z&&I.depositAccountLimitFetchState.fetchState!=="Completed")){const Y=o.type.code.includes("physical"),Se=Y?o.cardActivationAttemptHistory[0]?.timestamp:o.createTime;J.trackCardsCardDetailView(ee,re,{cardId:a,cardName:o.cardName,cardType:o.type.code.includes("credit")?"credit":"debit",cardCategory:Y?"physical":"virtual",cardLimit:ba(o.limit.amount),cardLastFourDigits:o.accountLast4,cardStatus:o.status.code,cardAssignedDate:o.createTime?.format(St.analytics.MMMDashDDDashYYYYFormat),cardIssuedDate:o.providerCardCreateTime?.format(St.analytics.MMMDashDDDashYYYYFormat),cardActivatedDate:Se?.format(St.analytics.MMMDashDDDashYYYYFormat),cardLimitFrequency:o.creditLimitFrequency.name,cardSpentAmount:ba(o.balance.amount),cardAvailableLimit:ba(o.available.amount),cardUtilizationPercent:o.limit.amount>0?Math.round((o.limit.amount-o.available.amount)/o.limit.amount*100):0,cardUtilizationAmount:ba(o.limit.amount-o.available.amount),totalNumberOfDeclinedTransactions:I.transactionStatistics.statistics.totalNumberOfDeclinedTransactions,numberOfDeclinedTransactionsCurrentMonth:I.transactionStatistics.statistics.numberOfDeclinedTransactionsCurrentMonth,totalNumberOfPaidTransactions:I.transactionStatistics.statistics.totalNumberOfPaidTransactions,numberOfPaidTransactionsCurrentMonth:I.transactionStatistics.statistics.numberOfPaidTransactionsCurrentMonth,totalNumberOfCanceledTransactions:I.transactionStatistics.statistics.totalNumberOfCanceledTransactions,numberOfCanceledTransactionsCurrentMonth:I.transactionStatistics.statistics.numberOfCanceledTransactionsCurrentMonth,totalNumberOfAuthorizedTransactions:I.transactionStatistics.statistics.totalNumberOfAuthorizedTransactions,numberOfAuthorizedTransactionsCurrentMonth:I.transactionStatistics.statistics.numberOfAuthorizedTransactionsCurrentMonth,totalNumberOfTransactionsWithReceipts:I.transactionStatistics.statistics.totalNumberOfTransactionsWithReceipts,numberOfTransactionsWithReceiptsCurrentMonth:I.transactionStatistics.statistics.numberOfTransactionsWithReceiptsCurrentMonth},{cardIssuedByName:kt(o.cardCreatedByUser,!1),cardIssuedByEmail:o.cardCreatedByUser?.email,cardIssuedByUserId:o.cardCreatedByUser?.userId,cardIssuedByRole:Te?.userRoles,cardIssuedByDepartment:De?.className},{cardholderName:kt(o.cardHolderUser,!1),cardholderEmail:o.cardHolderUser?.email,cardholderRole:ae?.userRoles,cardholderUserId:o.cardHolderUser?.userId,cardholderDepartment:oe?.className},fe,se)}},[I.fetchState,I.depositAccountLimitFetchState.fetchState,I.transactionStatistics.fetchState,D.fetchState,Z]),m==null)throw Error("Can't access card detail page without signing in...");const dt=ea(C),Ea=Z?[...At,...Mr]:At,na={events:ha(dt,Ea),eventCallback:(Y,Se,ie)=>{ie.onEventReceived(Y,Se)},onSubscribed:Y=>{Y.onPusherSubscribed()}},Aa=()=>{if(a!=null&&o!=null){const{ownerName:Y,cardName:Se,utilisation:ie,limit:Ge,frequency:Ke,cardColor:$e}=bt(o),ze=o.cardHolderUserId===m.userId;J.trackCardsDetailPageViewed(a,Y,Se,ie,Ge,Ke,$e,ze)}};r.useEffect(()=>{if(I.fetchState==="Completed"){const Y=I.chargeCard;if(Y?.status.code==="inactive"||ne&&Y?.isPinSet===!1||q&&F){const Se=_e(C.tenantEmailDomain,a,m,o,F);e(Se)}}},[I.fetchState]);const lt=(Y,Se)=>{if(a!=null&&o!=null){const{ownerName:ie,cardName:Ge,utilisation:Ke,limit:$e,frequency:ze}=bt(o),ra=o.cardHolderUserId===m.userId;J.trackCardsDetailPageClicked(a,ie,Ge,Ke,$e,ze,Y,ra,Se)}},ut=(Y,Se)=>{if(a!=null&&o!=null){const{ownerName:ie,cardName:Ge,utilisation:Ke,limit:$e,frequency:ze}=bt(o),ra=o.cardHolderUserId===m.userId;J.trackCardsVerifyPopUpClick(a,ie,Ge,Ke,$e,ze,Y,ra,Se)}},pe=D.balance.amount+D.hold.amount,Ua=C.companyChargeCardInfo?.info?.primaryFundingAccount,Da=_.allFundingAccounts.find(Y=>Y.id===Ua?.accountId),ja=I.chargeCard!=null,Ma=I.depositAccountLimit!=null;return I.fetchState!=="Error"||ja?!ja&&(I.fetchState==="In-Progress"||I.fetchState==="Not-Started")||ta.saveStatus.fetchState==="In-Progress"||!Ma&&ne&&Z&&I.depositAccountLimitFetchState.fetchState!=="Completed"?c.jsx(oo,{}):c.jsxs(c.Fragment,{children:[c.jsx(nt,{showConfetti:F}),I.fetchState==="Completed"?c.jsx(Ut,{analytics:J,onLoad:Aa}):null,g===!0?c.jsx(Yt,{closeDrawerHandler:()=>S(!1),isPaymentDrawerOpen:g,pageName:"Card Detail",sourcePage:"cardDetailPage",productInformation:re,creditAccountInformation:fe,debitAccountInformation:se,cashbackInformation:Ee,creditAccountSpentAmount:pe,isDebitCardInfoFetchStateCompleted:!ne||!Z||I.depositAccountLimitFetchState.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!O||D.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!Z||X.fetchState==="Completed",paymentInitiatedDate:G.initiatedRepaymentDate}):null,c.jsx(di,{...na,hideSorting:!0,onColumnSortConfigChanged:()=>{},onFireVerifyPopOnClickAnalytics:ut,onFireOnClickAnalytics:lt,isSandboxEnv:Rt(),signedInUser:m,location:t,navigate:e,setIsPaymentOpen:S,cardIssuedByRoles:Te?.userRoles,cardIssuedByDepartmentName:De?.className,cardHolderRoles:ae?.userRoles,cardHolderDepartmentName:oe?.className,loggedInUserRole:fa,isChargeCardFeatureEnabled:O,isDebitCardFeatureEnabled:k,isDebitCardSetupEnabled:R,isChargeCardSetupEnabled:z,isCardControlsEnabled:L,isEarlyPayEnabled:x,controllerEmails:ee,chargeCardCashbackDetailState:X,productInformation:re,creditAccountInformation:fe,debitAccountInformation:se,cashbackInformation:Ee,classListFetchState:v,primaryFundingAccountDetails:Da,currentTenant:C,cardProviderId:I.chargeCard?.cardProviderID,cardId:a,creditAccount:D,creditAccountRepayment:G,includeCreditAccountInfo:$,signedInUserToken:Q,appleWalletLink:"shoebox://",googleWalletLink:"https://www.android.com/payapp/",documentAiReceiptMaxSizeLimit:l.documentAiReceiptMaxSizeLimitBytes!=null?l.documentAiReceiptMaxSizeLimitBytes:9437184,isAiCfoAccessEnabled:N,onAskAiCfoClick:K,isCardsCommentingEnabled:d})]}):c.jsx(ct,{})}const bt=e=>{const n=`${e.cardHolderUser?.firstName.toLowerCase()} ${e.cardHolderUser?.lastName.toLowerCase()}`,t=e.cardName,a=(e.limit.amount??0)-(e.available.amount??0),s=e.limit.amount,b=e.creditLimitFrequency.name;return{ownerName:n,cardName:t,utilisation:a,cardColor:e.cardColorCode??"",frequency:b,limit:s}},{spendManagement:{chargeCard:{cardsAiCfoHero:{headline:ui,subheadline:mi,pageTitle:Ci}}}}=Je.getLocalizedStrings(),Nr=[pa,ot,Ur,La,Ra,it,zt,Ko,Gt,$t,Ht],pi=new Set(Nr),Dt=jt((e,n,t,a)=>{e(ia(n,t,a,!0))},400),hi=He.div`
|
|
19
|
-
display: flex;
|
|
20
|
-
width: 100%;
|
|
21
|
-
flex: 1 1 auto;
|
|
22
|
-
flex-direction: column;
|
|
23
|
-
align-items: center;
|
|
24
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
25
|
-
`,fi=Pe(function(e,n){const t=Ca(e,n.includeCreditAccountDebitSummaryAndCashbackInfo,n.isDebitCardFeatureEnabled&&n.isDebitCardSetupEnabled,n.isChargeCardFeatureEnabled&&n.isChargeCardSetupEnabled);return{chargeCardListView:t,rowActionView:lc(e),bulkActionView:uc(e),companyLegalName:n.currentTenant.companyName,admins:n.admins,searchText:t.searchText,uiState:t.uiState,signedInUser:n.signedInUser}},function(e,n){const{navigateAndClearBulkSelection:t,currentTenant:a,location:s,signedInUser:b,chargeCardListState:g,includeCreditAccountDebitSummaryAndCashbackInfo:S,isChargeCardFeatureEnabled:P,isCreditCardProductVisibleForExpressInterest:m,isChargeCardSetupEnabled:C,isDebitCardFeatureEnabled:F,isDebitCardSetupEnabled:v,isDebitCardTOSAccepted:l,isChargeCardTOSAccepted:M,controllerEmails:B,depositAccountListWithDebitCardIssued:L,primaryFundingAccountDetails:p,chargeCardSetUpViewFetchState:h,productInformation:T,cashbackInformation:u,creditAccountInformation:w,debitAccountInformation:E,updatePayNowInfoTooltip:U,isUserHasCardsAdminLevelAccess:y}=n,{tenantEmailDomain:k}=a,{cards:x}=g;return{onChargeCardRowClick:(d,f)=>{const j=Ar(x,d);let H;j!=null&&((R=>{const z=R.limit.amount-R.available.amount,$=`${R.cardHolderUser?.firstName.toLowerCase()} ${R.cardHolderUser?.lastName.toLowerCase()}`,_=R.cardName,D=R.department?.className??"",G=R.limit.amount,Q=R.creditLimitFrequency.name;J.trackCardsListRowClicked($,_,D,z,G,Q,b.userId===R.cardHolderUserId)})(j),ca(F,v,L)&&J.trackCardsCardListRowClick(B,T,"Card Row Item","row_clicked",f+1,{cardOwner:kt(j.cardHolderUser,!1),cardName:j.cardName,cardType:j.type.code.includes("credit")?"credit":"debit",cardStatus:j.status.code,cardUtilizationAmount:ba(j.limit.amount-j.available.amount),cardUtilizationPercent:j.limit.amount>0?Math.round((j.limit.amount-j.available.amount)/j.limit.amount*100):0,cardLimit:ba(j.limit.amount)},u,w,E)),H=j?.status.code==="request_on_hold"&&b.userId===j.cardHolderUserId?Dr(k):_e(k,d,b,j);const O=ye(s.state?.pathnameStackToGoBack,s.pathname);t(H,{state:{pathnameStackToGoBack:O}})},onFetchChargeCardsRecurringExpenses:d=>{e(Xn(d))},onFetchDepositAccountLimit:d=>{e(Wn({depositAccountId:d}))},onChargeCardResendInviteClick:d=>{e(bc(d))},onChargeCardRevokeInviteClick:d=>{e(qn(d))},onLockChargeCardList:(d,f)=>{e(Sc(d,f))},onUnlockChargeCardList:d=>{e(gc(d))},onCloseChargeCardList:(d,f)=>{e(fc(d,f))},onRevokeChargeCardList:d=>{e(hc(d))},updateChargeCardListSpendLimit(d,f,j){e(pc(d,f,j.code))},onLockChargeCard:(d,f)=>{e(ar(y,d,f))},onUnlockChargeCard:d=>{e(er(y,d))},onCloseChargeCard:(d,f)=>{e(Jn(d,f))},onUpdateSpendLimit(d,f,j,H){e(Kn(d,f,j.code,H))},updateChargeCardName:(d,f)=>{e(Qn(y,d,f))},onClickSetupIcon:()=>{J.trackCardsListPageClicked("settings"),ca(F,v,L)&&u!=null&&J.trackCardsSettingsClick(B,T,u,w,E);const d=Fo(k),f=ye(s.state?.pathnameStackToGoBack,s.pathname);t(d,{state:{pathnameStackToGoBack:f}})},onIssueCardClick:()=>{J.trackCardsListPageClicked("new card"),ca(F,v,L)&&u!=null&&J.trackCardsNewCardClick(B,T,u,"New Button","card_creation_initiated","Card List",w,E);const d=gi(k),f=ye(s.state?.pathnameStackToGoBack,s.pathname);t(d,{state:{pathnameStackToGoBack:f}})},onColumnSortConfigChanged:(d,f)=>{ca(F,v,L)&&u!=null&&J.trackCardsCardListSortClick(B,T,u,"Sort Icon","sort",d,f==="ascending"?"ASC":"DESC","Cards List",w,E),e(It({uiState:{sortKey:d,sortOrder:f}}))},onSearchTextChanged:d=>{e(Cc(d))},onReloadCards:()=>{e(ia(S,F&&v,P&&C,!0))},onLetsGoClick:()=>{t("./onboard")},onBackClick:()=>{t("../../")},onTotalCashbackClick:()=>{ca(F,v,L)&&u!=null&&J.trackCardsCashbackOverviewClick(B,T,u,"Cashback Overview","cashback_details_viewed",w,E),t("./cashback")},onClickStatementsIcon:()=>{ca(F,v,L)&&u!=null&&J.trackCardsStatementsClick(B,T,u,w,E),t("./statements")},onCreateNowClick:d=>{ca(F,v,L)&&u!=null&&J.trackCardsNewCardClick(B,T,u,"Promo Banner","card_creation_initiated","Card List",w,E),t(`./new?cardType=${d}`)},onPromoCardClick:d=>{t(d==="debit"&&F&&!l||d==="credit"&&m&&!M?`../promo?cardPromoType=${d}`:"./setup")},navigateToCreditCardPaymentPage:(d,f)=>{h==="Completed"&&a.company!=null&&u!=null&&J.trackCardsPayEarlyClick(B,T,u,"Card List",d,f,{isZeniCheckingEnabled:a.company.companyZeniAccountInfo.isZeniAccountEnabled,isZeniCheckingPaymentSource:p?.accType==="depositAccount",creditCardPaymentSourceAccountName:p?.label,creditCardPaymentSourceAccountType:p?.accType,creditCardPaymentSourceLastFourDigits:p?.accountLast4,creditCardPaymentSourceBalance:p?.accountBalance?.available?.amount??0},w,E);const j=Si(k);t(j)},navigateToCreditCardPaymentHistoryPage:()=>{const d=bi(k),f=ye(s.state?.pathnameStackToGoBack,s.pathname);t(d,{state:{pathnameStackToGoBack:f}})},shouldShowPayNowInfoTooltip:U,onSetRowActionCardId:d=>{e(mc(d))},onSetBulkActionCardIds:d=>{e(tr(d))},onEventReceived:d=>{pi.has(d)&&Dt(e,S,F&&v,P&&C)},onPusherSubscribed:()=>{Dt(e,S,F&&v,P&&C)}}})(st(Co));function In({isPaymentDrawerOpen:e}){const n=le(),t=me(),a=he(),s=r.useCallback((V,je)=>{t(tr([])),n(V,je)},[t,n]),[b,g]=r.useState(!1),[S,P]=r.useState(te.getPayNowInfoTooltip()??!1),m=V=>{te.savePayNowInfoTooltip(V),P(V)},[C,F]=r.useState(!1),v=te.getSignedInUser(),l=i(V=>ge(V)),[M,B]=r.useState(!1),[L,p]=r.useState(!1),{isAiCfoAccessEnabled:h,onAskAiCfoClick:T}=xa({mobileExploreReferrer:"Cards"}),u=l.userRole.includes("charge_card_user"),w=!u,E=!!l.companyDebitCardInfo?.info?.isDebitCardEnabled,{useFeatureGate:U,useDynamicConfig:y}=ue(),{isFeatureEnabled:k}=U(W.isCashbackFeatureEnabled),{isFeatureEnabled:x}=U(W.isChargeCardFeatureEnabled),{isFeatureEnabled:d}=U(W.isDebitCardFeatureEnabled),{isFeatureEnabled:f}=U(W.isEarlyPayFeatureEnabled),{isFeatureEnabled:j}=U(W.isChargeCardPaymentHistoryFeatureEnabled),{isFeatureEnabled:H}=U(W.isCardsCommentingEnabled),{isFeatureEnabled:O}=U(W.isAiCfoFileUploadEnabled),{isFeatureEnabled:R}=U(W.isCardPolicyEnabled),{isFeatureEnabled:z}=U(W.isAiCardCreationEnabled),$=Le(d,l),_=Oe({isDebitCardFeatureEnabled:d,isBankingOnlyTenant:$}),D=xe(l),G=Be(l),Q=l.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,I=Ue({isCardsOnlyTenant:D,isChargeCardFeatureEnabled:x,isBookKeepingTenant:G,isDebitCardProductVisible:_,chargeCardsCreditAccountLimit:Q}),N=Er({isCardsOnlyTenant:D,isChargeCardFeatureEnabled:x,isBookKeepingTenant:G}),{configValue:K}=y(We.zeniCardsConfig),X=Re(),o=Fe(X?.loggedInUserRoleMap),A=i(V=>da(V,l.companyId)),Z=la(A.controllers),ne=K.charge_card_cashback_rate_per_transaction!=null?K.charge_card_cashback_rate_per_transaction:.0175,q=K.credit_card_pay_now_threshold_by_company_id?.[l.companyId]??K.default_credit_card_pay_now_threshold??To,ke=K.is_card_controls_enabled_for_all_tenants===!0||Array.isArray(K.enable_card_controls_for_company_ids)&&K.enable_card_controls_for_company_ids.includes(l.companyId),ve=!!l.companyChargeCardInfo?.info?.isChargeCardTOSAccepted,fe=!!l.companyDebitCardInfo?.info?.isDebitCardTOSAccepted,se=!!l.companyChargeCardInfo?.info?.isChargeCardEnabled,Ee=!!l.company?.companyChargeCardInfo?.isChargeCardEnabled,re=!!l.company?.companyDebitCardInfo?.isDebitCardEnabled,Ce=i(V=>Gn(V)),Ae=ya(Ce.updateStatus),ee=i(V=>Ca(V,w,_&&E,I&&se)),Te=i(V=>cc(V)),De=i(V=>oc(V)),ae=i(V=>ic(V)),oe=i(V=>dc(V)),fa=i(V=>ae==null?[]:Mn(V.aiCfoState,ae).filter(je=>je.kind==="creating_cards"),_t),ta=ya(De.fetchState);r.useEffect(()=>{ta==="In-Progress"&&De.fetchState==="Completed"&&ae!=null&&fa.forEach(V=>{t(yt({chatSessionId:ae,id:V.id,entityIds:oe,kind:"created_cards"}))})},[t,De.fetchState,ae,oe,fa,ta]);const Oa=ee.cards.filter(V=>V.type.code.includes("debit")).map(V=>V.connectedAccountId),dt=[...new Set(Oa)],Ea=i(V=>ma(V)),na=i(V=>tt(V,dt)),Aa=i(V=>wa(V,l.companyId)),lt=Aa.companyChargeCardInfo?.primaryFundingAccount,ut=Aa.allFundingAccounts.find(V=>V.id===lt?.accountId),pe=ee.fetchState,Ua=ee.creditAccount,Da=r.useCallback(()=>o===!0&&R===!0&&pe==="Completed"&&te.getCardPolicyPopupSeen(l.tenantEmailDomain??"")!==!0,[o,R,pe,l.tenantEmailDomain]),[ja,Ma]=r.useState(Da);r.useEffect(()=>{Ma(Da())},[Da]);const Y=()=>{te.saveCardPolicyPopupSeen(l.tenantEmailDomain??"",!0),Ma(!1)},Se=pe==="Completed"&&!ee.hasCreditCard&&!ee.hasDebitCard;lo({isDataReady:pe==="Completed",pageContext:Se?"cards_creation":"cards"});const{creditAccountRepayment:ie}=i(V=>ua(V)),Ge=i(V=>qa(V).firstViewAfterActivation),{areTenantIdsInSync:Ke}=br(),$e=Mt(o,Ea),ze=Ba(I,se,o,Ua,ie),ra=Nt(_,E,o,na,ee.debitCardSummary),mt=Xe(I,_,E,se),Ct=ee.creditAccount.balance.amount+ee.creditAccount.hold.amount;if(r.useEffect(()=>{pe==="Completed"&&(te.getPayNowInfoTooltip()==null||Ct<q*ee.creditAccount.limit.amount/100)&&m(!0)},[pe,q,Ct,ee.creditAccount.limit.amount]),r.useEffect(()=>{if(e!=null&&e===!0&&ie.initiatedRepayments.amount===0&&ie.fetchState==="Completed"||Ae==="In-Progress"&&Ce.updateStatus==="Completed")m(!1),g(!0);else if(ie.initiatedRepayments.amount>0&&ie.fetchState==="Completed"){g(!1),document.body.style.overflow="auto";const V=aa(l.tenantEmailDomain);s(V)}},[e,ie.initiatedRepayments.amount,ie.fetchState,Ae,Ce.updateStatus,s,l.tenantEmailDomain]),r.useEffect(()=>{!M&&(se||E)&&(Ee||re)&&Ke&&(B(!0),t(ia(w,_&&E,I&&se,!1)))},[M,w,t,Ke,Ee,re]),r.useEffect(()=>{Ge&&C===!1&&(F(!0),setTimeout(()=>{t(Ya())},5e3))},[Ge,C]),r.useEffect(()=>()=>{Dt.flush()},[]),r.useEffect(()=>{pe==="Completed"&&u&&ee.cards.length===1&&(ee.cards[0].status.code==="inactive"&&ee.cards[0].type.code==="business_physical_credit_card"?s(`./${ee.cards[0].id}/activate`):ee.cards[0].status.code!=="request_on_hold"&&(a.state?.message==="comingFromCardDetail"?s("../../"):s(`./${ee.cards[0].id}`)))},[pe,u,a.state,s,ee.cards]),r.useEffect(()=>{if(pe==="Completed"&&u){const V=ee.cards.length,je=ee.cards.filter(Ze=>Ze.cardHolderUserId===v?.userId).filter(Ze=>Ze.status.code==="request_on_hold");je.length>0&&V===je.length&&s("./onboard")}},[pe,ee.cards,u,s,v?.userId]),r.useEffect(()=>{pe!=="Completed"||I&&ie.fetchState!=="Completed"||_&&E&&o&&na.fetchState!=="Completed"||J.trackCardsCardListView(Z,mt,$e,ze,ra)},[pe,Ua,ie.fetchState,na.fetchState,o]),v==null)throw Error("Can't access charge card list page without signing in...");const $r=i(V=>nr(V.userState,V.userRoleState,V.userListViewState,"cardAdmin")),Zt=xt(X?.loggedInUserRoleMap),qt=V=>{p(V)},zr=ee.creditAccount.limit,Yr=()=>{g(!1),s("..")},Wr=l.companyChargeCardInfo?.info!=null&&Ia({cardInfo:l.companyChargeCardInfo.info,isProductVisible:I&&Ee,isTOSAccepted:ve,isSetupEnabled:se,isUserHasCardsAdminLevelAccess:o,isUserHasCardsAccess:Zt}),Kr=l.companyDebitCardInfo?.info!=null&&Ia({cardInfo:l.companyDebitCardInfo.info,isProductVisible:_&&re,isTOSAccepted:fe,isSetupEnabled:E,isUserHasCardsAdminLevelAccess:o,isUserHasCardsAccess:Zt}),Zr=Wr||Kr,Qt=function(V){const{isEmptyCardsState:je,isChargeCardAdmin:Ze,isFileUploadEnabled:en}=V,an=le(),Na=he(),{tenantEmailDomain:Va}=Ve(),{isAiCfoOpen:as,setIsAiCfoOpen:tn}=pr(),ts=hr(),ns=fr(),nn=i(be=>jn(be)).createSessionAndSubmitState.fetchState==="In-Progress",{chips:rn,isResolved:sn}=Tr("cards_creation"),cn=r.useMemo(()=>vr(rn,sn,3),[rn,sn]),[Ha,pt]=r.useState(""),on=ns&&ts&&Va!=null&&!as,ga=r.useCallback(be=>{if(Va==null)return;const rs=ye(Na.state?.pathnameStackToGoBack,Na.pathname);an(`/${Va}/cards/ask`,{state:{message:"",origin:"",pathnameStackToGoBack:rs,referrer:"cards_hero",aiCfoInitialQuestion:be,aiCfoShouldSubmit:be!=null&&be.trim().length>0}})},[Na.pathname,Na.state,an,Va]),dn=r.useCallback(be=>{be.trim().length!==0&&(pt(""),ga(be))},[ga]),ln=r.useCallback(()=>{const be=Ha.trim();be.length!==0&&(pt(""),ga(be))},[Ha,ga]),un=r.useCallback(()=>{},[]),mn=r.useCallback(be=>{pt(be)},[]),Cn=r.useCallback(()=>{tn(!0)},[tn]),pn=r.useCallback(()=>{ga(void 0)},[ga]);return r.useMemo(()=>{if(on&&je&&Ze)return{aiAgentName:Ci,headline:ui,subheadline:mi,promptChips:cn,composer:{currentInput:Ha,isSubmitting:nn,isFileUploadEnabled:en,onInputChange:mn,onSubmit:ln,onStopSubmit:un},onPromptClick:dn,onOpenSidePanel:Cn,onOpenFullView:pn,dataTestIdPrefix:"cards-ai-cfo-hero"}},[Ha,on,Ze,je,en,nn,mn,pn,Cn,dn,un,ln,cn])}({isEmptyCardsState:Se,isChargeCardAdmin:o,isFileUploadEnabled:O}),Xt=z&&Qt!=null?c.jsx(gr,{...Qt}):null,{isCardsShuttingDown:qr,shutdownContent:Jt}=uo(l.tenantId,l.company?.managementInfo?.receiverEmails),Qr=qr===!0&&Jt!=null?c.jsx(mo,{shutdownContent:Jt}):null,Xr=h&&Xt==null,Jr=ea(l),es={events:ha(Jr,Nr),eventCallback:(V,je,Ze)=>{Ze.onEventReceived(V)},onSubscribed:V=>{V.onPusherSubscribed()}};return se||E?c.jsxs(c.Fragment,{children:[pe==="Completed"?c.jsxs(c.Fragment,{children:[c.jsx(Ut,{analytics:J,onLoad:()=>{J.trackPageLoaded(yr.Event.cardsListPage),(I&&!se||_&&!E)&&J.trackCardsPromoView(Z,{isCreditCardOffered:I,isDebitCardOffered:_,isDebitCardEnabled:E,isCreditCardEnabled:se},"Banner",_&&!E?"Debit Card":I&&!se?"Credit Card":"","Card List")}}),c.jsx(nt,{showConfetti:Ge})]}):null,b===!0?c.jsx(Yt,{closeDrawerHandler:Yr,isPaymentDrawerOpen:b,pageName:"Card List",sourcePage:"cardListPage",creditAccountSpentAmount:Ct,productInformation:mt,creditAccountInformation:ze,debitAccountInformation:ra,cashbackInformation:$e,isDebitCardInfoFetchStateCompleted:!(_&&E&&o)||na.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!I||ie.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!o||Ea.fetchState==="Completed",paymentInitiatedDate:ie.initiatedRepaymentDate}):null,c.jsxs(hi,{children:[c.jsx(Ie,{isAppContentDrawerOpen:L,handleDrawerToggle:qt}),c.jsx(fi,{...es,isCashbackFeatureEnabled:k,isChargeCardFeatureEnabled:I,isDebitCardFeatureEnabled:_,isCreditCardProductVisibleForExpressInterest:N,updatePayNowInfoTooltip:m,showPayNowInfoTooltip:S,creditCardPayNowThreshold:q,signedInUser:v,chargeCardListState:ee,location:a,admins:$r.users,navigateAndClearBulkSelection:s,currentTenant:l,isCardControlsEnabled:ke,companyChargeCardInfoCreditAccountLimit:l.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,isCompanyInterestedInChargeCard:l.companyChargeCardInfo?.info?.isCompanyInterestedInChargeCard??!1,isUserHasCardsAdminLevelAccess:o,includeCreditAccountDebitSummaryAndCashbackInfo:w,onClickMenuIcon:()=>{qt(!0)},creditLimit:zr,isChargeCardSetupEnabled:se,isChargeCardEnabledOnCompany:Ee,isDebitCardSetupEnabled:E,isDebitCardEnabledOnCompany:re,isEarlyPayEnabled:f,isChargeCardPaymentHistoryFeatureEnabled:j,cashbackRate:ne,controllerEmails:Z,chargeCardCashbackDetailState:Ea,depositAccountListWithDebitCardIssued:na,isChargeCardTOSAccepted:ve,isDebitCardTOSAccepted:fe,primaryFundingAccountDetails:ut,chargeCardSetUpViewFetchState:Aa.fetchState,productInformation:mt,creditAccountInformation:ze,debitAccountInformation:ra,cashbackInformation:$e,isAiCfoAccessEnabled:Xr,onAskAiCfoClick:T,isCardsCommentingEnabled:H,cardsAiCfoHero:Xt,cardsShutdownBanner:Qr,onClickPolicyIcon:o&&R?()=>n(yi(l.tenantEmailDomain)):void 0,isPolicyIntroTooltipVisible:ja,onPolicyIntroTooltipClose:Y,pendingCreationCount:Te})]})]}):(ve||fe)&&o===!0?c.jsx(oa,{to:"../setup"}):Zr?c.jsx(oa,{to:"../promo"}):c.jsx(va,{fetchState:pe})}const gi=e=>`/${e}/cards/new`,Si=e=>`/${e}/cards/payment`,bi=e=>`/${e}/cards/payment-history`,yi=e=>`/${e}/cards/policy`,Vr=[Or,Ur],Ii=new Set(Vr),ki=Pe(function(e){const n=te.getSignedInUser(),t=ge(e),a=e.tenantState.currentTenantId,s=rr(e),b={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:a??""},g=t?.companyName??"",S=e.chargeCardPaymentHistoryState.downloadUIState.downloadState;return{fetchState:s.fetchState,filters:s.filters,isZeniTenant:yc(t),repaymentList:s.repaymentHistory,searchText:s.searchText,repaymentHistoryUsers:s.repaymentHistoryUsers,sortConfig:{sortKey:s.uiState.sortKey,sortOrder:s.uiState.sortOrder},downloadParams:{authParams:b,companyName:g,spendManagementEndPoint:`${Et}/spendManagement`,isShowDeletedBillsEnabled:!1,isShowDeletedReimbursementEnabled:!1},downloadState:S}},function(e,n){const{location:t,navigate:a}=n;return{onBackClick:()=>{const s=we(t.state?.pathnameStackToGoBack),b=s.poppedPathname??"..";a(b,{state:{pathnameStackToGoBack:s.newStack}})},onColumnSortConfigChanged:(s,b)=>{e({type:"chargeCardPaymentHistory/updatePaymentHistoryUIState",payload:{uiState:{sortKey:s,sortOrder:b}}})},onFiltersChange:s=>{e(kc({filters:s}))},onReloadPayments:()=>{e(Ga(!0))},onEventReceived:s=>{Ii.has(s)&&e(Ga(!0))},onPusherSubscribed:()=>{e(Ga(!0))},onSearchTextChanged:s=>{e({type:"chargeCardPaymentHistory/updatePaymentHistorySearchText",payload:s})},updateDownloadStateHandler:s=>{e(Ic({uiState:{downloadState:s}}))}}})(st(po));function Ei(){const e=le(),n=he(),t=me(),{areTenantIdsInSync:a}=br(),{useFeatureGate:s}=ue();if(te.getSignedInUser()==null)throw Error("Can't access payment history page without signing in...");const b=i(o=>ge(o)),g=i(o=>rr(o)),[S,P]=r.useState(!1),[m,C]=r.useState(!1),[F,v]=r.useState(!1),[l,M]=r.useState(null),B=!b.userRole.includes("charge_card_user"),L=!!b.companyDebitCardInfo?.info?.isDebitCardEnabled,{isFeatureEnabled:p}=s(W.isChargeCardFeatureEnabled),{isFeatureEnabled:h}=s(W.isDebitCardFeatureEnabled),T=Le(h,b),u=Oe({isDebitCardFeatureEnabled:h,isBankingOnlyTenant:T}),w=xe(b),E=Be(b),U=b.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,y=Ue({isCardsOnlyTenant:w,isChargeCardFeatureEnabled:p,isBookKeepingTenant:E,isDebitCardProductVisible:u,chargeCardsCreditAccountLimit:U}),k=!!b.companyChargeCardInfo?.info?.isChargeCardEnabled,x=Re(),d=Fe(x?.loggedInUserRoleMap),f=i(o=>Ca(o,B,u&&L,y&&k)),j=r.useMemo(()=>{const o=f.cards.filter(A=>A.type.code.includes("debit"));return[...new Set(o.map(A=>A.connectedAccountId))]},[f.cards]),H=i(o=>ma(o)),O=i(o=>tt(o,j)),{creditAccountRepayment:R}=i(o=>ua(o)),z=r.useMemo(()=>Mt(d,H),[d,H]),$=r.useMemo(()=>Ba(y,k,d,f.creditAccount,R),[y,k,d,f.creditAccount,R]),_=r.useMemo(()=>Nt(u,L,d,O,f.debitCardSummary),[u,L,d,O,f.debitCardSummary]),D=r.useMemo(()=>Xe(y,u,L,k),[y,u,L,k]),G=f.creditAccount.balance.amount+f.creditAccount.hold.amount,Q=r.useMemo(()=>l!=null?g.repaymentHistory.find(o=>o.cardRepaymentId===l):void 0,[l,g.repaymentHistory]),I=r.useCallback(o=>{M(o),t(ia(B,u&&L,y&&k,!1)),v(!0)},[t,B,u,L,y,k]),N=r.useCallback(()=>{v(!1),M(null),document.body.style.overflow="auto"},[]);r.useEffect(()=>{S||g.fetchState==="Completed"||g.fetchState==="In-Progress"||(P(!0),t(Ga()))},[S,t,g.fetchState]),r.useEffect(()=>{!m&&(k||L)&&a&&(C(!0),t(ia(B,!1,y&&k,!1)))},[m,k,L,a,t,B,y]);const K=ea(b),X={events:ha(K,Vr),eventCallback:(o,A,Z)=>{Z.onEventReceived(o)},onSubscribed:o=>{o.onPusherSubscribed()}};return c.jsxs(c.Fragment,{children:[F?c.jsx(Yt,{closeDrawerHandler:N,isPaymentDrawerOpen:F,pageName:"Payment History",sourcePage:"cardPaymentHistory",creditAccountSpentAmount:G,productInformation:D,creditAccountInformation:$,debitAccountInformation:_,cashbackInformation:z,isDebitCardInfoFetchStateCompleted:!(u&&L&&d)||O.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!y||R.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!d||H.fetchState==="Completed",paymentInitiatedDate:R.initiatedRepaymentDate,retryRepayment:Q}):null,c.jsx(ki,{...X,location:n,navigate:e,accountInfoByAccountId:g.accountInfoByAccountId,onRetryPaymentClick:I})]})}const kn=He.div`
|
|
26
|
-
display: flex;
|
|
27
|
-
height: 100vh;
|
|
28
|
-
width: 100%;
|
|
29
|
-
flex: 1 1 auto;
|
|
30
|
-
flex-direction: column;
|
|
31
|
-
overflow: auto;
|
|
32
|
-
align-items: center;
|
|
33
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
34
|
-
`,En=Je.getLocalizedStrings().months;function Ai(){const e=le(),n=me(),t=he(),{creditAccount:a,creditAccountRepayment:s}=i(D=>ua(D)),b=`${Sr.cardMicroServiceBaseUrl}/1.0/credit-accounts/${a.id}`,[g,S]=r.useState(!1),[P,m]=r.useState(!1),C=i(D=>Ec(D)),{useFeatureGate:F}=ue(),v=i(D=>ge(D)),{isFeatureEnabled:l}=F(W.isChargeCardFeatureEnabled),{isFeatureEnabled:M}=F(W.isDebitCardFeatureEnabled),{isFeatureEnabled:B}=F(W.isCardsCommentingEnabled),L=_r(B?v.companyId:void 0,{clearParams:B&&C.fetchState==="Completed"}),p=Le(M,v),h=Oe({isDebitCardFeatureEnabled:M,isBankingOnlyTenant:p}),T=xe(v),u=Be(v),w=v.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,E=Ue({isCardsOnlyTenant:T,isChargeCardFeatureEnabled:l,isBookKeepingTenant:u,isDebitCardProductVisible:h,chargeCardsCreditAccountLimit:w}),U=!!v.companyDebitCardInfo?.info?.isDebitCardEnabled,y=!!v.companyChargeCardInfo?.info?.isChargeCardEnabled,k=i(D=>da(D,v.companyId)),x=la(k.controllers),d=i(D=>sr(D)),f=d.cards.filter(D=>D.type.code.includes("debit")).map(D=>D.connectedAccountId),j=[...new Set(f)],H=i(D=>tt(D,j)),O=i(D=>Ac(D));r.useEffect(()=>{P||a.fetchState==="Completed"||a.fetchState==="In-Progress"||(S(!0),n(Qe()))},[g,n,a.fetchState]),r.useEffect(()=>{P||a.fetchState!=="Completed"||a.id==null||C.fetchState==="Completed"||C.fetchState==="In-Progress"||(m(!0),n(Dc(a.id)))},[P,n,a.fetchState,a.id,C.fetchState]),r.useEffect(()=>{H.fetchState!=="Completed"&&H.fetchState!=="In-Progress"&&h&&U&&n(cr()),d.fetchState!=="Completed"&&d.fetchState!=="In-Progress"&&n(Ne()),O.fetchState!=="Completed"&&O.fetchState!=="In-Progress"&&h&&U&&n(_c()),s.fetchState!=="Completed"&&s.fetchState!=="In-Progress"&&E&&y&&n(Tt())},[H.fetchState,h,U,d.fetchState,O.fetchState,s.fetchState,E,y]),r.useEffect(()=>{if(C.fetchState==="Completed"&&a.fetchState==="Completed"&&s.fetchState==="Completed"&&d.fetchState==="Completed"&&(!h||!U||H.fetchState==="Completed"&&O.fetchState==="Completed")){let D="",G="";if(C.statements.length>0){const K=C.statements[C.statements.length-1].period,[X,o]=K.split("-"),A=C.statements[0].period,[Z,ne]=A.split("-");D=`${En[parseInt(o)-1]} ${X}`,G=`${En[parseInt(ne)-1]} ${Z}`}const Q=Xe(E,h,U,y),I=Ba(E,y,!0,a,s),N=Nt(h,U,!0,H,O);J.trackCardsCreditCardStatementsView(x,Q,{numberOfStatements:C.statements.length,oldestStatementMonthYear:D,latestStatementMonthYear:G},I,N)}},[C.fetchState,a.fetchState,s.fetchState,H.fetchState,d.fetchState,O.fetchState]);const R=()=>{const D=we(t.state?.pathnameStackToGoBack),G=D.poppedPathname??"..";e(G,{state:{pathnameStackToGoBack:D.newStack}})},z=i(D=>ma(D)),$=te.getSignedInUser(),_={userId:$?.userId??"",sessionId:$?.zeniSessionId??"",tenantId:v.tenantId??""};if($==null)throw Error("Can't access address page without signing in...");if(C.fetchState!=="Completed")return c.jsx(kn,{children:c.jsx(ho,{onBackClick:R})});{const D=Xe(E,h,U,y);return c.jsx(kn,{children:c.jsx(fo,{currentTenantCompanyName:v.companyName,statementListView:C,productInformation:D,onBackClick:R,authParams:_,controllerEmails:x,isChargeCardFeatureEnabled:E,isDebitCardFeatureEnabled:h,isDebitCardSetupEnabled:U,isChargeCardSetupEnabled:y,isCardsCommentingEnabled:B,initialOpenThreadRequest:L,chargeCardCashbackDetailState:z,creditAccount:a,creditAccountRepayment:s,depositAccountListWithDebitCardIssued:H,debitCardSummary:O,downloadEndPoint:b})})}}const Hr=[pa,it],Di=new Set(Hr),_i={containerWidth:new Fa(100,58)},Pi=({appContent:e})=>{const n=Ta(),t=me(),a=le(),s=he(),{useDynamicConfig:b}=ue(),[g,S]=r.useState(!1),[P,m]=r.useState(!1),[C,F]=r.useState(!1),[v,l]=r.useState(!1),M=r.useRef(!1),B=r.useRef(null);r.useEffect(()=>()=>{B.current!=null&&(clearTimeout(B.current),B.current=null)},[]);const[L,p]=r.useState(!1),[h,T]=r.useState(!1),u=te.getSignedInUser();if(u==null)throw Error("Can't access onboarding card page without signing in...");const w=i(N=>ge(N)),{configValue:E}=b(We.zeniCardsConfig),U=i(N=>Pc(N)),{tenantEmailDomain:y}=w,k=i(N=>N.settingsViewState.profile.fetchState),x=i(N=>N.chargeCardListState.fetchState),d=i(N=>N.settingsViewState.profile.userId),f=i(N=>N.chargeCardConfigState.fetchState);r.useEffect(()=>{g===!1&&k!=="In-Progress"&&k!=="Completed"&&(t(wc()),S(!0)),P===!1&&f!=="In-Progress"&&f!=="Completed"&&(t(Qa()),m(!0)),C===!1&&x==="Not-Started"&&(F(!0),t(Ne()))},[g,C,x,P,f]),r.useEffect(()=>{k==="Completed"&&L===!1&&d!=null&&x==="Completed"&&U.cards.length>0&&(t(vc({userId:d})),t(or({cardId:U.cards[U.cards.length-1].id})),p(!0))},[k,L,d,x]),r.useEffect(()=>{if(!v&&U.fetchState==="Completed"&&U.cards.length===0){const N=we(s.state?.pathnameStackToGoBack),K=N.poppedPathname??aa(y);a(K,{state:{pathnameStackToGoBack:N.newStack}})}},[U.fetchState,U.cards,v]);const j=i(N=>qa(N)),H=ya(j.updateStatus.fetchState),O=j.currentDisplayedCardId,{useFeatureGate:R}=ue(),{isFeatureEnabled:z}=R(W.isChargeCardFeatureEnabled),$=!!w.companyChargeCardInfo?.info?.isChargeCardEnabled,_=!w.userRole.includes("charge_card_user")&&z&&$,D=i(N=>O!=null?ir(N.chargeCardState,O):null),G=()=>{O!=null&&(M.current=!0,B.current!=null&&clearTimeout(B.current),B.current=setTimeout(()=>{M.current=!1,B.current=null},5e3),t(ka(O,_,!0)),t(Ne(!0)),l(!0))},Q=ea(w);Vt({events:ha(Q,Hr),onSubscribed:()=>{t(Ne(!0))},onEvent:(N,K)=>{if(!Di.has(N))return;const X=Wt(K),o=M.current;if(N===pa){const Z=de(X?.card_id)??O;if(Z!=null){const ne=Kt(X,Z);if(ne!=null)return t(Ft(ne)),void(Z!==O||o||G())}}if(N===it)return void t(Ne(!0));const A=de(X?.card_id)??O;(O==null||A===O)&&O!=null?o||G():t(Ne(!0))}}),r.useEffect(()=>{if(v&&O!=null&&D!=null&&D.status.code!=="request_on_hold"){const N=_e(w.tenantEmailDomain,O,u,D),K=ye(s.state?.pathnameStackToGoBack,s.pathname);t(Tc()),D?.type.code==="business_virtual_credit_card"&&t(Xa()),a(N,{state:{pathnameStackToGoBack:K},replace:!0}),M.current=!1,B.current!=null&&(clearTimeout(B.current),B.current=null)}},[v,D?.status.code]),r.useEffect(()=>{H==="In-Progress"&&j.updateStatus.fetchState==="Completed"&&setTimeout(G,3e3)},[H,j.updateStatus.fetchState]);const I=N=>{T(N)};if(k!=="Completed"||U.cards.length===0)return c.jsxs(An,{children:[c.jsx(Ie,{isAppContentDrawerOpen:h,handleDrawerToggle:I}),c.jsx(go,{})]});if(d==null)throw Error("Can't access my userId.");return c.jsxs(An,{children:[c.jsx(Ie,{isAppContentDrawerOpen:h,handleDrawerToggle:I}),c.jsx(wi,{chargeCardListView:U,cardUserOnboardingView:j,navigate:a,currentTenant:w,myUserId:d,location:s,chargeCardCashbackRatePerTransaction:E.charge_card_cashback_rate_per_transaction!=null?E.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{I(!0)}}),e!=null?c.jsx(vi,{windowSize:n,children:e}):null]})},wi=Pe(function(e,{currentTenant:n,cardUserOnboardingView:t,chargeCardListView:a,myUserId:s}){const b=Ca(e,!1,!1,!1);let g=!1;return b.fetchState==="Completed"&&b.cards.length<=1&&(g=!0),{cards:a.cards,showMenuIcon:g,companyLegalName:n.companyName,twoFAView:t.twoFAView,cardUserOnboardingLocalData:t.cardUserOnboardingLocalData??{userId:s},isDOBDisabled:t.isDOBPresent,onboardingProgressStatus:t.onboardingProgressStatus}},function(e,n){const{navigate:t,cardUserOnboardingView:a,location:s,currentTenant:b}=n,{tenantEmailDomain:g}=b;return{updateCardUserOnboardingLocalData:S=>{e(gn({localData:S}))},onGetOtp:S=>{if(a.cardUserOnboardingLocalData!=null){const P={...a.cardUserOnboardingLocalData,phone:S};e(gn({localData:P}))}e(at(S,"CardUserOnboarding"))},onResendOtp:S=>{e(et(S,"CardUserOnboarding"))},onVerifyOtp:(S,P)=>{e(Ja(S,P,"CardUserOnboarding"))},onVerifyOtpSuccess:S=>{e(Fc()),S!=null&&te.saveZeniOtpToken(S)},setCurrentDisplayedCardId:S=>{e(or({cardId:S}))},onBackClick:()=>{const S=we(s.state?.pathnameStackToGoBack),P=S.poppedPathname??aa(g);t(P,{state:{pathnameStackToGoBack:S.newStack}})}}})(So),vi=He.div`
|
|
35
|
-
display: flex;
|
|
36
|
-
flex-direction: column;
|
|
37
|
-
width: ${e=>`${_i.containerWidth.value(e.windowSize)}%`};
|
|
38
|
-
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
39
|
-
`,An=He.div`
|
|
40
|
-
display: flex;
|
|
41
|
-
min-height: 100%;
|
|
42
|
-
width: 100%;
|
|
43
|
-
flex: 1 1 auto;
|
|
44
|
-
flex-direction: column;
|
|
45
|
-
align-items: center;
|
|
46
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
47
|
-
`,Ti={containerWidth:new Fa(100,58)},Fi=({appContent:e})=>{const n=Ta(),t=me(),a=le(),{cardId:s}=Ve(),b=he(),{useDynamicConfig:g,useFeatureGate:S}=ue(),[P,m]=r.useState(!1),[C,F]=r.useState(!1),[v,l]=r.useState(!1),[M,B]=r.useState(!1),L=te.getSignedInUser();if(L==null)throw Error("Can't access onboarding card page without signing in...");const p=i(_=>ge(_));if(s==null)throw Error("Empty card id is not valid...");const{configValue:h}=g(We.zeniCardsConfig),T=i(_=>xc(_,s)),{isFeatureEnabled:u}=S(W.isChargeCardFeatureEnabled),{isFeatureEnabled:w}=S(W.isDebitCardFeatureEnabled),E=Le(w,p),U=Oe({isDebitCardFeatureEnabled:w,isBankingOnlyTenant:E}),y=xe(p),k=Be(p),x=p.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,d=Ue({isCardsOnlyTenant:y,isChargeCardFeatureEnabled:u,isBookKeepingTenant:k,isDebitCardProductVisible:U,chargeCardsCreditAccountLimit:x}),f=T.chargeCard,j=i(_=>_.chargeCardConfigState.fetchState);r.useEffect(()=>{P===!1&&j!=="In-Progress"&&j!=="Completed"&&(t(Qa()),m(!0)),C===!1&&T.fetchState==="Not-Started"&&(F(!0),t(ka(s,!1,d)))},[C,T.fetchState,P,j]);const H=f?.type.code==="business_physical_debit_card"||f?.type.code==="business_virtual_debit_card";r.useEffect(()=>{if(T.fetchState==="Completed"){if(v===!1&&(H===!1||H&&f.status?.code!=="active"||H&&f.status.code==="active"&&f.isPinSet||f.cardHolderUserId!==L.userId)){const _=_e(p.tenantEmailDomain,s,L,f,!0),D=ye(b.state?.pathnameStackToGoBack,b.pathname);a(_,{state:{pathnameStackToGoBack:D}})}else if(v&&T.isRefreshingViewInBackground===!1&&f?.isPinSet===!0){t(Bc({chargeCardId:s}));const _=_e(p.tenantEmailDomain,s,L,f,!0),D=ye(b.state?.pathnameStackToGoBack,b.pathname);t(Xa()),a(_,{state:{pathnameStackToGoBack:D}})}}},[T.fetchState,f?.type.code,v,T.isRefreshingViewInBackground]);const O=te.getZeniOtpTokenForCardHolder(s),R=i(_=>Vn(_.userState,L.userId)),z=()=>{f?.isPinSet!==!0&&t(Sa(s,!0))};r.useEffect(()=>{T.updateDebitCardPinAttemptFetchState.fetchState==="Completed"&&(setTimeout(z,3e3),l(!0))},[T.updateDebitCardPinAttemptFetchState.fetchState]);const $=_=>{B(_)};if(j!=="Completed"||f==null)return c.jsx(va,{fetchState:"In-Progress"});if(R?.phone==null)throw Error("Can't access user phone number.");return c.jsxs(Li,{children:[c.jsx(Ie,{isAppContentDrawerOpen:M,handleDrawerToggle:$}),c.jsx(xi,{cardId:s,card:f,phone:R.phone,signedInUser:L,isSandboxEnv:Rt(),debitCardDetailState:T,signedInUserToken:O,navigate:a,currentTenant:p,location:b,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{$(!0)}}),e!=null?c.jsx(Bi,{windowSize:n,children:e}):null]})},xi=Pe(function(e,{debitCardDetailState:n,cardId:t}){const a=Hn(e,t),s=n.updateStatus,b=Ca(e,!1,!1,!1);let g=!1;return b.fetchState==="Completed"&&b.cards.length<=1&&(g=!0),{showMenuIcon:g,vgsVaultId:rt.cardVaultId,twoFAView:a,setPinWaitStatus:s}},function(e,n){const{navigate:t,cardId:a,location:s,currentTenant:b,debitCardDetailState:g}=n,S=g.chargeCard?.cardProviderID,{tenantEmailDomain:P}=b;return{onGetOtp:m=>{S!=null&&e(at(m,"ChargeCardHolder",a))},onUpdateDebitCardPinAttempt:m=>{e(Zn(a,m))},onResendOtp:m=>{S!=null&&e(et(m,"ChargeCardHolder",a))},onVerifyOtp:(m,C)=>{S!=null&&e(Ja(m,C,"ChargeCardHolder",a))},onVerifyOtpSuccess:m=>{m!=null&&te.saveZeniOtpTokenForCardHolder(m,a)},onSetPinSuccess:()=>{e(Lc({chargeCardId:a}))},onBackClick:()=>{const m=we(s.state?.pathnameStackToGoBack),C=m.poppedPathname==null||m.poppedPathname.includes("activate")===!0?aa(P):m.poppedPathname;t(C,{state:{pathnameStackToGoBack:m.newStack}})}}})(bo),Bi=He.div`
|
|
48
|
-
display: flex;
|
|
49
|
-
flex-direction: column;
|
|
50
|
-
width: ${e=>`${Ti.containerWidth.value(e.windowSize)}%`};
|
|
51
|
-
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
52
|
-
box-shadow: ${e=>`${Wa.sp0} 2px ${Wa.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
53
|
-
`,Li=He.div`
|
|
54
|
-
display: flex;
|
|
55
|
-
min-height: 100%;
|
|
56
|
-
width: 100%;
|
|
57
|
-
flex: 1 1 auto;
|
|
58
|
-
flex-direction: column;
|
|
59
|
-
align-items: center;
|
|
60
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
61
|
-
box-shadow: ${e=>`${Wa.sp0} 2px ${Wa.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
62
|
-
`,Ri={overlayWidth:new Fa(ht[12],ht[12],ht[9])},Oi=Pe(function(e,n){const t=Bt(e,!1,!1),a=n.lineId,s=t.customAddress[a],b=t.customAddressStatus[a]??{fetchState:"Not-Started",error:void 0};return{googleAPIKey:n.googleAPIKey,customAddress:s,customAddressStatus:b,lineId:a}},function(e,n){const{newCustomAddressId:t,lineId:a,chargeCardTypeOption:s}=n;return{onSubmitHandler:b=>{t!=null&&e(dr(`${s==="creditCard"?"credit":"debit"}_custom_shipping_${a}_address`));const g=Bo(b);e(Uc({addressType:`${s==="creditCard"?"credit":"debit"}_custom_shipping_${a}_address`,addressToCreate:g})),e(jc(`${s==="creditCard"?"credit":"debit"}_custom_shipping_${a}_address`))},onDismissClick:()=>{n.onDismissClick(),t!=null&&e(Oc({addressId:t,cardLineId:a,cardType:s==="creditCard"?"business_physical_credit_card":"business_physical_debit_card"}))}}})(yo),Ui=({lineId:e,closeDrawerHandler:n,chargeCardTypeOption:t})=>{const a=Ot(),s=Ta(),b=()=>{n()},g=i(S=>Rc(`${t==="creditCard"?"credit":"debit"}_custom_shipping_${e}_address`,S))?.newAddressId;return c.jsx(Ir,{anchor:"right",open:e.length>0,PaperProps:{style:{minWidth:Ri.overlayWidth.valuePercentage(s),boxShadow:"none",zIndex:8}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:a.colors.black,cursor:"pointer"}}},onClose:(S,P)=>(P==="backdropClick"||P==="escapeKeyDown")&&b(),children:c.jsx(Oi,{googleAPIKey:rt.googleMapsAPIKey,onDismissClick:b,lineId:e,chargeCardTypeOption:t,newCustomAddressId:g})})},ji=Pe(function(e,n){const{isChargeCardFeatureEnabled:t,isDebitCardFeatureEnabled:a,isIssuePhysicalCardEnabled:s,isIssuePhysicalDebitCardEnabled:b,isChargeCardSetupEnabled:g,isDebitCardSetupEnabled:S}=n,P=Bt(e,t&&g,a&&S);return{issueChargeCards:P,isIssuePhysicalCardEnabled:s,isIssuePhysicalDebitCardEnabled:b,isDebitCardFeatureEnabled:a,isChargeCardFeatureEnabled:t,isChargeCardSetupEnabled:g,isDebitCardSetupEnabled:S,cardHolderCandidates:P.userList.map(m=>m.user).filter(Boolean),allRoles:P.userList.map(m=>m.userRole),allAccountingClasses:P.allAccountingClasses,userList:P.userList}},function(e,n){return{onIssueCardClick:()=>{e(Vc())},onSaveChangesToLocalStore:t=>{e(Nc(t))},onDismissClick:()=>{e(lr()),n.navigate("../")},resetCustomAddressByLineID:(t,a)=>{e(dr(`${a==="creditCard"?"credit":"debit"}_custom_shipping_${t}_address`))},openAddAddressDrawerHandler:n.openAddAddressDrawerHandler}})(Eo);function Mi(){const e=te.getSignedInUser(),n=le(),t=me(),a=Io(),[s]=Dn(),b=s.get("cardType"),{useFeatureGate:g}=ue(),{isFeatureEnabled:S}=g(W.isIssuePhysicalCardEnabled),{isFeatureEnabled:P}=g(W.isIssuePhysicalDebitCardEnabled),{isFeatureEnabled:m}=g(W.isDebitCardFeatureEnabled),{isFeatureEnabled:C}=g(W.isChargeCardFeatureEnabled),F=i(z=>ge(z)),v=Le(m,F),l=Oe({isDebitCardFeatureEnabled:m,isBankingOnlyTenant:v}),M=xe(F),B=Be(F),L=F.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,p=Ue({isCardsOnlyTenant:M,isChargeCardFeatureEnabled:C,isBookKeepingTenant:B,isDebitCardProductVisible:l,chargeCardsCreditAccountLimit:L}),[h,T]=r.useState(!1);if(e==null)throw Error("Can't access issue card page without signing in...");r.useEffect(()=>{h||(T(!0),t(Mc(l&&w,p&&u,!1)))},[h,T,t]);const u=!!F.companyChargeCardInfo?.info?.isChargeCardEnabled,w=!!F.companyDebitCardInfo?.info?.isDebitCardEnabled,E=i(z=>Bt(z,p&&u,l&&w)),U=E.fetchState,y=E.issueCardStatus.fetchState,k=E.lastSelfIssuedDebitCardId,x=i(z=>k!=null?ir(z.chargeCardState,k):void 0),[d,f]=r.useState(null),[j,H]=r.useState(null),O=()=>{f(null)},R=(z,$)=>{f(z),H($)};return r.useEffect(()=>{if(y==="Completed"){if(k!=null&&x?.type.code==="business_virtual_debit_card"){let z;z=x?.status.code==="request_on_hold"&&e.userId===x.cardHolderUserId?Dr(F.tenantEmailDomain):_e(F.tenantEmailDomain,k,e,x),n(z)}else n("../");t(lr())}},[y,k]),U==="Completed"?c.jsxs(c.Fragment,{children:[d!==null&&j!==null?c.jsx(Ui,{closeDrawerHandler:O,lineId:d,chargeCardTypeOption:j}):null,c.jsx(ji,{themeState:a,isIssuePhysicalCardEnabled:S,isIssuePhysicalDebitCardEnabled:P,isDebitCardFeatureEnabled:l,isChargeCardFeatureEnabled:p,isChargeCardSetupEnabled:u,isDebitCardSetupEnabled:w,navigate:n,fetchState:E.fetchState,openAddAddressDrawerHandler:R,defaultCardType:b==="creditCard"||b==="debitCard"?b:void 0})]}):U==="Error"?c.jsx(ct,{}):c.jsx(ko,{})}const Gr=[pa,it],Ni=new Set(Gr),Vi=He.div`
|
|
63
|
-
display: flex;
|
|
64
|
-
height: 100vh;
|
|
65
|
-
width: 100%;
|
|
66
|
-
flex: 1 1 auto;
|
|
67
|
-
flex-direction: column;
|
|
68
|
-
overflow: auto;
|
|
69
|
-
align-items: center;
|
|
70
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
71
|
-
`,Hi=Pe(function(e,n){const{myPendingActivationChargeCardListState:t}=n;return{myPendingActivationChargeCardListView:t,uiState:t.uiState,signedInUser:n.signedInUser}},function(e,n){const{navigate:t,currentTenant:a,location:s,signedInUser:b,myPendingActivationChargeCardListState:g}=n,{tenantEmailDomain:S}=a,{cards:P}=g;return{onChargeCardRowClick:m=>{const C=Ar(P,m),F=_e(S,m,b,C),v=ye(s.state?.pathnameStackToGoBack,s.pathname);t(F,{state:{pathnameStackToGoBack:v}})},onColumnSortConfigChanged:(m,C)=>{e(It({uiState:{sortKey:m,sortOrder:C}}))},onReloadCards:()=>{e(Ne())},onBackClick:()=>{const m=a.userRole.includes("charge_card_user");e(It({uiState:{sortKey:m?"cardName":"owner",sortOrder:"ascending"}})),t("../")}}})(Ao);function Gi(){const e=le(),n=me(),t=he(),a=Ot(),[s,b]=r.useState(!1),g=i(R=>Hc(R)),S=i(R=>ge(R)),P=i(R=>da(R,S.companyId)),m=la(P.controllers),{useFeatureGate:C}=ue(),{isFeatureEnabled:F}=C(W.isChargeCardFeatureEnabled),{isFeatureEnabled:v}=C(W.isDebitCardFeatureEnabled),l=Le(v,S),M=Oe({isDebitCardFeatureEnabled:v,isBankingOnlyTenant:l}),B=!!S.companyDebitCardInfo?.info?.isDebitCardEnabled,L=!!S.companyChargeCardInfo?.info?.isChargeCardEnabled,p=Re(),h=xe(S),T=Be(S),u=S.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,w=Ue({isCardsOnlyTenant:h,isChargeCardFeatureEnabled:F,isBookKeepingTenant:T,isDebitCardProductVisible:M,chargeCardsCreditAccountLimit:u}),E=Fe(p?.loggedInUserRoleMap),U=i(R=>ma(R)),{creditAccount:y,creditAccountRepayment:k}=i(R=>ua(R)),x=i(R=>sr(R)).cards.filter(R=>R.type.code.includes("debit")).map(R=>R.connectedAccountId),d=[...new Set(x)],f=i(R=>tt(R,d));r.useEffect(()=>{s||g.fetchState==="Completed"||g.fetchState==="In-Progress"||(b(!0),n(Ne()),n(Qa()))},[s,n,g.fetchState]),r.useEffect(()=>{if(g.fetchState==="Completed"&&g.cards.length===1&&j!=null){const R=_e(S.tenantEmailDomain,g.cards[0].id,j,g.cards[0]);e(R,{state:{message:t.state?.message}})}},[g.fetchState,g.cards]);const j=te.getSignedInUser();r.useEffect(()=>{y.fetchState!=="Completed"&&y.fetchState!=="In-Progress"&&w&&L&&E&&n(Qe()),k.fetchState!=="Completed"&&k.fetchState!=="In-Progress"&&E&&n(Tt()),f.fetchState!=="Completed"&&f.fetchState!=="In-Progress"&&M&&B&&E&&n(cr())},[y.fetchState,k.fetchState,n,f.fetchState,M,B,E,w,L]);const H=ea(S);if(Vt({events:ha(H,Gr),onEvent:(R,z)=>{if(!Ni.has(R))return;const $=Wt(z);if(R===pa){const _=de($?.card_id);if(_!=null){const D=Kt($,_);if(D!=null)return void n(Ft(D))}}n(Ne(!0))},onSubscribed:()=>{n(Ne(!0))}}),j==null)throw Error("Can't access address page without signing in...");const O=g.cards!=null&&g.cards.length>0;if(g.fetchState==="Completed"||O){const R=Xe(w,M,B,L);return c.jsx(Vi,{children:c.jsx(Hi,{navigate:e,currentTenant:S,signedInUser:j,productInformation:R,myPendingActivationChargeCardListState:g,isChargeCardFeatureEnabled:w,isDebitCardFeatureEnabled:M,isDebitCardSetupEnabled:B,isChargeCardSetupEnabled:L,chargeCardCashbackDetailState:U,creditAccount:y,creditAccountRepayment:k,depositAccountListWithDebitCardIssued:f,controllerEmails:m,location:t})})}return c.jsx(va,{fetchState:"In-Progress",style:{backgroundColor:a.colors.grey5}})}const $i=Pe(function(e,n){const{companyId:t,companyLegalName:a}=n;return{chargeCardSetupView:wa(e,t),admins:n.adminList,companyLegalName:a,meetingUrl:"https://meetings.hubspot.com/niharn/demo-zeni-charge-cards?embed=true"}},function(e,n){const{navigate:t,companyId:a,isCompanyBusinessVerificationAndPaymentSetUpDone:s,isDebitCardSetupEnabled:b,isChargeCardSetupEnabled:g,signedInUser:S,location:P,productInformation:m,isEarlyPayEnabled:C,controllerEmails:F,chargeCardsCreditAccountLimit:v}=n;return{onSetupButtonClick:l=>{if(S!=null&&J.trackCardsPromoPageClicked("enable cards"),s)switch(J.trackCardsEnableCardsClick(F,m,"Cards Promo"),l){case"credit":e(qe(a,!0,"charge_cards",C,!1));break;case"debit":e(qe(a,!0,"debit_cards",C,!1));break;case"debit_and_credit":e(v===0?qe(a,!0,"debit_cards",C,!0):qe(a,!0,"charge_cards__debit_cards",C,!1))}else switch(J.trackCardsSetupCardsClick(F,m,"Cards Promo"),l){case"credit":e(qe(a,!1,"charge_cards",C,!1));break;case"debit":e(qe(a,!1,"debit_cards",C,!1));break;case"debit_and_credit":e(v===0?qe(a,!1,"debit_cards",C,!0):qe(a,!1,"charge_cards__debit_cards",C,!1))}},onBackClick:()=>{const l=we(P.state?.pathnameStackToGoBack);let M=l.poppedPathname;M==null&&(M=b||g?"..":"../.."),t(M,{state:{pathnameStackToGoBack:l.newStack}})},onLetsGoClick:()=>{t("./onboard")},onSetupChargeCardSuccess:()=>{s?(e(Xa()),t("../",{relative:"path"})):t("../setup",{relative:"path"})},onExpressInterestClick:()=>{e(zc(a))}}})(_o),zi=()=>{const e=le(),{tenantEmailDomain:n}=Ve(),[t]=Dn(),a=t.get("cardPromoType"),s=me(),{useDynamicConfig:b,useFeatureGate:g}=ue(),[S,P]=r.useState(!1),{isFeatureEnabled:m}=g(W.isDebitCardFeatureEnabled),{isFeatureEnabled:C}=g(W.isEarlyPayFeatureEnabled),{isFeatureEnabled:F}=g(W.isChargeCardFeatureEnabled),{configValue:v}=b(We.zeniCardsConfig),l=i(ae=>ge(ae)),M=i(ae=>da(ae,l.companyId)),B=la(M.controllers),L=v.charge_card_cashback_rate_per_transaction!=null?v.charge_card_cashback_rate_per_transaction:.0175,p=he(),h=te.getSignedInUserTenant(n)?.companyId??l.companyId,T=i(ae=>wa(ae,h)),u=T.primaryFundingAccount,w=l.companyBillPayInfo?.info,E=xe(l),U=Be(l),y=Le(m,l),k=l.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,x=Oe({isDebitCardFeatureEnabled:m,isBankingOnlyTenant:y}),d=Ue({isCardsOnlyTenant:E,isChargeCardFeatureEnabled:F,isBookKeepingTenant:U,isDebitCardProductVisible:x,chargeCardsCreditAccountLimit:k}),f=Er({isCardsOnlyTenant:E,isChargeCardFeatureEnabled:F,isBookKeepingTenant:U}),j=x&&d===!1,H=w?.businessVerificationStatus?.code==="verified"&&(j||u?.accType==="depositAccount"||Gc(u?.providerVerificationStatus?.code??"")),O=te.getSignedInUser(),R=!!l.companyZeniAccountInfo?.info?.isZeniAccountEnabled,z=!!l.companyChargeCardInfo?.info?.isChargeCardTOSAccepted,$=!!l.company?.companyChargeCardInfo?.isChargeCardEnabled,_=!!l.company?.companyDebitCardInfo?.isDebitCardEnabled,D=!!l.companyChargeCardInfo?.info?.isChargeCardEnabled,G=!!l.companyDebitCardInfo?.info?.isDebitCardEnabled,Q=!!l.companyDebitCardInfo?.info?.isDebitCardTOSAccepted,I=ae=>{P(ae)},N=i(ae=>ae.chargeCardSetupViewState.fetchState);if(O==null)throw Error("Can't access Charge Card promo page without signing in...");const K=Re(),X=Fe(K?.loggedInUserRoleMap),o=xt(K?.loggedInUserRoleMap),[A,Z]=r.useState(!1),[ne,q]=r.useState(!1),[ke,ve]=r.useState(!1);r.useEffect(()=>{A===!1&&p.state?.message==="activation"&&Z(!0)},[p.state]),r.useEffect(()=>{ne||N!=="Not-Started"||h==null||(q(!0),s(Pa(h,!0)))},[ne,N,h,s]);const fe=l.companyChargeCardInfo?.info!=null&&Ia({cardInfo:l.companyChargeCardInfo.info,isProductVisible:f&&$,isTOSAccepted:z,isSetupEnabled:D,isUserHasCardsAdminLevelAccess:X,isUserHasCardsAccess:o}),se=l.companyDebitCardInfo?.info!=null&&Ia({cardInfo:l.companyDebitCardInfo.info,isProductVisible:x&&_,isTOSAccepted:Q,isSetupEnabled:G,isUserHasCardsAdminLevelAccess:X,isUserHasCardsAccess:o}),Ee=x&&se&&f&&k>=0&&fe?"debit_and_credit":x&&se?"debit":"credit",re=xo(a,Ee),Ce=T?.chargeCardTermsDetails?.fetchStatus?.fetchState,Ae=r.useRef(null);r.useEffect(()=>{Ce==="In-Progress"?Ae.current=re:Ce!=="Error"&&Ce!=="Not-Started"||(Ae.current=null)},[Ce,re]);const ee=Ce!=="In-Progress"&&Ce!=="Completed"||Ae.current==null?re:Ae.current;r.useEffect(()=>{re==="credit"&&(D||f===!1&&G)||re==="debit"&&G||re==="debit_and_credit"&&G&&D?e("../"):(re==="debit_and_credit"&&z===!0&&Q===!0||re==="credit"&&(z===!0||f===!1&&Q===!0)||re==="debit"&&Q===!0)&&X===!0&&e("../setup")},[H,D,G,re,z,Q]),r.useEffect(()=>{ke||(s($c("cardAdmin")),ve(!0))},[ke]);const Te=i(ae=>nr(ae.userState,ae.userRoleState,ae.userListViewState,"cardAdmin")),De=Xe(f,x,G,D);return(ae=>{switch(ae){case"credit":return $;case"debit":return _;case"debit_and_credit":return $&&_;default:return!1}})(ee)?(fe||se)&&N==="Completed"?c.jsxs(c.Fragment,{children:[c.jsx(Ut,{analytics:J,onLoad:()=>{if(J.trackPageLoaded(yr.Event.cardsPromoPage),!!f&&!D||!!x&&!G||!!f&&!!x&&!G&&!D){const ae=Yi({isDebitCardSetupEnabled:G,isChargeCardSetupEnabled:D,isCreditCardProductVisibleForExpressInterest:f,isDebitCardProductVisible:x});J.trackCardsPromoView(B,De,"Page",ae,"Promo Page")}}}),c.jsx(nt,{showConfetti:A}),c.jsx(Ie,{isAppContentDrawerOpen:S,handleDrawerToggle:I}),c.jsx($i,{signedInUser:O,location:p,showEnableCardButton:H,isCompanyBusinessVerificationAndPaymentSetUpDone:H,isChargeCardSetupEnabled:D,isDebitCardSetupEnabled:G,companyLegalName:l.companyName,adminList:Te.users,isCheckingEnabled:R,navigate:e,companyId:h,cardPromoType:ee,controllerEmails:B,productInformation:De,isCreditCardProductVisible:d,isDebitCardFeatureEnabled:m,isEarlyPayEnabled:C,cashbackRate:L,chargeCardsCreditAccountLimit:k,onClickMenuIcon:()=>{I(!0)}})]}):c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:S,handleDrawerToggle:I}),c.jsx(Do,{})]}):c.jsx(oa,{to:"../",replace:!0})},Yi=({isDebitCardSetupEnabled:e,isChargeCardSetupEnabled:n,isCreditCardProductVisibleForExpressInterest:t,isDebitCardProductVisible:a})=>t&&a&&!e&&!n?"Credit & Debit Card":t&&!n?"Credit Card":a&&!e?"Debit Card":"";function Sd(){const e=he(),n=i(K=>ge(K)),{useFeatureGate:t}=ue(),{isFeatureEnabled:a}=t(W.isChargeCardFeatureEnabled),{isFeatureEnabled:s}=t(W.isDebitCardFeatureEnabled),{isFeatureEnabled:b}=t(W.isEarlyPayFeatureEnabled),{isFeatureEnabled:g}=t(W.isChargeCardPaymentHistoryFeatureEnabled),{isFeatureEnabled:S}=t(W.isCardPolicyEnabled),P=Le(s,n),m=Oe({isDebitCardFeatureEnabled:s,isBankingOnlyTenant:P}),C=Po(n,a,s),F=!!n.company?.companyChargeCardInfo.isChargeCardTOSAccepted,v=!!n.company?.companyDebitCardInfo.isDebitCardTOSAccepted,l=!!n.company?.companyChargeCardInfo?.isChargeCardEnabled,M=!!n.company?.companyDebitCardInfo?.isDebitCardEnabled,B=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,L=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,p=Re(),h=Fe(p?.loggedInUserRoleMap),T=xt(p?.loggedInUserRoleMap),{isFeatureEnabled:u}=t(W.isCashbackFeatureEnabled),w=n.userRole.includes("charge_card_user"),E=!w,U=!w&&B,y=n?.userRole!=null&&Yc(n?.userRole),k=(n?.company==null||n.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!y)&&Wc(p?.loggedInUserRoleMap),x=Kc(p?.loggedInUserRoleMap),d=(n?.company==null||n.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!y)&&Zc(p?.loggedInUserRoleMap),{isFeatureEnabled:f}=t(W.isDepositAccountsFeatureEnabled),j=f&&!y&&$n(p?.loggedInUserRoleMap),H=B&&l&&!y,O=L&&M&&!y,R=C&&!y&&Fe(p?.loggedInUserRoleMap),z=qc(p?.loggedInUserRoleMap),$=xe(n),_=Be(n),D=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,G=Ue({isCardsOnlyTenant:$,isChargeCardFeatureEnabled:a,isBookKeepingTenant:_,isDebitCardProductVisible:m,chargeCardsCreditAccountLimit:D}),Q=n.companyChargeCardInfo?.info!=null&&Ia({cardInfo:n.companyChargeCardInfo.info,isProductVisible:G&&l,isTOSAccepted:F,isSetupEnabled:B,isUserHasCardsAdminLevelAccess:h,isUserHasCardsAccess:T}),I=n.companyDebitCardInfo?.info!=null&&Ia({cardInfo:n.companyDebitCardInfo.info,isProductVisible:m&&M,isTOSAccepted:v,isSetupEnabled:L,isUserHasCardsAdminLevelAccess:h,isUserHasCardsAccess:T}),N=Q||I;return c.jsxs(ss,{children:[h?c.jsx(ce,{path:"setup",element:c.jsx(Sn,{isBillPayAdminLevelAccess:k,isReimbursementAdminLevelAccess:d,isZeniAccountAdminLevelAccess:j,isChargeCardAdminLevelAccess:R,isUserHasOnlyCardAccess:z,isUserHasOnlyBillPayAccess:x,productType:"charge_cards",type:"setup"})}):null,h?c.jsx(ce,{path:"verification",element:c.jsx(Sn,{isBillPayAdminLevelAccess:k,isUserHasOnlyBillPayAccess:x,isReimbursementAdminLevelAccess:d,isZeniAccountAdminLevelAccess:j,isChargeCardAdminLevelAccess:R,isUserHasOnlyCardAccess:z,productType:"charge_cards",type:"verification"})}):null,h&&S?c.jsxs(c.Fragment,{children:[c.jsx(ce,{path:"policy",element:c.jsx(Yo,{})}),c.jsx(ce,{path:"policy/new",element:c.jsx(Uo,{})}),c.jsx(ce,{path:"policy/:templateId/edit",element:c.jsx(Vo,{})})]}):null,c.jsx(ce,{path:"promo",element:c.jsx(zi,{})}),H||O?c.jsxs(c.Fragment,{children:[c.jsx(ce,{path:"/",element:c.jsx(In,{isPaymentDrawerOpen:!1})}),R&&b?c.jsx(ce,{path:"payment",element:c.jsx(In,{isPaymentDrawerOpen:!0})}):null,c.jsx(ce,{path:"activate",element:c.jsx(Gi,{})}),c.jsx(ce,{path:"onboard",element:c.jsx(Pi,{})}),h?c.jsx(ce,{path:"new",element:c.jsx(Mi,{})}):null,u&&E?c.jsx(ce,{path:"cashback",element:c.jsx(Qo,{})}):null,U?c.jsx(ce,{path:"statements",element:c.jsx(Ai,{})}):null,R&&g&&B?c.jsx(ce,{path:"payment-history",element:c.jsx(Ei,{})}):null,c.jsx(ce,{path:":cardId/activate",element:c.jsx(ei,{})}),c.jsx(ce,{path:":cardId/setPin",element:c.jsx(Fi,{})}),c.jsx(ce,{path:":cardId/addToWallet",element:c.jsx(Wo,{})}),c.jsx(ce,{path:":cardId/*",element:c.jsx(li,{})}),c.jsx(ce,{path:"*",element:c.jsx(ct,{})})]}):(F||v)&&h?c.jsx(ce,{path:"*",element:c.jsx(oa,{to:"../setup"})}):N?c.jsx(ce,{path:"*",element:c.jsx(oa,{to:"../promo",state:e.state})}):c.jsx(ce,{path:"*",element:null})]})}export{Sd as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as i}from"./liveblocks-B2D23g1h.js";import{z as n}from"./index-sOa-ivVp.js";import{g as d}from"./QBOConnectionScreen-BlHRcpm3.js";import"./sentry-BQ1KU1t3.js";import{g as p,N as s}from"./core-FEzHdTwu.js";import"./zeni-epic-state-Bxb-N0Vf.js";import"./recharts-CIXkvtnT.js";import"./mui-C754KMjM.js";import"./analytics-BY30ztud.js";import"./plaid--k8gbxl0.js";import"./dnd-Cb_vPZwC.js";import"./stripe-DMRn4zHo.js";import"./lottie-BKshFrBj.js";import"./lexical-fJeYHrZP.js";import"./pdf-BSvba1pn.js";import"./utils-C8oTXAPM.js";import"./empty-C5RcOwbi.js";import"./pdf-lib-DwZXgIAK.js";import"./index-CVniyevN.js";import"./url-BWcieJIW.js";import"./index-C7vi0ZZK.js";import"./decodeURIComponentSafe-_VO6ySKg.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="817363c8-7f1d-4590-b58b-cef70b99ca15",t._sentryDebugIdIdentifier="sentry-dbid-817363c8-7f1d-4590-b58b-cef70b99ca15")}catch{}})();const U=()=>{const t=p(),{code:o,realmId:r,state:e}=d(t.search),m=n.getSignedInUser()?.userId??"";if(f(o,r,e,m)===!0){const a=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return i.jsx(s,{to:a})}return i.jsx(s,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as i}from"./liveblocks-B2D23g1h.js";import{K as f,E as l,y as c}from"./index-sOa-ivVp.js";import{D as p}from"./mui-C754KMjM.js";import"./sentry-BQ1KU1t3.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="d636e153-afe0-43db-9e0f-2ffcb0dec795",e._sentryDebugIdIdentifier="sentry-dbid-d636e153-afe0-43db-9e0f-2ffcb0dec795")}catch{}})();const b={drawerLeftMargin:new l(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:s}=e,n=f(),d=o?.valuePx(n)??b.drawerLeftMargin.valuePx(n),a=c();return i.jsx(p,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${d})`}},slotProps:{backdrop:{style:{backgroundColor:a.colors.black,opacity:.8,cursor:"pointer"}}},onClose:s,children:t})}export{h as D};
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import{j as t}from"./liveblocks-B2D23g1h.js";import{i as S,n as g,h as C,g as y,u as ee,t as te,j as E,N as ae,o as ne,p}from"./core-FEzHdTwu.js";import{Mb as k,Mc as v,Md as M,Bf as B,B1 as T,Me as D,Mf as oe,Mg as ie,B5 as se,fA as $,Bc as le,B9 as re}from"./zeni-epic-state-Bxb-N0Vf.js";import{K as x,o as r,k as de,d as j,h as G,m as ce,p as me,n as pe,q as _,C as ue,U as he,r as ge,v as xe,y as fe,w as we,B as be,x as Se,_ as ye,S as ke,D as ve,E as je,F as $e}from"./index-sOa-ivVp.js";import{n as m}from"./mui-C754KMjM.js";import f from"./NotFoundScreen-DKRpU5d2.js";import{a as I}from"./sentry-BQ1KU1t3.js";import"./recharts-CIXkvtnT.js";import"./analytics-BY30ztud.js";import"./plaid--k8gbxl0.js";import"./dnd-Cb_vPZwC.js";import"./stripe-DMRn4zHo.js";import"./lottie-BKshFrBj.js";import"./lexical-fJeYHrZP.js";import"./pdf-BSvba1pn.js";import"./utils-C8oTXAPM.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]="976ced6c-5f13-450a-b99e-f2e7470b9efd",e._sentryDebugIdIdentifier="sentry-dbid-976ced6c-5f13-450a-b99e-f2e7470b9efd")}catch{}})();const Ie=m.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
height: 100%;
|
|
4
|
-
width: 100%;
|
|
5
|
-
flex: 1 1 auto;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
align-items: center;
|
|
8
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
10
|
-
`,Ce=g(function(e){const a=k(e),n=v(e),{companyName:o}=a;return{companyName:o,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,magicLinkViewState:a}},function(e,a){const{vendorId:n,billId:o}=a;return{onFetchBankName:i=>{e(T(i))},onSaveHandler:i=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(o),e(B(i,"standard",n,o))},onACHDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(M({data:l}))}}})(de);function F(){const e=x(),{vendorId:a,billId:n}=S();return a==null||n==null?t.jsx(f,{}):t.jsx(t.Fragment,{children:t.jsx(Ie,{windowSize:e,children:t.jsx(Ce,{vendorId:a,billId:n})})})}const Be=m.div`
|
|
11
|
-
display: flex;
|
|
12
|
-
height: 100vh;
|
|
13
|
-
width: 100%;
|
|
14
|
-
flex: 1 1 auto;
|
|
15
|
-
flex-direction: column;
|
|
16
|
-
align-items: center;
|
|
17
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
18
|
-
box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
19
|
-
`,De=g(function(e,a){const{isSubPage:n}=a;return{addressToEdit:D(e),googleAPIKey:G.googleMapsAPIKey,isSubPage:n}},function(e,a){const{navigate:n,location:o}=a,i=()=>{const l=me(o.state?.pathnameStackToGoBack),s=l.poppedPathname??Pe();n(s,{state:{pathnameStackToGoBack:l.newStack}})};return{onSubmitHandler:l=>{const s=ze(l);e(oe({addressToCreate:s})),i()},onCancel:()=>{i()}}})(ce);function Ae({isSubPage:e}){const a=C(),n=y(),o=x();return t.jsx(t.Fragment,{children:t.jsx(Be,{windowSize:o,children:t.jsx(De,{location:n,navigate:a,isSubPage:e===!0,googleAPIKey:G.googleMapsAPIKey})})})}const Pe=(e=2)=>{let a="../";for(let n=0;n<e;n++)a=`${a}../`;return a},ze=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng}),Le=m.div`
|
|
20
|
-
display: flex;
|
|
21
|
-
height: 100%;
|
|
22
|
-
width: 100%;
|
|
23
|
-
flex: 1 1 auto;
|
|
24
|
-
flex-direction: column;
|
|
25
|
-
align-items: center;
|
|
26
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
27
|
-
box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
28
|
-
`,Ne=g(function(e){const a=k(e),n=v(e),o=D(e),{companyName:i}=a;return{companyName:i,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:a}},function(e,a){const{navigate:n,location:o,vendorId:i,billId:l}=a;return{onFetchBankName:s=>{e(T(s))},onSaveHandler:s=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(B(s,"us-domestic",i,l))},onWireDetailsUpdated:s=>{const{bankAccountSection:d}=s;e(M({data:d}))},onAddressClick:()=>{const s=o.pathname.replace("us-domestic","address"),d=_(o.state?.pathnameStackToGoBack,o.pathname);n(s,{state:{pathnameStackToGoBack:d}})}}})(pe);function Ee(){const e=C(),a=y(),n=x(),{vendorId:o,billId:i}=S();return o==null||i==null?t.jsx(f,{}):t.jsx(t.Fragment,{children:t.jsx(Le,{windowSize:n,children:t.jsx(Ne,{location:a,navigate:e,vendorId:o,billId:i})})})}const Fe=m.div`
|
|
29
|
-
display: flex;
|
|
30
|
-
height: 100%;
|
|
31
|
-
width: 100%;
|
|
32
|
-
flex: 1 1 auto;
|
|
33
|
-
flex-direction: column;
|
|
34
|
-
align-items: center;
|
|
35
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
36
|
-
box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
37
|
-
`,Me=g(function(e){const a=k(e),n=v(e),o=D(e),{companyName:i}=a;return{companyName:i,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:a}},function(e,a){const{navigate:n,location:o,vendorId:i,billId:l}=a;return{onFetchBankNameBySwift:s=>{e(se(s))},onSaveHandler:s=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(B(s,"international",i,l,a.isLocalCurrencyEnabled))},onBankDetailsUpdated:s=>{const{internationalWireSwiftAccountSection:d}=s;e(ie({data:d}))},onAddressClick:()=>{const s=o.pathname.replace("international","address"),d=_(o.state?.pathnameStackToGoBack,o.pathname);n(s,{state:{pathnameStackToGoBack:d}})}}})(ge);function Te(){const e=C(),a=y(),n=x(),{vendorId:o,billId:i}=S(),{useFeatureGate:l}=ue(),{isFeatureEnabled:s}=l(he.isBillPayLocalCurrencyFeatureEnabled);return o==null||i==null?t.jsx(f,{}):t.jsx(Fe,{windowSize:n,children:t.jsx(Me,{location:a,navigate:e,vendorId:o,billId:i,isLocalCurrencyEnabled:s})})}const Ge={containerWidth:new je(100,58)},_e=m(ke)`
|
|
38
|
-
width: ${r.sp4};
|
|
39
|
-
height: ${r.sp4};
|
|
40
|
-
margin-bottom: ${r.sp3};
|
|
41
|
-
margin-top: ${r.sp3};
|
|
42
|
-
margin-left: ${r.sp8};
|
|
43
|
-
cursor: pointer;
|
|
44
|
-
position: absolute;
|
|
45
|
-
color: ${e=>e.theme.colors.brandColorJade};
|
|
46
|
-
`,Ke=m.div`
|
|
47
|
-
display: flex;
|
|
48
|
-
height: 100vh;
|
|
49
|
-
flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
|
|
50
|
-
width: 100vw;
|
|
51
|
-
overflow-y: scroll;
|
|
52
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
53
|
-
`,Ve=m.div`
|
|
54
|
-
display: flex;
|
|
55
|
-
flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
|
|
56
|
-
flex-direction: column;
|
|
57
|
-
width: ${e=>`${Ge.containerWidth.value(e.windowSize)}%`};
|
|
58
|
-
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
59
|
-
box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
60
|
-
padding-top: ${e=>e.windowSize!=="small"?r.sp2:"0px"};
|
|
61
|
-
`,He=m.div`
|
|
62
|
-
display: flex;
|
|
63
|
-
flex-direction: column;
|
|
64
|
-
align-items: center;
|
|
65
|
-
justify-content: center;
|
|
66
|
-
padding: ${e=>e.windowSize==="small"?r.sp3:`62px ${r.sp6} ${r.sp9} ${r.sp8}`};
|
|
67
|
-
height: ${e=>e.windowSize==="small"?"490px":"auto"};
|
|
68
|
-
overflow: ${e=>e.windowSize==="small"?"unset":"hidden"};
|
|
69
|
-
width: ${e=>e.windowSize=="small"?"auto":"42%"};
|
|
70
|
-
background-color: ${e=>e.windowSize==="small"?e.theme.colors.grey4:e.theme.colors.background};
|
|
71
|
-
margin-top: ${e=>e.windowSize==="small"?e.isAddressPage?"0px":"186px":"unset"};
|
|
72
|
-
`,Ue=g(function(e,a){return{file:a.file,type:a.type}})(ve);function h({appContent:e}){const a=ee(),n=y(),{tenantEmailDomain:o,vendorId:i,billId:l}=S(),[s]=te(),d=s.get("token"),K=n.pathname.includes("address"),w=x(),V=xe(),A=fe(),b=we(),H=()=>{V.toggle()},U=E(u=>k(u)),W=E(u=>v(u)),{authParams:O,fetchState:c,billAttachment:q,billFetchState:P,companyName:J,currencySymbol:Q,amount:R}=U,{tenantId:z,userId:L,sessionId:N}=O,{fetchState:X,internationalBankAccountCreateStatus:Y}=W;return I.useEffect(()=>{$()},[]),I.useEffect(()=>{b&&c==="Not-Started"&&i!=null&&o!=null&&d!=null&&a(le(i,o,d))},[b,c,i,o,d,a]),I.useEffect(()=>{b&&c==="Completed"&&($(L,N,z),l!=null&&a(re(l)))},[c,b,L,N,z,l,a]),c==="Error"?t.jsx(f,{}):X==="Completed"||Y.fetchState==="Completed"?($(),t.jsx(ae,{to:"../../../../../../../bank/account/save/success",replace:!0,relative:"path"})):c==="In-Progress"?t.jsx(be,{fetchState:c,style:{height:"100vh",backgroundColor:A.colors.grey5,boxShadow:`0px 2px ${r.sp1} ${A.colors.dropShadowNormal}`}}):t.jsxs(t.Fragment,{children:[c==="Completed"&&P==="Completed"&&t.jsx(Se,{analytics:j,onLoad:u=>(Z=>Z.trackBillPayMagicLinkPageLoad(o??"",i??"",J,l??"",We(n.pathname),Q,R))(u)}),t.jsxs(Ke,{windowSize:w,children:[w!=="small"?t.jsx(_e,{onClick:H}):null,t.jsx(He,{windowSize:w,isAddressPage:K,children:P==="In-Progress"?t.jsx(ye,{size:"ExtraLarge",start:!0}):t.jsx(Ue,{file:q,type:"bill"})}),t.jsx(Ve,{windowSize:w,children:e})]})]})}const We=e=>`${e.split("/").at(-2)}_${e.split("/").at(-1)}`;function Oe(){return t.jsx($e,{})}function dt(){return t.jsxs(ne,{children:[t.jsx(p,{path:"bank/account/save/success",element:t.jsx(Oe,{})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/standard",element:t.jsx(h,{appContent:t.jsx(F,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/same-day",element:t.jsx(h,{appContent:t.jsx(F,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/address",element:t.jsx(h,{appContent:t.jsx(Ae,{isSubPage:!0})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/us-domestic",element:t.jsx(h,{appContent:t.jsx(Ee,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/international",element:t.jsx(h,{appContent:t.jsx(Te,{})})}),t.jsx(p,{path:"*",element:t.jsx(f,{})})]})}export{dt as default};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-B2D23g1h.js";import{a as g}from"./sentry-BQ1KU1t3.js";import{u as F,g as _,h as O,t as w,j as l,N as T}from"./core-FEzHdTwu.js";import{z as r,y as A,a as P,e as V,d as N,f as Y,H,_ as R,g as W}from"./index-sOa-ivVp.js";import{eX as X,LY as Z,M6 as $,LZ as q,fA as B,g0 as G,M2 as J,go as K,cY as Q,M7 as ee,M8 as te}from"./zeni-epic-state-Bxb-N0Vf.js";import{n as ne}from"./mui-C754KMjM.js";import{u as se}from"./useDeviceId-C0O1xmgi.js";import{f as ae}from"./analyticsHelper-BHJAp8-8.js";import{t as ie}from"./getLocaleForTenant-B8PdHxEZ.js";import"./recharts-CIXkvtnT.js";import"./analytics-BY30ztud.js";import"./plaid--k8gbxl0.js";import"./dnd-Cb_vPZwC.js";import"./stripe-DMRn4zHo.js";import"./lottie-BKshFrBj.js";import"./lexical-fJeYHrZP.js";import"./pdf-BSvba1pn.js";import"./utils-C8oTXAPM.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="2f2f2758-3e2b-4ce0-9a1c-7e59e307b0cd",t._sentryDebugIdIdentifier="sentry-dbid-2f2f2758-3e2b-4ce0-9a1c-7e59e307b0cd")}catch{}})();const x=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function xe(){const t=F(),a=_(),m=O(),[y]=w(),n=y.get("token"),p=y.get("stytch_token_type"),f=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:z,magicLinkEmail:c,verifyDeviceFetchState:C,resendVerifyDeviceOTPFetchState:D}=l(e=>e.tenantState),S=l(e=>e.tenantState.fetchState),k=l(e=>e.tenantState.activeTenantFetchState.fetchState),I=l(e=>e.tenantState.signInState),h=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),s=l(e=>e.tenantState.loggedInUser),o=l(e=>X(e)),b=l(e=>Z(e)),E=r.getSignedInUser(),v=A().mode;g.useEffect(()=>{s?.zeniSessionId==null&&n!=null&&x(n,p)&&i!=null&&f!=null&&(r.saveMagicLinkTriggered(n),t($(n,i,f)))},[n,p,t,i,f,s?.zeniSessionId]),g.useEffect(()=>{I!=="In-Progress"||S!=="Completed"&&k!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(q(b.tenantsInOrder),s.zeniSessionId),B(s.userId,s.zeniSessionId,o.tenantId),t(G(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(J("Completed")),P.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,b.tenantsInOrder),K().then(()=>{const e=W();e!=null&&V(e)}),setTimeout(()=>{N.trackLogin(Y.Event.loginSuccess,"email",Q(o.productSettings))},2e3))},[I,S,k,s,o,b,v,a.state,t]);const M=g.useCallback(()=>{m("/signin/auth")},[m]),U=g.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),j=g.useCallback(e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))},[i,n,t,c,d]);if(h==="Completed"&&d!=null)return u.jsx(H,{phoneNumber:z,verifyOtpFetchState:C.fetchState,resendVerifyDeviceOTPFetchState:D,onResendOtp:U,onVerifyOtp:j,onCancelVerifyDevice:M});if(I==="In-Progress"&&S==="Completed"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=a.state?.origin??"/";return u.jsx(T,{to:e,state:{...a.state,origin:""}})}if(!x(n,p)||f==null||h==="Error"){const e=a.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(R,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
|
|
2
|
-
position: fixed;
|
|
3
|
-
top: 0;
|
|
4
|
-
left: 0;
|
|
5
|
-
right: 0;
|
|
6
|
-
bottom: 0;
|
|
7
|
-
display: flex;
|
|
8
|
-
align-items: center;
|
|
9
|
-
justify-content: center;
|
|
10
|
-
z-index: 9999;
|
|
11
|
-
background-color: ${t=>t.theme.colors.background};
|
|
12
|
-
`;export{xe as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r}from"./liveblocks-B2D23g1h.js";import{h as n,n as i}from"./core-FEzHdTwu.js";import{V as e}from"./index-sOa-ivVp.js";import"./mui-C754KMjM.js";import"./sentry-BQ1KU1t3.js";import"./zeni-epic-state-Bxb-N0Vf.js";import"./recharts-CIXkvtnT.js";import"./analytics-BY30ztud.js";import"./plaid--k8gbxl0.js";import"./dnd-Cb_vPZwC.js";import"./stripe-DMRn4zHo.js";import"./lottie-BKshFrBj.js";import"./lexical-fJeYHrZP.js";import"./pdf-BSvba1pn.js";import"./utils-C8oTXAPM.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new o.Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="83df1d3c-82df-44f1-96da-d439d2110caa",o._sentryDebugIdIdentifier="sentry-dbid-83df1d3c-82df-44f1-96da-d439d2110caa")}catch{}})();const d=i(null,function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}})(e);function _(){const o=n();return r.jsx(d,{navigate:o})}export{_ as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as f}from"./liveblocks-B2D23g1h.js";import{a as r}from"./sentry-BQ1KU1t3.js";import{u as T,g as A,j as o,N as j}from"./core-FEzHdTwu.js";import{Ml as C,eX as P,fN as x,Mm as z,Mn as D,Mo as L,Mp as N,o9 as R,Li as k}from"./zeni-epic-state-Bxb-N0Vf.js";import{z as h,J as I}from"./index-sOa-ivVp.js";import"./mui-C754KMjM.js";import"./recharts-CIXkvtnT.js";import"./analytics-BY30ztud.js";import"./plaid--k8gbxl0.js";import"./dnd-Cb_vPZwC.js";import"./stripe-DMRn4zHo.js";import"./lottie-BKshFrBj.js";import"./lexical-fJeYHrZP.js";import"./pdf-BSvba1pn.js";import"./utils-C8oTXAPM.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new n.Error().stack;a&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[a]="a15da9d2-9365-47e6-9bc9-5a91e1673b7a",n._sentryDebugIdIdentifier="sentry-dbid-a15da9d2-9365-47e6-9bc9-5a91e1673b7a")}catch{}})();function ee(){const n=T(),a=A(),{params:t,error:i}=r.useMemo(()=>C(a.search),[a.search]),w=r.useMemo(()=>new URLSearchParams(a.search).get("client_name")??t?.clientId??"Unknown Application",[a.search,t]),p=h.isSignedIn(),s=h.getSignedInUser(),m=o(e=>P(e)),l=o(e=>x(e)),d=o(e=>e.tenantState.fetchState),y=o(z),b=o(D),u=o(L),[v,S]=r.useState(null),[E,_]=r.useState(null);r.useEffect(()=>{document.querySelector("#app-shell-loader")?.remove()},[]),r.useEffect(()=>()=>{n(N())},[n,a.search]),r.useEffect(()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)},[i]);const g=r.useRef(!1);r.useEffect(()=>{p&&s!=null&&!g.current&&(d!=="Not-Started"&&d!=="Error"||(g.current=!0,n(R(s.userId,s.zeniSessionId??void 0))))},[p,s,d,n]),r.useEffect(()=>{u!=null&&u!==""&&(window.location.href=u)},[u]);const M=r.useMemo(()=>{if(m?.tenantId!=null)return m.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some(U=>U.tenantId===e)?e:l.length===1?l[0].tenantId:null},[m?.tenantId,l]),c=v??M;return i!=null?f.jsx(I,{variant:"invalid_params",paramsError:i}):p?f.jsx(I,{variant:"signed_in",clientName:w,userEmail:s?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:c,onSelectTenant:S,approveError:E??b,isApproving:y==="In-Progress",showAllowButton:c!=null,onApprove:()=>{t!=null&&s!=null&&c!=null&&n(k(s.userId,s.zeniSessionId??void 0,c,t.clientId,t.redirectUri,t.codeChallenge,t.codeChallengeMethod,t.state,t.responseType))},onDeny:()=>{if(t!=null)try{const e=new URL(t.redirectUri);e.searchParams.set("error","access_denied"),e.searchParams.set("error_description","The user denied the request"),e.searchParams.set("state",t.state),window.location.href=e.toString()}catch{_("Unable to deny: redirect_uri is not a valid URL. Close this window or contact support.")}}}):f.jsx(j,{to:"/signin/auth",state:{origin:a.pathname+a.search},replace:!0})}export{ee as default};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-B2D23g1h.js";import{a as o}from"./sentry-BQ1KU1t3.js";import{j as f,h as F,u as H,g as V,n as K}from"./core-FEzHdTwu.js";import{y as N,K as W,z as P,bg as _,E as M,Z as U,a0 as $,x as q,d as l,f as z,a9 as X,bh as Z}from"./index-sOa-ivVp.js";import{fI as G,eX as J,Pp as R,Pq as Q,vK as Y,vA as g,fK as ee,bS as ae,vF as re,Pr as ne}from"./zeni-epic-state-Bxb-N0Vf.js";import{D as te,e as se,n as oe,S as ie}from"./mui-C754KMjM.js";import{u as le}from"./useAskAiCfoHostNavButtonProps-ByAiXj6b.js";import{M as de}from"./MobileAppDrawer-lEpfHv06.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]="205daaab-ce25-42d6-a6f7-d2236750b8fc",e._sentryDebugIdIdentifier="sentry-dbid-205daaab-ce25-42d6-a6f7-d2236750b8fc")}catch{}})();const ce={overlayWidth:new M(100,100,30)},fe=({isReferralDrawerOpen:e,closeDrawerHandler:a})=>{const r=N(),n=W();if(P.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{a(!0)},u=f(d=>G(d));return s.jsx(te,{anchor:"right",open:e,PaperProps:{style:{width:ce.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(se,{in:e,direction:"left",children:s.jsx(ue,{onClick:d=>d.stopPropagation(),children:s.jsx(_,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ue=oe(ie)`
|
|
2
|
-
display: flex;
|
|
3
|
-
min-height: 100%;
|
|
4
|
-
flex-direction: column;
|
|
5
|
-
`,I="refer-and-earn-status-update",pe=K(function(e){const a=R(e),r=e.referralViewState.rewardsPlanFetchState,n=ae([a,r]);return{inviteList:a.invitations,uiState:a.uiState,pendingBonus:a.pendingBonus,earnedBonus:a.earnedBonus,pendingReferrals:a.pendingReferrals,fetchState:n.fetchState,rewardsPlan:a.rewardsPlan}},function(e,a){const{navigate:r}=a;return{onColumnSortConfigChanged:(n,i)=>{e(ne({sortOrder:i,sortkey:n}))},onInviteClick:()=>{l.trackRewardsPageClicked("invite via email"),r("../refer")},onHowItWorksClick:()=>{l.trackRewardsPageClicked("know more"),r("../how-it-works")},onResendInviteClick:n=>{l.trackRewardsPageClicked("resend invite"),e(re(n))},onBackClick:()=>{r("../",{relative:"path"})},onReloadInvitees:()=>{e(g(!0))},onCopyReferralLink:()=>{l.trackRewardsPageClicked("copy referral link")},onClickRefer:()=>{l.trackRewardsPageClicked("refer")},onEventReceived:n=>{n===I&&e(g(!0,!0))}}})(X(Z));function ye({isReferralDrawerOpen:e}){const a=F(),r=H(),n=V(),[i,u]=o.useState(!1),[d,x]=o.useState(!1),[D,E]=o.useState(!1),[k,h]=o.useState(!1),p=P.getSignedInUser(),C=f(t=>J(t)),v=f(t=>R(t)),b=v.fetchState,w=f(t=>t.referralViewState.rewardsPlanFetchState),m=Q([v,w]),{areTenantIdsInSync:c}=U();o.useEffect(()=>{C?.rewardsLastViewedTime==null&&D===!1&&(r(Y()),E(!0))},[]),o.useEffect(()=>{!i&&b==="Not-Started"&&c&&(u(!0),r(g(!0)))},[b,r,c]),o.useEffect(()=>{!d&&w.fetchState==="Not-Started"&&c&&(x(!0),r(ee(!0)))},[w,r,c]),o.useEffect(()=>{h(e!=null&&e===!0)},[e]);const[j,A]=o.useState(!1),y=t=>{A(t)},{isAiCfoAccessEnabled:T,onAskAiCfoClick:B}=le({mobileExploreReferrer:"Rewards"});$({isDataReady:m===!0});const O={events:p?.userId!=null?[`private-encrypted-${p.userId}.${I}`]:[],eventCallback:(t,S,L)=>{L.onEventReceived(t)}};return s.jsxs(s.Fragment,{children:[m===!0?s.jsx(q,{analytics:l,onLoad:t=>(S=>{p!=null&&S.trackPageLoaded(z.Event.rewardsPageViewed)})(t)}):null,s.jsx(de,{isAppContentDrawerOpen:j,handleDrawerToggle:y}),k===!0?s.jsx(fe,{closeDrawerHandler:()=>{h(!1),a("..")},isReferralDrawerOpen:k}):null,s.jsx(pe,{location:n,navigate:a,currentTenant:C,onClickMenuIcon:()=>{y(!0)},isAiCfoAccessEnabled:T,onAskAiCfoClick:B,...O})]})}export{ye as R};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./liveblocks-B2D23g1h.js";import{C as j,z as w,aS as b,x as E,d as p,f as F,d9 as P,U as T}from"./index-sOa-ivVp.js";import"./mui-C754KMjM.js";import m from"./NotFoundScreen-DKRpU5d2.js";import{a as d}from"./sentry-BQ1KU1t3.js";import{u as L,j as y,h as U,g as V,n as A,o as R,p as u}from"./core-FEzHdTwu.js";import{eX as z,TF as C,P_ as G,TG as _,vK as K,fK as Y,TH as H,vI as O}from"./zeni-epic-state-Bxb-N0Vf.js";import{R as x}from"./ReferralListScreen-CR-hF3FX.js";import"./recharts-CIXkvtnT.js";import"./analytics-BY30ztud.js";import"./plaid--k8gbxl0.js";import"./dnd-Cb_vPZwC.js";import"./stripe-DMRn4zHo.js";import"./lottie-BKshFrBj.js";import"./lexical-fJeYHrZP.js";import"./pdf-BSvba1pn.js";import"./utils-C8oTXAPM.js";import"./useAskAiCfoHostNavButtonProps-ByAiXj6b.js";import"./MobileAppDrawer-lEpfHv06.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]="dd29282c-244d-4993-9601-7ad4b6c6bb6c",a._sentryDebugIdIdentifier="sentry-dbid-dd29282c-244d-4993-9601-7ad4b6c6bb6c")}catch{}})();const X=A(function(a,t){const n=C(a);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}},function(a,t){const{navigate:n}=t,i=w.getSignedInUser();return{onDismissClick:()=>{a(_()),n("..")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach(c=>{s.push(c.companyName),r.push(c.emailIds[0])}),p.trackInviteEmailClicked("send",s,r,s.length)}a(O())},onUpdateInviteFormLocalData:s=>{a(H({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}})(P),q=()=>{const a=L(),[t,n]=d.useState(!1),[i,s]=d.useState(!1),r=y(o=>z(o)),c=U(),v=V(),{useDynamicConfig:g}=j(),f=w.getSignedInUser();if(f==null)throw Error("Can't access invite referral screen without signing in...");const l=y(o=>C(o)),D=f?.firstName!=null?f.firstName:"User",{configValue:h}=g(b.zeniCardsConfig),{configValue:S}=g(b.zeniAccountsConfig),k=G(S);d.useEffect(()=>{a(_()),r?.rewardsLastViewedTime==null&&i===!1&&(a(K()),s(!0))},[]),d.useEffect(()=>{t||l.fetchState!=="Not-Started"||(n(!0),a(Y(!0)))},[l.fetchState,a]);const I=r.company?.companyInfo.companyLegalName??r.companyName;return e.jsxs(e.Fragment,{children:[l.fetchState==="Completed"?e.jsx(E,{analytics:p,onLoad:o=>(N=>N.trackPageLoaded(F.Event.inviteEmailViewed))(o)}):null,e.jsx(X,{navigate:c,location:v,currentTenant:r,companyName:I,userName:D,inviteFormCompayData:l.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:k.maxAnnualPercentageYield})]})};function ua(){const{useFeatureGate:a}=j(),{isFeatureEnabled:t}=a(T.isReferralFeatureEnabled);return e.jsxs(R,{children:[e.jsx(u,{path:"/",element:t?e.jsx(x,{}):e.jsx(m,{})}),e.jsx(u,{path:"how-it-works",element:t?e.jsx(x,{isReferralDrawerOpen:!0}):e.jsx(m,{})}),e.jsx(u,{path:"refer/*",element:t?e.jsx(q,{}):e.jsx(m,{})}),e.jsx(u,{path:"*",element:e.jsx(m,{})})]})}export{ua as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as f}from"./liveblocks-B2D23g1h.js";import{a as u,b as A,q as M}from"./sentry-BQ1KU1t3.js";import{u as T,h as z,j as l,g as D,N as O,n as j}from"./core-FEzHdTwu.js";import{u as P,z as s,y as F,d as E,a as N,e as _,f as B,N as Y,g as V,A as $,h as v}from"./index-sOa-ivVp.js";import{eX as q,LY as J,LZ as W,fA as X,g0 as Z,M2 as H,go as G,cY as K,M3 as b,M4 as Q,M5 as R,bY as y}from"./zeni-epic-state-Bxb-N0Vf.js";import"./mui-C754KMjM.js";import{u as ee}from"./useDeviceId-C0O1xmgi.js";import{f as te}from"./analyticsHelper-BHJAp8-8.js";import{t as ne}from"./getLocaleForTenant-B8PdHxEZ.js";import"./recharts-CIXkvtnT.js";import"./analytics-BY30ztud.js";import"./plaid--k8gbxl0.js";import"./dnd-Cb_vPZwC.js";import"./stripe-DMRn4zHo.js";import"./lottie-BKshFrBj.js";import"./lexical-fJeYHrZP.js";import"./pdf-BSvba1pn.js";import"./utils-C8oTXAPM.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]="677f9787-2917-4aca-8441-27aaf25bb94b",t._sentryDebugIdIdentifier="sentry-dbid-677f9787-2917-4aca-8441-27aaf25bb94b")}catch{}})();const ie=j(function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}},function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{M({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 c=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(R({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(c),sourceUri:y(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(Q(n,a)))},clearSignInError:()=>{t(b())}}})($),ae=A.memo(ie);function ve({setTenantEmailDomain:t}){const i=T(),d=z(),{clearAllLoading:g}=P(),n=s.getSignedInUser();u.useLayoutEffect(()=>{g()},[g]);const a=ee(),c=l(e=>e.tenantState.magicLinkCodeVerifier),{sendEmailMagicLinkFetchState:L,accountLocked:C,accountUnlockTime:h}=l(e=>e.tenantState),p=l(e=>e.tenantState.fetchState),k=l(e=>e.tenantState.activeTenantFetchState.fetchState),S=l(e=>e.tenantState.signInState),o=l(e=>e.tenantState.loggedInUser),r=l(e=>q(e)),I=l(e=>J(e)),m=D(),w=F().mode,U=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(u.useEffect(()=>{L.fetchState==="Completed"&&c!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))},[L.fetchState,c]),u.useEffect(()=>{t(void 0)},[]),u.useEffect(()=>{S!=="In-Progress"||p!=="Completed"&&k!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(W(I.tenantsInOrder),o.zeniSessionId),X(o.userId,o.zeniSessionId,r.tenantId),i(Z(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(H("Completed")),N.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),G().then(()=>{const e=V();e!=null&&_(e)}),setTimeout(()=>{E.trackLogin(B.Event.loginSuccess,o.authProvider??"google",K(r.productSettings))},2e3))},[S,p,k,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:!!U,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),C===!0&&h!=null?f.jsx(Y,{onClose:()=>i(b()),unlockDate:h}):null]})}export{ve as default};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-B2D23g1h.js";import{a as i}from"./sentry-BQ1KU1t3.js";import{u as c,g as d,N as u}from"./core-FEzHdTwu.js";import{z as n,d as a,f as m,B as p}from"./index-sOa-ivVp.js";import{gt as g,Mk as y}from"./zeni-epic-state-Bxb-N0Vf.js";import{n as b}from"./mui-C754KMjM.js";import"./recharts-CIXkvtnT.js";import"./analytics-BY30ztud.js";import"./plaid--k8gbxl0.js";import"./dnd-Cb_vPZwC.js";import"./stripe-DMRn4zHo.js";import"./lottie-BKshFrBj.js";import"./lexical-fJeYHrZP.js";import"./pdf-BSvba1pn.js";import"./utils-C8oTXAPM.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]="732543fc-31a4-46b6-9465-e79f363e8662",e._sentryDebugIdIdentifier="sentry-dbid-732543fc-31a4-46b6-9465-e79f363e8662")}catch{}})();function M(){const e=c(),t=d(),r=i.useRef(!1),f=n.isSignedIn(),o=t.state?.message==="logout"||f;return i.useEffect(()=>{if(o&&!r.current){r.current=!0;try{e(g()),y(),a.trackLogout(m.Event.logoutSuccess),a.resetUserIdentity(),n.clearAll()}catch(l){console.error("Error during sign out:",l)}finally{window.location.replace("/signin/auth")}}},[o,e]),o?s.jsx(h,{children:s.jsx(p,{fetchState:"In-Progress"})}):s.jsx(u,{to:"../",replace:!0})}const h=b.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{M as default};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./liveblocks-B2D23g1h.js";import{a as f}from"./sentry-BQ1KU1t3.js";import{t as u,u as h,j as y,N as I}from"./core-FEzHdTwu.js";import{Mh as b,fA as w,Bk as j}from"./zeni-epic-state-Bxb-N0Vf.js";import{z as l,B as x,G as S,I as D}from"./index-sOa-ivVp.js";import{n as p}from"./mui-C754KMjM.js";import"./recharts-CIXkvtnT.js";import"./analytics-BY30ztud.js";import"./plaid--k8gbxl0.js";import"./dnd-Cb_vPZwC.js";import"./stripe-DMRn4zHo.js";import"./lottie-BKshFrBj.js";import"./lexical-fJeYHrZP.js";import"./pdf-BSvba1pn.js";import"./utils-C8oTXAPM.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]="a3f7290e-5216-4dc3-9ba6-4d65a4d78bff",e._sentryDebugIdIdentifier="sentry-dbid-a3f7290e-5216-4dc3-9ba6-4d65a4d78bff")}catch{}})();const W=()=>{const[e]=u(),t=e.get("code")??"",s=e.get("state")??"",c=e.get("profileId")??"",[n,g]=f.useState(!1),a=h(),i=y(m=>b(m)),r=l.getSignedInUser(),d=l.getSignedInUserTenantWithId(s);if(r==null||d==null)return o.jsx(I,{to:"/signin/auth",replace:!0});if(r==null)throw Error("Can't access this page without signing in...");return w(r.userId,r.zeniSessionId,d?.tenantId),f.useEffect(()=>{n||(g(!0),a(j(t,c,s)))},[n,a]),i.fetchState==="Error"?o.jsx(E,{children:o.jsx(_,{children:i.error?.message??""})}):(i.fetchState==="Completed"&&window.close(),o.jsx(x,{fetchState:"In-Progress"}))},E=p.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
width: 100%;
|
|
4
|
-
height: 100vh;
|
|
5
|
-
flex-direction: row;
|
|
6
|
-
justify-content: center;
|
|
7
|
-
align-items: center;
|
|
8
|
-
background-color: ${e=>e.theme.colors.grey5};
|
|
9
|
-
`,_=p(D.LargeRegular)`
|
|
10
|
-
display: flex;
|
|
11
|
-
color: ${S.important};
|
|
12
|
-
`;export{W as default};
|