@marimo-team/frontend 0.25.2 → 0.25.3-dev12

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 (178) hide show
  1. package/dist/assets/{CellStatus-BP2mavAq.js → CellStatus-DVOHpdeJ.js} +1 -1
  2. package/dist/assets/{ConnectedDataExplorerComponent-t8fH_TNc.js → ConnectedDataExplorerComponent-TprnxZeJ.js} +1 -1
  3. package/dist/assets/{ErrorBoundary-Gl5nCA8C.js → ErrorBoundary-CM13wrd8.js} +2 -2
  4. package/dist/assets/JsonOutput-Cx1iyibB.js +11 -0
  5. package/dist/assets/{LazyAnyLanguageCodeMirror-CKcCbG2G.js → LazyAnyLanguageCodeMirror-B4fCknq1.js} +2 -2
  6. package/dist/assets/MarimoErrorOutput-s_5GOX8k.js +10 -0
  7. package/dist/assets/{RenderHTML-BbOqmHy3.js → RenderHTML-DX6i99Op.js} +1 -1
  8. package/dist/assets/{RunButton-CK3LhnP5.js → RunButton-BKoh0zYG.js} +1 -1
  9. package/dist/assets/{add-cell-with-ai-8UBC0xwR.js → add-cell-with-ai-BpD_790A.js} +11 -11
  10. package/dist/assets/{add-connection-dialog-DXQnd6eB.js → add-connection-dialog-B1BXCjex.js} +2 -2
  11. package/dist/assets/{agent-panel-D7kMZLG-.js → agent-panel-CDFUc1uu.js} +5 -5
  12. package/dist/assets/ai-model-dropdown-i1vfGeVi.js +13 -0
  13. package/dist/assets/{any-language-editor-BLCAD3yx.js → any-language-editor-BdTWdMCI.js} +1 -1
  14. package/dist/assets/{app-config-button-BKEG4x9u.js → app-config-button-AdV-QDD7.js} +1 -1
  15. package/dist/assets/{blob-D5nfNHOo.js → blob-BG8yoQmx.js} +1 -1
  16. package/dist/assets/{cell-editor-ADVfycpN.js → cell-editor-BKJ06H5F.js} +9 -9
  17. package/dist/assets/cell-link-8Auigi8P.js +1 -0
  18. package/dist/assets/{cells-BRkCaSsh.js → cells-C6YGYGdi.js} +56 -56
  19. package/dist/assets/{chat-display-Dnagy4Nv.js → chat-display-DhgI2MS9.js} +1 -1
  20. package/dist/assets/{chat-panel-DQ6HkWEF.js → chat-panel-Cau71Ygr.js} +2 -2
  21. package/dist/assets/{chat-ui-Df8Vcj6n.js → chat-ui-C5ql1Up-.js} +1 -1
  22. package/dist/assets/code-visibility-BJImdpDi.js +1 -0
  23. package/dist/assets/coerce-DWjFeXOY.js +1 -0
  24. package/dist/assets/{column-preview-Cm2D6vyX.js → column-preview-BZ_iNhtJ.js} +1 -1
  25. package/dist/assets/{command-palette-DTSQ7gOC.js → command-palette-DDC3kBet.js} +1 -1
  26. package/dist/assets/{common-Cu6CDbuw.js → common-Sl3uthjg.js} +1 -1
  27. package/dist/assets/{components-CGw16R_N.js → components-3cou6Mka.js} +1 -1
  28. package/dist/assets/{components-CP_UoFtT.js → components-CskjK6xZ.js} +1 -1
  29. package/dist/assets/{components-CXfO-F47.js → components-YBmtV0p6.js} +1 -1
  30. package/dist/assets/{config-VPSq73n8.js → config-CA1V-wjh.js} +1 -1
  31. package/dist/assets/config-DRIpOKqh.js +1 -0
  32. package/dist/assets/config-Dy28fDwn.js +1 -0
  33. package/dist/assets/{datasource-Cq6x_5ML.js → datasource-DfbNb83e.js} +1 -1
  34. package/dist/assets/{dates-BbFQ2oE4.js → dates-CfmdTL6B.js} +1 -1
  35. package/dist/assets/{dependency-graph-panel--Kgtktcw.js → dependency-graph-panel-L5cBE5sl.js} +1 -1
  36. package/dist/assets/{documentation-panel-BHmbeznw.js → documentation-panel-D7S8JIc2.js} +1 -1
  37. package/dist/assets/{download-DCJXy66H.js → download-C03FOElq.js} +1 -1
  38. package/dist/assets/edit-page-D_Rg0gQO.js +9 -0
  39. package/dist/assets/{error-banner-Cd69vvyX.js → error-banner-COZ7SfYV.js} +1 -1
  40. package/dist/assets/{error-entries-Dk3VZ-OK.js → error-entries-CLnPDv7b.js} +1 -1
  41. package/dist/assets/{error-panel-BPRYmC5J.js → error-panel-D2xrYLue.js} +1 -1
  42. package/dist/assets/{errors-DCrsa1nH.js → errors-CNsgAw6m.js} +1 -1
  43. package/dist/assets/{feedback-button-Bik2-e33.js → feedback-button-DzPunIqU.js} +2 -2
  44. package/dist/assets/feedback-button-Kla7i5RT.js +1 -0
  45. package/dist/assets/{file-explorer-panel-BEEK5lcl.js → file-explorer-panel-Uk4_QIJQ.js} +1 -1
  46. package/dist/assets/{file-name-input-Cdc-TVqO.js → file-name-input-B4fRaQkI.js} +1 -1
  47. package/dist/assets/{floating-outline-XD9FAV-f.js → floating-outline-B5MaM1JS.js} +1 -1
  48. package/dist/assets/{gallery-page-Dm6mGwBi.js → gallery-page-BefvdsM7.js} +1 -1
  49. package/dist/assets/{glide-data-editor-J9CAb70d.js → glide-data-editor-C3eaYlXg.js} +1 -1
  50. package/dist/assets/{home-page-DMHnsRxm.js → home-page-hmvKlc1w.js} +1 -1
  51. package/dist/assets/{hooks-93IwHd2u.js → hooks-DzML9nez.js} +1 -1
  52. package/dist/assets/index-6b4mf8Ai.css +2 -0
  53. package/dist/assets/index-ptK1gxmo.js +30 -0
  54. package/dist/assets/{layout-DmcNEu3P.js → layout-Ck1RoL1B.js} +5 -5
  55. package/dist/assets/{logs-panel-ABM16htT.js → logs-panel-BRytaWaO.js} +1 -1
  56. package/dist/assets/{markdown-renderer-BG3sp2rs.js → markdown-renderer-DX0Xrrfy.js} +1 -1
  57. package/dist/assets/{mermaid-a3xYymTy.js → mermaid-C4EiVqcd.js} +1 -1
  58. package/dist/assets/{name-cell-input-BgEBmqyL.js → name-cell-input-DlpTvPLa.js} +1 -1
  59. package/dist/assets/{outline-panel-DCXQ3_F6.js → outline-panel-B2WIpz-1.js} +1 -1
  60. package/dist/assets/{packages-panel-BMGOmZkR.js → packages-panel-CI5ff9b-.js} +1 -1
  61. package/dist/assets/{panel-accordion-state-C1sdPp0m.js → panel-accordion-state-BqSH5ttk.js} +1 -1
  62. package/dist/assets/panels-BCcZ_yLK.js +107 -0
  63. package/dist/assets/{process-output-D0KGq04R.js → process-output-f3C3PD0Z.js} +1 -1
  64. package/dist/assets/{readonly-code-display-Do50PHI8.js → readonly-code-display-MnMEoYW5.js} +1 -1
  65. package/dist/assets/{readonly-python-code-DCSMIsTX.js → readonly-python-code-ggs4hAzC.js} +1 -1
  66. package/dist/assets/{renderShortcut-BkVJQ_Zh.js → renderShortcut-C1JwYcqW.js} +1 -1
  67. package/dist/assets/{reveal-component-ltaepAqw.js → reveal-component-PiV1eQk9.js} +1 -1
  68. package/dist/assets/run-page-AfZhtEh1.js +1 -0
  69. package/dist/assets/{runtime-details-state-CSPobEdR.js → runtime-details-state-CoL-p0MC.js} +1 -1
  70. package/dist/assets/{schemas-Dv42wLFq.js → schemas-ChRqMOTL.js} +1 -1
  71. package/dist/assets/{scratchpad-panel-Dwd6W5PE.js → scratchpad-panel-D2rWg4k8.js} +1 -1
  72. package/dist/assets/{secrets-panel-Bctbtkrp.js → secrets-panel-D7KN4tVs.js} +1 -1
  73. package/dist/assets/session-panel-CnANhcTo.js +1 -0
  74. package/dist/assets/{snippets-panel-Bh1oTw4m.js → snippets-panel-ClGHtEKQ.js} +1 -1
  75. package/dist/assets/state-CbjBtkdd.js +3 -0
  76. package/dist/assets/{state-XsPO8hNi.js → state-DtGB7xeJ.js} +1 -1
  77. package/dist/assets/{terminal-Ck_vK-34.js → terminal-wnSHYT8N.js} +1 -1
  78. package/dist/assets/{tracing-Di6pUmX8.js → tracing-Dz2rYOFL.js} +1 -1
  79. package/dist/assets/{tracing-panel-PeRXHD8_.js → tracing-panel-DqQY9V91.js} +2 -2
  80. package/dist/assets/{tree-actions-GM5E_bUs.js → tree-actions-DnUokmva.js} +1 -1
  81. package/dist/assets/{useAddCell-GR7eEQrT.js → useAddCell-IN24thff.js} +1 -1
  82. package/dist/assets/{useBoolean-BDD6_xQQ.js → useBoolean-d0Tty94N.js} +1 -1
  83. package/dist/assets/{useCellActionButton-B-9eG5z_.js → useCellActionButton-DmaFZ4oF.js} +1 -1
  84. package/dist/assets/{useDeleteCell-2_bMClHd.js → useDeleteCell-fQlM46Y2.js} +1 -1
  85. package/dist/assets/{useDependencyPanelTab-k3C3M18S.js → useDependencyPanelTab-ImXYINm_.js} +1 -1
  86. package/dist/assets/{useInstallPackage-iX1eufdl.js → useInstallPackage-BW06eter.js} +1 -1
  87. package/dist/assets/{useNotebookActions-NHN6A-cN.js → useNotebookActions-DHt3s-ia.js} +1 -1
  88. package/dist/assets/{useRunCells-B2vUhREg.js → useRunCells-DSJPXE-j.js} +1 -1
  89. package/dist/assets/{useSplitCell-DEb03htp.js → useSplitCell-DQyMF5gd.js} +1 -1
  90. package/dist/assets/{useTheme-COhSHkCj.js → useTheme-n8Dj1zH7.js} +1 -1
  91. package/dist/assets/{vega-component-CnadTgoE.js → vega-component-IouMe13t.js} +1 -1
  92. package/dist/index.html +34 -35
  93. package/package.json +5 -2
  94. package/src/__tests__/fixtures/{pair-preview.ts → pair-config.ts} +3 -2
  95. package/src/__tests__/host-imports.test.ts +100 -0
  96. package/src/__tests__/mount.test.ts +28 -8
  97. package/src/components/data-table/__tests__/context-menu.test.ts +176 -0
  98. package/src/components/data-table/__tests__/date-filter-inputs.test.tsx +24 -1
  99. package/src/components/data-table/__tests__/export-actions.test.tsx +329 -6
  100. package/src/components/data-table/context-menu.tsx +125 -26
  101. package/src/components/data-table/date-filter-inputs.tsx +15 -42
  102. package/src/components/data-table/export-actions.tsx +192 -116
  103. package/src/components/data-table/schemas.ts +14 -36
  104. package/src/components/data-table/utils.ts +18 -0
  105. package/src/components/editor/Output.tsx +9 -2
  106. package/src/components/editor/actions/__tests__/pair-with-agent-commands.test.ts +80 -252
  107. package/src/components/editor/actions/__tests__/pair-with-agent-modal.test.tsx +186 -34
  108. package/src/components/editor/actions/pair-with-agent-commands.ts +42 -51
  109. package/src/components/editor/actions/pair-with-agent-modal.tsx +96 -36
  110. package/src/components/editor/chrome/panels/error-panel.tsx +1 -0
  111. package/src/components/editor/chrome/wrapper/__tests__/attachment-status.test.tsx +372 -0
  112. package/src/components/editor/chrome/wrapper/footer-item.tsx +32 -24
  113. package/src/components/editor/chrome/wrapper/footer-items/attachment-status.tsx +237 -0
  114. package/src/components/editor/chrome/wrapper/footer.tsx +2 -0
  115. package/src/components/editor/errors/__tests__/send-error-report-button.test.tsx +548 -0
  116. package/src/components/editor/errors/send-error-report-button.tsx +69 -0
  117. package/src/components/editor/output/MarimoErrorOutput.tsx +21 -5
  118. package/src/components/editor/output/MarimoTracebackOutput.tsx +35 -20
  119. package/src/components/editor/output/__tests__/ansi-reduce.test.ts +18 -0
  120. package/src/components/editor/output/ansi-reduce.ts +6 -0
  121. package/src/core/attachments/__tests__/toast.test.tsx +58 -0
  122. package/src/core/attachments/state.ts +21 -0
  123. package/src/core/attachments/toast.ts +15 -0
  124. package/src/core/cells/__tests__/cells.test.ts +52 -0
  125. package/src/core/cells/__tests__/error-report.test.ts +139 -0
  126. package/src/core/cells/__tests__/session.test.ts +50 -1
  127. package/src/core/cells/error-report.ts +63 -0
  128. package/src/core/cells/session.ts +28 -1
  129. package/src/core/config/pair.ts +5 -3
  130. package/src/core/edit-app.tsx +2 -2
  131. package/src/core/host/AGENTS.md +6 -0
  132. package/src/core/host/__tests__/events.test.ts +46 -0
  133. package/src/core/host/__tests__/notebook-client.test.ts +191 -0
  134. package/src/core/host/__tests__/protocol.test.ts +214 -0
  135. package/src/core/host/connection.ts +81 -0
  136. package/src/core/host/events.ts +60 -0
  137. package/src/core/host/notebook-client.ts +226 -0
  138. package/src/core/host/protocol.ts +1943 -0
  139. package/src/core/islands/__tests__/bootstrap.test.ts +26 -0
  140. package/src/core/islands/bootstrap.ts +1 -0
  141. package/src/core/run-app.tsx +2 -2
  142. package/src/core/runtime/__tests__/runtime.test.ts +55 -11
  143. package/src/core/runtime/runtime.ts +14 -1
  144. package/src/core/runtime/types.ts +2 -0
  145. package/src/core/websocket/__tests__/{useMarimoKernelConnection.test.ts → connection-state.test.ts} +15 -17
  146. package/src/core/websocket/__tests__/{useWebSocket.test.ts → createConnectionTransport.test.ts} +1 -1
  147. package/src/core/websocket/__tests__/useNotebookClient.hook.test.tsx +140 -0
  148. package/src/core/websocket/__tests__/{useMarimoKernelConnection.hook.test.tsx → useNotebookSession.hook.test.tsx} +352 -65
  149. package/src/core/websocket/connection-state.ts +70 -0
  150. package/src/core/websocket/transports/__tests__/sse.test.ts +1 -4
  151. package/src/core/websocket/transports/create.ts +31 -0
  152. package/src/core/websocket/transports/transport.ts +12 -23
  153. package/src/core/websocket/types.ts +9 -39
  154. package/src/core/websocket/useNotebookClient.ts +80 -0
  155. package/src/core/websocket/{useMarimoKernelConnection.tsx → useNotebookSession.tsx} +67 -225
  156. package/src/mount.tsx +7 -3
  157. package/src/plugins/impl/__tests__/DataTablePlugin.test.tsx +84 -0
  158. package/src/utils/__tests__/dates.test.ts +116 -0
  159. package/src/utils/dates.ts +94 -0
  160. package/dist/assets/JsonOutput-D6HIIsCb.js +0 -11
  161. package/dist/assets/MarimoErrorOutput-D60XkCny.js +0 -6
  162. package/dist/assets/ai-model-dropdown-B0z6-zhp.js +0 -5
  163. package/dist/assets/api-BeC_VSGv.js +0 -1
  164. package/dist/assets/cell-link-LSth_8hT.js +0 -1
  165. package/dist/assets/code-visibility-B-_GvwR5.js +0 -1
  166. package/dist/assets/coerce-CpE6kUdX.js +0 -1
  167. package/dist/assets/config-BOKzA3tF.js +0 -1
  168. package/dist/assets/config-DX8Y2WbJ.js +0 -1
  169. package/dist/assets/edit-page-ChcSgpke.js +0 -9
  170. package/dist/assets/feedback-button-B2gKC5cn.js +0 -1
  171. package/dist/assets/index-Bcdzex-3.css +0 -2
  172. package/dist/assets/index-s-M1OXjs.js +0 -29
  173. package/dist/assets/pair-CaQyK6En.js +0 -1
  174. package/dist/assets/panels-CxVG8-v2.js +0 -4
  175. package/dist/assets/run-page-DF3c5cDk.js +0 -1
  176. package/dist/assets/session-panel-VdDhEBa-.js +0 -1
  177. package/dist/assets/state-_Qai_QyX.js +0 -3
  178. package/src/core/websocket/useWebSocket.tsx +0 -88
@@ -1,4 +1,4 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-DVplv7_D.js";import{At as n,Mt as r,gi as i,jn as a,jt as o,kt as s,qa as c,wn as l,yt as u}from"./cells-BRkCaSsh.js";import{E as d,P as f,S as p,j as m,w as h}from"./schemas-Dv42wLFq.js";import{r as g}from"./coerce-CpE6kUdX.js";import{t as _}from"./compiler-runtime-BrajqUja.js";import{t as v}from"./cn-ldLVeaqm.js";import{t as y}from"./jsx-runtime-B74pBk57.js";import{i as ee,n as te,r as ne,t as re}from"./tabs-BuQlZFbt.js";import{i as b,t as ie}from"./tooltip-C9TuY18o.js";import{t as ae}from"./components-CP_UoFtT.js";import{a as x,l as oe,p as S,r as C,s as w}from"./write-secret-modal-DzKAInL2.js";import{t as se}from"./plus-C5silF6g.js";import{Jt as ce,Qt as le,Xt as ue,Yt as de,nn as fe,tn as pe}from"./input-BoBxR50a.js";import{r as T}from"./strings-B2vv-ENv.js";import{t as me}from"./useIframeCapabilities-CwTkczVN.js";var E=e(t(),1),D=_();function O(){return f().optional().describe(l.of({label:`Password`,inputType:`password`,optionRegex:`(password|passwd|pgpassword|db.?pass(word)?)`}))}function k(e,t){let n=f();return n=t?n.nonempty():n.optional(),n=n.describe(l.of({label:e||`Token`,inputType:`password`,optionRegex:`(token|api.?key|access.?token|auth.?token|(^|_)pat(_|$))`})),n}function A(){return f().optional().describe(l.of({label:`Warehouse Name`,optionRegex:`(warehouse|snowflake.?warehouse)`}))}function j(e,t){let n=f();return n=t?n.nonempty():n.optional(),n.describe(l.of({label:e||`URI`,optionRegex:`(uri|url|connection.?string|database.?url|jdbc)`}))}function M(e){return f().nonempty().describe(l.of({label:e||`Host`,optionRegex:`^(?!.*(kubernetes|gpg)).*(host(name)?|pghost|db.?host|database.?host|mysql.?host|postgres.?host|server.?host)`}))}function N(){return f().describe(l.of({label:`Database`,optionRegex:`(database|db.?name|pgdatabase|^DB$|^DATABASE$)`}))}function he(){return f().describe(l.of({label:`Schema`,optionRegex:`(^SCHEMA$|db.?schema|postgres.?schema|pg.?schema|_SCHEMA$)`}))}function P(){return f().nonempty().describe(l.of({label:`Username`,optionRegex:`(username|pguser|db.?user|^USER$|_USER$)`}))}function F(e){let t=g().describe(l.of({label:`Port`,inputType:`number`,placeholder:e?.toString()})).transform(Number).refine(e=>e>=0&&e<=65535,{message:`Port must be between 0 and 65535`});return e===void 0?t:t.default(e)}function ge(){return p().default(!1).describe(l.of({label:`Read Only`}))}var _e=m({type:d(`postgres`),host:M(),port:F(5432).optional(),database:N(),username:P(),password:O(),ssl:p().default(!1).describe(l.of({label:`Use SSL`}))}).describe(l.of({direction:`two-columns`})),ve=m({type:d(`mysql`),host:M(),port:F(3306),database:N(),username:P(),password:O(),ssl:p().default(!1).describe(l.of({label:`Use SSL`}))}).describe(l.of({direction:`two-columns`})),ye=m({type:d(`sqlite`),database:N().describe(l.of({label:`Database Path`}))}).describe(l.of({direction:`two-columns`})),be=m({type:d(`duckdb`),database:N().describe(l.of({label:`Database Path`})),read_only:ge()}).describe(l.of({direction:`two-columns`})),I=m({type:d(`motherduck`),database:N().default(`my_db`).describe(l.of({label:`Database Name`})),token:k()}).describe(l.of({direction:`two-columns`})),L=m({type:d(`snowflake`),account:f().nonempty().describe(l.of({label:`Account`,optionRegex:`(snowflake.?account|^SNOWFLAKE_ACCOUNT$|account.?id)`})),warehouse:f().optional().describe(l.of({label:`Warehouse`,optionRegex:`(snowflake.?warehouse|warehouse)`})),database:N(),schema:f().optional().describe(l.of({label:`Schema`,optionRegex:`(snowflake.?schema|^SCHEMA$|_SCHEMA$)`})),role:f().optional().describe(l.of({label:`Role`})),authType:h(`type`,[m({type:d(`Password`),username:P(),password:O(),enable_mfa:p().default(!1).describe(l.of({label:`Enable MFA (Duo Push)`}))}),m({type:d(`SSO (Browser)`),username:P()}),m({type:d(`Key Pair`),username:P(),private_key_path:f().nonempty().describe(l.of({label:`Private Key Path`,placeholder:`/path/to/rsa_key.p8`})),private_key_passphrase:f().optional().describe(l.of({label:`Private Key Passphrase`,inputType:`password`,optionRegex:`(passphrase|private.?key.?passphrase|key.?passphrase)`}))}),m({type:d(`OAuth / PAT`),token:k(`Token`,!0)})]).default({type:`Password`,username:`username`,enable_mfa:!1}).describe(l.of({special:`tabs`}))}).describe(l.of({direction:`two-columns`})),R=m({type:d(`bigquery`),project:f().nonempty().describe(l.of({label:`Project ID`,optionRegex:`(bigquery.?project|gcp.?project|google.?cloud.?project|project.?id)`})),dataset:f().nonempty().describe(l.of({label:`Dataset`,optionRegex:`(bigquery.?dataset|dataset)`})),credentials_json:f().describe(l.of({label:`Credentials JSON`,special:`secret_textarea`}))}).describe(l.of({direction:`two-columns`})),z=m({type:d(`clickhouse_connect`),host:M(),port:F(8123).optional(),username:P(),password:O(),secure:p().default(!1).describe(l.of({label:`Use HTTPs`})),proxy_path:f().optional().describe(l.of({label:`Proxy Path`,placeholder:`/clickhouse`}))}).describe(l.of({direction:`two-columns`})),B=m({type:d(`timeplus`),host:M().default(`localhost`),port:F(8123).optional(),username:P().default(`default`),password:O().default(``)}).describe(l.of({direction:`two-columns`})),V=m({type:d(`chdb`),database:N().describe(l.of({label:`Database Path`})),read_only:ge()}).describe(l.of({direction:`two-columns`})),H=m({type:d(`trino`),host:M(),port:F(8080),database:N(),schema:he().optional(),username:P(),password:O(),async_support:p().default(!1).describe(l.of({label:`Async Support`}))}).describe(l.of({direction:`two-columns`})),U=m({type:d(`iceberg`),name:f().describe(l.of({label:`Catalog Name`})),catalog:h(`type`,[m({type:d(`REST`),warehouse:A(),uri:f().optional().describe(l.of({label:`URI`,placeholder:`https://`,optionRegex:`(uri|url|connection.?string|database.?url|jdbc)`})),token:k()}),m({type:d(`SQL`),warehouse:A(),uri:f().optional().describe(l.of({label:`URI`,placeholder:`jdbc:iceberg://host:port/database`,optionRegex:`(uri|url|connection.?string|database.?url|jdbc)`}))}),m({type:d(`Hive`),warehouse:A(),uri:j()}),m({type:d(`Glue`),warehouse:A(),uri:j()}),m({type:d(`DynamoDB`),"dynamodb.profile-name":f().optional().describe(l.of({label:`Profile Name`})),"dynamodb.region":f().optional().describe(l.of({label:`Region`})),"dynamodb.access-key-id":f().optional().describe(l.of({label:`Access Key ID`,inputType:`password`,optionRegex:`(access.?key.?id|aws.?access.?key)`})),"dynamodb.secret-access-key":f().optional().describe(l.of({label:`Secret Access Key`,inputType:`password`,optionRegex:`(secret.?access.?key|aws.?secret)`})),"dynamodb.session-token":f().optional().describe(l.of({label:`Session Token`,inputType:`password`,optionRegex:`(session.?token|aws.?session)`}))})]).default({type:`REST`,token:void 0}).describe(l.of({special:`tabs`}))}),W=m({type:d(`datafusion`),sessionContext:p().optional().describe(l.of({label:`Use Session Context`}))}),G=m({type:d(`pyspark`),host:M().optional(),port:F().optional()}),K=m({type:d(`redshift`),host:M(),port:F(5439),connectionType:h(`type`,[m({type:d(`IAM credentials`),region:f().describe(l.of({label:`Region`})),aws_access_key_id:f().nonempty().describe(l.of({label:`AWS Access Key ID`,inputType:`password`,optionRegex:`(access.?key.?id|aws.?access.?key)`})),aws_secret_access_key:f().nonempty().describe(l.of({label:`AWS Secret Access Key`,inputType:`password`,optionRegex:`(secret.?access.?key|aws.?secret)`})),aws_session_token:f().optional().describe(l.of({label:`AWS Session Token`,inputType:`password`,optionRegex:`(session.?token|aws.?session)`}))}),m({type:d(`DB credentials`),user:P(),password:O()})]).default({type:`IAM credentials`,aws_access_key_id:``,aws_secret_access_key:``,region:``}),database:N()}).describe(l.of({direction:`two-columns`})),q=m({type:d(`databricks`),access_token:k(`Access Token`,!0),server_hostname:M(`Server Hostname`),http_path:j(`HTTP Path`,!0),catalog:f().optional().describe(l.of({label:`Catalog`})),schema:f().optional().describe(l.of({label:`Schema`}))}).describe(l.of({direction:`two-columns`})),xe=m({type:d(`supabase`),host:M(),port:F(5432).optional(),database:N(),username:P(),password:O(),disable_client_pooling:p().default(!1).describe(l.of({label:`Disable Client-Side Pooling`}))}).describe(l.of({direction:`two-columns`})),Se=h(`type`,[_e,ve,ye,be,I,L,R,z,B,V,H,U,W,G,K,q,xe]),Ce={sqlmodel:`SQLModel`,sqlalchemy:`SQLAlchemy`,duckdb:`DuckDB`,clickhouse_connect:`ClickHouse Connect`,chdb:`chDB`,pyiceberg:`PyIceberg`,ibis:`Ibis`,motherduck:`MotherDuck`,redshift:`Redshift`,databricks:`Databricks`},J=class{connection;orm;secrets;constructor(e,t,n){this.connection=e,this.orm=t,this.secrets=n}get imports(){let e=new Set(this.generateImports());switch(this.orm){case`sqlalchemy`:e.add(`import sqlalchemy`);break;case`sqlmodel`:e.add(`import sqlmodel`);break;case`duckdb`:e.add(`import duckdb`);break;case`ibis`:e.add(`import ibis`)}return e}},we=e=>`_${e}`,Te=class{secrets={};get imports(){return Object.keys(this.secrets).length===0?new Set:new Set([`import os`])}print(e,t,n){if(e=we(e),w(t)){let r=oe(t),i=n?`os.environ.get("${r}", "${n}")`:`os.environ.get("${r}")`;return this.secrets[e]=i,e}if(n!=null){let r=`os.environ.get("${t}", "${n}")`;return this.secrets[e]=r,e}return typeof t==`number`||typeof t==`number`?`${t}`:typeof t==`boolean`?Y(t):t?`"${t}"`:``}printInFString(e,t,n){if(t===void 0)return``;if(typeof t==`number`)return`${t}`;if(typeof t==`boolean`)return Y(t);let r=this.print(e,t,n);return r.startsWith(`"`)&&r.endsWith(`"`)?r.slice(1,-1):`{${r}}`}printPassword(e,t,n,r){let i=n?this.printInFString.bind(this):this.print.bind(this);return w(e)?i(r||`password`,e):i(r||`password`,t,e)}getSecrets(){return this.secrets}formatSecrets(){return Object.keys(this.secrets).length===0?``:Object.entries(this.secrets).map(([e,t])=>`${e} = ${t}`).join(`
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-DVplv7_D.js";import{At as n,Mt as r,gi as i,jn as a,jt as o,kt as s,qa as c,wn as l,yt as u}from"./cells-C6YGYGdi.js";import{C as d,I as f,N as p,O as m,T as h}from"./schemas-ChRqMOTL.js";import{r as g}from"./coerce-DWjFeXOY.js";import{t as _}from"./compiler-runtime-BrajqUja.js";import{t as v}from"./cn-ldLVeaqm.js";import{t as y}from"./jsx-runtime-B74pBk57.js";import{i as ee,n as te,r as ne,t as re}from"./tabs-BuQlZFbt.js";import{i as b,t as ie}from"./tooltip-C9TuY18o.js";import{t as ae}from"./components-CskjK6xZ.js";import{a as x,l as oe,p as S,r as C,s as w}from"./write-secret-modal-DzKAInL2.js";import{t as se}from"./plus-C5silF6g.js";import{Jt as ce,Qt as le,Xt as ue,Yt as de,nn as fe,tn as pe}from"./input-BoBxR50a.js";import{r as T}from"./strings-B2vv-ENv.js";import{t as me}from"./useIframeCapabilities-CwTkczVN.js";var E=e(t(),1),D=_();function O(){return f().optional().describe(l.of({label:`Password`,inputType:`password`,optionRegex:`(password|passwd|pgpassword|db.?pass(word)?)`}))}function k(e,t){let n=f();return n=t?n.nonempty():n.optional(),n=n.describe(l.of({label:e||`Token`,inputType:`password`,optionRegex:`(token|api.?key|access.?token|auth.?token|(^|_)pat(_|$))`})),n}function A(){return f().optional().describe(l.of({label:`Warehouse Name`,optionRegex:`(warehouse|snowflake.?warehouse)`}))}function j(e,t){let n=f();return n=t?n.nonempty():n.optional(),n.describe(l.of({label:e||`URI`,optionRegex:`(uri|url|connection.?string|database.?url|jdbc)`}))}function M(e){return f().nonempty().describe(l.of({label:e||`Host`,optionRegex:`^(?!.*(kubernetes|gpg)).*(host(name)?|pghost|db.?host|database.?host|mysql.?host|postgres.?host|server.?host)`}))}function N(){return f().describe(l.of({label:`Database`,optionRegex:`(database|db.?name|pgdatabase|^DB$|^DATABASE$)`}))}function he(){return f().describe(l.of({label:`Schema`,optionRegex:`(^SCHEMA$|db.?schema|postgres.?schema|pg.?schema|_SCHEMA$)`}))}function P(){return f().nonempty().describe(l.of({label:`Username`,optionRegex:`(username|pguser|db.?user|^USER$|_USER$)`}))}function F(e){let t=g().describe(l.of({label:`Port`,inputType:`number`,placeholder:e?.toString()})).transform(Number).refine(e=>e>=0&&e<=65535,{message:`Port must be between 0 and 65535`});return e===void 0?t:t.default(e)}function ge(){return d().default(!1).describe(l.of({label:`Read Only`}))}var _e=p({type:m(`postgres`),host:M(),port:F(5432).optional(),database:N(),username:P(),password:O(),ssl:d().default(!1).describe(l.of({label:`Use SSL`}))}).describe(l.of({direction:`two-columns`})),ve=p({type:m(`mysql`),host:M(),port:F(3306),database:N(),username:P(),password:O(),ssl:d().default(!1).describe(l.of({label:`Use SSL`}))}).describe(l.of({direction:`two-columns`})),ye=p({type:m(`sqlite`),database:N().describe(l.of({label:`Database Path`}))}).describe(l.of({direction:`two-columns`})),be=p({type:m(`duckdb`),database:N().describe(l.of({label:`Database Path`})),read_only:ge()}).describe(l.of({direction:`two-columns`})),I=p({type:m(`motherduck`),database:N().default(`my_db`).describe(l.of({label:`Database Name`})),token:k()}).describe(l.of({direction:`two-columns`})),L=p({type:m(`snowflake`),account:f().nonempty().describe(l.of({label:`Account`,optionRegex:`(snowflake.?account|^SNOWFLAKE_ACCOUNT$|account.?id)`})),warehouse:f().optional().describe(l.of({label:`Warehouse`,optionRegex:`(snowflake.?warehouse|warehouse)`})),database:N(),schema:f().optional().describe(l.of({label:`Schema`,optionRegex:`(snowflake.?schema|^SCHEMA$|_SCHEMA$)`})),role:f().optional().describe(l.of({label:`Role`})),authType:h(`type`,[p({type:m(`Password`),username:P(),password:O(),enable_mfa:d().default(!1).describe(l.of({label:`Enable MFA (Duo Push)`}))}),p({type:m(`SSO (Browser)`),username:P()}),p({type:m(`Key Pair`),username:P(),private_key_path:f().nonempty().describe(l.of({label:`Private Key Path`,placeholder:`/path/to/rsa_key.p8`})),private_key_passphrase:f().optional().describe(l.of({label:`Private Key Passphrase`,inputType:`password`,optionRegex:`(passphrase|private.?key.?passphrase|key.?passphrase)`}))}),p({type:m(`OAuth / PAT`),token:k(`Token`,!0)})]).default({type:`Password`,username:`username`,enable_mfa:!1}).describe(l.of({special:`tabs`}))}).describe(l.of({direction:`two-columns`})),R=p({type:m(`bigquery`),project:f().nonempty().describe(l.of({label:`Project ID`,optionRegex:`(bigquery.?project|gcp.?project|google.?cloud.?project|project.?id)`})),dataset:f().nonempty().describe(l.of({label:`Dataset`,optionRegex:`(bigquery.?dataset|dataset)`})),credentials_json:f().describe(l.of({label:`Credentials JSON`,special:`secret_textarea`}))}).describe(l.of({direction:`two-columns`})),z=p({type:m(`clickhouse_connect`),host:M(),port:F(8123).optional(),username:P(),password:O(),secure:d().default(!1).describe(l.of({label:`Use HTTPs`})),proxy_path:f().optional().describe(l.of({label:`Proxy Path`,placeholder:`/clickhouse`}))}).describe(l.of({direction:`two-columns`})),B=p({type:m(`timeplus`),host:M().default(`localhost`),port:F(8123).optional(),username:P().default(`default`),password:O().default(``)}).describe(l.of({direction:`two-columns`})),V=p({type:m(`chdb`),database:N().describe(l.of({label:`Database Path`})),read_only:ge()}).describe(l.of({direction:`two-columns`})),H=p({type:m(`trino`),host:M(),port:F(8080),database:N(),schema:he().optional(),username:P(),password:O(),async_support:d().default(!1).describe(l.of({label:`Async Support`}))}).describe(l.of({direction:`two-columns`})),U=p({type:m(`iceberg`),name:f().describe(l.of({label:`Catalog Name`})),catalog:h(`type`,[p({type:m(`REST`),warehouse:A(),uri:f().optional().describe(l.of({label:`URI`,placeholder:`https://`,optionRegex:`(uri|url|connection.?string|database.?url|jdbc)`})),token:k()}),p({type:m(`SQL`),warehouse:A(),uri:f().optional().describe(l.of({label:`URI`,placeholder:`jdbc:iceberg://host:port/database`,optionRegex:`(uri|url|connection.?string|database.?url|jdbc)`}))}),p({type:m(`Hive`),warehouse:A(),uri:j()}),p({type:m(`Glue`),warehouse:A(),uri:j()}),p({type:m(`DynamoDB`),"dynamodb.profile-name":f().optional().describe(l.of({label:`Profile Name`})),"dynamodb.region":f().optional().describe(l.of({label:`Region`})),"dynamodb.access-key-id":f().optional().describe(l.of({label:`Access Key ID`,inputType:`password`,optionRegex:`(access.?key.?id|aws.?access.?key)`})),"dynamodb.secret-access-key":f().optional().describe(l.of({label:`Secret Access Key`,inputType:`password`,optionRegex:`(secret.?access.?key|aws.?secret)`})),"dynamodb.session-token":f().optional().describe(l.of({label:`Session Token`,inputType:`password`,optionRegex:`(session.?token|aws.?session)`}))})]).default({type:`REST`,token:void 0}).describe(l.of({special:`tabs`}))}),W=p({type:m(`datafusion`),sessionContext:d().optional().describe(l.of({label:`Use Session Context`}))}),G=p({type:m(`pyspark`),host:M().optional(),port:F().optional()}),K=p({type:m(`redshift`),host:M(),port:F(5439),connectionType:h(`type`,[p({type:m(`IAM credentials`),region:f().describe(l.of({label:`Region`})),aws_access_key_id:f().nonempty().describe(l.of({label:`AWS Access Key ID`,inputType:`password`,optionRegex:`(access.?key.?id|aws.?access.?key)`})),aws_secret_access_key:f().nonempty().describe(l.of({label:`AWS Secret Access Key`,inputType:`password`,optionRegex:`(secret.?access.?key|aws.?secret)`})),aws_session_token:f().optional().describe(l.of({label:`AWS Session Token`,inputType:`password`,optionRegex:`(session.?token|aws.?session)`}))}),p({type:m(`DB credentials`),user:P(),password:O()})]).default({type:`IAM credentials`,aws_access_key_id:``,aws_secret_access_key:``,region:``}),database:N()}).describe(l.of({direction:`two-columns`})),q=p({type:m(`databricks`),access_token:k(`Access Token`,!0),server_hostname:M(`Server Hostname`),http_path:j(`HTTP Path`,!0),catalog:f().optional().describe(l.of({label:`Catalog`})),schema:f().optional().describe(l.of({label:`Schema`}))}).describe(l.of({direction:`two-columns`})),xe=p({type:m(`supabase`),host:M(),port:F(5432).optional(),database:N(),username:P(),password:O(),disable_client_pooling:d().default(!1).describe(l.of({label:`Disable Client-Side Pooling`}))}).describe(l.of({direction:`two-columns`})),Se=h(`type`,[_e,ve,ye,be,I,L,R,z,B,V,H,U,W,G,K,q,xe]),Ce={sqlmodel:`SQLModel`,sqlalchemy:`SQLAlchemy`,duckdb:`DuckDB`,clickhouse_connect:`ClickHouse Connect`,chdb:`chDB`,pyiceberg:`PyIceberg`,ibis:`Ibis`,motherduck:`MotherDuck`,redshift:`Redshift`,databricks:`Databricks`},J=class{connection;orm;secrets;constructor(e,t,n){this.connection=e,this.orm=t,this.secrets=n}get imports(){let e=new Set(this.generateImports());switch(this.orm){case`sqlalchemy`:e.add(`import sqlalchemy`);break;case`sqlmodel`:e.add(`import sqlmodel`);break;case`duckdb`:e.add(`import duckdb`);break;case`ibis`:e.add(`import ibis`)}return e}},we=e=>`_${e}`,Te=class{secrets={};get imports(){return Object.keys(this.secrets).length===0?new Set:new Set([`import os`])}print(e,t,n){if(e=we(e),w(t)){let r=oe(t),i=n?`os.environ.get("${r}", "${n}")`:`os.environ.get("${r}")`;return this.secrets[e]=i,e}if(n!=null){let r=`os.environ.get("${t}", "${n}")`;return this.secrets[e]=r,e}return typeof t==`number`||typeof t==`number`?`${t}`:typeof t==`boolean`?Y(t):t?`"${t}"`:``}printInFString(e,t,n){if(t===void 0)return``;if(typeof t==`number`)return`${t}`;if(typeof t==`boolean`)return Y(t);let r=this.print(e,t,n);return r.startsWith(`"`)&&r.endsWith(`"`)?r.slice(1,-1):`{${r}}`}printPassword(e,t,n,r){let i=n?this.printInFString.bind(this):this.print.bind(this);return w(e)?i(r||`password`,e):i(r||`password`,t,e)}getSecrets(){return this.secrets}formatSecrets(){return Object.keys(this.secrets).length===0?``:Object.entries(this.secrets).map(([e,t])=>`${e} = ${t}`).join(`
2
2
  `)}},Ee=class extends J{generateImports(){return[]}generateConnectionCode(){let e=this.connection.ssl?`, connect_args={'sslmode': 'require'}`:``,t=this.secrets.printPassword(this.connection.password,`POSTGRES_PASSWORD`,!0),n=this.secrets.printInFString(`username`,this.connection.username),r=this.secrets.printInFString(`host`,this.connection.host),a=this.secrets.printInFString(`port`,this.connection.port),o=this.secrets.printInFString(`database`,this.connection.database);return i(`
3
3
  DATABASE_URL = f"postgresql://${n}:${t}@${r}:${a}/${o}"
4
4
  engine = ${this.orm}.create_engine(DATABASE_URL${e})
@@ -132,7 +132,7 @@ ${X(o,e=>` ${e}`)},
132
132
  `)}},Ue=class{secrets=new Te;createGenerator(e,t){switch(e.type){case`postgres`:return new Ee(e,t,this.secrets);case`mysql`:return new De(e,t,this.secrets);case`sqlite`:return new Oe(e,t,this.secrets);case`snowflake`:return new ke(e,t,this.secrets);case`bigquery`:return new Ae(e,t,this.secrets);case`duckdb`:return new je(e,t,this.secrets);case`motherduck`:return new Me(e,t,this.secrets);case`clickhouse_connect`:return new Ne(e,t,this.secrets);case`timeplus`:return new Pe(e,t,this.secrets);case`chdb`:return new Fe(e,t,this.secrets);case`trino`:return new Ie(e,t,this.secrets);case`iceberg`:return new Le(e,t,this.secrets);case`datafusion`:return new Re(e,t,this.secrets);case`pyspark`:return new ze(e,t,this.secrets);case`redshift`:return new Be(e,t,this.secrets);case`databricks`:return new Ve(e,t,this.secrets);case`supabase`:return new He(e,t,this.secrets);default:T(e)}}};function We(e,t){if(!(t in Ce))throw Error(`Unsupported library: ${t}`);Se.parse(e);let n=new Ue,r=n.createGenerator(e,t),i=r.generateConnectionCode(),a=n.secrets,o=[...new Set([...a.imports,...r.imports])].toSorted();o.push(``);let s=a.formatSecrets();return s&&o.push(s),o.push(i.trim()),o.join(`
133
133
  `)}function Y(e){return e.toString().charAt(0).toUpperCase()+e.toString().slice(1)}function X(e,t){return Object.entries(e).filter(([,e])=>e!=null&&e!==``).map(([e,n])=>t(typeof n==`boolean`?`${e}=${Y(n)}`:`${e}=${n}`)).join(`,
134
134
  `)}function Ge(e,t){return Object.entries(e).filter(([,e])=>e!=null&&e!==``).map(([e,n])=>{let r=`"${e}"`;return t(typeof n==`boolean`?`${r}: ${Y(n)}`:`${r}: ${n}`)}).join(`,
135
- `)}var Z=y(),Ke=[{name:`PostgreSQL`,schema:_e,color:`#336791`,logo:`postgres`,connectionLibraries:{libraries:[`sqlalchemy`,`sqlmodel`],preferred:`sqlalchemy`}},{name:`MySQL`,schema:ve,color:`#00758F`,logo:`mysql`,connectionLibraries:{libraries:[`sqlalchemy`,`sqlmodel`],preferred:`sqlalchemy`}},{name:`SQLite`,schema:ye,color:`#003B57`,logo:`sqlite`,connectionLibraries:{libraries:[`sqlalchemy`,`sqlmodel`],preferred:`sqlalchemy`}},{name:`DuckDB`,schema:be,color:`#FFD700`,logo:`duckdb`,connectionLibraries:{libraries:[`duckdb`],preferred:`duckdb`}},{name:`MotherDuck`,schema:I,color:`#ff9538`,logo:`motherduck`,connectionLibraries:{libraries:[`duckdb`],preferred:`duckdb`}},{name:`Snowflake`,schema:L,color:`#29B5E8`,logo:`snowflake`,connectionLibraries:{libraries:[`sqlalchemy`,`sqlmodel`],preferred:`sqlalchemy`}},{name:`ClickHouse`,schema:z,color:`#2C2C1D`,logo:`clickhouse`,connectionLibraries:{libraries:[`clickhouse_connect`],preferred:`clickhouse_connect`}},{name:`Timeplus`,schema:B,color:`#B83280`,logo:`timeplus`,connectionLibraries:{libraries:[`sqlalchemy`,`sqlmodel`],preferred:`sqlalchemy`}},{name:`BigQuery`,schema:R,color:`#4285F4`,logo:`bigquery`,connectionLibraries:{libraries:[`sqlalchemy`,`sqlmodel`],preferred:`sqlalchemy`}},{name:`ClickHouse Embedded`,schema:V,color:`#f2b611`,logo:`clickhouse`,connectionLibraries:{libraries:[`chdb`],preferred:`chdb`}},{name:`Trino`,schema:H,color:`#d466b6`,logo:`trino`,connectionLibraries:{libraries:[`sqlalchemy`,`sqlmodel`],preferred:`sqlalchemy`}},{name:`DataFusion`,schema:W,color:`#202A37`,logo:`datafusion`,connectionLibraries:{libraries:[`ibis`],preferred:`ibis`}},{name:`PySpark`,schema:G,color:`#1C5162`,logo:`pyspark`,connectionLibraries:{libraries:[`ibis`],preferred:`ibis`}},{name:`Redshift`,schema:K,color:`#522BAE`,logo:`redshift`,connectionLibraries:{libraries:[`redshift`],preferred:`redshift`}},{name:`Databricks`,schema:q,color:`#c41e0c`,logo:`databricks`,connectionLibraries:{libraries:[`sqlalchemy`,`sqlmodel`,`ibis`],preferred:`sqlalchemy`}},{name:`Supabase`,schema:xe,color:`#238F5F`,logo:`supabase`,connectionLibraries:{libraries:[`sqlalchemy`,`sqlmodel`],preferred:`sqlalchemy`}}],qe=[{name:`Iceberg`,schema:U,color:`#000000`,logo:`iceberg`,connectionLibraries:{libraries:[`pyiceberg`],preferred:`pyiceberg`}}],Je=[...Ke,...qe],Ye=[...new Set(Je.flatMap(({name:e,logo:t})=>[e,t]))],Xe=e=>{let t=(0,D.c)(12),{onSelect:r}=e,i;t[0]===r?i=t[1]:(i=Ke.map(e=>{let{name:t,schema:i,color:o,logo:s}=e;return(0,Z.jsx)(n,{name:t,color:o,icon:(0,Z.jsx)(a,{name:s,className:`w-8 h-8 text-white brightness-0 invert dark:invert`}),onSelect:()=>r(i)},t)}),t[0]=r,t[1]=i);let s;t[2]===i?s=t[3]:(s=(0,Z.jsx)(o,{children:i}),t[2]=i,t[3]=s);let c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsxs)(`h4`,{className:`font-semibold text-muted-foreground text-lg flex items-center gap-4 my-2`,children:[`Data Catalogs`,(0,Z.jsx)(`hr`,{className:`flex-1`})]}),t[4]=c):c=t[4];let l;t[5]===r?l=t[6]:(l=qe.map(e=>{let{name:t,schema:i,color:o,logo:s}=e;return(0,Z.jsx)(n,{name:t,color:o,icon:(0,Z.jsx)(a,{name:s,className:`w-8 h-8 text-white brightness-0 invert dark:invert`}),onSelect:()=>r(i)},t)}),t[5]=r,t[6]=l);let u;t[7]===l?u=t[8]:(u=(0,Z.jsx)(o,{children:l}),t[7]=l,t[8]=u);let d;return t[9]!==s||t[10]!==u?(d=(0,Z.jsxs)(Z.Fragment,{children:[s,c,u]}),t[9]=s,t[10]=u,t[11]=d):d=t[11],d},Ze=e=>{let t=(0,D.c)(13),{onSubmit:n,header:r}=e,[i,a]=(0,E.useState)(null);if(!i){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(`div`,{children:(0,Z.jsx)(Xe,{onSelect:a})}),t[0]=e):e=t[0];let n;return t[1]===r?n=t[2]:(n=(0,Z.jsxs)(Z.Fragment,{children:[r,e]}),t[1]=r,t[2]=n),n}let o;t[3]===i?o=t[4]:(o=Je.find(e=>e.schema===i),t[3]=i,t[4]=o);let c=o?.connectionLibraries,l;t[5]===c?.libraries?l=t[6]:(l=c?.libraries??[],t[5]=c?.libraries,t[6]=l);let u=c?.preferred??`sqlalchemy`,d;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>a(null),t[7]=d):d=t[7];let f;return t[8]!==n||t[9]!==i||t[10]!==l||t[11]!==u?(f=(0,Z.jsx)(s,{schema:i,libraries:l,preferredLibrary:u,displayNames:Ce,libraryLabel:`Preferred connection library`,generateCode:Qe,onSubmit:n,onBack:d}),t[8]=n,t[9]=i,t[10]=l,t[11]=u,t[12]=f):f=t[12],f};function Qe(e,t){return We(e,t)}var $e=e=>{let t=(0,D.c)(19),{className:n,sources:r,onAdd:i}=e,a=(0,E.useId)();if(r.length===0)return null;let o;t[0]===n?o=t[1]:(o=v(`rounded-full bg-[linear-gradient(135deg,var(--blue-2),var(--purple-3))] px-3 py-2 dark:bg-[linear-gradient(135deg,var(--blue-2),var(--purple-2))]`,n),t[0]=n,t[1]=o);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(c,{className:`h-3.5 w-3.5 text-(--blue-9) dark:text-(--blue-10)`}),t[2]=s):s=t[2];let l;t[3]===a?l=t[4]:(l=(0,Z.jsxs)(`div`,{className:`mr-1 flex items-center gap-1.5`,children:[s,(0,Z.jsx)(`h3`,{id:a,className:`text-sm`,children:`Quick add`})]}),t[3]=a,t[4]=l);let u;if(t[5]!==i||t[6]!==r){let e;t[8]===i?e=t[9]:(e=e=>(0,Z.jsx)(ie,{side:`bottom`,content:(0,Z.jsx)(et,{source:e}),children:(0,Z.jsxs)(`button`,{type:`button`,"aria-label":`Add ${e.displayName} connection`,className:`inline-flex items-center gap-1 rounded-full border border-border/60 bg-background px-2.5 py-1 text-xs font-medium text-foreground/90 transition-colors hover:border-(--blue-7) focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 dark:border-border dark:bg-background/60 dark:hover:bg-accent/80`,onClick:()=>i(e),children:[(0,Z.jsx)(se,{className:`h-3 w-3 text-muted-foreground`}),e.displayName]})},e.id),t[8]=i,t[9]=e),u=r.map(e),t[5]=i,t[6]=r,t[7]=u}else u=t[7];let d;t[10]===u?d=t[11]:(d=(0,Z.jsx)(b,{delayDuration:200,children:u}),t[10]=u,t[11]=d);let f;t[12]!==l||t[13]!==d?(f=(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[l,d]}),t[12]=l,t[13]=d,t[14]=f):f=t[14];let p;return t[15]!==o||t[16]!==f||t[17]!==a?(p=(0,Z.jsx)(`section`,{"aria-labelledby":a,className:o,children:f}),t[15]=o,t[16]=f,t[17]=a,t[18]=p):p=t[18],p},et=e=>{let t=(0,D.c)(17),{source:n}=e,r;t[0]===n.displayName?r=t[1]:(r=(0,Z.jsx)(`div`,{className:`font-medium`,children:n.displayName}),t[0]=n.displayName,t[1]=r);let i;t[2]===n.origins?i=t[3]:(i=n.origins.map(nt).join(` and `),t[2]=n.origins,t[3]=i);let a;t[4]===i?a=t[5]:(a=(0,Z.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[`Detected from`,` `,i]}),t[4]=i,t[5]=a);let o;t[6]!==r||t[7]!==a?(o=(0,Z.jsxs)(`div`,{children:[r,a]}),t[6]=r,t[7]=a,t[8]=o):o=t[8];let s;t[9]===n.configuration?s=t[10]:(s=n.configuration.map(rt),t[9]=n.configuration,t[10]=s);let c;t[11]===s?c=t[12]:(c=(0,Z.jsx)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-xs`,children:s}),t[11]=s,t[12]=c);let l;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Click to add a configured cell.`}),t[13]=l):l=t[13];let u;return t[14]!==o||t[15]!==c?(u=(0,Z.jsxs)(`div`,{className:`min-w-64 space-y-2 py-1`,children:[o,c,l]}),t[14]=o,t[15]=c,t[16]=u):u=t[16],u},tt=e=>{let t=(0,D.c)(4),{onSubmit:n,className:i,group:a}=e,o=r(n),s=u(a),c;return t[0]!==o||t[1]!==i||t[2]!==s?(c=(0,Z.jsx)($e,{className:i,sources:s,onAdd:o}),t[0]=o,t[1]=i,t[2]=s,t[3]=c):c=t[3],c};function nt(e){return e.label}function rt(e){return(0,Z.jsxs)(`div`,{className:`contents`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:e.field}),(0,Z.jsx)(`dd`,{children:(0,Z.jsx)(`code`,{children:e.value.kind===`environment-variable`?`os.environ["${e.value.name}"]`:e.value.value})})]},e.value.kind===`environment-variable`?e.value.name:`${e.field}:${e.value.value}`)}var it=()=>h(`type`,[m({type:d(`Access keys`),access_key_id:f().optional().describe(l.of({label:`Access Key ID`,description:`Leave empty to use the default credential chain`,inputType:`password`,optionRegex:`(access.?key.?id|object.?storage.?key|aws.?access.?key)`})),secret_access_key:f().optional().describe(l.of({label:`Secret Access Key`,inputType:`password`,optionRegex:`(secret.?access.?key|object.?storage.?secret|aws.?secret)`}))}),m({type:d(`Container credentials`),container_credentials_full_uri:f().nonempty().describe(l.of({label:`Credentials URI`,description:`Endpoint that vends credentials to the container`,placeholder:`http://169.254.170.23/v1/credentials`,optionRegex:`container.?credentials`})),container_authorization_token_file:f().nonempty().describe(l.of({label:`Authorization Token File`,description:`File holding the token sent to the credentials URI`,placeholder:`/var/run/secrets/token`,optionRegex:`(container.?authorization.?token.?file|container.?auth.?token)`}))})]).default({type:`Access keys`}).describe(l.of({label:`Credentials`,special:`tabs`})),at=m({type:d(`s3`),bucket:f().nonempty().describe(l.of({label:`Bucket`,placeholder:`my-bucket`,optionRegex:`(bucket|s3.?bucket)`})),region:f().optional().describe(l.of({label:`Region`,placeholder:`us-east-1`,optionRegex:`(region|aws.?region)`})),endpoint_url:f().optional().describe(l.of({label:`Endpoint URL`,description:`Ignored if the AWS_ENDPOINT_URL_S3 environment variable is set`,placeholder:`https://s3.amazonaws.com`,optionRegex:`(endpoint|s3.?url|s3.?endpoint)`})),allow_http:p().default(!1).describe(l.of({label:`Allow HTTP`,description:`Required for plain-http (non-TLS) endpoints`})),auth:it()}).describe(l.of({direction:`two-columns`})),ot=m({type:d(`gcs`),bucket:f().nonempty().describe(l.of({label:`Bucket`,placeholder:`my-bucket`,optionRegex:`(bucket|gcs.?bucket|google.?bucket)`})),service_account_key:f().optional().describe(l.of({label:`Service Account Key (JSON)`,special:`secret_textarea`}))}).describe(l.of({direction:`two-columns`})),Q=m({type:d(`azure`),container:f().nonempty().describe(l.of({label:`Container`,placeholder:`my-container`})),account_name:f().nonempty().describe(l.of({label:`Account Name`,placeholder:`storageaccount`,optionRegex:`(azure.?account|account.?name|storage.?account)`})),account_key:f().optional().describe(l.of({label:`Account Key`,inputType:`password`,optionRegex:`(azure.?key|account.?key|storage.?key)`}))}).describe(l.of({direction:`two-columns`})),st=m({type:d(`coreweave`),bucket:f().nonempty().describe(l.of({label:`Bucket`,placeholder:`bucket-name`})),region:f().nonempty().describe(l.of({label:`Region`,placeholder:`US-EAST-04A`})),auth:it()}).describe(l.of({direction:`two-columns`})),ct=m({type:d(`gdrive`),credentials_json:f().optional().describe(l.of({label:`Service Account JSON`,description:`Leave empty to use browser-based authentication`,special:`secret_textarea`}))}).describe(l.of({direction:`two-columns`})),lt=m({type:d(`huggingface`),token:f().optional().describe(l.of({label:`Access Token`,description:`Leave empty to use the HF_TOKEN environment variable or cached login`,inputType:`password`,optionRegex:`(hf.?token|hugging.?face.?token|hub.?token)`}))}).describe(l.of({direction:`two-columns`}));function ut(e){return e!=null&&e!==``}var dt=m({type:d(`github`),org:f().nonempty().describe(l.of({label:`Organization or user`})),repo:f().nonempty().describe(l.of({label:`Repository`})),sha:f().optional().describe(l.of({label:`Branch, tag, or commit`,placeholder:`main`,description:`Leave empty to use the default branch`})),username:f().optional().describe(l.of({label:`Username`,description:`Set this together with access token`,optionRegex:`(github.?username|github.?user)`})),token:f().optional().describe(l.of({label:`Access Token`,description:`Set this together with username. Required for private repos and to avoid GitHub's rate limits.`,inputType:`password`,optionRegex:`(github.?token|gh.?token|github.?pat)`}))}).refine(e=>ut(e.username)===ut(e.token),{message:`Username and access token are required together`,path:[`token`]}).describe(l.of({direction:`two-columns`})),ft=h(`type`,[at,ot,Q,st,ct,lt,dt]),pt={obstore:`obstore`,fsspec:`fsspec`,huggingface_hub:`huggingface_hub`},mt=class{secrets={};get imports(){return Object.keys(this.secrets).length===0?new Set:new Set([`import os`])}print(e,t){if(t===void 0||t===``)return``;let n=`_${e}`;if(w(t)){let e=oe(t);return this.secrets[n]=`os.environ.get("${e}")`,n}return`"${C(t)}"`}formatSecrets(){return Object.keys(this.secrets).length===0?``:Object.entries(this.secrets).map(([e,t])=>`${e} = ${t}`).join(`
135
+ `)}var Z=y(),Ke=[{name:`PostgreSQL`,schema:_e,color:`#336791`,logo:`postgres`,connectionLibraries:{libraries:[`sqlalchemy`,`sqlmodel`],preferred:`sqlalchemy`}},{name:`MySQL`,schema:ve,color:`#00758F`,logo:`mysql`,connectionLibraries:{libraries:[`sqlalchemy`,`sqlmodel`],preferred:`sqlalchemy`}},{name:`SQLite`,schema:ye,color:`#003B57`,logo:`sqlite`,connectionLibraries:{libraries:[`sqlalchemy`,`sqlmodel`],preferred:`sqlalchemy`}},{name:`DuckDB`,schema:be,color:`#FFD700`,logo:`duckdb`,connectionLibraries:{libraries:[`duckdb`],preferred:`duckdb`}},{name:`MotherDuck`,schema:I,color:`#ff9538`,logo:`motherduck`,connectionLibraries:{libraries:[`duckdb`],preferred:`duckdb`}},{name:`Snowflake`,schema:L,color:`#29B5E8`,logo:`snowflake`,connectionLibraries:{libraries:[`sqlalchemy`,`sqlmodel`],preferred:`sqlalchemy`}},{name:`ClickHouse`,schema:z,color:`#2C2C1D`,logo:`clickhouse`,connectionLibraries:{libraries:[`clickhouse_connect`],preferred:`clickhouse_connect`}},{name:`Timeplus`,schema:B,color:`#B83280`,logo:`timeplus`,connectionLibraries:{libraries:[`sqlalchemy`,`sqlmodel`],preferred:`sqlalchemy`}},{name:`BigQuery`,schema:R,color:`#4285F4`,logo:`bigquery`,connectionLibraries:{libraries:[`sqlalchemy`,`sqlmodel`],preferred:`sqlalchemy`}},{name:`ClickHouse Embedded`,schema:V,color:`#f2b611`,logo:`clickhouse`,connectionLibraries:{libraries:[`chdb`],preferred:`chdb`}},{name:`Trino`,schema:H,color:`#d466b6`,logo:`trino`,connectionLibraries:{libraries:[`sqlalchemy`,`sqlmodel`],preferred:`sqlalchemy`}},{name:`DataFusion`,schema:W,color:`#202A37`,logo:`datafusion`,connectionLibraries:{libraries:[`ibis`],preferred:`ibis`}},{name:`PySpark`,schema:G,color:`#1C5162`,logo:`pyspark`,connectionLibraries:{libraries:[`ibis`],preferred:`ibis`}},{name:`Redshift`,schema:K,color:`#522BAE`,logo:`redshift`,connectionLibraries:{libraries:[`redshift`],preferred:`redshift`}},{name:`Databricks`,schema:q,color:`#c41e0c`,logo:`databricks`,connectionLibraries:{libraries:[`sqlalchemy`,`sqlmodel`,`ibis`],preferred:`sqlalchemy`}},{name:`Supabase`,schema:xe,color:`#238F5F`,logo:`supabase`,connectionLibraries:{libraries:[`sqlalchemy`,`sqlmodel`],preferred:`sqlalchemy`}}],qe=[{name:`Iceberg`,schema:U,color:`#000000`,logo:`iceberg`,connectionLibraries:{libraries:[`pyiceberg`],preferred:`pyiceberg`}}],Je=[...Ke,...qe],Ye=[...new Set(Je.flatMap(({name:e,logo:t})=>[e,t]))],Xe=e=>{let t=(0,D.c)(12),{onSelect:r}=e,i;t[0]===r?i=t[1]:(i=Ke.map(e=>{let{name:t,schema:i,color:o,logo:s}=e;return(0,Z.jsx)(n,{name:t,color:o,icon:(0,Z.jsx)(a,{name:s,className:`w-8 h-8 text-white brightness-0 invert dark:invert`}),onSelect:()=>r(i)},t)}),t[0]=r,t[1]=i);let s;t[2]===i?s=t[3]:(s=(0,Z.jsx)(o,{children:i}),t[2]=i,t[3]=s);let c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsxs)(`h4`,{className:`font-semibold text-muted-foreground text-lg flex items-center gap-4 my-2`,children:[`Data Catalogs`,(0,Z.jsx)(`hr`,{className:`flex-1`})]}),t[4]=c):c=t[4];let l;t[5]===r?l=t[6]:(l=qe.map(e=>{let{name:t,schema:i,color:o,logo:s}=e;return(0,Z.jsx)(n,{name:t,color:o,icon:(0,Z.jsx)(a,{name:s,className:`w-8 h-8 text-white brightness-0 invert dark:invert`}),onSelect:()=>r(i)},t)}),t[5]=r,t[6]=l);let u;t[7]===l?u=t[8]:(u=(0,Z.jsx)(o,{children:l}),t[7]=l,t[8]=u);let d;return t[9]!==s||t[10]!==u?(d=(0,Z.jsxs)(Z.Fragment,{children:[s,c,u]}),t[9]=s,t[10]=u,t[11]=d):d=t[11],d},Ze=e=>{let t=(0,D.c)(13),{onSubmit:n,header:r}=e,[i,a]=(0,E.useState)(null);if(!i){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(`div`,{children:(0,Z.jsx)(Xe,{onSelect:a})}),t[0]=e):e=t[0];let n;return t[1]===r?n=t[2]:(n=(0,Z.jsxs)(Z.Fragment,{children:[r,e]}),t[1]=r,t[2]=n),n}let o;t[3]===i?o=t[4]:(o=Je.find(e=>e.schema===i),t[3]=i,t[4]=o);let c=o?.connectionLibraries,l;t[5]===c?.libraries?l=t[6]:(l=c?.libraries??[],t[5]=c?.libraries,t[6]=l);let u=c?.preferred??`sqlalchemy`,d;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>a(null),t[7]=d):d=t[7];let f;return t[8]!==n||t[9]!==i||t[10]!==l||t[11]!==u?(f=(0,Z.jsx)(s,{schema:i,libraries:l,preferredLibrary:u,displayNames:Ce,libraryLabel:`Preferred connection library`,generateCode:Qe,onSubmit:n,onBack:d}),t[8]=n,t[9]=i,t[10]=l,t[11]=u,t[12]=f):f=t[12],f};function Qe(e,t){return We(e,t)}var $e=e=>{let t=(0,D.c)(19),{className:n,sources:r,onAdd:i}=e,a=(0,E.useId)();if(r.length===0)return null;let o;t[0]===n?o=t[1]:(o=v(`rounded-full bg-[linear-gradient(135deg,var(--blue-2),var(--purple-3))] px-3 py-2 dark:bg-[linear-gradient(135deg,var(--blue-2),var(--purple-2))]`,n),t[0]=n,t[1]=o);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(c,{className:`h-3.5 w-3.5 text-(--blue-9) dark:text-(--blue-10)`}),t[2]=s):s=t[2];let l;t[3]===a?l=t[4]:(l=(0,Z.jsxs)(`div`,{className:`mr-1 flex items-center gap-1.5`,children:[s,(0,Z.jsx)(`h3`,{id:a,className:`text-sm`,children:`Quick add`})]}),t[3]=a,t[4]=l);let u;if(t[5]!==i||t[6]!==r){let e;t[8]===i?e=t[9]:(e=e=>(0,Z.jsx)(ie,{side:`bottom`,content:(0,Z.jsx)(et,{source:e}),children:(0,Z.jsxs)(`button`,{type:`button`,"aria-label":`Add ${e.displayName} connection`,className:`inline-flex items-center gap-1 rounded-full border border-border/60 bg-background px-2.5 py-1 text-xs font-medium text-foreground/90 transition-colors hover:border-(--blue-7) focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 dark:border-border dark:bg-background/60 dark:hover:bg-accent/80`,onClick:()=>i(e),children:[(0,Z.jsx)(se,{className:`h-3 w-3 text-muted-foreground`}),e.displayName]})},e.id),t[8]=i,t[9]=e),u=r.map(e),t[5]=i,t[6]=r,t[7]=u}else u=t[7];let d;t[10]===u?d=t[11]:(d=(0,Z.jsx)(b,{delayDuration:200,children:u}),t[10]=u,t[11]=d);let f;t[12]!==l||t[13]!==d?(f=(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[l,d]}),t[12]=l,t[13]=d,t[14]=f):f=t[14];let p;return t[15]!==o||t[16]!==f||t[17]!==a?(p=(0,Z.jsx)(`section`,{"aria-labelledby":a,className:o,children:f}),t[15]=o,t[16]=f,t[17]=a,t[18]=p):p=t[18],p},et=e=>{let t=(0,D.c)(17),{source:n}=e,r;t[0]===n.displayName?r=t[1]:(r=(0,Z.jsx)(`div`,{className:`font-medium`,children:n.displayName}),t[0]=n.displayName,t[1]=r);let i;t[2]===n.origins?i=t[3]:(i=n.origins.map(nt).join(` and `),t[2]=n.origins,t[3]=i);let a;t[4]===i?a=t[5]:(a=(0,Z.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[`Detected from`,` `,i]}),t[4]=i,t[5]=a);let o;t[6]!==r||t[7]!==a?(o=(0,Z.jsxs)(`div`,{children:[r,a]}),t[6]=r,t[7]=a,t[8]=o):o=t[8];let s;t[9]===n.configuration?s=t[10]:(s=n.configuration.map(rt),t[9]=n.configuration,t[10]=s);let c;t[11]===s?c=t[12]:(c=(0,Z.jsx)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-xs`,children:s}),t[11]=s,t[12]=c);let l;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Click to add a configured cell.`}),t[13]=l):l=t[13];let u;return t[14]!==o||t[15]!==c?(u=(0,Z.jsxs)(`div`,{className:`min-w-64 space-y-2 py-1`,children:[o,c,l]}),t[14]=o,t[15]=c,t[16]=u):u=t[16],u},tt=e=>{let t=(0,D.c)(4),{onSubmit:n,className:i,group:a}=e,o=r(n),s=u(a),c;return t[0]!==o||t[1]!==i||t[2]!==s?(c=(0,Z.jsx)($e,{className:i,sources:s,onAdd:o}),t[0]=o,t[1]=i,t[2]=s,t[3]=c):c=t[3],c};function nt(e){return e.label}function rt(e){return(0,Z.jsxs)(`div`,{className:`contents`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:e.field}),(0,Z.jsx)(`dd`,{children:(0,Z.jsx)(`code`,{children:e.value.kind===`environment-variable`?`os.environ["${e.value.name}"]`:e.value.value})})]},e.value.kind===`environment-variable`?e.value.name:`${e.field}:${e.value.value}`)}var it=()=>h(`type`,[p({type:m(`Access keys`),access_key_id:f().optional().describe(l.of({label:`Access Key ID`,description:`Leave empty to use the default credential chain`,inputType:`password`,optionRegex:`(access.?key.?id|object.?storage.?key|aws.?access.?key)`})),secret_access_key:f().optional().describe(l.of({label:`Secret Access Key`,inputType:`password`,optionRegex:`(secret.?access.?key|object.?storage.?secret|aws.?secret)`}))}),p({type:m(`Container credentials`),container_credentials_full_uri:f().nonempty().describe(l.of({label:`Credentials URI`,description:`Endpoint that vends credentials to the container`,placeholder:`http://169.254.170.23/v1/credentials`,optionRegex:`container.?credentials`})),container_authorization_token_file:f().nonempty().describe(l.of({label:`Authorization Token File`,description:`File holding the token sent to the credentials URI`,placeholder:`/var/run/secrets/token`,optionRegex:`(container.?authorization.?token.?file|container.?auth.?token)`}))})]).default({type:`Access keys`}).describe(l.of({label:`Credentials`,special:`tabs`})),at=p({type:m(`s3`),bucket:f().nonempty().describe(l.of({label:`Bucket`,placeholder:`my-bucket`,optionRegex:`(bucket|s3.?bucket)`})),region:f().optional().describe(l.of({label:`Region`,placeholder:`us-east-1`,optionRegex:`(region|aws.?region)`})),endpoint_url:f().optional().describe(l.of({label:`Endpoint URL`,description:`Ignored if the AWS_ENDPOINT_URL_S3 environment variable is set`,placeholder:`https://s3.amazonaws.com`,optionRegex:`(endpoint|s3.?url|s3.?endpoint)`})),allow_http:d().default(!1).describe(l.of({label:`Allow HTTP`,description:`Required for plain-http (non-TLS) endpoints`})),auth:it()}).describe(l.of({direction:`two-columns`})),ot=p({type:m(`gcs`),bucket:f().nonempty().describe(l.of({label:`Bucket`,placeholder:`my-bucket`,optionRegex:`(bucket|gcs.?bucket|google.?bucket)`})),service_account_key:f().optional().describe(l.of({label:`Service Account Key (JSON)`,special:`secret_textarea`}))}).describe(l.of({direction:`two-columns`})),Q=p({type:m(`azure`),container:f().nonempty().describe(l.of({label:`Container`,placeholder:`my-container`})),account_name:f().nonempty().describe(l.of({label:`Account Name`,placeholder:`storageaccount`,optionRegex:`(azure.?account|account.?name|storage.?account)`})),account_key:f().optional().describe(l.of({label:`Account Key`,inputType:`password`,optionRegex:`(azure.?key|account.?key|storage.?key)`}))}).describe(l.of({direction:`two-columns`})),st=p({type:m(`coreweave`),bucket:f().nonempty().describe(l.of({label:`Bucket`,placeholder:`bucket-name`})),region:f().nonempty().describe(l.of({label:`Region`,placeholder:`US-EAST-04A`})),auth:it()}).describe(l.of({direction:`two-columns`})),ct=p({type:m(`gdrive`),credentials_json:f().optional().describe(l.of({label:`Service Account JSON`,description:`Leave empty to use browser-based authentication`,special:`secret_textarea`}))}).describe(l.of({direction:`two-columns`})),lt=p({type:m(`huggingface`),token:f().optional().describe(l.of({label:`Access Token`,description:`Leave empty to use the HF_TOKEN environment variable or cached login`,inputType:`password`,optionRegex:`(hf.?token|hugging.?face.?token|hub.?token)`}))}).describe(l.of({direction:`two-columns`}));function ut(e){return e!=null&&e!==``}var dt=p({type:m(`github`),org:f().nonempty().describe(l.of({label:`Organization or user`})),repo:f().nonempty().describe(l.of({label:`Repository`})),sha:f().optional().describe(l.of({label:`Branch, tag, or commit`,placeholder:`main`,description:`Leave empty to use the default branch`})),username:f().optional().describe(l.of({label:`Username`,description:`Set this together with access token`,optionRegex:`(github.?username|github.?user)`})),token:f().optional().describe(l.of({label:`Access Token`,description:`Set this together with username. Required for private repos and to avoid GitHub's rate limits.`,inputType:`password`,optionRegex:`(github.?token|gh.?token|github.?pat)`}))}).refine(e=>ut(e.username)===ut(e.token),{message:`Username and access token are required together`,path:[`token`]}).describe(l.of({direction:`two-columns`})),ft=h(`type`,[at,ot,Q,st,ct,lt,dt]),pt={obstore:`obstore`,fsspec:`fsspec`,huggingface_hub:`huggingface_hub`},mt=class{secrets={};get imports(){return Object.keys(this.secrets).length===0?new Set:new Set([`import os`])}print(e,t){if(t===void 0||t===``)return``;let n=`_${e}`;if(w(t)){let e=oe(t);return this.secrets[n]=`os.environ.get("${e}")`,n}return`"${C(t)}"`}formatSecrets(){return Object.keys(this.secrets).length===0?``:Object.entries(this.secrets).map(([e,t])=>`${e} = ${t}`).join(`
136
136
  `)}};function ht(e,t){if(e?.type===`Container credentials`)return[` container_credentials_full_uri=${t.print(`container_credentials_full_uri`,e.container_credentials_full_uri)},`,` container_authorization_token_file=${t.print(`container_authorization_token_file`,e.container_authorization_token_file)},`];let n=[];return e?.access_key_id&&n.push(` access_key_id=${t.print(`access_key_id`,e.access_key_id)},`),e?.secret_access_key&&n.push(` secret_access_key=${t.print(`secret_access_key`,e.secret_access_key)},`),n}function gt(e,t){let n=t.print(`bucket`,e.bucket),r=new Set([`from obstore.store import S3Store`]),a=[];e.region&&a.push(` region=${t.print(`region`,e.region)},`),a.push(...ht(e.auth,t)),e.endpoint_url&&a.push(` endpoint_url=${t.print(`endpoint_url`,e.endpoint_url)},`),e.allow_http&&a.push(` allow_http=True,`);let o=a.length>0?`\n${a.join(`
137
137
  `)}\n`:``;return{imports:r,code:i(`
138
138
  store = S3Store(${n},${o})