@zeniai/web-app-ui 5.3.49-qa → 5.3.50-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 (123) hide show
  1. package/dist/assets/{AccountMappingScreen-Q7xW7M5J.js → AccountMappingScreen-CQ7H13AJ.js} +1 -1
  2. package/dist/assets/ActualMatchingMatchDetailScreen-CiDidq0s.js +1 -0
  3. package/dist/assets/AddressRoutes-B6YbK3vV.js +1 -0
  4. package/dist/assets/{AddressScreen-D8vDeQgw.js → AddressScreen-Bpb3fVmC.js} +1 -1
  5. package/dist/assets/{AiCfoScreen-xhZL9MAI.js → AiCfoScreen-QnyN7vBU.js} +1 -1
  6. package/dist/assets/{AppDrawer-DZPNCAWD.js → AppDrawer-C0gwz2JB.js} +1 -1
  7. package/dist/assets/{BillPayApprovalRoutes-DvcTgpbu.js → BillPayApprovalRoutes-3EoXz0ZY.js} +1 -1
  8. package/dist/assets/{BillPayRoutes-B_NRduNp.js → BillPayRoutes-M6mZc5N-.js} +1 -1
  9. package/dist/assets/{BusinessVerificationPageScreen-qi4m6Iwf.js → BusinessVerificationPageScreen-Nce7icz0.js} +1 -1
  10. package/dist/assets/{CardsAiCfoScreen-B6Ly7KCD.js → CardsAiCfoScreen-DtOqwcGQ.js} +1 -1
  11. package/dist/assets/{ChargeCardRoutes-DQb3RWAv.js → ChargeCardRoutes-Dd-PxeHo.js} +1 -1
  12. package/dist/assets/{CompanyPassportScreen-CP4WxYKA.js → CompanyPassportScreen-49ty9VyO.js} +1 -1
  13. package/dist/assets/{ConnectionAuthScreen-BUbO6vCq.js → ConnectionAuthScreen-BXYkaDxo.js} +1 -1
  14. package/dist/assets/CustomerOnboardingAuthScreen-ydHqVzP0.js +1 -0
  15. package/dist/assets/{CustomerOnboardingRoutes-7sq_iREM.js → CustomerOnboardingRoutes-XyONN9ww.js} +1 -1
  16. package/dist/assets/{DashboardRoutes-BZR2-yyh.js → DashboardRoutes-dkthXH1f.js} +1 -1
  17. package/dist/assets/{DefaultTenantHome-cTUvHoos.js → DefaultTenantHome-CrymQf_N.js} +1 -1
  18. package/dist/assets/{DomesticWireDetailScreen-BDe-1BVE.js → DomesticWireDetailScreen-B7Wh2S3T.js} +1 -1
  19. package/dist/assets/{DrawerScreen-BcA0izcE.js → DrawerScreen-ClAWgRZL.js} +1 -1
  20. package/dist/assets/{EntityDetailRoutes-C9WRc6kR.js → EntityDetailRoutes-Bci8_0b4.js} +1 -1
  21. package/dist/assets/{ExpenseAutomationRoutes-BbHHMGOz.js → ExpenseAutomationRoutes-CBA2iWWZ.js} +1 -1
  22. package/dist/assets/{FeaturePreviewScreen-BOTDjoMi.js → FeaturePreviewScreen-B5y1DAdh.js} +1 -1
  23. package/dist/assets/{HubSpotOAuthCallbackScreen-Cae4-VGJ.js → HubSpotOAuthCallbackScreen-CxZT5Xg0.js} +1 -1
  24. package/dist/assets/{InboxNotificationsProvider-Dwt_tkdC.js → InboxNotificationsProvider-C4Mxy7-U.js} +1 -1
  25. package/dist/assets/InvoicingRoutes-BUMLkBJ7.js +2 -0
  26. package/dist/assets/{MagicLinkRoutes-Df6ri2Kl.js → MagicLinkRoutes-ZSHjgrvL.js} +1 -1
  27. package/dist/assets/{MagicLinkSignInScreen-B6vdgcuk.js → MagicLinkSignInScreen-CaYKvMpE.js} +1 -1
  28. package/dist/assets/{MobileAppDrawer-kvOHgs7K.js → MobileAppDrawer-yEi_dlxO.js} +1 -1
  29. package/dist/assets/NotFoundScreen-DYgKmfND.js +1 -0
  30. package/dist/assets/{NotificationRoutes-dDtgUdSm.js → NotificationRoutes-BnRbqfhI.js} +1 -1
  31. package/dist/assets/{OAuthConsentScreen-H2myTjtC.js → OAuthConsentScreen-BNUaqcAm.js} +1 -1
  32. package/dist/assets/{PandLWithForecastRoutes-BD7uAXdK.js → PandLWithForecastRoutes-DsyrosDN.js} +1 -1
  33. package/dist/assets/{PaymentLinkScreen-CNI9VcWA.js → PaymentLinkScreen-DhAsW9ww.js} +1 -1
  34. package/dist/assets/{PeopleRoutes-D3I8r7bv.js → PeopleRoutes-Slg7y6En.js} +1 -1
  35. package/dist/assets/PerformanceRoutes-DkaD6CAf.js +1 -0
  36. package/dist/assets/{Preview-qQlP44Bb.js → Preview-D3nFS6CS.js} +1 -1
  37. package/dist/assets/{QBOConnectionScreen-JAiYPx6A.js → QBOConnectionScreen-d5CTtraJ.js} +1 -1
  38. package/dist/assets/{ReimbursementApprovalRoutes-bNJ7cOlD.js → ReimbursementApprovalRoutes-DJ4bkGDP.js} +1 -1
  39. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BRScGn-s.js → ReimbursementApprovalRuleDetailScreen-CCuMPoSQ.js} +1 -1
  40. package/dist/assets/{ReimbursementRoutes-dOz52Qry.js → ReimbursementRoutes-UoeOjPcY.js} +4 -4
  41. package/dist/assets/{ReportsRoutes-B7vX60DN.js → ReportsRoutes-DLgdpJm_.js} +1 -1
  42. package/dist/assets/RewardsRoutes-C8Bk8JZD.js +1 -0
  43. package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-Cp-bmLgB.js → ScheduleDetailsPrepaidExpensesScreen-CbzZSAqb.js} +1 -1
  44. package/dist/assets/{ScreenRoutes-BgS5NEcb.js → ScreenRoutes-BFJdqr7A.js} +2 -2
  45. package/dist/assets/{SettingsRoutes-oYgtiH0s.js → SettingsRoutes-ssqLUH47.js} +1 -1
  46. package/dist/assets/{SetupPagesScreen-C8auoDk-.js → SetupPagesScreen-Dofrysh_.js} +1 -1
  47. package/dist/assets/{SignInScreen-BtWQTF4V.js → SignInScreen-2tgX27MZ.js} +1 -1
  48. package/dist/assets/{SignOutScreen-xTFTKHD6.js → SignOutScreen-DBUf9AUK.js} +1 -1
  49. package/dist/assets/{TaskListScreen-Ddl4-pS2.js → TaskListScreen-BvWmomDK.js} +1 -1
  50. package/dist/assets/TaskRoutes-CxfTcH7l.js +9 -0
  51. package/dist/assets/TransactionDetailRoutes-OdKQWakM.js +1 -0
  52. package/dist/assets/{TransactionDetailScreen-DEqpcfN2.js → TransactionDetailScreen-CJaRW_q2.js} +1 -1
  53. package/dist/assets/{TransactionListRoutes-D7yKkQrM.js → TransactionListRoutes-Co9yJGWM.js} +1 -1
  54. package/dist/assets/{TreasuryRoutes-eUohUJUJ.js → TreasuryRoutes-Can8ukgJ.js} +1 -1
  55. package/dist/assets/{VendorsRoutes-CTNYoZwy.js → VendorsRoutes-CBDR6q2p.js} +1 -1
  56. package/dist/assets/{WiseConfirmationScreen-BPaviOwA.js → WiseConfirmationScreen-7BKBvNTr.js} +1 -1
  57. package/dist/assets/{ZeniAccountRoutes-Q406Y_rs.js → ZeniAccountRoutes-Btl8MnMC.js} +1 -1
  58. package/dist/assets/ZeniAccountStatementScreen-CPlmGVIe.js +9 -0
  59. package/dist/assets/{accountMappingHelper-ZA3eE2RB.js → accountMappingHelper-C49jxhGs.js} +1 -1
  60. package/dist/assets/{analytics-EJdRN0EM.js → analytics-CqtBdMPM.js} +1 -1
  61. package/dist/assets/{analyticsHelper-IpMM6iCb.js → analyticsHelper-CMH3f5Mv.js} +1 -1
  62. package/dist/assets/{core-DrG65cn7.js → core-D9_r48xZ.js} +1 -1
  63. package/dist/assets/{decodeURIComponentSafe-Cq-VPmfw.js → decodeURIComponentSafe-DyEaiyWX.js} +1 -1
  64. package/dist/assets/{dnd-ySxwrcGd.js → dnd-BCAK2sIw.js} +1 -1
  65. package/dist/assets/{empty-HkstFjkG.js → empty-BoonXjm8.js} +1 -1
  66. package/dist/assets/{empty-hypZVcyj.js → empty-DHCuvVpz.js} +1 -1
  67. package/dist/assets/{emptyVideoElement-hQo6iMam.js → emptyVideoElement-DDkVcaiD.js} +1 -1
  68. package/dist/assets/epic-DVDsBNia.js +2 -0
  69. package/dist/assets/{expenseAutomationHelper-BhQOMrvk.js → expenseAutomationHelper-Bmn0IF_K.js} +1 -1
  70. package/dist/assets/{getLocaleForTenant-MjJHWv6K.js → getLocaleForTenant-CgHoQ1eD.js} +1 -1
  71. package/dist/assets/{index-CItropkZ.js → index-9Ja3Lqmf.js} +1 -1
  72. package/dist/assets/{index-CNCkAPT0.js → index-BWlvyCtM.js} +908 -908
  73. package/dist/assets/{index-DWaMzRgO.js → index-BYMHtOlo.js} +1 -1
  74. package/dist/assets/{index-CdqEwb4U.js → index-CYjuawf_.js} +1 -1
  75. package/dist/assets/{index-Csgz6JKS.js → index-DNkFQuNQ.js} +2 -2
  76. package/dist/assets/{index-CNxuKyrU.js → index-DmXcZyli.js} +1 -1
  77. package/dist/assets/{index-Cju_tsP9.js → index-bQlS7Nxz.js} +1 -1
  78. package/dist/assets/{index-D2y8Uf4E.js → index-dTLcnBHt.js} +1 -1
  79. package/dist/assets/{lexical-DsG4GgCt.js → lexical-2BO6qHmP.js} +1 -1
  80. package/dist/assets/{liveblocks-DJozFz1F.js → liveblocks-BIpuBqDU.js} +1 -1
  81. package/dist/assets/{lottie-B54UhbRD.js → lottie-CDi-6upx.js} +1 -1
  82. package/dist/assets/{mui-DqsEgFea.js → mui-81_cRiBE.js} +1 -1
  83. package/dist/assets/{pathToGoBack-Cvep4Zpb.js → pathToGoBack-B4fU8Azr.js} +1 -1
  84. package/dist/assets/{pdf-0ccxH7eS.js → pdf-Bb_1563M.js} +3 -3
  85. package/dist/assets/{pdf-lib-CYVFTJz1.js → pdf-lib-CJ09PoKW.js} +1 -1
  86. package/dist/assets/{plaid-KeCmRFX0.js → plaid-BDcnIkZ0.js} +1 -1
  87. package/dist/assets/{pusher-63t06gfb.js → pusher-Ct1YtECO.js} +1 -1
  88. package/dist/assets/{react-DoOX0jE5.js → react-903GIdr_.js} +1 -1
  89. package/dist/assets/{react-Ca5GapOf.js → react-Ad5cTmQt.js} +1 -1
  90. package/dist/assets/{react-CjVnH7Ak.js → react-B3Wl6nG2.js} +1 -1
  91. package/dist/assets/{react-xEeg46_z.js → react-CD8gkbD7.js} +1 -1
  92. package/dist/assets/{react-BNSYzriL.js → react-CWdNL9zh.js} +1 -1
  93. package/dist/assets/{react-CAoDTuLJ.js → react-GWNxCIDF.js} +1 -1
  94. package/dist/assets/{recharts-Bmrae78L.js → recharts-D2tzVFIn.js} +1 -1
  95. package/dist/assets/{routePaths-BlVxV4y9.js → routePaths-Clggvdtc.js} +1 -1
  96. package/dist/assets/{sentry-C1W0cBeR.js → sentry-B2ljjuRI.js} +1 -1
  97. package/dist/assets/{stripSplatSuffix-Dk3dK5Wm.js → stripSplatSuffix-UCDmTxu6.js} +1 -1
  98. package/dist/assets/{url-C0aMyBCn.js → url-BpHe0UXt.js} +1 -1
  99. package/dist/assets/{url-BrtuL5Mk.js → url-DyU7tVdi.js} +1 -1
  100. package/dist/assets/{useActualMatchingMatchDetail-CBa1BLct.js → useActualMatchingMatchDetail-Cu82mAOm.js} +1 -1
  101. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-D-duBA1I.js → useAiCfoDashboardSuggestedQuestionsChips-D4jhuxYc.js} +1 -1
  102. package/dist/assets/{useAskAiCfoHostNavButtonProps-DDB7rJuC.js → useAskAiCfoHostNavButtonProps-0qWmdvwE.js} +1 -1
  103. package/dist/assets/{useChargeCardPusherEvents-CN8r0o7t.js → useChargeCardPusherEvents-Bqb5brTt.js} +1 -1
  104. package/dist/assets/{useDeviceId-BQkxGsaf.js → useDeviceId-CrjinlLp.js} +1 -1
  105. package/dist/assets/{useEmailConnectResultRefresh-DeZjyILj.js → useEmailConnectResultRefresh-BEnYjVgX.js} +1 -1
  106. package/dist/assets/{useInitialThreadRequest-DjzuWq5l.js → useInitialThreadRequest-D_wVO4z2.js} +1 -1
  107. package/dist/assets/{useTaskManagerAccess-D96Us8rE.js → useTaskManagerAccess-DFbLYKBq.js} +1 -1
  108. package/dist/assets/{utils-BYrZSa_o.js → utils-DajTl1fi.js} +1 -1
  109. package/dist/assets/{withTransactionSidePanel-D6eLtbjK.js → withTransactionSidePanel-CJP44IF0.js} +1 -1
  110. package/dist/assets/{zeni-epic-state-1I_oueWp.js → zeni-epic-state-D8p_bjl4.js} +6 -6
  111. package/dist/index.html +1 -1
  112. package/package.json +3 -3
  113. package/dist/assets/ActualMatchingMatchDetailScreen-XRRKXZs7.js +0 -1
  114. package/dist/assets/AddressRoutes-CZYL1zoT.js +0 -1
  115. package/dist/assets/CustomerOnboardingAuthScreen-CTDV3sHx.js +0 -1
  116. package/dist/assets/InvoicingRoutes-C6Pu_uVI.js +0 -2
  117. package/dist/assets/NotFoundScreen-DWq-K_Je.js +0 -1
  118. package/dist/assets/PerformanceRoutes-CRpgkhVO.js +0 -1
  119. package/dist/assets/RewardsRoutes-Ccx-1Ivl.js +0 -1
  120. package/dist/assets/TaskRoutes-DBXAPfzd.js +0 -9
  121. package/dist/assets/TransactionDetailRoutes-DnVLeQAr.js +0 -1
  122. package/dist/assets/ZeniAccountStatementScreen-C2TGrJJ3.js +0 -9
  123. package/dist/assets/epic-BPI4oO0H.js +0 -2
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-CNCkAPT0.js"></script><link rel="modulepreload" crossorigin href="/assets/sentry-C1W0cBeR.js"><link rel="modulepreload" crossorigin href="/assets/core-DrG65cn7.js"><link rel="modulepreload" crossorigin href="/assets/zeni-epic-state-1I_oueWp.js"><link rel="modulepreload" crossorigin href="/assets/mui-DqsEgFea.js"><link rel="modulepreload" crossorigin href="/assets/analytics-EJdRN0EM.js"><link rel="modulepreload" crossorigin href="/assets/utils-BYrZSa_o.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-BWlvyCtM.js"></script><link rel="modulepreload" crossorigin href="/assets/sentry-B2ljjuRI.js"><link rel="modulepreload" crossorigin href="/assets/core-D9_r48xZ.js"><link rel="modulepreload" crossorigin href="/assets/zeni-epic-state-D8p_bjl4.js"><link rel="modulepreload" crossorigin href="/assets/mui-81_cRiBE.js"><link rel="modulepreload" crossorigin href="/assets/analytics-CqtBdMPM.js"><link rel="modulepreload" crossorigin href="/assets/utils-DajTl1fi.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.49-qa",
3
+ "version": "5.3.50-qa",
4
4
  "files": [
5
5
  "dist/**/*"
6
6
  ],
@@ -29,8 +29,8 @@
29
29
  "@sentry/react": "^9.42.1",
30
30
  "@stripe/stripe-js": "^4.4.0",
31
31
  "@zeniai/client-analytics": "2.0.92",
32
- "@zeniai/client-epic-state": "5.2.52",
33
- "@zeniai/web-components": "4.3.85",
32
+ "@zeniai/client-epic-state": "5.2.53",
33
+ "@zeniai/web-components": "4.3.86",
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 s}from"./liveblocks-DJozFz1F.js";import{a as k}from"./sentry-C1W0cBeR.js";import{a5 as I,dS as g}from"./index-CNCkAPT0.js";import"./mui-DqsEgFea.js";import{u as y}from"./useActualMatchingMatchDetail-CBa1BLct.js";import b from"./NotFoundScreen-DWq-K_Je.js";import{i as v,h as U,g as w}from"./core-DrG65cn7.js";import"./zeni-epic-state-1I_oueWp.js";import"./recharts-Bmrae78L.js";import"./analytics-EJdRN0EM.js";import"./plaid-KeCmRFX0.js";import"./dnd-ySxwrcGd.js";import"./stripe-cKAAJElX.js";import"./lottie-B54UhbRD.js";import"./lexical-DsG4GgCt.js";import"./pdf-0ccxH7eS.js";import"./utils-BYrZSa_o.js";import"./stripSplatSuffix-Dk3dK5Wm.js";import"./decodeURIComponentSafe-Cq-VPmfw.js";import"./routePaths-BlVxV4y9.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]="88fd1268-096c-4f58-b182-31ea48f678bc",t._sentryDebugIdIdentifier="sentry-dbid-88fd1268-096c-4f58-b182-31ea48f678bc")}catch{}})();function K(){const{matchId:t,tenantEmailDomain:e}=v(),n=U(),r=w(),R=y(t??""),a=k.useCallback((()=>{const S=I(r.state?.pathnameStackToGoBack);n(S.poppedPathname??`/${e??""}/month_end_close_checks/review`,{state:{pathnameStackToGoBack:S.newStack}})}),[r.state,n,e]);if(t==null)return s.jsx(b,{});const{match:i,detailFetchState:o,handleOpenBill:l,handleRefresh:c,handleUndoReversal:d,handleContinueMatch:f,lastMatchResults:h,lastUndoResults:m,refreshStatus:p,undoReversalStatus:u}=R;return i==null?o.fetchState==="Not-Started"||o.fetchState==="In-Progress"?s.jsx(g,{detailFetchState:o.fetchState,isUndoInFlight:u.fetchState==="In-Progress",refreshStatus:p.fetchState,onNavigateBack:a,onOpenBill:l,onContinueMatch:()=>{f(),a()},onRefresh:c,onUndoReversal:d,lastMatchResults:h,lastUndoResults:m}):s.jsx(b,{}):s.jsx(g,{match:i,detailFetchState:o.fetchState,isUndoInFlight:u.fetchState==="In-Progress",refreshStatus:p.fetchState,onNavigateBack:a,onOpenBill:l,onContinueMatch:()=>{f(),a()},onRefresh:c,onUndoReversal:d,lastMatchResults:h,lastUndoResults:m})}export{K as default};
@@ -1 +0,0 @@
1
- import{j as e}from"./liveblocks-DJozFz1F.js";import{A as i}from"./AddressScreen-D8vDeQgw.js";import s from"./NotFoundScreen-DWq-K_Je.js";import"./sentry-C1W0cBeR.js";import{n as d,o as r}from"./core-DrG65cn7.js";import"./zeni-epic-state-1I_oueWp.js";import"./recharts-Bmrae78L.js";import"./index-CNCkAPT0.js";import"./mui-DqsEgFea.js";import"./analytics-EJdRN0EM.js";import"./plaid-KeCmRFX0.js";import"./dnd-ySxwrcGd.js";import"./stripe-cKAAJElX.js";import"./lottie-B54UhbRD.js";import"./lexical-DsG4GgCt.js";import"./pdf-0ccxH7eS.js";import"./utils-BYrZSa_o.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="81cbb5c1-1b56-4d87-a240-ae6c03b91825",t._sentryDebugIdIdentifier="sentry-dbid-81cbb5c1-1b56-4d87-a240-ae6c03b91825")}catch{}})();function _(){return e.jsxs(d,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(i,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(i,{})}),e.jsx(r,{path:"*",element:e.jsx(s,{})})]})}export{_ as default};
@@ -1 +0,0 @@
1
- import{j as i}from"./liveblocks-DJozFz1F.js";import{z as m}from"./index-CNCkAPT0.js";import{g as n}from"./QBOConnectionScreen-JAiYPx6A.js";import"./sentry-C1W0cBeR.js";import{g as p,N as a}from"./core-DrG65cn7.js";import"./zeni-epic-state-1I_oueWp.js";import"./recharts-Bmrae78L.js";import"./mui-DqsEgFea.js";import"./analytics-EJdRN0EM.js";import"./plaid-KeCmRFX0.js";import"./dnd-ySxwrcGd.js";import"./stripe-cKAAJElX.js";import"./lottie-B54UhbRD.js";import"./lexical-DsG4GgCt.js";import"./pdf-0ccxH7eS.js";import"./utils-BYrZSa_o.js";import"./empty-hypZVcyj.js";import"./pdf-lib-CYVFTJz1.js";import"./index-DWaMzRgO.js";import"./url-BrtuL5Mk.js";import"./index-CItropkZ.js";import"./decodeURIComponentSafe-Cq-VPmfw.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="a1205b81-d106-415b-bd92-85aeae53ace3",t._sentryDebugIdIdentifier="sentry-dbid-a1205b81-d106-415b-bd92-85aeae53ace3")}catch{}})();const U=()=>{const t=p(),{code:o,realmId:r,state:e}=n(t.search),s=m.getSignedInUser()?.userId??"";if(f(o,r,e,s)===!0){const d=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return i.jsx(a,{to:d})}return i.jsx(a,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
@@ -1,2 +0,0 @@
1
- import{j as s}from"./liveblocks-DJozFz1F.js";import{a as r}from"./sentry-C1W0cBeR.js";import{u as P,h as L,i as R,j as C,t as K,l as O,s as H,g as G,N as B,n as te,o as x}from"./core-DrG65cn7.js";import{a9 as rt,k as p,ar as T,S as m,cc as lt,cd as dt,ce as ut,cf as gt,cg as mt,ch as vt,ci as pt,cj as ft,ck as St,cl as ht,cm as It,cn as Ct,co as Et,cp as kt,p as W,cq as yt,cr as xt,af as ae,cs as bt,ct as jt,z as ye,cu as Dt,cv as Pt,cw as Lt,cx as At,cy as $t,cz as wt,cA as Ft,cB as Rt,Q as Tt,aj as mn,cC as _t,cD as Ot,cE as Mt,cF as Nt,cG as $e,cH as Ut,cI as Bt,cJ as Vt,cK as Ht,cL as qt,cM as zt,t as ze,j as vn,cN as Zt,cO as Qt,cP as Kt,cQ as Gt,cR as Wt,cS as Yt,cT as Jt}from"./index-CNCkAPT0.js";import"./mui-DqsEgFea.js";import{A as Z}from"./AddressScreen-D8vDeQgw.js";import M from"./NotFoundScreen-DWq-K_Je.js";import{ZE as Xt,ZF as ei,vl as Ze,ZG as Q,vO as se,ZH as we,ZI as ce,wp as xe,ww as ni,wB as pn,ZJ as Fe,ZK as fn,wt as Sn,y3 as Qe,vN as Ke,ZL as ti,ZM as hn,wM as be,ZN as re,wQ as ii,ZO as oi,ZP as In,wT as Cn,y_ as ai,ZQ as ve,ZR as Ge,ZS as En,vL as si,ZT as ci,vF as ri,ZU as li,yg as di,ZV as kn,yp as We,ZW as ui,ym as gi,ZX as Re,gh as mi,ZY as ee,ZZ as ne,x6 as vi,vT as Ye,vY as yn,vW as pi,vQ as fi,w$ as Si,v_ as hi,x8 as Ii,Z_ as je,xh as xn,xf as Y,xd as le,xc as Ci,Z$ as bn,yv as Je,_0 as Ei,vM as jn,_1 as Te,w7 as De,w4 as Pe,wh as Dn,wg as _e,w1 as ki,wa as Pn,wj as ie,fF as Oe,Vr as Ln,vP as Me,we as yi,wf as xi,wd as bi,_2 as ji,wR as Di,wN as An,_3 as $n,vz as Xe,_4 as Pi,vv as Li,_5 as Ai,yB as $i,yF as q,yA as wi,xJ as Ne,_6 as Fi,_7 as wn,yO as en,_8 as Ri,yL as Ti,_9 as Fn,xM as _i,xN as V,xQ as Oi,_a as Rn,x_ as Ie,_b as Mi,x7 as Tn,TZ as _n,_c as Ni,y8 as Ui,_d as On,_e as Bi,_f as Vi,_g as Hi,zD as qi,_h as zi,_i as Mn,yV as Nn,_j as Un,zB as Ce,_k as Zi,zy as Qi,_l as Ki,_m as Gi,_n as Wi,_o as Yi,_p as Ji,_q as nn,_r as Xi,eg as eo,zH as no,_s as Ue,xr as to,xm as io,_t as de,xC as Bn,xu as ue,xt as oo,xx as Vn,_u as ao,xs as so,_v as Hn,y$ as qn,zq as tn,zl as co,_w as ro,z0 as lo,_x as uo,zr as go,zv as mo,_y as Be,wr as zn,zc as vo,ws as po,_z as fo,_A as Zn,c8 as So,ms as ho,mt as Io,_B as on,wq as ge,gl as Co,mz as Eo,zi as Qn,zT as ko,zf as Kn,uT as yo,zQ as an,uH as xo,zN as sn,hS as bo,Uq as cn,Ur as jo,Gb as Gn,hK as Do,_C as Po,Vg as Lo,_D as Ao,zY as Ee,zZ as $o,_E as wo,_F as Wn,zW as Fo,_G as Ro,_H as To,yc as _o,_I as Oo}from"./zeni-epic-state-1I_oueWp.js";import{M as Mo}from"./MobileAppDrawer-kvOHgs7K.js";import{q as me}from"./QBOConnectionScreen-JAiYPx6A.js";import"./recharts-Bmrae78L.js";import"./analytics-EJdRN0EM.js";import"./plaid-KeCmRFX0.js";import"./dnd-ySxwrcGd.js";import"./stripe-cKAAJElX.js";import"./lottie-B54UhbRD.js";import"./lexical-DsG4GgCt.js";import"./pdf-0ccxH7eS.js";import"./utils-BYrZSa_o.js";import"./InboxNotificationsProvider-Dwt_tkdC.js";import"./useTaskManagerAccess-D96Us8rE.js";import"./empty-hypZVcyj.js";import"./pdf-lib-CYVFTJz1.js";import"./index-DWaMzRgO.js";import"./url-BrtuL5Mk.js";import"./index-CItropkZ.js";import"./decodeURIComponentSafe-Cq-VPmfw.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]="a9a9c0df-e9f9-4d6a-b970-8f78a0d5e515",t._sentryDebugIdIdentifier="sentry-dbid-a9a9c0df-e9f9-4d6a-b970-8f78a0d5e515")}catch{}})();const $=({event:t,isReady:e=!0})=>e?s.jsx(rt,{analytics:p,onLoad:n=>n.trackPageLoaded(t)}):null;function N(...t){return t.some((e=>e==="Error"))}function No(){const t=P(),e=L(),{tenantEmailDomain:n}=R(),{areTenantIdsInSync:i}=T(),[a,o]=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:g,hasMore:S,items:f,nextCursor:h,auditLogEntityRouteOptions:D,auditLogListSortFieldOptions:b}=C(Xt),k=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),y=`/${n??""}/invoicing`,I=r.useCallback(((A,U)=>{const _=ei(y,A,U,D);_!=null&&(p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{entity:A,entityId:U,fromScreen:"audit_log"}),e(_))}),[D,e,y]);r.useEffect((()=>{const A=setTimeout((()=>d(a)),300);return()=>clearTimeout(A)}),[a]),r.useEffect((()=>{i&&t(Ze({filters:k,keepExistingListItems:!1,sort:u}))}),[i,k,u,t]);const j=g==="Not-Started"||g==="In-Progress"&&f.length===0,E=g==="In-Progress"&&f.length>0,w=g==="Completed";return N(g)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingAuditLogPage,isReady:w}),s.jsx(lt,{auditLogEntityRouteOptions:D,auditLogListSortFieldOptions:b,entries:f,hasMore:S,isLoading:j,isLoadingMore:E,searchValue:a,sortState:l,onEntityLinkClick:I,onLoadMore:()=>{S&&h!=null&&t(Ze({cursor:h,filters:k,keepExistingListItems:!0,sort:u}))},onSearchChange:o,onSortChange:v})]})}function pe(t,e=!1){const n=P(),i=C((c=>Q(c).productNextCursor!=null)),a=C((c=>Q(c).productNextCursor)),o=C((c=>Q(c).productFetchState.fetchState));r.useEffect((()=>{t&&(e&&o!=="Not-Started"||n(se({filters:{type:"addon|charge"},keepExistingListItems:!1})))}),[t,n,e]),r.useEffect((()=>{t&&o!=="In-Progress"&&i&&a!=null&&n(se({cursor:a,filters:{type:"addon|charge"},keepExistingListItems:!0}))}),[t,n,o,i,a])}function fe(t,e,n,i){const[a,o]=r.useState(0),[c,d]=r.useState(!1),l=r.useRef(t);return r.useEffect((()=>{const v=l.current==="In-Progress";l.current=t,t==="Completed"&&v&&n!=null&&(d(!0),i(n))}),[t,n,i]),r.useEffect((()=>{c&&!e&&(d(!1),o((v=>v+1)))}),[c,e]),a}const Uo=new Set(["plan"]),Yn=[],Bo=fn((t=>t.length>0?t:Yn),gt),Vo=fn((t=>t.length>0?t:Yn),ut),Ho=O((function(t,e){const{view:n}=e;return{applicableItemOptions:n.applicableItemOptions,groupedAccountOptions:Bo(n.qboAccountHierarchy),groupedClassOptions:Vo(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!==""?a=>{i!==""&&t(Sn({action:a,id:i}))}:void 0,onEditChange:a=>{i!==""&&t(Fe({id:i,localData:a}))},onSaveEdit:()=>{p.trackInvoicingActionClick(m.Event.invoicingCatalogItemEdited,{itemId:i}),t(pn({id:i}))},onSubFamilyLifecycleAction:(a,o)=>{i!==""&&t(ni({action:o,id:a,parentItemId:i}))}}}))(dt);function qo(){const t=P(),e=L(),{item_id:n,tenantEmailDomain:i}=R(),[a]=K(),{areTenantIdsInSync:o}=T(),c=(d=a.get("kind"))!=null&&Uo.has(d)?d:"plan";var d;const l=C((k=>we(k,n))),{pageFetchState:v}=l,u=v.fetchState;r.useEffect((()=>(t(ce({id:n})),()=>{t(ce({id:n}))})),[t,n]),r.useEffect((()=>{o&&t(xe({id:n,kind:c}))}),[o,n,c,t]);const g=r.useCallback((k=>t(xe({cacheOverride:!0,id:k,kind:c}))),[t,c]),S=fe(l.fetchState,l.isFormLoading,n,g),f=u==="Completed";pe(o,!0);const[h,D]=r.useState(f?n:void 0);r.useEffect((()=>{n!=null&&f&&D(n)}),[n,f]);const b=h!==n&&(u==="Not-Started"||u==="In-Progress");return N(u)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingCatalogItemDetailPage,isReady:f}),s.jsx(Ho,{navigate:e,tenantEmailDomain:i,itemId:n??"",kind:c,isLoading:b,view:l},S)]})}const zo=new Set(["addon","charge","plan"]),Zo=new Set(["plan"]),Qo=O((function(t,e){const n=we(t,e.itemId);return{fieldHelp:n.fieldHelp,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",isLoading:n.isFormLoading,localData:n.localData,mode:n.mode,pricingModelValues:n.pricingModelValues,prorationValues:n.prorationValues,tierTypeOptionsByPricingModel:n.catalogTierTypeOptionsByPricingModel,tierTypeValues:n.tierTypeValues}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,i=e.isEdit?"edit":"create",{itemId:a}=e,o=a!=null?`${n}/catalog/${encodeURIComponent(a)}`:`${n}/catalog`;return{onBack:()=>e.navigate(o),onCancel:()=>{p.trackInvoicingActionClick(m.Event.invoicingCatalogItemFormCancelled),t(ce({id:a})),e.navigate(`${n}/catalog`)},onChange:c=>{t(Fe({id:a,localData:c}))},onSubmit:()=>{p.trackInvoicingActionClick(m.Event.invoicingCatalogItemSaved,{mode:i}),t(pn({id:a}))}}}))(mt);function Ko(){const t=P(),e=L(),{item_id:n,tenantEmailDomain:i}=R(),[a]=K(),{areTenantIdsInSync:o}=T(),c=n!=null,d=a.get("type"),l=d!=null&&zo.has(d)?d:void 0,v=(u=a.get("kind"))!=null&&Zo.has(u)?u:"plan";var u;const g=C((S=>we(S,n)));return pe(o,!0),r.useEffect((()=>{o&&t(xe({id:n,kind:v}))}),[o,n,v,t]),r.useEffect((()=>{c||l==null||g.localData.catalogType===l||t(Fe({localData:{...g.localData,catalogType:l}}))}),[c,l,g.localData?.catalogType,t]),r.useEffect((()=>{if(g.fetchState==="Completed"){const S=g.savedItemId??n,f=S!=null?`/${i}/invoicing/catalog/${encodeURIComponent(S)}`:`/${i}/invoicing/catalog`;e(f),t(ce({id:n}))}}),[g.fetchState,g.savedItemId,n,t,e,i]),s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingCatalogItemFormPage}),s.jsx(Qo,{navigate:e,tenantEmailDomain:i,defaultType:l,isEdit:c,itemId:n})]})}const Go={addons:"addon",all:"item",charges:"charge",plans:"plan"},Wo=O((function(t,e){const n=Q(t),i=e.activeTab==="plans",a=e.activeTab==="all",o=i?n.plans:a?[...n.plans,...n.products]:n.products,c=i||a&&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:a&&n.planNextCursor!=null||n.productNextCursor!=null,isLoading:c==="Not-Started"||c==="In-Progress"&&o.length===0,isLoadingMore:c==="In-Progress"&&o.length>0,plans:n.plans,productColumns:n.productColumns,products:n.products}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,i=e.activeTab==="plans",a=e.activeTab==="all",o=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(m.Event.invoicingImportCsvClicked,{entity:"catalog"}),e.navigate(`${n}/data_import`)},onAddItem:()=>{const c=Go[e.activeTab];p.trackInvoicingActionClick(m.Event.invoicingAddCatalogItemClicked,{itemType:c}),e.navigate(`${n}/catalog/new?type=${c}`)},onItemClick:(c,d)=>{p.trackInvoicingActionClick(m.Event.invoicingCatalogItemRowClicked,{itemId:d}),e.navigate(`${n}/catalog/${encodeURIComponent(d)}`)},onCatalogItemLifecycleAction:(c,d)=>{t(Sn({action:ti(d),id:c}))},onLoadMore:()=>{if(a)return e.planNextCursor!=null&&t(Ke({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})));o!=null&&t(i?Ke({cursor:o,filters:e.planFilters,keepExistingListItems:!0,sort:e.sort}):se({cursor:o,filters:e.productFilters,keepExistingListItems:!0,sort:e.sort}))}}}))(vt);function Yo(){const t=P(),e=L(),{tenantEmailDomain:n}=R(),{areTenantIdsInSync:i}=T(),[a,o]=r.useState(""),[c,d]=r.useState("plans"),[l,v]=r.useState(""),[u,g]=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]),D=r.useMemo((()=>({search:f,type:"addon|charge"})),[f]),b=C((A=>Q(A))),k=b.planFilters.search,y=b.planSort,I=b.planNextCursor,j=b.productNextCursor,E=b.fetchState==="Completed",w=b.runningActionId??null;return r.useEffect((()=>{const A=setTimeout((()=>v(a)),300);return()=>clearTimeout(A)}),[a]),r.useEffect((()=>{i&&t(Qe({cacheOverride:!1,planFilters:h,productFilters:D,planSort:S,productSort:S}))}),[i,t,h,D,S]),r.useEffect((()=>{i&&(f!==k||S?.field!==y?.field||S?.dir!==y?.dir)&&t(Qe({cacheOverride:!0,planFilters:h,productFilters:D,planSort:S,productSort:S}))}),[k,y,i,t,h,D,f,S]),N(b.fetchState)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingCatalogPage,isReady:E}),s.jsx(Wo,{navigate:e,tenantEmailDomain:n,activeTab:c,searchValue:a,sortState:u,planFilters:h,productFilters:D,sort:S,planNextCursor:I,productNextCursor:j,runningCatalogItemActionId:w,onSearchChange:o,onTabChange:d,onSortChange:g})]})}const Jo=O((function(t,e){const n=hn(t,e.couponId);return{fieldHelp:n.fieldHelp,applyOnOptions:n.applyOnOptions,discountTypeOptions:n.discountTypeOptions,durationTypeOptions:n.durationTypeOptions,errorMessage:n.fetchState==="Error"?n.error?.message??"Failed to save coupon.":void 0,isQboConnected:n.isQboConnected,isQboPickerDataLoading:n.isQboPickerDataLoading,isSubmitting:n.fetchState==="In-Progress",isLoading:n.isFormLoading,localData:n.localData,mode:n.mode,periodUnitOptions:n.periodUnitOptions,qboAccountHierarchy:n.qboAccountHierarchy,qboIncomeAccountIds:n.qboIncomeAccountIds}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{couponId:i}=e,a=i!=null?"edit":"create",o=i!=null?`${n}/discounts/${encodeURIComponent(i)}`:`${n}/discounts`;return{onBack:()=>e.navigate(o),onCancel:()=>{p.trackInvoicingActionClick(m.Event.invoicingCouponFormCancelled),t(re({id:i})),e.navigate(`${n}/discounts`)},onChange:c=>{t(oi({id:i,localData:c}))},onSubmit:()=>{p.trackInvoicingActionClick(m.Event.invoicingCouponSaved,{mode:a}),t(ii({id:i}))}}}))(pt);function Xo(){const t=P(),e=L(),{coupon_id:n,tenantEmailDomain:i}=R(),{areTenantIdsInSync:a}=T(),{fetchState:o,savedCouponId:c}=C((d=>hn(d,n)));return r.useEffect((()=>{a&&t(be({id:n}))}),[a,n,t]),r.useEffect((()=>{if(o==="Completed"){const d=c??n,l=d!=null?`/${i}/invoicing/discounts/${encodeURIComponent(d)}`:`/${i}/invoicing/discounts`;e(l),t(re({id:n}))}}),[o,c,n,t,e,i]),s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingCouponFormPage}),s.jsx(Jo,{couponId:n,navigate:e,tenantEmailDomain:i})]})}const ea=O((function(t){const e=In(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(m.Event.invoicingCreateInvoiceCancelled),n.navigate(`${i}/invoices`)},onChange:a=>{e(En(a))},onSubmit:()=>{const a=ci(t.localData);p.trackInvoicingActionClick(m.Event.invoicingInvoiceCreated,{customerId:a.customer_id,lineItemCount:a.line_items?.length}),e(ri(a))}}}))(St);function na(){const t=P(),e=L(),{tenantEmailDomain:n}=R(),[i]=K(),{areTenantIdsInSync:a}=T(),o=i.get("customerId"),c=C((I=>In(I))),d=c.fetchState,l=c.localData,v=c.savedInvoiceId,u=C(Cn),g=C((I=>ai(I))),S=C(ve),f=g.fetchState==="Not-Started"||g.fetchState==="In-Progress"&&u==null,h=S.fetchState==="Not-Started"||S.fetchState==="In-Progress"&&S.customers.length===0,D=f||h,b=g.fetchState==="Completed"&&S.fetchState==="Completed";r.useEffect((()=>(t(Ge()),()=>{t(Ge())})),[t]);const k=r.useRef(!1);r.useEffect((()=>{k.current||o==null||o===""||l.customerId!==""||(k.current=!0,t(En({...l,customerId:o})))}),[o,l,t]),r.useEffect((()=>{a&&t(si({cacheOverride:!1}))}),[a,t]);const y=r.useRef(d);return r.useEffect((()=>{const I=y.current;if(y.current=d,I!=="Completed"&&d==="Completed"){const j=v!=null?`/${n}/invoicing/invoices/${encodeURIComponent(v)}`:`/${n}/invoicing/invoices`;e(j)}}),[d,v,e,n]),s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingCreateInvoicePage,isReady:b}),D?s.jsx(ft,{}):s.jsx(ea,{navigate:e,tenantEmailDomain:n})]})}const ta=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(m.Event.invoicingEntityLinkClicked,{customerId:i,fromScreen:"credit_detail",toScreen:"customer"}),e.navigate(`${n}/customers/${encodeURIComponent(i)}`)},onInvoiceClick:i=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{fromScreen:"credit_detail",invoiceId:i,toScreen:"invoice"}),e.navigate(`${n}/invoices/${encodeURIComponent(i)}`)},onSubscriptionClick:i=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{fromScreen:"credit_detail",subscriptionId:i,toScreen:"subscription"}),e.navigate(`${n}/subscriptions/${encodeURIComponent(i)}`)}}}))(ht);function ia(){const t=P(),e=L(),{credit_note_id:n,tenantEmailDomain:i}=R(),{areTenantIdsInSync:a}=T(),o=C((d=>li(d,n??""))),c=o.fetchState==="Completed";return r.useEffect((()=>{a&&n!=null&&t(di({id:n}))}),[a,n,t]),N(o.fetchState)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingCreditDetailPage,isReady:c}),s.jsx(ta,{navigate:e,tenantEmailDomain:i,creditNoteId:n??"",detailView:o})]})}const oa=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",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(m.Event.invoicingImportCsvClicked,{entity:"credits"}),e.navigate(`${n}/data_import`)},onCreditNoteClick:i=>{p.trackInvoicingActionClick(m.Event.invoicingCreditNoteRowClicked,{creditNoteId:i}),e.navigate(`${n}/credits/${encodeURIComponent(i)}`)},onLoadMore:()=>{e.nextCursor!=null&&t(gi({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(It);function aa(){const t=P(),e=L(),{tenantEmailDomain:n}=R(),{areTenantIdsInSync:i}=T(),[a,o]=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]),g=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),{activeStatus:S,appliedSearch:f,appliedSort:h,nextCursor:D,creditNoteListFetchState:b}=C((y=>{const I=kn(y);return{activeStatus:I.activeTab,appliedSearch:I.filters.search,appliedSort:I.sort,nextCursor:I.nextCursor,creditNoteListFetchState:I.fetchState}}),H),k=b==="Completed";return r.useEffect((()=>{const y=setTimeout((()=>d(a)),300);return()=>clearTimeout(y)}),[a]),r.useEffect((()=>{i&&t(We({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(g.search!==f||u?.field!==h?.field||u?.dir!==h?.dir)&&t(We({cacheOverride:!0,filters:g,sort:u}))}),[i,t,g,u,f,h]),N(b)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingCreditsListPage,isReady:k}),s.jsx(oa,{navigate:e,tenantEmailDomain:n,activeStatus:S,searchValue:a,sortState:l,filters:g,sort:u,nextCursor:D,onSearchChange:o,onStatusChange:y=>t(ui(y)),onSortChange:v})]})}const Jn=(t,e,n)=>{const i=`/${t}/invoicing/customers/`;return n!=null?`${i}${encodeURIComponent(n)}/${e}/`:`${i}new/${e}/`},sa=O((function(t,e){const{editView:n,hasLoadedRecord:i}=e;return{fieldHelp:n.fieldHelp,billingAddressLabel:n.billingAddressLabel,hasUnsavedBillingAddress:n.hasUnsavedBillingAddress,customerTypeOptions:n.customerTypeOptions,netTermDayOptions:n.netTermDayOptions,taxabilityOptions:n.taxabilityOptions,customer:n.record.invoicingCustomer,invoices:n.record.invoices.slice(0,5),isLoading:!i&&(n.pageFetchState.fetchState==="Not-Started"||n.pageFetchState.fetchState==="In-Progress"),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:a=>{t(je({id:i,localData:a}))},onCreateInvoice:()=>e.navigate(`${n}/invoices/create`),onInvoiceClick:a=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{fromScreen:"customer_detail",invoiceId:a,toScreen:"invoice"}),e.navigate(`${n}/invoices/${encodeURIComponent(a)}`)},onCreatePromotionalCredits:()=>e.onCreatePromotionalCredits(),onNewSubscription:()=>e.navigate(`${n}/subscriptions/new`),onDiscardEdit:()=>{t(Y(le)),t(Ci({id:i}))},onOpenAddress:()=>{const a=Jn(e.tenantEmailDomain??"",le,i),o=W(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(a,{state:{pathnameStackToGoBack:o}})},onOpenPaymentSettings:()=>e.navigate(`${n}/settings/payment-destination`),onSaveEdit:a=>{p.trackInvoicingActionClick(m.Event.invoicingCustomerEdited,{customerId:i}),t(je({id:i,localData:a})),t(xn({id:i}))},onFetchPaymentLinkEmailPreview:a=>t(Ii({cacheOverride:a,customerId:i})),onSendPaymentLink:(a,o,c)=>t(hi({body:c,customerId:i,email:a,subject:o})),onSubscriptionClick:a=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{fromScreen:"customer_detail",subscriptionId:a,toScreen:"subscription"}),e.navigate(`${n}/subscriptions/${encodeURIComponent(a)}`)}}}))(kt);function ca(){const t=P(),e=L(),n=G(),{customer_id:i,tenantEmailDomain:a}=R(),{areTenantIdsInSync:o}=T(),c=C((_=>Re(_,i))),d=c.pageFetchState.fetchState,l=d==="Completed",[v,u]=r.useState(!1),[g,S]=r.useState(!1),[f,h]=r.useState(c.record.fetchState==="Completed"?i:void 0);r.useEffect((()=>{i!=null&&c.record.fetchState==="Completed"&&h(i)}),[i,c.record.fetchState]);const D=f===i,{plaidTokenFetchState:b,promotionalCreditSubmitState:k}=c,{paymentMethodSaveState:y,setupIntentFetchState:I,stripeConnected:j}=c.record,E=r.useRef(c.record.sendLinkState.fetchState);r.useEffect((()=>{const _=c.record.sendLinkState.fetchState;E.current!=="Error"&&_==="Error"&&t(mi({messageSection:"common",messageText:"failed",showStatusIcon:!0,type:"error"})),E.current=_}),[t,c.record.sendLinkState.fetchState]);const w=I.fetchState==="Error"?I.error?.message??"Failed to start card setup.":y.fetchState==="Error"?y.error?.message??"Failed to save payment method.":b.fetchState==="Error"?b.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((()=>{o&&i!=null&&t(vi({id:i}))}),[o,i,t]),r.useEffect((()=>{o&&i!=null&&j&&t(Ye({customerId:i}))}),[o,i,t,j]);const A=r.useCallback((_=>t(yn({id:_}))),[t]),U=fe(c.fetchState,c.isFormLoading,i,A);return N(d)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingCustomerDetailPage,isReady:l}),s.jsx(sa,{customerId:i??"",editView:c,hasLoadedRecord:D,location:n,navigate:e,tenantEmailDomain:a,onAddPaymentMethod:()=>{t(ee()),i!=null&&j&&t(Ye({customerId:i})),u(!0)},onCreatePromotionalCredits:()=>{t(ne()),S(!0)}},U),s.jsx(Ct,{errorMessage:w,isCreatingSetupIntent:I.fetchState==="In-Progress",isSaving:y.fetchState==="In-Progress",open:v,plaidLinkToken:c.record.plaidLinkToken,saveSucceeded:y.fetchState==="Completed",setupIntent:c.record.setupIntent,stripeConnected:j,onChooseCard:()=>{i!=null&&t(fi({customerId:i}))},onClose:()=>{u(!1),t(ee())},onSavePaymentMethod:_=>{i!=null&&t(pi({customerId:i,data:_}))}}),s.jsx(Et,{currentBalance:c.record.invoicingCustomer?.promotionalCredits,currencyCode:c.record.invoicingCustomer?.preferredCurrencyCode,errorMessage:k.fetchState==="Error"?k.error?.message??"Failed to add promotional credits.":void 0,isSubmitting:k.fetchState==="In-Progress",open:g,submitSucceeded:k.fetchState==="Completed",onClose:()=>{S(!1),t(ne())},onSubmit:({amount:_,description:X})=>{i!=null&&t(Si({amount:_,customerId:i,currencyCode:c.record.invoicingCustomer?.preferredCurrencyCode,description:X}))}})]})}const ra=O((function(t,e){const n=Re(t,e.customerId);return{fieldHelp:n.fieldHelp,billingAddressLabel:n.billingAddressLabel,customerTypeOptions:n.customerTypeOptions,netTermDayOptions:n.netTermDayOptions,taxabilityOptions:n.taxabilityOptions,errorMessage:n.fetchState==="Error"?n.error?.message??"Failed to save customer.":void 0,isSubmitting:n.fetchState==="In-Progress",isLoading:n.isFormLoading,localData:n.localData,mode:n.mode}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{customerId:i}=e,a=i!=null?"edit":"create",o=i!=null?`${n}/customers/${encodeURIComponent(i)}`:`${n}/customers`;return{onBack:()=>e.navigate(o),onCancel:()=>{p.trackInvoicingActionClick(m.Event.invoicingCustomerFormCancelled),t(bn({id:i})),t(Y(le)),e.navigate(`${n}/customers`)},onChange:c=>{t(je({id:i,localData:c}))},onOpenAddress:()=>{const c=Jn(e.tenantEmailDomain??"",le,i),d=W(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(c,{state:{pathnameStackToGoBack:d}})},onSubmit:()=>{p.trackInvoicingActionClick(m.Event.invoicingCustomerSaved,{mode:a}),t(xn({id:i}))}}}))(yt);function la(){const t=P(),e=L(),n=G(),{customer_id:i,tenantEmailDomain:a}=R(),{areTenantIdsInSync:o}=T(),{fetchState:c,savedCustomerId:d}=C((l=>Re(l,i)));return r.useEffect((()=>{o&&i!=null&&t(yn({id:i}))}),[o,i,t]),r.useEffect((()=>{if(c==="Completed"){const l=d??i,v=l!=null?`/${a}/invoicing/customers/${encodeURIComponent(l)}`:`/${a}/invoicing/customers`;e(v),t(bn({id:i}))}}),[c,d,i,t,e,a]),s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingCustomerFormPage}),s.jsx(ra,{customerId:i,location:n,navigate:e,tenantEmailDomain:a})]})}const da=O((function(t){const e=ve(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(m.Event.invoicingAddCustomerClicked),e.navigate(`${n}/customers/new`)},onCustomerClick:i=>{p.trackInvoicingActionClick(m.Event.invoicingCustomerRowClicked,{customerId:i}),e.navigate(`${n}/customers/${encodeURIComponent(i)}`)},onImportCsv:()=>{p.trackInvoicingActionClick(m.Event.invoicingImportCsvClicked,{entity:"customers"}),e.navigate(`${n}/data_import`)},onRowAction:(i,a)=>{switch(a){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(jn({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(xt);function ua(){const t=P(),e=L(),{tenantEmailDomain:n}=R(),{areTenantIdsInSync:i}=T(),[a,o]=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]),g=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),{activeStatus:S,appliedSearch:f,appliedSort:h,nextCursor:D,customerListFetchState:b}=C((y=>{const I=ve(y);return{activeStatus:I.activeTab,appliedSearch:I.filters.search,appliedSort:I.sort,nextCursor:I.nextCursor,customerListFetchState:I.fetchState}}),H),k=b==="Completed";return r.useEffect((()=>{const y=setTimeout((()=>d(a)),300);return()=>clearTimeout(y)}),[a]),r.useEffect((()=>{i&&t(Je({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(g.search!==f||u?.field!==h?.field||u?.dir!==h?.dir)&&t(Je({cacheOverride:!0,filters:g,sort:u}))}),[i,t,g,u,f,h]),N(b)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingCustomersListPage,isReady:k}),s.jsx(da,{navigate:e,tenantEmailDomain:n,activeStatus:S,searchValue:a,sortState:l,filters:g,sort:u,nextCursor:D,onSearchChange:o,onStatusChange:y=>t(Ei(y)),onSortChange:v})]})}const Le=(t,e)=>e==null?void 0:t.sessionDetail[e]??t.sessions.find((n=>n.id===e)),ga=O((function(t,e){const{filters:n,sessionId:i,view:a}=e,o=i==null?void 0:a.diagnosticsBySession[i],c=o?.fetch.fetchState??"Not-Started";return{diagnostics:o?.items??[],errorMessage:c==="Error"?o?.fetch.error?.message:void 0,expired:o?.expired??!1,filters:n,hasMore:o?.nextCursor!=null,isLoading:c==="Not-Started"||c==="In-Progress",isLoadingMore:c==="In-Progress"&&(o?.items.length??0)>0,session:Le(a,i)}}),(function(t,e){const{downloadUrl:n,filters:i,navigate:a,sessionId:o,tenantEmailDomain:c,view:d}=e,l=o==null?void 0:d.diagnosticsBySession[o],v=Le(d,o),u=d.actionStateByKind.retry?.fetchState==="In-Progress",g=d.actionStateByKind.rollback?.fetchState==="In-Progress",S=v?.status==="done"&&v.rollback_available_until!=null&&new Date(v.rollback_available_until).getTime()>Date.now()&&!g;return{onBack:()=>a(`/${c}/invoicing/data_import`),onDownloadCsv:()=>{n!=null&&window.open(n,"_blank","noopener")},onFiltersChange:e.onFiltersChange,onLoadMore:()=>{o!=null&&l?.nextCursor!=null&&t(Pe({...i,cursor:l.nextCursor,sessionId:o}))},onRetry:v?.status!=="failed"||u?void 0:()=>{o!=null&&t(_e(o))},onRollback:S?()=>{o!=null&&t(Dn(o))}:void 0}}))(bt);function ma(){const t=P(),e=L(),{sessionId:n,tenantEmailDomain:i}=R(),{areTenantIdsInSync:a}=T(),[o,c]=r.useState({}),d=C(Te),l=Le(d,n),v=n==null?void 0:d.diagnosticsBySession[n];r.useEffect((()=>{a&&n!=null&&t(De(n))}),[a,t,n]),r.useEffect((()=>{if(!a||n==null)return;const f=setTimeout((()=>{t(Pe({...o,sessionId:n}))}),300);return()=>clearTimeout(f)}),[a,t,o,n]);const u=l?.status==="scanning"||l?.status==="importing";r.useEffect((()=>{if(!a||n==null||!u)return;const f=setInterval((()=>{t(De(n)),t(Pe({...o,sessionId:n}))}),3e3);return()=>clearInterval(f)}),[a,t,o,u,n]);const g=r.useMemo((()=>{if(n==null)return;const f=new URLSearchParams;o.moduleId!=null&&f.set("module_id",o.moduleId),o.level!=null&&f.set("level",o.level),o.outcome!=null&&f.set("outcome",o.outcome),o.search!=null&&o.search.trim()!==""&&f.set("search",o.search.trim());const h=f.toString();return`${ae?.invoicingMicroServiceBaseUrl??""}/1.0/data-import/${encodeURIComponent(n)}/issues.csv${h===""?"":`?${h}`}`}),[o,n]),S=v?.fetch.fetchState??"Not-Started";return N(S)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingDataImportHubPage,isReady:l!=null&&S!=="Not-Started"}),s.jsx(ga,{downloadUrl:g,filters:o,navigate:e,sessionId:n,tenantEmailDomain:i,view:d,onFiltersChange:c})]})}const Xn=t=>`invoicing_active_migration:${t}`,oe=(t,e)=>{if(t!=null&&t!=="")try{const n=Xn(t);e==null?sessionStorage.removeItem(n):sessionStorage.setItem(n,e)}catch{}},va=O((function(t,e){const{sessions:n,sessionsFetch:i,statusFetch:a,statusRows:o}=e.view;return{isLoading:!(a.fetchState!=="Not-Started"&&a.fetchState!=="In-Progress"||o.length!==0||i.fetchState!=="Not-Started"&&i.fetchState!=="In-Progress"),sessions:n,statusRows:o}}),(function(t,e){const{navigate:n,tenantEmailDomain:i}=e,a=o=>{const c=o??null;t(ie(c)),oe(i,c),n(`/${i}/invoicing/data_import/migrate`)};return{onContinueSession:o=>{p.trackInvoicingActionClick(m.Event.invoicingImportSessionAction,{action:"continue",sessionId:o}),a(o)},onNewImport:()=>{p.trackInvoicingActionClick(m.Event.invoicingNewImportClicked),a()},onRetrySession:o=>{p.trackInvoicingActionClick(m.Event.invoicingImportSessionAction,{action:"retry",sessionId:o}),t(_e(o)),a(o)},onRollbackSession:o=>{p.trackInvoicingActionClick(m.Event.invoicingImportSessionAction,{action:"rollback",sessionId:o}),t(Dn(o))},onViewSession:o=>{p.trackInvoicingActionClick(m.Event.invoicingImportSessionAction,{action:"view_details",sessionId:o}),n(`/${i}/invoicing/data_import/${encodeURIComponent(o)}`)}}}))(jt);function pa(){const t=P(),e=L(),{tenantEmailDomain:n}=R(),{areTenantIdsInSync:i}=T(),a=C(Te);r.useEffect((()=>{i&&(t(ki()),t(Pn()))}),[i,t]);const o=a.statusFetch.fetchState==="Completed"&&a.sessionsFetch.fetchState==="Completed";return s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingDataImportHubPage,isReady:o}),s.jsx(va,{navigate:e,tenantEmailDomain:n,view:a})]})}const fa=O((function(t,e){const{activeId:n,integrationsView:i,settings:a,view:o}=e,{actionStateByKind:c,sessionDetail:d,sessions:l}=o,v=i.externalConnections?.revenue?.find((g=>g.connectionName==="chargebee")),u=n!=null?d[n]:void 0;return{chargebeeConnected:a?.chargebee_connected===!0||(v?.isValid??!1),chargebeeConnectorAvailable:v!=null,chargebeeSite:a?.chargebee_site,connectError:c.connect?.error?.message,connecting:c.connect?.fetchState==="In-Progress",retrying:c.retry?.fetchState==="In-Progress",session:u??l.find((g=>g.id===n)),starting:c.start?.fetchState==="In-Progress",uploading:c.upload?.fetchState==="In-Progress"}}),(function(t,e){const{activeId:n,navigate:i,tenantEmailDomain:a}=e;return{onBack:e.onBack,onDownloadTemplates:()=>{p.trackInvoicingActionClick(m.Event.invoicingImportTemplatesDownloaded);const o=ae?.invoicingMicroServiceBaseUrl,c=o!=null&&o.length>0?o:"";window.open(`${c}/1.0/data-import/templates`,"_blank","noopener")},onFetchFromChargebee:()=>{p.trackInvoicingActionClick(m.Event.invoicingChargebeeConnectClicked),t(bi())},onGoToIntegrations:()=>{i(`/${a}/invoicing/settings`)},onGoToOverview:()=>i(`/${a}/invoicing/overview`),onRetry:()=>{n!=null&&t(_e(n))},onSaveLater:()=>{p.trackInvoicingActionClick(m.Event.invoicingImportSavedForLater),e.onBack()},onStartImport:()=>{p.trackInvoicingActionClick(m.Event.invoicingImportStarted),n!=null&&t(xi(n))},onUpload:o=>{p.trackInvoicingActionClick(m.Event.invoicingImportFileUploaded),t(yi({files:o}))},onViewDetails:n==null?void 0:()=>i(`/${a}/invoicing/data_import/${encodeURIComponent(n)}`)}}))(Dt);function Sa(){const t=P(),e=L(),{tenantEmailDomain:n}=R(),{areTenantIdsInSync:i}=T(),a=C(Cn),o=C(Oe).companyId??ye.getSignedInUserTenant(n??"")?.companyId,c=C((f=>Ln(f,o))),d=C(Te),{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(Me()),t(Pn()))}),[i,t]),r.useEffect((()=>{if(l!=null)return;const f=(h=>{if(h==null||h==="")return null;try{return sessionStorage.getItem(Xn(h))}catch{return null}})(n);f!=null&&t(ie(f))}),[l,t,n]),r.useEffect((()=>{oe(n,l)}),[l,n]);const g=u?.status,S=g==="scanning"||g==="importing";return r.useEffect((()=>{if(!i||v==null||!S)return;const f=setInterval((()=>{t(De(v))}),3e3);return()=>clearInterval(f)}),[i,v,S,t]),r.useEffect((()=>{g==="done"&&(t(ie(null)),oe(n,null))}),[t,g,n]),s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingDataImportMigratePage}),s.jsx(fa,{activeId:v,integrationsView:c,navigate:e,settings:a,tenantEmailDomain:n,view:d,onBack:()=>{t(ie(null)),oe(n,null),e(`/${n}/invoicing/data_import`)}})]})}const ha=O((function(t,e){const{editView:n}=e;return{fieldHelp:n.fieldHelp,coupon:n.coupon,discountLifecycleActionOptions:e.discountLifecycleActionOptions,discountsAccountName:n.discountsAccountName,isLoading:!e.hasLoadedRecord&&(n.pageFetchState.fetchState==="Not-Started"||n.pageFetchState.fetchState==="In-Progress"),isRunningLifecycleAction:e.isRunningLifecycleAction,isSaving:n.fetchState==="In-Progress"}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{couponId:i}=e;return{onBack:()=>e.navigate(`${n}/discounts`),onLifecycleAction:a=>{t(An({action:a,id:i}))},onSaveEdit:a=>{p.trackInvoicingActionClick(m.Event.invoicingCouponEdited,{couponId:i}),t(Di({data:a,id:i}))}}}))(Pt);function Ia(){const t=P(),e=L(),{coupon_id:n,tenantEmailDomain:i}=R(),{areTenantIdsInSync:a}=T(),o=C((h=>ji(h,n))),c=o.actionState.fetchState==="In-Progress",d=o.pageFetchState.fetchState,l=d==="Completed",[v,u]=r.useState(l?n:void 0);r.useEffect((()=>{n!=null&&l&&u(n)}),[n,l]);const g=v===n;r.useEffect((()=>(t(re({id:n})),()=>{t(re({id:n}))})),[n,t]),r.useEffect((()=>{a&&t(be({id:n}))}),[a,n,t]);const S=r.useCallback((h=>t(be({cacheOverride:!0,id:h}))),[t]),f=fe(o.fetchState,o.isFormLoading,n,S);return N(d)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingDiscountDetailPage,isReady:l}),s.jsx(ha,{hasLoadedRecord:g,couponId:n??"",discountLifecycleActionOptions:o.discountLifecycleActionOptions,editView:o,isRunningLifecycleAction:c,navigate:e,tenantEmailDomain:i},f)]})}const Ca=O((function(t){const e=$n(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(m.Event.invoicingDiscountRowClicked,{couponId:i}),e.navigate(`${n}/discounts/${encodeURIComponent(i)}`)},onCreateCoupon:()=>{p.trackInvoicingActionClick(m.Event.invoicingCreateCouponClicked),e.navigate(`${n}/discounts/new`)},onImportCsv:()=>{p.trackInvoicingActionClick(m.Event.invoicingImportCsvClicked,{entity:"discounts"}),e.navigate(`${n}/data_import`)},onDiscountLifecycleAction:(i,a)=>{t(An({action:a,id:i}))},onLoadMore:()=>{e.nextCursor!=null&&t(Li({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(Lt);function Ea(){const t=P(),e=L(),{tenantEmailDomain:n}=R(),{areTenantIdsInSync:i}=T(),[a,o]=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]),g=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),{activeStatus:S,appliedSearch:f,appliedSort:h,nextCursor:D,couponListFetchState:b,runningDiscountActionId:k}=C((I=>{const j=$n(I);return{activeStatus:j.activeTab,appliedSearch:j.filters.search,appliedSort:j.sort,nextCursor:j.nextCursor,couponListFetchState:j.fetchState,runningDiscountActionId:j.runningActionId??null}}),H),y=b==="Completed";return r.useEffect((()=>{const I=setTimeout((()=>d(a)),300);return()=>clearTimeout(I)}),[a]),r.useEffect((()=>{i&&t(Xe({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(g.search!==f||u?.field!==h?.field||u?.dir!==h?.dir)&&t(Xe({cacheOverride:!0,filters:g,sort:u}))}),[i,t,g,u,f,h]),N(b)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingDiscountsListPage,isReady:y}),s.jsx(Ca,{navigate:e,tenantEmailDomain:n,activeStatus:S,searchValue:a,sortState:l,filters:g,sort:u,nextCursor:D,runningDiscountActionId:k,onSearchChange:o,onStatusChange:I=>t(Pi(I)),onSortChange:v})]})}const ka=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,a=i!=="";return{onBack:()=>e.navigate(`${n}/dunning`),onInvoiceClick:o=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{caseId:i,fromScreen:"dunning_detail",invoiceId:o,toScreen:"invoice"}),e.navigate(`${n}/invoices/${encodeURIComponent(o)}`)},onCancel:a?()=>t(q({action:"cancel",id:i})):void 0,onResolve:a?()=>{p.trackInvoicingActionClick(m.Event.invoicingDunningAction,{action:"resolve",caseId:i}),t(q({action:"resolve",id:i}))}:void 0,onResume:a?()=>{p.trackInvoicingActionClick(m.Event.invoicingDunningAction,{action:"resume",caseId:i}),t(q({action:"resume",id:i}))}:void 0,onRetry:a?()=>{p.trackInvoicingActionClick(m.Event.invoicingDunningAction,{action:"retry",caseId:i}),t(q({action:"retry",id:i}))}:void 0}}))($t);function ya(){const t=P(),e=L(),{case_id:n,tenantEmailDomain:i}=R(),{areTenantIdsInSync:a}=T(),o=C((E=>Ai(E,n??""))),c=o.fetchState==="Completed",d=o.dunningCase?.invoiceID,[l,v]=r.useState("idle"),[u,g]=r.useState(!1),[S,f]=r.useState(),[h,D]=r.useState(!1),b=r.useCallback((()=>{v("idle"),g(!1),f(void 0),D(!1)}),[]),k=r.useCallback((()=>{if(n==null)return;t($i({id:n})),v("idle"),g(!1);const E=o.emailPreview.preview;f(E==null?void 0:{body:E.body,cc:E.cc,subject:E.subject,to:E.to}),D(!0)}),[n,t,o.emailPreview.preview]),y=r.useCallback((E=>{n!=null&&l!=="pending"&&(g(!1),v("pending"),p.trackInvoicingActionClick(m.Event.invoicingDunningAction,{action:"send-email",caseId:n}),t(q({action:"send-email",body:E,id:n})))}),[n,t,l]),I=r.useMemo((()=>o.emailPreview.preview==null?void 0:{bodyToken:o.emailPreview.preview.bodyToken,renderedHtmlTemplate:o.emailPreview.preview.renderedHtmlTemplate,subjectToken:o.emailPreview.preview.subjectToken}),[o.emailPreview.preview]);r.useEffect((()=>{a&&n!=null&&t(wi({id:n}))}),[a,n,t]),r.useEffect((()=>{a&&d!=null&&t(Ne({invoiceId:d}))}),[a,d,t]),r.useEffect((()=>{v("idle"),g(!1),f(void 0),D(!1)}),[n]),r.useEffect((()=>{a||(v("idle"),g(!1),f(void 0),D(!1))}),[a]),r.useEffect((()=>{h&&S==null&&o.emailPreview.preview!=null&&f({body:o.emailPreview.preview.body,cc:o.emailPreview.preview.cc,subject:o.emailPreview.preview.subject,to:o.emailPreview.preview.to})}),[o.emailPreview.preview,S,h]),r.useEffect((()=>{l==="pending"&&(o.actionState.fetchState!=="In-Progress"?u&&o.actionState.fetchState==="Completed"?(n!=null&&t(Fi({id:n})),b()):u&&o.actionState.fetchState==="Error"&&v("failed"):g(!0))}),[n,b,t,l,u,o.actionState.fetchState]);const j=d!=null&&o.linkedInvoice?.id===d?o.linkedInvoice.dunningAttempts:void 0;return N(o.fetchState)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingDunningDetailPage,isReady:c}),s.jsx(ka,{navigate:e,tenantEmailDomain:i,caseId:n??"",readView:o,dunningAttempts:j,onSendEmail:k}),s.jsx(At,{initialDraft:S,isPreviewLoading:o.emailPreview.fetchState==="Not-Started"||o.emailPreview.fetchState==="In-Progress",isSending:l==="pending",onClose:b,onSend:y,open:h,preview:I,previewErrorMessage:o.emailPreview.fetchState==="Error"?o.emailPreview.error?.message:void 0,sendErrorMessage:l==="failed"?o.actionState.error?.message:void 0})]})}const xa=O((function(t){const e=wn(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(m.Event.invoicingDunningCaseRowClicked,{caseId:i}),e.navigate(`${n}/dunning/${encodeURIComponent(i)}`)},onRowAction:(i,a)=>{a!=="retry"&&a!=="resume"&&a!=="resolve"&&a!=="cancel"||t(q({action:a,id:i}))},onLoadMore:()=>{e.nextCursor!=null&&t(Ti({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(wt);function ba(){const t=P(),e=L(),{tenantEmailDomain:n}=R(),{areTenantIdsInSync:i}=T(),[a,o]=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]),g=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),{activeStatus:S,appliedSearch:f,appliedSort:h,nextCursor:D,dunningCaseListFetchState:b}=C((y=>{const I=wn(y);return{activeStatus:I.activeTab,appliedSearch:I.filters.search,appliedSort:I.sort,nextCursor:I.nextCursor,dunningCaseListFetchState:I.fetchState}}),H),k=b==="Completed";return r.useEffect((()=>{const y=setTimeout((()=>d(a)),300);return()=>clearTimeout(y)}),[a]),r.useEffect((()=>{i&&t(en({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(g.search!==f||u?.field!==h?.field||u?.dir!==h?.dir)&&t(en({cacheOverride:!0,filters:g,sort:u}))}),[i,t,g,u,f,h]),N(b)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingDunningListPage,isReady:k}),s.jsx(xa,{navigate:e,tenantEmailDomain:n,activeStatus:S,searchValue:a,sortState:l,filters:g,sort:u,nextCursor:D,onSearchChange:o,onStatusChange:y=>t(Ri(y)),onSortChange:v})]})}const ja=O((function(t,e){const{view:n}=e;return{fieldHelp:e.view.fieldHelp,billingAddress:n.billingAddress,invoice:n.invoice,invoiceId:e.invoiceId,shippingAddress:n.shippingAddress,isLoading:!e.hasLoadedRecord&&(n.pageFetchState.fetchState==="Not-Started"||n.pageFetchState.fetchState==="In-Progress"),isSaving:n.actionState.fetchState==="In-Progress",isVoiding:n.actionState.fetchState==="In-Progress"}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{invoiceId:i}=e;return{onBack:()=>e.navigate(`${n}/invoices`),onCustomerClick:a=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{customerId:a,fromScreen:"invoice_detail",toScreen:"customer"}),e.navigate(`${n}/customers/${encodeURIComponent(a)}`)},onIssueCreditNote:()=>{p.trackInvoicingActionClick(m.Event.invoicingCreditNoteIssued,{invoiceId:i}),e.navigate(`${n}/invoices/${encodeURIComponent(i)}/issue-credit-note`)},onRecordPayment:()=>{p.trackInvoicingActionClick(m.Event.invoicingRecordPaymentClicked,{fromScreen:"invoice_detail",invoiceId:i}),e.navigate(`${n}/invoices/${encodeURIComponent(i)}/record-payment`)},onRegenerate:()=>{p.trackInvoicingActionClick(m.Event.invoicingInvoiceRegenerated,{invoiceId:i}),t(V({action:"regenerate",invoiceId:i}))},onSaveEdit:a=>{p.trackInvoicingActionClick(m.Event.invoicingInvoiceEdited,{invoiceId:i}),t(Oi({data:{due_date:a.due_date!==""?a.due_date:void 0,notes:a.notes.trim()!==""?a.notes.split(`
2
- `).map((o=>o.trim())).filter((o=>o!=="")).map((o=>({note:o}))):void 0,po_number:a.po_number!==""?a.po_number:null},invoiceId:i}))},onSendReminder:()=>{p.trackInvoicingActionClick(m.Event.invoicingInvoiceReminderSent,{invoiceId:i}),t(V({action:"send-reminder",invoiceId:i}))},onSubscriptionClick:a=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{fromScreen:"invoice_detail",subscriptionId:a,toScreen:"subscription"}),e.navigate(`${n}/subscriptions/${encodeURIComponent(a)}`)},onVoid:a=>{p.trackInvoicingActionClick(m.Event.invoicingInvoiceVoided,{invoiceId:i}),t(V({action:"void",invoiceId:i,body:a}))}}}))(Ft);function Da(){const t=P(),e=L(),{invoice_id:n,tenantEmailDomain:i}=R(),{areTenantIdsInSync:a}=T(),o=C((g=>Fn(g,n??""))),c=o.pageFetchState.fetchState,d=c==="Completed",[l,v]=r.useState(d?n:void 0);r.useEffect((()=>{n!=null&&d&&v(n)}),[n,d]);const u=l===n;return r.useEffect((()=>{a&&n!=null&&t(_i({invoiceId:n}))}),[a,n,t]),N(c)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingInvoiceDetailPage,isReady:d}),s.jsx(ja,{invoiceId:n??"",hasLoadedRecord:u,navigate:e,tenantEmailDomain:i,view:o})]})}const Pa=O((function(t){const e=Rn(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(m.Event.invoicingCreateInvoiceClicked),e.navigate(`${n}/invoices/create`)},onImportCsv:()=>{p.trackInvoicingActionClick(m.Event.invoicingImportCsvClicked,{entity:"invoices"}),e.navigate(`${n}/data_import`)},onInvoiceClick:i=>{p.trackInvoicingActionClick(m.Event.invoicingInvoiceRowClicked,{invoiceId:i}),e.navigate(`${n}/invoices/${encodeURIComponent(i)}`)},onRowAction:(i,a)=>{switch(a){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,a)=>{p.trackInvoicingActionClick(m.Event.invoicingInvoiceVoided,{invoiceId:i}),t(V({action:"void",invoiceId:i,body:a}))},onLoadMore:()=>{e.nextCursor!=null&&t(Tn({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(Rt);function La(){const t=P(),e=L(),{tenantEmailDomain:n}=R(),{areTenantIdsInSync:i}=T(),[a,o]=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]),g=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),{activeStatus:S,appliedSearch:f,appliedSort:h,nextCursor:D,invoiceListFetchState:b,voidingInvoiceId:k}=C((I=>{const j=Rn(I);return{activeStatus:j.activeTab,appliedSearch:j.filters.search,appliedSort:I.invoicingInvoiceListState.sort,nextCursor:j.nextCursor,invoiceListFetchState:j.fetchState,voidingInvoiceId:j.runningActionId}}),H),y=b==="Completed";return r.useEffect((()=>{const I=setTimeout((()=>d(a)),300);return()=>clearTimeout(I)}),[a]),r.useEffect((()=>{i&&t(Ie({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(g.search!==f||u?.field!==h?.field||u?.dir!==h?.dir)&&t(Ie({cacheOverride:!0,filters:g,sort:u}))}),[i,t,g,u,f,h]),N(b)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingInvoicesListPage,isReady:y}),s.jsx(Pa,{navigate:e,tenantEmailDomain:n,activeStatus:S,searchValue:a,sortState:l,filters:g,sort:u,nextCursor:D,voidingInvoiceId:k,onSearchChange:o,onStatusChange:I=>{t(Mi(I)),t(Ie({cacheOverride:!1,filters:g,sort:u}))},onSortChange:v})]})}function rn(){const t=P(),e=L(),{tenantEmailDomain:n}=R(),i=Tt(),a=mn(),[o,c]=r.useState(!1),{acceptTermsState:d,status:l}=C(_n),v=Ni(i?.loggedInUserRoleMap),u=`/${n}/invoicing`,g=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(Mo,{isAppContentDrawerOpen:o,handleDrawerToggle:g}),s.jsx(_t,{analytics:p,isAccepting:d.fetchState==="In-Progress",isReadOnlyUser:!v,meetingUrl:a("invoicing_promo"),onAcceptClick:()=>{t(Ui())},onBackClick:()=>{e(`/${n}`)},onClickMenuIcon:()=>{g(!0)}})]})}const Aa=O((function(t,e){const n=On(t,e.invoiceId),{invoice:i,localData:a,reasonCodeOptions:o,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:a,reasonCodeOptions:o,typeOptions:d}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing/invoices/${encodeURIComponent(e.invoiceId)}`,i=()=>e.navigate(n);return{onBack:i,onCancel:i,onChange:a=>{t(zi({localData:a}))},onSubmit:()=>{p.trackInvoicingActionClick(m.Event.invoicingCreditNoteIssued,{invoiceId:e.invoiceId}),t(qi())}}}))(Ot);function $a(){const t=P(),e=L(),{invoice_id:n,tenantEmailDomain:i}=R(),{areTenantIdsInSync:a}=T(),{fetchState:o,invoice:c,isPageReady:d,issuedCreditNoteId:l,submitState:v}=C((f=>On(f,n??""))),u=`/${i}/invoicing`,g=r.useRef(null);r.useEffect((()=>{t(Bi()),g.current=null}),[t,n]),r.useEffect((()=>{a&&n!=null&&t(Ne({invoiceId:n}))}),[a,t,n]),r.useEffect((()=>{c!=null&&n!=null&&o==="Completed"&&g.current!==n&&(g.current=n,t(Vi({localData:Hi(c)})))}),[t,o,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($,{event:m.Event.invoicingInvoiceDetailPage,isReady:d}),s.jsx(Aa,{invoiceId:n??"",navigate:e,tenantEmailDomain:i})]})}const wa=O((function(t){return{invoicingOverview:Mn(t)}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{onRefresh:()=>{t(Nn(e.selectedPeriod,!0))},onSubscriptionClick:i=>{p.trackInvoicingActionClick(m.Event.invoicingSubscriptionTileClicked,{subscriptionId:i}),e.navigate(`${n}/subscriptions/${i}`)},onViewInvoices:()=>{p.trackInvoicingActionClick(m.Event.invoicingViewInvoicesClicked),e.navigate(`${n}/invoices`)},onViewPayments:()=>{p.trackInvoicingActionClick(m.Event.invoicingViewPaymentsClicked),e.navigate(`${n}/payments`)}}}))(Mt);function Fa(){const t=P(),e=L(),{tenantEmailDomain:n}=R(),{areTenantIdsInSync:i}=T(),[a]=r.useState((()=>{const c=new Date;return{month:c.getMonth()+1,year:c.getFullYear()}})),o=C((c=>Mn(c).fetchState))==="Completed";return r.useEffect((()=>{i&&t(Nn(a))}),[i,t,a]),s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingOverviewPage,isReady:o}),s.jsx(wa,{navigate:e,selectedPeriod:a,tenantEmailDomain:n})]})}const Ra=O((function(t){const e=Un(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(m.Event.invoicingImportCsvClicked,{entity:"payments"}),e.navigate(`${n}/data_import`)},onTransactionClick:i=>{p.trackInvoicingActionClick(m.Event.invoicingPaymentRowClicked,{transactionId:i}),e.navigate(`${n}/payments/${encodeURIComponent(i)}`)},onLoadMore:()=>{e.nextCursor!=null&&t(Qi({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(Nt);function Ta(){const t=P(),e=L(),{tenantEmailDomain:n}=R(),{areTenantIdsInSync:i}=T(),[a,o]=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]),g=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),{activeType:S,appliedSearch:f,appliedSort:h,nextCursor:D,transactionListFetchState:b,transactions:k}=C((w=>{const A=Un(w);return{activeType:A.activeTab,appliedSearch:A.filters.search,appliedSort:A.sort,nextCursor:A.nextCursor,transactionListFetchState:A.fetchState,transactions:A.transactions}}),H),y=b==="Completed",I=`/${n}/invoicing`,j=r.useCallback((w=>{const A=k.find((_=>_.id===w)),U=A?.linkedInvoices?.[0]?.invoiceID??A?.invoiceID;U!=null&&(p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{fromScreen:"payments_list",invoiceId:U,toScreen:"invoice"}),e(`${I}/invoices/${encodeURIComponent(U)}`))}),[e,I,k]),E=r.useCallback((w=>{const A=k.find((U=>U.id===w))?.customerID;A!=null&&(p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{customerId:A,fromScreen:"payments_list",toScreen:"customer"}),e(`${I}/customers/${encodeURIComponent(A)}`))}),[e,I,k]);return r.useEffect((()=>{const w=setTimeout((()=>d(a)),300);return()=>clearTimeout(w)}),[a]),r.useEffect((()=>{i&&t(Ce({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(g.search!==f||u?.field!==h?.field||u?.dir!==h?.dir)&&t(Ce({cacheOverride:!0,filters:g,sort:u}))}),[i,t,g,u,f,h]),N(b)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingPaymentsListPage,isReady:y}),s.jsx(Ra,{navigate:e,tenantEmailDomain:n,activeType:S,searchValue:a,sortState:l,filters:g,sort:u,nextCursor:D,onSearchChange:o,onTypeChange:w=>{t(Zi(w)),t(Ce({cacheOverride:!1,filters:g,sort:u}))},onSortChange:v,onViewTransactionCustomer:E,onViewTransactionInvoice:j})]})}const _a=t=>{const e=[t.firstName,t.lastName].filter((n=>n!=null&&n.trim()!=="")).join(" ").trim();return(t.company!=null&&t.company.trim()!==""?t.company.trim():"")||e||(t.email!=null&&t.email.trim()!==""?t.email.trim():"")||t.id};function ln(){const t=P(),e=L(),{invoice_id:n,tenantEmailDomain:i}=R(),{areTenantIdsInSync:a}=T(),o=n!=null&&n!=="",c=C(ve),d=C((E=>Ki(E))),l=C(Gi),v=C((E=>Fn(E,n??""))),u=v.invoice,g=`/${i}/invoicing`,S=r.useRef(null),f=r.useRef("");r.useEffect((()=>{t(Wi()),S.current=null,f.current=""}),[t,n]),r.useEffect((()=>{a&&t(o&&n!=null?Ne({invoiceId:n}):jn({filters:{},keepExistingListItems:!1}))}),[a,t,n,o]),r.useEffect((()=>{o&&u!=null&&n!=null&&v.fetchState==="Completed"&&S.current!==n&&(S.current=n,t(Yi({contextInvoiceId:n,localData:Ji(u)})))}),[t,u,n,v.fetchState,o]),r.useEffect((()=>{if(o)return;const E=d.localData.customerId;E!==""&&E!==f.current&&(f.current=E,t(Tn({filters:{customerId:E},keepExistingListItems:!1})),d.localData.invoiceToLink!==""&&t(nn({localData:{...d.localData,customerId:E,invoiceToLink:""}})))}),[t,d.localData,o]);const h=r.useRef(l.fetchState);r.useEffect((()=>{const E=h.current;if(h.current=l.fetchState,E!=="Completed"&&l.fetchState==="Completed"){if(l.recordedInvoiceId!=null)return void e(`${g}/invoices/${encodeURIComponent(l.recordedInvoiceId)}`);e(`${g}/payments`)}}),[e,l.fetchState,l.recordedInvoiceId,g]);const D=r.useMemo((()=>c.customers.map((E=>({id:E.id,name:_a(E)})))),[c.customers]),b=C((E=>Xi(E,d.localData.customerId))),k=r.useMemo((()=>b.map((E=>{return{amountDue:(w=E.amountDue,A=eo.currencySymbol,Bt("0,0.00",w,A)),amountDueValue:E.amountDue,id:E.id,label:E.invoiceNumber};var w,A}))),[b]),y=r.useMemo((()=>{if(!o||u==null)return;const E=u.currencyCode??"USD",w=u.amountDue?.amount??0;return{amountDue:$e("0,0.00",u.amountDue),amountDueValue:w,currencyCode:E,customerName:u.customerName??u.customerID,invoiceId:u.id,invoiceNumber:u.invoiceNumber??u.id}}),[u,o]),I=o?`${g}/invoices/${encodeURIComponent(n??"")}`:`${g}/payments`,j=!o||v.fetchState==="Completed"&&d.localData.invoiceToLink!=="";return s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingRecordPaymentPage,isReady:j}),s.jsx(Ut,{customers:D,fieldHelp:d.fieldHelp,errorMessage:l.fetchState==="Error"?l.error?.message??"Failed to record payment. Please try again.":void 0,gatewayOptions:d.gatewayOptions,invoiceContext:y,invoiceOptions:k,isSubmitting:l.fetchState==="In-Progress",localData:d.localData,mode:o?"invoice":"customer",paymentMethodOptions:d.paymentMethodOptions,onBack:()=>{e(I)},onCancel:()=>{p.trackInvoicingActionClick(m.Event.invoicingRecordPaymentCancelled),e(I)},onChange:E=>{t(nn({localData:E}))},onSubmit:()=>{p.trackInvoicingActionClick(m.Event.invoicingPaymentRecorded,{customerId:d.localData.customerId,invoiceId:o?n:d.localData.invoiceToLink,paymentMethod:d.localData.paymentMethod}),t(no(o?n??void 0:void 0))}})]})}const et=(t,e,n)=>{const i=`/${t}/invoicing/subscriptions/`;return n!=null?`${i}${encodeURIComponent(n)}/${e}/`:`${i}new/${e}/`},Oa=(t,e)=>{if(t==null)return;const n=$e("0,0",t);return e!=null?`${n}/${e}`:n},nt=(t,e,n)=>{const i=[t,Oa(e,n)].filter((a=>a!=null&&a!=="")).join(" · ");return i!==""?i:void 0},dn=t=>t.priceCode!=null&&t.priceCode.trim()!=="",Ma=t=>({billingCycles:t.billingCycles,billingPeriod:t.period,billingPeriodUnit:t.periodUnit,label:t.name??t.id,subtitle:nt(t.productCode,t.price,t.periodUnit),value:t.priceCode}),Na=t=>({label:t.name??t.couponCode??t.id,value:t.couponCode??t.id}),Ua=O((function(t,e){const{editView:n}=e,i=n.subscription,a=i?.status,o=a!=null&&e.commercialEditAllowedFromStatuses.includes(a);return{cancelReasonCodeOptions:n.cancelReasonCodeOptions,fieldHelp:n.fieldHelp,addons:n.products.filter((c=>c.itemType==="addon")).filter(dn).map((c=>({label:c.name??c.id,subtitle:nt(c.productCode,c.price,c.periodUnit),value:c.priceCode}))),canEditCommercial:o,coupons:n.coupons.map(Na),isLoading:!e.hasLoadedRecord&&(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(dn).map(Ma),shippingAddressLabel:n.shippingAddressLabel,hasUnsavedShippingAddress:n.hasUnsavedShippingAddress,subscription:i}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{subscriptionId:i}=e,a=i!=="",o=(c,d)=>{p.trackInvoicingActionClick(m.Event.invoicingSubscriptionLifecycleAction,{action:c,subscriptionId:i}),t(Vn({action:c,id:i,body:d}))};return{onBack:()=>e.navigate(`${n}/subscriptions`),onChange:c=>{t(de({id:i,localData:c}))},onChangeTermEnd:a?c=>{const d=c?.trim()??"";d!==""&&o("change_term_end",{term_ends_at:d})}:void 0,onCustomerClick:c=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{customerId:c,fromScreen:"subscription_detail",toScreen:"customer"}),window.open(`${n}/customers/${encodeURIComponent(c)}`,"_blank","noopener,noreferrer")},onDiscardEdit:()=>{t(Y(ue)),t(oo({id:i}))},onOpenAddress:()=>{const c=et(e.tenantEmailDomain??"",ue,i),d=W(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(c,{state:{pathnameStackToGoBack:d}})},onViewInvoices:()=>e.navigate(`${n}/invoices`),onSaveEdit:c=>{p.trackInvoicingActionClick(m.Event.invoicingSubscriptionEdited,{subscriptionId:i}),t(de({id:i,localData:c})),t(Bn({id:i}))},onCancelSubscription:a?c=>{o("cancel",{cancel_reason_code:c.cancelReasonCode,end_of_term:!1,...c.cancelReason!=null&&c.cancelReason.trim()!==""?{cancel_reason:c.cancelReason.trim()}:{}})}:void 0,onLifecycleAction:a?(c,d)=>{c!=="pause"?o(c):o(c,d!=null&&d.trim()!==""?{resume_date:d.trim()}:void 0)}:void 0}}))(Vt);function Ba(){const t=P(),e=L(),n=G(),{subscription_id:i,tenantEmailDomain:a}=R(),{areTenantIdsInSync:o}=T(),c=C((k=>Ue(k,i))),{subscriptionCommercialEditAllowedFromStatuses:d,subscriptionLifecycleActionOptions:l,subscriptionMetadataEditAllowedFromStatuses:v}=c,u=c.pageFetchState.fetchState,g=u==="Completed",[S,f]=r.useState(g?i:void 0);r.useEffect((()=>{i!=null&&g&&f(i)}),[i,g]);const h=S===i;pe(o),r.useEffect((()=>{o&&i!=null&&t(to({id:i}))}),[o,i,t]);const D=r.useCallback((k=>t(io({id:k}))),[t]),b=fe(c.fetchState,c.isFormLoading,i,D);return N(u)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingSubscriptionDetailPage,isReady:g}),s.jsx(Ua,{hasLoadedRecord:h,commercialEditAllowedFromStatuses:d,editView:c,lifecycleActionOptions:l,location:n,metadataEditAllowedFromStatuses:v,navigate:e,subscriptionId:i??"",tenantEmailDomain:a},b)]})}const Va=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},Ha=(t,e)=>{if(t==null)return;const n=$e("0,0",t);return e!=null?`${n}/${e}`:n},Ae=(t,e,n)=>{const i=[t,Ha(e,n)].filter((a=>a!=null&&a!=="")).join(" · ");return i!==""?i:void 0},qa=t=>({label:Va(t),value:t.id}),ke=t=>t.priceCode!=null&&t.priceCode.trim()!=="",za=t=>({billingCycles:t.billingCycles,billingPeriod:t.period,billingPeriodUnit:t.periodUnit,label:t.name??t.id,subtitle:Ae(t.productCode,t.price,t.periodUnit),trialPeriod:t.trialPeriod,trialPeriodUnit:t.trialPeriodUnit,value:t.priceCode}),Za=t=>({label:t.name??t.couponCode??t.id,value:t.couponCode??t.id}),Qa=O((function(t,e){const n=Ue(t,e.subscriptionId);return{fieldHelp:n.fieldHelp,addons:n.products.filter((i=>i.itemType==="addon")).filter(ke).map((i=>({label:i.name??i.id,subtitle:Ae(i.productCode,i.price,i.periodUnit),value:i.priceCode}))),charges:n.products.filter((i=>i.itemType==="charge")).filter(ke).map((i=>({label:i.name??i.id,subtitle:Ae(i.productCode,i.price,void 0),value:i.priceCode}))),coupons:n.coupons.map(Za),customers:n.customers.map(qa),errorMessage:n.fetchState==="Error"?n.error?.message??"Failed to save subscription.":void 0,isSubmitting:n.fetchState==="In-Progress",isLoading:n.isFormLoading,localData:n.localData,mode:n.mode,plans:n.plans.filter(ke).map(za),shippingAddressLabel:n.shippingAddressLabel}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{subscriptionId:i}=e,a=i!=null?"edit":"create";return{onCancel:()=>{p.trackInvoicingActionClick(m.Event.invoicingSubscriptionFormCancelled),t(Hn({id:i})),t(Y(ue)),i==null?e.navigate(`${n}/subscriptions`):e.navigate(`${n}/subscriptions/${encodeURIComponent(i)}`)},onChange:o=>{t(de({id:i,localData:o}))},onOpenAddress:()=>{const o=et(e.tenantEmailDomain??"",ue,i),c=W(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(o,{state:{pathnameStackToGoBack:c}})},onSubmit:()=>{p.trackInvoicingActionClick(m.Event.invoicingSubscriptionSaved,{mode:a}),t(Bn({id:i}))}}}))(Ht);function Ka(){const t=P(),e=L(),n=G(),{subscription_id:i,tenantEmailDomain:a}=R(),[o]=K(),{areTenantIdsInSync:c}=T(),d=o.get("customerId"),{fetchState:l,savedSubscriptionId:v}=C((S=>ao(S,i))),u=C((S=>Ue(S,i).localData));pe(c),r.useEffect((()=>{c&&t(so({subscriptionId:i}))}),[c,i,t]);const g=r.useRef(!1);return r.useEffect((()=>{g.current||i!=null||d==null||d===""||u.customerId!==""||(g.current=!0,t(de({id:i,localData:{...u,customerId:d}})))}),[d,i,u,t]),r.useEffect((()=>{if(l==="Completed"){const S=v??i,f=S!=null?`/${a}/invoicing/subscriptions/${encodeURIComponent(S)}`:`/${a}/invoicing/subscriptions`;e(f),t(Hn({id:i}))}}),[l,v,i,t,e,a]),s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingSubscriptionFormPage}),s.jsx(Qa,{location:n,navigate:e,subscriptionId:i,tenantEmailDomain:a})]})}const Ga=O((function(t){const e=qn(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=(a,o,c)=>{p.trackInvoicingActionClick(m.Event.invoicingSubscriptionLifecycleAction,{action:o,subscriptionId:a}),t(Vn({action:o,id:a,body:c}))};return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onStatusChange:e.onStatusChange,onAddSubscription:()=>{p.trackInvoicingActionClick(m.Event.invoicingAddSubscriptionClicked),e.navigate(`${n}/subscriptions/new`)},onImportCsv:()=>{p.trackInvoicingActionClick(m.Event.invoicingImportCsvClicked,{entity:"subscriptions"}),e.navigate(`${n}/data_import`)},onChangeTermEnd:(a,o)=>{const c=o?.trim()??"";c!==""&&i(a,"change_term_end",{term_ends_at:c})},onSubscriptionAction:(a,o,c)=>{o!=="pause"?i(a,o):i(a,o,c!=null&&c.trim()!==""?{resume_date:c.trim()}:void 0)},onCancelSubscription:(a,o)=>{i(a,"cancel",{cancel_reason_code:o.cancelReasonCode,end_of_term:!1,...o.cancelReason!=null&&o.cancelReason.trim()!==""?{cancel_reason:o.cancelReason.trim()}:{}})},onSubscriptionClick:a=>{p.trackInvoicingActionClick(m.Event.invoicingSubscriptionRowClicked,{subscriptionId:a}),e.navigate(`${n}/subscriptions/${encodeURIComponent(a)}`)},onViewSubscriptionInvoices:()=>{e.navigate(`${n}/invoices`)},onLoadMore:()=>{e.nextCursor!=null&&t(lo({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(qt);function Wa(){const t=P(),e=L(),{tenantEmailDomain:n}=R(),{areTenantIdsInSync:i}=T(),[a,o]=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]),g=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),{activeStatus:S,appliedSearch:f,appliedSort:h,nextCursor:D,subscriptionListFetchState:b,runningActionSubscriptionId:k}=C((j=>{const E=qn(j);return{activeStatus:E.activeTab,appliedSearch:E.filters.search,appliedSort:E.sort,nextCursor:E.nextCursor,subscriptionListFetchState:E.fetchState,runningActionSubscriptionId:E.runningActionId??null}}),H),y=b==="Completed";r.useEffect((()=>{const j=setTimeout((()=>d(a)),300);return()=>clearTimeout(j)}),[a]),r.useEffect((()=>{i&&t(tn({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(g.search!==f||u?.field!==h?.field||u?.dir!==h?.dir)&&t(tn({cacheOverride:!0,filters:g,sort:u}))}),[i,t,g,u,f,h]);const I=r.useRef(k);return r.useEffect((()=>{const j=I.current!=null&&k==null;I.current=k,j&&i&&t(co())}),[k,i,t]),N(b)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingSubscriptionsListPage,isReady:y}),s.jsx(Ga,{navigate:e,tenantEmailDomain:n,activeStatus:S,searchValue:a,sortState:l,filters:g,sort:u,nextCursor:D,runningActionSubscriptionId:k,onSearchChange:o,onStatusChange:j=>t(ro(j)),onSortChange:v})]})}const Ya=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:a=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{customerId:a,fromScreen:"transaction_detail",toScreen:"customer"}),e.navigate(`${n}/customers/${encodeURIComponent(a)}`)},onInvoiceClick:a=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{fromScreen:"transaction_detail",invoiceId:a,toScreen:"invoice"}),e.navigate(`${n}/invoices/${encodeURIComponent(a)}`)},onSubscriptionClick:a=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{fromScreen:"transaction_detail",subscriptionId:a,toScreen:"subscription"}),e.navigate(`${n}/subscriptions/${encodeURIComponent(a)}`)},onCapture:i!==""?()=>{p.trackInvoicingActionClick(m.Event.invoicingTransactionCaptured,{transactionId:i}),t(mo({action:"capture",id:i}))}:void 0}}))(zt);function Ja(){const t=P(),e=L(),{tenantEmailDomain:n,transaction_id:i}=R(),{areTenantIdsInSync:a}=T(),o=C((d=>uo(d,i??""))),c=o.fetchState==="Completed";return r.useEffect((()=>{a&&i!=null&&t(go({id:i}))}),[a,i,t]),N(o.fetchState)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingTransactionDetailPage,isReady:c}),s.jsx(Ya,{navigate:e,tenantEmailDomain:n,transactionId:i??"",readView:o})]})}function tt(t={}){const{enabled:e=!0,fetchSyncHealth:n=!1,loadAccountingPickers:i=!1,reuseCached:a=!1}=t,o=P(),{areTenantIdsInSync:c}=T(),d=C(Be),l=d.connection?.connected===!0,v=d.connectionFetchState.fetchState;return r.useEffect((()=>{e&&c&&(a&&v!=="Not-Started"||o(zn()),n&&o(vo()))}),[c,o,e,n,a]),r.useEffect((()=>{e&&c&&l&&i&&o(po())}),[c,o,e,l,i]),{isQboConnected:l,qboView:d}}const Xa={branding:"invoicing_branding_save",dunning:"invoicing_dunning_settings_save",quickbooks:"invoicing_qbo_settings_save"};function J(t){const e=P(),{areTenantIdsInSync:n}=T(),{tenantEmailDomain:i}=R(),{fetchState:a,fieldHelp:o,logoFile:c,saveState:d,settings:l,stripeConnectState:v}=C(fo),{configError:u,configFetchState:g,dunningScheduleActionOptions:S,qboAccountMappingKindOptions:f,qboCustomerMatchingOptions:h,qboSyncStatusOptions:D}=C(Zn),b=C(Be);tt({enabled:t==="quickbooks",fetchSyncHealth:!0,loadAccountingPickers:!0});const k=C(Oe),y=t==="dunning"||t==="quickbooks",I=k.companyId??ye.getSignedInUserTenant(i??"")?.companyId,j=C((F=>Ln(F,I))),E=So(k.userRole??[]),w=k.tenantId??"",A=ye.getSignedInUser(),U={userId:A?.userId??"",sessionId:A?.zeniSessionId??"",tenantId:w},_=c?.fileId,X=C((F=>_!=null&&_!==""?ho(F,_):void 0)),Ve=C((F=>_!=null&&_!==""?Io(F,_):void 0)),it=_!=null&&_!==""&&X!=null?{[_]:X}:{},ot=_!=null&&_!==""&&Ve!=null?{[_]:Ve}:{};r.useEffect((()=>(e(on()),()=>{e(on())})),[e]),r.useEffect((()=>{n&&(a!=="Not-Started"&&a!=="Error"||e(Me()))}),[n,e,a]),r.useEffect((()=>{n&&y&&g==="Not-Started"&&e(ge())}),[n,e,g,y]),r.useEffect((()=>{if(!n)return;const F=A?.userId;F!=null&&F!==""&&w!==""&&ze.shouldFetchActiveTenant(w)&&(ze.markActiveTenantFetchStarted(w),e(Co(F,w,A?.zeniSessionId)))}),[n,e,A?.userId,A?.zeniSessionId,w]);const at=S.length>0||f.length>0,st=a==="Not-Started"||a==="In-Progress"&&l==null||y&&!at&&(g==="Not-Started"||g==="In-Progress"),ct=a==="Completed"&&(!y||g==="Completed"),He=j.externalConnections?.revenue?.find((F=>F.connectionName==="chargebee"))?.connectionId,Se=ae?.invoicingMicroServiceBaseUrl,qe=Se!=null&&Se.length>0?`${Se}/1.0/webhooks/stripe`:"",he={deleteConnectionError:j.externalConnections?.deleteConnectionError?.message,deleteConnectionState:j.externalConnections?.deleteConnectionState??"Not-Started",integrationsView:j,isAdmin:E,isStripeBusy:v.fetchState==="In-Progress",onConnectStripe:F=>e(sn(F)),onDisconnect:(F,z)=>{w!==""&&e(Do(w,F,cn(z)))},onDisconnectStripe:()=>e(an()),onReconnectQBO:()=>{const F=k.tenantEmailDomain??i??"";me.init("/connection/auth",F),me.handleClick()},onRefreshQBO:()=>{j.integrations.refreshQBO.fetchState!=="In-Progress"&&e(Gn())},onSaveChargeBeeCredentials:(F,z)=>{He!=null&&w!==""&&e(bo(w,He,cn("revenue"),jo("chargebee"),{api_key:F,site:z}))},saveChargeBeeError:j.externalConnections?.saveAPIKeyConnectionError?.message,saveChargeBeeState:j.externalConnections?.saveAPIKeyConnectionState??"Not-Started",settings:l,stripeError:v.fetchState==="Error"?v.error?.message??"Failed to connect Stripe. Check your keys and try again.":void 0,stripeWebhookUrl:qe};return{authParams:U,deleteFileStatusById:it,fieldHelp:o,dunningScheduleActionOptions:S,filesEndPoint:ae?.fileMicroServiceBaseUrl??"",integrationsSectionProps:he,isInvoicingPageReady:ct,isLoading:st,isSaving:d.fetchState==="In-Progress",isStripeBusy:v.fetchState==="In-Progress",logoFile:c,qboAccountMappingKindOptions:f,qboCustomerMatchingOptions:h,qboSyncStatusOptions:D,qboView:b,saveErrorMessage:d.fetchState==="Error"?d.error?.message??"Failed to save settings.":y&&g==="Error"?u?.message??"Failed to load invoicing configuration.":void 0,settings:l,stripeError:v.fetchState==="Error"?v.error?.message??"Failed to connect Stripe. Check your keys and try again.":void 0,stripeWebhookUrl:qe,updateFileStatusById:ot,onConnectStripe:F=>e(sn(F)),onDeleteFile:F=>e(xo(F,w)),onDisconnectStripe:()=>e(an()),onEditFileName:(F,z)=>e(yo(F,z,w)),onReconnectQBO:he.onReconnectQBO,onRefreshQBO:he.onRefreshQBO,onRetryQboSyncTask:F=>e(Kn(F)),onSave:F=>{p.trackInvoicingActionClick(m.Event.invoicingSettingsSaved,{tab:t??"hub"}),e(ko({settings:F,snackbarSection:Xa[t??""]}))},onStartQboBackfill:F=>e(Qn(F)),updateFilesEntity:F=>{p.trackInvoicingActionClick(m.Event.invoicingLogoUploaded),e(Eo({files:F}))}}}function un({appContent:t}){const e=L(),n=G(),i=P(),{tenantEmailDomain:a}=R(),o=J("branding"),c=C((v=>Po(v))),d=C((v=>Lo(Ee,v)?.addressToCreate));r.useEffect((()=>{c.saveState.fetchState==="Completed"&&(i(Ao()),i(Y(Ee)))}),[c.saveState.fetchState,i]);const l=vn(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($,{event:m.Event.invoicingSettingsPage,isReady:o.isInvoicingPageReady}),s.jsx(Zt,{address:d,fieldHelp:c.fieldHelp,addressLabel:c.addressLabel,appContent:t,authParams:o.authParams,dateFormatOptions:c.dateFormatOptions,deleteFileStatusById:o.deleteFileStatusById,filesEndPoint:o.filesEndPoint,isLoading:o.isLoading,isSaving:o.isSaving,localData:c.localData,logoFile:o.logoFile,saveErrorMessage:o.saveErrorMessage,settings:o.settings,updateFileStatusById:o.updateFileStatusById,onBackClick:()=>e(".."),onChange:v=>{i(wo({localData:v}))},onDeleteFile:o.onDeleteFile,onEditFileName:o.onEditFileName,onOpenAddress:()=>{const v=`/${a}/invoicing/settings/branding/${Ee}/`,u=W(n.state?.pathnameStackToGoBack,n.pathname);e(v,{state:{pathnameStackToGoBack:u}})},onSubmit:()=>i($o()),updateFilesEntity:o.updateFilesEntity})]})}function es(){const t=L(),e=J("dunning");return s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingSettingsPage,isReady:e.isInvoicingPageReady}),s.jsx(Qt,{dunningScheduleActionOptions:e.dunningScheduleActionOptions,isLoading:e.isLoading,isSaving:e.isSaving,saveErrorMessage:e.saveErrorMessage,settings:e.settings,onBackClick:()=>t(".."),onSave:e.onSave})]})}function ns(){const t=L(),e=J("integrations");return s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingSettingsPage,isReady:e.isInvoicingPageReady}),s.jsx(Kt,{integrationsSectionProps:{...e.integrationsSectionProps,onConfigureQBO:()=>t("../quickbooks"),onOpenPaymentDestination:()=>t("../payment-destination")},isLoading:e.isLoading,onBackClick:()=>t("..")})]})}function ts(){const t=L(),e=J("payment-destination");return s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.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 is=O((function(t){const e=Wn(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(To({localData:e}))},onReset:()=>{t(Ro())},onRetryTask:e=>{t(Kn(e))},onSave:()=>{p.trackInvoicingActionClick(m.Event.invoicingSettingsSaved,{tab:"quickbooks"}),t(Fo())},onStartBackfill:e=>{t(Qn(e))}}}))(Wt);function os(){const t=P(),e=L(),{tenantEmailDomain:n}=R(),i=C(Oe),{configFetchState:a,settingsFetchState:o}=C(Wn);return r.useEffect((()=>{o!=="Not-Started"&&o!=="Error"||t(Me())}),[t,o]),r.useEffect((()=>{a==="Not-Started"&&t(ge())}),[a,t]),tt({fetchSyncHealth:!0,loadAccountingPickers:!0}),s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingSettingsPage}),s.jsx(is,{onBackClick:()=>e(".."),onReconnect:()=>{me.init("/connection/auth",i.tenantEmailDomain??n??""),me.handleClick()},onRefresh:()=>t(Gn())})]})}const as={"payment-destination":"payment-destination",general:"branding",integrations:null,dunning:"dunning"};function ss(){const t=mn(),e=P(),n=L(),[i,a]=K(),o=J(),{canEnableInvoicing:c,isEnablingInvoicing:d,isInvoicingEnabled:l,isQboConfigured:v,isStripeConnected:u}=C(Zn),g=i.get("tab");return r.useEffect((()=>{if(g==null)return;const S=as[g];a({},{replace:!0}),S!=null&&n(S,{replace:!0})}),[g,n,a]),s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingSettingsPage,isReady:o.isInvoicingPageReady}),s.jsx(Yt,{analytics:p,integrationsSectionProps:{...o.integrationsSectionProps,onConfigureQBO:()=>n("quickbooks"),onOpenPaymentDestination:()=>n("payment-destination")},isEnablingInvoicing:d,isLoading:o.isLoading,meetingUrl:t("invoicing_settings"),settings:o.settings,onBrandingClick:()=>n("branding"),onDunningClick:()=>n("dunning"),canEnableInvoicing:c,isQboConfigured:v,isStripePaymentsReady:u,onEnableInvoicingClick:l?void 0:()=>{e(_o())}})]})}function gn(){return s.jsxs(te,{children:[s.jsx(x,{index:!0,element:s.jsx(ss,{})}),s.jsx(x,{path:"payment-destination",element:s.jsx(ts,{})}),s.jsx(x,{path:"branding",element:s.jsx(un,{})}),s.jsx(x,{path:"branding/:addressType",element:s.jsx(un,{appContent:s.jsx(Z,{isSubPage:!0,hideAddressBackButton:!0})})}),s.jsx(x,{path:"integrations",element:s.jsx(ns,{})}),s.jsx(x,{path:"dunning",element:s.jsx(es,{})}),s.jsx(x,{path:"quickbooks",element:s.jsx(os,{})}),s.jsx(x,{path:"*",element:s.jsx(B,{to:"..",replace:!0})})]})}function Rs(){const t=P(),e=L(),{tenantEmailDomain:n}=R(),{areTenantIdsInSync:i}=T(),{enableState:a,fetchState:o,status:c}=C(_n),d=vn(a.fetchState),l=`/${n}/invoicing`,v=r.useRef(!1),u=C((g=>Be(g).connectionFetchState.fetchState));return r.useEffect((()=>{i&&(o!=="Not-Started"?o!=="Error"||v.current||(v.current=!0,t(ge({cacheOverride:!1}))):t(ge({cacheOverride:!1})))}),[i,t,o]),r.useEffect((()=>{i&&u==="Not-Started"&&t(zn())}),[i,t,u]),r.useEffect((()=>{d==="In-Progress"&&a.fetchState==="Completed"&&(e(`${l}/catalog`),t(Oo()))}),[d,a.fetchState,l,t,e]),c==null&&o!=="Error"?s.jsx(Jt,{fetchState:"In-Progress"}):c==="not_started"?s.jsxs(te,{children:[s.jsx(x,{path:"promo",element:s.jsx(rn,{})}),s.jsx(x,{path:"*",element:s.jsx(B,{to:`${l}/promo`,replace:!0})})]}):c==="settings"?s.jsxs(te,{children:[s.jsx(x,{path:"promo",element:s.jsx(rn,{})}),s.jsx(x,{path:"settings/*",element:s.jsx(gn,{})}),s.jsx(x,{path:"*",element:s.jsx(B,{to:`${l}/settings`,replace:!0})})]}):s.jsxs(te,{children:[s.jsx(x,{path:"/",element:s.jsx(B,{to:"overview",replace:!0})}),s.jsx(x,{path:"overview",element:s.jsx(Fa,{})}),s.jsx(x,{path:"promo",element:s.jsx(B,{to:`${l}/overview`,replace:!0})}),s.jsx(x,{path:"customers",element:s.jsx(ua,{})}),s.jsx(x,{path:"customers/new",element:s.jsx(la,{})}),s.jsx(x,{path:"customers/new/:addressType",element:s.jsx(Z,{})}),s.jsx(x,{path:"customers/:customer_id",element:s.jsx(ca,{})}),s.jsx(x,{path:"customers/:customer_id/:addressType",element:s.jsx(Z,{})}),s.jsx(x,{path:"subscriptions",element:s.jsx(Wa,{})}),s.jsx(x,{path:"subscriptions/new",element:s.jsx(Ka,{})}),s.jsx(x,{path:"subscriptions/new/:addressType",element:s.jsx(Z,{})}),s.jsx(x,{path:"subscriptions/:subscription_id",element:s.jsx(Ba,{})}),s.jsx(x,{path:"subscriptions/:subscription_id/:addressType",element:s.jsx(Z,{})}),s.jsx(x,{path:"invoices",element:s.jsx(La,{})}),s.jsx(x,{path:"invoices/create",element:s.jsx(na,{})}),s.jsx(x,{path:"invoices/:invoice_id",element:s.jsx(Da,{})}),s.jsx(x,{path:"invoices/:invoice_id/record-payment",element:s.jsx(ln,{})}),s.jsx(x,{path:"invoices/:invoice_id/issue-credit-note",element:s.jsx($a,{})}),s.jsx(x,{path:"payments",element:s.jsx(Ta,{})}),s.jsx(x,{path:"payments/record",element:s.jsx(ln,{})}),s.jsx(x,{path:"payments/:transaction_id",element:s.jsx(Ja,{})}),s.jsx(x,{path:"credits",element:s.jsx(aa,{})}),s.jsx(x,{path:"credits/:credit_note_id",element:s.jsx(ia,{})}),s.jsx(x,{path:"discounts",element:s.jsx(Ea,{})}),s.jsx(x,{path:"discounts/new",element:s.jsx(Xo,{})}),s.jsx(x,{path:"discounts/:coupon_id",element:s.jsx(Ia,{})}),s.jsx(x,{path:"dunning",element:s.jsx(ba,{})}),s.jsx(x,{path:"dunning/:case_id",element:s.jsx(ya,{})}),s.jsx(x,{path:"catalog",element:s.jsx(Yo,{})}),s.jsx(x,{path:"catalog/new",element:s.jsx(Ko,{})}),s.jsx(x,{path:"catalog/:item_id",element:s.jsx(qo,{})}),s.jsx(x,{path:"settings/*",element:s.jsx(gn,{})}),s.jsx(x,{path:"audit_log",element:s.jsx(No,{})}),s.jsx(x,{path:"data_import",element:s.jsx(pa,{})}),s.jsx(x,{path:"data_import/migrate",element:s.jsx(Sa,{})}),s.jsx(x,{path:"data_import/:sessionId",element:s.jsx(ma,{})}),s.jsx(x,{path:"*",element:s.jsx(M,{})})]})}export{Rs as default};
@@ -1 +0,0 @@
1
- import{j as e}from"./liveblocks-DJozFz1F.js";import{h as r,l as n}from"./core-DrG65cn7.js";import{an as i}from"./index-CNCkAPT0.js";import"./mui-DqsEgFea.js";import"./sentry-C1W0cBeR.js";import"./zeni-epic-state-1I_oueWp.js";import"./recharts-Bmrae78L.js";import"./analytics-EJdRN0EM.js";import"./plaid-KeCmRFX0.js";import"./dnd-ySxwrcGd.js";import"./stripe-cKAAJElX.js";import"./lottie-B54UhbRD.js";import"./lexical-DsG4GgCt.js";import"./pdf-0ccxH7eS.js";import"./utils-BYrZSa_o.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new o.Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="3be885cb-07f5-4896-9ae7-ddcb5a1e09f4",o._sentryDebugIdIdentifier="sentry-dbid-3be885cb-07f5-4896-9ae7-ddcb5a1e09f4")}catch{}})();const a=n(null,(function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}}))(i);function _(){const o=r();return e.jsx(a,{navigate:o})}export{_ as default};
@@ -1 +0,0 @@
1
- import{j as s}from"./liveblocks-DJozFz1F.js";import E from"./NotFoundScreen-DWq-K_Je.js";import{a as r}from"./sentry-C1W0cBeR.js";import{h as _,g as M,j as p,i as U,u as v,N as P,l as z,n as F,o as h}from"./core-DrG65cn7.js";import{fF as O,a0U as b,bo as B,bn as N,iL as V,gh as L}from"./zeni-epic-state-1I_oueWp.js";import{M as Q,z as I,at as $,dQ as q}from"./index-CNCkAPT0.js";import"./mui-DqsEgFea.js";import{u as G}from"./useAskAiCfoHostNavButtonProps-DDB7rJuC.js";import{M as H}from"./MobileAppDrawer-kvOHgs7K.js";import"./recharts-Bmrae78L.js";import"./analytics-EJdRN0EM.js";import"./plaid-KeCmRFX0.js";import"./dnd-ySxwrcGd.js";import"./stripe-cKAAJElX.js";import"./lottie-B54UhbRD.js";import"./lexical-DsG4GgCt.js";import"./pdf-0ccxH7eS.js";import"./utils-BYrZSa_o.js";import"./InboxNotificationsProvider-Dwt_tkdC.js";import"./useTaskManagerAccess-D96Us8rE.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]="ec54af9f-deb1-4e22-98ce-b08d1f11ec60",e._sentryDebugIdIdentifier="sentry-dbid-ec54af9f-deb1-4e22-98ce-b08d1f11ec60")}catch{}})();const J=z((function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}}),(function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}}))(q),K=()=>{const e=_(),t=M(),c=Q(),o=p((a=>O(a))),{aggregatedReportViewState:n}=p((a=>b(a))),{tenantEmailDomain:m}=U(),u=v(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const f=r.useRef(!1),[w,S]=r.useState(!1),C=B(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,x=N(l),y=C||k||x,d=r.useCallback(((a,i,T)=>{u(V({fromMonth:a,toMonth:i,cacheOverride:T}))}),[]);r.useEffect((()=>{n?.fetchState==="Completed"&&f.current&&(u(L({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),f.current=!1)}),[n?.fetchState]);const D=r.useCallback(((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||d(a,i,!0),f.current=!0}),[n?.fetchState,d]),j=r.useCallback(((a,i)=>{d(a,i,!1)}),[d]),g=a=>{S(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=G({mobileExploreReferrer:"Performance"});return $({isDataReady:n?.fetchState==="Completed"}),y?s.jsxs(s.Fragment,{children:[s.jsx(H,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(J,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:l,tenantEmailDomain:m,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(P,{to:`/${m}/dashboard`,replace:!0})};function he(){return s.jsxs(F,{children:[s.jsx(h,{path:"*",element:s.jsx(K,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{he as default};
@@ -1 +0,0 @@
1
- import{j as a}from"./liveblocks-DJozFz1F.js";import{z as b,a9 as N,k as u,S as k,e5 as D,c as E,A as I}from"./index-CNCkAPT0.js";import"./mui-DqsEgFea.js";import g from"./NotFoundScreen-DWq-K_Je.js";import{a as c}from"./sentry-C1W0cBeR.js";import{u as C,j as h,h as F,g as L,l as P,n as T,o as f,N as y}from"./core-DrG65cn7.js";import{fF as U,a1P as w,a1Q as p,DM as _,p$ as V,a1R as R,DK as z}from"./zeni-epic-state-1I_oueWp.js";import"./recharts-Bmrae78L.js";import"./analytics-EJdRN0EM.js";import"./plaid-KeCmRFX0.js";import"./dnd-ySxwrcGd.js";import"./stripe-cKAAJElX.js";import"./lottie-B54UhbRD.js";import"./lexical-DsG4GgCt.js";import"./pdf-0ccxH7eS.js";import"./utils-BYrZSa_o.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]="13e8dce2-8d33-463b-abfb-6837b2900f86",e._sentryDebugIdIdentifier="sentry-dbid-13e8dce2-8d33-463b-abfb-6837b2900f86")}catch{}})();const A=P((function(e,t){const n=w(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(z())},onUpdateInviteFormLocalData:s=>{e(R({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&u.trackInviteEmailClicked("cancel")}}}))(D),G=()=>{const e=C(),[t,n]=c.useState(!1),[i,s]=c.useState(!1),r=h((o=>U(o))),l=F(),j=L(),d=b.getSignedInUser();if(d==null)throw Error("Can't access invite referral screen without signing in...");const m=h((o=>w(o))),x=d?.firstName!=null?d.firstName:"User";c.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(_()),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(N,{analytics:u,onLoad:o=>(v=>v.trackPageLoaded(k.Event.inviteEmailViewed))(o)}):null,a.jsx(A,{navigate:l,location:j,currentTenant:r,companyName:S,userName:x,inviteFormCompayData:m.localData})]})};function ne(){const{useFeatureGate:e}=E(),{isFeatureEnabled:t}=e(I.isReferralFeatureEnabled);return a.jsxs(T,{children:[a.jsx(f,{path:"/",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"how-it-works",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"refer/*",element:t?a.jsx(G,{}):a.jsx(g,{})}),a.jsx(f,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
@@ -1,9 +0,0 @@
1
- import{j as r}from"./liveblocks-DJozFz1F.js";import ue from"./NotFoundScreen-DWq-K_Je.js";import{a as k}from"./sentry-C1W0cBeR.js";import{h as Y,u as ee,j as b,g as de,i as ke,N as pe,l as me,n as Se,o as E}from"./core-DrG65cn7.js";import{PU as ae,PX as fe,PR as Te,ZK as ge,fF as te,a1S as se,Qh as g,Q9 as T,PO as he,QN as Ee,QG as be,a1T as ne,gh as oe,a1U as Z,PK as Ie,PH as De,uT as Ce,uH as Ge,mz as _e,Q7 as Ue,a1V as Re,Q_ as ye,Q3 as Pe,Qs as xe,Qp as Be,P_ as we,Qm as Ae,Ql as ve}from"./zeni-epic-state-1I_oueWp.js";import{z as U,e6 as je,M as Fe,c as Le,A as G,a5 as ie,p as _,a9 as Ke,k as M,S as $e,e7 as Qe,_ as q,af as Ne}from"./index-CNCkAPT0.js";import{n as Oe}from"./mui-DqsEgFea.js";import{u as ze}from"./useInitialThreadRequest-DjzuWq5l.js";import{M as Ve}from"./MobileAppDrawer-kvOHgs7K.js";import{b as Ze,a as Me,u as qe,T as f,t as He,c as H,d as X,e as Xe}from"./TaskListScreen-Ddl4-pS2.js";import"./recharts-Bmrae78L.js";import"./analytics-EJdRN0EM.js";import"./plaid-KeCmRFX0.js";import"./dnd-ySxwrcGd.js";import"./stripe-cKAAJElX.js";import"./lottie-B54UhbRD.js";import"./lexical-DsG4GgCt.js";import"./pdf-0ccxH7eS.js";import"./utils-BYrZSa_o.js";import"./InboxNotificationsProvider-Dwt_tkdC.js";import"./useTaskManagerAccess-D96Us8rE.js";import"./useAskAiCfoHostNavButtonProps-DDB7rJuC.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]="3847cdc9-1b38-4909-99da-feae377001d2",e._sentryDebugIdIdentifier="sentry-dbid-3847cdc9-1b38-4909-99da-feae377001d2")}catch{}})();function Je(){const e=Y(),a=ee(),n=U.getSignedInUser(),{cannedResponses:c,fetchState:s,saveFetchState:u}=b((o=>o.cannedResponsesState)),d=k.useCallback((()=>{a(ae())}),[a]),m=k.useCallback(((o,I,D)=>{a(fe({name:o,content:I,cannedResponseId:D}))}),[a]),t=k.useCallback((o=>{a(Te({cannedResponseId:o}))}),[a]);if(n==null)throw Error("Can't access quick responses page without signing in...");return r.jsx(je,{cannedResponses:c,isLoading:s==="In-Progress"||s==="Not-Started",isSaving:u==="In-Progress",onBackClick:()=>e(-1),onDelete:t,onFetch:d,onSave:m})}const L=e=>e?.taskState?.taskByID,j=(e,a)=>{const n=L(e);if(a!=null&&n!=null)return n[a]?.parentTaskId??void 0},We=ge([j,(e,a)=>{const n=j(e,a),c=L(e);if(n!=null&&c!=null)return c[n]?.name},(e,a)=>{const n=j(e,a),c=L(e);return n!=null&&c!=null&&c[n]!=null}],((e,a,n)=>{if(e!=null&&n===!0)return{id:e,name:a??""}}));let J,W=[];const Ye=me((function(e,a){const{location:n,taskGroupId:c}=a,s=ne(e,a.taskId),u=te(e),d=We(e,a.taskId),m=s.taskGroupId??c,t=m!=null?Z(e.taskGroupState,m):void 0,o=U.getSignedInUser(),I=u.tenantId,D={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:I??""},x=se(e),{tenantEmailDomain:B}=u,R=s.recurringSourceTaskId,w=R!=null?`${q.appUrl}/${B}/tasks/${encodeURIComponent(R)}`:void 0;var h;return{taskDetailSelectorView:s,authParams:D,isZeniUser:U.isZeniUser(),userGroupList:((h=e.userGroupsState.userGroupByUserGroupId)!==J&&(J=h,W=Object.values(h)),W),isNewClicked:n.state?.message==="comingFromTaskListPage",filesEndPoint:Ne.fileMicroServiceBaseUrl,companyName:a.currentTenant.companyName,companyId:a.currentTenant.companyId,currentUrl:`${q.appUrl}${a.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:w,tagListView:x,taskGroupName:m!=null&&t!=null&&t.isDefault===!1?t.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map((S=>Z(e.taskGroupState,S))).filter((S=>S!=null&&!S.isDeleted)).map((S=>({id:S.id,name:S.name,isDefault:S.isDefault}))),subtasks:s.subtasks,parentTaskRef:d,subTaskCreateStatus:e.taskDetailState?.subTaskCreateStatus?.fetchState}}),(function(e,a){const{taskId:n,navigate:c,currentTenant:s,location:u,taskGroupId:d}=a,{tenantEmailDomain:m}=s;return{onSaveChangesToLocalStore:t=>{e(ve({taskDetailLocalData:t,taskId:n}))},onSaveDetailClick:t=>{e(Ae(n,t??d))},onArchiveTaskClick:()=>{a.taskId!=null&&e(we(a.taskId))},onSnoozeTask:(t,o)=>{e(Be(t,o))},onUnsnoozeTask:t=>{e(xe(t))},onCreateSubtask:(t,o)=>{e(Pe({...o,parentTaskId:t}))},onSubtaskUpdate:(t,o)=>{e(ye({task:t,updates:o}))},onShowToast:t=>{e(oe(t))},onSubtaskRowClick:t=>{c(`/${m}/tasks/${t}`,{state:{pathnameStackToGoBack:_(u.state?.pathnameStackToGoBack,u.pathname)}})},onParentBreadcrumbClick:t=>{c(`/${m}/tasks/${t}`,{state:{pathnameStackToGoBack:_(u.state?.pathnameStackToGoBack,u.pathname)}})},onDismissClick:()=>{if(u.state?.message==="triggerBackClick"){const t=ie(u.state?.pathnameStackToGoBack),o=t.poppedPathname??"../../dashboard";c(o,{state:{pathnameStackToGoBack:t.newStack}})}else{const t=P(m),o=_(u.state?.pathnameStackToGoBack,u.pathname);c(t,{state:{pathnameStackToGoBack:o}})}e(Re({taskId:n}))},onDeleteTaskClick:()=>{e(Ue(n))},updateFilesEntity:t=>{e(_e({files:t}))},onDeleteFile:t=>{e(Ge(t))},onEditFileName:(t,o)=>{e(Ce(t,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(g(!1,n))},onCreateTagClick:t=>{e(De(t,n))},onDeleteTagClick:t=>{e(Ie(t,n))},onFetchCannedResponses:()=>{e(ae())},onManageTemplatesClick:()=>{c(`/${s.tenantEmailDomain}/tasks/quick-responses`)}}}))(Qe);function F(){const e=Y(),a=ee(),n=de(),c=Fe(),{taskId:s,taskGroupId:u}=ke(),d=b((i=>te(i))),m=ze(d?.companyId),{useFeatureGate:t}=Le(),{isFeatureEnabled:o}=t(G.isTaskSnoozeEnabled),{isFeatureEnabled:I}=t(G.isTaskVisibilityEnabled),{isFeatureEnabled:D}=t(G.isTaskCannedResponsesEnabled),{isFeatureEnabled:x}=t(G.isTaskRecurringParentEnabled),{isFeatureEnabled:B}=t(G.isTaskGroupAssigneesEnabled),[R,w]=k.useState(!1),[h,S]=k.useState(!1),[K,re]=k.useState(!1),[$,A]=k.useState(!1),C=k.useRef(!1),y=b((i=>i.taskListState.updateTasksFetchState.fetchState)),Q=b((i=>se(i))),N=b((i=>i.taskGroupViewState.fetchState));k.useEffect((()=>{a(g(!1,s)),s!=null&&a(T(s))}),[a,s]);const O=U.getSignedInUser()?.userId,ce=k.useMemo((()=>{const i=[f.TASK_CREATED,f.TASK_UPDATED,f.TASKS_BULK_UPDATED,f.TASKS_BULK_DELETED],l=[...i,f.TASK_SNOOZE_RESURFACED];return[...Ze(d?.companyId,i),...Me(O,l)]}),[d?.companyId,O]);qe({events:ce,onSubscribed:()=>{s!=null&&(a(g(!0,s)),a(T(s)))},onEvent:(i,l)=>{if(s!=null)switch(i){case f.TASK_CREATED:{X(l)?.parent_task_id===s&&(a(g(!0,s)),a(T(s)));break}case f.TASK_UPDATED:{const p=X(l);if(p==null)break;p.task_id===s?(a(g(!0,s)),a(T(s))):p.parent_task_id===s&&a(T(s));break}case f.TASKS_BULK_UPDATED:{const p=H(l);if(p==null)break;p.task_ids.includes(s)&&a(g(!0,s)),a(T(s));break}case f.TASKS_BULK_DELETED:{const p=H(l);if(p==null)break;if(p.task_ids.includes(s)){a(oe({messageSection:"delete_task",messageText:"success",type:"success"})),d?.tenantEmailDomain!=null&&e(P(d.tenantEmailDomain));break}a(T(s));break}case f.TASK_SNOOZE_RESURFACED:{He(l)?.task_id===s&&a(g(!0,s));break}}}}),k.useEffect((()=>{h||Q.fetchState==="Completed"||(S(!0),a(he()))}),[h,a,Q.fetchState]),k.useEffect((()=>{K||N==="Completed"||(re(!0),a(Ee()))}),[K,a,N]);const le=k.useCallback((()=>{s!=null&&(C.current=!1,a(be([s],null,{isArchived:!1})),A(!0))}),[a,s]);k.useEffect((()=>{if($)if(y!=="In-Progress"){if(C.current){if(y==="Error")return A(!1),void(C.current=!1);if(y==="Completed"){A(!1),C.current=!1;const{tenantEmailDomain:i}=d;if(n.state?.message==="triggerBackClick"){const l=ie(n.state?.pathnameStackToGoBack);e(l.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:l.newStack}})}else{const l=P(i);e(l,{state:{pathnameStackToGoBack:_(n.state?.pathnameStackToGoBack,n.pathname)}})}}}}else C.current=!0}),[$,y,d,n,e]);const z=b((i=>ne(i,s))),v=z.fetchState,V=U.getSignedInUser();if(V==null)throw Error("Can't access task detail page without signing in...");if(v==="Error"&&z.error?.code===400){const{tenantEmailDomain:i}=d,l=P(i),p=_(n.state?.pathnameStackToGoBack,n.pathname);return r.jsx(pe,{to:l,state:{pathnameStackToGoBack:p}})}return r.jsxs(r.Fragment,{children:[v==="Completed"?r.jsx(Ke,{analytics:M,onLoad:i=>(l=>l.trackPageLoaded($e.Event.taskDetailPage))(i)}):null,r.jsxs(ea,{children:[r.jsx(Ve,{isAppContentDrawerOpen:R,handleDrawerToggle:i=>{w(i)}}),r.jsx(Ye,{analytics:M,currentTenant:d,handleZeniLogoClick:()=>{c.toggle()},initialOpenThreadRequest:m,location:n,loggedInUser:V,navigate:e,taskGroupId:u,taskId:s,taskDetailFetchState:v,onUnarchiveTaskClick:le,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:I,isTaskCannedResponsesEnabled:D,isTaskRecurringParentEnabled:x,isTaskGroupAssigneesEnabled:B})]})]})}const ea=Oe.div`
2
- display: flex;
3
- min-height: 100%;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${e=>e.theme.colors.grey4};
9
- `,P=e=>`/${e}/tasks`;function Da(){return r.jsxs(Se,{children:[r.jsx(E,{path:"/new",element:r.jsx(F,{})}),r.jsx(E,{path:"/new/:taskGroupId",element:r.jsx(F,{})}),r.jsx(E,{path:"/group/:taskGroupId",element:r.jsx(Xe,{})}),r.jsx(E,{path:"/quick-responses",element:r.jsx(Je,{})}),r.jsx(E,{path:"/:taskId",element:r.jsx(F,{})}),r.jsx(E,{path:"*",element:r.jsx(ue,{})})]})}export{Da as default};
@@ -1 +0,0 @@
1
- import{j as t}from"./liveblocks-DJozFz1F.js";import i from"./NotFoundScreen-DWq-K_Je.js";import{T as r}from"./TransactionDetailScreen-DEqpcfN2.js";import"./sentry-C1W0cBeR.js";import{n as a,o as e}from"./core-DrG65cn7.js";import"./zeni-epic-state-1I_oueWp.js";import"./recharts-Bmrae78L.js";import"./index-CNCkAPT0.js";import"./mui-DqsEgFea.js";import"./analytics-EJdRN0EM.js";import"./plaid-KeCmRFX0.js";import"./dnd-ySxwrcGd.js";import"./stripe-cKAAJElX.js";import"./lottie-B54UhbRD.js";import"./lexical-DsG4GgCt.js";import"./pdf-0ccxH7eS.js";import"./utils-BYrZSa_o.js";import"./useAskAiCfoHostNavButtonProps-DDB7rJuC.js";import"./decodeURIComponentSafe-Cq-VPmfw.js";import"./useInitialThreadRequest-DjzuWq5l.js";import"./routePaths-BlVxV4y9.js";import"./expenseAutomationHelper-BhQOMrvk.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new o.Error().stack;n&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[n]="bfd19369-9f5a-4875-9ff9-f0a50fe2624d",o._sentryDebugIdIdentifier="sentry-dbid-bfd19369-9f5a-4875-9ff9-f0a50fe2624d")}catch{}})();function z(){return t.jsxs(a,{children:[t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(e,{path:"/*",element:t.jsx(r,{})})]})}export{z as default};
@@ -1,9 +0,0 @@
1
- import{j as i}from"./liveblocks-DJozFz1F.js";import{a as f}from"./sentry-C1W0cBeR.js";import{h as $,u as x,g as T,i as v,j as p}from"./core-DrG65cn7.js";import{T7 as s,T6 as j,$u as B,fF as C,$v as E}from"./zeni-epic-state-1I_oueWp.js";import{a2 as z,af as g,E as D,z as L,a8 as P,d7 as N,a5 as U}from"./index-CNCkAPT0.js";import{n as _}from"./mui-DqsEgFea.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]="578cb63d-2688-4550-9362-ec372715ae26",e._sentryDebugIdIdentifier="sentry-dbid-578cb63d-2688-4550-9362-ec372715ae26")}catch{}})();const G=_.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
- `;function H(){const e=$(),n=x(),d=z(),l=T();let{accountId:a}=v(),u=`${g.bankingMicroServiceBaseUrl}/1.0/deposit-accounts/${a}`;a==null&&l.pathname.includes(`${s}/statements`)&&(a=s,u=`${g.bankingMicroServiceBaseUrl}/1.0/${s}`);const[m,h]=f.useState(!1),y=D();f.useEffect((()=>{m||(h(!0),n(j(a??"",!1)))}),[m,n]);const o=p((t=>B(t,a??""))),I=()=>{const t=U(l.state?.pathnameStackToGoBack),S=t.poppedPathname??"..";e(S,{state:{pathnameStackToGoBack:t.newStack}})},r=L.getSignedInUser(),c=p((t=>C(t))),b={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:c.tenantId??""},w=E(a??"")===!0?s:o.zeniAccountDetail?.accountLast4??"",k=c.company?.companyInfo.companyLegalName??c.companyName;if(r==null)throw Error("Can't access address page without signing in...");return o.fetchState!=="Completed"?i.jsx(P,{fetchState:"In-Progress",style:{backgroundColor:y.colors.grey5}}):i.jsx(G,{windowSize:d,children:i.jsx(N,{currentTenantCompanyName:k,statementListView:o,accountLast4:w,onBackClick:I,authParams:b,downloadEndPoint:u})})}export{H as Z};