@zeniai/web-app-ui 5.3.63-dev → 5.3.64-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AccountMappingScreen-BRZHYOUR.js → AccountMappingScreen-xfXO279W.js} +2 -2
- package/dist/assets/{ActualMatchingMatchDetailScreen-CT_TfQgQ.js → ActualMatchingMatchDetailScreen-ByqHVLf7.js} +1 -1
- package/dist/assets/AddressRoutes-BWVJyPk8.js +1 -0
- package/dist/assets/{AddressScreen-CrINuapd.js → AddressScreen-CrPViFiu.js} +2 -2
- package/dist/assets/{AiCfoScreen-BXw0LDjo.js → AiCfoScreen-DXsXYKZU.js} +1 -1
- package/dist/assets/{AppDrawer-DZIMVdFc.js → AppDrawer-B2rHD8Zo.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-Dp_PkbIk.js → BillPayApprovalRoutes-CMAUuUUB.js} +1 -1
- package/dist/assets/{BillPayRoutes-CUUjBefv.js → BillPayRoutes-Dmusj5HX.js} +1 -1
- package/dist/assets/{BusinessVerificationPageScreen-DFamYzxa.js → BusinessVerificationPageScreen-C-aPhqey.js} +2 -2
- package/dist/assets/CardsAiCfoScreen-CTX5PjYy.js +14 -0
- package/dist/assets/{ChargeCardRoutes-DzIBuJeY.js → ChargeCardRoutes-JBiL4Thy.js} +1 -1
- package/dist/assets/CompanyPassportScreen-Df3GjmsH.js +1 -0
- package/dist/assets/ConnectionAuthScreen-CRXLzdg9.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-DSYY256B.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-CjmJGGJm.js → CustomerOnboardingRoutes-C2sAsjXY.js} +3 -3
- package/dist/assets/{DashboardRoutes-ByHBLKcB.js → DashboardRoutes-B3_TJQND.js} +4 -4
- package/dist/assets/{DefaultTenantHome-Dm9FOXup.js → DefaultTenantHome-4mMU5w7G.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-086WQWRB.js → DomesticWireDetailScreen-DQXD1NSK.js} +3 -3
- package/dist/assets/{DrawerScreen-B5BqRZEJ.js → DrawerScreen-DyQejCID.js} +1 -1
- package/dist/assets/{EntityDetailRoutes-BuN3sXNp.js → EntityDetailRoutes-0npRYuOC.js} +1 -1
- package/dist/assets/{ExpenseAutomationRoutes-Ce3IicTe.js → ExpenseAutomationRoutes-SlF4KM3u.js} +7 -7
- package/dist/assets/FeaturePreviewScreen-OtBPdCPK.js +1 -0
- package/dist/assets/{HubSpotOAuthCallbackScreen-BRUwb2B6.js → HubSpotOAuthCallbackScreen-CtTG0u9D.js} +1 -1
- package/dist/assets/{InboxNotificationsProvider-x0fdv66l.js → InboxNotificationsProvider-CYNlrTK-.js} +1 -1
- package/dist/assets/InvoicingRoutes-DBwLj6Ir.js +2 -0
- package/dist/assets/{MagicLinkRoutes-C5BKMtwW.js → MagicLinkRoutes-D5UwoWcf.js} +8 -8
- package/dist/assets/{MagicLinkSignInScreen-9LYlxmop.js → MagicLinkSignInScreen-B_572HKC.js} +1 -1
- package/dist/assets/{MobileAppDrawer-DX2JnkbM.js → MobileAppDrawer-DLFLa7hS.js} +1 -1
- package/dist/assets/NotFoundScreen-DzxbROot.js +1 -0
- package/dist/assets/{NotificationRoutes-DICT3yoM.js → NotificationRoutes-D7MHUmyT.js} +1 -1
- package/dist/assets/{OAuthConsentScreen-BmiLDdxn.js → OAuthConsentScreen-iNKlAsfd.js} +1 -1
- package/dist/assets/{PandLWithForecastRoutes-DAq9XRB1.js → PandLWithForecastRoutes-COCZ3G6X.js} +1 -1
- package/dist/assets/{PaymentLinkScreen-Cz1wlNqO.js → PaymentLinkScreen-Bh4jK9uE.js} +9 -9
- package/dist/assets/{PeopleRoutes-DgYtveDU.js → PeopleRoutes-BkRUXc0D.js} +5 -5
- package/dist/assets/{PerformanceRoutes-B6iTINLg.js → PerformanceRoutes-BzDFWREu.js} +1 -1
- package/dist/assets/{Preview-Dz6yJNce.js → Preview-Cqz8sG2s.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-D8eeXRWb.js → QBOConnectionScreen-DreC-yDW.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRoutes-CE6y6IwA.js → ReimbursementApprovalRoutes-DPScUcq4.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BT_O_PEv.js → ReimbursementApprovalRuleDetailScreen-BxglZgWl.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-BmOT-3C-.js → ReimbursementRoutes-DveTyQyE.js} +4 -4
- package/dist/assets/{ReportsRoutes-CqUKv9Uh.js → ReportsRoutes-BZjyXdiB.js} +1 -1
- package/dist/assets/RewardsRoutes-zL93sOaR.js +1 -0
- package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-CLEogplJ.js → ScheduleDetailsPrepaidExpensesScreen-PbMzJVD9.js} +5 -5
- package/dist/assets/{ScreenRoutes-xDjhbdP1.js → ScreenRoutes-Bl2EONFe.js} +2 -2
- package/dist/assets/{SettingsRoutes-QcMcR-j3.js → SettingsRoutes-hveOvbi9.js} +4 -4
- package/dist/assets/{SetupPagesScreen-fuvb0IYd.js → SetupPagesScreen-B8kiMdZf.js} +5 -5
- package/dist/assets/SignInScreen-CGBu1NjI.js +1 -0
- package/dist/assets/SignOutScreen-D0F6FeVm.js +9 -0
- package/dist/assets/{TaskListScreen-C2urPjKT.js → TaskListScreen-Bi73r_uo.js} +2 -2
- package/dist/assets/{TaskRoutes-BuzkCbPW.js → TaskRoutes-DCW1uZnF.js} +2 -2
- package/dist/assets/TransactionDetailRoutes-CWMSCIXL.js +1 -0
- package/dist/assets/{TransactionDetailScreen-CQr1YyP0.js → TransactionDetailScreen-DVFrl6h2.js} +2 -2
- package/dist/assets/{TransactionListRoutes-BTidVr9Z.js → TransactionListRoutes-B3tJhd_n.js} +1 -1
- package/dist/assets/{TreasuryRoutes-CbD79DO8.js → TreasuryRoutes-BPVOZ6Bj.js} +5 -5
- package/dist/assets/{VendorsRoutes-CCYu89Uf.js → VendorsRoutes-CHDVO5Sr.js} +1 -1
- package/dist/assets/{WiseConfirmationScreen-B0HeU8Sh.js → WiseConfirmationScreen-Du3rEKnE.js} +1 -1
- package/dist/assets/{ZeniAccountRoutes-CoRmS3Mc.js → ZeniAccountRoutes-BzLWpyYJ.js} +9 -9
- package/dist/assets/{ZeniAccountStatementScreen-BnpFJ5jB.js → ZeniAccountStatementScreen-DaV7I7ku.js} +1 -1
- package/dist/assets/{accountMappingHelper-tmyjt9rr.js → accountMappingHelper-Gh8rpbjD.js} +1 -1
- package/dist/assets/analytics-S5MhEivL.js +68 -0
- package/dist/assets/{analyticsHelper-BEL0ra9X.js → analyticsHelper-Ch9SsWjb.js} +1 -1
- package/dist/assets/{core-CHD8T-IM.js → core-Cc7wW2EM.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-p_nrn8Pg.js → decodeURIComponentSafe-DhqIXi_U.js} +1 -1
- package/dist/assets/{dnd-Dwi6R-ey.js → dnd-DEyyKSEC.js} +1 -1
- package/dist/assets/{empty-CeRjDJvl.js → empty-6MFM8UPN.js} +1 -1
- package/dist/assets/{empty-CZC5CrVC.js → empty-CjY9w6q2.js} +1 -1
- package/dist/assets/{emptyVideoElement-BQ5qxpg6.js → emptyVideoElement-MGXFhhLz.js} +1 -1
- package/dist/assets/{epic-BW8jUHg5.js → epic-D9Y6xcsI.js} +1 -1
- package/dist/assets/{expenseAutomationHelper-kGR6VZFG.js → expenseAutomationHelper-iXuIUZiF.js} +1 -1
- package/dist/assets/{getLocaleForTenant-D-or0iZO.js → getLocaleForTenant-Bgt5rFzV.js} +1 -1
- package/dist/assets/{index-BVHBHjSe.js → index-2QCkbhu2.js} +1 -1
- package/dist/assets/{index-BMy5YH8G.js → index-BZ6qOKkD.js} +1 -1
- package/dist/assets/{index-yiW1aZfy.js → index-Cm43WhAF.js} +2 -2
- package/dist/assets/{index-CKiMoeFX.js → index-D2oCZR3F.js} +1 -1
- package/dist/assets/{index-XRUedCJ0.js → index-DpnxiqBj.js} +1 -1
- package/dist/assets/{index-C1KaIuMT.js → index-gtGWrJ79.js} +1 -1
- package/dist/assets/{index-w09kaOHP.js → index-ldlm2cjp.js} +1 -1
- package/dist/assets/{index-DKH4PK2B.js → index-vIt7RQvO.js} +4561 -4561
- package/dist/assets/{lexical-CMNdypK6.js → lexical-DXgKWO29.js} +1 -1
- package/dist/assets/{liveblocks-e6rGc1UF.js → liveblocks-CgHUgeBY.js} +1 -1
- package/dist/assets/{lottie-B778bt56.js → lottie-C1A2hiZE.js} +1 -1
- package/dist/assets/{mui-NTaF3UaY.js → mui-C4zFSCiU.js} +1 -1
- package/dist/assets/{pathToGoBack-3T3qt1CN.js → pathToGoBack-C17GqrA7.js} +1 -1
- package/dist/assets/{pdf-lib-CSbJ_JNk.js → pdf-lib-CsM74zBq.js} +1 -1
- package/dist/assets/{pdf-Bx92ZlM_.js → pdf-rXyPRm1U.js} +3 -3
- package/dist/assets/{plaid-DdTo7m1-.js → plaid-vsHcqLdj.js} +1 -1
- package/dist/assets/{pusher-TnSBrmnt.js → pusher-C0EhdUPA.js} +1 -1
- package/dist/assets/{react-BRi8TcMI.js → react-BU_8yW5D.js} +1 -1
- package/dist/assets/{react-Ci1ltUcy.js → react-CEepHjWP.js} +1 -1
- package/dist/assets/{react-Ba46BK4D.js → react-CzfY0Vx3.js} +1 -1
- package/dist/assets/{react-DJOUavGZ.js → react-DG8YneWb.js} +1 -1
- package/dist/assets/{react-B75Gnqob.js → react-Gc0eJCMR.js} +1 -1
- package/dist/assets/{react-COkaiBQo.js → react-Yy9ZuxR6.js} +1 -1
- package/dist/assets/{recharts-C6xUtcdL.js → recharts-DJGeJ2v_.js} +1 -1
- package/dist/assets/{routePaths-CGyE-cU7.js → routePaths-C0UIXwMQ.js} +1 -1
- package/dist/assets/{sentry-DsyKtMW2.js → sentry-DSWD_gIh.js} +1 -1
- package/dist/assets/{stripSplatSuffix-CKrdD9MQ.js → stripSplatSuffix-kLnY55Qt.js} +1 -1
- package/dist/assets/{url-Zl9uXQ4e.js → url-DCbpXgdk.js} +1 -1
- package/dist/assets/{url-ClJewK9Y.js → url-DUlo21cY.js} +1 -1
- package/dist/assets/{useActualMatchingMatchDetail-Cc17Q5Tv.js → useActualMatchingMatchDetail-CwcmHDQ8.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-CHbHmZzx.js → useAiCfoDashboardSuggestedQuestionsChips-BFr557mr.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-7-6nPEHY.js +1 -0
- package/dist/assets/{useChargeCardPusherEvents-BWi4_PP5.js → useChargeCardPusherEvents-BVr00Fos.js} +1 -1
- package/dist/assets/{useDeviceId-VsdzmSZI.js → useDeviceId-B5zol9VP.js} +1 -1
- package/dist/assets/{useEmailConnectResultRefresh-ClXdZp-6.js → useEmailConnectResultRefresh-HcMCYvt9.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-DDr_z_RH.js → useInitialThreadRequest-D4Y8xhXu.js} +1 -1
- package/dist/assets/{useTaskManagerAccess-CUv6a62x.js → useTaskManagerAccess-BeNfkHpZ.js} +1 -1
- package/dist/assets/{useTaskManagerPusherEvents-DCIopLVZ.js → useTaskManagerPusherEvents-X_H33C0C.js} +1 -1
- package/dist/assets/{utils-CCA3F0sZ.js → utils-DiIEQ7_h.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-B_xgLNm6.js → withTransactionSidePanel-DkQdwLfY.js} +4 -4
- package/dist/assets/{zeni-epic-state-BO3zdDfL.js → zeni-epic-state-BVJjEVAA.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +3 -3
- package/dist/assets/AddressRoutes-CisWqyoC.js +0 -1
- package/dist/assets/CardsAiCfoScreen-Cx5KkOYw.js +0 -14
- package/dist/assets/CompanyPassportScreen-CENbDnLW.js +0 -1
- package/dist/assets/ConnectionAuthScreen-DTyZxcME.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-zLmHJyqv.js +0 -1
- package/dist/assets/FeaturePreviewScreen-D54Nwanb.js +0 -1
- package/dist/assets/InvoicingRoutes-IQsFojD0.js +0 -2
- package/dist/assets/NotFoundScreen-CtgFRYZy.js +0 -1
- package/dist/assets/RewardsRoutes-D5CR9NnI.js +0 -1
- package/dist/assets/SignInScreen-ekGlkjLH.js +0 -1
- package/dist/assets/SignOutScreen-9NJIr2hr.js +0 -9
- package/dist/assets/TransactionDetailRoutes-D99Yv6kv.js +0 -1
- package/dist/assets/analytics-C3e3An3a.js +0 -68
- package/dist/assets/useAskAiCfoHostNavButtonProps-BcCbRGDK.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-vIt7RQvO.js"></script><link rel="modulepreload" crossorigin href="/assets/sentry-DSWD_gIh.js"><link rel="modulepreload" crossorigin href="/assets/core-Cc7wW2EM.js"><link rel="modulepreload" crossorigin href="/assets/zeni-epic-state-BVJjEVAA.js"><link rel="modulepreload" crossorigin href="/assets/mui-C4zFSCiU.js"><link rel="modulepreload" crossorigin href="/assets/analytics-S5MhEivL.js"><link rel="modulepreload" crossorigin href="/assets/utils-DiIEQ7_h.js"><link rel="stylesheet" crossorigin href="/assets/index-BhC2LNQw.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.3.
|
|
3
|
+
"version": "5.3.64-dev",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist/**/*"
|
|
6
6
|
],
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
"@sentry/core": "^9.42.1",
|
|
29
29
|
"@sentry/react": "^9.42.1",
|
|
30
30
|
"@stripe/stripe-js": "^4.4.0",
|
|
31
|
-
"@zeniai/client-analytics": "2.0.
|
|
31
|
+
"@zeniai/client-analytics": "2.0.95",
|
|
32
32
|
"@zeniai/client-epic-state": "5.2.62",
|
|
33
|
-
"@zeniai/web-components": "4.4.
|
|
33
|
+
"@zeniai/web-components": "4.4.1",
|
|
34
34
|
"color": "3.1.3",
|
|
35
35
|
"crypto-js": "4.2.0",
|
|
36
36
|
"dnd-core": "^16.0.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./liveblocks-e6rGc1UF.js";import{A as i}from"./AddressScreen-CrINuapd.js";import s from"./NotFoundScreen-CtgFRYZy.js";import"./sentry-DsyKtMW2.js";import{n as d,o as r}from"./core-CHD8T-IM.js";import"./zeni-epic-state-BO3zdDfL.js";import"./recharts-C6xUtcdL.js";import"./index-DKH4PK2B.js";import"./mui-NTaF3UaY.js";import"./analytics-C3e3An3a.js";import"./plaid-DdTo7m1-.js";import"./dnd-Dwi6R-ey.js";import"./stripe-cKAAJElX.js";import"./lottie-B778bt56.js";import"./lexical-CMNdypK6.js";import"./pdf-Bx92ZlM_.js";import"./utils-CCA3F0sZ.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]="81cbb5c1-1b56-4d87-a240-ae6c03b91825",t._sentryDebugIdIdentifier="sentry-dbid-81cbb5c1-1b56-4d87-a240-ae6c03b91825")}catch{}})();function _(){return e.jsxs(d,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(i,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(i,{})}),e.jsx(r,{path:"*",element:e.jsx(s,{})})]})}export{_ as default};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import{j as S}from"./liveblocks-e6rGc1UF.js";import{a as l}from"./sentry-DsyKtMW2.js";import{u as pe,h as he,g as Ce,j as M,i as fe,l as ge}from"./core-CHD8T-IM.js";import{a as Se,e7 as be,z as ye,e9 as Pe,eb as N,ec as we,bp as W,a9 as Ie,k as $,ed as H,en as Ee,G as ke,U as Ae,w as xe,eg as Te,eh as Ue,aw as _e,ek as Oe,el as ve,bl as Qe,em as Fe}from"./index-DKH4PK2B.js";import{gK as $e,fE as G,fF as je,g8 as De,jl as Le,jh as Ve,fG as z,gu as qe,go as Re,gq as B,gw as Me,gx as He,gy as ze,gz as Be,gA as Ne}from"./zeni-epic-state-BO3zdDfL.js";import{D as We,n as D,P as Ge,S as Ke}from"./mui-NTaF3UaY.js";import"./recharts-C6xUtcdL.js";import"./analytics-C3e3An3a.js";import"./plaid-DdTo7m1-.js";import"./dnd-Dwi6R-ey.js";import"./stripe-cKAAJElX.js";import"./lottie-B778bt56.js";import"./lexical-CMNdypK6.js";import"./pdf-Bx92ZlM_.js";import"./utils-CCA3F0sZ.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="efc22e3a-ad71-483d-86a3-fca2d3c8b5f4",e._sentryDebugIdIdentifier="sentry-dbid-efc22e3a-ad71-483d-86a3-fca2d3c8b5f4")}catch{}})();const K="chat-response-generated",Y="cards/ask",J="card_policy_hero";function j(e){return`/${e}/cards`}function X(e){return`/${e}/cards/policy`}const Ye=ge((function(e,a){const o=G(e),c=a.isSubmitting,d=Ue(e,{allUsers:a.allUsers,onCardPolicyVendorSearchTextChange:a.onCardPolicyVendorSearchTextChange});return{showSampleQuestions:a.sessionFromUrl==="new_chat"&&o.uiState.currentChatSessionId==null,aiCfoView:o,isSubmitting:c,isNewChatSession:a.sessionFromUrl==="new_chat",isFullView:!0,tableDownloadEndPoint:`${_e}/tableDownload`,exportDownloadEndPoint:Oe(),emailLinkQuestion:a.emailLinkQuestion,autoSubmitEmailLinkQuestion:a.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:a.onEmailLinkQuestionProcessed,isFileUploadEnabled:a.isFileUploadEnabled,isUploadPromoVisible:a.isUploadPromoVisible,onUploadPromoClose:a.onUploadPromoClose,...d}}),(function(e,a){const{location:o,currentTenant:c,userId:d,navigate:m,currentChatSessionId:h,allSessionsWithOrderedQuestionAnswers:E,isAiCardCreationEnabled:x,isCardPolicyEnabled:T,cardPolicyPageContext:U}=a,i=c.tenantEmailDomain,C=o.state?.referrer,p=C===J?X(i):j(i);return{onEventReceived:(n,t)=>{if(n===K&&typeof t.text=="string"&&typeof t.metadata=="object"){const s=t,f=He(s.type),b=s.metadata.chat_session_id??null,{currentChatSession:y,currentQuestionAnswer:u,currentQuestionAnswerSummary:P}=W(E,b);f!=="answer"?$.trackAICFOChatResponseGenerated(f,u?.question.questionText??"",s.text,b,Fe(P,y),s.metadata.message_id??null):$.trackAICFOChatAnswerGenerated(s.text,u?.question.questionText??"",(s.follow_up_questions?.length??0)>0,!!s.assumptions,!!s.insights,s.visualization!=null,ze(s.visualization?.type??"")??null,b,s.summarized_title,s.metadata.message_id??null),e(Be({chatSessionId:s.metadata.chat_session_id,responseType:f,fetchState:{fetchState:"Completed",error:void 0}})),e(Ne({chatSessionId:s.metadata.chat_session_id,answerPayload:s,userId:d}))}},onSubmit:(n,t,s,f)=>{n&&Qe(e,n,t,h,E,d,f,s,U)},updateCurrentInput:n=>{e(B(n))},onStopSubmit:()=>{},onUpdateScrollYOffset:n=>{e(Me(n))},onSelectSampleQuestion:()=>{},onBackClick:()=>{m(-1)},onCloseClick:()=>{m(p,{state:{...o.state}}),e(B(""))},togglePageView:()=>{m(p,{state:N(o.state)}),a.setIsAiCfoOpen(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{m(-1)},onNewChatClick:()=>{h!=null&&e(Re()),m((function(n){return`/${n}/${Y}`})(i),{state:{...o.state}})},onToggleCotCollapsed:(n,t)=>{e(qe({questionAnswerId:n,isCollapsed:t}))},...ve(e,{isAiCardCreationEnabled:x,isCardPolicyEnabled:T,currentChatSessionId:h,onAfterCardsCreationSubmit:()=>{a.setIsAiCfoOpen(!0),m(j(i),{state:{...o.state}})},onAfterCardPolicySubmit:()=>{a.setIsAiCfoOpen(!0),m(`/${i}/cards/policy`,{state:{...o.state}})}})}}))(xe(Te)),{spendManagement:{chargeCard:{cardsAiCfoHero:Z,cardPolicyAiCfoHero:ee}}}=ke.getLocalizedStrings(),A=Z.pageTitle,Je=ee.pageTitle,Xe=Z.chatHeaderSubtitle,Ze=ee.chatHeaderSubtitle,St=({isFileUploadEnabled:e})=>{const{setIsAiCfoOpen:a}=Se(),o=pe(),c=he(),d=Ce(),[m,h]=l.useState(!1),{allUsers:E,isAiCardCreationEnabled:x,isCardPolicyEnabled:T,onCardPolicyVendorSearchTextChange:U}=be();l.useEffect((()=>{o($e())}),[o]);const i=M((r=>G(r))),C=ye.getSignedInUser(),{session_id:p}=fe(),n=M((r=>je(r))),t=i.uiState.currentChatSessionId,s=n.tenantEmailDomain,{handleUploadPromoClose:f,isUploadPromoVisible:b}=Pe({isFileUploadEnabled:e,tenantEmailDomain:s}),y=d.state,u=y?.aiCfoInitialQuestion??null,P=!!y?.aiCfoShouldSubmit,w=y?.referrer===J,te=w?"card_policy":void 0,se=l.useMemo((()=>({title:w?Je:A,subtitle:w?Ze:Xe})),[w]),[ae,_]=l.useState(null),[oe,O]=l.useState(!1),v=l.useRef(!1);l.useEffect((()=>{v.current||u==null||u===""||(_(u),O(P),v.current=!0)}),[u,P]);const ne=l.useCallback((()=>{_(null),O(!1),c(d.pathname,{replace:!0,state:N(d.state)})}),[d.pathname,d.state,c]),ie=n.masterTOSInfo,g=ie?.isMasterTOSAccepted??!1,k=l.useRef(null);l.useEffect((()=>{if(g&&k.current!=null){const{question:r,shouldSubmit:I}=k.current;k.current=null,_(r),O(I),v.current=!1}}),[g]);const{visitedSessions:L}=we(t),Q=i.fetchState,F=i.uiState.chatSessionsNextPageToken.hasMore||!i.uiState.chatSessionsFirstPageFetched,V=t!=null?i.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",q=t==null||(i.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),R=i.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:re}=W(R,t),le=re.length===0;l.useEffect((()=>{t!=null&&p!==t&&c((function(r,I){return`/${r}/${Y}/${I}`})(s,t),{state:{...d.state},replace:!0})}),[t,p,s,c,d.state]),l.useEffect((()=>{p!=null&&t==null&&p!=="new_chat"&&o(De({sessionId:p,agentId:"controller"}))}),[]);const de=l.useMemo((()=>({events:L.map((r=>`private-encrypted-chat-${r}.${K}`)),eventCallback:(r,I,me)=>me.onEventReceived(r,I)})),[L]);if(l.useEffect((()=>{Q!=="In-Progress"&&F&&o(Le())}),[Q,F,o]),l.useEffect((()=>{t!=null&&V!=="In-Progress"&&q&&C!=null&&Q==="Completed"&&!F&&o(Ve(t,C.userId))}),[V,q,t,C,o]),C==null)throw Error("Can't access Cards AI CFO page without signing in...");const ce=p??"new_chat",ue=t!=null&&i.responseStateByChatSessionId?.[t]?.answer?.fetchState==="In-Progress";return S.jsxs(tt,{children:[S.jsx(Ie,{analytics:$,onLoad:r=>r.trackPageLoaded(Ae.Event.aiCFOPage)}),g?S.jsx(Ye,{...de,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:R,allUsers:E,isAiCardCreationEnabled:x,isCardPolicyEnabled:T,openOnboardingPage:()=>h(!0),userId:C.userId,setIsAiCfoOpen:a,navigate:c,sessionFromUrl:ce,location:d,isSubmitting:ue,isEmptyChatWithSession:le,customPageTitle:A,chatHeader:se,currentTenant:n,emailLinkQuestion:ae??void 0,autoSubmitEmailLinkQuestion:oe,onEmailLinkQuestionProcessed:ne,isFileUploadEnabled:e,isUploadPromoVisible:b,onUploadPromoClose:f,onCardPolicyVendorSearchTextChange:U,cardPolicyPageContext:te}):S.jsx(H,{isTOSAccepted:g,acceptMasterTOSState:i.masterTOSAcceptanceState,customPageTitle:A,onCloseClick:()=>{c(w?X(s):j(s),{state:{...d.state}})},onCompleteClick:()=>{g||n.userRoleId==null||(u!=null&&u!==""&&(k.current={question:u,shouldSubmit:P}),o(z(n.userRoleId)))}}),S.jsx(We,{anchor:"right",open:m,transitionDuration:250,PaperProps:{component:st,style:{width:`${Ee}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>h(!1),children:S.jsx(et,{onClick:r=>r.stopPropagation(),children:S.jsx(H,{isTOSAccepted:g,acceptMasterTOSState:i.masterTOSAcceptanceState,customPageTitle:A,onCloseClick:()=>h(!1),onCompleteClick:()=>{g||n.userRoleId==null||o(z(n.userRoleId)),h(!1)}})})})]})},et=D(Ke)`
|
|
2
|
-
display: flex;
|
|
3
|
-
min-height: 100%;
|
|
4
|
-
flex-direction: column;
|
|
5
|
-
`,tt=D.div`
|
|
6
|
-
flex: 1 1 auto;
|
|
7
|
-
display: flex;
|
|
8
|
-
flex-direction: column;
|
|
9
|
-
min-height: 0;
|
|
10
|
-
width: 100%;
|
|
11
|
-
`,st=D(Ge)`
|
|
12
|
-
box-shadow: ${({theme:e})=>e.colors.elevation2};
|
|
13
|
-
color: ${({theme:e})=>e.colors.grey4};
|
|
14
|
-
`;export{St as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as m}from"./liveblocks-e6rGc1UF.js";import{a as g}from"./sentry-DsyKtMW2.js";import{h as w,u as k,g as x,i as T,j as O,l as E}from"./core-CHD8T-IM.js";import{z as D,bt as F,a9 as P,k as V,U as j,r as C,bu as L,af as A,aH as U,p as B}from"./index-DKH4PK2B.js";import{fF as h,gI as M,BE as _,gD as z,c8 as R,Yh as Y,bn as G,uX as H,uL as X,mz as Z,o8 as S,Yi as $,bE as q,cE as N,oj as J,ot as K}from"./zeni-epic-state-BO3zdDfL.js";import"./mui-NTaF3UaY.js";import{d as Q}from"./routePaths-CGyE-cU7.js";import{M as W}from"./MobileAppDrawer-DX2JnkbM.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new a.Error().stack;n&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[n]="8609d434-5141-455f-aa13-f87d4ea761ef",a._sentryDebugIdIdentifier="sentry-dbid-8609d434-5141-455f-aa13-f87d4ea761ef")}catch{}})();const ee=E((function(a){const n=z(a),i=D.getSignedInUser(),p=h(a),c=p.tenantId,l={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=R(p?.userRole??[])&&n.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=Y(a.companyConfigState),t=a.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:n.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:n,allIndustries:e.companyIndustries??[],allNationalityCountries:t,isDisabled:f,authParams:l,filesEndPoint:`${A.fileMicroServiceBaseUrl}`,isZeniUser:G(i)}}),(function(a,n){const{companyId:i,currentTenant:p,navigate:c,location:l}=n,{tenantEmailDomain:f}=p;return{onScheduleClick:e=>{let t=e.href;t.includes("http")||(t="https://".concat(t)),window.open(t,"_blank")},onSaveAll:()=>{a(K())},onAddressClick:e=>{const t=Q(f,e),o=B(l.state?.pathnameStackToGoBack,l.pathname);c(t,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{a(J({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:t,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=t,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:b}=r,v={companyInfo:{...t,website:u!=""&&u!=null?N(u):void 0,meetingLink:y!=""&&y!=null?N(y):void 0,industry:t.industry.selectedOption,companyIndustryType:t.companyIndustryType?.selectedOption??void 0,companySubIndustry:t.companySubIndustry?.selectedOption??void 0,businessModel:t.businessModel.selectedOption??"",companySourceOfFunds:t.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:t.companySourceOfFundsDescription??void 0,countriesOfOperations:t.countriesOfOperations?.selectedOptions?.map((I=>I.length===2?I:U(I)))??[],transactionVolume:t.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:t.transactionVolumeDescription??void 0,regulatedStatus:t.regulatedStatus??void 0,regulatedStatusDescription:t.regulatedStatusDescription??void 0,usNexus:t.usNexus??void 0,usNexusTypes:t.usNexusTypes?.selectedOptions??[],purposeOfAccount:t.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:t.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?q(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:b.selectedOptions.map((I=>parseInt(I))),fileId:r.fileIds[0]}};a(S({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{a(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{a(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:void 0}]}))},onNewCompanyOfficerRemoved:e=>{a($(e))},onCompanyOfficerUpdated:e=>{a(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:e.userId}]}))},updateFilesEntity:e=>{a(Z({files:e}))},onDeleteFile:e=>{a(X(e))},onEditFileName:(e,t)=>{a(H(e,t.split(".")[0]))}}}))(L);function de(){const a=w(),n=k(),i=x(),{tenantEmailDomain:p}=T(),[c,l]=g.useState(!1),[f,e]=g.useState(!1),t=O((s=>s.companyViewState.passportView.fetchState)),o=O((s=>s.companyConfigState.fetchState)),r=O((s=>h(s))),d=r.companyId??D.getSignedInUserTenant(p)?.companyId;if(D.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect((()=>{c||t!=="Not-Started"||d==null||(l(!0),n(M(d)))}),[c,t,d,n]),g.useEffect((()=>{o==="Not-Started"&&n(_())}),[o,n]);const u=s=>{e(s)},y=t==="Not-Started"||t==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&t==="Error"?m.jsx(F,{onGoHome:()=>a("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(P,{analytics:V,onLoad:s=>s.trackPageLoaded(j.Event.companyPassport,C(i)?"Settings":"Company Passport")}),C(i)?m.jsx(W,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:a,location:i,isLoading:y,currentTenant:r,isSettings:C(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{j as I}from"./liveblocks-e6rGc1UF.js";import{a as o}from"./sentry-DsyKtMW2.js";import{u as P,h as R,g as H,j as C,N as w}from"./core-CHD8T-IM.js";import{TX as q,fF as z,gl as G,pS as J,gM as A,gk as M,gi as Q,Ul as V,gh as O}from"./zeni-epic-state-BO3zdDfL.js";import{u as X,z as E,L as D,G as B,J as K}from"./index-DKH4PK2B.js";import{n as W}from"./mui-NTaF3UaY.js";import{P as h,a as _}from"./AccountMappingScreen-BRZHYOUR.js";import{t as Y}from"./getLocaleForTenant-D-or0iZO.js";import{g as Z,Q as ee}from"./QBOConnectionScreen-D8eeXRWb.js";import"./recharts-C6xUtcdL.js";import"./analytics-C3e3An3a.js";import"./plaid-DdTo7m1-.js";import"./dnd-Dwi6R-ey.js";import"./stripe-cKAAJElX.js";import"./lottie-B778bt56.js";import"./lexical-CMNdypK6.js";import"./pdf-Bx92ZlM_.js";import"./utils-CCA3F0sZ.js";import"./MobileAppDrawer-DX2JnkbM.js";import"./InboxNotificationsProvider-x0fdv66l.js";import"./useTaskManagerAccess-CUv6a62x.js";import"./accountMappingHelper-tmyjt9rr.js";import"./empty-CeRjDJvl.js";import"./pdf-lib-CSbJ_JNk.js";import"./index-BVHBHjSe.js";import"./url-ClJewK9Y.js";import"./index-CKiMoeFX.js";import"./decodeURIComponentSafe-p_nrn8Pg.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]="29afd1c4-a201-482e-97d8-eda3675690cc",t._sentryDebugIdIdentifier="sentry-dbid-29afd1c4-a201-482e-97d8-eda3675690cc")}catch{}})();const te=W.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 ${K.sp1} ${t.theme.colors.dropShadowNormal}`};
|
|
11
|
-
`;function we(){const t=P(),i=R(),v=H(),{setLoading:c,clearAllLoading:m}=X(),S=o.useRef(!1),x=o.useRef(!1),N=o.useRef(!1),p=o.useRef(!1),{code:U,realmId:$,state:F}=Z(v.search),f=U!==""&&$!==""&&F!=="";f&&(N.current=!0);const j=sessionStorage.getItem(h),u=j===_.pending,L=j===_.ready,y=C((s=>q(s))),e=C((s=>z(s))),n=C((s=>s.tenantState.fetchState)),r=C((s=>s.tenantState.activeTenantFetchState.fetchState)),a=E.getSignedInUser(),g=E.getActiveTenantForUser()?.tenantId,l=e?.externalConnections?.fetchState,d=e?.externalConnections?.saveConnectionState,T=e.externalConnections?.accounting[0]?.isValid;o.useLayoutEffect((()=>{c(D.CONNECTION_AUTH)}),[c]),o.useEffect((()=>{S.current||a==null||g==null||(S.current=!0,n==="Completed"||r!=="Not-Started"&&r!=="Error"||(c(D.TENANT_FETCHING),t(G(a.userId,g))))}),[S,n,c]),o.useEffect((()=>{e.tenantId==null&&!x.current&&a!=null&&(x.current=!0,!(g==null||g!=null&&(r==="Completed"||r==="Error"))||n!=="Not-Started"&&n!=="Error"||t(J(a.userId)))}),[x,n,r]),o.useEffect((()=>{a==null||e?.tenantId==null||e.externalConnections!=null||n!=="Completed"&&r!=="Completed"||l==="In-Progress"||d!=="Error"||(c(D.CONNECTION_AUTH),t(A(a.userId,e.tenantId)))}),[d]),o.useEffect((()=>{n!=="Completed"&&r!=="Completed"||a==null||e?.tenantId==null||(t(M(e.tenantId)),E.saveActiveTenantDomainForUser(e.tenantEmailDomain),Q(a?.userId,a?.zeniSessionId,e.tenantId),B.updateAppLocaleID(Y(V(e))),e.externalConnections!=null||n!=="Completed"&&r!=="Completed"||l==="In-Progress"||a==null||e==null||t(A(a.userId,e.tenantId)))}),[n,r,l]),o.useEffect((()=>{y.tenantsCoreDetailsInOrder.length>0&&n==="Completed"&&E.saveSignedInUserTenants(y.tenantsCoreDetailsInOrder)}),[y.tenantsCoreDetailsInOrder.length,n]);const b=e==null||n!=="Completed"&&r!=="Completed"||l!=="Completed";if(o.useEffect((()=>{n!=="Completed"&&n!=="Error"||r!=="Completed"&&r!=="Error"||l!=="Completed"&&l!=="Error"||m()}),[n,r,l]),o.useEffect((()=>{u&&d==="In-Progress"&&(p.current=!0)}),[u,d]),o.useEffect((()=>{if(!u||b)return;const s=e.tenantEmailDomain!=null?`/${e.tenantEmailDomain}/settings/accounting`:"/";return p.current&&d==="Completed"?(sessionStorage.setItem(h,_.ready),m(),void i(s,{replace:!0})):p.current&&d==="Error"?(sessionStorage.removeItem(h),t(O({messageSection:"accounting_projects_qbo_reconnect_failed",messageText:"failed",type:"error"})),m(),void i(s,{replace:!0})):void(f||N.current||p.current||T!==!0||(sessionStorage.removeItem(h),t(O({messageSection:"accounting_projects_qbo_reconnect_failed",messageText:"failed",type:"error"})),m(),i(s,{replace:!0})))}),[u,b,d,f,T,e.tenantEmailDomain,m,t,i]),b)return null;if(f||T!==!0)return I.jsx(te,{children:I.jsx(ee,{})});if(u)return null;const k=e.tenantEmailDomain!=null?`/${e.tenantEmailDomain}/settings/accounting`:"/";return L?I.jsx(w,{to:k,replace:!0}):I.jsx(w,{to:"/",replace:!0})}export{we as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as i}from"./liveblocks-e6rGc1UF.js";import{z as m}from"./index-DKH4PK2B.js";import{g as n}from"./QBOConnectionScreen-D8eeXRWb.js";import"./sentry-DsyKtMW2.js";import{g as p,N as a}from"./core-CHD8T-IM.js";import"./zeni-epic-state-BO3zdDfL.js";import"./recharts-C6xUtcdL.js";import"./mui-NTaF3UaY.js";import"./analytics-C3e3An3a.js";import"./plaid-DdTo7m1-.js";import"./dnd-Dwi6R-ey.js";import"./stripe-cKAAJElX.js";import"./lottie-B778bt56.js";import"./lexical-CMNdypK6.js";import"./pdf-Bx92ZlM_.js";import"./utils-CCA3F0sZ.js";import"./empty-CeRjDJvl.js";import"./pdf-lib-CSbJ_JNk.js";import"./index-BVHBHjSe.js";import"./url-ClJewK9Y.js";import"./index-CKiMoeFX.js";import"./decodeURIComponentSafe-p_nrn8Pg.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]="a1205b81-d106-415b-bd92-85aeae53ace3",t._sentryDebugIdIdentifier="sentry-dbid-a1205b81-d106-415b-bd92-85aeae53ace3")}catch{}})();const U=()=>{const t=p(),{code:o,realmId:r,state:e}=n(t.search),s=m.getSignedInUser()?.userId??"";if(f(o,r,e,s)===!0){const d=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return i.jsx(a,{to:d})}return i.jsx(a,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-e6rGc1UF.js";import{a as r}from"./sentry-DsyKtMW2.js";import{ax as l,ay as p,R as m,a5 as b}from"./index-DKH4PK2B.js";import"./mui-NTaF3UaY.js";import f from"./NotFoundScreen-CtgFRYZy.js";import{h as c,g as u}from"./core-CHD8T-IM.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="84290e3a-b5eb-4a67-b663-116401857d00",e._sentryDebugIdIdentifier="sentry-dbid-84290e3a-b5eb-4a67-b663-116401857d00")}catch{}})();const _=()=>{const e=c(),a=u(),t=r.useCallback((()=>{window.open("https://www.zeni.ai/demo/request","_blank")}),[]),i=r.useCallback((()=>{(()=>{const n=b(a.state?.pathnameStackToGoBack),d=n.poppedPathname??k();e(d,{state:{pathnameStackToGoBack:n.newStack}})})()}),[]),o=l(a.pathname);return o!=null?s.jsx(p,{menuItem:m(o),onDemoClick:t,onGoBack:i}):s.jsx(f,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{_ as F};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-e6rGc1UF.js";import{a as r}from"./sentry-DsyKtMW2.js";import{u as A,h as P,i as F,j as k,t as Z,l as O,s as H,g as W,N as B,n as oe,o as j}from"./core-CHD8T-IM.js";import{a9 as tt,k as v,ar as R,U as u,cd as it,ce as ot,cf as at,cg as st,ch as ct,ci as rt,cj as lt,ck as dt,cl as ut,cm as gt,cn as mt,co as vt,p as X,cp as pt,cq as St,z as G,af as ce,cr as ft,cs as ht,ct as It,cu as Ct,cv as kt,cw as Et,cx as yt,cy as xt,cz as bt,cA as jt,W as Dt,aj as un,cB as At,cC as Pt,cD as Lt,cE as $t,cF as wt,cG as _t,cH as Ft,cI as Rt,cJ as Tt,cK as Ot,cL as Mt,t as qe,l as $e,cM as Nt,cN as Ut,cO as Bt,cP as Vt,cQ as Ht,cR as qt,cS as zt}from"./index-DKH4PK2B.js";import"./mui-NTaF3UaY.js";import{A as Q}from"./AddressScreen-CrINuapd.js";import M from"./NotFoundScreen-CtgFRYZy.js";import{ZQ as Qt,ZR as Kt,vp as ze,ZS as K,vS as re,ZT as we,ZU as le,wt as be,wA as Gt,wF as gn,ZV as _e,wx as mn,y7 as Qe,vR as Ke,ZW as Zt,ZX as vn,wQ as je,ZY as de,wU as Wt,ZZ as Xt,Z_ as pn,wX as Sn,z2 as Jt,Z$ as Se,_0 as Ge,_1 as fn,vP as Yt,_2 as ei,vJ as ni,_3 as ti,yk as ii,_4 as hn,yt as Ze,_5 as oi,yq as ai,_6 as Fe,gh as Re,_7 as te,_8 as ie,xa as si,vX as We,w0 as In,v_ as ci,vU as ri,x3 as li,w2 as di,xc as ui,_9 as De,xl as Cn,xj as J,xh as ue,xg as gi,_a as kn,yz as Xe,_b as mi,vQ as En,_c as Te,fF as fe,wb as Ae,w8 as Pe,wl as yn,wk as Oe,w5 as vi,we as xn,wn as ae,VC as bn,vT as Me,wi as pi,wj as Si,wh as fi,_d as hi,wV as Ii,wR as jn,_e as Dn,vD as Je,_f as Ci,vz as ki,_g as Ei,yF as yi,yJ as q,yE as xi,xN as he,_h as bi,_i as An,yS as Ye,_j as ji,yP as Di,_k as Pn,xQ as Ai,xR as V,xU as Pi,_l as Ln,y2 as Ee,_m as Li,xb as $n,U8 as wn,_n as $i,yc as wi,_o as _n,_p as _i,_q as Fi,_r as Ri,zH as Ti,_s as Oi,_t as Fn,yZ as Rn,_u as Tn,zF as ye,_v as Mi,zC as Ni,_w as Ui,_x as Bi,_y as Vi,_z as Hi,_A as qi,_B as en,_C as zi,eg as Qi,zL as Ki,_D as Ne,xv as Gi,xq as Zi,_E as ge,xG as On,xy as me,xx as Wi,xB as Mn,_F as Xi,xw as Ji,_G as Nn,z3 as Un,zu as nn,zp as Yi,_H as eo,z4 as no,_I as to,zv as io,zz as oo,_J as Ue,wv as Bn,zg as ao,ww as so,_K as co,_L as Vn,c8 as ro,ms as lo,mt as uo,_M as tn,wu as ve,gl as go,mz as mo,zm as Hn,zX as vo,zj as qn,uX as po,zU as on,uL as So,zR as an,hS as fo,UB as sn,UC as ho,Gh as zn,hK as Io,_N as Co,Vr as ko,_O as Eo,A0 as xe,A1 as yo,_P as xo,_Q as Qn,z_ as bo,_R as jo,_S as Do,yg as Ao,_T as Po}from"./zeni-epic-state-BO3zdDfL.js";import{M as Lo}from"./MobileAppDrawer-DX2JnkbM.js";import{q as pe}from"./QBOConnectionScreen-D8eeXRWb.js";import"./recharts-C6xUtcdL.js";import"./analytics-C3e3An3a.js";import"./plaid-DdTo7m1-.js";import"./dnd-Dwi6R-ey.js";import"./stripe-cKAAJElX.js";import"./lottie-B778bt56.js";import"./lexical-CMNdypK6.js";import"./pdf-Bx92ZlM_.js";import"./utils-CCA3F0sZ.js";import"./InboxNotificationsProvider-x0fdv66l.js";import"./useTaskManagerAccess-CUv6a62x.js";import"./empty-CeRjDJvl.js";import"./pdf-lib-CSbJ_JNk.js";import"./index-BVHBHjSe.js";import"./url-ClJewK9Y.js";import"./index-CKiMoeFX.js";import"./decodeURIComponentSafe-p_nrn8Pg.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="1299e822-ef52-448e-8335-8786314f704f",t._sentryDebugIdIdentifier="sentry-dbid-1299e822-ef52-448e-8335-8786314f704f")}catch{}})();const $=({event:t,isReady:e=!0})=>e?a.jsx(tt,{analytics:v,onLoad:n=>n.trackPageLoaded(t)}):null;function N(...t){return t.some((e=>e==="Error"))}function $o(){const t=A(),e=P(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),[o,s]=r.useState(""),[c,d]=r.useState(""),[l,p]=r.useState(null),g=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),{fetchState:m,hasMore:S,items:f,nextCursor:h,auditLogEntityRouteOptions:E,auditLogListSortFieldOptions:I}=k(Qt),y=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),b=`/${n??""}/invoicing`,C=r.useCallback(((L,U)=>{const T=Kt(b,L,U,E);T!=null&&(v.trackInvoicingActionClick(u.Event.invoicingEntityLinkClicked,{entity:L,entityId:U,fromScreen:"audit_log"}),e(T))}),[E,e,b]);r.useEffect((()=>{const L=setTimeout((()=>d(o)),300);return()=>clearTimeout(L)}),[o]),r.useEffect((()=>{i&&t(ze({filters:y,keepExistingListItems:!1,sort:g}))}),[i,y,g,t]);const D=m==="Not-Started"||m==="In-Progress"&&f.length===0,x=m==="In-Progress"&&f.length>0,w=m==="Completed";return N(m)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingAuditLogPage,isReady:w}),a.jsx(it,{auditLogEntityRouteOptions:E,auditLogListSortFieldOptions:I,entries:f,hasMore:S,isLoading:D,isLoadingMore:x,searchValue:o,sortState:l,onEntityLinkClick:C,onLoadMore:()=>{S&&h!=null&&t(ze({cursor:h,filters:y,keepExistingListItems:!0,sort:g}))},onSearchChange:s,onSortChange:p})]})}function Ie(t,e=!1){const n=A(),i=k((c=>K(c).productNextCursor!=null)),o=k((c=>K(c).productNextCursor)),s=k((c=>K(c).productFetchState.fetchState));r.useEffect((()=>{t&&(e&&s!=="Not-Started"||n(re({filters:{type:"addon|charge"},keepExistingListItems:!1})))}),[t,n,e]),r.useEffect((()=>{t&&s!=="In-Progress"&&i&&o!=null&&n(re({cursor:o,filters:{type:"addon|charge"},keepExistingListItems:!0}))}),[t,n,s,i,o])}function Y(t,e,n,i){const[o,s]=r.useState(0),[c,d]=r.useState(!1),l=r.useRef(t);return r.useEffect((()=>{const p=l.current==="In-Progress";l.current=t,t==="Completed"&&p&&n!=null&&(d(!0),i(n))}),[t,n,i]),r.useEffect((()=>{c&&!e&&(d(!1),s((p=>p+1)))}),[c,e]),o}const wo=new Set(["plan"]),_o=O((function(t,e){const{view:n}=e;return{applicableItemOptions:n.applicableItemOptions,qboAccountHierarchy:n.qboAccountHierarchy,qboClassHierarchy:n.qboClassHierarchy,qboIncomeAccountIds:n.qboIncomeAccountIds,catalogItemLifecycleActionOptions:n.catalogItemLifecycleActionOptions,catalogProductLifecycleActionOptions:n.catalogProductLifecycleActionOptions,tierTypeOptionsByPricingModel:n.catalogTierTypeOptionsByPricingModel,periodUnitOptions:n.periodUnitOptions,trialEndActionOptions:n.trialEndActionOptions,trialUnitOptions:n.trialUnitOptions,typeOptions:n.typeOptions,isLoading:e.isLoading,isRunningLifecycleAction:n.actionState.fetchState==="In-Progress",isSaving:n.fetchState==="In-Progress",itemId:e.itemId,localData:n.localData,plan:n.plan}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{itemId:i}=e;return{onBack:()=>e.navigate(`${n}/catalog`),onLifecycleAction:i!==""?o=>{i!==""&&t(mn({action:o,id:i}))}:void 0,onEditChange:o=>{i!==""&&t(_e({id:i,localData:o}))},onSaveEdit:()=>{v.trackInvoicingActionClick(u.Event.invoicingCatalogItemEdited,{itemId:i}),t(gn({id:i}))},onSubFamilyLifecycleAction:(o,s)=>{i!==""&&t(Gt({action:s,id:o,parentItemId:i}))}}}))(ot);function Fo(){const t=A(),e=P(),{item_id:n,tenantEmailDomain:i}=F(),[o]=Z(),{areTenantIdsInSync:s}=R(),c=(d=o.get("kind"))!=null&&wo.has(d)?d:"plan";var d;const l=k((y=>we(y,n))),{pageFetchState:p}=l,g=p.fetchState;r.useEffect((()=>(t(le({id:n})),()=>{t(le({id:n}))})),[t,n]),r.useEffect((()=>{s&&t(be({id:n,kind:c}))}),[s,n,c,t]);const m=r.useCallback((y=>t(be({cacheOverride:!0,id:y,kind:c}))),[t,c]),S=Y(l.fetchState,l.isFormLoading,n,m),f=g==="Completed"&&!l.isFormLoading;Ie(s,!0);const[h,E]=r.useState(f?n:void 0);r.useEffect((()=>{n!=null&&f&&E(n)}),[n,f]);const I=h!==n&&(g==="Not-Started"||g==="In-Progress"||l.isFormLoading);return N(g)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingCatalogItemDetailPage,isReady:f}),a.jsx(_o,{navigate:e,tenantEmailDomain:i,itemId:n??"",kind:c,isLoading:I,view:l},S)]})}const Ro=new Set(["addon","charge","plan"]),To=new Set(["plan"]),Oo=O((function(t,e){const n=we(t,e.itemId);return{fieldHelp:n.fieldHelp,qboClassHierarchy:n.qboClassHierarchy,qboAccountHierarchy:n.qboAccountHierarchy,qboIncomeAccountIds:n.qboIncomeAccountIds,applicabilityValues:n.applicabilityValues,periodUnitOptions:n.periodUnitOptions,trialEndActionOptions:n.trialEndActionOptions,trialUnitOptions:n.trialUnitOptions,typeOptions:n.typeOptions,applicableItemOptions:n.applicableItemOptions,defaultType:e.isEdit?void 0:e.defaultType,errorMessage:n.fetchState==="Error"?n.error?.message??"Failed to save catalog item.":void 0,isSubmitting:n.fetchState==="In-Progress",isLoading:n.isFormLoading,localData:n.localData,mode:n.mode,pricingModelValues:n.pricingModelValues,prorationValues:n.prorationValues,tierTypeOptionsByPricingModel:n.catalogTierTypeOptionsByPricingModel,tierTypeValues:n.tierTypeValues}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,i=e.isEdit?"edit":"create",{itemId:o}=e,s=o!=null?`${n}/catalog/${encodeURIComponent(o)}`:`${n}/catalog`;return{onBack:()=>e.navigate(s),onCancel:()=>{v.trackInvoicingActionClick(u.Event.invoicingCatalogItemFormCancelled),t(le({id:o})),e.navigate(`${n}/catalog`)},onChange:c=>{t(_e({id:o,localData:c}))},onSubmit:()=>{v.trackInvoicingActionClick(u.Event.invoicingCatalogItemSaved,{mode:i}),t(gn({id:o}))}}}))(at);function Mo(){const t=A(),e=P(),{item_id:n,tenantEmailDomain:i}=F(),[o]=Z(),{areTenantIdsInSync:s}=R(),c=n!=null,d=o.get("type"),l=d!=null&&Ro.has(d)?d:void 0,p=(g=o.get("kind"))!=null&&To.has(g)?g:"plan";var g;const m=k((S=>we(S,n)));return Ie(s,!0),r.useEffect((()=>{s&&t(be({id:n,kind:p}))}),[s,n,p,t]),r.useEffect((()=>{c||l==null||m.localData.catalogType===l||t(_e({localData:{...m.localData,catalogType:l}}))}),[c,l,m.localData?.catalogType,t]),r.useEffect((()=>{if(m.fetchState==="Completed"){const S=m.savedItemId??n,f=S!=null?`/${i}/invoicing/catalog/${encodeURIComponent(S)}`:`/${i}/invoicing/catalog`;e(f),t(le({id:n}))}}),[m.fetchState,m.savedItemId,n,t,e,i]),a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingCatalogItemFormPage}),a.jsx(Oo,{navigate:e,tenantEmailDomain:i,defaultType:l,isEdit:c,itemId:n})]})}const No={addons:"addon",all:"item",charges:"charge",plans:"plan"},Uo=O((function(t,e){const n=K(t),i=e.activeTab==="plans",o=e.activeTab==="all",s=i?n.plans:o?[...n.plans,...n.products]:n.products,c=i||o&&n.fetchState==="In-Progress"?n.fetchState:n.productFetchState.fetchState;return{catalogItemLifecycleActionOptions:n.catalogItemLifecycleActionOptions,counts:n.count,countsLoading:n.countsFetchState.fetchState==="Not-Started"||n.countsFetchState.fetchState==="In-Progress",hasMore:i?n.planNextCursor!=null:o&&n.planNextCursor!=null||n.productNextCursor!=null,isLoading:c==="Not-Started"||c==="In-Progress"&&s.length===0,isLoadingMore:c==="In-Progress"&&s.length>0,plans:n.plans,productColumns:n.productColumns,products:n.products}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,i=e.activeTab==="plans",o=e.activeTab==="all",s=i?e.planNextCursor:e.productNextCursor;return{activeTab:e.activeTab,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onTabChange:e.onTabChange,onImportCsv:()=>{v.trackInvoicingActionClick(u.Event.invoicingImportCsvClicked,{entity:"catalog"}),e.navigate(`${n}/data_import`)},onAddItem:()=>{const c=No[e.activeTab];v.trackInvoicingActionClick(u.Event.invoicingAddCatalogItemClicked,{itemType:c}),e.navigate(`${n}/catalog/new?type=${c}`)},onItemClick:(c,d)=>{v.trackInvoicingActionClick(u.Event.invoicingCatalogItemRowClicked,{itemId:d}),e.navigate(`${n}/catalog/${encodeURIComponent(d)}`)},onCatalogItemLifecycleAction:(c,d)=>{v.trackInvoicingActionClick(u.Event.invoicingCatalogItemLifecycleAction,{action:d,fromScreen:"catalog_list",itemId:c}),t(mn({action:Zt(d),id:c}))},onLoadMore:()=>{if(o)return e.planNextCursor!=null&&t(Ke({cursor:e.planNextCursor,filters:e.planFilters,keepExistingListItems:!0,sort:e.sort})),void(e.productNextCursor!=null&&t(re({cursor:e.productNextCursor,filters:e.productFilters,keepExistingListItems:!0,sort:e.sort})));s!=null&&t(i?Ke({cursor:s,filters:e.planFilters,keepExistingListItems:!0,sort:e.sort}):re({cursor:s,filters:e.productFilters,keepExistingListItems:!0,sort:e.sort}))}}}))(st);function Bo(){const t=A(),e=P(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),[o,s]=r.useState(""),[c,d]=r.useState("plans"),[l,p]=r.useState(""),[g,m]=r.useState(null),S=r.useMemo((()=>g!=null?{dir:g.direction,field:g.columnKey}:void 0),[g]),f=l.trim()!==""?l.trim():void 0,h=r.useMemo((()=>({search:f,type:"plan"})),[f]),E=r.useMemo((()=>({search:f,type:"addon|charge"})),[f]),I=k((L=>K(L))),y=I.planFilters.search,b=I.planSort,C=I.planNextCursor,D=I.productNextCursor,x=I.fetchState==="Completed",w=I.runningActionId??null;return r.useEffect((()=>{const L=setTimeout((()=>p(o)),300);return()=>clearTimeout(L)}),[o]),r.useEffect((()=>{i&&t(Qe({cacheOverride:!1,planFilters:h,productFilters:E,planSort:S,productSort:S}))}),[i,t,h,E,S]),r.useEffect((()=>{i&&(f!==y||S?.field!==b?.field||S?.dir!==b?.dir)&&t(Qe({cacheOverride:!0,planFilters:h,productFilters:E,planSort:S,productSort:S}))}),[y,b,i,t,h,E,f,S]),N(I.fetchState)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingCatalogPage,isReady:x}),a.jsx(Uo,{navigate:e,tenantEmailDomain:n,activeTab:c,searchValue:o,sortState:g,planFilters:h,productFilters:E,sort:S,planNextCursor:C,productNextCursor:D,runningCatalogItemActionId:w,onSearchChange:s,onTabChange:d,onSortChange:m})]})}const Vo=O((function(t,e){const n=vn(t,e.couponId);return{fieldHelp:n.fieldHelp,applyOnOptions:n.applyOnOptions,discountTypeOptions:n.discountTypeOptions,durationTypeOptions:n.durationTypeOptions,errorMessage:n.fetchState==="Error"?n.error?.message??"Failed to save coupon.":void 0,isQboConnected:n.isQboConnected,isQboPickerDataLoading:n.isQboPickerDataLoading,isSubmitting:n.fetchState==="In-Progress",isLoading:n.isFormLoading,localData:n.localData,mode:n.mode,periodUnitOptions:n.periodUnitOptions,qboAccountHierarchy:n.qboAccountHierarchy,qboIncomeAccountIds:n.qboIncomeAccountIds}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{couponId:i}=e,o=i!=null?"edit":"create",s=i!=null?`${n}/discounts/${encodeURIComponent(i)}`:`${n}/discounts`;return{onBack:()=>e.navigate(s),onCancel:()=>{v.trackInvoicingActionClick(u.Event.invoicingCouponFormCancelled),t(de({id:i})),e.navigate(`${n}/discounts`)},onChange:c=>{t(Xt({id:i,localData:c}))},onSubmit:()=>{v.trackInvoicingActionClick(u.Event.invoicingCouponSaved,{mode:o}),t(Wt({id:i}))}}}))(ct);function Ho(){const t=A(),e=P(),{coupon_id:n,tenantEmailDomain:i}=F(),{areTenantIdsInSync:o}=R(),{fetchState:s,savedCouponId:c}=k((d=>vn(d,n)));return r.useEffect((()=>{o&&t(je({id:n}))}),[o,n,t]),r.useEffect((()=>{if(s==="Completed"){const d=c??n,l=d!=null?`/${i}/invoicing/discounts/${encodeURIComponent(d)}`:`/${i}/invoicing/discounts`;e(l),t(de({id:n}))}}),[s,c,n,t,e,i]),a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingCouponFormPage}),a.jsx(Vo,{couponId:n,navigate:e,tenantEmailDomain:i})]})}const qo=O((function(t){const e=pn(t);return{fieldHelp:e.fieldHelp,customers:e.customers,planNames:e.planNames,errorMessage:e.fetchState==="Error"?e.error?.message??"Failed to create invoice. Please try again.":void 0,isSubmitting:e.fetchState==="In-Progress",localData:e.localData,settings:e.settings}}),(function(t){return{dispatch:t}}),(function(t,{dispatch:e},n){const i=`/${n.tenantEmailDomain}/invoicing`;return{...t,onCancel:()=>{v.trackInvoicingActionClick(u.Event.invoicingCreateInvoiceCancelled),n.navigate(`${i}/invoices`)},onChange:o=>{e(fn(o))},onSubmit:()=>{const o=ei(t.localData);v.trackInvoicingActionClick(u.Event.invoicingInvoiceCreated,{customerId:o.customer_id,lineItemCount:o.line_items?.length}),e(ni(o))}}}))(lt);function zo(){const t=A(),e=P(),{tenantEmailDomain:n}=F(),[i]=Z(),{areTenantIdsInSync:o}=R(),s=i.get("customerId"),c=k((C=>pn(C))),d=c.fetchState,l=c.localData,p=c.savedInvoiceId,g=k(Sn),m=k((C=>Jt(C))),S=k(Se),f=m.fetchState==="Not-Started"||m.fetchState==="In-Progress"&&g==null,h=S.fetchState==="Not-Started"||S.fetchState==="In-Progress"&&S.customers.length===0,E=f||h,I=m.fetchState==="Completed"&&S.fetchState==="Completed";r.useEffect((()=>(t(Ge()),()=>{t(Ge())})),[t]);const y=r.useRef(!1);r.useEffect((()=>{y.current||s==null||s===""||l.customerId!==""||(y.current=!0,t(fn({...l,customerId:s})))}),[s,l,t]),r.useEffect((()=>{o&&t(Yt({cacheOverride:!1}))}),[o,t]);const b=r.useRef(d);return r.useEffect((()=>{const C=b.current;if(b.current=d,C!=="Completed"&&d==="Completed"){const D=p!=null?`/${n}/invoicing/invoices/${encodeURIComponent(p)}`:`/${n}/invoicing/invoices`;e(D)}}),[d,p,e,n]),a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingCreateInvoicePage,isReady:I}),E?a.jsx(rt,{}):a.jsx(qo,{navigate:e,tenantEmailDomain:n})]})}const Qo=O((function(t,e){const{detailView:n}=e;return{fieldHelp:e.detailView.fieldHelp,creditNote:n.creditNote,creditNoteId:e.creditNoteId,isLoading:n.fetchState==="Not-Started"||n.fetchState==="In-Progress"}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{onBack:()=>e.navigate(`${n}/credits`),onCustomerClick:i=>{v.trackInvoicingActionClick(u.Event.invoicingEntityLinkClicked,{customerId:i,fromScreen:"credit_detail",toScreen:"customer"}),e.navigate(`${n}/customers/${encodeURIComponent(i)}`)},onInvoiceClick:i=>{v.trackInvoicingActionClick(u.Event.invoicingEntityLinkClicked,{fromScreen:"credit_detail",invoiceId:i,toScreen:"invoice"}),e.navigate(`${n}/invoices/${encodeURIComponent(i)}`)},onSubscriptionClick:i=>{v.trackInvoicingActionClick(u.Event.invoicingEntityLinkClicked,{fromScreen:"credit_detail",subscriptionId:i,toScreen:"subscription"}),e.navigate(`${n}/subscriptions/${encodeURIComponent(i)}`)}}}))(dt);function Ko(){const t=A(),e=P(),{credit_note_id:n,tenantEmailDomain:i}=F(),{areTenantIdsInSync:o}=R(),s=k((d=>ti(d,n??""))),c=s.fetchState==="Completed";return r.useEffect((()=>{o&&n!=null&&t(ii({id:n}))}),[o,n,t]),N(s.fetchState)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingCreditDetailPage,isReady:c}),a.jsx(Qo,{navigate:e,tenantEmailDomain:i,creditNoteId:n??"",detailView:s})]})}const Go=O((function(t){const e=hn(t),{fetchState:n}=e;return{columns:e.columns,counts:e.count,countsLoading:e.countsFetchState.fetchState==="Not-Started"||e.countsFetchState.fetchState==="In-Progress",creditNotes:e.creditNotes,hasMore:e.nextCursor!=null,isLoading:n==="Not-Started"||n==="In-Progress"&&e.creditNotes.length===0,isLoadingMore:n==="In-Progress"&&e.creditNotes.length>0,tabIds:e.tabIds}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onStatusChange:e.onStatusChange,onImportCsv:()=>{v.trackInvoicingActionClick(u.Event.invoicingImportCsvClicked,{entity:"credits"}),e.navigate(`${n}/data_import`)},onCreditNoteClick:i=>{v.trackInvoicingActionClick(u.Event.invoicingCreditNoteRowClicked,{creditNoteId:i}),e.navigate(`${n}/credits/${encodeURIComponent(i)}`)},onLoadMore:()=>{e.nextCursor!=null&&t(ai({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(ut);function Zo(){const t=A(),e=P(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),[o,s]=r.useState(""),[c,d]=r.useState(""),[l,p]=r.useState(null),g=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),m=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),{activeStatus:S,appliedSearch:f,appliedSort:h,nextCursor:E,creditNoteListFetchState:I}=k((b=>{const C=hn(b);return{activeStatus:C.activeTab,appliedSearch:C.filters.search,appliedSort:C.sort,nextCursor:C.nextCursor,creditNoteListFetchState:C.fetchState}}),H),y=I==="Completed";return r.useEffect((()=>{const b=setTimeout((()=>d(o)),300);return()=>clearTimeout(b)}),[o]),r.useEffect((()=>{i&&t(Ze({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(m.search!==f||g?.field!==h?.field||g?.dir!==h?.dir)&&t(Ze({cacheOverride:!0,filters:m,sort:g}))}),[i,t,m,g,f,h]),N(I)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingCreditsListPage,isReady:y}),a.jsx(Go,{navigate:e,tenantEmailDomain:n,activeStatus:S,searchValue:o,sortState:l,filters:m,sort:g,nextCursor:E,onSearchChange:s,onStatusChange:b=>t(oi(b)),onSortChange:p})]})}const Kn=(t,e,n)=>{const i=`/${t}/invoicing/customers/`;return n!=null?`${i}${encodeURIComponent(n)}/${e}/`:`${i}new/${e}/`},Wo=O((function(t,e){const{editView:n,hasLoadedRecord:i}=e;return{fieldHelp:n.fieldHelp,billingAddressLabel:n.billingAddressLabel,hasUnsavedBillingAddress:n.hasUnsavedBillingAddress,customerTypeOptions:n.customerTypeOptions,netTermDayOptions:n.netTermDayOptions,taxabilityOptions:n.taxabilityOptions,customer:n.record.invoicingCustomer,invoices:n.record.invoices.slice(0,5),isLoading:!i&&(n.pageFetchState.fetchState==="Not-Started"||n.pageFetchState.fetchState==="In-Progress"||n.isFormLoading),hasPaymentLinkEmailPreviewFailed:n.emailPreviewFetchState.fetchState==="Error",isPaymentLinkEmailPreviewLoading:n.emailPreviewFetchState.fetchState==="In-Progress",isSaving:n.fetchState==="In-Progress",paymentLinkEmailPreview:n.emailPreview,isSendingPaymentLink:n.record.sendLinkState.fetchState==="In-Progress",localData:n.localData,paymentMethods:n.record.paymentMethods,sendPaymentLinkErrorMessage:n.record.sendLinkState.fetchState==="Error"?n.record.sendLinkState.error?.message??"Failed to send payment link.":void 0,sentPaymentLinkEmail:n.record.sendLinkState.fetchState==="Completed"?n.record.sentPaymentLinkEmail:void 0,sentPaymentLinkMagicUrl:n.record.sendLinkState.fetchState==="Completed"?n.record.sentPaymentLinkMagicUrl:void 0,stripeConnected:n.record.stripeConnected}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{customerId:i}=e;return{onBack:()=>e.navigate(`${n}/customers`),onChange:o=>{t(De({id:i,localData:o}))},onCreateInvoice:()=>e.navigate(`${n}/invoices/create`),onInvoiceClick:o=>{v.trackInvoicingActionClick(u.Event.invoicingEntityLinkClicked,{fromScreen:"customer_detail",invoiceId:o,toScreen:"invoice"}),e.navigate(`${n}/invoices/${encodeURIComponent(o)}`)},onCreatePromotionalCredits:()=>e.onCreatePromotionalCredits(),onNewSubscription:()=>e.navigate(`${n}/subscriptions/new`),onDiscardEdit:()=>{t(J(ue)),t(gi({id:i}))},onOpenAddress:()=>{const o=Kn(e.tenantEmailDomain??"",ue,i),s=X(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(o,{state:{pathnameStackToGoBack:s}})},onOpenPaymentSettings:()=>e.navigate(`${n}/settings/payment-destination`),onSaveEdit:o=>{v.trackInvoicingActionClick(u.Event.invoicingCustomerEdited,{customerId:i}),t(De({id:i,localData:o})),t(Cn({id:i}))},onFetchPaymentLinkEmailPreview:o=>t(ui({cacheOverride:o,customerId:i})),onSendPaymentLink:(o,s,c)=>t(di({body:c,customerId:i,email:o,subject:s})),onSubscriptionClick:o=>{v.trackInvoicingActionClick(u.Event.invoicingEntityLinkClicked,{fromScreen:"customer_detail",subscriptionId:o,toScreen:"subscription"}),e.navigate(`${n}/subscriptions/${encodeURIComponent(o)}`)}}}))(vt);function Xo(){const t=A(),e=P(),n=W(),{customer_id:i,tenantEmailDomain:o}=F(),{areTenantIdsInSync:s}=R(),c=k((T=>Fe(T,i))),d=c.pageFetchState.fetchState,l=d==="Completed"&&!c.isFormLoading,[p,g]=r.useState(!1),[m,S]=r.useState(!1),[f,h]=r.useState(l?i:void 0);r.useEffect((()=>{i!=null&&l&&h(i)}),[i,l]);const E=f===i,{plaidTokenFetchState:I,promotionalCreditSubmitState:y}=c,{paymentMethodSaveState:b,setupIntentFetchState:C,stripeConnected:D}=c.record,x=r.useRef(c.record.sendLinkState.fetchState);r.useEffect((()=>{const T=c.record.sendLinkState.fetchState;x.current!=="Error"&&T==="Error"&&t(Re({messageSection:"common",messageText:"failed",showStatusIcon:!0,type:"error"})),x.current=T}),[t,c.record.sendLinkState.fetchState]);const w=C.fetchState==="Error"?C.error?.message??"Failed to start card setup.":b.fetchState==="Error"?b.error?.message??"Failed to save payment method.":I.fetchState==="Error"?I.error?.message??"Failed to connect bank account.":void 0;r.useEffect((()=>(t(te()),t(ie()),()=>{t(te()),t(ie())})),[t]),r.useEffect((()=>{n.state?.openPromotionalCreditsDialog===!0&&(S(!0),e(n.pathname,{replace:!0,state:null}))}),[n.pathname,n.state,e]),r.useEffect((()=>{s&&i!=null&&t(si({id:i}))}),[s,i,t]),r.useEffect((()=>{s&&i!=null&&D&&t(We({customerId:i}))}),[s,i,t,D]);const L=r.useCallback((T=>t(In({id:T}))),[t]),U=Y(c.fetchState,c.isFormLoading,i,L);return N(d)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingCustomerDetailPage,isReady:l}),a.jsx(Wo,{customerId:i??"",editView:c,hasLoadedRecord:E,location:n,navigate:e,tenantEmailDomain:o,onAddPaymentMethod:()=>{t(te()),i!=null&&D&&t(We({customerId:i})),g(!0)},onCreatePromotionalCredits:()=>{t(ie()),S(!0)}},U),a.jsx(gt,{errorMessage:w,isCreatingSetupIntent:C.fetchState==="In-Progress",isSaving:b.fetchState==="In-Progress",open:p,plaidLinkToken:c.record.plaidLinkToken,saveSucceeded:b.fetchState==="Completed",setupIntent:c.record.setupIntent,stripeConnected:D,onChooseCard:()=>{i!=null&&t(ri({customerId:i}))},onClose:()=>{g(!1),t(te())},onSavePaymentMethod:T=>{i!=null&&t(ci({customerId:i,data:T}))}}),a.jsx(mt,{currentBalance:c.record.invoicingCustomer?.promotionalCredits,currencyCode:c.record.invoicingCustomer?.preferredCurrencyCode,errorMessage:y.fetchState==="Error"?y.error?.message??"Failed to add promotional credits.":void 0,isSubmitting:y.fetchState==="In-Progress",open:m,submitSucceeded:y.fetchState==="Completed",onClose:()=>{S(!1),t(ie())},onSubmit:({amount:T,description:ne})=>{i!=null&&t(li({amount:T,customerId:i,currencyCode:c.record.invoicingCustomer?.preferredCurrencyCode,description:ne}))}})]})}const Jo=O((function(t,e){const n=Fe(t,e.customerId);return{fieldHelp:n.fieldHelp,billingAddressLabel:n.billingAddressLabel,customerTypeOptions:n.customerTypeOptions,netTermDayOptions:n.netTermDayOptions,taxabilityOptions:n.taxabilityOptions,errorMessage:n.fetchState==="Error"?n.error?.message??"Failed to save customer.":void 0,isSubmitting:n.fetchState==="In-Progress",isLoading:n.isFormLoading,localData:n.localData,mode:n.mode}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{customerId:i}=e,o=i!=null?"edit":"create",s=i!=null?`${n}/customers/${encodeURIComponent(i)}`:`${n}/customers`;return{onBack:()=>e.navigate(s),onCancel:()=>{v.trackInvoicingActionClick(u.Event.invoicingCustomerFormCancelled),t(kn({id:i})),t(J(ue)),e.navigate(`${n}/customers`)},onChange:c=>{t(De({id:i,localData:c}))},onOpenAddress:()=>{const c=Kn(e.tenantEmailDomain??"",ue,i),d=X(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(c,{state:{pathnameStackToGoBack:d}})},onSubmit:()=>{v.trackInvoicingActionClick(u.Event.invoicingCustomerSaved,{mode:o}),t(Cn({id:i}))}}}))(pt);function Yo(){const t=A(),e=P(),n=W(),{customer_id:i,tenantEmailDomain:o}=F(),{areTenantIdsInSync:s}=R(),{fetchState:c,savedCustomerId:d}=k((l=>Fe(l,i)));return r.useEffect((()=>{s&&i!=null&&t(In({id:i}))}),[s,i,t]),r.useEffect((()=>{if(c==="Completed"){const l=d??i,p=l!=null?`/${o}/invoicing/customers/${encodeURIComponent(l)}`:`/${o}/invoicing/customers`;e(p),t(kn({id:i}))}}),[c,d,i,t,e,o]),a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingCustomerFormPage}),a.jsx(Jo,{customerId:i,location:n,navigate:e,tenantEmailDomain:o})]})}const ea=O((function(t){const e=Se(t),{fetchState:n}=e;return{addressesById:t.addressState.addressesById,columns:e.columns,counts:e.count,countsLoading:e.countsFetchState.fetchState==="Not-Started"||e.countsFetchState.fetchState==="In-Progress",customers:e.customers,hasMore:e.nextCursor!=null,isLoading:n==="Not-Started"||n==="In-Progress"&&e.customers.length===0,isLoadingMore:n==="In-Progress"&&e.customers.length>0,tabIds:e.tabIds}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onStatusChange:e.onStatusChange,onSortChange:e.onSortChange,onAddCustomer:()=>{v.trackInvoicingActionClick(u.Event.invoicingAddCustomerClicked),e.navigate(`${n}/customers/new`)},onCustomerClick:i=>{v.trackInvoicingActionClick(u.Event.invoicingCustomerRowClicked,{customerId:i}),e.navigate(`${n}/customers/${encodeURIComponent(i)}`)},onImportCsv:()=>{v.trackInvoicingActionClick(u.Event.invoicingImportCsvClicked,{entity:"customers"}),e.navigate(`${n}/data_import`)},onRowAction:(i,o)=>{switch(o){case"createInvoice":v.trackInvoicingActionClick(u.Event.invoicingCreateInvoiceClicked,{customerId:i,fromScreen:"customers_list"}),e.navigate(`${n}/invoices/create?customerId=${encodeURIComponent(i)}`);break;case"newSubscription":v.trackInvoicingActionClick(u.Event.invoicingAddSubscriptionClicked,{customerId:i,fromScreen:"customers_list"}),e.navigate(`${n}/subscriptions/new?customerId=${encodeURIComponent(i)}`);break;case"createPromotionalCredits":v.trackInvoicingActionClick(u.Event.invoicingPromotionalCreditsClicked,{customerId:i,fromScreen:"customers_list"}),e.navigate(`${n}/customers/${encodeURIComponent(i)}`,{state:{openPromotionalCreditsDialog:!0}})}},onLoadMore:()=>{e.nextCursor!=null&&t(En({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(St);function na(){const t=A(),e=P(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),[o,s]=r.useState(""),[c,d]=r.useState(""),[l,p]=r.useState(null),g=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),m=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),{activeStatus:S,appliedSearch:f,appliedSort:h,nextCursor:E,customerListFetchState:I}=k((b=>{const C=Se(b);return{activeStatus:C.activeTab,appliedSearch:C.filters.search,appliedSort:C.sort,nextCursor:C.nextCursor,customerListFetchState:C.fetchState}}),H),y=I==="Completed";return r.useEffect((()=>{const b=setTimeout((()=>d(o)),300);return()=>clearTimeout(b)}),[o]),r.useEffect((()=>{i&&t(Xe({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(m.search!==f||g?.field!==h?.field||g?.dir!==h?.dir)&&t(Xe({cacheOverride:!0,filters:m,sort:g}))}),[i,t,m,g,f,h]),N(I)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingCustomersListPage,isReady:y}),a.jsx(ea,{navigate:e,tenantEmailDomain:n,activeStatus:S,searchValue:o,sortState:l,filters:m,sort:g,nextCursor:E,onSearchChange:s,onStatusChange:b=>t(mi(b)),onSortChange:p})]})}const Le=(t,e)=>e==null?void 0:t.sessionDetail[e]??t.sessions.find((n=>n.id===e)),ta=O((function(t,e){const{authParams:n,csvDownloadUrl:i,filters:o,sessionId:s,view:c}=e,d=s==null?void 0:c.diagnosticsBySession[s],l=d?.fetch.fetchState??"Not-Started";return{authParams:n,csvDownloadUrl:i,diagnostics:d?.items??[],errorMessage:l==="Error"?d?.fetch.error?.message:void 0,expired:d?.expired??!1,filters:o,hasMore:d?.nextCursor!=null,isLoading:l==="Not-Started"||l==="In-Progress",isLoadingMore:l==="In-Progress"&&(d?.items.length??0)>0,session:Le(c,s)}}),(function(t,e){const{filters:n,navigate:i,sessionId:o,tenantEmailDomain:s,view:c}=e,d=o==null?void 0:c.diagnosticsBySession[o],l=Le(c,o),p=c.actionStateByKind.retry?.fetchState==="In-Progress",g=c.actionStateByKind.rollback?.fetchState==="In-Progress",m=l?.status==="done"&&l.rollback_available_until!=null&&new Date(l.rollback_available_until).getTime()>Date.now()&&!g;return{onBack:()=>i(`/${s}/invoicing/data_import`),onDownloadError:()=>{t(Re({messageSection:"invoicing_data_import_download",messageText:"failed",showStatusIcon:!0,type:"error"}))},onFiltersChange:e.onFiltersChange,onLoadMore:()=>{o!=null&&d?.nextCursor!=null&&t(Pe({...n,cursor:d.nextCursor,sessionId:o}))},onRetry:l?.status!=="failed"||p?void 0:()=>{o!=null&&t(Oe(o))},onRollback:m?()=>{o!=null&&t(yn(o))}:void 0}}))(ft);function ia(){const t=A(),e=P(),{sessionId:n,tenantEmailDomain:i}=F(),{areTenantIdsInSync:o}=R(),[s,c]=r.useState({}),d=k(Te),l=k(fe),p=r.useMemo((()=>{const E=G.getSignedInUser();return{userId:E?.userId??"",sessionId:E?.zeniSessionId??"",tenantId:l.tenantId}}),[l.tenantId]),g=Le(d,n),m=n==null?void 0:d.diagnosticsBySession[n];r.useEffect((()=>{o&&n!=null&&t(Ae(n))}),[o,t,n]),r.useEffect((()=>{if(!o||n==null)return;const E=setTimeout((()=>{t(Pe({...s,sessionId:n}))}),300);return()=>clearTimeout(E)}),[o,t,s,n]);const S=g?.status==="scanning"||g?.status==="importing";r.useEffect((()=>{if(!o||n==null||!S)return;const E=setInterval((()=>{t(Ae(n)),t(Pe({...s,sessionId:n}))}),3e3);return()=>clearInterval(E)}),[o,t,s,S,n]);const f=r.useMemo((()=>{if(n==null)return"";const E=new URLSearchParams;s.moduleId!=null&&E.set("module_id",s.moduleId),s.level!=null&&E.set("level",s.level),s.outcome!=null&&E.set("outcome",s.outcome),s.search!=null&&s.search.trim()!==""&&E.set("search",s.search.trim());const I=E.toString();return`${ce?.invoicingMicroServiceBaseUrl??""}/1.0/data-import/${encodeURIComponent(n)}/issues.csv${I===""?"":`?${I}`}`}),[s,n]),h=m?.fetch.fetchState??"Not-Started";return N(h)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingDataImportHubPage,isReady:g!=null&&h!=="Not-Started"}),a.jsx(ta,{authParams:p,csvDownloadUrl:f,filters:s,navigate:e,sessionId:n,tenantEmailDomain:i,view:d,onFiltersChange:c})]})}const Gn=t=>`invoicing_active_migration:${t}`,se=(t,e)=>{if(t!=null&&t!=="")try{const n=Gn(t);e==null?sessionStorage.removeItem(n):sessionStorage.setItem(n,e)}catch{}},oa=O((function(t,e){const{sessions:n,sessionsFetch:i,statusFetch:o,statusRows:s}=e.view;return{isLoading:!(o.fetchState!=="Not-Started"&&o.fetchState!=="In-Progress"||s.length!==0||i.fetchState!=="Not-Started"&&i.fetchState!=="In-Progress"),sessions:n,statusRows:s}}),(function(t,e){const{navigate:n,tenantEmailDomain:i}=e,o=s=>{const c=s??null;t(ae(c)),se(i,c),n(`/${i}/invoicing/data_import/migrate`)};return{onContinueSession:s=>{v.trackInvoicingActionClick(u.Event.invoicingImportSessionAction,{action:"continue",sessionId:s}),o(s)},onNewImport:()=>{v.trackInvoicingActionClick(u.Event.invoicingNewImportClicked),o()},onRetrySession:s=>{v.trackInvoicingActionClick(u.Event.invoicingImportSessionAction,{action:"retry",sessionId:s}),t(Oe(s)),o(s)},onRollbackSession:s=>{v.trackInvoicingActionClick(u.Event.invoicingImportSessionAction,{action:"rollback",sessionId:s}),t(yn(s))},onViewSession:s=>{v.trackInvoicingActionClick(u.Event.invoicingImportSessionAction,{action:"view_details",sessionId:s}),n(`/${i}/invoicing/data_import/${encodeURIComponent(s)}`)}}}))(ht);function aa(){const t=A(),e=P(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),o=k(Te);r.useEffect((()=>{i&&(t(vi()),t(xn()))}),[i,t]);const s=o.statusFetch.fetchState==="Completed"&&o.sessionsFetch.fetchState==="Completed";return a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingDataImportHubPage,isReady:s}),a.jsx(oa,{navigate:e,tenantEmailDomain:n,view:o})]})}const sa=O((function(t,e){const{activeId:n,authParams:i,integrationsView:o,settings:s,templatesDownloadUrl:c,view:d}=e,{actionStateByKind:l,sessionDetail:p,sessions:g}=d,m=o.externalConnections?.revenue?.find((f=>f.connectionName==="chargebee")),S=n!=null?p[n]:void 0;return{authParams:i,templatesDownloadUrl:c,chargebeeConnected:s?.chargebee_connected===!0||(m?.isValid??!1),chargebeeConnectorAvailable:m!=null,chargebeeSite:s?.chargebee_site,connectError:l.connect?.error?.message,connecting:l.connect?.fetchState==="In-Progress",retrying:l.retry?.fetchState==="In-Progress",session:S??g.find((f=>f.id===n)),starting:l.start?.fetchState==="In-Progress",uploading:l.upload?.fetchState==="In-Progress"}}),(function(t,e){const{activeId:n,navigate:i,tenantEmailDomain:o}=e;return{onBack:e.onBack,onDownloadError:()=>{t(Re({messageSection:"invoicing_data_import_download",messageText:"failed",showStatusIcon:!0,type:"error"}))},onDownloadTemplates:()=>{v.trackInvoicingActionClick(u.Event.invoicingImportTemplatesDownloaded)},onFetchFromChargebee:()=>{v.trackInvoicingActionClick(u.Event.invoicingChargebeeConnectClicked),t(fi())},onGoToIntegrations:()=>{i(`/${o}/invoicing/settings`)},onGoToOverview:()=>i(`/${o}/invoicing/overview`),onRetry:()=>{n!=null&&t(Oe(n))},onSaveLater:()=>{v.trackInvoicingActionClick(u.Event.invoicingImportSavedForLater),e.onBack()},onStartImport:()=>{v.trackInvoicingActionClick(u.Event.invoicingImportStarted),n!=null&&t(Si(n))},onUpload:s=>{v.trackInvoicingActionClick(u.Event.invoicingImportFileUploaded),t(pi({files:s}))},onViewDetails:n==null?void 0:()=>i(`/${o}/invoicing/data_import/${encodeURIComponent(n)}`)}}))(It);function ca(){const t=A(),e=P(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),o=k(Sn),s=k(fe),c=r.useMemo((()=>{const I=G.getSignedInUser();return{userId:I?.userId??"",sessionId:I?.zeniSessionId??"",tenantId:s.tenantId}}),[s.tenantId]),d=`${ce?.invoicingMicroServiceBaseUrl??""}/1.0/data-import/templates`,l=s.companyId??G.getSignedInUserTenant(n??"")?.companyId,p=k((I=>bn(I,l))),g=k(Te),{activeMigrationSessionId:m}=g,S=m??void 0,f=S!=null?g.sessionDetail[S]??g.sessions.find((I=>I.id===S)):void 0;r.useEffect((()=>{i&&(t(Me()),t(xn()))}),[i,t]),r.useEffect((()=>{if(m!=null)return;const I=(y=>{if(y==null||y==="")return null;try{return sessionStorage.getItem(Gn(y))}catch{return null}})(n);I!=null&&t(ae(I))}),[m,t,n]),r.useEffect((()=>{se(n,m)}),[m,n]);const h=f?.status,E=h==="scanning"||h==="importing";return r.useEffect((()=>{if(!i||S==null||!E)return;const I=setInterval((()=>{t(Ae(S))}),3e3);return()=>clearInterval(I)}),[i,S,E,t]),r.useEffect((()=>{h==="done"&&(t(ae(null)),se(n,null))}),[t,h,n]),a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingDataImportMigratePage}),a.jsx(sa,{activeId:S,authParams:c,integrationsView:p,navigate:e,settings:o,templatesDownloadUrl:d,tenantEmailDomain:n,view:g,onBack:()=>{t(ae(null)),se(n,null),e(`/${n}/invoicing/data_import`)}})]})}const ra=O((function(t,e){const{editView:n}=e;return{fieldHelp:n.fieldHelp,coupon:n.coupon,discountLifecycleActionOptions:e.discountLifecycleActionOptions,discountsAccountName:n.discountsAccountName,isLoading:!e.hasLoadedRecord&&(n.pageFetchState.fetchState==="Not-Started"||n.pageFetchState.fetchState==="In-Progress"),isRunningLifecycleAction:e.isRunningLifecycleAction,isSaving:n.fetchState==="In-Progress"}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{couponId:i}=e;return{onBack:()=>e.navigate(`${n}/discounts`),onLifecycleAction:o=>{t(jn({action:o,id:i}))},onSaveEdit:o=>{v.trackInvoicingActionClick(u.Event.invoicingCouponEdited,{couponId:i}),t(Ii({data:o,id:i}))}}}))(Ct);function la(){const t=A(),e=P(),{coupon_id:n,tenantEmailDomain:i}=F(),{areTenantIdsInSync:o}=R(),s=k((h=>hi(h,n))),c=s.actionState.fetchState==="In-Progress",d=s.pageFetchState.fetchState,l=d==="Completed",[p,g]=r.useState(l?n:void 0);r.useEffect((()=>{n!=null&&l&&g(n)}),[n,l]);const m=p===n;r.useEffect((()=>(t(de({id:n})),()=>{t(de({id:n}))})),[n,t]),r.useEffect((()=>{o&&t(je({id:n}))}),[o,n,t]);const S=r.useCallback((h=>t(je({cacheOverride:!0,id:h}))),[t]),f=Y(s.fetchState,s.isFormLoading,n,S);return N(d)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingDiscountDetailPage,isReady:l}),a.jsx(ra,{hasLoadedRecord:m,couponId:n??"",discountLifecycleActionOptions:s.discountLifecycleActionOptions,editView:s,isRunningLifecycleAction:c,navigate:e,tenantEmailDomain:i},f)]})}const da=O((function(t){const e=Dn(t),{fetchState:n}=e;return{columns:e.columns,counts:e.count,discountLifecycleActionOptions:e.discountLifecycleActionOptions,countsLoading:e.countsFetchState.fetchState==="Not-Started"||e.countsFetchState.fetchState==="In-Progress",coupons:e.coupons,hasMore:e.nextCursor!=null,isLoading:n==="Not-Started"||n==="In-Progress"&&e.coupons.length===0,isLoadingMore:n==="In-Progress"&&e.coupons.length>0,tabIds:e.tabIds}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onStatusChange:e.onStatusChange,onSortChange:e.onSortChange,onCouponClick:i=>{v.trackInvoicingActionClick(u.Event.invoicingDiscountRowClicked,{couponId:i}),e.navigate(`${n}/discounts/${encodeURIComponent(i)}`)},onCreateCoupon:()=>{v.trackInvoicingActionClick(u.Event.invoicingCreateCouponClicked),e.navigate(`${n}/discounts/new`)},onImportCsv:()=>{v.trackInvoicingActionClick(u.Event.invoicingImportCsvClicked,{entity:"discounts"}),e.navigate(`${n}/data_import`)},onDiscountLifecycleAction:(i,o)=>{v.trackInvoicingActionClick(u.Event.invoicingCouponLifecycleAction,{action:o,couponId:i,fromScreen:"discounts_list"}),t(jn({action:o,id:i}))},onLoadMore:()=>{e.nextCursor!=null&&t(ki({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(kt);function ua(){const t=A(),e=P(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),[o,s]=r.useState(""),[c,d]=r.useState(""),[l,p]=r.useState(null),g=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),m=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),{activeStatus:S,appliedSearch:f,appliedSort:h,nextCursor:E,couponListFetchState:I,runningDiscountActionId:y}=k((C=>{const D=Dn(C);return{activeStatus:D.activeTab,appliedSearch:D.filters.search,appliedSort:D.sort,nextCursor:D.nextCursor,couponListFetchState:D.fetchState,runningDiscountActionId:D.runningActionId??null}}),H),b=I==="Completed";return r.useEffect((()=>{const C=setTimeout((()=>d(o)),300);return()=>clearTimeout(C)}),[o]),r.useEffect((()=>{i&&t(Je({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(m.search!==f||g?.field!==h?.field||g?.dir!==h?.dir)&&t(Je({cacheOverride:!0,filters:m,sort:g}))}),[i,t,m,g,f,h]),N(I)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingDiscountsListPage,isReady:b}),a.jsx(da,{navigate:e,tenantEmailDomain:n,activeStatus:S,searchValue:o,sortState:l,filters:m,sort:g,nextCursor:E,runningDiscountActionId:y,onSearchChange:s,onStatusChange:C=>t(Ci(C)),onSortChange:p})]})}const ga=O((function(t,e){const{readView:n}=e;return{fieldHelp:e.readView.fieldHelp,caseId:e.caseId,dunningAttempts:e.dunningAttempts,dunningCase:n.dunningCase,isLoading:n.fetchState==="Not-Started"||n.fetchState==="In-Progress",isRunningAction:n.actionState.fetchState==="In-Progress"}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{caseId:i}=e,o=i!=="";return{onBack:()=>e.navigate(`${n}/dunning`),onInvoiceClick:s=>{v.trackInvoicingActionClick(u.Event.invoicingEntityLinkClicked,{caseId:i,fromScreen:"dunning_detail",invoiceId:s,toScreen:"invoice"}),e.navigate(`${n}/invoices/${encodeURIComponent(s)}`)},onCancel:o?()=>t(q({action:"cancel",id:i})):void 0,onResolve:o?()=>{v.trackInvoicingActionClick(u.Event.invoicingDunningAction,{action:"resolve",caseId:i}),t(q({action:"resolve",id:i}))}:void 0,onResume:o?()=>{v.trackInvoicingActionClick(u.Event.invoicingDunningAction,{action:"resume",caseId:i}),t(q({action:"resume",id:i}))}:void 0,onRetry:o?()=>{v.trackInvoicingActionClick(u.Event.invoicingDunningAction,{action:"retry",caseId:i}),t(q({action:"retry",id:i}))}:void 0}}))(yt);function ma(){const t=A(),e=P(),{case_id:n,tenantEmailDomain:i}=F(),{areTenantIdsInSync:o}=R(),s=k((x=>Ei(x,n??""))),c=s.fetchState==="Completed",d=s.dunningCase?.invoiceID,[l,p]=r.useState("idle"),[g,m]=r.useState(!1),[S,f]=r.useState(),[h,E]=r.useState(!1),I=r.useCallback((()=>{p("idle"),m(!1),f(void 0),E(!1)}),[]),y=r.useCallback((()=>{if(n==null)return;t(yi({id:n})),p("idle"),m(!1);const x=s.emailPreview.preview;f(x==null?void 0:{body:x.body,cc:x.cc,subject:x.subject,to:x.to}),E(!0)}),[n,t,s.emailPreview.preview]),b=r.useCallback((x=>{n!=null&&l!=="pending"&&(m(!1),p("pending"),v.trackInvoicingActionClick(u.Event.invoicingDunningAction,{action:"send-email",caseId:n}),t(q({action:"send-email",body:x,id:n})))}),[n,t,l]),C=r.useMemo((()=>s.emailPreview.preview==null?void 0:{bodyToken:s.emailPreview.preview.bodyToken,renderedHtmlTemplate:s.emailPreview.preview.renderedHtmlTemplate,subjectToken:s.emailPreview.preview.subjectToken}),[s.emailPreview.preview]);r.useEffect((()=>{o&&n!=null&&t(xi({id:n}))}),[o,n,t]),r.useEffect((()=>{o&&d!=null&&t(he({invoiceId:d}))}),[o,d,t]),r.useEffect((()=>{p("idle"),m(!1),f(void 0),E(!1)}),[n]),r.useEffect((()=>{o||(p("idle"),m(!1),f(void 0),E(!1))}),[o]),r.useEffect((()=>{h&&S==null&&s.emailPreview.preview!=null&&f({body:s.emailPreview.preview.body,cc:s.emailPreview.preview.cc,subject:s.emailPreview.preview.subject,to:s.emailPreview.preview.to})}),[s.emailPreview.preview,S,h]),r.useEffect((()=>{l==="pending"&&(s.actionState.fetchState!=="In-Progress"?g&&s.actionState.fetchState==="Completed"?(n!=null&&t(bi({id:n})),I()):g&&s.actionState.fetchState==="Error"&&p("failed"):m(!0))}),[n,I,t,l,g,s.actionState.fetchState]);const D=d!=null&&s.linkedInvoice?.id===d?s.linkedInvoice.dunningAttempts:void 0;return N(s.fetchState)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingDunningDetailPage,isReady:c}),a.jsx(ga,{navigate:e,tenantEmailDomain:i,caseId:n??"",readView:s,dunningAttempts:D,onSendEmail:y}),a.jsx(Et,{initialDraft:S,isPreviewLoading:s.emailPreview.fetchState==="Not-Started"||s.emailPreview.fetchState==="In-Progress",isSending:l==="pending",onClose:I,onSend:b,open:h,preview:C,previewErrorMessage:s.emailPreview.fetchState==="Error"?s.emailPreview.error?.message:void 0,sendErrorMessage:l==="failed"?s.actionState.error?.message:void 0})]})}const va=O((function(t){const e=An(t),{fetchState:n}=e;return{columns:e.columns,counts:e.count,countsLoading:e.countsFetchState.fetchState==="Not-Started"||e.countsFetchState.fetchState==="In-Progress",dunningCases:e.dunningCases,hasMore:e.nextCursor!=null,isLoading:n==="Not-Started"||n==="In-Progress"&&e.dunningCases.length===0,isLoadingMore:n==="In-Progress"&&e.dunningCases.length>0,tabIds:e.tabIds}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onStatusChange:e.onStatusChange,onImportCsv:()=>e.navigate(`${n}/data_import`),onDunningCaseClick:i=>{v.trackInvoicingActionClick(u.Event.invoicingDunningCaseRowClicked,{caseId:i}),e.navigate(`${n}/dunning/${encodeURIComponent(i)}`)},onRowAction:(i,o)=>{o!=="retry"&&o!=="resume"&&o!=="resolve"&&o!=="cancel"||(v.trackInvoicingActionClick(u.Event.invoicingDunningAction,{action:o,caseId:i,fromScreen:"dunning_list"}),t(q({action:o,id:i})))},onLoadMore:()=>{e.nextCursor!=null&&t(Di({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(xt);function pa(){const t=A(),e=P(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),[o,s]=r.useState(""),[c,d]=r.useState(""),[l,p]=r.useState(null),g=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),m=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),{activeStatus:S,appliedSearch:f,appliedSort:h,nextCursor:E,dunningCaseListFetchState:I}=k((b=>{const C=An(b);return{activeStatus:C.activeTab,appliedSearch:C.filters.search,appliedSort:C.sort,nextCursor:C.nextCursor,dunningCaseListFetchState:C.fetchState}}),H),y=I==="Completed";return r.useEffect((()=>{const b=setTimeout((()=>d(o)),300);return()=>clearTimeout(b)}),[o]),r.useEffect((()=>{i&&t(Ye({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(m.search!==f||g?.field!==h?.field||g?.dir!==h?.dir)&&t(Ye({cacheOverride:!0,filters:m,sort:g}))}),[i,t,m,g,f,h]),N(I)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingDunningListPage,isReady:y}),a.jsx(va,{navigate:e,tenantEmailDomain:n,activeStatus:S,searchValue:o,sortState:l,filters:m,sort:g,nextCursor:E,onSearchChange:s,onStatusChange:b=>t(ji(b)),onSortChange:p})]})}const Sa=O((function(t,e){const{view:n}=e;return{fieldHelp:e.view.fieldHelp,billingAddress:n.billingAddress,invoice:n.invoice,invoiceId:e.invoiceId,shippingAddress:n.shippingAddress,isLoading:!e.hasLoadedRecord&&(n.pageFetchState.fetchState==="Not-Started"||n.pageFetchState.fetchState==="In-Progress"),isSaving:n.actionState.fetchState==="In-Progress",isVoiding:n.actionState.fetchState==="In-Progress"}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{invoiceId:i}=e;return{onBack:()=>e.navigate(`${n}/invoices`),onCustomerClick:o=>{v.trackInvoicingActionClick(u.Event.invoicingEntityLinkClicked,{customerId:o,fromScreen:"invoice_detail",toScreen:"customer"}),e.navigate(`${n}/customers/${encodeURIComponent(o)}`)},onIssueCreditNote:()=>{v.trackInvoicingActionClick(u.Event.invoicingCreditNoteIssued,{invoiceId:i}),e.navigate(`${n}/invoices/${encodeURIComponent(i)}/issue-credit-note`)},onRecordPayment:()=>{v.trackInvoicingActionClick(u.Event.invoicingRecordPaymentClicked,{fromScreen:"invoice_detail",invoiceId:i}),e.navigate(`${n}/invoices/${encodeURIComponent(i)}/record-payment`)},onRegenerate:()=>{v.trackInvoicingActionClick(u.Event.invoicingInvoiceRegenerated,{invoiceId:i}),t(V({action:"regenerate",invoiceId:i}))},onSaveEdit:o=>{v.trackInvoicingActionClick(u.Event.invoicingInvoiceEdited,{invoiceId:i}),t(Pi({data:{due_date:o.due_date!==""?o.due_date:void 0,notes:o.notes.trim()!==""?o.notes.split(`
|
|
2
|
-
`).map((s=>s.trim())).filter((s=>s!=="")).map((s=>({note:s}))):void 0,po_number:o.po_number!==""?o.po_number:null},invoiceId:i}))},onSendReminder:()=>{v.trackInvoicingActionClick(u.Event.invoicingInvoiceReminderSent,{invoiceId:i}),t(V({action:"send-reminder",invoiceId:i}))},onSubscriptionClick:o=>{v.trackInvoicingActionClick(u.Event.invoicingEntityLinkClicked,{fromScreen:"invoice_detail",subscriptionId:o,toScreen:"subscription"}),e.navigate(`${n}/subscriptions/${encodeURIComponent(o)}`)},onVoid:o=>{v.trackInvoicingActionClick(u.Event.invoicingInvoiceVoided,{invoiceId:i}),t(V({action:"void",invoiceId:i,body:o}))}}}))(bt);function fa(){const t=A(),e=P(),{invoice_id:n,tenantEmailDomain:i}=F(),{areTenantIdsInSync:o}=R(),s=k((f=>Pn(f,n??""))),c=s.pageFetchState.fetchState,d=c==="Completed",[l,p]=r.useState(d?n:void 0);r.useEffect((()=>{n!=null&&d&&p(n)}),[n,d]);const g=l===n;r.useEffect((()=>{o&&n!=null&&t(Ai({invoiceId:n}))}),[o,n,t]);const m=r.useCallback((f=>t(he({invoiceId:f}))),[t]),S=Y(s.actionState.fetchState,s.fetchState==="In-Progress",n,m);return N(c)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingInvoiceDetailPage,isReady:d}),a.jsx(Sa,{invoiceId:n??"",hasLoadedRecord:g,navigate:e,tenantEmailDomain:i,view:s},S)]})}const ha=O((function(t){const e=Ln(t),{fetchState:n}=e;return{counts:e.counts,countsLoading:e.countsFetchState.fetchState==="Not-Started"||e.countsFetchState.fetchState==="In-Progress",hasMore:e.nextCursor!=null,invoices:e.invoices,statusOptions:e.statusOptions,isLoading:n==="Not-Started"||n==="In-Progress"&&e.invoices.length===0,isLoadingMore:n==="In-Progress"&&e.invoices.length>0,kpis:e.kpis,kpisLoading:e.kpisFetchState.fetchState==="Not-Started"||e.kpisFetchState.fetchState==="In-Progress"&&e.kpis==null,tabIds:e.tabIds}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onStatusChange:e.onStatusChange,onCreateInvoice:()=>{v.trackInvoicingActionClick(u.Event.invoicingCreateInvoiceClicked),e.navigate(`${n}/invoices/create`)},onImportCsv:()=>{v.trackInvoicingActionClick(u.Event.invoicingImportCsvClicked,{entity:"invoices"}),e.navigate(`${n}/data_import`)},onInvoiceClick:i=>{v.trackInvoicingActionClick(u.Event.invoicingInvoiceRowClicked,{invoiceId:i}),e.navigate(`${n}/invoices/${encodeURIComponent(i)}`)},onRowAction:(i,o)=>{switch(o){case"recordPayment":v.trackInvoicingActionClick(u.Event.invoicingRecordPaymentClicked,{fromScreen:"invoices_list",invoiceId:i}),e.navigate(`${n}/invoices/${encodeURIComponent(i)}/record-payment`);break;case"issueCreditNote":v.trackInvoicingActionClick(u.Event.invoicingCreditNoteIssued,{fromScreen:"invoices_list",invoiceId:i}),e.navigate(`${n}/invoices/${encodeURIComponent(i)}/issue-credit-note`);break;case"sendReminder":v.trackInvoicingActionClick(u.Event.invoicingInvoiceReminderSent,{fromScreen:"invoices_list",invoiceId:i}),t(V({action:"send-reminder",invoiceId:i}));break;case"regenerate":v.trackInvoicingActionClick(u.Event.invoicingInvoiceRegenerated,{fromScreen:"invoices_list",invoiceId:i}),t(V({action:"regenerate",invoiceId:i}));break;case"void":v.trackInvoicingActionClick(u.Event.invoicingInvoiceVoided,{fromScreen:"invoices_list",invoiceId:i}),t(V({action:"void",invoiceId:i}))}},onVoidInvoice:(i,o)=>{v.trackInvoicingActionClick(u.Event.invoicingInvoiceVoided,{fromScreen:"invoices_list",invoiceId:i}),t(V({action:"void",invoiceId:i,body:o}))},onLoadMore:()=>{e.nextCursor!=null&&t($n({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(jt);function Ia(){const t=A(),e=P(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),[o,s]=r.useState(""),[c,d]=r.useState(""),[l,p]=r.useState(null),g=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),m=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),{activeStatus:S,appliedSearch:f,appliedSort:h,nextCursor:E,invoiceListFetchState:I,voidingInvoiceId:y}=k((C=>{const D=Ln(C);return{activeStatus:D.activeTab,appliedSearch:D.filters.search,appliedSort:C.invoicingInvoiceListState.sort,nextCursor:D.nextCursor,invoiceListFetchState:D.fetchState,voidingInvoiceId:D.runningActionId}}),H),b=I==="Completed";return r.useEffect((()=>{const C=setTimeout((()=>d(o)),300);return()=>clearTimeout(C)}),[o]),r.useEffect((()=>{i&&t(Ee({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(m.search!==f||g?.field!==h?.field||g?.dir!==h?.dir)&&t(Ee({cacheOverride:!0,filters:m,sort:g}))}),[i,t,m,g,f,h]),N(I)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingInvoicesListPage,isReady:b}),a.jsx(ha,{navigate:e,tenantEmailDomain:n,activeStatus:S,searchValue:o,sortState:l,filters:m,sort:g,nextCursor:E,voidingInvoiceId:y,onSearchChange:s,onStatusChange:C=>{t(Li(C)),t(Ee({cacheOverride:!1,filters:m,sort:g}))},onSortChange:p})]})}function cn(){const t=A(),e=P(),{tenantEmailDomain:n}=F(),i=Dt(),o=un(),[s,c]=r.useState(!1),{acceptTermsState:d,status:l}=k(wn),p=$i(i?.loggedInUserRoleMap),g=`/${n}/invoicing`,m=S=>{c(S)};return l==="completed"?a.jsx(B,{to:`${g}/overview`,replace:!0}):l==="settings"&&p?a.jsx(B,{to:`${g}/settings`,replace:!0}):a.jsxs(a.Fragment,{children:[a.jsx(Lo,{isAppContentDrawerOpen:s,handleDrawerToggle:m}),a.jsx(At,{analytics:v,isAccepting:d.fetchState==="In-Progress",isReadOnlyUser:!p,meetingUrl:o("invoicing_promo"),onAcceptClick:()=>{t(wi())},onBackClick:()=>{e(`/${n}`)},onClickMenuIcon:()=>{m(!0)}})]})}const Ca=O((function(t,e){const n=_n(t,e.invoiceId),{invoice:i,localData:o,reasonCodeOptions:s,submitState:c,typeOptions:d}=n;return{fieldHelp:n.fieldHelp,amountDue:i?.amountDue,currencyCode:i?.currencyCode??"USD",customerName:i?.customerName??"",errorMessage:c.fetchState==="Error"?c.error?.message??"Failed to issue credit note. Please try again.":void 0,invoiceNumber:i?.invoiceNumber??e.invoiceId,isSubmitting:c.fetchState==="In-Progress",localData:o,reasonCodeOptions:s,typeOptions:d}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing/invoices/${encodeURIComponent(e.invoiceId)}`,i=()=>e.navigate(n);return{onBack:i,onCancel:i,onChange:o=>{t(Oi({localData:o}))},onSubmit:()=>{v.trackInvoicingActionClick(u.Event.invoicingCreditNoteIssued,{invoiceId:e.invoiceId}),t(Ti())}}}))(Pt);function ka(){const t=A(),e=P(),{invoice_id:n,tenantEmailDomain:i}=F(),{areTenantIdsInSync:o}=R(),{fetchState:s,invoice:c,isPageReady:d,issuedCreditNoteId:l,submitState:p}=k((f=>_n(f,n??""))),g=`/${i}/invoicing`,m=r.useRef(null);r.useEffect((()=>{t(_i()),m.current=null}),[t,n]),r.useEffect((()=>{o&&n!=null&&t(he({invoiceId:n}))}),[o,t,n]),r.useEffect((()=>{c!=null&&n!=null&&s==="Completed"&&m.current!==n&&(m.current=n,t(Fi({localData:Ri(c)})))}),[t,s,c,n]);const S=r.useRef(p.fetchState);return r.useEffect((()=>{const f=S.current;S.current=p.fetchState,f!=="Completed"&&p.fetchState==="Completed"&&l!=null&&e(`${g}/credits/${encodeURIComponent(l)}`)}),[l,e,p.fetchState,g]),a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingInvoiceDetailPage,isReady:d}),a.jsx(Ca,{invoiceId:n??"",navigate:e,tenantEmailDomain:i})]})}const Ea=O((function(t){return{invoicingOverview:Fn(t)}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{onRefresh:()=>{t(Rn(e.selectedPeriod,!0))},onSubscriptionClick:i=>{v.trackInvoicingActionClick(u.Event.invoicingSubscriptionTileClicked,{subscriptionId:i}),e.navigate(`${n}/subscriptions/${i}`)},onViewInvoices:()=>{v.trackInvoicingActionClick(u.Event.invoicingViewInvoicesClicked),e.navigate(`${n}/invoices`)},onViewPayments:()=>{v.trackInvoicingActionClick(u.Event.invoicingViewPaymentsClicked),e.navigate(`${n}/payments`)}}}))(Lt);function ya(){const t=A(),e=P(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),[o]=r.useState((()=>{const c=new Date;return{month:c.getMonth()+1,year:c.getFullYear()}})),s=k((c=>Fn(c).fetchState))==="Completed";return r.useEffect((()=>{i&&t(Rn(o))}),[i,t,o]),a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingOverviewPage,isReady:s}),a.jsx(Ea,{navigate:e,selectedPeriod:o,tenantEmailDomain:n})]})}const xa=O((function(t){const e=Tn(t),{fetchState:n}=e;return{columns:e.columns,hasMore:e.nextCursor!=null,isLoading:n==="Not-Started"||n==="In-Progress"&&e.transactions.length===0,isLoadingMore:n==="In-Progress"&&e.transactions.length>0,tabIds:e.tabIds,transactions:e.transactions}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{activeType:e.activeType,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onTypeChange:e.onTypeChange,onViewTransactionCustomer:e.onViewTransactionCustomer,onViewTransactionInvoice:e.onViewTransactionInvoice,onImportCsv:()=>{v.trackInvoicingActionClick(u.Event.invoicingImportCsvClicked,{entity:"payments"}),e.navigate(`${n}/data_import`)},onTransactionClick:i=>{v.trackInvoicingActionClick(u.Event.invoicingPaymentRowClicked,{transactionId:i}),e.navigate(`${n}/payments/${encodeURIComponent(i)}`)},onLoadMore:()=>{e.nextCursor!=null&&t(Ni({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))($t);function ba(){const t=A(),e=P(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),[o,s]=r.useState(""),[c,d]=r.useState(""),[l,p]=r.useState(null),g=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),m=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),{activeType:S,appliedSearch:f,appliedSort:h,nextCursor:E,transactionListFetchState:I,transactions:y}=k((w=>{const L=Tn(w);return{activeType:L.activeTab,appliedSearch:L.filters.search,appliedSort:L.sort,nextCursor:L.nextCursor,transactionListFetchState:L.fetchState,transactions:L.transactions}}),H),b=I==="Completed",C=`/${n}/invoicing`,D=r.useCallback((w=>{const L=y.find((T=>T.id===w)),U=L?.linkedInvoices?.[0]?.invoiceID??L?.invoiceID;U!=null&&(v.trackInvoicingActionClick(u.Event.invoicingEntityLinkClicked,{fromScreen:"payments_list",invoiceId:U,toScreen:"invoice"}),e(`${C}/invoices/${encodeURIComponent(U)}`))}),[e,C,y]),x=r.useCallback((w=>{const L=y.find((U=>U.id===w))?.customerID;L!=null&&(v.trackInvoicingActionClick(u.Event.invoicingEntityLinkClicked,{customerId:L,fromScreen:"payments_list",toScreen:"customer"}),e(`${C}/customers/${encodeURIComponent(L)}`))}),[e,C,y]);return r.useEffect((()=>{const w=setTimeout((()=>d(o)),300);return()=>clearTimeout(w)}),[o]),r.useEffect((()=>{i&&t(ye({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(m.search!==f||g?.field!==h?.field||g?.dir!==h?.dir)&&t(ye({cacheOverride:!0,filters:m,sort:g}))}),[i,t,m,g,f,h]),N(I)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingPaymentsListPage,isReady:b}),a.jsx(xa,{navigate:e,tenantEmailDomain:n,activeType:S,searchValue:o,sortState:l,filters:m,sort:g,nextCursor:E,onSearchChange:s,onTypeChange:w=>{t(Mi(w)),t(ye({cacheOverride:!1,filters:m,sort:g}))},onSortChange:p,onViewTransactionCustomer:x,onViewTransactionInvoice:D})]})}const ja=t=>{const e=[t.firstName,t.lastName].filter((n=>n!=null&&n.trim()!=="")).join(" ").trim();return(t.company!=null&&t.company.trim()!==""?t.company.trim():"")||e||(t.email!=null&&t.email.trim()!==""?t.email.trim():"")||t.id};function rn(){const t=A(),e=P(),{invoice_id:n,tenantEmailDomain:i}=F(),{areTenantIdsInSync:o}=R(),s=n!=null&&n!=="",c=k(Se),d=k((x=>Ui(x))),l=k(Bi),p=k((x=>Pn(x,n??""))),g=p.invoice,m=`/${i}/invoicing`,S=r.useRef(null),f=r.useRef("");r.useEffect((()=>{t(Vi()),S.current=null,f.current=""}),[t,n]),r.useEffect((()=>{o&&t(s&&n!=null?he({invoiceId:n}):En({filters:{},keepExistingListItems:!1}))}),[o,t,n,s]),r.useEffect((()=>{s&&g!=null&&n!=null&&p.fetchState==="Completed"&&S.current!==n&&(S.current=n,t(Hi({contextInvoiceId:n,localData:qi(g)})))}),[t,g,n,p.fetchState,s]),r.useEffect((()=>{if(s)return;const x=d.localData.customerId;x!==""&&x!==f.current&&(f.current=x,t($n({filters:{customerId:x},keepExistingListItems:!1})),d.localData.invoiceToLink!==""&&t(en({localData:{...d.localData,customerId:x,invoiceToLink:""}})))}),[t,d.localData,s]);const h=r.useRef(l.fetchState);r.useEffect((()=>{const x=h.current;if(h.current=l.fetchState,x!=="Completed"&&l.fetchState==="Completed"){if(l.recordedInvoiceId!=null)return void e(`${m}/invoices/${encodeURIComponent(l.recordedInvoiceId)}`);e(`${m}/payments`)}}),[e,l.fetchState,l.recordedInvoiceId,m]);const E=r.useMemo((()=>c.customers.map((x=>({id:x.id,name:ja(x)})))),[c.customers]),I=k((x=>zi(x,d.localData.customerId))),y=r.useMemo((()=>I.map((x=>{return{amountDue:(w=x.amountDue,L=Qi.currencySymbol,Ft("0,0.00",w,L)),amountDueValue:x.amountDue,id:x.id,label:x.invoiceNumber};var w,L}))),[I]),b=r.useMemo((()=>{if(!s||g==null)return;const x=g.currencyCode??"USD",w=g.amountDue?.amount??0;return{amountDue:wt("0,0.00",g.amountDue),amountDueValue:w,currencyCode:x,customerName:g.customerName??g.customerID,invoiceId:g.id,invoiceNumber:g.invoiceNumber??g.id}}),[g,s]),C=s?`${m}/invoices/${encodeURIComponent(n??"")}`:`${m}/payments`,D=!s||p.fetchState==="Completed"&&d.localData.invoiceToLink!=="";return a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingRecordPaymentPage,isReady:D}),a.jsx(_t,{customers:E,fieldHelp:d.fieldHelp,errorMessage:l.fetchState==="Error"?l.error?.message??"Failed to record payment. Please try again.":void 0,gatewayOptions:d.gatewayOptions,invoiceContext:b,invoiceOptions:y,isSubmitting:l.fetchState==="In-Progress",localData:d.localData,mode:s?"invoice":"customer",paymentMethodOptions:d.paymentMethodOptions,onBack:()=>{e(C)},onCancel:()=>{v.trackInvoicingActionClick(u.Event.invoicingRecordPaymentCancelled),e(C)},onChange:x=>{t(en({localData:x}))},onSubmit:()=>{v.trackInvoicingActionClick(u.Event.invoicingPaymentRecorded,{customerId:d.localData.customerId,invoiceId:s?n:d.localData.invoiceToLink,paymentMethod:d.localData.paymentMethod}),t(Ki(s?n??void 0:void 0))}})]})}const Zn=(t,e,n)=>{const i=`/${t}/invoicing/subscriptions/`;return n!=null?`${i}${encodeURIComponent(n)}/${e}/`:`${i}new/${e}/`},Da=O((function(t,e){const{editView:n}=e,i=n.subscription,o=i?.status,s=o!=null&&e.commercialEditAllowedFromStatuses.includes(o);return{cancelReasonCodeOptions:n.cancelReasonCodeOptions,fieldHelp:n.fieldHelp,addons:n.addons,canEditCommercial:s,charges:n.charges,coupons:n.coupons,isLoading:!e.hasLoadedRecord&&(n.pageFetchState.fetchState==="Not-Started"||n.pageFetchState.fetchState==="In-Progress"||n.isFormLoading),isRunningAction:n.actionState.fetchState==="In-Progress",isSaving:n.fetchState==="In-Progress",lifecycleActionOptions:e.lifecycleActionOptions,localData:n.localData,plans:n.plans,shippingAddressLabel:n.shippingAddressLabel,hasUnsavedShippingAddress:n.hasUnsavedShippingAddress,subscription:i}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{subscriptionId:i}=e,o=i!=="",s=(c,d)=>{v.trackInvoicingActionClick(u.Event.invoicingSubscriptionLifecycleAction,{action:c,subscriptionId:i}),t(Mn({action:c,id:i,body:d}))};return{onBack:()=>e.navigate(`${n}/subscriptions`),onChange:c=>{t(ge({id:i,localData:c}))},onChangeTermEnd:o?c=>{const d=c?.trim()??"";d!==""&&s("change_term_end",{term_ends_at:d})}:void 0,onCustomerClick:c=>{v.trackInvoicingActionClick(u.Event.invoicingEntityLinkClicked,{customerId:c,fromScreen:"subscription_detail",toScreen:"customer"}),window.open(`${n}/customers/${encodeURIComponent(c)}`,"_blank","noopener,noreferrer")},onDiscardEdit:()=>{t(J(me)),t(Wi({id:i}))},onOpenAddress:()=>{const c=Zn(e.tenantEmailDomain??"",me,i),d=X(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(c,{state:{pathnameStackToGoBack:d}})},onViewInvoices:()=>e.navigate(`${n}/invoices`),onSaveEdit:c=>{v.trackInvoicingActionClick(u.Event.invoicingSubscriptionEdited,{subscriptionId:i}),t(ge({id:i,localData:c})),t(On({id:i}))},onCancelSubscription:o?c=>{s("cancel",{cancel_reason_code:c.cancelReasonCode,end_of_term:!1,...c.cancelReason!=null&&c.cancelReason.trim()!==""?{cancel_reason:c.cancelReason.trim()}:{}})}:void 0,onLifecycleAction:o?(c,d)=>{c!=="pause"?s(c):s(c,d!=null&&d.trim()!==""?{resume_date:d.trim()}:void 0)}:void 0}}))(Rt);function Aa(){const t=A(),e=P(),n=W(),{subscription_id:i,tenantEmailDomain:o}=F(),{areTenantIdsInSync:s}=R(),c=k((y=>Ne(y,i))),{subscriptionCommercialEditAllowedFromStatuses:d,subscriptionLifecycleActionOptions:l,subscriptionMetadataEditAllowedFromStatuses:p}=c,g=c.pageFetchState.fetchState,m=g==="Completed"&&!c.isFormLoading,[S,f]=r.useState(m?i:void 0);r.useEffect((()=>{i!=null&&m&&f(i)}),[i,m]);const h=S===i;Ie(s),r.useEffect((()=>{s&&i!=null&&t(Gi({id:i}))}),[s,i,t]);const E=r.useCallback((y=>t(Zi({id:y}))),[t]),I=Y(c.fetchState,c.isFormLoading,i,E);return N(g)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingSubscriptionDetailPage,isReady:m}),a.jsx(Da,{hasLoadedRecord:h,commercialEditAllowedFromStatuses:d,editView:c,lifecycleActionOptions:l,location:n,metadataEditAllowedFromStatuses:p,navigate:e,subscriptionId:i??"",tenantEmailDomain:o},I)]})}const Pa=O((function(t,e){const n=Ne(t,e.subscriptionId);return{fieldHelp:n.fieldHelp,addons:n.addons,charges:n.charges,coupons:n.coupons,customers:n.customers,errorMessage:n.fetchState==="Error"?n.error?.message??"Failed to save subscription.":void 0,isSubmitting:n.fetchState==="In-Progress",isLoading:n.isFormLoading,localData:n.localData,mode:n.mode,plans:n.plans,shippingAddressLabel:n.shippingAddressLabel}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{subscriptionId:i}=e,o=i!=null?"edit":"create";return{onCancel:()=>{v.trackInvoicingActionClick(u.Event.invoicingSubscriptionFormCancelled),t(Nn({id:i})),t(J(me)),i==null?e.navigate(`${n}/subscriptions`):e.navigate(`${n}/subscriptions/${encodeURIComponent(i)}`)},onChange:s=>{t(ge({id:i,localData:s}))},onOpenAddress:()=>{const s=Zn(e.tenantEmailDomain??"",me,i),c=X(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(s,{state:{pathnameStackToGoBack:c}})},onSubmit:()=>{v.trackInvoicingActionClick(u.Event.invoicingSubscriptionSaved,{mode:o}),t(On({id:i}))}}}))(Tt);function La(){const t=A(),e=P(),n=W(),{subscription_id:i,tenantEmailDomain:o}=F(),[s]=Z(),{areTenantIdsInSync:c}=R(),d=s.get("customerId"),{fetchState:l,savedSubscriptionId:p}=k((S=>Xi(S,i))),g=k((S=>Ne(S,i).localData));Ie(c),r.useEffect((()=>{c&&t(Ji({subscriptionId:i}))}),[c,i,t]);const m=r.useRef(!1);return r.useEffect((()=>{m.current||i!=null||d==null||d===""||g.customerId!==""||(m.current=!0,t(ge({id:i,localData:{...g,customerId:d}})))}),[d,i,g,t]),r.useEffect((()=>{if(l==="Completed"){const S=p??i,f=S!=null?`/${o}/invoicing/subscriptions/${encodeURIComponent(S)}`:`/${o}/invoicing/subscriptions`;e(f),t(Nn({id:i}))}}),[l,p,i,t,e,o]),a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingSubscriptionFormPage}),a.jsx(Pa,{location:n,navigate:e,subscriptionId:i,tenantEmailDomain:o})]})}const $a=O((function(t){const e=Un(t),{fetchState:n}=e;return{columns:e.columns,counts:e.count,countsLoading:e.countsFetchState.fetchState==="Not-Started"||e.countsFetchState.fetchState==="In-Progress",hasMore:e.nextCursor!=null,isLoading:n==="Not-Started"||n==="In-Progress"&&e.subscriptions.length===0,isLoadingMore:n==="In-Progress"&&e.subscriptions.length>0,cancelReasonCodeOptions:e.cancelReasonCodeOptions,lifecycleActionOptions:e.subscriptionLifecycleActionOptions,subscriptions:e.subscriptions,tabIds:e.tabIds}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,i=(o,s,c)=>{v.trackInvoicingActionClick(u.Event.invoicingSubscriptionLifecycleAction,{action:s,subscriptionId:o}),t(Mn({action:s,id:o,body:c}))};return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onStatusChange:e.onStatusChange,onAddSubscription:()=>{v.trackInvoicingActionClick(u.Event.invoicingAddSubscriptionClicked),e.navigate(`${n}/subscriptions/new`)},onImportCsv:()=>{v.trackInvoicingActionClick(u.Event.invoicingImportCsvClicked,{entity:"subscriptions"}),e.navigate(`${n}/data_import`)},onChangeTermEnd:(o,s)=>{const c=s?.trim()??"";c!==""&&i(o,"change_term_end",{term_ends_at:c})},onSubscriptionAction:(o,s,c)=>{s!=="pause"?i(o,s):i(o,s,c!=null&&c.trim()!==""?{resume_date:c.trim()}:void 0)},onCancelSubscription:(o,s)=>{i(o,"cancel",{cancel_reason_code:s.cancelReasonCode,end_of_term:!1,...s.cancelReason!=null&&s.cancelReason.trim()!==""?{cancel_reason:s.cancelReason.trim()}:{}})},onSubscriptionClick:o=>{v.trackInvoicingActionClick(u.Event.invoicingSubscriptionRowClicked,{subscriptionId:o}),e.navigate(`${n}/subscriptions/${encodeURIComponent(o)}`)},onViewSubscriptionInvoices:()=>{e.navigate(`${n}/invoices`)},onLoadMore:()=>{e.nextCursor!=null&&t(no({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(Ot);function wa(){const t=A(),e=P(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),[o,s]=r.useState(""),[c,d]=r.useState(""),[l,p]=r.useState(null),g=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),m=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),{activeStatus:S,appliedSearch:f,appliedSort:h,nextCursor:E,subscriptionListFetchState:I,runningActionSubscriptionId:y}=k((D=>{const x=Un(D);return{activeStatus:x.activeTab,appliedSearch:x.filters.search,appliedSort:x.sort,nextCursor:x.nextCursor,subscriptionListFetchState:x.fetchState,runningActionSubscriptionId:x.runningActionId??null}}),H),b=I==="Completed";r.useEffect((()=>{const D=setTimeout((()=>d(o)),300);return()=>clearTimeout(D)}),[o]),r.useEffect((()=>{i&&t(nn({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(m.search!==f||g?.field!==h?.field||g?.dir!==h?.dir)&&t(nn({cacheOverride:!0,filters:m,sort:g}))}),[i,t,m,g,f,h]);const C=r.useRef(y);return r.useEffect((()=>{const D=C.current!=null&&y==null;C.current=y,D&&i&&t(Yi())}),[y,i,t]),N(I)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingSubscriptionsListPage,isReady:b}),a.jsx($a,{navigate:e,tenantEmailDomain:n,activeStatus:S,searchValue:o,sortState:l,filters:m,sort:g,nextCursor:E,runningActionSubscriptionId:y,onSearchChange:s,onStatusChange:D=>t(eo(D)),onSortChange:p})]})}const _a=O((function(t,e){const{readView:n}=e;return{isLoading:n.fetchState==="Not-Started"||n.fetchState==="In-Progress",isRunningAction:n.actionState.fetchState==="In-Progress",transaction:n.transaction,transactionId:e.transactionId}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{transactionId:i}=e;return{onBack:()=>e.navigate(`${n}/payments`),onCustomerClick:o=>{v.trackInvoicingActionClick(u.Event.invoicingEntityLinkClicked,{customerId:o,fromScreen:"transaction_detail",toScreen:"customer"}),e.navigate(`${n}/customers/${encodeURIComponent(o)}`)},onInvoiceClick:o=>{v.trackInvoicingActionClick(u.Event.invoicingEntityLinkClicked,{fromScreen:"transaction_detail",invoiceId:o,toScreen:"invoice"}),e.navigate(`${n}/invoices/${encodeURIComponent(o)}`)},onSubscriptionClick:o=>{v.trackInvoicingActionClick(u.Event.invoicingEntityLinkClicked,{fromScreen:"transaction_detail",subscriptionId:o,toScreen:"subscription"}),e.navigate(`${n}/subscriptions/${encodeURIComponent(o)}`)},onCapture:i!==""?()=>{v.trackInvoicingActionClick(u.Event.invoicingTransactionCaptured,{transactionId:i}),t(oo({action:"capture",id:i}))}:void 0}}))(Mt);function Fa(){const t=A(),e=P(),{tenantEmailDomain:n,transaction_id:i}=F(),{areTenantIdsInSync:o}=R(),s=k((d=>to(d,i??""))),c=s.fetchState==="Completed";return r.useEffect((()=>{o&&i!=null&&t(io({id:i}))}),[o,i,t]),N(s.fetchState)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingTransactionDetailPage,isReady:c}),a.jsx(_a,{navigate:e,tenantEmailDomain:n,transactionId:i??"",readView:s})]})}function Wn(t={}){const{enabled:e=!0,fetchSyncHealth:n=!1,loadAccountingPickers:i=!1,reuseCached:o=!1}=t,s=A(),{areTenantIdsInSync:c}=R(),d=k(Ue),l=d.connection?.connected===!0,p=d.connectionFetchState.fetchState;return r.useEffect((()=>{e&&c&&(o&&p!=="Not-Started"||s(Bn()),n&&s(ao()))}),[c,s,e,n,o]),r.useEffect((()=>{e&&c&&l&&i&&s(so())}),[c,s,e,l,i]),{isQboConnected:l,qboView:d}}const Ra={branding:"invoicing_branding_save",dunning:"invoicing_dunning_settings_save",quickbooks:"invoicing_qbo_settings_save"};function ee(t){const e=A(),{areTenantIdsInSync:n}=R(),{tenantEmailDomain:i}=F(),{fetchState:o,fieldHelp:s,logoFile:c,saveState:d,settings:l,stripeConnectState:p}=k(co),{configError:g,configFetchState:m,dunningScheduleActionOptions:S,qboAccountMappingKindOptions:f,qboCustomerMatchingOptions:h,qboSyncStatusOptions:E}=k(Vn),I=k(Ue);Wn({enabled:t==="quickbooks",fetchSyncHealth:!0,loadAccountingPickers:!0});const y=k(fe),b=t==="dunning"||t==="quickbooks",C=y.companyId??G.getSignedInUserTenant(i??"")?.companyId,D=k((_=>bn(_,C))),x=ro(y.userRole??[]),w=y.tenantId??"",L=G.getSignedInUser(),U={userId:L?.userId??"",sessionId:L?.zeniSessionId??"",tenantId:w},T=c?.fileId,ne=k((_=>T!=null&&T!==""?lo(_,T):void 0)),Be=k((_=>T!=null&&T!==""?uo(_,T):void 0)),Xn=T!=null&&T!==""&&ne!=null?{[T]:ne}:{},Jn=T!=null&&T!==""&&Be!=null?{[T]:Be}:{};r.useEffect((()=>(e(tn()),()=>{e(tn())})),[e]),r.useEffect((()=>{n&&(o!=="Not-Started"&&o!=="Error"||e(Me()))}),[n,e,o]),r.useEffect((()=>{n&&b&&m==="Not-Started"&&e(ve())}),[n,e,m,b]),r.useEffect((()=>{if(!n)return;const _=L?.userId;_!=null&&_!==""&&w!==""&&qe.shouldFetchActiveTenant(w)&&(qe.markActiveTenantFetchStarted(w),e(go(_,w,L?.zeniSessionId)))}),[n,e,L?.userId,L?.zeniSessionId,w]);const Yn=S.length>0||f.length>0,et=o==="Not-Started"||o==="In-Progress"&&l==null||b&&!Yn&&(m==="Not-Started"||m==="In-Progress"),nt=o==="Completed"&&(!b||m==="Completed"),Ve=D.externalConnections?.revenue?.find((_=>_.connectionName==="chargebee"))?.connectionId,Ce=ce?.invoicingMicroServiceBaseUrl,He=Ce!=null&&Ce.length>0?`${Ce}/1.0/webhooks/stripe`:"",ke={deleteConnectionError:D.externalConnections?.deleteConnectionError?.message,deleteConnectionState:D.externalConnections?.deleteConnectionState??"Not-Started",integrationsView:D,isAdmin:x,isStripeBusy:p.fetchState==="In-Progress",onConnectStripe:_=>e(an(_)),onDisconnect:(_,z)=>{w!==""&&e(Io(w,_,sn(z)))},onDisconnectStripe:()=>e(on()),onReconnectQBO:()=>{const _=y.tenantEmailDomain??i??"";pe.init("/connection/auth",_),pe.handleClick()},onRefreshQBO:()=>{D.integrations.refreshQBO.fetchState!=="In-Progress"&&e(zn())},onSaveChargeBeeCredentials:(_,z)=>{Ve!=null&&w!==""&&e(fo(w,Ve,sn("revenue"),ho("chargebee"),{api_key:_,site:z}))},saveChargeBeeError:D.externalConnections?.saveAPIKeyConnectionError?.message,saveChargeBeeState:D.externalConnections?.saveAPIKeyConnectionState??"Not-Started",settings:l,stripeError:p.fetchState==="Error"?p.error?.message??"Failed to connect Stripe. Check your keys and try again.":void 0,stripeWebhookUrl:He};return{authParams:U,deleteFileStatusById:Xn,fieldHelp:s,dunningScheduleActionOptions:S,filesEndPoint:ce?.fileMicroServiceBaseUrl??"",integrationsSectionProps:ke,isInvoicingPageReady:nt,isLoading:et,isSaving:d.fetchState==="In-Progress",isStripeBusy:p.fetchState==="In-Progress",logoFile:c,qboAccountMappingKindOptions:f,qboCustomerMatchingOptions:h,qboSyncStatusOptions:E,qboView:I,saveErrorMessage:d.fetchState==="Error"?d.error?.message??"Failed to save settings.":b&&m==="Error"?g?.message??"Failed to load invoicing configuration.":void 0,settings:l,stripeError:p.fetchState==="Error"?p.error?.message??"Failed to connect Stripe. Check your keys and try again.":void 0,stripeWebhookUrl:He,updateFileStatusById:Jn,onConnectStripe:_=>e(an(_)),onDeleteFile:_=>e(So(_,w)),onDisconnectStripe:()=>e(on()),onEditFileName:(_,z)=>e(po(_,z.split(".")[0],w)),onReconnectQBO:ke.onReconnectQBO,onRefreshQBO:ke.onRefreshQBO,onRetryQboSyncTask:_=>e(qn(_)),onSave:_=>{v.trackInvoicingActionClick(u.Event.invoicingSettingsSaved,{tab:t??"hub"}),e(vo({settings:_,snackbarSection:Ra[t??""]}))},onStartQboBackfill:_=>e(Hn(_)),updateFilesEntity:_=>{v.trackInvoicingActionClick(u.Event.invoicingLogoUploaded),e(mo({files:_}))}}}function ln({appContent:t}){const e=P(),n=W(),i=A(),{tenantEmailDomain:o}=F(),s=ee("branding"),c=k((p=>Co(p))),d=k((p=>ko(xe,p)?.addressToCreate));r.useEffect((()=>{c.saveState.fetchState==="Completed"&&(i(Eo()),i(J(xe)))}),[c.saveState.fetchState,i]);const l=$e(c.saveState.fetchState);return r.useEffect((()=>{l==="In-Progress"&&c.saveState.fetchState==="Completed"&&e("..")}),[l,c.saveState.fetchState,e]),a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingSettingsPage,isReady:s.isInvoicingPageReady}),a.jsx(Nt,{address:d,fieldHelp:c.fieldHelp,addressLabel:c.addressLabel,appContent:t,authParams:s.authParams,dateFormatOptions:c.dateFormatOptions,deleteFileStatusById:s.deleteFileStatusById,filesEndPoint:s.filesEndPoint,isLoading:s.isLoading,isSaving:s.isSaving,localData:c.localData,logoFile:s.logoFile,saveErrorMessage:s.saveErrorMessage,settings:s.settings,updateFileStatusById:s.updateFileStatusById,onBackClick:()=>e(".."),onChange:p=>{i(xo({localData:p}))},onDeleteFile:s.onDeleteFile,onEditFileName:s.onEditFileName,onOpenAddress:()=>{const p=`/${o}/invoicing/settings/branding/${xe}/`,g=X(n.state?.pathnameStackToGoBack,n.pathname);e(p,{state:{pathnameStackToGoBack:g}})},onSubmit:()=>i(yo()),updateFilesEntity:s.updateFilesEntity})]})}function Ta(){const t=P(),e=ee("dunning");return a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingSettingsPage,isReady:e.isInvoicingPageReady}),a.jsx(Ut,{dunningScheduleActionOptions:e.dunningScheduleActionOptions,isLoading:e.isLoading,isSaving:e.isSaving,saveErrorMessage:e.saveErrorMessage,settings:e.settings,onBackClick:()=>t(".."),onSave:e.onSave})]})}function Oa(){const t=P(),e=ee("integrations");return a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingSettingsPage,isReady:e.isInvoicingPageReady}),a.jsx(Bt,{integrationsSectionProps:{...e.integrationsSectionProps,onConfigureQBO:()=>t("../quickbooks"),onOpenPaymentDestination:()=>t("../payment-destination")},isLoading:e.isLoading,onBackClick:()=>t("..")})]})}function Ma(){const t=P(),e=ee("payment-destination");return a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingSettingsPage,isReady:e.isInvoicingPageReady}),a.jsx(Vt,{fieldHelp:e.fieldHelp,isLoading:e.isLoading,isStripeBusy:e.isStripeBusy,saveErrorMessage:e.saveErrorMessage,settings:e.settings,stripeError:e.stripeError,stripeWebhookUrl:e.stripeWebhookUrl,onBackClick:()=>t(".."),onConnectStripe:e.onConnectStripe})]})}const Na=O((function(t){const e=Qn(t);return{accountMappingKindOptions:e.accountMappingKindOptions,fieldHelp:e.fieldHelp,accounts:e.accounts,connection:e.connection,customerMatchingOptions:e.customerMatchingOptions,isBackfilling:e.backfillState.fetchState==="In-Progress",isLoading:e.isLoading,isSaving:e.saveState.fetchState==="In-Progress",isSyncEnabledSaved:e.isSyncEnabledSaved,localData:e.localData,nestedAccountHierarchy:e.nestedAccountHierarchy,retryFetchStateByTaskId:e.retryFetchStateByTaskId,saveErrorMessage:e.saveState.fetchState==="Error"?e.saveState.error?.message:void 0,syncHealth:e.syncHealth,syncStatusOptions:e.syncStatusOptions}}),(function(t){return{onChange:e=>{t(Do({localData:e}))},onReset:()=>{t(jo())},onRetryTask:e=>{t(qn(e))},onSave:()=>{v.trackInvoicingActionClick(u.Event.invoicingSettingsSaved,{tab:"quickbooks"}),t(bo())},onStartBackfill:e=>{t(Hn(e))}}}))(Ht);function Ua(){const t=A(),e=P(),{tenantEmailDomain:n}=F(),i=k(fe),{configFetchState:o,saveState:s,settingsFetchState:c}=k(Qn),d=$e(s.fetchState);return r.useEffect((()=>{d==="In-Progress"&&s.fetchState==="Completed"&&e("..")}),[e,d,s.fetchState]),r.useEffect((()=>{c!=="Not-Started"&&c!=="Error"||t(Me())}),[t,c]),r.useEffect((()=>{o==="Not-Started"&&t(ve())}),[o,t]),Wn({fetchSyncHealth:!0,loadAccountingPickers:!0}),a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingSettingsPage}),a.jsx(Na,{onBackClick:()=>e(".."),onReconnect:()=>{pe.init("/connection/auth",i.tenantEmailDomain??n??""),pe.handleClick()},onRefresh:()=>t(zn())})]})}const Ba={"payment-destination":"payment-destination",general:"branding",integrations:null,dunning:"dunning"};function Va(){const t=un(),e=A(),n=P(),[i,o]=Z(),s=ee(),{canEnableInvoicing:c,isEnablingInvoicing:d,isInvoicingEnabled:l,isQboConfigured:p,isStripeConnected:g}=k(Vn),m=i.get("tab");return r.useEffect((()=>{if(m==null)return;const S=Ba[m];o({},{replace:!0}),S!=null&&n(S,{replace:!0})}),[m,n,o]),a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingSettingsPage,isReady:s.isInvoicingPageReady}),a.jsx(qt,{analytics:v,integrationsSectionProps:{...s.integrationsSectionProps,onConfigureQBO:()=>n("quickbooks"),onOpenPaymentDestination:()=>n("payment-destination")},isEnablingInvoicing:d,isLoading:s.isLoading,meetingUrl:t("invoicing_settings"),settings:s.settings,onBrandingClick:()=>n("branding"),onDunningClick:()=>n("dunning"),canEnableInvoicing:c,isQboConfigured:p,isStripePaymentsReady:g,onEnableInvoicingClick:l?void 0:()=>{e(Ao())}})]})}function dn(){return a.jsxs(oe,{children:[a.jsx(j,{index:!0,element:a.jsx(Va,{})}),a.jsx(j,{path:"payment-destination",element:a.jsx(Ma,{})}),a.jsx(j,{path:"branding",element:a.jsx(ln,{})}),a.jsx(j,{path:"branding/:addressType",element:a.jsx(ln,{appContent:a.jsx(Q,{isSubPage:!0,hideAddressBackButton:!0})})}),a.jsx(j,{path:"integrations",element:a.jsx(Oa,{})}),a.jsx(j,{path:"dunning",element:a.jsx(Ta,{})}),a.jsx(j,{path:"quickbooks",element:a.jsx(Ua,{})}),a.jsx(j,{path:"*",element:a.jsx(B,{to:"..",replace:!0})})]})}function Ss(){const t=A(),e=P(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),{enableState:o,fetchState:s,status:c}=k(wn),d=$e(o.fetchState),l=`/${n}/invoicing`,p=r.useRef(!1),g=k((m=>Ue(m).connectionFetchState.fetchState));return r.useEffect((()=>{i&&(s!=="Not-Started"?s!=="Error"||p.current||(p.current=!0,t(ve({cacheOverride:!1}))):t(ve({cacheOverride:!1})))}),[i,t,s]),r.useEffect((()=>{i&&g==="Not-Started"&&t(Bn())}),[i,t,g]),r.useEffect((()=>{d==="In-Progress"&&o.fetchState==="Completed"&&(e(`${l}/catalog`),t(Po()))}),[d,o.fetchState,l,t,e]),c==null&&s!=="Error"?a.jsx(zt,{fetchState:"In-Progress"}):c==="not_started"?a.jsxs(oe,{children:[a.jsx(j,{path:"promo",element:a.jsx(cn,{})}),a.jsx(j,{path:"*",element:a.jsx(B,{to:`${l}/promo`,replace:!0})})]}):c==="settings"?a.jsxs(oe,{children:[a.jsx(j,{path:"promo",element:a.jsx(cn,{})}),a.jsx(j,{path:"settings/*",element:a.jsx(dn,{})}),a.jsx(j,{path:"*",element:a.jsx(B,{to:`${l}/settings`,replace:!0})})]}):a.jsxs(oe,{children:[a.jsx(j,{path:"/",element:a.jsx(B,{to:"overview",replace:!0})}),a.jsx(j,{path:"overview",element:a.jsx(ya,{})}),a.jsx(j,{path:"promo",element:a.jsx(B,{to:`${l}/overview`,replace:!0})}),a.jsx(j,{path:"customers",element:a.jsx(na,{})}),a.jsx(j,{path:"customers/new",element:a.jsx(Yo,{})}),a.jsx(j,{path:"customers/new/:addressType",element:a.jsx(Q,{})}),a.jsx(j,{path:"customers/:customer_id",element:a.jsx(Xo,{})}),a.jsx(j,{path:"customers/:customer_id/:addressType",element:a.jsx(Q,{})}),a.jsx(j,{path:"subscriptions",element:a.jsx(wa,{})}),a.jsx(j,{path:"subscriptions/new",element:a.jsx(La,{})}),a.jsx(j,{path:"subscriptions/new/:addressType",element:a.jsx(Q,{})}),a.jsx(j,{path:"subscriptions/:subscription_id",element:a.jsx(Aa,{})}),a.jsx(j,{path:"subscriptions/:subscription_id/:addressType",element:a.jsx(Q,{})}),a.jsx(j,{path:"invoices",element:a.jsx(Ia,{})}),a.jsx(j,{path:"invoices/create",element:a.jsx(zo,{})}),a.jsx(j,{path:"invoices/:invoice_id",element:a.jsx(fa,{})}),a.jsx(j,{path:"invoices/:invoice_id/record-payment",element:a.jsx(rn,{})}),a.jsx(j,{path:"invoices/:invoice_id/issue-credit-note",element:a.jsx(ka,{})}),a.jsx(j,{path:"payments",element:a.jsx(ba,{})}),a.jsx(j,{path:"payments/record",element:a.jsx(rn,{})}),a.jsx(j,{path:"payments/:transaction_id",element:a.jsx(Fa,{})}),a.jsx(j,{path:"credits",element:a.jsx(Zo,{})}),a.jsx(j,{path:"credits/:credit_note_id",element:a.jsx(Ko,{})}),a.jsx(j,{path:"discounts",element:a.jsx(ua,{})}),a.jsx(j,{path:"discounts/new",element:a.jsx(Ho,{})}),a.jsx(j,{path:"discounts/:coupon_id",element:a.jsx(la,{})}),a.jsx(j,{path:"dunning",element:a.jsx(pa,{})}),a.jsx(j,{path:"dunning/:case_id",element:a.jsx(ma,{})}),a.jsx(j,{path:"catalog",element:a.jsx(Bo,{})}),a.jsx(j,{path:"catalog/new",element:a.jsx(Mo,{})}),a.jsx(j,{path:"catalog/:item_id",element:a.jsx(Fo,{})}),a.jsx(j,{path:"settings/*",element:a.jsx(dn,{})}),a.jsx(j,{path:"audit_log",element:a.jsx($o,{})}),a.jsx(j,{path:"data_import",element:a.jsx(aa,{})}),a.jsx(j,{path:"data_import/migrate",element:a.jsx(ca,{})}),a.jsx(j,{path:"data_import/:sessionId",element:a.jsx(ia,{})}),a.jsx(j,{path:"*",element:a.jsx(M,{})})]})}export{Ss as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./liveblocks-e6rGc1UF.js";import{h as r,l as n}from"./core-CHD8T-IM.js";import{an as i}from"./index-DKH4PK2B.js";import"./mui-NTaF3UaY.js";import"./sentry-DsyKtMW2.js";import"./zeni-epic-state-BO3zdDfL.js";import"./recharts-C6xUtcdL.js";import"./analytics-C3e3An3a.js";import"./plaid-DdTo7m1-.js";import"./dnd-Dwi6R-ey.js";import"./stripe-cKAAJElX.js";import"./lottie-B778bt56.js";import"./lexical-CMNdypK6.js";import"./pdf-Bx92ZlM_.js";import"./utils-CCA3F0sZ.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new o.Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="3be885cb-07f5-4896-9ae7-ddcb5a1e09f4",o._sentryDebugIdIdentifier="sentry-dbid-3be885cb-07f5-4896-9ae7-ddcb5a1e09f4")}catch{}})();const a=n(null,(function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}}))(i);function _(){const o=r();return e.jsx(a,{navigate:o})}export{_ as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-e6rGc1UF.js";import{z as w,a9 as v,k as u,U as k,e3 as D,N as E,f as I}from"./index-DKH4PK2B.js";import"./mui-NTaF3UaY.js";import g from"./NotFoundScreen-CtgFRYZy.js";import{a as m}from"./sentry-DsyKtMW2.js";import{u as C,j as h,h as F,g as L,l as U,n as T,o as d,N as y}from"./core-CHD8T-IM.js";import{fF as _,a1$ as j,a20 as p,DS as P,p$ as V,a21 as $,DQ as z}from"./zeni-epic-state-BO3zdDfL.js";import"./recharts-C6xUtcdL.js";import"./analytics-C3e3An3a.js";import"./plaid-DdTo7m1-.js";import"./dnd-Dwi6R-ey.js";import"./stripe-cKAAJElX.js";import"./lottie-B778bt56.js";import"./lexical-CMNdypK6.js";import"./pdf-Bx92ZlM_.js";import"./utils-CCA3F0sZ.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]="ac2589e5-c046-4299-9f97-e5c0dc4daab3",e._sentryDebugIdIdentifier="sentry-dbid-ac2589e5-c046-4299-9f97-e5c0dc4daab3")}catch{}})();const G=U((function(e,t){const n=j(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}}),(function(e,t){const{navigate:n}=t,i=w.getSignedInUser();return{onDismissClick:()=>{e(p()),n("/")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach((c=>{s.push(c.companyName),r.push(c.emailIds[0])})),u.trackInviteEmailClicked("send",s,r,s.length)}e(z())},onUpdateInviteFormLocalData:s=>{e($({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&u.trackInviteEmailClicked("cancel")}}}))(D),Q=()=>{const e=C(),[t,n]=m.useState(!1),[i,s]=m.useState(!1),r=h((o=>_(o))),c=F(),x=L(),f=w.getSignedInUser();if(f==null)throw Error("Can't access invite referral screen without signing in...");const l=h((o=>j(o))),b=f?.firstName!=null?f.firstName:"User";m.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(P()),s(!0))}),[]),m.useEffect((()=>{t||l.fetchState!=="Not-Started"||(n(!0),e(V(!0)))}),[l.fetchState,e]);const N=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[l.fetchState==="Completed"?a.jsx(v,{analytics:u,onLoad:o=>(S=>S.trackPageLoaded(k.Event.inviteEmailViewed))(o)}):null,a.jsx(G,{navigate:c,location:x,currentTenant:r,companyName:N,userName:b,inviteFormCompayData:l.localData})]})};function ne(){const{useFeatureGate:e}=E(),{isFeatureEnabled:t}=e(I.isReferralFeatureEnabled);return a.jsxs(T,{children:[a.jsx(d,{path:"/",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(d,{path:"how-it-works",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(d,{path:"refer/*",element:t?a.jsx(Q,{}):a.jsx(g,{})}),a.jsx(d,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-e6rGc1UF.js";import{a as f,R as T,q as A}from"./sentry-DsyKtMW2.js";import{u as z,h as D,j as l,g as j,N as F,l as M}from"./core-CHD8T-IM.js";import{u as P,z as s,E as O,k as w,G as _,T as N,U as B,V,Y as $,Z,_ as v}from"./index-DKH4PK2B.js";import{fF as q,TZ as J,Uh as R,gi as W,gk as G,Um as H,gU as Y,dj as K,Un as b,Uo as Q,Up as X,b$ as U}from"./zeni-epic-state-BO3zdDfL.js";import"./mui-NTaF3UaY.js";import{u as ee}from"./useDeviceId-VsdzmSZI.js";import{f as te}from"./analyticsHelper-BEL0ra9X.js";import{t as ne}from"./getLocaleForTenant-D-or0iZO.js";import"./recharts-C6xUtcdL.js";import"./analytics-C3e3An3a.js";import"./plaid-DdTo7m1-.js";import"./dnd-Dwi6R-ey.js";import"./stripe-cKAAJElX.js";import"./lottie-B778bt56.js";import"./lexical-CMNdypK6.js";import"./pdf-Bx92ZlM_.js";import"./utils-CCA3F0sZ.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]="80a202e5-2f17-43b3-bb0e-bc239750d9a6",t._sentryDebugIdIdentifier="sentry-dbid-80a202e5-2f17-43b3-bb0e-bc239750d9a6")}catch{}})();const ie=M((function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}}),(function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{A({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const c=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(X({authCode:n,oauthProvider:a,appType:"web",redirectUri:U(c),sourceUri:U(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(Q(n,a)))},clearSignInError:()=>{t(b())}}}))(Z),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=z(),d=D(),{clearAllLoading:g}=P(),n=s.getSignedInUser();f.useLayoutEffect((()=>{g()}),[g]);const a=ee(),c=l((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:h,accountLocked:y,accountUnlockTime:k}=l((e=>e.tenantState)),p=l((e=>e.tenantState.fetchState)),L=l((e=>e.tenantState.activeTenantFetchState.fetchState)),S=l((e=>e.tenantState.signInState)),o=l((e=>e.tenantState.loggedInUser)),r=l((e=>q(e))),I=l((e=>J(e))),m=j(),E=O().mode,C=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(f.useEffect((()=>{h.fetchState==="Completed"&&c!=null&&(w.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))}),[h.fetchState,c]),f.useEffect((()=>{t(void 0)}),[]),f.useEffect((()=>{S!=="In-Progress"||p!=="Completed"&&L!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(R(I.tenantsInOrder),o.zeniSessionId),W(o.userId,o.zeniSessionId,r.tenantId),i(G(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(H("Completed")),_.updateAppLocaleID(ne(r)),te(o,r,E,void 0,I.tenantsInOrder),Y().then((()=>{const e=$();e!=null&&N(e)})),setTimeout((()=>{w.trackLogin(B.Event.loginSuccess,o.authProvider??"google",K(r.productSettings))}),2e3))}),[S,p,L,o,r,I,E,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return u.jsx(F,{to:e,state:{...m.state,origin:""}})}return u.jsxs(u.Fragment,{children:[u.jsx(ae,{magicLinkExpired:!!C,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),y===!0&&k!=null?u.jsx(V,{onClose:()=>i(b()),unlockDate:k}):null]})}export{ve as default};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-e6rGc1UF.js";import{a as i}from"./sentry-DsyKtMW2.js";import{u as c,g as d,N as u}from"./core-CHD8T-IM.js";import{z as a,k as n,U as m,a8 as p}from"./index-DKH4PK2B.js";import{gX as g,UD as b}from"./zeni-epic-state-BO3zdDfL.js";import{n as y}from"./mui-NTaF3UaY.js";import"./recharts-C6xUtcdL.js";import"./analytics-C3e3An3a.js";import"./plaid-DdTo7m1-.js";import"./dnd-Dwi6R-ey.js";import"./stripe-cKAAJElX.js";import"./lottie-B778bt56.js";import"./lexical-CMNdypK6.js";import"./pdf-Bx92ZlM_.js";import"./utils-CCA3F0sZ.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="3855b89b-a7aa-4b9a-81b1-94b97f636334",t._sentryDebugIdIdentifier="sentry-dbid-3855b89b-a7aa-4b9a-81b1-94b97f636334")}catch{}})();function N(){const t=c(),e=d(),r=i.useRef(!1),f=a.isSignedIn(),o=e.state?.message==="logout"||f;return i.useEffect((()=>{if(o&&!r.current){r.current=!0;try{t(g()),b(),n.trackLogout(m.Event.logoutSuccess),n.resetUserIdentity(),a.clearAll()}catch(l){console.error("Error during sign out:",l)}finally{window.location.replace("/signin/auth")}}}),[o,t]),o?s.jsx(h,{children:s.jsx(p,{fetchState:"In-Progress"})}):s.jsx(u,{to:"../",replace:!0})}const h=y.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: ${t=>t.theme.colors.grey4};
|
|
9
|
-
`;export{N as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t}from"./liveblocks-e6rGc1UF.js";import i from"./NotFoundScreen-CtgFRYZy.js";import{T as r}from"./TransactionDetailScreen-CQr1YyP0.js";import"./sentry-DsyKtMW2.js";import{n as a,o as e}from"./core-CHD8T-IM.js";import"./zeni-epic-state-BO3zdDfL.js";import"./recharts-C6xUtcdL.js";import"./index-DKH4PK2B.js";import"./mui-NTaF3UaY.js";import"./analytics-C3e3An3a.js";import"./plaid-DdTo7m1-.js";import"./dnd-Dwi6R-ey.js";import"./stripe-cKAAJElX.js";import"./lottie-B778bt56.js";import"./lexical-CMNdypK6.js";import"./pdf-Bx92ZlM_.js";import"./utils-CCA3F0sZ.js";import"./useAskAiCfoHostNavButtonProps-BcCbRGDK.js";import"./decodeURIComponentSafe-p_nrn8Pg.js";import"./useInitialThreadRequest-DDr_z_RH.js";import"./routePaths-CGyE-cU7.js";import"./expenseAutomationHelper-kGR6VZFG.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new o.Error().stack;n&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[n]="bfd19369-9f5a-4875-9ff9-f0a50fe2624d",o._sentryDebugIdIdentifier="sentry-dbid-bfd19369-9f5a-4875-9ff9-f0a50fe2624d")}catch{}})();function z(){return t.jsxs(a,{children:[t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(e,{path:"/*",element:t.jsx(r,{})})]})}export{z as default};
|