@marimo-team/frontend 0.16.0 → 0.16.2

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 (284) hide show
  1. package/dist/assets/ConnectedDataExplorerComponent-B5cPvWoQ.js +19 -0
  2. package/dist/assets/{ImageComparisonComponent-fTHv1Ih0.js → ImageComparisonComponent-CqR26LSv.js} +1 -1
  3. package/dist/assets/{VegaLite-Bdi-TyfY.js → VegaLite-DvQDATwI.js} +1 -1
  4. package/dist/assets/_baseEach--KDTwKbG.js +1 -0
  5. package/dist/assets/_baseMap-Cu3o-eyO.js +1 -0
  6. package/dist/assets/{_baseUniq-CCgDNtZb.js → _baseUniq-y7ZXnMo1.js} +1 -1
  7. package/dist/assets/{_createAggregator-DcD0kTA5.js → _createAggregator-ZcHkHPNJ.js} +1 -1
  8. package/dist/assets/{agent-panel-Crv430aI.js → agent-panel-B91RoLct.js} +76 -57
  9. package/dist/assets/{any-language-editor-CQh552Wu.js → any-language-editor-CxfHcm5h.js} +1 -1
  10. package/dist/assets/{architectureDiagram-W76B3OCA-BAJeBxzt.js → architectureDiagram-W76B3OCA-BQsvK8uR.js} +1 -1
  11. package/dist/assets/{between-horizontal-start-Boxgxbt_.js → between-horizontal-start-BmYToIaM.js} +1 -1
  12. package/dist/assets/{blockDiagram-QIGZ2CNN-CL-1svEK.js → blockDiagram-QIGZ2CNN-r3HgCj4w.js} +1 -1
  13. package/dist/assets/{c4Diagram-FPNF74CW-BbEqbCTl.js → c4Diagram-FPNF74CW-BJbPNt41.js} +1 -1
  14. package/dist/assets/channel-DFaEx1fu.js +1 -0
  15. package/dist/assets/chat-panel-IoPMv8e2.js +3 -0
  16. package/dist/assets/{chunk-4BX2VUAB-C--8TXeE.js → chunk-4BX2VUAB-Dv4MZ9Hj.js} +1 -1
  17. package/dist/assets/{chunk-55IACEB6-Bj00HDqq.js → chunk-55IACEB6-CM4AHquB.js} +1 -1
  18. package/dist/assets/{chunk-FMBD7UC4-C-lhB6hN.js → chunk-FMBD7UC4-C_Zz0ENB.js} +1 -1
  19. package/dist/assets/{chunk-K7UQS3LO-B-pGTXPt.js → chunk-K7UQS3LO-DYSmiXYq.js} +1 -1
  20. package/dist/assets/{chunk-QN33PNHL-DqUzGhvm.js → chunk-QN33PNHL-QM4OPuQP.js} +1 -1
  21. package/dist/assets/{chunk-QZHKN3VN-TntJHfSk.js → chunk-QZHKN3VN-CfAsGyeB.js} +1 -1
  22. package/dist/assets/{chunk-TVAH2DTR-HUJb1psV.js → chunk-TVAH2DTR-6j_Cpjsi.js} +1 -1
  23. package/dist/assets/{chunk-TZMSLE5B-BK3C__t3.js → chunk-TZMSLE5B-BHslFJQE.js} +1 -1
  24. package/dist/assets/{circle-play-DBLOv1Yu.js → circle-play-CK3UZRYQ.js} +1 -1
  25. package/dist/assets/classDiagram-KNZD7YFC-BsZtvV5O.js +1 -0
  26. package/dist/assets/classDiagram-v2-RKCZMP56-BsZtvV5O.js +1 -0
  27. package/dist/assets/{clear-button-BeoFbEKH.js → clear-button-C4fDVSv8.js} +1 -1
  28. package/dist/assets/clone-YBEvPE-s.js +1 -0
  29. package/dist/assets/command-palette-D7hOfvf6.js +1 -0
  30. package/dist/assets/{common-C7oJcmCT.js → common-D-lbuUwz.js} +1 -1
  31. package/dist/assets/{compile-7L0MwhyI.js → compile-DVQe1Mzk.js} +1 -1
  32. package/dist/assets/{cose-bilkent-S5V4N54A-BMkGLcVC.js → cose-bilkent-S5V4N54A-D-IS7WC8.js} +1 -1
  33. package/dist/assets/{dagre-5GWH7T2D-BJtRienS.js → dagre-5GWH7T2D-lYu-tEWT.js} +1 -1
  34. package/dist/assets/{data-grid-overlay-editor-DBkmGtNs.js → data-grid-overlay-editor-C5peOCit.js} +1 -1
  35. package/dist/assets/datasources-panel-D3NA20uZ.js +1 -0
  36. package/dist/assets/{dependency-graph-panel-DEdOxp2X.js → dependency-graph-panel-BGVYOfkV.js} +1 -1
  37. package/dist/assets/{diagram-N5W7TBWH-CmECY3nb.js → diagram-N5W7TBWH-BnvIuYUp.js} +1 -1
  38. package/dist/assets/{diagram-QEK2KX5R-DMOVSNKD.js → diagram-QEK2KX5R-DemedRK3.js} +1 -1
  39. package/dist/assets/{diagram-S2PKOQOG-BiJ96PNQ.js → diagram-S2PKOQOG-iiY7AuyH.js} +1 -1
  40. package/dist/assets/{documentation-panel-xULhaEv3.js → documentation-panel-C3dSwOSQ.js} +1 -1
  41. package/dist/assets/edit-page-C5TsEeSo.js +129 -0
  42. package/dist/assets/{ellipsis-vertical-BBqXIlc2.js → ellipsis-vertical-CazJl8M7.js} +1 -1
  43. package/dist/assets/{empty-state-B3dA3G5P.js → empty-state-DW308mFO.js} +1 -1
  44. package/dist/assets/{erDiagram-AWTI2OKA-MP1DiFRo.js → erDiagram-AWTI2OKA-6wQ8Ugg0.js} +1 -1
  45. package/dist/assets/{error-panel-Cc1sv-Ag.js → error-panel-D1VnJ1yP.js} +1 -1
  46. package/dist/assets/file-explorer-panel-0oVd4t-D.js +1 -0
  47. package/dist/assets/{flowDiagram-PVAE7QVJ-BX7caPp7.js → flowDiagram-PVAE7QVJ-C55IUWjm.js} +1 -1
  48. package/dist/assets/{ganttDiagram-OWAHRB6G-B462g4Yf.js → ganttDiagram-OWAHRB6G-DmqCM6ME.js} +4 -4
  49. package/dist/assets/{gitGraphDiagram-NY62KEGX-CGgvZ9-9.js → gitGraphDiagram-NY62KEGX-DBvhAeM_.js} +1 -1
  50. package/dist/assets/{glide-data-editor-C0gUFZON.js → glide-data-editor-CHNuHidQ.js} +4 -4
  51. package/dist/assets/{graph-CHRVBzY5.js → graph-CG6BgUWQ.js} +1 -1
  52. package/dist/assets/home-page-dgivXuSR.js +9 -0
  53. package/dist/assets/{index-Clbi_Yaq.js → index-BTGpssVX.js} +1 -1
  54. package/dist/assets/{index-CQDrxQ0j.js → index-BYVZlBF8.js} +1 -1
  55. package/dist/assets/{index-lYa_leQE.js → index-BelfnXwL.js} +1 -1
  56. package/dist/assets/{index-DRMm6SNo.js → index-BneyUujp.js} +1 -1
  57. package/dist/assets/{index-BY93Ejhl.js → index-C02SqeRj.js} +1 -1
  58. package/dist/assets/{index-C-8WADat.js → index-C7dtgr9A.js} +1 -1
  59. package/dist/assets/{index-D9UKkrr2.js → index-CAQvMTzM.js} +1 -1
  60. package/dist/assets/index-CGDMlQfO.css +1 -0
  61. package/dist/assets/index-CelXfcd8.js +580 -0
  62. package/dist/assets/{index-vmICa5KN.js → index-Csd6QrCV.js} +1 -1
  63. package/dist/assets/{index-DoRmcrKM.js → index-CtPksxf0.js} +1 -1
  64. package/dist/assets/{index-C1v_Z9et.js → index-Cxyk7pt-.js} +1 -1
  65. package/dist/assets/{index-CpTPJo4k.js → index-DAZ-9ri2.js} +1 -1
  66. package/dist/assets/{index-DEQvTChO.js → index-DONRrmA2.js} +1 -1
  67. package/dist/assets/{index-C4Tn5NvJ.js → index-Db36XTG_.js} +1 -1
  68. package/dist/assets/{index-z9bohSQJ.js → index-DdIhdEVw.js} +1 -1
  69. package/dist/assets/{index-C-GhZ7ti.js → index-M_pBKDSe.js} +1 -1
  70. package/dist/assets/{index-C77h_TXN.js → index-_luCZMLM.js} +1 -1
  71. package/dist/assets/{index-D1vmG6DS.js → index-mkubqy9-.js} +1 -1
  72. package/dist/assets/{index-BVgAenPd.js → index-sbO9UaUU.js} +1 -1
  73. package/dist/assets/{index-CWMgowgL.js → index-z4krxQ4j.js} +1 -1
  74. package/dist/assets/infoDiagram-STP46IZ2-wTALjfPc.js +2 -0
  75. package/dist/assets/{isEmpty-DU_ogP_D.js → isEmpty-CqX_YTIf.js} +1 -1
  76. package/dist/assets/{journeyDiagram-BIP6EPQ6-C6EgLP_Q.js → journeyDiagram-BIP6EPQ6-Y5w_Tqe_.js} +1 -1
  77. package/dist/assets/{kanban-definition-6OIFK2YF-BXzYO1yj.js → kanban-definition-6OIFK2YF-DbXs5Rxi.js} +1 -1
  78. package/dist/assets/{layout-jihVw5-i.js → layout-BCNPDACj.js} +1 -1
  79. package/dist/assets/{linear-C4blANlC.js → linear-uO6UVhXt.js} +1 -1
  80. package/dist/assets/links-Drv7cJgN.js +7 -0
  81. package/dist/assets/{logs-panel-D401qzZh.js → logs-panel-BEQ1eRUp.js} +1 -1
  82. package/dist/assets/{markdown-renderer-Cd9eYyaL.js → markdown-renderer-Dmzbb00W.js} +20 -20
  83. package/dist/assets/{mermaid-BEVuRz_O.js → mermaid-qRc4MXIj.js} +1 -1
  84. package/dist/assets/{mermaid.core-CaSnaLH0.js → mermaid.core-CvvJtCRj.js} +4 -4
  85. package/dist/assets/min-DYUOb1RR.js +1 -0
  86. package/dist/assets/{mindmap-definition-Q6HEUPPD-BXUM5MT2.js → mindmap-definition-Q6HEUPPD-G5NognM-.js} +1 -1
  87. package/dist/assets/{number-overlay-editor-4uWXGlPG.js → number-overlay-editor-DPr5sHFu.js} +1 -1
  88. package/dist/assets/outline-panel-gxQXvVi4.js +1 -0
  89. package/dist/assets/{packages-panel-CJL0MVlj.js → packages-panel-B1T0VPlg.js} +1 -1
  90. package/dist/assets/{pieDiagram-ADFJNKIX-Dxt5PVNo.js → pieDiagram-ADFJNKIX-DK9SHkfc.js} +1 -1
  91. package/dist/assets/{quadrantDiagram-LMRXKWRM-D4pUaA31.js → quadrantDiagram-LMRXKWRM-D1DdWF8C.js} +1 -1
  92. package/dist/assets/{react-plotly-cJZ0VWBq.js → react-plotly-CTwajqCb.js} +1 -1
  93. package/dist/assets/{requirementDiagram-4UW4RH46-DVRTjgas.js → requirementDiagram-4UW4RH46-DnjDAypr.js} +1 -1
  94. package/dist/assets/{run-page-BUEnMC9w.js → run-page-CQY9im22.js} +1 -1
  95. package/dist/assets/{sankeyDiagram-GR3RE2ED-CVFnD9C-.js → sankeyDiagram-GR3RE2ED-B67Va-ER.js} +1 -1
  96. package/dist/assets/{scratchpad-panel-BIgRENkI.js → scratchpad-panel-DlDfcDtW.js} +1 -1
  97. package/dist/assets/{secrets-panel-xY5-V_BD.js → secrets-panel-BDGyuGZA.js} +1 -1
  98. package/dist/assets/{sequenceDiagram-C3RYC4MD-_lY4ZN_S.js → sequenceDiagram-C3RYC4MD-DiWgZPtN.js} +1 -1
  99. package/dist/assets/{slides-component-DMjQomc3.css → slides-component-C-LoGC1U.css} +1 -1
  100. package/dist/assets/{slides-component-Xjymwj7X.js → slides-component-DhpPRtQp.js} +1 -1
  101. package/dist/assets/snippets-panel-CLkBXhJ2.js +1 -0
  102. package/dist/assets/sortBy-D4OG7w4O.js +1 -0
  103. package/dist/assets/{state-C4NiC9tO.js → state-Dz_3JyED.js} +1 -1
  104. package/dist/assets/{stateDiagram-KXAO66HF-Da0JQWCn.js → stateDiagram-KXAO66HF-ByF2AULw.js} +1 -1
  105. package/dist/assets/stateDiagram-v2-UMBNRL4Z-CtBJqosP.js +1 -0
  106. package/dist/assets/storage-Dr0CC44z.js +26 -0
  107. package/dist/assets/{terminal-BPwTkXae.js → terminal-BtdissBf.js} +1 -1
  108. package/dist/assets/{time-Dv5_Ouz_.js → time-DKdOTnQg.js} +1 -1
  109. package/dist/assets/{timeline-definition-XQNQX7LJ-Dxh5Zu2e.js → timeline-definition-XQNQX7LJ-DzER9bf6.js} +1 -1
  110. package/dist/assets/tracing-Dpx5M-u3.js +2 -0
  111. package/dist/assets/{tracing-panel-DAzrzNmm.js → tracing-panel-hCjBkSER.js} +2 -2
  112. package/dist/assets/{trash-Dc6DSjz_.js → trash-C6Ko-g5q.js} +1 -1
  113. package/dist/assets/{tree-jheoerAX.js → tree-BHN2gcCF.js} +6 -6
  114. package/dist/assets/{treemap-75Q7IDZK-IgpxeGaf.js → treemap-75Q7IDZK-DR79Mhzt.js} +27 -27
  115. package/dist/assets/variable-panel-PFBCFz36.js +1 -0
  116. package/dist/assets/{vega-component-BpfpiPKI.js → vega-component-Db6-uY4C.js} +1 -1
  117. package/dist/assets/worker-fHbtoWvT.js +1 -0
  118. package/dist/assets/{xychartDiagram-6GGTOJPD-CmNigJ31.js → xychartDiagram-6GGTOJPD-DWzBP3tZ.js} +1 -1
  119. package/dist/index.html +2 -2
  120. package/package.json +5 -4
  121. package/src/__mocks__/requests.ts +1 -0
  122. package/src/components/app-config/user-config-form.tsx +46 -1
  123. package/src/components/chat/acp/__tests__/__snapshots__/prompt.test.ts.snap +62 -43
  124. package/src/components/chat/acp/__tests__/atoms.test.ts +1 -1
  125. package/src/components/chat/acp/__tests__/state.test.ts +36 -36
  126. package/src/components/chat/acp/agent-panel.tsx +24 -27
  127. package/src/components/chat/acp/blocks.tsx +6 -6
  128. package/src/components/chat/acp/prompt.ts +62 -43
  129. package/src/components/chat/chat-panel.tsx +5 -1
  130. package/src/components/chat/markdown-renderer.tsx +6 -10
  131. package/src/components/chat/tool-call-accordion.tsx +52 -20
  132. package/src/components/data-table/SearchBar.tsx +8 -7
  133. package/src/components/data-table/__tests__/column_formatting.test.ts +50 -35
  134. package/src/components/data-table/__tests__/columns.test.tsx +38 -0
  135. package/src/components/data-table/__tests__/data-table.test.tsx +39 -1
  136. package/src/components/data-table/cell-hover-template/feature.ts +14 -0
  137. package/src/components/data-table/cell-hover-template/types.ts +11 -0
  138. package/src/components/data-table/charts/components/form-fields.tsx +41 -37
  139. package/src/components/data-table/charts/forms/common-chart.tsx +2 -2
  140. package/src/components/data-table/column-explorer-panel/column-explorer.tsx +5 -2
  141. package/src/components/data-table/column-formatting/feature.ts +62 -29
  142. package/src/components/data-table/column-formatting/types.ts +1 -0
  143. package/src/components/data-table/column-header.tsx +3 -1
  144. package/src/components/data-table/column-summary/chart-spec-model.tsx +24 -7
  145. package/src/components/data-table/column-summary/column-summary.tsx +18 -9
  146. package/src/components/data-table/columns.tsx +63 -20
  147. package/src/components/data-table/data-table.tsx +10 -2
  148. package/src/components/data-table/date-popover.tsx +85 -75
  149. package/src/components/data-table/filter-pills.tsx +14 -9
  150. package/src/components/data-table/header-items.tsx +5 -1
  151. package/src/components/data-table/pagination.tsx +20 -13
  152. package/src/components/data-table/renderers.tsx +36 -0
  153. package/src/components/data-table/row-viewer-panel/row-viewer.tsx +10 -8
  154. package/src/components/data-table/schemas.ts +16 -0
  155. package/src/components/datasources/column-preview.tsx +6 -2
  156. package/src/components/datasources/datasources.tsx +8 -12
  157. package/src/components/editor/Cell.tsx +2 -0
  158. package/src/components/editor/ai/transport/chat-transport.tsx +4 -1
  159. package/src/components/editor/cell/CellStatus.tsx +23 -20
  160. package/src/components/editor/cell/CreateCellButton.tsx +3 -4
  161. package/src/components/editor/cell/code/language-toggle.tsx +3 -4
  162. package/src/components/editor/chrome/wrapper/footer-items/machine-stats.tsx +39 -28
  163. package/src/components/editor/controls/notebook-menu-dropdown.tsx +4 -2
  164. package/src/components/editor/errors/sql-validation-errors.tsx +34 -0
  165. package/src/components/editor/file-tree/requesting-tree.tsx +14 -8
  166. package/src/components/editor/output/ConsoleOutput.tsx +13 -1
  167. package/src/components/editor/output/MarimoErrorOutput.tsx +60 -1
  168. package/src/components/editor/renderers/CellArray.tsx +3 -4
  169. package/src/components/editor/renderers/slides-layout/slides-layout.tsx +3 -3
  170. package/src/components/editor/renderers/slides-layout/types.ts +1 -0
  171. package/src/components/pages/home-page.tsx +4 -1
  172. package/src/components/slides/slides-component.tsx +1 -1
  173. package/src/components/slides/slides.css +6 -0
  174. package/src/components/terminal/theme.tsx +1 -0
  175. package/src/components/tracing/tracing-spec.ts +5 -4
  176. package/src/components/ui/range-slider.tsx +4 -2
  177. package/src/components/ui/slider.tsx +3 -1
  178. package/src/components/variables/variables-table.tsx +3 -0
  179. package/src/core/MarimoApp.tsx +9 -6
  180. package/src/core/ai/context/__tests__/registry.test.ts +6 -4
  181. package/src/core/ai/context/providers/cell-output.ts +4 -20
  182. package/src/core/ai/context/providers/error.ts +3 -1
  183. package/src/core/ai/context/providers/file.ts +7 -2
  184. package/src/core/ai/context/providers/tables.ts +3 -2
  185. package/src/core/ai/context/providers/variable.ts +6 -4
  186. package/src/core/ai/staged-cells.ts +34 -1
  187. package/src/core/cells/__tests__/add-missing-import.test.ts +67 -22
  188. package/src/core/cells/add-missing-import.ts +24 -7
  189. package/src/core/cells/cells.ts +26 -27
  190. package/src/core/cells/logs.ts +1 -1
  191. package/src/core/codemirror/find-replace/search-highlight.ts +3 -1
  192. package/src/core/codemirror/language/LanguageAdapters.ts +9 -3
  193. package/src/core/codemirror/language/__tests__/extension.test.ts +24 -0
  194. package/src/core/codemirror/language/__tests__/sql-validation.test.ts +133 -0
  195. package/src/core/codemirror/language/languages/sql/sql-mode.ts +20 -0
  196. package/src/core/codemirror/language/languages/sql/sql.ts +90 -3
  197. package/src/core/codemirror/language/languages/sql/validation-errors.ts +79 -0
  198. package/src/core/codemirror/language/panel/panel.tsx +8 -2
  199. package/src/core/codemirror/language/panel/sql.tsx +81 -4
  200. package/src/core/codemirror/lsp/notebook-lsp.ts +8 -2
  201. package/src/core/codemirror/readonly/__tests__/extension.test.ts +1 -1
  202. package/src/core/codemirror/rtc/loro/awareness.ts +52 -17
  203. package/src/core/codemirror/rtc/loro/sync.ts +12 -4
  204. package/src/core/config/config-schema.ts +1 -0
  205. package/src/core/config/config.ts +4 -0
  206. package/src/core/config/feature-flag.tsx +3 -1
  207. package/src/core/datasets/request-registry.ts +17 -1
  208. package/src/core/hotkeys/hotkeys.ts +8 -4
  209. package/src/core/i18n/__tests__/locale-provider.test.tsx +176 -0
  210. package/src/core/i18n/locale-provider.tsx +35 -0
  211. package/src/core/i18n/with-locale.tsx +12 -0
  212. package/src/core/islands/bridge.ts +1 -0
  213. package/src/core/islands/components/web-components.tsx +13 -10
  214. package/src/core/islands/main.ts +1 -0
  215. package/src/core/kernel/RuntimeState.ts +4 -1
  216. package/src/core/kernel/messages.ts +3 -2
  217. package/src/core/network/DeferredRequestRegistry.ts +16 -4
  218. package/src/core/network/requests-network.ts +7 -0
  219. package/src/core/network/requests-static.ts +1 -0
  220. package/src/core/network/requests-toasting.ts +1 -0
  221. package/src/core/network/types.ts +2 -0
  222. package/src/core/runtime/runtime.ts +5 -4
  223. package/src/core/wasm/bridge.ts +10 -1
  224. package/src/core/wasm/store.ts +4 -1
  225. package/src/core/wasm/worker/message-buffer.ts +3 -2
  226. package/src/core/websocket/types.ts +22 -16
  227. package/src/core/websocket/useMarimoWebSocket.tsx +4 -0
  228. package/src/hooks/useFormatting.ts +97 -0
  229. package/src/hooks/useTimer.ts +8 -5
  230. package/src/plugins/core/registerReactComponent.tsx +39 -29
  231. package/src/plugins/impl/DataTablePlugin.tsx +15 -4
  232. package/src/plugins/impl/RangeSliderPlugin.tsx +5 -3
  233. package/src/plugins/impl/SliderPlugin.tsx +3 -1
  234. package/src/plugins/impl/anywidget/model.ts +16 -5
  235. package/src/plugins/impl/data-editor/types.ts +7 -5
  236. package/src/plugins/impl/data-explorer/components/column-summary.tsx +20 -13
  237. package/src/plugins/impl/data-frames/DataFramePlugin.tsx +17 -5
  238. package/src/plugins/impl/panel/utils.ts +6 -4
  239. package/src/plugins/layout/OutlinePlugin.tsx +69 -0
  240. package/src/plugins/layout/StatPlugin.tsx +4 -1
  241. package/src/plugins/plugins.ts +2 -0
  242. package/src/stories/dataframe.stories.tsx +2 -0
  243. package/src/utils/__tests__/dates.test.ts +45 -24
  244. package/src/utils/__tests__/dom.test.ts +167 -0
  245. package/src/utils/__tests__/numbers.test.ts +42 -30
  246. package/src/utils/__tests__/once.test.ts +187 -0
  247. package/src/utils/dates.ts +15 -10
  248. package/src/utils/dom.ts +55 -0
  249. package/src/utils/edit-distance.ts +8 -6
  250. package/src/utils/errors.ts +1 -1
  251. package/src/utils/id-tree.tsx +21 -10
  252. package/src/utils/localStorage.ts +13 -4
  253. package/src/utils/numbers.ts +11 -11
  254. package/src/utils/once.ts +32 -0
  255. package/src/utils/paths.ts +4 -1
  256. package/src/utils/pluralize.ts +12 -5
  257. package/src/utils/python-poet/poet.ts +30 -15
  258. package/src/utils/time.ts +5 -1
  259. package/dist/assets/ConnectedDataExplorerComponent-BErMbWvG.js +0 -19
  260. package/dist/assets/_baseEach-CNBxBxvS.js +0 -1
  261. package/dist/assets/_baseMap-D1WHjKrd.js +0 -1
  262. package/dist/assets/channel-_2eNSz0n.js +0 -1
  263. package/dist/assets/chat-panel-CXh5Wl6C.js +0 -3
  264. package/dist/assets/classDiagram-KNZD7YFC-BGmh9POF.js +0 -1
  265. package/dist/assets/classDiagram-v2-RKCZMP56-BGmh9POF.js +0 -1
  266. package/dist/assets/clone-BFDSPAj3.js +0 -1
  267. package/dist/assets/command-palette-CXZiSv0I.js +0 -1
  268. package/dist/assets/datasources-panel-B7FbYLiy.js +0 -1
  269. package/dist/assets/edit-page-BrYda9VE.js +0 -129
  270. package/dist/assets/file-explorer-panel-Bw59Kva1.js +0 -1
  271. package/dist/assets/home-page-Fb2osjys.js +0 -9
  272. package/dist/assets/index-Cx0bsY1w.css +0 -1
  273. package/dist/assets/index-DKEudB02.js +0 -578
  274. package/dist/assets/infoDiagram-STP46IZ2-CVyrdLc8.js +0 -2
  275. package/dist/assets/links-D59GIweI.js +0 -7
  276. package/dist/assets/min-DUMu_zeK.js +0 -1
  277. package/dist/assets/outline-panel-DIzkvm2I.js +0 -1
  278. package/dist/assets/snippets-panel-CTPYW41n.js +0 -1
  279. package/dist/assets/sortBy-BNZKwiq_.js +0 -1
  280. package/dist/assets/stateDiagram-v2-UMBNRL4Z-D5lYZOOt.js +0 -1
  281. package/dist/assets/storage-CMdLzB_c.js +0 -26
  282. package/dist/assets/tracing-BCIurUfa.js +0 -2
  283. package/dist/assets/variable-panel-DYAiLBmF.js +0 -1
  284. package/dist/assets/worker-X5rxzQGQ.js +0 -1
@@ -0,0 +1,7 @@
1
+ import{eP as ts,dT as ns,c as pe,r as b,ie as He,ig as st,ih as Ie,ii as ls,ij as ss,ik as tn,il as nn,im as Mt,io as ln,gN as ye,ip as it,iq as sn,ir as Ue,is,bY as at,it as an,iu as ot,iv as be,iw as as,ix as Ne,iy as on,c6 as rn,gM as cn,iz as os,iA as dn,iB as un,d as E,iC as rs,iD as hn,gK as cs,iE as mn,iF as rt,iG as ds,iH as us,iI as hs,gT as ct,iJ as ms,iK as ps,iL as gs,iM as fs,gO as Pt,gP as xs,gQ as At,gS as We,iN as ys,iO as pn,iP as Et,iQ as Tt,gR as vs,iR as bs,iS as js,iT as ks,a as te,cw as Cs,T as _e,j as l,cq as ws,ax as Fe,iU as gn,h_ as Ss,iV as fn,fs as xn,iW as G,iX as yn,iY as Y,iZ as U,i_ as Q,i$ as ge,j0 as X,bS as je,j1 as vn,j2 as J,j3 as re,a0 as Re,j4 as de,eg as ce,j5 as dt,h7 as bn,j6 as jn,j7 as Ns,j8 as Ve,e$ as Se,j9 as kn,p as Ks,ja as Is,jb as Cn,jc as ut,jd as wn,je as _s,jf as ht,L as ae,jg as ue,jh as Ds,ba as mt,ji as Sn,hG as Ms,f4 as $t,bK as Ps,jj as Nn,jk as As,jl as Es,jm as Kn,jn as In,jo as Ts,av as Ge,cr as Ye,aw as _n,K as pt,cu as $s,jp as zs,aY as zt,jq as Fs,jr as Rs,a$ as Dn,b0 as Vs,b1 as Mn,a_ as me,cE as Pn,js as An,jt as Ls,bn as gt,ju as En,jv as Bs,jw as Os,jx as qs,cL as Hs,jy as Us,jz as Ws,jA as Gs,jB as Ys,jC as Qs,jD as Xs,ft as Zs,eh as De,a7 as Js,dc as Tn,a8 as ei,$ as ti,f7 as ni,dh as Qe,ee as ft,eS as $n,jE as li,jF as zn,aB as Me,jG as Fn,jH as xt,jI as Ft,jJ as Rn,aA as Pe,jK as Vn,jL as Ln,cO as yt,f_ as si,g4 as Xe,jM as Bn,dj as ii,dk as ai,jN as oi,dr as On,d6 as ri,jO as ci,dg as qn,bT as di,aI as Hn,jP as ui,aH as hi,dv as mi,dy as pi,a2 as gi,dz as fi,fa as xi,dd as yi,fd as vi,ht as bi,jQ as ji,jR as Un,jS as ki,d2 as Ci,d4 as wi,d5 as Si,b as Ni,Y as Wn,Z as Rt,c7 as Ki,a1 as Gn,E as Ii,a3 as _i,a4 as vt,a5 as Di,a6 as Mi,ay as Vt,g3 as Pi,jT as Ai,jU as Ei,jV as Ti,jW as $i,hs as Ze,_ as bt,jX as zi,dK as Yn,jY as Fi,aZ as Ri,am as Vi,an as Li,al as Bi,X as Oi,eb as qi,e5 as Hi}from"./index-CelXfcd8.js";/**
2
+ * @license lucide-react v0.542.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const Ui=pe("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),Wi=pe("book-marked",[["path",{d:"M10 2v8l3-3 3 3V2",key:"sqw3rj"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]]),Qn=pe("box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]),Xn=pe("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]),Zn=pe("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]),Gi=pe("flask-conical",[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]]),Jn=pe("folder-cog",[["path",{d:"M10.3 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.98a2 2 0 0 1 1.69.9l.66 1.2A2 2 0 0 0 12 6h8a2 2 0 0 1 2 2v3.3",key:"128dxu"}],["path",{d:"m14.305 19.53.923-.382",key:"3m78fa"}],["path",{d:"m15.228 16.852-.923-.383",key:"npixar"}],["path",{d:"m16.852 15.228-.383-.923",key:"5xggr7"}],["path",{d:"m16.852 20.772-.383.924",key:"dpfhf9"}],["path",{d:"m19.148 15.228.383-.923",key:"1reyyz"}],["path",{d:"m19.53 21.696-.382-.924",key:"1goivc"}],["path",{d:"m20.772 16.852.924-.383",key:"htqkph"}],["path",{d:"m20.772 19.148.924.383",key:"9w9pjp"}],["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}]]),Yi=pe("github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]),Qi=pe("grid-3x3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]),Xi=pe("link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]),Zi=pe("messages-square",[["path",{d:"M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z",key:"1n2ejm"}],["path",{d:"M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1",key:"1qfcsi"}]]),Ji=pe("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]),ea=pe("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]),ta=pe("power-off",[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),na=pe("youtube",[["path",{d:"M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17",key:"1q2vi4"}],["path",{d:"m10 15 5-3-5-3z",key:"1jp15x"}]]);function el(n,e){const t=b.useRef(!0),s=b.useRef(null);He(()=>(t.current=!0,()=>{t.current=!1}),[]),He(()=>{t.current?t.current=!1:s.current&&!e.some((i,a)=>!Object.is(i,s[a]))||n(),s.current=e},e)}function la(n){const e=b.version.split(".");return parseInt(e[0],10)>=19?n:n?"true":void 0}function Le(n){return ls()?n.metaKey:n.ctrlKey}const sa=500;function tl(n){let e=(function(t){let s=sn(t),i=s==null?void 0:s.getAttribute("aria-activedescendant");return i&&t.getElementById(i)||s})(nn(n));e!==n&&(e&&(function(t,s){t.dispatchEvent(new FocusEvent("blur",{relatedTarget:s})),t.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:s}))})(e,n),n&&nl(n,e))}function nl(n,e){n.dispatchEvent(new FocusEvent("focus",{relatedTarget:e})),n.dispatchEvent(new FocusEvent("focusin",{bubbles:!0,relatedTarget:e}))}function Lt(n){return is()?n.altKey:n.ctrlKey}function jt(n,e){var t,s;let i=`[data-key="${CSS.escape(String(e))}"]`,a=(t=n.current)===null||t===void 0?void 0:t.dataset.collection;return a&&(i=`[data-collection="${CSS.escape(a)}"]${i}`),(s=n.current)===null||s===void 0?void 0:s.querySelector(i)}const ll=new WeakMap;function ia(n){let{selectionManager:e,keyboardDelegate:t,ref:s,autoFocus:i=!1,shouldFocusWrap:a=!1,disallowEmptySelection:o=!1,disallowSelectAll:c=!1,escapeKeyBehavior:d="clearSelection",selectOnFocus:u=e.selectionBehavior==="replace",disallowTypeAhead:r=!1,shouldUseVirtualFocus:h,allowsTabNavigation:g=!1,isVirtualized:p,scrollRef:m=s,linkBehavior:k="action"}=n,{direction:y}=at(),j=an(),w=b.useRef({top:0,left:0});ot(m,"scroll",p?void 0:()=>{var C,A,R,q;w.current={top:(R=(C=m.current)===null||C===void 0?void 0:C.scrollTop)!==null&&R!==void 0?R:0,left:(q=(A=m.current)===null||A===void 0?void 0:A.scrollLeft)!==null&&q!==void 0?q:0}});let v=b.useRef(!1);ot(s,"react-aria-focus",h?C=>{let{detail:A}=C;C.stopPropagation(),e.setFocused(!0),(A==null?void 0:A.focusStrategy)==="first"&&(v.current=!0)}:void 0);let S=st(()=>{var C,A;let R=(A=(C=t.getFirstKey)===null||C===void 0?void 0:C.call(t))!==null&&A!==void 0?A:null;if(R==null){let q=sn();tl(s.current),nl(q,null),e.collection.size>0&&(v.current=!1)}else e.setFocusedKey(R),v.current=!1});el(()=>{v.current&&S()},[e.collection,S]);let M=st(()=>{e.collection.size>0&&(v.current=!1)});el(()=>{M()},[e.focusedKey,M]),ot(s,"react-aria-clear-focus",h?C=>{var A;C.stopPropagation(),e.setFocused(!1),!((A=C.detail)===null||A===void 0)&&A.clearFocusKey&&e.setFocusedKey(null)}:void 0);const P=b.useRef(i),_=b.useRef(!1);b.useEffect(()=>{if(P.current){var C,A;let O=null;var R,q;i==="first"&&(O=(R=(C=t.getFirstKey)===null||C===void 0?void 0:C.call(t))!==null&&R!==void 0?R:null),i==="last"&&(O=(q=(A=t.getLastKey)===null||A===void 0?void 0:A.call(t))!==null&&q!==void 0?q:null);let f=e.selectedKeys;if(f.size){for(let V of f)if(e.canSelectItem(V)){O=V;break}}e.setFocused(!0),e.setFocusedKey(O),O==null&&!h&&s.current&&be(s.current),e.collection.size>0&&(P.current=!1,_.current=!0)}});let D=b.useRef(e.focusedKey),I=b.useRef(null);b.useEffect(()=>{if(e.isFocused&&e.focusedKey!=null&&(e.focusedKey!==D.current||_.current)&&m.current&&s.current){let C=on(),A=jt(s,e.focusedKey);if(!(A instanceof HTMLElement))return;(C==="keyboard"||_.current)&&(I.current&&cancelAnimationFrame(I.current),I.current=requestAnimationFrame(()=>{m.current&&(as(m.current,A),C!=="virtual"&&Ne(A,{containingElement:s.current}))}))}!h&&e.isFocused&&e.focusedKey==null&&D.current!=null&&s.current&&be(s.current),D.current=e.focusedKey,_.current=!1}),b.useEffect(()=>()=>{I.current&&cancelAnimationFrame(I.current)},[]),ot(s,"react-aria-focus-scope-restore",C=>{C.preventDefault(),e.setFocused(!0)});let $,F={onKeyDown:C=>{var A;if(C.altKey&&C.key==="Tab"&&C.preventDefault(),!(!((A=s.current)===null||A===void 0)&&A.contains(C.target)))return;const R=(T,ie)=>{if(T!=null){if(e.isLink(T)&&k==="selection"&&u&&!Lt(C)){rn.flushSync(()=>{e.setFocusedKey(T,ie)});let Z=jt(s,T),oe=e.getItemProps(T);return void(Z&&j.open(Z,C,oe.href,oe.routerOptions))}if(e.setFocusedKey(T,ie),e.isLink(T)&&k==="override")return;C.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(T):u&&!Lt(C)&&e.replaceSelection(T)}};switch(C.key){case"ArrowDown":if(t.getKeyBelow){var q,O,f;let T=e.focusedKey!=null?(q=t.getKeyBelow)===null||q===void 0?void 0:q.call(t,e.focusedKey):(O=t.getFirstKey)===null||O===void 0?void 0:O.call(t);T==null&&a&&(T=(f=t.getFirstKey)===null||f===void 0?void 0:f.call(t,e.focusedKey)),T!=null&&(C.preventDefault(),R(T))}break;case"ArrowUp":if(t.getKeyAbove){var V,B,L;let T=e.focusedKey!=null?(V=t.getKeyAbove)===null||V===void 0?void 0:V.call(t,e.focusedKey):(B=t.getLastKey)===null||B===void 0?void 0:B.call(t);T==null&&a&&(T=(L=t.getLastKey)===null||L===void 0?void 0:L.call(t,e.focusedKey)),T!=null&&(C.preventDefault(),R(T))}break;case"ArrowLeft":if(t.getKeyLeftOf){var W,K,x;let T=e.focusedKey!=null?(W=t.getKeyLeftOf)===null||W===void 0?void 0:W.call(t,e.focusedKey):null;T==null&&a&&(T=y==="rtl"?(K=t.getFirstKey)===null||K===void 0?void 0:K.call(t,e.focusedKey):(x=t.getLastKey)===null||x===void 0?void 0:x.call(t,e.focusedKey)),T!=null&&(C.preventDefault(),R(T,y==="rtl"?"first":"last"))}break;case"ArrowRight":if(t.getKeyRightOf){var N,le,se;let T=e.focusedKey!=null?(N=t.getKeyRightOf)===null||N===void 0?void 0:N.call(t,e.focusedKey):null;T==null&&a&&(T=y==="rtl"?(le=t.getLastKey)===null||le===void 0?void 0:le.call(t,e.focusedKey):(se=t.getFirstKey)===null||se===void 0?void 0:se.call(t,e.focusedKey)),T!=null&&(C.preventDefault(),R(T,y==="rtl"?"last":"first"))}break;case"Home":if(t.getFirstKey){if(e.focusedKey===null&&C.shiftKey)return;C.preventDefault();let T=t.getFirstKey(e.focusedKey,Le(C));e.setFocusedKey(T),T!=null&&(Le(C)&&C.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(T):u&&e.replaceSelection(T))}break;case"End":if(t.getLastKey){if(e.focusedKey===null&&C.shiftKey)return;C.preventDefault();let T=t.getLastKey(e.focusedKey,Le(C));e.setFocusedKey(T),T!=null&&(Le(C)&&C.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(T):u&&e.replaceSelection(T))}break;case"PageDown":if(t.getKeyPageBelow&&e.focusedKey!=null){let T=t.getKeyPageBelow(e.focusedKey);T!=null&&(C.preventDefault(),R(T))}break;case"PageUp":if(t.getKeyPageAbove&&e.focusedKey!=null){let T=t.getKeyPageAbove(e.focusedKey);T!=null&&(C.preventDefault(),R(T))}break;case"a":Le(C)&&e.selectionMode==="multiple"&&c!==!0&&(C.preventDefault(),e.selectAll());break;case"Escape":d!=="clearSelection"||o||e.selectedKeys.size===0||(C.stopPropagation(),C.preventDefault(),e.clearSelection());break;case"Tab":if(!g){if(C.shiftKey)s.current.focus();else{let T,ie,Z=it(s.current,{tabbable:!0});do ie=Z.lastChild(),ie&&(T=ie);while(ie);T&&!T.contains(document.activeElement)&&Mt(T)}break}}},onFocus:C=>{if(e.isFocused)C.currentTarget.contains(C.target)||e.setFocused(!1);else if(C.currentTarget.contains(C.target)){if(e.setFocused(!0),e.focusedKey==null){var A,R;let f=B=>{B!=null&&(e.setFocusedKey(B),u&&!e.isSelected(B)&&e.replaceSelection(B))},V=C.relatedTarget;var q,O;V&&C.currentTarget.compareDocumentPosition(V)&Node.DOCUMENT_POSITION_FOLLOWING?f((q=e.lastSelectedKey)!==null&&q!==void 0?q:(A=t.getLastKey)===null||A===void 0?void 0:A.call(t)):f((O=e.firstSelectedKey)!==null&&O!==void 0?O:(R=t.getFirstKey)===null||R===void 0?void 0:R.call(t))}else!p&&m.current&&(m.current.scrollTop=w.current.top,m.current.scrollLeft=w.current.left);if(e.focusedKey!=null&&m.current){let f=jt(s,e.focusedKey);f instanceof HTMLElement&&(f.contains(document.activeElement)||h||Mt(f),on()==="keyboard"&&Ne(f,{containingElement:s.current}))}}},onBlur:C=>{C.currentTarget.contains(C.relatedTarget)||e.setFocused(!1)},onMouseDown(C){m.current===C.target&&C.preventDefault()}},{typeSelectProps:z}=(function(C){let{keyboardDelegate:A,selectionManager:R,onTypeSelect:q}=C,O=b.useRef({search:"",timeout:void 0}).current;return{typeSelectProps:{onKeyDownCapture:A.getKeyForSearch?f=>{let V=(B=f.key).length!==1&&/^[A-Z]/i.test(B)?"":B;var B;if(V&&!f.ctrlKey&&!f.metaKey&&f.currentTarget.contains(f.target)&&(O.search.length!==0||V!==" ")){if(V===" "&&O.search.trim().length>0&&(f.preventDefault(),"continuePropagation"in f||f.stopPropagation()),O.search+=V,A.getKeyForSearch!=null){let L=A.getKeyForSearch(O.search,R.focusedKey);L==null&&(L=A.getKeyForSearch(O.search)),L!=null&&(R.setFocusedKey(L),q&&q(L))}clearTimeout(O.timeout),O.timeout=setTimeout(()=>{O.search=""},1e3)}}:void 0}}})({keyboardDelegate:t,selectionManager:e});r||(F=ye(z,F)),h||($=e.focusedKey==null?0:-1);let H=(function(C){let A=Ue();return ll.set(C,A),A})(e.collection);return{collectionProps:ye(F,{tabIndex:$,"data-collection":H})}}function aa(n){let{id:e,selectionManager:t,key:s,ref:i,shouldSelectOnPressUp:a,shouldUseVirtualFocus:o,focus:c,isDisabled:d,onAction:u,allowsDifferentPressOrigin:r,linkBehavior:h="action"}=n,g=an();e=Ue(e);let p=f=>{if(f.pointerType==="keyboard"&&Lt(f))t.toggleSelection(s);else{if(t.selectionMode==="none")return;if(t.isLink(s)){if(h==="selection"&&i.current){let V=t.getItemProps(s);return g.open(i.current,f,V.href,V.routerOptions),void t.setSelectedKeys(t.selectedKeys)}if(h==="override"||h==="none")return}t.selectionMode==="single"?t.isSelected(s)&&!t.disallowEmptySelection?t.toggleSelection(s):t.replaceSelection(s):f&&f.shiftKey?t.extendSelection(s):t.selectionBehavior==="toggle"||f&&(Le(f)||f.pointerType==="touch"||f.pointerType==="virtual")?t.toggleSelection(s):t.replaceSelection(s)}};b.useEffect(()=>{s===t.focusedKey&&t.isFocused&&(o?tl(i.current):c?c():document.activeElement!==i.current&&i.current&&be(i.current))},[i,s,t.focusedKey,t.childFocusStrategy,t.isFocused,o]),d=d||t.isDisabled(s);let m={};o||d?d&&(m.onMouseDown=f=>{f.preventDefault()}):m={tabIndex:s===t.focusedKey?0:-1,onFocus(f){f.target===i.current&&t.setFocusedKey(s)}};let k=t.isLink(s)&&h==="override",y=t.isLink(s)&&h!=="selection"&&h!=="none",j=!d&&t.canSelectItem(s)&&!k,w=(u||y)&&!d,v=w&&(t.selectionBehavior==="replace"?!j:!j||t.isEmpty),S=w&&j&&t.selectionBehavior==="replace",M=v||S,P=b.useRef(null),_=M&&j,D=b.useRef(!1),I=b.useRef(!1),$=t.getItemProps(s),F=f=>{u&&u(),y&&i.current&&g.open(i.current,f,$.href,$.routerOptions)},z={ref:i};var H;if(a?(z.onPressStart=f=>{P.current=f.pointerType,D.current=_,f.pointerType!=="keyboard"||M&&!il()||p(f)},r?(z.onPressUp=v?void 0:f=>{f.pointerType==="mouse"&&j&&p(f)},z.onPress=v?F:f=>{f.pointerType!=="keyboard"&&f.pointerType!=="mouse"&&j&&p(f)}):z.onPress=f=>{if(v||S&&f.pointerType!=="mouse"){if(f.pointerType==="keyboard"&&!sl())return;F(f)}else f.pointerType!=="keyboard"&&j&&p(f)}):(z.onPressStart=f=>{P.current=f.pointerType,D.current=_,I.current=v,j&&(f.pointerType==="mouse"&&!v||f.pointerType==="keyboard"&&(!w||il()))&&p(f)},z.onPress=f=>{(f.pointerType==="touch"||f.pointerType==="pen"||f.pointerType==="virtual"||f.pointerType==="keyboard"&&M&&sl()||f.pointerType==="mouse"&&I.current)&&(M?F(f):j&&p(f))}),m["data-collection"]=(H=t.collection,ll.get(H)),m["data-key"]=s,z.preventFocusOnPress=o,o&&(z=ye(z,{onPressStart(f){f.pointerType!=="touch"&&(t.setFocused(!0),t.setFocusedKey(s))},onPress(f){f.pointerType==="touch"&&(t.setFocused(!0),t.setFocusedKey(s))}})),$)for(let f of["onPressStart","onPressEnd","onPressChange","onPress","onPressUp","onClick"])$[f]&&(z[f]=cn(z[f],$[f]));let{pressProps:C,isPressed:A}=tn(z),R=S?f=>{P.current==="mouse"&&(f.stopPropagation(),f.preventDefault(),F(f))}:void 0,{longPressProps:q}=(function(f){let{isDisabled:V,onLongPressStart:B,onLongPressEnd:L,onLongPress:W,threshold:K=sa,accessibilityDescription:x}=f;const N=b.useRef(void 0);let{addGlobalListener:le,removeGlobalListener:se}=ss(),{pressProps:T}=tn({isDisabled:V,onPressStart(Z){if(Z.continuePropagation(),(Z.pointerType==="mouse"||Z.pointerType==="touch")&&(B&&B({...Z,type:"longpressstart"}),N.current=setTimeout(()=>{Z.target.dispatchEvent(new PointerEvent("pointercancel",{bubbles:!0})),nn(Z.target).activeElement!==Z.target&&Mt(Z.target),W&&W({...Z,type:"longpress"}),N.current=void 0},K),Z.pointerType==="touch")){let oe=he=>{he.preventDefault()};le(Z.target,"contextmenu",oe,{once:!0}),le(window,"pointerup",()=>{setTimeout(()=>{se(Z.target,"contextmenu",oe)},30)},{once:!0})}},onPressEnd(Z){N.current&&clearTimeout(N.current),!L||Z.pointerType!=="mouse"&&Z.pointerType!=="touch"||L({...Z,type:"longpressend"})}}),ie=ln(W&&!V?x:void 0);return{longPressProps:ye(T,ie)}})({isDisabled:!_,onLongPress(f){f.pointerType==="touch"&&(p(f),t.setSelectionBehavior("toggle"))}}),O=h!=="none"&&t.isLink(s)?f=>{os.isOpening||f.preventDefault()}:void 0;return{itemProps:ye(m,j||v||o&&!d?C:{},_?q:{},{onDoubleClick:R,onDragStartCapture:f=>{P.current==="touch"&&D.current&&f.preventDefault()},onClick:O,id:e},o?{onMouseDown:f=>f.preventDefault()}:void 0),isPressed:A,isSelected:t.isSelected(s),isFocused:t.isFocused&&t.focusedKey===s,isDisabled:d,allowsSelection:j,hasAction:M}}function sl(){let n=window.event;return(n==null?void 0:n.key)==="Enter"}function il(){let n=window.event;return(n==null?void 0:n.key)===" "||(n==null?void 0:n.code)==="Space"}class al{getItemRect(e){let t=this.ref.current;if(!t)return null;let s=e!=null?jt(this.ref,e):null;if(!s)return null;let i=t.getBoundingClientRect(),a=s.getBoundingClientRect();return{x:a.left-i.left+t.scrollLeft,y:a.top-i.top+t.scrollTop,width:a.width,height:a.height}}getContentSize(){let e=this.ref.current;var t,s;return{width:(t=e==null?void 0:e.scrollWidth)!==null&&t!==void 0?t:0,height:(s=e==null?void 0:e.scrollHeight)!==null&&s!==void 0?s:0}}getVisibleRect(){let e=this.ref.current;var t,s,i,a;return{x:(t=e==null?void 0:e.scrollLeft)!==null&&t!==void 0?t:0,y:(s=e==null?void 0:e.scrollTop)!==null&&s!==void 0?s:0,width:(i=e==null?void 0:e.offsetWidth)!==null&&i!==void 0?i:0,height:(a=e==null?void 0:e.offsetHeight)!==null&&a!==void 0?a:0}}constructor(e){this.ref=e}}class ol{isDisabled(e){var t;return this.disabledBehavior==="all"&&(((t=e.props)===null||t===void 0?void 0:t.isDisabled)||this.disabledKeys.has(e.key))}findNextNonDisabled(e,t){let s=e;for(;s!=null;){let i=this.collection.getItem(s);if((i==null?void 0:i.type)==="item"&&!this.isDisabled(i))return s;s=t(s)}return null}getNextKey(e){let t=e;return t=this.collection.getKeyAfter(t),this.findNextNonDisabled(t,s=>this.collection.getKeyAfter(s))}getPreviousKey(e){let t=e;return t=this.collection.getKeyBefore(t),this.findNextNonDisabled(t,s=>this.collection.getKeyBefore(s))}findKey(e,t,s){let i=e,a=this.layoutDelegate.getItemRect(i);if(!a||i==null)return null;let o=a;do{if(i=t(i),i==null)break;a=this.layoutDelegate.getItemRect(i)}while(a&&s(o,a)&&i!=null);return i}isSameRow(e,t){return e.y===t.y||e.x!==t.x}isSameColumn(e,t){return e.x===t.x||e.y!==t.y}getKeyBelow(e){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(e,t=>this.getNextKey(t),this.isSameRow):this.getNextKey(e)}getKeyAbove(e){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(e,t=>this.getPreviousKey(t),this.isSameRow):this.getPreviousKey(e)}getNextColumn(e,t){return t?this.getPreviousKey(e):this.getNextKey(e)}getKeyRightOf(e){let t=this.direction==="ltr"?"getKeyRightOf":"getKeyLeftOf";return this.layoutDelegate[t]?(e=this.layoutDelegate[t](e),this.findNextNonDisabled(e,s=>this.layoutDelegate[t](s))):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(e,this.direction==="rtl"):this.findKey(e,s=>this.getNextColumn(s,this.direction==="rtl"),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(e,this.direction==="rtl"):null}getKeyLeftOf(e){let t=this.direction==="ltr"?"getKeyLeftOf":"getKeyRightOf";return this.layoutDelegate[t]?(e=this.layoutDelegate[t](e),this.findNextNonDisabled(e,s=>this.layoutDelegate[t](s))):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(e,this.direction==="ltr"):this.findKey(e,s=>this.getNextColumn(s,this.direction==="ltr"),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(e,this.direction==="ltr"):null}getFirstKey(){let e=this.collection.getFirstKey();return this.findNextNonDisabled(e,t=>this.collection.getKeyAfter(t))}getLastKey(){let e=this.collection.getLastKey();return this.findNextNonDisabled(e,t=>this.collection.getKeyBefore(t))}getKeyPageAbove(e){let t=this.ref.current,s=this.layoutDelegate.getItemRect(e);if(!s)return null;if(t&&!dn(t))return this.getFirstKey();let i=e;if(this.orientation==="horizontal"){let a=Math.max(0,s.x+s.width-this.layoutDelegate.getVisibleRect().width);for(;s&&s.x>a&&i!=null;)i=this.getKeyAbove(i),s=i==null?null:this.layoutDelegate.getItemRect(i)}else{let a=Math.max(0,s.y+s.height-this.layoutDelegate.getVisibleRect().height);for(;s&&s.y>a&&i!=null;)i=this.getKeyAbove(i),s=i==null?null:this.layoutDelegate.getItemRect(i)}return i??this.getFirstKey()}getKeyPageBelow(e){let t=this.ref.current,s=this.layoutDelegate.getItemRect(e);if(!s)return null;if(t&&!dn(t))return this.getLastKey();let i=e;if(this.orientation==="horizontal"){let a=Math.min(this.layoutDelegate.getContentSize().width,s.y-s.width+this.layoutDelegate.getVisibleRect().width);for(;s&&s.x<a&&i!=null;)i=this.getKeyBelow(i),s=i==null?null:this.layoutDelegate.getItemRect(i)}else{let a=Math.min(this.layoutDelegate.getContentSize().height,s.y-s.height+this.layoutDelegate.getVisibleRect().height);for(;s&&s.y<a&&i!=null;)i=this.getKeyBelow(i),s=i==null?null:this.layoutDelegate.getItemRect(i)}return i??this.getLastKey()}getKeyForSearch(e,t){if(!this.collator)return null;let s=this.collection,i=t||this.getFirstKey();for(;i!=null;){let a=s.getItem(i);if(!a)return null;let o=a.textValue.slice(0,e.length);if(a.textValue&&this.collator.compare(o,e)===0)return i;i=this.getNextKey(i)}return null}constructor(...e){if(e.length===1){let t=e[0];this.collection=t.collection,this.ref=t.ref,this.collator=t.collator,this.disabledKeys=t.disabledKeys||new Set,this.disabledBehavior=t.disabledBehavior||"all",this.orientation=t.orientation||"vertical",this.direction=t.direction,this.layout=t.layout||"stack",this.layoutDelegate=t.layoutDelegate||new al(t.ref)}else this.collection=e[0],this.disabledKeys=e[1],this.ref=e[2],this.collator=e[3],this.layout="stack",this.orientation="vertical",this.disabledBehavior="all",this.layoutDelegate=new al(this.ref);this.layout==="stack"&&this.orientation==="vertical"&&(this.getKeyLeftOf=void 0,this.getKeyRightOf=void 0)}}class oa{build(e,t){return this.context=t,rl(()=>this.iterateCollection(e))}*iterateCollection(e){let{children:t,items:s}=e;if(E.isValidElement(t)&&t.type===E.Fragment)yield*this.iterateCollection({children:t.props.children,items:s});else if(typeof t=="function"){if(!s)throw new Error("props.children was a function but props.items is missing");let i=0;for(let a of s)yield*this.getFullNode({value:a,index:i},{renderer:t}),i++}else{let i=[];E.Children.forEach(t,o=>{o&&i.push(o)});let a=0;for(let o of i){let c=this.getFullNode({element:o,index:a},{});for(let d of c)a++,yield d}}}getKey(e,t,s,i){if(e.key!=null)return e.key;if(t.type==="cell"&&t.key!=null)return`${i}${t.key}`;let a=t.value;if(a!=null){var o;let c=(o=a.key)!==null&&o!==void 0?o:a.id;if(c==null)throw new Error("No key found for item");return c}return i?`${i}.${t.index}`:`$.${t.index}`}getChildState(e,t){return{renderer:t.renderer||e.renderer}}*getFullNode(e,t,s,i){if(E.isValidElement(e.element)&&e.element.type===E.Fragment){let y=[];var a;E.Children.forEach(e.element.props.children,w=>{y.push(w)});let j=(a=e.index)!==null&&a!==void 0?a:0;for(const w of y)yield*this.getFullNode({element:w,index:j++},t,s,i);return}let o=e.element;if(!o&&e.value&&t&&t.renderer){let y=this.cache.get(e.value);if(y&&(!y.shouldInvalidate||!y.shouldInvalidate(this.context)))return y.index=e.index,y.parentKey=i?i.key:null,void(yield y);o=t.renderer(e.value)}if(E.isValidElement(o)){let y=o.type;if(typeof y!="function"&&typeof y.getCollectionNode!="function"){let S=o.type;throw new Error(`Unknown element <${S}> in collection.`)}let j=y.getCollectionNode(o.props,this.context);var c;let w=(c=e.index)!==null&&c!==void 0?c:0,v=j.next();for(;!v.done&&v.value;){let S=v.value;var d;e.index=w;let M=(d=S.key)!==null&&d!==void 0?d:null;M==null&&(M=S.element?null:this.getKey(o,e,t,s));let P=[...this.getFullNode({...S,key:M,index:w,wrapper:ra(e.wrapper,S.wrapper)},this.getChildState(t,S),s?`${s}${o.key}`:o.key,i)];for(let _ of P){var u,r,h;if(_.value=(r=(u=S.value)!==null&&u!==void 0?u:e.value)!==null&&r!==void 0?r:null,_.value&&this.cache.set(_.value,_),e.type&&_.type!==e.type)throw new Error(`Unsupported type <${Bt(_.type)}> in <${Bt((h=i==null?void 0:i.type)!==null&&h!==void 0?h:"unknown parent type")}>. Only <${Bt(e.type)}> is supported.`);w++,yield _}v=j.next(P)}return}if(e.key==null||e.type==null)return;let g=this;var p,m;let k={type:e.type,props:e.props,key:e.key,parentKey:i?i.key:null,value:(p=e.value)!==null&&p!==void 0?p:null,level:i?i.level+1:0,index:e.index,rendered:e.rendered,textValue:(m=e.textValue)!==null&&m!==void 0?m:"","aria-label":e["aria-label"],wrapper:e.wrapper,shouldInvalidate:e.shouldInvalidate,hasChildNodes:e.hasChildNodes||!1,childNodes:rl(function*(){if(!e.hasChildNodes||!e.childNodes)return;let y=0;for(let j of e.childNodes()){j.key!=null&&(j.key=`${k.key}${j.key}`);let w=g.getFullNode({...j,index:y},g.getChildState(t,j),k.key,k);for(let v of w)y++,yield v}})};yield k}constructor(){this.cache=new WeakMap}}function rl(n){let e=[],t=null;return{*[Symbol.iterator](){for(let s of e)yield s;t||(t=n());for(let s of t)e.push(s),yield s}}}function ra(n,e){return n&&e?t=>n(e(t)):n||e||void 0}function Bt(n){return n[0].toUpperCase()+n.slice(1)}function ca(n,e){return typeof e.getChildren=="function"?e.getChildren(n.key):n.childNodes}function da(n){return(function(e){for(let t of e)return t})(n)}function Ot(n,e,t){if(e.parentKey===t.parentKey)return e.index-t.index;let s=[...cl(n,e),e],i=[...cl(n,t),t],a=s.slice(0,i.length).findIndex((o,c)=>o!==i[c]);return a!==-1?(e=s[a],t=i[a],e.index-t.index):s.findIndex(o=>o===t)>=0?1:(i.findIndex(o=>o===e),-1)}function cl(n,e){let t=[],s=e;for(;(s==null?void 0:s.parentKey)!=null;)s=n.getItem(s.parentKey),s&&t.unshift(s);return t}class Be{get childNodes(){throw new Error("childNodes is not supported")}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e["aria-label"]=this["aria-label"],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,s){let i=this.clone();return t.addDescendants(i,e),i}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue="",this["aria-label"]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}}class dl extends Be{filter(e,t,s){let[i,a]=hl(e,t,this.firstChildKey,s),o=this.clone();return o.firstChildKey=i,o.lastChildKey=a,o}}(class extends Be{}).type="header";class ul extends Be{}ul.type="loader",(class extends dl{filter(n,e,t){if(t(this.textValue,this)){let s=this.clone();return e.addDescendants(s,n),s}return null}}).type="item",(class extends dl{filter(n,e,t){let s=super.filter(n,e,t);if(s&&s.lastChildKey!==null){let i=n.getItem(s.lastChildKey);if(i&&i.type!=="header")return s}return null}}).type="section";class ua{get size(){return this.itemCount}getKeys(){return this.keyMap.keys()}*[Symbol.iterator](){let e=this.firstKey!=null?this.keyMap.get(this.firstKey):void 0;for(;e;)yield e,e=e.nextKey!=null?this.keyMap.get(e.nextKey):void 0}getChildren(e){let t=this.keyMap;return{*[Symbol.iterator](){let s=t.get(e),i=(s==null?void 0:s.firstChildKey)!=null?t.get(s.firstChildKey):null;for(;i;)yield i,i=i.nextKey!=null?t.get(i.nextKey):void 0}}}getKeyBefore(e){let t=this.keyMap.get(e);if(!t)return null;if(t.prevKey!=null){for(t=this.keyMap.get(t.prevKey);t&&t.type!=="item"&&t.lastChildKey!=null;)t=this.keyMap.get(t.lastChildKey);var s;return(s=t==null?void 0:t.key)!==null&&s!==void 0?s:null}return t.parentKey}getKeyAfter(e){let t=this.keyMap.get(e);if(!t)return null;if(t.type!=="item"&&t.firstChildKey!=null)return t.firstChildKey;for(;t;){if(t.nextKey!=null)return t.nextKey;if(t.parentKey==null)return null;t=this.keyMap.get(t.parentKey)}return null}getFirstKey(){return this.firstKey}getLastKey(){let e=this.lastKey!=null?this.keyMap.get(this.lastKey):null;for(;(e==null?void 0:e.lastChildKey)!=null;)e=this.keyMap.get(e.lastChildKey);var t;return(t=e==null?void 0:e.key)!==null&&t!==void 0?t:null}getItem(e){var t;return(t=this.keyMap.get(e))!==null&&t!==void 0?t:null}at(){throw new Error("Not implemented")}clone(){let e=new this.constructor;return e.keyMap=new Map(this.keyMap),e.firstKey=this.firstKey,e.lastKey=this.lastKey,e.itemCount=this.itemCount,e}addNode(e){if(this.frozen)throw new Error("Cannot add a node to a frozen collection");e.type==="item"&&this.keyMap.get(e.key)==null&&this.itemCount++,this.keyMap.set(e.key,e)}addDescendants(e,t){this.addNode(e);let s=t.getChildren(e.key);for(let i of s)this.addDescendants(i,t)}removeNode(e){if(this.frozen)throw new Error("Cannot remove a node to a frozen collection");let t=this.keyMap.get(e);t!=null&&t.type==="item"&&this.itemCount--,this.keyMap.delete(e)}commit(e,t,s=!1){if(this.frozen)throw new Error("Cannot commit a frozen collection");this.firstKey=e,this.lastKey=t,this.frozen=!s}filter(e){let t=new this.constructor,[s,i]=hl(this,t,this.firstKey,e);return t==null||t.commit(s,i),t}constructor(){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.frozen=!1,this.itemCount=0}}function hl(n,e,t,s){if(t==null)return[null,null];let i=null,a=null,o=n.getItem(t);for(;o!=null;){let u=o.filter(n,e,s);u!=null&&(u.nextKey=null,a&&(u.prevKey=a.key,a.nextKey=u.key),i==null&&(i=u),e.addNode(u),a=u),o=o.nextKey?n.getItem(o.nextKey):null}if(a&&a.type==="separator"){let u=a.prevKey;e.removeNode(a.key),u?(a=e.getItem(u),a.nextKey=null):a=null}var c,d;return[(c=i==null?void 0:i.key)!==null&&c!==void 0?c:null,(d=a==null?void 0:a.key)!==null&&d!==void 0?d:null]}class ml{*[Symbol.iterator](){let e=this.firstChild;for(;e;)yield e,e=e.nextSibling}get firstChild(){return this._firstChild}set firstChild(e){this._firstChild=e,this.ownerDocument.markDirty(this)}get lastChild(){return this._lastChild}set lastChild(e){this._lastChild=e,this.ownerDocument.markDirty(this)}get previousSibling(){return this._previousSibling}set previousSibling(e){this._previousSibling=e,this.ownerDocument.markDirty(this)}get nextSibling(){return this._nextSibling}set nextSibling(e){this._nextSibling=e,this.ownerDocument.markDirty(this)}get parentNode(){return this._parentNode}set parentNode(e){this._parentNode=e,this.ownerDocument.markDirty(this)}get isConnected(){var e;return((e=this.parentNode)===null||e===void 0?void 0:e.isConnected)||!1}invalidateChildIndices(e){(this._minInvalidChildIndex==null||!this._minInvalidChildIndex.isConnected||e.index<this._minInvalidChildIndex.index)&&(this._minInvalidChildIndex=e,this.ownerDocument.markDirty(this))}updateChildIndices(){let e=this._minInvalidChildIndex;for(;e;)e.index=e.previousSibling?e.previousSibling.index+1:0,e=e.nextSibling;this._minInvalidChildIndex=null}appendChild(e){e.parentNode&&e.parentNode.removeChild(e),this.firstChild==null&&(this.firstChild=e),this.lastChild?(this.lastChild.nextSibling=e,e.index=this.lastChild.index+1,e.previousSibling=this.lastChild):(e.previousSibling=null,e.index=0),e.parentNode=this,e.nextSibling=null,this.lastChild=e,this.ownerDocument.markDirty(this),this.isConnected&&this.ownerDocument.queueUpdate()}insertBefore(e,t){if(t==null)return this.appendChild(e);e.parentNode&&e.parentNode.removeChild(e),e.nextSibling=t,e.previousSibling=t.previousSibling,e.index=t.index-1,this.firstChild===t?this.firstChild=e:t.previousSibling&&(t.previousSibling.nextSibling=e),t.previousSibling=e,e.parentNode=t.parentNode,this.invalidateChildIndices(e),this.isConnected&&this.ownerDocument.queueUpdate()}removeChild(e){e.parentNode===this&&this.ownerDocument.isMounted&&(this._minInvalidChildIndex===e&&(this._minInvalidChildIndex=null),e.nextSibling&&(this.invalidateChildIndices(e.nextSibling),e.nextSibling.previousSibling=e.previousSibling),e.previousSibling&&(e.previousSibling.nextSibling=e.nextSibling),this.firstChild===e&&(this.firstChild=e.nextSibling),this.lastChild===e&&(this.lastChild=e.previousSibling),e.parentNode=null,e.nextSibling=null,e.previousSibling=null,e.index=0,this.ownerDocument.markDirty(e),this.isConnected&&this.ownerDocument.queueUpdate())}addEventListener(){}removeEventListener(){}get previousVisibleSibling(){let e=this.previousSibling;for(;e&&e.isHidden;)e=e.previousSibling;return e}get nextVisibleSibling(){let e=this.nextSibling;for(;e&&e.isHidden;)e=e.nextSibling;return e}get firstVisibleChild(){let e=this.firstChild;for(;e&&e.isHidden;)e=e.nextSibling;return e}get lastVisibleChild(){let e=this.lastChild;for(;e&&e.isHidden;)e=e.previousSibling;return e}constructor(e){this._firstChild=null,this._lastChild=null,this._previousSibling=null,this._nextSibling=null,this._parentNode=null,this._minInvalidChildIndex=null,this.ownerDocument=e}}class qe extends ml{get index(){return this._index}set index(e){this._index=e,this.ownerDocument.markDirty(this)}get level(){var e;return this.parentNode instanceof qe?this.parentNode.level+(((e=this.node)===null||e===void 0?void 0:e.type)==="item"?1:0):0}getMutableNode(){return this.node==null?null:(this.isMutated||(this.node=this.node.clone(),this.isMutated=!0),this.ownerDocument.markDirty(this),this.node)}updateNode(){var e,t,s,i,a,o,c,d;let u=this.nextVisibleSibling,r=this.getMutableNode();var h,g,p,m,k;if(r!=null&&(r.index=this.index,r.level=this.level,r.parentKey=this.parentNode instanceof qe&&(h=(e=this.parentNode.node)===null||e===void 0?void 0:e.key)!==null&&h!==void 0?h:null,r.prevKey=(g=(s=this.previousVisibleSibling)===null||s===void 0||(t=s.node)===null||t===void 0?void 0:t.key)!==null&&g!==void 0?g:null,r.nextKey=(p=u==null||(i=u.node)===null||i===void 0?void 0:i.key)!==null&&p!==void 0?p:null,r.hasChildNodes=!!this.firstChild,r.firstChildKey=(m=(o=this.firstVisibleChild)===null||o===void 0||(a=o.node)===null||a===void 0?void 0:a.key)!==null&&m!==void 0?m:null,r.lastChildKey=(k=(d=this.lastVisibleChild)===null||d===void 0||(c=d.node)===null||c===void 0?void 0:c.key)!==null&&k!==void 0?k:null,(r.colSpan!=null||r.colIndex!=null)&&u)){var y,j;let w=((y=r.colIndex)!==null&&y!==void 0?y:r.index)+((j=r.colSpan)!==null&&j!==void 0?j:1);u.node!=null&&w!==u.node.colIndex&&(u.getMutableNode().colIndex=w)}}setProps(e,t,s,i,a){let o,{value:c,textValue:d,id:u,...r}=e;if(this.node==null?(o=new s(u??"react-aria-"+ ++this.ownerDocument.nodeId),this.node=o):o=this.getMutableNode(),r.ref=t,o.props=r,o.rendered=i,o.render=a,o.value=c,o.textValue=d||(typeof r.children=="string"?r.children:"")||e["aria-label"]||"",u!=null&&u!==o.key)throw new Error("Cannot change the id of an item");r.colSpan!=null&&(o.colSpan=r.colSpan),this.isConnected&&this.ownerDocument.queueUpdate()}get style(){let e=this;return{get display(){return e.isHidden?"none":""},set display(t){let s=t==="none";if(e.isHidden!==s){var i,a;((i=e.parentNode)===null||i===void 0?void 0:i.firstVisibleChild)!==e&&((a=e.parentNode)===null||a===void 0?void 0:a.lastVisibleChild)!==e||e.ownerDocument.markDirty(e.parentNode);let o=e.previousVisibleSibling,c=e.nextVisibleSibling;o&&e.ownerDocument.markDirty(o),c&&e.ownerDocument.markDirty(c),e.isHidden=s,e.ownerDocument.markDirty(e)}}}}hasAttribute(){}setAttribute(){}setAttributeNS(){}removeAttribute(){}constructor(e,t){super(t),this.nodeType=8,this.isMutated=!0,this._index=0,this.isHidden=!1,this.node=null}}class ha extends ml{get isConnected(){return this.isMounted}createElement(e){return new qe(e,this)}getMutableCollection(){return this.nextCollection||(this.nextCollection=this.collection.clone()),this.nextCollection}markDirty(e){this.dirtyNodes.add(e)}addNode(e){if(e.isHidden||e.node==null)return;let t=this.getMutableCollection();if(!t.getItem(e.node.key))for(let s of e)this.addNode(s);t.addNode(e.node)}removeNode(e){if(e.node!=null){for(let t of e)this.removeNode(t);this.getMutableCollection().removeNode(e.node.key)}}getCollection(){return this.inSubscription?this.collection.clone():(this.queuedRender=!1,this.updateCollection(),this.collection)}updateCollection(){for(let c of this.dirtyNodes)c instanceof qe&&(!c.isConnected||c.isHidden)?this.removeNode(c):c.updateChildIndices();for(let c of this.dirtyNodes)c instanceof qe&&(c.isConnected&&!c.isHidden&&(c.updateNode(),this.addNode(c)),c.isMutated=!1);var e,t,s,i,a,o;this.dirtyNodes.clear(),this.nextCollection&&(this.nextCollection.commit((a=(t=this.firstVisibleChild)===null||t===void 0||(e=t.node)===null||e===void 0?void 0:e.key)!==null&&a!==void 0?a:null,(o=(i=this.lastVisibleChild)===null||i===void 0||(s=i.node)===null||s===void 0?void 0:s.key)!==null&&o!==void 0?o:null,this.isSSR),this.isSSR||(this.collection=this.nextCollection,this.nextCollection=null))}queueUpdate(){if(this.dirtyNodes.size!==0&&!this.queuedRender){this.queuedRender=!0,this.inSubscription=!0;for(let e of this.subscriptions)e();this.inSubscription=!1}}subscribe(e){return this.subscriptions.add(e),()=>this.subscriptions.delete(e)}resetAfterSSR(){this.isSSR&&(this.isSSR=!1,this.firstChild=null,this.lastChild=null,this.nodeId=0)}constructor(e){super(null),this.nodeType=11,this.ownerDocument=this,this.dirtyNodes=new Set,this.isSSR=!1,this.nodeId=0,this.nodesByProps=new WeakMap,this.isMounted=!0,this.nextCollection=null,this.subscriptions=new Set,this.queuedRender=!1,this.inSubscription=!1,this.collection=e,this.nextCollection=e}}function qt(n){let{children:e,items:t,idScope:s,addIdAndValue:i,dependencies:a=[]}=n,o=b.useMemo(()=>new WeakMap,a);return b.useMemo(()=>{if(t&&typeof e=="function"){let u=[];for(let r of t){let h=o.get(r);if(!h){var c,d;h=e(r);let g=(d=(c=h.props.id)!==null&&c!==void 0?c:r.key)!==null&&d!==void 0?d:r.id;if(g==null)throw new Error("Could not determine key for item");s&&(g=s+":"+g),h=b.cloneElement(h,i?{key:g,id:g,value:r}:{key:g}),o.set(r,h)}u.push(h)}return u}if(typeof e!="function")return e},[e,t,o,s,i])}const pl=b.createContext(!1),Je=b.createContext(null);function ma(n){if(b.useContext(Je))return n.content;let{collection:e,document:t}=(function(s){let[i]=b.useState(()=>new ha((s==null?void 0:s())||new ua)),a=b.useCallback(u=>i.subscribe(u),[i]),o=b.useCallback(()=>{let u=i.getCollection();return i.isSSR&&i.resetAfterSSR(),u},[i]),c=b.useCallback(()=>(i.isSSR=!0,i.getCollection()),[i]),d=ga(a,o,c);return He(()=>(i.isMounted=!0,()=>{i.isMounted=!1}),[i]),{collection:d,document:i}})(n.createCollection);return E.createElement(E.Fragment,null,E.createElement(rs,null,E.createElement(Je.Provider,{value:t},n.content)),E.createElement(pa,{render:n.children,collection:e}))}function pa({collection:n,render:e}){return e(n)}const ga=typeof E.useSyncExternalStore=="function"?E.useSyncExternalStore:function(n,e,t){let s=hn(),i=b.useRef(s);i.current=s;let a=b.useCallback(()=>i.current?t():e(),[e,t]);return cs.useSyncExternalStore(n,a)},Ht=b.createContext(null);function gl(n,e,t,s,i,a){var o,c;typeof n=="string"&&(o=n,(c=class extends Be{}).type=o,n=c);let d=b.useCallback(r=>{r==null||r.setProps(e,t,n,s,a)},[e,t,s,a,n]),u=b.useContext(Ht);if(u){let r=u.ownerDocument.nodesByProps.get(e);return r||(r=u.ownerDocument.createElement(n.type),r.setProps(e,t,n,s,a),u.appendChild(r),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(e,r)),i?E.createElement(Ht.Provider,{value:r},i):null}return E.createElement(n.type,{ref:d},i)}function fl(n,e){let t=({node:i})=>e(i.props,i.props.ref,i),s=b.forwardRef((i,a)=>{let o=b.useContext(mn);if(!b.useContext(pl)){if(e.length>=3)throw new Error(e.name+" cannot be rendered outside a collection.");return e(i,a)}return gl(n,i,a,"children"in i?i.children:null,null,c=>E.createElement(mn.Provider,{value:o},E.createElement(t,{node:c})))});return s.displayName=e.name,s}function fa(n,e,t=xl){let s=({node:a})=>e(a.props,a.props.ref,a),i=b.forwardRef((a,o)=>{let c=t(a);var d;return(d=gl(n,a,o,null,c,u=>E.createElement(s,{node:u})))!==null&&d!==void 0?d:E.createElement(E.Fragment,null)});return i.displayName=e.name,i}function xl(n){return qt({...n,addIdAndValue:!0})}const yl=b.createContext(null);function xa(n){let e=b.useContext(yl),t=((e==null?void 0:e.dependencies)||[]).concat(n.dependencies),s=n.idScope||(e==null?void 0:e.idScope),i=xl({...n,idScope:s,dependencies:t});return b.useContext(Je)&&(i=E.createElement(ya,null,i)),e=b.useMemo(()=>({dependencies:t,idScope:s}),[s,...t]),E.createElement(yl.Provider,{value:e},i)}function ya({children:n}){let e=b.useContext(Je),t=b.useMemo(()=>E.createElement(Je.Provider,{value:null},E.createElement(pl.Provider,{value:!0},n)),[n]);return hn()?E.createElement(Ht.Provider,{value:e},t):rn.createPortal(t,e)}const vl={CollectionRoot:({collection:n,renderDropIndicator:e})=>bl(n,null,e),CollectionBranch:({collection:n,parent:e,renderDropIndicator:t})=>bl(n,e,t)};function bl(n,e,t){return qt({items:e?n.getChildren(e.key):n,dependencies:[t],children(s){let i=s.render(s);return t&&s.type==="item"?E.createElement(E.Fragment,null,t({type:"item",key:s.key,dropPosition:"before"}),i,(function(a,o,c){let d=o.key,u=a.getKeyAfter(d),r=u!=null?a.getItem(u):null;for(;r!=null&&r.type!=="item";)u=a.getKeyAfter(r.key),r=u!=null?a.getItem(u):null;let h=o.nextKey!=null?a.getItem(o.nextKey):null;for(;h!=null&&h.type!=="item";)h=h.nextKey!=null?a.getItem(h.nextKey):null;let g=[];if(h==null){let p=o;for(;p&&(!r||p.parentKey!==r.parentKey&&r.level<p.level);){let m=c({type:"item",key:p.key,dropPosition:"after"});b.isValidElement(m)&&g.push(b.cloneElement(m,{key:`${p.key}-after`})),p=p.parentKey!=null?a.getItem(p.parentKey):null}}return g})(n,s,t)):i}})}const Ut=b.createContext(vl),Wt=new WeakMap;function Gt(n,e){var t;let{id:s}=(t=Wt.get(n))!==null&&t!==void 0?t:{};if(!s)throw new Error("Unknown list");return`${s}-${(function(i){return typeof i=="string"?i.replace(/\s*/g,""):""+i})(e)}`}var kt;function jl(n,e){let t=new Set;if(n==="all"||e==="all")return t;for(let s of n.keys())e.has(s)||t.add(s);return t}function va(n,e,t){let{isVirtualized:s,keyboardDelegate:i,layoutDelegate:a,onAction:o,disallowTypeAhead:c,linkBehavior:d="action",keyboardNavigationBehavior:u="arrow",escapeKeyBehavior:r="clearSelection",shouldSelectOnPressUp:h}=n;n["aria-label"]||n["aria-labelledby"]||console.warn("An aria-label or aria-labelledby prop is required for accessibility.");let{listProps:g}=(function(w){let{selectionManager:v,collection:S,disabledKeys:M,ref:P,keyboardDelegate:_,layoutDelegate:D}=w,I=un({usage:"search",sensitivity:"base"}),$=v.disabledBehavior,F=b.useMemo(()=>_||new ol({collection:S,disabledKeys:M,disabledBehavior:$,ref:P,collator:I,layoutDelegate:D}),[_,D,S,M,P,I,$]),{collectionProps:z}=ia({...w,ref:P,selectionManager:v,keyboardDelegate:F});return{listProps:z}})({selectionManager:e.selectionManager,collection:e.collection,disabledKeys:e.disabledKeys,ref:t,keyboardDelegate:i,layoutDelegate:a,isVirtualized:s,selectOnFocus:e.selectionManager.selectionBehavior==="replace",shouldFocusWrap:n.shouldFocusWrap,linkBehavior:d,disallowTypeAhead:c,autoFocus:n.autoFocus,escapeKeyBehavior:r}),p=Ue(n.id);Wt.set(e,{id:p,onAction:o,linkBehavior:d,keyboardNavigationBehavior:u,shouldSelectOnPressUp:h});let m=(function(w){let v=rt((S=kt)&&S.__esModule?S.default:S,"@react-aria/grid");var S;let M=hs(),P=(M==="pointer"||M==="virtual"||M==null)&&typeof window<"u"&&"ontouchstart"in window,_=b.useMemo(()=>{let D,I=w.selectionManager.selectionMode,$=w.selectionManager.selectionBehavior;return P&&(D=v.format("longPressToSelect")),$==="replace"&&I!=="none"&&w.hasItemActions?D:void 0},[w.selectionManager.selectionMode,w.selectionManager.selectionBehavior,w.hasItemActions,v,P]);return ln(_)})({selectionManager:e.selectionManager,hasItemActions:!!o}),k=(function(w,v){let S=v==null?void 0:v.isDisabled,[M,P]=b.useState(!1);return He(()=>{if(w!=null&&w.current&&!S){let _=()=>{if(w.current){let I=it(w.current,{tabbable:!0});P(!!I.nextNode())}};_();let D=new MutationObserver(_);return D.observe(w.current,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabIndex","disabled"]}),()=>{D.disconnect()}}}),!S&&M})(t,{isDisabled:e.collection.size!==0}),y=ct(n,{labelable:!0}),j=ye(y,{role:"grid",id:p,"aria-multiselectable":e.selectionManager.selectionMode==="multiple"?"true":void 0},e.collection.size===0?{tabIndex:k?-1:0}:g,m);return s&&(j["aria-rowcount"]=e.collection.size,j["aria-colcount"]=1),(function(w,v){let{getRowText:S=$=>{var F,z,H,C;return(C=(F=(z=v.collection).getTextValue)===null||F===void 0?void 0:F.call(z,$))!==null&&C!==void 0?C:(H=v.collection.getItem($))===null||H===void 0?void 0:H.textValue}}=w,M=rt((P=kt)&&P.__esModule?P.default:P,"@react-aria/grid");var P;let _=v.selectionManager.rawSelection,D=b.useRef(_),I=st(()=>{var $;if(!v.selectionManager.isFocused||_===D.current)return void(D.current=_);let F=jl(_,D.current),z=jl(D.current,_),H=v.selectionManager.selectionBehavior==="replace",C=[];if(v.selectionManager.selectedKeys.size===1&&H){let A=v.selectionManager.selectedKeys.keys().next().value;if(A!=null&&v.collection.getItem(A)){let R=S(A);R&&C.push(M.format("selectedItem",{item:R}))}}else if(F.size===1&&z.size===0){let A=F.keys().next().value;if(A!=null){let R=S(A);R&&C.push(M.format("selectedItem",{item:R}))}}else if(z.size===1&&F.size===0){let A=z.keys().next().value;if(A!=null&&v.collection.getItem(A)){let R=S(A);R&&C.push(M.format("deselectedItem",{item:R}))}}v.selectionManager.selectionMode==="multiple"&&(C.length===0||_==="all"||_.size>1||D.current==="all"||(($=D.current)===null||$===void 0?void 0:$.size)>1)&&C.push(_==="all"?M.format("selectedAll"):M.format("selectedCount",{count:_.size})),C.length>0&&ds(C.join(" ")),D.current=_});us(()=>{if(!v.selectionManager.isFocused){let $=requestAnimationFrame(I);return()=>cancelAnimationFrame($)}I()},[_,v.selectionManager.isFocused])})({},e),{gridProps:j}}kt={"ar-AE":{deselectedItem:n=>`${n.item} \u063A\u064A\u0631 \u0627\u0644\u0645\u062D\u062F\u062F`,longPressToSelect:"\u0627\u0636\u063A\u0637 \u0645\u0637\u0648\u0644\u064B\u0627 \u0644\u0644\u062F\u062E\u0648\u0644 \u0625\u0644\u0649 \u0648\u0636\u0639 \u0627\u0644\u062A\u062D\u062F\u064A\u062F.",select:"\u062A\u062D\u062F\u064A\u062F",selectedAll:"\u062C\u0645\u064A\u0639 \u0627\u0644\u0639\u0646\u0627\u0635\u0631 \u0627\u0644\u0645\u062D\u062F\u062F\u0629.",selectedCount:(n,e)=>`${e.plural(n.count,{"=0":"\u0644\u0645 \u064A\u062A\u0645 \u062A\u062D\u062F\u064A\u062F \u0639\u0646\u0627\u0635\u0631",one:()=>`${e.number(n.count)} \u0639\u0646\u0635\u0631 \u0645\u062D\u062F\u062F`,other:()=>`${e.number(n.count)} \u0639\u0646\u0635\u0631 \u0645\u062D\u062F\u062F`})}.`,selectedItem:n=>`${n.item} \u0627\u0644\u0645\u062D\u062F\u062F`},"bg-BG":{deselectedItem:n=>`${n.item} \u043D\u0435 \u0435 \u0438\u0437\u0431\u0440\u0430\u043D.`,longPressToSelect:"\u041D\u0430\u0442\u0438\u0441\u043D\u0435\u0442\u0435 \u0438 \u0437\u0430\u0434\u0440\u044A\u0436\u0442\u0435 \u0437\u0430 \u0434\u0430 \u0432\u043B\u0435\u0437\u0435\u0442\u0435 \u0432 \u0438\u0437\u0431\u0438\u0440\u0430\u0442\u0435\u043B\u0435\u043D \u0440\u0435\u0436\u0438\u043C.",select:"\u0418\u0437\u0431\u0435\u0440\u0435\u0442\u0435",selectedAll:"\u0412\u0441\u0438\u0447\u043A\u0438 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438 \u0441\u0430 \u0438\u0437\u0431\u0440\u0430\u043D\u0438.",selectedCount:(n,e)=>`${e.plural(n.count,{"=0":"\u041D\u044F\u043C\u0430 \u0438\u0437\u0431\u0440\u0430\u043D\u0438 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438",one:()=>`${e.number(n.count)} \u0438\u0437\u0431\u0440\u0430\u043D \u0435\u043B\u0435\u043C\u0435\u043D\u0442`,other:()=>`${e.number(n.count)} \u0438\u0437\u0431\u0440\u0430\u043D\u0438 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438`})}.`,selectedItem:n=>`${n.item} \u0438\u0437\u0431\u0440\u0430\u043D.`},"cs-CZ":{deselectedItem:n=>`Polo\u017Eka ${n.item} nen\xED vybr\xE1na.`,longPressToSelect:"Dlouh\xFDm stisknut\xEDm p\u0159ejdete do re\u017Eimu v\xFDb\u011Bru.",select:"Vybrat",selectedAll:"Vybr\xE1ny v\u0161echny polo\u017Eky.",selectedCount:(n,e)=>`${e.plural(n.count,{"=0":"Nevybr\xE1ny \u017E\xE1dn\xE9 polo\u017Eky",one:()=>`Vybr\xE1na ${e.number(n.count)} polo\u017Eka`,other:()=>`Vybr\xE1no ${e.number(n.count)} polo\u017Eek`})}.`,selectedItem:n=>`Vybr\xE1na polo\u017Eka ${n.item}.`},"da-DK":{deselectedItem:n=>`${n.item} ikke valgt.`,longPressToSelect:"Lav et langt tryk for at aktivere valgtilstand.",select:"V\xE6lg",selectedAll:"Alle elementer valgt.",selectedCount:(n,e)=>`${e.plural(n.count,{"=0":"Ingen elementer valgt",one:()=>`${e.number(n.count)} element valgt`,other:()=>`${e.number(n.count)} elementer valgt`})}.`,selectedItem:n=>`${n.item} valgt.`},"de-DE":{deselectedItem:n=>`${n.item} nicht ausgew\xE4hlt.`,longPressToSelect:"Gedr\xFCckt halten, um Auswahlmodus zu \xF6ffnen.",select:"Ausw\xE4hlen",selectedAll:"Alle Elemente ausgew\xE4hlt.",selectedCount:(n,e)=>`${e.plural(n.count,{"=0":"Keine Elemente ausgew\xE4hlt",one:()=>`${e.number(n.count)} Element ausgew\xE4hlt`,other:()=>`${e.number(n.count)} Elemente ausgew\xE4hlt`})}.`,selectedItem:n=>`${n.item} ausgew\xE4hlt.`},"el-GR":{deselectedItem:n=>`\u0394\u03B5\u03BD \u03B5\u03C0\u03B9\u03BB\u03AD\u03C7\u03B8\u03B7\u03BA\u03B5 \u03C4\u03BF \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03BF ${n.item}.`,longPressToSelect:"\u03A0\u03B1\u03C4\u03AE\u03C3\u03C4\u03B5 \u03C0\u03B1\u03C1\u03B1\u03C4\u03B5\u03C4\u03B1\u03BC\u03AD\u03BD\u03B1 \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03BC\u03C0\u03B5\u03AF\u03C4\u03B5 \u03C3\u03B5 \u03BB\u03B5\u03B9\u03C4\u03BF\u03C5\u03C1\u03B3\u03AF\u03B1 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE\u03C2.",select:"\u0395\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE",selectedAll:"\u0395\u03C0\u03B9\u03BB\u03AD\u03C7\u03B8\u03B7\u03BA\u03B1\u03BD \u03CC\u03BB\u03B1 \u03C4\u03B1 \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1.",selectedCount:(n,e)=>`${e.plural(n.count,{"=0":"\u0394\u03B5\u03BD \u03B5\u03C0\u03B9\u03BB\u03AD\u03C7\u03B8\u03B7\u03BA\u03B1\u03BD \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",one:()=>`\u0395\u03C0\u03B9\u03BB\u03AD\u03C7\u03B8\u03B7\u03BA\u03B5 ${e.number(n.count)} \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03BF`,other:()=>`\u0395\u03C0\u03B9\u03BB\u03AD\u03C7\u03B8\u03B7\u03BA\u03B1\u03BD ${e.number(n.count)} \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1`})}.`,selectedItem:n=>`\u0395\u03C0\u03B9\u03BB\u03AD\u03C7\u03B8\u03B7\u03BA\u03B5 \u03C4\u03BF \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03BF ${n.item}.`},"en-US":{deselectedItem:n=>`${n.item} not selected.`,select:"Select",selectedCount:(n,e)=>`${e.plural(n.count,{"=0":"No items selected",one:()=>`${e.number(n.count)} item selected`,other:()=>`${e.number(n.count)} items selected`})}.`,selectedAll:"All items selected.",selectedItem:n=>`${n.item} selected.`,longPressToSelect:"Long press to enter selection mode."},"es-ES":{deselectedItem:n=>`${n.item} no seleccionado.`,longPressToSelect:"Mantenga pulsado para abrir el modo de selecci\xF3n.",select:"Seleccionar",selectedAll:"Todos los elementos seleccionados.",selectedCount:(n,e)=>`${e.plural(n.count,{"=0":"Ning\xFAn elemento seleccionado",one:()=>`${e.number(n.count)} elemento seleccionado`,other:()=>`${e.number(n.count)} elementos seleccionados`})}.`,selectedItem:n=>`${n.item} seleccionado.`},"et-EE":{deselectedItem:n=>`${n.item} pole valitud.`,longPressToSelect:"Valikure\u017Eiimi sisenemiseks vajutage pikalt.",select:"Vali",selectedAll:"K\xF5ik \xFCksused valitud.",selectedCount:(n,e)=>`${e.plural(n.count,{"=0":"\xDCksusi pole valitud",one:()=>`${e.number(n.count)} \xFCksus valitud`,other:()=>`${e.number(n.count)} \xFCksust valitud`})}.`,selectedItem:n=>`${n.item} valitud.`},"fi-FI":{deselectedItem:n=>`Kohdetta ${n.item} ei valittu.`,longPressToSelect:"Siirry valintatilaan painamalla pitk\xE4\xE4n.",select:"Valitse",selectedAll:"Kaikki kohteet valittu.",selectedCount:(n,e)=>`${e.plural(n.count,{"=0":"Ei yht\xE4\xE4n kohdetta valittu",one:()=>`${e.number(n.count)} kohde valittu`,other:()=>`${e.number(n.count)} kohdetta valittu`})}.`,selectedItem:n=>`${n.item} valittu.`},"fr-FR":{deselectedItem:n=>`${n.item} non s\xE9lectionn\xE9.`,longPressToSelect:"Appuyez de mani\xE8re prolong\xE9e pour passer en mode de s\xE9lection.",select:"S\xE9lectionner",selectedAll:"Tous les \xE9l\xE9ments s\xE9lectionn\xE9s.",selectedCount:(n,e)=>`${e.plural(n.count,{"=0":"Aucun \xE9l\xE9ment s\xE9lectionn\xE9",one:()=>`${e.number(n.count)} \xE9l\xE9ment s\xE9lectionn\xE9`,other:()=>`${e.number(n.count)} \xE9l\xE9ments s\xE9lectionn\xE9s`})}.`,selectedItem:n=>`${n.item} s\xE9lectionn\xE9.`},"he-IL":{deselectedItem:n=>`${n.item} \u05DC\u05D0 \u05E0\u05D1\u05D7\u05E8.`,longPressToSelect:"\u05D4\u05E7\u05E9\u05D4 \u05D0\u05E8\u05D5\u05DB\u05D4 \u05DC\u05DB\u05E0\u05D9\u05E1\u05D4 \u05DC\u05DE\u05E6\u05D1 \u05D1\u05D7\u05D9\u05E8\u05D4.",select:"\u05D1\u05D7\u05E8",selectedAll:"\u05DB\u05DC \u05D4\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD \u05E0\u05D1\u05D7\u05E8\u05D5.",selectedCount:(n,e)=>`${e.plural(n.count,{"=0":"\u05DC\u05D0 \u05E0\u05D1\u05D7\u05E8\u05D5 \u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",one:()=>`\u05E4\u05E8\u05D9\u05D8 ${e.number(n.count)} \u05E0\u05D1\u05D7\u05E8`,other:()=>`${e.number(n.count)} \u05E4\u05E8\u05D9\u05D8\u05D9\u05DD \u05E0\u05D1\u05D7\u05E8\u05D5`})}.`,selectedItem:n=>`${n.item} \u05E0\u05D1\u05D7\u05E8.`},"hr-HR":{deselectedItem:n=>`Stavka ${n.item} nije odabrana.`,longPressToSelect:"Dugo pritisnite za ulazak u na\u010Din odabira.",select:"Odaberite",selectedAll:"Odabrane su sve stavke.",selectedCount:(n,e)=>`${e.plural(n.count,{"=0":"Nije odabrana nijedna stavka",one:()=>`Odabrana je ${e.number(n.count)} stavka`,other:()=>`Odabrano je ${e.number(n.count)} stavki`})}.`,selectedItem:n=>`Stavka ${n.item} je odabrana.`},"hu-HU":{deselectedItem:n=>`${n.item} nincs kijel\xF6lve.`,longPressToSelect:"Nyomja hosszan a kijel\xF6l\xE9shez.",select:"Kijel\xF6l\xE9s",selectedAll:"Az \xF6sszes elem kijel\xF6lve.",selectedCount:(n,e)=>`${e.plural(n.count,{"=0":"Egy elem sincs kijel\xF6lve",one:()=>`${e.number(n.count)} elem kijel\xF6lve`,other:()=>`${e.number(n.count)} elem kijel\xF6lve`})}.`,selectedItem:n=>`${n.item} kijel\xF6lve.`},"it-IT":{deselectedItem:n=>`${n.item} non selezionato.`,longPressToSelect:"Premi a lungo per passare alla modalit\xE0 di selezione.",select:"Seleziona",selectedAll:"Tutti gli elementi selezionati.",selectedCount:(n,e)=>`${e.plural(n.count,{"=0":"Nessun elemento selezionato",one:()=>`${e.number(n.count)} elemento selezionato`,other:()=>`${e.number(n.count)} elementi selezionati`})}.`,selectedItem:n=>`${n.item} selezionato.`},"ja-JP":{deselectedItem:n=>`${n.item} \u304C\u9078\u629E\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002`,longPressToSelect:"\u9577\u62BC\u3057\u3057\u3066\u9078\u629E\u30E2\u30FC\u30C9\u3092\u958B\u304D\u307E\u3059\u3002",select:"\u9078\u629E",selectedAll:"\u3059\u3079\u3066\u306E\u9805\u76EE\u3092\u9078\u629E\u3057\u307E\u3057\u305F\u3002",selectedCount:(n,e)=>`${e.plural(n.count,{"=0":"\u9805\u76EE\u304C\u9078\u629E\u3055\u308C\u3066\u3044\u307E\u305B\u3093",one:()=>`${e.number(n.count)} \u9805\u76EE\u3092\u9078\u629E\u3057\u307E\u3057\u305F`,other:()=>`${e.number(n.count)} \u9805\u76EE\u3092\u9078\u629E\u3057\u307E\u3057\u305F`})}\u3002`,selectedItem:n=>`${n.item} \u3092\u9078\u629E\u3057\u307E\u3057\u305F\u3002`},"ko-KR":{deselectedItem:n=>`${n.item}\uC774(\uAC00) \uC120\uD0DD\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4.`,longPressToSelect:"\uC120\uD0DD \uBAA8\uB4DC\uB85C \uB4E4\uC5B4\uAC00\uB824\uBA74 \uAE38\uAC8C \uB204\uB974\uC2ED\uC2DC\uC624.",select:"\uC120\uD0DD",selectedAll:"\uBAA8\uB4E0 \uD56D\uBAA9\uC774 \uC120\uD0DD\uB418\uC5C8\uC2B5\uB2C8\uB2E4.",selectedCount:(n,e)=>`${e.plural(n.count,{"=0":"\uC120\uD0DD\uB41C \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4",one:()=>`${e.number(n.count)}\uAC1C \uD56D\uBAA9\uC774 \uC120\uD0DD\uB418\uC5C8\uC2B5\uB2C8\uB2E4`,other:()=>`${e.number(n.count)}\uAC1C \uD56D\uBAA9\uC774 \uC120\uD0DD\uB418\uC5C8\uC2B5\uB2C8\uB2E4`})}.`,selectedItem:n=>`${n.item}\uC774(\uAC00) \uC120\uD0DD\uB418\uC5C8\uC2B5\uB2C8\uB2E4.`},"lt-LT":{deselectedItem:n=>`${n.item} nepasirinkta.`,longPressToSelect:"Nor\u0117dami \u012Fjungti pasirinkimo re\u017Eim\u0105, paspauskite ir palaikykite.",select:"Pasirinkti",selectedAll:"Pasirinkti visi elementai.",selectedCount:(n,e)=>`${e.plural(n.count,{"=0":"Nepasirinktas n\u0117 vienas elementas",one:()=>`Pasirinktas ${e.number(n.count)} elementas`,other:()=>`Pasirinkta element\u0173: ${e.number(n.count)}`})}.`,selectedItem:n=>`Pasirinkta: ${n.item}.`},"lv-LV":{deselectedItem:n=>`Vienums ${n.item} nav atlas\u012Bts.`,longPressToSelect:"Ilgi turiet nospiestu. lai iesl\u0113gtu atlases re\u017E\u012Bmu.",select:"Atlas\u012Bt",selectedAll:"Atlas\u012Bti visi vienumi.",selectedCount:(n,e)=>`${e.plural(n.count,{"=0":"Nav atlas\u012Bts neviens vienums",one:()=>`Atlas\u012Bto vienumu skaits: ${e.number(n.count)}`,other:()=>`Atlas\u012Bto vienumu skaits: ${e.number(n.count)}`})}.`,selectedItem:n=>`Atlas\u012Bts vienums ${n.item}.`},"nb-NO":{deselectedItem:n=>`${n.item} er ikke valgt.`,longPressToSelect:"Bruk et langt trykk for \xE5 g\xE5 inn i valgmodus.",select:"Velg",selectedAll:"Alle elementer er valgt.",selectedCount:(n,e)=>`${e.plural(n.count,{"=0":"Ingen elementer er valgt",one:()=>`${e.number(n.count)} element er valgt`,other:()=>`${e.number(n.count)} elementer er valgt`})}.`,selectedItem:n=>`${n.item} er valgt.`},"nl-NL":{deselectedItem:n=>`${n.item} niet geselecteerd.`,longPressToSelect:"Druk lang om de selectiemodus te openen.",select:"Selecteren",selectedAll:"Alle items geselecteerd.",selectedCount:(n,e)=>`${e.plural(n.count,{"=0":"Geen items geselecteerd",one:()=>`${e.number(n.count)} item geselecteerd`,other:()=>`${e.number(n.count)} items geselecteerd`})}.`,selectedItem:n=>`${n.item} geselecteerd.`},"pl-PL":{deselectedItem:n=>`Nie zaznaczono ${n.item}.`,longPressToSelect:"Naci\u015Bnij i przytrzymaj, aby wej\u015B\u0107 do trybu wyboru.",select:"Zaznacz",selectedAll:"Wszystkie zaznaczone elementy.",selectedCount:(n,e)=>`${e.plural(n.count,{"=0":"Nie zaznaczono \u017Cadnych element\xF3w",one:()=>`${e.number(n.count)} zaznaczony element`,other:()=>`${e.number(n.count)} zaznaczonych element\xF3w`})}.`,selectedItem:n=>`Zaznaczono ${n.item}.`},"pt-BR":{deselectedItem:n=>`${n.item} n\xE3o selecionado.`,longPressToSelect:"Mantenha pressionado para entrar no modo de sele\xE7\xE3o.",select:"Selecionar",selectedAll:"Todos os itens selecionados.",selectedCount:(n,e)=>`${e.plural(n.count,{"=0":"Nenhum item selecionado",one:()=>`${e.number(n.count)} item selecionado`,other:()=>`${e.number(n.count)} itens selecionados`})}.`,selectedItem:n=>`${n.item} selecionado.`},"pt-PT":{deselectedItem:n=>`${n.item} n\xE3o selecionado.`,longPressToSelect:"Prima continuamente para entrar no modo de sele\xE7\xE3o.",select:"Selecionar",selectedAll:"Todos os itens selecionados.",selectedCount:(n,e)=>`${e.plural(n.count,{"=0":"Nenhum item selecionado",one:()=>`${e.number(n.count)} item selecionado`,other:()=>`${e.number(n.count)} itens selecionados`})}.`,selectedItem:n=>`${n.item} selecionado.`},"ro-RO":{deselectedItem:n=>`${n.item} neselectat.`,longPressToSelect:"Ap\u0103sa\u021Bi lung pentru a intra \xEEn modul de selectare.",select:"Selectare",selectedAll:"Toate elementele selectate.",selectedCount:(n,e)=>`${e.plural(n.count,{"=0":"Niciun element selectat",one:()=>`${e.number(n.count)} element selectat`,other:()=>`${e.number(n.count)} elemente selectate`})}.`,selectedItem:n=>`${n.item} selectat.`},"ru-RU":{deselectedItem:n=>`${n.item} \u043D\u0435 \u0432\u044B\u0431\u0440\u0430\u043D\u043E.`,longPressToSelect:"\u041D\u0430\u0436\u043C\u0438\u0442\u0435 \u0438 \u0443\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0439\u0442\u0435 \u0434\u043B\u044F \u0432\u0445\u043E\u0434\u0430 \u0432 \u0440\u0435\u0436\u0438\u043C \u0432\u044B\u0431\u043E\u0440\u0430.",select:"\u0412\u044B\u0431\u0440\u0430\u0442\u044C",selectedAll:"\u0412\u044B\u0431\u0440\u0430\u043D\u044B \u0432\u0441\u0435 \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B.",selectedCount:(n,e)=>`${e.plural(n.count,{"=0":"\u041D\u0435\u0442 \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0445 \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432",one:()=>`${e.number(n.count)} \u044D\u043B\u0435\u043C\u0435\u043D\u0442 \u0432\u044B\u0431\u0440\u0430\u043D`,other:()=>`${e.number(n.count)} \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432 \u0432\u044B\u0431\u0440\u0430\u043D\u043E`})}.`,selectedItem:n=>`${n.item} \u0432\u044B\u0431\u0440\u0430\u043D\u043E.`},"sk-SK":{deselectedItem:n=>`Nevybrat\xE9 polo\u017Eky: ${n.item}.`,longPressToSelect:"Dlh\u0161\xEDm stla\u010Den\xEDm prejdite do re\u017Eimu v\xFDberu.",select:"Vybra\u0165",selectedAll:"V\u0161etky vybrat\xE9 polo\u017Eky.",selectedCount:(n,e)=>`${e.plural(n.count,{"=0":"\u017Diadne vybrat\xE9 polo\u017Eky",one:()=>`${e.number(n.count)} vybrat\xE1 polo\u017Eka`,other:()=>`Po\u010Det vybrat\xFDch polo\u017Eiek:${e.number(n.count)}`})}.`,selectedItem:n=>`Vybrat\xE9 polo\u017Eky: ${n.item}.`},"sl-SI":{deselectedItem:n=>`Element ${n.item} ni izbran.`,longPressToSelect:"Za izbirni na\u010Din pritisnite in dlje \u010Dasa dr\u017Eite.",select:"Izberite",selectedAll:"Vsi elementi so izbrani.",selectedCount:(n,e)=>`${e.plural(n.count,{"=0":"Noben element ni izbran",one:()=>`${e.number(n.count)} element je izbran`,other:()=>`${e.number(n.count)} elementov je izbranih`})}.`,selectedItem:n=>`Element ${n.item} je izbran.`},"sr-SP":{deselectedItem:n=>`${n.item} nije izabrano.`,longPressToSelect:"Dugo pritisnite za ulazak u re\u017Eim biranja.",select:"Izaberite",selectedAll:"Izabrane su sve stavke.",selectedCount:(n,e)=>`${e.plural(n.count,{"=0":"Nije izabrana nijedna stavka",one:()=>`Izabrana je ${e.number(n.count)} stavka`,other:()=>`Izabrano je ${e.number(n.count)} stavki`})}.`,selectedItem:n=>`${n.item} je izabrano.`},"sv-SE":{deselectedItem:n=>`${n.item} ej markerat.`,longPressToSelect:"Tryck l\xE4nge n\xE4r du vill \xF6ppna v\xE4ljarl\xE4ge.",select:"Markera",selectedAll:"Alla markerade objekt.",selectedCount:(n,e)=>`${e.plural(n.count,{"=0":"Inga markerade objekt",one:()=>`${e.number(n.count)} markerat objekt`,other:()=>`${e.number(n.count)} markerade objekt`})}.`,selectedItem:n=>`${n.item} markerat.`},"tr-TR":{deselectedItem:n=>`${n.item} se\xE7ilmedi.`,longPressToSelect:"Se\xE7im moduna girmek i\xE7in uzun bas\u0131n.",select:"Se\xE7",selectedAll:"T\xFCm \xF6geler se\xE7ildi.",selectedCount:(n,e)=>`${e.plural(n.count,{"=0":"Hi\xE7bir \xF6ge se\xE7ilmedi",one:()=>`${e.number(n.count)} \xF6ge se\xE7ildi`,other:()=>`${e.number(n.count)} \xF6ge se\xE7ildi`})}.`,selectedItem:n=>`${n.item} se\xE7ildi.`},"uk-UA":{deselectedItem:n=>`${n.item} \u043D\u0435 \u0432\u0438\u0431\u0440\u0430\u043D\u043E.`,longPressToSelect:"\u0412\u0438\u043A\u043E\u043D\u0430\u0439\u0442\u0435 \u0434\u043E\u0432\u0433\u0435 \u043D\u0430\u0442\u0438\u0441\u043D\u0435\u043D\u043D\u044F, \u0449\u043E\u0431 \u043F\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 \u0440\u0435\u0436\u0438\u043C \u0432\u0438\u0431\u043E\u0440\u0443.",select:"\u0412\u0438\u0431\u0440\u0430\u0442\u0438",selectedAll:"\u0423\u0441\u0456 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438 \u0432\u0438\u0431\u0440\u0430\u043D\u043E.",selectedCount:(n,e)=>`${e.plural(n.count,{"=0":"\u0416\u043E\u0434\u043D\u0438\u0445 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432 \u043D\u0435 \u0432\u0438\u0431\u0440\u0430\u043D\u043E",one:()=>`${e.number(n.count)} \u0435\u043B\u0435\u043C\u0435\u043D\u0442 \u0432\u0438\u0431\u0440\u0430\u043D\u043E`,other:()=>`\u0412\u0438\u0431\u0440\u0430\u043D\u043E \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432: ${e.number(n.count)}`})}.`,selectedItem:n=>`${n.item} \u0432\u0438\u0431\u0440\u0430\u043D\u043E.`},"zh-CN":{deselectedItem:n=>`\u672A\u9009\u62E9 ${n.item}\u3002`,longPressToSelect:"\u957F\u6309\u4EE5\u8FDB\u5165\u9009\u62E9\u6A21\u5F0F\u3002",select:"\u9009\u62E9",selectedAll:"\u5DF2\u9009\u62E9\u6240\u6709\u9879\u76EE\u3002",selectedCount:(n,e)=>`${e.plural(n.count,{"=0":"\u672A\u9009\u62E9\u9879\u76EE",one:()=>`\u5DF2\u9009\u62E9 ${e.number(n.count)} \u4E2A\u9879\u76EE`,other:()=>`\u5DF2\u9009\u62E9 ${e.number(n.count)} \u4E2A\u9879\u76EE`})}\u3002`,selectedItem:n=>`\u5DF2\u9009\u62E9 ${n.item}\u3002`},"zh-TW":{deselectedItem:n=>`\u672A\u9078\u53D6\u300C${n.item}\u300D\u3002`,longPressToSelect:"\u9577\u6309\u4EE5\u9032\u5165\u9078\u64C7\u6A21\u5F0F\u3002",select:"\u9078\u53D6",selectedAll:"\u5DF2\u9078\u53D6\u6240\u6709\u9805\u76EE\u3002",selectedCount:(n,e)=>`${e.plural(n.count,{"=0":"\u672A\u9078\u53D6\u4EFB\u4F55\u9805\u76EE",one:()=>`\u5DF2\u9078\u53D6 ${e.number(n.count)} \u500B\u9805\u76EE`,other:()=>`\u5DF2\u9078\u53D6 ${e.number(n.count)} \u500B\u9805\u76EE`})}\u3002`,selectedItem:n=>`\u5DF2\u9078\u53D6\u300C${n.item}\u300D\u3002`}};const ba={ltr:"ArrowRight",rtl:"ArrowLeft"},ja={ltr:"ArrowLeft",rtl:"ArrowRight"};function kl(n){let e=null,t=null;do t=n.lastChild(),t&&(e=t);while(t);return e}function ka(n,e){let{key:t}=n;const{checkboxProps:s}=(function(i,a){let{key:o}=i,c=a.selectionManager,d=Ue(),u=!a.selectionManager.canSelectItem(o),r=a.selectionManager.isSelected(o);var h;return{checkboxProps:{id:d,"aria-label":rt((h=kt)&&h.__esModule?h.default:h,"@react-aria/grid").format("select"),isSelected:r,isDisabled:u,onChange:()=>c.toggleSelection(o)}}})(n,e);return{checkboxProps:{...s,"aria-labelledby":`${s.id} ${Gt(e,t)}`}}}var Cl;function wl(n,e,t){let{node:s}=n,i=(function(u,r,h){var g,p;let{node:m,isVirtualized:k}=u,{direction:y}=at(),{onAction:j,linkBehavior:w,keyboardNavigationBehavior:v,shouldSelectOnPressUp:S}=Wt.get(r),M=ms(),P=b.useRef(null),_={},D=u.hasChildItems,I=r.selectionManager.isLink(m.key);if(m!=null&&"expandedKeys"in r){var $,F;let f=($=(F=r.collection).getChildren)===null||$===void 0?void 0:$.call(F,m.key);D=D||[...f??[]].length>1,j==null&&!I&&r.selectionManager.selectionMode==="none"&&D&&(j=()=>r.toggleKey(m.key));let V=D?r.expandedKeys.has(m.key):void 0,B=1;if(m.level>0&&(m==null?void 0:m.parentKey)!=null){let L=r.collection.getItem(m.parentKey);var z,H;L&&(B=[...(z=(H=r.collection).getChildren)===null||z===void 0?void 0:z.call(H,L.key)].filter(W=>W.type==="item").length)}else B=[...r.collection].filter(L=>L.level===0&&L.type==="item").length;_={"aria-expanded":V,"aria-level":m.level+1,"aria-posinset":(m==null?void 0:m.index)+1,"aria-setsize":B}}let{itemProps:C,...A}=aa({selectionManager:r.selectionManager,key:m.key,ref:h,isVirtualized:k,shouldSelectOnPressUp:u.shouldSelectOnPressUp||S,onAction:j||!((g=m.props)===null||g===void 0)&&g.onAction?cn((p=m.props)===null||p===void 0?void 0:p.onAction,j?()=>j(m.key):void 0):void 0,focus:()=>{var f;h.current===null||(P.current==null||m.key===P.current)&&(!((f=h.current)===null||f===void 0)&&f.contains(document.activeElement))||be(h.current)},linkBehavior:w}),R=ps(m.props),q=A.hasAction?R:{},O=ye(C,q,{role:"row",onKeyDownCapture:f=>{if(!f.currentTarget.contains(f.target)||!h.current||!document.activeElement)return;let V=it(h.current);if(V.currentNode=document.activeElement,"expandedKeys"in r&&document.activeElement===h.current&&(f.key===ba[y]&&r.selectionManager.focusedKey===m.key&&D&&!r.expandedKeys.has(m.key)||f.key===ja[y]&&r.selectionManager.focusedKey===m.key&&D&&r.expandedKeys.has(m.key)))return r.toggleKey(m.key),void f.stopPropagation();switch(f.key){case"ArrowLeft":if(v==="arrow"){let L=y==="rtl"?V.nextNode():V.previousNode();if(L)f.preventDefault(),f.stopPropagation(),be(L),Ne(L,{containingElement:Ie(h.current)});else if(f.preventDefault(),f.stopPropagation(),y==="rtl")be(h.current),Ne(h.current,{containingElement:Ie(h.current)});else{V.currentNode=h.current;let W=kl(V);W&&(be(W),Ne(W,{containingElement:Ie(h.current)}))}}break;case"ArrowRight":if(v==="arrow"){let L=y==="rtl"?V.previousNode():V.nextNode();if(L)f.preventDefault(),f.stopPropagation(),be(L),Ne(L,{containingElement:Ie(h.current)});else if(f.preventDefault(),f.stopPropagation(),y==="ltr")be(h.current),Ne(h.current,{containingElement:Ie(h.current)});else{V.currentNode=h.current;let W=kl(V);W&&(be(W),Ne(W,{containingElement:Ie(h.current)}))}}break;case"ArrowUp":case"ArrowDown":var B;!f.altKey&&h.current.contains(f.target)&&(f.stopPropagation(),f.preventDefault(),(B=h.current.parentElement)===null||B===void 0||B.dispatchEvent(new KeyboardEvent(f.nativeEvent.type,f.nativeEvent)))}},onKeyDown:f=>{if(f.currentTarget.contains(f.target)&&h.current&&document.activeElement&&f.key==="Tab"&&v==="tab"){let V=it(h.current,{tabbable:!0});V.currentNode=document.activeElement,(f.shiftKey?V.previousNode():V.nextNode())&&f.stopPropagation()}},onFocus:f=>{P.current=m.key,f.target===h.current||gs()||r.selectionManager.setFocusedKey(m.key)},"aria-label":m.textValue||void 0,"aria-selected":r.selectionManager.canSelectItem(m.key)?r.selectionManager.isSelected(m.key):void 0,"aria-disabled":r.selectionManager.isDisabled(m.key)||void 0,"aria-labelledby":M&&m.textValue?`${Gt(r,m.key)} ${M}`:void 0,id:Gt(r,m.key)});if(k){let{collection:f}=r,V=[...f];O["aria-rowindex"]=V.find(B=>B.type==="section")?[...f.getKeys()].filter(B=>{var L;return((L=f.getItem(B))===null||L===void 0?void 0:L.type)!=="section"}).findIndex(B=>B===m.key)+1:m.index+1}return{rowProps:{...ye(O,_)},gridCellProps:{role:"gridcell","aria-colindex":1},descriptionProps:{id:M},...A}})(n,e,t),a=i.rowProps["aria-expanded"]===!0,o=rt((c=Cl)&&c.__esModule?c.default:c,"@react-aria/tree");var c;let d={onPress:()=>{i.isDisabled||(e.toggleKey(s.key),e.selectionManager.setFocused(!0),e.selectionManager.setFocusedKey(s.key))},excludeFromTabOrder:!0,preventFocusOnPress:!0,"data-react-aria-prevent-focus":!0,...fs({"aria-label":a?o.format("collapse"):o.format("expand"),"aria-labelledby":i.rowProps.id})};return{...i,expandButtonProps:d}}Cl={"ar-AE":{collapse:"\u0637\u064A",expand:"\u062A\u0645\u062F\u064A\u062F"},"bg-BG":{collapse:"\u0421\u0432\u0438\u0432\u0430\u043D\u0435",expand:"\u0420\u0430\u0437\u0448\u0438\u0440\u044F\u0432\u0430\u043D\u0435"},"cs-CZ":{collapse:"Sbalit",expand:"Rozt\xE1hnout"},"da-DK":{collapse:"Skjul",expand:"Udvid"},"de-DE":{collapse:"Reduzieren",expand:"Erweitern"},"el-GR":{collapse:"\u03A3\u03CD\u03BC\u03C0\u03C4\u03C5\u03BE\u03B7",expand:"\u0391\u03BD\u03AC\u03C0\u03C4\u03C5\u03BE\u03B7"},"en-US":{expand:"Expand",collapse:"Collapse"},"es-ES":{collapse:"Contraer",expand:"Ampliar"},"et-EE":{collapse:"Ahenda",expand:"Laienda"},"fi-FI":{collapse:"Pienenn\xE4",expand:"Laajenna"},"fr-FR":{collapse:"R\xE9duire",expand:"D\xE9velopper"},"he-IL":{collapse:"\u05DB\u05D5\u05D5\u05E5",expand:"\u05D4\u05E8\u05D7\u05D1"},"hr-HR":{collapse:"Sa\u017Emi",expand:"Pro\u0161iri"},"hu-HU":{collapse:"\xD6sszecsuk\xE1s",expand:"Kibont\xE1s"},"it-IT":{collapse:"Comprimi",expand:"Espandi"},"ja-JP":{collapse:"\u6298\u308A\u305F\u305F\u3080",expand:"\u5C55\u958B"},"ko-KR":{collapse:"\uC811\uAE30",expand:"\uD3BC\uCE58\uAE30"},"lt-LT":{collapse:"Sutraukti",expand:"I\u0161skleisti"},"lv-LV":{collapse:"Sak\u013Caut",expand:"Izv\u0113rst"},"nb-NO":{collapse:"Skjul",expand:"Utvid"},"nl-NL":{collapse:"Samenvouwen",expand:"Uitvouwen"},"pl-PL":{collapse:"Zwi\u0144",expand:"Rozwi\u0144"},"pt-BR":{collapse:"Recolher",expand:"Expandir"},"pt-PT":{collapse:"Colapsar",expand:"Expandir"},"ro-RO":{collapse:"Restr\xE2nge\u021Bi",expand:"Extinde\u021Bi"},"ru-RU":{collapse:"\u0421\u0432\u0435\u0440\u043D\u0443\u0442\u044C",expand:"\u0420\u0430\u0437\u0432\u0435\u0440\u043D\u0443\u0442\u044C"},"sk-SK":{collapse:"Zbali\u0165",expand:"Rozbali\u0165"},"sl-SI":{collapse:"Strni",expand:"Raz\u0161iri"},"sr-SP":{collapse:" Skupi",expand:"Pro\u0161iri"},"sv-SE":{collapse:"D\xF6lj",expand:"Expandera"},"tr-TR":{collapse:"Daralt",expand:"Geni\u015Flet"},"uk-UA":{collapse:"\u0417\u0433\u043E\u0440\u043D\u0443\u0442\u0438",expand:"\u0420\u043E\u0437\u0433\u043E\u0440\u043D\u0443\u0442\u0438"},"zh-CN":{collapse:"\u6298\u53E0",expand:"\u6269\u5C55"},"zh-TW":{collapse:"\u6536\u5408",expand:"\u5C55\u958B"}};class ve extends Set{constructor(e,t,s){super(e),e instanceof ve?(this.anchorKey=t??e.anchorKey,this.currentKey=s??e.currentKey):(this.anchorKey=t??null,this.currentKey=s??null)}}function Sl(n,e){return n?n==="all"?"all":new ve(n):e}class en{get selectionMode(){return this.state.selectionMode}get disallowEmptySelection(){return this.state.disallowEmptySelection}get selectionBehavior(){return this.state.selectionBehavior}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}get isFocused(){return this.state.isFocused}setFocused(e){this.state.setFocused(e)}get focusedKey(){return this.state.focusedKey}get childFocusStrategy(){return this.state.childFocusStrategy}setFocusedKey(e,t){(e==null||this.collection.getItem(e))&&this.state.setFocusedKey(e,t)}get selectedKeys(){return this.state.selectedKeys==="all"?new Set(this.getSelectAllKeys()):this.state.selectedKeys}get rawSelection(){return this.state.selectedKeys}isSelected(e){if(this.state.selectionMode==="none")return!1;let t=this.getKey(e);return t!=null&&(this.state.selectedKeys==="all"?this.canSelectItem(t):this.state.selectedKeys.has(t))}get isEmpty(){return this.state.selectedKeys!=="all"&&this.state.selectedKeys.size===0}get isSelectAll(){if(this.isEmpty)return!1;if(this.state.selectedKeys==="all")return!0;if(this._isSelectAll!=null)return this._isSelectAll;let e=this.getSelectAllKeys(),t=this.state.selectedKeys;return this._isSelectAll=e.every(s=>t.has(s)),this._isSelectAll}get firstSelectedKey(){let e=null;for(let s of this.state.selectedKeys){let i=this.collection.getItem(s);(!e||i&&Ot(this.collection,i,e)<0)&&(e=i)}var t;return(t=e==null?void 0:e.key)!==null&&t!==void 0?t:null}get lastSelectedKey(){let e=null;for(let s of this.state.selectedKeys){let i=this.collection.getItem(s);(!e||i&&Ot(this.collection,i,e)>0)&&(e=i)}var t;return(t=e==null?void 0:e.key)!==null&&t!==void 0?t:null}get disabledKeys(){return this.state.disabledKeys}get disabledBehavior(){return this.state.disabledBehavior}extendSelection(e){if(this.selectionMode==="none")return;if(this.selectionMode==="single")return void this.replaceSelection(e);let t,s=this.getKey(e);if(s!=null){if(this.state.selectedKeys==="all")t=new ve([s],s,s);else{let o=this.state.selectedKeys;var i;let c=(i=o.anchorKey)!==null&&i!==void 0?i:s;var a;t=new ve(o,c,s);for(let d of this.getKeyRange(c,(a=o.currentKey)!==null&&a!==void 0?a:s))t.delete(d);for(let d of this.getKeyRange(s,c))this.canSelectItem(d)&&t.add(d)}this.state.setSelectedKeys(t)}}getKeyRange(e,t){let s=this.collection.getItem(e),i=this.collection.getItem(t);return s&&i?Ot(this.collection,s,i)<=0?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){var s;if(!((s=this.layoutDelegate)===null||s===void 0)&&s.getKeyRange)return this.layoutDelegate.getKeyRange(e,t);let i=[],a=e;for(;a!=null;){let o=this.collection.getItem(a);if(o&&(o.type==="item"||o.type==="cell"&&this.allowsCellSelection)&&i.push(a),a===t)return i;a=this.collection.getKeyAfter(a)}return[]}getKey(e){let t=this.collection.getItem(e);if(!t||t.type==="cell"&&this.allowsCellSelection)return e;for(;t&&t.type!=="item"&&t.parentKey!=null;)t=this.collection.getItem(t.parentKey);return t&&t.type==="item"?t.key:null}toggleSelection(e){if(this.selectionMode==="none")return;if(this.selectionMode==="single"&&!this.isSelected(e))return void this.replaceSelection(e);let t=this.getKey(e);if(t==null)return;let s=new ve(this.state.selectedKeys==="all"?this.getSelectAllKeys():this.state.selectedKeys);s.has(t)?s.delete(t):this.canSelectItem(t)&&(s.add(t),s.anchorKey=t,s.currentKey=t),this.disallowEmptySelection&&s.size===0||this.state.setSelectedKeys(s)}replaceSelection(e){if(this.selectionMode==="none")return;let t=this.getKey(e);if(t==null)return;let s=this.canSelectItem(t)?new ve([t],t,t):new ve;this.state.setSelectedKeys(s)}setSelectedKeys(e){if(this.selectionMode==="none")return;let t=new ve;for(let s of e){let i=this.getKey(s);if(i!=null&&(t.add(i),this.selectionMode==="single"))break}this.state.setSelectedKeys(t)}getSelectAllKeys(){let e=[],t=s=>{for(;s!=null;){if(this.canSelectItem(s)){var i;let o=this.collection.getItem(s);var a;(o==null?void 0:o.type)==="item"&&e.push(s),o!=null&&o.hasChildNodes&&(this.allowsCellSelection||o.type!=="item")&&t((a=(i=da(ca(o,this.collection)))===null||i===void 0?void 0:i.key)!==null&&a!==void 0?a:null)}s=this.collection.getKeyAfter(s)}};return t(this.collection.getFirstKey()),e}selectAll(){this.isSelectAll||this.selectionMode!=="multiple"||this.state.setSelectedKeys("all")}clearSelection(){!this.disallowEmptySelection&&(this.state.selectedKeys==="all"||this.state.selectedKeys.size>0)&&this.state.setSelectedKeys(new ve)}toggleSelectAll(){this.isSelectAll?this.clearSelection():this.selectAll()}select(e,t){this.selectionMode!=="none"&&(this.selectionMode==="single"?this.isSelected(e)&&!this.disallowEmptySelection?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior==="toggle"||t&&(t.pointerType==="touch"||t.pointerType==="virtual")?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys)return!0;let t=this.selectedKeys;if(e.size!==t.size)return!1;for(let s of e)if(!t.has(s))return!1;for(let s of t)if(!e.has(s))return!1;return!0}canSelectItem(e){var t;if(this.state.selectionMode==="none"||this.state.disabledKeys.has(e))return!1;let s=this.collection.getItem(e);return!(!s||!(s==null||(t=s.props)===null||t===void 0)&&t.isDisabled||s.type==="cell"&&!this.allowsCellSelection)}isDisabled(e){var t,s;return this.state.disabledBehavior==="all"&&(this.state.disabledKeys.has(e)||!!(!((s=this.collection.getItem(e))===null||s===void 0||(t=s.props)===null||t===void 0)&&t.isDisabled))}isLink(e){var t,s;return!!(!((s=this.collection.getItem(e))===null||s===void 0||(t=s.props)===null||t===void 0)&&t.href)}getItemProps(e){var t;return(t=this.collection.getItem(e))===null||t===void 0?void 0:t.props}withCollection(e){return new en(e,this.state,{allowsCellSelection:this.allowsCellSelection,layoutDelegate:this.layoutDelegate||void 0})}constructor(e,t,s){var i;this.collection=e,this.state=t,this.allowsCellSelection=(i=s==null?void 0:s.allowsCellSelection)!==null&&i!==void 0&&i,this._isSelectAll=null,this.layoutDelegate=(s==null?void 0:s.layoutDelegate)||null}}class Ca{*[Symbol.iterator](){yield*this.iterable}get size(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){let t=this.keyMap.get(e);var s;return t&&(s=t.prevKey)!==null&&s!==void 0?s:null}getKeyAfter(e){let t=this.keyMap.get(e);var s;return t&&(s=t.nextKey)!==null&&s!==void 0?s:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){var t;return(t=this.keyMap.get(e))!==null&&t!==void 0?t:null}at(e){const t=[...this.getKeys()];return this.getItem(t[e])}constructor(e,{expandedKeys:t}={}){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.iterable=e,t=t||new Set;let s=c=>{if(this.keyMap.set(c.key,c),c.childNodes&&(c.type==="section"||t.has(c.key)))for(let d of c.childNodes)s(d)};for(let c of e)s(c);let i=null,a=0;for(let[c,d]of this.keyMap)i?(i.nextKey=c,d.prevKey=i.key):(this.firstKey=c,d.prevKey=void 0),d.type==="item"&&(d.index=a++),i=d,i.nextKey=void 0;var o;this.lastKey=(o=i==null?void 0:i.key)!==null&&o!==void 0?o:null}}function wa(n){let{onExpandedChange:e}=n,[t,s]=Pt(n.expandedKeys?new Set(n.expandedKeys):void 0,n.defaultExpandedKeys?new Set(n.defaultExpandedKeys):new Set,e),i=(function(c){let{selectionMode:d="none",disallowEmptySelection:u=!1,allowDuplicateSelectionEvents:r,selectionBehavior:h="toggle",disabledBehavior:g="all"}=c,p=b.useRef(!1),[,m]=b.useState(!1),k=b.useRef(null),y=b.useRef(null),[,j]=b.useState(null),w=b.useMemo(()=>Sl(c.selectedKeys),[c.selectedKeys]),v=b.useMemo(()=>Sl(c.defaultSelectedKeys,new ve),[c.defaultSelectedKeys]),[S,M]=Pt(w,v,c.onSelectionChange),P=b.useMemo(()=>c.disabledKeys?new Set(c.disabledKeys):new Set,[c.disabledKeys]),[_,D]=b.useState(h);h==="replace"&&_==="toggle"&&typeof S=="object"&&S.size===0&&D("replace");let I=b.useRef(h);return b.useEffect(()=>{h!==I.current&&(D(h),I.current=h)},[h]),{selectionMode:d,disallowEmptySelection:u,selectionBehavior:_,setSelectionBehavior:D,get isFocused(){return p.current},setFocused($){p.current=$,m($)},get focusedKey(){return k.current},get childFocusStrategy(){return y.current},setFocusedKey($,F="first"){k.current=$,y.current=F,j($)},selectedKeys:S,setSelectedKeys($){!r&&(function(F,z){if(F.size!==z.size)return!1;for(let H of F)if(!z.has(H))return!1;return!0})($,S)||M($)},disabledKeys:P,disabledBehavior:g}})(n),a=b.useMemo(()=>n.disabledKeys?new Set(n.disabledKeys):new Set,[n.disabledKeys]),o=(function(c,d,u){let r=b.useMemo(()=>new oa,[]),{children:h,items:g,collection:p}=c;return b.useMemo(()=>{if(p)return p;let m=r.build({children:h,items:g},u);return d(m)},[r,h,g,p,u,d])})(n,b.useCallback(c=>new Ca(c,{expandedKeys:t}),[t]),null);return b.useEffect(()=>{i.focusedKey==null||o.getItem(i.focusedKey)||i.setFocusedKey(null)},[o,i.focusedKey]),{collection:o,expandedKeys:t,disabledKeys:a,toggleKey:c=>{s((function(d,u){let r=new Set(d);return r.has(u)?r.delete(u):r.add(u),r})(t,c))},setExpandedKeys:s,selectionManager:new en(o,i)}}const Ct=b.createContext({}),Nl=b.createContext(null),Sa=b.forwardRef(function(n,e){let{render:t}=b.useContext(Nl);return E.createElement(E.Fragment,null,t(n,e))});function Na(n,e){var t;let s=n==null?void 0:n.renderDropIndicator,i=n==null||(t=n.isVirtualDragging)===null||t===void 0?void 0:t.call(n),a=b.useCallback(o=>{if(i||e!=null&&e.isDropTarget(o))return s?s(o):E.createElement(Sa,{target:o})},[e==null?void 0:e.target,i,s]);return n!=null&&n.useDropIndicator?a:void 0}function Ka(n,e,t){var s,i;let a=n.focusedKey,o=null;if(!(e==null||(s=e.isVirtualDragging)===null||s===void 0)&&s.call(e)&&(t==null||(i=t.target)===null||i===void 0?void 0:i.type)==="item"&&(o=t.target.key,t.target.dropPosition==="after")){let h=t.collection.getKeyAfter(o),g=null;if(h!=null){var c,d;let p=(d=(c=t.collection.getItem(o))===null||c===void 0?void 0:c.level)!==null&&d!==void 0?d:0;for(;h;){let m=t.collection.getItem(h);if(!m)break;if(m.type==="item"){var u;if(((u=m.level)!==null&&u!==void 0?u:0)<=p)break;g=h,h=t.collection.getKeyAfter(h)}else h=t.collection.getKeyAfter(h)}}var r;o=(r=h??g)!==null&&r!==void 0?r:o}return b.useMemo(()=>new Set([a,o].filter(h=>h!=null)),[a,o])}class Ia{setup(e,t,s){this.delegate=e,this.state=t,this.direction=s}getDropTargetFromPoint(e,t,s){let i=this.delegate.getDropTargetFromPoint(e,t,s);return i&&i.type!=="root"?this.resolveDropTarget(i,e,t,s):i}resolveDropTarget(e,t,s,i){let a=this.pointerTracking,o=s-a.lastY,c=t-a.lastX,d=a.yDirection,u=a.xDirection;if(Math.abs(o)>5&&(d=o>0?"down":"up",a.yDirection=d,a.lastY=s),Math.abs(c)>10&&(u=c>0?"right":"left",a.xDirection=u,a.lastX=t),e.dropPosition==="before"){let g=this.state.collection.getKeyBefore(e.key);if(g!=null){let p={type:"item",key:g,dropPosition:"after"};i(p)&&(e=p)}}let r,h=this.getPotentialTargets(e,i);return h.length===0?{type:"root"}:(h.length>1?r=this.selectTarget(h,e,t,s,d,u):(r=h[0],a.boundaryContext=null),r)}getPotentialTargets(e,t){if(e.dropPosition==="on")return[e];let s=e,i=this.state.collection,a=i.getItem(s.key);for(;a&&(a==null?void 0:a.type)!=="item"&&a.nextKey!=null;)s.key=a.nextKey,a=i.getItem(a.nextKey);let o=[s];if(a&&a.hasChildNodes&&this.state.expandedKeys.has(a.key)&&i.getChildren&&s.dropPosition==="after"){let u=null;for(let r of i.getChildren(a.key))if(r.type==="item"){u=r;break}if(u){const r={type:"item",key:u.key,dropPosition:"before"};return t(r)?[r]:[]}}if((a==null?void 0:a.nextKey)!=null)return[e];let c=a==null?void 0:a.parentKey,d=[];for(;c;){let u=i.getItem(c),r=u!=null&&u.nextKey?i.getItem(u.nextKey):null;if(!r||r.parentKey!==c){let h={type:"item",key:c,dropPosition:"after"};if(t(h)&&d.push(h),r)break}c=u==null?void 0:u.parentKey}if(d.length>0&&o.push(...d),o.length===1){let u=i.getKeyAfter(s.key),r=u?i.getItem(u):null;if(u!=null&&r&&a&&r.level!=null&&a.level!=null&&r.level>a.level){let h={type:"item",key:u,dropPosition:"before"};if(t(h))return[h]}}return o.filter(t)}selectTarget(e,t,s,i,a,o){if(e.length<2)return e[0];let c=this.pointerTracking,d=this.state.collection.getItem(t.key),u=d==null?void 0:d.parentKey;if(!u)return e[0];if(!c.boundaryContext||c.boundaryContext.parentKey!==u){let g=c.yDirection==="up"?e.length-1:0;c.boundaryContext={parentKey:u,preferredTargetIndex:g,lastSwitchY:i,lastSwitchX:s}}let r=c.boundaryContext,h=Math.abs(s-r.lastSwitchX);if(Math.abs(i-r.lastSwitchY)>5&&a){let g=r.preferredTargetIndex||0;a==="down"&&g===0?r.preferredTargetIndex=e.length-1:a==="up"&&g===e.length-1&&(r.preferredTargetIndex=0),c.xDirection=null}if(h>10&&o){let g=r.preferredTargetIndex||0;o==="left"?this.direction==="ltr"?g<e.length-1&&(r.preferredTargetIndex=g+1,r.lastSwitchX=s):g>0&&(r.preferredTargetIndex=g-1,r.lastSwitchX=s):o==="right"&&(this.direction==="ltr"?g>0&&(r.preferredTargetIndex=g-1,r.lastSwitchX=s):g<e.length-1&&(r.preferredTargetIndex=g+1,r.lastSwitchX=s)),c.yDirection=null}return e[Math.max(0,Math.min(r.preferredTargetIndex||0,e.length-1))]}constructor(){this.delegate=null,this.state=null,this.direction="ltr",this.pointerTracking={lastY:0,lastX:0,yDirection:null,xDirection:null,boundaryContext:null}}}class _a{*[Symbol.iterator](){yield*this.flattenedRows}get size(){return this.itemCount}getKeys(){return this.keyMap.keys()}getItem(e){return this.keyMap.get(e)||null}at(e){return this.flattenedRows[e]}getFirstKey(){var e;return(e=this.flattenedRows[0])===null||e===void 0?void 0:e.key}getLastKey(){var e;return(e=this.flattenedRows[this.flattenedRows.length-1])===null||e===void 0?void 0:e.key}getKeyAfter(e){var t;let s=this.flattenedRows.findIndex(i=>i.key===e);return(t=this.flattenedRows[s+1])===null||t===void 0?void 0:t.key}getKeyBefore(e){var t;let s=this.flattenedRows.findIndex(i=>i.key===e);return(t=this.flattenedRows[s-1])===null||t===void 0?void 0:t.key}getChildren(e){let t=this.keyMap;return{*[Symbol.iterator](){let s=t.get(e),i=(s==null?void 0:s.firstChildKey)!=null?t.get(s.firstChildKey):null;for(;i;)yield i,i=i.nextKey!=null?t.get(i.nextKey):void 0}}}getTextValue(e){let t=this.getItem(e);return t?t.textValue:""}constructor(e){this.keyMap=new Map,this.itemCount=0;let{collection:t,expandedKeys:s}=e,{flattenedRows:i,keyMap:a,itemCount:o}=(function(c,d){let{expandedKeys:u=new Set}=d,r=new Map,h=[],g=0,p=m=>{if(m.type==="item"||m.type==="loader"){let k=m==null?void 0:m.parentKey,y={...m};k!=null?([...c.getChildren(k)][0].type!=="item"&&(y.index=(m==null?void 0:m.index)!=null?(m==null?void 0:m.index)-1:0),m.type==="loader"&&(y.level=m.level+1),r.set(y.key,y)):r.set(m.key,m);let j=r.get(m.key)||m;(j.level===0||j.parentKey!=null&&u.has(j.parentKey)&&h.find(w=>w.key===j.parentKey))&&(j.type==="item"&&g++,h.push(j))}else m.type!==null&&r.set(m.key,m);for(let k of c.getChildren(m.key))p(k)};for(let m of c)p(m);return{flattenedRows:h,keyMap:r,itemCount:g}})(t,{expandedKeys:s});this.flattenedRows=i,this.keyMap=a,this.itemCount=o}}const Da=b.createContext(null),Yt=b.createContext(null),Ma=b.forwardRef(function(n,e){return[n,e]=xs(n,e,Da),E.createElement(ma,{content:E.createElement(xa,n)},t=>E.createElement(Pa,{props:n,collection:t,treeRef:e}))}),Kl={expand:{ltr:"ArrowRight",rtl:"ArrowLeft"},collapse:{ltr:"ArrowLeft",rtl:"ArrowRight"}};function Pa({props:n,collection:e,treeRef:t}){const{dragAndDropHooks:s}=n;let{direction:i}=at(),a=un({usage:"search",sensitivity:"base"}),o=!!(s!=null&&s.useDraggableCollectionState),c=!!(s!=null&&s.useDroppableCollectionState),d=b.useRef(o),u=b.useRef(c);b.useEffect(()=>{d.current!==o&&console.warn("Drag hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior."),u.current!==c&&console.warn("Drop hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.")},[o,c]);let r,h,g,{selectionMode:p="none",expandedKeys:m,defaultExpandedKeys:k,onExpandedChange:y,disabledBehavior:j="all"}=n,{CollectionRoot:w,isVirtualized:v,layoutDelegate:S,dropTargetDelegate:M}=b.useContext(Ut),[P,_]=Pt(m?Al(m):void 0,k?Al(k):new Set,y),D=b.useMemo(()=>new _a({collection:e,expandedKeys:P}),[e,P]),I=wa({...n,selectionMode:p,expandedKeys:P,onExpandedChange:_,collection:D,children:void 0,disabledBehavior:j}),{gridProps:$}=(function(W,K,x){let{gridProps:N}=va(W,K,x);return N.role="treegrid",{gridProps:N}})({...n,isVirtualized:v,layoutDelegate:S},I,t),F=!1,z=null,H=b.useRef(null);if(o&&s){r=s.useDraggableCollectionState({collection:I.collection,selectionManager:I.selectionManager,preview:s.renderDragPreview?H:void 0}),s.useDraggableCollection({},r,t);let W=s.DragPreview;z=s.renderDragPreview?E.createElement(W,{ref:H},s.renderDragPreview):null}let[C]=b.useState(()=>new Ia);if(c&&s){h=s.useDroppableCollectionState({collection:I.collection,selectionManager:I.selectionManager});let W=s.dropTargetDelegate||M||new s.ListDropTargetDelegate(I.collection,t,{direction:i});C.setup(W,I,i);let K=new ol({collection:I.collection,collator:a,ref:t,disabledKeys:I.selectionManager.disabledKeys,disabledBehavior:I.selectionManager.disabledBehavior,direction:i,layoutDelegate:S});g=s.useDroppableCollection({keyboardDelegate:K,dropTargetDelegate:C,onDropActivate:N=>{if(N.target.type==="item"){var le;let se=N.target.key,T=I.collection.getItem(se),ie=P!=="all"&&P.has(se);T&&T.hasChildNodes&&(!ie||!(s==null||(le=s.isVirtualDragging)===null||le===void 0)&&le.call(s))&&I.toggleKey(se)}},onKeyDown:N=>{let le=h==null?void 0:h.target;if(le&&le.type==="item"&&le.dropPosition==="on"){let se=I.collection.getItem(le.key);(N.key===Kl.expand[i]&&(se!=null&&se.hasChildNodes)&&!I.expandedKeys.has(le.key)||N.key===Kl.collapse[i]&&(se!=null&&se.hasChildNodes)&&I.expandedKeys.has(le.key))&&I.toggleKey(le.key)}}},h,t);let x=h.getDropOperation;h.getDropOperation=N=>{let{target:le,isInternal:se}=N;var T;let ie=(T=r==null?void 0:r.draggingKeys)!==null&&T!==void 0?T:new Set;if(se&&le.type==="item"&&ie.size>0){if(ie.has(le.key)&&le.dropPosition==="on")return"cancel";let Z=le.key;for(;Z!=null;){let oe=I.collection.getItem(Z),he=oe==null?void 0:oe.parentKey;if(he!=null&&ie.has(he))return"cancel";Z=he??null}}return x(N)},F=h.isDropTarget({type:"root"})}let A=!(!o||r!=null&&r.isDisabled),{focusProps:R,isFocused:q,isFocusVisible:O}=At(),f={isEmpty:I.collection.size===0,isFocused:q,isFocusVisible:O,isDropTarget:F,selectionMode:I.selectionManager.selectionMode,allowsDragging:!!A,state:I},V=We({className:n.className,style:n.style,defaultClassName:"react-aria-Tree",values:f}),B=null;if(I.collection.size===0&&n.renderEmptyState){let{isEmpty:W,...K}=f,x=n.renderEmptyState({...K}),N={"aria-level":1};B=E.createElement("div",{role:"row",style:{display:"contents"},...N},E.createElement("div",{role:"gridcell",style:{display:"contents"}},x))}let L=ct(n,{global:!0});return E.createElement(E.Fragment,null,E.createElement(ys,null,E.createElement("div",{...ye(L,V,$,R,g==null?void 0:g.collectionProps),ref:t,slot:n.slot||void 0,"data-empty":I.collection.size===0||void 0,"data-focused":q||void 0,"data-drop-target":F||void 0,"data-focus-visible":O||void 0,"data-selection-mode":I.selectionManager.selectionMode==="none"?void 0:I.selectionManager.selectionMode,"data-allows-dragging":!!A||void 0},E.createElement(pn,{values:[[Yt,I],[Ct,{dragAndDropHooks:s,dragState:r,dropState:h}],[Nl,{render:Aa}]]},c&&E.createElement($a,null),E.createElement(w,{collection:I.collection,persistedKeys:Ka(I.selectionManager,s,h),scrollRef:t,renderDropIndicator:Na(s,h)})),B)),z)}class Il extends Be{}Il.type="content";const _l=fl(Il,function(n){let e=b.useContext(Dl),t=We({children:n.children,values:e});return E.createElement(Ut.Provider,{value:vl},t.children)}),Dl=b.createContext(null);class Ml extends Be{}Ml.type="item";const Pl=fa(Ml,(n,e,t)=>{var s;let i=b.useContext(Yt);e=Et(e);let{dragAndDropHooks:a,dragState:o,dropState:c}=b.useContext(Ct),{rowProps:d,gridCellProps:u,expandButtonProps:r,descriptionProps:h,...g}=wl({node:t,shouldSelectOnPressUp:!!o},i,e),p=d["aria-expanded"]===!0,m=n.hasChildItems||((s=[...i.collection.getChildren(t.key)])===null||s===void 0?void 0:s.length)>1,k=d["aria-level"]||1,{hoverProps:y,isHovered:j}=vs({isDisabled:!g.allowsSelection&&!g.hasAction,onHoverStart:n.onHoverStart,onHoverChange:n.onHoverChange,onHoverEnd:n.onHoverEnd}),{isFocusVisible:w,focusProps:v}=At(),{isFocusVisible:S,focusProps:M}=At({within:!0}),{checkboxProps:P}=ka({key:t.key},i),_=null;o&&a&&(_=a.useDraggableItem({key:t.key,hasDragButton:!0},o));let D=null,I=b.useRef(null),$=b.useRef(null),F=b.useRef(null),{visuallyHiddenProps:z}=Tt();c&&a&&(D=a.useDropIndicator({target:{type:"item",key:t.key,dropPosition:"on"},activateButtonRef:F},c,$));let H=o&&o.isDragging(t.key),C=D==null?void 0:D.isDropTarget,A=i.selectionManager.selectionMode,R=i.selectionManager.selectionBehavior,q=E.useMemo(()=>({...g,isHovered:j,isFocusVisible:w,isExpanded:p,hasChildItems:m,level:k,selectionMode:A,selectionBehavior:R,isFocusVisibleWithin:S,state:i,id:t.key,allowsDragging:!!o,isDragging:H,isDropTarget:C}),[g,j,w,p,m,k,S,i,t.key,o,H,C,R,A]),O=We({...n,id:void 0,children:t.rendered,defaultClassName:"react-aria-TreeItem",defaultStyle:{"--tree-item-level":k},values:q});b.useEffect(()=>{t.textValue},[t.textValue]),b.useEffect(()=>{m&&I.current},[]);let f=b.useRef(null);b.useEffect(()=>{o&&f.current},[]);let V=qt({items:i.collection.getChildren(t.key),children:W=>{switch(W.type){case"content":return W.render(W);case"loader":case"item":return E.createElement(E.Fragment,null);default:throw new Error("Unsupported element type in TreeRow: "+W.type)}}}),B=Ue(),L=ct(n,{global:!0});return delete L.id,delete L.onClick,E.createElement(E.Fragment,null,D&&!D.isHidden&&E.createElement("div",{role:"row","aria-level":d["aria-level"],"aria-expanded":d["aria-expanded"],"aria-label":D.dropIndicatorProps["aria-label"]},E.createElement("div",{role:"gridcell","aria-colindex":1,style:{display:"contents"}},E.createElement("div",{role:"button",...z,...D.dropIndicatorProps,ref:$}),d["aria-expanded"]!=null?E.createElement("div",{role:"button",...z,id:B,"aria-label":r["aria-label"],"aria-labelledby":`${B} ${d.id}`,tabIndex:-1,ref:F}):null)),E.createElement("div",{...ye(L,d,v,y,M,_==null?void 0:_.dragProps),...O,ref:e,"data-expanded":m&&p||void 0,"data-has-child-items":m||void 0,"data-level":k,"data-selected":g.isSelected||void 0,"data-disabled":g.isDisabled||void 0,"data-hovered":j||void 0,"data-focused":g.isFocused||void 0,"data-focus-visible":w||void 0,"data-pressed":g.isPressed||void 0,"data-selection-mode":i.selectionManager.selectionMode==="none"?void 0:i.selectionManager.selectionMode,"data-allows-dragging":!!o||void 0,"data-dragging":H||void 0,"data-drop-target":C||void 0},E.createElement("div",{...u,style:{display:"contents"}},E.createElement(pn,{values:[[bs,{slots:{selection:P}}],[js,{slots:{[ks]:{},chevron:{...r,ref:I},drag:{..._==null?void 0:_.dragButtonProps,ref:f,style:{pointerEvents:"none"}}}}],[Dl,{...q}]]},V))))});function Al(n){return n?n==="all"?"all":new Set(n):new Set}function Aa(n,e){var t;e=Et(e);let{dragAndDropHooks:s,dropState:i}=b.useContext(Ct),a=b.useRef(null),{dropIndicatorProps:o,isHidden:c,isDropTarget:d}=s.useDropIndicator(n,i,a);if(c)return null;let u=i&&n.target.type==="item"?(((t=i.collection.getItem(n.target.key))===null||t===void 0?void 0:t.level)||0)+1:1;return E.createElement(Ta,{...n,dropIndicatorProps:o,isDropTarget:d,ref:e,buttonRef:a,level:u})}function Ea(n,e){let{dropIndicatorProps:t,isDropTarget:s,buttonRef:i,level:a,...o}=n,{visuallyHiddenProps:c}=Tt(),d=We({...o,defaultClassName:"react-aria-DropIndicator",defaultStyle:{position:"relative","--tree-item-level":a},values:{isDropTarget:s}});return E.createElement("div",{...d,role:"row","aria-level":a,ref:e,"data-drop-target":s||void 0},E.createElement("div",{role:"gridcell"},E.createElement("div",{...c,role:"button",...t,ref:i}),d.children))}fl(ul,function(n,e,t){let{isVirtualized:s}=b.useContext(Ut),i=b.useContext(Yt),{isLoading:a,onLoadMore:o,scrollOffset:c,...d}=n,u=b.useRef(null);(function(y,j){let{collection:w,onLoadMore:v,scrollOffset:S=1}=y,M=b.useRef(null),P=st(_=>{for(let D of _)D.isIntersecting&&v&&v()});He(()=>(j.current&&(M.current=new IntersectionObserver(P,{root:Ie(j==null?void 0:j.current),rootMargin:`0px ${100*S}% ${100*S}% ${100*S}%`}),M.current.observe(j.current)),()=>{M.current&&M.current.disconnect()}),[w,P,j,S])})(b.useMemo(()=>({onLoadMore:o,collection:i==null?void 0:i.collection,sentinelRef:u,scrollOffset:c}),[o,c,i==null?void 0:i.collection]),u),e=Et(e);let{rowProps:r,gridCellProps:h}=wl({node:t},i,e),g=r["aria-level"]||1,p={role:"row","aria-level":r["aria-level"]},m=We({...d,id:void 0,children:t.rendered,defaultClassName:"react-aria-TreeLoader",values:{level:g}}),k={};return s&&(k={display:"contents"}),E.createElement(E.Fragment,null,E.createElement("div",{style:{position:"relative",width:0,height:0},inert:la(!0)},E.createElement("div",{"data-testid":"loadMoreSentinel",ref:u,style:{position:"absolute",height:1,width:1}})),a&&m.children&&E.createElement("div",{ref:e,...ye(ct(n),p),...m,"data-level":g},E.createElement("div",{...h,style:k},m.children)))});const Ta=b.forwardRef(Ea);function $a(){let{dragAndDropHooks:n,dropState:e}=b.useContext(Ct),t=b.useRef(null),{dropIndicatorProps:s}=n.useDropIndicator({target:{type:"root"}},e,t),i=e.isDropTarget({type:"root"}),{visuallyHiddenProps:a}=Tt();return!i&&s["aria-hidden"]?null:E.createElement("div",{role:"row","aria-hidden":s["aria-hidden"],style:{position:"absolute"}},E.createElement("div",{role:"gridcell"},E.createElement("div",{role:"button",...a,...s,ref:t})))}function za(n,e){const t=te.c(11),{delayMs:s,whenVisible:i,disabled:a}=e,o=a!==void 0&&a,c=b.useRef(void 0);let d,u,r,h,g;return t[0]!==n?(d=()=>{c.current=n},u=[n],t[0]=n,t[1]=d,t[2]=u):(d=t[1],u=t[2]),b.useEffect(d,u),t[3]!==s||t[4]!==o||t[5]!==i?(r=()=>{if(s===null||o)return;const p=setInterval(()=>{var m;i&&document.visibilityState!=="visible"||((m=c.current)==null||m.call(c))},s);return()=>clearInterval(p)},h=[s,i,o],t[3]=s,t[4]=o,t[5]=i,t[6]=r,t[7]=h):(r=t[6],h=t[7]),b.useEffect(r,h),t[8]!==o||t[9]!==i?(g=()=>{var p;document.visibilityState==="visible"&&i&&!o&&((p=c.current)==null||p.call(c))},t[8]=o,t[9]=i,t[10]=g):g=t[10],Cs(document,"visibilitychange",g),null}function Fa(){return["compact","medium","full","columns"]}const Ra=n=>{const e=te.c(2),{children:t}=n;let s;return e[0]!==t?(s=l.jsx("div",{className:"text-md font-semibold text-muted-foreground uppercase tracking-wide mb-1",children:t}),e[0]=t,e[1]=s):s=e[1],s},wt=n=>{const e=te.c(10);let t,s,i,a,o;return e[0]!==n?({children:t,className:s,...i}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=i):(t=e[1],s=e[2],i=e[3]),e[4]!==s?(a=_e("text-base font-semibold underline-offset-2 text-accent-foreground uppercase tracking-wide",s),e[4]=s,e[5]=a):a=e[5],e[6]!==t||e[7]!==i||e[8]!==a?(o=l.jsx("div",{...i,className:a,children:t}),e[6]=t,e[7]=i,e[8]=a,e[9]=o):o=e[9],o},Va=n=>{const e=te.c(2),{children:t}=n;let s;return e[0]!==t?(s=l.jsx("p",{className:"text-sm text-muted-foreground",children:t}),e[0]=t,e[1]=s):s=e[1],s},El=[{label:"Auto (Default)",value:"auto"},{label:"Native",value:"native"},{label:"Polars",value:"polars"},{label:"Lazy Polars",value:"lazy-polars"},{label:"Pandas",value:"pandas"}],La=()=>{const n=te.c(37),[e,t]=ws(),{saveAppConfig:s}=Fe(),i=b.useId(),a=b.useId();let o,c;n[0]===Symbol.for("react.memo_cache_sentinel")?(o=gn(Ss),n[0]=o):o=n[0],n[1]!==e?(c={resolver:o,defaultValues:e},n[1]=e,n[2]=c):c=n[2];const d=fn(c);let u;n[3]!==s||n[4]!==t?(u=async D=>{await s({config:D}).then(()=>{t(D)}).catch(()=>{t(D)})},n[3]=s,n[4]=t,n[5]=u):u=n[5];const r=u;let h;n[6]!==r?(h=D=>{r(D)},n[6]=r,n[7]=h):h=n[7];const g=xn(h,100);let p,m,k,y,j,w,v,S,M,P,_;return n[8]!==e.width?(p=[e.width],n[8]=e.width,n[9]=p):p=n[9],b.useEffect(Ba,p),n[10]!==g||n[11]!==d?(m=d.handleSubmit(g),n[10]=g,n[11]=d,n[12]=m):m=n[12],n[13]===Symbol.for("react.memo_cache_sentinel")?(k=l.jsxs("div",{children:[l.jsx(Ra,{children:"Notebook Settings"}),l.jsx(Va,{children:"Configure how your notebook or application looks and behaves."})]}),n[13]=k):k=n[13],n[14]!==d.control?(y=l.jsxs(St,{title:"Display",children:[l.jsx(G,{control:d.control,name:"width",render:qa}),l.jsx(G,{control:d.control,name:"app_title",render:Ha})]}),n[14]=d.control,n[15]=y):y=n[15],n[16]!==d.control?(j=l.jsxs(St,{title:"Custom Files",children:[l.jsx(G,{control:d.control,name:"css_file",render:Ua}),l.jsx(G,{control:d.control,name:"html_head_file",render:Wa})]}),n[16]=d.control,n[17]=j):j=n[17],n[18]!==d.control?(w=l.jsx(St,{title:"Data",children:l.jsx(G,{control:d.control,name:"sql_output",render:Ya})}),n[18]=d.control,n[19]=w):w=n[19],n[20]!==i||n[21]!==a?(v=D=>{const{field:I}=D;return l.jsxs("div",{className:"flex flex-col gap-y-1",children:[l.jsxs(Y,{className:"flex flex-col gap-2",children:[l.jsx(Q,{children:l.jsxs("div",{className:"flex gap-4",children:[l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(ce,{id:i,"data-testid":"html-checkbox",checked:I.value.includes("html"),onCheckedChange:()=>{I.onChange(dt(I.value,"html"))}}),l.jsx(U,{htmlFor:i,children:"HTML"})]}),l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(ce,{id:a,"data-testid":"ipynb-checkbox",checked:I.value.includes("ipynb"),onCheckedChange:()=>{I.onChange(dt(I.value,"ipynb"))}}),l.jsx(U,{htmlFor:a,children:"IPYNB"})]})]})}),l.jsx(X,{})]}),l.jsxs(J,{children:["When enabled, marimo will periodically save this notebook in your selected formats (HTML, IPYNB) to a folder named"," ",l.jsx(re,{className:"inline",children:"__marimo__"})," next to your notebook file."]})]})},n[20]=i,n[21]=a,n[22]=v):v=n[22],n[23]!==d.control||n[24]!==v?(S=l.jsx(St,{title:"Exporting outputs",children:l.jsx(G,{control:d.control,name:"auto_download",render:v})}),n[23]=d.control,n[24]=v,n[25]=S):S=n[25],n[26]!==S||n[27]!==y||n[28]!==j||n[29]!==w?(M=l.jsxs("div",{className:"grid grid-cols-2 gap-x-8 gap-y-4",children:[y,j,w,S]}),n[26]=S,n[27]=y,n[28]=j,n[29]=w,n[30]=M):M=n[30],n[31]!==M||n[32]!==m?(P=l.jsxs("form",{onChange:m,className:"flex flex-col gap-6",children:[k,M]}),n[31]=M,n[32]=m,n[33]=P):P=n[33],n[34]!==d||n[35]!==P?(_=l.jsx(yn,{...d,children:P}),n[34]=d,n[35]=P,n[36]=_):_=n[36],_},St=n=>{const e=te.c(5),{title:t,children:s}=n;let i,a;return e[0]!==t?(i=l.jsx("h3",{className:"text-base font-semibold mb-1",children:t}),e[0]=t,e[1]=i):i=e[1],e[2]!==s||e[3]!==i?(a=l.jsxs("div",{className:"flex flex-col gap-y-2",children:[i,s]}),e[2]=s,e[3]=i,e[4]=a):a=e[4],a};function Ba(){window.dispatchEvent(new Event("resize"))}function Oa(n){return l.jsx("option",{value:n,children:n},n)}function qa(n){const{field:e}=n;return l.jsxs(Y,{className:"flex flex-row items-center space-x-1 space-y-0",children:[l.jsx(U,{children:"Width"}),l.jsx(Q,{children:l.jsx(ge,{"data-testid":"app-width-select",onChange:t=>e.onChange(t.target.value),value:e.value,disabled:e.disabled,className:"inline-flex mr-2",children:["compact","medium","full","columns"].map(Oa)})}),l.jsx(X,{})]})}function Ha(n){const{field:e}=n;return l.jsxs("div",{className:"flex flex-col gap-y-1",children:[l.jsxs(Y,{className:"flex flex-row items-center space-x-1 space-y-0",children:[l.jsx(U,{children:"App title"}),l.jsx(Q,{children:l.jsx(je,{...e,value:e.value??"",onChange:t=>{e.onChange(t.target.value),vn.safeParse(t.target.value).success&&(document.title=t.target.value)}})}),l.jsx(X,{})]}),l.jsx(J,{children:"The application title is put in the title tag in the HTML code and typically displayed in the title bar of the browser window."})]})}function Ua(n){const{field:e}=n;return l.jsxs("div",{className:"flex flex-col gap-y-1",children:[l.jsxs(Y,{className:"flex flex-row items-center space-x-1 space-y-0",children:[l.jsx(U,{className:"shrink-0",children:"Custom CSS"}),l.jsx(Q,{children:l.jsx(je,{...e,value:e.value??"",placeholder:"custom.css",onChange:t=>{e.onChange(t.target.value),vn.safeParse(t.target.value).success&&(document.title=t.target.value)}})}),l.jsx(X,{})]}),l.jsx(J,{children:"A filepath to a custom css file to be injected into the notebook."})]})}function Wa(n){const{field:e}=n;return l.jsxs("div",{className:"flex flex-col gap-y-1",children:[l.jsxs(Y,{className:"flex flex-row items-center space-x-1 space-y-0",children:[l.jsx(U,{className:"shrink-0",children:"HTML Head"}),l.jsx(Q,{children:l.jsx(je,{...e,value:e.value??"",placeholder:"head.html",onChange:t=>{e.onChange(t.target.value)}})}),l.jsx(X,{})]}),l.jsxs(J,{children:["A filepath to an HTML file to be injected into the"," ",l.jsx(re,{className:"inline",children:"<head/>"})," section of the notebook. Use this to add analytics, custom fonts, meta tags, or external scripts."]})]})}function Ga(n){return l.jsx("option",{value:n.value,children:n.label},n.value)}function Ya(n){const{field:e}=n;return l.jsxs("div",{className:"flex flex-col gap-y-1",children:[l.jsxs(Y,{className:"flex flex-row items-center space-x-1 space-y-0",children:[l.jsx(U,{children:"SQL Output Type"}),l.jsx(Q,{children:l.jsx(ge,{"data-testid":"sql-output-select",onChange:t=>{e.onChange(t.target.value),Re({title:"Kernel Restart Required",description:"This change requires a kernel restart to take effect."})},value:e.value,disabled:e.disabled,className:"inline-flex mr-2",children:El.map(Ga)})}),l.jsx(X,{})]}),l.jsxs(J,{children:["The Python type returned by a SQL cell. For best performance with large datasets, we recommend using"," ",l.jsx(re,{className:"inline",children:"native"}),". See the"," ",l.jsx(de,{href:"https://docs.marimo.io/guides/working_with_data/sql",children:"SQL guide"})," ","for more information."]})]})}const Qa=bn("flex items-center justify-center m-0 leading-none font-medium border border-foreground/10 shadow-xs-solid hover:cursor-pointer active:shadow-none dark:border-border text-sm",{variants:{color:{gray:"mo-button gray",white:"mo-button white",green:"mo-button green",red:"mo-button red",yellow:"mo-button yellow","hint-green":"mo-button hint-green",disabled:"mo-button disabled active:shadow-xs-solid"},shape:{rectangle:"rounded",circle:"rounded-full"},size:{small:"",medium:""}},compoundVariants:[{size:"small",shape:"circle",class:"h-[24px] w-[24px] px-[5.5px] py-[5.5px]"},{size:"medium",shape:"circle",class:"px-2 py-2"},{size:"small",shape:"rectangle",class:"px-1 py-1 h-[24px] w-[24px]"},{size:"medium",shape:"rectangle",class:"px-3 py-2"}],defaultVariants:{color:"gray",size:"medium",shape:"rectangle"}}),Xa=bn("font-mono w-full flex-1 inline-flex items-center justify-center rounded px-2.5 text-foreground/60 h-[36px] hover:shadow-md hover:cursor-pointer focus:shadow-md focus:outline-hidden text-[hsl(0, 0%, 43.5%)] bg-transparent hover:bg-background focus:bg-background"),Nt=E.forwardRef((n,e)=>{const t=te.c(15);let s,i,a,o,c,d,u;return t[0]!==n?({color:i,shape:o,size:c,className:s,...a}=n,t[0]=n,t[1]=s,t[2]=i,t[3]=a,t[4]=o,t[5]=c):(s=t[1],i=t[2],a=t[3],o=t[4],c=t[5]),t[6]!==s||t[7]!==i||t[8]!==o||t[9]!==c?(d=jn(Qa({color:i,shape:o,size:c}),s),t[6]=s,t[7]=i,t[8]=o,t[9]=c,t[10]=d):d=t[10],t[11]!==a||t[12]!==e||t[13]!==d?(u=l.jsx("button",{ref:e,className:d,...a,children:a.children}),t[11]=a,t[12]=e,t[13]=d,t[14]=u):u=t[14],u});Nt.displayName="Button",E.forwardRef((n,e)=>{const t=te.c(9);let s,i,a,o;return t[0]!==n?({className:s,...i}=n,t[0]=n,t[1]=s,t[2]=i):(s=t[1],i=t[2]),t[3]!==s?(a=jn(Xa(),s),t[3]=s,t[4]=a):a=t[4],t[5]!==i||t[6]!==e||t[7]!==a?(o=l.jsx("input",{ref:e,className:a,...i}),t[5]=i,t[6]=e,t[7]=a,t[8]=o):o=t[8],o}).displayName="Input";let Kt=null;class Za{constructor(e){this.view=void 0,this.abortController=new AbortController,this.view=e.view,this.view.dom.addEventListener("focus",()=>{Kt=new WeakRef(this.view)},{signal:this.abortController.signal,capture:!0}),this.update()}update(){const e=this.view.dom.querySelector(".cm-vimCursorLayer");if(e instanceof HTMLElement)if(Ns())e.style.display="none";else{const t=(Kt==null?void 0:Kt.deref())===this.view;e.style.display=t?"":"none"}}destroy(){this.abortController.abort()}}const Tl={map:{args:["lhs","rhs"]},nmap:{mode:"normal",args:["lhs","rhs"]},vmap:{mode:"visual",args:["lhs","rhs"]},imap:{mode:"insert",args:["lhs","rhs"]},noremap:{args:["lhs","rhs"]},nnoremap:{mode:"normal",args:["lhs","rhs"]},vnoremap:{mode:"visual",args:["lhs","rhs"]},inoremap:{mode:"insert",args:["lhs","rhs"]},unmap:{args:["lhs"]},nunmap:{mode:"normal",args:["lhs"]},vunmap:{mode:"visual",args:["lhs"]},iunmap:{mode:"insert",args:["lhs"]},mapclear:{},nmapclear:{mode:"normal"},vmapclear:{mode:"visual"},imapclear:{mode:"insert"}};function Ja(n,e){const t=n.split(/\s+/),s=t[0];let i=0;if(s in Tl){const a=Tl[s],o={};for(const d of a.args||[]){if(i+=1,!(i<t.length))return void(e&&e(`Not enough arguments for "${s}" command: "${n}"`));o[d]=t[i]}const c={name:s};return"args"in a&&(c.args=o),"mode"in a&&(c.mode=a.mode),c}e&&e(`Unknown vimrc command: "${n}"`)}var $l;const eo=Ve(()=>{ue.defineAction("goToDefinition",n=>{const e=n.cm6;return Ds(e)}),ue.mapCommand("gd","action","goToDefinition",{},{context:"normal"}),ue.defineEx("write","w",n=>{const e=n.cm6;e&&e.state.facet(ut).saveNotebook()})}),to=Ve(async()=>{var t;const n=mt.get(Sn),e=(t=n.keymap)==null?void 0:t.vimrc;if(e)try{ae.log(`Loading vimrc from ${e}`);const s=(await Ms().sendFileDetails({path:e})).contents;if(!s)return void ae.error(`Failed to load vimrc from ${e}`);const i=(function(a,o){const c=[];for(const d of a.split(`
7
+ `)){if(d.startsWith('"')||d.trim()==="")continue;const u=Ja(d,o);u&&c.push(u)}return c})(s,ae.warn);(function(a){function o(r){r.args&&r.args.lhs&&r.args.rhs?r.mode?ue.map(r.args.lhs,r.args.rhs,r.mode):ue.map(r.args.lhs,r.args.rhs):ae.warn(`Could not execute vimrc command "${r.name}: expected arguments"`)}function c(r){r.args&&r.args.lhs&&r.args.rhs?r.mode?ue.noremap(r.args.lhs,r.args.rhs,r.mode):ue.noremap(r.args.lhs,r.args.rhs):ae.warn(`Could not execute vimrc command "${r.name}: expected arguments"`)}function d(r){r.args&&r.args.lhs?r.mode?ue.unmap(r.args.lhs,r.mode):ue.unmap(r.args.lhs):ae.warn(`Could not execute vimrc command "${r.name}: expected arguments"`)}function u(r){r.mode?ue.mapclear(r.mode):ue.mapclear()}for(const r of a)"map|nmap|vmap|imap".split("|").includes(r.name)?o(r):"noremap|nnoremap|vnoremap|inoremap".split("|").includes(r.name)?c(r):"unmap|nunmap|vunmap|iunmap".split("|").includes(r.name)?d(r):"mapclear|nmapclear|vmapclear|imapclear".split("|").includes(r.name)?u(r):ae.warn(`Could not execute vimrc command "${r.name}: unknown command"`)})(i)}catch(s){ae.error("Failed to load vimrc:",s)}});class It{constructor(){this.instances=new Set,this.isBroadcasting=!1}addInstance(e){this.instances.add(e);const t=ht(e);t?t.on("vim-mode-change",s=>{var i;this.isBroadcasting||($t("mode"in s,'Expected event to have a "mode" property'),this.isBroadcasting=!0,i=()=>{this.broadcastModeChange(e,s.mode,s.subMode),this.isBroadcasting=!1},"scheduler"in window?window.scheduler.postTask(i,{priority:"background"}):"requestIdleCallback"in window?requestIdleCallback(i):setTimeout(i,0))}):ae.warn("Expected CodeMirror instance to have CodeMirror instance state")}removeInstance(e){this.instances.delete(e)}broadcastModeChange(e,t,s){$t("exitInsertMode"in ue,"Vim does not have an exitInsertMode method"),$t("exitVisualMode"in ue,"Vim does not have an exitVisualMode method");for(const i of this.instances)if(i!==e){const a=ht(i);if(!a){ae.warn("Expected CodeMirror instance to have CodeMirror instance state");continue}const o=a.setSelections.bind(a);if(a.setSelections=()=>[],!zl(a)){ae.warn("Expected CodeMirror instance to have Vim state");continue}const c=a.state.vim;switch(t){case"normal":c.insertMode&&ue.exitInsertMode(a,!0),c.visualMode&&ue.exitVisualMode(a,!0);break;case"insert":c.insertMode||ue.handleKey(a,"i","")}a.setSelections=o}}}function zl(n){return n.state.vim!==void 0}$l=It,It.INSTANCES=new $l;const no=["default","vim"];function lo(n,e){switch(n.preset){case"default":return[Se.of(Fl()),Se.of(Rl(e))];case"vim":return[Se.of(io()),Se.of(Rl(e)),Se.of([{key:"Enter",run:t=>{var i;const s=ht(t);return!!((i=s==null?void 0:s.state.vim)!=null&&i.insertMode)&&Es(t)}}]),Nn.high(ao("d",t=>t.state.doc.toString()==="",t=>t.state.doc.toString()===""?(t.state.facet(ut).deleteCell(),!0):!1)),As({status:!1}),Nn.high((eo(),to(),[Se.of([{key:"j",run:t=>{if(Is(t,!0)&&Cn(t)){const s=t.state.facet(ut),i=t.state.facet(wn);return s.moveToNextCell({cellId:i,before:!1,noCreate:!0}),!0}return!1}}]),Se.of([{key:"k",run:t=>{if(_s(t)&&Cn(t)){const s=t.state.facet(ut),i=t.state.facet(wn);return s.moveToNextCell({cellId:i,before:!0,noCreate:!0}),!0}return!1}}]),Se.of([{linux:"Ctrl-[",win:"Ctrl-[",run:t=>{const s=ht(t);return s?zl(s)?!!s.state.vim.insertMode&&(ue.exitInsertMode(s,!0),!0):(ae.warn("Expected CodeMirror instance to have Vim state"),!1):(ae.warn("Expected CodeMirror instance to have CodeMirror instance state"),!1)}}]),kn.define(t=>(requestAnimationFrame(()=>{It.INSTANCES.addInstance(t)}),{destroy(){It.INSTANCES.removeInstance(t)}})),kn.define(t=>new Za({view:t})),Ks.domEventHandlers({keydown:(t,s)=>!(!t.ctrlKey||t.key!=="Escape"||(s.dom.dispatchEvent(new KeyboardEvent(t.type,t)),0))})]))];default:return Ps(n.preset),[]}}const so=new Set([Kn,In]),Fl=Ve(()=>Ts.filter(n=>!so.has(n.run))),Rl=n=>[{key:n.getHotkey("cell.toggleComment").key,run:Kn},{key:n.getHotkey("cell.toggleBlockComment").key,run:In}],io=Ve(()=>{const n=new Set(["Enter","Ctrl-v"]);return Fl().filter(e=>!n.has(e.key||e.mac||e.linux||e.win||""))});function ao(n,e,t){let s="",i=0;return Se.of([{any:(a,o)=>{const c=o.key,d=o.timeStamp;return c!==n||!e(a)?(s="",i=0,!1):s===n&&d-i<500&&t(a)?(s="",i=0,!0):(s=c,i=d,!1)}}])}const Qt=Ge(!1),oo=()=>{const[n,e]=Ye(Qt),[t,s]=b.useState(null),[i,a]=b.useState([]),[o,c]=_n(),d=pt($s),{saveUserConfig:u}=Fe();zs("global.showHelp",()=>e(y=>!y));const r=async y=>{const j={...o};c(y),await u({config:y}).catch(w=>{throw c(j),w})},h=async()=>{if(!t)return;const y={...o,keymap:{...o.keymap,overrides:{...o.keymap.overrides}}};delete y.keymap.overrides[t],s(null),a([]),await r(y)};if(!n)return null;const g=y=>{const j=d.getHotkey(y);if(t===y){const w=Ls(y);return l.jsxs("div",{children:[l.jsx(je,{defaultValue:i.join("+"),placeholder:j.name,onKeyDown:v=>{v.preventDefault();const S=[];if(v.key==="Meta"||v.key==="Control"||v.key==="Alt"||v.key==="Shift"||(v.metaKey&&S.push(An()?"Cmd":"Meta"),v.ctrlKey&&S.push("Ctrl"),v.altKey&&S.push("Alt"),v.shiftKey&&S.push("Shift"),v.key==="-"))return;if(v.key==="Escape"&&S.length===0)return s(null),void a([]);let M=v.key.toLowerCase();v.key===" "&&(M="Space"),S.push(M),(async P=>{if(!t)return;const _=P.join("-"),D={...o,keymap:{...o.keymap,overrides:{...o.keymap.overrides,[t]:_}}};s(null),a([]),await r(D)})(S)},autoFocus:!0,endAdornment:l.jsx(me,{variant:"text",size:"xs",className:"mb-0",onClick:()=>{s(null),a([])},children:l.jsx(gt,{className:"w-4 h-4"})})}),l.jsxs("div",{className:"flex items-center justify-between w-full",children:[l.jsx("span",{className:"text-muted-foreground text-xs",children:"Press a key combination"}),w.key!==j.key&&l.jsxs("span",{className:"text-xs cursor-pointer text-primary",onClick:h,children:["Reset to default:"," ",l.jsx("span",{className:"font-mono",children:w.key})]})]})]},y)}return l.jsxs("div",{className:"grid grid-cols-[auto_2fr_3fr] gap-2 items-center",children:[d.isEditable(y)?l.jsx(En,{className:"cursor-pointer opacity-60 hover:opacity-100 text-muted-foreground w-3 h-3",onClick:()=>{a([]),s(y)}}):l.jsx("div",{className:"w-3 h-3"}),l.jsx(Pn,{className:"justify-end",shortcut:j.key}),l.jsx("span",{children:j.name.toLowerCase()})]},y)},p=d.getHotkeyGroups(),m=(y,j)=>{const w=p[y];return l.jsxs("div",{className:"mb-[40px] gap-2 flex flex-col",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-medium",children:y}),j]}),w.map(g)]})};return l.jsx(zt,{open:n,onOpenChange:y=>e(y),children:l.jsxs(Fs,{className:"sm:items-center sm:top-0",children:[l.jsx(Rs,{}),l.jsxs(Dn,{usePortal:!1,className:"max-h-screen sm:max-h-[90vh] overflow-y-auto sm:max-w-[850px]",children:[l.jsx(Vs,{children:l.jsx(Mn,{children:"Shortcuts"})}),l.jsxs("div",{className:"flex flex-row gap-3",children:[l.jsxs("div",{className:"w-1/2",children:[m("Editing"),m("Markdown")]}),l.jsxs("div",{className:"w-1/2",children:[m("Navigation"),m("Running Cells"),m("Creation and Ordering"),(k="Command",m(k,l.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1",children:["Press"," ",o.keymap.preset==="vim"?l.jsxs(l.Fragment,{children:[l.jsx(Pn,{shortcut:An()?"Cmd":"Ctrl"}),l.jsx(re,{children:"Esc"})]}):l.jsx(re,{children:"Esc"})," ","in a cell to enter command mode"]}))),m("Other"),l.jsx(me,{className:"mt-4 hover:bg-destructive/10 border-destructive hover:border-destructive",variant:"outline",size:"xs",onClick:async()=>{if(!window.confirm("Are you sure you want to reset all shortcuts to their default values?"))return;const y={...o,keymap:{...o.keymap,overrides:{}}};s(null),a([]),await r(y)},tabIndex:-1,children:l.jsx("span",{className:"text-destructive",children:"Reset all to default"})})]})]})]})]})});var k};var ro=Bs();const Vl="marimo:copilot:signedIn",Ll=Hs(Vl,null,void 0,{getOnInit:!0}),Bl=Ge(null),_t=Ge(null);function Ol(){const n=localStorage.getItem(Vl)==="true",e=Os();return n&&e.completion.copilot==="github"}const xe=ae.get("@github/copilot-language-server");class co extends Us{constructor(...e){super(...e),this.documentVersion=0,this.hasOpenedDocument=!1,this.getCompletionInternal=async(t,s)=>await this._request("textDocument/inlineCompletion",{...t,textDocument:{...t.textDocument,version:s}}),this.throttledGetCompletionInternal=(function(t,s,i){var a=!0,o=!0;if(typeof t!="function")throw new TypeError("Expected a function");return ts(i)&&(a="leading"in i?!!i.leading:a,o="trailing"in i?!!i.trailing:o),ns(t,s,{leading:a,maxWait:s,trailing:o})})(this.getCompletionInternal,200)}async _request(e,t){try{return await this.request(e,t)}catch(s){throw xe.error("#request: Error",s),s}}async notify(e,t){return xe.debug("#notify",e,t),super.notify(e,t)}getInitializationOptions(){const e={name:"marimo",version:"0.1.0"};return{...super.getInitializationOptions(),workspaceFolders:[],capabilities:{workspace:{workspaceFolders:!1}},initializationOptions:{editorInfo:e,editorPluginInfo:e}}}isDisabled(){return!Ol()}async textDocumentDidOpen(e){return this.isDisabled()?e:(this.hasOpenedDocument=!0,super.textDocumentDidOpen(e))}async textDocumentCompletion(e){return[]}async textDocumentDidChange(e){if(this.isDisabled())return e;this.hasOpenedDocument||await this.textDocumentDidOpen({textDocument:{uri:e.textDocument.uri,languageId:"python",version:e.textDocument.version,text:e.contentChanges[0].text}});const t=e.contentChanges;t.length!==1&&xe.warn("#textDocumentDidChange: Multiple changes detected. This is not supported.",t);const s=t[0];"range"in s&&xe.warn("#textDocumentDidChange: Copilot doesn't support range changes.",s);const i=Ws(s.text);return super.textDocumentDidChange({...e,contentChanges:[{text:i}],textDocument:Gs.VersionedTextDocumentIdentifier.create(e.textDocument.uri,++this.documentVersion)})}textDocumentHover(e){return Promise.resolve({contents:[]})}signOut(){return this._request("signOut",{})}async signInInitiate(){xe.log("#signInInitiate: Starting sign-in flow");try{const e=await this._request("signIn",{});return xe.log("#signInInitiate: Sign-in flow started successfully"),e}catch(e){throw xe.warn("#signInInitiate: Failed to start sign-in flow",e),e}}async signInConfirm(e){xe.log("#signInConfirm: Confirming sign-in");try{const t=await this._request("signInConfirm",e);return xe.log("#signInConfirm: Sign-in confirmed successfully"),t}catch(t){throw xe.warn("#signInConfirm: Failed to confirm sign-in",t),t}}async signedIn(){try{const{status:e}=await this._request("checkStatus",{});return xe.log("#checkStatus: Status check completed",{status:e}),e==="SignedIn"||e==="AlreadySignedIn"||e==="OK"}catch(e){throw xe.warn("#signedIn: Failed to check sign-in status",e),e}}async getCompletion(e){if(this.isDisabled())return null;const t=this.documentVersion;if(e.textDocument.version=t,t===0)return null;var s;s=t,mt.set(_t,s);const i=await this.throttledGetCompletionInternal(e,t);var a;return a=t,mt.get(_t)===a&&mt.set(_t,null),t!==this.documentVersion?null:i??null}}const ql="/__marimo_copilot__.py",Hl=`file://${ql}`,uo=Ve(()=>new ho);class ho extends ro.Transport{constructor(){super(),this.delegate=void 0,this.delegate=void 0}getWsUrl(){return Qs().getLSPURL("copilot").toString()}async tryConnect(e=3,t=1e3){for(let s=1;s<=e;s++)try{return this.delegate||(this.delegate=new Xs.WebSocketTransport(this.getWsUrl())),await this.delegate.connect(),void ae.log("Copilot#connect: Connected successfully")}catch(i){if(ae.warn(`Copilot#connect: Connection attempt ${s}/${e} failed`,i),s===e)throw this.delegate=void 0,Re({variant:"danger",title:"GitHub Copilot Connection Error",description:"Failed to connect to GitHub Copilot. Please check settings and try again."}),i;await new Promise(a=>setTimeout(a,t))}}async connect(){return await qs(Sn,e=>e.completion.copilot==="github"),await Zs(),this.tryConnect()}close(){var e;(e=this.delegate)==null||e.close(),this.delegate=void 0}async sendData(e,t){var s;return t=Math.min(t??5e3,5e3),(s=this.delegate)==null?void 0:s.sendData(e,t)}}const et=Ve(()=>new co({rootUri:Hl,workspaceFolders:null,transport:uo()}));function mo(){return Ys({documentUri:Hl,client:et(),languageId:"copilot",hoverEnabled:!1,completionEnabled:!1,definitionEnabled:!1,renameEnabled:!1,codeActionsEnabled:!1,signatureHelpEnabled:!1,diagnosticsEnabled:!1,sendIncrementalChanges:!1})}const Ul=b.memo(()=>{const[n,e]=Ye(Ll),[t,s]=Ye(Bl),[i,a]=b.useState(),[o,c]=b.useState(!1),d=async h=>{h.preventDefault(),c(!0);try{const{verificationUri:g,status:p,userCode:m}=await(async function(){return await et().signInInitiate()})();Yl(p)?e(!0):(s("signingIn"),a({url:g,code:m}))}finally{c(!1)}},u=async h=>{if(h.preventDefault(),i){c(!0);try{const g=await(async function(p){const m=et();try{ae.log("Copilot#tryFinishSignIn: Attempting to confirm sign-in");const{status:k}=await m.signInConfirm({userCode:p});return Yl(k)?(ae.log("Copilot#tryFinishSignIn: Sign-in confirmed successfully"),{success:!0}):(ae.warn("Copilot#tryFinishSignIn: Sign-in confirmation returned unexpected status",{status:k}),{success:!1})}catch(k){return Gl(k)?(ae.error("Copilot#tryFinishSignIn: Connection error during sign-in",k),{success:!1,error:"connection"}):await(async function(y){for(let j=0;j<Wl;j++)try{if(await new Promise(w=>setTimeout(w,po)),await y.signedIn())return ae.log("Copilot#tryFinishSignIn: Successfully signed in after retry"),{success:!0}}catch(w){if(ae.warn("Copilot#tryFinishSignIn: Retry attempt failed",{attempt:j+1,maxRetries:Wl}),Gl(w))return{success:!1,error:"connection"}}return ae.error("Copilot#tryFinishSignIn: All sign-in attempts failed"),{success:!1}})(m)}})(i.code);g.success?(e(!0),s("signedIn")):g.error==="connection"?(s("connectionError"),Re({title:"GitHub Copilot Connection Error",description:"Lost connection during sign-in. Please try again.",variant:"danger",action:l.jsx(me,{onClick:d,children:"Retry"})})):s("signInFailed")}finally{c(!1)}}},r=async h=>{h.preventDefault(),await(async function(){await et().signOut()})(),e(!1),s("signedOut")};return(()=>{switch(t??(n?"signedIn":"connecting")){case"connecting":return l.jsx(De,{className:"font-normal flex",children:"Connecting..."});case"signedOut":return l.jsx(me,{onClick:d,size:"xs",variant:"link",children:"Sign in to GitHub Copilot"});case"signingIn":return l.jsxs("ol",{className:"ml-4 text-sm list-decimal [&>li]:mt-2",children:[l.jsx("li",{children:l.jsxs("div",{className:"flex items-center",children:["Copy this code:",l.jsx("strong",{className:"ml-2",children:i==null?void 0:i.code}),l.jsx(ei,{className:"ml-2 cursor-pointer opacity-60 hover:opacity-100 h-3 w-3",onClick:async()=>{i&&(await ti(i.code),Re({description:"Copied to clipboard"}))}})]})}),l.jsxs("li",{children:["Enter the code at this link:",l.jsx("a",{href:i==null?void 0:i.url,target:"_blank",rel:"noreferrer",className:ni({variant:"link",size:"xs"}),children:i==null?void 0:i.url})]}),l.jsxs("li",{children:["Click here when done:",l.jsxs(me,{size:"xs",onClick:u,className:"ml-1",children:[o&&l.jsx(Tn,{className:"h-3 w-3 mr-1 animate-spin"}),"Done"]})]})]});case"signInFailed":return l.jsxs("div",{className:"flex flex-col gap-1",children:[l.jsx("div",{className:"text-destructive text-sm",children:"Sign in failed. Please try again."}),o?l.jsx(Tn,{className:"h-3 w-3 mr-1 animate-spin"}):l.jsx(me,{onClick:d,size:"xs",variant:"link",children:"Connect to GitHub Copilot"})]});case"signedIn":return l.jsxs("div",{className:"flex items-center gap-5",children:[l.jsxs(De,{className:"font-normal flex items-center",children:[l.jsx("div",{className:"inline-flex items-center justify-center bg-(--grass-7) rounded-full p-1 mr-2",children:l.jsx(Js,{className:"h-3 w-3 text-white"})}),"Connected"]}),l.jsx(me,{onClick:r,size:"xs",variant:"text",children:"Disconnect"})]});case"connectionError":return l.jsxs("div",{className:"flex flex-col gap-1",children:[l.jsxs(De,{className:"font-normal flex",children:[l.jsx(gt,{className:"h-4 w-4 mr-1"}),"Connection Error"]}),l.jsx("div",{className:"text-sm",children:"Unable to connect to GitHub Copilot."}),l.jsx(me,{onClick:d,size:"xs",variant:"link",children:"Retry Connection"})]});case"notConnected":return l.jsxs("div",{className:"flex flex-col gap-1",children:[l.jsxs(De,{className:"font-normal flex",children:[l.jsx(gt,{className:"h-4 w-4 mr-1"}),"Unable to connect"]}),l.jsxs("div",{className:"text-sm",children:["For troubleshooting, see the"," ",l.jsx(de,{href:"https://docs.marimo.io/getting_started/index.html#github-copilot",children:"docs"}),"."]})]})}})()});Ul.displayName="CopilotConfig";const Wl=5,po=3e3;function Gl(n){return n instanceof Error&&(n.message.includes("ECONNREFUSED")||n.message.includes("WebSocket")||n.message.includes("network"))}function Yl(n){return n==="SignedIn"||n==="AlreadySignedIn"||n==="OK"}const go=["us-east-1","us-east-2","us-west-2","eu-central-1","ap-northeast-1","ap-southeast-1"],Ql=n=>{const e=te.c(12),{value:t,includeSuggestion:s}=n,i=s===void 0||s;if(!t||t.includes("/"))return null;let a;e[0]!==t?(a=Qe.parse(t),e[0]=t,e[1]=a):a=e[1];const o=a.id;let c,d,u,r,h;return e[2]===Symbol.for("react.memo_cache_sentinel")?(c=l.jsx("code",{className:"font-bold",children:"provider/model"}),e[2]=c):c=e[2],e[3]!==t?(d=l.jsxs("span",{children:["Model id should be in the form"," ",c,". ",t," is missing a provider."]}),e[3]=t,e[4]=d):d=e[4],e[5]===Symbol.for("react.memo_cache_sentinel")?(u=l.jsx("br",{}),e[5]=u):u=e[5],e[6]!==i||e[7]!==o?(r=i&&o&&l.jsxs("span",{children:["Did you mean ",l.jsx("code",{className:"font-bold",children:o}),"?"]}),e[6]=i,e[7]=o,e[8]=r):r=e[8],e[9]!==d||e[10]!==r?(h=l.jsxs(ft,{kind:"danger",className:"mt-1",children:[d,u,r]}),e[9]=d,e[10]=r,e[11]=h):h=e[11],h};function Xl(n,e){const t=te.c(10);let s;t[0]!==e||t[1]!==n?(s=$n(n,e),t[0]=e,t[1]=n,t[2]=s):s=t[2];const i=s,a=pt(li);let o;t[3]!==e||t[4]!==a?(o=$n(a,e),t[3]=e,t[4]=a,t[5]=o):o=t[5];const c=o,d=c!=null&&i!==c;let u;return t[6]!==i||t[7]!==d||t[8]!==c?(u={isOverridden:d,currentValue:i,overriddenValue:c},t[6]=i,t[7]=d,t[8]=c,t[9]=u):u=t[9],u}const fo=n=>{const e=te.c(3),{name:t,children:s}=n,[i]=zn(),{isOverridden:a}=Xl(i,t);let o;return e[0]!==s||e[1]!==a?(o=a?l.jsx(Me,{delayDuration:200,content:l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsxs("p",{children:["This setting is overridden by the"," ",l.jsx(re,{className:"inline mx-px",children:"pyproject.toml"})," config."]}),l.jsxs("p",{children:["To change it, edit the project config"," ",l.jsx(re,{className:"inline mx-px",children:"pyproject.toml"}),"directly."]})]}),children:l.jsx("div",{className:"text-muted-foreground opacity-80 cursor-not-allowed *:pointer-events-none",children:s})}):s,e[0]=s,e[1]=a,e[2]=o):o=e[2],o},ee=n=>{const e=te.c(18),{userConfig:t,name:s}=n,{isOverridden:i,currentValue:a,overriddenValue:o}=Xl(t,s);if(!i)return null;let c,d,u,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=l.jsxs("span",{children:["This setting is overridden by"," ",l.jsx(re,{className:"inline",children:"pyproject.toml"}),"."]}),d=l.jsx("br",{}),e[0]=c,e[1]=d):(c=e[0],d=e[1]),e[2]===Symbol.for("react.memo_cache_sentinel")?(u=l.jsxs("span",{children:["Edit the ",l.jsx(re,{className:"inline",children:"pyproject.toml"})," file directly to change this setting."]}),r=l.jsx("br",{}),e[2]=u,e[3]=r):(u=e[2],r=e[3]);const h=String(a);let g,p;e[4]!==h?(g=l.jsxs("span",{children:["User value: ",l.jsx("strong",{children:h})]}),e[4]=h,e[5]=g):g=e[5],e[6]===Symbol.for("react.memo_cache_sentinel")?(p=l.jsx("br",{}),e[6]=p):p=e[6];const m=String(o);let k,y,j;e[7]!==m?(k=l.jsxs("span",{children:["Project value: ",l.jsx("strong",{children:m})]}),e[7]=m,e[8]=k):k=e[8],e[9]!==g||e[10]!==k?(y=l.jsxs(l.Fragment,{children:[c,d,u,r,g,p,k]}),e[9]=g,e[10]=k,e[11]=y):y=e[11],e[12]===Symbol.for("react.memo_cache_sentinel")?(j=l.jsx(Jn,{className:"w-3 h-3"}),e[12]=j):j=e[12];const w=String(o);let v,S;return e[13]!==w?(v=l.jsxs("span",{className:"text-(--amber-12) text-xs flex items-center gap-1 border rounded px-2 py-1 bg-(--amber-2) border-(--amber-6) ml-1",children:[j,"Overridden by pyproject.toml [",w,"]"]}),e[13]=w,e[14]=v):v=e[14],e[15]!==y||e[16]!==v?(S=l.jsx(Me,{content:y,children:v}),e[15]=y,e[16]=v,e[17]=S):S=e[17],S},Oe="flex flex-row items-center space-x-1 space-y-0",xo=n=>{const e=te.c(5),{provider:t,children:s}=n;let i,a;return e[0]!==t?(i=t&&l.jsx(Xe,{provider:t,className:"mr-2"}),e[0]=t,e[1]=i):i=e[1],e[2]!==s||e[3]!==i?(a=l.jsxs("div",{className:"flex items-center text-base font-semibold",children:[i,s]}),e[2]=s,e[3]=i,e[4]=a):a=e[4],a},Ae=n=>{const e=te.c(10),{form:t,config:s,name:i,placeholder:a,testId:o,description:c}=n;let d,u;return e[0]!==s||e[1]!==c||e[2]!==i||e[3]!==a||e[4]!==o?(d=r=>{const{field:h}=r;return l.jsxs("div",{className:"flex flex-col space-y-1",children:[l.jsxs(Y,{className:Oe,children:[l.jsx(U,{children:"API Key"}),l.jsx(Q,{children:l.jsx(je,{"data-testid":o,rootClassName:"flex-1",className:"m-0 inline-flex h-7",placeholder:a,...h,value:tt(h.value),onChange:g=>{const p=g.target.value;p.includes("*")||h.onChange(p)}})}),l.jsx(X,{}),l.jsx(ee,{userConfig:s,name:i})]}),c&&l.jsx(J,{children:c})]})},e[0]=s,e[1]=c,e[2]=i,e[3]=a,e[4]=o,e[5]=d):d=e[5],e[6]!==t.control||e[7]!==i||e[8]!==d?(u=l.jsx(G,{control:t.control,name:i,render:d}),e[6]=t.control,e[7]=i,e[8]=d,e[9]=u):u=e[9],u};function tt(n){if(n!=null)return typeof n=="string"?n:String(n)}const nt=n=>{const e=te.c(12),{form:t,config:s,name:i,placeholder:a,testId:o,description:c,disabled:d,defaultValue:u}=n,r=d!==void 0&&d;let h,g;return e[0]!==s||e[1]!==u||e[2]!==c||e[3]!==i||e[4]!==a||e[5]!==o?(h=p=>{const{field:m}=p;return l.jsxs("div",{className:"flex flex-col space-y-1",children:[l.jsxs(Y,{className:Oe,children:[l.jsx(U,{children:"Base URL"}),l.jsx(Q,{children:l.jsx(je,{"data-testid":o,rootClassName:"flex-1",className:"m-0 inline-flex h-7",placeholder:a,defaultValue:u,...m,value:tt(m.value)})}),l.jsx(X,{}),l.jsx(ee,{userConfig:s,name:i})]}),c&&l.jsx(J,{children:c})]})},e[0]=s,e[1]=u,e[2]=c,e[3]=i,e[4]=a,e[5]=o,e[6]=h):h=e[6],e[7]!==r||e[8]!==t.control||e[9]!==i||e[10]!==h?(g=l.jsx(G,{control:t.control,name:i,disabled:r,render:h}),e[7]=r,e[8]=t.control,e[9]=i,e[10]=h,e[11]=g):g=e[11],g},Xt=n=>{const e=te.c(15),{form:t,config:s,name:i,placeholder:a,testId:o,description:c,disabled:d,label:u,forRole:r,onSubmit:h}=n,g=d!==void 0&&d;let p,m;return e[0]!==s||e[1]!==c||e[2]!==r||e[3]!==t||e[4]!==u||e[5]!==i||e[6]!==h||e[7]!==a||e[8]!==o?(p=k=>{const{field:y}=k,j=tt(y.value),w=v=>{y.onChange(v),h(t.getValues())};return l.jsxs("div",{className:"flex flex-col space-y-1",children:[l.jsxs(Y,{className:Oe,children:[l.jsx(U,{children:u}),l.jsx(Q,{children:l.jsx(fi,{value:j,placeholder:a,onSelect:w,triggerClassName:"text-sm",customDropdownContent:l.jsxs(l.Fragment,{children:[l.jsx(xi,{}),l.jsxs("p",{className:"px-2 py-1.5 text-sm text-muted-secondary flex items-center gap-1",children:["Enter a custom model",l.jsx(Me,{content:"Models should include the provider prefix, e.g. 'openai/gpt-4o'",children:l.jsx(yi,{className:"h-3 w-3"})})]}),l.jsxs("div",{className:"px-2 py-1",children:[l.jsx(je,{"data-testid":o,className:"w-full border-border shadow-none focus-visible:shadow-xs",placeholder:a,...y,value:tt(y.value),onKeyDown:Hn.stopPropagation()}),j&&l.jsx(Ql,{value:j,includeSuggestion:!1})]})]}),forRole:r})}),l.jsx(X,{})]}),l.jsx(ee,{userConfig:s,name:i}),l.jsx(Ql,{value:j}),c&&l.jsx(J,{children:c})]})},e[0]=s,e[1]=c,e[2]=r,e[3]=t,e[4]=u,e[5]=i,e[6]=h,e[7]=a,e[8]=o,e[9]=p):p=e[9],e[10]!==g||e[11]!==t.control||e[12]!==i||e[13]!==p?(m=l.jsx(G,{control:t.control,name:i,disabled:g,render:p}),e[10]=g,e[11]=t.control,e[12]=i,e[13]=p,e[14]=m):m=e[14],m},yo=n=>{const e=te.c(10),{form:t,config:s,name:i,options:a,testId:o,disabled:c}=n,d=c!==void 0&&c;let u,r;return e[0]!==s||e[1]!==i||e[2]!==a||e[3]!==o?(u=h=>{const{field:g}=h;return l.jsx("div",{className:"flex flex-col space-y-1",children:l.jsxs(Y,{className:Oe,children:[l.jsx(U,{children:"Provider"}),l.jsx(Q,{children:l.jsx(ge,{"data-testid":o,onChange:p=>{p.target.value==="none"?g.onChange(!1):g.onChange(p.target.value)},value:tt(g.value===!0?"github":g.value===!1?"none":g.value),disabled:g.disabled,className:"inline-flex mr-2",children:a.map(Io)})}),l.jsx(X,{}),l.jsx(ee,{userConfig:s,name:i})]})})},e[0]=s,e[1]=i,e[2]=a,e[3]=o,e[4]=u):u=e[4],e[5]!==d||e[6]!==t.control||e[7]!==i||e[8]!==u?(r=l.jsx(G,{control:t.control,name:i,disabled:d,render:u}),e[5]=d,e[6]=t.control,e[7]=i,e[8]=u,e[9]=r):r=e[9],r},Dt=n=>{const e=te.c(5),{children:t,className:s}=n;let i,a;return e[0]!==s?(i=_e("flex flex-col gap-4 pb-4",s),e[0]=s,e[1]=i):i=e[1],e[2]!==t||e[3]!==i?(a=l.jsx("div",{className:i,children:t}),e[2]=t,e[3]=i,e[4]=a):a=e[4],a},vo=n=>{const e=te.c(24),{qualifiedId:t,model:s,isEnabled:i,onToggle:a,onDelete:o}=n;let c;e[0]!==a||e[1]!==t?(c=()=>{a(t)},e[0]=a,e[1]=t,e[2]=c):c=e[2];const d=c;let u;e[3]!==o||e[4]!==t?(u=y=>{y.stopPropagation(),y.preventDefault(),o(t)},e[3]=o,e[4]=t,e[5]=u):u=e[5];const r=u;let h,g,p,m,k;return e[6]!==s||e[7]!==t?(h=l.jsx(bo,{model:s,qualifiedId:t}),e[6]=s,e[7]=t,e[8]=h):h=e[8],e[9]!==r||e[10]!==s.custom?(g=s.custom&&l.jsx(me,{variant:"ghost",size:"icon",onClick:r,className:"mr-2 hover:bg-transparent",children:l.jsx(vi,{className:"h-3.5 w-3.5 text-muted-foreground"})}),e[9]=r,e[10]=s.custom,e[11]=g):g=e[11],e[12]!==d||e[13]!==i?(p=l.jsx(bi,{checked:i,onClick:d,size:"sm"}),e[12]=d,e[13]=i,e[14]=p):p=e[14],e[15]!==h||e[16]!==g||e[17]!==p?(m=l.jsx(_l,{children:l.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b last:border-b-0 cursor-pointer outline-none",children:[h,g,p]})}),e[15]=h,e[16]=g,e[17]=p,e[18]=m):m=e[18],e[19]!==d||e[20]!==s.name||e[21]!==t||e[22]!==m?(k=l.jsx(Pl,{id:t,textValue:s.name,className:"pl-6 outline-none data-focused:bg-muted/50 hover:bg-muted/50",onAction:d,children:m}),e[19]=d,e[20]=s.name,e[21]=t,e[22]=m,e[23]=k):k=e[23],k},bo=n=>{const e=te.c(21),{model:t,qualifiedId:s}=n;let i,a,o,c,d,u,r,h;return e[0]!==t.name?(i=l.jsx("h3",{className:"font-medium",children:t.name}),e[0]=t.name,e[1]=i):i=e[1],e[2]!==t.custom?(a=t.custom&&l.jsx(ji,{className:"h-4 w-4"}),e[2]=t.custom,e[3]=a):a=e[3],e[4]!==a?(o=l.jsx(Me,{content:"Custom model",children:a}),e[4]=a,e[5]=o):o=e[5],e[6]!==i||e[7]!==o?(c=l.jsxs("div",{className:"flex items-center gap-2",children:[i,o]}),e[6]=i,e[7]=o,e[8]=c):c=e[8],e[9]!==s?(d=l.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:s}),e[9]=s,e[10]=d):d=e[10],e[11]!==t.custom||e[12]!==t.description?(u=t.description&&!t.custom&&l.jsx("p",{className:"text-sm text-muted-secondary mt-1 line-clamp-2",children:t.description}),e[11]=t.custom,e[12]=t.description,e[13]=u):u=e[13],e[14]!==t.thinking?(r=t.thinking&&l.jsxs("div",{className:_e("flex items-center gap-1 rounded px-1 py-0.5 w-fit mt-1.5",ki("thinking")),children:[l.jsx(Un,{className:"h-3 w-3"}),l.jsx("span",{className:"text-xs font-medium",children:"Reasoning"})]}),e[14]=t.thinking,e[15]=r):r=e[15],e[16]!==c||e[17]!==d||e[18]!==u||e[19]!==r?(h=l.jsx("div",{className:"flex items-center gap-3 flex-1",children:l.jsxs("div",{className:"flex flex-col flex-1",children:[c,d,u,r]})}),e[16]=c,e[17]=d,e[18]=u,e[19]=r,e[20]=h):h=e[20],h},jo=n=>{const e=te.c(13),{form:t,config:s,onSubmit:i}=n;let a,o,c,d,u,r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=l.jsx(wt,{children:"Code Completion"}),o=l.jsx("p",{className:"text-sm text-muted-secondary",children:"Choose GitHub Copilot, Codeium, or a custom provider (such as Ollama) to enable AI-powered code completion."}),e[0]=a,e[1]=o):(a=e[0],o=e[1]),e[2]===Symbol.for("react.memo_cache_sentinel")?(c=["none","github","codeium","custom"],e[2]=c):c=e[2],e[3]!==s||e[4]!==t?(d=l.jsx(yo,{form:t,config:s,name:"completion.copilot",options:c,testId:"copilot-select"}),e[3]=s,e[4]=t,e[5]=d):d=e[5],e[6]!==s||e[7]!==t||e[8]!==i?(u=(({form:h,config:g,onSubmit:p})=>{const m=h.getValues("completion.copilot");return m===!1?null:m==="codeium"?l.jsxs(l.Fragment,{children:[l.jsxs("p",{className:"text-sm text-muted-secondary",children:["To get a Windsurf API key, follow"," ",l.jsx(de,{href:"https://docs.marimo.io/guides/editor_features/ai_completion.html#windsurf-copilot",children:"these instructions"}),"."]}),l.jsx(Ae,{form:h,config:g,name:"completion.codeium_api_key",placeholder:"key",testId:"codeium-api-key-input"})]}):m==="github"?l.jsx(Ul,{}):m==="custom"?l.jsx(Xt,{label:"Autocomplete Model",form:h,config:g,name:"ai.models.autocomplete_model",placeholder:"ollama/qwen2.5-coder:1.5b",testId:"custom-model-input",description:"Model to use for code completion when using a custom provider.",onSubmit:p,forRole:"autocomplete"}):void 0})({form:t,config:s,onSubmit:i}),e[6]=s,e[7]=t,e[8]=i,e[9]=u):u=e[9],e[10]!==d||e[11]!==u?(r=l.jsxs(Dt,{children:[a,o,d,u]}),e[10]=d,e[11]=u,e[12]=r):r=e[12],r},Ke=n=>{const e=te.c(15),{title:t,triggerClassName:s,provider:i,children:a,isConfigured:o}=n;let c,d,u,r,h;return e[0]!==o?(c=o&&l.jsx("span",{className:"ml-2 px-1 rounded bg-muted text-xs font-medium border",children:"Configured"}),e[0]=o,e[1]=c):c=e[1],e[2]!==i||e[3]!==c||e[4]!==t?(d=l.jsxs(xo,{provider:i,children:[t,c]}),e[2]=i,e[3]=c,e[4]=t,e[5]=d):d=e[5],e[6]!==d||e[7]!==s?(u=l.jsx(Ci,{className:s,children:d}),e[6]=d,e[7]=s,e[8]=u):u=e[8],e[9]!==a?(r=l.jsx(wi,{wrapperClassName:"flex flex-col gap-4",children:a}),e[9]=a,e[10]=r):r=e[10],e[11]!==i||e[12]!==u||e[13]!==r?(h=l.jsxs(Si,{value:i,children:[u,r]}),e[11]=i,e[12]=u,e[13]=r,e[14]=h):h=e[14],h},ko=n=>{const e=te.c(88),{form:t,config:s}=n;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=Pe(),e[0]=i):i=e[0];const a=i;let o;e[1]!==t?(o=Ce=>!!t.getValues(Ce),e[1]=t,e[2]=o):o=e[2];const c=o;let d,u;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=l.jsx(re,{className:"inline",children:"marimo.toml"}),e[3]=d):d=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(u=l.jsxs("p",{className:"text-sm text-muted-secondary",children:["Add your API keys below or to ",d," ","to set up a provider for the Code Completion and Assistant features; see"," ",l.jsx(de,{href:"https://docs.marimo.io/guides/editor_features/ai_completion/#connecting-to-an-llm",children:"docs"})," ","for more info."]}),e[4]=u):u=e[4];const r=c("ai.open_ai.api_key");let h,g,p,m;e[5]===Symbol.for("react.memo_cache_sentinel")?(h=l.jsxs(l.Fragment,{children:["Your OpenAI API key from"," ",l.jsx(de,{href:"https://platform.openai.com/account/api-keys",children:"platform.openai.com"}),"."]}),e[5]=h):h=e[5],e[6]!==s||e[7]!==t?(g=l.jsx(Ae,{form:t,config:s,name:"ai.open_ai.api_key",placeholder:"sk-proj...",testId:"ai-openai-api-key-input",description:h}),p=l.jsx(nt,{form:t,config:s,name:"ai.open_ai.base_url",placeholder:"https://api.openai.com/v1",testId:"ai-base-url-input",disabled:a}),e[6]=s,e[7]=t,e[8]=g,e[9]=p):(g=e[8],p=e[9]),e[10]!==r||e[11]!==g||e[12]!==p?(m=l.jsxs(Ke,{title:"OpenAI",provider:"openai",triggerClassName:"pt-0",isConfigured:r,children:[g,p]}),e[10]=r,e[11]=g,e[12]=p,e[13]=m):m=e[13];const k=c("ai.anthropic.api_key");let y,j,w;e[14]===Symbol.for("react.memo_cache_sentinel")?(y=l.jsxs(l.Fragment,{children:["Your Anthropic API key from"," ",l.jsx(de,{href:"https://console.anthropic.com/settings/keys",children:"console.anthropic.com"}),"."]}),e[14]=y):y=e[14],e[15]!==s||e[16]!==t?(j=l.jsx(Ae,{form:t,config:s,name:"ai.anthropic.api_key",placeholder:"sk-ant...",testId:"ai-anthropic-api-key-input",description:y}),e[15]=s,e[16]=t,e[17]=j):j=e[17],e[18]!==k||e[19]!==j?(w=l.jsx(Ke,{title:"Anthropic",provider:"anthropic",isConfigured:k,children:j}),e[18]=k,e[19]=j,e[20]=w):w=e[20];const v=c("ai.google.api_key");let S,M,P;e[21]===Symbol.for("react.memo_cache_sentinel")?(S=l.jsxs(l.Fragment,{children:["Your Google AI API key from"," ",l.jsx(de,{href:"https://aistudio.google.com/app/apikey",children:"aistudio.google.com"}),"."]}),e[21]=S):S=e[21],e[22]!==s||e[23]!==t?(M=l.jsx(Ae,{form:t,config:s,name:"ai.google.api_key",placeholder:"AI...",testId:"ai-google-api-key-input",description:S}),e[22]=s,e[23]=t,e[24]=M):M=e[24],e[25]!==v||e[26]!==M?(P=l.jsx(Ke,{title:"Google",provider:"google",isConfigured:v,children:M}),e[25]=v,e[26]=M,e[27]=P):P=e[27];const _=c("ai.ollama.base_url");let D,I;e[28]!==s||e[29]!==t?(D=l.jsx(nt,{form:t,config:s,name:"ai.ollama.base_url",placeholder:"http://localhost:11434/v1",defaultValue:"http://localhost:11434/v1",testId:"ollama-base-url-input"}),e[28]=s,e[29]=t,e[30]=D):D=e[30],e[31]!==_||e[32]!==D?(I=l.jsx(Ke,{title:"Ollama",provider:"ollama",isConfigured:_,children:D}),e[31]=_,e[32]=D,e[33]=I):I=e[33];const $=c("ai.github.api_key");let F,z,H,C;e[34]===Symbol.for("react.memo_cache_sentinel")?(F=l.jsxs(l.Fragment,{children:["Your GitHub API token from"," ",l.jsx(re,{className:"inline",children:"gh auth token"}),"."]}),e[34]=F):F=e[34],e[35]!==s||e[36]!==t?(z=l.jsx(Ae,{form:t,config:s,name:"ai.github.api_key",placeholder:"gho_...",testId:"ai-github-api-key-input",description:F}),H=l.jsx(nt,{form:t,config:s,name:"ai.github.base_url",placeholder:"https://api.githubcopilot.com/",testId:"ai-github-base-url-input"}),e[35]=s,e[36]=t,e[37]=z,e[38]=H):(z=e[37],H=e[38]),e[39]!==$||e[40]!==z||e[41]!==H?(C=l.jsxs(Ke,{title:"GitHub",provider:"github",isConfigured:$,children:[z,H]}),e[39]=$,e[40]=z,e[41]=H,e[42]=C):C=e[42];const A=c("ai.azure.api_key")&&c("ai.azure.base_url");let R,q,O,f;e[43]===Symbol.for("react.memo_cache_sentinel")?(R=l.jsxs(l.Fragment,{children:["Your Azure API key from"," ",l.jsx(de,{href:"https://portal.azure.com/",children:"portal.azure.com"}),"."]}),e[43]=R):R=e[43],e[44]!==s||e[45]!==t?(q=l.jsx(Ae,{form:t,config:s,name:"ai.azure.api_key",placeholder:"sk-proj...",testId:"ai-azure-api-key-input",description:R}),O=l.jsx(nt,{form:t,config:s,name:"ai.azure.base_url",placeholder:"https://<your-resource-name>.openai.azure.com",testId:"ai-azure-base-url-input"}),e[44]=s,e[45]=t,e[46]=q,e[47]=O):(q=e[46],O=e[47]),e[48]!==A||e[49]!==q||e[50]!==O?(f=l.jsxs(Ke,{title:"Azure",provider:"azure",isConfigured:A,children:[q,O]}),e[48]=A,e[49]=q,e[50]=O,e[51]=f):f=e[51];const V=c("ai.bedrock.region_name");let B,L,W,K,x,N;e[52]===Symbol.for("react.memo_cache_sentinel")?(B=l.jsxs("p",{className:"text-sm text-muted-secondary mb-2",children:["To use AWS Bedrock, you need to configure AWS credentials and region. See the"," ",l.jsx(de,{href:"https://docs.marimo.io/guides/editor_features/ai_completion.html#aws-bedrock",children:"documentation"})," ","for more details."]}),e[52]=B):B=e[52],e[53]!==s?(L=Ce=>{const{field:fe}=Ce;return l.jsxs("div",{className:"flex flex-col space-y-1",children:[l.jsxs(Y,{className:Oe,children:[l.jsx(U,{children:"AWS Region"}),l.jsx(Q,{children:l.jsx(ge,{"data-testid":"bedrock-region-select",onChange:Ee=>fe.onChange(Ee.target.value),value:typeof fe.value=="string"?fe.value:"us-east-1",disabled:fe.disabled,className:"inline-flex mr-2",children:go.map(_o)})}),l.jsx(X,{}),l.jsx(ee,{userConfig:s,name:"ai.bedrock.region_name"})]}),l.jsx(J,{children:"The AWS region where Bedrock service is available."})]})},e[53]=s,e[54]=L):L=e[54],e[55]!==t.control||e[56]!==L?(W=l.jsx(G,{control:t.control,disabled:a,name:"ai.bedrock.region_name",render:L}),e[55]=t.control,e[56]=L,e[57]=W):W=e[57],e[58]!==s?(K=Ce=>{const{field:fe}=Ce;return l.jsxs("div",{className:"flex flex-col space-y-1",children:[l.jsxs(Y,{className:Oe,children:[l.jsx(U,{children:"AWS Profile Name (Optional)"}),l.jsx(Q,{children:l.jsx(je,{"data-testid":"bedrock-profile-input",rootClassName:"flex-1",className:"m-0 inline-flex h-7",placeholder:"default",...fe,value:fe.value||""})}),l.jsx(X,{}),l.jsx(ee,{userConfig:s,name:"ai.bedrock.profile_name"})]}),l.jsx(J,{children:"The AWS profile name from your ~/.aws/credentials file. Leave blank to use your default AWS credentials."})]})},e[58]=s,e[59]=K):K=e[59],e[60]!==t.control||e[61]!==K?(x=l.jsx(G,{control:t.control,disabled:a,name:"ai.bedrock.profile_name",render:K}),e[60]=t.control,e[61]=K,e[62]=x):x=e[62],e[63]!==V||e[64]!==W||e[65]!==x?(N=l.jsxs(Ke,{title:"AWS Bedrock",provider:"bedrock",isConfigured:V,children:[B,W,x]}),e[63]=V,e[64]=W,e[65]=x,e[66]=N):N=e[66];const le=c("ai.open_ai_compatible.api_key")&&c("ai.open_ai_compatible.base_url");let se,T,ie,Z,oe,he;return e[67]===Symbol.for("react.memo_cache_sentinel")?(se=l.jsx(l.Fragment,{children:"API key for any OpenAI-compatible provider (e.g., Together, Groq, Mistral, Perplexity, etc)."}),e[67]=se):se=e[67],e[68]!==s||e[69]!==t?(T=l.jsx(Ae,{form:t,config:s,name:"ai.open_ai_compatible.api_key",placeholder:"sk-...",testId:"ai-openai-compatible-api-key-input",description:se}),e[68]=s,e[69]=t,e[70]=T):T=e[70],e[71]===Symbol.for("react.memo_cache_sentinel")?(ie=l.jsx(l.Fragment,{children:"Base URL for your OpenAI-compatible provider."}),e[71]=ie):ie=e[71],e[72]!==s||e[73]!==t?(Z=l.jsx(nt,{form:t,config:s,name:"ai.open_ai_compatible.base_url",placeholder:"https://api.together.xyz/v1",testId:"ai-openai-compatible-base-url-input",description:ie}),e[72]=s,e[73]=t,e[74]=Z):Z=e[74],e[75]!==le||e[76]!==T||e[77]!==Z?(oe=l.jsxs(Ke,{title:"OpenAI-Compatible",provider:"openai-compatible",isConfigured:le,children:[T,Z]}),e[75]=le,e[76]=T,e[77]=Z,e[78]=oe):oe=e[78],e[79]!==w||e[80]!==P||e[81]!==I||e[82]!==C||e[83]!==f||e[84]!==N||e[85]!==oe||e[86]!==m?(he=l.jsxs(Dt,{children:[u,l.jsxs(ri,{type:"multiple",children:[m,w,P,I,C,f,N,oe]})]}),e[79]=w,e[80]=P,e[81]=I,e[82]=C,e[83]=f,e[84]=N,e[85]=oe,e[86]=m,e[87]=he):he=e[87],he},Co=n=>{const e=te.c(23),{form:t,config:s,onSubmit:i}=n;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=Pe(),e[0]=a):a=e[0];const o=a;let c,d,u,r,h,g,p,m,k,y;return e[1]===Symbol.for("react.memo_cache_sentinel")?(c=l.jsx(wt,{children:"AI Assistant"}),d=l.jsx(ci,{}),e[1]=c,e[2]=d):(c=e[1],d=e[2]),e[3]===Symbol.for("react.memo_cache_sentinel")?(u=l.jsx("span",{children:"Model to use for chat conversations in the Chat panel."}),e[3]=u):u=e[3],e[4]!==s||e[5]!==t||e[6]!==i?(r=l.jsx(Xt,{label:"Chat Model",form:t,config:s,name:"ai.models.chat_model",placeholder:qn,testId:"ai-chat-model-input",disabled:o,description:u,forRole:"chat",onSubmit:i}),e[4]=s,e[5]=t,e[6]=i,e[7]=r):r=e[7],e[8]===Symbol.for("react.memo_cache_sentinel")?(h=l.jsxs("span",{children:["Model to use for code editing with the"," ",l.jsx(re,{className:"inline",children:"Generate with AI"})," button."]}),e[8]=h):h=e[8],e[9]!==s||e[10]!==t||e[11]!==i?(g=l.jsx(Xt,{label:"Edit Model",form:t,config:s,name:"ai.models.edit_model",placeholder:qn,testId:"ai-edit-model-input",disabled:o,description:h,forRole:"edit",onSubmit:i}),e[9]=s,e[10]=t,e[11]=i,e[12]=g):g=e[12],e[13]===Symbol.for("react.memo_cache_sentinel")?(p=l.jsxs("ul",{className:"bg-muted p-2 rounded-md list-disc space-y-1 pl-6",children:[l.jsx("li",{className:"text-xs text-muted-secondary",children:'Models should include the provider name and model name separated by a slash. For example, "anthropic/claude-3-5-sonnet-latest" or "google/gemini-2.0-flash-exp"'}),l.jsx("li",{className:"text-xs text-muted-secondary",children:"Depending on the provider, we will use the respective API key and additional configuration."})]}),e[13]=p):p=e[13],e[14]!==s?(m=j=>{const{field:w}=j;return l.jsxs("div",{className:"flex flex-col",children:[l.jsxs(Y,{children:[l.jsx(U,{children:"Custom Rules"}),l.jsx(Q,{children:l.jsx(di,{"data-testid":"ai-rules-input",className:"m-0 inline-flex w-full h-32 p-2 text-sm",placeholder:"e.g. Always use type hints; prefer polars over pandas",...w,value:w.value})}),l.jsx(X,{}),l.jsx(ee,{userConfig:s,name:"ai.rules"})]}),l.jsx(J,{children:"Custom rules to include in all AI completion prompts."})]})},e[14]=s,e[15]=m):m=e[15],e[16]!==t.control||e[17]!==m?(k=l.jsx(G,{control:t.control,name:"ai.rules",render:m}),e[16]=t.control,e[17]=m,e[18]=k):k=e[18],e[19]!==k||e[20]!==r||e[21]!==g?(y=l.jsxs(Dt,{children:[c,d,r,g,p,k]}),e[19]=k,e[20]=r,e[21]=g,e[22]=y):y=e[22],y},wo=n=>{const e=te.c(51),{providerId:t,models:s,enabledModels:i,onToggleModel:a,onToggleProvider:o,onDeleteModel:c}=n;let d;if(e[0]!==i||e[1]!==s||e[2]!==t){let z;e[4]!==i||e[5]!==t?(z=H=>i.has(new Qe(t,H.model).id),e[4]=i,e[5]=t,e[6]=z):z=e[6],d=s.filter(z),e[0]=i,e[1]=s,e[2]=t,e[3]=d}else d=e[3];const u=d.length,r=s.length;let h;e[7]!==t?(h=Ln.getProviderInfo(t),e[7]=t,e[8]=h):h=e[8];const g=h;let p;e[9]!==(g==null?void 0:g.name)||e[10]!==t?(p=(g==null?void 0:g.name)||si.startCase(t),e[9]=g==null?void 0:g.name,e[10]=t,e[11]=p):p=e[11];const m=p,k=u!==0&&(u===r||"indeterminate");let y;e[12]!==u||e[13]!==o||e[14]!==t||e[15]!==r?(y=()=>{o(t,u<r/2)},e[12]=u,e[13]=o,e[14]=t,e[15]=r,e[16]=y):y=e[16];const j=yt(y);let w,v,S,M,P,_,D,I,$,F;if(e[17]===Symbol.for("react.memo_cache_sentinel")?(w=Hn.stopPropagation(),e[17]=w):w=e[17],e[18]!==k||e[19]!==j?(v=l.jsx(ce,{checked:k,onCheckedChange:j,onClick:w}),e[18]=k,e[19]=j,e[20]=v):v=e[20],e[21]!==t?(S=l.jsx(Xe,{provider:t,className:"h-5 w-5"}),e[21]=t,e[22]=S):S=e[22],e[23]!==m?(M=l.jsx("h2",{className:"font-semibold",children:m}),e[23]=m,e[24]=M):M=e[24],e[25]!==u||e[26]!==r?(P=l.jsxs("p",{className:"text-sm text-muted-secondary",children:[u,"/",r," models"]}),e[25]=u,e[26]=r,e[27]=P):P=e[27],e[28]!==M||e[29]!==P?(_=l.jsxs("div",{className:"flex items-center justify-between w-full",children:[M,P]}),e[28]=M,e[29]=P,e[30]=_):_=e[30],e[31]===Symbol.for("react.memo_cache_sentinel")?(D=l.jsx(ui,{slot:"chevron",children:l.jsx(hi,{className:"h-4 w-4 text-muted-foreground shrink-0 transition-transform duration-200 group-data-[expanded]:rotate-90"})}),e[31]=D):D=e[31],e[32]!==_||e[33]!==v||e[34]!==S?(I=l.jsx(_l,{children:l.jsxs("div",{className:"flex items-center gap-3 px-3 py-3 hover:bg-muted/50 cursor-pointer outline-none focus-visible:outline-none",children:[v,S,_,D]})}),e[32]=_,e[33]=v,e[34]=S,e[35]=I):I=e[35],e[36]!==i||e[37]!==s||e[38]!==c||e[39]!==a||e[40]!==t){let z;e[42]!==i||e[43]!==c||e[44]!==a||e[45]!==t?(z=H=>{const C=new Qe(t,H.model).id;return l.jsx(vo,{qualifiedId:C,model:H,isEnabled:i.has(C),onToggle:a,onDelete:c},C)},e[42]=i,e[43]=c,e[44]=a,e[45]=t,e[46]=z):z=e[46],$=s.map(z),e[36]=i,e[37]=s,e[38]=c,e[39]=a,e[40]=t,e[41]=$}else $=e[41];return e[47]!==t||e[48]!==I||e[49]!==$?(F=l.jsxs(Pl,{id:t,hasChildItems:!0,textValue:t,className:"outline-none data-focused:bg-muted/50 group",children:[I,$]}),e[47]=t,e[48]=I,e[49]=$,e[50]=F):F=e[50],F},So=({form:n,onSubmit:e})=>{const t=Vn({control:n.control,name:"ai.models.custom_models"}),s=b.useMemo(()=>Ln.create({displayedModels:[],customModels:t}),[t]),i=Vn({control:n.control,name:"ai.models.displayed_models",defaultValue:[]}),a=new Set(i),o=s.getGroupedModelsByProvider(),c=s.getListModelsByProvider(),d=yt(h=>{const g=a.has(h)?i.filter(p=>p!==h):[...i,h];n.setValue("ai.models.displayed_models",g),e(n.getValues())}),u=yt(async(h,g)=>{const p=o.get(h)||[],m=new Set(p.map(y=>new Qe(h,y.model).id)),k=g?[...new Set([...i,...m])]:i.filter(y=>!m.has(y));n.setValue("ai.models.displayed_models",k),e(n.getValues())}),r=yt(h=>{const g=t.filter(p=>p!==h);n.setValue("ai.models.custom_models",g),e(n.getValues())});return l.jsxs(Dt,{className:"gap-2",children:[l.jsx("p",{className:"text-sm text-muted-secondary mb-6",children:"Control which AI models are displayed in model selection dropdowns. When no models are selected, all available models will be shown."}),l.jsx("div",{className:"border rounded-md bg-background",children:l.jsx(Ma,{"aria-label":"AI Models by Provider",className:"flex-1 overflow-auto outline-none focus-visible:outline-none",selectionMode:"none",children:c.map(([h,g])=>l.jsx(wo,{providerId:h,models:g,enabledModels:a,onToggleModel:d,onToggleProvider:u,onDeleteModel:r},h))})}),l.jsx(No,{form:n,customModels:t})]})},No=n=>{const e=te.c(69),{form:t,customModels:s}=n,[i,a]=b.useState(!1),[o,c]=b.useState(!1),[d,u]=b.useState(null),[r,h]=b.useState(""),[g,p]=b.useState(""),m=b.useId(),k=b.useId(),y=b.useId(),j=d==="custom",w=j?r:d;let v;e[0]!==g||e[1]!==w?(v=(w==null?void 0:w.trim())&&(g==null?void 0:g.trim()),e[0]=g,e[1]=w,e[2]=v):v=e[2];const S=v;let M;e[3]===Symbol.for("react.memo_cache_sentinel")?(M=()=>{u(null),h(""),p(""),a(!1)},e[3]=M):M=e[3];const P=M;let _;e[4]!==s||e[5]!==t||e[6]!==S||e[7]!==g||e[8]!==w?(_=()=>{if(!S)return;const we=new Qe(w,g);t.setValue("ai.models.custom_models",[we.id,...s]),P(),c(!0),setTimeout(()=>c(!1),2e3)},e[4]=s,e[5]=t,e[6]=S,e[7]=g,e[8]=w,e[9]=_):_=e[9];const D=_;let I;e[10]!==m?(I=l.jsx(De,{htmlFor:m,className:"text-sm font-medium text-muted-foreground min-w-12",children:"Provider"}),e[10]=m,e[11]=I):I=e[11];const $=d||"";let F,z,H,C,A,R,q,O;e[12]===Symbol.for("react.memo_cache_sentinel")?(F=we=>u(we),e[12]=F):F=e[12],e[13]!==d?(z=d?l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(Xe,{provider:d,className:"h-3.5 w-3.5"}),l.jsx("span",{children:Bn(d)})]}):l.jsx("span",{className:"text-muted-foreground",children:"Select..."}),e[13]=d,e[14]=z):z=e[14],e[15]!==m||e[16]!==z?(H=l.jsx(mi,{id:m,className:"w-40 truncate",children:z}),e[15]=m,e[16]=z,e[17]=H):H=e[17],e[18]===Symbol.for("react.memo_cache_sentinel")?(C=l.jsx(ii,{children:l.jsxs(ai,{children:[l.jsx(On,{value:"custom",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Xe,{provider:"openai-compatible",className:"h-4 w-4"}),l.jsx("span",{children:"Custom"})]})}),oi.filter(Do).map(Mo)]})}),e[18]=C):C=e[18],e[19]!==$||e[20]!==H?(A=l.jsxs(pi,{value:$,onValueChange:F,children:[H,C]}),e[19]=$,e[20]=H,e[21]=A):A=e[21],e[22]!==A||e[23]!==I?(R=l.jsxs("div",{className:"flex items-center gap-2",children:[I,A]}),e[22]=A,e[23]=I,e[24]=R):R=e[24],e[25]!==k||e[26]!==r||e[27]!==j?(q=j&&l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(De,{htmlFor:k,className:"text-sm font-medium text-muted-foreground min-w-12",children:"Name"}),l.jsx(je,{id:k,value:r,onChange:we=>h(we.target.value),placeholder:"openrouter",className:"w-40 truncate"})]}),e[25]=k,e[26]=r,e[27]=j,e[28]=q):q=e[28],e[29]!==R||e[30]!==q?(O=l.jsxs("div",{className:"flex flex-col gap-2",children:[R,q]}),e[29]=R,e[30]=q,e[31]=O):O=e[31];const f=O,V=j&&"self-start";let B,L,W,K,x;e[32]!==V?(B=_e("flex items-center gap-2",V),e[32]=V,e[33]=B):B=e[33],e[34]!==y?(L=l.jsx(De,{htmlFor:y,className:"text-sm font-medium text-muted-foreground",children:"Model"}),e[34]=y,e[35]=L):L=e[35],e[36]===Symbol.for("react.memo_cache_sentinel")?(W=we=>p(we.target.value),e[36]=W):W=e[36],e[37]!==g||e[38]!==y?(K=l.jsx(je,{id:y,value:g,onChange:W,placeholder:"gpt-4",className:"text-xs mb-0"}),e[37]=g,e[38]=y,e[39]=K):K=e[39],e[40]!==B||e[41]!==L||e[42]!==K?(x=l.jsxs("div",{className:B,children:[L,K]}),e[40]=B,e[41]=L,e[42]=K,e[43]=x):x=e[43];const N=x,le=j&&"self-end";let se;e[44]!==le?(se=_e("flex gap-1.5 ml-auto",le),e[44]=le,e[45]=se):se=e[45];const T=!S;let ie,Z,oe,he;e[46]!==D||e[47]!==T?(ie=l.jsx(me,{onClick:D,disabled:T,size:"xs",children:"Add"}),e[46]=D,e[47]=T,e[48]=ie):ie=e[48],e[49]===Symbol.for("react.memo_cache_sentinel")?(Z=l.jsx(me,{variant:"outline",onClick:P,size:"xs",children:"Cancel"}),e[49]=Z):Z=e[49],e[50]!==se||e[51]!==ie?(oe=l.jsxs("div",{className:se,children:[ie,Z]}),e[50]=se,e[51]=ie,e[52]=oe):oe=e[52],e[53]!==N||e[54]!==f||e[55]!==oe?(he=l.jsxs("div",{className:"flex items-center gap-3 p-3 border border-border rounded-md",children:[f,N,oe]}),e[53]=N,e[54]=f,e[55]=oe,e[56]=he):he=e[56];const Ce=i&&he;let fe,Ee,Te,$e,ze,lt;return e[57]===Symbol.for("react.memo_cache_sentinel")?(fe=we=>{we.preventDefault(),a(!0)},e[57]=fe):fe=e[57],e[58]===Symbol.for("react.memo_cache_sentinel")?(Ee=l.jsx(gi,{className:"h-4 w-4 mr-2 mb-0.5"}),e[58]=Ee):Ee=e[58],e[59]!==i?(Te=l.jsxs(me,{onClick:fe,variant:"link",disabled:i,children:[Ee,"Add Model"]}),e[59]=i,e[60]=Te):Te=e[60],e[61]!==o?($e=o&&l.jsx("div",{className:"flex items-center gap-1 text-green-700 bg-green-500/10 px-2 py-1 rounded-md ml-auto",children:"\u2713 Model added"}),e[61]=o,e[62]=$e):$e=e[62],e[63]!==Te||e[64]!==$e?(ze=l.jsxs("div",{className:"flex flex-row text-sm",children:[Te,$e]}),e[63]=Te,e[64]=$e,e[65]=ze):ze=e[65],e[66]!==Ce||e[67]!==ze?(lt=l.jsxs("div",{children:[Ce,ze]}),e[66]=Ce,e[67]=ze,e[68]=lt):lt=e[68],lt},Ko=n=>{const e=te.c(17),{form:t,config:s,onSubmit:i}=n;let a,o,c,d,u;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=l.jsxs(Fn,{className:"mb-2",children:[l.jsx(xt,{value:"ai-features",children:"AI Features"}),l.jsx(xt,{value:"ai-providers",children:"AI Providers"}),l.jsx(xt,{value:"ai-models",children:"AI Models"})]}),e[0]=a):a=e[0],e[1]!==s||e[2]!==t||e[3]!==i?(o=l.jsxs(Ft,{value:"ai-features",children:[l.jsx(jo,{form:t,config:s,onSubmit:i}),l.jsx(Co,{form:t,config:s,onSubmit:i})]}),e[1]=s,e[2]=t,e[3]=i,e[4]=o):o=e[4],e[5]!==s||e[6]!==t||e[7]!==i?(c=l.jsx(Ft,{value:"ai-providers",children:l.jsx(ko,{form:t,config:s,onSubmit:i})}),e[5]=s,e[6]=t,e[7]=i,e[8]=c):c=e[8],e[9]!==s||e[10]!==t||e[11]!==i?(d=l.jsx(Ft,{value:"ai-models",children:l.jsx(So,{form:t,config:s,onSubmit:i})}),e[9]=s,e[10]=t,e[11]=i,e[12]=d):d=e[12],e[13]!==o||e[14]!==c||e[15]!==d?(u=l.jsxs(Rn,{defaultValue:"ai-features",className:"flex-1",children:[a,o,c,d]}),e[13]=o,e[14]=c,e[15]=d,e[16]=u):u=e[16],u};function Io(n){return l.jsx("option",{value:n,children:n},n)}function _o(n){return l.jsx("option",{value:n,children:n},n)}function Do(n){return n!=="marimo"}function Mo(n){return l.jsx(On,{value:n,children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Xe,{provider:n,className:"h-4 w-4"}),l.jsx("span",{children:Bn(n)})]})},n)}const Zl=[{id:"sql",packagesRequired:[{name:"duckdb"},{name:"sqlglot"}],additionalPackageInstalls:[{name:"polars[pyarrow]"}],description:"SQL cells"},{id:"charts",packagesRequired:[{name:"altair"}],additionalPackageInstalls:[],description:"Charts in datasource viewer"},{id:"fast-charts",packagesRequired:[{name:"vegafusion"},{name:"vl-convert-python"}],additionalPackageInstalls:[],description:"Fast server-side charts"},{id:"formatting",packagesRequired:[Pe()?{name:"black"}:{name:"ruff"}],additionalPackageInstalls:[],description:"Formatting"},{id:"ai",packagesRequired:[{name:"openai"}],additionalPackageInstalls:[],description:"AI features"},{id:"ipy-export",packagesRequired:[{name:"nbformat"}],additionalPackageInstalls:[],description:"Export as IPYNB"},{id:"testing",packagesRequired:[{name:"pytest"}],additionalPackageInstalls:[],description:"Autorun unit tests"}];Pe()||Zl.push({id:"lsp",packagesRequired:[{name:"python-lsp-server"},{name:"websockets"}],additionalPackageInstalls:[{name:"python-lsp-ruff"}],description:"Language Server Protocol*"});const Po=()=>{const n=te.c(21),[e]=_n(),t=e.package_management.manager,{getPackageList:s}=Fe();let i,a;n[0]!==s?(i=()=>s(),n[0]=s,n[1]=i):i=n[1],n[2]!==t?(a=[t],n[2]=t,n[3]=a):a=n[3];const{data:o,error:c,refetch:d,isPending:u}=Ni(i,a);if(u){let v;return n[4]===Symbol.for("react.memo_cache_sentinel")?(v=l.jsx(Gn,{size:"medium",centered:!0}),n[4]=v):v=n[4],v}if(c){let v;return n[5]!==c?(v=l.jsx(Ii,{error:c}),n[5]=c,n[6]=v):v=n[6],v}let r;n[7]!==(o==null?void 0:o.packages)?(r=new Set(((o==null?void 0:o.packages)||[]).map(Eo)),n[7]=o==null?void 0:o.packages,n[8]=r):r=n[8];const h=r;let g,p,m,k,y,j,w;return n[9]===Symbol.for("react.memo_cache_sentinel")?(g=l.jsx(wt,{children:"Optional Features"}),n[9]=g):g=n[9],n[10]===Symbol.for("react.memo_cache_sentinel")?(p=l.jsxs("p",{className:"text-sm text-muted-foreground",children:["marimo is lightweight, with few dependencies, to maximize compatibility with your own environments.",l.jsx("br",{}),"To unlock additional features in the marimo editor, you can install these optional dependencies:"]}),n[10]=p):p=n[10],n[11]===Symbol.for("react.memo_cache_sentinel")?(m=l.jsx(_i,{children:l.jsxs(Wn,{children:[l.jsx(vt,{children:"Dependency"}),l.jsx(vt,{children:"Feature"}),l.jsx(vt,{children:"Status"}),l.jsx(vt,{})]})}),n[11]=m):m=n[11],n[12]!==h||n[13]!==t||n[14]!==d?(k=Zl.map(v=>{const S=v.packagesRequired.every(P=>h.has(P.name.split("[")[0])),M=v.packagesRequired.map(To).join(", ");return l.jsxs(Wn,{className:"text-sm",children:[l.jsx(Rt,{children:v.description}),l.jsx(Rt,{className:"font-mono text-xs",children:M}),l.jsx(Rt,{children:S?l.jsxs("div",{className:"flex items-center",children:[l.jsx(Xn,{className:"h-4 w-4 text-(--grass-10) mr-2"}),l.jsx("span",{children:"Installed"})]}):l.jsxs("div",{className:"flex items-center",children:[l.jsx(Ki,{className:"h-4 w-4 text-(--red-10) mr-2"}),l.jsx(Ao,{packageSpecs:[...v.packagesRequired,...v.additionalPackageInstalls],packageManager:t,onSuccess:d})]})})]},v.id)}),n[12]=h,n[13]=t,n[14]=d,n[15]=k):k=n[15],n[16]!==k?(y=l.jsxs(Di,{children:[m,l.jsx(Mi,{children:k})]}),n[16]=k,n[17]=y):y=n[17],n[18]===Symbol.for("react.memo_cache_sentinel")?(j=l.jsx("p",{className:"text-muted-foreground mt-2",children:"*Requires server restart"}),n[18]=j):j=n[18],n[19]!==y?(w=l.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden gap-2",children:[g,p,y,j]}),n[19]=y,n[20]=w):w=n[20],w},Ao=({packageSpecs:n,packageManager:e,onSuccess:t})=>{const[s,i]=E.useState(!1),{addPackage:a}=Fe();return l.jsxs(me,{size:"xs",variant:"outline",className:_e("text-xs",s&&"opacity-50 cursor-not-allowed"),onClick:async()=>{try{i(!0);const o=n.map(d=>d.minVersion?`${d.name}>=${d.minVersion}`:d.name).join(" "),c=await a({package:o});c.success?(t(),Re({title:"Package installed",description:l.jsxs("span",{children:["The packages"," ",l.jsx(re,{className:"inline",children:n.map(d=>d.name).join(", ")})," ","have been added to your environment."]})})):Re({title:"Failed to install package",description:c.error,variant:"danger"})}finally{i(!1)}},disabled:s,children:[s?l.jsx(Gn,{size:"small",className:"mr-2 h-3 w-3"}):l.jsx(Qn,{className:"mr-2 h-3 w-3"}),"Install with ",e]})};function Eo(n){return n.name}function To(n){return n.name}const ne="flex flex-row items-center space-x-1 space-y-0",Jl=[{id:"editor",label:"Editor",Icon:En,className:"bg-(--blue-4)"},{id:"display",label:"Display",Icon:Ji,className:"bg-(--grass-4)"},{id:"packageManagement",label:"Package Management",Icon:ea,className:"bg-(--red-4)"},{id:"runtime",label:"Runtime",Icon:Zn,className:"bg-(--amber-4)"},{id:"ai",label:"AI",Icon:Un,className:"bg-[linear-gradient(45deg,var(--purple-5),var(--cyan-5))]"},{id:"optionalDeps",label:"Optional Dependencies",Icon:Jn,className:"bg-(--orange-4)"},{id:"labs",label:"Labs",Icon:Gi,className:"bg-(--slate-4)"}],es=Ge(Jl[0].id),Zt="__system__",$o=()=>{const n=te.c(52),[e,t]=zn(),s=b.useRef(null),i=Vt(Qt),[a,o]=Ye(es),c=pt(Pi),d=pt(Ai),{locale:u}=at(),{saveUserConfig:r}=Fe();let h,g;n[0]===Symbol.for("react.memo_cache_sentinel")?(h=gn(Ei),n[0]=h):h=n[0],n[1]!==e?(g={resolver:h,defaultValues:e},n[1]=e,n[2]=g):g=n[2];const p=fn(g);let m;n[3]!==r||n[4]!==t?(m=async K=>{await r({config:K}).then(()=>{t(K)})},n[3]=r,n[4]=t,n[5]=m):m=n[5];const k=xn(m,100);let y;n[6]===Symbol.for("react.memo_cache_sentinel")?(y=Pe(),n[6]=y):y=n[6];const j=y,w=b.useId(),v=b.useId();let S;n[7]!==a||n[8]!==c||n[9]!==e||n[10]!==p||n[11]!==w||n[12]!==v||n[13]!==k||n[14]!==o||n[15]!==i?(S=()=>{switch(a){case"editor":return l.jsxs(l.Fragment,{children:[l.jsxs(ke,{title:"Autosave",children:[l.jsx(G,{control:p.control,name:"save.autosave",render:K=>{const{field:x}=K;return l.jsxs(Y,{className:ne,children:[l.jsx(U,{className:"font-normal",children:"Autosave enabled"}),l.jsx(Q,{children:l.jsx(ce,{"data-testid":"autosave-checkbox",checked:x.value==="after_delay",disabled:x.disabled,onCheckedChange:N=>{x.onChange(N?"after_delay":"off")}})}),l.jsx(X,{}),l.jsx(ee,{userConfig:e,name:"save.autosave"})]})}}),l.jsx(G,{control:p.control,name:"save.autosave_delay",render:K=>{const{field:x}=K;return l.jsxs(Y,{className:ne,children:[l.jsx(U,{children:"Autosave delay (seconds)"}),l.jsx(Q,{children:l.jsx(Ze,{"aria-label":"Autosave delay","data-testid":"autosave-delay-input",className:"m-0 w-24",isDisabled:p.getValues("save.autosave")!=="after_delay",...x,value:x.value/1e3,minValue:1,onChange:N=>{x.onChange(1e3*N),Number.isNaN(N)||k(p.getValues())}})}),l.jsx(X,{}),l.jsx(ee,{userConfig:e,name:"save.autosave_delay"})]})}}),l.jsx(G,{control:p.control,name:"runtime.default_auto_download",render:K=>{const{field:x}=K;return l.jsxs("div",{className:"flex flex-col gap-y-1",children:[l.jsxs(Y,{className:ne,children:[l.jsx(U,{children:"Save cell outputs as"}),l.jsx(Q,{children:l.jsxs("div",{className:"flex gap-4",children:[l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(ce,{id:w,checked:Array.isArray(x.value)&&x.value.includes("html"),onCheckedChange:()=>{const N=Array.isArray(x.value)?x.value:[];x.onChange(dt(N,"html"))}}),l.jsx(U,{htmlFor:w,children:"HTML"})]}),l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(ce,{id:v,checked:Array.isArray(x.value)&&x.value.includes("ipynb"),onCheckedChange:()=>{const N=Array.isArray(x.value)?x.value:[];x.onChange(dt(N,"ipynb"))}}),l.jsx(U,{htmlFor:v,children:"IPYNB"})]})]})}),l.jsx(X,{}),l.jsx(ee,{userConfig:e,name:"runtime.default_auto_download"})]}),l.jsxs(J,{children:["When enabled, marimo will periodically save notebooks in your selected formats (HTML, IPYNB) to a folder named"," ",l.jsx(re,{className:"inline",children:"__marimo__"})," next to your notebook file."]})]})}})]}),l.jsxs(ke,{title:"Formatting",children:[l.jsx(G,{control:p.control,name:"save.format_on_save",render:K=>{const{field:x}=K;return l.jsxs(Y,{className:ne,children:[l.jsx(U,{className:"font-normal",children:"Format on save"}),l.jsx(Q,{children:l.jsx(ce,{"data-testid":"format-on-save-checkbox",checked:x.value,disabled:x.disabled,onCheckedChange:N=>{x.onChange(N)}})}),l.jsx(X,{}),l.jsx(ee,{userConfig:e,name:"save.format_on_save"})]})}}),l.jsx(G,{control:p.control,name:"formatting.line_length",render:K=>{const{field:x}=K;return l.jsxs("div",{className:"flex flex-col space-y-1",children:[l.jsxs(Y,{className:ne,children:[l.jsx(U,{children:"Line length"}),l.jsx(Q,{children:l.jsx(Ze,{"aria-label":"Line length","data-testid":"line-length-input",className:"m-0 w-24",...x,value:x.value,minValue:1,maxValue:1e3,onChange:N=>{x.onChange(N),Number.isNaN(N)||k(p.getValues())}})}),l.jsx(X,{}),l.jsx(ee,{userConfig:e,name:"formatting.line_length"})]}),l.jsx(J,{children:"Maximum line length when formatting code."})]})}})]}),l.jsx(ke,{title:"Autocomplete",children:l.jsx(G,{control:p.control,name:"completion.activate_on_typing",render:K=>{const{field:x}=K;return l.jsxs("div",{className:"flex flex-col space-y-1",children:[l.jsxs(Y,{className:ne,children:[l.jsx(U,{className:"font-normal",children:"Autocomplete"}),l.jsx(Q,{children:l.jsx(ce,{"data-testid":"autocomplete-checkbox",checked:x.value,disabled:x.disabled,onCheckedChange:N=>{x.onChange(!!N)}})}),l.jsx(X,{}),l.jsx(ee,{userConfig:e,name:"completion.activate_on_typing"})]}),l.jsx(J,{children:"When unchecked, code completion is still available through a hotkey."}),l.jsx("div",{children:l.jsx(me,{variant:"link",className:"mb-0 px-0",type:"button",onClick:N=>{N.preventDefault(),N.stopPropagation(),o("ai")},children:"Edit AI autocomplete"})})]})}})}),l.jsxs(ke,{title:"Language Servers",children:[l.jsxs(J,{children:["See the"," ",l.jsx(de,{href:"https://docs.marimo.io/guides/editor_features/language_server/",children:"docs"})," ","for more information about language server support."]}),l.jsxs(J,{children:[l.jsx("strong",{children:"Note:"})," When using multiple language servers, different features may conflict."]}),l.jsx(G,{control:p.control,name:"language_servers.pylsp.enabled",render:K=>{const{field:x}=K;return l.jsxs("div",{className:"flex flex-col gap-1",children:[l.jsxs(Y,{className:ne,children:[l.jsxs(U,{children:[l.jsx(bt,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"Python Language Server (",l.jsx(de,{href:"https://github.com/python-lsp/python-lsp-server",children:"docs"}),")"]}),l.jsx(Q,{children:l.jsx(ce,{"data-testid":"pylsp-checkbox",checked:x.value,disabled:x.disabled,onCheckedChange:N=>{x.onChange(!!N)}})}),l.jsx(X,{}),l.jsx(ee,{userConfig:e,name:"language_servers.pylsp.enabled"})]}),x.value&&!c.pylsp&&l.jsxs(ft,{kind:"danger",children:["The Python Language Server is not available in your current environment. Please install"," ",l.jsx(re,{className:"inline",children:"python-lsp-server"})," in your environment."]})]})}}),l.jsx(G,{control:p.control,name:"language_servers.basedpyright.enabled",render:K=>{const{field:x}=K;return l.jsxs("div",{className:"flex flex-col gap-1",children:[l.jsxs(Y,{className:ne,children:[l.jsxs(U,{children:[l.jsx(bt,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"basedpyright (",l.jsx(de,{href:"https://github.com/DetachHead/basedpyright",children:"docs"}),")"]}),l.jsx(Q,{children:l.jsx(ce,{"data-testid":"basedpyright-checkbox",checked:x.value,disabled:x.disabled,onCheckedChange:N=>{x.onChange(!!N)}})}),l.jsx(X,{}),l.jsx(ee,{userConfig:e,name:"language_servers.basedpyright.enabled"})]}),x.value&&!c.basedpyright&&l.jsxs(ft,{kind:"danger",children:["basedpyright is not available in your current environment. Please install"," ",l.jsx(re,{className:"inline",children:"basedpyright"})," in your environment."]})]})}}),l.jsx(G,{control:p.control,name:"language_servers.ty.enabled",render:K=>{const{field:x}=K;return l.jsxs("div",{className:"flex flex-col gap-1",children:[l.jsxs(Y,{className:ne,children:[l.jsxs(U,{children:[l.jsx(bt,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"ty (",l.jsx(de,{href:"https://github.com/astral-sh/ty",children:"docs"}),")"]}),l.jsx(Q,{children:l.jsx(ce,{"data-testid":"ty-checkbox",checked:x.value,disabled:x.disabled,onCheckedChange:N=>{x.onChange(!!N)}})}),l.jsx(X,{}),l.jsx(ee,{userConfig:e,name:"language_servers.ty.enabled"})]}),x.value&&!c.ty&&l.jsxs(ft,{kind:"danger",children:["ty is not available in your current environment. Please install ",l.jsx(re,{className:"inline",children:"ty"})," in your environment."]})]})}}),l.jsx(G,{control:p.control,name:"diagnostics.enabled",render:K=>{const{field:x}=K;return l.jsxs(Y,{className:ne,children:[l.jsxs(U,{children:[l.jsx(bt,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"Diagnostics"]}),l.jsx(Q,{children:l.jsx(ce,{"data-testid":"diagnostics-checkbox",checked:x.value,disabled:x.disabled,onCheckedChange:N=>{x.onChange(!!N)}})}),l.jsx(X,{}),l.jsx(ee,{userConfig:e,name:"diagnostics.enabled"})]})}})]}),l.jsxs(ke,{title:"Keymap",children:[l.jsx(G,{control:p.control,name:"keymap.preset",render:K=>{const{field:x}=K;return l.jsx("div",{className:"flex flex-col space-y-1",children:l.jsxs(Y,{className:ne,children:[l.jsx(U,{children:"Keymap"}),l.jsx(Q,{children:l.jsx(ge,{"data-testid":"keymap-select",onChange:N=>x.onChange(N.target.value),value:x.value,disabled:x.disabled,className:"inline-flex mr-2",children:no.map(zo)})}),l.jsx(X,{}),l.jsx(ee,{userConfig:e,name:"keymap.preset"})]})})}}),l.jsx(G,{control:p.control,name:"keymap.destructive_delete",render:K=>{const{field:x}=K;return l.jsxs("div",{className:"flex flex-col space-y-1",children:[l.jsxs(Y,{className:ne,children:[l.jsx(U,{className:"font-normal",children:"Destructive delete"}),l.jsx(Q,{children:l.jsx(ce,{"data-testid":"destructive-delete-checkbox",checked:x.value,disabled:x.disabled,onCheckedChange:N=>{x.onChange(!!N)}})}),l.jsx(X,{}),l.jsx(ee,{userConfig:e,name:"keymap.destructive_delete"})]}),l.jsxs(J,{className:"flex items-center gap-1",children:["Allow deleting non-empty cells",l.jsx(Me,{content:l.jsxs("div",{className:"max-w-xs",children:[l.jsx("strong",{children:"Use with caution:"})," Deleting cells with code can lose work and computed results since variables are removed from memory."]}),children:l.jsx(zi,{className:"w-3 h-3 text-(--amber-11)"})})]}),l.jsx("div",{children:l.jsx(me,{variant:"link",className:"mb-0 px-0",type:"button",onClick:N=>{N.preventDefault(),N.stopPropagation(),i(!0)},children:"Edit Keyboard Shortcuts"})})]})}})]})]});case"display":return l.jsxs(l.Fragment,{children:[l.jsxs(ke,{title:"Display",children:[l.jsx(G,{control:p.control,name:"display.default_width",render:K=>{const{field:x}=K;return l.jsxs("div",{className:"flex flex-col space-y-1",children:[l.jsxs(Y,{className:ne,children:[l.jsx(U,{children:"Default width"}),l.jsx(Q,{children:l.jsx(ge,{"data-testid":"user-config-width-select",onChange:N=>x.onChange(N.target.value),value:x.value,disabled:x.disabled,className:"inline-flex mr-2",children:["compact","medium","full","columns"].map(Fo)})}),l.jsx(X,{}),l.jsx(ee,{userConfig:e,name:"display.default_width"})]}),l.jsx(J,{children:'The default app width for new notebooks; overridden by "width" in the application config.'})]})}}),l.jsx(G,{control:p.control,name:"display.theme",render:K=>{const{field:x}=K;return l.jsxs("div",{className:"flex flex-col space-y-1",children:[l.jsxs(Y,{className:ne,children:[l.jsx(U,{children:"Theme"}),l.jsx(Q,{children:l.jsx(ge,{"data-testid":"theme-select",onChange:N=>x.onChange(N.target.value),value:x.value,disabled:x.disabled,className:"inline-flex mr-2",children:$i.map(Ro)})}),l.jsx(X,{}),l.jsx(ee,{userConfig:e,name:"display.theme"})]}),l.jsx(J,{children:"This theme will be applied to the user's configuration; it does not affect theme when sharing the notebook."})]})}}),l.jsx(G,{control:p.control,name:"display.code_editor_font_size",render:K=>{const{field:x}=K;return l.jsxs(Y,{className:ne,children:[l.jsx(U,{children:"Code editor font size (px)"}),l.jsx(Q,{children:l.jsx("span",{className:"inline-flex mr-2",children:l.jsx(Ze,{"aria-label":"Code editor font size","data-testid":"code-editor-font-size-input",className:"m-0 w-24",...x,value:x.value,minValue:8,maxValue:32,onChange:N=>{x.onChange(N),k(p.getValues())}})})}),l.jsx(X,{}),l.jsx(ee,{userConfig:e,name:"display.code_editor_font_size"})]})}}),l.jsx(G,{control:p.control,name:"display.locale",render:K=>{const{field:x}=K;return l.jsxs("div",{className:"flex flex-col space-y-1",children:[l.jsxs(Y,{className:ne,children:[l.jsx(U,{children:"Locale"}),l.jsx(Q,{children:l.jsxs(ge,{"data-testid":"locale-select",onChange:N=>{N.target.value===Zt?x.onChange(void 0):x.onChange(N.target.value)},value:x.value||Zt,disabled:x.disabled,className:"inline-flex mr-2",children:[l.jsx("option",{value:Zt,children:"System"}),navigator.languages.map(Vo)]})}),l.jsx(X,{}),l.jsx(ee,{userConfig:e,name:"display.locale"})]}),l.jsxs(J,{children:["The locale to use for the notebook. If your desired locale is not listed, you can change it manually via"," ",l.jsx(re,{className:"inline",children:"marimo config show"}),"."]})]})}}),l.jsx(G,{control:p.control,name:"display.reference_highlighting",render:K=>{const{field:x}=K;return l.jsxs("div",{className:"flex flex-col space-y-1",children:[l.jsxs(Y,{className:ne,children:[l.jsx(U,{children:"Reference highlighting"}),l.jsx(Q,{children:l.jsx(ce,{"data-testid":"reference-highlighting-checkbox",checked:x.value,onCheckedChange:x.onChange})}),l.jsx(X,{}),l.jsx(ee,{userConfig:e,name:"display.reference_highlighting"})]}),l.jsx(J,{children:"Visually emphasizes variables in a cell that are defined elsewhere in the notebook."})]})}})]}),l.jsxs(ke,{title:"Outputs",children:[l.jsx(G,{control:p.control,name:"display.cell_output",render:K=>{const{field:x}=K;return l.jsxs("div",{className:"flex flex-col space-y-1",children:[l.jsxs(Y,{className:ne,children:[l.jsx(U,{children:"Cell output area"}),l.jsx(Q,{children:l.jsx(ge,{"data-testid":"cell-output-select",onChange:N=>x.onChange(N.target.value),value:x.value,disabled:x.disabled,className:"inline-flex mr-2",children:["above","below"].map(Lo)})}),l.jsx(X,{}),l.jsx(ee,{userConfig:e,name:"display.cell_output"})]}),l.jsx(J,{children:"Where to display cell's output."})]})}}),l.jsx(G,{control:p.control,name:"display.dataframes",render:K=>{const{field:x}=K;return l.jsxs("div",{className:"flex flex-col space-y-1",children:[l.jsxs(Y,{className:ne,children:[l.jsx(U,{children:"Dataframe viewer"}),l.jsx(Q,{children:l.jsx(ge,{"data-testid":"display-dataframes-select",onChange:N=>x.onChange(N.target.value),value:x.value,disabled:x.disabled,className:"inline-flex mr-2",children:["rich","plain"].map(Bo)})}),l.jsx(X,{}),l.jsx(ee,{userConfig:e,name:"display.dataframes"})]}),l.jsx(J,{children:"Whether to use marimo's rich dataframe viewer or a plain HTML table. This requires restarting your notebook to take effect."})]})}}),l.jsx(G,{control:p.control,name:"display.default_table_page_size",render:K=>{const{field:x}=K;return l.jsxs("div",{className:"flex flex-col space-y-1",children:[l.jsxs(Y,{className:ne,children:[l.jsx(U,{children:"Default table page size"}),l.jsx(Q,{children:l.jsx(Ze,{"aria-label":"Default table page size","data-testid":"default-table-page-size-input",className:"m-0 w-24",...x,value:x.value,minValue:1,step:1,onChange:N=>{x.onChange(N),Number.isNaN(N)||k(p.getValues())}})}),l.jsx(X,{}),l.jsx(ee,{userConfig:e,name:"display.default_table_page_size"})]}),l.jsx(J,{children:"The default number of rows displayed in dataframes and SQL results."})]})}}),l.jsx(G,{control:p.control,name:"display.default_table_max_columns",render:K=>{const{field:x}=K;return l.jsxs("div",{className:"flex flex-col space-y-1",children:[l.jsxs(Y,{className:ne,children:[l.jsx(U,{children:"Default table max columns"}),l.jsx(Q,{children:l.jsx(Ze,{"aria-label":"Default table max columns","data-testid":"default-table-max-columns-input",className:"m-0 w-24",...x,value:x.value,minValue:1,step:1,onChange:N=>{x.onChange(N),Number.isNaN(N)||k(p.getValues())}})}),l.jsx(X,{}),l.jsx(ee,{userConfig:e,name:"display.default_table_max_columns"})]}),l.jsx(J,{children:"The default maximum number of columns displayed in dataframes and SQL results."})]})}})]})]});case"packageManagement":return l.jsx(ke,{title:"Package Management",children:l.jsx(G,{control:p.control,disabled:j,name:"package_management.manager",render:K=>{const{field:x}=K;return l.jsxs("div",{className:"flex flex-col space-y-1",children:[l.jsxs(Y,{className:ne,children:[l.jsx(U,{children:"Manager"}),l.jsx(Q,{children:l.jsx(ge,{"data-testid":"package-manager-select",onChange:N=>x.onChange(N.target.value),value:x.value,disabled:x.disabled,className:"inline-flex mr-2",children:Ti.map(Oo)})}),l.jsx(X,{}),l.jsx(ee,{userConfig:e,name:"package_management.manager"})]}),l.jsxs(J,{children:["When marimo comes across a module that is not installed, you will be prompted to install it using your preferred package manager. Learn more in the"," ",l.jsx(de,{href:"https://docs.marimo.io/guides/editor_features/package_management.html",children:"docs"}),".",l.jsx("br",{}),l.jsx("br",{}),"Running marimo in a"," ",l.jsx(de,{href:"https://docs.marimo.io/guides/editor_features/package_management.html#running-marimo-in-a-sandbox-environment-uv-only",children:"sandboxed environment"})," ","is only supported by ",l.jsx(re,{className:"inline",children:"uv"})]})]})}})});case"runtime":return l.jsxs(ke,{title:"Runtime configuration",children:[l.jsx(G,{control:p.control,name:"runtime.auto_instantiate",render:K=>{const{field:x}=K;return l.jsxs("div",{className:"flex flex-col gap-y-1",children:[l.jsxs(Y,{className:ne,children:[l.jsx(U,{className:"font-normal",children:"Autorun on startup"}),l.jsx(Q,{children:l.jsx(ce,{"data-testid":"auto-instantiate-checkbox",disabled:x.disabled,checked:x.value,onCheckedChange:x.onChange})}),l.jsx(X,{}),l.jsx(ee,{userConfig:e,name:"runtime.auto_instantiate"})]}),l.jsx(J,{children:"Whether to automatically run all cells on startup."})]})}}),l.jsx(G,{control:p.control,name:"runtime.on_cell_change",render:K=>{const{field:x}=K;return l.jsxs("div",{className:"flex flex-col gap-y-1",children:[l.jsxs(Y,{className:ne,children:[l.jsx(U,{className:"font-normal",children:"On cell change"}),l.jsx(Q,{children:l.jsx(ge,{"data-testid":"on-cell-change-select",onChange:N=>x.onChange(N.target.value),value:x.value,className:"inline-flex mr-2",children:["lazy","autorun"].map(qo)})}),l.jsx(X,{}),l.jsx(ee,{userConfig:e,name:"runtime.on_cell_change"})]}),l.jsx(J,{children:`Whether marimo should automatically run cells or just mark them as stale. If "autorun", marimo will automatically run affected cells when a cell is run or a UI element is interacted with; if "lazy", marimo will mark affected cells as stale but won't re-run them.`})]})}}),l.jsx(G,{control:p.control,name:"runtime.auto_reload",render:K=>{const{field:x}=K;return l.jsxs("div",{className:"flex flex-col gap-y-1",children:[l.jsxs(Y,{className:ne,children:[l.jsx(U,{className:"font-normal",children:"On module change"}),l.jsx(Q,{children:l.jsx(ge,{"data-testid":"auto-reload-select",onChange:N=>x.onChange(N.target.value),value:x.value,disabled:j,className:"inline-flex mr-2",children:["off","lazy","autorun"].map(Ho)})}),l.jsx(X,{}),l.jsx(ee,{userConfig:e,name:"runtime.auto_reload"})]}),l.jsx(J,{children:'Whether marimo should automatically reload modules before executing cells. If "lazy", marimo will mark cells affected by module modifications as stale; if "autorun", affected cells will be automatically re-run.'})]})}}),l.jsx(G,{control:p.control,name:"runtime.default_sql_output",render:K=>{const{field:x}=K;return l.jsxs("div",{className:"flex flex-col space-y-1",children:[l.jsxs(Y,{className:ne,children:[l.jsx(U,{children:"Default SQL output"}),l.jsx(Q,{children:l.jsx(ge,{"data-testid":"user-config-sql-output-select",onChange:N=>x.onChange(N.target.value),value:x.value,disabled:x.disabled,className:"inline-flex mr-2",children:El.map(Uo)})}),l.jsx(X,{}),l.jsx(ee,{userConfig:e,name:"runtime.default_sql_output"})]}),l.jsx(J,{children:'The default SQL output type for new notebooks; overridden by "sql_output" in the application config.'})]})}}),l.jsx(G,{control:p.control,name:"runtime.reactive_tests",render:K=>{const{field:x}=K;return l.jsxs("div",{className:"flex flex-col gap-y-1",children:[l.jsxs(Y,{className:ne,children:[l.jsx(U,{className:"font-normal",children:"Autorun Unit Tests"}),l.jsx(Q,{children:l.jsx(ce,{"data-testid":"reactive-test-checkbox",checked:x.value,onCheckedChange:x.onChange})})]}),l.jsx(ee,{userConfig:e,name:"runtime.reactive_tests"}),l.jsx(X,{}),l.jsx(J,{children:"Enable reactive pytest tests in notebook. When a cell contains only test functions (test_*) and classes (Test_*), marimo will automatically run them with pytest (requires notebook restart)."})," "]})}}),l.jsxs(J,{children:["Learn more in the"," ",l.jsx(de,{href:"https://docs.marimo.io/guides/reactivity/#configuring-how-marimo-runs-cells",children:"docs"}),"."]})]});case"ai":return l.jsx(Ko,{form:p,config:e,onSubmit:k});case"optionalDeps":return l.jsx(Po,{});case"labs":return l.jsxs(ke,{title:"Experimental Features",children:[l.jsx("p",{className:"text-sm text-muted-secondary mb-4",children:"\u26A0\uFE0F These features are experimental and may require restarting your notebook to take effect."}),l.jsx(G,{control:p.control,name:"experimental.inline_ai_tooltip",render:Wo}),l.jsx(G,{control:p.control,name:"experimental.rtc_v2",render:Go}),l.jsx(G,{control:p.control,name:"experimental.performant_table_charts",render:K=>{const{field:x}=K;return l.jsxs("div",{className:"flex flex-col gap-y-1",children:[l.jsxs(Y,{className:ne,children:[l.jsx(U,{className:"font-normal",children:"Performant Table Charts"}),l.jsx(Q,{children:l.jsx(ce,{"data-testid":"performant-table-charts-checkbox",checked:x.value===!0,onCheckedChange:x.onChange})})]}),l.jsx(ee,{userConfig:e,name:"experimental.performant_table_charts"}),l.jsx(J,{children:"Enable experimental table charts which are computed on the backend."})]})}}),l.jsx(G,{control:p.control,name:"experimental.sql_linter",render:K=>{const{field:x}=K;return l.jsxs("div",{className:"flex flex-col gap-y-1",children:[l.jsxs(Y,{className:ne,children:[l.jsx(U,{className:"font-normal",children:"SQL Linter"}),l.jsx(Q,{children:l.jsx(ce,{"data-testid":"sql-linter-checkbox",checked:x.value===!0,onCheckedChange:x.onChange})})]}),l.jsx(ee,{userConfig:e,name:"experimental.sql_linter"}),l.jsx(J,{children:"Enable experimental SQL linting and autocompletion."})]})}}),l.jsx(G,{control:p.control,name:"experimental.external_agents",render:K=>{const{field:x}=K;return l.jsxs("div",{className:"flex flex-col gap-y-1",children:[l.jsxs(Y,{className:ne,children:[l.jsx(U,{className:"font-normal",children:"External Agents"}),l.jsx(Q,{children:l.jsx(ce,{"data-testid":"external-agents-checkbox",checked:x.value===!0,onCheckedChange:x.onChange})})]}),l.jsx(ee,{userConfig:e,name:"experimental.external_agents"}),l.jsxs(J,{children:["Enable experimental external agents such as Claude Code and Gemini CLI. Learn more in the"," ",l.jsx(de,{href:"https://docs.marimo.io/guides/editor_features/agents/",children:"docs"}),"."]})]})}})]})}},n[7]=a,n[8]=c,n[9]=e,n[10]=p,n[11]=w,n[12]=v,n[13]=k,n[14]=o,n[15]=i,n[16]=S):S=n[16];const M=S;let P,_,D;n[17]===Symbol.for("react.memo_cache_sentinel")?(P=l.jsx(re,{className:"inline",children:"marimo.toml"}),_=l.jsx("br",{}),n[17]=P,n[18]=_):(P=n[17],_=n[18]),n[19]===Symbol.for("react.memo_cache_sentinel")?(D=l.jsxs("p",{className:"text-muted-secondary",children:["User configuration is stored in ",P,_,"Run ",l.jsx(re,{className:"inline",children:"marimo config show"})," in your terminal to show your current configuration and file location."]}),n[19]=D):D=n[19];const I=D;let $,F,z,H,C,A,R,q,O,f,V,B,L,W;return n[20]!==p||n[21]!==k?($=p.handleSubmit(k),n[20]=p,n[21]=k,n[22]=$):$=n[22],n[23]!==o?(F=K=>o(K),n[23]=o,n[24]=F):F=n[24],n[25]===Symbol.for("react.memo_cache_sentinel")?(z=Jl.map(Yo),n[25]=z):z=n[25],n[26]!==d?(H=l.jsxs("span",{children:["Version: ",d]}),n[26]=d,n[27]=H):H=n[27],n[28]!==u?(C=l.jsxs("span",{children:["Locale: ",u]}),n[28]=u,n[29]=C):C=n[29],n[30]!==H||n[31]!==C?(A=l.jsxs("div",{className:"p-2 text-xs text-muted-foreground self-start flex flex-col gap-1",children:[H,C]}),n[30]=H,n[31]=C,n[32]=A):A=n[32],n[33]===Symbol.for("react.memo_cache_sentinel")?(R=l.jsx("div",{className:"flex-1"}),q=!Pe()&&I,n[33]=R,n[34]=q):(R=n[33],q=n[34]),n[35]!==A?(O=l.jsxs(Fn,{className:"self-start max-h-none flex flex-col gap-2 shrink-0 bg-background flex-1 min-h-full",children:[z,A,R,q]}),n[35]=A,n[36]=O):O=n[36],n[37]!==a||n[38]!==O||n[39]!==F?(f=l.jsx(Rn,{value:a,onValueChange:F,orientation:"vertical",className:"w-1/3 border-r h-full overflow-auto p-3",children:O}),n[37]=a,n[38]=O,n[39]=F,n[40]=f):f=n[40],n[41]!==M?(V=M(),n[41]=M,n[42]=V):V=n[42],n[43]!==V?(B=l.jsx("div",{className:"w-2/3 pl-6 gap-2 flex flex-col overflow-auto p-6",children:V}),n[43]=V,n[44]=B):B=n[44],n[45]!==f||n[46]!==B||n[47]!==$?(L=l.jsxs("form",{ref:s,onChange:$,className:"flex text-pretty overflow-hidden",children:[f,B]}),n[45]=f,n[46]=B,n[47]=$,n[48]=L):L=n[48],n[49]!==p||n[50]!==L?(W=l.jsx(yn,{...p,children:L}),n[49]=p,n[50]=L,n[51]=W):W=n[51],W},ke=n=>{const e=te.c(5),{title:t,children:s}=n;let i,a;return e[0]!==t?(i=l.jsx(wt,{children:t}),e[0]=t,e[1]=i):i=e[1],e[2]!==s||e[3]!==i?(a=l.jsxs("div",{className:"flex flex-col gap-4 pb-4",children:[i,s]}),e[2]=s,e[3]=i,e[4]=a):a=e[4],a};function zo(n){return l.jsx("option",{value:n,children:n},n)}function Fo(n){return l.jsx("option",{value:n,children:n},n)}function Ro(n){return l.jsx("option",{value:n,children:n},n)}function Vo(n){return l.jsx("option",{value:n,children:n},n)}function Lo(n){return l.jsx("option",{value:n,children:n},n)}function Bo(n){return l.jsx("option",{value:n,children:n},n)}function Oo(n){return l.jsx("option",{value:n,children:n},n)}function qo(n){return l.jsx("option",{value:n,children:n},n)}function Ho(n){return l.jsx("option",{value:n,children:n},n)}function Uo(n){return l.jsx("option",{value:n.value,children:n.label},n.value)}function Wo(n){const{field:e}=n;return l.jsxs("div",{className:"flex flex-col gap-y-1",children:[l.jsxs(Y,{className:ne,children:[l.jsx(U,{className:"font-normal",children:"AI Edit Tooltip"}),l.jsx(Q,{children:l.jsx(ce,{"data-testid":"inline-ai-checkbox",checked:e.value===!0,onCheckedChange:e.onChange})})]}),l.jsx(J,{children:'Enable experimental "Edit with AI" tooltip when selecting code.'})]})}function Go(n){const{field:e}=n;return l.jsxs("div",{className:"flex flex-col gap-y-1",children:[l.jsxs(Y,{className:ne,children:[l.jsx(U,{className:"font-normal",children:"Real-Time Collaboration"}),l.jsx(Q,{children:l.jsx(ce,{"data-testid":"rtc-checkbox",checked:e.value===!0,onCheckedChange:e.onChange})})]}),l.jsx(J,{children:"Enable experimental real-time collaboration. This change requires a page refresh to take effect."})]})}function Yo(n){return l.jsx(xt,{value:n.id,className:"w-full text-left p-2 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground justify-start",children:l.jsxs("div",{className:"flex gap-4 items-center text-lg overflow-hidden",children:[l.jsx("span",{className:_e(n.className,"w-8 h-8 rounded flex items-center justify-center text-muted-foreground shrink-0"),children:l.jsx(n.Icon,{className:"w-4 h-4"})}),l.jsx("span",{className:"truncate",children:n.label})]})},n.id)}const Jt=Ge(!1);function Qo(){const n=te.c(3),e=Vt(es),t=Vt(Jt);let s;return n[0]!==e||n[1]!==t?(s={handleClick:i=>{e(i),t(!0)}},n[0]=e,n[1]=t,n[2]=s):s=n[2],s}const Xo=n=>{const e=te.c(32),{showAppConfig:t,disabled:s,tooltip:i}=n,a=t===void 0||t,o=s!==void 0&&s,c=i===void 0?"Settings":i,[d,u]=Ye(Jt),r=o?"disabled":"hint-green";let h,g,p;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=l.jsx(Yn,{strokeWidth:1.8}),e[0]=h):h=e[0],e[1]!==c?(g=l.jsx(Me,{content:c,children:h}),e[1]=c,e[2]=g):g=e[2],e[3]!==o||e[4]!==r||e[5]!==g?(p=l.jsx(Nt,{"aria-label":"Config","data-testid":"app-config-button",shape:"circle",size:"small",className:"h-[27px] w-[27px]",disabled:o,color:r,children:g}),e[3]=o,e[4]=r,e[5]=g,e[6]=p):p=e[6];const m=p;let k;e[7]===Symbol.for("react.memo_cache_sentinel")?(k=l.jsxs(Dn,{className:"w-[90vw] h-[90vh] overflow-hidden sm:max-w-5xl top-[5vh] p-0",children:[l.jsx(Fi,{children:l.jsx(Mn,{children:"User settings"})}),l.jsx($o,{})]}),e[7]=k):k=e[7];const y=k;if(!a){let $,F;return e[8]!==m?($=l.jsx(Ri,{children:m}),e[8]=m,e[9]=$):$=e[9],e[10]!==u||e[11]!==d||e[12]!==$?(F=l.jsxs(zt,{open:d,onOpenChange:u,children:[$,y]}),e[10]=u,e[11]=d,e[12]=$,e[13]=F):F=e[13],F}let j,w,v,S,M,P,_,D,I;return e[14]!==m?(j=l.jsx(Vi,{asChild:!0,children:m}),e[14]=m,e[15]=j):j=e[15],e[16]===Symbol.for("react.memo_cache_sentinel")?(w=l.jsx(La,{}),v=l.jsx("div",{className:"h-px bg-border my-2"}),e[16]=w,e[17]=v):(w=e[16],v=e[17]),e[18]!==u?(S=()=>u(!0),e[18]=u,e[19]=S):S=e[19],e[20]===Symbol.for("react.memo_cache_sentinel")?(M=l.jsx(Yn,{strokeWidth:1.8,className:"w-4 h-4 mr-2"}),e[20]=M):M=e[20],e[21]!==S?(P=l.jsxs(Li,{className:"w-[650px] overflow-auto max-h-[80vh] max-w-[80vw]",align:"end",side:"bottom",onFocusOutside:Zo,children:[w,v,l.jsxs(me,{onClick:S,variant:"link",className:"px-0",children:[M,"User settings"]})]}),e[21]=S,e[22]=P):P=e[22],e[23]!==P||e[24]!==j?(_=l.jsxs(Bi,{children:[j,P]}),e[23]=P,e[24]=j,e[25]=_):_=e[25],e[26]!==u||e[27]!==d?(D=l.jsx(zt,{open:d,onOpenChange:u,children:y}),e[26]=u,e[27]=d,e[28]=D):D=e[28],e[29]!==_||e[30]!==D?(I=l.jsxs(l.Fragment,{children:[_,D]}),e[29]=_,e[30]=D,e[31]=I):I=e[31],I};function Zo(n){return n.preventDefault()}const Jo=n=>{const e=te.c(15),{description:t,disabled:s,tooltip:i}=n,a=s!==void 0&&s,o=i===void 0?"Shutdown":i,{openConfirm:c,closeModal:d}=Oi(),{sendShutdown:u}=Fe();let r;e[0]!==u?(r=()=>{u(),setTimeout(er,200)},e[0]=u,e[1]=r):r=e[1];const h=r;if(Pe())return null;const g=a?"disabled":"red";let p,m,k,y;return e[2]!==d||e[3]!==t||e[4]!==h||e[5]!==c?(p=j=>{j.stopPropagation(),c({title:"Shutdown",description:t,variant:"destructive",confirmAction:l.jsx(qi,{onClick:()=>{h(),d()},"aria-label":"Confirm Shutdown",children:"Shutdown"})})},e[2]=d,e[3]=t,e[4]=h,e[5]=c,e[6]=p):p=e[6],e[7]===Symbol.for("react.memo_cache_sentinel")?(m=l.jsx(gt,{strokeWidth:1}),e[7]=m):m=e[7],e[8]!==a||e[9]!==g||e[10]!==p?(k=l.jsx(Nt,{"aria-label":"Shutdown","data-testid":"shutdown-button",shape:"circle",size:"small",color:g,className:"h-[27px] w-[27px]",disabled:a,onClick:p,children:m}),e[8]=a,e[9]=g,e[10]=p,e[11]=k):k=e[11],e[12]!==k||e[13]!==o?(y=l.jsx(Me,{content:o,children:k}),e[12]=k,e[13]=o,e[14]=y):y=e[14],y};function er(){window.close()}function tr(n){window.open(Hi(`?file=${n}`).toString(),"_blank")}export{Ui as A,Qn as B,Xn as C,fo as D,Qi as G,oo as K,Xi as L,Zi as M,ta as P,Jo as S,na as Y,Wi as a,Yi as b,za as c,Xo as d,Nt as e,mo as f,Fa as g,et as h,Ol as i,ql as j,Qt as k,lo as l,Ll as m,_t as n,tr as o,Bl as p,Zn as q,Jt as s,Qo as u};
@@ -1 +1 @@
1
- import{a as p,Q as m,S as h,T as d,j as a,U as g,V as f,W as j}from"./index-DKEudB02.js";import{C as u}from"./clear-button-BeoFbEKH.js";import{P as y}from"./empty-state-B3dA3G5P.js";const N=()=>{const s=p.c(9),e=m(),{clearLogs:c}=h();if(e.length===0){let t,o;return s[0]===Symbol.for("react.memo_cache_sentinel")?(t=a.jsx("code",{className:"border rounded px-1",children:"stdout"}),s[0]=t):t=s[0],s[1]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(y,{title:"No logs",description:a.jsxs("span",{children:[t," and"," ",a.jsx("code",{className:"border rounded px-1",children:"stderr"})," logs will appear here."]}),icon:a.jsx(j,{})}),s[1]=o):o=s[1],o}let l,r,n;return s[2]!==c?(l=a.jsx("div",{className:"flex flex-row justify-end px-2 py-1",children:a.jsx(u,{dataTestId:"clear-logs-button",onClick:c})}),s[2]=c,s[3]=l):l=s[3],s[4]!==e?(r=a.jsx("div",{className:"overflow-auto flex-1",children:a.jsx(x,{logs:e,className:"min-w-[300px]"})}),s[4]=e,s[5]=r):r=s[5],s[6]!==l||s[7]!==r?(n=a.jsxs(a.Fragment,{children:[l,r]}),s[6]=l,s[7]=r,s[8]=n):n=s[8],n},x=s=>{const e=p.c(10),{logs:c,className:l}=s;let r,n,t,o,i;return e[0]!==l?(r=d("flex flex-col",l),e[0]=l,e[1]=r):r=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(n={whiteSpace:"pre-wrap"},e[2]=n):n=e[2],e[3]!==c?(t=c.map(w),e[3]=c,e[4]=t):t=e[4],e[5]!==t?(o=a.jsx("pre",{className:"grid text-xs font-mono gap-1 whitespace-break-spaces font-semibold align-left",children:a.jsx("div",{className:"grid grid-cols-[30px_1fr]",style:n,children:t})}),e[5]=t,e[6]=o):o=e[6],e[7]!==r||e[8]!==o?(i=a.jsx("div",{className:r,children:o}),e[7]=r,e[8]=o,e[9]=i):i=e[9],i};function v(s){const e=g(s.timestamp),c=b[s.level],l=s.level.toUpperCase();return a.jsxs(a.Fragment,{children:[a.jsxs("span",{className:"shrink-0 text-(--gray-10) dark:text-(--gray-11)",children:["[",e,"]"]}),a.jsx("span",{className:d("shrink-0",c),children:l}),a.jsxs("span",{className:"shrink-0 text-(--gray-10)",children:["(",a.jsx(f,{cellId:s.cellId}),")"]}),s.message]})}const b={stdout:"text-(--grass-9)",stderr:"text-(--red-9)"};function w(s,e){return a.jsxs("div",{className:"contents group",children:[a.jsx("span",{className:d("opacity-70 group-hover:bg-(--gray-3) group-hover:opacity-100","text-right col-span-1 py-1 pr-1"),children:e+1}),a.jsx("span",{className:d("opacity-70 group-hover:bg-(--gray-3) group-hover:opacity-100","px-2 flex gap-x-1.5 py-1 flex-wrap"),children:v(s)})]},e)}export{x as LogViewer,N as default};
1
+ import{a as p,Q as m,S as h,T as d,j as a,U as g,V as f,W as j}from"./index-CelXfcd8.js";import{C as u}from"./clear-button-C4fDVSv8.js";import{P as y}from"./empty-state-DW308mFO.js";const N=()=>{const s=p.c(9),e=m(),{clearLogs:c}=h();if(e.length===0){let t,o;return s[0]===Symbol.for("react.memo_cache_sentinel")?(t=a.jsx("code",{className:"border rounded px-1",children:"stdout"}),s[0]=t):t=s[0],s[1]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(y,{title:"No logs",description:a.jsxs("span",{children:[t," and"," ",a.jsx("code",{className:"border rounded px-1",children:"stderr"})," logs will appear here."]}),icon:a.jsx(j,{})}),s[1]=o):o=s[1],o}let l,r,n;return s[2]!==c?(l=a.jsx("div",{className:"flex flex-row justify-end px-2 py-1",children:a.jsx(u,{dataTestId:"clear-logs-button",onClick:c})}),s[2]=c,s[3]=l):l=s[3],s[4]!==e?(r=a.jsx("div",{className:"overflow-auto flex-1",children:a.jsx(x,{logs:e,className:"min-w-[300px]"})}),s[4]=e,s[5]=r):r=s[5],s[6]!==l||s[7]!==r?(n=a.jsxs(a.Fragment,{children:[l,r]}),s[6]=l,s[7]=r,s[8]=n):n=s[8],n},x=s=>{const e=p.c(10),{logs:c,className:l}=s;let r,n,t,o,i;return e[0]!==l?(r=d("flex flex-col",l),e[0]=l,e[1]=r):r=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(n={whiteSpace:"pre-wrap"},e[2]=n):n=e[2],e[3]!==c?(t=c.map(w),e[3]=c,e[4]=t):t=e[4],e[5]!==t?(o=a.jsx("pre",{className:"grid text-xs font-mono gap-1 whitespace-break-spaces font-semibold align-left",children:a.jsx("div",{className:"grid grid-cols-[30px_1fr]",style:n,children:t})}),e[5]=t,e[6]=o):o=e[6],e[7]!==r||e[8]!==o?(i=a.jsx("div",{className:r,children:o}),e[7]=r,e[8]=o,e[9]=i):i=e[9],i};function v(s){const e=g(s.timestamp),c=b[s.level],l=s.level.toUpperCase();return a.jsxs(a.Fragment,{children:[a.jsxs("span",{className:"shrink-0 text-(--gray-10) dark:text-(--gray-11)",children:["[",e,"]"]}),a.jsx("span",{className:d("shrink-0",c),children:l}),a.jsxs("span",{className:"shrink-0 text-(--gray-10)",children:["(",a.jsx(f,{cellId:s.cellId}),")"]}),s.message]})}const b={stdout:"text-(--grass-9)",stderr:"text-(--red-9)"};function w(s,e){return a.jsxs("div",{className:"contents group",children:[a.jsx("span",{className:d("opacity-70 group-hover:bg-(--gray-3) group-hover:opacity-100","text-right col-span-1 py-1 pr-1"),children:e+1}),a.jsx("span",{className:d("opacity-70 group-hover:bg-(--gray-3) group-hover:opacity-100","px-2 flex gap-x-1.5 py-1 flex-wrap"),children:v(s)})]},e)}export{x as LogViewer,N as default};