@marimo-team/frontend 0.24.1-dev99 → 0.24.2-dev129

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 (304) hide show
  1. package/dist/assets/{CellStatus-wvvZkEPY.js → CellStatus-LoTwk7fR.js} +1 -1
  2. package/dist/assets/{ConnectedDataExplorerComponent-Dkqk66Mv.js → ConnectedDataExplorerComponent-DW6cJ-Lr.js} +1 -1
  3. package/dist/assets/{ErrorBoundary-npvnLp9x.js → ErrorBoundary-CDVGFYfr.js} +1 -1
  4. package/dist/assets/JsonOutput-CzIGPEZQ.js +50 -0
  5. package/dist/assets/{LazyAnyLanguageCodeMirror-zSwE3dvU.js → LazyAnyLanguageCodeMirror-LboTfNDv.js} +2 -2
  6. package/dist/assets/{MarimoErrorOutput-CeUo5oka.js → MarimoErrorOutput-DqpoYOvw.js} +1 -1
  7. package/dist/assets/RenderHTML-DwhMAd9l.js +1 -0
  8. package/dist/assets/{RunButton-BaV8A-z4.js → RunButton-BlpbweyH.js} +1 -1
  9. package/dist/assets/{VisuallyHidden-SChAyKIQ.js → VisuallyHidden-CBMDmozt.js} +1 -1
  10. package/dist/assets/{add-cell-with-ai-DoLkfzYn.js → add-cell-with-ai-R-3DS79K.js} +1 -1
  11. package/dist/assets/{add-connection-dialog-C1IF1nR0.js → add-connection-dialog-BGfpw5lC.js} +1 -1
  12. package/dist/assets/{agent-panel-CG154QrU.js → agent-panel-Cgt_K0tD.js} +1 -1
  13. package/dist/assets/ai-model-dropdown-DCmiuk7x.js +3 -0
  14. package/dist/assets/alert-dialog-CA-2mBs3.js +11 -0
  15. package/dist/assets/any-language-editor-DflLjPSQ.js +1 -0
  16. package/dist/assets/{app-config-button-ktBH1pEB.js → app-config-button-DUJC6b6x.js} +1 -1
  17. package/dist/assets/badge-BSgtkC2e.js +1 -0
  18. package/dist/assets/{blob-DVtvZmWH.js → blob-B2d_dHwI.js} +1 -1
  19. package/dist/assets/button-Dh8EwhsF.js +1 -0
  20. package/dist/assets/{cache-panel-C7jsiqCa.js → cache-panel-DqgtC98s.js} +1 -1
  21. package/dist/assets/{capabilities-LWzb3E3M.js → capabilities-D8kPgMKr.js} +1 -1
  22. package/dist/assets/{cell-editor-DoDqaCZp.js → cell-editor-Dw09J9yD.js} +6 -6
  23. package/dist/assets/{cell-link-Dqqt6Rgs.js → cell-link-6burT2XF.js} +1 -1
  24. package/dist/assets/{cells-D4RwofRx.js → cells-Cp-G34Rz.js} +56 -56
  25. package/dist/assets/{chat-display-COmzHgx5.js → chat-display-Bu405iyc.js} +1 -1
  26. package/dist/assets/{chat-panel-B2tyEfGW.js → chat-panel-BlUwNY5j.js} +1 -1
  27. package/dist/assets/{chat-ui-B5bsr-7V.js → chat-ui-DGiVDzNh.js} +1 -1
  28. package/dist/assets/{circle--ysFeW9z.js → circle-ByJdIf5p.js} +1 -1
  29. package/dist/assets/{column-preview-CW5DPFvy.js → column-preview-riSXbYe_.js} +1 -1
  30. package/dist/assets/{command-palette-B9dyvMvJ.js → command-palette-CCVzJcyf.js} +1 -1
  31. package/dist/assets/{common-CC3tuCpi.js → common-CHR7w7aQ.js} +1 -1
  32. package/dist/assets/{components-D02ZZZMP.js → components-C7mWrmXr.js} +1 -1
  33. package/dist/assets/{components-CBlGIIAX.js → components-DUYCXngU.js} +1 -1
  34. package/dist/assets/config-B-r81uZ6.js +1 -0
  35. package/dist/assets/{config-D4frVGQ4.js → config-BlNM0caL.js} +1 -1
  36. package/dist/assets/{copy-Cg05mM3C.js → copy-DlEomWzI.js} +1 -1
  37. package/dist/assets/{copy-icon-CRxVZTJ9.js → copy-icon-z8fuTE3w.js} +1 -1
  38. package/dist/assets/{createReducer-Bq-nQJiK.js → createReducer-B_XmHROl.js} +1 -1
  39. package/dist/assets/{datasource-Do8f2hFf.js → datasource-DrODSIs0.js} +1 -1
  40. package/dist/assets/{dates-DK5JikJo.js → dates-B58T85Jq.js} +1 -1
  41. package/dist/assets/dependency-graph-panel-AY5BEVH2.js +5 -0
  42. package/dist/assets/{dist-7qdHLg-L.js → dist-B0RXffUm.js} +1 -1
  43. package/dist/assets/dist-B0qYy1Ye.js +1 -0
  44. package/dist/assets/{dist-B97dKQGP.js → dist-B8pdsUrS.js} +1 -1
  45. package/dist/assets/{dist-BcfF-rkl.js → dist-BF7Lrekv.js} +1 -1
  46. package/dist/assets/dist-BL8RjfvI.js +1 -0
  47. package/dist/assets/dist-BVZxge7j.js +1 -0
  48. package/dist/assets/{dist-fxnYzq-R.js → dist-BaRNSaca.js} +1 -1
  49. package/dist/assets/dist-Bk2yQtw4.js +1 -0
  50. package/dist/assets/dist-BsfiiKoy.js +1 -0
  51. package/dist/assets/dist-BskmVd3B.js +1 -0
  52. package/dist/assets/{dist-DL1Thauf.js → dist-Bsu3h9O7.js} +1 -1
  53. package/dist/assets/{dist-PIe1xcZo.js → dist-BtC9ym6k.js} +7 -7
  54. package/dist/assets/{dist-DeuWxYVk.js → dist-Bv0S1RlZ.js} +1 -1
  55. package/dist/assets/{dist-CidBzUqR.js → dist-C--ZICxQ.js} +1 -1
  56. package/dist/assets/dist-C-2fD3XY.js +1 -0
  57. package/dist/assets/{dist-DzAWvPVK.js → dist-CKUpxYGQ.js} +1 -1
  58. package/dist/assets/dist-CMFMfBm1.js +1 -0
  59. package/dist/assets/dist-CZNULd6Z.js +2 -0
  60. package/dist/assets/dist-CjFduPiC.js +1 -0
  61. package/dist/assets/{dist-DoAjHgMj.js → dist-CmImLjus.js} +1 -1
  62. package/dist/assets/{dist-BKx0MLbb.js → dist-Cq8NOszX.js} +1 -1
  63. package/dist/assets/{dist-DCc0VfiO.js → dist-Cx4BE7jC.js} +3 -3
  64. package/dist/assets/dist-D45ScydS.js +1 -0
  65. package/dist/assets/dist-D6dg87r7.js +1 -0
  66. package/dist/assets/dist-DEjfQLz0.js +1 -0
  67. package/dist/assets/{dist-BcYW-EJk.js → dist-DJOWOALB.js} +1 -1
  68. package/dist/assets/{dist-CxxZaSme.js → dist-DPoYlxSC.js} +1 -1
  69. package/dist/assets/dist-DR-Y-nl3.js +1 -0
  70. package/dist/assets/dist-Dahlp9JQ.js +1 -0
  71. package/dist/assets/{dist-DIkuvChK.js → dist-Db-HC93w.js} +1 -1
  72. package/dist/assets/{dist-DTM7BAUu.js → dist-DdOlZ6mj.js} +1 -1
  73. package/dist/assets/{dist-Dz_04liz.js → dist-DiYjQAhI.js} +1 -1
  74. package/dist/assets/{dist-BO5c5n_b.js → dist-DkPPv0FB.js} +1 -1
  75. package/dist/assets/{dist-DkCO0b-0.js → dist-DmGtPaVM.js} +1 -1
  76. package/dist/assets/{dist-CXmhxecl.js → dist-DnxYYyU7.js} +1 -1
  77. package/dist/assets/{dist-CO1Hfv5H.js → dist-Dw9YRsCU.js} +1 -1
  78. package/dist/assets/dist-Dwx3KdUP.js +1 -0
  79. package/dist/assets/{dist-BgL43w5r.js → dist-DzCQtGkt.js} +1 -1
  80. package/dist/assets/dist-JweaDt6P.js +1 -0
  81. package/dist/assets/{dist-Dbu5sPgR.js → dist-gELFCfHH.js} +1 -1
  82. package/dist/assets/dist-kGDJ0AWF.js +1 -0
  83. package/dist/assets/{dist-Cqm1W-Zm.js → dist-kaLvV_d4.js} +1 -1
  84. package/dist/assets/{dist-CEeRVpMD.js → dist-qvk3g06H.js} +1 -1
  85. package/dist/assets/dist-wCw2twuB.js +1 -0
  86. package/dist/assets/dist-wF42tUcr.js +1 -0
  87. package/dist/assets/dist-wY2yia-1.js +3 -0
  88. package/dist/assets/{documentation-panel-DvHjxlli.js → documentation-panel-CaJF7e-j.js} +1 -1
  89. package/dist/assets/{download-BP8MrprC.js → download-DMxOzI7b.js} +1 -1
  90. package/dist/assets/dropdown-menu-C40jM9o4.js +1 -0
  91. package/dist/assets/{edit-page-71cK-Nhe.js → edit-page-Vqd9NedM.js} +6 -6
  92. package/dist/assets/{error-banner-BYN8YUMe.js → error-banner-Dw5YY9wq.js} +1 -1
  93. package/dist/assets/{error-entries-DOZ1u97X.js → error-entries-Cv2m1yhc.js} +1 -1
  94. package/dist/assets/{error-panel-CINcf76Z.js → error-panel-Bhlvt6_H.js} +1 -1
  95. package/dist/assets/{es-BuMFDpR4.js → es-CrFhA96G.js} +1 -1
  96. package/dist/assets/{esm-Dw0vvSg2.js → esm-BHMOvJzM.js} +1 -1
  97. package/dist/assets/{esm-BGpfQNhD.js → esm-DmqQGMel.js} +1 -1
  98. package/dist/assets/file-explorer-panel-6HvNfCrJ.js +1 -0
  99. package/dist/assets/{file-icons-DgKj9mrV.js → file-icons-DdGYuADJ.js} +1 -1
  100. package/dist/assets/file-name-input-K4MKESI_.js +3 -0
  101. package/dist/assets/{floating-outline-CRXIsrPm.js → floating-outline-DaUHnl_e.js} +1 -1
  102. package/dist/assets/{formats-DSzGCKeO.js → formats-C6s96nu2.js} +1 -1
  103. package/dist/assets/{formatting-BJlT1s_3.js → formatting-BWZH2nBg.js} +1 -1
  104. package/dist/assets/{fullscreen-0EEPR7uc.js → fullscreen-BH2jz-F4.js} +5 -5
  105. package/dist/assets/{gallery-page-TqnFYECu.js → gallery-page-C3pBpHlY.js} +1 -1
  106. package/dist/assets/{glide-data-editor-DcY3nXI8.js → glide-data-editor-sICUMEhk.js} +1 -1
  107. package/dist/assets/{glide-utils-CR1sWLZU.js → glide-utils-UGsrRHYj.js} +1 -1
  108. package/dist/assets/home-page-BLd6rnbk.js +4 -0
  109. package/dist/assets/{html-to-image-DMn_7CCA.js → html-to-image-D6GUC5q6.js} +1 -1
  110. package/dist/assets/index-BGT7have.css +2 -0
  111. package/dist/assets/index-ipFYAeCF.js +29 -0
  112. package/dist/assets/{input-Daz6sk8l.js → input-DEbY281O.js} +2 -2
  113. package/dist/assets/{kiosk-mode-CzGt3mc2.js → kiosk-mode-mxgb5lWf.js} +1 -1
  114. package/dist/assets/{layout-KJMQADEj.js → layout-DWnrxIo2.js} +5 -5
  115. package/dist/assets/links-DLvOXyO_.js +1 -0
  116. package/dist/assets/{logs-panel-DFibPeCT.js → logs-panel-BGS2v3ba.js} +1 -1
  117. package/dist/assets/lua-1tNpM92n.js +1 -0
  118. package/dist/assets/{lua-CRIS5afH.js → lua-DXBxhmso.js} +1 -1
  119. package/dist/assets/{markdown-renderer-CdZX2MvM.js → markdown-renderer-BZKlbm2Q.js} +1 -1
  120. package/dist/assets/menu-items-BSRA2YI9.js +1 -0
  121. package/dist/assets/{mermaid-CeseGGnS.js → mermaid-l6lQkCib.js} +1 -1
  122. package/dist/assets/{name-cell-input-B-d5Jwh4.js → name-cell-input-BMCdK-el.js} +1 -1
  123. package/dist/assets/{numbers-DKurV_vq.js → numbers-Bc-r3jsC.js} +1 -1
  124. package/dist/assets/{outline-panel-D2Wk10hY.js → outline-panel-Dr5u73V6.js} +1 -1
  125. package/dist/assets/{packages-panel-CQsbxIlG.js → packages-panel-BdpRg9tX.js} +1 -1
  126. package/dist/assets/{pair-with-agent-modal-CNxmIMFM.js → pair-with-agent-modal-CbUFKJHP.js} +1 -1
  127. package/dist/assets/{panel-accordion-state-D6-FMXE2.js → panel-accordion-state-DjUTN7i5.js} +1 -1
  128. package/dist/assets/{panels-BgcK_4M7.js → panels-CWn0Yh1D.js} +1 -1
  129. package/dist/assets/process-output-Ck7-P_xp.js +1 -0
  130. package/dist/assets/{readonly-code-display-BvqLeUsJ.js → readonly-code-display--S2daDa6.js} +1 -1
  131. package/dist/assets/{readonly-python-code-GSN4D4sb.js → readonly-python-code-DpIyjHqY.js} +1 -1
  132. package/dist/assets/{renderShortcut-DK_OucLT.js → renderShortcut-X-CJUSM8.js} +1 -1
  133. package/dist/assets/{reveal-component-u9ED2diI.js → reveal-component-nZIAapoD.js} +1 -1
  134. package/dist/assets/{run-page-U5iuhyz8.js → run-page-9pl8qhQR.js} +1 -1
  135. package/dist/assets/{runs-BQTlv6Ja.js → runs-euHSzlw_.js} +1 -1
  136. package/dist/assets/{scratchpad-panel--YOR0kUB.js → scratchpad-panel-BleGt2KM.js} +1 -1
  137. package/dist/assets/{scroll-to-bottom-button-xua0e9rA.js → scroll-to-bottom-button-DufiYUD7.js} +1 -1
  138. package/dist/assets/{secrets-panel-CZPbFAZH.js → secrets-panel-D3BpDIgg.js} +1 -1
  139. package/dist/assets/select-nLt2y0Sw.js +1 -0
  140. package/dist/assets/{session-CEdta5_Q.js → session-Sz5nSFku.js} +1 -1
  141. package/dist/assets/session-panel-DRGPlL5J.js +1 -0
  142. package/dist/assets/{share-C2MPy_VX.js → share-CPtBiNgr.js} +1 -1
  143. package/dist/assets/{skeleton-CsceCAjw.js → skeleton-BKeh8hf3.js} +1 -1
  144. package/dist/assets/{snippets-panel-BxwHsPmW.js → snippets-panel-D5yy7kj0.js} +1 -1
  145. package/dist/assets/{spec-CUFquO6R.js → spec-DKsAmLTi.js} +1 -1
  146. package/dist/assets/{state-BqrF--O0.js → state-B6AklCzD.js} +1 -1
  147. package/dist/assets/{state-C2c3_VuY.js → state-B8XRqyFg.js} +1 -1
  148. package/dist/assets/{state-CHplO0zn.js → state-Di9TbuV9.js} +1 -1
  149. package/dist/assets/{strings-CpYReX2Q.js → strings-CReV1AYG.js} +1 -1
  150. package/dist/assets/{swiper-component-Bot7ehYH.js → swiper-component-5Kdi1-Gn.js} +1 -1
  151. package/dist/assets/{switch-CtH5Ct94.js → switch-DjXr9Y9D.js} +1 -1
  152. package/dist/assets/{tabs-c6mpccpH.js → tabs-Cy1qXLzH.js} +1 -1
  153. package/dist/assets/{terminal-C73iz1fU.js → terminal-CQAFGBfN.js} +1 -1
  154. package/dist/assets/{tooltip-Cwltdez8.js → tooltip-BG35uS_N.js} +1 -1
  155. package/dist/assets/{tooltip-D7dq6bnc.js → tooltip-BUtPzKB4.js} +1 -1
  156. package/dist/assets/{tracing-Dhq121dR.js → tracing-DNk3gmWv.js} +1 -1
  157. package/dist/assets/{tracing-panel-IKt1933_.js → tracing-panel-Yqazr6w_.js} +2 -2
  158. package/dist/assets/{tree-actions-DIfWonCA.js → tree-actions-CG5g7aUQ.js} +1 -1
  159. package/dist/assets/{useAddCell-BYrVaYfZ.js → useAddCell-DdB_uBif.js} +1 -1
  160. package/dist/assets/{useBoolean-ZU5StAbr.js → useBoolean-BXC4CItZ.js} +1 -1
  161. package/dist/assets/{useCellActionButton-DbXDs0MA.js → useCellActionButton-B31neI3m.js} +1 -1
  162. package/dist/assets/{useDebounce-Dulm61-t.js → useDebounce-DgpSQhrP.js} +1 -1
  163. package/dist/assets/{useDeleteCell-Wgcl3CRG.js → useDeleteCell-Bz49_cFj.js} +1 -1
  164. package/dist/assets/{useDependencyPanelTab-C5AU8GKL.js → useDependencyPanelTab-C_ps0r--.js} +1 -1
  165. package/dist/assets/{useEventListener-D27Dii_l.js → useEventListener-92uWqz-P.js} +1 -1
  166. package/dist/assets/{useIframeCapabilities-DEpTCh1Q.js → useIframeCapabilities-C7Di8f2y.js} +1 -1
  167. package/dist/assets/{useInstallPackage-u7d0wo79.js → useInstallPackage-DsD08SLK.js} +1 -1
  168. package/dist/assets/{useInterval-B1_J4wdT.js → useInterval-B4v7_zd0.js} +1 -1
  169. package/dist/assets/{useNotebookActions-FuMERtHq.js → useNotebookActions-CQtbk9CB.js} +2 -2
  170. package/dist/assets/{useRunCells-DTdMRbkE.js → useRunCells-CX7oW5zy.js} +1 -1
  171. package/dist/assets/{useSplitCell-2z0zEB8X.js → useSplitCell-Dy2_DmJR.js} +1 -1
  172. package/dist/assets/{useTheme-CF-zG9YH.js → useTheme-C-ri8BtY.js} +1 -1
  173. package/dist/assets/utils-D5Ywm7-q.js +1 -0
  174. package/dist/assets/{vega-component-BSXJcTJb.js → vega-component-C7TCzyaU.js} +1 -1
  175. package/dist/assets/write-secret-modal-D6zoZgLY.js +2 -0
  176. package/dist/index.html +73 -73
  177. package/package.json +26 -26
  178. package/src/components/ai/ai-provider-icon.tsx +2 -2
  179. package/src/components/ai/ai-utils.ts +1 -1
  180. package/src/components/app-config/ai-config.tsx +33 -37
  181. package/src/components/app-config/user-config-form.tsx +1 -1
  182. package/src/components/data-table/__tests__/column-explorer.test.tsx +64 -4
  183. package/src/components/data-table/__tests__/column-visibility-dropdown.test.tsx +137 -4
  184. package/src/components/data-table/__tests__/url-detector.test.tsx +1 -1
  185. package/src/components/data-table/__tests__/useColumnVisibility.test.ts +153 -1
  186. package/src/components/data-table/column-explorer-panel/column-explorer.tsx +54 -25
  187. package/src/components/data-table/column-visibility-dropdown.tsx +62 -14
  188. package/src/components/data-table/date-popover.tsx +2 -1
  189. package/src/components/data-table/hooks/use-column-visibility.ts +76 -0
  190. package/src/components/data-table/renderers.tsx +4 -8
  191. package/src/components/data-table/show-only-column-button.tsx +58 -0
  192. package/src/components/dependency-graph/__tests__/elements.test.ts +151 -0
  193. package/src/components/dependency-graph/custom-edge.tsx +68 -0
  194. package/src/components/dependency-graph/custom-node.tsx +54 -26
  195. package/src/components/dependency-graph/dependency-graph-tree.tsx +110 -21
  196. package/src/components/dependency-graph/elements.ts +225 -31
  197. package/src/components/dependency-graph/panels.tsx +23 -2
  198. package/src/components/dependency-graph/utils/__tests__/layout.test.ts +78 -0
  199. package/src/components/dependency-graph/utils/layout.ts +108 -18
  200. package/src/components/editor/Output.tsx +40 -0
  201. package/src/components/editor/__tests__/Output.test.tsx +85 -2
  202. package/src/components/editor/connections/secret-combobox.tsx +3 -1
  203. package/src/components/editor/file-tree/__tests__/file-explorer-navigation.test.tsx +832 -0
  204. package/src/components/editor/file-tree/__tests__/file-viewer.test.tsx +27 -0
  205. package/src/components/editor/file-tree/__tests__/requesting-tree.test.ts +130 -0
  206. package/src/components/editor/file-tree/file-browser-row.tsx +82 -0
  207. package/src/components/editor/file-tree/file-explorer.tsx +377 -159
  208. package/src/components/editor/file-tree/file-operations.tsx +1 -1
  209. package/src/components/editor/file-tree/file-search-results.tsx +142 -0
  210. package/src/components/editor/file-tree/file-tree-row.tsx +40 -0
  211. package/src/components/editor/file-tree/file-viewer.tsx +2 -1
  212. package/src/components/editor/file-tree/renderers.tsx +4 -2
  213. package/src/components/editor/file-tree/requesting-tree.tsx +162 -32
  214. package/src/components/editor/file-tree/use-file-search.ts +142 -0
  215. package/src/components/editor/file-tree/use-hover-expand.ts +34 -0
  216. package/src/components/editor/navigation/__tests__/navigation.test.ts +30 -0
  217. package/src/components/editor/navigation/navigation.ts +20 -0
  218. package/src/components/forms/form.tsx +6 -4
  219. package/src/components/home/components.tsx +1 -0
  220. package/src/components/static-html/share-modal.tsx +3 -2
  221. package/src/components/ui/__tests__/badge.test.ts +63 -0
  222. package/src/components/ui/__tests__/button.test.ts +19 -0
  223. package/src/components/ui/__tests__/fullscreen.test.tsx +88 -0
  224. package/src/components/ui/__tests__/menu-items.test.ts +31 -0
  225. package/src/components/ui/badge.tsx +9 -7
  226. package/src/components/ui/button.tsx +1 -0
  227. package/src/components/ui/combobox.tsx +1 -1
  228. package/src/components/ui/date-input.tsx +1 -1
  229. package/src/components/ui/dialog.tsx +3 -1
  230. package/src/components/ui/fullscreen.tsx +43 -1
  231. package/src/components/ui/input.tsx +5 -1
  232. package/src/components/ui/links.tsx +2 -1
  233. package/src/components/ui/menu-items.tsx +9 -9
  234. package/src/components/ui/native-select.tsx +2 -2
  235. package/src/components/ui/navigation.tsx +1 -1
  236. package/src/components/ui/range-slider.tsx +5 -3
  237. package/src/components/ui/select.tsx +1 -1
  238. package/src/components/ui/sheet.tsx +1 -1
  239. package/src/components/ui/toast.tsx +8 -5
  240. package/src/components/ui/toaster.tsx +2 -2
  241. package/src/core/ai/ids/__tests__/ids.test.ts +0 -8
  242. package/src/core/ai/ids/ids.ts +1 -1
  243. package/src/core/cells/__tests__/add-missing-import.test.ts +20 -0
  244. package/src/core/codemirror/language/__tests__/utils.test.ts +1 -1
  245. package/src/core/config/config-schema.ts +1 -0
  246. package/src/core/hotkeys/hotkeys.ts +5 -0
  247. package/src/core/network/__tests__/requests-toasting.test.tsx +14 -0
  248. package/src/core/network/requests-toasting.tsx +1 -1
  249. package/src/css/globals.css +28 -0
  250. package/src/hooks/useEventListener.ts +1 -1
  251. package/src/plugins/core/RenderHTML.tsx +6 -4
  252. package/src/plugins/impl/MatrixPlugin.tsx +1 -1
  253. package/src/plugins/impl/code/any-language-editor.tsx +7 -4
  254. package/src/plugins/impl/data-frames/__tests__/schema.test.ts +34 -1
  255. package/src/plugins/impl/data-frames/forms/__tests__/__snapshots__/form.test.tsx.snap +25 -25
  256. package/src/plugins/impl/data-frames/schema.ts +5 -11
  257. package/src/plugins/impl/panel/__tests__/utils.test.ts +4 -4
  258. package/src/plugins/impl/vega/__tests__/vega.test.ts +1 -1
  259. package/src/stories/cell.stories.tsx +15 -11
  260. package/src/utils/__tests__/events.test.ts +1 -1
  261. package/dist/assets/JsonOutput-CRLQQVKf.js +0 -50
  262. package/dist/assets/RenderHTML-YkwVPe9V.js +0 -1
  263. package/dist/assets/ai-model-dropdown-CrSrb8Zz.js +0 -3
  264. package/dist/assets/alert-dialog-BVi_GyOB.js +0 -11
  265. package/dist/assets/any-language-editor-BL8H-DwB.js +0 -1
  266. package/dist/assets/badge-D_-uqy2N.js +0 -1
  267. package/dist/assets/button-Btj6GXNy.js +0 -1
  268. package/dist/assets/config-ycxJQP2b.js +0 -1
  269. package/dist/assets/dependency-graph-panel-Dg-tUB9T.js +0 -5
  270. package/dist/assets/dist-2oRmY-BC.js +0 -1
  271. package/dist/assets/dist-8lhGoJ54.js +0 -3
  272. package/dist/assets/dist-B4QaGCvF.js +0 -1
  273. package/dist/assets/dist-B_ABJVTW.js +0 -1
  274. package/dist/assets/dist-Bke0Ybxy.js +0 -1
  275. package/dist/assets/dist-Bw8CAY5i.js +0 -1
  276. package/dist/assets/dist-BwmO3SSk.js +0 -1
  277. package/dist/assets/dist-C3KxgR0m.js +0 -1
  278. package/dist/assets/dist-CLE562nZ.js +0 -1
  279. package/dist/assets/dist-CLi0j3bw.js +0 -1
  280. package/dist/assets/dist-CMIyXejt.js +0 -1
  281. package/dist/assets/dist-CbQrIaPV.js +0 -2
  282. package/dist/assets/dist-CpgfIIzU.js +0 -1
  283. package/dist/assets/dist-D7aYPqs9.js +0 -1
  284. package/dist/assets/dist-DKCF5R0T.js +0 -1
  285. package/dist/assets/dist-DbFa9cik.js +0 -1
  286. package/dist/assets/dist-DdPuhs_-.js +0 -1
  287. package/dist/assets/dist-DkfdZExz.js +0 -1
  288. package/dist/assets/dist-hOh6JBwi.js +0 -1
  289. package/dist/assets/dist-mY1j_5eA.js +0 -1
  290. package/dist/assets/dist-tg3aVnpD.js +0 -1
  291. package/dist/assets/dropdown-menu-CqNabM1f.js +0 -1
  292. package/dist/assets/file-explorer-panel-cflxW8a7.js +0 -1
  293. package/dist/assets/file-name-input-CQF4Ovwx.js +0 -3
  294. package/dist/assets/home-page-DPRHPAQM.js +0 -4
  295. package/dist/assets/index-BkIXRAbi.css +0 -2
  296. package/dist/assets/index-p49fbIlR.js +0 -29
  297. package/dist/assets/links-DPh7yoP-.js +0 -1
  298. package/dist/assets/lua-_4wuYo1j.js +0 -1
  299. package/dist/assets/menu-items-BSVrMleU.js +0 -1
  300. package/dist/assets/process-output-DvTtgoMs.js +0 -1
  301. package/dist/assets/select-czJLm6jf.js +0 -1
  302. package/dist/assets/session-panel-C_N3WGWQ.js +0 -1
  303. package/dist/assets/utils-CWSZQEjr.js +0 -1
  304. package/dist/assets/write-secret-modal-lNU_7c2x.js +0 -2
@@ -1 +1 @@
1
- import{Qi as e}from"./cells-D4RwofRx.js";import{t}from"./cn-ldLVeaqm.js";import{t as n}from"./jsx-runtime-B74pBk57.js";import{t as r}from"./createLucideIcon-B7HeEoG2.js";import{n as i,t as a}from"./file-headphone-rFCxFRI8.js";import{t as o}from"./file-DF8n85RA.js";import{t as s}from"./image-ab13yGv4.js";var c=r(`file-code`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]),l=r(`file-play`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M15.033 13.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56v-4.704a.645.645 0 0 1 .967-.56z`,key:`1tzo1f`}]]),u=r(`file-spreadsheet`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 13h2`,key:`yr2amv`}],[`path`,{d:`M14 13h2`,key:`un5t4a`}],[`path`,{d:`M8 17h2`,key:`2yhykz`}],[`path`,{d:`M14 17h2`,key:`10kma7`}]]),d=r(`folder-archive`,[[`circle`,{cx:`15`,cy:`19`,r:`2`,key:`u2pros`}],[`path`,{d:`M20.9 19.8A2 2 0 0 0 22 18V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h5.1`,key:`1jj40k`}],[`path`,{d:`M15 11v-1`,key:`cntcp`}],[`path`,{d:`M15 17v-2`,key:`1279jj`}]]),f=r(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),p=n(),m={py:`python`,txt:`text`,md:`text`,qmd:`text`,log:`text`,png:`image`,jpg:`image`,jpeg:`image`,gif:`image`,svg:`image`,webp:`image`,csv:`data`,parquet:`data`,arrow:`data`,xlsx:`data`,json:`json`,js:`code`,ts:`code`,tsx:`code`,html:`code`,css:`code`,toml:`code`,yaml:`code`,yml:`code`,wasm:`code`,mp3:`audio`,m4a:`audio`,ogg:`audio`,wav:`audio`,mp4:`video`,m4v:`video`,mpeg:`video`,webm:`video`,mkv:`video`,pdf:`pdf`,zip:`zip`,tar:`zip`,gz:`zip`};function h(e){let t=e.split(`.`).pop()?.toLowerCase();return t?m[t]??`unknown`:`unknown`}var g={directory:f,python:c,code:c,json:i,text:e,image:s,audio:a,video:l,data:u,pdf:e,zip:d,unknown:o},_={directory:`text-amber-500`,python:`text-blue-500`,code:`text-blue-500`,json:`text-blue-500`,text:`text-muted-foreground`,image:`text-purple-500`,audio:`text-orange-500`,video:`text-orange-500`,data:`text-green-500`,pdf:`text-red-500`,zip:`text-muted-foreground`,unknown:`text-muted-foreground`};function v(e,n){let r=h(e),i=g[r],a=_[r];return(0,p.jsx)(i,{className:t(`h-3.5 w-3.5 shrink-0`,a,n)})}export{f as a,v as i,_ as n,h as r,g as t};
1
+ import{Qi as e}from"./cells-Cp-G34Rz.js";import{t}from"./cn-ldLVeaqm.js";import{t as n}from"./jsx-runtime-B74pBk57.js";import{t as r}from"./createLucideIcon-B7HeEoG2.js";import{n as i,t as a}from"./file-headphone-rFCxFRI8.js";import{t as o}from"./file-DF8n85RA.js";import{t as s}from"./image-ab13yGv4.js";var c=r(`file-code`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]),l=r(`file-play`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M15.033 13.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56v-4.704a.645.645 0 0 1 .967-.56z`,key:`1tzo1f`}]]),u=r(`file-spreadsheet`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 13h2`,key:`yr2amv`}],[`path`,{d:`M14 13h2`,key:`un5t4a`}],[`path`,{d:`M8 17h2`,key:`2yhykz`}],[`path`,{d:`M14 17h2`,key:`10kma7`}]]),d=r(`folder-archive`,[[`circle`,{cx:`15`,cy:`19`,r:`2`,key:`u2pros`}],[`path`,{d:`M20.9 19.8A2 2 0 0 0 22 18V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h5.1`,key:`1jj40k`}],[`path`,{d:`M15 11v-1`,key:`cntcp`}],[`path`,{d:`M15 17v-2`,key:`1279jj`}]]),f=r(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),p=n(),m={py:`python`,txt:`text`,md:`text`,qmd:`text`,log:`text`,png:`image`,jpg:`image`,jpeg:`image`,gif:`image`,svg:`image`,webp:`image`,csv:`data`,parquet:`data`,arrow:`data`,xlsx:`data`,json:`json`,js:`code`,ts:`code`,tsx:`code`,html:`code`,css:`code`,toml:`code`,yaml:`code`,yml:`code`,wasm:`code`,mp3:`audio`,m4a:`audio`,ogg:`audio`,wav:`audio`,mp4:`video`,m4v:`video`,mpeg:`video`,webm:`video`,mkv:`video`,pdf:`pdf`,zip:`zip`,tar:`zip`,gz:`zip`};function h(e){let t=e.split(`.`).pop()?.toLowerCase();return t?m[t]??`unknown`:`unknown`}var g={directory:f,python:c,code:c,json:i,text:e,image:s,audio:a,video:l,data:u,pdf:e,zip:d,unknown:o},_={directory:`text-amber-500`,python:`text-blue-500`,code:`text-blue-500`,json:`text-blue-500`,text:`text-muted-foreground`,image:`text-purple-500`,audio:`text-orange-500`,video:`text-orange-500`,data:`text-green-500`,pdf:`text-red-500`,zip:`text-muted-foreground`,unknown:`text-muted-foreground`};function v(e,n){let r=h(e),i=g[r],a=_[r];return(0,p.jsx)(i,{className:t(`h-3.5 w-3.5 shrink-0`,a,n)})}export{f as a,v as i,_ as n,h as r,g as t};
@@ -0,0 +1,3 @@
1
+ import{a as e,r as t,t as n}from"./rolldown-runtime-B0Z9INg1.js";import{t as r}from"./useEvent-xfs0Sn4r.js";import{t as i}from"./react-CBDbhulC.js";import{t as a}from"./compiler-runtime-CYIjoINj.js";import{_ as o}from"./useEventListener-92uWqz-P.js";import{t as s}from"./jsx-runtime-B74pBk57.js";import{o as c}from"./alert-dialog-CA-2mBs3.js";import{a as l}from"./tabs-Cy1qXLzH.js";import{a as u,p as d,r as f,t as p}from"./dropdown-menu-C40jM9o4.js";import{r as m}from"./requests-C6_IaFh7.js";import{t as h}from"./createLucideIcon-B7HeEoG2.js";import{n as g,t as _}from"./tree-actions-CG5g7aUQ.js";import{t as v}from"./copy-BMXKNElG.js";import{b as ee}from"./write-secret-modal-D6zoZgLY.js";import{t as y}from"./trash-2-D_HX-0qx.js";import{t as b}from"./use-toast-DpWHUGuF.js";import{t as te}from"./paths-zcL04qUW.js";import{a as ne}from"./errors-DzO-nXy-.js";import{t as re}from"./extends-CvVTau-c.js";import{i as ie,n as ae,r as x}from"./pathUtils-Cryrlpma.js";import{n as oe}from"./semaphore-BjoL5P0h.js";var se=h(`pen-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),S=e(i(),1),C=s(),ce=l();function le(e,t){return le=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},le(e,t)}function ue(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,le(e,t)}function de(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}var fe=n(((e,t)=>{t.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}})),pe=(0,S.createContext)({dragDropManager:void 0});function w(e){return`Minified Redux error #`+e+`; visit https://redux.js.org/Errors?code=`+e+` for the full message or use the non-minified dev environment for full errors. `}var me=(function(){return typeof Symbol==`function`&&Symbol.observable||`@@observable`})(),he=function(){return Math.random().toString(36).substring(7).split(``).join(`.`)},ge={INIT:`@@redux/INIT`+he(),REPLACE:`@@redux/REPLACE`+he(),PROBE_UNKNOWN_ACTION:function(){return`@@redux/PROBE_UNKNOWN_ACTION`+he()}};function _e(e){if(typeof e!=`object`||!e)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function ve(e,t,n){var r;if(typeof t==`function`&&typeof n==`function`||typeof n==`function`&&typeof arguments[3]==`function`)throw Error(w(0));if(typeof t==`function`&&n===void 0&&(n=t,t=void 0),n!==void 0){if(typeof n!=`function`)throw Error(w(1));return n(ve)(e,t)}if(typeof e!=`function`)throw Error(w(2));var i=e,a=t,o=[],s=o,c=!1;function l(){s===o&&(s=o.slice())}function u(){if(c)throw Error(w(3));return a}function d(e){if(typeof e!=`function`)throw Error(w(4));if(c)throw Error(w(5));var t=!0;return l(),s.push(e),function(){if(t){if(c)throw Error(w(6));t=!1,l();var n=s.indexOf(e);s.splice(n,1),o=null}}}function f(e){if(!_e(e))throw Error(w(7));if(e.type===void 0)throw Error(w(8));if(c)throw Error(w(9));try{c=!0,a=i(a,e)}finally{c=!1}for(var t=o=s,n=0;n<t.length;n++){var r=t[n];r()}return e}function p(e){if(typeof e!=`function`)throw Error(w(10));i=e,f({type:ge.REPLACE})}function m(){var e,t=d;return e={subscribe:function(e){if(typeof e!=`object`||!e)throw Error(w(11));function n(){e.next&&e.next(u())}return n(),{unsubscribe:t(n)}}},e[me]=function(){return this},e}return f({type:ge.INIT}),r={dispatch:f,subscribe:d,getState:u,replaceReducer:p},r[me]=m,r}function T(e,t,...n){if(ye()&&t===void 0)throw Error(`invariant requires an error message argument`);if(!e){let e;if(t===void 0)e=Error(`Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.`);else{let r=0;e=Error(t.replace(/%s/g,function(){return n[r++]})),e.name=`Invariant Violation`}throw e.framesToPop=1,e}}function ye(){return typeof process<`u`&&!0}function be(e,t,n){return t.split(`.`).reduce((e,t)=>e&&e[t]?e[t]:n||null,e)}function xe(e,t){return e.filter(e=>e!==t)}function Se(e){return typeof e==`object`}function Ce(e,t){let n=new Map,r=e=>{n.set(e,n.has(e)?n.get(e)+1:1)};e.forEach(r),t.forEach(r);let i=[];return n.forEach((e,t)=>{e===1&&i.push(t)}),i}function we(e,t){return e.filter(e=>t.indexOf(e)>-1)}var Te=`dnd-core/INIT_COORDS`,E=`dnd-core/BEGIN_DRAG`,Ee=`dnd-core/PUBLISH_DRAG_SOURCE`,D=`dnd-core/HOVER`,O=`dnd-core/DROP`,k=`dnd-core/END_DRAG`;function De(e,t){return{type:Te,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}var Oe={type:Te,payload:{clientOffset:null,sourceClientOffset:null}};function ke(e){return function(t=[],n={publishSource:!0}){let{publishSource:r=!0,clientOffset:i,getSourceClientOffset:a}=n,o=e.getMonitor(),s=e.getRegistry();e.dispatch(De(i)),Ae(t,o,s);let c=Ne(t,o);if(c==null){e.dispatch(Oe);return}let l=null;if(i){if(!a)throw Error(`getSourceClientOffset must be defined`);je(a),l=a(c)}e.dispatch(De(i,l));let u=s.getSource(c).beginDrag(o,c);return u==null?void 0:(Me(u),s.pinSource(c),{type:E,payload:{itemType:s.getSourceType(c),item:u,sourceId:c,clientOffset:i||null,sourceClientOffset:l||null,isSourcePublic:!!r}})}}function Ae(e,t,n){T(!t.isDragging(),`Cannot call beginDrag while dragging.`),e.forEach(function(e){T(n.getSource(e),`Expected sourceIds to be registered.`)})}function je(e){T(typeof e==`function`,`When clientOffset is provided, getSourceClientOffset must be a function.`)}function Me(e){T(Se(e),`Item must be an object.`)}function Ne(e,t){let n=null;for(let r=e.length-1;r>=0;r--)if(t.canDragSource(e[r])){n=e[r];break}return n}function Pe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t],r=Object.keys(n);typeof Object.getOwnPropertySymbols==`function`&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){Pe(e,t,n[t])})}return e}function Ie(e){return function(t={}){let n=e.getMonitor(),r=e.getRegistry();Le(n),Be(n).forEach((i,a)=>{let o={type:O,payload:{dropResult:Fe({},t,Re(i,a,r,n))}};e.dispatch(o)})}}function Le(e){T(e.isDragging(),`Cannot call drop while not dragging.`),T(!e.didDrop(),`Cannot call drop twice during one drag operation.`)}function Re(e,t,n,r){let i=n.getTarget(e),a=i?i.drop(r,e):void 0;return ze(a),a===void 0&&(a=t===0?{}:r.getDropResult()),a}function ze(e){T(e===void 0||Se(e),`Drop result must either be an object or undefined.`)}function Be(e){let t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function Ve(e){return function(){let t=e.getMonitor(),n=e.getRegistry();He(t);let r=t.getSourceId();return r!=null&&(n.getSource(r,!0).endDrag(t,r),n.unpinSource()),{type:k}}}function He(e){T(e.isDragging(),`Cannot call endDrag while not dragging.`)}function Ue(e,t){return t===null?e===null:Array.isArray(e)?e.some(e=>e===t):e===t}function We(e){return function(t,{clientOffset:n}={}){Ge(t);let r=t.slice(0),i=e.getMonitor(),a=e.getRegistry();return qe(r,a,i.getItemType()),Ke(r,i,a),Je(r,i,a),{type:D,payload:{targetIds:r,clientOffset:n||null}}}}function Ge(e){T(Array.isArray(e),`Expected targetIds to be an array.`)}function Ke(e,t,n){T(t.isDragging(),`Cannot call hover while not dragging.`),T(!t.didDrop(),`Cannot call hover after drop.`);for(let t=0;t<e.length;t++){let r=e[t];T(e.lastIndexOf(r)===t,`Expected targetIds to be unique in the passed array.`),T(n.getTarget(r),`Expected targetIds to be registered.`)}}function qe(e,t,n){for(let r=e.length-1;r>=0;r--){let i=e[r];Ue(t.getTargetType(i),n)||e.splice(r,1)}}function Je(e,t,n){e.forEach(function(e){n.getTarget(e).hover(t,e)})}function Ye(e){return function(){if(e.getMonitor().isDragging())return{type:Ee}}}function Xe(e){return{beginDrag:ke(e),publishDragSource:Ye(e),hover:We(e),drop:Ie(e),endDrag:Ve(e)}}var Ze=class{receiveBackend(e){this.backend=e}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){let e=this,{dispatch:t}=this.store;function n(n){return(...r)=>{let i=n.apply(e,r);i!==void 0&&t(i)}}let r=Xe(this);return Object.keys(r).reduce((e,t)=>{let i=r[t];return e[t]=n(i),e},{})}dispatch(e){this.store.dispatch(e)}constructor(e,t){this.isSetUp=!1,this.handleRefCountChange=()=>{let e=this.store.getState().refCount>0;this.backend&&(e&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!e&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=e,this.monitor=t,e.subscribe(this.handleRefCountChange)}};function Qe(e,t){return{x:e.x+t.x,y:e.y+t.y}}function $e(e,t){return{x:e.x-t.x,y:e.y-t.y}}function et(e){let{clientOffset:t,initialClientOffset:n,initialSourceClientOffset:r}=e;return!t||!n||!r?null:$e(Qe(t,r),n)}function tt(e){let{clientOffset:t,initialClientOffset:n}=e;return!t||!n?null:$e(t,n)}var A=[],nt=[];A.__IS_NONE__=!0,nt.__IS_ALL__=!0;function rt(e,t){return e===A?!1:e===nt||t===void 0||we(t,e).length>0}var it=class{subscribeToStateChange(e,t={}){let{handlerIds:n}=t;T(typeof e==`function`,`listener must be a function.`),T(n===void 0||Array.isArray(n),`handlerIds, when specified, must be an array of strings.`);let r=this.store.getState().stateId;return this.store.subscribe(()=>{let t=this.store.getState(),i=t.stateId;try{i===r||i===r+1&&!rt(t.dirtyHandlerIds,n)||e()}finally{r=i}})}subscribeToOffsetChange(e){T(typeof e==`function`,`listener must be a function.`);let t=this.store.getState().dragOffset;return this.store.subscribe(()=>{let n=this.store.getState().dragOffset;n!==t&&(t=n,e())})}canDragSource(e){if(!e)return!1;let t=this.registry.getSource(e);return T(t,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()&&t.canDrag(this,e)}canDropOnTarget(e){if(!e)return!1;let t=this.registry.getTarget(e);return T(t,`Expected to find a valid target. targetId=${e}`),!this.isDragging()||this.didDrop()?!1:Ue(this.registry.getTargetType(e),this.getItemType())&&t.canDrop(this,e)}isDragging(){return!!this.getItemType()}isDraggingSource(e){if(!e)return!1;let t=this.registry.getSource(e,!0);return T(t,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()||!this.isSourcePublic()||this.registry.getSourceType(e)!==this.getItemType()?!1:t.isDragging(this,e)}isOverTarget(e,t={shallow:!1}){if(!e)return!1;let{shallow:n}=t;if(!this.isDragging())return!1;let r=this.registry.getTargetType(e),i=this.getItemType();if(i&&!Ue(r,i))return!1;let a=this.getTargetIds();if(!a.length)return!1;let o=a.indexOf(e);return n?o===a.length-1:o>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return et(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return tt(this.store.getState().dragOffset)}constructor(e,t){this.store=e,this.registry=t}},at=typeof global<`u`?global:self,ot=at.MutationObserver||at.WebKitMutationObserver;function st(e){return function(){let t=setTimeout(r,0),n=setInterval(r,50);function r(){clearTimeout(t),clearInterval(n),e()}}}function ct(e){let t=1,n=new ot(e),r=document.createTextNode(``);return n.observe(r,{characterData:!0}),function(){t=-t,r.data=t}}var lt=typeof ot==`function`?ct:st,ut=class{enqueueTask(e){let{queue:t,requestFlush:n}=this;t.length||(n(),this.flushing=!0),t[t.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{let{queue:e}=this;for(;this.index<e.length;){let t=this.index;if(this.index++,e[t].call(),this.index>this.capacity){for(let t=0,n=e.length-this.index;t<n;t++)e[t]=e[t+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=lt(this.flush),this.requestErrorThrow=st(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}},dt=class{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,t){this.onError=e,this.release=t,this.task=null}},ft=class{create(e){let t=this.freeTasks,n=t.length?t.pop():new dt(this.onError,e=>t[t.length]=e);return n.task=e,n}constructor(e){this.onError=e,this.freeTasks=[]}},pt=new ut,mt=new ft(pt.registerPendingError);function ht(e){pt.enqueueTask(mt.create(e))}var gt=`dnd-core/ADD_SOURCE`,_t=`dnd-core/ADD_TARGET`,vt=`dnd-core/REMOVE_SOURCE`,j=`dnd-core/REMOVE_TARGET`;function yt(e){return{type:gt,payload:{sourceId:e}}}function bt(e){return{type:_t,payload:{targetId:e}}}function xt(e){return{type:vt,payload:{sourceId:e}}}function St(e){return{type:j,payload:{targetId:e}}}function Ct(e){T(typeof e.canDrag==`function`,`Expected canDrag to be a function.`),T(typeof e.beginDrag==`function`,`Expected beginDrag to be a function.`),T(typeof e.endDrag==`function`,`Expected endDrag to be a function.`)}function wt(e){T(typeof e.canDrop==`function`,`Expected canDrop to be a function.`),T(typeof e.hover==`function`,`Expected hover to be a function.`),T(typeof e.drop==`function`,`Expected beginDrag to be a function.`)}function Tt(e,t){if(t&&Array.isArray(e)){e.forEach(e=>Tt(e,!1));return}T(typeof e==`string`||typeof e==`symbol`,t?`Type can only be a string, a symbol, or an array of either.`:`Type can only be a string or a symbol.`)}var M;(function(e){e.SOURCE=`SOURCE`,e.TARGET=`TARGET`})(M||={});var Et=0;function Dt(){return Et++}function Ot(e){let t=Dt().toString();switch(e){case M.SOURCE:return`S${t}`;case M.TARGET:return`T${t}`;default:throw Error(`Unknown Handler Role: ${e}`)}}function kt(e){switch(e[0]){case`S`:return M.SOURCE;case`T`:return M.TARGET;default:throw Error(`Cannot parse handler ID: ${e}`)}}function At(e,t){let n=e.entries(),r=!1;do{let{done:e,value:[,i]}=n.next();if(i===t)return!0;r=!!e}while(!r);return!1}var jt=class{addSource(e,t){Tt(e),Ct(t);let n=this.addHandler(M.SOURCE,e,t);return this.store.dispatch(yt(n)),n}addTarget(e,t){Tt(e,!0),wt(t);let n=this.addHandler(M.TARGET,e,t);return this.store.dispatch(bt(n)),n}containsHandler(e){return At(this.dragSources,e)||At(this.dropTargets,e)}getSource(e,t=!1){return T(this.isSourceId(e),`Expected a valid source ID.`),t&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}getTarget(e){return T(this.isTargetId(e),`Expected a valid target ID.`),this.dropTargets.get(e)}getSourceType(e){return T(this.isSourceId(e),`Expected a valid source ID.`),this.types.get(e)}getTargetType(e){return T(this.isTargetId(e),`Expected a valid target ID.`),this.types.get(e)}isSourceId(e){return kt(e)===M.SOURCE}isTargetId(e){return kt(e)===M.TARGET}removeSource(e){T(this.getSource(e),`Expected an existing source.`),this.store.dispatch(xt(e)),ht(()=>{this.dragSources.delete(e),this.types.delete(e)})}removeTarget(e){T(this.getTarget(e),`Expected an existing target.`),this.store.dispatch(St(e)),this.dropTargets.delete(e),this.types.delete(e)}pinSource(e){let t=this.getSource(e);T(t,`Expected an existing source.`),this.pinnedSourceId=e,this.pinnedSource=t}unpinSource(){T(this.pinnedSource,`No source is pinned at the time.`),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(e,t,n){let r=Ot(e);return this.types.set(r,t),e===M.SOURCE?this.dragSources.set(r,n):e===M.TARGET&&this.dropTargets.set(r,n),r}constructor(e){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=e}},Mt=(e,t)=>e===t;function Nt(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function Pt(e,t,n=Mt){if(e.length!==t.length)return!1;for(let r=0;r<e.length;++r)if(!n(e[r],t[r]))return!1;return!0}function Ft(e=A,t){switch(t.type){case D:break;case gt:case _t:case j:case vt:return A;case E:case Ee:case k:case O:default:return nt}let{targetIds:n=[],prevTargetIds:r=[]}=t.payload,i=Ce(n,r);if(!(i.length>0||!Pt(n,r)))return A;let a=r[r.length-1],o=n[n.length-1];return a!==o&&(a&&i.push(a),o&&i.push(o)),i}function It(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t],r=Object.keys(n);typeof Object.getOwnPropertySymbols==`function`&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){It(e,t,n[t])})}return e}var Rt={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function zt(e=Rt,t){let{payload:n}=t;switch(t.type){case Te:case E:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case D:return Nt(e.clientOffset,n.clientOffset)?e:Lt({},e,{clientOffset:n.clientOffset});case k:case O:return Rt;default:return e}}function Bt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t],r=Object.keys(n);typeof Object.getOwnPropertySymbols==`function`&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){Bt(e,t,n[t])})}return e}var Vt={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Ht(e=Vt,t){let{payload:n}=t;switch(t.type){case E:return N({},e,{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case Ee:return N({},e,{isSourcePublic:!0});case D:return N({},e,{targetIds:n.targetIds});case j:return e.targetIds.indexOf(n.targetId)===-1?e:N({},e,{targetIds:xe(e.targetIds,n.targetId)});case O:return N({},e,{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case k:return N({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function Ut(e=0,t){switch(t.type){case gt:case _t:return e+1;case vt:case j:return e-1;default:return e}}function Wt(e=0){return e+1}function Gt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t],r=Object.keys(n);typeof Object.getOwnPropertySymbols==`function`&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){Gt(e,t,n[t])})}return e}function qt(e={},t){return{dirtyHandlerIds:Ft(e.dirtyHandlerIds,{type:t.type,payload:Kt({},t.payload,{prevTargetIds:be(e,`dragOperation.targetIds`,[])})}),dragOffset:zt(e.dragOffset,t),refCount:Ut(e.refCount,t),dragOperation:Ht(e.dragOperation,t),stateId:Wt(e.stateId)}}function Jt(e,t=void 0,n={},r=!1){let i=Yt(r),a=new Ze(i,new it(i,new jt(i))),o=e(a,t,n);return a.receiveBackend(o),a}function Yt(e){let t=typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION__;return ve(qt,e&&t&&t({name:`dnd-core`,instanceId:`dnd-core`}))}function Xt(e,t){if(e==null)return{};var n=Zt(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Zt(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var Qt=0,$t=Symbol.for(`__REACT_DND_CONTEXT_INSTANCE__`),en=(0,S.memo)(function(e){var{children:t}=e;let[n,r]=tn(Xt(e,[`children`]));return(0,S.useEffect)(()=>{if(r){let e=rn();return++Qt,()=>{--Qt===0&&(e[$t]=null)}}},[]),(0,C.jsx)(pe.Provider,{value:n,children:t})});function tn(e){return`manager`in e?[{dragDropManager:e.manager},!1]:[nn(e.backend,e.context,e.options,e.debugMode),!e.context]}function nn(e,t=rn(),n,r){let i=t;return i[$t]||(i[$t]={dragDropManager:Jt(e,t,n,r)}),i[$t]}function rn(){return typeof global<`u`?global:window}var an=e(fe(),1),P=typeof window<`u`?S.useLayoutEffect:S.useEffect;function on(e,t,n){let[r,i]=(0,S.useState)(()=>t(e)),a=(0,S.useCallback)(()=>{let a=t(e);(0,an.default)(r,a)||(i(a),n&&n())},[r,e,n]);return P(a),[r,a]}function sn(e,t,n){let[r,i]=on(e,t,n);return P(function(){let t=e.getHandlerId();if(t!=null)return e.subscribeToStateChange(i,{handlerIds:[t]})},[e,i]),r}function cn(e,t,n){return sn(t,e||(()=>({})),()=>n.reconnect())}function ln(e,t){let n=[...t||[]];return t==null&&typeof e!=`function`&&n.push(e),(0,S.useMemo)(()=>typeof e==`function`?e():e,n)}function un(e){return(0,S.useMemo)(()=>e.hooks.dragSource(),[e])}function dn(e){return(0,S.useMemo)(()=>e.hooks.dragPreview(),[e])}var fn=!1,pn=!1,mn=class{receiveHandlerId(e){this.sourceId=e}getHandlerId(){return this.sourceId}canDrag(){T(!fn,`You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor`);try{return fn=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{fn=!1}}isDragging(){if(!this.sourceId)return!1;T(!pn,`You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor`);try{return pn=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{pn=!1}}subscribeToStateChange(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}isDraggingSource(e){return this.internalMonitor.isDraggingSource(e)}isOverTarget(e,t){return this.internalMonitor.isOverTarget(e,t)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(e){return this.internalMonitor.subscribeToOffsetChange(e)}canDragSource(e){return this.internalMonitor.canDragSource(e)}canDropOnTarget(e){return this.internalMonitor.canDropOnTarget(e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.sourceId=null,this.internalMonitor=e.getMonitor()}},hn=!1,gn=class{receiveHandlerId(e){this.targetId=e}getHandlerId(){return this.targetId}subscribeToStateChange(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}canDrop(){if(!this.targetId)return!1;T(!hn,`You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor`);try{return hn=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{hn=!1}}isOver(e){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,e):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.targetId=null,this.internalMonitor=e.getMonitor()}};function _n(e,t,n){let r=n.getRegistry(),i=r.addTarget(e,t);return[i,()=>r.removeTarget(i)]}function vn(e,t,n){let r=n.getRegistry(),i=r.addSource(e,t);return[i,()=>r.removeSource(i)]}function yn(e,t,n,r){let i=n?n.call(r,e,t):void 0;if(i!==void 0)return!!i;if(e===t)return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;let a=Object.keys(e),o=Object.keys(t);if(a.length!==o.length)return!1;let s=Object.prototype.hasOwnProperty.bind(t);for(let o=0;o<a.length;o++){let c=a[o];if(!s(c))return!1;let l=e[c],u=t[c];if(i=n?n.call(r,l,u,c):void 0,i===!1||i===void 0&&l!==u)return!1}return!0}function bn(e){return typeof e==`object`&&!!e&&Object.prototype.hasOwnProperty.call(e,`current`)}function xn(e){if(typeof e.type==`string`)return;let t=e.type.displayName||e.type.name||`the component`;throw Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${t} into a <div>, or turn it into a drag source or a drop target itself.`)}function Sn(e){return(t=null,n=null)=>{if(!(0,S.isValidElement)(t)){let r=t;return e(r,n),r}let r=t;return xn(r),Tn(r,n?t=>e(t,n):e)}}function Cn(e){let t={};return Object.keys(e).forEach(n=>{let r=e[n];if(n.endsWith(`Ref`))t[n]=e[n];else{let e=Sn(r);t[n]=()=>e}}),t}function wn(e,t){typeof e==`function`?e(t):e.current=t}function Tn(e,t){let n=e.ref;return T(typeof n!=`string`,`Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs`),n?(0,S.cloneElement)(e,{ref:e=>{wn(n,e),wn(t,e)}}):(0,S.cloneElement)(e,{ref:t})}var En=class{receiveHandlerId(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(e){this.dragSourceOptionsInternal=e}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(e){this.dragPreviewOptionsInternal=e}reconnect(){let e=this.reconnectDragSource();this.reconnectDragPreview(e)}reconnectDragSource(){let e=this.dragSource,t=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return t&&this.disconnectDragSource(),this.handlerId?e?(t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)),t):(this.lastConnectedDragSource=e,t):t}reconnectDragPreview(e=!1){let t=this.dragPreview,n=e||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(n&&this.disconnectDragPreview(),this.handlerId){if(!t){this.lastConnectedDragPreview=t;return}n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=t,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,t,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!yn(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!yn(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&=(this.dragSourceUnsubscribe(),void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(e){this.hooks=Cn({dragSource:(e,t)=>{this.clearDragSource(),this.dragSourceOptions=t||null,bn(e)?this.dragSourceRef=e:this.dragSourceNode=e,this.reconnectDragSource()},dragPreview:(e,t)=>{this.clearDragPreview(),this.dragPreviewOptions=t||null,bn(e)?this.dragPreviewRef=e:this.dragPreviewNode=e,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=e}},Dn=class{get connectTarget(){return this.dropTarget}reconnect(){let e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();let t=this.dropTarget;if(this.handlerId){if(!t){this.lastConnectedDropTarget=t;return}e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=t,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,t,this.dropTargetOptions))}}receiveHandlerId(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(e){this.dropTargetOptionsInternal=e}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!yn(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&=(this.unsubscribeDropTarget(),void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(e){this.hooks=Cn({dropTarget:(e,t)=>{this.clearDropTarget(),this.dropTargetOptions=t,bn(e)?this.dropTargetRef=e:this.dropTargetNode=e,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=e}};function F(){let{dragDropManager:e}=(0,S.useContext)(pe);return T(e!=null,`Expected drag drop context`),e}function On(e,t){let n=F(),r=(0,S.useMemo)(()=>new En(n.getBackend()),[n]);return P(()=>(r.dragSourceOptions=e||null,r.reconnect(),()=>r.disconnectDragSource()),[r,e]),P(()=>(r.dragPreviewOptions=t||null,r.reconnect(),()=>r.disconnectDragPreview()),[r,t]),r}function kn(){let e=F();return(0,S.useMemo)(()=>new mn(e),[e])}var An=class{beginDrag(){let e=this.spec,t=this.monitor,n=null;return n=typeof e.item==`object`?e.item:typeof e.item==`function`?e.item(t):{},n??null}canDrag(){let e=this.spec,t=this.monitor;return typeof e.canDrag==`boolean`?e.canDrag:typeof e.canDrag!=`function`||e.canDrag(t)}isDragging(e,t){let n=this.spec,r=this.monitor,{isDragging:i}=n;return i?i(r):t===e.getSourceId()}endDrag(){let e=this.spec,t=this.monitor,n=this.connector,{end:r}=e;r&&r(t.getItem(),t),n.reconnect()}constructor(e,t,n){this.spec=e,this.monitor=t,this.connector=n}};function jn(e,t,n){let r=(0,S.useMemo)(()=>new An(e,t,n),[t,n]);return(0,S.useEffect)(()=>{r.spec=e},[e]),r}function Mn(e){return(0,S.useMemo)(()=>{let t=e.type;return T(t!=null,`spec.type must be defined`),t},[e])}function Nn(e,t,n){let r=F(),i=jn(e,t,n),a=Mn(e);P(function(){if(a!=null){let[e,o]=vn(a,i,r);return t.receiveHandlerId(e),n.receiveHandlerId(e),o}},[r,t,n,i,a])}function Pn(e,t){let n=ln(e,t);T(!n.begin,`useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)`);let r=kn(),i=On(n.options,n.previewOptions);return Nn(n,r,i),[cn(n.collect,r,i),un(i),dn(i)]}function Fn(e){let t=F().getMonitor(),[n,r]=on(t,e);return(0,S.useEffect)(()=>t.subscribeToOffsetChange(r)),(0,S.useEffect)(()=>t.subscribeToStateChange(r)),n}function In(e){return(0,S.useMemo)(()=>e.hooks.dropTarget(),[e])}function Ln(e){let t=F(),n=(0,S.useMemo)(()=>new Dn(t.getBackend()),[t]);return P(()=>(n.dropTargetOptions=e||null,n.reconnect(),()=>n.disconnectDropTarget()),[e]),n}function Rn(){let e=F();return(0,S.useMemo)(()=>new gn(e),[e])}function zn(e){let{accept:t}=e;return(0,S.useMemo)(()=>(T(e.accept!=null,`accept must be defined`),Array.isArray(t)?t:[t]),[t])}var Bn=class{canDrop(){let e=this.spec,t=this.monitor;return!e.canDrop||e.canDrop(t.getItem(),t)}hover(){let e=this.spec,t=this.monitor;e.hover&&e.hover(t.getItem(),t)}drop(){let e=this.spec,t=this.monitor;if(e.drop)return e.drop(t.getItem(),t)}constructor(e,t){this.spec=e,this.monitor=t}};function Vn(e,t){let n=(0,S.useMemo)(()=>new Bn(e,t),[t]);return(0,S.useEffect)(()=>{n.spec=e},[e]),n}function Hn(e,t,n){let r=F(),i=Vn(e,t),a=zn(e);P(function(){let[e,o]=_n(a,i,r);return t.receiveHandlerId(e),n.receiveHandlerId(e),o},[r,t,i,n,a.map(e=>e.toString()).join(`|`)])}function Un(e,t){let n=ln(e,t),r=Rn(),i=Ln(n.options);return Hn(n,r,i),[cn(n.collect,r,i),In(i)]}function Wn(e){let t=null;return()=>(t??=e(),t)}function Gn(e,t){return e.filter(e=>e!==t)}function Kn(e,t){let n=new Set,r=e=>n.add(e);e.forEach(r),t.forEach(r);let i=[];return n.forEach(e=>i.push(e)),i}var qn=class{enter(e){let t=this.entered.length,n=t=>this.isNodeInDocument(t)&&(!t.contains||t.contains(e));return this.entered=Kn(this.entered.filter(n),[e]),t===0&&this.entered.length>0}leave(e){let t=this.entered.length;return this.entered=Gn(this.entered.filter(this.isNodeInDocument),e),t>0&&this.entered.length===0}reset(){this.entered=[]}constructor(e){this.entered=[],this.isNodeInDocument=e}},Jn=class{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(e=>{Object.defineProperty(this.item,e,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${e}" until the drop event.`),null}})})}loadDataTransfer(e){if(e){let t={};Object.keys(this.config.exposeProperties).forEach(n=>{let r=this.config.exposeProperties[n];r!=null&&(t[n]={value:r(e,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,t)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(e,t){return t===e.getSourceId()}endDrag(){}constructor(e){this.config=e,this.item={},this.initializeExposedProperties()}},Yn=t({FILE:()=>Xn,HTML:()=>$n,TEXT:()=>Qn,URL:()=>Zn}),Xn=`__NATIVE_FILE__`,Zn=`__NATIVE_URL__`,Qn=`__NATIVE_TEXT__`,$n=`__NATIVE_HTML__`;function er(e,t,n){return t.reduce((t,n)=>t||e.getData(n),``)??n}var tr={[Xn]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:[`Files`]},[$n]:{exposeProperties:{html:(e,t)=>er(e,t,``),dataTransfer:e=>e},matchesTypes:[`Html`,`text/html`]},[Zn]:{exposeProperties:{urls:(e,t)=>er(e,t,``).split(`
2
+ `),dataTransfer:e=>e},matchesTypes:[`Url`,`text/uri-list`]},[Qn]:{exposeProperties:{text:(e,t)=>er(e,t,``),dataTransfer:e=>e},matchesTypes:[`Text`,`text/plain`]}};function nr(e,t){let n=tr[e];if(!n)throw Error(`native type ${e} has no configuration`);let r=new Jn(n);return r.loadDataTransfer(t),r}function rr(e){if(!e)return null;let t=Array.prototype.slice.call(e.types||[]);return Object.keys(tr).filter(e=>{let n=tr[e];return n?.matchesTypes?n.matchesTypes.some(e=>t.indexOf(e)>-1):!1})[0]||null}var ir=Wn(()=>/firefox/i.test(navigator.userAgent)),ar=Wn(()=>!!window.safari),or=class{interpolate(e){let{xs:t,ys:n,c1s:r,c2s:i,c3s:a}=this,o=t.length-1;if(e===t[o])return n[o];let s=0,c=a.length-1,l;for(;s<=c;){l=Math.floor(.5*(s+c));let r=t[l];if(r<e)s=l+1;else if(r>e)c=l-1;else return n[l]}o=Math.max(0,c);let u=e-t[o],d=u*u;return n[o]+r[o]*u+i[o]*d+a[o]*u*d}constructor(e,t){let{length:n}=e,r=[];for(let e=0;e<n;e++)r.push(e);r.sort((t,n)=>e[t]<e[n]?-1:1);let i=[],a=[],o=[],s,c;for(let r=0;r<n-1;r++)s=e[r+1]-e[r],c=t[r+1]-t[r],a.push(s),i.push(c),o.push(c/s);let l=[o[0]];for(let e=0;e<a.length-1;e++){let t=o[e],n=o[e+1];if(t*n<=0)l.push(0);else{s=a[e];let r=a[e+1],i=s+r;l.push(3*i/((i+r)/t+(i+s)/n))}}l.push(o[o.length-1]);let u=[],d=[],f;for(let e=0;e<l.length-1;e++){f=o[e];let t=l[e],n=1/a[e],r=t+l[e+1]-f-f;u.push((f-t-r)*n),d.push(r*n*n)}this.xs=e,this.ys=t,this.c1s=l,this.c2s=u,this.c3s=d}},sr=1;function cr(e){let t=e.nodeType===sr?e:e.parentElement;if(!t)return null;let{top:n,left:r}=t.getBoundingClientRect();return{x:r,y:n}}function lr(e){return{x:e.clientX,y:e.clientY}}function ur(e){return e.nodeName===`IMG`&&(ir()||!document.documentElement?.contains(e))}function dr(e,t,n,r){let i=e?t.width:n,a=e?t.height:r;return ar()&&e&&(a/=window.devicePixelRatio,i/=window.devicePixelRatio),{dragPreviewWidth:i,dragPreviewHeight:a}}function fr(e,t,n,r,i){let a=ur(t),o=cr(a?e:t),s={x:n.x-o.x,y:n.y-o.y},{offsetWidth:c,offsetHeight:l}=e,{anchorX:u,anchorY:d}=r,{dragPreviewWidth:f,dragPreviewHeight:p}=dr(a,t,c,l),m=()=>{let e=new or([0,.5,1],[s.y,s.y/l*p,s.y+p-l]).interpolate(d);return ar()&&a&&(e+=(window.devicePixelRatio-1)*p),e},h=()=>new or([0,.5,1],[s.x,s.x/c*f,s.x+f-c]).interpolate(u),{offsetX:g,offsetY:_}=i,v=g===0||g,ee=_===0||_;return{x:v?g:h(),y:ee?_:m()}}var pr=class{get window(){if(this.globalContext)return this.globalContext;if(typeof window<`u`)return window}get document(){if(this.globalContext?.document)return this.globalContext.document;if(this.window)return this.window.document}get rootElement(){return this.optionsArgs?.rootElement||this.window}constructor(e,t){this.ownerDocument=null,this.globalContext=e,this.optionsArgs=t}};function mr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t],r=Object.keys(n);typeof Object.getOwnPropertySymbols==`function`&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){mr(e,t,n[t])})}return e}var gr=class{profile(){return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:this.dragStartSourceIds?.length||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:this.dragOverTargetIds?.length||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){let e=this.rootElement;if(e!==void 0){if(e.__isReactDndBackendSetUp)throw Error(`Cannot have two HTML5 backends at the same time.`);e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}teardown(){let e=this.rootElement;if(e!==void 0&&(e.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var t;(t=this.window)==null||t.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(e,t,n){return this.sourcePreviewNodeOptions.set(e,n),this.sourcePreviewNodes.set(e,t),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDragSource(e,t,n){this.sourceNodes.set(e,t),this.sourceNodeOptions.set(e,n);let r=t=>this.handleDragStart(t,e),i=e=>this.handleSelectStart(e);return t.setAttribute(`draggable`,`true`),t.addEventListener(`dragstart`,r),t.addEventListener(`selectstart`,i),()=>{this.sourceNodes.delete(e),this.sourceNodeOptions.delete(e),t.removeEventListener(`dragstart`,r),t.removeEventListener(`selectstart`,i),t.setAttribute(`draggable`,`false`)}}connectDropTarget(e,t){let n=t=>this.handleDragEnter(t,e),r=t=>this.handleDragOver(t,e),i=t=>this.handleDrop(t,e);return t.addEventListener(`dragenter`,n),t.addEventListener(`dragover`,r),t.addEventListener(`drop`,i),()=>{t.removeEventListener(`dragenter`,n),t.removeEventListener(`dragover`,r),t.removeEventListener(`drop`,i)}}addEventListeners(e){e.addEventListener&&(e.addEventListener(`dragstart`,this.handleTopDragStart),e.addEventListener(`dragstart`,this.handleTopDragStartCapture,!0),e.addEventListener(`dragend`,this.handleTopDragEndCapture,!0),e.addEventListener(`dragenter`,this.handleTopDragEnter),e.addEventListener(`dragenter`,this.handleTopDragEnterCapture,!0),e.addEventListener(`dragleave`,this.handleTopDragLeaveCapture,!0),e.addEventListener(`dragover`,this.handleTopDragOver),e.addEventListener(`dragover`,this.handleTopDragOverCapture,!0),e.addEventListener(`drop`,this.handleTopDrop),e.addEventListener(`drop`,this.handleTopDropCapture,!0))}removeEventListeners(e){e.removeEventListener&&(e.removeEventListener(`dragstart`,this.handleTopDragStart),e.removeEventListener(`dragstart`,this.handleTopDragStartCapture,!0),e.removeEventListener(`dragend`,this.handleTopDragEndCapture,!0),e.removeEventListener(`dragenter`,this.handleTopDragEnter),e.removeEventListener(`dragenter`,this.handleTopDragEnterCapture,!0),e.removeEventListener(`dragleave`,this.handleTopDragLeaveCapture,!0),e.removeEventListener(`dragover`,this.handleTopDragOver),e.removeEventListener(`dragover`,this.handleTopDragOverCapture,!0),e.removeEventListener(`drop`,this.handleTopDrop),e.removeEventListener(`drop`,this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){let e=this.monitor.getSourceId(),t=this.sourceNodeOptions.get(e);return hr({dropEffect:this.altKeyPressed?`copy`:`move`},t||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?`copy`:this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){let e=this.monitor.getSourceId();return hr({anchorX:.5,anchorY:.5,captureDraggingState:!1},this.sourcePreviewNodeOptions.get(e)||{})}isDraggingNativeItem(){let e=this.monitor.getItemType();return Object.keys(Yn).some(t=>Yn[t]===e)}beginDragNativeItem(e,t){this.clearCurrentDragSourceNode(),this.currentNativeSource=nr(e,t),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e,this.mouseMoveTimeoutTimer=setTimeout(()=>this.rootElement?.addEventListener(`mousemove`,this.endDragIfSourceWasRemovedFromDOM,!0),1e3)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var e;(e=this.window)==null||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener(`mousemove`,this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(e,t){e.defaultPrevented||(this.dragStartSourceIds||=[],this.dragStartSourceIds.unshift(t))}handleDragEnter(e,t){this.dragEnterTargetIds.unshift(t)}handleDragOver(e,t){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(t)}handleDrop(e,t){this.dropTargetIds.unshift(t)}constructor(e,t,n){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=e=>{let t=this.sourceNodes.get(e);return t&&cr(t)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=e=>!!(e&&this.document&&this.document.body&&this.document.body.contains(e)),this.endDragIfSourceWasRemovedFromDOM=()=>{let e=this.currentDragSourceNode;e==null||this.isNodeInDocument(e)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=e=>{this.hoverRafId===null&&typeof requestAnimationFrame<`u`&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(e||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<`u`&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=e=>{if(e.defaultPrevented)return;let{dragStartSourceIds:t}=this;this.dragStartSourceIds=null;let n=lr(e);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(t||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:n});let{dataTransfer:r}=e,i=rr(r);if(this.monitor.isDragging()){if(r&&typeof r.setDragImage==`function`){let e=this.monitor.getSourceId(),t=this.sourceNodes.get(e),i=this.sourcePreviewNodes.get(e)||t;if(i){let{anchorX:e,anchorY:a,offsetX:o,offsetY:s}=this.getCurrentSourcePreviewNodeOptions(),c=fr(t,i,n,{anchorX:e,anchorY:a},{offsetX:o,offsetY:s});r.setDragImage(i,c.x,c.y)}}try{r?.setData(`application/json`,{})}catch{}this.setCurrentDragSourceNode(e.target);let{captureDraggingState:t}=this.getCurrentSourcePreviewNodeOptions();t?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(i)this.beginDragNativeItem(i);else if(r&&!r.types&&(e.target&&!e.target.hasAttribute||!e.target.hasAttribute(`draggable`)))return;else e.preventDefault()},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=e=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var t;(t=this.currentNativeSource)==null||t.loadDataTransfer(e.dataTransfer)}if(!this.enterLeaveCounter.enter(e.target)||this.monitor.isDragging())return;let{dataTransfer:n}=e,r=rr(n);r&&this.beginDragNativeItem(r,n)},this.handleTopDragEnter=e=>{let{dragEnterTargetIds:t}=this;this.dragEnterTargetIds=[],this.monitor.isDragging()&&(this.altKeyPressed=e.altKey,t.length>0&&this.actions.hover(t,{clientOffset:lr(e)}),t.some(e=>this.monitor.canDropOnTarget(e))&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=this.getCurrentDropEffect())))},this.handleTopDragOverCapture=e=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var t;(t=this.currentNativeSource)==null||t.loadDataTransfer(e.dataTransfer)}},this.handleTopDragOver=e=>{let{dragOverTargetIds:t}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`none`);return}this.altKeyPressed=e.altKey,this.lastClientOffset=lr(e),this.scheduleHover(t),(t||[]).some(e=>this.monitor.canDropOnTarget(e))?(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?e.preventDefault():(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`none`))},this.handleTopDragLeaveCapture=e=>{this.isDraggingNativeItem()&&e.preventDefault(),this.enterLeaveCounter.leave(e.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=e=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var t;e.preventDefault(),(t=this.currentNativeSource)==null||t.loadDataTransfer(e.dataTransfer)}else rr(e.dataTransfer)&&e.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=e=>{let{dropTargetIds:t}=this;this.dropTargetIds=[],this.actions.hover(t,{clientOffset:lr(e)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=e=>{let t=e.target;typeof t.dragDrop==`function`&&(t.tagName===`INPUT`||t.tagName===`SELECT`||t.tagName===`TEXTAREA`||t.isContentEditable||(e.preventDefault(),t.dragDrop()))},this.options=new pr(t,n),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new qn(this.isNodeInDocument)}},_r;function vr(){return _r||(_r=new Image,_r.src=`data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==`),_r}var yr=function(e,t,n){return new gr(e,t,n)},br=(0,S.createContext)(null);function I(){let e=(0,S.useContext)(br);if(e===null)throw Error(`No Tree Api Provided`);return e}var xr=(0,S.createContext)(null);function Sr(){let e=(0,S.useContext)(xr);if(e===null)throw Error(`Provide a NodesContext`);return e}var Cr=(0,S.createContext)(null);function wr(){let e=(0,S.useContext)(Cr);if(e===null)throw Error(`Provide a DnDContext`);return e}var Tr=(0,S.createContext)(0);function Er(){(0,S.useContext)(Tr)}var Dr=t({access:()=>L,bound:()=>Or,dfs:()=>Fr,focusNextElement:()=>Lr,focusPrevElement:()=>Rr,getInsertIndex:()=>Kr,getInsertParentId:()=>qr,identify:()=>R,identifyNull:()=>Hr,indexOf:()=>Nr,isClosed:()=>Ar,isDescendant:()=>Mr,isItem:()=>kr,isOpenWithEmptyChildren:()=>jr,mergeRefs:()=>Ur,noop:()=>Pr,safeRun:()=>Wr,waitFor:()=>Gr,walk:()=>Ir});function Or(e,t,n){return Math.max(Math.min(e,n),t)}function kr(e){return e&&e.isLeaf}function Ar(e){return e&&e.isInternal&&!e.isOpen}function jr(e){return e&&e.isOpen&&!e.children?.length}var Mr=(e,t)=>{let n=e;for(;n;){if(n.id===t.id)return!0;n=n.parent}return!1},Nr=e=>{if(!e.parent)throw Error(`Node does not have a parent`);return e.parent.children.findIndex(t=>t.id===e.id)};function Pr(){}function Fr(e,t){if(!e)return null;if(e.id===t)return e;if(e.children)for(let n of e.children){let e=Fr(n,t);if(e)return e}return null}function Ir(e,t){if(t(e),e.children)for(let n of e.children)Ir(n,t)}function Lr(e){let t=Vr(e),n;for(let r=0;r<t.length;++r)if(t[r]===e){n=zr(t,r);break}n?.focus()}function Rr(e){let t=Vr(e),n;for(let r=0;r<t.length;++r)if(t[r]===e){n=Br(t,r);break}n?.focus()}function zr(e,t){return t+1<e.length?e[t+1]:e[0]}function Br(e,t){return t-1>=0?e[t-1]:e[e.length-1]}function Vr(e){return Array.from(document.querySelectorAll(`button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled]), details:not([disabled]), summary:not(:disabled)`)).filter(t=>t===e||!e.contains(t))}function L(e,t){return typeof t==`boolean`?t:typeof t==`string`?e[t]:t(e)}function Hr(e){return e===null?null:R(e)}function R(e){return typeof e==`string`?e:e.id}function Ur(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}function Wr(e,...t){if(e)return e(...t)}function Gr(e){return new Promise((t,n)=>{let r=0;function i(){r+=1,r===100&&n(),e()?t():setTimeout(i,10)}i()})}function Kr(e){let t=e.focusedNode;return t?t.isOpen?0:t.parent?t.childIndex+1:0:e.root.children?.length??0}function qr(e){let t=e.focusedNode;return t?t.isOpen?t.id:t.parent&&!t.parent.isRoot?t.parent.id:null:null}var Jr={display:`flex`,alignItems:`center`,zIndex:1},Yr={flex:1,height:`2px`,background:`#4B91E2`,borderRadius:`1px`},Xr={width:`4px`,height:`4px`,boxShadow:`0 0 0 3px #4B91E2`,borderRadius:`50%`},Zr=S.memo(function({top:e,left:t,indent:n}){let r={position:`absolute`,pointerEvents:`none`,top:e-2+`px`,left:t+`px`,right:n+`px`};return(0,C.jsxs)(`div`,{style:Object.assign(Object.assign({},Jr),r),children:[(0,C.jsx)(`div`,{style:Object.assign({},Xr)}),(0,C.jsx)(`div`,{style:Object.assign({},Yr)})]})});function Qr({node:e,attrs:t,innerRef:n,children:r}){return(0,C.jsx)(`div`,Object.assign({},t,{ref:n,onFocus:e=>e.stopPropagation(),onClick:e.handleClick,children:r}))}function $r(e){return(0,C.jsxs)(`div`,{ref:e.dragHandle,style:e.style,children:[(0,C.jsx)(`span`,{onClick:t=>{t.stopPropagation(),e.node.toggle()},children:e.node.isLeaf?`🌳`:e.node.isOpen?`🗁`:`🗀`}),` `,e.node.isEditing?(0,C.jsx)(ti,Object.assign({},e)):(0,C.jsx)(ei,Object.assign({},e))]})}function ei(e){return(0,C.jsx)(C.Fragment,{children:(0,C.jsx)(`span`,{children:e.node.data.name})})}function ti({node:e}){let t=(0,S.useRef)();return(0,S.useEffect)(()=>{var e,n;(e=t.current)==null||e.focus(),(n=t.current)==null||n.select()},[]),(0,C.jsx)(`input`,{ref:t,defaultValue:e.data.name,onBlur:()=>e.reset(),onKeyDown:n=>{n.key===`Escape`&&e.reset(),n.key===`Enter`&&e.submit(t.current?.value||``)}})}function ni(e){return{type:`EDIT`,id:e}}function ri(e={id:null},t){return t.type===`EDIT`?Object.assign(Object.assign({},e),{id:t.id}):e}function z(e){return{type:`FOCUS`,id:e}}function ii(){return{type:`TREE_BLUR`}}function ai(e={id:null,treeFocused:!1},t){return t.type===`FOCUS`?Object.assign(Object.assign({},e),{id:t.id,treeFocused:!0}):t.type===`TREE_BLUR`?Object.assign(Object.assign({},e),{treeFocused:!1}):e}var oi=class e{constructor(e){this.handleClick=e=>{e.metaKey&&!this.tree.props.disableMultiSelection?this.isSelected?this.deselect():this.selectMulti():e.shiftKey&&!this.tree.props.disableMultiSelection?this.selectContiguous():(this.select(),this.activate())},this.tree=e.tree,this.id=e.id,this.data=e.data,this.level=e.level,this.children=e.children,this.parent=e.parent,this.isDraggable=e.isDraggable,this.rowIndex=e.rowIndex}get isRoot(){return this.id===si}get isLeaf(){return!Array.isArray(this.children)}get isInternal(){return!this.isLeaf}get isOpen(){return!this.isLeaf&&this.tree.isOpen(this.id)}get isClosed(){return!this.isLeaf&&!this.tree.isOpen(this.id)}get isEditable(){return this.tree.isEditable(this.data)}get isEditing(){return this.tree.editingId===this.id}get isSelected(){return this.tree.isSelected(this.id)}get isOnlySelection(){return this.isSelected&&this.tree.hasOneSelection}get isSelectedStart(){return this.isSelected&&!this.prev?.isSelected}get isSelectedEnd(){return this.isSelected&&!this.next?.isSelected}get isFocused(){return this.tree.isFocused(this.id)}get isDragging(){return this.tree.isDragging(this.id)}get willReceiveDrop(){return this.tree.willReceiveDrop(this.id)}get state(){return{isClosed:this.isClosed,isDragging:this.isDragging,isEditing:this.isEditing,isFocused:this.isFocused,isInternal:this.isInternal,isLeaf:this.isLeaf,isOpen:this.isOpen,isSelected:this.isSelected,isSelectedEnd:this.isSelectedEnd,isSelectedStart:this.isSelectedStart,willReceiveDrop:this.willReceiveDrop}}get childIndex(){return this.parent&&this.parent.children?this.parent.children.findIndex(e=>e.id===this.id):-1}get next(){return this.rowIndex===null?null:this.tree.at(this.rowIndex+1)}get prev(){return this.rowIndex===null?null:this.tree.at(this.rowIndex-1)}get nextSibling(){let e=this.childIndex;return this.parent?.children[e+1]??null}isAncestorOf(e){if(!e)return!1;let t=e;for(;t;){if(t.id===this.id)return!0;t=t.parent}return!1}select(){this.tree.select(this)}deselect(){this.tree.deselect(this)}selectMulti(){this.tree.selectMulti(this)}selectContiguous(){this.tree.selectContiguous(this)}activate(){this.tree.activate(this)}focus(){this.tree.focus(this)}toggle(){this.tree.toggle(this)}open(){this.tree.open(this)}openParents(){this.tree.openParents(this)}close(){this.tree.close(this)}submit(e){this.tree.submit(this,e)}reset(){this.tree.reset()}clone(){return new e(Object.assign({},this))}edit(){return this.tree.edit(this)}},si=`__REACT_ARBORIST_INTERNAL_ROOT__`;function ci(e){function t(n,r,i){let a=new oi({tree:e,data:n,level:r,parent:i,id:e.accessId(n),children:null,isDraggable:e.isDraggable(n),rowIndex:null}),o=e.accessChildren(n);return o&&(a.children=o.map(e=>t(e,r+1,a))),a}let n=new oi({tree:e,id:si,data:{id:si},level:-1,parent:null,children:null,isDraggable:!0,rowIndex:null});return n.children=(e.props.data??[]).map(e=>t(e,0,n)),n}var li={open(e,t){return{type:`VISIBILITY_OPEN`,id:e,filtered:t}},close(e,t){return{type:`VISIBILITY_CLOSE`,id:e,filtered:t}},toggle(e,t){return{type:`VISIBILITY_TOGGLE`,id:e,filtered:t}},clear(e){return{type:`VISIBILITY_CLEAR`,filtered:e}}};function ui(e={},t){if(t.type===`VISIBILITY_OPEN`)return Object.assign(Object.assign({},e),{[t.id]:!0});if(t.type===`VISIBILITY_CLOSE`)return Object.assign(Object.assign({},e),{[t.id]:!1});if(t.type===`VISIBILITY_TOGGLE`){let n=e[t.id];return Object.assign(Object.assign({},e),{[t.id]:!n})}return t.type===`VISIBILITY_CLEAR`?{}:e}function di(e={filtered:{},unfiltered:{}},t){return t.type.startsWith(`VISIBILITY`)?t.filtered?Object.assign(Object.assign({},e),{filtered:ui(e.filtered,t)}):Object.assign(Object.assign({},e),{unfiltered:ui(e.unfiltered,t)}):e}var B=e=>({nodes:{open:{filtered:{},unfiltered:e?.initialOpenState??{}},focus:{id:null,treeFocused:!1},edit:{id:null},drag:{id:null,selectedIds:[],destinationParentId:null,destinationIndex:null},selection:{ids:new Set,anchor:null,mostRecent:null}},dnd:{cursor:{type:`none`},dragId:null,dragIds:[],parentId:null,index:-1}}),V={clear:()=>({type:`SELECTION_CLEAR`}),only:e=>({type:`SELECTION_ONLY`,id:R(e)}),add:e=>({type:`SELECTION_ADD`,ids:(Array.isArray(e)?e:[e]).map(R)}),remove:e=>({type:`SELECTION_REMOVE`,ids:(Array.isArray(e)?e:[e]).map(R)}),set:e=>Object.assign({type:`SELECTION_SET`},e),mostRecent:e=>({type:`SELECTION_MOST_RECENT`,id:e===null?null:R(e)}),anchor:e=>({type:`SELECTION_ANCHOR`,id:e===null?null:R(e)})};function fi(e=B().nodes.selection,t){let n=e.ids;switch(t.type){case`SELECTION_CLEAR`:return Object.assign(Object.assign({},e),{ids:new Set});case`SELECTION_ONLY`:return Object.assign(Object.assign({},e),{ids:new Set([t.id])});case`SELECTION_ADD`:return t.ids.length===0?e:(t.ids.forEach(e=>n.add(e)),Object.assign(Object.assign({},e),{ids:new Set(n)}));case`SELECTION_REMOVE`:return t.ids.length===0?e:(t.ids.forEach(e=>n.delete(e)),Object.assign(Object.assign({},e),{ids:new Set(n)}));case`SELECTION_SET`:return Object.assign(Object.assign({},e),{ids:t.ids,mostRecent:t.mostRecent,anchor:t.anchor});case`SELECTION_MOST_RECENT`:return Object.assign(Object.assign({},e),{mostRecent:t.id});case`SELECTION_ANCHOR`:return Object.assign(Object.assign({},e),{anchor:t.id});default:return e}}var H={cursor(e){return{type:`DND_CURSOR`,cursor:e}},dragStart(e,t){return{type:`DND_DRAG_START`,id:e,dragIds:t}},dragEnd(){return{type:`DND_DRAG_END`}},hovering(e,t){return{type:`DND_HOVERING`,parentId:e,index:t}}};function pi(e=B().dnd,t){switch(t.type){case`DND_CURSOR`:return Object.assign(Object.assign({},e),{cursor:t.cursor});case`DND_DRAG_START`:return Object.assign(Object.assign({},e),{dragId:t.id,dragIds:t.dragIds});case`DND_DRAG_END`:return B().dnd;case`DND_HOVERING`:return Object.assign(Object.assign({},e),{parentId:t.parentId,index:t.index});default:return e}}var mi={position:`fixed`,pointerEvents:`none`,zIndex:100,left:0,top:0,width:`100%`,height:`100%`},hi=e=>{if(!e)return{display:`none`};let{x:t,y:n}=e;return{transform:`translate(${t}px, ${n}px)`}},gi=e=>{if(!e)return{display:`none`};let{x:t,y:n}=e;return{transform:`translate(${t+10}px, ${n+10}px)`}};function _i({offset:e,mouse:t,id:n,dragIds:r,isDragging:i}){return(0,C.jsxs)(vi,{isDragging:i,children:[(0,C.jsx)(yi,{offset:e,children:(0,C.jsx)(xi,{id:n,dragIds:r})}),(0,C.jsx)(bi,{mouse:t,count:r.length})]})}var vi=(0,S.memo)(function(e){return e.isDragging?(0,C.jsx)(`div`,{style:mi,children:e.children}):null});function yi(e){return(0,C.jsx)(`div`,{className:`row preview`,style:hi(e.offset),children:e.children})}function bi(e){let{count:t,mouse:n}=e;return t>1?(0,C.jsx)(`div`,{className:`selected-count`,style:gi(n),children:t}):null}var xi=(0,S.memo)(function(e){let t=I(),n=t.get(e.id);return n?(0,C.jsx)(t.renderNode,{preview:!0,node:n,style:{paddingLeft:n.level*t.indent,opacity:.2,background:`transparent`},tree:t}):null}),Si=Number.isNaN||function(e){return typeof e==`number`&&e!==e};function Ci(e,t){return!!(e===t||Si(e)&&Si(t))}function wi(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Ci(e[n],t[n]))return!1;return!0}function Ti(e,t){t===void 0&&(t=wi);var n,r=[],i,a=!1;function o(){var o=[...arguments];return a&&n===this&&t(o,r)?i:(i=e.apply(this,o),a=!0,n=this,r=o,i)}return o}var Ei=typeof performance==`object`&&typeof performance.now==`function`?function(){return performance.now()}:function(){return Date.now()};function Di(e){cancelAnimationFrame(e.id)}function Oi(e,t){var n=Ei();function r(){Ei()-n>=t?e.call(null):i.id=requestAnimationFrame(r)}var i={id:requestAnimationFrame(r)};return i}var ki=-1;function Ai(e){if(e===void 0&&(e=!1),ki===-1||e){var t=document.createElement(`div`),n=t.style;n.width=`50px`,n.height=`50px`,n.overflow=`scroll`,document.body.appendChild(t),ki=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return ki}var U=null;function ji(e){if(e===void 0&&(e=!1),U===null||e){var t=document.createElement(`div`),n=t.style;n.width=`50px`,n.height=`50px`,n.overflow=`scroll`,n.direction=`rtl`;var r=document.createElement(`div`),i=r.style;return i.width=`100px`,i.height=`100px`,t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?U=`positive-descending`:(t.scrollLeft=1,U=t.scrollLeft===0?`negative`:`positive-ascending`),document.body.removeChild(t),U}return U}var Mi=150,Ni=function(e,t){return e};function Pi(e){var t,n=e.getItemOffset,r=e.getEstimatedTotalSize,i=e.getItemSize,a=e.getOffsetForIndexAndAlignment,o=e.getStartIndexForOffset,s=e.getStopIndexForStartIndex,c=e.initInstanceProps,l=e.shouldResetStyleCacheOnItemSizeChange,u=e.validateProps;return t=function(e){ue(t,e);function t(t){var r=e.call(this,t)||this;return r._instanceProps=c(r.props,de(r)),r._outerRef=void 0,r._resetIsScrollingTimeoutId=null,r.state={instance:de(r),isScrolling:!1,scrollDirection:`forward`,scrollOffset:typeof r.props.initialScrollOffset==`number`?r.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},r._callOnItemsRendered=void 0,r._callOnItemsRendered=Ti(function(e,t,n,i){return r.props.onItemsRendered({overscanStartIndex:e,overscanStopIndex:t,visibleStartIndex:n,visibleStopIndex:i})}),r._callOnScroll=void 0,r._callOnScroll=Ti(function(e,t,n){return r.props.onScroll({scrollDirection:e,scrollOffset:t,scrollUpdateWasRequested:n})}),r._getItemStyle=void 0,r._getItemStyle=function(e){var t=r.props,a=t.direction,o=t.itemSize,s=t.layout,c=r._getItemStyleCache(l&&o,l&&s,l&&a),u;if(c.hasOwnProperty(e))u=c[e];else{var d=n(r.props,e,r._instanceProps),f=i(r.props,e,r._instanceProps),p=a===`horizontal`||s===`horizontal`,m=a===`rtl`,h=p?d:0;c[e]=u={position:`absolute`,left:m?void 0:h,right:m?h:void 0,top:p?0:d,height:p?`100%`:f,width:p?f:`100%`}}return u},r._getItemStyleCache=void 0,r._getItemStyleCache=Ti(function(e,t,n){return{}}),r._onScrollHorizontal=function(e){var t=e.currentTarget,n=t.clientWidth,i=t.scrollLeft,a=t.scrollWidth;r.setState(function(e){if(e.scrollOffset===i)return null;var t=r.props.direction,o=i;if(t===`rtl`)switch(ji()){case`negative`:o=-i;break;case`positive-descending`:o=a-n-i}return o=Math.max(0,Math.min(o,a-n)),{isScrolling:!0,scrollDirection:e.scrollOffset<o?`forward`:`backward`,scrollOffset:o,scrollUpdateWasRequested:!1}},r._resetIsScrollingDebounced)},r._onScrollVertical=function(e){var t=e.currentTarget,n=t.clientHeight,i=t.scrollHeight,a=t.scrollTop;r.setState(function(e){if(e.scrollOffset===a)return null;var t=Math.max(0,Math.min(a,i-n));return{isScrolling:!0,scrollDirection:e.scrollOffset<t?`forward`:`backward`,scrollOffset:t,scrollUpdateWasRequested:!1}},r._resetIsScrollingDebounced)},r._outerRefSetter=function(e){var t=r.props.outerRef;r._outerRef=e,typeof t==`function`?t(e):typeof t==`object`&&t&&t.hasOwnProperty(`current`)&&(t.current=e)},r._resetIsScrollingDebounced=function(){r._resetIsScrollingTimeoutId!==null&&Di(r._resetIsScrollingTimeoutId),r._resetIsScrollingTimeoutId=Oi(r._resetIsScrolling,Mi)},r._resetIsScrolling=function(){r._resetIsScrollingTimeoutId=null,r.setState({isScrolling:!1},function(){r._getItemStyleCache(-1,null)})},r}t.getDerivedStateFromProps=function(e,t){return Fi(e,t),u(e),null};var d=t.prototype;return d.scrollTo=function(e){e=Math.max(0,e),this.setState(function(t){return t.scrollOffset===e?null:{scrollDirection:t.scrollOffset<e?`forward`:`backward`,scrollOffset:e,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},d.scrollToItem=function(e,t){t===void 0&&(t=`auto`);var n=this.props,r=n.itemCount,i=n.layout,o=this.state.scrollOffset;e=Math.max(0,Math.min(e,r-1));var s=0;if(this._outerRef){var c=this._outerRef;s=i===`vertical`?c.scrollWidth>c.clientWidth?Ai():0:c.scrollHeight>c.clientHeight?Ai():0}this.scrollTo(a(this.props,e,t,o,this._instanceProps,s))},d.componentDidMount=function(){var e=this.props,t=e.direction,n=e.initialScrollOffset,r=e.layout;if(typeof n==`number`&&this._outerRef!=null){var i=this._outerRef;t===`horizontal`||r===`horizontal`?i.scrollLeft=n:i.scrollTop=n}this._callPropsCallbacks()},d.componentDidUpdate=function(){var e=this.props,t=e.direction,n=e.layout,r=this.state,i=r.scrollOffset;if(r.scrollUpdateWasRequested&&this._outerRef!=null){var a=this._outerRef;if(t===`horizontal`||n===`horizontal`){if(t===`rtl`)switch(ji()){case`negative`:a.scrollLeft=-i;break;case`positive-ascending`:a.scrollLeft=i;break;default:var o=a.clientWidth;a.scrollLeft=a.scrollWidth-o-i}else a.scrollLeft=i}else a.scrollTop=i}this._callPropsCallbacks()},d.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&Di(this._resetIsScrollingTimeoutId)},d.render=function(){var e=this.props,t=e.children,n=e.className,i=e.direction,a=e.height,o=e.innerRef,s=e.innerElementType,c=e.innerTagName,l=e.itemCount,u=e.itemData,d=e.itemKey,f=d===void 0?Ni:d,p=e.layout,m=e.outerElementType,h=e.outerTagName,g=e.style,_=e.useIsScrolling,v=e.width,ee=this.state.isScrolling,y=i===`horizontal`||p===`horizontal`,b=y?this._onScrollHorizontal:this._onScrollVertical,te=this._getRangeToRender(),ne=te[0],ie=te[1],ae=[];if(l>0)for(var x=ne;x<=ie;x++)ae.push((0,S.createElement)(t,{data:u,key:f(x,u),index:x,isScrolling:_?ee:void 0,style:this._getItemStyle(x)}));var oe=r(this.props,this._instanceProps);return(0,S.createElement)(m||h||`div`,{className:n,onScroll:b,ref:this._outerRefSetter,style:re({position:`relative`,height:a,width:v,overflow:`auto`,WebkitOverflowScrolling:`touch`,willChange:`transform`,direction:i},g)},(0,S.createElement)(s||c||`div`,{children:ae,ref:o,style:{height:y?`100%`:oe,pointerEvents:ee?`none`:void 0,width:y?oe:`100%`}}))},d._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered==`function`&&this.props.itemCount>0){var e=this._getRangeToRender(),t=e[0],n=e[1],r=e[2],i=e[3];this._callOnItemsRendered(t,n,r,i)}if(typeof this.props.onScroll==`function`){var a=this.state,o=a.scrollDirection,s=a.scrollOffset,c=a.scrollUpdateWasRequested;this._callOnScroll(o,s,c)}},d._getRangeToRender=function(){var e=this.props,t=e.itemCount,n=e.overscanCount,r=this.state,i=r.isScrolling,a=r.scrollDirection,c=r.scrollOffset;if(t===0)return[0,0,0,0];var l=o(this.props,c,this._instanceProps),u=s(this.props,l,c,this._instanceProps),d=!i||a===`backward`?Math.max(1,n):1,f=!i||a===`forward`?Math.max(1,n):1;return[Math.max(0,l-d),Math.max(0,Math.min(t-1,u+f)),l,u]},t}(S.PureComponent),t.defaultProps={direction:`ltr`,itemData:void 0,layout:`vertical`,overscanCount:2,useIsScrolling:!1},t}var Fi=function(e,t){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,t.instance},Ii=Pi({getItemOffset:function(e,t){return t*e.itemSize},getItemSize:function(e,t){return e.itemSize},getEstimatedTotalSize:function(e){var t=e.itemCount;return e.itemSize*t},getOffsetForIndexAndAlignment:function(e,t,n,r,i,a){var o=e.direction,s=e.height,c=e.itemCount,l=e.itemSize,u=e.layout,d=e.width,f=o===`horizontal`||u===`horizontal`?d:s,p=Math.max(0,c*l-f),m=Math.min(p,t*l),h=Math.max(0,t*l-f+l+a);switch(n===`smart`&&(n=r>=h-f&&r<=m+f?`auto`:`center`),n){case`start`:return m;case`end`:return h;case`center`:var g=Math.round(h+(m-h)/2);return g<Math.ceil(f/2)?0:g>p+Math.floor(f/2)?p:g;default:return r>=h&&r<=m?r:r<h?h:m}},getStartIndexForOffset:function(e,t){var n=e.itemCount,r=e.itemSize;return Math.max(0,Math.min(n-1,Math.floor(t/r)))},getStopIndexForStartIndex:function(e,t,n){var r=e.direction,i=e.height,a=e.itemCount,o=e.itemSize,s=e.layout,c=e.width,l=r===`horizontal`||s===`horizontal`,u=t*o,d=Math.ceil(((l?c:i)+n-u)/o);return Math.max(0,Math.min(a-1,t+d-1))},initInstanceProps:function(e){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(e){e.itemSize}});function Li(){let e=I(),t=wr().cursor;if(!t||t.type!==`line`)return null;let n=e.indent,r=e.rowHeight*t.index+(e.props.padding??e.props.paddingTop??0),i=n*t.level,a=e.renderCursor;return(0,C.jsx)(a,{top:r,left:i,indent:n})}var Ri=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},zi=(0,S.forwardRef)(function(e,t){let{children:n}=e,r=Ri(e,[`children`]),i=I();return(0,C.jsxs)(`div`,Object.assign({ref:t},r,{onClick:e=>{e.currentTarget===e.target&&i.deselectAll()},children:[(0,C.jsx)(Bi,{}),n]}))}),Bi=()=>{let e=I();return(0,C.jsx)(`div`,{style:{height:e.visibleNodes.length*e.rowHeight,width:`100%`,position:`absolute`,left:`0`,right:`0`},children:(0,C.jsx)(Li,{})})},Vi=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},Hi=(0,S.forwardRef)(function(e,t){var{style:n}=e,r=Vi(e,[`style`]);let i=I(),a=i.props.padding??i.props.paddingTop??0,o=i.props.padding??i.props.paddingBottom??0;return(0,C.jsx)(`div`,Object.assign({ref:t,style:Object.assign(Object.assign({},n),{height:`${parseFloat(n.height)+a+o}px`})},r))});function Ui(e){let t=I(),n=t.selectedIds,[r,i,a]=Pn(()=>({canDrag:()=>e.isDraggable,type:`NODE`,item:()=>{let r=t.isSelected(e.id)?Array.from(n):[e.id];return t.dispatch(H.dragStart(e.id,r)),{id:e.id,dragIds:r}},end:()=>{t.hideCursor(),t.dispatch(H.dragEnd())}}),[n,e]);return(0,S.useEffect)(()=>{a(vr())},[a]),i}function Wi(e,t){let n=e.getBoundingClientRect(),r=t.x-Math.round(n.x),i=t.y-Math.round(n.y),a=n.height,o=i<a/2,s=!o,c=a/4,l=i>c&&i<a-c;return{x:r,inTopHalf:o,inBottomHalf:s,inMiddle:l,atTop:!l&&o,atBottom:!l&&s}}function Gi(e,t,n,r){return e?e.isInternal?r.atTop?[t,e]:r.inMiddle?[e,e]:[e,n]:r.inTopHalf?[t,e]:[e,n]:[t,null]}function Ki(e,t){return{parentId:e||null,index:t}}function W(e,t){return{type:`line`,index:e,level:t}}function qi(e){return{type:`highlight`,id:e}}function Ji(e,t){let n=e;for(;n.parent&&n.level>t;)n=n.parent;return{parentId:n.parent?.id||null,index:Nr(n)+1}}function Yi(e){let t=Wi(e.element,e.offset),n=e.indent,r=Math.round(Math.max(0,t.x-n)/n),{node:i,nextNode:a,prevNode:o}=e,[s,c]=Gi(i,o,a,t);if(i&&i.isInternal&&t.inMiddle)return{drop:Ki(i.id,null),cursor:qi(i.id)};if(!s)return{drop:Ki(c?.parent?.id,0),cursor:W(0,0)};if(kr(s)){let e=Or(r,c?.level||0,s.level);return{drop:Ji(s,e),cursor:W(s.rowIndex+1,e)}}if(Ar(s)){let e=Or(r,c?.level||0,s.level);return{drop:Ji(s,e),cursor:W(s.rowIndex+1,e)}}if(jr(s)){let e=Or(r,0,s.level+1);return e>s.level?{drop:Ki(s.id,0),cursor:W(s.rowIndex+1,e)}:{drop:Ji(s,e),cursor:W(s.rowIndex+1,e)}}return{drop:Ki(s?.id,0),cursor:W(s.rowIndex+1,s.level+1)}}function Xi(e,t){let n=I(),[r,i]=Un(()=>({accept:`NODE`,canDrop:()=>n.canDrop(),hover:(r,i)=>{let a=i.getClientOffset();if(!e.current||!a)return;let{cursor:o,drop:s}=Yi({element:e.current,offset:a,indent:n.indent,node:t,prevNode:t.prev,nextNode:t.next});s&&n.dispatch(H.hovering(s.parentId,s.index)),i.canDrop()?o&&n.showCursor(o):n.hideCursor()},drop:(e,t)=>{if(!t.canDrop())return null;let{parentId:r,index:i,dragIds:a}=n.state.dnd;Wr(n.props.onMove,{dragIds:a,parentId:r===`__REACT_ARBORIST_INTERNAL_ROOT__`?null:r,index:i===null?0:i,dragNodes:n.dragNodes,parentNode:n.get(r)}),n.open(r)}}),[t,e.current,n.props]);return i}function Zi(e){let t=I(),n=t.at(e);if(!n)throw Error(`Could not find node for index: ${e}`);return(0,S.useMemo)(()=>{let r=n.clone();return t.visibleNodes[e]=r,r},[...Object.values(n.state),n])}var Qi=S.memo(function({index:e,style:t}){Er(),Sr();let n=I(),r=Zi(e),i=(0,S.useRef)(null),a=Ui(r),o=Xi(i,r),s=(0,S.useCallback)(e=>{i.current=e,o(e)},[o]),c=n.indent*r.level,l=(0,S.useMemo)(()=>({paddingLeft:c}),[c]),u=(0,S.useMemo)(()=>Object.assign(Object.assign({},t),{top:parseFloat(t.top)+(n.props.padding??n.props.paddingTop??0)}),[t,n.props.padding,n.props.paddingTop]),d={role:`treeitem`,"aria-level":r.level+1,"aria-selected":r.isSelected,"aria-expanded":r.isOpen,style:u,tabIndex:-1,className:n.props.rowClassName};(0,S.useEffect)(()=>{var e;!r.isEditing&&r.isFocused&&((e=i.current)==null||e.focus({preventScroll:!0}))},[r.isEditing,r.isFocused,i.current]);let f=n.renderNode,p=n.renderRow;return(0,C.jsx)(p,{node:r,innerRef:s,attrs:d,children:(0,C.jsx)(f,{node:r,tree:n,style:l,dragHandle:a})})}),$i=``,ea=null;function ta(){Er();let e=I();return(0,C.jsx)(`div`,{role:`tree`,style:{height:e.height,width:e.width,minHeight:0,minWidth:0},onContextMenu:e.props.onContextMenu,onClick:e.props.onClick,tabIndex:0,onFocus:t=>{t.currentTarget.contains(t.relatedTarget)||e.onFocus()},onBlur:t=>{t.currentTarget.contains(t.relatedTarget)||e.onBlur()},onKeyDown:t=>{if(e.isEditing)return;if(t.key===`Backspace`){if(!e.props.onDelete)return;let t=Array.from(e.selectedIds);if(t.length>1){let n=e.mostRecentNode;for(;n&&n.isSelected;)n=n.nextSibling;n||=e.lastNode,e.focus(n,{scroll:!1}),e.delete(Array.from(t))}else{let t=e.focusedNode;if(t){let n=t.nextSibling,r=t.parent;e.focus(n||r,{scroll:!1}),e.delete(t)}}return}if(t.key===`Tab`&&!t.shiftKey){t.preventDefault(),Lr(t.currentTarget);return}if(t.key===`Tab`&&t.shiftKey){t.preventDefault(),Rr(t.currentTarget);return}if(t.key===`ArrowDown`){t.preventDefault();let n=e.nextNode;if(t.metaKey){e.select(e.focusedNode),e.activate(e.focusedNode);return}if(!t.shiftKey||e.props.disableMultiSelection){e.focus(n);return}{if(!n)return;let t=e.focusedNode;t?t.isSelected?e.selectContiguous(n):e.selectMulti(n):e.focus(e.firstNode);return}}if(t.key===`ArrowUp`){t.preventDefault();let n=e.prevNode;if(!t.shiftKey||e.props.disableMultiSelection){e.focus(n);return}{if(!n)return;let t=e.focusedNode;t?t.isSelected?e.selectContiguous(n):e.selectMulti(n):e.focus(e.lastNode);return}}if(t.key===`ArrowRight`){let t=e.focusedNode;if(!t)return;t.isInternal&&t.isOpen?e.focus(e.nextNode):t.isInternal&&e.open(t.id);return}if(t.key===`ArrowLeft`){let t=e.focusedNode;if(!t||t.isRoot)return;t.isInternal&&t.isOpen?e.close(t.id):t.parent?.isRoot||e.focus(t.parent);return}if(t.key===`a`&&t.metaKey&&!e.props.disableMultiSelection){t.preventDefault(),e.selectAll();return}if(t.key===`a`&&!t.metaKey&&e.props.onCreate){e.createLeaf();return}if(t.key===`A`&&!t.metaKey){if(!e.props.onCreate)return;e.createInternal();return}if(t.key===`Home`){t.preventDefault(),e.focus(e.firstNode);return}if(t.key===`End`){t.preventDefault(),e.focus(e.lastNode);return}if(t.key===`Enter`){let t=e.focusedNode;if(!t||!t.isEditable||!e.props.onRename)return;setTimeout(()=>{t&&e.edit(t)});return}if(t.key===` `){t.preventDefault();let n=e.focusedNode;if(!n)return;n.isLeaf?(n.select(),n.activate()):n.toggle();return}if(t.key===`*`){let t=e.focusedNode;if(!t)return;e.openSiblings(t);return}if(t.key===`PageUp`){t.preventDefault(),e.pageUp();return}t.key===`PageDown`&&(t.preventDefault(),e.pageDown()),clearTimeout(ea),$i+=t.key,ea=setTimeout(()=>{$i=``},600);let n=e.visibleNodes.find(e=>{let t=e.data.name;return typeof t==`string`&&t.toLowerCase().startsWith($i)});n&&e.focus(n.id)},children:(0,C.jsx)(Ii,{className:e.props.className,outerRef:e.listEl,itemCount:e.visibleNodes.length,height:e.height,width:e.width,itemSize:e.rowHeight,overscanCount:e.overscanCount,itemKey:t=>e.visibleNodes[t]?.id||t,outerElementType:zi,innerElementType:Hi,onScroll:e.props.onScroll,onItemsRendered:e.onItemsRendered.bind(e),ref:e.list,children:Qi})})}function na(e){return e.isFiltered?ia(e.root,e.isMatch.bind(e)):ra(e.root)}function ra(e){let t=[];function n(e){var r;e.level>=0&&t.push(e),e.isOpen&&((r=e.children)==null||r.forEach(n))}return n(e),t.forEach(aa),t}function ia(e,t){let n={},r=[];function i(e){if(!e.isRoot&&t(e)){n[e.id]=!0;let t=e.parent;for(;t;)n[t.id]=!0,t=t.parent}if(e.children)for(let t of e.children)i(t)}function a(e){var t;e.level>=0&&n[e.id]&&r.push(e),e.isOpen&&((t=e.children)==null||t.forEach(a))}return i(e),a(e),r.forEach(aa),r}function aa(e,t){e.rowIndex=t}var oa=e=>e.reduce((e,t,n)=>(e[t.id]=n,e),{}),sa=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},{safeRun:G,identify:K,identifyNull:q}=Dr,ca=class e{constructor(e,t,n,r){this.store=e,this.props=t,this.list=n,this.listEl=r,this.visibleStartIndex=0,this.visibleStopIndex=0,this.root=ci(this),this.visibleNodes=na(this),this.idToIndex=oa(this.visibleNodes)}update(e){this.props=e,this.root=ci(this),this.visibleNodes=na(this),this.idToIndex=oa(this.visibleNodes)}dispatch(e){return this.store.dispatch(e)}get state(){return this.store.getState()}get openState(){return this.state.nodes.open.unfiltered}get width(){return this.props.width??300}get height(){return this.props.height??500}get indent(){return this.props.indent??24}get rowHeight(){return this.props.rowHeight??24}get overscanCount(){return this.props.overscanCount??1}get searchTerm(){return(this.props.searchTerm||``).trim()}get matchFn(){let e=this.props.searchMatch??((e,t)=>JSON.stringify(Object.values(e.data)).toLocaleLowerCase().includes(t.toLocaleLowerCase()));return t=>e(t,this.searchTerm)}accessChildren(e){return L(e,this.props.childrenAccessor||`children`)??null}accessId(e){let t=L(e,this.props.idAccessor||`id`);if(!t)throw Error(`Data must contain an 'id' property or props.idAccessor must return a string`);return t}get firstNode(){return this.visibleNodes[0]??null}get lastNode(){return this.visibleNodes[this.visibleNodes.length-1]??null}get focusedNode(){return this.get(this.state.nodes.focus.id)??null}get mostRecentNode(){return this.get(this.state.nodes.selection.mostRecent)??null}get nextNode(){let e=this.indexOf(this.focusedNode);return e===null?null:this.at(e+1)}get prevNode(){let e=this.indexOf(this.focusedNode);return e===null?null:this.at(e-1)}get(e){return e&&e in this.idToIndex&&this.visibleNodes[this.idToIndex[e]]||null}at(e){return this.visibleNodes[e]||null}nodesBetween(e,t){if(e===null||t===null)return[];let n=this.indexOf(e)??0,r=this.indexOf(t);if(r===null)return[];let i=Math.min(n,r),a=Math.max(n,r);return this.visibleNodes.slice(i,a+1)}indexOf(e){let t=Hr(e);return t?this.idToIndex[t]:null}get editingId(){return this.state.nodes.edit.id}createInternal(){return this.create({type:`internal`})}createLeaf(){return this.create({type:`leaf`})}create(){return sa(this,arguments,void 0,function*(e={}){let t=e.parentId===void 0?qr(this):e.parentId,n=e.index??Kr(this),r=e.type??`leaf`,i=yield G(this.props.onCreate,{type:r,parentId:t,index:n,parentNode:this.get(t)});i&&(this.focus(i),setTimeout(()=>{this.edit(i).then(()=>{this.select(i),this.activate(i)})}))})}delete(e){return sa(this,void 0,void 0,function*(){if(!e)return;let t=(Array.isArray(e)?e:[e]).map(K),n=t.map(e=>this.get(e)).filter(e=>!!e);yield G(this.props.onDelete,{nodes:n,ids:t})})}edit(t){let n=K(t);return this.resolveEdit({cancelled:!0}),this.scrollTo(n),this.dispatch(ni(n)),new Promise(t=>{e.editPromise=t})}submit(e,t){return sa(this,void 0,void 0,function*(){if(!e)return;let n=K(e);yield G(this.props.onRename,{id:n,name:t,node:this.get(n)}),this.dispatch(ni(null)),this.resolveEdit({cancelled:!1,value:t}),setTimeout(()=>this.onFocus())})}reset(){this.dispatch(ni(null)),this.resolveEdit({cancelled:!0}),setTimeout(()=>this.onFocus())}activate(e){let t=this.get(q(e));t&&G(this.props.onActivate,t)}resolveEdit(t){let n=e.editPromise;n&&n(t),e.editPromise=null}get selectedIds(){return this.state.nodes.selection.ids}get selectedNodes(){let e=[];for(let t of Array.from(this.selectedIds)){let n=this.get(t);n&&e.push(n)}return e}focus(e,t={}){e&&(this.props.selectionFollowsFocus?this.select(e):(this.dispatch(z(K(e))),t.scroll!==!1&&this.scrollTo(e),this.focusedNode&&G(this.props.onFocus,this.focusedNode)))}pageUp(){let e=this.visibleStartIndex,t=this.visibleStopIndex-e,n=this.focusedNode?.rowIndex??0;n=n>e?e:Math.max(e-t,0),this.focus(this.at(n))}pageDown(){let e=this.visibleStartIndex,t=this.visibleStopIndex,n=t-e,r=this.focusedNode?.rowIndex??0;r=r<t?t:Math.min(r+n,this.visibleNodes.length-1),this.focus(this.at(r))}select(e,t={}){if(!e)return;let n=t.focus!==!1,r=K(e);n&&this.dispatch(z(r)),this.dispatch(V.only(r)),this.dispatch(V.anchor(r)),this.dispatch(V.mostRecent(r)),this.scrollTo(r,t.align),this.focusedNode&&n&&G(this.props.onFocus,this.focusedNode),G(this.props.onSelect,this.selectedNodes)}deselect(e){if(!e)return;let t=K(e);this.dispatch(V.remove(t)),G(this.props.onSelect,this.selectedNodes)}selectMulti(e){let t=this.get(q(e));t&&(this.dispatch(z(t.id)),this.dispatch(V.add(t.id)),this.dispatch(V.anchor(t.id)),this.dispatch(V.mostRecent(t.id)),this.scrollTo(t),this.focusedNode&&G(this.props.onFocus,this.focusedNode),G(this.props.onSelect,this.selectedNodes))}selectContiguous(e){if(!e)return;let t=K(e),{anchor:n,mostRecent:r}=this.state.nodes.selection;this.dispatch(z(t)),this.dispatch(V.remove(this.nodesBetween(n,r))),this.dispatch(V.add(this.nodesBetween(n,q(t)))),this.dispatch(V.mostRecent(t)),this.scrollTo(t),this.focusedNode&&G(this.props.onFocus,this.focusedNode),G(this.props.onSelect,this.selectedNodes)}deselectAll(){this.setSelection({ids:[],anchor:null,mostRecent:null}),G(this.props.onSelect,this.selectedNodes)}selectAll(){this.setSelection({ids:Object.keys(this.idToIndex),anchor:this.firstNode,mostRecent:this.lastNode}),this.dispatch(z(this.lastNode?.id)),this.focusedNode&&G(this.props.onFocus,this.focusedNode),G(this.props.onSelect,this.selectedNodes)}setSelection(e){let t=new Set(e.ids?.map(K)),n=q(e.anchor),r=q(e.mostRecent);this.dispatch(V.set({ids:t,anchor:n,mostRecent:r})),G(this.props.onSelect,this.selectedNodes)}get cursorParentId(){let{cursor:e}=this.state.dnd;switch(e.type){case`highlight`:return e.id;default:return null}}get cursorOverFolder(){return this.state.dnd.cursor.type===`highlight`}get dragNodes(){return this.state.dnd.dragIds.map(e=>this.get(e)).filter(e=>!!e)}get dragNode(){return this.get(this.state.nodes.drag.id)}get dragDestinationParent(){return this.get(this.state.nodes.drag.destinationParentId)}get dragDestinationIndex(){return this.state.nodes.drag.destinationIndex}canDrop(){if(this.isFiltered)return!1;let e=this.get(this.state.dnd.parentId)??this.root,t=this.dragNodes,n=this.props.disableDrop;for(let n of t)if(!n||!e||n.isInternal&&Mr(e,n))return!1;return typeof n==`function`?!n({parentNode:e,dragNodes:this.dragNodes,index:this.state.dnd.index||0}):typeof n==`string`?!e.data[n]:typeof n!=`boolean`||!n}hideCursor(){this.dispatch(H.cursor({type:`none`}))}showCursor(e){this.dispatch(H.cursor(e))}open(e){let t=q(e);t&&(this.isOpen(t)||(this.dispatch(li.open(t,this.isFiltered)),G(this.props.onToggle,t)))}close(e){let t=q(e);t&&this.isOpen(t)&&(this.dispatch(li.close(t,this.isFiltered)),G(this.props.onToggle,t))}toggle(e){let t=q(e);if(t)return this.isOpen(t)?this.close(t):this.open(t)}openParents(e){let t=q(e);if(!t)return;let n=Fr(this.root,t)?.parent;for(;n;)this.open(n.id),n=n.parent}openSiblings(e){let t=e.parent;if(!t)this.toggle(e.id);else if(t.children){let n=e.isOpen;for(let e of t.children)e.isInternal&&(n?this.close(e.id):this.open(e.id));this.scrollTo(this.focusedNode)}}openAll(){Ir(this.root,e=>{e.isInternal&&e.open()})}closeAll(){Ir(this.root,e=>{e.isInternal&&e.close()})}scrollTo(e,t=`smart`){if(!e)return;let n=K(e);return this.openParents(n),Gr(()=>n in this.idToIndex).then(()=>{var e;let r=this.idToIndex[n];r!==void 0&&((e=this.list.current)==null||e.scrollToItem(r,t))}).catch(()=>{})}get isEditing(){return this.state.nodes.edit.id!==null}get isFiltered(){return!!this.props.searchTerm?.trim()}get hasFocus(){return this.state.nodes.focus.treeFocused}get hasNoSelection(){return this.state.nodes.selection.ids.size===0}get hasOneSelection(){return this.state.nodes.selection.ids.size===1}get hasMultipleSelections(){return this.state.nodes.selection.ids.size>1}isSelected(e){return e?this.state.nodes.selection.ids.has(e):!1}isOpen(e){if(!e)return!1;if(e===`__REACT_ARBORIST_INTERNAL_ROOT__`)return!0;let t=this.props.openByDefault??!0;return this.isFiltered?this.state.nodes.open.filtered[e]??!0:this.state.nodes.open.unfiltered[e]??t}isEditable(e){return!L(e,this.props.disableEdit||(()=>!1))}isDraggable(e){return!L(e,this.props.disableDrag||(()=>!1))}isDragging(e){let t=q(e);return t?this.state.nodes.drag.id===t:!1}isFocused(e){return this.hasFocus&&this.state.nodes.focus.id===e}isMatch(e){return this.matchFn(e)}willReceiveDrop(e){let t=q(e);if(!t)return!1;let{destinationParentId:n,destinationIndex:r}=this.state.nodes.drag;return t===n&&r===null}onFocus(){let e=this.focusedNode||this.firstNode;e&&this.dispatch(z(e.id))}onBlur(){this.dispatch(ii())}onItemsRendered(e){this.visibleStartIndex=e.visibleStartIndex,this.visibleStopIndex=e.visibleStopIndex}get renderContainer(){return this.props.renderContainer||ta}get renderRow(){return this.props.renderRow||Qr}get renderNode(){return this.props.children||$r}get renderDragPreview(){return this.props.renderDragPreview||_i}get renderCursor(){return this.props.renderCursor||Zr}};function J(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var la=typeof Symbol==`function`&&Symbol.observable||`@@observable`,ua=()=>Math.random().toString(36).substring(7).split(``).join(`.`),da={INIT:`@@redux/INIT${ua()}`,REPLACE:`@@redux/REPLACE${ua()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${ua()}`};function fa(e){if(typeof e!=`object`||!e)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function pa(e,t,n){if(typeof e!=`function`)throw Error(J(2));if(typeof t==`function`&&typeof n==`function`||typeof n==`function`&&typeof arguments[3]==`function`)throw Error(J(0));if(typeof t==`function`&&n===void 0&&(n=t,t=void 0),n!==void 0){if(typeof n!=`function`)throw Error(J(1));return n(pa)(e,t)}let r=e,i=t,a=new Map,o=a,s=0,c=!1;function l(){o===a&&(o=new Map,a.forEach((e,t)=>{o.set(t,e)}))}function u(){if(c)throw Error(J(3));return i}function d(e){if(typeof e!=`function`)throw Error(J(4));if(c)throw Error(J(5));let t=!0;l();let n=s++;return o.set(n,e),function(){if(t){if(c)throw Error(J(6));t=!1,l(),o.delete(n),a=null}}}function f(e){if(!fa(e))throw Error(J(7));if(e.type===void 0)throw Error(J(8));if(typeof e.type!=`string`)throw Error(J(17));if(c)throw Error(J(9));try{c=!0,i=r(i,e)}finally{c=!1}return(a=o).forEach(e=>{e()}),e}function p(e){if(typeof e!=`function`)throw Error(J(10));r=e,f({type:da.REPLACE})}function m(){let e=d;return{subscribe(t){if(typeof t!=`object`||!t)throw Error(J(11));function n(){let e=t;e.next&&e.next(u())}return n(),{unsubscribe:e(n)}},[la](){return this}}}return f({type:da.INIT}),{dispatch:f,subscribe:d,getState:u,replaceReducer:p,[la]:m}}function ma(e){Object.keys(e).forEach(t=>{let n=e[t];if(n(void 0,{type:da.INIT})===void 0)throw Error(J(12));if(n(void 0,{type:da.PROBE_UNKNOWN_ACTION()})===void 0)throw Error(J(13))})}function ha(e){let t=Object.keys(e),n={};for(let r=0;r<t.length;r++){let i=t[r];typeof e[i]==`function`&&(n[i]=e[i])}let r=Object.keys(n),i;try{ma(n)}catch(e){i=e}return function(e={},t){if(i)throw i;let a=!1,o={};for(let i=0;i<r.length;i++){let s=r[i],c=n[s],l=e[s],u=c(l,t);if(u===void 0)throw t&&t.type,Error(J(14));o[s]=u,a||=u!==l}return a||=r.length!==Object.keys(e).length,a?o:e}}function ga(e=B().nodes.drag,t){switch(t.type){case`DND_DRAG_START`:return Object.assign(Object.assign({},e),{id:t.id,selectedIds:t.dragIds});case`DND_DRAG_END`:return Object.assign(Object.assign({},e),{id:null,destinationParentId:null,destinationIndex:null,selectedIds:[]});case`DND_HOVERING`:return t.parentId!==e.destinationParentId||t.index!=e.destinationIndex?Object.assign(Object.assign({},e),{destinationParentId:t.parentId,destinationIndex:t.index}):e;default:return e}}var _a=ha({nodes:ha({focus:ai,edit:ri,open:di,selection:fi,drag:ga}),dnd:pi}),va=B();function ya({treeProps:e,imperativeHandle:t,children:n}){let r=(0,S.useRef)(null),i=(0,S.useRef)(null),a=(0,S.useRef)(pa(_a,B(e))),o=(0,ce.useSyncExternalStore)(a.current.subscribe,a.current.getState,()=>va),s=(0,S.useMemo)(()=>new ca(a.current,e,r,i),[]),c=(0,S.useRef)(0);return(0,S.useMemo)(()=>{c.current+=1,s.update(e)},[...Object.values(e),o.nodes.open]),(0,S.useImperativeHandle)(t,()=>s),(0,S.useEffect)(()=>{s.props.selection?s.select(s.props.selection,{focus:!1}):s.deselectAll()},[s.props.selection]),(0,S.useEffect)(()=>{s.props.searchTerm||a.current.dispatch(li.clear(!0))},[s.props.searchTerm]),(0,C.jsx)(br.Provider,{value:s,children:(0,C.jsx)(Tr.Provider,{value:c.current,children:(0,C.jsx)(xr.Provider,{value:o.nodes,children:(0,C.jsx)(Cr.Provider,{value:o.dnd,children:(0,C.jsx)(en,Object.assign({backend:yr,options:{rootElement:s.props.dndRootElement||void 0}},e.dndManager&&{manager:e.dndManager},{children:n}))})})})})}function ba(){let e=I(),[,t]=Un(()=>({accept:`NODE`,canDrop:(t,n)=>n.isOver({shallow:!0})?e.canDrop():!1,hover:(t,n)=>{if(!n.isOver({shallow:!0}))return;let r=n.getClientOffset();if(!e.listEl.current||!r)return;let{cursor:i,drop:a}=Yi({element:e.listEl.current,offset:r,indent:e.indent,node:null,prevNode:e.visibleNodes[e.visibleNodes.length-1],nextNode:null});a&&e.dispatch(H.hovering(a.parentId,a.index)),n.canDrop()?i&&e.showCursor(i):e.hideCursor()}}),[e]);t(e.listEl)}function xa(e){return ba(),e.children}function Sa(){let e=I().props.renderContainer||ta;return(0,C.jsx)(C.Fragment,{children:(0,C.jsx)(e,{})})}function Ca(){let e=I(),{offset:t,mouse:n,item:r,isDragging:i}=Fn(e=>({offset:e.getSourceClientOffset(),mouse:e.getClientOffset(),item:e.getItem(),isDragging:e.isDragging()})),a=e.props.renderDragPreview||_i;return(0,C.jsx)(a,{offset:t,mouse:n,id:r?.id||null,dragIds:r?.dragIds||[],isDragging:i})}var wa=class{constructor(e){this.root=Ta(e)}get data(){return this.root.children?.map(e=>e.data)??[]}create(e){let t=e.parentId?this.find(e.parentId):this.root;if(!t)return null;t.addChild(e.data,e.index)}move(e){let t=this.find(e.id),n=e.parentId?this.find(e.parentId):this.root;!t||!n||(n.addChild(t.data,e.index),t.drop())}update(e){let t=this.find(e.id);t&&t.update(e.changes)}drop(e){let t=this.find(e.id);t&&t.drop()}find(e,t=this.root){if(!t)return null;if(t.id===e)return t;if(t.children){for(let n of t.children){let t=this.find(e,n);if(t)return t}return null}return null}};function Ta(e){let t=new Da({id:`ROOT`},null);return t.children=e.map(e=>Ea(e,t)),t}function Ea(e,t){let n=new Da(e,t);return e.children&&(n.children=e.children.map(e=>Ea(e,n))),n}var Da=class{constructor(e,t){this.data=e,this.parent=t,this.id=e.id}hasParent(){return!!this.parent}get childIndex(){return this.hasParent()?this.parent.children.indexOf(this):-1}addChild(e,t){let n=Ea(e,this);this.children=this.children??[],this.children.splice(t,0,n),this.data.children=this.data.children??[],this.data.children.splice(t,0,e)}removeChild(e){var t,n;(t=this.children)==null||t.splice(e,1),(n=this.data.children)==null||n.splice(e,1)}update(e){if(this.hasParent()){let t=this.childIndex;this.parent.addChild(Object.assign(Object.assign({},this.data),e),t),this.drop()}}drop(){this.hasParent()&&this.parent.removeChild(this.childIndex)}},Oa=0;function ka(e){let[t,n]=(0,S.useState)(e),r=(0,S.useMemo)(()=>new wa(t),[t]);return[t,{onMove:e=>{for(let t of e.dragIds)r.move({id:t,parentId:e.parentId,index:e.index});n(r.data)},onRename:({name:e,id:t})=>{r.update({id:t,changes:{name:e}}),n(r.data)},onCreate:({parentId:e,index:t,type:i})=>{let a={id:`simple-tree-id-${Oa++}`,name:``};return i===`internal`&&(a.children=[]),r.create({parentId:e,index:t,data:a}),n(r.data),a},onDelete:e=>{e.ids.forEach(e=>r.drop({id:e})),n(r.data)}}]}function Aa(e){if(e.initialData&&e.data)throw Error(`React Arborist Tree => Provide either a data or initialData prop, but not both.`);if(e.initialData&&(e.onCreate||e.onDelete||e.onMove||e.onRename))throw Error(`React Arborist Tree => You passed the initialData prop along with a data handler.
3
+ Use the data prop if you want to provide your own handlers.`);if(e.initialData){let[t,n]=ka(e.initialData);return Object.assign(Object.assign(Object.assign({},e),n),{data:t})}return e}function ja(e,t){let n=Aa(e);return(0,C.jsxs)(ya,{treeProps:n,imperativeHandle:t,children:[(0,C.jsx)(xa,{children:(0,C.jsx)(Sa,{})}),(0,C.jsx)(Ca,{})]})}var Ma=(0,S.forwardRef)(ja),Y=a(),Na=5,Pa=/^[A-Za-z]:[/\\]/,Fa=/^\\\\/;function X(e){return e.success?e:(b({title:`Failed`,description:e.message}),null)}var Ia=class{delegate=new wa([]);callbacks;constructor(e){this.callbacks=e}roots=[];pendingExpansions=new Map;onChange=o.NOOP;path=new te(`/`);initialize=async e=>{if(this.onChange=e,this.delegate.data.length===0)try{let{roots:e}=await this.callbacks.getRoots(),t=e.find(e=>e.isPrimary);if(!t)throw Error(`File browser response is missing a primary root`);if(this.roots=e,this.path=te.guessDeliminator(t.path),this.delegate=new wa(e.map(za)),e.length===1){let e=await this.callbacks.listFiles({path:t.path});this.updateDirectory(this.getPrimaryRootId(),e.files)}}catch(e){b({title:`Failed`,description:ne(e)})}this.emitChange()};expand(e){return this.requestDirectory(e)}requestDirectory(e,t=!1){let n=this.pendingExpansions.get(e);if(n)return n;let r=this.delegate.find(e);if(!r?.data.isDirectory)return Promise.resolve(!1);if(!t&&r.data.loadState===`loaded`)return Promise.resolve(!0);let i=this.loadDirectory(e,r.data).finally(()=>{this.pendingExpansions.delete(e)});return this.pendingExpansions.set(e,i),i}async loadDirectory(e,t){this.delegate.update({id:e,changes:{loadState:`loading`}}),this.emitChange();try{let n=await this.callbacks.listFiles({path:t.path});return this.updateDirectory(e,n.files),!0}catch(n){return this.delegate.update({id:e,changes:{loadState:`error`}}),b({title:`Could not load ${t.name}`,description:ne(n)}),!1}finally{this.emitChange()}}getRoots(){return this.roots}async reveal(e){let t=Q(e.path,e.rootPath);if(t===null)return!1;let n=e.rootPath,r=t.split(Ua(e.rootPath)).filter(Boolean);e.isDirectory||r.pop();for(let t of[null,...r]){if(t!==null){let r=Z(e.rootPath,n);if(n=$(n,t),!this.delegate.find(Z(e.rootPath,n))&&!await this.requestDirectory(r,!0))return!1}let r=Z(e.rootPath,n);if(!this.delegate.find(r))return b({title:`Could not reveal folder`,description:`The folder may have moved or been deleted: ${n}`}),!1;if(!await this.expand(r))return!1}return!0}async copy(e,t){let n=this.getMutableNode(e);if(!n)return;let r=n.data.path,i=this.getParentPath(n.data),a=$(i,t);await this.callbacks.copyFileOrFolder({path:r,newPath:a}).then(X)&&await this.refreshPath(i)}async rename(e,t){let n=this.getMutableNode(e);if(!n)return;let r=n.data.path,i=this.getParentPath(n.data),a=$(i,t);await this.callbacks.renameFileOrFolder({path:r,newPath:a}).then(X)&&await this.refreshPath(i)}async move(e,t){let n=t??this.getPrimaryRootId(),r=this.delegate.find(n);if(!r?.data.isDirectory)return;let i=new Set;await oe(e,Na,async e=>{let t=this.getMutableNode(e,!1);if(!t)return;let n=t.data.path,a=this.getParentPath(t.data),o=$(r.data.path,this.path.basename(n));await this.callbacks.renameFileOrFolder({path:n,newPath:o}).then(X)&&(i.add(r.data.path),i.add(a))}),await this.refreshPaths([...i])}async createFile({name:e,parentId:t,type:n=`file`}){let r=this.getParentNode(t);r&&await this.callbacks.createFileOrFolder({path:r.data.path,type:n,name:e}).then(X)&&await this.refreshPath(r.data.path)}async createFolder(e,t){let n=this.getParentNode(t);n&&await this.callbacks.createFileOrFolder({path:n.data.path,type:`directory`,name:e}).then(X)&&await this.refreshPath(n.data.path)}async delete(e){let t=this.getMutableNode(e);if(!t)return;let n=this.getParentPath(t.data);await this.callbacks.deleteFileOrFolder({path:t.data.path}).then(X)&&await this.refreshPath(n)}refreshAll=async e=>{let t=[...this.roots.map(e=>e.path),...e.map(e=>this.delegate.find(e)?.data.path).filter(e=>!!e)];await this.refreshPaths(t,new Set([...this.roots.map(e=>Z(e.path,e.path)),...e]))};refreshPath=async e=>{await this.refreshPaths([e])};getPrimaryRelativePath=e=>{let t=this.getPrimaryRoot();return t?Q(e,t.path):null};getPrimaryRootPath=()=>this.getPrimaryRoot()?.path??``;getPrimaryRootId=()=>{let e=this.getPrimaryRoot()?.path??``;return Z(e,e)};isPrimaryNode=e=>e.isPrimaryRoot;getDisplayPath=e=>{let t=this.getRootForPath(e);if(!t)return e;let n=Q(e,t.path);return n?t.isPrimary?n:`${t.name}/${n}`:t.name};isRootPath=e=>this.roots.some(t=>Va(e,t.path));getPrimaryRoot(){return this.roots.find(e=>e.isPrimary)}getRootForNode(e){return this.roots.find(t=>Va(t.path,e.rootPath))??this.getPrimaryRoot()??{path:e.rootPath,name:e.rootPath,isPrimary:e.isPrimaryRoot}}getRootForPath(e){return this.roots.filter(t=>Q(e,t.path)!==null).toSorted((e,t)=>t.path.length-e.path.length)[0]}getParentNode(e){let t=e??this.getPrimaryRootId(),n=this.delegate.find(t);return n?.data.isDirectory?n:null}getParentPath(e){return(this.delegate.find(e.id)?.parent)?.data.path??e.rootPath}getMutableNode(e,t=!0){let n=this.delegate.find(e);return!n||n.data.isRoot?(t&&b({title:`Failed`,description:n?`File browser roots cannot be modified`:`Node with id ${e} not found in the tree`}),null):n}refreshPaths=async(e,t)=>{let n=[...new Set(e)].toSorted((e,t)=>e.length-t.length);if(n.length===0)return;let r=await oe(n,Na,e=>this.callbacks.listFiles({path:e}).catch(()=>null));for(let[e,i]of n.entries()){let n=r[e];if(n)for(let e of this.roots){let r=Z(e.path,i);(!t||t.has(r))&&this.updateDirectory(r,n.files,t)}}this.emitChange()};updateDirectory(e,t,n){let r=this.delegate.find(e)?.data;if(!r?.isDirectory)return;let i=La(Ba(t,this.getRootForNode(r)),r.children);this.delegate.update({id:e,changes:{children:n?Ra(i,n):i,loadState:`loaded`}})}emitChange(){let e=this.delegate.data;this.onChange(this.roots.length===1?[...e[0]?.children??[]]:e)}};function La(e,t){let n=new Map(t.map(e=>[e.id,e]));return e.map(e=>{let t=n.get(e.id);return!e.isDirectory||!t?.isDirectory?e:{...e,children:t.children,loadState:t.loadState}})}function Ra(e,t){return e.map(e=>e.isDirectory?t.has(e.id)?{...e,children:Ra(e.children,t)}:{...e,children:[],loadState:`unloaded`}:e)}function za(e){return{id:Z(e.path,e.path),path:e.path,name:e.name,isDirectory:!0,isMarimoFile:!1,children:[],isRoot:!0,rootPath:e.path,isPrimaryRoot:e.isPrimary,loadState:`unloaded`}}function Ba(e,t){return e.map(e=>({...e,id:Z(t.path,e.path),children:Ba(e.children??[],t),loadState:e.children?.length?`loaded`:`unloaded`,isRoot:!1,rootPath:t.path,isPrimaryRoot:t.isPrimary}))}function Z(e,t){return`${encodeURIComponent(e)}:${encodeURIComponent(t)}`}function Q(e,t){let n=Ha(t),r=e=>n?e.toLowerCase():e,i=r(e);if(i===r(t))return``;let a=Ua(t),o=t.endsWith(a)?t:`${t}${a}`,s=r(o);return i.startsWith(s)?e.slice(o.length):null}function Va(e,t){return Q(e,t)===``}function $(e,t){let n=Ua(e);return`${e}${e.endsWith(n)?``:n}${t}`}function Ha(e){return Pa.test(e)||Fa.test(e)}function Ua(e){return Fa.test(e)||/^[A-Za-z]:\\/.test(e)?`\\`:`/`}function Wa(e){let t=(0,Y.c)(13),{root:n}=e,{sendRenameFileOrFolder:r,sendCopyFileOrFolder:i,sendDeleteFileOrFolder:a}=m(),o;t[0]!==n||t[1]!==r?(o=async(e,t)=>{let{path:i,newPath:a}=x({path:e.path,name:t,root:n});return X(await r({path:i,newPath:a}))},t[0]=n,t[1]=r,t[2]=o):o=t[2];let s=o,c;t[3]!==n||t[4]!==i?(c=async e=>{let{path:t,newPath:r}=x({path:e.path,name:ae(e.name),root:n});return X(await i({path:t,newPath:r}))},t[3]=n,t[4]=i,t[5]=c):c=t[5];let l=c,u;t[6]!==n||t[7]!==a?(u=async e=>X(await a({path:ie(e.path,n)})),t[6]=n,t[7]=a,t[8]=u):u=t[8];let d=u,f;return t[9]!==d||t[10]!==l||t[11]!==s?(f={renameFile:s,duplicateFile:l,deleteFile:d},t[9]=d,t[10]=l,t[11]=s,t[12]=f):f=t[12],f}var Ga={file:`Delete file`,folder:`Delete folder`,notebook:`Delete notebook`};function Ka(){let e=(0,Y.c)(2),{openConfirm:t}=ee(),n;return e[0]===t?n=e[1]:(n=(e,n)=>{let r=e.kind??`file`;t({title:Ga[r],description:`Are you sure you want to delete ${e.name}?`,confirmAction:(0,C.jsx)(c,{onClick:async()=>{await n()},"aria-label":`Confirm`,children:`Delete`})})},e[0]=t,e[1]=n),n}function qa(e){let t=(0,Y.c)(17),{node:n,root:i,onAfterChange:a}=e,o;t[0]===i?o=t[1]:(o={root:i},t[0]=i,t[1]=o);let{duplicateFile:s,deleteFile:c}=Wa(o),l=Ka(),u;t[2]===n?u=t[3]:(u=()=>{n.edit()},t[2]=n,t[3]=u);let d=r(u),f;t[4]!==s||t[5]!==n.data||t[6]!==a?(f=async()=>{await s(n.data)&&a?.()},t[4]=s,t[5]=n.data,t[6]=a,t[7]=f):f=t[7];let p=r(f),m;t[8]!==l||t[9]!==c||t[10]!==n.data||t[11]!==a?(m=()=>{let e=n.data.isDirectory?`folder`:n.data.isMarimoFile?`notebook`:`file`;l({name:n.data.name,kind:e},async()=>{await c(n.data)&&a?.()})},t[8]=l,t[9]=c,t[10]=n.data,t[11]=a,t[12]=m):m=t[12];let h=r(m),g;return t[13]!==h||t[14]!==p||t[15]!==d?(g={handleRename:d,handleDuplicate:p,handleDelete:h},t[13]=h,t[14]=p,t[15]=d,t[16]=g):g=t[16],g}var Ja=e=>{let t=(0,Y.c)(15),{testId:n,buttonClassName:r,iconClassName:i,contentClassName:a,preventDefaultOnTrigger:o,children:s}=e,c=o!==void 0&&o,l;t[0]===c?l=t[1]:(l=e=>{e.stopPropagation(),c&&e.preventDefault()},t[0]=c,t[1]=l);let u;t[2]!==r||t[3]!==i||t[4]!==n?(u=(0,C.jsx)(g,{"data-testid":n,className:r,iconClassName:i}),t[2]=r,t[3]=i,t[4]=n,t[5]=u):u=t[5];let m;t[6]!==l||t[7]!==u?(m=(0,C.jsx)(d,{asChild:!0,tabIndex:-1,onClick:l,children:u}),t[6]=l,t[7]=u,t[8]=m):m=t[8];let h=a??`print:hidden w-[240px]`,_;t[9]!==s||t[10]!==h?(_=(0,C.jsx)(f,{align:`end`,className:h,onClick:Qa,onCloseAutoFocus:$a,children:s}),t[9]=s,t[10]=h,t[11]=_):_=t[11];let v;return t[12]!==m||t[13]!==_?(v=(0,C.jsxs)(p,{modal:!1,children:[m,_]}),t[12]=m,t[13]=_,t[14]=v):v=t[14],v},Ya=e=>{let t=(0,Y.c)(6),{onSelect:n,disabled:r,title:i,testId:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,C.jsx)(se,{className:_}),t[0]=o):o=t[0];let s;return t[1]!==r||t[2]!==n||t[3]!==a||t[4]!==i?(s=(0,C.jsxs)(u,{onSelect:n,disabled:r,title:i,"data-testid":a,children:[o,`Rename`]}),t[1]=r,t[2]=n,t[3]=a,t[4]=i,t[5]=s):s=t[5],s},Xa=e=>{let t=(0,Y.c)(6),{onSelect:n,disabled:r,title:i,testId:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,C.jsx)(v,{className:_}),t[0]=o):o=t[0];let s;return t[1]!==r||t[2]!==n||t[3]!==a||t[4]!==i?(s=(0,C.jsxs)(u,{onSelect:n,disabled:r,title:i,"data-testid":a,children:[o,`Duplicate`]}),t[1]=r,t[2]=n,t[3]=a,t[4]=i,t[5]=s):s=t[5],s},Za=e=>{let t=(0,Y.c)(6),{onSelect:n,disabled:r,title:i,testId:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,C.jsx)(y,{className:_}),t[0]=o):o=t[0];let s;return t[1]!==r||t[2]!==n||t[3]!==a||t[4]!==i?(s=(0,C.jsxs)(u,{onSelect:n,variant:`danger`,disabled:r,title:i,"data-testid":a,children:[o,`Delete`]}),t[1]=r,t[2]=n,t[3]=a,t[4]=i,t[5]=s):s=t[5],s};function Qa(e){return e.stopPropagation()}function $a(e){return e.preventDefault()}var eo=e=>{let t=(0,Y.c)(10),{node:n}=e,r=(0,S.useRef)(null),i,a;t[0]===n.data.name?(i=t[1],a=t[2]):(i=()=>{r.current?.focus();let e=n.data.name,t=e.lastIndexOf(`.`),i=t>0?t:e.length;r.current?.setSelectionRange(0,i)},a=[n.data.name],t[0]=n.data.name,t[1]=i,t[2]=a),(0,S.useEffect)(i,a);let o,s;t[3]===n?(o=t[4],s=t[5]):(o=()=>n.reset(),s=e=>{e.key===`Escape`&&n.reset(),e.key===`Enter`&&n.submit(e.currentTarget.value)},t[3]=n,t[4]=o,t[5]=s);let c;return t[6]!==n.data.name||t[7]!==o||t[8]!==s?(c=(0,C.jsx)(`input`,{ref:r,className:`flex-1 bg-transparent border border-border text-muted-foreground`,defaultValue:n.data.name,onClick:to,onBlur:o,onKeyDown:s}),t[6]=n.data.name,t[7]=o,t[8]=s,t[9]=c):c=t[9],c};function to(e){return e.stopPropagation()}export{Ya as a,Ia as c,yr as d,Un as f,Ja as i,Z as l,en as m,Za as n,Wa as o,F as p,Xa as r,qa as s,eo as t,Ma as u};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{l as t}from"./useEvent-xfs0Sn4r.js";import{t as n}from"./react-CBDbhulC.js";import{S as r,mt as i}from"./cells-D4RwofRx.js";import{t as a}from"./compiler-runtime-CYIjoINj.js";import{g as o}from"./useEventListener-D27Dii_l.js";import{E as s}from"./config-D4frVGQ4.js";import{t as c}from"./cn-ldLVeaqm.js";import{t as l}from"./jsx-runtime-B74pBk57.js";var u=a(),d=e(n(),1);function f(){return s()===`edit`?document.getElementById(`App`):void 0}function p(e){let t=(0,u.c)(7),[n,r]=(0,d.useState)(void 0),[a,o]=(0,d.useState)(void 0),s=(0,d.useRef)(null),c=(0,d.useRef)(null),l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=new Map,t[0]=l):l=t[0];let p=(0,d.useRef)(l),h,g;t[1]===e?(h=t[2],g=t[3]):(h=()=>e.length===0?void 0:(s.current=new IntersectionObserver(e=>{let t=!1;if(e.forEach(e=>{let n=e.target;e.isIntersecting?(!c.current||n.getBoundingClientRect().top<c.current.getBoundingClientRect().top)&&(c.current=n,t=!0):n===c.current&&(c.current=null,t=!0)}),t&&c.current){let e=i(c.current),t=`id`in e?e.id:e.path;r(t),o(p.current.get(c.current))}},{root:f(),rootMargin:`0px`,threshold:0}),e.forEach(t=>{if(t){let n=i(t[0]),r=e.map(m).filter(e=>`id`in n?e.id===n.id:e.textContent===t[0].textContent).indexOf(t[0]);p.current.set(t[0],r),s.current?.observe(t[0])}}),()=>{s.current&&s.current.disconnect(),c.current=null}),g=[e],t[1]=e,t[2]=h,t[3]=g),(0,d.useEffect)(h,g);let _;return t[4]!==n||t[5]!==a?(_={activeHeaderId:n,activeOccurrences:a},t[4]=n,t[5]=a,t[6]=_):_=t[6],_}function m(e){let[t]=e;return t}function h(e){if(e.length===0)return[];let t=new Map;return e.map(e=>{let n=`id`in e.by?e.by.id:e.by.path,r=t.get(n)??0;t.set(n,r+1);let i=_(e,r);return i?[i,n]:null}).filter(Boolean)}function g(e,t){let n=_(e,t);if(!n){o.warn(`Could not find element for outline item`,e);return}n.scrollIntoView({behavior:`smooth`,block:`start`}),n.classList.add(`outline-item-highlight`),setTimeout(()=>{n.classList.remove(`outline-item-highlight`)},3e3)}function _(e,t){return`id`in e.by?document.querySelectorAll(`[id="${CSS.escape(e.by.id)}"]`)[t]:document.evaluate(e.by.path,document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue}var v=l(),y=()=>{let e=(0,u.c)(19),{items:n}=t(r),i;e[0]===n?i=e[1]:(i=h(n),e[0]=n,e[1]=i);let{activeHeaderId:a,activeOccurrences:o}=p(i),[s,l]=d.useState(!1);if(n.length<2)return null;let f,m,g;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=()=>l(!0),m=()=>l(!1),g=c(`fixed top-[25vh] right-8 z-10000 print:hidden`,`hidden md:block`),e[2]=f,e[3]=m,e[4]=g):(f=e[2],m=e[3],g=e[4]);let _=s?`left-[-280px] opacity-100`:`left-[300px] opacity-0`,y;e[5]===_?y=e[6]:(y=c(`-top-4 max-h-[70vh] bg-background rounded-lg shadow-lg absolute overflow-auto transition-all duration-300 w-[300px] border`,_),e[5]=_,e[6]=y);let S;e[7]!==a||e[8]!==o||e[9]!==n||e[10]!==y?(S=(0,v.jsx)(x,{className:y,items:n,activeHeaderId:a,activeOccurrences:o}),e[7]=a,e[8]=o,e[9]=n,e[10]=y,e[11]=S):S=e[11];let C;e[12]!==a||e[13]!==o||e[14]!==n?(C=(0,v.jsx)(b,{items:n,activeHeaderId:a,activeOccurrences:o}),e[12]=a,e[13]=o,e[14]=n,e[15]=C):C=e[15];let w;return e[16]!==S||e[17]!==C?(w=(0,v.jsxs)(`div`,{onMouseEnter:f,onMouseLeave:m,className:g,children:[S,C]}),e[16]=S,e[17]=C,e[18]=w):w=e[18],w},b=e=>{let t=(0,u.c)(8),{items:n,activeHeaderId:r,activeOccurrences:i}=e,a,o;if(t[0]!==r||t[1]!==i||t[2]!==n){let e=new Map;a=`flex flex-col gap-4 items-end max-h-[70vh] overflow-hidden`,o=n.map((t,n)=>{let a=`id`in t.by?t.by.id:t.by.path,o=e.get(a)??0;return e.set(a,o+1),(0,v.jsx)(`div`,{className:c(`h-[2px] bg-muted-foreground/60`,t.level===1&&`w-5`,t.level===2&&`w-4`,t.level===3&&`w-3`,t.level===4&&`w-2`,o===i&&r===a&&`bg-foreground`),onClick:()=>g(t,o)},`${a}-${n}`)}),t[0]=r,t[1]=i,t[2]=n,t[3]=a,t[4]=o}else a=t[3],o=t[4];let s;return t[5]!==a||t[6]!==o?(s=(0,v.jsx)(`div`,{className:a,children:o}),t[5]=a,t[6]=o,t[7]=s):s=t[7],s},x=e=>{let t=(0,u.c)(11),{items:n,activeHeaderId:r,activeOccurrences:i,className:a}=e,o,s;if(t[0]!==r||t[1]!==i||t[2]!==a||t[3]!==n){let e=new Map;t[6]===a?o=t[7]:(o=c(`flex flex-col overflow-auto py-4 pl-2`,a),t[6]=a,t[7]=o),s=n.map((t,n)=>{let a=`id`in t.by?t.by.id:t.by.path,o=e.get(a)??0;e.set(a,o+1);let s=`${a}-${n}`,l={className:c(`px-2 py-1 cursor-pointer hover:bg-accent/50 hover:text-accent-foreground rounded-l`,t.level===1&&`font-semibold`,t.level===2&&`ml-3`,t.level===3&&`ml-6`,t.level===4&&`ml-9`,o===i&&r===a&&`text-accent-foreground`),onClick:()=>g(t,o)};return t.html?(0,v.jsx)(`div`,{...l,dangerouslySetInnerHTML:{__html:t.html}},s):(0,v.jsx)(`div`,{...l,children:t.name},s)}),t[0]=r,t[1]=i,t[2]=a,t[3]=n,t[4]=o,t[5]=s}else o=t[4],s=t[5];let l;return t[8]!==o||t[9]!==s?(l=(0,v.jsx)(`div`,{className:o,children:s}),t[8]=o,t[9]=s,t[10]=l):l=t[10],l};export{p as i,x as n,h as r,y as t};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{l as t}from"./useEvent-xfs0Sn4r.js";import{t as n}from"./react-CBDbhulC.js";import{S as r,mt as i}from"./cells-Cp-G34Rz.js";import{t as a}from"./compiler-runtime-CYIjoINj.js";import{g as o}from"./useEventListener-92uWqz-P.js";import{E as s}from"./config-BlNM0caL.js";import{t as c}from"./cn-ldLVeaqm.js";import{t as l}from"./jsx-runtime-B74pBk57.js";var u=a(),d=e(n(),1);function f(){return s()===`edit`?document.getElementById(`App`):void 0}function p(e){let t=(0,u.c)(7),[n,r]=(0,d.useState)(void 0),[a,o]=(0,d.useState)(void 0),s=(0,d.useRef)(null),c=(0,d.useRef)(null),l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=new Map,t[0]=l):l=t[0];let p=(0,d.useRef)(l),h,g;t[1]===e?(h=t[2],g=t[3]):(h=()=>e.length===0?void 0:(s.current=new IntersectionObserver(e=>{let t=!1;if(e.forEach(e=>{let n=e.target;e.isIntersecting?(!c.current||n.getBoundingClientRect().top<c.current.getBoundingClientRect().top)&&(c.current=n,t=!0):n===c.current&&(c.current=null,t=!0)}),t&&c.current){let e=i(c.current),t=`id`in e?e.id:e.path;r(t),o(p.current.get(c.current))}},{root:f(),rootMargin:`0px`,threshold:0}),e.forEach(t=>{if(t){let n=i(t[0]),r=e.map(m).filter(e=>`id`in n?e.id===n.id:e.textContent===t[0].textContent).indexOf(t[0]);p.current.set(t[0],r),s.current?.observe(t[0])}}),()=>{s.current&&s.current.disconnect(),c.current=null}),g=[e],t[1]=e,t[2]=h,t[3]=g),(0,d.useEffect)(h,g);let _;return t[4]!==n||t[5]!==a?(_={activeHeaderId:n,activeOccurrences:a},t[4]=n,t[5]=a,t[6]=_):_=t[6],_}function m(e){let[t]=e;return t}function h(e){if(e.length===0)return[];let t=new Map;return e.map(e=>{let n=`id`in e.by?e.by.id:e.by.path,r=t.get(n)??0;t.set(n,r+1);let i=_(e,r);return i?[i,n]:null}).filter(Boolean)}function g(e,t){let n=_(e,t);if(!n){o.warn(`Could not find element for outline item`,e);return}n.scrollIntoView({behavior:`smooth`,block:`start`}),n.classList.add(`outline-item-highlight`),setTimeout(()=>{n.classList.remove(`outline-item-highlight`)},3e3)}function _(e,t){return`id`in e.by?document.querySelectorAll(`[id="${CSS.escape(e.by.id)}"]`)[t]:document.evaluate(e.by.path,document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue}var v=l(),y=()=>{let e=(0,u.c)(19),{items:n}=t(r),i;e[0]===n?i=e[1]:(i=h(n),e[0]=n,e[1]=i);let{activeHeaderId:a,activeOccurrences:o}=p(i),[s,l]=d.useState(!1);if(n.length<2)return null;let f,m,g;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=()=>l(!0),m=()=>l(!1),g=c(`fixed top-[25vh] right-8 z-10000 print:hidden`,`hidden md:block`),e[2]=f,e[3]=m,e[4]=g):(f=e[2],m=e[3],g=e[4]);let _=s?`left-[-280px] opacity-100`:`left-[300px] opacity-0`,y;e[5]===_?y=e[6]:(y=c(`-top-4 max-h-[70vh] bg-background rounded-lg shadow-lg absolute overflow-auto transition-all duration-300 w-[300px] border`,_),e[5]=_,e[6]=y);let S;e[7]!==a||e[8]!==o||e[9]!==n||e[10]!==y?(S=(0,v.jsx)(x,{className:y,items:n,activeHeaderId:a,activeOccurrences:o}),e[7]=a,e[8]=o,e[9]=n,e[10]=y,e[11]=S):S=e[11];let C;e[12]!==a||e[13]!==o||e[14]!==n?(C=(0,v.jsx)(b,{items:n,activeHeaderId:a,activeOccurrences:o}),e[12]=a,e[13]=o,e[14]=n,e[15]=C):C=e[15];let w;return e[16]!==S||e[17]!==C?(w=(0,v.jsxs)(`div`,{onMouseEnter:f,onMouseLeave:m,className:g,children:[S,C]}),e[16]=S,e[17]=C,e[18]=w):w=e[18],w},b=e=>{let t=(0,u.c)(8),{items:n,activeHeaderId:r,activeOccurrences:i}=e,a,o;if(t[0]!==r||t[1]!==i||t[2]!==n){let e=new Map;a=`flex flex-col gap-4 items-end max-h-[70vh] overflow-hidden`,o=n.map((t,n)=>{let a=`id`in t.by?t.by.id:t.by.path,o=e.get(a)??0;return e.set(a,o+1),(0,v.jsx)(`div`,{className:c(`h-[2px] bg-muted-foreground/60`,t.level===1&&`w-5`,t.level===2&&`w-4`,t.level===3&&`w-3`,t.level===4&&`w-2`,o===i&&r===a&&`bg-foreground`),onClick:()=>g(t,o)},`${a}-${n}`)}),t[0]=r,t[1]=i,t[2]=n,t[3]=a,t[4]=o}else a=t[3],o=t[4];let s;return t[5]!==a||t[6]!==o?(s=(0,v.jsx)(`div`,{className:a,children:o}),t[5]=a,t[6]=o,t[7]=s):s=t[7],s},x=e=>{let t=(0,u.c)(11),{items:n,activeHeaderId:r,activeOccurrences:i,className:a}=e,o,s;if(t[0]!==r||t[1]!==i||t[2]!==a||t[3]!==n){let e=new Map;t[6]===a?o=t[7]:(o=c(`flex flex-col overflow-auto py-4 pl-2`,a),t[6]=a,t[7]=o),s=n.map((t,n)=>{let a=`id`in t.by?t.by.id:t.by.path,o=e.get(a)??0;e.set(a,o+1);let s=`${a}-${n}`,l={className:c(`px-2 py-1 cursor-pointer hover:bg-accent/50 hover:text-accent-foreground rounded-l`,t.level===1&&`font-semibold`,t.level===2&&`ml-3`,t.level===3&&`ml-6`,t.level===4&&`ml-9`,o===i&&r===a&&`text-accent-foreground`),onClick:()=>g(t,o)};return t.html?(0,v.jsx)(`div`,{...l,dangerouslySetInnerHTML:{__html:t.html}},s):(0,v.jsx)(`div`,{...l,children:t.name},s)}),t[0]=r,t[1]=i,t[2]=a,t[3]=n,t[4]=o,t[5]=s}else o=t[4],s=t[5];let l;return t[8]!==o||t[9]!==s?(l=(0,v.jsx)(`div`,{className:o,children:s}),t[8]=o,t[9]=s,t[10]=l):l=t[10],l};export{p as i,x as n,h as r,y as t};
@@ -1 +1 @@
1
- import{o as e}from"./tooltip-Cwltdez8.js";function t(e){function t(e){return!!e?.schema&&Array.isArray(e.schema.fields)&&typeof e.toArray==`function`}return(t(e)?e:n(e)).toArray()}t.responseType=`arrayBuffer`;function n(t,n){return e(t,n??{useProxy:!0})}export{t};
1
+ import{o as e}from"./tooltip-BG35uS_N.js";function t(e){function t(e){return!!e?.schema&&Array.isArray(e.schema.fields)&&typeof e.toArray==`function`}return(t(e)?e:n(e)).toArray()}t.responseType=`arrayBuffer`;function n(t,n){return e(t,n??{useProxy:!0})}export{t};
@@ -1 +1 @@
1
- import{i as e}from"./numbers-DKurV_vq.js";function t(t,n){if(t===0||t===-1)return`0 B`;let r=1024,i=[`B`,`KB`,`MB`,`GB`,`TB`],a=Math.floor(Math.log(t)/Math.log(r)),o=t/r**a;return`${e(o,n)} ${i[a]}`}function n(t,n){if(t===0)return`0s`;if(t<.001)return`${e(t*1e6,n)}µs`;if(t<1)return`${e(t*1e3,n)}ms`;if(t<60)return`${e(t,n)}s`;let r=Math.floor(t/60),i=t%60;if(r<60)return i>0?`${r}m ${e(i,n)}s`:`${r}m`;let a=Math.floor(r/60),o=r%60;return o>0?`${a}h ${o}m`:`${a}h`}export{n,t};
1
+ import{i as e}from"./numbers-Bc-r3jsC.js";function t(t,n){if(t===0||t===-1)return`0 B`;let r=1024,i=[`B`,`KB`,`MB`,`GB`,`TB`],a=Math.floor(Math.log(t)/Math.log(r)),o=t/r**a;return`${e(o,n)} ${i[a]}`}function n(t,n){if(t===0)return`0s`;if(t<.001)return`${e(t*1e6,n)}µs`;if(t<1)return`${e(t*1e3,n)}ms`;if(t<60)return`${e(t,n)}s`;let r=Math.floor(t/60),i=t%60;if(r<60)return i>0?`${r}m ${e(i,n)}s`:`${r}m`;let a=Math.floor(r/60),o=r%60;return o>0?`${a}h ${o}m`:`${a}h`}export{n,t};
@@ -1,9 +1,9 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-CBDbhulC.js";import{t as n}from"./react-dom-BQrReHnR.js";import{t as r}from"./compiler-runtime-CYIjoINj.js";import{o as i,r as a,t as o}from"./useEventListener-D27Dii_l.js";import{t as s}from"./jsx-runtime-B74pBk57.js";var c=e(t(),1),l=e(n(),1),u=s(),d=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=a(`Primitive.${t}`),r=c.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,u.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function f(e,t){e&&l.flushSync(()=>e.dispatchEvent(t))}function p(e,t){let n=c.createContext(t),r=e=>{let{children:t,...r}=e,i=c.useMemo(()=>r,Object.values(r));return(0,u.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=c.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function m(e,t=[]){let n=[];function r(t,r){let i=c.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,l=c.useMemo(()=>o,Object.values(o));return(0,u.jsx)(s.Provider,{value:l,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,l=c.useContext(s);if(l)return l;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>c.createContext(e));return function(n){let r=n?.[e]||t;return c.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,h(i,...t)]}function h(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}typeof window<`u`&&window.document&&window.document.createElement;function g(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var _=globalThis?.document?c.useLayoutEffect:()=>{},v=c.useInsertionEffect||_;function y({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=b({defaultProp:t,onChange:n}),s=e!==void 0,l=s?e:i;{let t=c.useRef(e!==void 0);c.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[l,c.useCallback(t=>{if(s){let n=x(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function b({defaultProp:e,onChange:t}){let[n,r]=c.useState(e),i=c.useRef(n),a=c.useRef(t);return v(()=>{a.current=t},[t]),c.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function x(e){return typeof e==`function`}function S(e,t){return c.useReducer((e,n)=>t[e][n]??e,e)}var C=e=>{let{present:t,children:n}=e,r=w(t),a=typeof n==`function`?n({present:r.isPresent}):c.Children.only(n),o=i(r.ref,ee(a));return typeof n==`function`||r.isPresent?c.cloneElement(a,{ref:o}):null};C.displayName=`Presence`;function w(e){let[t,n]=c.useState(),r=c.useRef(null),i=c.useRef(e),a=c.useRef(`none`),[o,s]=S(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return c.useEffect(()=>{let e=T(r.current);a.current=o===`mounted`?e:`none`},[o]),_(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=T(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),_(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=T(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=T(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:c.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function T(e){return e?.animationName||`none`}function ee(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var E=c.useId||(()=>void 0),te=0;function ne(e){let[t,n]=c.useState(E());return _(()=>{e||n(e=>e??String(te++))},[e]),e||(t?`radix-${t}`:``)}function D(e){let t=c.useRef(e);return c.useEffect(()=>{t.current=e}),c.useMemo(()=>(...e)=>t.current?.(...e),[])}function re(e,t=globalThis?.document){let n=D(e);c.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var ie=`DismissableLayer`,O=`dismissableLayer.update`,ae=`dismissableLayer.pointerDownOutside`,oe=`dismissableLayer.focusOutside`,se,ce=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),k=c.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:l,...f}=e,p=c.useContext(ce),[m,h]=c.useState(null),_=m?.ownerDocument??globalThis?.document,[,v]=c.useState({}),y=i(t,e=>h(e)),b=Array.from(p.layers),[x]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),S=b.indexOf(x),C=m?b.indexOf(m):-1,w=p.layersWithOutsidePointerEventsDisabled.size>0,T=C>=S,ee=de(e=>{let t=e.target,n=[...p.branches].some(e=>e.contains(t));!T||n||(a?.(e),s?.(e),e.defaultPrevented||l?.())},_),E=fe(e=>{let t=e.target;[...p.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||l?.())},_);return re(e=>{C===p.layers.size-1&&(r?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},_),c.useEffect(()=>{if(m)return n&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(se=_.body.style.pointerEvents,_.body.style.pointerEvents=`none`),p.layersWithOutsidePointerEventsDisabled.add(m)),p.layers.add(m),pe(),()=>{n&&p.layersWithOutsidePointerEventsDisabled.size===1&&(_.body.style.pointerEvents=se)}},[m,_,n,p]),c.useEffect(()=>()=>{m&&(p.layers.delete(m),p.layersWithOutsidePointerEventsDisabled.delete(m),pe())},[m,p]),c.useEffect(()=>{let e=()=>v({});return document.addEventListener(O,e),()=>document.removeEventListener(O,e)},[]),(0,u.jsx)(d.div,{...f,ref:y,style:{pointerEvents:w?T?`auto`:`none`:void 0,...e.style},onFocusCapture:g(e.onFocusCapture,E.onFocusCapture),onBlurCapture:g(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:g(e.onPointerDownCapture,ee.onPointerDownCapture)})});k.displayName=ie;var le=`DismissableLayerBranch`,ue=c.forwardRef((e,t)=>{let n=c.useContext(ce),r=c.useRef(null),a=i(t,r);return c.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,u.jsx)(d.div,{...e,ref:a})});ue.displayName=le;function de(e,t=globalThis?.document){let n=D(e),r=c.useRef(!1),i=c.useRef(()=>{});return c.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){me(ae,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function fe(e,t=globalThis?.document){let n=D(e),r=c.useRef(!1);return c.useEffect(()=>{let e=e=>{e.target&&!r.current&&me(oe,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function pe(){let e=new CustomEvent(O);document.dispatchEvent(e)}function me(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?f(i,a):i.dispatchEvent(a)}var he=k,ge=ue,A=`focusScope.autoFocusOnMount`,j=`focusScope.autoFocusOnUnmount`,_e={bubbles:!1,cancelable:!0},ve=`FocusScope`,ye=c.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:o,...s}=e,[l,f]=c.useState(null),p=D(a),m=D(o),h=c.useRef(null),g=i(t,e=>f(e)),_=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(r){let e=function(e){if(_.paused||!l)return;let t=e.target;l.contains(t)?h.current=t:M(h.current,{select:!0})},t=function(e){if(_.paused||!l)return;let t=e.relatedTarget;t!==null&&(l.contains(t)||M(h.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&M(l)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,l,_.paused]),c.useEffect(()=>{if(l){Ee.add(_);let e=document.activeElement;if(!l.contains(e)){let t=new CustomEvent(A,_e);l.addEventListener(A,p),l.dispatchEvent(t),t.defaultPrevented||(be(ke(Se(l)),{select:!0}),document.activeElement===e&&M(l))}return()=>{l.removeEventListener(A,p),setTimeout(()=>{let t=new CustomEvent(j,_e);l.addEventListener(j,m),l.dispatchEvent(t),t.defaultPrevented||M(e??document.body,{select:!0}),l.removeEventListener(j,m),Ee.remove(_)},0)}}},[l,p,m,_]);let v=c.useCallback(e=>{if(!n&&!r||_.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=xe(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&M(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&M(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,_.paused]);return(0,u.jsx)(d.div,{tabIndex:-1,...s,ref:g,onKeyDown:v})});ye.displayName=ve;function be(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(M(r,{select:t}),document.activeElement!==n)return}function xe(e){let t=Se(e);return[Ce(t,e),Ce(t.reverse(),e)]}function Se(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ce(e,t){for(let n of e)if(!we(n,{upTo:t}))return n}function we(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function Te(e){return e instanceof HTMLInputElement&&`select`in e}function M(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Te(e)&&t&&e.select()}}var Ee=De();function De(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Oe(e,t),e.unshift(t)},remove(t){e=Oe(e,t),e[0]?.resume()}}}function Oe(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function ke(e){return e.filter(e=>e.tagName!==`A`)}var Ae=`Portal`,je=c.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=c.useState(!1);_(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?l.createPortal((0,u.jsx)(d.div,{...r,ref:t}),o):null});je.displayName=Ae;var N=0;function Me(){c.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??Ne()),document.body.insertAdjacentElement(`beforeend`,e[1]??Ne()),N++,()=>{N===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),N--}},[])}function Ne(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var P=function(){return P=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},P.apply(this,arguments)};function Pe(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Fe(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function Ie(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var F=`right-scroll-bar-position`,I=`width-before-scroll-bar`,Le=`with-scroll-bars-hidden`,Re=`--removed-body-scroll-bar-size`;function L(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function ze(e,t){var n=(0,c.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Be=typeof window<`u`?c.useLayoutEffect:c.useEffect,Ve=new WeakMap;function He(e,t){var n=ze(t||null,function(t){return e.forEach(function(e){return L(e,t)})});return Be(function(){var t=Ve.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||L(e,null)}),i.forEach(function(e){r.has(e)||L(e,a)})}Ve.set(n,e)},[e]),n}function Ue(e){return e}function We(e,t){t===void 0&&(t=Ue);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Ge(e){e===void 0&&(e={});var t=We(null);return t.options=P({async:!0,ssr:!1},e),t}var Ke=function(e){var t=e.sideCar,n=Pe(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return c.createElement(r,P({},n))};Ke.isSideCarExport=!0;function qe(e,t){return e.useMedium(t),Ke}var R=Ge(),z=function(){},B=c.forwardRef(function(e,t){var n=c.useRef(null),r=c.useState({onScrollCapture:z,onWheelCapture:z,onTouchMoveCapture:z}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=Pe(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=He([n,t]),w=P(P({},x),i);return c.createElement(c.Fragment,null,d&&c.createElement(S,{sideCar:R,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?c.cloneElement(c.Children.only(s),P(P({},w),{ref:C})):c.createElement(y,P({},w,{className:l,ref:C}),s))});B.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},B.classNames={fullWidth:I,zeroRight:F};var Je,Ye=function(){if(Je)return Je;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Xe(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Ye();return t&&e.setAttribute(`nonce`,t),e}function Ze(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Qe(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var $e=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Xe())&&(Ze(t,n),Qe(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},et=function(){var e=$e();return function(t,n){c.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},tt=function(){var e=et();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},nt={left:0,top:0,right:0,gap:0},V=function(e){return parseInt(e||``,10)||0},rt=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[V(n),V(r),V(i)]},it=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return nt;var t=rt(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},at=tt(),H=`data-scroll-locked`,ot=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-CBDbhulC.js";import{t as n}from"./react-dom-BQrReHnR.js";import{t as r}from"./compiler-runtime-CYIjoINj.js";import{o as i,r as a,t as o}from"./useEventListener-92uWqz-P.js";import{t as s}from"./jsx-runtime-B74pBk57.js";var c=e(t(),1),l=e(n(),1),u=s(),d=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=a(`Primitive.${t}`),r=c.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,u.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function f(e,t){e&&l.flushSync(()=>e.dispatchEvent(t))}function p(e,t){let n=c.createContext(t),r=e=>{let{children:t,...r}=e,i=c.useMemo(()=>r,Object.values(r));return(0,u.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=c.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function m(e,t=[]){let n=[];function r(t,r){let i=c.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,l=c.useMemo(()=>o,Object.values(o));return(0,u.jsx)(s.Provider,{value:l,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,l=c.useContext(s);if(l)return l;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>c.createContext(e));return function(n){let r=n?.[e]||t;return c.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,h(i,...t)]}function h(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}typeof window<`u`&&window.document&&window.document.createElement;function g(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var _=globalThis?.document?c.useLayoutEffect:()=>{},v=c.useInsertionEffect||_;function y({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=b({defaultProp:t,onChange:n}),s=e!==void 0,l=s?e:i;{let t=c.useRef(e!==void 0);c.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[l,c.useCallback(t=>{if(s){let n=x(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function b({defaultProp:e,onChange:t}){let[n,r]=c.useState(e),i=c.useRef(n),a=c.useRef(t);return v(()=>{a.current=t},[t]),c.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function x(e){return typeof e==`function`}function S(e,t){return c.useReducer((e,n)=>t[e][n]??e,e)}var C=e=>{let{present:t,children:n}=e,r=w(t),a=typeof n==`function`?n({present:r.isPresent}):c.Children.only(n),o=i(r.ref,ee(a));return typeof n==`function`||r.isPresent?c.cloneElement(a,{ref:o}):null};C.displayName=`Presence`;function w(e){let[t,n]=c.useState(),r=c.useRef(null),i=c.useRef(e),a=c.useRef(`none`),[o,s]=S(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return c.useEffect(()=>{let e=T(r.current);a.current=o===`mounted`?e:`none`},[o]),_(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=T(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),_(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=T(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=T(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:c.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function T(e){return e?.animationName||`none`}function ee(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var E=c.useId||(()=>void 0),te=0;function ne(e){let[t,n]=c.useState(E());return _(()=>{e||n(e=>e??String(te++))},[e]),e||(t?`radix-${t}`:``)}function D(e){let t=c.useRef(e);return c.useEffect(()=>{t.current=e}),c.useMemo(()=>(...e)=>t.current?.(...e),[])}function re(e,t=globalThis?.document){let n=D(e);c.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var ie=`DismissableLayer`,O=`dismissableLayer.update`,ae=`dismissableLayer.pointerDownOutside`,oe=`dismissableLayer.focusOutside`,se,ce=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),k=c.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:l,...f}=e,p=c.useContext(ce),[m,h]=c.useState(null),_=m?.ownerDocument??globalThis?.document,[,v]=c.useState({}),y=i(t,e=>h(e)),b=Array.from(p.layers),[x]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),S=b.indexOf(x),C=m?b.indexOf(m):-1,w=p.layersWithOutsidePointerEventsDisabled.size>0,T=C>=S,ee=de(e=>{let t=e.target,n=[...p.branches].some(e=>e.contains(t));!T||n||(a?.(e),s?.(e),e.defaultPrevented||l?.())},_),E=fe(e=>{let t=e.target;[...p.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||l?.())},_);return re(e=>{C===p.layers.size-1&&(r?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},_),c.useEffect(()=>{if(m)return n&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(se=_.body.style.pointerEvents,_.body.style.pointerEvents=`none`),p.layersWithOutsidePointerEventsDisabled.add(m)),p.layers.add(m),pe(),()=>{n&&p.layersWithOutsidePointerEventsDisabled.size===1&&(_.body.style.pointerEvents=se)}},[m,_,n,p]),c.useEffect(()=>()=>{m&&(p.layers.delete(m),p.layersWithOutsidePointerEventsDisabled.delete(m),pe())},[m,p]),c.useEffect(()=>{let e=()=>v({});return document.addEventListener(O,e),()=>document.removeEventListener(O,e)},[]),(0,u.jsx)(d.div,{...f,ref:y,style:{pointerEvents:w?T?`auto`:`none`:void 0,...e.style},onFocusCapture:g(e.onFocusCapture,E.onFocusCapture),onBlurCapture:g(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:g(e.onPointerDownCapture,ee.onPointerDownCapture)})});k.displayName=ie;var le=`DismissableLayerBranch`,ue=c.forwardRef((e,t)=>{let n=c.useContext(ce),r=c.useRef(null),a=i(t,r);return c.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,u.jsx)(d.div,{...e,ref:a})});ue.displayName=le;function de(e,t=globalThis?.document){let n=D(e),r=c.useRef(!1),i=c.useRef(()=>{});return c.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){me(ae,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function fe(e,t=globalThis?.document){let n=D(e),r=c.useRef(!1);return c.useEffect(()=>{let e=e=>{e.target&&!r.current&&me(oe,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function pe(){let e=new CustomEvent(O);document.dispatchEvent(e)}function me(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?f(i,a):i.dispatchEvent(a)}var he=k,ge=ue,A=`focusScope.autoFocusOnMount`,j=`focusScope.autoFocusOnUnmount`,_e={bubbles:!1,cancelable:!0},ve=`FocusScope`,ye=c.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:o,...s}=e,[l,f]=c.useState(null),p=D(a),m=D(o),h=c.useRef(null),g=i(t,e=>f(e)),_=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(r){let e=function(e){if(_.paused||!l)return;let t=e.target;l.contains(t)?h.current=t:M(h.current,{select:!0})},t=function(e){if(_.paused||!l)return;let t=e.relatedTarget;t!==null&&(l.contains(t)||M(h.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&M(l)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,l,_.paused]),c.useEffect(()=>{if(l){Ee.add(_);let e=document.activeElement;if(!l.contains(e)){let t=new CustomEvent(A,_e);l.addEventListener(A,p),l.dispatchEvent(t),t.defaultPrevented||(be(ke(Se(l)),{select:!0}),document.activeElement===e&&M(l))}return()=>{l.removeEventListener(A,p),setTimeout(()=>{let t=new CustomEvent(j,_e);l.addEventListener(j,m),l.dispatchEvent(t),t.defaultPrevented||M(e??document.body,{select:!0}),l.removeEventListener(j,m),Ee.remove(_)},0)}}},[l,p,m,_]);let v=c.useCallback(e=>{if(!n&&!r||_.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=xe(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&M(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&M(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,_.paused]);return(0,u.jsx)(d.div,{tabIndex:-1,...s,ref:g,onKeyDown:v})});ye.displayName=ve;function be(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(M(r,{select:t}),document.activeElement!==n)return}function xe(e){let t=Se(e);return[Ce(t,e),Ce(t.reverse(),e)]}function Se(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ce(e,t){for(let n of e)if(!we(n,{upTo:t}))return n}function we(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function Te(e){return e instanceof HTMLInputElement&&`select`in e}function M(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Te(e)&&t&&e.select()}}var Ee=De();function De(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Oe(e,t),e.unshift(t)},remove(t){e=Oe(e,t),e[0]?.resume()}}}function Oe(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function ke(e){return e.filter(e=>e.tagName!==`A`)}var Ae=`Portal`,je=c.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=c.useState(!1);_(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?l.createPortal((0,u.jsx)(d.div,{...r,ref:t}),o):null});je.displayName=Ae;var N=0;function Me(){c.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??Ne()),document.body.insertAdjacentElement(`beforeend`,e[1]??Ne()),N++,()=>{N===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),N--}},[])}function Ne(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var P=function(){return P=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},P.apply(this,arguments)};function Pe(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Fe(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function Ie(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var F=`right-scroll-bar-position`,I=`width-before-scroll-bar`,Le=`with-scroll-bars-hidden`,Re=`--removed-body-scroll-bar-size`;function L(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function ze(e,t){var n=(0,c.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Be=typeof window<`u`?c.useLayoutEffect:c.useEffect,Ve=new WeakMap;function He(e,t){var n=ze(t||null,function(t){return e.forEach(function(e){return L(e,t)})});return Be(function(){var t=Ve.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||L(e,null)}),i.forEach(function(e){r.has(e)||L(e,a)})}Ve.set(n,e)},[e]),n}function Ue(e){return e}function We(e,t){t===void 0&&(t=Ue);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Ge(e){e===void 0&&(e={});var t=We(null);return t.options=P({async:!0,ssr:!1},e),t}var Ke=function(e){var t=e.sideCar,n=Pe(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return c.createElement(r,P({},n))};Ke.isSideCarExport=!0;function qe(e,t){return e.useMedium(t),Ke}var Je=Ge(),R=function(){},z=c.forwardRef(function(e,t){var n=c.useRef(null),r=c.useState({onScrollCapture:R,onWheelCapture:R,onTouchMoveCapture:R}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=Pe(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=He([n,t]),w=P(P({},x),i);return c.createElement(c.Fragment,null,d&&c.createElement(S,{sideCar:Je,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?c.cloneElement(c.Children.only(s),P(P({},w),{ref:C})):c.createElement(y,P({},w,{className:l,ref:C}),s))});z.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},z.classNames={fullWidth:I,zeroRight:F};var Ye,Xe=function(){if(Ye)return Ye;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Ze(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Xe();return t&&e.setAttribute(`nonce`,t),e}function Qe(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function $e(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var et=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ze())&&(Qe(t,n),$e(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},tt=function(){var e=et();return function(t,n){c.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},nt=function(){var e=tt();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},rt={left:0,top:0,right:0,gap:0},B=function(e){return parseInt(e||``,10)||0},it=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[B(n),B(r),B(i)]},at=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return rt;var t=it(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},ot=nt(),V=`data-scroll-locked`,st=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
2
2
  .${Le} {
3
3
  overflow: hidden ${r};
4
4
  padding-right: ${s}px ${r};
5
5
  }
6
- body[${H}] {
6
+ body[${V}] {
7
7
  overflow: hidden ${r};
8
8
  overscroll-behavior: contain;
9
9
  ${[t&&`position: relative ${r};`,n===`margin`&&`
@@ -32,10 +32,10 @@ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-CBDbhul
32
32
  margin-right: 0 ${r};
33
33
  }
34
34
 
35
- body[${H}] {
35
+ body[${V}] {
36
36
  ${Re}: ${s}px;
37
37
  }
38
- `},st=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},ct=function(){c.useEffect(function(){return document.body.setAttribute(H,(st()+1).toString()),function(){var e=st()-1;e<=0?document.body.removeAttribute(H):document.body.setAttribute(H,e.toString())}},[])},lt=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;ct();var a=c.useMemo(function(){return it(i)},[i]);return c.createElement(at,{styles:ot(a,!t,i,n?``:`!important`)})},U=!1;if(typeof window<`u`)try{var W=Object.defineProperty({},"passive",{get:function(){return U=!0,!0}});window.addEventListener(`test`,W,W),window.removeEventListener(`test`,W,W)}catch{U=!1}var G=U?{passive:!1}:!1,ut=function(e){return e.tagName===`TEXTAREA`},dt=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!ut(e)&&n[t]===`visible`)},ft=function(e){return dt(e,`overflowY`)},pt=function(e){return dt(e,`overflowX`)},mt=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),_t(e,r)){var i=vt(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},ht=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},gt=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},_t=function(e,t){return e===`v`?ft(t):pt(t)},vt=function(e,t){return e===`v`?ht(t):gt(t)},yt=function(e,t){return e===`h`&&t===`rtl`?-1:1},bt=function(e,t,n,r,i){var a=yt(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=vt(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&_t(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},K=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},xt=function(e){return[e.deltaX,e.deltaY]},St=function(e){return e&&`current`in e?e.current:e},Ct=function(e,t){return e[0]===t[0]&&e[1]===t[1]},wt=function(e){return`
38
+ `},ct=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},lt=function(){c.useEffect(function(){return document.body.setAttribute(V,(ct()+1).toString()),function(){var e=ct()-1;e<=0?document.body.removeAttribute(V):document.body.setAttribute(V,e.toString())}},[])},ut=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;lt();var a=c.useMemo(function(){return at(i)},[i]);return c.createElement(ot,{styles:st(a,!t,i,n?``:`!important`)})},H=!1;if(typeof window<`u`)try{var U=Object.defineProperty({},"passive",{get:function(){return H=!0,!0}});window.addEventListener(`test`,U,U),window.removeEventListener(`test`,U,U)}catch{H=!1}var W=H?{passive:!1}:!1,dt=function(e){return e.tagName===`TEXTAREA`},ft=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!dt(e)&&n[t]===`visible`)},pt=function(e){return ft(e,`overflowY`)},mt=function(e){return ft(e,`overflowX`)},ht=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),vt(e,r)){var i=yt(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},gt=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},_t=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},vt=function(e,t){return e===`v`?pt(t):mt(t)},yt=function(e,t){return e===`v`?gt(t):_t(t)},bt=function(e,t){return e===`h`&&t===`rtl`?-1:1},xt=function(e,t,n,r,i){var a=bt(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=yt(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&vt(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},G=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},St=function(e){return[e.deltaX,e.deltaY]},Ct=function(e){return e&&`current`in e?e.current:e},wt=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Tt=function(e){return`
39
39
  .block-interactivity-${e} {pointer-events: none;}
40
40
  .allow-interactivity-${e} {pointer-events: all;}
41
- `},Tt=0,q=[];function Et(e){var t=c.useRef([]),n=c.useRef([0,0]),r=c.useRef(),i=c.useState(Tt++)[0],a=c.useState(tt)[0],o=c.useRef(e);c.useEffect(function(){o.current=e},[e]),c.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Ie([e.lockRef.current],(e.shards||[]).map(St),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=c.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=K(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=mt(d,u);if(!f)return!0;if(f?l=d:(l=d===`v`?`h`:`v`,f=mt(d,u)),!f)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var p=r.current||l;return bt(p,t,e,p===`h`?s:c,!0)},[]),l=c.useCallback(function(e){var n=e;if(!(!q.length||q[q.length-1]!==a)){var r=`deltaY`in n?xt(n):K(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Ct(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(St).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),u=c.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Dt(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=c.useCallback(function(e){n.current=K(e),r.current=void 0},[]),f=c.useCallback(function(t){u(t.type,xt(t),t.target,s(t,e.lockRef.current))},[]),p=c.useCallback(function(t){u(t.type,K(t),t.target,s(t,e.lockRef.current))},[]);c.useEffect(function(){return q.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener(`wheel`,l,G),document.addEventListener(`touchmove`,l,G),document.addEventListener(`touchstart`,d,G),function(){q=q.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,l,G),document.removeEventListener(`touchmove`,l,G),document.removeEventListener(`touchstart`,d,G)}},[]);var m=e.removeScrollBar,h=e.inert;return c.createElement(c.Fragment,null,h?c.createElement(a,{styles:wt(i)}):null,m?c.createElement(lt,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Dt(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Ot=qe(R,Et),kt=c.forwardRef(function(e,t){return c.createElement(B,P({},e,{ref:t,sideCar:Ot}))});kt.classNames=B.classNames;var At=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},J=new WeakMap,Y=new WeakMap,X={},Z=0,jt=function(e){return e&&(e.host||jt(e.parentNode))},Mt=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=jt(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Nt=function(e,t,n,r){var i=Mt(t,Array.isArray(e)?e:[e]);X[n]||(X[n]=new WeakMap);var a=X[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(J.get(e)||0)+1,l=(a.get(e)||0)+1;J.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Y.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Z++,function(){o.forEach(function(e){var t=J.get(e)-1,i=a.get(e)-1;J.set(e,t),a.set(e,i),t||(Y.has(e)||e.removeAttribute(r),Y.delete(e)),i||e.removeAttribute(n)}),Z--,Z||(J=new WeakMap,J=new WeakMap,Y=new WeakMap,X={})}},Pt=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||At(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Nt(r,i,n,`aria-hidden`)):function(){return null}},Q=r(),Ft={display:`contents`},It=c.forwardRef((e,t)=>{let n=(0,Q.c)(3),{children:r}=e,i;return n[0]!==r||n[1]!==t?(i=(0,u.jsx)(`div`,{ref:t,className:`marimo`,style:Ft,children:r}),n[0]=r,n[1]=t,n[2]=i):i=n[2],i});It.displayName=`StyleNamespace`;function $(){return document.querySelector(`[data-vscode-theme-kind]`)!==null}var Lt=`[data-vscode-output-container]`,Rt=$()?0:30;function zt(){let e=(0,Q.c)(1),[t,n]=(0,c.useState)(document.fullscreenElement),r;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{n(document.fullscreenElement)},e[0]=r):r=e[0],o(document,`fullscreenchange`,r),t}function Bt(e){let t=t=>{let n=(0,Q.c)(6),[r,i]=c.useState(null),a=c.useRef(null),o,s;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>{if(!a.current)return;let e=Ht(a.current,Lt);i(e)},s=[],n[0]=o,n[1]=s):(o=n[0],s=n[1]),c.useLayoutEffect(o,s);let l;n[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,u.jsx)(`div`,{ref:a,className:`contents invisible`}),n[2]=l):l=n[2];let d;return n[3]!==r||n[4]!==t?(d=(0,u.jsxs)(u.Fragment,{children:[l,(0,u.jsx)(e,{...t,container:r})]}),n[3]=r,n[4]=t,n[5]=d):d=n[5],d},n=n=>{let r=(0,Q.c)(7),i=zt();if($()){let e;return r[0]===n?e=r[1]:(e=(0,u.jsx)(t,{...n}),r[0]=n,r[1]=e),e}if(!i){let t;return r[2]===n?t=r[3]:(t=(0,u.jsx)(e,{...n}),r[2]=n,r[3]=t),t}let a;return r[4]!==i||r[5]!==n?(a=(0,u.jsx)(e,{...n,container:i}),r[4]=i,r[5]=n,r[6]=a):a=r[6],a};return n.displayName=e.displayName,n}function Vt(e){let t=t=>{let n=(0,Q.c)(6),[r,i]=c.useState(null),a=c.useRef(null),o,s;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>{if(!a.current)return;let e=Ht(a.current,Lt);i(e)},s=[],n[0]=o,n[1]=s):(o=n[0],s=n[1]),c.useLayoutEffect(o,s);let l;n[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,u.jsx)(`div`,{ref:a,className:`contents invisible`}),n[2]=l):l=n[2];let d;return n[3]!==r||n[4]!==t?(d=(0,u.jsxs)(u.Fragment,{children:[l,(0,u.jsx)(e,{...t,collisionBoundary:r})]}),n[3]=r,n[4]=t,n[5]=d):d=n[5],d},n=n=>{let r=(0,Q.c)(4);if($()){let e;return r[0]===n?e=r[1]:(e=(0,u.jsx)(t,{...n}),r[0]=n,r[1]=e),e}let i;return r[2]===n?i=r[3]:(i=(0,u.jsx)(e,{...n}),r[2]=n,r[3]=i),i};return n.displayName=e.displayName,n}function Ht(e,t){let n=e;for(;n;){let e=n.closest(t);if(e)return e;let r=n.getRootNode();if(n=r instanceof ShadowRoot?r.host:n.parentElement,n===r)break}return null}export{m as C,p as S,f as T,ne as _,$ as a,_ as b,kt as c,je as d,ye as f,D as g,he as h,Vt as i,Fe as l,k as m,zt as n,It as o,ge as p,Bt as r,Pt as s,Rt as t,Me as u,C as v,d as w,g as x,y};
41
+ `},Et=0,K=[];function Dt(e){var t=c.useRef([]),n=c.useRef([0,0]),r=c.useRef(),i=c.useState(Et++)[0],a=c.useState(nt)[0],o=c.useRef(e);c.useEffect(function(){o.current=e},[e]),c.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Ie([e.lockRef.current],(e.shards||[]).map(Ct),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=c.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=G(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=ht(d,u);if(!f)return!0;if(f?l=d:(l=d===`v`?`h`:`v`,f=ht(d,u)),!f)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var p=r.current||l;return xt(p,t,e,p===`h`?s:c,!0)},[]),l=c.useCallback(function(e){var n=e;if(!(!K.length||K[K.length-1]!==a)){var r=`deltaY`in n?St(n):G(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&wt(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Ct).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),u=c.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Ot(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=c.useCallback(function(e){n.current=G(e),r.current=void 0},[]),f=c.useCallback(function(t){u(t.type,St(t),t.target,s(t,e.lockRef.current))},[]),p=c.useCallback(function(t){u(t.type,G(t),t.target,s(t,e.lockRef.current))},[]);c.useEffect(function(){return K.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener(`wheel`,l,W),document.addEventListener(`touchmove`,l,W),document.addEventListener(`touchstart`,d,W),function(){K=K.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,l,W),document.removeEventListener(`touchmove`,l,W),document.removeEventListener(`touchstart`,d,W)}},[]);var m=e.removeScrollBar,h=e.inert;return c.createElement(c.Fragment,null,h?c.createElement(a,{styles:Tt(i)}):null,m?c.createElement(ut,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ot(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var kt=qe(Je,Dt),At=c.forwardRef(function(e,t){return c.createElement(z,P({},e,{ref:t,sideCar:kt}))});At.classNames=z.classNames;var jt=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},q=new WeakMap,J=new WeakMap,Y={},X=0,Mt=function(e){return e&&(e.host||Mt(e.parentNode))},Nt=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Mt(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Pt=function(e,t,n,r){var i=Nt(t,Array.isArray(e)?e:[e]);Y[n]||(Y[n]=new WeakMap);var a=Y[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(q.get(e)||0)+1,l=(a.get(e)||0)+1;q.set(e,c),a.set(e,l),o.push(e),c===1&&i&&J.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),X++,function(){o.forEach(function(e){var t=q.get(e)-1,i=a.get(e)-1;q.set(e,t),a.set(e,i),t||(J.has(e)||e.removeAttribute(r),J.delete(e)),i||e.removeAttribute(n)}),X--,X||(q=new WeakMap,q=new WeakMap,J=new WeakMap,Y={})}},Ft=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||jt(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Pt(r,i,n,`aria-hidden`)):function(){return null}},Z=r(),It={display:`contents`},Lt=c.forwardRef((e,t)=>{let n=(0,Z.c)(3),{children:r}=e,i;return n[0]!==r||n[1]!==t?(i=(0,u.jsx)(`div`,{ref:t,className:`marimo`,style:It,children:r}),n[0]=r,n[1]=t,n[2]=i):i=n[2],i});Lt.displayName=`StyleNamespace`;function Q(){return document.querySelector(`[data-vscode-theme-kind]`)!==null}var Rt=`[data-vscode-output-container]`,zt=Q()?0:30;function Bt(){let e=(0,Z.c)(1),[t,n]=(0,c.useState)(document.fullscreenElement),r;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{n(document.fullscreenElement)},e[0]=r):r=e[0],o(document,`fullscreenchange`,r),t}var $=new Set;function Vt(){for(let e of $)e()}function Ht(e){return $.size===0&&document.addEventListener(`fullscreenchange`,Vt),$.add(e),()=>{$.delete(e),$.size===0&&document.removeEventListener(`fullscreenchange`,Vt)}}function Ut(e){let t=(0,Z.c)(2),n;return t[0]===e?n=t[1]:(n=()=>{let t=document.fullscreenElement;return t!==null&&t===e.current},t[0]=e,t[1]=n),(0,c.useSyncExternalStore)(Ht,n)}function Wt(e){let t=t=>{let n=(0,Z.c)(6),[r,i]=c.useState(null),a=c.useRef(null),o,s;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>{if(!a.current)return;let e=Kt(a.current,Rt);i(e)},s=[],n[0]=o,n[1]=s):(o=n[0],s=n[1]),c.useLayoutEffect(o,s);let l;n[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,u.jsx)(`div`,{ref:a,className:`contents invisible`}),n[2]=l):l=n[2];let d;return n[3]!==r||n[4]!==t?(d=(0,u.jsxs)(u.Fragment,{children:[l,(0,u.jsx)(e,{...t,container:r})]}),n[3]=r,n[4]=t,n[5]=d):d=n[5],d},n=n=>{let r=(0,Z.c)(7),i=Bt();if(Q()){let e;return r[0]===n?e=r[1]:(e=(0,u.jsx)(t,{...n}),r[0]=n,r[1]=e),e}if(!i){let t;return r[2]===n?t=r[3]:(t=(0,u.jsx)(e,{...n}),r[2]=n,r[3]=t),t}let a;return r[4]!==i||r[5]!==n?(a=(0,u.jsx)(e,{...n,container:i}),r[4]=i,r[5]=n,r[6]=a):a=r[6],a};return n.displayName=e.displayName,n}function Gt(e){let t=t=>{let n=(0,Z.c)(6),[r,i]=c.useState(null),a=c.useRef(null),o,s;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>{if(!a.current)return;let e=Kt(a.current,Rt);i(e)},s=[],n[0]=o,n[1]=s):(o=n[0],s=n[1]),c.useLayoutEffect(o,s);let l;n[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,u.jsx)(`div`,{ref:a,className:`contents invisible`}),n[2]=l):l=n[2];let d;return n[3]!==r||n[4]!==t?(d=(0,u.jsxs)(u.Fragment,{children:[l,(0,u.jsx)(e,{...t,collisionBoundary:r})]}),n[3]=r,n[4]=t,n[5]=d):d=n[5],d},n=n=>{let r=(0,Z.c)(4);if(Q()){let e;return r[0]===n?e=r[1]:(e=(0,u.jsx)(t,{...n}),r[0]=n,r[1]=e),e}let i;return r[2]===n?i=r[3]:(i=(0,u.jsx)(e,{...n}),r[2]=n,r[3]=i),i};return n.displayName=e.displayName,n}function Kt(e,t){let n=e;for(;n;){let e=n.closest(t);if(e)return e;let r=n.getRootNode();if(n=r instanceof ShadowRoot?r.host:n.parentElement,n===r)break}return null}export{p as C,f as E,g as S,d as T,D as _,Gt as a,y as b,Ft as c,Me as d,je as f,he as g,k as h,Wt as i,At as l,ge as m,Bt as n,Q as o,ye as p,Ut as r,Lt as s,zt as t,Fe as u,ne as v,m as w,_ as x,C as y};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-CBDbhulC.js";import{t as n}from"./compiler-runtime-CYIjoINj.js";import{t as r}from"./ErrorBoundary-npvnLp9x.js";import{t as i}from"./jsx-runtime-B74pBk57.js";import{r as a}from"./requests-C6_IaFh7.js";import{t as o}from"./spinner-Ck-Hgfvj.js";import{Wt as s,r as c}from"./input-Daz6sk8l.js";import{n as l,t as u}from"./paths-zcL04qUW.js";import{c as d,t as f}from"./session-CEdta5_Q.js";import{n as p}from"./useAsyncData-Buhk-UgR.js";import{a as m}from"./errors-DzO-nXy-.js";import{t as h}from"./error-banner-BYN8YUMe.js";import{n as g,t as _}from"./card-dYXwy2mo.js";var v=n(),y=e(t(),1),b=i(),x=e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase(),S=e=>{let t=u.guessDeliminator(e).deliminator;return e.replace(/\.[^./]+$/,``).split(t).filter(Boolean).map(e=>e.split(/[_-]/).map(x).join(` `)).join(` > `)},C=e=>`${f()}-${encodeURIComponent(e)}`,w=e=>{try{return new URL(e).protocol===`https:`}catch{return!1}},T=10,E=()=>{let e=(0,v.c)(32),{getWorkspaceFiles:t}=a(),[n,i]=(0,y.useState)(``),u;e[0]===t?u=e[1]:(u=()=>t({includeMarkdown:!1}),e[0]=t,e[1]=u);let f;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=[],e[2]=f):f=e[2];let g=p(u,f),_=g.data;_?.files,_?.root;let x;e[3]===_?.files?x=e[4]:(x=_?.files??[],e[3]=_?.files,e[4]=x);let C=x,E=_?.root??``,A;if(e[5]!==C||e[6]!==E){let t;e[8]===E?t=e[9]:(t=e=>{let t=E&&l.isAbsolute(e.path)&&e.path.startsWith(E)?l.rest(e.path,E):e.path,n=e.opengraph?.title??S(l.basename(t)),r=S(l.dirname(t)),i=e.opengraph?.description??``,a=e.opengraph?.image,o=a&&w(a)?a:d(`og/thumbnail?file=${encodeURIComponent(t)}`).toString();return{...e,relativePath:t,title:n,subtitle:r,description:i,thumbnailUrl:o}},e[8]=E,e[9]=t),A=C.filter(D).map(t).toSorted(O),e[5]=C,e[6]=E,e[7]=A}else A=e[7];let j=A,M;bb0:{if(!n){M=j;break bb0}let t;if(e[10]!==j||e[11]!==n){let r=n.toLowerCase();t=j.filter(e=>e.title.toLowerCase().includes(r)),e[10]=j,e[11]=n,e[12]=t}else t=e[12];M=t}let N=M;if(g.isPending){let t;return e[13]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,b.jsx)(o,{centered:!0,size:`xlarge`,className:`mt-6`}),e[13]=t):t=e[13],t}if(g.error){let t;e[14]===g.error?t=e[15]:(t=m(g.error),e[14]=g.error,e[15]=t);let n;return e[16]===t?n=e[17]:(n=(0,b.jsx)(h,{kind:`danger`,className:`rounded p-4`,children:t}),e[16]=t,e[17]=n),n}if(!_){let t;return e[18]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,b.jsx)(o,{centered:!0,size:`xlarge`,className:`mt-6`}),e[18]=t):t=e[18],t}let P;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,b.jsx)(`img`,{src:`logo.png`,alt:`marimo logo`,className:`w-48 mb-2`}),e[19]=P):P=e[19];let F;e[20]!==_.fileCount||e[21]!==_.hasMore?(F=_.hasMore&&(0,b.jsxs)(h,{kind:`warn`,className:`rounded p-4`,children:[`Showing first `,_.fileCount,` files. Your workspace has more files.`]}),e[20]=_.fileCount,e[21]=_.hasMore,e[22]=F):F=e[22];let I;e[23]!==j.length||e[24]!==n?(I=j.length>T&&(0,b.jsx)(c,{id:`search`,value:n,icon:(0,b.jsx)(s,{className:`h-4 w-4`}),onChange:e=>i(e.target.value),placeholder:`Search`,rootClassName:`mb-3`,className:`mb-0 border-border`}),e[23]=j.length,e[24]=n,e[25]=I):I=e[25];let L;e[26]===N?L=e[27]:(L=N.length===0?(0,b.jsx)(h,{kind:`warn`,className:`rounded p-4`,children:`No marimo apps found.`}):(0,b.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4`,children:N.map(k)}),e[26]=N,e[27]=L);let R;return e[28]!==F||e[29]!==I||e[30]!==L?(R=(0,b.jsx)(y.Suspense,{children:(0,b.jsxs)(`div`,{className:`flex flex-col gap-6 max-w-6xl container pt-5 pb-20 z-10`,children:[P,(0,b.jsx)(r,{children:(0,b.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[F,I,L]})})]})}),e[28]=F,e[29]=I,e[30]=L,e[31]=R):R=e[31],R};function D(e){return!e.isDirectory}function O(e,t){return e.relativePath.localeCompare(t.relativePath)}function k(e){return(0,b.jsx)(`a`,{href:d(`?file=${encodeURIComponent(e.relativePath)}`).toString(),target:C(e.path),className:`no-underline`,children:(0,b.jsxs)(_,{className:`h-full overflow-hidden hover:bg-accent/20 transition-colors`,children:[(0,b.jsx)(`img`,{src:e.thumbnailUrl,alt:e.title,loading:`lazy`,className:`w-full aspect-1200/630 object-cover border-b border-border/60`}),(0,b.jsx)(g,{className:`p-6 pt-4`,children:(0,b.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[e.subtitle&&(0,b.jsx)(`div`,{className:`text-sm font-semibold text-muted-foreground`,children:e.subtitle}),(0,b.jsx)(`div`,{className:`text-lg font-medium`,children:e.title}),e.description&&(0,b.jsx)(`div`,{className:`text-sm text-muted-foreground line-clamp-3 mt-1`,children:e.description})]})})]})},e.path)}export{E as default};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-CBDbhulC.js";import{t as n}from"./compiler-runtime-CYIjoINj.js";import{t as r}from"./ErrorBoundary-CDVGFYfr.js";import{t as i}from"./jsx-runtime-B74pBk57.js";import{r as a}from"./requests-C6_IaFh7.js";import{t as o}from"./spinner-Ck-Hgfvj.js";import{Wt as s,r as c}from"./input-DEbY281O.js";import{n as l,t as u}from"./paths-zcL04qUW.js";import{c as d,t as f}from"./session-Sz5nSFku.js";import{n as p}from"./useAsyncData-Buhk-UgR.js";import{a as m}from"./errors-DzO-nXy-.js";import{t as h}from"./error-banner-Dw5YY9wq.js";import{n as g,t as _}from"./card-dYXwy2mo.js";var v=n(),y=e(t(),1),b=i(),x=e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase(),S=e=>{let t=u.guessDeliminator(e).deliminator;return e.replace(/\.[^./]+$/,``).split(t).filter(Boolean).map(e=>e.split(/[_-]/).map(x).join(` `)).join(` > `)},C=e=>`${f()}-${encodeURIComponent(e)}`,w=e=>{try{return new URL(e).protocol===`https:`}catch{return!1}},T=10,E=()=>{let e=(0,v.c)(32),{getWorkspaceFiles:t}=a(),[n,i]=(0,y.useState)(``),u;e[0]===t?u=e[1]:(u=()=>t({includeMarkdown:!1}),e[0]=t,e[1]=u);let f;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=[],e[2]=f):f=e[2];let g=p(u,f),_=g.data;_?.files,_?.root;let x;e[3]===_?.files?x=e[4]:(x=_?.files??[],e[3]=_?.files,e[4]=x);let C=x,E=_?.root??``,A;if(e[5]!==C||e[6]!==E){let t;e[8]===E?t=e[9]:(t=e=>{let t=E&&l.isAbsolute(e.path)&&e.path.startsWith(E)?l.rest(e.path,E):e.path,n=e.opengraph?.title??S(l.basename(t)),r=S(l.dirname(t)),i=e.opengraph?.description??``,a=e.opengraph?.image,o=a&&w(a)?a:d(`og/thumbnail?file=${encodeURIComponent(t)}`).toString();return{...e,relativePath:t,title:n,subtitle:r,description:i,thumbnailUrl:o}},e[8]=E,e[9]=t),A=C.filter(D).map(t).toSorted(O),e[5]=C,e[6]=E,e[7]=A}else A=e[7];let j=A,M;bb0:{if(!n){M=j;break bb0}let t;if(e[10]!==j||e[11]!==n){let r=n.toLowerCase();t=j.filter(e=>e.title.toLowerCase().includes(r)),e[10]=j,e[11]=n,e[12]=t}else t=e[12];M=t}let N=M;if(g.isPending){let t;return e[13]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,b.jsx)(o,{centered:!0,size:`xlarge`,className:`mt-6`}),e[13]=t):t=e[13],t}if(g.error){let t;e[14]===g.error?t=e[15]:(t=m(g.error),e[14]=g.error,e[15]=t);let n;return e[16]===t?n=e[17]:(n=(0,b.jsx)(h,{kind:`danger`,className:`rounded p-4`,children:t}),e[16]=t,e[17]=n),n}if(!_){let t;return e[18]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,b.jsx)(o,{centered:!0,size:`xlarge`,className:`mt-6`}),e[18]=t):t=e[18],t}let P;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,b.jsx)(`img`,{src:`logo.png`,alt:`marimo logo`,className:`w-48 mb-2`}),e[19]=P):P=e[19];let F;e[20]!==_.fileCount||e[21]!==_.hasMore?(F=_.hasMore&&(0,b.jsxs)(h,{kind:`warn`,className:`rounded p-4`,children:[`Showing first `,_.fileCount,` files. Your workspace has more files.`]}),e[20]=_.fileCount,e[21]=_.hasMore,e[22]=F):F=e[22];let I;e[23]!==j.length||e[24]!==n?(I=j.length>T&&(0,b.jsx)(c,{id:`search`,value:n,icon:(0,b.jsx)(s,{className:`h-4 w-4`}),onChange:e=>i(e.target.value),placeholder:`Search`,rootClassName:`mb-3`,className:`mb-0 border-border`}),e[23]=j.length,e[24]=n,e[25]=I):I=e[25];let L;e[26]===N?L=e[27]:(L=N.length===0?(0,b.jsx)(h,{kind:`warn`,className:`rounded p-4`,children:`No marimo apps found.`}):(0,b.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4`,children:N.map(k)}),e[26]=N,e[27]=L);let R;return e[28]!==F||e[29]!==I||e[30]!==L?(R=(0,b.jsx)(y.Suspense,{children:(0,b.jsxs)(`div`,{className:`flex flex-col gap-6 max-w-6xl container pt-5 pb-20 z-10`,children:[P,(0,b.jsx)(r,{children:(0,b.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[F,I,L]})})]})}),e[28]=F,e[29]=I,e[30]=L,e[31]=R):R=e[31],R};function D(e){return!e.isDirectory}function O(e,t){return e.relativePath.localeCompare(t.relativePath)}function k(e){return(0,b.jsx)(`a`,{href:d(`?file=${encodeURIComponent(e.relativePath)}`).toString(),target:C(e.path),className:`no-underline`,children:(0,b.jsxs)(_,{className:`h-full overflow-hidden hover:bg-accent/20 transition-colors`,children:[(0,b.jsx)(`img`,{src:e.thumbnailUrl,alt:e.title,loading:`lazy`,className:`w-full aspect-1200/630 object-cover border-b border-border/60`}),(0,b.jsx)(g,{className:`p-6 pt-4`,children:(0,b.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[e.subtitle&&(0,b.jsx)(`div`,{className:`text-sm font-semibold text-muted-foreground`,children:e.subtitle}),(0,b.jsx)(`div`,{className:`text-lg font-medium`,children:e.title}),e.description&&(0,b.jsx)(`div`,{className:`text-sm text-muted-foreground line-clamp-3 mt-1`,children:e.description})]})})]})},e.path)}export{E as default};