@zeniai/web-app-ui 5.3.24-qa → 5.3.25-qa

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/dist/assets/{AccountMappingScreen-DBBdkCwK.js → AccountMappingScreen-C0aQk3eU.js} +2 -2
  2. package/dist/assets/AddressRoutes-sfAfU_xp.js +1 -0
  3. package/dist/assets/{AddressScreen-B2w4_PKl.js → AddressScreen-BD6hfTYm.js} +2 -2
  4. package/dist/assets/{AiCfoScreen-CqaebBsK.js → AiCfoScreen-BQBOwbGt.js} +1 -1
  5. package/dist/assets/{AppDrawer-CKB499oT.js → AppDrawer-DhN1iuHe.js} +1 -1
  6. package/dist/assets/{BillPayApprovalRoutes-CZ1LN8um.js → BillPayApprovalRoutes-D-5hMi6f.js} +1 -1
  7. package/dist/assets/{BillPayRoutes-CQ68uF6m.js → BillPayRoutes-Bl_cSE9O.js} +10 -10
  8. package/dist/assets/{BusinessVerificationPageScreen-DcWVPrfh.js → BusinessVerificationPageScreen-C37udtB6.js} +2 -2
  9. package/dist/assets/{CardsAiCfoScreen-BXy3FrXI.js → CardsAiCfoScreen-DmUDeMY2.js} +1 -1
  10. package/dist/assets/{ChargeCardRoutes-Dv_9gHLl.js → ChargeCardRoutes-BbRPoXSC.js} +8 -8
  11. package/dist/assets/CompanyPassportScreen-C02FQ11m.js +1 -0
  12. package/dist/assets/ConnectionAuthScreen-MC_AsURR.js +11 -0
  13. package/dist/assets/CustomerOnboardingAuthScreen-96EM2Iem.js +1 -0
  14. package/dist/assets/{CustomerOnboardingRoutes-CchBXDRW.js → CustomerOnboardingRoutes-C3c9eOtd.js} +2 -2
  15. package/dist/assets/{DashboardRoutes-CdzeWYFZ.js → DashboardRoutes-C_2UjNDc.js} +1 -1
  16. package/dist/assets/{DefaultTenantHome-CsHhgUxV.js → DefaultTenantHome-DhIA-Auv.js} +1 -1
  17. package/dist/assets/{DomesticWireDetailScreen-jQEBeMm8.js → DomesticWireDetailScreen-BQNmPyj8.js} +3 -3
  18. package/dist/assets/{DrawerScreen-BxvAHfn3.js → DrawerScreen-BRJIwisq.js} +1 -1
  19. package/dist/assets/{EntityDetailRoutes-A1jj_wD6.js → EntityDetailRoutes-DbfX6l2s.js} +1 -1
  20. package/dist/assets/{ExpenseAutomationRoutes-BWhl8VPU.js → ExpenseAutomationRoutes-BTeDD1VK.js} +3 -3
  21. package/dist/assets/FeaturePreviewScreen-o3aGYwm3.js +1 -0
  22. package/dist/assets/{HubSpotOAuthCallbackScreen-RBVExOv1.js → HubSpotOAuthCallbackScreen-WSu5A4Ct.js} +1 -1
  23. package/dist/assets/{InboxNotificationsProvider-wKDejaDE.js → InboxNotificationsProvider-DDRknvRh.js} +1 -1
  24. package/dist/assets/InvoicingRoutes-BC26Hbp1.js +2 -0
  25. package/dist/assets/{MagicLinkRoutes-DZNt_dSs.js → MagicLinkRoutes-BjW61OFo.js} +9 -9
  26. package/dist/assets/{MagicLinkSignInScreen-C8VHmxv1.js → MagicLinkSignInScreen-CuZ2N1Pw.js} +1 -1
  27. package/dist/assets/{MobileAppDrawer-DpejEUKo.js → MobileAppDrawer-Dt611RZ9.js} +1 -1
  28. package/dist/assets/NotFoundScreen-RGfzDsux.js +1 -0
  29. package/dist/assets/{NotificationRoutes-DVdA_FNb.js → NotificationRoutes-BrF6wQ3V.js} +1 -1
  30. package/dist/assets/{OAuthConsentScreen-dMY5nBa0.js → OAuthConsentScreen-BmxCN9Az.js} +1 -1
  31. package/dist/assets/{PandLWithForecastRoutes-D57GW1cM.js → PandLWithForecastRoutes-CHdKE6AL.js} +1 -1
  32. package/dist/assets/PaymentLinkScreen-DvX14mnT.js +21 -0
  33. package/dist/assets/{PeopleRoutes-Dn3ixuya.js → PeopleRoutes-DdiAV2ss.js} +3 -3
  34. package/dist/assets/{PerformanceRoutes-BvYJFI_Z.js → PerformanceRoutes-DJdm2Hjh.js} +1 -1
  35. package/dist/assets/{Preview-QWFcM5zJ.js → Preview-CscVzNW8.js} +1 -1
  36. package/dist/assets/{QBOConnectionScreen-C366HwrW.js → QBOConnectionScreen-Ck8uFfex.js} +22 -22
  37. package/dist/assets/ReimbursementApprovalRoutes-5mZE12FG.js +1 -0
  38. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-CsvqRnAa.js → ReimbursementApprovalRuleDetailScreen-BFUt_Xh2.js} +1 -1
  39. package/dist/assets/{ReimbursementRoutes-CNEWxfxv.js → ReimbursementRoutes-CLw3cjMk.js} +4 -4
  40. package/dist/assets/{ReportsRoutes-2VOVKXB1.js → ReportsRoutes-CBUKpJzK.js} +1 -1
  41. package/dist/assets/RewardsRoutes-BBrOnwnJ.js +1 -0
  42. package/dist/assets/ScreenRoutes-BUG6uyqt.js +2 -0
  43. package/dist/assets/{SettingsRoutes-DncRJVSz.js → SettingsRoutes-D9auvf6o.js} +1 -1
  44. package/dist/assets/{SetupPagesScreen-DeEl3avt.js → SetupPagesScreen-C6kDqRGd.js} +5 -5
  45. package/dist/assets/{SignInScreen-CjKuVPgf.js → SignInScreen-DRDEbF4D.js} +1 -1
  46. package/dist/assets/SignOutScreen-uoV20vWX.js +9 -0
  47. package/dist/assets/{TaskListScreen-DxnAUhd5.js → TaskListScreen-Cln-YyNE.js} +2 -2
  48. package/dist/assets/{TaskRoutes-BFSJCXvT.js → TaskRoutes-CMDSqiu4.js} +2 -2
  49. package/dist/assets/TransactionDetailRoutes-DMotJtMw.js +1 -0
  50. package/dist/assets/{TransactionDetailScreen-O2btGOsz.js → TransactionDetailScreen-B38w1Q4M.js} +1 -1
  51. package/dist/assets/{TransactionListRoutes-C_J1qRL2.js → TransactionListRoutes-CtUzO7h7.js} +1 -1
  52. package/dist/assets/{TreasuryRoutes--6WRfqbv.js → TreasuryRoutes-CaCxjqBo.js} +1 -1
  53. package/dist/assets/{VendorsRoutes-1M6iQid4.js → VendorsRoutes-P3oVwEbQ.js} +12 -12
  54. package/dist/assets/{WiseConfirmationScreen-uEwTTtUw.js → WiseConfirmationScreen-BCBFNvno.js} +1 -1
  55. package/dist/assets/{ZeniAccountRoutes-DSe57kIf.js → ZeniAccountRoutes-BRGQxOqx.js} +9 -9
  56. package/dist/assets/{ZeniAccountStatementScreen-wuqmOaNw.js → ZeniAccountStatementScreen-DQaLVOUo.js} +1 -1
  57. package/dist/assets/{accountMappingHelper-Dxym9iZl.js → accountMappingHelper-L9SkIWKz.js} +1 -1
  58. package/dist/assets/{analytics-D6lgRN4g.js → analytics-CsbG8awP.js} +1 -1
  59. package/dist/assets/{analyticsHelper-BAyQ5I4q.js → analyticsHelper-DtAHYi5r.js} +1 -1
  60. package/dist/assets/{core-dudeiae1.js → core-CGqhbBHO.js} +1 -1
  61. package/dist/assets/{decodeURIComponentSafe-DdtJweGV.js → decodeURIComponentSafe-6FvQaIqS.js} +1 -1
  62. package/dist/assets/{dnd-w5RIXJhq.js → dnd-CyZNzT3I.js} +1 -1
  63. package/dist/assets/{empty-BQ-kH7ke.js → empty-CIUWZs8G.js} +1 -1
  64. package/dist/assets/{empty-S4_FsbsM.js → empty-EE_1cMfQ.js} +1 -1
  65. package/dist/assets/{emptyVideoElement-BOMXiLde.js → emptyVideoElement-CPGcaaig.js} +1 -1
  66. package/dist/assets/{epic-B6GCyFsa.js → epic-Cxd3kHt9.js} +1 -1
  67. package/dist/assets/{expenseAutomationHelper-CNM6-ogC.js → expenseAutomationHelper-wwug0Eyp.js} +1 -1
  68. package/dist/assets/{getLocaleForTenant-Cpc4BQ5R.js → getLocaleForTenant-CSGkphtC.js} +1 -1
  69. package/dist/assets/{index-CTLvjwvC.js → index-BVFow4eV.js} +1 -1
  70. package/dist/assets/{index-BqrSHrqP.js → index-BcNWzeQF.js} +1 -1
  71. package/dist/assets/{index-CRLGPEBi.js → index-BswIxmLx.js} +1 -1
  72. package/dist/assets/{index-DpPNNcCA.js → index-CoKBrrSw.js} +2175 -2175
  73. package/dist/assets/{index-JYUQRle9.js → index-CpkJ0bAk.js} +1 -1
  74. package/dist/assets/{index-B2u8Reic.js → index-Dv01hTrY.js} +1 -1
  75. package/dist/assets/{index-D5TSKAOG.js → index-QncEC5ur.js} +1 -1
  76. package/dist/assets/{index-DvQ-vYdk.js → index-tzevB3Ch.js} +2 -2
  77. package/dist/assets/{lexical-C-raBUAt.js → lexical-C5ZCOEAv.js} +1 -1
  78. package/dist/assets/{liveblocks-BbYAHGiW.js → liveblocks-D83XGo_c.js} +1 -1
  79. package/dist/assets/{lottie-DNeeuCiH.js → lottie-DeqWxWVC.js} +1 -1
  80. package/dist/assets/{mui-DOWmAnEx.js → mui-CD71lp6N.js} +1 -1
  81. package/dist/assets/{pathToGoBack-DijDyQJF.js → pathToGoBack-CoDJzfH-.js} +1 -1
  82. package/dist/assets/{pdf-DOlTc5K5.js → pdf-D4eEcTTi.js} +4 -4
  83. package/dist/assets/{pdf-lib-DldClLY6.js → pdf-lib-Bd7L71QV.js} +1 -1
  84. package/dist/assets/{plaid-DLQRcG8N.js → plaid-C8_LWTII.js} +1 -1
  85. package/dist/assets/{pusher-BblTL6fP.js → pusher-BsMqYR11.js} +1 -1
  86. package/dist/assets/{react-CqBqEhXX.js → react-1_9r2O7V.js} +1 -1
  87. package/dist/assets/{react-fmNHKjFg.js → react-BEE0PagD.js} +1 -1
  88. package/dist/assets/{react-C91EH6ov.js → react-CNf4SjYR.js} +1 -1
  89. package/dist/assets/{react-CE2R_Gca.js → react-Dd8IfcKg.js} +1 -1
  90. package/dist/assets/{react-DNk2CrYB.js → react-DvKEjk5s.js} +1 -1
  91. package/dist/assets/{react-Dg9ESyCy.js → react-l2dFGOnI.js} +1 -1
  92. package/dist/assets/{recharts-B1E_Vcxh.js → recharts-2kmMgB1t.js} +1 -1
  93. package/dist/assets/{routePaths-CKi0kijJ.js → routePaths-DU2fgaW2.js} +1 -1
  94. package/dist/assets/{sentry-BOojnQyr.js → sentry-BPfEBx2C.js} +1 -1
  95. package/dist/assets/{url-9L1oZ1DN.js → url-DSofFSVz.js} +1 -1
  96. package/dist/assets/{url-Csy-z1a3.js → url-WFx5ES50.js} +1 -1
  97. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-CV2CbS_g.js → useAiCfoDashboardSuggestedQuestionsChips-BBuMQpNs.js} +1 -1
  98. package/dist/assets/useAskAiCfoHostNavButtonProps-C4V1Wf7u.js +1 -0
  99. package/dist/assets/{useChargeCardPusherEvents-BMqY0sxt.js → useChargeCardPusherEvents-B1n0Fi92.js} +1 -1
  100. package/dist/assets/{useDeviceId-DHa0QldK.js → useDeviceId-D_DsCe-9.js} +1 -1
  101. package/dist/assets/{useEmailConnectResultRefresh-BkDgJaeO.js → useEmailConnectResultRefresh-BxNSbaGA.js} +1 -1
  102. package/dist/assets/{useInitialThreadRequest-LMcL-Aqa.js → useInitialThreadRequest-CP8MsLNf.js} +1 -1
  103. package/dist/assets/{useTaskManagerAccess-B8w6mJa8.js → useTaskManagerAccess-Dl-8FUHJ.js} +1 -1
  104. package/dist/assets/{utils-wJEG-Wcu.js → utils-B6XFkcn3.js} +1 -1
  105. package/dist/assets/{withTransactionSidePanel-e7n25G5R.js → withTransactionSidePanel-D0UiF_in.js} +1 -1
  106. package/dist/assets/{zeni-epic-state-Dc6DIqGa.js → zeni-epic-state-DASyz1An.js} +3 -3
  107. package/dist/index.html +1 -1
  108. package/package.json +4 -4
  109. package/dist/assets/AddressRoutes-B_KlQ5l4.js +0 -1
  110. package/dist/assets/CompanyPassportScreen-CA83T6v2.js +0 -1
  111. package/dist/assets/ConnectionAuthScreen-D5kWfHq7.js +0 -11
  112. package/dist/assets/CustomerOnboardingAuthScreen-BE65CVvR.js +0 -1
  113. package/dist/assets/FeaturePreviewScreen-DJVzHSu6.js +0 -1
  114. package/dist/assets/InvoicingRoutes-Ct661m9L.js +0 -2
  115. package/dist/assets/NotFoundScreen-DyEaBoCc.js +0 -1
  116. package/dist/assets/PaymentLinkScreen-DWgevViD.js +0 -21
  117. package/dist/assets/ReimbursementApprovalRoutes-bETIIvv3.js +0 -1
  118. package/dist/assets/RewardsRoutes-D-DDx4kZ.js +0 -1
  119. package/dist/assets/ScreenRoutes-JdLv48Sy.js +0 -2
  120. package/dist/assets/SignOutScreen-sRADO8nf.js +0 -9
  121. package/dist/assets/TransactionDetailRoutes-BMeucnIf.js +0 -1
  122. package/dist/assets/useAskAiCfoHostNavButtonProps-Dlbp0rlc.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-DpPNNcCA.js"></script><link rel="modulepreload" crossorigin href="/assets/sentry-BOojnQyr.js"><link rel="modulepreload" crossorigin href="/assets/core-dudeiae1.js"><link rel="modulepreload" crossorigin href="/assets/zeni-epic-state-Dc6DIqGa.js"><link rel="modulepreload" crossorigin href="/assets/mui-DOWmAnEx.js"><link rel="modulepreload" crossorigin href="/assets/analytics-D6lgRN4g.js"><link rel="modulepreload" crossorigin href="/assets/utils-wJEG-Wcu.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>
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-CoKBrrSw.js"></script><link rel="modulepreload" crossorigin href="/assets/sentry-BPfEBx2C.js"><link rel="modulepreload" crossorigin href="/assets/core-CGqhbBHO.js"><link rel="modulepreload" crossorigin href="/assets/zeni-epic-state-DASyz1An.js"><link rel="modulepreload" crossorigin href="/assets/mui-CD71lp6N.js"><link rel="modulepreload" crossorigin href="/assets/analytics-CsbG8awP.js"><link rel="modulepreload" crossorigin href="/assets/utils-B6XFkcn3.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.24-qa",
3
+ "version": "5.3.25-qa",
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.88",
32
- "@zeniai/client-epic-state": "5.2.33",
33
- "@zeniai/web-components": "4.3.60",
31
+ "@zeniai/client-analytics": "2.0.87",
32
+ "@zeniai/client-epic-state": "5.2.32",
33
+ "@zeniai/web-components": "4.3.61",
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-BbYAHGiW.js";import{A as o}from"./AddressScreen-B2w4_PKl.js";import i from"./NotFoundScreen-DyEaBoCc.js";import"./sentry-BOojnQyr.js";import{n as s,o as r}from"./core-dudeiae1.js";import"./zeni-epic-state-Dc6DIqGa.js";import"./recharts-B1E_Vcxh.js";import"./index-DpPNNcCA.js";import"./mui-DOWmAnEx.js";import"./analytics-D6lgRN4g.js";import"./plaid-DLQRcG8N.js";import"./dnd-w5RIXJhq.js";import"./stripe-cKAAJElX.js";import"./lottie-DNeeuCiH.js";import"./lexical-C-raBUAt.js";import"./pdf-DOlTc5K5.js";import"./utils-wJEG-Wcu.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new t.Error().stack;d&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[d]="31d0e0e8-dcf1-419d-b2be-6dc359df28c9",t._sentryDebugIdIdentifier="sentry-dbid-31d0e0e8-dcf1-419d-b2be-6dc359df28c9")}catch{}})();function _(){return e.jsxs(s,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(o,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(o,{})}),e.jsx(r,{path:"*",element:e.jsx(i,{})})]})}export{_ as default};
@@ -1 +0,0 @@
1
- import{j as m}from"./liveblocks-BbYAHGiW.js";import{a as g}from"./sentry-BOojnQyr.js";import{h as w,u as x,g as T,i as k,j as O,l as E}from"./core-dudeiae1.js";import{z as C,bp as F,a6 as P,l as A,S as V,r as b,bq as j,ac as L,aE as U,p as B}from"./index-DpPNNcCA.js";import{fB as N,gF as M,AG as R,gA as _,c7 as G,X9 as z,bn as X,u1 as Y,tR as Z,md as q,nO as S,Xa as H,bE as $,cD as D,nZ as J,o7 as K}from"./zeni-epic-state-Dc6DIqGa.js";import"./mui-DOWmAnEx.js";import{d as Q}from"./routePaths-CKi0kijJ.js";import{M as W}from"./MobileAppDrawer-DpejEUKo.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="38958817-42c7-4c88-b550-0b5dcba73072",t._sentryDebugIdIdentifier="sentry-dbid-38958817-42c7-4c88-b550-0b5dcba73072")}catch{}})();const ee=E((function(t){const a=_(t),i=C.getSignedInUser(),p=N(t),c=p.tenantId,l={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=G(p?.userRole??[])&&a.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=z(t.companyConfigState),n=t.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:a.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:a,allIndustries:e.companyIndustries??[],allNationalityCountries:n,isDisabled:f,authParams:l,filesEndPoint:`${L.fileMicroServiceBaseUrl}`,isZeniUser:X(i)}}),(function(t,a){const{companyId:i,currentTenant:p,navigate:c,location:l}=a,{tenantEmailDomain:f}=p;return{onScheduleClick:e=>{let n=e.href;n.includes("http")||(n="https://".concat(n)),window.open(n,"_blank")},onSaveAll:()=>{t(K())},onAddressClick:e=>{const n=Q(f,e),o=B(l.state?.pathnameStackToGoBack,l.pathname);c(n,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{t(J({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:n,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=n,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:h}=r,v={companyInfo:{...n,website:u!=""&&u!=null?D(u):void 0,meetingLink:y!=""&&y!=null?D(y):void 0,industry:n.industry.selectedOption,companyIndustryType:n.companyIndustryType?.selectedOption??void 0,companySubIndustry:n.companySubIndustry?.selectedOption??void 0,businessModel:n.businessModel.selectedOption??"",companySourceOfFunds:n.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:n.companySourceOfFundsDescription??void 0,countriesOfOperations:n.countriesOfOperations?.selectedOptions?.map((I=>I.length===2?I:U(I)))??[],transactionVolume:n.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:n.transactionVolumeDescription??void 0,regulatedStatus:n.regulatedStatus??void 0,regulatedStatusDescription:n.regulatedStatusDescription??void 0,usNexus:n.usNexus??void 0,usNexusTypes:n.usNexusTypes?.selectedOptions??[],purposeOfAccount:n.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:n.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?$(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:h.selectedOptions.map((I=>parseInt(I))),fileId:r.fileIds[0]}};t(S({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{t(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{t(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=>{t(H(e))},onCompanyOfficerUpdated:e=>{t(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=>{t(q({files:e}))},onDeleteFile:e=>{t(Z(e))},onEditFileName:(e,n)=>{t(Y(e,n.split(".")[0]))}}}))(j);function de(){const t=w(),a=x(),i=T(),{tenantEmailDomain:p}=k(),[c,l]=g.useState(!1),[f,e]=g.useState(!1),n=O((s=>s.companyViewState.passportView.fetchState)),o=O((s=>s.companyConfigState.fetchState)),r=O((s=>N(s))),d=r.companyId??C.getSignedInUserTenant(p)?.companyId;if(C.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect((()=>{c||n!=="Not-Started"||d==null||(l(!0),a(M(d)))}),[c,n,d,a]),g.useEffect((()=>{o==="Not-Started"&&a(R())}),[o,a]);const u=s=>{e(s)},y=n==="Not-Started"||n==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&n==="Error"?m.jsx(F,{onGoHome:()=>t("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(P,{analytics:A,onLoad:s=>s.trackPageLoaded(V.Event.companyPassport,b(i)?"Settings":"Company Passport")}),b(i)?m.jsx(W,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:t,location:i,isLoading:y,currentTenant:r,isSettings:b(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
@@ -1,11 +0,0 @@
1
- import{j as I}from"./liveblocks-BbYAHGiW.js";import{a as o}from"./sentry-BOojnQyr.js";import{u as R,h as k,g as H,j as C,N as j}from"./core-dudeiae1.js";import{SV as q,fB as z,gh as G,pw as V,gJ as A,gg as B,ge as J,Tf as K,gd as O}from"./zeni-epic-state-Dc6DIqGa.js";import{u as Q,z as E,L as D,G as M,K as W}from"./index-DpPNNcCA.js";import{n as X}from"./mui-DOWmAnEx.js";import{P as h,a as _}from"./AccountMappingScreen-DBBdkCwK.js";import{t as Y}from"./getLocaleForTenant-Cpc4BQ5R.js";import{g as Z,Q as ee}from"./QBOConnectionScreen-C366HwrW.js";import"./recharts-B1E_Vcxh.js";import"./analytics-D6lgRN4g.js";import"./plaid-DLQRcG8N.js";import"./dnd-w5RIXJhq.js";import"./stripe-cKAAJElX.js";import"./lottie-DNeeuCiH.js";import"./lexical-C-raBUAt.js";import"./pdf-DOlTc5K5.js";import"./utils-wJEG-Wcu.js";import"./MobileAppDrawer-DpejEUKo.js";import"./InboxNotificationsProvider-wKDejaDE.js";import"./useTaskManagerAccess-B8w6mJa8.js";import"./accountMappingHelper-Dxym9iZl.js";import"./empty-BQ-kH7ke.js";import"./pdf-lib-DldClLY6.js";import"./index-D5TSKAOG.js";import"./url-9L1oZ1DN.js";import"./index-BqrSHrqP.js";import"./decodeURIComponentSafe-DdtJweGV.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]="2090b9db-1f32-4376-a169-e6361ec22e6f",t._sentryDebugIdIdentifier="sentry-dbid-2090b9db-1f32-4376-a169-e6361ec22e6f")}catch{}})();const te=X.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 ${W.sp1} ${t.theme.colors.dropShadowNormal}`};
11
- `;function je(){const t=R(),i=k(),v=H(),{setLoading:c,clearAllLoading:m}=Q(),S=o.useRef(!1),b=o.useRef(!1),N=o.useRef(!1),p=o.useRef(!1),{code:U,realmId:$,state:L}=Z(v.search),f=U!==""&&$!==""&&L!=="";f&&(N.current=!0);const w=sessionStorage.getItem(h),u=w===_.pending,F=w===_.ready,x=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,y=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&&!b.current&&a!=null&&(b.current=!0,!(g==null||g!=null&&(r==="Completed"||r==="Error"))||n!=="Not-Started"&&n!=="Error"||t(V(a.userId)))}),[b,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(B(e.tenantId)),E.saveActiveTenantDomainForUser(e.tenantEmailDomain),J(a?.userId,a?.zeniSessionId,e.tenantId),M.updateAppLocaleID(Y(K(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((()=>{x.tenantsCoreDetailsInOrder.length>0&&n==="Completed"&&E.saveSignedInUserTenants(x.tenantsCoreDetailsInOrder)}),[x.tenantsCoreDetailsInOrder.length,n]);const T=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||T)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||y!==!0||(sessionStorage.removeItem(h),t(O({messageSection:"accounting_projects_qbo_reconnect_failed",messageText:"failed",type:"error"})),m(),i(s,{replace:!0})))}),[u,T,d,f,y,e.tenantEmailDomain,m,t,i]),T)return null;if(f||y!==!0)return I.jsx(te,{children:I.jsx(ee,{})});if(u)return null;const P=e.tenantEmailDomain!=null?`/${e.tenantEmailDomain}/settings/accounting`:"/";return F?I.jsx(j,{to:P,replace:!0}):I.jsx(j,{to:"/",replace:!0})}export{je as default};
@@ -1 +0,0 @@
1
- import{j as i}from"./liveblocks-BbYAHGiW.js";import{z as a}from"./index-DpPNNcCA.js";import{g as n}from"./QBOConnectionScreen-C366HwrW.js";import"./sentry-BOojnQyr.js";import{g as p,N as s}from"./core-dudeiae1.js";import"./zeni-epic-state-Dc6DIqGa.js";import"./recharts-B1E_Vcxh.js";import"./mui-DOWmAnEx.js";import"./analytics-D6lgRN4g.js";import"./plaid-DLQRcG8N.js";import"./dnd-w5RIXJhq.js";import"./stripe-cKAAJElX.js";import"./lottie-DNeeuCiH.js";import"./lexical-C-raBUAt.js";import"./pdf-DOlTc5K5.js";import"./utils-wJEG-Wcu.js";import"./empty-BQ-kH7ke.js";import"./pdf-lib-DldClLY6.js";import"./index-D5TSKAOG.js";import"./url-9L1oZ1DN.js";import"./index-BqrSHrqP.js";import"./decodeURIComponentSafe-DdtJweGV.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]="c18cd95e-770d-4ff7-92bf-3374948ea538",t._sentryDebugIdIdentifier="sentry-dbid-c18cd95e-770d-4ff7-92bf-3374948ea538")}catch{}})();const U=()=>{const t=p(),{code:o,realmId:r,state:e}=n(t.search),d=a.getSignedInUser()?.userId??"";if(f(o,r,e,d)===!0){const m=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return i.jsx(s,{to:m})}return i.jsx(s,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
@@ -1 +0,0 @@
1
- import{j as s}from"./liveblocks-BbYAHGiW.js";import{a as r}from"./sentry-BOojnQyr.js";import{au as f,av as l,s as p,a2 as m}from"./index-DpPNNcCA.js";import"./mui-DOWmAnEx.js";import c from"./NotFoundScreen-DyEaBoCc.js";import{h as u,g as b}from"./core-dudeiae1.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]="7698f57c-9ebe-4017-b325-0803d56e00f6",e._sentryDebugIdIdentifier="sentry-dbid-7698f57c-9ebe-4017-b325-0803d56e00f6")}catch{}})();const _=()=>{const e=u(),t=b(),a=r.useCallback((()=>{window.open("https://www.zeni.ai/demo/request","_blank")}),[]),i=r.useCallback((()=>{(()=>{const n=m(t.state?.pathnameStackToGoBack),d=n.poppedPathname??k();e(d,{state:{pathnameStackToGoBack:n.newStack}})})()}),[]),o=f(t.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:a,onGoBack:i}):s.jsx(c,{})},k=(e=2)=>{let t="../";for(let a=0;a<e;a++)t=`${t}../`;return t};export{_ as F};
@@ -1,2 +0,0 @@
1
- import{j as s}from"./liveblocks-BbYAHGiW.js";import{a as r}from"./sentry-BOojnQyr.js";import{u as P,h as A,i as F,j as E,t as z,l as O,s as H,g as W,N as B,n as te,o as y}from"./core-dudeiae1.js";import{a6 as lt,l as p,ao as T,S as g,c9 as dt,ca as ut,cb as gt,cc as mt,cd as vt,ce as pt,cf as ft,cg as St,ch as ht,ci as Ct,cj as It,ck as Et,cl as kt,cm as yt,p as J,cn as xt,co as bt,ac as ae,cp as jt,cq as Dt,z as Se,cr as Pt,cs as At,ct as Lt,cu as $t,cv as wt,cw as Ft,cx as Tt,cy as Rt,U as Ot,ag as Sn,cz as _t,cA as Mt,cB as Nt,cC as Ut,cD as Bt,cE as Vt,cF as Ht,cG as Zt,cH as qt,t as Ye,k as hn,cI as Yt,cJ as Kt,cK as Qt,cL as Gt,cM as zt,cN as Wt,cO as Jt}from"./index-DpPNNcCA.js";import"./mui-DOWmAnEx.js";import{A as Y}from"./AddressScreen-B2w4_PKl.js";import M from"./NotFoundScreen-DyEaBoCc.js";import{YI as Xt,YJ as ei,uv as Ke,YK as je,YL as K,vz as Qe,vG as ni,vL as Cn,YM as De,YN as In,vD as En,YO as Pe,vB as kn,yg as ti,vC as ii,YP as Q,uY as se,vv as oi,x7 as Ge,uX as he,YQ as ai,YR as yn,vS as si,YS as G,vZ as ci,YT as ri,YU as xn,YV as bn,y2 as li,YW as de,YX as ze,YY as jn,uV as di,YZ as ui,uP as gi,Y_ as mi,xk as vi,Y$ as Dn,xt as We,Z0 as pi,xq as fi,Z1 as Ae,gd as Si,Z2 as ee,Z3 as ne,wc as hi,v1 as Je,Z4 as Le,v6 as Pn,v4 as Ci,u_ as Ii,w5 as Ei,v8 as ki,we as yi,Z5 as Ce,wm as An,wk as Ie,F6 as $e,xz as Xe,Z6 as xi,uW as we,Z7 as Fe,vh as Ee,ve as ke,vr as Ln,vq as Te,vb as bi,vk as $n,vt as ie,fB as Re,Uv as wn,uZ as Oe,vo as ji,vp as Di,vn as Pi,Z8 as Ai,vV as en,v_ as Li,vW as Fn,Z9 as Tn,uJ as nn,Za as $i,uF as Rn,Zb as wi,xF as Fi,xJ as Z,xE as Ti,wN as _e,Zc as Ri,Zd as On,xS as tn,Ze as Oi,xP as _i,Zf as _n,wQ as Mi,wR as V,wU as Ni,Zg as Mn,x2 as me,Zh as Ui,wd as Nn,T3 as Un,Zi as Bi,xc as Vi,Zj as Bn,Zk as Hi,Zl as Zi,Zm as qi,yH as Yi,Zn as Ki,Zo as Vn,xZ as Hn,Zp as Zn,yF as ve,Zq as Qi,yC as Gi,Zr as zi,Zs as Wi,Zt as Ji,Zu as Xi,Zv as eo,Zw as on,Zx as no,yL as to,Zy as Me,ww as an,Zz as Ne,ZA as ce,wG as qn,wB as Yn,wz as ye,ZB as io,wr as oo,y3 as Kn,yu as sn,yp as ao,ZC as so,y4 as co,ZD as ro,yv as lo,yz as uo,ZE as go,ZF as Qn,c7 as mo,m6 as vo,m7 as po,ZG as cn,vA as re,gh as fo,tX as So,md as ho,ym as Gn,yX as Co,yj as zn,u1 as Io,yU as rn,tR as Eo,yR as ln,hP as ko,Tv as dn,Tw as yo,Fi as Wn,hH as xo,ZH as bo,Uk as jo,ZI as Do,z1 as pe,z2 as Po,ZJ as Ao,ZK as Jn,y_ as Lo,ZL as $o,ZM as wo,xg as Fo,ZN as To}from"./zeni-epic-state-Dc6DIqGa.js";import{M as Ro}from"./MobileAppDrawer-DpejEUKo.js";import{q as le}from"./QBOConnectionScreen-C366HwrW.js";import"./recharts-B1E_Vcxh.js";import"./analytics-D6lgRN4g.js";import"./plaid-DLQRcG8N.js";import"./dnd-w5RIXJhq.js";import"./stripe-cKAAJElX.js";import"./lottie-DNeeuCiH.js";import"./lexical-C-raBUAt.js";import"./pdf-DOlTc5K5.js";import"./utils-wJEG-Wcu.js";import"./InboxNotificationsProvider-wKDejaDE.js";import"./useTaskManagerAccess-B8w6mJa8.js";import"./empty-BQ-kH7ke.js";import"./pdf-lib-DldClLY6.js";import"./index-D5TSKAOG.js";import"./url-9L1oZ1DN.js";import"./index-BqrSHrqP.js";import"./decodeURIComponentSafe-DdtJweGV.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]="18b6efff-cf65-45db-9f1c-27dcf4e6765e",t._sentryDebugIdIdentifier="sentry-dbid-18b6efff-cf65-45db-9f1c-27dcf4e6765e")}catch{}})();const w=({event:t,isReady:e=!0})=>e?s.jsx(lt,{analytics:p,onLoad:n=>n.trackPageLoaded(t)}):null;function N(...t){return t.some((e=>e==="Error"))}function Oo(){const t=P(),e=A(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=T(),[o,a]=r.useState(""),[c,d]=r.useState(""),[l,v]=r.useState(null),u=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),{fetchState:m,hasMore:S,items:f,nextCursor:h,auditLogEntityRouteOptions:j,auditLogListSortFieldOptions:k}=E(Xt),x=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),b=`/${n??""}/invoicing`,I=r.useCallback(((_,R)=>{const U=ei(b,_,R,j);U!=null&&(p.trackInvoicingActionClick(g.Event.invoicingEntityLinkClicked,{entity:_,entityId:R,fromScreen:"audit_log"}),e(U))}),[j,e,b]);r.useEffect((()=>{const _=setTimeout((()=>d(o)),300);return()=>clearTimeout(_)}),[o]),r.useEffect((()=>{i&&t(Ke({filters:x,keepExistingListItems:!1,sort:u}))}),[i,x,u,t]);const D=m==="Not-Started"||m==="In-Progress"&&f.length===0,C=m==="In-Progress"&&f.length>0,L=m==="Completed";return N(m)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx(w,{event:g.Event.invoicingAuditLogPage,isReady:L}),s.jsx(dt,{auditLogEntityRouteOptions:j,auditLogListSortFieldOptions:k,entries:f,hasMore:S,isLoading:D,isLoadingMore:C,searchValue:o,sortState:l,onEntityLinkClick:I,onLoadMore:()=>{S&&h!=null&&t(Ke({cursor:h,filters:x,keepExistingListItems:!0,sort:u}))},onSearchChange:a,onSortChange:v})]})}const _o=new Set(["plan"]),Xn=[],Mo=In((t=>t.length>0?t:Xn),mt),No=In((t=>t.length>0?t:Xn),gt),Uo=O((function(t,e){const{view:n}=e;return{groupedAccountOptions:Mo(n.qboAccountHierarchy),groupedClassOptions:No(n.qboClassHierarchy),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(En({action:o,id:i}))}:void 0,onEditChange:o=>{i!==""&&t(De({id:i,localData:o}))},onSaveEdit:()=>{p.trackInvoicingActionClick(g.Event.invoicingCatalogItemEdited,{itemId:i}),t(Cn({id:i}))},onSubFamilyLifecycleAction:(o,a)=>{i!==""&&t(ni({action:a,id:o,parentItemId:i}))}}}))(ut);function Bo(){const t=P(),e=A(),{item_id:n,tenantEmailDomain:i}=F(),[o]=z(),{areTenantIdsInSync:a}=T(),c=(d=o.get("kind"))!=null&&_o.has(d)?d:"plan";var d;const l=E((k=>je(k,n))),{pageFetchState:v,plan:u}=l,m=v.fetchState;r.useEffect((()=>(t(K()),()=>{t(K())})),[t]),r.useEffect((()=>{a&&t(Qe({id:n,kind:c}))}),[a,n,c,t]);const[S,f]=r.useState(0);r.useEffect((()=>{l.fetchState==="Completed"&&(t(K()),t(Qe({cacheOverride:!0,id:n,kind:c})),f((k=>k+1)))}),[l.fetchState,t,n,c]);const h=u==null&&(m==="Not-Started"||m==="In-Progress"),j=m==="Completed";return N(m)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx(w,{event:g.Event.invoicingCatalogItemDetailPage,isReady:j}),s.jsx(Uo,{navigate:e,tenantEmailDomain:i,itemId:n??"",kind:c,isLoading:h,view:l},S)]})}function Ue(t={}){const{enabled:e=!0,fetchSyncHealth:n=!1,loadAccountingPickers:i=!1,reuseCached:o=!1}=t,a=P(),{areTenantIdsInSync:c}=T(),d=E(Pe),l=d.connection?.connected===!0,v=d.connectionFetchState.fetchState;return r.useEffect((()=>{e&&c&&(o&&v!=="Not-Started"||a(kn()),n&&a(ti()))}),[c,a,e,n,o]),r.useEffect((()=>{e&&c&&l&&i&&a(ii())}),[c,a,e,l,i]),{isQboConnected:l,qboView:d}}function Be(t,e=!1){const n=P(),i=E((c=>Q(c).productNextCursor!=null)),o=E((c=>Q(c).productNextCursor)),a=E((c=>Q(c).productFetchState.fetchState));r.useEffect((()=>{t&&(e&&a!=="Not-Started"||n(se({filters:{type:"addon|charge"},keepExistingListItems:!1})))}),[t,n,e]),r.useEffect((()=>{t&&a!=="In-Progress"&&i&&o!=null&&n(se({cursor:o,filters:{type:"addon|charge"},keepExistingListItems:!0}))}),[t,n,a,i,o])}const Vo=new Set(["addon","charge","plan"]),Ho=new Set(["plan"]),Zo=O((function(t,e){const n=je(t,e.itemId);return{fieldHelp:n.fieldHelp,isQboPickerDataLoading:n.isQboPickerDataLoading,qboClassHierarchy:n.qboClassHierarchy,qboAccountHierarchy:n.qboAccountHierarchy,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",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,a=o!=null?`${n}/catalog/${encodeURIComponent(o)}`:`${n}/catalog`;return{onBack:()=>e.navigate(a),onCancel:()=>{p.trackInvoicingActionClick(g.Event.invoicingCatalogItemFormCancelled),t(K()),e.navigate(`${n}/catalog`)},onChange:c=>{t(De({id:o,localData:c}))},onSubmit:()=>{p.trackInvoicingActionClick(g.Event.invoicingCatalogItemSaved,{mode:i}),t(Cn({id:o}))}}}))(vt);function qo(){const t=P(),e=A(),{item_id:n,tenantEmailDomain:i}=F(),[o]=z(),{areTenantIdsInSync:a}=T(),c=n!=null,d=o.get("type"),l=d!=null&&Vo.has(d)?d:void 0,v=(u=o.get("kind"))!=null&&Ho.has(u)?u:"plan";var u;const m=E((S=>je(S,n)));return Be(a,!0),Ue({loadAccountingPickers:!0,reuseCached:!0}),r.useEffect((()=>{a&&n!=null&&t(oi({id:n,kind:v}))}),[a,n,v,t]),r.useEffect((()=>{c||l==null||m.localData.catalogType===l||t(De({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(K())}}),[m.fetchState,m.savedItemId,n,t,e,i]),s.jsxs(s.Fragment,{children:[s.jsx(w,{event:g.Event.invoicingCatalogItemFormPage}),s.jsx(Zo,{navigate:e,tenantEmailDomain:i,defaultType:l,isEdit:c,itemId:n})]})}const Yo={addons:"addon",all:"item",charges:"charge",plans:"plan"},Ko=O((function(t,e){const n=Q(t),i=e.activeTab==="plans",o=e.activeTab==="all",a=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"&&a.length===0,isLoadingMore:c==="In-Progress"&&a.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",a=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:()=>{p.trackInvoicingActionClick(g.Event.invoicingImportCsvClicked,{entity:"catalog"}),e.navigate(`${n}/data_import`)},onAddItem:()=>{const c=Yo[e.activeTab];p.trackInvoicingActionClick(g.Event.invoicingAddCatalogItemClicked,{itemType:c}),e.navigate(`${n}/catalog/new?type=${c}`)},onItemClick:(c,d)=>{p.trackInvoicingActionClick(g.Event.invoicingCatalogItemRowClicked,{itemId:d}),e.navigate(`${n}/catalog/${encodeURIComponent(d)}`)},onCatalogItemLifecycleAction:(c,d)=>{t(En({action:ai(d),id:c}))},onLoadMore:()=>{if(o)return e.planNextCursor!=null&&t(he({cursor:e.planNextCursor,filters:e.planFilters,keepExistingListItems:!0,sort:e.sort})),void(e.productNextCursor!=null&&t(se({cursor:e.productNextCursor,filters:e.productFilters,keepExistingListItems:!0,sort:e.sort})));a!=null&&t(i?he({cursor:a,filters:e.planFilters,keepExistingListItems:!0,sort:e.sort}):se({cursor:a,filters:e.productFilters,keepExistingListItems:!0,sort:e.sort}))}}}))(pt);function Qo(){const t=P(),e=A(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=T(),[o,a]=r.useState(""),[c,d]=r.useState("plans"),[l,v]=r.useState(""),[u,m]=r.useState(null),S=r.useMemo((()=>u!=null?{dir:u.direction,field:u.columnKey}:void 0),[u]),f=l.trim()!==""?l.trim():void 0,h=r.useMemo((()=>({search:f,type:"plan"})),[f]),j=r.useMemo((()=>({search:f,type:"addon|charge"})),[f]),k=E((_=>Q(_))),x=k.planFilters.search,b=k.planSort,I=k.planNextCursor,D=k.productNextCursor,C=k.fetchState==="Completed",L=k.runningActionId??null;return r.useEffect((()=>{const _=setTimeout((()=>v(o)),300);return()=>clearTimeout(_)}),[o]),r.useEffect((()=>{i&&t(Ge({cacheOverride:!1,planFilters:h,productFilters:j,planSort:S,productSort:S}))}),[i,t,h,j,S]),r.useEffect((()=>{i&&(f!==x||S?.field!==b?.field||S?.dir!==b?.dir)&&t(Ge({cacheOverride:!0,planFilters:h,productFilters:j,planSort:S,productSort:S}))}),[x,b,i,t,h,j,f,S]),N(k.fetchState)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx(w,{event:g.Event.invoicingCatalogPage,isReady:C}),s.jsx(Ko,{navigate:e,tenantEmailDomain:n,activeTab:c,searchValue:o,sortState:u,planFilters:h,productFilters:j,sort:S,planNextCursor:I,productNextCursor:D,runningCatalogItemActionId:L,onSearchChange:a,onTabChange:d,onSortChange:m})]})}const Go=O((function(t,e){const n=yn(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,isSubmitting:n.fetchState==="In-Progress",localData:n.localData,mode:n.mode,periodUnitOptions:n.periodUnitOptions}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{couponId:i}=e,o=i!=null?"edit":"create",a=i!=null?`${n}/discounts/${encodeURIComponent(i)}`:`${n}/discounts`;return{onBack:()=>e.navigate(a),onCancel:()=>{p.trackInvoicingActionClick(g.Event.invoicingCouponFormCancelled),t(G()),e.navigate(`${n}/discounts`)},onChange:c=>{t(ri({id:i,localData:c}))},onSubmit:()=>{p.trackInvoicingActionClick(g.Event.invoicingCouponSaved,{mode:o}),t(ci({id:i}))}}}))(ft);function zo(){const t=P(),e=A(),{coupon_id:n,tenantEmailDomain:i}=F(),{areTenantIdsInSync:o}=T(),{fetchState:a,savedCouponId:c}=E((d=>yn(d,n)));return r.useEffect((()=>{o&&n!=null&&t(si({id:n}))}),[o,n,t]),r.useEffect((()=>{if(a==="Completed"){const d=c??n,l=d!=null?`/${i}/invoicing/discounts/${encodeURIComponent(d)}`:`/${i}/invoicing/discounts`;e(l),t(G())}}),[a,c,n,t,e,i]),s.jsxs(s.Fragment,{children:[s.jsx(w,{event:g.Event.invoicingCouponFormPage}),s.jsx(Go,{couponId:n,navigate:e,tenantEmailDomain:i})]})}const Wo=O((function(t){const e=xn(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:()=>{p.trackInvoicingActionClick(g.Event.invoicingCreateInvoiceCancelled),n.navigate(`${i}/invoices`)},onChange:o=>{e(jn(o))},onSubmit:()=>{const o=ui(t.localData);p.trackInvoicingActionClick(g.Event.invoicingInvoiceCreated,{customerId:o.customer_id,lineItemCount:o.line_items?.length}),e(gi(o))}}}))(ht);function Jo(){const t=P(),e=A(),{tenantEmailDomain:n}=F(),[i]=z(),{areTenantIdsInSync:o}=T(),a=i.get("customerId"),c=E((I=>xn(I))),d=c.fetchState,l=c.localData,v=c.savedInvoiceId,u=E(bn),m=E((I=>li(I))),S=E(de),f=m.fetchState==="Not-Started"||m.fetchState==="In-Progress"&&u==null,h=S.fetchState==="Not-Started"||S.fetchState==="In-Progress"&&S.customers.length===0,j=f||h,k=m.fetchState==="Completed"&&S.fetchState==="Completed";r.useEffect((()=>(t(ze()),()=>{t(ze())})),[t]);const x=r.useRef(!1);r.useEffect((()=>{x.current||a==null||a===""||l.customerId!==""||(x.current=!0,t(jn({...l,customerId:a})))}),[a,l,t]),r.useEffect((()=>{o&&t(di({cacheOverride:!1}))}),[o,t]);const b=r.useRef(d);return r.useEffect((()=>{const I=b.current;if(b.current=d,I!=="Completed"&&d==="Completed"){const D=v!=null?`/${n}/invoicing/invoices/${encodeURIComponent(v)}`:`/${n}/invoicing/invoices`;e(D)}}),[d,v,e,n]),s.jsxs(s.Fragment,{children:[s.jsx(w,{event:g.Event.invoicingCreateInvoicePage,isReady:k}),j?s.jsx(St,{}):s.jsx(Wo,{navigate:e,tenantEmailDomain:n})]})}const Xo=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=>{p.trackInvoicingActionClick(g.Event.invoicingEntityLinkClicked,{customerId:i,fromScreen:"credit_detail",toScreen:"customer"}),e.navigate(`${n}/customers/${encodeURIComponent(i)}`)},onInvoiceClick:i=>{p.trackInvoicingActionClick(g.Event.invoicingEntityLinkClicked,{fromScreen:"credit_detail",invoiceId:i,toScreen:"invoice"}),e.navigate(`${n}/invoices/${encodeURIComponent(i)}`)},onSubscriptionClick:i=>{p.trackInvoicingActionClick(g.Event.invoicingEntityLinkClicked,{fromScreen:"credit_detail",subscriptionId:i,toScreen:"subscription"}),e.navigate(`${n}/subscriptions/${encodeURIComponent(i)}`)}}}))(Ct);function ea(){const t=P(),e=A(),{credit_note_id:n,tenantEmailDomain:i}=F(),{areTenantIdsInSync:o}=T(),a=E((d=>mi(d,n??""))),c=a.fetchState==="Completed";return r.useEffect((()=>{o&&n!=null&&t(vi({id:n}))}),[o,n,t]),N(a.fetchState)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx(w,{event:g.Event.invoicingCreditDetailPage,isReady:c}),s.jsx(Xo,{navigate:e,tenantEmailDomain:i,creditNoteId:n??"",detailView:a})]})}const na=O((function(t){const e=Dn(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:()=>{p.trackInvoicingActionClick(g.Event.invoicingImportCsvClicked,{entity:"credits"}),e.navigate(`${n}/data_import`)},onCreditNoteClick:i=>{p.trackInvoicingActionClick(g.Event.invoicingCreditNoteRowClicked,{creditNoteId:i}),e.navigate(`${n}/credits/${encodeURIComponent(i)}`)},onLoadMore:()=>{e.nextCursor!=null&&t(fi({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(It);function ta(){const t=P(),e=A(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=T(),[o,a]=r.useState(""),[c,d]=r.useState(""),[l,v]=r.useState(null),u=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:j,creditNoteListFetchState:k}=E((b=>{const I=Dn(b);return{activeStatus:I.activeTab,appliedSearch:I.filters.search,appliedSort:I.sort,nextCursor:I.nextCursor,creditNoteListFetchState:I.fetchState}}),H),x=k==="Completed";return r.useEffect((()=>{const b=setTimeout((()=>d(o)),300);return()=>clearTimeout(b)}),[o]),r.useEffect((()=>{i&&t(We({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(m.search!==f||u?.field!==h?.field||u?.dir!==h?.dir)&&t(We({cacheOverride:!0,filters:m,sort:u}))}),[i,t,m,u,f,h]),N(k)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx(w,{event:g.Event.invoicingCreditsListPage,isReady:x}),s.jsx(na,{navigate:e,tenantEmailDomain:n,activeStatus:S,searchValue:o,sortState:l,filters:m,sort:u,nextCursor:j,onSearchChange:a,onStatusChange:b=>t(pi(b)),onSortChange:v})]})}const et=(t,e,n)=>{const i=`/${t}/invoicing/customers/`;return n!=null?`${i}${encodeURIComponent(n)}/${e}/`:`${i}new/${e}/`},ia=O((function(t,e){const{editView:n}=e;return{fieldHelp:n.fieldHelp,billingAddressLabel:n.billingAddressLabel,customerTypeOptions:n.customerTypeOptions,netTermDayOptions:n.netTermDayOptions,taxabilityOptions:n.taxabilityOptions,customer:n.record.invoicingCustomer,invoices:n.record.invoices.slice(0,5),isLoading:n.record.invoicingCustomer==null&&(n.pageFetchState.fetchState==="Not-Started"||n.pageFetchState.fetchState==="In-Progress"),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(Ce({id:i,localData:o}))},onCreateInvoice:()=>e.navigate(`${n}/invoices/create`),onInvoiceClick:o=>{p.trackInvoicingActionClick(g.Event.invoicingEntityLinkClicked,{fromScreen:"customer_detail",invoiceId:o,toScreen:"invoice"}),e.navigate(`${n}/invoices/${encodeURIComponent(o)}`)},onCreatePromotionalCredits:()=>e.onCreatePromotionalCredits(),onNewSubscription:()=>e.navigate(`${n}/subscriptions/new`),onOpenAddress:()=>{const o=et(e.tenantEmailDomain??"",Ie,i),a=J(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(o,{state:{pathnameStackToGoBack:a}})},onOpenPaymentSettings:()=>e.navigate(`${n}/settings/payment-destination`),onSaveEdit:o=>{p.trackInvoicingActionClick(g.Event.invoicingCustomerEdited,{customerId:i}),t(Ce({id:i,localData:o})),t(An({id:i}))},onFetchPaymentLinkEmailPreview:o=>t(yi({cacheOverride:o,customerId:i})),onSendPaymentLink:(o,a,c)=>t(ki({body:c,customerId:i,email:o,subject:a})),onSubscriptionClick:o=>{p.trackInvoicingActionClick(g.Event.invoicingEntityLinkClicked,{fromScreen:"customer_detail",subscriptionId:o,toScreen:"subscription"}),e.navigate(`${n}/subscriptions/${encodeURIComponent(o)}`)}}}))(yt);function oa(){const t=P(),e=A(),n=W(),{customer_id:i,tenantEmailDomain:o}=F(),{areTenantIdsInSync:a}=T(),c=E((L=>Ae(L,i))),d=c.pageFetchState.fetchState,l=d==="Completed",[v,u]=r.useState(!1),[m,S]=r.useState(!1),{plaidTokenFetchState:f,promotionalCreditSubmitState:h}=c,{paymentMethodSaveState:j,setupIntentFetchState:k,stripeConnected:x}=c.record,b=r.useRef(c.record.sendLinkState.fetchState);r.useEffect((()=>{const L=c.record.sendLinkState.fetchState;b.current!=="Error"&&L==="Error"&&t(Si({messageSection:"common",messageText:"failed",showStatusIcon:!0,type:"error"})),b.current=L}),[t,c.record.sendLinkState.fetchState]);const I=k.fetchState==="Error"?k.error?.message??"Failed to start card setup.":j.fetchState==="Error"?j.error?.message??"Failed to save payment method.":f.fetchState==="Error"?f.error?.message??"Failed to connect bank account.":void 0;r.useEffect((()=>(t(ee()),t(ne()),()=>{t(ee()),t(ne())})),[t]),r.useEffect((()=>{n.state?.openPromotionalCreditsDialog===!0&&(S(!0),e(n.pathname,{replace:!0,state:null}))}),[n.pathname,n.state,e]),r.useEffect((()=>{a&&i!=null&&t(hi({id:i}))}),[a,i,t]),r.useEffect((()=>{a&&i!=null&&x&&t(Je({customerId:i}))}),[a,i,t,x]);const[D,C]=r.useState(0);return r.useEffect((()=>{c.fetchState==="Completed"&&(t(Le()),i!=null&&t(Pn({id:i})),C((L=>L+1)))}),[c.fetchState,t,i]),N(d)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx(w,{event:g.Event.invoicingCustomerDetailPage,isReady:l}),s.jsx(ia,{customerId:i??"",editView:c,location:n,navigate:e,tenantEmailDomain:o,onAddPaymentMethod:()=>{t(ee()),i!=null&&x&&t(Je({customerId:i})),u(!0)},onCreatePromotionalCredits:()=>{t(ne()),S(!0)}},D),s.jsx(Et,{errorMessage:I,isCreatingSetupIntent:k.fetchState==="In-Progress",isSaving:j.fetchState==="In-Progress",open:v,plaidLinkToken:c.record.plaidLinkToken,saveSucceeded:j.fetchState==="Completed",setupIntent:c.record.setupIntent,stripeConnected:x,onChooseCard:()=>{i!=null&&t(Ii({customerId:i}))},onClose:()=>{u(!1),t(ee())},onSavePaymentMethod:L=>{i!=null&&t(Ci({customerId:i,data:L}))}}),s.jsx(kt,{currentBalance:c.record.invoicingCustomer?.promotionalCredits,currencyCode:c.record.invoicingCustomer?.preferredCurrencyCode,errorMessage:h.fetchState==="Error"?h.error?.message??"Failed to add promotional credits.":void 0,isSubmitting:h.fetchState==="In-Progress",open:m,submitSucceeded:h.fetchState==="Completed",onClose:()=>{S(!1),t(ne())},onSubmit:({amount:L,description:_})=>{i!=null&&t(Ei({amount:L,customerId:i,currencyCode:c.record.invoicingCustomer?.preferredCurrencyCode,description:_}))}})]})}const aa=O((function(t,e){const n=Ae(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",localData:n.localData,mode:n.mode}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{customerId:i}=e,o=i!=null?"edit":"create",a=i!=null?`${n}/customers/${encodeURIComponent(i)}`:`${n}/customers`;return{onBack:()=>e.navigate(a),onCancel:()=>{p.trackInvoicingActionClick(g.Event.invoicingCustomerFormCancelled),t(Le()),t($e(Ie)),e.navigate(`${n}/customers`)},onChange:c=>{t(Ce({id:i,localData:c}))},onOpenAddress:()=>{const c=et(e.tenantEmailDomain??"",Ie,i),d=J(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(c,{state:{pathnameStackToGoBack:d}})},onSubmit:()=>{p.trackInvoicingActionClick(g.Event.invoicingCustomerSaved,{mode:o}),t(An({id:i}))}}}))(xt);function sa(){const t=P(),e=A(),n=W(),{customer_id:i,tenantEmailDomain:o}=F(),{areTenantIdsInSync:a}=T(),{fetchState:c,savedCustomerId:d}=E((l=>Ae(l,i)));return r.useEffect((()=>{a&&i!=null&&t(Pn({id:i}))}),[a,i,t]),r.useEffect((()=>{if(c==="Completed"){const l=d??i,v=l!=null?`/${o}/invoicing/customers/${encodeURIComponent(l)}`:`/${o}/invoicing/customers`;e(v),t(Le())}}),[c,d,i,t,e,o]),s.jsxs(s.Fragment,{children:[s.jsx(w,{event:g.Event.invoicingCustomerFormPage}),s.jsx(aa,{customerId:i,location:n,navigate:e,tenantEmailDomain:o})]})}const ca=O((function(t){const e=de(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:()=>{p.trackInvoicingActionClick(g.Event.invoicingAddCustomerClicked),e.navigate(`${n}/customers/new`)},onCustomerClick:i=>{p.trackInvoicingActionClick(g.Event.invoicingCustomerRowClicked,{customerId:i}),e.navigate(`${n}/customers/${encodeURIComponent(i)}`)},onImportCsv:()=>{p.trackInvoicingActionClick(g.Event.invoicingImportCsvClicked,{entity:"customers"}),e.navigate(`${n}/data_import`)},onRowAction:(i,o)=>{switch(o){case"createInvoice":e.navigate(`${n}/invoices/create?customerId=${encodeURIComponent(i)}`);break;case"newSubscription":e.navigate(`${n}/subscriptions/new?customerId=${encodeURIComponent(i)}`);break;case"createPromotionalCredits":e.navigate(`${n}/customers/${encodeURIComponent(i)}`,{state:{openPromotionalCreditsDialog:!0}})}},onLoadMore:()=>{e.nextCursor!=null&&t(we({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(bt);function ra(){const t=P(),e=A(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=T(),[o,a]=r.useState(""),[c,d]=r.useState(""),[l,v]=r.useState(null),u=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:j,customerListFetchState:k}=E((b=>{const I=de(b);return{activeStatus:I.activeTab,appliedSearch:I.filters.search,appliedSort:I.sort,nextCursor:I.nextCursor,customerListFetchState:I.fetchState}}),H),x=k==="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||u?.field!==h?.field||u?.dir!==h?.dir)&&t(Xe({cacheOverride:!0,filters:m,sort:u}))}),[i,t,m,u,f,h]),N(k)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx(w,{event:g.Event.invoicingCustomersListPage,isReady:x}),s.jsx(ca,{navigate:e,tenantEmailDomain:n,activeStatus:S,searchValue:o,sortState:l,filters:m,sort:u,nextCursor:j,onSearchChange:a,onStatusChange:b=>t(xi(b)),onSortChange:v})]})}const xe=(t,e)=>e==null?void 0:t.sessionDetail[e]??t.sessions.find((n=>n.id===e)),la=O((function(t,e){const{filters:n,sessionId:i,view:o}=e,a=i==null?void 0:o.diagnosticsBySession[i],c=a?.fetch.fetchState??"Not-Started";return{diagnostics:a?.items??[],errorMessage:c==="Error"?a?.fetch.error?.message:void 0,expired:a?.expired??!1,filters:n,hasMore:a?.nextCursor!=null,isLoading:c==="Not-Started"||c==="In-Progress",isLoadingMore:c==="In-Progress"&&(a?.items.length??0)>0,session:xe(o,i)}}),(function(t,e){const{downloadUrl:n,filters:i,navigate:o,sessionId:a,tenantEmailDomain:c,view:d}=e,l=a==null?void 0:d.diagnosticsBySession[a],v=xe(d,a),u=d.actionStateByKind.retry?.fetchState==="In-Progress",m=d.actionStateByKind.rollback?.fetchState==="In-Progress",S=v?.status==="done"&&v.rollback_available_until!=null&&new Date(v.rollback_available_until).getTime()>Date.now()&&!m;return{onBack:()=>o(`/${c}/invoicing/data_import`),onDownloadCsv:()=>{n!=null&&window.open(n,"_blank","noopener")},onFiltersChange:e.onFiltersChange,onLoadMore:()=>{a!=null&&l?.nextCursor!=null&&t(ke({...i,cursor:l.nextCursor,sessionId:a}))},onRetry:v?.status!=="failed"||u?void 0:()=>{a!=null&&t(Te(a))},onRollback:S?()=>{a!=null&&t(Ln(a))}:void 0}}))(jt);function da(){const t=P(),e=A(),{sessionId:n,tenantEmailDomain:i}=F(),{areTenantIdsInSync:o}=T(),[a,c]=r.useState({}),d=E(Fe),l=xe(d,n),v=n==null?void 0:d.diagnosticsBySession[n];r.useEffect((()=>{o&&n!=null&&t(Ee(n))}),[o,t,n]),r.useEffect((()=>{if(!o||n==null)return;const f=setTimeout((()=>{t(ke({...a,sessionId:n}))}),300);return()=>clearTimeout(f)}),[o,t,a,n]);const u=l?.status==="scanning"||l?.status==="importing";r.useEffect((()=>{if(!o||n==null||!u)return;const f=setInterval((()=>{t(Ee(n)),t(ke({...a,sessionId:n}))}),3e3);return()=>clearInterval(f)}),[o,t,a,u,n]);const m=r.useMemo((()=>{if(n==null)return;const f=new URLSearchParams;a.moduleId!=null&&f.set("module_id",a.moduleId),a.level!=null&&f.set("level",a.level),a.outcome!=null&&f.set("outcome",a.outcome),a.search!=null&&a.search.trim()!==""&&f.set("search",a.search.trim());const h=f.toString();return`${ae?.invoicingMicroServiceBaseUrl??""}/1.0/data-import/${encodeURIComponent(n)}/issues.csv${h===""?"":`?${h}`}`}),[a,n]),S=v?.fetch.fetchState??"Not-Started";return N(S)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx(w,{event:g.Event.invoicingDataImportHubPage,isReady:l!=null&&S!=="Not-Started"}),s.jsx(la,{downloadUrl:m,filters:a,navigate:e,sessionId:n,tenantEmailDomain:i,view:d,onFiltersChange:c})]})}const nt=t=>`invoicing_active_migration:${t}`,oe=(t,e)=>{if(t!=null&&t!=="")try{const n=nt(t);e==null?sessionStorage.removeItem(n):sessionStorage.setItem(n,e)}catch{}},ua=O((function(t,e){const{sessions:n,sessionsFetch:i,statusFetch:o,statusRows:a}=e.view;return{isLoading:!(o.fetchState!=="Not-Started"&&o.fetchState!=="In-Progress"||a.length!==0||i.fetchState!=="Not-Started"&&i.fetchState!=="In-Progress"),sessions:n,statusRows:a}}),(function(t,e){const{navigate:n,tenantEmailDomain:i}=e,o=a=>{const c=a??null;t(ie(c)),oe(i,c),n(`/${i}/invoicing/data_import/migrate`)};return{onContinueSession:a=>{p.trackInvoicingActionClick(g.Event.invoicingImportSessionAction,{action:"continue",sessionId:a}),o(a)},onNewImport:()=>{p.trackInvoicingActionClick(g.Event.invoicingNewImportClicked),o()},onRetrySession:a=>{p.trackInvoicingActionClick(g.Event.invoicingImportSessionAction,{action:"retry",sessionId:a}),t(Te(a)),o(a)},onRollbackSession:a=>{p.trackInvoicingActionClick(g.Event.invoicingImportSessionAction,{action:"rollback",sessionId:a}),t(Ln(a))},onViewSession:a=>{p.trackInvoicingActionClick(g.Event.invoicingImportSessionAction,{action:"view_details",sessionId:a}),n(`/${i}/invoicing/data_import/${encodeURIComponent(a)}`)}}}))(Dt);function ga(){const t=P(),e=A(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=T(),o=E(Fe);r.useEffect((()=>{i&&(t(bi()),t($n()))}),[i,t]);const a=o.statusFetch.fetchState==="Completed"&&o.sessionsFetch.fetchState==="Completed";return s.jsxs(s.Fragment,{children:[s.jsx(w,{event:g.Event.invoicingDataImportHubPage,isReady:a}),s.jsx(ua,{navigate:e,tenantEmailDomain:n,view:o})]})}const ma=O((function(t,e){const{activeId:n,integrationsView:i,settings:o,view:a}=e,{actionStateByKind:c,sessionDetail:d,sessions:l}=a,v=i.externalConnections?.revenue?.find((m=>m.connectionName==="chargebee")),u=n!=null?d[n]:void 0;return{chargebeeConnected:o?.chargebee_connected===!0||(v?.isValid??!1),chargebeeConnectorAvailable:v!=null,chargebeeSite:o?.chargebee_site,connectError:c.connect?.error?.message,connecting:c.connect?.fetchState==="In-Progress",retrying:c.retry?.fetchState==="In-Progress",session:u??l.find((m=>m.id===n)),starting:c.start?.fetchState==="In-Progress",uploading:c.upload?.fetchState==="In-Progress"}}),(function(t,e){const{activeId:n,navigate:i,tenantEmailDomain:o}=e;return{onBack:e.onBack,onDownloadTemplates:()=>{p.trackInvoicingActionClick(g.Event.invoicingImportTemplatesDownloaded);const a=ae?.invoicingMicroServiceBaseUrl,c=a!=null&&a.length>0?a:"";window.open(`${c}/1.0/data-import/templates`,"_blank","noopener")},onFetchFromChargebee:()=>{p.trackInvoicingActionClick(g.Event.invoicingChargebeeConnectClicked),t(Pi())},onGoToIntegrations:()=>{i(`/${o}/invoicing/settings`)},onGoToOverview:()=>i(`/${o}/invoicing/overview`),onRetry:()=>{n!=null&&t(Te(n))},onSaveLater:()=>{p.trackInvoicingActionClick(g.Event.invoicingImportSavedForLater),e.onBack()},onStartImport:()=>{p.trackInvoicingActionClick(g.Event.invoicingImportStarted),n!=null&&t(Di(n))},onUpload:a=>{p.trackInvoicingActionClick(g.Event.invoicingImportFileUploaded),t(ji({files:a}))},onViewDetails:n==null?void 0:()=>i(`/${o}/invoicing/data_import/${encodeURIComponent(n)}`)}}))(Pt);function va(){const t=P(),e=A(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=T(),o=E(bn),a=E(Re).companyId??Se.getSignedInUserTenant(n??"")?.companyId,c=E((f=>wn(f,a))),d=E(Fe),{activeMigrationSessionId:l}=d,v=l??void 0,u=v!=null?d.sessionDetail[v]??d.sessions.find((f=>f.id===v)):void 0;r.useEffect((()=>{i&&(t(Oe()),t($n()))}),[i,t]),r.useEffect((()=>{if(l!=null)return;const f=(h=>{if(h==null||h==="")return null;try{return sessionStorage.getItem(nt(h))}catch{return null}})(n);f!=null&&t(ie(f))}),[l,t,n]),r.useEffect((()=>{oe(n,l)}),[l,n]);const m=u?.status,S=m==="scanning"||m==="importing";return r.useEffect((()=>{if(!i||v==null||!S)return;const f=setInterval((()=>{t(Ee(v))}),3e3);return()=>clearInterval(f)}),[i,v,S,t]),r.useEffect((()=>{m==="done"&&(t(ie(null)),oe(n,null))}),[t,m,n]),s.jsxs(s.Fragment,{children:[s.jsx(w,{event:g.Event.invoicingDataImportMigratePage}),s.jsx(ma,{activeId:v,integrationsView:c,navigate:e,settings:o,tenantEmailDomain:n,view:d,onBack:()=>{t(ie(null)),oe(n,null),e(`/${n}/invoicing/data_import`)}})]})}const pa=O((function(t,e){const{editView:n}=e;return{fieldHelp:n.fieldHelp,coupon:n.coupon,discountLifecycleActionOptions:e.discountLifecycleActionOptions,isLoading:n.coupon==null&&(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(Fn({action:o,id:i}))},onSaveEdit:o=>{p.trackInvoicingActionClick(g.Event.invoicingCouponEdited,{couponId:i}),t(Li({data:o,id:i}))}}}))(At);function fa(){const t=P(),e=A(),{coupon_id:n,tenantEmailDomain:i}=F(),{areTenantIdsInSync:o}=T(),a=E((m=>Ai(m,n))),c=a.actionState.fetchState==="In-Progress",d=a.pageFetchState.fetchState,l=d==="Completed";r.useEffect((()=>(t(G()),()=>{t(G())})),[t]),r.useEffect((()=>{o&&t(en({id:n}))}),[o,n,t]);const[v,u]=r.useState(0);return r.useEffect((()=>{a.fetchState==="Completed"&&(t(G()),t(en({cacheOverride:!0,id:n})),u((m=>m+1)))}),[a.fetchState,t,n]),N(d)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx(w,{event:g.Event.invoicingDiscountDetailPage,isReady:l}),s.jsx(pa,{couponId:n??"",discountLifecycleActionOptions:a.discountLifecycleActionOptions,editView:a,isRunningLifecycleAction:c,navigate:e,tenantEmailDomain:i},v)]})}const Sa=O((function(t){const e=Tn(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=>{p.trackInvoicingActionClick(g.Event.invoicingDiscountRowClicked,{couponId:i}),e.navigate(`${n}/discounts/${encodeURIComponent(i)}`)},onCreateCoupon:()=>{p.trackInvoicingActionClick(g.Event.invoicingCreateCouponClicked),e.navigate(`${n}/discounts/new`)},onImportCsv:()=>{p.trackInvoicingActionClick(g.Event.invoicingImportCsvClicked,{entity:"discounts"}),e.navigate(`${n}/data_import`)},onDiscountLifecycleAction:(i,o)=>{t(Fn({action:o,id:i}))},onLoadMore:()=>{e.nextCursor!=null&&t(Rn({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(Lt);function ha(){const t=P(),e=A(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=T(),[o,a]=r.useState(""),[c,d]=r.useState(""),[l,v]=r.useState(null),u=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:j,couponListFetchState:k,runningDiscountActionId:x}=E((I=>{const D=Tn(I);return{activeStatus:D.activeTab,appliedSearch:D.filters.search,appliedSort:D.sort,nextCursor:D.nextCursor,couponListFetchState:D.fetchState,runningDiscountActionId:D.runningActionId??null}}),H),b=k==="Completed";return r.useEffect((()=>{const I=setTimeout((()=>d(o)),300);return()=>clearTimeout(I)}),[o]),r.useEffect((()=>{i&&t(nn({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(m.search!==f||u?.field!==h?.field||u?.dir!==h?.dir)&&t(nn({cacheOverride:!0,filters:m,sort:u}))}),[i,t,m,u,f,h]),N(k)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx(w,{event:g.Event.invoicingDiscountsListPage,isReady:b}),s.jsx(Sa,{navigate:e,tenantEmailDomain:n,activeStatus:S,searchValue:o,sortState:l,filters:m,sort:u,nextCursor:j,runningDiscountActionId:x,onSearchChange:a,onStatusChange:I=>t($i(I)),onSortChange:v})]})}const Ca=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:a=>{p.trackInvoicingActionClick(g.Event.invoicingEntityLinkClicked,{caseId:i,fromScreen:"dunning_detail",invoiceId:a,toScreen:"invoice"}),e.navigate(`${n}/invoices/${encodeURIComponent(a)}`)},onCancel:o?()=>t(Z({action:"cancel",id:i})):void 0,onResolve:o?()=>{p.trackInvoicingActionClick(g.Event.invoicingDunningAction,{action:"resolve",caseId:i}),t(Z({action:"resolve",id:i}))}:void 0,onResume:o?()=>{p.trackInvoicingActionClick(g.Event.invoicingDunningAction,{action:"resume",caseId:i}),t(Z({action:"resume",id:i}))}:void 0,onRetry:o?()=>{p.trackInvoicingActionClick(g.Event.invoicingDunningAction,{action:"retry",caseId:i}),t(Z({action:"retry",id:i}))}:void 0}}))(wt);function Ia(){const t=P(),e=A(),{case_id:n,tenantEmailDomain:i}=F(),{areTenantIdsInSync:o}=T(),a=E((C=>wi(C,n??""))),c=a.fetchState==="Completed",d=a.dunningCase?.invoiceID,[l,v]=r.useState("idle"),[u,m]=r.useState(!1),[S,f]=r.useState(),[h,j]=r.useState(!1),k=r.useCallback((()=>{v("idle"),m(!1),f(void 0),j(!1)}),[]),x=r.useCallback((()=>{if(n==null)return;t(Fi({id:n})),v("idle"),m(!1);const C=a.emailPreview.preview;f(C==null?void 0:{body:C.body,cc:C.cc,subject:C.subject,to:C.to}),j(!0)}),[n,t,a.emailPreview.preview]),b=r.useCallback((C=>{n!=null&&l!=="pending"&&(m(!1),v("pending"),p.trackInvoicingActionClick(g.Event.invoicingDunningAction,{action:"send-email",caseId:n}),t(Z({action:"send-email",body:C,id:n})))}),[n,t,l]),I=r.useMemo((()=>a.emailPreview.preview==null?void 0:{bodyToken:a.emailPreview.preview.bodyToken,renderedHtmlTemplate:a.emailPreview.preview.renderedHtmlTemplate,subjectToken:a.emailPreview.preview.subjectToken}),[a.emailPreview.preview]);r.useEffect((()=>{o&&n!=null&&t(Ti({id:n}))}),[o,n,t]),r.useEffect((()=>{o&&d!=null&&t(_e({invoiceId:d}))}),[o,d,t]),r.useEffect((()=>{v("idle"),m(!1),f(void 0),j(!1)}),[n]),r.useEffect((()=>{o||(v("idle"),m(!1),f(void 0),j(!1))}),[o]),r.useEffect((()=>{h&&S==null&&a.emailPreview.preview!=null&&f({body:a.emailPreview.preview.body,cc:a.emailPreview.preview.cc,subject:a.emailPreview.preview.subject,to:a.emailPreview.preview.to})}),[a.emailPreview.preview,S,h]),r.useEffect((()=>{l==="pending"&&(a.actionState.fetchState!=="In-Progress"?u&&a.actionState.fetchState==="Completed"?(n!=null&&t(Ri({id:n})),k()):u&&a.actionState.fetchState==="Error"&&v("failed"):m(!0))}),[n,k,t,l,u,a.actionState.fetchState]);const D=d!=null&&a.linkedInvoice?.id===d?a.linkedInvoice.dunningAttempts:void 0;return N(a.fetchState)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx(w,{event:g.Event.invoicingDunningDetailPage,isReady:c}),s.jsx(Ca,{navigate:e,tenantEmailDomain:i,caseId:n??"",readView:a,dunningAttempts:D,onSendEmail:x}),s.jsx($t,{initialDraft:S,isPreviewLoading:a.emailPreview.fetchState==="Not-Started"||a.emailPreview.fetchState==="In-Progress",isSending:l==="pending",onClose:k,onSend:b,open:h,preview:I,previewErrorMessage:a.emailPreview.fetchState==="Error"?a.emailPreview.error?.message:void 0,sendErrorMessage:l==="failed"?a.actionState.error?.message:void 0})]})}const Ea=O((function(t){const e=On(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=>{p.trackInvoicingActionClick(g.Event.invoicingDunningCaseRowClicked,{caseId:i}),e.navigate(`${n}/dunning/${encodeURIComponent(i)}`)},onRowAction:(i,o)=>{o!=="retry"&&o!=="resume"&&o!=="resolve"&&o!=="cancel"||t(Z({action:o,id:i}))},onLoadMore:()=>{e.nextCursor!=null&&t(_i({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(Ft);function ka(){const t=P(),e=A(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=T(),[o,a]=r.useState(""),[c,d]=r.useState(""),[l,v]=r.useState(null),u=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:j,dunningCaseListFetchState:k}=E((b=>{const I=On(b);return{activeStatus:I.activeTab,appliedSearch:I.filters.search,appliedSort:I.sort,nextCursor:I.nextCursor,dunningCaseListFetchState:I.fetchState}}),H),x=k==="Completed";return r.useEffect((()=>{const b=setTimeout((()=>d(o)),300);return()=>clearTimeout(b)}),[o]),r.useEffect((()=>{i&&t(tn({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(m.search!==f||u?.field!==h?.field||u?.dir!==h?.dir)&&t(tn({cacheOverride:!0,filters:m,sort:u}))}),[i,t,m,u,f,h]),N(k)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx(w,{event:g.Event.invoicingDunningListPage,isReady:x}),s.jsx(Ea,{navigate:e,tenantEmailDomain:n,activeStatus:S,searchValue:o,sortState:l,filters:m,sort:u,nextCursor:j,onSearchChange:a,onStatusChange:b=>t(Oi(b)),onSortChange:v})]})}const ya=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:n.invoice==null&&(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=>{p.trackInvoicingActionClick(g.Event.invoicingEntityLinkClicked,{customerId:o,fromScreen:"invoice_detail",toScreen:"customer"}),e.navigate(`${n}/customers/${encodeURIComponent(o)}`)},onIssueCreditNote:()=>{p.trackInvoicingActionClick(g.Event.invoicingCreditNoteIssued,{invoiceId:i}),e.navigate(`${n}/invoices/${encodeURIComponent(i)}/issue-credit-note`)},onRecordPayment:()=>{p.trackInvoicingActionClick(g.Event.invoicingRecordPaymentClicked,{fromScreen:"invoice_detail",invoiceId:i}),e.navigate(`${n}/invoices/${encodeURIComponent(i)}/record-payment`)},onRegenerate:()=>{p.trackInvoicingActionClick(g.Event.invoicingInvoiceRegenerated,{invoiceId:i}),t(V({action:"regenerate",invoiceId:i}))},onSaveEdit:o=>{p.trackInvoicingActionClick(g.Event.invoicingInvoiceEdited,{invoiceId:i}),t(Ni({data:{due_date:o.due_date!==""?o.due_date:void 0,notes:o.notes.trim()!==""?o.notes.split(`
2
- `).map((a=>a.trim())).filter((a=>a!=="")).map((a=>({note:a}))):void 0,po_number:o.po_number!==""?o.po_number:null},invoiceId:i}))},onSendReminder:()=>{p.trackInvoicingActionClick(g.Event.invoicingInvoiceReminderSent,{invoiceId:i}),t(V({action:"send-reminder",invoiceId:i}))},onSubscriptionClick:o=>{p.trackInvoicingActionClick(g.Event.invoicingEntityLinkClicked,{fromScreen:"invoice_detail",subscriptionId:o,toScreen:"subscription"}),e.navigate(`${n}/subscriptions/${encodeURIComponent(o)}`)},onVoid:o=>{p.trackInvoicingActionClick(g.Event.invoicingInvoiceVoided,{invoiceId:i}),t(V({action:"void",invoiceId:i,body:o}))}}}))(Tt);function xa(){const t=P(),e=A(),{invoice_id:n,tenantEmailDomain:i}=F(),{areTenantIdsInSync:o}=T(),a=E((l=>_n(l,n??""))),c=a.pageFetchState.fetchState,d=c==="Completed";return r.useEffect((()=>{o&&n!=null&&t(Mi({invoiceId:n}))}),[o,n,t]),N(c)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx(w,{event:g.Event.invoicingInvoiceDetailPage,isReady:d}),s.jsx(ya,{invoiceId:n??"",navigate:e,tenantEmailDomain:i,view:a})]})}const ba=O((function(t){const e=Mn(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:()=>{p.trackInvoicingActionClick(g.Event.invoicingCreateInvoiceClicked),e.navigate(`${n}/invoices/create`)},onImportCsv:()=>{p.trackInvoicingActionClick(g.Event.invoicingImportCsvClicked,{entity:"invoices"}),e.navigate(`${n}/data_import`)},onInvoiceClick:i=>{p.trackInvoicingActionClick(g.Event.invoicingInvoiceRowClicked,{invoiceId:i}),e.navigate(`${n}/invoices/${encodeURIComponent(i)}`)},onRowAction:(i,o)=>{switch(o){case"recordPayment":e.navigate(`${n}/invoices/${encodeURIComponent(i)}/record-payment`);break;case"issueCreditNote":e.navigate(`${n}/invoices/${encodeURIComponent(i)}/issue-credit-note`);break;case"sendReminder":t(V({action:"send-reminder",invoiceId:i}));break;case"regenerate":t(V({action:"regenerate",invoiceId:i}));break;case"void":t(V({action:"void",invoiceId:i}))}},onVoidInvoice:(i,o)=>{p.trackInvoicingActionClick(g.Event.invoicingInvoiceVoided,{invoiceId:i}),t(V({action:"void",invoiceId:i,body:o}))},onLoadMore:()=>{e.nextCursor!=null&&t(Nn({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(Rt);function ja(){const t=P(),e=A(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=T(),[o,a]=r.useState(""),[c,d]=r.useState(""),[l,v]=r.useState(null),u=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:j,invoiceListFetchState:k,voidingInvoiceId:x}=E((I=>{const D=Mn(I);return{activeStatus:D.activeTab,appliedSearch:D.filters.search,appliedSort:I.invoicingInvoiceListState.sort,nextCursor:D.nextCursor,invoiceListFetchState:D.fetchState,voidingInvoiceId:D.runningActionId}}),H),b=k==="Completed";return r.useEffect((()=>{const I=setTimeout((()=>d(o)),300);return()=>clearTimeout(I)}),[o]),r.useEffect((()=>{i&&t(me({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(m.search!==f||u?.field!==h?.field||u?.dir!==h?.dir)&&t(me({cacheOverride:!0,filters:m,sort:u}))}),[i,t,m,u,f,h]),N(k)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx(w,{event:g.Event.invoicingInvoicesListPage,isReady:b}),s.jsx(ba,{navigate:e,tenantEmailDomain:n,activeStatus:S,searchValue:o,sortState:l,filters:m,sort:u,nextCursor:j,voidingInvoiceId:x,onSearchChange:a,onStatusChange:I=>{t(Ui(I)),t(me({cacheOverride:!1,filters:m,sort:u}))},onSortChange:v})]})}function un(){const t=P(),e=A(),{tenantEmailDomain:n}=F(),i=Ot(),o=Sn(),[a,c]=r.useState(!1),{acceptTermsState:d,status:l}=E(Un),v=Bi(i?.loggedInUserRoleMap),u=`/${n}/invoicing`,m=S=>{c(S)};return l==="completed"?s.jsx(B,{to:`${u}/overview`,replace:!0}):l==="settings"&&v?s.jsx(B,{to:`${u}/settings`,replace:!0}):s.jsxs(s.Fragment,{children:[s.jsx(Ro,{isAppContentDrawerOpen:a,handleDrawerToggle:m}),s.jsx(_t,{analytics:p,isAccepting:d.fetchState==="In-Progress",isReadOnlyUser:!v,meetingUrl:o("invoicing_promo"),onAcceptClick:()=>{t(Vi())},onBackClick:()=>{e(`/${n}`)},onClickMenuIcon:()=>{m(!0)}})]})}const Da=O((function(t,e){const n=Bn(t,e.invoiceId),{invoice:i,localData:o,reasonCodeOptions:a,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:a,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(Ki({localData:o}))},onSubmit:()=>{p.trackInvoicingActionClick(g.Event.invoicingCreditNoteIssued,{invoiceId:e.invoiceId}),t(Yi())}}}))(Mt);function Pa(){const t=P(),e=A(),{invoice_id:n,tenantEmailDomain:i}=F(),{areTenantIdsInSync:o}=T(),{fetchState:a,invoice:c,isPageReady:d,issuedCreditNoteId:l,submitState:v}=E((f=>Bn(f,n??""))),u=`/${i}/invoicing`,m=r.useRef(null);r.useEffect((()=>{t(Hi()),m.current=null}),[t,n]),r.useEffect((()=>{o&&n!=null&&t(_e({invoiceId:n}))}),[o,t,n]),r.useEffect((()=>{c!=null&&n!=null&&a==="Completed"&&m.current!==n&&(m.current=n,t(Zi({localData:qi(c)})))}),[t,a,c,n]);const S=r.useRef(v.fetchState);return r.useEffect((()=>{const f=S.current;S.current=v.fetchState,f!=="Completed"&&v.fetchState==="Completed"&&l!=null&&e(`${u}/credits/${encodeURIComponent(l)}`)}),[l,e,v.fetchState,u]),s.jsxs(s.Fragment,{children:[s.jsx(w,{event:g.Event.invoicingInvoiceDetailPage,isReady:d}),s.jsx(Da,{invoiceId:n??"",navigate:e,tenantEmailDomain:i})]})}const Aa=O((function(t){return{invoicingOverview:Vn(t)}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{onRefresh:()=>{t(Hn(e.selectedPeriod,!0))},onSubscriptionClick:i=>{p.trackInvoicingActionClick(g.Event.invoicingSubscriptionTileClicked,{subscriptionId:i}),e.navigate(`${n}/subscriptions/${i}`)},onViewInvoices:()=>{p.trackInvoicingActionClick(g.Event.invoicingViewInvoicesClicked),e.navigate(`${n}/invoices`)},onViewPayments:()=>{p.trackInvoicingActionClick(g.Event.invoicingViewPaymentsClicked),e.navigate(`${n}/payments`)}}}))(Nt);function La(){const t=P(),e=A(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=T(),[o]=r.useState((()=>{const c=new Date;return{month:c.getMonth()+1,year:c.getFullYear()}})),a=E((c=>Vn(c).fetchState))==="Completed";return r.useEffect((()=>{i&&t(Hn(o))}),[i,t,o]),s.jsxs(s.Fragment,{children:[s.jsx(w,{event:g.Event.invoicingOverviewPage,isReady:a}),s.jsx(Aa,{navigate:e,selectedPeriod:o,tenantEmailDomain:n})]})}const $a=O((function(t){const e=Zn(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:()=>{p.trackInvoicingActionClick(g.Event.invoicingImportCsvClicked,{entity:"payments"}),e.navigate(`${n}/data_import`)},onTransactionClick:i=>{p.trackInvoicingActionClick(g.Event.invoicingPaymentRowClicked,{transactionId:i}),e.navigate(`${n}/payments/${encodeURIComponent(i)}`)},onLoadMore:()=>{e.nextCursor!=null&&t(Gi({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(Ut);function wa(){const t=P(),e=A(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=T(),[o,a]=r.useState(""),[c,d]=r.useState(""),[l,v]=r.useState(null),u=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:j,transactionListFetchState:k,transactions:x}=E((L=>{const _=Zn(L);return{activeType:_.activeTab,appliedSearch:_.filters.search,appliedSort:_.sort,nextCursor:_.nextCursor,transactionListFetchState:_.fetchState,transactions:_.transactions}}),H),b=k==="Completed",I=`/${n}/invoicing`,D=r.useCallback((L=>{const _=x.find((U=>U.id===L)),R=_?.linkedInvoices?.[0]?.invoiceID??_?.invoiceID;R!=null&&(p.trackInvoicingActionClick(g.Event.invoicingEntityLinkClicked,{fromScreen:"payments_list",invoiceId:R,toScreen:"invoice"}),e(`${I}/invoices/${encodeURIComponent(R)}`))}),[e,I,x]),C=r.useCallback((L=>{const _=x.find((R=>R.id===L))?.customerID;_!=null&&(p.trackInvoicingActionClick(g.Event.invoicingEntityLinkClicked,{customerId:_,fromScreen:"payments_list",toScreen:"customer"}),e(`${I}/customers/${encodeURIComponent(_)}`))}),[e,I,x]);return r.useEffect((()=>{const L=setTimeout((()=>d(o)),300);return()=>clearTimeout(L)}),[o]),r.useEffect((()=>{i&&t(ve({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(m.search!==f||u?.field!==h?.field||u?.dir!==h?.dir)&&t(ve({cacheOverride:!0,filters:m,sort:u}))}),[i,t,m,u,f,h]),N(k)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx(w,{event:g.Event.invoicingPaymentsListPage,isReady:b}),s.jsx($a,{navigate:e,tenantEmailDomain:n,activeType:S,searchValue:o,sortState:l,filters:m,sort:u,nextCursor:j,onSearchChange:a,onTypeChange:L=>{t(Qi(L)),t(ve({cacheOverride:!1,filters:m,sort:u}))},onSortChange:v,onViewTransactionCustomer:C,onViewTransactionInvoice:D})]})}const Fa=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},gn=(t,e)=>new Intl.NumberFormat("en-US",{currency:e,style:"currency"}).format(t);function mn(){const t=P(),e=A(),{invoice_id:n,tenantEmailDomain:i}=F(),{areTenantIdsInSync:o}=T(),a=n!=null&&n!=="",c=E(de),d=E((C=>zi(C))),l=E(Wi),v=E((C=>_n(C,n??""))),u=v.invoice,m=`/${i}/invoicing`,S=r.useRef(null),f=r.useRef("");r.useEffect((()=>{t(Ji()),S.current=null,f.current=""}),[t,n]),r.useEffect((()=>{o&&t(a&&n!=null?_e({invoiceId:n}):we({filters:{},keepExistingListItems:!1}))}),[o,t,n,a]),r.useEffect((()=>{a&&u!=null&&n!=null&&v.fetchState==="Completed"&&S.current!==n&&(S.current=n,t(Xi({contextInvoiceId:n,localData:eo(u)})))}),[t,u,n,v.fetchState,a]),r.useEffect((()=>{if(a)return;const C=d.localData.customerId;C!==""&&C!==f.current&&(f.current=C,t(Nn({filters:{customerId:C},keepExistingListItems:!1})),d.localData.invoiceToLink!==""&&t(on({localData:{...d.localData,customerId:C,invoiceToLink:""}})))}),[t,d.localData,a]);const h=r.useRef(l.fetchState);r.useEffect((()=>{const C=h.current;if(h.current=l.fetchState,C!=="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 j=r.useMemo((()=>c.customers.map((C=>({id:C.id,name:Fa(C)})))),[c.customers]),k=E((C=>no(C,d.localData.customerId))),x=r.useMemo((()=>k.map((C=>({amountDue:gn(C.amountDue,"USD"),amountDueValue:C.amountDue,id:C.id,label:C.invoiceNumber})))),[k]),b=r.useMemo((()=>{if(!a||u==null)return;const C=u.currencyCode??"USD",L=u.amountDue?.amount??0;return{amountDue:gn(L,C),amountDueValue:L,currencyCode:C,customerName:u.customerName??u.customerID,invoiceId:u.id,invoiceNumber:u.invoiceNumber??u.id}}),[u,a]),I=a?`${m}/invoices/${encodeURIComponent(n??"")}`:`${m}/payments`,D=!a||v.fetchState==="Completed"&&d.localData.invoiceToLink!=="";return s.jsxs(s.Fragment,{children:[s.jsx(w,{event:g.Event.invoicingRecordPaymentPage,isReady:D}),s.jsx(Bt,{customers:j,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:x,isSubmitting:l.fetchState==="In-Progress",localData:d.localData,mode:a?"invoice":"customer",paymentMethodOptions:d.paymentMethodOptions,onBack:()=>{e(I)},onCancel:()=>{p.trackInvoicingActionClick(g.Event.invoicingRecordPaymentCancelled),e(I)},onChange:C=>{t(on({localData:C}))},onSubmit:()=>{p.trackInvoicingActionClick(g.Event.invoicingPaymentRecorded,{customerId:d.localData.customerId,invoiceId:a?n:d.localData.invoiceToLink,paymentMethod:d.localData.paymentMethod}),t(to(a?n??void 0:void 0))}})]})}const tt=(t,e,n)=>{const i=`/${t}/invoicing/subscriptions/`;return n!=null?`${i}${encodeURIComponent(n)}/${e}/`:`${i}new/${e}/`},Ta=(t,e)=>{if(t==null)return;const n=new Intl.NumberFormat("en-US",{currency:t.currencyCode??"USD",maximumFractionDigits:0,style:"currency"}).format(t.amount);return e!=null?`${n}/${e}`:n},it=(t,e,n)=>{const i=[t,Ta(e,n)].filter((o=>o!=null&&o!=="")).join(" · ");return i!==""?i:void 0},vn=t=>t.priceCode!=null&&t.priceCode.trim()!=="",Ra=t=>({billingCycles:t.billingCycles,billingPeriod:t.period,billingPeriodUnit:t.periodUnit,label:t.name??t.id,subtitle:it(t.productCode,t.price,t.periodUnit),value:t.priceCode}),Oa=t=>({label:t.name??t.couponCode??t.id,value:t.couponCode??t.id}),_a=O((function(t,e){const{editView:n}=e,i=n.subscription,o=i?.status,a=o!=null&&e.commercialEditAllowedFromStatuses.includes(o);return{cancelReasonCodeOptions:n.cancelReasonCodeOptions,fieldHelp:n.fieldHelp,addons:n.products.filter((c=>c.itemType==="addon")).filter(vn).map((c=>({label:c.name??c.id,subtitle:it(c.productCode,c.price,c.periodUnit),value:c.priceCode}))),canEditCommercial:a,coupons:n.coupons.map(Oa),isLoading:n.subscription==null&&(n.pageFetchState.fetchState==="Not-Started"||n.pageFetchState.fetchState==="In-Progress"),isRunningAction:n.actionState.fetchState==="In-Progress",isSaving:n.fetchState==="In-Progress",lifecycleActionOptions:e.lifecycleActionOptions,localData:n.localData,plans:n.plans.filter(vn).map(Ra),shippingAddressLabel:n.shippingAddressLabel,subscription:i}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{subscriptionId:i}=e,o=i!=="",a=(c,d)=>{p.trackInvoicingActionClick(g.Event.invoicingSubscriptionLifecycleAction,{action:c,subscriptionId:i}),t(Yn({action:c,id:i,body:d}))};return{onBack:()=>e.navigate(`${n}/subscriptions`),onChange:c=>{t(ce({id:i,localData:c}))},onChangeTermEnd:o?c=>{const d=c?.trim()??"";d!==""&&a("change_term_end",{term_ends_at:d})}:void 0,onCustomerClick:c=>{p.trackInvoicingActionClick(g.Event.invoicingEntityLinkClicked,{customerId:c,fromScreen:"subscription_detail",toScreen:"customer"}),window.open(`${n}/customers/${encodeURIComponent(c)}`,"_blank","noopener,noreferrer")},onOpenAddress:()=>{const c=tt(e.tenantEmailDomain??"",ye,i),d=J(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(c,{state:{pathnameStackToGoBack:d}})},onViewInvoices:()=>e.navigate(`${n}/invoices`),onSaveEdit:c=>{p.trackInvoicingActionClick(g.Event.invoicingSubscriptionEdited,{subscriptionId:i}),t(ce({id:i,localData:c})),t(qn({id:i}))},onCancelSubscription:o?c=>{a("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"?a(c):a(c,d!=null&&d.trim()!==""?{resume_date:d.trim()}:void 0)}:void 0}}))(Vt);function Ma(){const t=P(),e=A(),n=W(),{subscription_id:i,tenantEmailDomain:o}=F(),{areTenantIdsInSync:a}=T(),c=E((h=>Me(h,i))),{subscriptionCommercialEditAllowedFromStatuses:d,subscriptionLifecycleActionOptions:l,subscriptionMetadataEditAllowedFromStatuses:v}=c,u=c.pageFetchState.fetchState,m=u==="Completed";Be(a),r.useEffect((()=>{a&&i!=null&&t(an({id:i}))}),[a,i,t]);const[S,f]=r.useState(0);return r.useEffect((()=>{c.fetchState==="Completed"&&(t(Ne()),t(an({cacheOverride:!0,id:i})),f((h=>h+1)))}),[c.fetchState,t,i]),N(u)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx(w,{event:g.Event.invoicingSubscriptionDetailPage,isReady:m}),s.jsx(_a,{commercialEditAllowedFromStatuses:d,editView:c,lifecycleActionOptions:l,location:n,metadataEditAllowedFromStatuses:v,navigate:e,subscriptionId:i??"",tenantEmailDomain:o},S)]})}const Na=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},Ua=(t,e)=>{if(t==null)return;const n=new Intl.NumberFormat("en-US",{currency:t.currencyCode??"USD",maximumFractionDigits:0,style:"currency"}).format(t.amount);return e!=null?`${n}/${e}`:n},be=(t,e,n)=>{const i=[t,Ua(e,n)].filter((o=>o!=null&&o!=="")).join(" · ");return i!==""?i:void 0},Ba=t=>({label:Na(t),value:t.id}),fe=t=>t.priceCode!=null&&t.priceCode.trim()!=="",Va=t=>({billingCycles:t.billingCycles,billingPeriod:t.period,billingPeriodUnit:t.periodUnit,label:t.name??t.id,subtitle:be(t.productCode,t.price,t.periodUnit),trialPeriod:t.trialPeriod,trialPeriodUnit:t.trialPeriodUnit,value:t.priceCode}),Ha=t=>({label:t.name??t.couponCode??t.id,value:t.couponCode??t.id}),Za=O((function(t,e){const n=Me(t,e.subscriptionId);return{fieldHelp:n.fieldHelp,addons:n.products.filter((i=>i.itemType==="addon")).filter(fe).map((i=>({label:i.name??i.id,subtitle:be(i.productCode,i.price,i.periodUnit),value:i.priceCode}))),charges:n.products.filter((i=>i.itemType==="charge")).filter(fe).map((i=>({label:i.name??i.id,subtitle:be(i.productCode,i.price,void 0),value:i.priceCode}))),coupons:n.coupons.map(Ha),customers:n.customers.map(Ba),errorMessage:n.fetchState==="Error"?n.error?.message??"Failed to save subscription.":void 0,isSubmitting:n.fetchState==="In-Progress",localData:n.localData,mode:n.mode,plans:n.plans.filter(fe).map(Va),shippingAddressLabel:n.shippingAddressLabel}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{subscriptionId:i}=e,o=i!=null?"edit":"create";return{onCancel:()=>{p.trackInvoicingActionClick(g.Event.invoicingSubscriptionFormCancelled),t(Ne()),t($e(ye)),i==null?e.navigate(`${n}/subscriptions`):e.navigate(`${n}/subscriptions/${encodeURIComponent(i)}`)},onChange:a=>{t(ce({id:i,localData:a}))},onOpenAddress:()=>{const a=tt(e.tenantEmailDomain??"",ye,i),c=J(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(a,{state:{pathnameStackToGoBack:c}})},onSubmit:()=>{p.trackInvoicingActionClick(g.Event.invoicingSubscriptionSaved,{mode:o}),t(qn({id:i}))}}}))(Ht);function qa(){const t=P(),e=A(),n=W(),{subscription_id:i,tenantEmailDomain:o}=F(),[a]=z(),{areTenantIdsInSync:c}=T(),d=a.get("customerId"),{fetchState:l,savedSubscriptionId:v}=E((S=>io(S,i))),u=E((S=>Me(S,i).localData));Be(c),r.useEffect((()=>{c&&(t(we({filters:{},keepExistingListItems:!1})),t(he({filters:{type:"plan"},keepExistingListItems:!1})),t(Rn({filters:{},keepExistingListItems:!1})),i!=null&&t(oo({id:i})))}),[c,i,t]);const m=r.useRef(!1);return r.useEffect((()=>{m.current||i!=null||d==null||d===""||u.customerId!==""||(m.current=!0,t(ce({id:i,localData:{...u,customerId:d}})))}),[d,i,u,t]),r.useEffect((()=>{if(l==="Completed"){const S=v??i,f=S!=null?`/${o}/invoicing/subscriptions/${encodeURIComponent(S)}`:`/${o}/invoicing/subscriptions`;e(f),t(Ne())}}),[l,v,i,t,e,o]),s.jsxs(s.Fragment,{children:[s.jsx(w,{event:g.Event.invoicingSubscriptionFormPage}),s.jsx(Za,{location:n,navigate:e,subscriptionId:i,tenantEmailDomain:o})]})}const Ya=O((function(t){const e=Kn(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,a,c)=>{p.trackInvoicingActionClick(g.Event.invoicingSubscriptionLifecycleAction,{action:a,subscriptionId:o}),t(Yn({action:a,id:o,body:c}))};return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onStatusChange:e.onStatusChange,onAddSubscription:()=>{p.trackInvoicingActionClick(g.Event.invoicingAddSubscriptionClicked),e.navigate(`${n}/subscriptions/new`)},onImportCsv:()=>{p.trackInvoicingActionClick(g.Event.invoicingImportCsvClicked,{entity:"subscriptions"}),e.navigate(`${n}/data_import`)},onChangeTermEnd:(o,a)=>{const c=a?.trim()??"";c!==""&&i(o,"change_term_end",{term_ends_at:c})},onSubscriptionAction:(o,a,c)=>{a!=="pause"?i(o,a):i(o,a,c!=null&&c.trim()!==""?{resume_date:c.trim()}:void 0)},onCancelSubscription:(o,a)=>{i(o,"cancel",{cancel_reason_code:a.cancelReasonCode,end_of_term:!1,...a.cancelReason!=null&&a.cancelReason.trim()!==""?{cancel_reason:a.cancelReason.trim()}:{}})},onSubscriptionClick:o=>{p.trackInvoicingActionClick(g.Event.invoicingSubscriptionRowClicked,{subscriptionId:o}),e.navigate(`${n}/subscriptions/${encodeURIComponent(o)}`)},onViewSubscriptionInvoices:()=>{e.navigate(`${n}/invoices`)},onLoadMore:()=>{e.nextCursor!=null&&t(co({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(Zt);function Ka(){const t=P(),e=A(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=T(),[o,a]=r.useState(""),[c,d]=r.useState(""),[l,v]=r.useState(null),u=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:j,subscriptionListFetchState:k,runningActionSubscriptionId:x}=E((D=>{const C=Kn(D);return{activeStatus:C.activeTab,appliedSearch:C.filters.search,appliedSort:C.sort,nextCursor:C.nextCursor,subscriptionListFetchState:C.fetchState,runningActionSubscriptionId:C.runningActionId??null}}),H),b=k==="Completed";r.useEffect((()=>{const D=setTimeout((()=>d(o)),300);return()=>clearTimeout(D)}),[o]),r.useEffect((()=>{i&&t(sn({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(m.search!==f||u?.field!==h?.field||u?.dir!==h?.dir)&&t(sn({cacheOverride:!0,filters:m,sort:u}))}),[i,t,m,u,f,h]);const I=r.useRef(x);return r.useEffect((()=>{const D=I.current!=null&&x==null;I.current=x,D&&i&&t(ao())}),[x,i,t]),N(k)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx(w,{event:g.Event.invoicingSubscriptionsListPage,isReady:b}),s.jsx(Ya,{navigate:e,tenantEmailDomain:n,activeStatus:S,searchValue:o,sortState:l,filters:m,sort:u,nextCursor:j,runningActionSubscriptionId:x,onSearchChange:a,onStatusChange:D=>t(so(D)),onSortChange:v})]})}const Qa=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=>{p.trackInvoicingActionClick(g.Event.invoicingEntityLinkClicked,{customerId:o,fromScreen:"transaction_detail",toScreen:"customer"}),e.navigate(`${n}/customers/${encodeURIComponent(o)}`)},onInvoiceClick:o=>{p.trackInvoicingActionClick(g.Event.invoicingEntityLinkClicked,{fromScreen:"transaction_detail",invoiceId:o,toScreen:"invoice"}),e.navigate(`${n}/invoices/${encodeURIComponent(o)}`)},onSubscriptionClick:o=>{p.trackInvoicingActionClick(g.Event.invoicingEntityLinkClicked,{fromScreen:"transaction_detail",subscriptionId:o,toScreen:"subscription"}),e.navigate(`${n}/subscriptions/${encodeURIComponent(o)}`)},onCapture:i!==""?()=>{p.trackInvoicingActionClick(g.Event.invoicingTransactionCaptured,{transactionId:i}),t(uo({action:"capture",id:i}))}:void 0}}))(qt);function Ga(){const t=P(),e=A(),{tenantEmailDomain:n,transaction_id:i}=F(),{areTenantIdsInSync:o}=T(),a=E((d=>ro(d,i??""))),c=a.fetchState==="Completed";return r.useEffect((()=>{o&&i!=null&&t(lo({id:i}))}),[o,i,t]),N(a.fetchState)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx(w,{event:g.Event.invoicingTransactionDetailPage,isReady:c}),s.jsx(Qa,{navigate:e,tenantEmailDomain:n,transactionId:i??"",readView:a})]})}const za={branding:"invoicing_branding_save",dunning:"invoicing_dunning_settings_save",quickbooks:"invoicing_qbo_settings_save"};function X(t){const e=P(),{areTenantIdsInSync:n}=T(),{tenantEmailDomain:i}=F(),{fetchState:o,fieldHelp:a,saveState:c,settings:d,stripeConnectState:l}=E(go),{configError:v,configFetchState:u,dunningScheduleActionOptions:m,qboAccountMappingKindOptions:S,qboCustomerMatchingOptions:f,qboSyncStatusOptions:h}=E(Qn),j=E(Pe);Ue({enabled:t==="quickbooks",fetchSyncHealth:!0,loadAccountingPickers:!0});const k=E(Re),x=t==="dunning"||t==="quickbooks",b=k.companyId??Se.getSignedInUserTenant(i??"")?.companyId,I=E(($=>wn($,b))),D=mo(k.userRole??[]),C=k.tenantId??"",L=Se.getSignedInUser(),_={userId:L?.userId??"",sessionId:L?.zeniSessionId??"",tenantId:C},R=d?.logo_file_id,U=E(($=>R!=null&&R!==""?$.fileState.fileByFileId[R]:void 0)),Ve=E(($=>R!=null&&R!==""?vo($,R):void 0)),He=E(($=>R!=null&&R!==""?po($,R):void 0)),ot=R!=null&&R!==""&&Ve!=null?{[R]:Ve}:{},at=R!=null&&R!==""&&He!=null?{[R]:He}:{};r.useEffect((()=>(e(cn()),()=>{e(cn())})),[e]),r.useEffect((()=>{n&&(o!=="Not-Started"&&o!=="Error"||e(Oe()))}),[n,e,o]),r.useEffect((()=>{n&&x&&u==="Not-Started"&&e(re())}),[n,e,u,x]),r.useEffect((()=>{if(!n)return;const $=L?.userId;$!=null&&$!==""&&C!==""&&Ye.shouldFetchActiveTenant(C)&&(Ye.markActiveTenantFetchStarted(C),e(fo($,C,L?.zeniSessionId)))}),[n,e,L?.userId,L?.zeniSessionId,C]),r.useEffect((()=>{n&&R!=null&&R!==""&&C!==""&&U==null&&e(So(R,C))}),[n,e,U,R,C]);const st=m.length>0||S.length>0,ct=o==="Not-Started"||o==="In-Progress"&&d==null||x&&!st&&(u==="Not-Started"||u==="In-Progress"),rt=o==="Completed"&&(!x||u==="Completed"),Ze=I.externalConnections?.revenue?.find(($=>$.connectionName==="chargebee"))?.connectionId,ue=ae?.invoicingMicroServiceBaseUrl,qe=ue!=null&&ue.length>0?`${ue}/1.0/webhooks/stripe`:"",ge={deleteConnectionError:I.externalConnections?.deleteConnectionError?.message,deleteConnectionState:I.externalConnections?.deleteConnectionState??"Not-Started",integrationsView:I,isAdmin:D,isStripeBusy:l.fetchState==="In-Progress",onConnectStripe:$=>e(ln($)),onDisconnect:($,q)=>{C!==""&&e(xo(C,$,dn(q)))},onDisconnectStripe:()=>e(rn()),onReconnectQBO:()=>{const $=k.tenantEmailDomain??i??"";le.init("/connection/auth",$),le.handleClick()},onRefreshQBO:()=>{I.integrations.refreshQBO.fetchState!=="In-Progress"&&e(Wn())},onSaveChargeBeeCredentials:($,q)=>{Ze!=null&&C!==""&&e(ko(C,Ze,dn("revenue"),yo("chargebee"),{api_key:$,site:q}))},saveChargeBeeError:I.externalConnections?.saveAPIKeyConnectionError?.message,saveChargeBeeState:I.externalConnections?.saveAPIKeyConnectionState??"Not-Started",settings:d,stripeError:l.fetchState==="Error"?l.error?.message??"Failed to connect Stripe. Check your keys and try again.":void 0,stripeWebhookUrl:qe};return{authParams:_,deleteFileStatusById:ot,fieldHelp:a,dunningScheduleActionOptions:m,filesEndPoint:ae?.fileMicroServiceBaseUrl??"",integrationsSectionProps:ge,isInvoicingPageReady:rt,isLoading:ct,isSaving:c.fetchState==="In-Progress",isStripeBusy:l.fetchState==="In-Progress",logoFile:U,qboAccountMappingKindOptions:S,qboCustomerMatchingOptions:f,qboSyncStatusOptions:h,qboView:j,saveErrorMessage:c.fetchState==="Error"?c.error?.message??"Failed to save settings.":x&&u==="Error"?v?.message??"Failed to load invoicing configuration.":void 0,settings:d,stripeError:l.fetchState==="Error"?l.error?.message??"Failed to connect Stripe. Check your keys and try again.":void 0,stripeWebhookUrl:qe,updateFileStatusById:at,onConnectStripe:$=>e(ln($)),onDeleteFile:$=>e(Eo($)),onDisconnectStripe:()=>e(rn()),onEditFileName:($,q)=>e(Io($,q)),onReconnectQBO:ge.onReconnectQBO,onRefreshQBO:ge.onRefreshQBO,onRetryQboSyncTask:$=>e(zn($)),onSave:$=>{p.trackInvoicingActionClick(g.Event.invoicingSettingsSaved,{tab:t??"hub"}),e(Co({settings:$,snackbarSection:za[t??""]}))},onStartQboBackfill:$=>e(Gn($)),updateFilesEntity:$=>{p.trackInvoicingActionClick(g.Event.invoicingLogoUploaded),e(ho({files:$}))}}}function pn({appContent:t}){const e=A(),n=W(),i=P(),{tenantEmailDomain:o}=F(),a=X("branding"),c=E((v=>bo(v))),d=E((v=>jo(pe,v)?.addressToCreate));r.useEffect((()=>{c.saveState.fetchState==="Completed"&&(i(Do()),i($e(pe)))}),[c.saveState.fetchState,i]);const l=hn(c.saveState.fetchState);return r.useEffect((()=>{l==="In-Progress"&&c.saveState.fetchState==="Completed"&&e("..")}),[l,c.saveState.fetchState,e]),s.jsxs(s.Fragment,{children:[s.jsx(w,{event:g.Event.invoicingSettingsPage,isReady:a.isInvoicingPageReady}),s.jsx(Yt,{address:d,fieldHelp:c.fieldHelp,addressLabel:c.addressLabel,appContent:t,authParams:a.authParams,dateFormatOptions:c.dateFormatOptions,deleteFileStatusById:a.deleteFileStatusById,filesEndPoint:a.filesEndPoint,isLoading:a.isLoading,isSaving:a.isSaving,localData:c.localData,saveErrorMessage:a.saveErrorMessage,settings:a.settings,updateFileStatusById:a.updateFileStatusById,onBackClick:()=>e(".."),onChange:v=>{i(Ao({localData:v}))},onDeleteFile:a.onDeleteFile,onEditFileName:a.onEditFileName,onOpenAddress:()=>{const v=`/${o}/invoicing/settings/branding/${pe}/`,u=J(n.state?.pathnameStackToGoBack,n.pathname);e(v,{state:{pathnameStackToGoBack:u}})},onSubmit:()=>i(Po()),updateFilesEntity:a.updateFilesEntity})]})}function Wa(){const t=A(),e=X("dunning");return s.jsxs(s.Fragment,{children:[s.jsx(w,{event:g.Event.invoicingSettingsPage,isReady:e.isInvoicingPageReady}),s.jsx(Kt,{dunningScheduleActionOptions:e.dunningScheduleActionOptions,isLoading:e.isLoading,isSaving:e.isSaving,saveErrorMessage:e.saveErrorMessage,settings:e.settings,onBackClick:()=>t(".."),onSave:e.onSave})]})}function Ja(){const t=A(),e=X("integrations");return s.jsxs(s.Fragment,{children:[s.jsx(w,{event:g.Event.invoicingSettingsPage,isReady:e.isInvoicingPageReady}),s.jsx(Qt,{integrationsSectionProps:{...e.integrationsSectionProps,onConfigureQBO:()=>t("../quickbooks"),onOpenPaymentDestination:()=>t("../payment-destination")},isLoading:e.isLoading,onBackClick:()=>t("..")})]})}function Xa(){const t=A(),e=X("payment-destination");return s.jsxs(s.Fragment,{children:[s.jsx(w,{event:g.Event.invoicingSettingsPage,isReady:e.isInvoicingPageReady}),s.jsx(Gt,{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 es=O((function(t){const e=Jn(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(wo({localData:e}))},onReset:()=>{t($o())},onRetryTask:e=>{t(zn(e))},onSave:()=>{p.trackInvoicingActionClick(g.Event.invoicingSettingsSaved,{tab:"quickbooks"}),t(Lo())},onStartBackfill:e=>{t(Gn(e))}}}))(zt);function ns(){const t=P(),e=A(),{tenantEmailDomain:n}=F(),i=E(Re),{configFetchState:o,settingsFetchState:a}=E(Jn);return r.useEffect((()=>{a!=="Not-Started"&&a!=="Error"||t(Oe())}),[t,a]),r.useEffect((()=>{o==="Not-Started"&&t(re())}),[o,t]),Ue({fetchSyncHealth:!0,loadAccountingPickers:!0}),s.jsxs(s.Fragment,{children:[s.jsx(w,{event:g.Event.invoicingSettingsPage}),s.jsx(es,{onBackClick:()=>e(".."),onReconnect:()=>{le.init("/connection/auth",i.tenantEmailDomain??n??""),le.handleClick()},onRefresh:()=>t(Wn())})]})}const ts={"payment-destination":"payment-destination",general:"branding",integrations:null,dunning:"dunning"};function is(){const t=Sn(),e=P(),n=A(),[i,o]=z(),a=X(),{canEnableInvoicing:c,isEnablingInvoicing:d,isInvoicingEnabled:l,isQboConfigured:v,isStripeConnected:u}=E(Qn),m=i.get("tab");return r.useEffect((()=>{if(m==null)return;const S=ts[m];o({},{replace:!0}),S!=null&&n(S,{replace:!0})}),[m,n,o]),s.jsxs(s.Fragment,{children:[s.jsx(w,{event:g.Event.invoicingSettingsPage,isReady:a.isInvoicingPageReady}),s.jsx(Wt,{analytics:p,integrationsSectionProps:{...a.integrationsSectionProps,onConfigureQBO:()=>n("quickbooks"),onOpenPaymentDestination:()=>n("payment-destination")},isEnablingInvoicing:d,isLoading:a.isLoading,meetingUrl:t("invoicing_settings"),settings:a.settings,onBrandingClick:()=>n("branding"),onDunningClick:()=>n("dunning"),canEnableInvoicing:c,isQboConfigured:v,isStripePaymentsReady:u,onEnableInvoicingClick:l?void 0:()=>{e(Fo())}})]})}function fn(){return s.jsxs(te,{children:[s.jsx(y,{index:!0,element:s.jsx(is,{})}),s.jsx(y,{path:"payment-destination",element:s.jsx(Xa,{})}),s.jsx(y,{path:"branding",element:s.jsx(pn,{})}),s.jsx(y,{path:"branding/:addressType",element:s.jsx(pn,{appContent:s.jsx(Y,{isSubPage:!0,hideAddressBackButton:!0})})}),s.jsx(y,{path:"integrations",element:s.jsx(Ja,{})}),s.jsx(y,{path:"dunning",element:s.jsx(Wa,{})}),s.jsx(y,{path:"quickbooks",element:s.jsx(ns,{})}),s.jsx(y,{path:"*",element:s.jsx(B,{to:"..",replace:!0})})]})}function $s(){const t=P(),e=A(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=T(),{enableState:o,fetchState:a,status:c}=E(Un),d=hn(o.fetchState),l=`/${n}/invoicing`,v=r.useRef(!1),u=E((m=>Pe(m).connectionFetchState.fetchState));return r.useEffect((()=>{i&&(a!=="Not-Started"?a!=="Error"||v.current||(v.current=!0,t(re({cacheOverride:!1}))):t(re({cacheOverride:!1})))}),[i,t,a]),r.useEffect((()=>{i&&u==="Not-Started"&&t(kn())}),[i,t,u]),r.useEffect((()=>{d==="In-Progress"&&o.fetchState==="Completed"&&(e(`${l}/catalog`),t(To()))}),[d,o.fetchState,l,t,e]),c==null&&a!=="Error"?s.jsx(Jt,{}):c==="not_started"?s.jsxs(te,{children:[s.jsx(y,{path:"promo",element:s.jsx(un,{})}),s.jsx(y,{path:"*",element:s.jsx(B,{to:`${l}/promo`,replace:!0})})]}):c==="settings"?s.jsxs(te,{children:[s.jsx(y,{path:"promo",element:s.jsx(un,{})}),s.jsx(y,{path:"settings/*",element:s.jsx(fn,{})}),s.jsx(y,{path:"*",element:s.jsx(B,{to:`${l}/settings`,replace:!0})})]}):s.jsxs(te,{children:[s.jsx(y,{path:"/",element:s.jsx(B,{to:"overview",replace:!0})}),s.jsx(y,{path:"overview",element:s.jsx(La,{})}),s.jsx(y,{path:"promo",element:s.jsx(B,{to:`${l}/overview`,replace:!0})}),s.jsx(y,{path:"customers",element:s.jsx(ra,{})}),s.jsx(y,{path:"customers/new",element:s.jsx(sa,{})}),s.jsx(y,{path:"customers/new/:addressType",element:s.jsx(Y,{})}),s.jsx(y,{path:"customers/:customer_id",element:s.jsx(oa,{})}),s.jsx(y,{path:"customers/:customer_id/:addressType",element:s.jsx(Y,{})}),s.jsx(y,{path:"subscriptions",element:s.jsx(Ka,{})}),s.jsx(y,{path:"subscriptions/new",element:s.jsx(qa,{})}),s.jsx(y,{path:"subscriptions/new/:addressType",element:s.jsx(Y,{})}),s.jsx(y,{path:"subscriptions/:subscription_id",element:s.jsx(Ma,{})}),s.jsx(y,{path:"subscriptions/:subscription_id/:addressType",element:s.jsx(Y,{})}),s.jsx(y,{path:"invoices",element:s.jsx(ja,{})}),s.jsx(y,{path:"invoices/create",element:s.jsx(Jo,{})}),s.jsx(y,{path:"invoices/:invoice_id",element:s.jsx(xa,{})}),s.jsx(y,{path:"invoices/:invoice_id/record-payment",element:s.jsx(mn,{})}),s.jsx(y,{path:"invoices/:invoice_id/issue-credit-note",element:s.jsx(Pa,{})}),s.jsx(y,{path:"payments",element:s.jsx(wa,{})}),s.jsx(y,{path:"payments/record",element:s.jsx(mn,{})}),s.jsx(y,{path:"payments/:transaction_id",element:s.jsx(Ga,{})}),s.jsx(y,{path:"credits",element:s.jsx(ta,{})}),s.jsx(y,{path:"credits/:credit_note_id",element:s.jsx(ea,{})}),s.jsx(y,{path:"discounts",element:s.jsx(ha,{})}),s.jsx(y,{path:"discounts/new",element:s.jsx(zo,{})}),s.jsx(y,{path:"discounts/:coupon_id",element:s.jsx(fa,{})}),s.jsx(y,{path:"dunning",element:s.jsx(ka,{})}),s.jsx(y,{path:"dunning/:case_id",element:s.jsx(Ia,{})}),s.jsx(y,{path:"catalog",element:s.jsx(Qo,{})}),s.jsx(y,{path:"catalog/new",element:s.jsx(qo,{})}),s.jsx(y,{path:"catalog/:item_id",element:s.jsx(Bo,{})}),s.jsx(y,{path:"settings/*",element:s.jsx(fn,{})}),s.jsx(y,{path:"audit_log",element:s.jsx(Oo,{})}),s.jsx(y,{path:"data_import",element:s.jsx(ga,{})}),s.jsx(y,{path:"data_import/migrate",element:s.jsx(va,{})}),s.jsx(y,{path:"data_import/:sessionId",element:s.jsx(da,{})}),s.jsx(y,{path:"*",element:s.jsx(M,{})})]})}export{$s as default};
@@ -1 +0,0 @@
1
- import{j as e}from"./liveblocks-BbYAHGiW.js";import{h as r,l as i}from"./core-dudeiae1.js";import{ak as n}from"./index-DpPNNcCA.js";import"./mui-DOWmAnEx.js";import"./sentry-BOojnQyr.js";import"./zeni-epic-state-Dc6DIqGa.js";import"./recharts-B1E_Vcxh.js";import"./analytics-D6lgRN4g.js";import"./plaid-DLQRcG8N.js";import"./dnd-w5RIXJhq.js";import"./stripe-cKAAJElX.js";import"./lottie-DNeeuCiH.js";import"./lexical-C-raBUAt.js";import"./pdf-DOlTc5K5.js";import"./utils-wJEG-Wcu.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]="e1fe4b0b-a509-4443-892f-577d1dfd5036",o._sentryDebugIdIdentifier="sentry-dbid-e1fe4b0b-a509-4443-892f-577d1dfd5036")}catch{}})();const a=i(null,(function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}}))(n);function _(){const o=r();return e.jsx(a,{navigate:o})}export{_ as default};
@@ -1,21 +0,0 @@
1
- import{j as r}from"./liveblocks-BbYAHGiW.js";import{a as p}from"./sentry-BOojnQyr.js";import{J as c,K as a,a7 as m,ab as f,ac as h}from"./index-DpPNNcCA.js";import"./mui-DOWmAnEx.js";import{i as y}from"./core-dudeiae1.js";import"./zeni-epic-state-Dc6DIqGa.js";import"./recharts-B1E_Vcxh.js";import"./analytics-D6lgRN4g.js";import"./plaid-DLQRcG8N.js";import"./dnd-w5RIXJhq.js";import"./stripe-cKAAJElX.js";import"./lottie-DNeeuCiH.js";import"./lexical-C-raBUAt.js";import"./pdf-DOlTc5K5.js";import"./utils-wJEG-Wcu.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]="2012cfb4-548c-4aab-9220-efd79b933e1c",e._sentryDebugIdIdentifier="sentry-dbid-2012cfb4-548c-4aab-9220-efd79b933e1c")}catch{}})();const g=c("div")`
2
- display: flex;
3
- flex-direction: column;
4
- width: 100%;
5
- min-height: 100vh;
6
- background-color: ${e=>e.theme.colors.grey4};
7
- `,b=c("header")`
8
- flex-shrink: 0;
9
- padding: ${a.sp3} ${a.sp4};
10
- `,k=c(m)`
11
- width: ${a.sp4};
12
- height: ${a.sp4};
13
- color: ${e=>e.theme.colors.brandColorJade};
14
- `,x=c("main")`
15
- display: flex;
16
- flex: 1 1 auto;
17
- flex-direction: column;
18
- align-items: center;
19
- justify-content: center;
20
- padding: ${a.sp4};
21
- `;function j({children:e}){return r.jsxs(g,{"data-testid":"invoicing-collect-payment-layout",children:[r.jsx(b,{children:r.jsx(k,{"aria-label":"Zeni",role:"img"})}),r.jsx(x,{children:e})]})}class w extends Error{statusCode;constructor(t,o){super(t),this.name="PortalRequestError",this.statusCode=o}}function $(e,t){const o=(function(){const n=h?.invoicingMicroServiceBaseUrl;return`${n!=null&&n.length>0?n:""}/1.0`})(),s={namespace:e,token:t};async function i(n,u){const l=await fetch(`${o}${n}`,{body:JSON.stringify(u),headers:{"Content-Type":"application/json"},method:"POST"}),d=await l.json();if(!l.ok)throw new w(d.status?.message??`Request failed (${l.status}).`,l.status);return d.data}return{checkoutSession:()=>i("/portal/payment-link/checkout-session",s),plaidLinkToken:()=>i("/portal/payment-link/plaid-link-token",s),requestAccess:()=>i("/portal/payment-link/request-access",s),savePaymentMethod:n=>i("/portal/payment-link/payment-methods",{...s,...n}),session:()=>i("/portal/payment-link/session",s),setupIntent:()=>i("/portal/payment-link/setup-intent",s)}}function B(){const{namespace:e="",token:t=""}=y();p.useEffect((()=>{document.querySelector("#app-shell-loader")?.remove()}),[]);const o=p.useMemo((()=>$(e,t)),[e,t]);return r.jsx(j,{children:r.jsx(f,{portal:o})})}export{B as default};
@@ -1 +0,0 @@
1
- import{j as r}from"./liveblocks-BbYAHGiW.js";import _ from"./NotFoundScreen-DyEaBoCc.js";import{a as p}from"./sentry-BOojnQyr.js";import{h as C,g as D,u as V,j as c,N as k,l as B,n as Y,o as b}from"./core-dudeiae1.js";import{fB as E,Y1 as h,Yi as w,MI as U,ME as L,MH as f,Mx as N,YH as M,MB as H,MK as K}from"./zeni-epic-state-Dc6DIqGa.js";import{z as T,w as $,c7 as z,r as O,bQ as Q,c8 as q}from"./index-DpPNNcCA.js";import"./mui-DOWmAnEx.js";import{u as F,R as x}from"./ReimbursementApprovalRuleDetailScreen-CsvqRnAa.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="a58a2c68-16d0-405c-8c6f-c15b83a73caa",e._sentryDebugIdIdentifier="sentry-dbid-a58a2c68-16d0-405c-8c6f-c15b83a73caa")}catch{}})();const j="reimbursement-approval-rule-update",G=B((function(e){return{approvalView:h(e),remiSetupApproverViewUpdateData:w(e).remiSetupApproverViewUpdateData}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(j)&&e(M(!1))},onBackClick:()=>{O(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(N(t,!1))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))}}}))($(z)),J=({isLoading:e})=>{const s=C(),n=D(),a=V(),[t,l]=p.useState(!1),[v,R]=p.useState(!1),S=c((o=>o.remiSetupApproverViewState.fetchState)),u=c((o=>E(o))),d=c((o=>h(o))),g=c((o=>w(o).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{g?.updateStatus.fetchState==="Completed"&&a(U())}),[g]),p.useEffect((()=>{t||S!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!1)))}),[t,S,e,a]),T.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{d.allApprovalRules.length===0&&d.fetchState==="Completed"&&(v||(R(!0),a(f())),s("./new"))}),[v,d,a]);const m={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${j}`]:[],eventCallback:(o,y,I)=>{o.endsWith(j)&&I.onApprovalRulesEventReceived(o)}};return u?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(k,{to:"../../promo"}):r.jsx(G,{currentTenant:u,location:n,navigate:s,...m})},A="reimbursement-approval-rule-update",P=B((function(e){const s=h(e),n=w(e).remiSetupApproverViewUpdateData,a={};for(const l of Object.values(e.vendorState.vendorByID))l?.id!=null&&(a[l.id]=l.name);const t={};for(const l of Object.values(e.classState.classesByKey))l?.classId!=null&&(t[l.classId]=l.className);return{approvalView:s,remiSetupApproverViewUpdateData:n,vendorNamesById:a,departmentNamesById:t}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(A)&&e(M(!1))},onBackClick:()=>{O(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(N(t,!0))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))},onReorderRules:t=>{e(K(t,!0))}}}))($(q)),X=()=>{const e=c((a=>E(a))),{isApprovalRulesV3Enabled:s,isLoading:n}=Q(e?.tenantId);return s?r.jsx(Z,{isLoading:n}):r.jsx(J,{isLoading:n})},Z=({isLoading:e})=>{const s=C(),n=D(),a=V(),[t,l]=p.useState(!1),[v,R]=p.useState(!1),[S,u]=p.useState(!1),d=c((i=>i.remiSetupApproverViewState.fetchState)),g=c((i=>i.remiSetupApproverViewState.approverListState.fetchStatus.fetchState)),m=c((i=>E(i))),o=c((i=>h(i)));F();const y=c((i=>w(i).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{y?.updateStatus.fetchState==="Completed"&&a(U())}),[y]),p.useEffect((()=>{t||d!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!0)))}),[t,d,e,a]),p.useEffect((()=>{v||g!=="Not-Started"||e||(R(!0),a(H(!1,!0)))}),[v,g,e,a]),T.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{o.allApprovalRules.length===0&&o.fetchState==="Completed"&&(S||(u(!0),a(f())),s("./new"))}),[S,o,a]);const I={events:m.companyId!=null?[`private-encrypted-${m.companyId}.${A}`]:[],eventCallback:(i,ee,W)=>{i.endsWith(A)&&W.onApprovalRulesEventReceived(i)}};return m?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(k,{to:"../../promo"}):r.jsx(P,{currentTenant:m,location:n,navigate:s,isLoading:e,...I})};function le(){return r.jsxs(Y,{children:[r.jsx(b,{path:"/",element:r.jsx(X,{})}),r.jsx(b,{path:"/new",element:r.jsx(x,{})}),r.jsx(b,{path:"/:approvalRuleId/edit",element:r.jsx(x,{})}),r.jsx(b,{path:"*",element:r.jsx(_,{})})]})}export{le as R};
@@ -1 +0,0 @@
1
- import{j as a}from"./liveblocks-BbYAHGiW.js";import{z as b,a6 as C,l as u,S as N,d_ as E,I,d as k}from"./index-DpPNNcCA.js";import"./mui-DOWmAnEx.js";import g from"./NotFoundScreen-DyEaBoCc.js";import{a as c}from"./sentry-BOojnQyr.js";import{u as D,j as h,h as F,g as L,l as _,n as P,o as d,N as y}from"./core-dudeiae1.js";import{fB as T,a0P as j,a0Q as p,CS as U,pF as V,a0R as Q,CQ as R}from"./zeni-epic-state-Dc6DIqGa.js";import"./recharts-B1E_Vcxh.js";import"./analytics-D6lgRN4g.js";import"./plaid-DLQRcG8N.js";import"./dnd-w5RIXJhq.js";import"./stripe-cKAAJElX.js";import"./lottie-DNeeuCiH.js";import"./lexical-C-raBUAt.js";import"./pdf-DOlTc5K5.js";import"./utils-wJEG-Wcu.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]="3ee50173-0a16-4d96-8bab-221b70f08569",e._sentryDebugIdIdentifier="sentry-dbid-3ee50173-0a16-4d96-8bab-221b70f08569")}catch{}})();const z=_((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=b.getSignedInUser();return{onDismissClick:()=>{e(p()),n("/")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach((l=>{s.push(l.companyName),r.push(l.emailIds[0])})),u.trackInviteEmailClicked("send",s,r,s.length)}e(R())},onUpdateInviteFormLocalData:s=>{e(Q({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&u.trackInviteEmailClicked("cancel")}}}))(E),B=()=>{const e=D(),[t,n]=c.useState(!1),[i,s]=c.useState(!1),r=h((o=>T(o))),l=F(),w=L(),f=b.getSignedInUser();if(f==null)throw Error("Can't access invite referral screen without signing in...");const m=h((o=>j(o))),x=f?.firstName!=null?f.firstName:"User";c.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(U()),s(!0))}),[]),c.useEffect((()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(V(!0)))}),[m.fetchState,e]);const S=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(C,{analytics:u,onLoad:o=>(v=>v.trackPageLoaded(N.Event.inviteEmailViewed))(o)}):null,a.jsx(z,{navigate:l,location:w,currentTenant:r,companyName:S,userName:x,inviteFormCompayData:m.localData})]})};function ne(){const{useFeatureGate:e}=I(),{isFeatureEnabled:t}=e(k.isReferralFeatureEnabled);return a.jsxs(P,{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(B,{}):a.jsx(g,{})}),a.jsx(d,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NotFoundScreen-DyEaBoCc.js","assets/sentry-BOojnQyr.js","assets/core-dudeiae1.js","assets/zeni-epic-state-Dc6DIqGa.js","assets/index-DpPNNcCA.js","assets/mui-DOWmAnEx.js","assets/analytics-D6lgRN4g.js","assets/utils-wJEG-Wcu.js","assets/index-BhC2LNQw.css","assets/DashboardRoutes-CdzeWYFZ.js","assets/withTransactionSidePanel-e7n25G5R.js","assets/useAskAiCfoHostNavButtonProps-Dlbp0rlc.js","assets/TransactionDetailScreen-O2btGOsz.js","assets/decodeURIComponentSafe-DdtJweGV.js","assets/useInitialThreadRequest-LMcL-Aqa.js","assets/routePaths-CKi0kijJ.js","assets/expenseAutomationHelper-CNM6-ogC.js","assets/analyticsHelper-BAyQ5I4q.js","assets/CompanyPassportScreen-CA83T6v2.js","assets/MobileAppDrawer-DpejEUKo.js","assets/InboxNotificationsProvider-wKDejaDE.js","assets/useTaskManagerAccess-B8w6mJa8.js","assets/useAiCfoDashboardSuggestedQuestionsChips-CV2CbS_g.js","assets/FeaturePreviewScreen-DJVzHSu6.js","assets/BillPayRoutes-CQ68uF6m.js","assets/AddressScreen-B2w4_PKl.js","assets/DomesticWireDetailScreen-jQEBeMm8.js","assets/BusinessVerificationPageScreen-DcWVPrfh.js","assets/DrawerScreen-BxvAHfn3.js","assets/SetupPagesScreen-DeEl3avt.js","assets/BillPayApprovalRoutes-CZ1LN8um.js","assets/ReimbursementApprovalRuleDetailScreen-CsvqRnAa.js","assets/getLocaleForTenant-Cpc4BQ5R.js","assets/ReimbursementRoutes-CNEWxfxv.js","assets/ReimbursementApprovalRoutes-bETIIvv3.js","assets/TransactionListRoutes-C_J1qRL2.js","assets/ZeniAccountStatementScreen-wuqmOaNw.js","assets/SettingsRoutes-DncRJVSz.js","assets/AccountMappingScreen-DBBdkCwK.js","assets/QBOConnectionScreen-C366HwrW.js","assets/empty-BQ-kH7ke.js","assets/index-D5TSKAOG.js","assets/url-9L1oZ1DN.js","assets/index-BqrSHrqP.js","assets/accountMappingHelper-Dxym9iZl.js","assets/useEmailConnectResultRefresh-BkDgJaeO.js","assets/ReportsRoutes-2VOVKXB1.js","assets/ChargeCardRoutes-Dv_9gHLl.js","assets/useChargeCardPusherEvents-BMqY0sxt.js","assets/PeopleRoutes-Dn3ixuya.js","assets/ExpenseAutomationRoutes-BWhl8VPU.js","assets/TreasuryRoutes--6WRfqbv.js","assets/VendorsRoutes-1M6iQid4.js","assets/pathToGoBack-DijDyQJF.js","assets/ZeniAccountRoutes-DSe57kIf.js","assets/AddressRoutes-B_KlQ5l4.js","assets/PandLWithForecastRoutes-D57GW1cM.js","assets/CustomerOnboardingRoutes-CchBXDRW.js","assets/TransactionDetailRoutes-BMeucnIf.js","assets/EntityDetailRoutes-A1jj_wD6.js","assets/InvoicingRoutes-Ct661m9L.js","assets/NotificationRoutes-DVdA_FNb.js","assets/PerformanceRoutes-BvYJFI_Z.js","assets/RewardsRoutes-D-DDx4kZ.js","assets/TaskRoutes-BFSJCXvT.js","assets/TaskListScreen-DxnAUhd5.js","assets/AiCfoScreen-CqaebBsK.js","assets/CardsAiCfoScreen-BXy3FrXI.js"])))=>i.map(i=>d[i]);
2
- import{_ as s,bn as cs,fB as ms,dV as _s,dU as Es,A3 as hs,de as ps,gG as gs,g5 as xs,db as pe,cF as Rs,gj as Is,cx as js,bE as Ts,br as As,T9 as fs,v as Ds,Tb as ys,bq as bs,Tc as Cs,bK as vs,bJ as Os,bt as Us,ct as Ps,Td as ws,Te as Fs,d6 as Ls,d9 as Vs,d8 as ks,cE as Hs,cL as Bs,pw as ge,ge as xe,gV as Ss,gg as Re,gI as Ie,gJ as je,gh as Ns}from"./zeni-epic-state-Dc6DIqGa.js";import{j as e}from"./liveblocks-BbYAHGiW.js";import{a as P}from"./sentry-BOojnQyr.js";import{N as u,u as Ms,h as Zs,i as Gs,g as $s,j as $,q as Te,n as zs,o as t}from"./core-dudeiae1.js";import{N as l,E as qs,u as Ys,z as y,I as Ws,f as Js,g as Ks,d as M,j as Qs,O as Xs,U as en,L as F,G as Ae,t as _,P as sn,Q as nn,l as ne}from"./index-DpPNNcCA.js";import"./mui-DOWmAnEx.js";import{f as fe}from"./analyticsHelper-BAyQ5I4q.js";import{t as tn}from"./getLocaleForTenant-Cpc4BQ5R.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},A=new a.Error().stack;A&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[A]="a296531a-ff24-491d-a86a-8f009275a0e0",a._sentryDebugIdIdentifier="sentry-dbid-a296531a-ff24-491d-a86a-8f009275a0e0")}catch{}})();const an=l((()=>s((()=>import("./NotFoundScreen-DyEaBoCc.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),on=({tenantEmailDomain:a})=>e.jsx(u,{to:`/${a}/reimbursements`}),rn=({tenantEmailDomain:a})=>e.jsx(u,{to:`/${a}/bills`}),De=({tenantEmailDomain:a})=>e.jsx(u,{to:`/${a}/treasury`}),ye=({tenantEmailDomain:a})=>e.jsx(u,{to:`/${a}/checking`}),be=({tenantEmailDomain:a})=>e.jsx(u,{to:`/${a}/cards`}),b=({showZeniAccountRoute:a,isUserHasBillPayAccess:A,isUserHasReimbursementAccess:B,showTreasuryRoute:i,isTenantBankingOnly:V,showChargeCardRoute:O,tenantEmailDomain:v})=>{if(V===!0){if(a)return e.jsx(ye,{tenantEmailDomain:v});if(i)return e.jsx(De,{tenantEmailDomain:v});if(O)return e.jsx(be,{tenantEmailDomain:v})}return a?e.jsx(ye,{tenantEmailDomain:v}):i?e.jsx(De,{tenantEmailDomain:v}):O?e.jsx(be,{tenantEmailDomain:v}):A?e.jsx(rn,{tenantEmailDomain:v}):B?e.jsx(on,{tenantEmailDomain:v}):e.jsx(an,{})},ln={dashboard:()=>s((()=>import("./DashboardRoutes-CdzeWYFZ.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,0,17,18,19,20,21,22,23,8])),bills:()=>s((()=>import("./BillPayRoutes-CQ68uF6m.js")),__vite__mapDeps([24,1,2,3,4,5,6,7,25,0,26,11,14,27,15,19,20,21,28,23,29,17,30,31,32,8])),reimbursement:()=>s((()=>import("./ReimbursementRoutes-CNEWxfxv.js")),__vite__mapDeps([33,1,2,3,4,5,6,7,0,29,27,15,19,20,21,17,23,11,14,28,34,31,32,8])),transactions:()=>s((()=>import("./TransactionListRoutes-C_J1qRL2.js")),__vite__mapDeps([35,1,2,3,4,5,6,7,10,11,12,13,14,15,16,36,8])),settings:()=>s((()=>import("./SettingsRoutes-DncRJVSz.js")),__vite__mapDeps([37,1,2,3,4,5,6,7,21,38,19,20,39,40,41,42,43,13,44,25,0,17,27,15,18,45,30,31,34,8])),reports:()=>s((()=>import("./ReportsRoutes-2VOVKXB1.js")),__vite__mapDeps([46,1,2,3,4,5,6,7,0,23,14,15,19,20,21,8])),chargeCards:()=>s((()=>import("./ChargeCardRoutes-Dv_9gHLl.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,11,19,20,21,29,27,15,0,17,14,48,25,8])),people:()=>s((()=>import("./PeopleRoutes-Dn3ixuya.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,0,11,19,20,21,8])),expenseAutomation:()=>s((()=>import("./ExpenseAutomationRoutes-BWhl8VPU.js")),__vite__mapDeps([50,1,2,3,0,4,5,6,7,11,12,13,14,15,16,10,44,28,8])),treasury:()=>s((()=>import("./TreasuryRoutes--6WRfqbv.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,0,29,27,15,19,20,21,17,11,14,23,8])),vendors:()=>s((()=>import("./VendorsRoutes-1M6iQid4.js")),__vite__mapDeps([52,1,2,3,4,5,6,7,25,0,23,53,15,11,19,20,21,28,44,8])),zeniAccounts:()=>s((()=>import("./ZeniAccountRoutes-DSe57kIf.js")),__vite__mapDeps([54,1,2,3,4,5,6,7,0,29,27,15,19,20,21,17,23,26,25,11,36,8]))},un=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],te=a=>{"requestIdleCallback"in window?requestIdleCallback(a):setTimeout(a,100)},dn=l((()=>s((()=>import("./ReportsRoutes-2VOVKXB1.js")),__vite__mapDeps([46,1,2,3,4,5,6,7,0,23,14,15,19,20,21,8])))),cn=l((()=>s((()=>import("./AddressRoutes-B_KlQ5l4.js")),__vite__mapDeps([55,1,2,3,25,4,5,6,7,0,8])))),mn=l((()=>s((()=>import("./PeopleRoutes-Dn3ixuya.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,0,11,19,20,21,8])))),_n=l((()=>s((()=>import("./PandLWithForecastRoutes-D57GW1cM.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,0,23,11,14,15,19,20,21,8])))),En=l((()=>s((()=>import("./CustomerOnboardingRoutes-CchBXDRW.js")),__vite__mapDeps([57,1,2,3,25,4,5,6,7,0,39,40,41,42,43,13,45,48,8])))),hn=l((()=>s((()=>import("./VendorsRoutes-1M6iQid4.js")),__vite__mapDeps([52,1,2,3,4,5,6,7,25,0,23,53,15,11,19,20,21,28,44,8])))),pn=l((()=>s((()=>import("./TransactionDetailRoutes-BMeucnIf.js")),__vite__mapDeps([58,1,2,3,0,4,5,6,7,12,11,13,14,15,16,8])))),Ce=l((()=>s((()=>import("./EntityDetailRoutes-A1jj_wD6.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,13,10,11,12,14,15,16,8])))),gn=l((()=>s((()=>import("./DashboardRoutes-CdzeWYFZ.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,0,17,18,19,20,21,22,23,8])))),ve=l((()=>s((()=>import("./BillPayRoutes-CQ68uF6m.js")),__vite__mapDeps([24,1,2,3,4,5,6,7,25,0,26,11,14,27,15,19,20,21,28,23,29,17,30,31,32,8])))),xn=l((()=>s((()=>import("./SettingsRoutes-DncRJVSz.js")),__vite__mapDeps([37,1,2,3,4,5,6,7,21,38,19,20,39,40,41,42,43,13,44,25,0,17,27,15,18,45,30,31,34,8])))),Rn=l((()=>s((()=>import("./InvoicingRoutes-Ct661m9L.js")),__vite__mapDeps([60,1,2,3,4,5,6,7,25,0,19,20,21,39,40,41,42,43,13,8])))),Oe=l((()=>s((()=>import("./ReimbursementRoutes-CNEWxfxv.js")),__vite__mapDeps([33,1,2,3,4,5,6,7,0,29,27,15,19,20,21,17,23,11,14,28,34,31,32,8])))),In=l((()=>s((()=>import("./ZeniAccountRoutes-DSe57kIf.js")),__vite__mapDeps([54,1,2,3,4,5,6,7,0,29,27,15,19,20,21,17,23,26,25,11,36,8])))),jn=l((()=>s((()=>import("./TreasuryRoutes--6WRfqbv.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,0,29,27,15,19,20,21,17,11,14,23,8])))),Tn=l((()=>s((()=>import("./TransactionListRoutes-C_J1qRL2.js")),__vite__mapDeps([35,1,2,3,4,5,6,7,10,11,12,13,14,15,16,36,8])))),An=l((()=>s((()=>import("./ChargeCardRoutes-Dv_9gHLl.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,11,19,20,21,29,27,15,0,17,14,48,25,8])))),fn=l((()=>s((()=>import("./NotificationRoutes-DVdA_FNb.js")),__vite__mapDeps([61,1,2,3,0,4,5,6,7,11,21,8])))),Dn=l((()=>s((()=>import("./PerformanceRoutes-BvYJFI_Z.js")),__vite__mapDeps([62,1,2,3,0,4,5,6,7,11,19,20,21,8])))),yn=l((()=>s((()=>import("./ExpenseAutomationRoutes-BWhl8VPU.js")),__vite__mapDeps([50,1,2,3,0,4,5,6,7,11,12,13,14,15,16,10,44,28,8])))),bn=l((()=>s((()=>import("./RewardsRoutes-D-DDx4kZ.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,0,8])))),Cn=l((()=>s((()=>import("./TaskRoutes-BFSJCXvT.js")),__vite__mapDeps([64,1,2,3,0,4,5,6,7,14,19,20,21,65,11,8])))),vn=l((()=>s((()=>import("./AiCfoScreen-CqaebBsK.js")),__vite__mapDeps([66,1,2,3,4,5,6,7,22,53,8])))),Ue=l((()=>s((()=>import("./CardsAiCfoScreen-BXy3FrXI.js")),__vite__mapDeps([67,1,2,3,4,5,6,7,8])))),C=l((()=>s((()=>import("./NotFoundScreen-DyEaBoCc.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),On=l((()=>s((()=>import("./TaskListScreen-DxnAUhd5.js").then((a=>a.f))),__vite__mapDeps([65,1,2,3,4,5,6,7,11,19,20,21,8])))),Un=({isDashboardAccess:a,showZeniAccountRoute:A,isUserHasBillPayAccess:B,isUserHasReimbursementAccess:i,showTreasuryRoute:V,isTenantBankingOnly:O,isTenantCardsOnly:v,showChargeCardRoute:k})=>{if(O===!0){if(A)return e.jsx(u,{to:"checking"});if(V)return e.jsx(u,{to:"treasury"});if(k)return e.jsx(u,{to:"cards"})}return v===!0&&k?e.jsx(u,{to:"cards"}):a?e.jsx(u,{to:"dashboard"}):A?e.jsx(u,{to:"checking"}):V?e.jsx(u,{to:"treasury"}):k?e.jsx(u,{to:"cards"}):B?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},Pe=({tenantEmailDomain:a})=>e.jsx(u,{to:`/${a}/dashboard`}),Sn=Object.freeze(Object.defineProperty({__proto__:null,default:function({setTenantEmailDomain:a}){const A=Ms(),B=Zs(),{tenantEmailDomain:i}=Gs(),V=qs().mode,{setLoading:O,clearAllLoading:v,clearLoading:k}=Ys(),f=y.getSignedInUserTenant(i)?.tenantId,j=y.getSignedInUser(),J=cs(j),z=$s(),[L,we]=P.useState(!1),r=$((o=>ms(o))),{useFeatureGate:S}=Ws(),Z=Js(),ae=Ks(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:Ve}=S(M.isChargeCardFeatureEnabled),{isFeatureEnabled:oe}=S(M.isDebitCardFeatureEnabled),T=$((o=>o.tenantState.fetchState)),p=$((o=>o.tenantState.activeTenantFetchState.fetchState)),E=p==="Completed"||T==="Completed"?_s(oe,r):void 0,K=p==="Completed"||T==="Completed"?Es(r):void 0,re=p==="Completed"||T==="Completed"?hs(r)&&!ps(r):void 0,ke=Qs(r,Ve,oe),{isCardsHidden:He}=Xs(r?.tenantId),Be=!ke||!!He,{isFeatureEnabled:Se}=S(M.isSettingsFeatureEnabled),{isFeatureEnabled:Q}=S(M.isAiCfoFileUploadEnabled),{isFeatureEnabled:Ne}=S(M.isInvoicingFeatureEnabled??"is_invoicing_feature_enabled"),Me=Ne||nn==="DEV",q=$((o=>gs(o)));if(i!=null){const o=y.getSignedInUserTenant(i);j!=null&&o!=null&&fe(j,r,V)}const G={tenantId:f,userId:j?.userId,sessionId:j?.zeniSessionId},ie=xs(),h=en(),Ze=r.company==null||h?.loggedInUserRoleMap!=null&&pe(h.loggedInUserRole),Ge=Rs(h?.loggedInUserRoleMap),X=Te("/:tenantEmailDomain/onboarding/*")!==null,ee=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),$e=$((o=>G.tenantId!=null?Is(o,G.tenantId):void 0));P.useEffect((()=>{O(F.TENANT_FETCHING),a(i)}),[i]),P.useEffect((()=>{if(ee!=null&&f!=null){const o=ee.params.selectedPeriod;if(o!=null){const D=o.split("-");if(D.length===2){const d=js(Number(D[0])),n=Number(D[1]),c=Ts(`01-${d<10?`0${d}`:d}-${n}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),N=As();c.isAfter(N,"month")===!1?A(fs(f,{month:d,year:n})):B(`/${i}/month_end_close_checks/review`)}}}}),[ee,f]),P.useEffect((()=>{L||(we(!0),O(F.TENANT_FETCHING))}),[L,G,ie,j,A,y]),P.useLayoutEffect((()=>{!Ds(ie,G)&&y.isSignedIn()&&(O(F.TENANT_FETCHING),(function(o,D,d,n){if(xe(D?.userId,D?.zeniSessionId,o.tenantId),d(Ss(!0)),d(Re(o.tenantId)),o.tenantId!=null&&_.clearTenant(o.tenantId),o.tenantId!=null){const c=y.getSignedInUserTenantWithId(o.tenantId);n&&Ae.updateAppLocaleID(tn(n)),c?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(c?.tenantEmailDomain)}o.userId!=null?ne.identify(o.userId,{tenant_id:o.tenantId}):ne.resetUserIdentity()})(G,j,A,$e))}),[f]),P.useEffect((()=>{y.isSignedIn()&&(O(F.TENANT_FETCHING),(function(o,D,d,n,c,N,H){if(d==null&&n==null)return void console.warn("There is no current tenant selected!!");const Y=n!=null&&c?.zeniSessionId!=null,ls=d==null||d.tenantId!==n,us=d!=null&&d.excludedResources==null,ds=d!=null&&d.externalConnections==null;if(Y&&ls){H(Re(n));const W=y.getSignedInUserTenantWithId(n);W?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(W?.tenantEmailDomain),xe(c?.userId,c?.zeniSessionId,n),_.shouldFetchExcludedResources(n)&&(_.markExcludedResourcesFetchStarted(n),H(Ie(c.userId,n))),_.shouldFetchConnections(n)&&(_.markConnectionsFetchStarted(n),H(je(c.userId,n)))}else Y&&us&&_.shouldFetchExcludedResources(n)&&(_.markExcludedResourcesFetchStarted(n),H(Ie(c.userId,n))),Y&&ds&&_.shouldFetchConnections(n)&&(_.markConnectionsFetchStarted(n),H(je(c.userId,n)));if(Y){ne.identify(c.userId,{tenant_id:n});const W=n==null||n!=null&&(D==="Completed"||D==="Error");o==="Completed"||D!=="Not-Started"&&D!=="Error"||n==null||!_.shouldFetchActiveTenant(n)||(_.markActiveTenantFetchStarted(n),N(F.TENANT_FETCHING),H(Ns(c.userId,n,c.zeniSessionId))),W&&(o==="Not-Started"||o==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),H(ge(c.userId,c.zeniSessionId)))}})(T,p,r,f,j,O,A))}),[f,p]),P.useEffect((()=>{y.isSignedIn()&&T==="Completed"&&q.tenantsBaseInOrder.length>0&&(k(F.TENANT_FETCHING),y.saveSignedInUserTenants(ys(q.tenantsBaseInOrder)),j!=null&&fe(j,r,V,void 0,q.tenantsBaseInOrder))}),[q,T,r,j]),P.useEffect((()=>{p==="In-Progress"&&O(F.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&f!=null?(v(),_.markActiveTenantFetchCompleted(f)):p==="Error"&&f!=null&&(_.markActiveTenantFetchFailed(f),k(F.TENANT_FETCHING),k(F.TENANT_SWITCHING))),T!=="Completed"&&T!=="Error"||(T==="Completed"?_.markAllTenantsFetchCompleted():T==="Error"&&_.markAllTenantsFetchFailed())}),[p,T,f,L]);const le=P.useRef(!1);P.useEffect((()=>{!le.current&&p==="Completed"&&L&&(le.current=!0,(function(o=un,D=3e3){setTimeout((()=>{const d=n=>{if(n>=o.length)return;const c=o[n],N=ln[c];N!=null?N().then((()=>te((()=>d(n+1))))).catch((()=>te((()=>d(n+1))))):d(n+1)};te((()=>d(0)))}),D)})())}),[p,L]);const U=r?.userRole!=null&&bs(r?.userRole),{isFeatureEnabled:ze}=S(M.isReferralFeatureEnabled),qe=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Ye=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),w=r?.userRole!=null&&pe(r.userRole),ue=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!U,de=!Be&&!U,We=Cs(h?.loggedInUserRoleMap),Je=r.externalConnections?.accounting[0]?.isValid,Ke=r.externalConnections?.fetchState==="Completed",se=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!U,me=ce&&vs(h?.loggedInUserRoleMap),_e=Fe&&!U,Qe=Le&&!U,Xe=ue&&Os(h?.loggedInUserRoleMap),es=de&&Us(h?.loggedInUserRoleMap),ss=_e&&Ps(h?.loggedInUserRoleMap),ns=ws(h?.loggedInUserRoleMap),ts=Fs(h?.loggedInUserRoleMap),as=Ls(h?.loggedInUserRoleMap),os=Vs(h?.loggedInUserRoleMap),rs=ks(h?.loggedInUserRoleMap),g=Hs(h?.loggedInUserRoleMap),x=Bs(h?.loggedInUserRoleMap),Ee=ue&&g,he=ce&&x,R=_e&&as,I=Qe&&os,m=de&&rs,is=r.excludedResources?.resources?.find((o=>o.resource==="/invites"))!=null||Ge===!0||We===!0||ns===!0||ts===!0;return y.isSignedIn()?f==null?T==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}):(j!=null&&T!=="In-Progress"&&A(ge(j.userId,j.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||T==="Completed"?(se===!0||J&&!X)&&Ke&&Je!==!0&&E===!1&&K===!1&&re===!1?(a(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!L||re!==!0||se!==!0||X||J?!L||se!==!1||X||J?L&&r?.userRole&&E!=null&&K!=null&&i!=null&&Object.keys(h.loggedInUserRoleMap).length>0?e.jsx(zs,{children:e.jsxs(t,{element:e.jsx(sn,{}),children:[e.jsx(t,{path:"/",element:e.jsx(Un,{isDashboardAccess:w,showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:E,isTenantCardsOnly:K,showChargeCardRoute:m})}),e.jsx(t,{path:"dashboard/*",element:w?e.jsx(gn,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"reports/*",element:w?e.jsx(dn,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"people/*",element:is||w?e.jsx(mn,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"forecast/*",element:w?e.jsx(_n,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(En,{})}),e.jsx(t,{path:"transaction/*",element:w&&U===!1||qe||Ye?e.jsx(pn,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"transactions/*",element:w&&U===!1?e.jsx(Tn,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"customer/*",element:w&&U===!1?e.jsx(Ce,{entityType:"customer"}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isTenantBankingOnly:E,showTreasuryRoute:I,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"vendor/*",element:w&&U===!1?e.jsx(Ce,{entityType:"vendor"}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"tasks",element:e.jsx(On,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(Cn,{})}),e.jsx(t,{path:"address/*",element:Xe||me||ss||es?e.jsx(cn,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"checking/*",element:R?e.jsx(In,{}):e.jsx(C,{})}),e.jsx(t,{path:"treasury/*",element:I?e.jsx(jn,{}):e.jsx(C,{})}),e.jsx(t,{path:"performance",element:ae===!0?e.jsx(Dn,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:ae===!0&&U===!1?e.jsx(yn,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(t,{path:"notifications/*",element:e.jsx(fn,{})}),e.jsx(t,{path:"vendors/*",element:Ze?e.jsx(hn,{}):e.jsx(C,{})}),e.jsx(t,{path:"bill/*",element:Ee?e.jsx(ve,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"bills/*",element:Ee?e.jsx(ve,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"reimbursement/*",element:he?e.jsx(Oe,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"reimbursements/*",element:he?e.jsx(Oe,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"settings/*",element:Se?e.jsx(xn,{hasAdminLevelAccess:me}):e.jsx(C,{})}),e.jsx(t,{path:"invoicing/*",element:Me?e.jsx(Rn,{}):e.jsx(C,{})}),e.jsx(t,{path:"cards/ask",element:m&&Z?e.jsx(Ue,{isFileUploadEnabled:Q}):e.jsx(C,{})}),e.jsx(t,{path:"cards/ask/:session_id",element:m&&Z?e.jsx(Ue,{isFileUploadEnabled:Q}):e.jsx(C,{})}),e.jsx(t,{path:"cards/*",element:m?e.jsx(An,{}):e.jsx(C,{})}),e.jsx(t,{path:"rewards/*",element:ze?e.jsx(bn,{}):e.jsx(C,{})}),e.jsx(t,{path:"/ai-cfo",element:Z?e.jsx(u,{to:"explore"}):e.jsx(C,{})}),e.jsx(t,{path:"/ai-cfo/",element:Z?e.jsx(u,{to:"explore"}):e.jsx(C,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:Z?e.jsx(vn,{isFileUploadEnabled:Q}):e.jsx(C,{})}),e.jsx(t,{path:"*",element:e.jsx(C,{})})]})}):null:(a(void 0),e.jsx(u,{to:`/${i}/onboarding`,replace:!0})):(a(void 0),e.jsx(u,{to:`/${i}/onboarding/thankyou`,replace:!0})):null:(console.warn("User logged out!!"),a(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}))}},Symbol.toStringTag,{value:"Module"}));export{b as F,Sn as S};
@@ -1,9 +0,0 @@
1
- import{j as s}from"./liveblocks-BbYAHGiW.js";import{a}from"./sentry-BOojnQyr.js";import{u as c,g as l,N as u}from"./core-dudeiae1.js";import{z as i,l as n,S as m,a5 as p}from"./index-DpPNNcCA.js";import{gU as g,Tx as y}from"./zeni-epic-state-Dc6DIqGa.js";import{n as b}from"./mui-DOWmAnEx.js";import"./recharts-B1E_Vcxh.js";import"./analytics-D6lgRN4g.js";import"./plaid-DLQRcG8N.js";import"./dnd-w5RIXJhq.js";import"./stripe-cKAAJElX.js";import"./lottie-DNeeuCiH.js";import"./lexical-C-raBUAt.js";import"./pdf-DOlTc5K5.js";import"./utils-wJEG-Wcu.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]="4489ff5d-4dc3-4aab-8e6c-acaaed5fdb1d",e._sentryDebugIdIdentifier="sentry-dbid-4489ff5d-4dc3-4aab-8e6c-acaaed5fdb1d")}catch{}})();function N(){const e=c(),t=l(),r=a.useRef(!1),d=i.isSignedIn(),o=t.state?.message==="logout"||d;return a.useEffect((()=>{if(o&&!r.current){r.current=!0;try{e(g()),y(),n.trackLogout(m.Event.logoutSuccess),n.resetUserIdentity(),i.clearAll()}catch(f){console.error("Error during sign out:",f)}finally{window.location.replace("/signin/auth")}}}),[o,e]),o?s.jsx(h,{children:s.jsx(p,{fetchState:"In-Progress"})}):s.jsx(u,{to:"../",replace:!0})}const h=b.div`
2
- display: flex;
3
- height: 100vh;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${e=>e.theme.colors.grey4};
9
- `;export{N as default};
@@ -1 +0,0 @@
1
- import{j as t}from"./liveblocks-BbYAHGiW.js";import i from"./NotFoundScreen-DyEaBoCc.js";import{T as r}from"./TransactionDetailScreen-O2btGOsz.js";import"./sentry-BOojnQyr.js";import{n as a,o}from"./core-dudeiae1.js";import"./zeni-epic-state-Dc6DIqGa.js";import"./recharts-B1E_Vcxh.js";import"./index-DpPNNcCA.js";import"./mui-DOWmAnEx.js";import"./analytics-D6lgRN4g.js";import"./plaid-DLQRcG8N.js";import"./dnd-w5RIXJhq.js";import"./stripe-cKAAJElX.js";import"./lottie-DNeeuCiH.js";import"./lexical-C-raBUAt.js";import"./pdf-DOlTc5K5.js";import"./utils-wJEG-Wcu.js";import"./useAskAiCfoHostNavButtonProps-Dlbp0rlc.js";import"./decodeURIComponentSafe-DdtJweGV.js";import"./useInitialThreadRequest-LMcL-Aqa.js";import"./routePaths-CKi0kijJ.js";import"./expenseAutomationHelper-CNM6-ogC.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="9520d72a-46e5-44e2-9697-a97671635162",e._sentryDebugIdIdentifier="sentry-dbid-9520d72a-46e5-44e2-9697-a97671635162")}catch{}})();function z(){return t.jsxs(a,{children:[t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(o,{path:"/*",element:t.jsx(r,{})})]})}export{z as default};
@@ -1 +0,0 @@
1
- import{a as u}from"./sentry-BOojnQyr.js";import{h as b,g,i as h,j as S}from"./core-dudeiae1.js";import{fB as y}from"./zeni-epic-state-Dc6DIqGa.js";import{a as k,$ as A,f as C,ap as T,A as I,p as w,as as D}from"./index-DpPNNcCA.js";import"./mui-DOWmAnEx.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]="4760a5d6-5dde-4730-a4ee-ee5a67721687",e._sentryDebugIdIdentifier="sentry-dbid-4760a5d6-5dde-4730-a4ee-ee5a67721687")}catch{}})();function B(e){const{mobileExploreReferrer:a}=e,{isAiCfoOpen:r,setIsAiCfoOpen:i}=k(),s=b(),o=g(),{tenantEmailDomain:n}=h(),l=A(),f=D(l),c=C(),p=T(),m=S((t=>t.tenantState.fetchState==="Completed"||t.tenantState.activeTenantFetchState.fetchState==="Completed"?y(t):void 0)),d=m?.masterTOSInfo?.isMasterTOSAccepted??!1;return{isAiCfoAccessEnabled:p&&c&&!r,onAskAiCfoClick:u.useCallback((()=>{if(n!=null)if(d)if(f){const t=w(o.state?.pathnameStackToGoBack,o.pathname);s(`/${n}/ai-cfo/explore`,{state:{pathnameStackToGoBack:t,referrer:a}})}else i(!0);else I({location:o,navigate:s,mergeState:{referrer:a}})}),[d,f,o,a,s,i,n])}}export{B as u};