@zeniai/web-app-ui 5.1.46-dev → 5.1.47-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-CZCF3Ed7.js +1 -0
- package/dist/assets/AddressScreen-DVPbua-7.js +9 -0
- package/dist/assets/AiCfoScreen-CquZXfRI.js +22 -0
- package/dist/assets/BillPayApprovalRoutes-Bsqa7UIt.js +1 -0
- package/dist/assets/{BillPayRoutes-UlCXMjZ_.js → BillPayRoutes-DrhDRZTP.js} +33 -33
- package/dist/assets/BusinessVerificationPageScreen-BVkfBtGX.js +9 -0
- package/dist/assets/ChargeCardRoutes-DJ3TgdzU.js +71 -0
- package/dist/assets/{CompanyPassportScreen-Jd7RmMxP.js → CompanyPassportScreen-Bd9dcAEb.js} +1 -1
- package/dist/assets/ConnectionAuthScreen-DtUVl4gJ.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-y2T_jVxs.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-BeYw23eY.js → CustomerOnboardingRoutes-D0TFB5es.js} +5 -5
- package/dist/assets/{DashboardRoutes-BKrnUTFX.js → DashboardRoutes-AglkqdZb.js} +4 -4
- package/dist/assets/DefaultTenantHome-D0gpxBnQ.js +1 -0
- package/dist/assets/DomesticWireDetailScreen-hVPTa7zl.js +18 -0
- package/dist/assets/DrawerScreen-Dcd16rrd.js +1 -0
- package/dist/assets/EntityDetailRoutes-Be1JmzWy.js +1 -0
- package/dist/assets/ExpenseAutomationRoutes-DQU2nPFS.js +25 -0
- package/dist/assets/FeaturePreviewScreen-nQP4PBuN.js +1 -0
- package/dist/assets/HubSpotOAuthCallbackScreen-CJZCnYYo.js +1 -0
- package/dist/assets/MagicLinkRoutes-C-x0DqRV.js +72 -0
- package/dist/assets/MagicLinkSignInScreen-BJYa-6dE.js +12 -0
- package/dist/assets/MobileAppDrawer-MkL6Ri_E.js +1 -0
- package/dist/assets/NotFoundScreen-B1j26TaW.js +1 -0
- package/dist/assets/{NotificationRoutes-DkowgBJj.js → NotificationRoutes-CTsePQJL.js} +1 -1
- package/dist/assets/OAuthConsentScreen-Bf7Rz5GL.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-BYdB78V0.js +1 -0
- package/dist/assets/PeopleRoutes-D04-zoLL.js +22 -0
- package/dist/assets/PerformanceRoutes-qo5w7ss8.js +1 -0
- package/dist/assets/{Preview-DkidNz3z.js → Preview-evpWpYgT.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-DwoHkIu2.js → QBOConnectionScreen-DjJePSxH.js} +1 -1
- package/dist/assets/ReferralListScreen-BVRl8Eqw.js +5 -0
- package/dist/assets/ReimbursementApprovalRoutes-C0W7Zcf-.js +1 -0
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BtppAsqY.js → ReimbursementApprovalRuleDetailScreen-D_U8RiI7.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-eiz8xheE.js → ReimbursementRoutes-DkEf0a2t.js} +9 -9
- package/dist/assets/ReportsRoutes-DVYYxF0q.js +1 -0
- package/dist/assets/RewardsRoutes-D1Dw_YCi.js +1 -0
- package/dist/assets/ScreenRoutes-DL6N-VWP.js +2 -0
- package/dist/assets/{SettingsRoutes-BI4dN7RS.js → SettingsRoutes-BTd0zpvV.js} +8 -8
- package/dist/assets/{SetupPagesScreen-D-neLjJM.js → SetupPagesScreen-Bsr5a1pQ.js} +5 -5
- package/dist/assets/SignInScreen-D29YArRQ.js +1 -0
- package/dist/assets/SignOutScreen-CkM8N7kI.js +9 -0
- package/dist/assets/TaskListScreen-QBxj3x6l.js +9 -0
- package/dist/assets/TaskRoutes-CbCeuDZl.js +9 -0
- package/dist/assets/TransactionDetailRoutes-B8Gwc4cc.js +1 -0
- package/dist/assets/{TransactionDetailScreen-Bshs2g2Z.js → TransactionDetailScreen-BZ1U45_F.js} +2 -2
- package/dist/assets/TransactionListRoutes-mnxKDjQ_.js +1 -0
- package/dist/assets/{TreasuryRoutes-CNbtiHFp.js → TreasuryRoutes-Dk7L5dYO.js} +6 -6
- package/dist/assets/{VendorsRoutes-C5KKIVE-.js → VendorsRoutes-Brv3hCD7.js} +27 -27
- package/dist/assets/WiseConfirmationScreen-1oJ6ZH1s.js +12 -0
- package/dist/assets/ZeniAccountRoutes-CaJgy_QF.js +57 -0
- package/dist/assets/ZeniAccountStatementScreen-Coj3gUoh.js +9 -0
- package/dist/assets/{accountMappingHelper-cmIw559z.js → accountMappingHelper-BrnyZK4h.js} +1 -1
- package/dist/assets/{analytics-DORMe8dT.js → analytics-BoOSk_FS.js} +1 -1
- package/dist/assets/{analyticsHelper-aSqJwcvL.js → analyticsHelper-BEsUC0Tf.js} +1 -1
- package/dist/assets/{core-D95G1COY.js → core-4srnP2ry.js} +2 -2
- package/dist/assets/{decodeURIComponentSafe-BLmfpdcW.js → decodeURIComponentSafe-CVdrGRir.js} +1 -1
- package/dist/assets/{dnd-BXlaBlTc.js → dnd-CUjyBBrM.js} +1 -1
- package/dist/assets/{empty-BE68b5E4.js → empty-BLi0L7W4.js} +1 -1
- package/dist/assets/empty-Djhp5I5N.js +1 -0
- package/dist/assets/{emptyVideoElement-NX2rx7EQ.js → emptyVideoElement-CHvCCbcl.js} +1 -1
- package/dist/assets/epic-CAI4UhoR.js +2 -0
- package/dist/assets/getLocaleForTenant-BNybPRoM.js +1 -0
- package/dist/assets/index-65j4ugfY.js +1 -0
- package/dist/assets/{index-CnP5hpUl.js → index-B6rVBPLj.js} +1 -1
- package/dist/assets/{empty-BTAxEJiS.js → index-BJV7t3Ln.js} +1 -1
- package/dist/assets/{index-C8tyyalR.js → index-C7Pw0HtV.js} +15593 -17927
- package/dist/assets/{index-CruHx9g6.js → index-CSlCNnzL.js} +1 -1
- package/dist/assets/{index-BjNhU8qP.js → index-Cd6KSZfb.js} +1 -1
- package/dist/assets/{index-B_Cirr74.js → index-D2Vz8Hnp.js} +2 -2
- package/dist/assets/{index-cIfsvMlJ.js → index-DF8zTrCI.js} +1 -1
- package/dist/assets/{index-BUmr5maU.css → index-R6GjjTB3.css} +1 -1
- package/dist/assets/{lexical-D90cNSQE.js → lexical-B1-kkGoh.js} +1 -1
- package/dist/assets/{liveblocks-8SEYIom7.js → liveblocks-FvHIfhey.js} +1 -1
- package/dist/assets/{lottie-DGqwGfHh.js → lottie-jiJBGHVV.js} +1 -1
- package/dist/assets/{mui-jqvOLufq.js → mui-BM0jIy5o.js} +1 -1
- package/dist/assets/{pathToGoBack-Csr3Iao-.js → pathToGoBack-De4TIG3J.js} +1 -1
- package/dist/assets/{pdf-lib-C0lYQdSO.js → pdf-lib-D9nBH3t7.js} +1 -1
- package/dist/assets/{pdf-CMafEn8a.js → pdf-whYpMQAC.js} +4 -4
- package/dist/assets/{plaid-BvitY7vM.js → plaid-mry1J-xa.js} +1 -1
- package/dist/assets/{pusher-DVRirJfe.js → pusher-DhA-kRSw.js} +1 -1
- package/dist/assets/{react-DADgee2G.js → react-6uxZfi85.js} +1 -1
- package/dist/assets/{react-DJ_69eFR.js → react-BSvTOr35.js} +1 -1
- package/dist/assets/{react-C-4UGOsg.js → react-BmGLt_sB.js} +1 -1
- package/dist/assets/{react-DOyz-DAB.js → react-CGiQlkN0.js} +1 -1
- package/dist/assets/{react-CAXdypQs.js → react-Dx6ccGzO.js} +1 -1
- package/dist/assets/{react-CVOHOwD-.js → react-ego9yzv1.js} +1 -1
- package/dist/assets/{recharts-B5BD4Kau.js → recharts-DVgLcWbN.js} +1 -1
- package/dist/assets/{routePaths-STLgTv0l.js → routePaths-DTTWQHJ_.js} +1 -1
- package/dist/assets/{sentry-Bpr6hwv_.js → sentry-BGmWGtx4.js} +1 -1
- package/dist/assets/{url-83NdFFZ3.js → url-BrqJU0tJ.js} +1 -1
- package/dist/assets/{url-tRs_qG1D.js → url-BrtamPmb.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-BfufDhKS.js → useAiCfoDashboardSuggestedQuestionsChips-DQgVgxsR.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-CHKiu4ka.js +1 -0
- package/dist/assets/{useDeviceId-DNdkDSci.js → useDeviceId-BCg9_rD9.js} +1 -1
- package/dist/assets/useInitialThreadRequest-H-0PGnfZ.js +1 -0
- package/dist/assets/{utils-kj_q6fLI.js → utils-BQpFY40P.js} +2 -2
- package/dist/assets/{withTransactionSidePanel-CyTjTf4e.js → withTransactionSidePanel-Cg2hWd8r.js} +4 -4
- package/dist/assets/{zeni-epic-state-BnmnEdbj.js → zeni-epic-state-Cicf7kze.js} +6 -6
- package/dist/index.html +1 -1
- package/package.json +4 -4
- package/dist/assets/AddressRoutes-Bu1wLdr9.js +0 -1
- package/dist/assets/AddressScreen-DyCQJjNT.js +0 -9
- package/dist/assets/AiCfoScreen-DpYulm6L.js +0 -22
- package/dist/assets/BillPayApprovalRoutes-BiuKI-Rl.js +0 -1
- package/dist/assets/BusinessVerificationPageScreen-fLqoQmHN.js +0 -9
- package/dist/assets/CardsAiCfoScreen-D49SttU_.js +0 -14
- package/dist/assets/ChargeCardRoutes-lr8bIl57.js +0 -71
- package/dist/assets/ConnectionAuthScreen-JILvaDGY.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-BM-quSNh.js +0 -1
- package/dist/assets/DefaultTenantHome-C4xFfbR_.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-DN6hsoHQ.js +0 -18
- package/dist/assets/DrawerScreen-C3rL34Nr.js +0 -1
- package/dist/assets/EntityDetailRoutes-B6x-jsr1.js +0 -1
- package/dist/assets/ExpenseAutomationRoutes-Cs8BXmkZ.js +0 -25
- package/dist/assets/FeaturePreviewScreen-Bq9eSSz9.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-B3oZEnMP.js +0 -1
- package/dist/assets/MagicLinkRoutes-Bvtkhcw0.js +0 -72
- package/dist/assets/MagicLinkSignInScreen-RvwdSqqO.js +0 -12
- package/dist/assets/MobileAppDrawer-D8HOXn7v.js +0 -1
- package/dist/assets/NotFoundScreen-0h0DiOvj.js +0 -1
- package/dist/assets/OAuthConsentScreen-MNbkNl_v.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-DXEDmlZd.js +0 -1
- package/dist/assets/PeopleRoutes-CsAbJBHX.js +0 -22
- package/dist/assets/PerformanceRoutes-8SJwQoaV.js +0 -1
- package/dist/assets/ReferralListScreen-DAUAqg4I.js +0 -5
- package/dist/assets/ReimbursementApprovalRoutes-DxtKouwg.js +0 -1
- package/dist/assets/ReportsRoutes-_Zdg3F2x.js +0 -1
- package/dist/assets/RewardsRoutes-UFPd_8TA.js +0 -1
- package/dist/assets/ScreenRoutes-BoQ6iXAM.js +0 -2
- package/dist/assets/SignInScreen-qgS7vG1A.js +0 -1
- package/dist/assets/SignOutScreen-BbyO1zZV.js +0 -9
- package/dist/assets/TaskListScreen-CVeALlL0.js +0 -9
- package/dist/assets/TaskRoutes-Gx5x8B3t.js +0 -9
- package/dist/assets/TransactionDetailRoutes-Dngsr6y1.js +0 -1
- package/dist/assets/TransactionListRoutes-Bg_zUk5Q.js +0 -1
- package/dist/assets/WiseConfirmationScreen-Bqy3cyw-.js +0 -12
- package/dist/assets/ZeniAccountRoutes-CDeXOkOl.js +0 -57
- package/dist/assets/ZeniAccountStatementScreen-DE1cm9kp.js +0 -9
- package/dist/assets/epic-K6OBBbJr.js +0 -2
- package/dist/assets/getLocaleForTenant-HT8Btw6T.js +0 -1
- package/dist/assets/index-DLVDaPoM.js +0 -1
- package/dist/assets/index-DMreRMIr.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-CE4sjmcs.js +0 -1
- package/dist/assets/useInitialThreadRequest-DzF6un_U.js +0 -1
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-C7Pw0HtV.js"></script><link rel="modulepreload" crossorigin href="/assets/sentry-BGmWGtx4.js"><link rel="modulepreload" crossorigin href="/assets/core-4srnP2ry.js"><link rel="modulepreload" crossorigin href="/assets/zeni-epic-state-Cicf7kze.js"><link rel="modulepreload" crossorigin href="/assets/mui-BM0jIy5o.js"><link rel="modulepreload" crossorigin href="/assets/analytics-BoOSk_FS.js"><link rel="modulepreload" crossorigin href="/assets/utils-BQpFY40P.js"><link rel="stylesheet" crossorigin href="/assets/index-R6GjjTB3.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.47-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.0.
|
|
32
|
-
"@zeniai/web-components": "4.1.
|
|
30
|
+
"@zeniai/client-analytics": "2.0.22",
|
|
31
|
+
"@zeniai/client-epic-state": "5.0.96",
|
|
32
|
+
"@zeniai/web-components": "4.1.65",
|
|
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-8SEYIom7.js";import{A as d}from"./AddressScreen-DyCQJjNT.js";import i from"./NotFoundScreen-0h0DiOvj.js";import"./sentry-Bpr6hwv_.js";import{o as s,p as r}from"./core-D95G1COY.js";import"./zeni-epic-state-BnmnEdbj.js";import"./recharts-B5BD4Kau.js";import"./index-C8tyyalR.js";import"./mui-jqvOLufq.js";import"./analytics-DORMe8dT.js";import"./plaid-BvitY7vM.js";import"./dnd-BXlaBlTc.js";import"./stripe-DMRn4zHo.js";import"./lottie-DGqwGfHh.js";import"./lexical-D90cNSQE.js";import"./pdf-CMafEn8a.js";import"./utils-kj_q6fLI.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,9 +0,0 @@
|
|
|
1
|
-
import{j as r}from"./liveblocks-8SEYIom7.js";import{a as h}from"./sentry-Bpr6hwv_.js";import{h as P,u as _,g as j,i as E,j as L,n as B}from"./core-D95G1COY.js";import{J as M,m as $,z as D,A as K,B as N,N as R,d as C,g as m,S as z,j as b,p as F}from"./index-C8tyyalR.js";import{LX as w,hM as U,eT as G,LY as O,c3 as V,LZ as q,l5 as H}from"./zeni-epic-state-BnmnEdbj.js";import{n as J}from"./mui-jqvOLufq.js";import X from"./NotFoundScreen-0h0DiOvj.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]="7fd54fc1-493a-4d35-9215-0773e1bb386d",e._sentryDebugIdIdentifier="sentry-dbid-7fd54fc1-493a-4d35-9215-0773e1bb386d")}catch{}})();const Y=J.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
|
-
`,Z=B(function(e,t){const{addressId:o,isSubPage:i,addressType:c}=t,l=G(e),a=t.roleMap!=null&&O(t.roleMap),d=i||c==="user_address"||V(l?.userRole??[])||a?void 0:"readonly";if(o==null){const s=q(c,e);return{addressToEdit:s?.addressToCreate,loadingState:s?.status?.fetchState,googleAPIKey:b.googleMapsAPIKey,isDisabled:d,isSubPage:i,dontShowSaveConfirmationPopup:t.dontShowSaveConfirmation}}const n=w(e,o);return{addressToEdit:n.address,loadingState:n.fetchState,googleAPIKey:b.googleMapsAPIKey,isDisabled:d}},function(e,t){const{navigate:o,location:i,addressType:c}=t,l=a=>{if(a==="express-pay")o("../express-pay/add-wire");else{const d=i.state,n=F(d?.pathnameStackToGoBack);let s=n.poppedPathname??A();const u=d?.queryParams;if(u){const g=new URLSearchParams(u).toString();g&&(s=`${s}?${g}`)}o(s,{state:{pathnameStackToGoBack:n.newStack}})}};return{onSubmitHandler:a=>{const d=Q(a);e(H({addressType:c,addressToCreate:d})),C?.trackSaveAddressClicked(m.Event.saveAddressClicked,{street:a.street.addressString,city:a.city,state:a.state,country:a.country.selectedOption??"",postalCode:a.postalCode,suite:a.suite,secondaryInfo:a.secondaryInfo}),l(t.bankAccountContext)},onCancel:()=>{l(t.bankAccountContext)}}})(z);function re({isSubPage:e,hideAddressSubTitle:t=!1,hideAddressBackButton:o=!1,dontShowSaveConfirmation:i,accountContext:c,addressTypeParam:l}){const a=P(),d=_(),n=j(),{addressId:s,addressType:u}=E(),g=M(),I=$(),k=D.getSignedInUser(),[f,v]=h.useState(s==null),p=L(S=>s!=null?w(S,s).fetchState:"Not-Started"),x=K();if(k==null)throw Error("Can't access address page without signing in...");const T=S=>S.trackPageLoaded(s!=null?m.Event.editAddress:m.Event.addAddress),y=l??u;return h.useEffect(()=>{f||s==null||(v(!0),d(U(s,!1)))},[f,s,d]),y==null||y.match(/(user_address|company_address|company_registered_address|vendor_address|officer_([1-9]|10)_address)$/g)?!f&&p==="Not-Started"||f&&p==="In-Progress"?r.jsx(N,{fetchState:p,style:{backgroundColor:I.colors.grey5}}):s!=null&&p==="Error"?(a(`${A(1)}/new`,{replace:!0}),r.jsx(r.Fragment,{})):r.jsxs(r.Fragment,{children:[r.jsx(R,{analytics:C,onLoad:T}),r.jsx(Y,{windowSize:g,children:r.jsx(Z,{location:n,navigate:a,isSubPage:e===!0,hideAddressBackButton:o,hideAddressSubTitle:t,addressId:s,addressType:y,dontShowSaveConfirmation:i,bankAccountContext:c,roleMap:x?.loggedInUserRoleMap})})]}):r.jsx(X,{})}const A=(e=2)=>{let t="../";for(let o=0;o<e;o++)t=`${t}../`;return t},Q=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});export{re as A,Q as t};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import{j as d}from"./liveblocks-8SEYIom7.js";import{a as l}from"./sentry-Bpr6hwv_.js";import{u as ge,h as Ce,g as be,j as Y,i as Ie,n as ke}from"./core-D95G1COY.js";import{V as we,z as xe,J as Pe,d2 as ye,d3 as Ee,b6 as J,d4 as Te,b5 as K,p as D,N as L,d as b,d5 as F,d6 as ve,d7 as Qe,a1 as _e,g as Ae,a7 as Oe,d8 as Ue,a2 as je,d9 as Le,da as Fe,q as Be,b1 as De,db as Re}from"./index-C8tyyalR.js";import{gg as Me,eS as ee,eT as Ve,is as Ge,S_ as Ne,eZ as $e,iC as qe,iy as We,eU as B,f4 as ze,fV as He,fy as Ye,fC as X,fW as Je,fX as Xe,fY as Ze,fZ as Ke,f_ as et}from"./zeni-epic-state-BnmnEdbj.js";import{D as tt,n as I,S as st,P as ot}from"./mui-jqvOLufq.js";import{u as at}from"./useAiCfoDashboardSuggestedQuestionsChips-BfufDhKS.js";import{p as nt}from"./pathToGoBack-Csr3Iao-.js";import"./recharts-B5BD4Kau.js";import"./analytics-DORMe8dT.js";import"./plaid-BvitY7vM.js";import"./dnd-BXlaBlTc.js";import"./stripe-DMRn4zHo.js";import"./lottie-DGqwGfHh.js";import"./lexical-D90cNSQE.js";import"./pdf-CMafEn8a.js";import"./utils-kj_q6fLI.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new t.Error().stack;r&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[r]="4f245dbb-3c6c-4190-adc1-b3f23cb2f359",t._sentryDebugIdIdentifier="sentry-dbid-4f245dbb-3c6c-4190-adc1-b3f23cb2f359")}catch{}})();const te="chat-response-generated",it=ke(function(t,r){const s=ee(t),m=r.isSubmitting,n=s.uiState?.currentChatSessionId,p=n!=null?ze(t.aiCfoState,n):[];return{showSampleQuestions:r.sessionFromUrl==="explore"&&s.uiState.currentChatSessionId==null,aiCfoView:s,isSubmitting:m,isNewChatSession:r.sessionFromUrl==="new_chat"||r.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${je}/tableDownload`,emailLinkQuestion:r.emailLinkQuestion,autoSubmitEmailLinkQuestion:r.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:r.onEmailLinkQuestionProcessed,routedInitialQuestionSource:r.routedInitialQuestionSource,routedInitialQuestionSuggestionIndex:r.routedInitialQuestionSuggestionIndex,exploreSuggestedPromptQuestions:r.exploreSuggestedPromptQuestions,exploreSuggestedPromptQuestionsLoading:r.exploreSuggestedPromptQuestionsLoading,isFileUploadEnabled:r.isFileUploadEnabled,isUploadPromoVisible:r.isUploadPromoVisible,onUploadPromoClose:r.onUploadPromoClose,syntheticAnswers:p,resolveSyntheticAnswerCardTile:Fe(t),resolveSyntheticAnswerPolicyTile:Le(t)}},function(t,r){const{location:s,currentTenant:m,userId:n,navigate:p,currentChatSessionId:h,allSessionsWithOrderedQuestionAnswers:u,setIsAiCfoOpen:f}=r;return{onEventReceived:(e,S)=>{if(e===te&&typeof S.text=="string"&&typeof S.metadata=="object"){const a=S,c=Xe(a.type),o=a.metadata.chat_session_id??null,{currentChatSession:y,currentQuestionAnswer:k,currentQuestionAnswerSummary:E}=K(u,o);c!=="answer"?b.trackAICFOChatResponseGenerated(c,k?.question.questionText??"",a.text,o,Re(E,y),a.metadata.message_id??null):b.trackAICFOChatAnswerGenerated(a.text,k?.question.questionText??"",(a.follow_up_questions?.length??0)>0,!!a.assumptions,!!a.insights,a.visualization!=null,Ze(a.visualization?.type??"")??null,o,a.summarized_title,a.metadata.message_id??null),t(Ke({chatSessionId:a.metadata.chat_session_id,responseType:c,fetchState:{fetchState:"Completed",error:void 0}})),t(et({chatSessionId:a.metadata.chat_session_id,answerPayload:a,userId:n}))}},onSubmit:(e,S,a,c)=>{e&&De(t,e,S,h,u,n,c,a)},updateCurrentInput:e=>{t(X(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{t(Je(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{p(-1)},onCloseClick:()=>{const e=D(s.state?.pathnameStackToGoBack),S=e.poppedPathname??nt(1);p(S,{state:{...s.state,pathnameStackToGoBack:e.newStack}}),t(X(""))},togglePageView:()=>{const e=D(s.state?.pathnameStackToGoBack),S=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;p(S,{state:{...s.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),f(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{p(-1)},onNewChatClick:()=>{h!=null&&t(Ye());const e=Be(s.state?.pathnameStackToGoBack,s.pathname);p(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,S)=>{t(He({questionAnswerId:e,isCollapsed:S}))},onMenuClick:r.onMenuClick}})(Oe(Ue)),vt=({isFileUploadEnabled:t})=>{const{setIsAiCfoOpen:r}=we(),s=ge(),m=Ce(),n=be(),[p,h]=l.useState(!1);l.useEffect(()=>{s(Me())},[s]);const u=Y(i=>ee(i)),f=xe.getSignedInUser(),{session_id:e}=Ie(),S=Pe(),a=_e(S),c=Y(i=>Ve(i)),o=u.uiState.currentChatSessionId,y=c.tenantEmailDomain,{handleUploadPromoClose:k,isUploadPromoVisible:E}=ye({isFileUploadEnabled:t,tenantEmailDomain:y}),T=Ee({currentTenant:c,currentChatSessionId:o,aiCfoView:u}),{isSuggestedQuestionsLoading:se,suggestedPromptQuestions:oe}=at(),w=n.state,x=w?.aiCfoInitialQuestion,R=!!w?.aiCfoShouldSubmit;l.useEffect(()=>{const i=n.state;if(i?.[J]!==!0)return;h(!0);const g={...i};delete g[J],m(n,{replace:!0,state:g})},[n.pathname,n.search,n.state,m]);const[ae,v]=l.useState(null),[ne,Q]=l.useState(!1),[ie,_]=l.useState(void 0),[re,A]=l.useState(void 0),M=l.useRef(!1);l.useEffect(()=>{if(!M.current&&x!=null&&x!==""){const i=n.state;v(x),Q(R),_(i?.aiCfoInitialSubmissionSource!=null?i.aiCfoInitialSubmissionSource:void 0);const g=i?.aiCfoSuggestionIndex;A(typeof g=="number"?g:void 0),M.current=!0}},[x,R,n.state]);const le=l.useCallback(()=>{v(null),Q(!1),_(void 0),A(void 0)},[]),V=l.useMemo(()=>new URLSearchParams(n.search),[n.search]),G=V.get("ref")??w?.aiCfoRef,O=V.get("emailRefId")??w?.aiCfoEmailRefId,N=l.useRef(!1);l.useEffect(()=>{N.current||G!=="month-end-email"||O==null||o!=null||f==null||(s(Ge("controller",f.userId,O,"MONTH_END_EMAIL")),N.current=!0)},[G,O,o,s,f]);const P=u.uiState.lastContextMessage;l.useEffect(()=>{P!=null&&P!==""&&o!=null&&(v(P),Q(!0),_(void 0),A(void 0),s(Ne()))},[P,o,s]);const de=c.masterTOSInfo,C=de?.isMasterTOSAccepted??!1,{visitedSessions:$}=Te(o),U=u.fetchState,j=u.uiState.chatSessionsNextPageToken.hasMore||!u.uiState.chatSessionsFirstPageFetched,q=o!=null?u.fetchChatSessionHistoryByChatSessionId?.[o]?.fetchState??"Not-Started":"Not-Started",W=o==null||(u.uiState.chatHistoryNextPageToken[o]?.hasMore??!0),z=u.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:ce}=K(z,o),ue=ce.length===0;l.useEffect(()=>{C||a||m("../dashboard",{state:{...n.state,message:"open_ai_cfo_drawer"}})},[C,a,m,n.state]);const me=l.useCallback(()=>{const i=D(n.state?.pathnameStackToGoBack),g=c.tenantEmailDomain;m(i.poppedPathname??(g!=null?`/${g}/dashboard`:".."),{state:{...n.state,pathnameStackToGoBack:i.newStack}})},[c.tenantEmailDomain,n.state,m]);l.useEffect(()=>{o!=null&&e!==o&&m(`../ai-cfo/${o}`,{state:{...n.state}})},[o,e]),l.useEffect(()=>{e!=null&&o==null&&e!=="new_chat"&&e!=="explore"&&s($e({sessionId:e,agentId:"controller"}))},[]);const pe=l.useMemo(()=>({events:$.map(i=>`private-encrypted-chat-${i}.${te}`),eventCallback:(i,g,fe)=>fe.onEventReceived(i,g)}),[$]);l.useEffect(()=>{U!=="In-Progress"&&j&&s(qe())},[U,j,s]),l.useEffect(()=>{o!=null&&q!=="In-Progress"&&W&&f!=null&&U==="Completed"&&!j&&s(We(o,f.userId))},[q,W,o,f,s]);const H=i=>i.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(f==null||e==null)throw Error("Can't access AI Controller page without signing in...");const Se=o!=null&&u.responseStateByChatSessionId?.[o]?.answer?.fetchState==="In-Progress";if(!C&&a)return d.jsxs(lt,{children:[d.jsx(L,{analytics:b,onLoad:H}),T.drawerElement,d.jsx(dt,{children:d.jsx(Z,{children:d.jsx(F,{isTOSAccepted:!1,acceptMasterTOSState:u.masterTOSAcceptanceState,onCloseClick:me,onCompleteClick:()=>{c.userRoleId!=null&&s(B(c.userRoleId))}})})})]});const he=d.jsxs(d.Fragment,{children:[p&&!C?d.jsx(L,{analytics:b,onLoad:H}):null,d.jsx(F,{isTOSAccepted:C,acceptMasterTOSState:u.masterTOSAcceptanceState,showHeader:!1,togglePageView:C?()=>h(!1):void 0,onCloseClick:()=>h(!1),onCompleteClick:()=>{C||c.userRoleId==null||s(B(c.userRoleId)),h(!1)}})]});return d.jsxs(d.Fragment,{children:[d.jsxs(rt,{children:[d.jsx(L,{analytics:b,onLoad:i=>i.trackPageLoaded(Ae.Event.aiCFOPage)}),a&&T.drawerElement,d.jsx(it,{...pe,currentChatSessionId:o,allSessionsWithOrderedQuestionAnswers:z,openOnboardingPage:()=>h(!0),userId:f.userId,setIsAiCfoOpen:r,navigate:m,sessionFromUrl:e,location:n,isSubmitting:Se,isEmptyChatWithSession:ue,currentTenant:c,emailLinkQuestion:ae??void 0,autoSubmitEmailLinkQuestion:ne,onEmailLinkQuestionProcessed:le,routedInitialQuestionSource:ie,routedInitialQuestionSuggestionIndex:re,onMenuClick:a?T.open:void 0,isFileUploadEnabled:t,isUploadPromoVisible:E,onUploadPromoClose:k,exploreSuggestedPromptQuestions:oe,exploreSuggestedPromptQuestionsLoading:se}),p&&a?d.jsx(tt,{anchor:"right",open:p,transitionDuration:250,PaperProps:{component:ct,style:{width:"100%"}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>h(!1),children:d.jsx(Z,{onClick:i=>i.stopPropagation(),children:d.jsx(F,{isTOSAccepted:C,acceptMasterTOSState:u.masterTOSAcceptanceState,onCloseClick:()=>h(!1),onCompleteClick:()=>{C||c.userRoleId==null||s(B(c.userRoleId)),h(!1)}})})}):null]}),p&&!a?d.jsx(ve,{open:p,onClose:()=>h(!1),children:d.jsx(Qe,{children:he})}):null]})},Z=I(st)`
|
|
2
|
-
display: flex;
|
|
3
|
-
min-height: 100%;
|
|
4
|
-
flex-direction: column;
|
|
5
|
-
`,rt=I.div`
|
|
6
|
-
height: 100vh;
|
|
7
|
-
width: 100%;
|
|
8
|
-
`,lt=I.div`
|
|
9
|
-
height: 100vh;
|
|
10
|
-
width: 100%;
|
|
11
|
-
display: flex;
|
|
12
|
-
flex-direction: column;
|
|
13
|
-
min-height: 0;
|
|
14
|
-
`,dt=I.div`
|
|
15
|
-
flex: 1;
|
|
16
|
-
min-height: 0;
|
|
17
|
-
display: flex;
|
|
18
|
-
flex-direction: column;
|
|
19
|
-
`,ct=I(ot)`
|
|
20
|
-
box-shadow: ${({theme:t})=>t.colors.elevation2};
|
|
21
|
-
color: ${({theme:t})=>t.colors.grey4};
|
|
22
|
-
`;export{vt as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as l}from"./liveblocks-8SEYIom7.js";import{a as f}from"./sentry-Bpr6hwv_.js";import{h as U,g as B,u as T,j as v,N as O,n as j,i as $,o as z,p as h}from"./core-D95G1COY.js";import{eT as N,Pc as A,OU as b,z7 as I,z1 as F,z5 as w,yW as L,OW as W,yZ as q,z9 as H,z8 as C}from"./zeni-epic-state-BnmnEdbj.js";import{m as P,z as k,B as V,a7 as Z,bH as G,af as _,bI as J}from"./index-C8tyyalR.js";import"./mui-jqvOLufq.js";import{i as K}from"./ReimbursementApprovalRuleDetailScreen-BtppAsqY.js";import M from"./NotFoundScreen-0h0DiOvj.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="51b92233-fdc1-4eee-946f-a340810774ff",e._sentryDebugIdIdentifier="sentry-dbid-51b92233-fdc1-4eee-946f-a340810774ff")}catch{}})();const R="bill-approval-rule-update",Q=j(function(e){return{approvalView:A(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:t,location:p}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(R)&&e(W(!1))},onBackClick:()=>{_(p)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(L(a))},onEditRuleClick:a=>{a!=null?(e(w(a)),t(`./${a}/edit`)):(e(w()),t("./new"))}}})(Z(G)),X=()=>{const e=U(),o=B(),t=T(),[p,a]=f.useState(!1),[u,s]=f.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>N(i)),r=v(i=>A(i)),g=v(i=>b(i).billPaySetupApproverViewUpdateData);if(f.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(I())},[g]),f.useEffect(()=>{p||n!=="Not-Started"||(a(!0),t(F(!0)))},[p,n,t]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");f.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),t(w())),e("./new"))},[u,r,t]);const y={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${R}`]:[],eventCallback:(i,x,m)=>{i.endsWith(R)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx(O,{to:"../../promo"}):c.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||r.fetchState!=="Completed"&&r.fetchState!=="Error"?l.jsx(V,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):l.jsx(Q,{currentTenant:c,location:o,navigate:e,...y})},Y=j(function(e,o){const t=b(e),p=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=p==="approval_create"&&t.allApprovalRules.length!==0;let u=t.allApprovalRules.length===0;return o.approvalRuleId&&(u=t.allApprovalRules.findIndex(s=>s.approvalRuleId===o.approvalRuleId)===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:u,approvalUpdateActionType:p}},function(e,o){const{navigate:t,approvalUpdateDataView:p,approverViewData:a,approvalRuleId:u}=o,s=p.billPaySetupApproverViewUpdateData?.type,d=_(o.location);return{onApprovalRuleDataUpdated:n=>{const c=r=>{const g=[];return r.forEach(y=>{const i=y.actors.selectedUsers.map(S=>({type:"user",userId:S.userId,isImplicitActor:!1})),x=y.actors.selectedNonUsers.map(S=>{const E=!!K(S.value);return{type:E?"attribute":"role",subType:S.value,userId:void 0,idType:void 0,isImplicitActor:!E}}),m=i.concat(x);g.push({action:y.stepType.selectedOption,actors:m,operator:m.length>1?y.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),g};if(s==="approval_create"){const r={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}},onResetClick:()=>{e(I()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(I()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(H())},onSaveRuleSuccess:()=>{t("../")}}})(J);function D(){const e=U(),o=T(),t=B(),{approvalRuleId:p}=$(),a=k.getSignedInUser(),u=P(),s=v(r=>b(r)),d=v(r=>A(r)),[n,c]=f.useState(!1);if(f.useEffect(()=>{n||(c(!0),o(q(!0)))}),f.useEffect(()=>{d.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[d,p]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?l.jsx(V,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:u.colors.grey5}}):l.jsx(Y,{navigate:e,approvalUpdateDataView:s,approvalRuleId:p,approverViewData:d,location:t})}function se(){return l.jsxs(z,{children:[l.jsx(h,{path:"/",element:l.jsx(X,{})}),l.jsx(h,{path:"/new",element:l.jsx(D,{})}),l.jsx(h,{path:"/:approvalRuleId/edit",element:l.jsx(D,{})}),l.jsx(h,{path:"*",element:l.jsx(M,{})})]})}export{se as B};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{j as k}from"./liveblocks-8SEYIom7.js";import{a as V}from"./sentry-Bpr6hwv_.js";import{h as ae,g as ne,u as se,i as ie,j as C,N as oe,n as re}from"./core-D95G1COY.js";import{A as ce,f as ue,aN as de,z as E,N as pe,d as z,af as x,g as P,bD as le,at as me,q as B,au as R}from"./index-C8tyyalR.js";import{P0 as fe,eT as G,tm as ye,Jv as Se,zc as ge,Cn as Ie,EY as be,FB as he,GC as Oe,Pn as Te,Po as De,Pp as ke,Pq as Ce,Pr as Ve,LY as we,Op as Ne,M7 as Ae,l5 as ve,gc as _e,gb as Fe,ga as xe,rv as Pe,rm as Ee,rj as ze,kZ as Be,tv as Re,tt as L,bE as M,tH as j,cw as Le}from"./zeni-epic-state-BnmnEdbj.js";import{n as Me}from"./mui-jqvOLufq.js";import{d as U}from"./routePaths-STLgTv0l.js";import{M as je}from"./MobileAppDrawer-D8HOXn7v.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new e.Error().stack;d&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[d]="e25988a6-ca6a-4bd9-8dfa-c22a61735b55",e._sentryDebugIdIdentifier="sentry-dbid-e25988a6-ca6a-4bd9-8dfa-c22a61735b55")}catch{}})();const Ue=Me.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
min-height: 100%;
|
|
4
|
-
width: 100%;
|
|
5
|
-
flex: 1 1 auto;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
align-items: center;
|
|
8
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,Ge=re(function(e,d){const{businessVerificationDetails:i}=d,r=G(e),y=E.getSignedInUser(),S=r.tenantId,l={userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:S??""},h=we(d.roleMap)&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",t=Ne(e.companyConfigState),s=Ae(e.userRoleConfigState);return{businessVerificationDetails:i,verficationDetailsFetchState:i.fetchState,isRefreshingViewInBackground:i.isRefreshingViewInBackground,allNationalityCountries:i.allNationalityCountries,filesEndPoint:`${me.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:h,allIndustries:t.companyIndustries??[],companyTitles:s.companyTitles}},function(e,d){const{companyId:i,productType:r,currentTenant:y,navigate:S,location:l}=d,{tenantEmailDomain:h}=y;return{onCompanyDetailsChanged:t=>{const{companyDescription:s,companyIndustry:p,companyIndustryType:T,companyLegalName:D,companyTaxId:g,companyWebsite:m,companyPhone:I,primaryContactEmail:c,primaryContactName:n,primaryContactUserId:u,primaryContactSyncToken:O,syncToken:f,fileIds:a,incDate:o,typeOfIncorporation:w,stateOfIncorporation:N,sourceOfFunds:A,companySubIndustry:v,countriesOfOperations:b,companySourceOfFunds:q,companySourceOfFundsDescription:Z,transactionVolume:Y,transactionVolumeDescription:$,purposeOfAccount:H,purposeOfAccountDescription:J,regulatedStatus:W,regulatedStatusDescription:K,usNexus:Q,usNexusTypes:X}=t,_=T?.selectedOption,ee={companyId:i,companyDescription:s,companyIndustry:p.selectedOption,companyIndustryType:_==null||_===""?void 0:_,companyLegalName:D,taxIdOrEIN:g,website:m!=""&&m!=null?Le(m):void 0,phone:I,syncToken:f,fileIds:a,incDate:o!=null?M(o?.toString()):o,typeOfIncorporation:w?.selectedOption??"",stateOfIncorporation:N?.selectedOption??"",sourceOfFunds:A?.selectedOption??"",companySubIndustry:v?.selectedOption??"",countriesOfOperations:b?.selectedOptions.map(F=>F.length===2?F:R(F))??[],companySourceOfFunds:q?.selectedOption??"",companySourceOfFundsDescription:Z,transactionVolume:Y?.selectedOption??"",transactionVolumeDescription:$,purposeOfAccount:H?.selectedOption??"",purposeOfAccountDescription:J,regulatedStatus:W??"",regulatedStatusDescription:K,usNexus:Q,usNexusTypes:X?.selectedOptions??[]},te={userId:u,firstName:n.firstName,lastName:n.lastName,email:c,syncToken:O};e(j({companyDetails:ee,primaryContactDetails:te}))},onCompanyOfficerUpdated:t=>{const s=t.map(p=>{const{officerType:T,userId:D,name:g,email:m,nationalityCountryCode:I,ssn:c,dob:n,phone:u,syncToken:O,selectDocument:f,role:a,ownership:o,isSelectedForVerification:w,userVerificationStatus:N,treasuryUserVerificationStatus:A,fileIds:v}=p;let b;return f.selectDocumentType==="driverLicense"?b="driving_license":f.selectDocumentType==="passport"?b="passport":f.selectDocumentType==="stateId"?b="id_document":f.selectDocumentType==="ssnCard"&&(b="social_security_card"),{officerType:T,userId:D,firstName:g.firstName,lastName:g.lastName,email:m,ssn:c,nationalityCountryCode:I?.selectedOption!=null?R(I.selectedOption):void 0,phone:u,birthday:n!=null?M(n?.toString()):n,syncToken:O,titleAtCompany:a.selectedOption,ownershipInCompany:o,documentTypeSelectedForVerification:b,isSelectedForVerification:w,userVerificationStatus:N,treasuryUserVerificationStatus:A,fileIds:v,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(j({officers:s}))},onSaveDetailsClick:t=>{e(L(i,t,r))},onSendForVerificationClick:t=>{e(L(i,t,r,!0))},onAddressClick:t=>{const s=U(h,t),p=B(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onRegisteredAddressClick:t=>{const s=U(h,t),p=B(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onBackClick:()=>{e(Re({companyId:i})),S("../setup")},updateFilesEntity:t=>{e(Be({files:t}))},onDeleteFile:t=>{e(ze(t))},onDeleteFileList:t=>{e(Ee(t))},onEditFileName:(t,s)=>{e(Pe(t,s.split(".")[0]))},onGetOtp:t=>{e(xe(t,"SpendManagementSetup"))},onResendOtp:t=>{e(Fe(t,"SpendManagementSetup"))},onVerifyOtp:(t,s)=>{e(_e(t,s,"SpendManagementSetup"))},saveNewAddressInLocalStore:(t,s)=>{e(ve({addressType:t,addressToCreate:s}))}}})(le),Qe=({productType:e})=>{const d=ae(),i=ne(),r=se(),[y,S]=V.useState(!1),[l,h]=V.useState(!1),{tenantEmailDomain:t}=ie(),s=ce(),{useDynamicConfig:p}=ue(),{configValue:T}=p(de.zeniAccountsConfig),D=fe(T),g=C(a=>{switch(e){case"zeni_accounts":return a.zeniAccountSetupViewState.fetchState;case"reimbursement":return a.remiSetupViewState.fetchState;case"charge_cards":return a.chargeCardSetupViewState.fetchState;case"zeni_treasury":return a.treasurySetupViewState.fetchState;default:return a.billPaySetupViewState.fetchState}}),m=C(a=>a.companyConfigState.fetchState),I=C(a=>a.userRoleConfigState.fetchState),c=C(a=>G(a)),n=c.companyId??E.getSignedInUserTenant(t)?.companyId;if(V.useEffect(()=>{m==="Not-Started"&&r(ye()),I==="Not-Started"&&r(Se(!0))},[m,I,r]),V.useEffect(()=>{if(!y&&g==="Not-Started"&&n!=null)switch(S(!0),e){case"zeni_accounts":r(Oe(n,!0));break;case"zeni_treasury":r(he(n,!0));break;case"reimbursement":r(be(n,!0));break;case"charge_cards":r(Ie(n,!0));break;default:r(ge(n,!0))}},[y,g,n,r]),E.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let u;switch(e){case"zeni_accounts":u=c.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":u=c.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":u=c.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||c.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":u=c.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:u=c.companyBillPayInfo?.info?.isBillPayTOSAccepted}const O=a=>{h(a)},f=C(a=>{let o;switch(e){case"zeni_accounts":o=Ve(a,n);break;case"zeni_treasury":o=Ce(a,n);break;case"charge_cards":o=ke(a,n);break;case"reimbursement":o=De(a,n);break;default:o=Te(a,n)}return o});return u===!1?k.jsx(oe,{to:"../promo"}):k.jsxs(Ue,{children:[k.jsx(pe,{analytics:z,onLoad:a=>(o=>{switch(e){case"zeni_accounts":return o.trackPageLoaded(P.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return o.trackPageLoaded(P.Event.reimbursementBusinessVerification);default:return o.trackPageLoaded(P.Event.billPayBusinessVerification,x(i)?"Settings":void 0)}})(a)}),x(i)?k.jsx(je,{isAppContentDrawerOpen:l,handleDrawerToggle:O}):null,k.jsx(Ge,{businessVerificationDetails:f,navigate:d,location:i,companyId:n,analytics:z,currentTenant:c,productType:e,isSettings:x(i),roleMap:s?.loggedInUserRoleMap??{},onClickMenuIcon:()=>{O(!0)},maxInsuredAmount:D.maxInsuredAmount})]})};export{Qe as B};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import{j as b}from"./liveblocks-8SEYIom7.js";import{a as i}from"./sentry-Bpr6hwv_.js";import{n as z}from"./utils-kj_q6fLI.js";import{u as Ie,h as we,g as Ee,j as T,i as ke,n as ve}from"./core-D95G1COY.js";import{V as Ae,f as Te,c as W,z as Oe,d2 as Ue,d4 as Fe,b5 as ee,N as _e,d as V,d5 as G,dc as xe,O as Qe,g as De,a7 as Le,d8 as $e,a2 as Ve,dd as Re,b1 as He,db as Me}from"./index-C8tyyalR.js";import{gg as je,g1 as Ne,g2 as Y,g3 as qe,fM as te,g4 as Be,g5 as ze,eS as se,eT as We,g6 as Ge,eZ as Ye,iC as Ze,iy as Je,eU as Z,fF as Ke,fG as Xe,fH as et,fI as tt,fJ as st,fK as at,fL as ot,fN as nt,fO as it,fP as J,bE as K,fQ as rt,fR as lt,fS as dt,fT as ct,fU as ut,fV as mt,fy as ft,fC as X,fW as pt,fX as Ct,fY as St,fZ as ht,f_ as gt,f$ as bt,g0 as yt}from"./zeni-epic-state-BnmnEdbj.js";import{D as Pt,n as H,P as It,S as wt}from"./mui-jqvOLufq.js";import{d as Et}from"./recharts-B5BD4Kau.js";import"./analytics-DORMe8dT.js";import"./plaid-BvitY7vM.js";import"./dnd-BXlaBlTc.js";import"./stripe-DMRn4zHo.js";import"./lottie-DGqwGfHh.js";import"./lexical-D90cNSQE.js";import"./pdf-CMafEn8a.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]="63003251-d11e-43bf-8ac1-aa1401556fb0",e._sentryDebugIdIdentifier="sentry-dbid-63003251-d11e-43bf-8ac1-aa1401556fb0")}catch{}})();const kt=e=>yt(e,!1),vt=e=>bt(e.name,!1),ae="chat-response-generated",oe="cards/ask",ne="card_policy_hero";function R(e){return`/${e}/cards`}function ie(e){return`/${e}/cards/policy`}const At=ve(function(e,r){const s=se(e),C=r.isSubmitting,c=e.cardPolicyState,m=Ke(c),d=Xe(c),S=et(c);return{showSampleQuestions:r.sessionFromUrl==="new_chat"&&s.uiState.currentChatSessionId==null,aiCfoView:s,isSubmitting:C,isNewChatSession:r.sessionFromUrl==="new_chat",isFullView:!0,tableDownloadEndPoint:`${Ve}/tableDownload`,emailLinkQuestion:r.emailLinkQuestion,autoSubmitEmailLinkQuestion:r.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:r.onEmailLinkQuestionProcessed,isFileUploadEnabled:r.isFileUploadEnabled,isUploadPromoVisible:r.isUploadPromoVisible,onUploadPromoClose:r.onUploadPromoClose,allUsers:r.allUsers,cardPolicyCategorySearchOptions:m.map(kt),cardPolicyVendorSearchOptions:d.map(vt),cardPolicyIsVendorSearchLoading:S==="In-Progress",cardPolicyDocumentUploadState:ot(c),cardPolicyUploadedFileName:at(c),cardPolicyFormDraft:st(e.createCardPolicyState),cardsCreationFormDraft:tt(e)}},function(e,r){const{location:s,currentTenant:C,userId:c,navigate:m,currentChatSessionId:d,allSessionsWithOrderedQuestionAnswers:S,isAiCardCreationEnabled:E,isCardPolicyEnabled:y,cardPolicyPageContext:k}=r,f=C.tenantEmailDomain,U=s.state?.referrer,u=U===ne?ie(f):R(f);return{onEventReceived:(a,l)=>{if(a===ae&&typeof l.text=="string"&&typeof l.metadata=="object"){const t=l,n=Ct(t.type),p=t.metadata.chat_session_id??null,{currentChatSession:F,currentQuestionAnswer:v,currentQuestionAnswerSummary:P}=ee(S,p);n!=="answer"?V.trackAICFOChatResponseGenerated(n,v?.question.questionText??"",t.text,p,Me(P,F),t.metadata.message_id??null):V.trackAICFOChatAnswerGenerated(t.text,v?.question.questionText??"",(t.follow_up_questions?.length??0)>0,!!t.assumptions,!!t.insights,t.visualization!=null,St(t.visualization?.type??"")??null,p,t.summarized_title,t.metadata.message_id??null),e(ht({chatSessionId:t.metadata.chat_session_id,responseType:n,fetchState:{fetchState:"Completed",error:void 0}})),e(gt({chatSessionId:t.metadata.chat_session_id,answerPayload:t,userId:c}))}},onSubmit:(a,l,t,n)=>{a&&He(e,a,l,d,S,c,n,t,k)},updateCurrentInput:a=>{e(X(a))},onStopSubmit:()=>{},onUpdateScrollYOffset:a=>{e(pt(a))},onSelectSampleQuestion:()=>{},onBackClick:()=>{m(-1)},onCloseClick:()=>{m(u,{state:{...s.state}}),e(X(""))},togglePageView:()=>{m(u,{state:{...s.state}}),r.setIsAiCfoOpen(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{m(-1)},onNewChatClick:()=>{d!=null&&e(ft()),m(function(a){return`/${a}/${oe}`}(f),{state:{...s.state}})},onToggleCotCollapsed:(a,l)=>{e(mt({questionAnswerId:a,isCollapsed:l}))},onCardsCreationFormChange:E?a=>{e(ut(a))}:void 0,onCardsCreationFormSubmit:E?(a,l)=>{const t=lt(a);t.length!==0&&(e(dt(t)),e(ct({sourceChatSessionId:d??void 0})),d!=null&&e(J({chatSessionId:d,id:z(),kind:"creating_cards",createdAt:K(""),sourceQuestionAnswerId:l})),r.setIsAiCfoOpen(!0),m(R(f),{state:{...s.state}}))}:void 0,onCardPolicyFormChange:y?a=>{e(rt(a))}:void 0,onCardPolicyFormSubmit:y?(a,l)=>{const t=Re({values:a});e(it({templates:[t],sourceChatSessionId:d})),d!=null&&e(J({chatSessionId:d,id:z(),kind:"creating_policy",createdAt:K(""),sourceQuestionAnswerId:l})),r.setIsAiCfoOpen(!0),m(`/${f}/cards/policy`,{state:{...s.state}})}:void 0,onCardPolicyUploadDocument:y?(a,l,t)=>{a.length!==0&&e(nt(a,l,t))}:void 0,onCardPolicyRemoveDocument:y?()=>{e(te())}:void 0}})(Le($e)),{spendManagement:{chargeCard:{cardsAiCfoHero:re,cardPolicyAiCfoHero:le}}}=Qe.getLocalizedStrings(),O=re.pageTitle,Tt=le.pageTitle,Ot=re.chatHeaderSubtitle,Ut=le.chatHeaderSubtitle,Yt=({isFileUploadEnabled:e})=>{const{setIsAiCfoOpen:r}=Ae(),s=Ie(),C=we(),c=Ee(),[m,d]=i.useState(!1),{useFeatureGate:S}=Te(),{isFeatureEnabled:E}=S(W.isAiCardCreationEnabled),{isFeatureEnabled:y}=S(W.isCardPolicyEnabled);i.useEffect(()=>{s(je())},[s]),i.useEffect(()=>(s(Ne()),s(Y()),s(qe("cardHolderCandidate",!1)),()=>{s(te())}),[s]);const k=T(o=>Be(o).fetchState);i.useEffect(()=>{k==="Not-Started"&&s(ze(!1,!1,!1))},[k,s]);const f=i.useMemo(()=>Et(o=>{s(Y(o))},250),[s]);i.useEffect(()=>()=>{f.cancel()},[f]);const U=i.useCallback(o=>{f(o)},[f]),u=T(o=>se(o)),a=Oe.getSignedInUser(),{session_id:l}=ke(),t=T(o=>We(o)),n=u.uiState.currentChatSessionId,p=t.tenantEmailDomain,{handleUploadPromoClose:F,isUploadPromoVisible:v}=Ue({isFileUploadEnabled:e,tenantEmailDomain:p}),P=c.state,h=P?.aiCfoInitialQuestion??null,_=!!P?.aiCfoShouldSubmit,I=P?.referrer===ne,de=I?"card_policy":void 0,ce=i.useMemo(()=>({title:I?Tt:O,subtitle:I?Ut:Ot}),[I]),[ue,x]=i.useState(null),[me,Q]=i.useState(!1),D=i.useRef(!1);i.useEffect(()=>{D.current||h==null||h===""||(x(h),Q(_),D.current=!0)},[h,_]);const fe=i.useCallback(()=>{x(null),Q(!1)},[]),pe=t.masterTOSInfo,g=pe?.isMasterTOSAccepted??!1,A=i.useRef(null);i.useEffect(()=>{if(g&&A.current!=null){const{question:o,shouldSubmit:w}=A.current;A.current=null,x(o),Q(w),D.current=!1}},[g]);const{visitedSessions:M}=Fe(n),L=u.fetchState,$=u.uiState.chatSessionsNextPageToken.hasMore||!u.uiState.chatSessionsFirstPageFetched,j=n!=null?u.fetchChatSessionHistoryByChatSessionId?.[n]?.fetchState??"Not-Started":"Not-Started",N=n==null||(u.uiState.chatHistoryNextPageToken[n]?.hasMore??!0),q=u.allSessionsWithOrderedQuestionAnswers,B=T(o=>Ge(o.userState,o.userRoleState,o.userListViewState,"cardHolderCandidate")).users,Ce=i.useMemo(()=>B.map(o=>o.user).filter(o=>o!=null),[B]),{currentSessionQuestionAnswers:Se}=ee(q,n),he=Se.length===0;i.useEffect(()=>{n!=null&&l!==n&&C(function(o,w){return`/${o}/${oe}/${w}`}(p,n),{state:{...c.state},replace:!0})},[n,l,p,C,c.state]),i.useEffect(()=>{l!=null&&n==null&&l!=="new_chat"&&s(Ye({sessionId:l,agentId:"controller"}))},[]);const ge=i.useMemo(()=>({events:M.map(o=>`private-encrypted-chat-${o}.${ae}`),eventCallback:(o,w,Pe)=>Pe.onEventReceived(o,w)}),[M]);if(i.useEffect(()=>{L!=="In-Progress"&&$&&s(Ze())},[L,$,s]),i.useEffect(()=>{n!=null&&j!=="In-Progress"&&N&&a!=null&&L==="Completed"&&!$&&s(Je(n,a.userId))},[j,N,n,a,s]),a==null)throw Error("Can't access Cards AI CFO page without signing in...");const be=l??"new_chat",ye=n!=null&&u.responseStateByChatSessionId?.[n]?.answer?.fetchState==="In-Progress";return b.jsxs(_t,{children:[b.jsx(_e,{analytics:V,onLoad:o=>o.trackPageLoaded(De.Event.aiCFOPage)}),g?b.jsx(At,{...ge,currentChatSessionId:n,allSessionsWithOrderedQuestionAnswers:q,allUsers:Ce,isAiCardCreationEnabled:E,isCardPolicyEnabled:y,openOnboardingPage:()=>d(!0),userId:a.userId,setIsAiCfoOpen:r,navigate:C,sessionFromUrl:be,location:c,isSubmitting:ye,isEmptyChatWithSession:he,customPageTitle:O,chatHeader:ce,currentTenant:t,emailLinkQuestion:ue??void 0,autoSubmitEmailLinkQuestion:me,onEmailLinkQuestionProcessed:fe,isFileUploadEnabled:e,isUploadPromoVisible:v,onUploadPromoClose:F,onCardPolicyVendorSearchTextChange:U,cardPolicyPageContext:de}):b.jsx(G,{isTOSAccepted:g,acceptMasterTOSState:u.masterTOSAcceptanceState,customPageTitle:O,onCloseClick:()=>{C(I?ie(p):R(p),{state:{...c.state}})},onCompleteClick:()=>{g||t.userRoleId==null||(h!=null&&h!==""&&(A.current={question:h,shouldSubmit:_}),s(Z(t.userRoleId)))}}),b.jsx(Pt,{anchor:"right",open:m,transitionDuration:250,PaperProps:{component:xt,style:{width:`${xe}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>d(!1),children:b.jsx(Ft,{onClick:o=>o.stopPropagation(),children:b.jsx(G,{isTOSAccepted:g,acceptMasterTOSState:u.masterTOSAcceptanceState,customPageTitle:O,onCloseClick:()=>d(!1),onCompleteClick:()=>{g||t.userRoleId==null||s(Z(t.userRoleId)),d(!1)}})})})]})},Ft=H(wt)`
|
|
2
|
-
display: flex;
|
|
3
|
-
min-height: 100%;
|
|
4
|
-
flex-direction: column;
|
|
5
|
-
`,_t=H.div`
|
|
6
|
-
flex: 1 1 auto;
|
|
7
|
-
display: flex;
|
|
8
|
-
flex-direction: column;
|
|
9
|
-
min-height: 0;
|
|
10
|
-
width: 100%;
|
|
11
|
-
`,xt=H(It)`
|
|
12
|
-
box-shadow: ${({theme:e})=>e.colors.elevation2};
|
|
13
|
-
color: ${({theme:e})=>e.colors.grey4};
|
|
14
|
-
`;export{Yt as default};
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import{j as c}from"./liveblocks-8SEYIom7.js";import{h as de,g as Ce,i as Me,u as pe,j as o,N as Sa,s as At,n as De,t as yn,o as as,p as se}from"./core-D95G1COY.js";import{bs as Pe,QX as ts,QY as ns,fM as ln,QZ as In,fF as kn,Q_ as En,Q$ as An,R0 as Dn,R1 as _n,fG as Pn,fH as wn,R2 as vn,g1 as Tn,g2 as $a,R3 as Fn,R4 as rs,fL as ss,fK as cs,R5 as os,g4 as Rn,g5 as sa,R6 as is,R7 as ds,fO as ls,fN as us,R8 as xn,hC as Qe,g0 as Bn,f$ as Ln,R9 as ms,eV as Cs,A_ as ps,AZ as hs,B1 as fs,B3 as gs,e$ as bs,eS as On,Ra as Ss,Rb as ys,f4 as Un,Rc as Is,f5 as jn,B9 as ks,B6 as Es,eT as fe,Rd as Qa,f8 as we,f9 as ve,fa as Te,gr as ca,ct as oa,Re as ia,Rf as Dt,uA as za,kx as Za,Rg as Ya,BH as ka,BJ as qe,BK as _t,kn as Mn,Rh as da,Bv as _a,Ri as As,Rj as Ds,By as Ja,Rk as _s,Pk as Xa,eX as Nn,BE as ga,hN as Ps,Rl as Vn,Rm as la,bq as ws,Rn as vs,gc as et,gb as at,Cc as Ts,ga as tt,P0 as Fs,Ro as Hn,cm as Gn,cN as Rs,Pj as wa,CN as $n,Rp as un,Cn as Pa,Rq as zn,CO as xs,PM as Bs,CP as Ls,DL as Os,tX as Us,DF as js,Rr as Ms,BI as na,Rs as Ns,Rt as Vs,Ru as Hs,Rv as Gs,Rw as $s,Rx as Pt,Ry as zs,BZ as Zn,BS as Zs,Rz as Ys,gt as Ks,C6 as Yn,Ca as Kn,gs as Ws,RA as qs,Cz as Wn,RB as Qs,RC as Js,RD as Xs,C8 as qn,BV as Qn,BB as Jn,C2 as Xn,C0 as er,C4 as ec,RE as ar,RF as ac,f1 as tc,f2 as nc,f3 as rc,RG as nt,g6 as tr,cO as wt,RH as sc,RI as cc,RJ as oc,RK as ic,Ci as St,CG as dc,CC as lc,Ce as uc,CE as mc,Cu as Cc,Cw as pc,RL as nr,CM as Ga,Js as hc,RM as fc,RN as gc,RO as bc,RP as rr,RQ as Sc,D7 as yc,Cm as sr,Ch as je,Cl as Ic,RR as kc,RS as Ec,Bs as Ac,RT as cr,eW as or,RU as Dc,Bu as _c,Bt as mn,RV as Pc,RW as wc,RX as vc,LZ as Tc,RY as vt,RZ as Fc,xA as ir,l5 as Rc,hD as xc,Dc as Bc,R_ as dr,fS as Lc,fT as Oc,R$ as Uc,df as jc,g3 as Mc,D2 as Nc,CY as We,bt as Vc,bF as Hc,cy as Gc,bG as $c,La as zc}from"./zeni-epic-state-BnmnEdbj.js";import{A as Fe,cf as lr,p as _e,cg as ur,ch as mr,ci as Zc,O as ua,_ as Tt,cj as Yc,ck as Kc,V as Cr,a as pr,Y as hr,q as ye,f as le,c as K,aq as ya,cl as fr,cm as Wc,cn as qc,z as re,B as va,c4 as rt,co as Qc,cp as Jc,cq as Xc,cr as eo,cs as ao,J as Ta,aN as ze,bo as Ft,ct as to,y as Fa,j as st,m as Rt,d as J,a7 as ct,cu as no,bA as ba,cv as yt,cw as ro,N as xt,cx as so,at as gr,a2 as It,cy as co,X as br,g as Sr,cz as oo,cA as io,cB as lo,cC as uo,cD as mo,cE as Co,o as Ka,cF as po,cG as ho,cH as pt,E as fo,cI as go,cJ as bo,cK as So,cL as yo,cM as Io,a9 as ko}from"./index-C8tyyalR.js";import{n as Ne,D as yr,S as Eo}from"./mui-jqvOLufq.js";import{a as r}from"./sentry-Bpr6hwv_.js";import{u as Ra}from"./useAskAiCfoHostNavButtonProps-CE4sjmcs.js";import{M as Ie}from"./MobileAppDrawer-D8HOXn7v.js";import{d as Bt}from"./recharts-B5BD4Kau.js";import{g as Ae,a as xa,b as Ir,c as Re,d as xe,e as Je,f as Xe,h as ea,A as Ao,i as Lt,P as Do,j as Ot,s as Ia,k as kr,l as ra,m as Er,n as _o,o as Ar,p as Po,S as Cn}from"./SetupPagesScreen-D-neLjJM.js";import{u as Dr}from"./useInitialThreadRequest-DzF6un_U.js";import ot from"./NotFoundScreen-0h0DiOvj.js";import{n as pn}from"./utils-kj_q6fLI.js";import{t as wo}from"./AddressScreen-DyCQJjNT.js";import"./analytics-DORMe8dT.js";import"./plaid-BvitY7vM.js";import"./dnd-BXlaBlTc.js";import"./stripe-DMRn4zHo.js";import"./lottie-DGqwGfHh.js";import"./lexical-D90cNSQE.js";import"./pdf-CMafEn8a.js";import"./analyticsHelper-aSqJwcvL.js";import"./routePaths-STLgTv0l.js";import"./BusinessVerificationPageScreen-fLqoQmHN.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]="bd29c6c8-0299-42c3-ba6f-8fc3accbf039",e._sentryDebugIdIdentifier="sentry-dbid-bd29c6c8-0299-42c3-ba6f-8fc3accbf039")}catch{}})();const vo=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}},_r=e=>({id:e.id,isChecked:!1,cardName:e.cardName,last4:e.accountLast4,limitAmount:e.limit?.amount??0,limitCadence:e.creditLimitFrequency?.code,owner:vo(e),utilizationAmount:(e.limit?.amount??0)-(e.available?.amount??0)}),{spendManagement:{chargeCard:{cardPolicyPage:hn}}}=ua.getLocalizedStrings(),To=e=>Bn(e,!1),Fo=e=>Ln(e.name,!1);function Ro(){const e=de(),n=Ce(),{tenantEmailDomain:t}=Me(),a=pe(),s=Fe(),b=Pe(s?.loggedInUserRoleMap),[f,g]=r.useState(!1),_=r.useCallback(v=>{g(v)},[]),i=r.useCallback(()=>{_(!0)},[_]),{isAiCfoAccessEnabled:m,onAskAiCfoClick:R}=Ra({mobileExploreReferrer:"Card Policy"});r.useEffect(()=>()=>{a(ts()),a(ns()),a(ln())},[a]);const D=o(v=>In(v.cardPolicyState)),d=o(v=>kn(v.cardPolicyState)),j=o(v=>En(v.cardPolicyState)),P=o(v=>An(v.cardPolicyState)),B=o(v=>Dn(v.cardPolicyState)),p=o(v=>_n(v.cardPolicyState)),h=o(v=>Pn(v.cardPolicyState)),w=o(v=>wn(v.cardPolicyState)),u=o(v=>vn(v.cardPolicyState)),T=o(v=>v.chargeCardConfigState.receiptRequiredAboveAmount.amount),k=o(v=>v.chargeCardConfigState.fetchState);r.useEffect(()=>{D!=="Completed"&&D!=="In-Progress"&&a(Tn())},[a,D]),r.useEffect(()=>{w==="Completed"&&u===""||w==="In-Progress"||a($a())},[a,w,u]);const M=o(v=>Fn(v.createCardPolicyState)),A=o(v=>rs(v.createCardPolicyState)),y=o(v=>ss(v.cardPolicyState)),L=o(v=>cs(v.cardPolicyState)),l=o(v=>os(v.createCardPolicyState)),C=o(v=>Rn(v));r.useEffect(()=>{C.fetchState==="Not-Started"&&a(sa(!1,!1,!1))},[C.fetchState,a]);const N=r.useMemo(()=>d.map(To),[d]),G=r.useMemo(()=>h.map(Fo),[h]),O=r.useMemo(()=>C.cards.filter(v=>!lr(v.status.code)).map(_r),[C.cards]),U=D==="Completed"&&C.fetchState==="Completed"&&k==="Completed";r.useEffect(()=>{U&&l==null&&a(is({cardsMasterList:O,defaultRequireReceiptAmount:T,suggestedAllowMerchants:j,suggestedBlockMerchants:P,suggestedAllowCategories:B,suggestedBlockCategories:p}))},[k,a,U,l,O,T,j,P,B,p]);const z=r.useMemo(()=>Bt(v=>{a($a(v))},250),[a]);r.useEffect(()=>()=>{z.cancel()},[z]);const Z=r.useCallback(v=>{z(v)},[z]),I=M.fetchState,x=t!=null?`/${t}/cards/policy`:"..",Y=r.useCallback(()=>{const v=_e(n.state?.pathnameStackToGoBack),ee=v.poppedPathname??x;e(ee,{state:{pathnameStackToGoBack:v.newStack}})},[n.state,e,x]),q=r.useCallback(()=>{e(x)},[e,x]),E=r.useCallback(v=>{a(ds(v))},[a]),V=r.useCallback(v=>{const ee=ur(v);a(ls({templates:[ee]}))},[a]),Q=r.useCallback(v=>{v.length!==0&&a(us(v))},[a]),X=r.useCallback(()=>{a(ln())},[a]),S=r.useRef(I);r.useEffect(()=>{const v=S.current;S.current=I,I==="Completed"&&v!=="Completed"&&A!=null&&(a(xn()),a(Qe({messageSection:"card_policy_created",messageText:"success",type:"success"})),e(x))},[a,I,A,e,x]);const F=I==="Error"?M.error?.message??hn.createPolicyGenericErrorMessage:void 0;return b&&t!=null?l==null?c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:f,handleDrawerToggle:_}),c.jsx(mr,{showUploadDocumentSection:!0,navBarTitle:hn.createPageTitle,onBackClick:Y,onClickMenuIcon:i,isAiCfoAccessEnabled:m,onAskAiCfoClick:R})]}):c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:f,handleDrawerToggle:_}),c.jsx(Zc,{formDraft:l,vendorSearchOptions:G,categorySearchOptions:N,isVendorSearchLoading:w==="In-Progress",onVendorSearchTextChange:Z,submitState:I,submitErrorMessage:F,documentUploadState:y,uploadedFileName:L,isAiCfoAccessEnabled:m,onAskAiCfoClick:R,onBackClick:Y,onCancelClick:q,onClickMenuIcon:i,onFormChange:E,onSubmit:V,onUploadDocument:Q,onRemoveDocument:X})]}):c.jsx(Sa,{to:"..",replace:!0})}const{spendManagement:{chargeCard:{cardPolicyPage:xo}}}=ua.getLocalizedStrings(),Bo=e=>Bn(e,!1),Lo=e=>Ln(e.name,!1);function Oo(){const e=de(),n=Ce(),{tenantEmailDomain:t,templateId:a}=Me(),s=pe(),b=Fe(),f=Pe(b?.loggedInUserRoleMap),[g,_]=r.useState(!1),i=r.useCallback(F=>{_(F)},[]),m=r.useCallback(()=>{i(!0)},[i]),{isAiCfoAccessEnabled:R,onAskAiCfoClick:D}=Ra({mobileExploreReferrer:"Card Policy"}),d=o(F=>ms(F)),j=o(F=>In(F.cardPolicyState)),P=o(F=>kn(F.cardPolicyState)),B=o(F=>En(F.cardPolicyState)),p=o(F=>An(F.cardPolicyState)),h=o(F=>Dn(F.cardPolicyState)),w=o(F=>_n(F.cardPolicyState)),u=o(F=>Pn(F.cardPolicyState)),T=o(F=>wn(F.cardPolicyState)),k=o(F=>vn(F.cardPolicyState)),M=o(F=>Rn(F)),A=o(F=>a!=null?Cs(F.cardPolicyState,a):void 0),y=r.useMemo(()=>d.templateId===a&&d.formDraft!=null?d.formDraft:A!=null?ps(A):void 0,[d.templateId,d.formDraft,A,a]);r.useEffect(()=>{if(a==null)return;const F=d.detailFetchState.fetchState;d.templateId===a&&(F==="Completed"||F==="In-Progress")||A!=null||s(hs(a))},[s,a,d.templateId,d.detailFetchState.fetchState,A]),r.useEffect(()=>{j!=="Completed"&&j!=="In-Progress"&&s(Tn())},[s,j]),r.useEffect(()=>{T==="Completed"&&k===""||T==="In-Progress"||s($a())},[s,T,k]);const L=o(F=>F.chargeCardConfigState.receiptRequiredAboveAmount.amount);r.useEffect(()=>{M.fetchState==="Not-Started"&&s(sa(!1,!1,!1))},[M.fetchState,s]);const l=r.useMemo(()=>P.map(Bo),[P]),C=r.useMemo(()=>u.map(Lo),[u]),N=r.useMemo(()=>M.cards.filter(F=>!lr(F.status.code)).map(_r),[M.cards]);Tt({isDataReady:y!=null});const G=r.useMemo(()=>{if(y!=null)return Yc({draft:y,cardRows:N,categorySearchOptions:l,vendorSearchOptions:C,defaultRequireReceiptAmount:L,suggestedAllowMerchants:B,suggestedBlockMerchants:p,suggestedAllowCategories:h,suggestedBlockCategories:w})},[y,N,l,C,L,B,p,h,w]),[O,U]=r.useState(void 0),z=r.useRef(!1);r.useEffect(()=>{z.current||O!=null||G==null||(z.current=!0,U(G))},[O,G]);const Z=r.useCallback(F=>{U(F)},[]),I=r.useMemo(()=>Bt(F=>{s($a(F))},250),[s]);r.useEffect(()=>()=>{I.cancel()},[I]);const x=r.useCallback(F=>{I(F)},[I]),Y=d.updateFetchState.fetchState,q=t!=null?`/${t}/cards/policy`:"..",E=r.useCallback(()=>{const F=_e(n.state?.pathnameStackToGoBack),v=F.poppedPathname??q;e(v,{state:{pathnameStackToGoBack:F.newStack}})},[n.state,e,q]),V=r.useCallback(()=>{e(q)},[e,q]),Q=r.useCallback(F=>{if(a==null)return;const v=ur(F);s(fs(v)),s(gs(a))},[s,a]),X=r.useRef(Y);r.useEffect(()=>{const F=X.current;X.current=Y,Y==="Completed"&&F!=="Completed"&&(s(Qe({messageSection:"card_policy_updated",messageText:"success",type:"success"})),e(q))},[s,Y,e,q]);const S=Y==="Error"?d.updateFetchState.error?.message??xo.updatePolicyGenericErrorMessage:void 0;return!f||t==null||a==null?c.jsx(Sa,{to:"..",replace:!0}):O!=null&&j==="Completed"&&M.fetchState==="Completed"?c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:g,handleDrawerToggle:i}),c.jsx(Kc,{templateName:d.template?.name??"",formDraft:O,vendorSearchOptions:C,categorySearchOptions:l,isVendorSearchLoading:T==="In-Progress",onVendorSearchTextChange:x,submitState:Y,submitErrorMessage:S,isAiCfoAccessEnabled:R,onAskAiCfoClick:D,onBackClick:E,onCancelClick:V,onClickMenuIcon:m,onFormChange:Z,onSubmit:Q})]}):c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:g,handleDrawerToggle:i}),c.jsx(mr,{showUploadDocumentSection:!1,navBarTitle:d.template?.name,onBackClick:E,onClickMenuIcon:m,isAiCfoAccessEnabled:R,onAskAiCfoClick:D})]})}function Pr(e,n,t){return n?e.filter(a=>a!=null&&a.trim().length>0).slice(0,t):[]}function wr(e){return o(n=>e==null||e===""?{chips:ht,isResolved:!1}:function(t){const a=t?.fetchState,s=a==="Completed"||a==="Error";return{chips:a==="Completed"?t?.suggestedQuestions??ht:ht,isResolved:s}}(bs(n,e)),At)}const ht=[],{spendManagement:{chargeCard:{cardPolicyAiCfoHero:{headline:Uo,subheadline:jo,pageTitle:Mo}}}}=ua.getLocalizedStrings(),No=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 Vo(){const e=de(),n=Ce(),{tenantEmailDomain:t}=Me(),a=pe(),s=Fe(),b=Pe(s?.loggedInUserRoleMap),[f,g]=r.useState(!1),_=r.useCallback(I=>{g(I)},[]),i=r.useCallback(()=>{_(!0)},[_]),{useFeatureGate:m}=le(),{isFeatureEnabled:R}=m(K.isAiCfoFileUploadEnabled),{isFeatureEnabled:D}=m(K.isCardPolicyEnabled),{isAiCfoAccessEnabled:d,onAskAiCfoClick:j}=Ra({mobileExploreReferrer:"Card Policy"}),P=o(I=>Ss(I)),B=o(I=>Fn(I.createCardPolicyState)),p=o(I=>ys(I.createCardPolicyState)),h=o(I=>p==null?[]:Un(I.aiCfoState,p).filter(x=>x.kind==="creating_policy"),At),w=B.fetchState==="In-Progress"?Math.max(h.length,1):0,u=o(I=>Is(I.createCardPolicyState)),T=ya(B.fetchState);r.useEffect(()=>{T==="In-Progress"&&B.fetchState==="Completed"&&p!=null&&(a(xn()),h.forEach(I=>{a(jn({chatSessionId:p,id:I.id,entityIds:u,kind:"created_policy"}))}))},[B.fetchState,a,p,u,h,T]);const k=P.fetchState.fetchState;r.useEffect(()=>{k!=="Not-Started"&&k!=="Error"||a(ks())},[a,k]);const M=P.archiveFetchState.fetchState,A=ya(M);r.useEffect(()=>{A==="In-Progress"&&M==="Completed"&&a(Qe({messageSection:"card_policy_deleted",messageText:"success",type:"success"}))},[M,a,A]);const y=r.useMemo(()=>P.templates.map(No),[P.templates]);Tt({isDataReady:P.fetchState.fetchState==="Completed"});const L=y.length>0||w>0,l=function(I){const{hasAnyPolicies:x,isChargeCardAdmin:Y,isFileUploadEnabled:q}=I,E=de(),V=Ce(),{tenantEmailDomain:Q}=Me(),{isAiCfoOpen:X,setIsAiCfoOpen:S}=Cr(),F=pr(),v=hr(),ee=o(ce=>On(ce)).createSessionAndSubmitState.fetchState==="In-Progress",{chips:W,isResolved:ke}=wr("card_policy"),be=r.useMemo(()=>Pr(W,ke,3),[W,ke]),[ge,ae]=r.useState(""),ue=v&&F&&Q!=null&&!X,oe=r.useCallback(ce=>{if(Q==null)return;const Ea=ye(V.state?.pathnameStackToGoBack,V.pathname);E(`/${Q}/cards/ask`,{state:{message:"",origin:"",pathnameStackToGoBack:Ea,referrer:"card_policy_hero",aiCfoInitialQuestion:ce,aiCfoShouldSubmit:ce!=null&&ce.trim().length>0}})},[V.pathname,V.state,E,Q]),te=r.useCallback(ce=>{ce.trim().length!==0&&(ae(""),oe(ce))},[oe]),Ze=r.useCallback(()=>{const ce=ge.trim();ce.length!==0&&(ae(""),oe(ce))},[ge,oe]),Ee=r.useCallback(()=>{},[]),ne=r.useCallback(ce=>{ae(ce)},[]),Ye=r.useCallback(()=>{S(!0)},[S]),Be=r.useCallback(()=>{oe(void 0)},[oe]);return r.useMemo(()=>{if(ue&&!x&&Y)return{aiAgentName:Mo,headline:Uo,subheadline:jo,promptChips:be,composer:{currentInput:ge,isSubmitting:ee,isFileUploadEnabled:q,onInputChange:ne,onSubmit:Ze,onStopSubmit:Ee},onPromptClick:te,onOpenSidePanel:Ye,onOpenFullView:Be,dataTestIdPrefix:"card-policy-ai-cfo-hero"}},[ge,x,ue,Y,q,ee,ne,Be,Ye,te,Ee,Ze,be])}({hasAnyPolicies:L,isChargeCardAdmin:b,isFileUploadEnabled:R}),C=D&&l!=null?c.jsx(fr,{...l}):null,N=d&&C==null,G=r.useCallback(()=>{const I=_e(n.state?.pathnameStackToGoBack),x=I.poppedPathname??"..";e(x,{state:{pathnameStackToGoBack:I.newStack}})},[n.state,e]),O=r.useCallback(()=>{t!=null&&e(`/${t}/cards/policy/new`)},[e,t]),U=r.useCallback(I=>{t!=null&&e(`/${t}/cards/policy/${I}/edit`)},[e,t]),z=r.useCallback(I=>{a(Es(I))},[a]),Z=P.fetchState.fetchState;return!L&&Z!=="Completed"&&Z!=="Error"?c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:f,handleDrawerToggle:_}),c.jsx(Wc,{onBackClick:G,onNewPolicyClick:O,onClickMenuIcon:i,isAiCfoAccessEnabled:d,onAskAiCfoClick:j})]}):c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:f,handleDrawerToggle:_}),c.jsx(qc,{policies:y,archivingTemplateId:P.archiveTargetTemplateId,pendingCreationCount:w,onBackClick:G,onNewPolicyClick:O,onEditPolicyClick:U,onArchivePolicyClick:z,onClickMenuIcon:i,policyAiCfoHero:C,isAiCfoAccessEnabled:N,onAskAiCfoClick:j})]})}function Ho(){const e=de(),{cardId:n}=Me(),t=pe(),a=re.getSignedInUser(),s=o(W=>fe(W)),b=Fe(),f=Pe(b?.loggedInUserRoleMap),{useFeatureGate:g}=le();if(a==null)throw Error("Can't access Add To Wallet Page without signing in...");const[_,i]=r.useState(!1),m=o(W=>Qa(W).firstViewAfterActivation);if(n==null)throw Error("Empty card id is not valid...");const R=s.userRole.includes("charge_card_user"),{isFeatureEnabled:D}=g(K.isChargeCardFeatureEnabled),d=!!s.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:j}=g(K.isDebitCardFeatureEnabled),P=we(s),B=ve(s),p=Te(j,s),h=s.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,w=Re({isDebitCardFeatureEnabled:j,isBankingOnlyTenant:p}),u=xe({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:D,isBookKeepingTenant:B,isDebitCardProductVisible:w,chargeCardsCreditAccountLimit:h}),T=!!s.companyDebitCardInfo?.info?.isDebitCardEnabled,k=o(W=>ca(W,s.companyId)),M=oa(k.controllers),{creditAccount:A,creditAccountRepayment:y}=o(W=>ia(W)),L=o(W=>W.classListState.fetchState),l=!R&&u&&d,C=o(W=>Dt(W,n,l,u)),[N,G]=r.useState(!1),O=C.chargeCard,U=O?.cardCreatedByUser?.userId,z=o(W=>U!=null?za(W.userRoleState,U):void 0),Z=z?.accountingClassIDs[0],I=o(W=>Z!=null?Za(W.classState,{classId:Z,reportId:"class_list"}):void 0),x=O?.cardHolderUser?.userId,Y=o(W=>x!=null?za(W.userRoleState,x):void 0),q=Y?.accountingClassIDs[0],E=o(W=>q!=null?Za(W.classState,{classId:q,reportId:"class_list"}):void 0),V=O?.type.code==="business_physical_credit_card"||O?.type.code==="business_physical_debit_card",Q=O?.type.code==="business_physical_debit_card";r.useEffect(()=>{m&&_===!1&&V&&(i(!0),setTimeout(()=>{t(Ya()),Q&&t(Qe({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[m,_,V,Q]),r.useEffect(()=>{N||C.fetchState==="Completed"||C.fetchState==="In-Progress"||n==null||(G(!0),t(ka(n,l,!1)))},[N,C,n,t]),r.useEffect(()=>{if(C.fetchState==="Completed"&&(V===!1||V&&O?.status?.code!=="active"||O?.cardHolderUserId!==a.userId||m===!1&&_===!1||O?.type.code==="business_physical_debit_card"||O?.type.code==="business_virtual_debit_card")){const W=Ae(s.tenantEmailDomain,n,a,O,m);e(W)}},[C.fetchState,m,V]),r.useEffect(()=>{A.fetchState!=="Completed"&&A.fetchState!=="In-Progress"&&u&&d&&f&&t(qe()),y.fetchState!=="Completed"&&y.fetchState!=="In-Progress"&&u&&d&&f&&t(_t()),L!=="Completed"&&L!=="In-Progress"&&t(Mn())},[A.fetchState,y.fetchState,t,u,d,f,L]);const X=()=>{if(a!=null&&n!=null){t(Ya());const W=Ae(s.tenantEmailDomain,n,a);e(W)}},S=O?.type.code==="business_physical_debit_card"||O?.type.code==="business_virtual_debit_card",F=Je(u,w,T,d),v=xa(u,d,f,A,y),ee=Ir(S,C);return C.fetchState!=="Completed"?c.jsx(va,{fetchState:"In-Progress"}):c.jsxs(c.Fragment,{children:[c.jsx(rt,{showConfetti:m}),c.jsx(Qc,{onGotItClick:X,isDebitCard:O?.type.code==="business_physical_debit_card",controllerEmails:M,isChargeCardFeatureEnabled:u,isDebitCardFeatureEnabled:w,isDebitCardSetupEnabled:T,isChargeCardSetupEnabled:d,productInformation:F,creditAccountInformation:v,debitAccountInformation:ee,chargeCardDetailView:C,creditAccount:A,classListFetchState:L,creditAccountRepayment:y,cardIssuedByRoles:z?.userRoles,cardIssuedByDepartmentName:I?.className,cardHolderRoles:Y?.userRoles,cardHolderDepartmentName:E?.className})]})}const Ut=e=>{const{events:n,onEvent:t,onSubscribed:a}=e,s=Jc(),b=r.useRef(t),f=r.useRef(a),g=r.useRef(0);r.useEffect(()=>{b.current=t},[t]),r.useEffect(()=>{f.current=a},[a]);const _=r.useMemo(()=>[...n].sort().join("|"),[n]);r.useEffect(()=>{if(s==null||n.length===0)return;const i=[],m=new Set,R=()=>{if(f.current==null)return;const D=Date.now();D-g.current<5e3||(g.current=D,f.current())};return n.forEach(D=>{const[d,j]=Xc(D);if(j==="")return;const P=s.channel(d),B=h=>{b.current(j,h)};let p;if(P?.subscribed===!0)p=P,p.bind(j,B),m.has(d)||(m.add(d),R()),i.push(()=>{P.unbind(j,B)});else{if(p=P??s.subscribe(d),p.bind(j,B),!m.has(d)){m.add(d);const h=()=>{R()};p.bind("pusher:subscription_succeeded",h),i.push(()=>{p.unbind("pusher:subscription_succeeded",h)})}i.push(()=>{p.unbind(j,B)})}}),()=>{i.forEach(D=>D())}},[s,_])},vr="charge-card-transaction-update",Tr="charge-card-transaction-created",Fr="charge-card-transaction-declined",Rr="charge-card-transaction-updated",xr="charge-card-transaction-receipt-uploaded",ma="charge-card-status-update",jt="charge-card-spending-updated",it="credit-account-balance-updated",dt="charge-card-created",Mt="charge-card-limit-updated",Nt="charge-card-limit-reset",Vt="charge-card-renamed",Go="charge-card-department-updated",Br="charge-card-repayment-completed",Lr="charge-card-payment-date-updated",Ba="charge-card-cashback-redeemed",La="charge-card-cashback-earned",Ca=(e,n)=>e==null||e===""?[]:n.map(t=>`private-encrypted-${e}.${t}`),$o=[La,Ba],zo=De(function(e){const n=da(e);return{insightsData:n.insight,cashbackByPeriod:n.cashbackByPeriod,uiState:n.uiState,cashbackSummary:n.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(n,t)=>{e(As({uiState:{sortKey:n,sortOrder:t}}))}}})(ao);function Zo(){const e=de(),n=pe(),t=Ce(),a=re.getSignedInUser(),s=o(j=>fe(j)),{useFeatureGate:b}=le(),{isFeatureEnabled:f}=b(K.isCardsCommentingEnabled),[g,_]=r.useState(!1),i=o(j=>da(j)),m=Dr(s.companyId,{clearParams:i.fetchState==="Completed"}),R=r.useCallback(()=>{const j=_e(t.state?.pathnameStackToGoBack),P=j.poppedPathname??Yo(s.tenantEmailDomain);e(P,{state:{pathnameStackToGoBack:j.newStack}})},[e,t,s.tenantEmailDomain]),D=Xe(s);if(Ut({events:Ca(D,$o),onEvent:j=>{switch(j){case La:case Ba:return void n(_a(!0))}},onSubscribed:()=>{n(_a(!0))}}),r.useEffect(()=>{g||i.fetchState==="Completed"||i.fetchState==="In-Progress"||(_(!0),n(_a()))},[g,i,n]),a==null)throw Error("Can't access cashback detail page without signing in...");const d=i.cashbackSummary?.cashbackEarned?.amount!=null&&i.fetchState!=="Not-Started";return i.fetchState!=="In-Progress"||d?(i.cashbackSummary?.cashbackEarned?.amount??0)===0&&i.fetchState==="Completed"?c.jsx(ot,{}):c.jsx(zo,{onBackClick:R,isCardsCommentingEnabled:f,initialOpenThreadRequest:m}):c.jsx(eo,{onBackClick:R})}const Yo=e=>`/${e}/cards`,Ko={containerWidth:new Fa(100,58)},Wo=({appContent:e})=>{const n=Ta(),t=pe(),a=de(),{cardId:s}=Me(),b=Ce(),{useDynamicConfig:f}=le(),[g,_]=r.useState(!1),[i,m]=r.useState(!1),[R,D]=r.useState(!1),[d,j]=r.useState(!1),P=re.getSignedInUser();if(P==null)throw Error("Can't access onboarding card page without signing in...");const B=o(E=>fe(E));if(s==null)throw Error("Empty card id is not valid...");const{configValue:p}=f(ze.zeniCardsConfig),h=p.max_charge_card_activation_attempts_by_card_id,w=o(E=>Ds(E,s)),u=w.chargeCard,T=o(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:k}=le(),{isFeatureEnabled:M}=k(K.isChargeCardFeatureEnabled),{isFeatureEnabled:A}=k(K.isDebitCardFeatureEnabled),y=Te(A,B),L=Re({isDebitCardFeatureEnabled:A,isBankingOnlyTenant:y}),l=!!B.companyChargeCardInfo?.info?.isChargeCardEnabled,C=B.userRole.includes("charge_card_user"),N=we(B),G=ve(B),O=B.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,U=xe({isCardsOnlyTenant:N,isChargeCardFeatureEnabled:M,isBookKeepingTenant:G,isDebitCardProductVisible:L,chargeCardsCreditAccountLimit:O}),z=!C&&U&&l;r.useEffect(()=>{g===!1&&T!=="In-Progress"&&T!=="Completed"&&(t(Ja()),_(!0)),i===!1&&w.fetchState==="Not-Started"&&(m(!0),t(ka(s,z,U)))},[i,w.fetchState,g,T]);const Z=u?.type.code==="business_physical_credit_card"||u?.type.code==="business_physical_debit_card";r.useEffect(()=>{if(w.fetchState==="Completed"){if(R===!1&&(Z===!1||Z&&u?.status?.code!=="inactive"||u?.cardHolderUserId!==P.userId)){const E=Ae(B.tenantEmailDomain,s,P,u,!0),V=ye(b.state?.pathnameStackToGoBack,b.pathname);a(E,{state:{pathnameStackToGoBack:V}})}else if(R&&w.isRefreshingViewInBackground===!1&&u?.status?.code==="active"){t(_s({chargeCardId:s}));const E=Ae(B.tenantEmailDomain,s,P,u,!0),V=ye(b.state?.pathnameStackToGoBack,b.pathname);t(Xa()),a(E,{state:{pathnameStackToGoBack:V}})}}},[w.fetchState,u?.type.code,R,w.isRefreshingViewInBackground]);const I=re.getZeniOtpTokenForCardHolder(s),x=o(E=>Nn(E.userState,P.userId)),Y=()=>{u?.status?.code!=="active"&&t(ga(s,!0))};r.useEffect(()=>{w.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&u?.cardActivationAttemptHistory.some(E=>E.statusCode==="success")===!0&&R===!1&&(setTimeout(Y,3e3),D(!0))},[w.updatePhysicalChargeCardAttemptFetchState.fetchState,u?.cardActivationAttemptHistory]);const q=E=>{j(E)};if(T!=="Completed"||u==null)return c.jsx(va,{fetchState:"In-Progress"});if(u.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(x?.phone==null)throw Error("Can't access user phone number.");return c.jsxs(Jo,{children:[c.jsx(Ie,{isAppContentDrawerOpen:d,handleDrawerToggle:q}),c.jsx(qo,{cardId:s,card:u,shippingAddressId:u.shippingAddressId,phone:x.phone,signedInUser:P,isSandboxEnv:Ft(),chargeCardDetailState:w,signedInUserToken:I,navigate:a,currentTenant:B,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(Qo,{windowSize:n,children:e}):null]})},qo=De(function(e,{chargeCardDetailState:n,shippingAddressId:t,location:a,cardId:s}){const b=Ps(e.addressState,t);if(b==null)throw Error("Can't access shippingAddress.");const f=Vn(e,s),g=n.updateStatus,_=la(e,!1,!1,!1);let i=!1;_.fetchState==="Completed"&&_.cards.length<=1&&(i=!0);const m=a.state?.message==="comingFromV2UrlPath";return{showActivatePage:n.chargeCard?.providerCardCreateTime!=null&&n.chargeCard.providerCardCreateTime.add(24,"h").isBefore(ws())||m,showMenuIcon:i,shippingAddress:b,vgsVaultId:st.cardVaultId,twoFAView:f,activationWaitStatus:g,isRefreshingViewInBackground:n.isRefreshingViewInBackground}},function(e,n){const{navigate:t,cardId:a,location:s,currentTenant:b,chargeCardDetailState:f}=n,g=f.chargeCard?.cardProviderID,{tenantEmailDomain:_}=b;return{onGetOtp:i=>{g!=null&&e(tt(i,"ChargeCardHolder",a))},onUpdatePhysicalChargeCardAttempt:i=>{e(Ts(a,i))},onResendOtp:i=>{g!=null&&e(at(i,"ChargeCardHolder",a))},onVerifyOtp:(i,m)=>{g!=null&&e(et(i,m,"ChargeCardHolder",a))},onVerifyOtpSuccess:i=>{i!=null&&re.saveZeniOtpTokenForCardHolder(i,a)},onCVVActivateSuccess:()=>{e(vs({chargeCardId:a}))},onBackClick:()=>{const i=_e(s.state?.pathnameStackToGoBack),m=i.poppedPathname==null||i.poppedPathname.includes("onboard")===!0?ea(_):i.poppedPathname;t(m,{state:{pathnameStackToGoBack:i.newStack}})}}})(to),Qo=Ne.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
width: ${e=>`${Ko.containerWidth.value(e.windowSize)}%`};
|
|
5
|
-
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
6
|
-
`,Jo=Ne.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
|
-
`,Wa=ua.getLocalizedStrings().dateFormat,Xo={overlayWidth:new Fa(100,100,58)},Or=[Br,it],ei=new Set(Or),ai=De(function(e,n){const t=n.currentTenant?.companyId;return{plaidConnectionDetails:Bs(e,t,"zeni_accounts","external_account").plaidConnectionDetails,depositAccountListView:Ls(e.depositAccountState,e.depositAccountListState)}},function(e,n){const{navigate:t,currentTenant:a,hasZeniAccountsAdminAccess:s,isZeniAccountsUser:b,isCashbackInfoFetchStateCompleted:f,isCreditCardInfoFetchStateCompleted:g,isDebitCardInfoFetchStateCompleted:_,controllerEmails:i,paymentDetails:m,productInformation:R,cashbackInformation:D,paymentSourceInformation:d,creditAccountInformation:j,debitAccountInformation:P,paymentInitiatedDate:B,sourcePage:p}=n,{tenantEmailDomain:h}=a,w=()=>{e($n(!0));const u=Xe(a);u!=null&&u!==""&&e(Pa(u,!0,!0)),e(qe(!0))};return{onBackNavigation:()=>{if(f&&g&&_&&D!=null&&J.trackCardsPayEarlyFormClick(i,R,D,"Back",m.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:m.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:m.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:m.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:m.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:B?.add(3,"day").format(Wa.visual.MMMDCommaYYYYformat),paymentInitiatedDate:B?.format(Wa.visual.MMMDCommaYYYYformat)},d,j,P),p==="cardPaymentHistory")n.closeDrawerHandler(!0),e(zn());else{const u=ea(h);t(u)}},onUpdatePaymentAccountStatus:(u,T,k)=>{e(js(u,T,"bill_pay","bill_pay_detail",k))},onEstablishConnectionSuccess:()=>{e(Pa(a.companyId,!0))},onFetchLinkTokenClick:u=>{e(Us("external_account",u))},onEstablishConnectionClick:u=>{e(Os(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=>{ei.has(u)&&w()},onPusherSubscribed:w}})(ct(no)),Ht=({isPaymentDrawerOpen:e,closeDrawerHandler:n,pageName:t,creditAccountSpentAmount:a,productInformation:s,sourcePage:b,creditAccountInformation:f,debitAccountInformation:g,cashbackInformation:_,isDebitCardInfoFetchStateCompleted:i,isCreditCardInfoFetchStateCompleted:m,isCashbackInfoFetchStateCompleted:R,paymentInitiatedDate:D,retryRepayment:d})=>{const j=de(),{useDynamicConfig:P}=le(),{configValue:B}=P(ze.zeniAccountsConfig),p=Fs(B),h=o(F=>Hn(F)),{creditAccount:w}=o(F=>ia(F)),u=o(F=>fe(F)),T=Rt(),k=Ta(),M=pe(),A=re.getSignedInUser(),y=Fe(),[L,l]=r.useState(!1),[C,N]=r.useState(!1),{configValue:G}=P(ze.zeniCardsConfig),O=G.credit_card_auto_pay_threshold_by_company_id?.[u.companyId]??G.default_credit_card_auto_pay_threshold??Ao,U=Gn(y?.loggedInUserRoleMap),z=Rs(y?.loggedInUserRoleMap),Z=!!u.companyZeniAccountInfo?.info?.isZeniAccountEnabled,I=o(F=>wa(F,u.companyId)),x=I.companyChargeCardInfo?.primaryFundingAccount,Y=I.allFundingAccounts.find(F=>F.id===x?.accountId),q=o(F=>ca(F,u.companyId)),E=oa(q.controllers);r.useEffect(()=>{if(h.fetchState!=="Completed"&&h.fetchState!=="In-Progress"&&M($n()),h.fetchState==="Completed"&&!C){const F=u.companyChargeCardInfo?.info?.primaryFundingAccount?.accountId,v=h.transferFromAccounts.find(W=>W.id===F);let ee;if(b==="cardPaymentHistory"&&d){const W=d.paymentAccountId!=null?h.transferFromAccounts.find(ke=>ke.id===d.paymentAccountId):void 0;ee={amount:d.amount,isAutoRepayment:u.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,idempotencyKey:pn(),transferFrom:W??v}}else ee={amount:{amount:w.balance.amount+w.hold.amount,currencyCode:w.balance.currencyCode,currencySymbol:w.balance.currencySymbol},isAutoRepayment:u.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,idempotencyKey:pn(),transferFrom:v};M(un(ee)),N(!0)}},[h.fetchState,C,b,d,h.transferFromAccounts,u.companyChargeCardInfo?.info?.primaryFundingAccount?.accountId,u.companyChargeCardInfo?.info?.isAutoPayEnabled,w.balance.amount,w.balance.currencyCode,w.balance.currencySymbol,w.hold.amount,M]);const V={isZeniCheckingEnabled:u.companyZeniAccountInfo?.info?.isZeniAccountEnabled??!1,isZeniCheckingPaymentSource:Y?.accType==="depositAccount",creditCardPaymentSourceAccountName:Y?.label,creditCardPaymentSourceAccountType:Y?.accType,creditCardPaymentSourceLastFourDigits:Y?.accountLast4,creditCardPaymentSourceBalance:Y?.accountBalance?.available?.amount??0};if(r.useEffect(()=>{I.fetchState!=="Completed"&&I.fetchState!=="In-Progress"&&M(Pa(u.companyId,!0))},[I.fetchState]),r.useEffect(()=>{h.updateStatus==="Completed"&&_!=null&&R&&m&&i&&J.trackCardsPayEarlyPayNowClick(E,s,_,h.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:h.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:h.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:h.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:h.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:D?.add(3,"day").format(Wa.visual.MMMDCommaYYYYformat),paymentInitiatedDate:D?.format(Wa.visual.MMMDCommaYYYYformat)},V,f,g)},[h.updateStatus,_,R,m,i,D]),r.useEffect(()=>{h.fetchState==="Completed"&&_!=null&&R&&m&&i&&!L&&e&&C&&_!=null&&(J.trackCardsPayEarlyFormView(E,s,_,t,u.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,w.balance.amount,V,f,g),l(!0))},[h,R,m,i,L,e,C]),A==null)throw Error("Can't access invite people page without signing in...");const Q=()=>{n(!0),M(zn())},X=Xe(u),S={events:e?Ca(X,Or):[],eventCallback:(F,v,ee)=>{ee.onEventReceived(F)},onSubscribed:F=>{F.onPusherSubscribed()}};return c.jsx(c.Fragment,{children:c.jsx(yr,{onClose:()=>{Q()},anchor:"right",transitionDuration:250,open:e,PaperProps:{style:{width:Xo.overlayWidth.valuePercentage(k),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:T.colors.black,opacity:.75,cursor:"pointer"}}},children:c.jsx(ti,{onClick:F=>F.stopPropagation(),children:c.jsx(ai,{...S,closeDrawerHandler:n,navigate:j,paymentDetails:h,creditAccountSpentAmount:a,onTransferClick:()=>{R&&m&&i&&_!=null&&J.trackCardsPayEarlyFormClick(E,s,_,"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},V,f,g),M(xs({companyId:u.companyId}))},onDismissClick:Q,onSaveChangesToLocalStore:F=>{M(un(F))},currentTenant:u,hasZeniAccountsAdminAccess:U,isZeniAccountsUser:z,isZeniAccountSetupEnabled:Z,productInformation:s,sourcePage:b,controllerEmails:E,autoPayThreshold:O,paymentSourceInformation:V,creditAccountInformation:f,debitAccountInformation:g,cashbackInformation:_,isCashbackInfoFetchStateCompleted:R,isCreditCardInfoFetchStateCompleted:m,isDebitCardInfoFetchStateCompleted:i,paymentInitiatedDate:D,maxInsuredAmount:p.maxInsuredAmount})})})})},ti=Ne(Eo)`
|
|
15
|
-
display: flex;
|
|
16
|
-
min-height: 100%;
|
|
17
|
-
flex-direction: column;
|
|
18
|
-
`,Gt=e=>e!=null&&typeof e=="object"?e:null,ie=e=>typeof e=="string"?e:void 0,Ue=e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,qa=e=>e!=null&&typeof e=="object"&&typeof e.code=="string"&&typeof e.name=="string",ft=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"&&!!qa(n.transaction_status)&&!!qa(n.transaction_type)},$t=(e,n)=>{const t=e?.card_status;if(!qa(t))return null;const a=e?.is_locked_by_admin;return{cardId:n,cardStatus:t,isLockedByAdmin:typeof a=="boolean"?a:void 0}},kt=[vr,Tr,Fr,Rr,xr,ma,jt,it,Mt,Nt,Vt],Ur=[La,Ba],ni=new Set([...kt,...Ur]),gt=ua.getLocalizedStrings().dateFormat,ri=De(function(e,n){const{includeCreditAccountInfo:t,cardId:a,signedInUserToken:s,isChargeCardFeatureEnabled:b}=n,f=re.getSignedInUser(),g=e.tenantState.currentTenantId,_={userId:f?.userId??"",sessionId:f?.zeniSessionId??"",tenantId:g??""},i=Dt(e,a,t,b),m=Ys(e,a),R=Ks(e);return{chargeCardDetailView:i,chargeCardsRecurringExpensesState:m,vgsVaultId:st.cardVaultId,transactionAttachmentsEndpointToFetch:`${It}/card_transaction_attachments`,transactionAttachmentEndpointToDownload:`${It}/card_transaction_attachment`,authParams:_,isSnackbarOpen:R.isSnackbarOpen,cardsEndPoint:`${gr.cardMicroServiceBaseUrl}`,signedInUserToken:i.twoFAView.token??s}},function(e,n){const{cardId:t,currentTenant:a,navigate:s,location:b,cardProviderId:f,includeCreditAccountInfo:g,setIsPaymentOpen:_,controllerEmails:i,productInformation:m,cashbackInformation:R,primaryFundingAccountDetails:D,creditAccountInformation:d,debitAccountInformation:j,isChargeCardFeatureEnabled:P}=n,{tenantEmailDomain:B}=a;return{onEventReceived:(p,h)=>{(({event:w,data:u,cardId:T,dispatch:k,subscribedEvents:M})=>{const A=Gt(u);switch(w){case La:case Ba:return void k(_a(!0));case vr:{const y=ie(A?.card_id);if(y==null||y!==T)return;const L=ie(A?.transaction_id),l=A?.transaction_status;return L!=null&&qa(l)?void k(zs({transactionId:L,transactionStatus:l})):void k(na(T,null,null,!0))}case ma:{const y=ie(A?.card_id)??T;if(y!==T)return;const L=$t(A,y);return L!=null?void k(Pt(L)):void k(ga(T,!0))}case jt:{const y=ie(A?.card_id)??T;if(y!==T)return;const L=ie(A?.currency_code),l=ie(A?.currency_symbol),C=Ue(A?.balance);return L!=null&&l!=null&&C!=null?(k($s({cardId:y,currencyCode:L,currencySymbol:l,balance:C,hold:Ue(A?.hold),dailyPurchaseSpends:Ue(A?.daily_purchase_spends),monthlyPurchaseSpends:Ue(A?.monthly_purchase_spends),dailyWithdrawals:Ue(A?.daily_withdrawals),monthlyWithdrawals:Ue(A?.monthly_withdrawals)})),void k(qe(!0))):(k(ga(T,!0)),void k(qe(!0)))}case it:{const y=ie(A?.currency_code),L=ie(A?.currency_symbol),l=Ue(A?.available_amount),C=Ue(A?.balance_amount);return y!=null&&L!=null&&l!=null&&C!=null?void k(Gs({currencyCode:y,currencySymbol:L,available:l,balance:C,hold:Ue(A?.hold_amount),cashback:Ue(A?.cashback_amount)})):void k(qe(!0))}case Tr:{const y=ie(A?.card_id)??T;if(y!==T)return;const L=A?.transaction;return ft(L)?void k(Hs({cardId:y,transaction:L})):void k(na(T,null,null,!0))}case Fr:{const y=ie(A?.card_id)??T;if(y!==T)return;const L=A?.transaction;return ft(L)?void k(Vs({cardId:y,declineReason:ie(A?.decline_reason),transaction:L})):void k(na(T,null,null,!0))}case Rr:{const y=ie(A?.card_id)??T;if(y!==T)return;const L=A?.transaction;return ft(L)?void k(Ns({cardId:y,transaction:L})):void k(na(T,null,null,!0))}case xr:{const y=ie(A?.card_id)??T;if(y!==T)return;const L=ie(A?.transaction_id),l=A?.attachment_file_paths;return L!=null&&Array.isArray(l)&&l.every(C=>typeof C=="string")?void k(Ms({cardId:y,transactionId:L,attachmentFilePaths:l})):void k(na(T,null,null,!0))}case Mt:case Nt:case Vt:{const y=ie(A?.card_id);if(y==null||y!==T)return;k(ga(T,!0))}}})({event:p,data:h,cardId:t,dispatch:e,subscribedEvents:ni})},onPusherSubscribed:()=>{e(ga(t,!0)),e(na(t,null,null,!0)),e(qe(!0))},onReloadTransactions:()=>{e(ka(t,g,P))},onFetchChargeCardTransactionList:(p,h)=>{e(na(t,p,h))},onUpdateScrollYOffset:p=>{},onGetOtp:p=>{f!=null&&e(tt(p,"ChargeCardHolder",t))},onResendOtp:p=>{f!=null&&e(at(p,"ChargeCardHolder",t))},onVerifyOtp:(p,h)=>{f!=null&&e(et(p,h,"ChargeCardHolder",t))},onVerifyOtpSuccess:p=>{p!=null&&re.saveZeniOtpTokenForCardHolder(p,t)},onColorCodeChange:p=>{e(ec(t,p))},onLockChargeCard:(p,h)=>{e(er(p,t,h))},onUnlockChargeCard:p=>{e(Xn(p,t))},onCloseChargeCard:p=>{e(Jn(t,p))},onFetchChargeCardsRecurringExpenses:()=>{e(Qn([t]))},updateChargeCardName:(p,h)=>{e(qn(p,t,h))},updateChargeCardTransactionAttachments:(p,h)=>{h!=null&&e(Xs({transactionId:p,data:h}))},updateChargeCardTransactionUploadReceiptsFetchStatus:(p,h,w,u)=>{e(Js({chargeCardId:h,transactionId:p,fetchState:w,error:u}))},updateChargeCardTransactionReceiptsShowTick:(p,h,w)=>{e(Qs({chargeCardId:h,transactionId:p,shouldShowTick:w}))},onChargeCardRevokeInviteClick:()=>{e(Wn(t))},updateChargeCardTransactionIsViewReceiptClicked:(p,h,w)=>{e(qs({chargeCardId:h,transactionId:p,isViewReceiptClicked:w}))},onChargeCardTransactionRowClick:(p,h)=>{const w=ye(b.state?.pathnameStackToGoBack,b.pathname);s(`../../transaction/${p}/${h}`,{state:{pathnameStackToGoBack:w}})},onBackClick:()=>{const p=_e(b.state?.pathnameStackToGoBack),h=ea(B);s(h,{state:{pathnameStackToGoBack:p.newStack,message:"comingFromCardDetail"}})},removeSnackbar:()=>{e(Ws())},onUpdateDebitCardPinAttempt:p=>{e(Kn(t,p)),p==="success"&&e(Qe({messageSection:"update_debit_card_pin_attempt",messageText:"success",type:"success",showStatusIcon:!0}))},onUploadReceiptComplete:(p,h)=>{p?e(Qe({messageSection:"charge_card_receipt_upload",messageText:"success",type:"success",showStatusIcon:!0})):h!=null&&e(Qe({messageSection:"charge_card_receipt_upload",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"_api-error_",variableValue:h.message}]}))},updateSpendLimit(p,h,w,u){e(Yn(p,h,w.code,u))},shouldOpenCreditCardPaymentDrawer(p){p&&R!=null&&J.trackCardsPayEarlyClick(i,m,R,"Card Detail","Text Button","Pay Now",{isZeniCheckingEnabled:a.company?.companyZeniAccountInfo.isZeniAccountEnabled??!1,isZeniCheckingPaymentSource:D?.accType==="depositAccount",creditCardPaymentSourceAccountName:D?.label,creditCardPaymentSourceAccountType:D?.accType,creditCardPaymentSourceLastFourDigits:D?.accountLast4,creditCardPaymentSourceBalance:D?.accountBalance?.available?.amount??0},d,j),_(p)}}})(ct(so));function si(){const e=de(),n=pe(),t=Ce(),{cardId:a}=Me(),[s,b]=r.useState(!1),[f,g]=r.useState(!1),{useDynamicConfig:_}=le(),i=re.getSignedInUser(),m=o(H=>fe(H)),R=o(H=>Qa(H).firstViewAfterActivation),D=o(H=>H.classListState.fetchState),{configValue:d}=_(ze.documentAiReceiptMaxSizeLimitBytesConfig),{configValue:j}=_(ze.zeniCardsConfig),P=j.enable_card_controls_for_company_ids,B=j.is_card_controls_enabled_for_all_tenants===!0||Array.isArray(P)&&P.includes(m.companyId),[p,h]=r.useState(!1),[w,u]=r.useState(!1),{useFeatureGate:T}=le(),{isFeatureEnabled:k}=T(K.isChargeCardFeatureEnabled),{isFeatureEnabled:M}=T(K.isDebitCardFeatureEnabled),A=Te(M,m),y=Re({isDebitCardFeatureEnabled:M,isBankingOnlyTenant:A}),{isFeatureEnabled:L}=T(K.isEarlyPayFeatureEnabled),{isFeatureEnabled:l}=T(K.isCardsCommentingEnabled),C=ve(m),N=we(m),G=m.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,O=xe({isCardsOnlyTenant:N,isChargeCardFeatureEnabled:k,isBookKeepingTenant:C,isDebitCardProductVisible:y,chargeCardsCreditAccountLimit:G}),U=!!m.companyDebitCardInfo?.info?.isDebitCardEnabled,z=!!m.companyChargeCardInfo?.info?.isChargeCardEnabled,Z=!m.userRole.includes("charge_card_user")&&O&&z;if(a==null)throw Error("Empty card id is not valid...");const I=o(H=>wa(H,m.companyId)),{creditAccount:x,creditAccountRepayment:Y}=o(H=>ia(H)),q=re.getZeniOtpTokenForCardHolder(a),E=o(H=>Dt(H,a,Z,O)),{isAiCfoAccessEnabled:V,onAskAiCfoClick:Q}=Ra({mobileExploreReferrer:"Card Detail"});Tt({isDataReady:E.fetchState==="Completed"});const X=o(H=>da(H)),S=E.chargeCard,F=Fe(),v=Pe(F?.loggedInUserRoleMap),ee=S?.type.code==="business_physical_debit_card"||S?.type.code==="business_virtual_debit_card",W=S?.type.code==="business_physical_debit_card"||S?.type.code==="business_physical_credit_card",ke=S?.type.code==="business_virtual_debit_card"||S?.type.code==="business_virtual_credit_card",be=S?.type.code==="business_virtual_debit_card",ge=xa(O,z,v,x,Y),ae=Ir(ee,E),ue=Lt(v,X),oe=Je(O,y,U,z),te=E.depositAccountLimitFetchState.fetchState!=="Completed"&&E.depositAccountLimitFetchState.fetchState!=="In-Progress",Ze=o(H=>ca(H,m.companyId)),Ee=oa(Ze.controllers),ne=o(H=>S?.cardCreatedByUser?.userId!=null?za(H.userRoleState,S?.cardCreatedByUser?.userId):void 0),Ye=o(H=>ne?.accountingClassIDs[0]!=null?Za(H.classState,{classId:ne?.accountingClassIDs[0],reportId:"class_list"}):void 0),Be=o(H=>S?.cardHolderUser?.userId!=null?za(H.userRoleState,S?.cardHolderUser?.userId):void 0),ce=o(H=>Be?.accountingClassIDs[0]!=null?Za(H.classState,{classId:Be?.accountingClassIDs[0],reportId:"class_list"}):void 0),Ea=m?.userRole,pa=o(H=>la(H,!1,y,k).revokeCardInvite),ha=ya(pa.saveStatus.fetchState);if(r.useEffect(()=>{if(ha==="In-Progress"&&pa.saveStatus.fetchState==="Completed"){const H=ea(m.tenantEmailDomain);e(H)}},[ha,pa.saveStatus.fetchState,e,m.tenantEmailDomain]),r.useEffect(()=>{R&&s===!1&&ke&&(b(!0),setTimeout(()=>{n(Ya()),be&&n(Qe({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[R,s,ke,be]),r.useEffect(()=>{p||E.fetchState==="Completed"||E.fetchState==="In-Progress"||a==null||(h(!0),n(ka(a,Z,O,!1)))},[p,E,a,n]),r.useEffect(()=>{!w&&E.fetchState==="Completed"&&E.chargeCard?.connectedAccountId!=null&&ee&&te&&v&&(u(!0),n(Zn({depositAccountId:E.chargeCard?.connectedAccountId})))},[w,E,n,te,v]),r.useEffect(()=>{X.fetchState!=="Completed"&&X.fetchState!=="In-Progress"&&v&&n(_a()),D!=="Completed"&&D!=="In-Progress"&&n(Mn()),E.transactionStatistics.fetchState!=="Completed"&&E.transactionStatistics.fetchState!=="In-Progress"&&n(Zs({chargeCardId:a})),I.fetchState!=="Completed"&&I.fetchState!=="In-Progress"&&n(Pa(m.companyId,!0))},[X.fetchState,n,v,D,E.transactionStatistics.fetchState,I.fetchState]),r.useEffect(()=>{if(!(E.fetchState!=="Completed"||O&&x.fetchState!=="Completed"||S==null||E.transactionStatistics.fetchState!=="Completed"||ee&&v&&E.depositAccountLimitFetchState.fetchState!=="Completed")){const H=S.type.code.includes("physical"),he=H?S.cardActivationAttemptHistory[0]?.timestamp:S.createTime;J.trackCardsCardDetailView(Ee,oe,{cardId:a,cardName:S.cardName,cardType:S.type.code.includes("credit")?"credit":"debit",cardCategory:H?"physical":"virtual",cardLimit:ba(S.limit.amount),cardLastFourDigits:S.accountLast4,cardStatus:S.status.code,cardAssignedDate:S.createTime?.format(gt.analytics.MMMDashDDDashYYYYFormat),cardIssuedDate:S.providerCardCreateTime?.format(gt.analytics.MMMDashDDDashYYYYFormat),cardActivatedDate:he?.format(gt.analytics.MMMDashDDDashYYYYFormat),cardLimitFrequency:S.creditLimitFrequency.name,cardSpentAmount:ba(S.balance.amount),cardAvailableLimit:ba(S.available.amount),cardUtilizationPercent:S.limit.amount>0?Math.round((S.limit.amount-S.available.amount)/S.limit.amount*100):0,cardUtilizationAmount:ba(S.limit.amount-S.available.amount),totalNumberOfDeclinedTransactions:E.transactionStatistics.statistics.totalNumberOfDeclinedTransactions,numberOfDeclinedTransactionsCurrentMonth:E.transactionStatistics.statistics.numberOfDeclinedTransactionsCurrentMonth,totalNumberOfPaidTransactions:E.transactionStatistics.statistics.totalNumberOfPaidTransactions,numberOfPaidTransactionsCurrentMonth:E.transactionStatistics.statistics.numberOfPaidTransactionsCurrentMonth,totalNumberOfCanceledTransactions:E.transactionStatistics.statistics.totalNumberOfCanceledTransactions,numberOfCanceledTransactionsCurrentMonth:E.transactionStatistics.statistics.numberOfCanceledTransactionsCurrentMonth,totalNumberOfAuthorizedTransactions:E.transactionStatistics.statistics.totalNumberOfAuthorizedTransactions,numberOfAuthorizedTransactionsCurrentMonth:E.transactionStatistics.statistics.numberOfAuthorizedTransactionsCurrentMonth,totalNumberOfTransactionsWithReceipts:E.transactionStatistics.statistics.totalNumberOfTransactionsWithReceipts,numberOfTransactionsWithReceiptsCurrentMonth:E.transactionStatistics.statistics.numberOfTransactionsWithReceiptsCurrentMonth},{cardIssuedByName:yt(S.cardCreatedByUser,!1),cardIssuedByEmail:S.cardCreatedByUser?.email,cardIssuedByUserId:S.cardCreatedByUser?.userId,cardIssuedByRole:ne?.userRoles,cardIssuedByDepartment:Ye?.className},{cardholderName:yt(S.cardHolderUser,!1),cardholderEmail:S.cardHolderUser?.email,cardholderRole:Be?.userRoles,cardholderUserId:S.cardHolderUser?.userId,cardholderDepartment:ce?.className},ge,ae)}},[E.fetchState,E.depositAccountLimitFetchState.fetchState,E.transactionStatistics.fetchState,x.fetchState,v]),i==null)throw Error("Can't access card detail page without signing in...");const aa=Xe(m),Aa=v?[...kt,...Ur]:kt,lt={events:Ca(aa,Aa),eventCallback:(H,he,Le)=>{Le.onEventReceived(H,he)},onSubscribed:H=>{H.onPusherSubscribed()}},ut=()=>{if(a!=null&&S!=null){const{ownerName:H,cardName:he,utilisation:Le,limit:Ve,frequency:He,cardColor:Ge}=bt(S),$e=S.cardHolderUserId===i.userId;J.trackCardsDetailPageViewed(a,H,he,Le,Ve,He,Ge,$e)}};r.useEffect(()=>{if(E.fetchState==="Completed"){const H=E.chargeCard;if(H?.status.code==="inactive"||ee&&H?.isPinSet===!1||W&&R){const he=Ae(m.tenantEmailDomain,a,i,S,R);e(he)}}},[E.fetchState]);const me=(H,he)=>{if(a!=null&&S!=null){const{ownerName:Le,cardName:Ve,utilisation:He,limit:Ge,frequency:$e}=bt(S),ta=S.cardHolderUserId===i.userId;J.trackCardsDetailPageClicked(a,Le,Ve,He,Ge,$e,H,ta,he)}},Oa=(H,he)=>{if(a!=null&&S!=null){const{ownerName:Le,cardName:Ve,utilisation:He,limit:Ge,frequency:$e}=bt(S),ta=S.cardHolderUserId===i.userId;J.trackCardsVerifyPopUpClick(a,Le,Ve,He,Ge,$e,H,ta,he)}},Da=x.balance.amount+x.hold.amount,mt=m.companyChargeCardInfo?.info?.primaryFundingAccount,Ua=I.allFundingAccounts.find(H=>H.id===mt?.accountId),ja=E.chargeCard!=null,Ma=E.depositAccountLimit!=null;return E.fetchState!=="Error"||ja?!ja&&(E.fetchState==="In-Progress"||E.fetchState==="Not-Started")||pa.saveStatus.fetchState==="In-Progress"||!Ma&&ee&&v&&E.depositAccountLimitFetchState.fetchState!=="Completed"?c.jsx(ro,{}):c.jsxs(c.Fragment,{children:[c.jsx(rt,{showConfetti:R}),E.fetchState==="Completed"?c.jsx(xt,{analytics:J,onLoad:ut}):null,f===!0?c.jsx(Ht,{closeDrawerHandler:()=>g(!1),isPaymentDrawerOpen:f,pageName:"Card Detail",sourcePage:"cardDetailPage",productInformation:oe,creditAccountInformation:ge,debitAccountInformation:ae,cashbackInformation:ue,creditAccountSpentAmount:Da,isDebitCardInfoFetchStateCompleted:!ee||!v||E.depositAccountLimitFetchState.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!O||x.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!v||X.fetchState==="Completed",paymentInitiatedDate:Y.initiatedRepaymentDate}):null,c.jsx(ri,{...lt,hideSorting:!0,onColumnSortConfigChanged:()=>{},onFireVerifyPopOnClickAnalytics:Oa,onFireOnClickAnalytics:me,isSandboxEnv:Ft(),signedInUser:i,location:t,navigate:e,setIsPaymentOpen:g,cardIssuedByRoles:ne?.userRoles,cardIssuedByDepartmentName:Ye?.className,cardHolderRoles:Be?.userRoles,cardHolderDepartmentName:ce?.className,loggedInUserRole:Ea,isChargeCardFeatureEnabled:O,isDebitCardFeatureEnabled:y,isDebitCardSetupEnabled:U,isChargeCardSetupEnabled:z,isCardControlsEnabled:B,isEarlyPayEnabled:L,controllerEmails:Ee,chargeCardCashbackDetailState:X,productInformation:oe,creditAccountInformation:ge,debitAccountInformation:ae,cashbackInformation:ue,classListFetchState:D,primaryFundingAccountDetails:Ua,currentTenant:m,cardProviderId:E.chargeCard?.cardProviderID,cardId:a,creditAccount:x,creditAccountRepayment:Y,includeCreditAccountInfo:Z,signedInUserToken:q,appleWalletLink:"shoebox://",googleWalletLink:"https://www.android.com/payapp/",documentAiReceiptMaxSizeLimit:d.documentAiReceiptMaxSizeLimitBytes!=null?d.documentAiReceiptMaxSizeLimitBytes:9437184,isAiCfoAccessEnabled:V,onAskAiCfoClick:Q,isCardsCommentingEnabled:l})]}):c.jsx(ot,{})}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:ci,subheadline:oi,pageTitle:ii}}}}=ua.getLocalizedStrings(),jr=[ma,it,Lr,Ba,La,dt,Vt,Go,Mt,Nt,jt],di=new Set(jr),Et=Bt((e,n,t,a)=>{e(sa(n,t,a,!0))},400),li=Ne.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
|
-
`,ui=De(function(e,n){const t=la(e,n.includeCreditAccountDebitSummaryAndCashbackInfo,n.isDebitCardFeatureEnabled&&n.isDebitCardSetupEnabled,n.isChargeCardFeatureEnabled&&n.isChargeCardSetupEnabled);return{chargeCardListView:t,rowActionView:sc(e),bulkActionView:cc(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:f,includeCreditAccountDebitSummaryAndCashbackInfo:g,isChargeCardFeatureEnabled:_,isCreditCardProductVisibleForExpressInterest:i,isChargeCardSetupEnabled:m,isDebitCardFeatureEnabled:R,isDebitCardSetupEnabled:D,isDebitCardTOSAccepted:d,isChargeCardTOSAccepted:j,controllerEmails:P,depositAccountListWithDebitCardIssued:B,primaryFundingAccountDetails:p,chargeCardSetUpViewFetchState:h,productInformation:w,cashbackInformation:u,creditAccountInformation:T,debitAccountInformation:k,updatePayNowInfoTooltip:M,isUserHasCardsAdminLevelAccess:A}=n,{tenantEmailDomain:y}=a,{cards:L}=f;return{onChargeCardRowClick:(l,C)=>{const N=Er(L,l);let G;N!=null&&((U=>{const z=U.limit.amount-U.available.amount,Z=`${U.cardHolderUser?.firstName.toLowerCase()} ${U.cardHolderUser?.lastName.toLowerCase()}`,I=U.cardName,x=U.department?.className??"",Y=U.limit.amount,q=U.creditLimitFrequency.name;J.trackCardsListRowClicked(Z,I,x,z,Y,q,b.userId===U.cardHolderUserId)})(N),ra(R,D,B)&&J.trackCardsCardListRowClick(P,w,"Card Row Item","row_clicked",C+1,{cardOwner:yt(N.cardHolderUser,!1),cardName:N.cardName,cardType:N.type.code.includes("credit")?"credit":"debit",cardStatus:N.status.code,cardUtilizationAmount:ba(N.limit.amount-N.available.amount),cardUtilizationPercent:N.limit.amount>0?Math.round((N.limit.amount-N.available.amount)/N.limit.amount*100):0,cardLimit:ba(N.limit.amount)},u,T,k)),G=N?.status.code==="request_on_hold"&&b.userId===N.cardHolderUserId?Ar(y):Ae(y,l,b,N);const O=ye(s.state?.pathnameStackToGoBack,s.pathname);t(G,{state:{pathnameStackToGoBack:O}})},onFetchChargeCardsRecurringExpenses:l=>{e(Qn(l))},onFetchDepositAccountLimit:l=>{e(Zn({depositAccountId:l}))},onChargeCardResendInviteClick:l=>{e(pc(l))},onChargeCardRevokeInviteClick:l=>{e(Wn(l))},onLockChargeCardList:(l,C)=>{e(Cc(l,C))},onUnlockChargeCardList:l=>{e(mc(l))},onCloseChargeCardList:(l,C)=>{e(uc(l,C))},onRevokeChargeCardList:l=>{e(lc(l))},updateChargeCardListSpendLimit(l,C,N){e(dc(l,C,N.code))},onLockChargeCard:(l,C)=>{e(er(A,l,C))},onUnlockChargeCard:l=>{e(Xn(A,l))},onCloseChargeCard:(l,C)=>{e(Jn(l,C))},onUpdateSpendLimit(l,C,N,G){e(Yn(l,C,N.code,G))},updateChargeCardName:(l,C)=>{e(qn(A,l,C))},onClickSetupIcon:()=>{J.trackCardsListPageClicked("settings"),ra(R,D,B)&&u!=null&&J.trackCardsSettingsClick(P,w,u,T,k);const l=_o(y),C=ye(s.state?.pathnameStackToGoBack,s.pathname);t(l,{state:{pathnameStackToGoBack:C}})},onIssueCardClick:()=>{J.trackCardsListPageClicked("new card"),ra(R,D,B)&&u!=null&&J.trackCardsNewCardClick(P,w,u,"New Button","card_creation_initiated","Card List",T,k);const l=mi(y),C=ye(s.state?.pathnameStackToGoBack,s.pathname);t(l,{state:{pathnameStackToGoBack:C}})},onColumnSortConfigChanged:(l,C)=>{ra(R,D,B)&&u!=null&&J.trackCardsCardListSortClick(P,w,u,"Sort Icon","sort",l,C==="ascending"?"ASC":"DESC","Cards List",T,k),e(St({uiState:{sortKey:l,sortOrder:C}}))},onSearchTextChanged:l=>{e(ic(l))},onReloadCards:()=>{e(sa(g,R&&D,_&&m,!0))},onLetsGoClick:()=>{t("./onboard")},onBackClick:()=>{t("../../")},onTotalCashbackClick:()=>{ra(R,D,B)&&u!=null&&J.trackCardsCashbackOverviewClick(P,w,u,"Cashback Overview","cashback_details_viewed",T,k),t("./cashback")},onClickStatementsIcon:()=>{ra(R,D,B)&&u!=null&&J.trackCardsStatementsClick(P,w,u,T,k),t("./statements")},onCreateNowClick:l=>{ra(R,D,B)&&u!=null&&J.trackCardsNewCardClick(P,w,u,"Promo Banner","card_creation_initiated","Card List",T,k),t(`./new?cardType=${l}`)},onPromoCardClick:l=>{t(l==="debit"&&R&&!d||l==="credit"&&i&&!j?`../promo?cardPromoType=${l}`:"./setup")},navigateToCreditCardPaymentPage:(l,C)=>{h==="Completed"&&a.company!=null&&u!=null&&J.trackCardsPayEarlyClick(P,w,u,"Card List",l,C,{isZeniCheckingEnabled:a.company.companyZeniAccountInfo.isZeniAccountEnabled,isZeniCheckingPaymentSource:p?.accType==="depositAccount",creditCardPaymentSourceAccountName:p?.label,creditCardPaymentSourceAccountType:p?.accType,creditCardPaymentSourceLastFourDigits:p?.accountLast4,creditCardPaymentSourceBalance:p?.accountBalance?.available?.amount??0},T,k);const N=Ci(y);t(N)},navigateToCreditCardPaymentHistoryPage:()=>{const l=pi(y),C=ye(s.state?.pathnameStackToGoBack,s.pathname);t(l,{state:{pathnameStackToGoBack:C}})},shouldShowPayNowInfoTooltip:M,onSetRowActionCardId:l=>{e(oc(l))},onSetBulkActionCardIds:l=>{e(ar(l))},onEventReceived:l=>{di.has(l)&&Et(e,g,R&&D,_&&m)},onPusherSubscribed:()=>{Et(e,g,R&&D,_&&m)}}})(ct(oo));function fn({isPaymentDrawerOpen:e}){const n=de(),t=pe(),a=Ce(),s=r.useCallback(($,Oe)=>{t(ar([])),n($,Oe)},[t,n]),[b,f]=r.useState(!1),[g,_]=r.useState(re.getPayNowInfoTooltip()??!1),i=$=>{re.savePayNowInfoTooltip($),_($)},[m,R]=r.useState(!1),D=re.getSignedInUser(),d=o($=>fe($)),[j,P]=r.useState(!1),[B,p]=r.useState(!1),{isAiCfoAccessEnabled:h,onAskAiCfoClick:w}=Ra({mobileExploreReferrer:"Cards"}),u=d.userRole.includes("charge_card_user"),T=!u,k=!!d.companyDebitCardInfo?.info?.isDebitCardEnabled,{useFeatureGate:M,useDynamicConfig:A}=le(),{isFeatureEnabled:y}=M(K.isCashbackFeatureEnabled),{isFeatureEnabled:L}=M(K.isChargeCardFeatureEnabled),{isFeatureEnabled:l}=M(K.isDebitCardFeatureEnabled),{isFeatureEnabled:C}=M(K.isEarlyPayFeatureEnabled),{isFeatureEnabled:N}=M(K.isChargeCardPaymentHistoryFeatureEnabled),{isFeatureEnabled:G}=M(K.isCardsCommentingEnabled),{isFeatureEnabled:O}=M(K.isAiCfoFileUploadEnabled),{isFeatureEnabled:U}=M(K.isCardPolicyEnabled),{isFeatureEnabled:z}=M(K.isAiCardCreationEnabled),Z=Te(l,d),I=Re({isDebitCardFeatureEnabled:l,isBankingOnlyTenant:Z}),x=we(d),Y=ve(d),q=d.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,E=xe({isCardsOnlyTenant:x,isChargeCardFeatureEnabled:L,isBookKeepingTenant:Y,isDebitCardProductVisible:I,chargeCardsCreditAccountLimit:q}),V=kr({isCardsOnlyTenant:x,isChargeCardFeatureEnabled:L,isBookKeepingTenant:Y}),{configValue:Q}=A(ze.zeniCardsConfig),X=Fe(),S=Pe(X?.loggedInUserRoleMap),F=o($=>ca($,d.companyId)),v=oa(F.controllers),ee=Q.charge_card_cashback_rate_per_transaction!=null?Q.charge_card_cashback_rate_per_transaction:.0175,W=Q.credit_card_pay_now_threshold_by_company_id?.[d.companyId]??Q.default_credit_card_pay_now_threshold??Do,ke=Q.is_card_controls_enabled_for_all_tenants===!0||Array.isArray(Q.enable_card_controls_for_company_ids)&&Q.enable_card_controls_for_company_ids.includes(d.companyId),be=!!d.companyChargeCardInfo?.info?.isChargeCardTOSAccepted,ge=!!d.companyDebitCardInfo?.info?.isDebitCardTOSAccepted,ae=!!d.companyChargeCardInfo?.info?.isChargeCardEnabled,ue=o($=>Hn($)),oe=ya(ue.updateStatus),te=o($=>la($,T,I&&k,E&&ae)),Ze=o($=>ac($)),Ee=o($=>tc($)),ne=o($=>nc($)),Ye=o($=>rc($)),Be=o($=>ne==null?[]:Un($.aiCfoState,ne).filter(Oe=>Oe.kind==="creating_cards"),At),ce=ya(Ee.fetchState);r.useEffect(()=>{ce==="In-Progress"&&Ee.fetchState==="Completed"&&ne!=null&&Be.forEach($=>{t(jn({chatSessionId:ne,id:$.id,entityIds:Ye,kind:"created_cards"}))})},[t,Ee.fetchState,ne,Ye,Be,ce]);const Ea=te.cards.filter($=>$.type.code.includes("debit")).map($=>$.connectedAccountId),pa=[...new Set(Ea)],ha=o($=>da($)),aa=o($=>nt($,pa)),Aa=o($=>wa($,d.companyId)),lt=Aa.companyChargeCardInfo?.primaryFundingAccount,ut=Aa.allFundingAccounts.find($=>$.id===lt?.accountId),me=te.fetchState,Oa=te.creditAccount,Da=r.useCallback(()=>S===!0&&U===!0&&me==="Completed"&&re.getCardPolicyPopupSeen(d.tenantEmailDomain??"")!==!0,[S,U,me,d.tenantEmailDomain]),[mt,Ua]=r.useState(Da);r.useEffect(()=>{Ua(Da())},[Da]);const ja=()=>{re.saveCardPolicyPopupSeen(d.tenantEmailDomain??"",!0),Ua(!1)},Ma=me==="Completed"&&!te.hasCreditCard&&!te.hasDebitCard;co({isDataReady:me==="Completed",pageContext:Ma?"cards_creation":"cards"});const{creditAccountRepayment:H}=o($=>ia($)),he=o($=>Qa($).firstViewAfterActivation),{areTenantIdsInSync:Le}=br(),Ve=Lt(S,ha),He=xa(E,ae,S,Oa,H),Ge=Ot(I,k,S,aa,te.debitCardSummary),$e=Je(E,I,k,ae),ta=te.creditAccount.balance.amount+te.creditAccount.hold.amount;if(r.useEffect(()=>{me==="Completed"&&(re.getPayNowInfoTooltip()==null||ta<W*te.creditAccount.limit.amount/100)&&i(!0)},[me,W,ta,te.creditAccount.limit.amount]),r.useEffect(()=>{if(e!=null&&e===!0&&H.initiatedRepayments.amount===0&&H.fetchState==="Completed"||oe==="In-Progress"&&ue.updateStatus==="Completed")i(!1),f(!0);else if(H.initiatedRepayments.amount>0&&H.fetchState==="Completed"){f(!1),document.body.style.overflow="auto";const $=ea(d.tenantEmailDomain);s($)}},[e,H.initiatedRepayments.amount,H.fetchState,oe,ue.updateStatus,s,d.tenantEmailDomain]),r.useEffect(()=>{!j&&(ae||k)&&Le&&(P(!0),t(sa(T,I&&k,E&&ae,!1)))},[j,T,t,Le]),r.useEffect(()=>{he&&m===!1&&(R(!0),setTimeout(()=>{t(Ya())},5e3))},[he,m]),r.useEffect(()=>()=>{Et.flush()},[]),r.useEffect(()=>{me==="Completed"&&u&&te.cards.length===1&&(te.cards[0].status.code==="inactive"&&te.cards[0].type.code==="business_physical_credit_card"?s(`./${te.cards[0].id}/activate`):te.cards[0].status.code!=="request_on_hold"&&(a.state?.message==="comingFromCardDetail"?s("../../"):s(`./${te.cards[0].id}`)))},[me,u,a.state,s,te.cards]),r.useEffect(()=>{if(me==="Completed"&&u){const $=te.cards.length,Oe=te.cards.filter(Ke=>Ke.cardHolderUserId===D?.userId).filter(Ke=>Ke.status.code==="request_on_hold");Oe.length>0&&$===Oe.length&&s("./onboard")}},[me,te.cards,u,s,D?.userId]),r.useEffect(()=>{me!=="Completed"||E&&H.fetchState!=="Completed"||I&&k&&S&&aa.fetchState!=="Completed"||J.trackCardsCardListView(v,$e,Ve,He,Ge)},[me,Oa,H.fetchState,aa.fetchState,S]),D==null)throw Error("Can't access charge card list page without signing in...");const Hr=o($=>tr($.userState,$.userRoleState,$.userListViewState,"cardAdmin")),zt=wt(X?.loggedInUserRoleMap),Zt=$=>{p($)},Gr=te.creditAccount.limit,$r=()=>{f(!1),s("..")},zr=d.companyChargeCardInfo?.info!=null&&Ia({cardInfo:d.companyChargeCardInfo.info,isProductVisible:E,isTOSAccepted:be,isSetupEnabled:ae,isUserHasCardsAdminLevelAccess:S,isUserHasCardsAccess:zt}),Zr=d.companyDebitCardInfo?.info!=null&&Ia({cardInfo:d.companyDebitCardInfo.info,isProductVisible:I,isTOSAccepted:ge,isSetupEnabled:k,isUserHasCardsAdminLevelAccess:S,isUserHasCardsAccess:zt}),Yr=zr||Zr,Yt=function($){const{isEmptyCardsState:Oe,isChargeCardAdmin:Ke,isFileUploadEnabled:Wt}=$,qt=de(),Na=Ce(),{tenantEmailDomain:Va}=Me(),{isAiCfoOpen:Qr,setIsAiCfoOpen:Qt}=Cr(),Jr=pr(),Xr=hr(),Jt=o(Se=>On(Se)).createSessionAndSubmitState.fetchState==="In-Progress",{chips:Xt,isResolved:en}=wr("cards_creation"),an=r.useMemo(()=>Pr(Xt,en,3),[Xt,en]),[Ha,Ct]=r.useState(""),tn=Xr&&Jr&&Va!=null&&!Qr,fa=r.useCallback(Se=>{if(Va==null)return;const es=ye(Na.state?.pathnameStackToGoBack,Na.pathname);qt(`/${Va}/cards/ask`,{state:{message:"",origin:"",pathnameStackToGoBack:es,referrer:"cards_hero",aiCfoInitialQuestion:Se,aiCfoShouldSubmit:Se!=null&&Se.trim().length>0}})},[Na.pathname,Na.state,qt,Va]),nn=r.useCallback(Se=>{Se.trim().length!==0&&(Ct(""),fa(Se))},[fa]),rn=r.useCallback(()=>{const Se=Ha.trim();Se.length!==0&&(Ct(""),fa(Se))},[Ha,fa]),sn=r.useCallback(()=>{},[]),cn=r.useCallback(Se=>{Ct(Se)},[]),on=r.useCallback(()=>{Qt(!0)},[Qt]),dn=r.useCallback(()=>{fa(void 0)},[fa]);return r.useMemo(()=>{if(tn&&Oe&&Ke)return{aiAgentName:ii,headline:ci,subheadline:oi,promptChips:an,composer:{currentInput:Ha,isSubmitting:Jt,isFileUploadEnabled:Wt,onInputChange:cn,onSubmit:rn,onStopSubmit:sn},onPromptClick:nn,onOpenSidePanel:on,onOpenFullView:dn,dataTestIdPrefix:"cards-ai-cfo-hero"}},[Ha,tn,Ke,Oe,Wt,Jt,cn,dn,on,nn,sn,rn,an])}({isEmptyCardsState:Ma,isChargeCardAdmin:S,isFileUploadEnabled:O}),Kt=z&&Yt!=null?c.jsx(fr,{...Yt}):null,Kr=h&&Kt==null,Wr=Xe(d),qr={events:Ca(Wr,jr),eventCallback:($,Oe,Ke)=>{Ke.onEventReceived($)},onSubscribed:$=>{$.onPusherSubscribed()}};return ae||k?c.jsxs(c.Fragment,{children:[me==="Completed"?c.jsxs(c.Fragment,{children:[c.jsx(xt,{analytics:J,onLoad:()=>{J.trackPageLoaded(Sr.Event.cardsListPage),(E&&!ae||I&&!k)&&J.trackCardsPromoView(v,{isCreditCardOffered:E,isDebitCardOffered:I,isDebitCardEnabled:k,isCreditCardEnabled:ae},"Banner",I&&!k?"Debit Card":E&&!ae?"Credit Card":"","Card List")}}),c.jsx(rt,{showConfetti:he})]}):null,b===!0?c.jsx(Ht,{closeDrawerHandler:$r,isPaymentDrawerOpen:b,pageName:"Card List",sourcePage:"cardListPage",creditAccountSpentAmount:ta,productInformation:$e,creditAccountInformation:He,debitAccountInformation:Ge,cashbackInformation:Ve,isDebitCardInfoFetchStateCompleted:!(I&&k&&S)||aa.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!E||H.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!S||ha.fetchState==="Completed",paymentInitiatedDate:H.initiatedRepaymentDate}):null,c.jsxs(li,{children:[c.jsx(Ie,{isAppContentDrawerOpen:B,handleDrawerToggle:Zt}),c.jsx(ui,{...qr,isCashbackFeatureEnabled:y,isChargeCardFeatureEnabled:E,isDebitCardFeatureEnabled:I,isCreditCardProductVisibleForExpressInterest:V,updatePayNowInfoTooltip:i,showPayNowInfoTooltip:g,creditCardPayNowThreshold:W,signedInUser:D,chargeCardListState:te,location:a,admins:Hr.users,navigateAndClearBulkSelection:s,currentTenant:d,isCardControlsEnabled:ke,companyChargeCardInfoCreditAccountLimit:d.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,isCompanyInterestedInChargeCard:d.companyChargeCardInfo?.info?.isCompanyInterestedInChargeCard??!1,isUserHasCardsAdminLevelAccess:S,includeCreditAccountDebitSummaryAndCashbackInfo:T,onClickMenuIcon:()=>{Zt(!0)},creditLimit:Gr,isChargeCardSetupEnabled:ae,isDebitCardSetupEnabled:k,isEarlyPayEnabled:C,isChargeCardPaymentHistoryFeatureEnabled:N,cashbackRate:ee,controllerEmails:v,chargeCardCashbackDetailState:ha,depositAccountListWithDebitCardIssued:aa,isChargeCardTOSAccepted:be,isDebitCardTOSAccepted:ge,primaryFundingAccountDetails:ut,chargeCardSetUpViewFetchState:Aa.fetchState,productInformation:$e,creditAccountInformation:He,debitAccountInformation:Ge,cashbackInformation:Ve,isAiCfoAccessEnabled:Kr,onAskAiCfoClick:w,isCardsCommentingEnabled:G,cardsAiCfoHero:Kt,onClickPolicyIcon:S&&U?()=>n(hi(d.tenantEmailDomain)):void 0,isPolicyIntroTooltipVisible:mt,onPolicyIntroTooltipClose:ja,pendingCreationCount:Ze})]})]}):(be||ge)&&S===!0?c.jsx(Sa,{to:"../setup"}):Yr?c.jsx(Sa,{to:"../promo"}):c.jsx(va,{fetchState:me})}const mi=e=>`/${e}/cards/new`,Ci=e=>`/${e}/cards/payment`,pi=e=>`/${e}/cards/payment-history`,hi=e=>`/${e}/cards/policy`,Mr=[Br,Lr],fi=new Set(Mr),gi=De(function(e){const n=re.getSignedInUser(),t=fe(e),a=e.tenantState.currentTenantId,s=nr(e),b={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:a??""},f=t?.companyName??"",g=e.chargeCardPaymentHistoryState.downloadUIState.downloadState;return{fetchState:s.fetchState,filters:s.filters,isZeniTenant:hc(t),repaymentList:s.repaymentHistory,searchText:s.searchText,repaymentHistoryUsers:s.repaymentHistoryUsers,sortConfig:{sortKey:s.uiState.sortKey,sortOrder:s.uiState.sortOrder},downloadParams:{authParams:b,companyName:f,spendManagementEndPoint:`${It}/spendManagement`,isShowDeletedBillsEnabled:!1,isShowDeletedReimbursementEnabled:!1},downloadState:g}},function(e,n){const{location:t,navigate:a}=n;return{onBackClick:()=>{const s=_e(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(gc({filters:s}))},onReloadPayments:()=>{e(Ga(!0))},onEventReceived:s=>{fi.has(s)&&e(Ga(!0))},onPusherSubscribed:()=>{e(Ga(!0))},onSearchTextChanged:s=>{e({type:"chargeCardPaymentHistory/updatePaymentHistorySearchText",payload:s})},updateDownloadStateHandler:s=>{e(fc({uiState:{downloadState:s}}))}}})(ct(io));function bi(){const e=de(),n=Ce(),t=pe(),{areTenantIdsInSync:a}=br(),{useFeatureGate:s}=le();if(re.getSignedInUser()==null)throw Error("Can't access payment history page without signing in...");const b=o(S=>fe(S)),f=o(S=>nr(S)),[g,_]=r.useState(!1),[i,m]=r.useState(!1),[R,D]=r.useState(!1),[d,j]=r.useState(null),P=!b.userRole.includes("charge_card_user"),B=!!b.companyDebitCardInfo?.info?.isDebitCardEnabled,{isFeatureEnabled:p}=s(K.isChargeCardFeatureEnabled),{isFeatureEnabled:h}=s(K.isDebitCardFeatureEnabled),w=Te(h,b),u=Re({isDebitCardFeatureEnabled:h,isBankingOnlyTenant:w}),T=we(b),k=ve(b),M=b.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,A=xe({isCardsOnlyTenant:T,isChargeCardFeatureEnabled:p,isBookKeepingTenant:k,isDebitCardProductVisible:u,chargeCardsCreditAccountLimit:M}),y=!!b.companyChargeCardInfo?.info?.isChargeCardEnabled,L=Fe(),l=Pe(L?.loggedInUserRoleMap),C=o(S=>la(S,P,u&&B,A&&y)),N=r.useMemo(()=>{const S=C.cards.filter(F=>F.type.code.includes("debit"));return[...new Set(S.map(F=>F.connectedAccountId))]},[C.cards]),G=o(S=>da(S)),O=o(S=>nt(S,N)),{creditAccountRepayment:U}=o(S=>ia(S)),z=r.useMemo(()=>Lt(l,G),[l,G]),Z=r.useMemo(()=>xa(A,y,l,C.creditAccount,U),[A,y,l,C.creditAccount,U]),I=r.useMemo(()=>Ot(u,B,l,O,C.debitCardSummary),[u,B,l,O,C.debitCardSummary]),x=r.useMemo(()=>Je(A,u,B,y),[A,u,B,y]),Y=C.creditAccount.balance.amount+C.creditAccount.hold.amount,q=r.useMemo(()=>d!=null?f.repaymentHistory.find(S=>S.cardRepaymentId===d):void 0,[d,f.repaymentHistory]),E=r.useCallback(S=>{j(S),t(sa(P,u&&B,A&&y,!1)),D(!0)},[t,P,u,B,A,y]),V=r.useCallback(()=>{D(!1),j(null),document.body.style.overflow="auto"},[]);r.useEffect(()=>{g||f.fetchState==="Completed"||f.fetchState==="In-Progress"||(_(!0),t(Ga()))},[g,t,f.fetchState]),r.useEffect(()=>{!i&&(y||B)&&a&&(m(!0),t(sa(P,!1,A&&y,!1)))},[i,y,B,a,t,P,A]);const Q=Xe(b),X={events:Ca(Q,Mr),eventCallback:(S,F,v)=>{v.onEventReceived(S)},onSubscribed:S=>{S.onPusherSubscribed()}};return c.jsxs(c.Fragment,{children:[R?c.jsx(Ht,{closeDrawerHandler:V,isPaymentDrawerOpen:R,pageName:"Payment History",sourcePage:"cardPaymentHistory",creditAccountSpentAmount:Y,productInformation:x,creditAccountInformation:Z,debitAccountInformation:I,cashbackInformation:z,isDebitCardInfoFetchStateCompleted:!(u&&B&&l)||O.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!A||U.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!l||G.fetchState==="Completed",paymentInitiatedDate:U.initiatedRepaymentDate,retryRepayment:q}):null,c.jsx(gi,{...X,location:n,navigate:e,accountInfoByAccountId:f.accountInfoByAccountId,onRetryPaymentClick:E})]})}const gn=Ne.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
|
-
`,bn=ua.getLocalizedStrings().months;function Si(){const e=de(),n=pe(),t=Ce(),{creditAccount:a,creditAccountRepayment:s}=o(x=>ia(x)),b=`${gr.cardMicroServiceBaseUrl}/1.0/credit-accounts/${a.id}`,[f,g]=r.useState(!1),[_,i]=r.useState(!1),m=o(x=>bc(x)),{useFeatureGate:R}=le(),D=o(x=>fe(x)),{isFeatureEnabled:d}=R(K.isChargeCardFeatureEnabled),{isFeatureEnabled:j}=R(K.isDebitCardFeatureEnabled),{isFeatureEnabled:P}=R(K.isCardsCommentingEnabled),B=Dr(P?D.companyId:void 0,{clearParams:P&&m.fetchState==="Completed"}),p=Te(j,D),h=Re({isDebitCardFeatureEnabled:j,isBankingOnlyTenant:p}),w=we(D),u=ve(D),T=D.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,k=xe({isCardsOnlyTenant:w,isChargeCardFeatureEnabled:d,isBookKeepingTenant:u,isDebitCardProductVisible:h,chargeCardsCreditAccountLimit:T}),M=!!D.companyDebitCardInfo?.info?.isDebitCardEnabled,A=!!D.companyChargeCardInfo?.info?.isChargeCardEnabled,y=o(x=>ca(x,D.companyId)),L=oa(y.controllers),l=o(x=>rr(x)),C=l.cards.filter(x=>x.type.code.includes("debit")).map(x=>x.connectedAccountId),N=[...new Set(C)],G=o(x=>nt(x,N)),O=o(x=>Sc(x));r.useEffect(()=>{_||a.fetchState==="Completed"||a.fetchState==="In-Progress"||(g(!0),n(qe()))},[f,n,a.fetchState]),r.useEffect(()=>{_||a.fetchState!=="Completed"||a.id==null||m.fetchState==="Completed"||m.fetchState==="In-Progress"||(i(!0),n(yc(a.id)))},[_,n,a.fetchState,a.id,m.fetchState]),r.useEffect(()=>{G.fetchState!=="Completed"&&G.fetchState!=="In-Progress"&&h&&M&&n(sr()),l.fetchState!=="Completed"&&l.fetchState!=="In-Progress"&&n(je()),O.fetchState!=="Completed"&&O.fetchState!=="In-Progress"&&h&&M&&n(Ic()),s.fetchState!=="Completed"&&s.fetchState!=="In-Progress"&&k&&A&&n(_t())},[G.fetchState,h,M,l.fetchState,O.fetchState,s.fetchState,k,A]),r.useEffect(()=>{if(m.fetchState==="Completed"&&a.fetchState==="Completed"&&s.fetchState==="Completed"&&l.fetchState==="Completed"&&(!h||!M||G.fetchState==="Completed"&&O.fetchState==="Completed")){let x="",Y="";if(m.statements.length>0){const Q=m.statements[m.statements.length-1].period,[X,S]=Q.split("-"),F=m.statements[0].period,[v,ee]=F.split("-");x=`${bn[parseInt(S)-1]} ${X}`,Y=`${bn[parseInt(ee)-1]} ${v}`}const q=Je(k,h,M,A),E=xa(k,A,!0,a,s),V=Ot(h,M,!0,G,O);J.trackCardsCreditCardStatementsView(L,q,{numberOfStatements:m.statements.length,oldestStatementMonthYear:x,latestStatementMonthYear:Y},E,V)}},[m.fetchState,a.fetchState,s.fetchState,G.fetchState,l.fetchState,O.fetchState]);const U=()=>{const x=_e(t.state?.pathnameStackToGoBack),Y=x.poppedPathname??"..";e(Y,{state:{pathnameStackToGoBack:x.newStack}})},z=o(x=>da(x)),Z=re.getSignedInUser(),I={userId:Z?.userId??"",sessionId:Z?.zeniSessionId??"",tenantId:D.tenantId??""};if(Z==null)throw Error("Can't access address page without signing in...");if(m.fetchState!=="Completed")return c.jsx(gn,{children:c.jsx(lo,{onBackClick:U})});{const x=Je(k,h,M,A);return c.jsx(gn,{children:c.jsx(uo,{currentTenantCompanyName:D.companyName,statementListView:m,productInformation:x,onBackClick:U,authParams:I,controllerEmails:L,isChargeCardFeatureEnabled:k,isDebitCardFeatureEnabled:h,isDebitCardSetupEnabled:M,isChargeCardSetupEnabled:A,isCardsCommentingEnabled:P,initialOpenThreadRequest:B,chargeCardCashbackDetailState:z,creditAccount:a,creditAccountRepayment:s,depositAccountListWithDebitCardIssued:G,debitCardSummary:O,downloadEndPoint:b})})}}const Nr=[ma,dt],yi=new Set(Nr),Ii={containerWidth:new Fa(100,58)},ki=({appContent:e})=>{const n=Ta(),t=pe(),a=de(),s=Ce(),{useDynamicConfig:b}=le(),[f,g]=r.useState(!1),[_,i]=r.useState(!1),[m,R]=r.useState(!1),[D,d]=r.useState(!1),j=r.useRef(!1),P=r.useRef(null);r.useEffect(()=>()=>{P.current!=null&&(clearTimeout(P.current),P.current=null)},[]);const[B,p]=r.useState(!1),[h,w]=r.useState(!1),u=re.getSignedInUser();if(u==null)throw Error("Can't access onboarding card page without signing in...");const T=o(V=>fe(V)),{configValue:k}=b(ze.zeniCardsConfig),M=o(V=>kc(V)),{tenantEmailDomain:A}=T,y=o(V=>V.settingsViewState.profile.fetchState),L=o(V=>V.chargeCardListState.fetchState),l=o(V=>V.settingsViewState.profile.userId),C=o(V=>V.chargeCardConfigState.fetchState);r.useEffect(()=>{f===!1&&y!=="In-Progress"&&y!=="Completed"&&(t(Ec()),g(!0)),_===!1&&C!=="In-Progress"&&C!=="Completed"&&(t(Ja()),i(!0)),m===!1&&L==="Not-Started"&&(R(!0),t(je()))},[f,m,L,_,C]),r.useEffect(()=>{y==="Completed"&&B===!1&&l!=null&&L==="Completed"&&M.cards.length>0&&(t(Ac({userId:l})),t(cr({cardId:M.cards[M.cards.length-1].id})),p(!0))},[y,B,l,L]),r.useEffect(()=>{if(!D&&M.fetchState==="Completed"&&M.cards.length===0){const V=_e(s.state?.pathnameStackToGoBack),Q=V.poppedPathname??ea(A);a(Q,{state:{pathnameStackToGoBack:V.newStack}})}},[M.fetchState,M.cards,D]);const N=o(V=>Qa(V)),G=ya(N.updateStatus.fetchState),O=N.currentDisplayedCardId,{useFeatureGate:U}=le(),{isFeatureEnabled:z}=U(K.isChargeCardFeatureEnabled),Z=!!T.companyChargeCardInfo?.info?.isChargeCardEnabled,I=!T.userRole.includes("charge_card_user")&&z&&Z,x=o(V=>O!=null?or(V.chargeCardState,O):null),Y=()=>{O!=null&&(j.current=!0,P.current!=null&&clearTimeout(P.current),P.current=setTimeout(()=>{j.current=!1,P.current=null},5e3),t(ka(O,I,!0)),t(je(!0)),d(!0))},q=Xe(T);Ut({events:Ca(q,Nr),onSubscribed:()=>{t(je(!0))},onEvent:(V,Q)=>{if(!yi.has(V))return;const X=Gt(Q),S=j.current;if(V===ma){const v=ie(X?.card_id)??O;if(v!=null){const ee=$t(X,v);if(ee!=null)return t(Pt(ee)),void(v!==O||S||Y())}}if(V===dt)return void t(je(!0));const F=ie(X?.card_id)??O;(O==null||F===O)&&O!=null?S||Y():t(je(!0))}}),r.useEffect(()=>{if(D&&O!=null&&x!=null&&x.status.code!=="request_on_hold"){const V=Ae(T.tenantEmailDomain,O,u,x),Q=ye(s.state?.pathnameStackToGoBack,s.pathname);t(Dc()),x?.type.code==="business_virtual_credit_card"&&t(Xa()),a(V,{state:{pathnameStackToGoBack:Q},replace:!0}),j.current=!1,P.current!=null&&(clearTimeout(P.current),P.current=null)}},[D,x?.status.code]),r.useEffect(()=>{G==="In-Progress"&&N.updateStatus.fetchState==="Completed"&&setTimeout(Y,3e3)},[G,N.updateStatus.fetchState]);const E=V=>{w(V)};if(y!=="Completed"||M.cards.length===0)return c.jsxs(Sn,{children:[c.jsx(Ie,{isAppContentDrawerOpen:h,handleDrawerToggle:E}),c.jsx(mo,{})]});if(l==null)throw Error("Can't access my userId.");return c.jsxs(Sn,{children:[c.jsx(Ie,{isAppContentDrawerOpen:h,handleDrawerToggle:E}),c.jsx(Ei,{chargeCardListView:M,cardUserOnboardingView:N,navigate:a,currentTenant:T,myUserId:l,location:s,chargeCardCashbackRatePerTransaction:k.charge_card_cashback_rate_per_transaction!=null?k.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{E(!0)}}),e!=null?c.jsx(Ai,{windowSize:n,children:e}):null]})},Ei=De(function(e,{currentTenant:n,cardUserOnboardingView:t,chargeCardListView:a,myUserId:s}){const b=la(e,!1,!1,!1);let f=!1;return b.fetchState==="Completed"&&b.cards.length<=1&&(f=!0),{cards:a.cards,showMenuIcon:f,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:f}=b;return{updateCardUserOnboardingLocalData:g=>{e(mn({localData:g}))},onGetOtp:g=>{if(a.cardUserOnboardingLocalData!=null){const _={...a.cardUserOnboardingLocalData,phone:g};e(mn({localData:_}))}e(tt(g,"CardUserOnboarding"))},onResendOtp:g=>{e(at(g,"CardUserOnboarding"))},onVerifyOtp:(g,_)=>{e(et(g,_,"CardUserOnboarding"))},onVerifyOtpSuccess:g=>{e(_c()),g!=null&&re.saveZeniOtpToken(g)},setCurrentDisplayedCardId:g=>{e(cr({cardId:g}))},onBackClick:()=>{const g=_e(s.state?.pathnameStackToGoBack),_=g.poppedPathname??ea(f);t(_,{state:{pathnameStackToGoBack:g.newStack}})}}})(Co),Ai=Ne.div`
|
|
35
|
-
display: flex;
|
|
36
|
-
flex-direction: column;
|
|
37
|
-
width: ${e=>`${Ii.containerWidth.value(e.windowSize)}%`};
|
|
38
|
-
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
39
|
-
`,Sn=Ne.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
|
-
`,Di={containerWidth:new Fa(100,58)},_i=({appContent:e})=>{const n=Ta(),t=pe(),a=de(),{cardId:s}=Me(),b=Ce(),{useDynamicConfig:f,useFeatureGate:g}=le(),[_,i]=r.useState(!1),[m,R]=r.useState(!1),[D,d]=r.useState(!1),[j,P]=r.useState(!1),B=re.getSignedInUser();if(B==null)throw Error("Can't access onboarding card page without signing in...");const p=o(I=>fe(I));if(s==null)throw Error("Empty card id is not valid...");const{configValue:h}=f(ze.zeniCardsConfig),w=o(I=>Pc(I,s)),{isFeatureEnabled:u}=g(K.isChargeCardFeatureEnabled),{isFeatureEnabled:T}=g(K.isDebitCardFeatureEnabled),k=Te(T,p),M=Re({isDebitCardFeatureEnabled:T,isBankingOnlyTenant:k}),A=we(p),y=ve(p),L=p.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,l=xe({isCardsOnlyTenant:A,isChargeCardFeatureEnabled:u,isBookKeepingTenant:y,isDebitCardProductVisible:M,chargeCardsCreditAccountLimit:L}),C=w.chargeCard,N=o(I=>I.chargeCardConfigState.fetchState);r.useEffect(()=>{_===!1&&N!=="In-Progress"&&N!=="Completed"&&(t(Ja()),i(!0)),m===!1&&w.fetchState==="Not-Started"&&(R(!0),t(ka(s,!1,l)))},[m,w.fetchState,_,N]);const G=C?.type.code==="business_physical_debit_card"||C?.type.code==="business_virtual_debit_card";r.useEffect(()=>{if(w.fetchState==="Completed"){if(D===!1&&(G===!1||G&&C.status?.code!=="active"||G&&C.status.code==="active"&&C.isPinSet||C.cardHolderUserId!==B.userId)){const I=Ae(p.tenantEmailDomain,s,B,C,!0),x=ye(b.state?.pathnameStackToGoBack,b.pathname);a(I,{state:{pathnameStackToGoBack:x}})}else if(D&&w.isRefreshingViewInBackground===!1&&C?.isPinSet===!0){t(wc({chargeCardId:s}));const I=Ae(p.tenantEmailDomain,s,B,C,!0),x=ye(b.state?.pathnameStackToGoBack,b.pathname);t(Xa()),a(I,{state:{pathnameStackToGoBack:x}})}}},[w.fetchState,C?.type.code,D,w.isRefreshingViewInBackground]);const O=re.getZeniOtpTokenForCardHolder(s),U=o(I=>Nn(I.userState,B.userId)),z=()=>{C?.isPinSet!==!0&&t(ga(s,!0))};r.useEffect(()=>{w.updateDebitCardPinAttemptFetchState.fetchState==="Completed"&&(setTimeout(z,3e3),d(!0))},[w.updateDebitCardPinAttemptFetchState.fetchState]);const Z=I=>{P(I)};if(N!=="Completed"||C==null)return c.jsx(va,{fetchState:"In-Progress"});if(U?.phone==null)throw Error("Can't access user phone number.");return c.jsxs(vi,{children:[c.jsx(Ie,{isAppContentDrawerOpen:j,handleDrawerToggle:Z}),c.jsx(Pi,{cardId:s,card:C,phone:U.phone,signedInUser:B,isSandboxEnv:Ft(),debitCardDetailState:w,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:()=>{Z(!0)}}),e!=null?c.jsx(wi,{windowSize:n,children:e}):null]})},Pi=De(function(e,{debitCardDetailState:n,cardId:t}){const a=Vn(e,t),s=n.updateStatus,b=la(e,!1,!1,!1);let f=!1;return b.fetchState==="Completed"&&b.cards.length<=1&&(f=!0),{showMenuIcon:f,vgsVaultId:st.cardVaultId,twoFAView:a,setPinWaitStatus:s}},function(e,n){const{navigate:t,cardId:a,location:s,currentTenant:b,debitCardDetailState:f}=n,g=f.chargeCard?.cardProviderID,{tenantEmailDomain:_}=b;return{onGetOtp:i=>{g!=null&&e(tt(i,"ChargeCardHolder",a))},onUpdateDebitCardPinAttempt:i=>{e(Kn(a,i))},onResendOtp:i=>{g!=null&&e(at(i,"ChargeCardHolder",a))},onVerifyOtp:(i,m)=>{g!=null&&e(et(i,m,"ChargeCardHolder",a))},onVerifyOtpSuccess:i=>{i!=null&&re.saveZeniOtpTokenForCardHolder(i,a)},onSetPinSuccess:()=>{e(vc({chargeCardId:a}))},onBackClick:()=>{const i=_e(s.state?.pathnameStackToGoBack),m=i.poppedPathname==null||i.poppedPathname.includes("activate")===!0?ea(_):i.poppedPathname;t(m,{state:{pathnameStackToGoBack:i.newStack}})}}})(po),wi=Ne.div`
|
|
48
|
-
display: flex;
|
|
49
|
-
flex-direction: column;
|
|
50
|
-
width: ${e=>`${Di.containerWidth.value(e.windowSize)}%`};
|
|
51
|
-
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
52
|
-
box-shadow: ${e=>`${Ka.sp0} 2px ${Ka.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
53
|
-
`,vi=Ne.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=>`${Ka.sp0} 2px ${Ka.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
62
|
-
`,Ti={overlayWidth:new Fa(pt[12],pt[12],pt[9])},Fi=De(function(e,n){const t=vt(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(ir(`${s==="creditCard"?"credit":"debit"}_custom_shipping_${a}_address`));const f=wo(b);e(Rc({addressType:`${s==="creditCard"?"credit":"debit"}_custom_shipping_${a}_address`,addressToCreate:f})),e(xc(`${s==="creditCard"?"credit":"debit"}_custom_shipping_${a}_address`))},onDismissClick:()=>{n.onDismissClick(),t!=null&&e(Fc({addressId:t,cardLineId:a,cardType:s==="creditCard"?"business_physical_credit_card":"business_physical_debit_card"}))}}})(ho),Ri=({lineId:e,closeDrawerHandler:n,chargeCardTypeOption:t})=>{const a=Rt(),s=Ta(),b=()=>{n()},f=o(g=>Tc(`${t==="creditCard"?"credit":"debit"}_custom_shipping_${e}_address`,g))?.newAddressId;return c.jsx(yr,{anchor:"right",open:e.length>0,PaperProps:{style:{minWidth:Ti.overlayWidth.valuePercentage(s),boxShadow:"none",zIndex:8}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:a.colors.black,cursor:"pointer"}}},onClose:(g,_)=>(_==="backdropClick"||_==="escapeKeyDown")&&b(),children:c.jsx(Fi,{googleAPIKey:st.googleMapsAPIKey,onDismissClick:b,lineId:e,chargeCardTypeOption:t,newCustomAddressId:f})})},xi=De(function(e,n){const{isChargeCardFeatureEnabled:t,isDebitCardFeatureEnabled:a,isIssuePhysicalCardEnabled:s,isIssuePhysicalDebitCardEnabled:b,isChargeCardSetupEnabled:f,isDebitCardSetupEnabled:g}=n,_=vt(e,t&&f,a&&g);return{issueChargeCards:_,isIssuePhysicalCardEnabled:s,isIssuePhysicalDebitCardEnabled:b,isDebitCardFeatureEnabled:a,isChargeCardFeatureEnabled:t,isChargeCardSetupEnabled:f,isDebitCardSetupEnabled:g,cardHolderCandidates:_.userList.map(i=>i.user).filter(Boolean),allRoles:_.userList.map(i=>i.userRole),allAccountingClasses:_.allAccountingClasses,userList:_.userList}},function(e,n){return{onIssueCardClick:()=>{e(Oc())},onSaveChangesToLocalStore:t=>{e(Lc(t))},onDismissClick:()=>{e(dr()),n.navigate("../")},resetCustomAddressByLineID:(t,a)=>{e(ir(`${a==="creditCard"?"credit":"debit"}_custom_shipping_${t}_address`))},openAddAddressDrawerHandler:n.openAddAddressDrawerHandler}})(bo);function Bi(){const e=re.getSignedInUser(),n=de(),t=pe(),a=fo(),[s]=yn(),b=s.get("cardType"),{useFeatureGate:f}=le(),{isFeatureEnabled:g}=f(K.isIssuePhysicalCardEnabled),{isFeatureEnabled:_}=f(K.isIssuePhysicalDebitCardEnabled),{isFeatureEnabled:i}=f(K.isDebitCardFeatureEnabled),{isFeatureEnabled:m}=f(K.isChargeCardFeatureEnabled),R=o(z=>fe(z)),D=Te(i,R),d=Re({isDebitCardFeatureEnabled:i,isBankingOnlyTenant:D}),j=we(R),P=ve(R),B=R.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,p=xe({isCardsOnlyTenant:j,isChargeCardFeatureEnabled:m,isBookKeepingTenant:P,isDebitCardProductVisible:d,chargeCardsCreditAccountLimit:B}),[h,w]=r.useState(!1);if(e==null)throw Error("Can't access issue card page without signing in...");r.useEffect(()=>{h||(w(!0),t(Bc(d&&T,p&&u,!1)))},[h,w,t]);const u=!!R.companyChargeCardInfo?.info?.isChargeCardEnabled,T=!!R.companyDebitCardInfo?.info?.isDebitCardEnabled,k=o(z=>vt(z,p&&u,d&&T)),M=k.fetchState,A=k.issueCardStatus.fetchState,y=k.lastSelfIssuedDebitCardId,L=o(z=>y!=null?or(z.chargeCardState,y):void 0),[l,C]=r.useState(null),[N,G]=r.useState(null),O=()=>{C(null)},U=(z,Z)=>{C(z),G(Z)};return r.useEffect(()=>{if(A==="Completed"){if(y!=null&&L?.type.code==="business_virtual_debit_card"){let z;z=L?.status.code==="request_on_hold"&&e.userId===L.cardHolderUserId?Ar(R.tenantEmailDomain):Ae(R.tenantEmailDomain,y,e,L),n(z)}else n("../");t(dr())}},[A,y]),M==="Completed"?c.jsxs(c.Fragment,{children:[l!==null&&N!==null?c.jsx(Ri,{closeDrawerHandler:O,lineId:l,chargeCardTypeOption:N}):null,c.jsx(xi,{themeState:a,isIssuePhysicalCardEnabled:g,isIssuePhysicalDebitCardEnabled:_,isDebitCardFeatureEnabled:d,isChargeCardFeatureEnabled:p,isChargeCardSetupEnabled:u,isDebitCardSetupEnabled:T,navigate:n,fetchState:k.fetchState,openAddAddressDrawerHandler:U,defaultCardType:b==="creditCard"||b==="debitCard"?b:void 0})]}):M==="Error"?c.jsx(ot,{}):c.jsx(go,{})}const Vr=[ma,dt],Li=new Set(Vr),Oi=Ne.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
|
-
`,Ui=De(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:f}=n,{tenantEmailDomain:g}=a,{cards:_}=f;return{onChargeCardRowClick:i=>{const m=Er(_,i),R=Ae(g,i,b,m),D=ye(s.state?.pathnameStackToGoBack,s.pathname);t(R,{state:{pathnameStackToGoBack:D}})},onColumnSortConfigChanged:(i,m)=>{e(St({uiState:{sortKey:i,sortOrder:m}}))},onReloadCards:()=>{e(je())},onBackClick:()=>{const i=a.userRole.includes("charge_card_user");e(St({uiState:{sortKey:i?"cardName":"owner",sortOrder:"ascending"}})),t("../")}}})(So);function ji(){const e=de(),n=pe(),t=Ce(),a=Rt(),[s,b]=r.useState(!1),f=o(U=>Uc(U)),g=o(U=>fe(U)),_=o(U=>ca(U,g.companyId)),i=oa(_.controllers),{useFeatureGate:m}=le(),{isFeatureEnabled:R}=m(K.isChargeCardFeatureEnabled),{isFeatureEnabled:D}=m(K.isDebitCardFeatureEnabled),d=Te(D,g),j=Re({isDebitCardFeatureEnabled:D,isBankingOnlyTenant:d}),P=!!g.companyDebitCardInfo?.info?.isDebitCardEnabled,B=!!g.companyChargeCardInfo?.info?.isChargeCardEnabled,p=Fe(),h=we(g),w=ve(g),u=g.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,T=xe({isCardsOnlyTenant:h,isChargeCardFeatureEnabled:R,isBookKeepingTenant:w,isDebitCardProductVisible:j,chargeCardsCreditAccountLimit:u}),k=Pe(p?.loggedInUserRoleMap),M=o(U=>da(U)),{creditAccount:A,creditAccountRepayment:y}=o(U=>ia(U)),L=o(U=>rr(U)).cards.filter(U=>U.type.code.includes("debit")).map(U=>U.connectedAccountId),l=[...new Set(L)],C=o(U=>nt(U,l));r.useEffect(()=>{s||f.fetchState==="Completed"||f.fetchState==="In-Progress"||(b(!0),n(je()),n(Ja()))},[s,n,f.fetchState]),r.useEffect(()=>{if(f.fetchState==="Completed"&&f.cards.length===1&&N!=null){const U=Ae(g.tenantEmailDomain,f.cards[0].id,N,f.cards[0]);e(U,{state:{message:t.state?.message}})}},[f.fetchState,f.cards]);const N=re.getSignedInUser();r.useEffect(()=>{A.fetchState!=="Completed"&&A.fetchState!=="In-Progress"&&T&&B&&k&&n(qe()),y.fetchState!=="Completed"&&y.fetchState!=="In-Progress"&&k&&n(_t()),C.fetchState!=="Completed"&&C.fetchState!=="In-Progress"&&j&&P&&k&&n(sr())},[A.fetchState,y.fetchState,n,C.fetchState,j,P,k,T,B]);const G=Xe(g);if(Ut({events:Ca(G,Vr),onEvent:(U,z)=>{if(!Li.has(U))return;const Z=Gt(z);if(U===ma){const I=ie(Z?.card_id);if(I!=null){const x=$t(Z,I);if(x!=null)return void n(Pt(x))}}n(je(!0))},onSubscribed:()=>{n(je(!0))}}),N==null)throw Error("Can't access address page without signing in...");const O=f.cards!=null&&f.cards.length>0;if(f.fetchState==="Completed"||O){const U=Je(T,j,P,B);return c.jsx(Oi,{children:c.jsx(Ui,{navigate:e,currentTenant:g,signedInUser:N,productInformation:U,myPendingActivationChargeCardListState:f,isChargeCardFeatureEnabled:T,isDebitCardFeatureEnabled:j,isDebitCardSetupEnabled:P,isChargeCardSetupEnabled:B,chargeCardCashbackDetailState:M,creditAccount:A,creditAccountRepayment:y,depositAccountListWithDebitCardIssued:C,controllerEmails:i,location:t})})}return c.jsx(va,{fetchState:"In-Progress",style:{backgroundColor:a.colors.grey5}})}const Mi=De(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:f,signedInUser:g,location:_,productInformation:i,isEarlyPayEnabled:m,controllerEmails:R,chargeCardsCreditAccountLimit:D}=n;return{onSetupButtonClick:d=>{if(g!=null&&J.trackCardsPromoPageClicked("enable cards"),s)switch(J.trackCardsEnableCardsClick(R,i,"Cards Promo"),d){case"credit":e(We(a,!0,"charge_cards",m,!1));break;case"debit":e(We(a,!0,"debit_cards",m,!1));break;case"debit_and_credit":e(D===0?We(a,!0,"debit_cards",m,!0):We(a,!0,"charge_cards__debit_cards",m,!1))}else switch(J.trackCardsSetupCardsClick(R,i,"Cards Promo"),d){case"credit":e(We(a,!1,"charge_cards",m,!1));break;case"debit":e(We(a,!1,"debit_cards",m,!1));break;case"debit_and_credit":e(D===0?We(a,!1,"debit_cards",m,!0):We(a,!1,"charge_cards__debit_cards",m,!1))}},onBackClick:()=>{const d=_e(_.state?.pathnameStackToGoBack);let j=d.poppedPathname;j==null&&(j=b||f?"..":"../.."),t(j,{state:{pathnameStackToGoBack:d.newStack}})},onLetsGoClick:()=>{t("./onboard")},onSetupChargeCardSuccess:()=>{s?(e(Xa()),t("../",{relative:"path"})):t("../setup",{relative:"path"})},onExpressInterestClick:()=>{e(Nc(a))}}})(Io),Ni=()=>{const e=de(),{tenantEmailDomain:n}=Me(),[t]=yn(),a=t.get("cardPromoType"),s=pe(),{useDynamicConfig:b,useFeatureGate:f}=le(),[g,_]=r.useState(!1),{isFeatureEnabled:i}=f(K.isDebitCardFeatureEnabled),{isFeatureEnabled:m}=f(K.isEarlyPayFeatureEnabled),{isFeatureEnabled:R}=f(K.isChargeCardFeatureEnabled),{configValue:D}=b(ze.zeniCardsConfig),d=o(ne=>fe(ne)),j=o(ne=>ca(ne,d.companyId)),P=oa(j.controllers),B=D.charge_card_cashback_rate_per_transaction!=null?D.charge_card_cashback_rate_per_transaction:.0175,p=Ce(),h=re.getSignedInUserTenant(n)?.companyId??d.companyId,w=o(ne=>wa(ne,h)),u=w.primaryFundingAccount,T=d.companyBillPayInfo?.info,k=we(d),M=ve(d),A=Te(i,d),y=d.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,L=Re({isDebitCardFeatureEnabled:i,isBankingOnlyTenant:A}),l=xe({isCardsOnlyTenant:k,isChargeCardFeatureEnabled:R,isBookKeepingTenant:M,isDebitCardProductVisible:L,chargeCardsCreditAccountLimit:y}),C=kr({isCardsOnlyTenant:k,isChargeCardFeatureEnabled:R,isBookKeepingTenant:M}),N=L&&l===!1,G=T?.businessVerificationStatus?.code==="verified"&&(N||u?.accType==="depositAccount"||jc(u?.providerVerificationStatus?.code??"")),O=re.getSignedInUser(),U=!!d.companyZeniAccountInfo?.info?.isZeniAccountEnabled,z=!!d.companyChargeCardInfo?.info?.isChargeCardTOSAccepted,Z=!!d.company?.companyChargeCardInfo.isChargeCardEnabled,I=!!d.company?.companyDebitCardInfo.isDebitCardEnabled,x=!!d.companyDebitCardInfo?.info?.isDebitCardTOSAccepted,Y=ne=>{_(ne)},q=o(ne=>ne.chargeCardSetupViewState.fetchState);if(O==null)throw Error("Can't access Charge Card promo page without signing in...");const E=Fe(),V=Pe(E?.loggedInUserRoleMap),Q=wt(E?.loggedInUserRoleMap),[X,S]=r.useState(!1),[F,v]=r.useState(!1),[ee,W]=r.useState(!1);r.useEffect(()=>{X===!1&&p.state?.message==="activation"&&S(!0)},[p.state]),r.useEffect(()=>{F||q!=="Not-Started"||h==null||(v(!0),s(Pa(h,!0)))},[F,q,h,s]);const ke=d.companyChargeCardInfo?.info!=null&&Ia({cardInfo:d.companyChargeCardInfo.info,isProductVisible:C,isTOSAccepted:z,isSetupEnabled:Z,isUserHasCardsAdminLevelAccess:V,isUserHasCardsAccess:Q}),be=d.companyDebitCardInfo?.info!=null&&Ia({cardInfo:d.companyDebitCardInfo.info,isProductVisible:L,isTOSAccepted:x,isSetupEnabled:I,isUserHasCardsAdminLevelAccess:V,isUserHasCardsAccess:Q}),ge=L&&be&&C&&y>=0&&ke?"debit_and_credit":L&&be?"debit":"credit",ae=Po(a,ge),ue=w?.chargeCardTermsDetails?.fetchStatus?.fetchState,oe=r.useRef(null);r.useEffect(()=>{ue==="In-Progress"?oe.current=ae:ue!=="Error"&&ue!=="Not-Started"||(oe.current=null)},[ue,ae]);const te=ue!=="In-Progress"&&ue!=="Completed"||oe.current==null?ae:oe.current;r.useEffect(()=>{ae==="credit"&&(Z||C===!1&&I)||ae==="debit"&&I||ae==="debit_and_credit"&&I&&Z?e("../"):(ae==="debit_and_credit"&&z===!0&&x===!0||ae==="credit"&&(z===!0||C===!1&&x===!0)||ae==="debit"&&x===!0)&&V===!0&&e("../setup")},[G,Z,I,ae,z,x]),r.useEffect(()=>{ee||(s(Mc("cardAdmin")),W(!0))},[ee]);const Ze=o(ne=>tr(ne.userState,ne.userRoleState,ne.userListViewState,"cardAdmin")),Ee=Je(C,L,I,Z);return(ke||be)&&q==="Completed"?c.jsxs(c.Fragment,{children:[c.jsx(xt,{analytics:J,onLoad:()=>{if(J.trackPageLoaded(Sr.Event.cardsPromoPage),!!C&&!Z||!!L&&!I||!!C&&!!L&&!I&&!Z){const ne=Vi({isDebitCardSetupEnabled:I,isChargeCardSetupEnabled:Z,isCreditCardProductVisibleForExpressInterest:C,isDebitCardProductVisible:L});J.trackCardsPromoView(P,Ee,"Page",ne,"Promo Page")}}}),c.jsx(rt,{showConfetti:X}),c.jsx(Ie,{isAppContentDrawerOpen:g,handleDrawerToggle:Y}),c.jsx(Mi,{signedInUser:O,location:p,showEnableCardButton:G,isCompanyBusinessVerificationAndPaymentSetUpDone:G,isChargeCardSetupEnabled:Z,isDebitCardSetupEnabled:I,companyLegalName:d.companyName,adminList:Ze.users,isCheckingEnabled:U,navigate:e,companyId:h,cardPromoType:te,controllerEmails:P,productInformation:Ee,isCreditCardProductVisible:l,isDebitCardFeatureEnabled:i,isEarlyPayEnabled:m,cashbackRate:B,chargeCardsCreditAccountLimit:y,onClickMenuIcon:()=>{Y(!0)}})]}):c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:g,handleDrawerToggle:Y}),c.jsx(yo,{})]})},Vi=({isDebitCardSetupEnabled:e,isChargeCardSetupEnabled:n,isCreditCardProductVisibleForExpressInterest:t,isDebitCardProductVisible:a})=>t&&a&&!e&&!n?"Credit & Debit Card":t&&!n?"Credit Card":a&&!e?"Debit Card":"";function md(){const e=Ce(),n=o(E=>fe(E)),{useFeatureGate:t}=le(),{isFeatureEnabled:a}=t(K.isChargeCardFeatureEnabled),{isFeatureEnabled:s}=t(K.isDebitCardFeatureEnabled),{isFeatureEnabled:b}=t(K.isEarlyPayFeatureEnabled),{isFeatureEnabled:f}=t(K.isChargeCardPaymentHistoryFeatureEnabled),{isFeatureEnabled:g}=t(K.isCardPolicyEnabled),_=Te(s,n),i=Re({isDebitCardFeatureEnabled:s,isBankingOnlyTenant:_}),m=ko(n,a,s),R=!!n.company?.companyChargeCardInfo.isChargeCardTOSAccepted,D=!!n.company?.companyDebitCardInfo.isDebitCardTOSAccepted,d=!!n.company?.companyChargeCardInfo.isChargeCardEnabled,j=!!n.company?.companyDebitCardInfo.isDebitCardEnabled,P=Fe(),B=Pe(P?.loggedInUserRoleMap),p=wt(P?.loggedInUserRoleMap),{isFeatureEnabled:h}=t(K.isCashbackFeatureEnabled),w=n.userRole.includes("charge_card_user"),u=!w,T=!w&&d,k=n?.userRole!=null&&Vc(n?.userRole),M=(n?.company==null||n.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!k)&&Hc(P?.loggedInUserRoleMap),A=Gc(P?.loggedInUserRoleMap),y=(n?.company==null||n.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!k)&&$c(P?.loggedInUserRoleMap),{isFeatureEnabled:L}=t(K.isDepositAccountsFeatureEnabled),l=L&&!k&&Gn(P?.loggedInUserRoleMap),C=d&&!k,N=j&&!k,G=m&&!k&&Pe(P?.loggedInUserRoleMap),O=zc(P?.loggedInUserRoleMap),U=we(n),z=ve(n),Z=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,I=xe({isCardsOnlyTenant:U,isChargeCardFeatureEnabled:a,isBookKeepingTenant:z,isDebitCardProductVisible:i,chargeCardsCreditAccountLimit:Z}),x=n.companyChargeCardInfo?.info!=null&&Ia({cardInfo:n.companyChargeCardInfo.info,isProductVisible:I,isTOSAccepted:R,isSetupEnabled:d,isUserHasCardsAdminLevelAccess:B,isUserHasCardsAccess:p}),Y=n.companyDebitCardInfo?.info!=null&&Ia({cardInfo:n.companyDebitCardInfo.info,isProductVisible:i,isTOSAccepted:D,isSetupEnabled:j,isUserHasCardsAdminLevelAccess:B,isUserHasCardsAccess:p}),q=x||Y;return c.jsxs(as,{children:[B?c.jsx(se,{path:"setup",element:c.jsx(Cn,{isBillPayAdminLevelAccess:M,isReimbursementAdminLevelAccess:y,isZeniAccountAdminLevelAccess:l,isChargeCardAdminLevelAccess:G,isUserHasOnlyCardAccess:O,isUserHasOnlyBillPayAccess:A,productType:"charge_cards",type:"setup"})}):null,B?c.jsx(se,{path:"verification",element:c.jsx(Cn,{isBillPayAdminLevelAccess:M,isUserHasOnlyBillPayAccess:A,isReimbursementAdminLevelAccess:y,isZeniAccountAdminLevelAccess:l,isChargeCardAdminLevelAccess:G,isUserHasOnlyCardAccess:O,productType:"charge_cards",type:"verification"})}):null,B&&g?c.jsxs(c.Fragment,{children:[c.jsx(se,{path:"policy",element:c.jsx(Vo,{})}),c.jsx(se,{path:"policy/new",element:c.jsx(Ro,{})}),c.jsx(se,{path:"policy/:templateId/edit",element:c.jsx(Oo,{})})]}):null,c.jsx(se,{path:"promo",element:c.jsx(Ni,{})}),C||N?c.jsxs(c.Fragment,{children:[c.jsx(se,{path:"/",element:c.jsx(fn,{isPaymentDrawerOpen:!1})}),G&&b?c.jsx(se,{path:"payment",element:c.jsx(fn,{isPaymentDrawerOpen:!0})}):null,c.jsx(se,{path:"activate",element:c.jsx(ji,{})}),c.jsx(se,{path:"onboard",element:c.jsx(ki,{})}),B?c.jsx(se,{path:"new",element:c.jsx(Bi,{})}):null,h&&u?c.jsx(se,{path:"cashback",element:c.jsx(Zo,{})}):null,T?c.jsx(se,{path:"statements",element:c.jsx(Si,{})}):null,G&&f&&d?c.jsx(se,{path:"payment-history",element:c.jsx(bi,{})}):null,c.jsx(se,{path:":cardId/activate",element:c.jsx(Wo,{})}),c.jsx(se,{path:":cardId/setPin",element:c.jsx(_i,{})}),c.jsx(se,{path:":cardId/addToWallet",element:c.jsx(Ho,{})}),c.jsx(se,{path:":cardId/*",element:c.jsx(si,{})}),c.jsx(se,{path:"*",element:c.jsx(ot,{})})]}):(R||D)&&B?c.jsx(se,{path:"*",element:c.jsx(Sa,{to:"../setup"})}):q?c.jsx(se,{path:"*",element:c.jsx(Sa,{to:"../promo",state:e.state})}):c.jsx(se,{path:"*",element:null})]})}export{md as default};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{j as C}from"./liveblocks-8SEYIom7.js";import{a}from"./sentry-Bpr6hwv_.js";import{u as D,g as v,j as m,N as w}from"./core-D95G1COY.js";import{L6 as A,eT as O,fA as L,o2 as _,gn as h,fz as j,f6 as U,Ld as F}from"./zeni-epic-state-BnmnEdbj.js";import{u as $,z as f,L as g,O as k,o as z}from"./index-C8tyyalR.js";import{n as H}from"./mui-jqvOLufq.js";import{t as R}from"./getLocaleForTenant-HT8Btw6T.js";import{g as P,Q as G}from"./QBOConnectionScreen-DwoHkIu2.js";import"./recharts-B5BD4Kau.js";import"./analytics-DORMe8dT.js";import"./plaid-BvitY7vM.js";import"./dnd-BXlaBlTc.js";import"./stripe-DMRn4zHo.js";import"./lottie-DGqwGfHh.js";import"./lexical-D90cNSQE.js";import"./pdf-CMafEn8a.js";import"./utils-kj_q6fLI.js";import"./empty-BE68b5E4.js";import"./pdf-lib-C0lYQdSO.js";import"./index-CruHx9g6.js";import"./url-tRs_qG1D.js";import"./index-DLVDaPoM.js";import"./decodeURIComponentSafe-BLmfpdcW.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]="a9a9fb66-2dd1-4fb1-9c31-a159376c72a5",t._sentryDebugIdIdentifier="sentry-dbid-a9a9fb66-2dd1-4fb1-9c31-a159376c72a5")}catch{}})();const Q=H.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
flex: 1 1 auto;
|
|
4
|
-
flex-direction: row;
|
|
5
|
-
justify-content: center;
|
|
6
|
-
align-items: center;
|
|
7
|
-
width: 100%;
|
|
8
|
-
height: 100vh;
|
|
9
|
-
background-color: ${t=>t.theme.colors.background};
|
|
10
|
-
box-shadow: ${t=>`0px 2px ${z.sp1} ${t.theme.colors.dropShadowNormal}`};
|
|
11
|
-
`;function ce(){const t=D(),i=v(),{setLoading:d,clearAllLoading:b}=$(),c=a.useRef(!1),p=a.useRef(!1),{code:x,realmId:T,state:y}=P(i.search),N=x!==""&&T!==""&&y!=="",I=m(l=>A(l)),e=m(l=>O(l)),n=m(l=>l.tenantState.fetchState),r=m(l=>l.tenantState.activeTenantFetchState.fetchState),o=f.getSignedInUser(),u=f.getActiveTenantForUser()?.tenantId,s=e?.externalConnections?.fetchState,E=e?.externalConnections?.saveConnectionState,S=e.externalConnections?.accounting[0]?.isValid;return a.useLayoutEffect(()=>{d(g.CONNECTION_AUTH)},[d]),a.useEffect(()=>{c.current||o==null||u==null||(c.current=!0,n==="Completed"||r!=="Not-Started"&&r!=="Error"||(d(g.TENANT_FETCHING),t(L(o.userId,u))))},[c,n,d]),a.useEffect(()=>{e.tenantId==null&&!p.current&&o!=null&&(p.current=!0,!(u==null||u!=null&&(r==="Completed"||r==="Error"))||n!=="Not-Started"&&n!=="Error"||t(_(o.userId)))},[p,n,r]),a.useEffect(()=>{o==null||e?.tenantId==null||e.externalConnections!=null||n!=="Completed"&&r!=="Completed"||s==="In-Progress"||E!=="Error"||(d(g.CONNECTION_AUTH),t(h(o.userId,e.tenantId)))},[E]),a.useEffect(()=>{n!=="Completed"&&r!=="Completed"||o==null||e?.tenantId==null||(t(j(e.tenantId)),f.saveActiveTenantDomainForUser(e.tenantEmailDomain),U(o?.userId,o?.zeniSessionId,e.tenantId),k.updateAppLocaleID(R(F(e))),e.externalConnections!=null||n!=="Completed"&&r!=="Completed"||s==="In-Progress"||o==null||e==null||t(h(o.userId,e.tenantId)))},[n,r,s]),a.useEffect(()=>{I.tenantsCoreDetailsInOrder.length>0&&n==="Completed"&&f.saveSignedInUserTenants(I.tenantsCoreDetailsInOrder)},[I.tenantsCoreDetailsInOrder.length,n]),a.useEffect(()=>{n!=="Completed"&&n!=="Error"||r!=="Completed"&&r!=="Error"||s!=="Completed"&&s!=="Error"||b()},[n,r,s]),e==null||n!=="Completed"&&r!=="Completed"||s!=="Completed"?null:N||S===!1?C.jsx(Q,{children:C.jsx(G,{})}):C.jsx(w,{to:"/",replace:!0})}export{ce as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as i}from"./liveblocks-8SEYIom7.js";import{z as n}from"./index-C8tyyalR.js";import{g as d}from"./QBOConnectionScreen-DwoHkIu2.js";import"./sentry-Bpr6hwv_.js";import{g as p,N as s}from"./core-D95G1COY.js";import"./zeni-epic-state-BnmnEdbj.js";import"./recharts-B5BD4Kau.js";import"./mui-jqvOLufq.js";import"./analytics-DORMe8dT.js";import"./plaid-BvitY7vM.js";import"./dnd-BXlaBlTc.js";import"./stripe-DMRn4zHo.js";import"./lottie-DGqwGfHh.js";import"./lexical-D90cNSQE.js";import"./pdf-CMafEn8a.js";import"./utils-kj_q6fLI.js";import"./empty-BE68b5E4.js";import"./pdf-lib-C0lYQdSO.js";import"./index-CruHx9g6.js";import"./url-tRs_qG1D.js";import"./index-DLVDaPoM.js";import"./decodeURIComponentSafe-BLmfpdcW.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 v}from"./liveblocks-8SEYIom7.js";import{a as u}from"./sentry-Bpr6hwv_.js";import{u as y,j as b,n as A,g as w,N as L}from"./core-D95G1COY.js";import{L6 as N,eT as _,fA as U,L7 as k,o2 as R,L8 as z}from"./zeni-epic-state-BnmnEdbj.js";import{u as O,z as f,L as T,t as I,O as j,b as $}from"./index-C8tyyalR.js";import"./mui-jqvOLufq.js";import{t as P}from"./getLocaleForTenant-HT8Btw6T.js";import"./recharts-B5BD4Kau.js";import"./analytics-DORMe8dT.js";import"./plaid-BvitY7vM.js";import"./dnd-BXlaBlTc.js";import"./stripe-DMRn4zHo.js";import"./lottie-DGqwGfHh.js";import"./lexical-D90cNSQE.js";import"./pdf-CMafEn8a.js";import"./utils-kj_q6fLI.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="ab1db5a0-1f88-4749-8c83-3457072bd43a",t._sentryDebugIdIdentifier="sentry-dbid-ab1db5a0-1f88-4749-8c83-3457072bd43a")}catch{}})();const Q=A(function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:z(t).tenantsInOrder}})(function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=w(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map(l=>l.tenantEmailDomain),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,S=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce((l,F)=>l||i.split("/").find(D=>D===F)!=null,!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,S=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=$(c,p);return v.jsx(L,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:S}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=O(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b(e=>N(e)),n=b(e=>e.tenantState.fetchState),i=b(e=>e.tenantState.error),a=b(e=>e.tenantState.activeTenantFetchState.fetchState),c=b(e=>_(e)),d=f.getSignedInUser();return u.useLayoutEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,h.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)},[a,n]),u.useEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&I.shouldFetchActiveTenant(e)&&(h.current=!0,I.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(U(d.userId,e))))},[n,a,d,t]),u.useEffect(()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,S=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&S&&I.shouldFetchAllTenants()&&(r.current=!0,I.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!k(i))&&t(R(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(j.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(Q,{})}const q=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],G={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of q)if(t.toLocaleLowerCase().includes(s))return G[s]}export{oe as default};
|