ghost 6.52.0 → 6.52.1

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 (220) hide show
  1. package/components/tryghost-kg-card-factory-5.2.3.tgz +0 -0
  2. package/components/tryghost-kg-clean-basic-html-4.3.3.tgz +0 -0
  3. package/components/tryghost-kg-converters-1.2.3.tgz +0 -0
  4. package/components/tryghost-kg-default-cards-10.3.3.tgz +0 -0
  5. package/components/tryghost-kg-default-nodes-2.1.3.tgz +0 -0
  6. package/components/tryghost-kg-default-transforms-1.3.3.tgz +0 -0
  7. package/components/tryghost-kg-html-to-lexical-1.3.3.tgz +0 -0
  8. package/components/tryghost-kg-lexical-html-renderer-1.4.3.tgz +0 -0
  9. package/components/tryghost-kg-markdown-html-renderer-7.2.3.tgz +0 -0
  10. package/components/tryghost-kg-utils-1.1.3.tgz +0 -0
  11. package/core/built/admin/assets/Growth-CczbRexv.js +3 -0
  12. package/core/built/admin/assets/Newsletters-rFycX4x8.js +1 -0
  13. package/core/built/admin/assets/Overview-DFubBJaR.js +1 -0
  14. package/core/built/admin/assets/Web-BDE2lN4_.js +2 -0
  15. package/core/built/admin/assets/{account-migration-DiS76mRS.js → account-migration-gvH5a8ea.js} +1 -1
  16. package/core/built/admin/assets/audience-CMWMCxFS.js +1 -0
  17. package/core/built/admin/assets/{automated-emails-Cel18g7S.js → automated-emails-293Lcj5S.js} +1 -1
  18. package/core/built/admin/assets/automations-BxnjfCKn.js +1 -0
  19. package/core/built/admin/assets/automations-kPr44AmD.js +1 -0
  20. package/core/built/admin/assets/bluesky-sharing-Cww54F3Y.js +1 -0
  21. package/core/built/admin/assets/{chunk.912.9d6df5a6da679d905bbf.js → chunk.251.dd82df30188bb633b4ae.js} +9 -9
  22. package/core/built/admin/assets/{chunk.730.2457b7fede040aa52c88.js → chunk.341.20e7d2936dfa5877deea.js} +3 -3
  23. package/core/built/admin/assets/{chunk.524.d6d399b571454ea0234d.js → chunk.524.697bf0ded48e7c994fc3.js} +5 -5
  24. package/core/built/admin/assets/{chunk.582.50a9a5cbab6996daf0fe.js → chunk.582.6b742e9ba932688c442c.js} +6 -6
  25. package/core/built/admin/assets/{code-editor-view-BLGzcLub.js → code-editor-view-DSY5RHLf.js} +1 -1
  26. package/core/built/admin/assets/comments-BwNUmaNM.js +1 -0
  27. package/core/built/admin/assets/constants-c-JNF9c2.js +1 -0
  28. package/core/built/admin/assets/container-CD33Rm0u.js +1 -0
  29. package/core/built/admin/assets/content-helpers-CNBPrwsi.js +1 -0
  30. package/core/built/admin/assets/date-range-select-BkkNN98H.js +1 -0
  31. package/core/built/admin/assets/disabled-sources-indicator-ChHTF69d.js +1 -0
  32. package/core/built/admin/assets/{domain-2REz20SO.js → domain-CGk9SMa-.js} +1 -1
  33. package/core/built/admin/assets/dropzone-9zocztX0.js +5 -0
  34. package/core/built/admin/assets/{edit-profile-7QEh0VtN.js → edit-profile-C0B2Kbsl.js} +1 -1
  35. package/core/built/admin/assets/editor-Bz2Sm2O8.js +8 -0
  36. package/core/built/admin/assets/{esm-CEtFqV1y.js → esm-CsHLKmLh.js} +1 -1
  37. package/core/built/admin/assets/explore-CpRAMnx7.js +1 -0
  38. package/core/built/admin/assets/feed-BRoOWghO.js +1 -0
  39. package/core/built/admin/assets/filter-sources-DhxqZID1.js +1 -0
  40. package/core/built/admin/assets/{filters-DUy8rzI5.js → filters-B8nLLYGO.js} +1 -1
  41. package/core/built/admin/assets/{gh-chart-DdBGmBS8.js → gh-chart-Cqy9gGq7.js} +1 -1
  42. package/core/built/admin/assets/{gift-link-modal-CSgyxenA.js → gift-link-modal-v55u0VUL.js} +1 -1
  43. package/core/built/admin/assets/growth-BIfM3w1p.js +1 -0
  44. package/core/built/admin/assets/{inbox-CTD-ix6u.js → inbox-CDX57fXK.js} +11 -11
  45. package/core/built/admin/assets/index-B5yxmQNp.js +69 -0
  46. package/core/built/admin/assets/inline-DdrWe7D3.js +1 -0
  47. package/core/built/admin/assets/{input-group-DkR63-nk.js → input-group-DUPGQck1.js} +1 -1
  48. package/core/built/admin/assets/{koenig-lexical-D09TwwLs.js → koenig-lexical-CUVpp-dC.js} +1 -1
  49. package/core/built/admin/assets/{kpi-card-Fr_HJH78.js → kpi-card-DyDbok3h.js} +1 -1
  50. package/core/built/admin/assets/kpi-helpers-Bx9IHIMq.js +1 -0
  51. package/core/built/admin/assets/{kpi-tabs-Dc4Nt4a5.js → kpi-tabs-DmUcThFc.js} +1 -1
  52. package/core/built/admin/assets/labels-DLL8dl-7.js +1 -0
  53. package/core/built/admin/assets/layout-B7K3SmL0.js +1 -0
  54. package/core/built/admin/assets/{links-CfAB2Yeq.js → link-helpers-DHG_8GIT.js} +1 -1
  55. package/core/built/admin/assets/list-page-COAUFrmV.js +1 -0
  56. package/core/built/admin/assets/members-BxWs_mjq.js +10 -0
  57. package/core/built/admin/assets/{modals-Bu-1Uxdc.js → modals-DF2sECo6.js} +4 -4
  58. package/core/built/admin/assets/moderation-DYKTx5x0.js +1 -0
  59. package/core/built/admin/assets/newsletter-C-ZD1dI8.js +1 -0
  60. package/core/built/admin/assets/note-oaRdU_5z.js +1 -0
  61. package/core/built/admin/assets/notifications-BF4fAiP1.js +1 -0
  62. package/core/built/admin/assets/{nql-lang-CvCSOQG3.js → nql-lang-BoHzkNg5.js} +1 -1
  63. package/core/built/admin/assets/{onboarding-route-BDaa9hd3.js → onboarding-route-SS-e9Aeb.js} +1 -1
  64. package/core/built/admin/assets/overview-Cbn6bIoR.js +1 -0
  65. package/core/built/admin/assets/post-analytics-Bk9-KEgB.js +1 -0
  66. package/core/built/admin/assets/post-analytics-context-C8t_048I.js +1 -0
  67. package/core/built/admin/assets/post-analytics-header-xTjcg4H0.js +1 -0
  68. package/core/built/admin/assets/post-analytics-provider-CqnWwLMk.js +1 -0
  69. package/core/built/admin/assets/{post-share-modal-59Ujf4t1.js → post-share-modal-ZUCX7JZo.js} +1 -1
  70. package/core/built/admin/assets/preferences-BgjgxiBB.js +5 -0
  71. package/core/built/admin/assets/profile-qIwaxKTm.js +1 -0
  72. package/core/built/admin/assets/{router-provider-DcttGCQn.js → router-provider-S8Wf6jdu.js} +1 -1
  73. package/core/built/admin/assets/select-Cp27ScMR.js +1 -0
  74. package/core/built/admin/assets/{settings-dLraw6et.js → settings-CdDfyF90.js} +1 -1
  75. package/core/built/admin/assets/{settings-CIslWMfh.js → settings-CynBh-YN.js} +4 -4
  76. package/core/built/admin/assets/{share-modal-CI3E67kW.js → share-modal-DTIFYNI1.js} +1 -1
  77. package/core/built/admin/assets/social-urls-DVvRfwEp.js +16 -0
  78. package/core/built/admin/assets/{sort-button-BYwI0xdN.js → sort-button-BHh5Ba1K.js} +1 -1
  79. package/core/built/admin/assets/source-icon--egCE7iN.js +1 -0
  80. package/core/built/admin/assets/stats-DkqCtrPh.js +1 -0
  81. package/core/built/admin/assets/stats-view-BvWWxegf.js +1 -0
  82. package/core/built/admin/assets/step-1-DWjw7rIn.js +1 -0
  83. package/core/built/admin/assets/{step-2-CVOvLQ2n.js → step-2-D1LrETIB.js} +1 -1
  84. package/core/built/admin/assets/{step-3-BsVXcpWU.js → step-3-BAdJdZw4.js} +2 -2
  85. package/core/built/admin/assets/{tabs-Bw8aEqsd.js → tabs-DSrHPjWP.js} +1 -1
  86. package/core/built/admin/assets/tags-BWZqBj19.js +1 -0
  87. package/core/built/admin/assets/{textarea-CNaqhk5P.js → textarea-CUVQjsrM.js} +1 -1
  88. package/core/built/admin/assets/{toggle-group-CMp1taHd.js → toggle-group-CrFpl-Xz.js} +1 -1
  89. package/core/built/admin/assets/{topic-filter-D2_9eEw4.js → topic-filter-jAxwwd9I.js} +1 -1
  90. package/core/built/admin/assets/types-uYQ1HgqL.js +1 -0
  91. package/core/built/admin/assets/url-helpers-CCyfRrKj.js +1 -0
  92. package/core/built/admin/assets/use-analytics-data-DXG7mpgK.js +1 -0
  93. package/core/built/admin/assets/use-filter-params-EoQBXfP3.js +1 -0
  94. package/core/built/admin/assets/use-growth-stats-DJoXxVfD.js +1 -0
  95. package/core/built/admin/assets/use-post-referrers-B-onYbuS.js +1 -0
  96. package/core/built/admin/assets/use-reply-chain-data-D8IFALoz.js +1 -0
  97. package/core/built/admin/assets/{use-tinybird-query-CNCaUn39.js → use-tinybird-query-BSL3iVCc.js} +1 -1
  98. package/core/built/admin/assets/{use-tinybird-token-1T80Odca.js → use-tinybird-token-DHgOnrNu.js} +1 -1
  99. package/core/built/admin/assets/virtual-list-AQrbRAXP.js +1 -0
  100. package/core/built/admin/assets/web-zEFi98DS.js +1 -0
  101. package/core/built/admin/index.html +6 -6
  102. package/core/server/services/automations/automations-api.js +20 -0
  103. package/core/server/services/automations/automations-api.ts +31 -0
  104. package/core/server/services/automations/poll.js +7 -7
  105. package/core/server/services/automations/poll.ts +12 -9
  106. package/core/server/services/email-analytics/email-analytics-provider-mailgun.js +2 -2
  107. package/core/server/services/email-analytics/email-analytics-service-wrapper.js +1 -4
  108. package/core/server/services/email-analytics/email-analytics-service.js +5 -7
  109. package/core/server/services/webhooks/serialize.js +6 -5
  110. package/package.json +1 -1
  111. package/pnpm-lock.yaml +14 -14
  112. package/pnpm-workspace.yaml +5 -0
  113. package/core/built/admin/assets/Growth-Dx0vv-BS.js +0 -3
  114. package/core/built/admin/assets/Newsletters-v1GnbUjW.js +0 -1
  115. package/core/built/admin/assets/Overview-BgM7o-Z8.js +0 -1
  116. package/core/built/admin/assets/Web-DRv-83Ow.js +0 -2
  117. package/core/built/admin/assets/automations-DFLgH14-.js +0 -1
  118. package/core/built/admin/assets/automations-Dc4DUKBb.js +0 -1
  119. package/core/built/admin/assets/bluesky-sharing-Dk1RTUaz.js +0 -1
  120. package/core/built/admin/assets/comments-DgH1rC7w.js +0 -1
  121. package/core/built/admin/assets/constants-BlvYJTqz.js +0 -1
  122. package/core/built/admin/assets/content-helpers-BEgGpvyE.js +0 -1
  123. package/core/built/admin/assets/editor-u3BPqQed.js +0 -8
  124. package/core/built/admin/assets/en-DA2zVD_n.js +0 -1
  125. package/core/built/admin/assets/explore-BgHmdFVz.js +0 -1
  126. package/core/built/admin/assets/feed-Cs7-F3I5.js +0 -1
  127. package/core/built/admin/assets/filter-query-core-D6GjHUFB.js +0 -1
  128. package/core/built/admin/assets/growth-IkQZ1ZV9.js +0 -1
  129. package/core/built/admin/assets/index-BMhs4O3N.js +0 -69
  130. package/core/built/admin/assets/inline-C1CpHxuO.js +0 -1
  131. package/core/built/admin/assets/kpis-BTZ8cyw-.js +0 -1
  132. package/core/built/admin/assets/labels-sA9m188H.js +0 -5
  133. package/core/built/admin/assets/layout-szLkuQ88.js +0 -1
  134. package/core/built/admin/assets/list-page-DWkOdljb.js +0 -1
  135. package/core/built/admin/assets/main-layout-B-K8KliJ.js +0 -1
  136. package/core/built/admin/assets/members-PNNhalbu.js +0 -10
  137. package/core/built/admin/assets/moderation-DqnsNTiw.js +0 -1
  138. package/core/built/admin/assets/newsletter-BhuQeWFL.js +0 -1
  139. package/core/built/admin/assets/note-DFy2JTpP.js +0 -1
  140. package/core/built/admin/assets/notifications-BVu-JOkB.js +0 -1
  141. package/core/built/admin/assets/overview-Bhg8M7VS.js +0 -1
  142. package/core/built/admin/assets/pagemenu-C4paivNj.js +0 -1
  143. package/core/built/admin/assets/post-analytics-BhQUmZyA.js +0 -1
  144. package/core/built/admin/assets/post-analytics-context-Dy17HR1_.js +0 -1
  145. package/core/built/admin/assets/post-analytics-header-DAQep1VQ.js +0 -1
  146. package/core/built/admin/assets/posts/_react-dom-Blmuc0OL.js +0 -21
  147. package/core/built/admin/assets/posts/alert-dialog-DBJeQQTK.js +0 -154
  148. package/core/built/admin/assets/posts/app-provider-BJr9fdEC.js +0 -22
  149. package/core/built/admin/assets/posts/app-utils-9O53Czfw.js +0 -83
  150. package/core/built/admin/assets/posts/automations-BM0oBTjO.js +0 -275
  151. package/core/built/admin/assets/posts/automations-Dbp-gdHS.js +0 -223
  152. package/core/built/admin/assets/posts/avatar-kOk1tTvT.js +0 -144
  153. package/core/built/admin/assets/posts/badge-DnByIHe9.js +0 -25
  154. package/core/built/admin/assets/posts/button-Dd8Xreln.js +0 -40844
  155. package/core/built/admin/assets/posts/chunk-KS7C4IRE-ECXkcZq6.js +0 -7740
  156. package/core/built/admin/assets/posts/comments-D-7hbbdw.js +0 -8032
  157. package/core/built/admin/assets/posts/data-list-DdD_glQ-.js +0 -14219
  158. package/core/built/admin/assets/posts/dialog-DDkTy_np.js +0 -229
  159. package/core/built/admin/assets/posts/editor-D7-01KV_.js +0 -14633
  160. package/core/built/admin/assets/posts/empty-indicator-Ze-bwJ27.js +0 -38
  161. package/core/built/admin/assets/posts/filters-CmKfKtpS.js +0 -5611
  162. package/core/built/admin/assets/posts/get-site-timezone-DVbWc-NA.js +0 -39
  163. package/core/built/admin/assets/posts/growth-DlhFUzVg.js +0 -299
  164. package/core/built/admin/assets/posts/heading-BBl-8tMC.js +0 -92
  165. package/core/built/admin/assets/posts/hooks-gZAmj4Al.js +0 -5429
  166. package/core/built/admin/assets/posts/input-DuPLeCGW.js +0 -16
  167. package/core/built/admin/assets/posts/input-surface-ClwNIxfd.js +0 -17
  168. package/core/built/admin/assets/posts/jsx-runtime-BfZnKD4L.js +0 -95
  169. package/core/built/admin/assets/posts/koenig-lexical-DCHiJJou.js +0 -77579
  170. package/core/built/admin/assets/posts/kpis-Fsx0XmYK.js +0 -2061
  171. package/core/built/admin/assets/posts/label-D1wSl69p.js +0 -32
  172. package/core/built/admin/assets/posts/links-DLozzgMh.js +0 -1243
  173. package/core/built/admin/assets/posts/loading-indicator-BgU2kK3v.js +0 -44
  174. package/core/built/admin/assets/posts/main-layout-DDlTMrnF.js +0 -15
  175. package/core/built/admin/assets/posts/newsletter-DAQJ1GLe.js +0 -736
  176. package/core/built/admin/assets/posts/overview-G3MfRm-S.js +0 -426
  177. package/core/built/admin/assets/posts/page-header-CanFyB95.js +0 -284
  178. package/core/built/admin/assets/posts/popover-Cta8ZDHJ.js +0 -221
  179. package/core/built/admin/assets/posts/post-analytics-cS07-wo_.js +0 -121
  180. package/core/built/admin/assets/posts/post-analytics-context-D868SMoq.js +0 -150
  181. package/core/built/admin/assets/posts/post-analytics-header-CZYiuaEL.js +0 -42249
  182. package/core/built/admin/assets/posts/post-share-modal-BJfswZzf.js +0 -352
  183. package/core/built/admin/assets/posts/posts-CpusjBC0.js +0 -37
  184. package/core/built/admin/assets/posts/posts-app-context-CPC7dOlt.js +0 -26
  185. package/core/built/admin/assets/posts/posts.js +0 -145
  186. package/core/built/admin/assets/posts/router-provider-DrqpOc8m.js +0 -114
  187. package/core/built/admin/assets/posts/separator-DAZNzARU.js +0 -37
  188. package/core/built/admin/assets/posts/settings-CMfUn5Hq.js +0 -66
  189. package/core/built/admin/assets/posts/shade-app-DLbeExcd-NeEZjE3R.js +0 -4764
  190. package/core/built/admin/assets/posts/sheet-CEuv-0a5.js +0 -62
  191. package/core/built/admin/assets/posts/site-WJ6ldary.js +0 -10
  192. package/core/built/admin/assets/posts/skeleton-CO0qCdQF.js +0 -2426
  193. package/core/built/admin/assets/posts/source-icon-Bs6o84W3.js +0 -143
  194. package/core/built/admin/assets/posts/stats-B1Z8H0JT.js +0 -92
  195. package/core/built/admin/assets/posts/table-CbJ9bOpM.js +0 -77
  196. package/core/built/admin/assets/posts/tabs-BvzzwQ4P.js +0 -242
  197. package/core/built/admin/assets/posts/tags-D-4TwsD0.js +0 -462
  198. package/core/built/admin/assets/posts/tooltip-BI7VtFUY.js +0 -380
  199. package/core/built/admin/assets/posts/update-queries-DiUznIQ1.js +0 -60
  200. package/core/built/admin/assets/posts/users-UgRPrTKW.js +0 -83
  201. package/core/built/admin/assets/posts/value-DF_wOhJe.js +0 -415
  202. package/core/built/admin/assets/posts/virtual-list-window-DP63Onpm.js +0 -853
  203. package/core/built/admin/assets/posts/web-axp2l3kK.js +0 -8077
  204. package/core/built/admin/assets/preferences-ChOzBKcF.js +0 -5
  205. package/core/built/admin/assets/profile-DlcrYKay.js +0 -1
  206. package/core/built/admin/assets/select-BbtNHCBq.js +0 -1
  207. package/core/built/admin/assets/social-urls-DVzIHh2W.js +0 -16
  208. package/core/built/admin/assets/source-icon-Uuhttjun.js +0 -1
  209. package/core/built/admin/assets/source-utils-BchD0sF0.js +0 -1
  210. package/core/built/admin/assets/stats-CrlPzgdd.js +0 -1
  211. package/core/built/admin/assets/stats-view-UNMhTMCZ.js +0 -1
  212. package/core/built/admin/assets/step-1-C2HY6pyi.js +0 -1
  213. package/core/built/admin/assets/tags-DjCsJo0X.js +0 -1
  214. package/core/built/admin/assets/typeof-Ca-duI-z.js +0 -1
  215. package/core/built/admin/assets/url-helpers-DxA844rA.js +0 -1
  216. package/core/built/admin/assets/use-growth-stats-DNIGdI8h.js +0 -1
  217. package/core/built/admin/assets/use-reply-chain-data-DtEC2Azp.js +0 -1
  218. package/core/built/admin/assets/virtual-list-window-BTXGwpf5.js +0 -1
  219. package/core/built/admin/assets/web-Cj8VEw3s.js +0 -1
  220. /package/core/built/admin/assets/{chunk.912.9d6df5a6da679d905bbf.js.LICENSE.txt → chunk.251.dd82df30188bb633b4ae.js.LICENSE.txt} +0 -0
@@ -1,853 +0,0 @@
1
- import { C as e, D as t, E as n, T as r, b as i, p as a, t as o } from "./jsx-runtime-BfZnKD4L.js";
2
- import { s } from "./chunk-KS7C4IRE-ECXkcZq6.js";
3
- import { a as c, i as l } from "./_react-dom-Blmuc0OL.js";
4
- import { t as u } from "./button-Dd8Xreln.js";
5
- import { m as d } from "./shade-app-DLbeExcd-NeEZjE3R.js";
6
- //#region src/components/virtual-table/load-more-button.tsx
7
- var f = o(), p = ({ isLoading: e, onClick: t }) => {
8
- let n = !!e;
9
- return /* @__PURE__ */ (0, f.jsx)("div", {
10
- className: "flex justify-center px-4 py-6",
11
- children: /* @__PURE__ */ (0, f.jsx)(u, {
12
- disabled: n,
13
- variant: "outline",
14
- onClick: t,
15
- children: n ? "Loading more..." : "Load more"
16
- })
17
- });
18
- };
19
- c(), a();
20
- function m(e, t, n) {
21
- let r = Array(e);
22
- return new Proxy(r, { get(r, i, a) {
23
- if (typeof i == "string") {
24
- let a = i.charCodeAt(0);
25
- if (a >= 48 && a <= 57) {
26
- let a = +i;
27
- if (Number.isInteger(a) && a >= 0 && a < e) {
28
- let e = r[a];
29
- if (!e) {
30
- let i = t[a * 2];
31
- e = r[a] = {
32
- index: a,
33
- key: n(a),
34
- start: i,
35
- size: t[a * 2 + 1],
36
- end: i + t[a * 2 + 1],
37
- lane: 0
38
- };
39
- }
40
- return e;
41
- }
42
- }
43
- if (i === "length") return e;
44
- }
45
- return Reflect.get(r, i, a);
46
- } });
47
- }
48
- //#endregion
49
- //#region ../../node_modules/.pnpm/@tanstack+virtual-core@3.17.3/node_modules/@tanstack/virtual-core/dist/esm/utils.js
50
- function h(e, t, n) {
51
- let r = n.initialDeps ?? [], i, a = !0;
52
- function o() {
53
- let o = e();
54
- return o.length !== r.length || o.some((e, t) => r[t] !== e) ? (r = o, i = t(...o), n?.onChange && !(a && n.skipInitialOnChange) && n.onChange(i), a = !1, i) : i;
55
- }
56
- return o.updateDeps = (e) => {
57
- r = e;
58
- }, o;
59
- }
60
- function g(e, t) {
61
- if (e === void 0) throw Error(`Unexpected undefined${t ? `: ${t}` : ""}`);
62
- return e;
63
- }
64
- var _ = (e, t) => Math.abs(e - t) < 1.01, v = (e, t, n) => {
65
- let r;
66
- return function(...i) {
67
- e.clearTimeout(r), r = e.setTimeout(() => t.apply(this, i), n);
68
- };
69
- }, y, b = () => {
70
- if (y !== void 0) return y;
71
- if (typeof navigator > "u") return y = !1;
72
- if (/iP(hone|od|ad)/.test(navigator.userAgent)) return y = !0;
73
- let e = navigator.maxTouchPoints;
74
- return y = navigator.platform === "MacIntel" && e !== void 0 && e > 0;
75
- }, x = (e) => {
76
- let { offsetWidth: t, offsetHeight: n } = e;
77
- return {
78
- width: t,
79
- height: n
80
- };
81
- }, S = (e) => e, C = (e) => {
82
- let t = Math.max(e.startIndex - e.overscan, 0), n = Math.min(e.endIndex + e.overscan, e.count - 1) - t + 1, r = Array(n);
83
- for (let e = 0; e < n; e++) r[e] = t + e;
84
- return r;
85
- }, w = (e, t) => {
86
- let n = e.scrollElement;
87
- if (!n) return;
88
- let r = e.targetWindow;
89
- if (!r) return;
90
- let i = (e) => {
91
- let { width: n, height: r } = e;
92
- t({
93
- width: Math.round(n),
94
- height: Math.round(r)
95
- });
96
- };
97
- if (i(x(n)), !r.ResizeObserver) return () => {};
98
- let a = new r.ResizeObserver((t) => {
99
- let r = () => {
100
- let e = t[0];
101
- if (e?.borderBoxSize) {
102
- let t = e.borderBoxSize[0];
103
- if (t) {
104
- i({
105
- width: t.inlineSize,
106
- height: t.blockSize
107
- });
108
- return;
109
- }
110
- }
111
- i(x(n));
112
- };
113
- e.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(r) : r();
114
- });
115
- return a.observe(n, { box: "border-box" }), () => {
116
- a.unobserve(n);
117
- };
118
- }, T = { passive: !0 }, E = typeof window > "u" ? !0 : "onscrollend" in window, D = (e, t, n) => {
119
- let r = e.scrollElement;
120
- if (!r) return;
121
- let i = e.targetWindow;
122
- if (!i) return;
123
- let a = e.options.useScrollendEvent && E, o = 0, s = a ? null : v(i, () => t(o, !1), e.options.isScrollingResetDelay), c = (e) => () => {
124
- o = n(r), s?.(), t(o, e);
125
- }, l = c(!0), u = c(!1);
126
- return r.addEventListener("scroll", l, T), a && r.addEventListener("scrollend", u, T), () => {
127
- r.removeEventListener("scroll", l), a && r.removeEventListener("scrollend", u);
128
- };
129
- }, O = (e, t) => D(e, t, (t) => {
130
- let { horizontal: n, isRtl: r } = e.options;
131
- return n ? t.scrollLeft * (r && -1 || 1) : t.scrollTop;
132
- }), k = (e, t, n) => {
133
- if (n.options.useCachedMeasurements) {
134
- let t = n.indexFromElement(e), r = n.options.getItemKey(t);
135
- return n.itemSizeCache.get(r) ?? n.options.estimateSize(t);
136
- }
137
- if (t?.borderBoxSize) {
138
- let e = t.borderBoxSize[0];
139
- if (e) return Math.round(e[n.options.horizontal ? "inlineSize" : "blockSize"]);
140
- }
141
- if (!t) {
142
- let t = n.indexFromElement(e), r = n.options.getItemKey(t), i = n.itemSizeCache.get(r);
143
- if (i !== void 0) return i;
144
- }
145
- return e[n.options.horizontal ? "offsetWidth" : "offsetHeight"];
146
- }, A = (e, { adjustments: t = 0, behavior: n }, r) => {
147
- var i, a;
148
- (a = (i = r.scrollElement)?.scrollTo) == null || a.call(i, {
149
- [r.options.horizontal ? "left" : "top"]: e + t,
150
- behavior: n
151
- });
152
- }, j = class {
153
- constructor(e) {
154
- this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.scrollState = null, this.measurementsCache = [], this._flatMeasurements = null, this.itemSizeCache = /* @__PURE__ */ new Map(), this.itemSizeCacheVersion = 0, this.laneAssignments = /* @__PURE__ */ new Map(), this.pendingMin = null, this.prevLanes = void 0, this.lanesChangedFlag = !1, this.lanesSettling = !1, this.pendingScrollAnchor = null, this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this._iosDeferredAdjustment = 0, this._iosTouching = !1, this._iosJustTouchEnded = !1, this._iosTouchEndTimerId = null, this._intendedScrollOffset = null, this.elementsCache = /* @__PURE__ */ new Map(), this.now = () => {
155
- var e;
156
- return ((e = this.targetWindow?.performance)?.now)?.call(e) ?? Date.now();
157
- }, this.observer = /* @__PURE__ */ (() => {
158
- let e = null, t = () => e || (!this.targetWindow || !this.targetWindow.ResizeObserver ? null : e = new this.targetWindow.ResizeObserver((e) => {
159
- e.forEach((e) => {
160
- let t = () => {
161
- let t = e.target, n = this.indexFromElement(t);
162
- if (!t.isConnected) {
163
- this.observer.unobserve(t);
164
- for (let [e, n] of this.elementsCache) if (n === t) {
165
- this.elementsCache.delete(e);
166
- break;
167
- }
168
- return;
169
- }
170
- this.shouldMeasureDuringScroll(n) && this.resizeItem(n, this.options.measureElement(t, e, this));
171
- };
172
- this.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(t) : t();
173
- });
174
- }));
175
- return {
176
- disconnect: () => {
177
- var n;
178
- (n = t()) == null || n.disconnect(), e = null;
179
- },
180
- observe: (e) => t()?.observe(e, { box: "border-box" }),
181
- unobserve: (e) => t()?.unobserve(e)
182
- };
183
- })(), this.range = null, this.setOptions = (e) => {
184
- let t = {
185
- debug: !1,
186
- initialOffset: 0,
187
- overscan: 1,
188
- paddingStart: 0,
189
- paddingEnd: 0,
190
- scrollPaddingStart: 0,
191
- scrollPaddingEnd: 0,
192
- horizontal: !1,
193
- getItemKey: S,
194
- rangeExtractor: C,
195
- onChange: () => {},
196
- measureElement: k,
197
- initialRect: {
198
- width: 0,
199
- height: 0
200
- },
201
- scrollMargin: 0,
202
- gap: 0,
203
- indexAttribute: "data-index",
204
- initialMeasurementsCache: [],
205
- lanes: 1,
206
- anchorTo: "start",
207
- followOnAppend: !1,
208
- scrollEndThreshold: 1,
209
- isScrollingResetDelay: 150,
210
- enabled: !0,
211
- isRtl: !1,
212
- useScrollendEvent: !1,
213
- useAnimationFrameWithResizeObserver: !1,
214
- laneAssignmentMode: "estimate",
215
- useCachedMeasurements: !1
216
- };
217
- for (let n in e) {
218
- let r = e[n];
219
- r !== void 0 && (t[n] = r);
220
- }
221
- let n = this.options, r = null, i = null, a = !1;
222
- if (n !== void 0 && n.enabled && t.enabled && t.anchorTo === "end" && this.scrollElement !== null) {
223
- let e = n.count, o = t.count, s = this.getMeasurements(), c = e > 0 ? s[0]?.key ?? n.getItemKey(0) : null, l = e > 0 ? s[e - 1]?.key ?? n.getItemKey(e - 1) : null;
224
- if (o !== e || e > 0 && o > 0 && (t.getItemKey(0) !== c || t.getItemKey(o - 1) !== l)) {
225
- a = !0;
226
- let c = e > 0 ? this.getVirtualItemForOffset(this.getScrollOffset()) ?? s[0] : null;
227
- c && (r = [c.key, this.getScrollOffset() - c.start]);
228
- let u = t.followOnAppend === !0 ? "auto" : t.followOnAppend || null;
229
- u && o > e && this.isAtEnd(n.scrollEndThreshold) && (e === 0 || t.getItemKey(o - 1) !== l) && (i = u);
230
- }
231
- }
232
- this.options = t, a && (this.pendingMin = 0, this.itemSizeCacheVersion++);
233
- let o = !1, s = 0;
234
- if (r && this.scrollOffset !== null) {
235
- let [e, t] = r, n = this.getMeasurements(), { count: i, getItemKey: a } = this.options, c = 0;
236
- for (; c < i && a(c) !== e;) c++;
237
- if (c < i) {
238
- let e = n[c];
239
- if (e) {
240
- let n = e.start + t;
241
- n !== this.scrollOffset && (s = n - this.scrollOffset, this.scrollOffset = n, o = !0);
242
- }
243
- }
244
- }
245
- (o || i) && (this.pendingScrollAnchor = [
246
- o ? r[0] : null,
247
- o ? r[1] : 0,
248
- i,
249
- s
250
- ]);
251
- }, this.notify = (e) => {
252
- var t, n;
253
- (n = (t = this.options).onChange) == null || n.call(t, this, e);
254
- }, this.maybeNotify = h(() => (this.calculateRange(), [
255
- this.isScrolling,
256
- this.range ? this.range.startIndex : null,
257
- this.range ? this.range.endIndex : null
258
- ]), (e) => {
259
- this.notify(e);
260
- }, {
261
- key: !1,
262
- debug: () => this.options.debug,
263
- initialDeps: [
264
- this.isScrolling,
265
- this.range ? this.range.startIndex : null,
266
- this.range ? this.range.endIndex : null
267
- ]
268
- }), this.cleanup = () => {
269
- this.unsubs.filter(Boolean).forEach((e) => e()), this.unsubs = [], this.observer.disconnect(), this.rafId != null && this.targetWindow && (this.targetWindow.cancelAnimationFrame(this.rafId), this.rafId = null), this.scrollState = null, this.scrollElement = null, this.targetWindow = null;
270
- }, this._didMount = () => () => {
271
- this.cleanup();
272
- }, this._willUpdate = () => {
273
- let e = this.options.enabled ? this.options.getScrollElement() : null;
274
- if (this.scrollElement !== e) {
275
- if (this.cleanup(), !e) {
276
- this.maybeNotify();
277
- return;
278
- }
279
- if (this.scrollElement = e, this.scrollElement && "ownerDocument" in this.scrollElement ? this.targetWindow = this.scrollElement.ownerDocument.defaultView : this.targetWindow = this.scrollElement?.window ?? null, this.elementsCache.forEach((e) => {
280
- this.observer.observe(e);
281
- }), this.unsubs.push(this.options.observeElementRect(this, (e) => {
282
- this.scrollRect = e, this.maybeNotify();
283
- })), this.unsubs.push(this.options.observeElementOffset(this, (e, t) => {
284
- if (t && this._intendedScrollOffset === null && e === this.scrollOffset) return;
285
- this._intendedScrollOffset !== null && Math.abs(e - this._intendedScrollOffset) < 1.5 && (e = this._intendedScrollOffset), this._intendedScrollOffset = null, this.scrollAdjustments = 0;
286
- let n = this.getScrollOffset();
287
- this.scrollDirection = t ? n === e ? this.scrollDirection : n < e ? "forward" : "backward" : null, this.scrollOffset = e, this.isScrolling = t, this._flushIosDeferredIfReady(), this.scrollState && this.scheduleScrollReconcile(), this.maybeNotify();
288
- })), "addEventListener" in this.scrollElement) {
289
- let e = this.scrollElement, t = () => {
290
- this._iosTouching = !0, this._iosJustTouchEnded = !1, this._iosTouchEndTimerId !== null && this.targetWindow != null && (this.targetWindow.clearTimeout(this._iosTouchEndTimerId), this._iosTouchEndTimerId = null);
291
- }, n = () => {
292
- this._iosTouching = !1, !(!b() || this.targetWindow == null) && (this._iosJustTouchEnded = !0, this._iosTouchEndTimerId = this.targetWindow.setTimeout(() => {
293
- this._iosJustTouchEnded = !1, this._iosTouchEndTimerId = null, this._flushIosDeferredIfReady();
294
- }, 150));
295
- };
296
- e.addEventListener("touchstart", t, T), e.addEventListener("touchend", n, T), this.unsubs.push(() => {
297
- e.removeEventListener("touchstart", t), e.removeEventListener("touchend", n), this._iosTouchEndTimerId !== null && this.targetWindow != null && (this.targetWindow.clearTimeout(this._iosTouchEndTimerId), this._iosTouchEndTimerId = null);
298
- });
299
- }
300
- this._scrollToOffset(this.getScrollOffset(), {
301
- adjustments: void 0,
302
- behavior: void 0
303
- });
304
- }
305
- let t = this.pendingScrollAnchor;
306
- if (this.pendingScrollAnchor = null, t && this.scrollElement && this.options.enabled) {
307
- let [e, n, r, i] = t;
308
- e !== null && !r && (b() && (this.isScrolling || this._iosTouching || this._iosJustTouchEnded) ? i !== 0 && (this._iosDeferredAdjustment += i) : this._scrollToOffset(this.getScrollOffset(), {
309
- adjustments: void 0,
310
- behavior: void 0
311
- })), r && this.scrollToEnd({ behavior: r });
312
- }
313
- }, this._flushIosDeferredIfReady = () => {
314
- if (this._iosDeferredAdjustment === 0 || this.isScrolling || this._iosTouching || this._iosJustTouchEnded) return;
315
- let e = this.getScrollOffset(), t = this.getMaxScrollOffset();
316
- if (e < 0 || e > t) return;
317
- let n = this._iosDeferredAdjustment;
318
- this._iosDeferredAdjustment = 0, this._scrollToOffset(e, {
319
- adjustments: this.scrollAdjustments += n,
320
- behavior: void 0
321
- });
322
- }, this.rafId = null, this.getSize = () => this.options.enabled ? (this.scrollRect = this.scrollRect ?? this.options.initialRect, this.scrollRect[this.options.horizontal ? "width" : "height"]) : (this.scrollRect = null, 0), this.getScrollOffset = () => this.options.enabled ? (this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset == "function" ? this.options.initialOffset() : this.options.initialOffset), this.scrollOffset) : (this.scrollOffset = null, 0), this.getFurthestMeasurement = (e, t) => {
323
- let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
324
- for (let i = t - 1; i >= 0; i--) {
325
- let t = e[i];
326
- if (n.has(t.lane)) continue;
327
- let a = r.get(t.lane);
328
- if (a == null || t.end > a.end ? r.set(t.lane, t) : t.end < a.end && n.set(t.lane, !0), n.size === this.options.lanes) break;
329
- }
330
- return r.size === this.options.lanes ? Array.from(r.values()).sort((e, t) => e.end === t.end ? e.index - t.index : e.end - t.end)[0] : void 0;
331
- }, this.getMeasurementOptions = h(() => [
332
- this.options.count,
333
- this.options.paddingStart,
334
- this.options.scrollMargin,
335
- this.options.getItemKey,
336
- this.options.enabled,
337
- this.options.lanes,
338
- this.options.laneAssignmentMode
339
- ], (e, t, n, r, i, a, o) => (this.prevLanes !== void 0 && this.prevLanes !== a && (this.lanesChangedFlag = !0), this.prevLanes = a, this.pendingMin = null, {
340
- count: e,
341
- paddingStart: t,
342
- scrollMargin: n,
343
- getItemKey: r,
344
- enabled: i,
345
- lanes: a,
346
- laneAssignmentMode: o
347
- }), { key: !1 }), this.getMeasurements = h(() => [this.getMeasurementOptions(), this.itemSizeCacheVersion], ({ count: e, paddingStart: t, scrollMargin: n, getItemKey: r, enabled: i, lanes: a, laneAssignmentMode: o }, s) => {
348
- let c = this.itemSizeCache;
349
- if (!i) return this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), [];
350
- if (this.laneAssignments.size > e) for (let t of this.laneAssignments.keys()) t >= e && this.laneAssignments.delete(t);
351
- this.lanesChangedFlag && (this.lanesChangedFlag = !1, this.lanesSettling = !0, this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), this.pendingMin = null), this.measurementsCache.length === 0 && !this.lanesSettling && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((e) => {
352
- this.itemSizeCache.set(e.key, e.size);
353
- }));
354
- let l = this.lanesSettling ? 0 : this.pendingMin ?? 0;
355
- if (this.pendingMin = null, this.lanesSettling && this.measurementsCache.length === e && (this.lanesSettling = !1), a === 1) {
356
- let i = this.options.gap, a = e * 2, o = this._flatMeasurements;
357
- if (!o || o.length < a) {
358
- let e = new Float64Array(a);
359
- o && l > 0 && e.set(o.subarray(0, l * 2)), o = e, this._flatMeasurements = o;
360
- }
361
- let s;
362
- if (l === 0) s = t + n;
363
- else {
364
- let e = l - 1;
365
- s = o[e * 2] + o[e * 2 + 1] + i;
366
- }
367
- for (let t = l; t < e; t++) {
368
- let e = r(t), n = c.get(e), a = typeof n == "number" ? n : this.options.estimateSize(t);
369
- o[t * 2] = s, o[t * 2 + 1] = a, s += a + i;
370
- }
371
- let u = m(e, o, r);
372
- return this.measurementsCache = u, u;
373
- }
374
- let u = this.measurementsCache.slice(0, l), d = Array(a).fill(void 0);
375
- for (let e = 0; e < l; e++) {
376
- let t = u[e];
377
- t && (d[t.lane] = e);
378
- }
379
- for (let i = l; i < e; i++) {
380
- let e = r(i), a = this.laneAssignments.get(i), s, l, f = o === "estimate" || c.has(e);
381
- if (a !== void 0 && this.options.lanes > 1) {
382
- s = a;
383
- let e = d[s], r = e === void 0 ? void 0 : u[e];
384
- l = r ? r.end + this.options.gap : t + n;
385
- } else {
386
- let e = this.options.lanes === 1 ? u[i - 1] : this.getFurthestMeasurement(u, i);
387
- l = e ? e.end + this.options.gap : t + n, s = e ? e.lane : i % this.options.lanes, this.options.lanes > 1 && f && this.laneAssignments.set(i, s);
388
- }
389
- let p = c.get(e), m = typeof p == "number" ? p : this.options.estimateSize(i), h = l + m;
390
- u[i] = {
391
- index: i,
392
- start: l,
393
- size: m,
394
- end: h,
395
- key: e,
396
- lane: s
397
- }, d[s] = i;
398
- }
399
- return this.measurementsCache = u, u;
400
- }, {
401
- key: !1,
402
- debug: () => this.options.debug
403
- }), this.calculateRange = h(() => [
404
- this.getMeasurements(),
405
- this.getSize(),
406
- this.getScrollOffset(),
407
- this.options.lanes
408
- ], (e, t, n, r) => e.length === 0 || t === 0 ? (this.range = null, null) : (this.range = P(e, t, n, r, r === 1 && this._flatMeasurements != null ? this._flatMeasurements : null), this.range), {
409
- key: !1,
410
- debug: () => this.options.debug
411
- }), this.getVirtualIndexes = h(() => {
412
- let e = null, t = null, n = this.calculateRange();
413
- return n && (e = n.startIndex, t = n.endIndex), this.maybeNotify.updateDeps([
414
- this.isScrolling,
415
- e,
416
- t
417
- ]), [
418
- this.options.rangeExtractor,
419
- this.options.overscan,
420
- this.options.count,
421
- e,
422
- t
423
- ];
424
- }, (e, t, n, r, i) => r === null || i === null ? [] : e({
425
- startIndex: r,
426
- endIndex: i,
427
- overscan: t,
428
- count: n
429
- }), {
430
- key: !1,
431
- debug: () => this.options.debug
432
- }), this.indexFromElement = (e) => {
433
- let t = this.options.indexAttribute, n = e.getAttribute(t);
434
- return n ? parseInt(n, 10) : (console.warn(`Missing attribute name '${t}={index}' on measured element.`), -1);
435
- }, this.shouldMeasureDuringScroll = (e) => {
436
- if (!this.scrollState || this.scrollState.behavior !== "smooth") return !0;
437
- let t = this.scrollState.index ?? this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;
438
- if (t !== void 0 && this.range) {
439
- let n = Math.max(this.options.overscan, Math.ceil((this.range.endIndex - this.range.startIndex) / 2)), r = Math.max(0, t - n), i = Math.min(this.options.count - 1, t + n);
440
- return e >= r && e <= i;
441
- }
442
- return !0;
443
- }, this.measureElement = (e) => {
444
- if (!e) {
445
- this.elementsCache.forEach((e, t) => {
446
- e.isConnected || (this.observer.unobserve(e), this.elementsCache.delete(t));
447
- });
448
- return;
449
- }
450
- let t = this.indexFromElement(e), n = this.options.getItemKey(t), r = this.elementsCache.get(n);
451
- r !== e && (r && this.observer.unobserve(r), this.observer.observe(e), this.elementsCache.set(n, e)), (!this.isScrolling || this.scrollState) && this.shouldMeasureDuringScroll(t) && this.resizeItem(t, this.options.measureElement(e, void 0, this));
452
- }, this.resizeItem = (e, t) => {
453
- if (e < 0 || e >= this.options.count) return;
454
- let n, r, i, a = this._flatMeasurements;
455
- if (this.options.lanes === 1 && a !== null) i = this.options.getItemKey(e), r = a[e * 2], n = a[e * 2 + 1];
456
- else {
457
- let t = this.measurementsCache[e];
458
- if (!t) return;
459
- i = t.key, r = t.start, n = t.size;
460
- }
461
- let o = t - (this.itemSizeCache.get(i) ?? n);
462
- if (o !== 0) {
463
- let a = this.options.anchorTo === "end" && this.scrollState?.behavior !== "smooth" && this.getVirtualDistanceFromEnd() <= this.options.scrollEndThreshold, s = a ? this.getTotalSize() : 0, c = this.scrollState?.behavior !== "smooth" && (this.shouldAdjustScrollPositionOnItemSizeChange === void 0 ? r < this.getScrollOffset() + this.scrollAdjustments && (!this.itemSizeCache.has(i) || this.scrollDirection !== "backward") : this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e] ?? {
464
- index: e,
465
- key: i,
466
- start: r,
467
- size: n,
468
- end: r + n,
469
- lane: 0
470
- }, o, this));
471
- (this.pendingMin === null || e < this.pendingMin) && (this.pendingMin = e), this.itemSizeCache.set(i, t), this.itemSizeCacheVersion++, a ? this.applyScrollAdjustment(this.getTotalSize() - s) : c && this.applyScrollAdjustment(o), this.notify(!1);
472
- }
473
- }, this.getVirtualItems = h(() => [this.getVirtualIndexes(), this.getMeasurements()], (e, t) => {
474
- let n = [];
475
- for (let r = 0, i = e.length; r < i; r++) {
476
- let i = t[e[r]];
477
- n.push(i);
478
- }
479
- return n;
480
- }, {
481
- key: !1,
482
- debug: () => this.options.debug
483
- }), this.getVirtualItemForOffset = (e) => {
484
- let t = this.getMeasurements();
485
- if (t.length === 0) return;
486
- let n = this._flatMeasurements, r = this.options.lanes === 1 && n != null;
487
- return g(t[M(0, t.length - 1, r ? (e) => n[e * 2] : (e) => g(t[e]).start, e)]);
488
- }, this.getMaxScrollOffset = () => {
489
- if (!this.scrollElement) return 0;
490
- if ("scrollHeight" in this.scrollElement) return this.options.horizontal ? this.scrollElement.scrollWidth - this.scrollElement.clientWidth : this.scrollElement.scrollHeight - this.scrollElement.clientHeight;
491
- {
492
- let e = this.scrollElement.document.documentElement;
493
- return this.options.horizontal ? e.scrollWidth - this.scrollElement.innerWidth : e.scrollHeight - this.scrollElement.innerHeight;
494
- }
495
- }, this.getVirtualDistanceFromEnd = () => Math.max(this.getTotalSize() - this.getSize() - this.getScrollOffset(), 0), this.getDistanceFromEnd = () => Math.max(this.getMaxScrollOffset() - this.getScrollOffset(), 0), this.isAtEnd = (e = this.options.scrollEndThreshold) => this.getDistanceFromEnd() <= e, this.getOffsetForAlignment = (e, t, n = 0) => {
496
- if (!this.scrollElement) return 0;
497
- let r = this.getSize(), i = this.getScrollOffset();
498
- t === "auto" && (t = e >= i + r ? "end" : "start"), t === "center" ? e += (n - r) / 2 : t === "end" && (e -= r);
499
- let a = this.getMaxScrollOffset();
500
- return Math.max(Math.min(a, e), 0);
501
- }, this.getOffsetForIndex = (e, t = "auto") => {
502
- e = Math.max(0, Math.min(e, this.options.count - 1));
503
- let n = this.getSize(), r = this.getScrollOffset(), i = this.measurementsCache[e];
504
- if (!i) return;
505
- if (t === "auto") if (i.end >= r + n - this.options.scrollPaddingEnd) t = "end";
506
- else if (i.start <= r + this.options.scrollPaddingStart) t = "start";
507
- else return [r, t];
508
- if (t === "end" && e === this.options.count - 1) return [this.getMaxScrollOffset(), t];
509
- let a = t === "end" ? i.end + this.options.scrollPaddingEnd : i.start - this.options.scrollPaddingStart;
510
- return [this.getOffsetForAlignment(a, t, i.size), t];
511
- }, this.scrollToOffset = (e, { align: t = "start", behavior: n = "auto" } = {}) => {
512
- let r = this.getOffsetForAlignment(e, t), i = this.now();
513
- this.scrollState = {
514
- index: null,
515
- align: t,
516
- behavior: n,
517
- startedAt: i,
518
- lastTargetOffset: r,
519
- stableFrames: 0
520
- }, this._scrollToOffset(r, {
521
- adjustments: void 0,
522
- behavior: n
523
- }), this.scheduleScrollReconcile();
524
- }, this.scrollToIndex = (e, { align: t = "auto", behavior: n = "auto" } = {}) => {
525
- e = Math.max(0, Math.min(e, this.options.count - 1));
526
- let r = this.getOffsetForIndex(e, t);
527
- if (!r) return;
528
- let [i, a] = r, o = this.now();
529
- this.scrollState = {
530
- index: e,
531
- align: a,
532
- behavior: n,
533
- startedAt: o,
534
- lastTargetOffset: i,
535
- stableFrames: 0
536
- }, this._scrollToOffset(i, {
537
- adjustments: void 0,
538
- behavior: n
539
- }), this.scheduleScrollReconcile();
540
- }, this.scrollBy = (e, { behavior: t = "auto" } = {}) => {
541
- let n = this.getScrollOffset() + e, r = this.now();
542
- this.scrollState = {
543
- index: null,
544
- align: "start",
545
- behavior: t,
546
- startedAt: r,
547
- lastTargetOffset: n,
548
- stableFrames: 0
549
- }, this._scrollToOffset(n, {
550
- adjustments: void 0,
551
- behavior: t
552
- }), this.scheduleScrollReconcile();
553
- }, this.scrollToEnd = ({ behavior: e = "auto" } = {}) => {
554
- if (this.options.count > 0) {
555
- this.scrollToIndex(this.options.count - 1, {
556
- align: "end",
557
- behavior: e
558
- });
559
- return;
560
- }
561
- this.scrollToOffset(Math.max(this.getTotalSize() - this.getSize(), 0), { behavior: e });
562
- }, this.getTotalSize = () => {
563
- let e = this.getMeasurements(), t;
564
- if (e.length === 0) t = this.options.paddingStart;
565
- else if (this.options.lanes === 1) {
566
- let n = e.length - 1, r = this._flatMeasurements;
567
- t = r == null ? e[n]?.end ?? 0 : r[n * 2] + r[n * 2 + 1];
568
- } else {
569
- let n = Array(this.options.lanes).fill(null), r = e.length - 1;
570
- for (; r >= 0 && n.some((e) => e === null);) {
571
- let t = e[r];
572
- n[t.lane] === null && (n[t.lane] = t.end), r--;
573
- }
574
- t = Math.max(...n.filter((e) => e !== null));
575
- }
576
- return Math.max(t - this.options.scrollMargin + this.options.paddingEnd, 0);
577
- }, this.takeSnapshot = () => {
578
- let e = [];
579
- if (this.itemSizeCache.size === 0) return e;
580
- let t = this.getMeasurements();
581
- for (let n of t) n && this.itemSizeCache.has(n.key) && e.push({
582
- index: n.index,
583
- key: n.key,
584
- start: n.start,
585
- size: n.size,
586
- end: n.end,
587
- lane: n.lane
588
- });
589
- return e;
590
- }, this._scrollToOffset = (e, { adjustments: t, behavior: n }) => {
591
- this._intendedScrollOffset = e + (t ?? 0), this.options.scrollToFn(e, {
592
- behavior: n,
593
- adjustments: t
594
- }, this);
595
- }, this.measure = () => {
596
- this.pendingMin = null, this.itemSizeCache.clear(), this.laneAssignments.clear(), this.itemSizeCacheVersion++, this.notify(!1);
597
- }, this.setOptions(e);
598
- }
599
- applyScrollAdjustment(e, t) {
600
- e !== 0 && (b() && (this.isScrolling || this._iosTouching || this._iosJustTouchEnded) ? this._iosDeferredAdjustment += e : (this._scrollToOffset(this.getScrollOffset(), {
601
- adjustments: this.scrollAdjustments += e,
602
- behavior: t
603
- }), this.scrollOffset !== null && (this.scrollOffset += this.scrollAdjustments, this.scrollAdjustments = 0)));
604
- }
605
- scheduleScrollReconcile() {
606
- if (!this.targetWindow) {
607
- this.scrollState = null;
608
- return;
609
- }
610
- this.rafId ??= this.targetWindow.requestAnimationFrame(() => {
611
- this.rafId = null, this.reconcileScroll();
612
- });
613
- }
614
- reconcileScroll() {
615
- if (!this.scrollState || !this.scrollElement) return;
616
- if (this.now() - this.scrollState.startedAt > 5e3) {
617
- this.scrollState = null;
618
- return;
619
- }
620
- let e = this.scrollState.index == null ? void 0 : this.getOffsetForIndex(this.scrollState.index, this.scrollState.align), t = e ? e[0] : this.scrollState.lastTargetOffset, n = t !== this.scrollState.lastTargetOffset;
621
- if (!n && _(t, this.getScrollOffset())) {
622
- if (this.scrollState.stableFrames++, this.scrollState.stableFrames >= 1) {
623
- this.getScrollOffset() !== t && this._scrollToOffset(t, {
624
- adjustments: void 0,
625
- behavior: "auto"
626
- }), this.scrollState = null;
627
- return;
628
- }
629
- } else if (this.scrollState.stableFrames = 0, n) {
630
- let e = this.getSize() || 600, n = Math.abs(t - this.getScrollOffset()), r = this.scrollState.behavior === "smooth" && n > e;
631
- this.scrollState.lastTargetOffset = t, r || (this.scrollState.behavior = "auto"), this._scrollToOffset(t, {
632
- adjustments: void 0,
633
- behavior: r ? "smooth" : "auto"
634
- });
635
- }
636
- this.scheduleScrollReconcile();
637
- }
638
- }, M = (e, t, n, r) => {
639
- for (; e <= t;) {
640
- let i = (e + t) / 2 | 0, a = n(i);
641
- if (a < r) e = i + 1;
642
- else if (a > r) t = i - 1;
643
- else return i;
644
- }
645
- return e > 0 ? e - 1 : 0;
646
- };
647
- function N(e, t, n) {
648
- let r = 0;
649
- for (; r <= t;) {
650
- let i = (r + t) / 2 | 0, a = e[i * 2];
651
- if (a < n) r = i + 1;
652
- else if (a > n) t = i - 1;
653
- else return i;
654
- }
655
- return r > 0 ? r - 1 : 0;
656
- }
657
- function P(e, t, n, r, i) {
658
- let a = e.length - 1;
659
- if (e.length <= r) return {
660
- startIndex: 0,
661
- endIndex: a
662
- };
663
- if (r === 1 && i !== null) {
664
- let e = N(i, a, n), r = e, o = n + t;
665
- for (; r < a && i[r * 2] + i[r * 2 + 1] < o;) r++;
666
- return {
667
- startIndex: e,
668
- endIndex: r
669
- };
670
- }
671
- let o = M(0, a, (t) => e[t].start, n), s = o;
672
- if (r === 1) for (; s < a && e[s].end < n + t;) s++;
673
- else if (r > 1) {
674
- let i = Array(r).fill(0);
675
- for (; s < a && i.some((e) => e < n + t);) {
676
- let t = e[s];
677
- i[t.lane] = t.end, s++;
678
- }
679
- let c = Array(r).fill(n + t);
680
- for (; o >= 0 && c.some((e) => e >= n);) {
681
- let t = e[o];
682
- c[t.lane] = t.start, o--;
683
- }
684
- o = Math.max(0, o - o % r), s = Math.min(a, s + (r - 1 - s % r));
685
- }
686
- return {
687
- startIndex: o,
688
- endIndex: s
689
- };
690
- }
691
- //#endregion
692
- //#region ../../node_modules/.pnpm/@tanstack+react-virtual@3.14.5_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@tanstack/react-virtual/dist/esm/index.js
693
- var F = typeof document < "u" ? e : i;
694
- function I({ useFlushSync: e = !0, directDomUpdates: i = !1, directDomUpdatesMode: a = "transform", ...o }) {
695
- let s = r((e) => e + 1, 0)[1], c = n({
696
- enabled: i,
697
- mode: a,
698
- container: null,
699
- lastSize: null,
700
- lastPositions: /* @__PURE__ */ new WeakMap(),
701
- prevRange: null
702
- });
703
- c.current.enabled = i, c.current.mode = a;
704
- let u = (e) => {
705
- let t = c.current;
706
- if (!t.enabled || !t.container) return;
707
- let n = e.getTotalSize();
708
- if (n !== t.lastSize) {
709
- t.lastSize = n;
710
- let r = e.options.horizontal ? "width" : "height";
711
- t.container.style[r] = `${n}px`;
712
- }
713
- let r = !!e.options.horizontal, i = t.mode === "transform", a = r ? "left" : "top", o = e.options.scrollMargin, s = e.getVirtualItems();
714
- for (let n of s) {
715
- let s = n.start - o, c = e.elementsCache.get(n.key);
716
- c && t.lastPositions.get(c) !== s && (t.lastPositions.set(c, s), i ? c.style.transform = r ? `translate3d(${s}px, 0, 0)` : `translate3d(0, ${s}px, 0)` : c.style[a] = `${s}px`);
717
- }
718
- }, d = {
719
- ...o,
720
- onChange: (t, n) => {
721
- var r;
722
- let i = c.current, a = !0;
723
- if (i.enabled) {
724
- u(t);
725
- let e = t.range, n = i.prevRange;
726
- a = !n || n.isScrolling !== t.isScrolling || n.startIndex !== e?.startIndex || n.endIndex !== e?.endIndex, a && (i.prevRange = e ? {
727
- startIndex: e.startIndex,
728
- endIndex: e.endIndex,
729
- isScrolling: t.isScrolling
730
- } : null);
731
- }
732
- a && (e && n ? l(s) : s()), (r = o.onChange) == null || r.call(o, t, n);
733
- }
734
- }, [f] = t(() => {
735
- let e = new j(d);
736
- return Object.assign(e, { containerRef: (t) => {
737
- let n = c.current;
738
- if (n.container = t, n.lastSize = null, t && n.enabled) {
739
- let r = e.getTotalSize();
740
- n.lastSize = r;
741
- let i = e.options.horizontal ? "width" : "height";
742
- t.style[i] = `${r}px`;
743
- }
744
- } });
745
- });
746
- return f.setOptions(d), F(() => f._didMount(), []), F(() => f._willUpdate()), F(() => {
747
- u(f);
748
- }), f;
749
- }
750
- function L(e) {
751
- return I({
752
- observeElementRect: w,
753
- observeElementOffset: O,
754
- scrollToFn: A,
755
- ...e
756
- });
757
- }
758
- //#endregion
759
- //#region src/components/virtual-table/use-infinite-virtual-scroll.tsx
760
- a();
761
- function R({ items: e, totalItems: t, parentRef: n, hasNextPage: r, isFetchingNextPage: a, fetchNextPage: o, estimateSize: s = () => 100, overscan: c = 5 }) {
762
- let l = L({
763
- count: t,
764
- getScrollElement: () => d(n.current),
765
- estimateSize: s,
766
- overscan: c
767
- }), u = l.getVirtualItems(), f = u.length > 0 ? (u.at(0)?.start ?? 0) - l.options.scrollMargin : 0, p = u.length > 0 ? l.getTotalSize() - (u.at(-1)?.end ?? 0) : 0, m = u.map((t) => ({
768
- virtualItem: t,
769
- key: t.key,
770
- item: e[t.index],
771
- props: {
772
- ref: l.measureElement,
773
- "data-index": t.index
774
- }
775
- })), h = m.at(-1) && !m.at(-1)?.item;
776
- return i(() => {
777
- r && h && !a && o();
778
- }, [
779
- r,
780
- h,
781
- a,
782
- o
783
- ]), {
784
- visibleItems: m,
785
- virtualizer: l,
786
- spaceBefore: f,
787
- spaceAfter: p
788
- };
789
- }
790
- //#endregion
791
- //#region src/components/virtual-table/virtual-list-window.ts
792
- a();
793
- var z = 1e3, B = "ghostVirtualListWindow";
794
- function V({ totalItems: e, unlockedItemCount: t }) {
795
- let n = Math.min(e, t);
796
- return {
797
- visibleItemCount: n,
798
- canLoadMore: e > n
799
- };
800
- }
801
- function H(e) {
802
- return e + z;
803
- }
804
- function U(e, t) {
805
- return `${e}::${t}`;
806
- }
807
- function W(e, t, n = z) {
808
- let r = e?.[B];
809
- if (!r || typeof r != "object") return n;
810
- let i = r[t];
811
- return typeof i != "number" || !Number.isFinite(i) ? n : Math.max(1, Math.floor(i));
812
- }
813
- function G(e, t, n) {
814
- if (typeof window > "u") return;
815
- let r = e?.[B], i = {
816
- ...e ?? {},
817
- [B]: {
818
- ...r && typeof r == "object" ? r : {},
819
- [t]: n
820
- }
821
- };
822
- window.history.replaceState(i, "");
823
- }
824
- function K() {
825
- if (!(typeof window > "u")) return window.history.state;
826
- }
827
- function q(e, { resetKey: r } = {}) {
828
- let { key: a, pathname: o, search: c } = s(), l = U(o, r ?? c), [u, d] = t(() => W(K(), l)), f = n(l);
829
- i(() => {
830
- if (f.current !== l) {
831
- f.current = l, d(W(K(), l));
832
- return;
833
- }
834
- G(K(), l, u);
835
- }, [
836
- l,
837
- a,
838
- u
839
- ]);
840
- let { visibleItemCount: p, canLoadMore: m } = V({
841
- totalItems: e,
842
- unlockedItemCount: u
843
- });
844
- return {
845
- visibleItemCount: p,
846
- canLoadMore: m,
847
- loadMore: () => d((e) => H(e))
848
- };
849
- }
850
- //#endregion
851
- export { R as n, p as r, q as t };
852
-
853
- //# sourceMappingURL=virtual-list-window-DP63Onpm.js.map