@marimo-team/frontend 0.23.12-dev4 → 0.23.12-dev7
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.
- package/dist/assets/{CellStatus-DWKF60ch.js → CellStatus-6opTJjMX.js} +1 -1
- package/dist/assets/{ConnectedDataExplorerComponent-DjiALugX.js → ConnectedDataExplorerComponent-i1kaFF7n.js} +1 -1
- package/dist/assets/{ErrorBoundary-YqGfStRa.js → ErrorBoundary-Bo313Z9X.js} +1 -1
- package/dist/assets/{ImperativeModal-_JsD8Geg.js → ImperativeModal-B62Q6S9l.js} +1 -1
- package/dist/assets/{Inputs-CuKU-ENz.css → Inputs-C4Oo7q-H.css} +1 -1
- package/dist/assets/{JsonOutput-B7vuddcd.css → JsonOutput-BQtz7-np.css} +1 -1
- package/dist/assets/{JsonOutput-QXW7KD7g.js → JsonOutput-CWVuEz6C.js} +3 -3
- package/dist/assets/{LazyAnyLanguageCodeMirror-BqPfvXlM.js → LazyAnyLanguageCodeMirror-CsAMDSIw.js} +2 -2
- package/dist/assets/{MarimoErrorOutput-CbSSWhjw.js → MarimoErrorOutput-dYrcxVwq.js} +2 -2
- package/dist/assets/{RSPContexts-B9yuKjdT.js → RSPContexts-VzcTZjG1.js} +1 -1
- package/dist/assets/{RenderHTML-B283s7MJ.js → RenderHTML-ohul2q99.js} +1 -1
- package/dist/assets/{RunButton-C_19zU-4.js → RunButton-BMpP08P_.js} +1 -1
- package/dist/assets/{add-cell-with-ai-63FLemQ6.js → add-cell-with-ai-5tJjrFh0.js} +1 -1
- package/dist/assets/{add-connection-dialog-Bv2XA3ka.js → add-connection-dialog-pVExi7gB.js} +1 -1
- package/dist/assets/{agent-panel-7V3dGxQ5.js → agent-panel-By97CFFK.js} +5 -5
- package/dist/assets/{ai-model-dropdown-C6gk2SxA.js → ai-model-dropdown-Dvmxl0HU.js} +4 -4
- package/dist/assets/alert-1y_DnRWn.js +1 -0
- package/dist/assets/{alert-dialog-Dj7YzzBi.js → alert-dialog-CC0gG4Av.js} +1 -1
- package/dist/assets/{any-language-editor-DadY-3pz.js → any-language-editor-F2HBwXr3.js} +1 -1
- package/dist/assets/{app-config-button-CC-L3J3r.js → app-config-button-BB5z7_FE.js} +1 -1
- package/dist/assets/{button-DuHyjdW2.js → button-BF7GSjhW.js} +1 -1
- package/dist/assets/{cache-panel-BHYMMbEc.js → cache-panel-BlIrcwlT.js} +1 -1
- package/dist/assets/{capabilities-ClLgkhPb.js → capabilities-CjNGDxxx.js} +1 -1
- package/dist/assets/{cell-editor-b-XUcy_0.js → cell-editor-DQKaGrC9.js} +2 -2
- package/dist/assets/cell-editor-_cVIHMNI.css +2 -0
- package/dist/assets/{cell-link-CltAZE6t.js → cell-link-DBKqdVgo.js} +1 -1
- package/dist/assets/{cells-pu5xzE_v.css → cells-BVzo2MHf.css} +2 -2
- package/dist/assets/{cells-CHWMpikY.js → cells-DiASVTIh.js} +20 -20
- package/dist/assets/{chat-display-0upQ9ApT.js → chat-display-D8X6vz7W.js} +1 -1
- package/dist/assets/{chat-panel-C3iqwnxV.js → chat-panel-B9l3ukjX.js} +1 -1
- package/dist/assets/{chat-ui-CG7BMZQT.js → chat-ui-BwH7dd6n.js} +1 -1
- package/dist/assets/{column-preview-DPRIVh2U.js → column-preview-B3CdpsbL.js} +1 -1
- package/dist/assets/{command-emRtRCMn.js → command-DRHbYHUP.js} +1 -1
- package/dist/assets/{command-palette-J0bFdD9g.js → command-palette-D2BHtSuk.js} +1 -1
- package/dist/assets/{common-YBBQumDk.js → common-CvUUt55g.js} +1 -1
- package/dist/assets/{components-DBOw-EPg.js → components-CimBDpZ8.js} +1 -1
- package/dist/assets/{config-6vnnoRNy.js → config-3clPIEB9.js} +1 -1
- package/dist/assets/{copy-C_iQKqnH.js → copy-D8MtpXgN.js} +1 -1
- package/dist/assets/{copy-icon-CeGeeBdW.js → copy-icon-EHMT-qlr.js} +1 -1
- package/dist/assets/{createReducer-CzbhqMat.js → createReducer-3wF4dU7I.js} +1 -1
- package/dist/assets/{datasource-C6_8-viy.js → datasource-Da-qoi34.js} +1 -1
- package/dist/assets/{dates-C61OL-dM.js → dates-D8uxHHPL.js} +1 -1
- package/dist/assets/{dependency-graph-panel-D83-WLVK.js → dependency-graph-panel-CMjZH8W-.js} +2 -2
- package/dist/assets/{dialog-HQS6OqZN.js → dialog-DkJmIrsG.js} +1 -1
- package/dist/assets/{dist-C3166O2z.js → dist-DCqDlsgq.js} +1 -1
- package/dist/assets/{documentation-panel-DTnM09IC.js → documentation-panel-BS_uG8hW.js} +1 -1
- package/dist/assets/{download-Ct_TgW5r.js → download-CdS_EveB.js} +1 -1
- package/dist/assets/{dropdown-menu-ItqBTuc3.js → dropdown-menu-DfGLyCbP.js} +1 -1
- package/dist/assets/{edit-page-CRS0yn99.js → edit-page-DanoliKk.js} +6 -6
- package/dist/assets/empty-state-QmmE2oN4.js +1 -0
- package/dist/assets/{error-banner-Ct1mv9wE.js → error-banner-BSQVN46J.js} +1 -1
- package/dist/assets/{error-panel-DLrrxrpE.js → error-panel-Csh1BgrG.js} +1 -1
- package/dist/assets/{es-D70Vphlx.js → es-EItoYvXh.js} +1 -1
- package/dist/assets/{field-tn87_E9F.js → field-DlNY-dDH.js} +1 -1
- package/dist/assets/{file-explorer-panel-C4On50ex.js → file-explorer-panel--h0xwnRB.js} +1 -1
- package/dist/assets/{file-icons-CYkhl3GL.js → file-icons-D6BjDFSV.js} +1 -1
- package/dist/assets/{file-name-input-ChsdEroc.js → file-name-input-CsUxNFtr.js} +1 -1
- package/dist/assets/{floating-outline-BYOWegDI.js → floating-outline-D2cwxR8Z.js} +1 -1
- package/dist/assets/{focus-D5qOsUgK.js → focus-BvvRVcVF.js} +1 -1
- package/dist/assets/{form-DeUXsgGH.js → form-CO925gWV.js} +1 -1
- package/dist/assets/{formats-CBt24TWP.js → formats-ZGU43GQU.js} +1 -1
- package/dist/assets/{formatting-eWiw-Q8f.js → formatting-DhA_x3cD.js} +1 -1
- package/dist/assets/{fullscreen-BWhrFYLX.js → fullscreen-BXI8V5i6.js} +1 -1
- package/dist/assets/{gallery-page-Cdzff-Qg.js → gallery-page-CNPcxPCI.js} +1 -1
- package/dist/assets/{glide-data-editor-C-TEbaaI.js → glide-data-editor-Bmm8OMxa.js} +1 -1
- package/dist/assets/glide-data-editor-bv6Gjy-B.css +1 -0
- package/dist/assets/{globals-CtlGW6I9.js → globals-Bx8Km3LH.js} +1 -1
- package/dist/assets/{home-page-mSJrlwQP.js → home-page-CPt4LGp0.js} +1 -1
- package/dist/assets/{hooks-B7Rts5E9.js → hooks-7dyPrQQS.js} +1 -1
- package/dist/assets/{html-to-image-CwotZpj4.js → html-to-image-BWhkUSek.js} +1 -1
- package/dist/assets/index-C65kCpI9.css +2 -0
- package/dist/assets/{index-CPP8bPS4.js → index-awbrczCl.js} +7 -7
- package/dist/assets/{input-DqLOEfxi.js → input-DB2LiTiQ.js} +1 -1
- package/dist/assets/{kiosk-mode-BbYPCeNP.js → kiosk-mode-D0mAc3Fr.js} +1 -1
- package/dist/assets/{label-B0dIDKzs.js → label-CFvCMYuj.js} +1 -1
- package/dist/assets/{layout-D6cTuIkL.js → layout-C0MKkswN.js} +3 -3
- package/dist/assets/{links-DyPoFWQA.js → links-BN8FYTyp.js} +1 -1
- package/dist/assets/{logs-panel-Bbs9bNZs.js → logs-panel-BaGDTq_5.js} +1 -1
- package/dist/assets/{markdown-renderer-BNkLMIkn.js → markdown-renderer-CyLjgnQY.js} +1 -1
- package/dist/assets/{menu-items-CO4MfAgB.js → menu-items-CQMqwayA.js} +1 -1
- package/dist/assets/{mermaid-x93GPw1i.js → mermaid-yhDJCmk2.js} +1 -1
- package/dist/assets/{multi-icon-pwGWVz3d.css → multi-icon-CW3_9bja.css} +1 -1
- package/dist/assets/{multi-map-BRoHtMOY.js → multi-map-9ogswH46.js} +1 -1
- package/dist/assets/{name-cell-input-BLlsboll.js → name-cell-input-DBkW5PZU.js} +1 -1
- package/dist/assets/{numbers-B5K_E7OP.js → numbers-_ry1Nlla.js} +1 -1
- package/dist/assets/{outline-panel-w43V587L.css → outline-panel-DHPbKZNT.css} +1 -1
- package/dist/assets/{outline-panel-rkIr1QNz.js → outline-panel-xLeB4sTR.js} +1 -1
- package/dist/assets/{packages-panel-BDeQ6RMe.js → packages-panel-BbWGOWIZ.js} +1 -1
- package/dist/assets/{pair-with-agent-modal-LNomHeQ3.js → pair-with-agent-modal-Q9Od23Rh.js} +2 -2
- package/dist/assets/{panels-B4E3DsXP.css → panels-DDsRoC3H.css} +1 -1
- package/dist/assets/{panels-DklBul5F.js → panels-id0eyz64.js} +1 -1
- package/dist/assets/{popover-CjugjEGp.js → popover-DMNO6Poc.js} +1 -1
- package/dist/assets/process-output-BcuY_Us9.js +1 -0
- package/dist/assets/{radio-group-ro2znWCo.js → radio-group-XouISBp9.js} +1 -1
- package/dist/assets/{readonly-python-code-Rbx7Ee_u.js → readonly-python-code-BK3Xk2qY.js} +1 -1
- package/dist/assets/{renderShortcut-D7vPTxQw.js → renderShortcut-LpVarhnQ.js} +1 -1
- package/dist/assets/{reveal-component-CMD1_gk8.css → reveal-component-55QLSQaY.css} +1 -1
- package/dist/assets/{reveal-component-D--4ov10.js → reveal-component-Do91RUH9.js} +2 -2
- package/dist/assets/{run-page-HMHhlHXA.js → run-page-CYnMjVum.js} +1 -1
- package/dist/assets/{runs-C1XrKvr5.js → runs-Edg4TRSI.js} +1 -1
- package/dist/assets/{scratchpad-panel-1N03WMvF.js → scratchpad-panel-DH3KlUbZ.js} +1 -1
- package/dist/assets/{secrets-panel-BdUz6vG7.js → secrets-panel-CgahHnqr.js} +1 -1
- package/dist/assets/{select-D8ewebPZ.js → select-Cjly7tmx.js} +1 -1
- package/dist/assets/{session-NNbloO8g.js → session-CsT5Gg9j.js} +1 -1
- package/dist/assets/{session-panel-sp7p_i1J.js → session-panel-BJP2lKfE.js} +1 -1
- package/dist/assets/{share-C1RBdbis.js → share-DQjChRJG.js} +1 -1
- package/dist/assets/{snippets-panel-BWo8lxGn.js → snippets-panel-DKenTNmv.js} +1 -1
- package/dist/assets/{snippets-panel-fg1cdAzn.css → snippets-panel-Qc3aWbYx.css} +1 -1
- package/dist/assets/{spec-CegvVOyV.js → spec-CDgWI0fT.js} +1 -1
- package/dist/assets/{state-Des6nv42.js → state-Cy10NkuA.js} +1 -1
- package/dist/assets/{state-nw3MJ7Ul.js → state-DjrxAf9W.js} +1 -1
- package/dist/assets/{state-3LYweM3z.js → state-DwAS0kE4.js} +1 -1
- package/dist/assets/{state-C2QvlGMs.js → state-MC8-jN2e.js} +1 -1
- package/dist/assets/{strings-C0KZ4uek.js → strings-DvZlHYnD.js} +1 -1
- package/dist/assets/{swiper-component-CJYx1rIa.js → swiper-component-BwPCQTdo.js} +1 -1
- package/dist/assets/{swiper-component-a65-SW8d.css → swiper-component-UB_Zmrma.css} +1 -1
- package/dist/assets/{switch-CAAV-Q_3.js → switch-DvDNxcZP.js} +1 -1
- package/dist/assets/{table-D0oF_Cv_.js → table-CnW850Wt.js} +1 -1
- package/dist/assets/{terminal-Bd0wzkSP.js → terminal-BXH7Uaqi.js} +1 -1
- package/dist/assets/{textarea-BF6sxhXQ.js → textarea-BBpaAGpK.js} +1 -1
- package/dist/assets/{tooltip-DfvClvB6.js → tooltip-CgQpRVyN.js} +1 -1
- package/dist/assets/{tracing-Cgii-4al.js → tracing-Bz68-Fa1.js} +1 -1
- package/dist/assets/{tracing-panel-BXvvt77y.js → tracing-panel-BfgGYFNi.js} +2 -2
- package/dist/assets/{tree-actions-D0qu4tQX.js → tree-actions-C729o8TG.js} +1 -1
- package/dist/assets/{useBoolean-CEf-f6bo.js → useBoolean-BMzj74q1.js} +1 -1
- package/dist/assets/{useCellActionButton-CctL-6ce.js → useCellActionButton-VGB6-gGh.js} +1 -1
- package/dist/assets/{useDeleteCell-9SpULTHH.js → useDeleteCell-D_p8uMly.js} +1 -1
- package/dist/assets/{useDependencyPanelTab-DEoqXf8l.js → useDependencyPanelTab-v8fQPE_U.js} +1 -1
- package/dist/assets/{useEventListener-Wyg6Md5s.js → useEventListener-BakX-tnw.js} +1 -1
- package/dist/assets/{useHotkey-BK1MRrIi.js → useHotkey-CJo8iX8v.js} +1 -1
- package/dist/assets/{useIframeCapabilities-piGMPmIq.js → useIframeCapabilities-B0dNZiKK.js} +1 -1
- package/dist/assets/{useInstallPackage-D_8LtT7f.js → useInstallPackage-C1Dd0aIZ.js} +1 -1
- package/dist/assets/{useInterval-D6xsFpdR.js → useInterval-BvJQmQqd.js} +1 -1
- package/dist/assets/{useNotebookActions-WDk7rlWv.js → useNotebookActions-Hdu82BAI.js} +1 -1
- package/dist/assets/{useRunCells-CXNnlQUh.js → useRunCells-DXtOL4UR.js} +1 -1
- package/dist/assets/{useSplitCell-7Ob0s_PE.js → useSplitCell-CzaZEqwj.js} +1 -1
- package/dist/assets/{useTheme-D7YEMvxS.js → useTheme-D_ZbTTJw.js} +1 -1
- package/dist/assets/{utils-B-XvLACn.js → utils-DPvpQ891.js} +1 -1
- package/dist/assets/{utils-Dcn8htEz.js → utils-Dev6I_Kv.js} +1 -1
- package/dist/assets/{vega-component-Cc5BbafI.js → vega-component-Ch7x9hsC.js} +1 -1
- package/dist/assets/{write-secret-modal-DW9FRn4n.js → write-secret-modal-K2n79wHj.js} +1 -1
- package/dist/index.html +70 -70
- package/package.json +3 -3
- package/src/components/ai/display-helpers.tsx +5 -5
- package/src/components/app-config/ai-config.tsx +5 -5
- package/src/components/app-config/mcp-config.tsx +3 -3
- package/src/components/chat/acp/agent-panel.tsx +3 -3
- package/src/components/chat/acp/blocks.tsx +36 -38
- package/src/components/chat/acp/common.tsx +12 -16
- package/src/components/chat/acp/scroll-to-bottom-button.tsx +1 -1
- package/src/components/chat/acp/session-tabs.tsx +2 -2
- package/src/components/chat/chat-history-popover.tsx +1 -1
- package/src/components/data-table/columns.tsx +2 -2
- package/src/components/data-table/filter-pill-editor.tsx +1 -1
- package/src/components/dependency-graph/minimap-content.tsx +1 -1
- package/src/components/editor/RecoveryButton.tsx +1 -1
- package/src/components/editor/actions/pair-with-agent-modal.tsx +2 -2
- package/src/components/editor/ai/ai-completion-editor.tsx +1 -1
- package/src/components/editor/cell/CreateCellButton.tsx +1 -1
- package/src/components/editor/chrome/panels/empty-state.tsx +1 -1
- package/src/components/editor/chrome/panels/outline/floating-outline.tsx +1 -1
- package/src/components/editor/chrome/wrapper/pending-ai-cells.tsx +1 -1
- package/src/components/editor/columns/cell-column.tsx +1 -1
- package/src/components/editor/columns/sortable-column.tsx +2 -2
- package/src/components/editor/output/MarimoErrorOutput.tsx +1 -1
- package/src/components/editor/output/TextOutput.tsx +2 -2
- package/src/components/slides/minimap.tsx +2 -2
- package/src/components/slides/reveal-component.tsx +1 -1
- package/src/components/ui/alert.tsx +1 -1
- package/src/components/ui/command.tsx +2 -2
- package/src/components/ui/reorderable-list.tsx +1 -1
- package/src/components/ui/table.tsx +2 -5
- package/src/core/codemirror/language/languages/sql/renderers.tsx +60 -68
- package/src/core/hotkeys/hotkeys.ts +1 -0
- package/src/plugins/impl/MatrixPlugin.tsx +2 -2
- package/src/plugins/impl/TabsPlugin.tsx +1 -1
- package/src/plugins/impl/matplotlib/matplotlib-renderer.ts +1 -1
- package/src/plugins/impl/mpl-interactive/MplInteractivePlugin.tsx +155 -98
- package/src/plugins/impl/mpl-interactive/__tests__/MplInteractivePlugin.test.tsx +154 -1
- package/src/plugins/impl/mpl-interactive/mpl-websocket-shim.ts +10 -0
- package/dist/assets/alert-DqbbTJFm.js +0 -1
- package/dist/assets/cell-editor-nqEF4IhQ.css +0 -2
- package/dist/assets/empty-state-COZ7sMv4.js +0 -1
- package/dist/assets/glide-data-editor-BrZJn3-g.css +0 -1
- package/dist/assets/index-DYQYDO53.css +0 -2
- package/dist/assets/process-output-B1Leg7X7.js +0 -1
- /package/dist/assets/{Inputs-Ce5uKBe1.js → Inputs-CqgPhOqy.js} +0 -0
- /package/dist/assets/{multi-icon-DZE4vMSW.js → multi-icon-CTvmuLdL.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Ge=Object.defineProperty;var Ve=(t,e,s)=>e in t?Ge(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var z=(t,e,s)=>Ve(t,typeof e!="symbol"?e+"":e,s);import{s as ne}from"./chunk-LvLJmgfZ.js";import{u as Ze}from"./useEvent-D91BmmQi.js";import{t as Qe}from"./react-Bj1aDYRI.js";import{D as Je,Qn as y,jt as ce}from"./cells-CHWMpikY.js";import{D as M,P as _,R as u,T as D,_ as ae,i as Ye,k as w,m as Xe}from"./zod-H_cgTO0M.js";import{t as B}from"./compiler-runtime-B3qBwwSJ.js";import{v as et}from"./useEventListener-Wyg6Md5s.js";import{c as tt}from"./utils-Dcn8htEz.js";import{t as G}from"./cn-X2M2usMq.js";import{t as st}from"./jsx-runtime-PbYoItBR.js";import{a as rt,c as ie,o as le,s as ot}from"./popover-CjugjEGp.js";import{c as nt,i as ct,n as at,r as it,s as lt,t as dt}from"./select-D8ewebPZ.js";import{a as J,c as de,o as pt,p as ht,r as mt,t as ut}from"./dropdown-menu-ItqBTuc3.js";import{t as Y}from"./button-DuHyjdW2.js";import{l as bt}from"./arrays-DWxvyYxP.js";import{r as U}from"./strings-C0KZ4uek.js";import{t as ft}from"./createLucideIcon-BTp1tQDO.js";import{t as gt}from"./circle-plus-BIy1BGHw.js";import{t as yt}from"./database-zap-DIlSqcdp.js";import{t as _t}from"./github-CyzgLJDA.js";import{c,o as wt,t as St,u as xt}from"./form-DeUXsgGH.js";import{n as kt}from"./DeferredRequestRegistry-RuL7NV1n.js";import{o as vt,r as $t}from"./input-DqLOEfxi.js";import{a as jt,c as Ct,d as At,g as Tt,l as Rt,o as Lt,p as Dt,s as It,u as Pt}from"./textarea-BF6sxhXQ.js";import{r as qt}from"./useTheme-D7YEMvxS.js";import{a as Nt,c as Ft,l as Et,n as Bt,r as Ot,t as Mt}from"./dialog-HQS6OqZN.js";import{n as Ut}from"./ImperativeModal-_JsD8Geg.js";import{t as V}from"./links-CCkJpphF.js";import{t as Kt}from"./useIframeCapabilities-piGMPmIq.js";import{r as Ht}from"./html-to-image-CwotZpj4.js";import{o as Wt}from"./focus-D5qOsUgK.js";import{n as zt}from"./useAsyncData-DAQcLiyE.js";import{n as Gt,t as Vt}from"./azure-DBVzcmvx.js";import{t as Zt}from"./request-registry-K6vbazWs.js";import{n as Qt,t as Jt}from"./write-secret-modal-DW9FRn4n.js";var X=ft("hard-drive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]),ee="env:";function Or(t){return t}function K(t){return typeof t=="string"?t.startsWith(ee):!1}function te(t){return`${ee}${t}`}function pe(t){return t.replace(ee,"")}var Yt=B(),N=ne(Qe(),1),n=ne(st(),1),he=(0,N.createContext)({providerNames:[],secretKeys:[],loading:!1,error:void 0,refreshSecrets:et.NOOP});const Xt=()=>(0,N.use)(he),es=t=>{let e=(0,Yt.c)(14),{children:s}=t,o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=[],e[0]=o):o=e[0];let{data:r,isPending:d,error:i,refetch:a}=zt(ns,o),l;e[1]===(r==null?void 0:r.secretKeys)?l=e[2]:(l=(r==null?void 0:r.secretKeys)||[],e[1]=r==null?void 0:r.secretKeys,e[2]=l);let p;e[3]===(r==null?void 0:r.providerNames)?p=e[4]:(p=(r==null?void 0:r.providerNames)||[],e[3]=r==null?void 0:r.providerNames,e[4]=p);let h;e[5]!==i||e[6]!==d||e[7]!==a||e[8]!==l||e[9]!==p?(h={secretKeys:l,providerNames:p,loading:d,error:i,refreshSecrets:a},e[5]=i,e[6]=d,e[7]=a,e[8]=l,e[9]=p,e[10]=h):h=e[10];let f;return e[11]!==s||e[12]!==h?(f=(0,n.jsx)(he,{value:h,children:s}),e[11]=s,e[12]=h,e[13]=f):f=e[13],f},ts={isMatch:t=>{if(t instanceof ae||t instanceof Xe){let{optionRegex:e}=c.parse(t.description||"");return!!e}return!1},Component:({schema:t,form:e,path:s})=>{let{secretKeys:o,providerNames:r,refreshSecrets:d}=Xt(),{openModal:i,closeModal:a}=Ut(),{label:l,description:p,optionRegex:h=""}=c.parse(t.description||""),[f,b]=bt(o,m=>new RegExp(h,"i").test(m));return(0,n.jsx)(Ct,{control:e.control,name:s,render:({field:m})=>(0,n.jsxs)(Rt,{children:[(0,n.jsx)(Pt,{children:l}),(0,n.jsx)(Lt,{children:p}),(0,n.jsx)(jt,{children:(0,n.jsxs)("div",{className:"flex gap-2",children:[t instanceof ae?(0,n.jsx)($t,{...m,value:m.value,onChange:m.onChange,className:G("flex-1")}):(0,n.jsx)(vt,{...m,value:m.value,onChange:m.onChange,className:"flex-1"}),(0,n.jsxs)(ut,{children:[(0,n.jsx)(ht,{asChild:!0,children:(0,n.jsx)(Y,{variant:"outline",size:"icon",className:G(K(m.value)&&"bg-accent"),children:(0,n.jsx)(kt,{className:"h-3 w-3"})})}),(0,n.jsxs)(mt,{align:"end",className:"max-h-60 overflow-y-auto",children:[(0,n.jsxs)(J,{onSelect:()=>{i((0,n.jsx)(Jt,{providerNames:r,onSuccess:g=>{d(),m.onChange(te(g)),a()},onClose:a}))},children:[(0,n.jsx)(gt,{className:"mr-2 h-3.5 w-3.5"}),"Create a new secret"]}),f.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(de,{}),(0,n.jsx)(pt,{children:"Recommended"})]}),f.map(g=>(0,n.jsx)(J,{onSelect:()=>m.onChange(te(g)),children:g},g)),b.length>0&&(0,n.jsx)(de,{}),b.map(g=>(0,n.jsx)(J,{onSelect:()=>m.onChange(te(g)),children:g},g))]})]})]})}),(0,n.jsx)(At,{})]})})}};function ss(t){return t.provider!=="env"}function rs(t){return t.name}function os(t){return t.keys}async function ns(){let t=await Zt.request({}),e=Qt(t.secrets).filter(ss).map(rs);return{secretKeys:t.secrets.flatMap(os).toSorted(),providerNames:e}}var H=B(),cs=[ts];const se=t=>{let e=(0,H.c)(2),{children:s}=t,o;return e[0]===s?o=e[1]:(o=(0,n.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4",children:s}),e[0]=s,e[1]=o),o},re=t=>{let e=(0,H.c)(9),{name:s,color:o,icon:r,onSelect:d}=t,i;e[0]===o?i=e[1]:(i={backgroundColor:o},e[0]=o,e[1]=i);let a;e[2]===s?a=e[3]:(a=(0,n.jsx)("span",{className:"text-white font-medium text-lg",children:s}),e[2]=s,e[3]=a);let l;return e[4]!==r||e[5]!==d||e[6]!==i||e[7]!==a?(l=(0,n.jsxs)("button",{type:"button",className:"py-3 flex flex-col items-center justify-center gap-1 transition-all hover:scale-105 hover:brightness-110 rounded shadow-sm-solid hover:shadow-md-solid",style:i,onClick:d,children:[r,a]}),e[4]=r,e[5]=d,e[6]=i,e[7]=a,e[8]=l):l=e[8],l},as=t=>{let e=(0,H.c)(25),{onBack:s,isValid:o,libraries:r,preferredLibrary:d,onLibraryChange:i,displayNames:a,libraryLabel:l}=t,p=l===void 0?"Preferred library":l,h;e[0]===s?h=e[1]:(h=(0,n.jsx)(Y,{type:"button",variant:"outline",onClick:s,children:"Back"}),e[0]=s,e[1]=h);let f=!o,b;e[2]===f?b=e[3]:(b=(0,n.jsx)(Y,{type:"submit",disabled:f,children:"Add"}),e[2]=f,e[3]=b);let m;e[4]!==h||e[5]!==b?(m=(0,n.jsxs)("div",{className:"flex gap-2",children:[h,b]}),e[4]=h,e[5]=b,e[6]=m):m=e[6];let g;e[7]===Symbol.for("react.memo_cache_sentinel")?(g=(0,n.jsx)(lt,{children:(0,n.jsx)(nt,{placeholder:"Select a library"})}),e[7]=g):g=e[7];let S;e[8]===p?S=e[9]:(S=(0,n.jsxs)("div",{className:"flex flex-col gap-1 items-end",children:[g,(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:p})]}),e[8]=p,e[9]=S);let $;if(e[10]!==a||e[11]!==r){let j;e[13]===a?j=e[14]:(j=R=>(0,n.jsx)(ct,{value:R,children:a[R]??R},R),e[13]=a,e[14]=j),$=r.map(j),e[10]=a,e[11]=r,e[12]=$}else $=e[12];let x;e[15]===$?x=e[16]:(x=(0,n.jsx)(at,{children:(0,n.jsx)(it,{children:$})}),e[15]=$,e[16]=x);let v;e[17]!==i||e[18]!==d||e[19]!==S||e[20]!==x?(v=(0,n.jsx)("div",{children:(0,n.jsxs)(dt,{value:d,onValueChange:i,children:[S,x]})}),e[17]=i,e[18]=d,e[19]=S,e[20]=x,e[21]=v):v=e[21];let C;return e[22]!==v||e[23]!==m?(C=(0,n.jsxs)("div",{className:"flex gap-2 justify-between",children:[m,v]}),e[22]=v,e[23]=m,e[24]=C):C=e[24],C};function is(){let t=(0,H.c)(4),{createNewCell:e}=Je(),s=Wt(),o=Ze(tt),r;return t[0]!==o||t[1]!==e||t[2]!==s?(r=d=>{/\bmo\./.test(d)&&Ht({autoInstantiate:o,createNewCell:e,fromCellId:s}),e({code:d,before:!1,cellId:s??"__end__",skipIfCodeExists:!0})},t[0]=o,t[1]=e,t[2]=s,t[3]=r):r=t[3],r}const me=t=>{let e=(0,H.c)(30),{schema:s,libraries:o,preferredLibrary:r,displayNames:d,libraryLabel:i,generateCode:a,onSubmit:l,onBack:p}=t,h;e[0]===s?h=e[1]:(h=wt(s),e[0]=s,e[1]=h);let f=h,b;e[2]===s?b=e[3]:(b=Dt(s),e[2]=s,e[3]=b);let m;e[4]!==f||e[5]!==b?(m={defaultValues:f,resolver:b,reValidateMode:"onChange"},e[4]=f,e[5]=b,e[6]=m):m=e[6];let g=Tt(m),[S,$]=N.useState(r),x=is(),v;e[7]!==a||e[8]!==x||e[9]!==l||e[10]!==S?(v=ze=>{x(a(ze,S)),l()},e[7]=a,e[8]=x,e[9]=l,e[10]=S,e[11]=v):v=e[11];let C=v,j;e[12]!==g||e[13]!==C?(j=g.handleSubmit(C),e[12]=g,e[13]=C,e[14]=j):j=e[14];let R;e[15]===Symbol.for("react.memo_cache_sentinel")?(R=(0,n.jsx)(It,{}),e[15]=R):R=e[15];let F;e[16]!==g||e[17]!==s?(F=(0,n.jsx)(es,{children:(0,n.jsx)(St,{schema:s,form:g,renderers:cs,children:R})}),e[16]=g,e[17]=s,e[18]=F):F=e[18];let E;e[19]!==d||e[20]!==g.formState.isValid||e[21]!==o||e[22]!==i||e[23]!==p||e[24]!==S?(E=(0,n.jsx)(as,{onBack:p,isValid:g.formState.isValid,libraries:o,preferredLibrary:S,onLibraryChange:$,displayNames:d,libraryLabel:i}),e[19]=d,e[20]=g.formState.isValid,e[21]=o,e[22]=i,e[23]=p,e[24]=S,e[25]=E):E=e[25];let W;return e[26]!==j||e[27]!==F||e[28]!==E?(W=(0,n.jsxs)("form",{onSubmit:j,className:"space-y-4",children:[F,E]}),e[26]=j,e[27]=F,e[28]=E,e[29]=W):W=e[29],W};function I(){return u().optional().describe(c.of({label:"Password",inputType:"password",placeholder:"password",optionRegex:".*password.*"}))}function Z(t,e){let s=u();return s=e?s.nonempty():s.optional(),s=s.describe(c.of({label:t||"Token",inputType:"password",placeholder:"token",optionRegex:".*token.*"})),s}function Q(){return u().optional().describe(c.of({label:"Warehouse Name",placeholder:"warehouse",optionRegex:".*warehouse.*"}))}function oe(t,e){let s=u();return s=e?s.nonempty():s.optional(),s.describe(c.of({label:t||"URI",optionRegex:".*uri.*"}))}function L(t){return u().nonempty().describe(c.of({label:t||"Host",placeholder:"localhost",optionRegex:".*host.*"}))}function A(){return u().describe(c.of({label:"Database",placeholder:"db name",optionRegex:".*database.*"}))}function ls(){return u().describe(c.of({label:"Schema",placeholder:"schema name",optionRegex:".*schema.*"}))}function T(){return u().nonempty().describe(c.of({label:"Username",placeholder:"username",optionRegex:".*username.*"}))}function P(t){let e=Ye().describe(c.of({label:"Port",inputType:"number",placeholder:t==null?void 0:t.toString()})).transform(Number).refine(s=>s>=0&&s<=65535,{message:"Port must be between 0 and 65535"});return t===void 0?e:e.default(t)}function ue(){return D().default(!1).describe(c.of({label:"Read Only"}))}const be=_({type:w("postgres"),host:L(),port:P(5432).optional(),database:A(),username:T(),password:I(),ssl:D().default(!1).describe(c.of({label:"Use SSL"}))}).describe(c.of({direction:"two-columns"})),fe=_({type:w("mysql"),host:L(),port:P(3306),database:A(),username:T(),password:I(),ssl:D().default(!1).describe(c.of({label:"Use SSL"}))}).describe(c.of({direction:"two-columns"})),ge=_({type:w("sqlite"),database:A().describe(c.of({label:"Database Path"}))}).describe(c.of({direction:"two-columns"})),ye=_({type:w("duckdb"),database:A().describe(c.of({label:"Database Path"})),read_only:ue()}).describe(c.of({direction:"two-columns"})),_e=_({type:w("motherduck"),database:A().default("my_db").describe(c.of({label:"Database Name"})),token:Z()}).describe(c.of({direction:"two-columns"})),we=_({type:w("snowflake"),account:u().nonempty().describe(c.of({label:"Account",optionRegex:".*snowflake.*"})),warehouse:u().optional().describe(c.of({label:"Warehouse",optionRegex:".*snowflake.*"})),database:A(),schema:u().optional().describe(c.of({label:"Schema",optionRegex:".*snowflake.*"})),role:u().optional().describe(c.of({label:"Role"})),authType:M("type",[_({type:w("Password"),username:T(),password:I(),enable_mfa:D().default(!1).describe(c.of({label:"Enable MFA (Duo Push)"}))}),_({type:w("SSO (Browser)"),username:T()}),_({type:w("Key Pair"),username:T(),private_key_path:u().nonempty().describe(c.of({label:"Private Key Path",placeholder:"/path/to/rsa_key.p8"})),private_key_passphrase:u().optional().describe(c.of({label:"Private Key Passphrase",inputType:"password",optionRegex:".*passphrase.*"}))}),_({type:w("OAuth / PAT"),token:Z("Token",!0)})]).default({type:"Password",username:"username",enable_mfa:!1}).describe(c.of({special:"tabs"}))}).describe(c.of({direction:"two-columns"})),Se=_({type:w("bigquery"),project:u().nonempty().describe(c.of({label:"Project ID",optionRegex:".*bigquery.*"})),dataset:u().nonempty().describe(c.of({label:"Dataset",optionRegex:".*bigquery.*"})),credentials_json:u().describe(c.of({label:"Credentials JSON",inputType:"textarea"}))}).describe(c.of({direction:"two-columns"})),xe=_({type:w("clickhouse_connect"),host:L(),port:P(8123).optional(),username:T(),password:I(),secure:D().default(!1).describe(c.of({label:"Use HTTPs"})),proxy_path:u().optional().describe(c.of({label:"Proxy Path",placeholder:"/clickhouse"}))}).describe(c.of({direction:"two-columns"})),ke=_({type:w("timeplus"),host:L().default("localhost"),port:P(8123).optional(),username:T().default("default"),password:I().default("")}).describe(c.of({direction:"two-columns"})),ve=_({type:w("chdb"),database:A().describe(c.of({label:"Database Path"})),read_only:ue()}).describe(c.of({direction:"two-columns"})),$e=_({type:w("trino"),host:L(),port:P(8080),database:A(),schema:ls().optional(),username:T(),password:I(),async_support:D().default(!1).describe(c.of({label:"Async Support"}))}).describe(c.of({direction:"two-columns"})),je=_({type:w("iceberg"),name:u().describe(c.of({label:"Catalog Name"})),catalog:M("type",[_({type:w("REST"),warehouse:Q(),uri:u().optional().describe(c.of({label:"URI",placeholder:"https://",optionRegex:".*uri.*"})),token:Z()}),_({type:w("SQL"),warehouse:Q(),uri:u().optional().describe(c.of({label:"URI",placeholder:"jdbc:iceberg://host:port/database",optionRegex:".*uri.*"}))}),_({type:w("Hive"),warehouse:Q(),uri:oe()}),_({type:w("Glue"),warehouse:Q(),uri:oe()}),_({type:w("DynamoDB"),"dynamodb.profile-name":u().optional().describe(c.of({label:"Profile Name"})),"dynamodb.region":u().optional().describe(c.of({label:"Region"})),"dynamodb.access-key-id":u().optional().describe(c.of({label:"Access Key ID"})),"dynamodb.secret-access-key":u().optional().describe(c.of({label:"Secret Access Key",inputType:"password"})),"dynamodb.session-token":u().optional().describe(c.of({label:"Session Token",inputType:"password"}))})]).default({type:"REST",token:void 0}).describe(c.of({special:"tabs"}))}),Ce=_({type:w("datafusion"),sessionContext:D().optional().describe(c.of({label:"Use Session Context"}))}),Ae=_({type:w("pyspark"),host:L().optional(),port:P().optional()}),Te=_({type:w("redshift"),host:L(),port:P(5439),connectionType:M("type",[_({type:w("IAM credentials"),region:u().describe(c.of({label:"Region"})),aws_access_key_id:u().nonempty().describe(c.of({label:"AWS Access Key ID",inputType:"password",optionRegex:".*aws_access_key_id.*"})),aws_secret_access_key:u().nonempty().describe(c.of({label:"AWS Secret Access Key",inputType:"password",optionRegex:".*aws_secret_access_key.*"})),aws_session_token:u().optional().describe(c.of({label:"AWS Session Token",inputType:"password",optionRegex:".*aws_session_token.*"}))}),_({type:w("DB credentials"),user:T(),password:I()})]).default({type:"IAM credentials",aws_access_key_id:"",aws_secret_access_key:"",region:""}),database:A()}).describe(c.of({direction:"two-columns"})),Re=_({type:w("databricks"),access_token:Z("Access Token",!0),server_hostname:L("Server Hostname"),http_path:oe("HTTP Path",!0),catalog:u().optional().describe(c.of({label:"Catalog"})),schema:u().optional().describe(c.of({label:"Schema"}))}).describe(c.of({direction:"two-columns"})),Le=_({type:w("supabase"),host:L(),port:P(5432).optional(),database:A(),username:T(),password:I(),disable_client_pooling:D().default(!1).describe(c.of({label:"Disable Client-Side Pooling"}))}).describe(c.of({direction:"two-columns"})),ds=M("type",[be,fe,ge,ye,_e,we,Se,xe,ke,ve,$e,je,Ce,Ae,Te,Re,Le]),De={sqlmodel:"SQLModel",sqlalchemy:"SQLAlchemy",duckdb:"DuckDB",clickhouse_connect:"ClickHouse Connect",chdb:"chDB",pyiceberg:"PyIceberg",ibis:"Ibis",motherduck:"MotherDuck",redshift:"Redshift",databricks:"Databricks"};var k=class{constructor(t,e,s){this.connection=t,this.orm=e,this.secrets=s}get imports(){let t=new Set(this.generateImports());switch(this.orm){case"sqlalchemy":t.add("import sqlalchemy");break;case"sqlmodel":t.add("import sqlmodel");break;case"duckdb":t.add("import duckdb");break;case"ibis":t.add("import ibis");break}return t}},ps=t=>`_${t}`,hs=class{constructor(){z(this,"secrets",{})}get imports(){return Object.keys(this.secrets).length===0?new Set:new Set(["import os"])}print(t,e,s){if(t=ps(t),K(e)){let o=pe(e),r=s?`os.environ.get("${o}", "${s}")`:`os.environ.get("${o}")`;return this.secrets[t]=r,t}if(s!=null){let o=`os.environ.get("${e}", "${s}")`;return this.secrets[t]=o,t}return typeof e=="number"||typeof e=="number"?`${e}`:typeof e=="boolean"?O(e):e?`"${e}"`:""}printInFString(t,e,s){if(e===void 0)return"";if(typeof e=="number")return`${e}`;if(typeof e=="boolean")return O(e);let o=this.print(t,e,s);return o.startsWith('"')&&o.endsWith('"')?o.slice(1,-1):`{${o}}`}printPassword(t,e,s,o){let r=s?this.printInFString.bind(this):this.print.bind(this);return K(t)?r(o||"password",t):r(o||"password",e,t)}getSecrets(){return this.secrets}formatSecrets(){return Object.keys(this.secrets).length===0?"":Object.entries(this.secrets).map(([t,e])=>`${t} = ${e}`).join(`
|
|
1
|
+
var Ge=Object.defineProperty;var Ve=(t,e,s)=>e in t?Ge(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var z=(t,e,s)=>Ve(t,typeof e!="symbol"?e+"":e,s);import{s as ne}from"./chunk-LvLJmgfZ.js";import{u as Ze}from"./useEvent-D91BmmQi.js";import{t as Qe}from"./react-Bj1aDYRI.js";import{D as Je,Qn as y,jt as ce}from"./cells-DiASVTIh.js";import{D as M,P as _,R as u,T as D,_ as ae,i as Ye,k as w,m as Xe}from"./zod-H_cgTO0M.js";import{t as B}from"./compiler-runtime-B3qBwwSJ.js";import{v as et}from"./useEventListener-BakX-tnw.js";import{c as tt}from"./utils-Dev6I_Kv.js";import{t as G}from"./cn-X2M2usMq.js";import{t as st}from"./jsx-runtime-PbYoItBR.js";import{a as rt,c as ie,o as le,s as ot}from"./popover-DMNO6Poc.js";import{c as nt,i as ct,n as at,r as it,s as lt,t as dt}from"./select-Cjly7tmx.js";import{a as J,c as de,o as pt,p as ht,r as mt,t as ut}from"./dropdown-menu-DfGLyCbP.js";import{t as Y}from"./button-BF7GSjhW.js";import{l as bt}from"./arrays-DWxvyYxP.js";import{r as U}from"./strings-DvZlHYnD.js";import{t as ft}from"./createLucideIcon-BTp1tQDO.js";import{t as gt}from"./circle-plus-BIy1BGHw.js";import{t as yt}from"./database-zap-DIlSqcdp.js";import{t as _t}from"./github-CyzgLJDA.js";import{c,o as wt,t as St,u as xt}from"./form-CO925gWV.js";import{n as kt}from"./DeferredRequestRegistry-RuL7NV1n.js";import{o as vt,r as $t}from"./input-DB2LiTiQ.js";import{a as jt,c as Ct,d as At,g as Tt,l as Rt,o as Lt,p as Dt,s as It,u as Pt}from"./textarea-BBpaAGpK.js";import{r as qt}from"./useTheme-D_ZbTTJw.js";import{a as Nt,c as Ft,l as Et,n as Bt,r as Ot,t as Mt}from"./dialog-DkJmIrsG.js";import{n as Ut}from"./ImperativeModal-B62Q6S9l.js";import{t as V}from"./links-CCkJpphF.js";import{t as Kt}from"./useIframeCapabilities-B0dNZiKK.js";import{r as Ht}from"./html-to-image-BWhkUSek.js";import{o as Wt}from"./focus-BvvRVcVF.js";import{n as zt}from"./useAsyncData-DAQcLiyE.js";import{n as Gt,t as Vt}from"./azure-DBVzcmvx.js";import{t as Zt}from"./request-registry-K6vbazWs.js";import{n as Qt,t as Jt}from"./write-secret-modal-K2n79wHj.js";var X=ft("hard-drive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]),ee="env:";function Or(t){return t}function K(t){return typeof t=="string"?t.startsWith(ee):!1}function te(t){return`${ee}${t}`}function pe(t){return t.replace(ee,"")}var Yt=B(),N=ne(Qe(),1),n=ne(st(),1),he=(0,N.createContext)({providerNames:[],secretKeys:[],loading:!1,error:void 0,refreshSecrets:et.NOOP});const Xt=()=>(0,N.use)(he),es=t=>{let e=(0,Yt.c)(14),{children:s}=t,o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=[],e[0]=o):o=e[0];let{data:r,isPending:d,error:i,refetch:a}=zt(ns,o),l;e[1]===(r==null?void 0:r.secretKeys)?l=e[2]:(l=(r==null?void 0:r.secretKeys)||[],e[1]=r==null?void 0:r.secretKeys,e[2]=l);let p;e[3]===(r==null?void 0:r.providerNames)?p=e[4]:(p=(r==null?void 0:r.providerNames)||[],e[3]=r==null?void 0:r.providerNames,e[4]=p);let h;e[5]!==i||e[6]!==d||e[7]!==a||e[8]!==l||e[9]!==p?(h={secretKeys:l,providerNames:p,loading:d,error:i,refreshSecrets:a},e[5]=i,e[6]=d,e[7]=a,e[8]=l,e[9]=p,e[10]=h):h=e[10];let f;return e[11]!==s||e[12]!==h?(f=(0,n.jsx)(he,{value:h,children:s}),e[11]=s,e[12]=h,e[13]=f):f=e[13],f},ts={isMatch:t=>{if(t instanceof ae||t instanceof Xe){let{optionRegex:e}=c.parse(t.description||"");return!!e}return!1},Component:({schema:t,form:e,path:s})=>{let{secretKeys:o,providerNames:r,refreshSecrets:d}=Xt(),{openModal:i,closeModal:a}=Ut(),{label:l,description:p,optionRegex:h=""}=c.parse(t.description||""),[f,b]=bt(o,m=>new RegExp(h,"i").test(m));return(0,n.jsx)(Ct,{control:e.control,name:s,render:({field:m})=>(0,n.jsxs)(Rt,{children:[(0,n.jsx)(Pt,{children:l}),(0,n.jsx)(Lt,{children:p}),(0,n.jsx)(jt,{children:(0,n.jsxs)("div",{className:"flex gap-2",children:[t instanceof ae?(0,n.jsx)($t,{...m,value:m.value,onChange:m.onChange,className:G("flex-1")}):(0,n.jsx)(vt,{...m,value:m.value,onChange:m.onChange,className:"flex-1"}),(0,n.jsxs)(ut,{children:[(0,n.jsx)(ht,{asChild:!0,children:(0,n.jsx)(Y,{variant:"outline",size:"icon",className:G(K(m.value)&&"bg-accent"),children:(0,n.jsx)(kt,{className:"h-3 w-3"})})}),(0,n.jsxs)(mt,{align:"end",className:"max-h-60 overflow-y-auto",children:[(0,n.jsxs)(J,{onSelect:()=>{i((0,n.jsx)(Jt,{providerNames:r,onSuccess:g=>{d(),m.onChange(te(g)),a()},onClose:a}))},children:[(0,n.jsx)(gt,{className:"mr-2 h-3.5 w-3.5"}),"Create a new secret"]}),f.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(de,{}),(0,n.jsx)(pt,{children:"Recommended"})]}),f.map(g=>(0,n.jsx)(J,{onSelect:()=>m.onChange(te(g)),children:g},g)),b.length>0&&(0,n.jsx)(de,{}),b.map(g=>(0,n.jsx)(J,{onSelect:()=>m.onChange(te(g)),children:g},g))]})]})]})}),(0,n.jsx)(At,{})]})})}};function ss(t){return t.provider!=="env"}function rs(t){return t.name}function os(t){return t.keys}async function ns(){let t=await Zt.request({}),e=Qt(t.secrets).filter(ss).map(rs);return{secretKeys:t.secrets.flatMap(os).toSorted(),providerNames:e}}var H=B(),cs=[ts];const se=t=>{let e=(0,H.c)(2),{children:s}=t,o;return e[0]===s?o=e[1]:(o=(0,n.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4",children:s}),e[0]=s,e[1]=o),o},re=t=>{let e=(0,H.c)(9),{name:s,color:o,icon:r,onSelect:d}=t,i;e[0]===o?i=e[1]:(i={backgroundColor:o},e[0]=o,e[1]=i);let a;e[2]===s?a=e[3]:(a=(0,n.jsx)("span",{className:"text-white font-medium text-lg",children:s}),e[2]=s,e[3]=a);let l;return e[4]!==r||e[5]!==d||e[6]!==i||e[7]!==a?(l=(0,n.jsxs)("button",{type:"button",className:"py-3 flex flex-col items-center justify-center gap-1 transition-all hover:scale-105 hover:brightness-110 rounded shadow-sm-solid hover:shadow-md-solid",style:i,onClick:d,children:[r,a]}),e[4]=r,e[5]=d,e[6]=i,e[7]=a,e[8]=l):l=e[8],l},as=t=>{let e=(0,H.c)(25),{onBack:s,isValid:o,libraries:r,preferredLibrary:d,onLibraryChange:i,displayNames:a,libraryLabel:l}=t,p=l===void 0?"Preferred library":l,h;e[0]===s?h=e[1]:(h=(0,n.jsx)(Y,{type:"button",variant:"outline",onClick:s,children:"Back"}),e[0]=s,e[1]=h);let f=!o,b;e[2]===f?b=e[3]:(b=(0,n.jsx)(Y,{type:"submit",disabled:f,children:"Add"}),e[2]=f,e[3]=b);let m;e[4]!==h||e[5]!==b?(m=(0,n.jsxs)("div",{className:"flex gap-2",children:[h,b]}),e[4]=h,e[5]=b,e[6]=m):m=e[6];let g;e[7]===Symbol.for("react.memo_cache_sentinel")?(g=(0,n.jsx)(lt,{children:(0,n.jsx)(nt,{placeholder:"Select a library"})}),e[7]=g):g=e[7];let S;e[8]===p?S=e[9]:(S=(0,n.jsxs)("div",{className:"flex flex-col gap-1 items-end",children:[g,(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:p})]}),e[8]=p,e[9]=S);let $;if(e[10]!==a||e[11]!==r){let j;e[13]===a?j=e[14]:(j=R=>(0,n.jsx)(ct,{value:R,children:a[R]??R},R),e[13]=a,e[14]=j),$=r.map(j),e[10]=a,e[11]=r,e[12]=$}else $=e[12];let x;e[15]===$?x=e[16]:(x=(0,n.jsx)(at,{children:(0,n.jsx)(it,{children:$})}),e[15]=$,e[16]=x);let v;e[17]!==i||e[18]!==d||e[19]!==S||e[20]!==x?(v=(0,n.jsx)("div",{children:(0,n.jsxs)(dt,{value:d,onValueChange:i,children:[S,x]})}),e[17]=i,e[18]=d,e[19]=S,e[20]=x,e[21]=v):v=e[21];let C;return e[22]!==v||e[23]!==m?(C=(0,n.jsxs)("div",{className:"flex gap-2 justify-between",children:[m,v]}),e[22]=v,e[23]=m,e[24]=C):C=e[24],C};function is(){let t=(0,H.c)(4),{createNewCell:e}=Je(),s=Wt(),o=Ze(tt),r;return t[0]!==o||t[1]!==e||t[2]!==s?(r=d=>{/\bmo\./.test(d)&&Ht({autoInstantiate:o,createNewCell:e,fromCellId:s}),e({code:d,before:!1,cellId:s??"__end__",skipIfCodeExists:!0})},t[0]=o,t[1]=e,t[2]=s,t[3]=r):r=t[3],r}const me=t=>{let e=(0,H.c)(30),{schema:s,libraries:o,preferredLibrary:r,displayNames:d,libraryLabel:i,generateCode:a,onSubmit:l,onBack:p}=t,h;e[0]===s?h=e[1]:(h=wt(s),e[0]=s,e[1]=h);let f=h,b;e[2]===s?b=e[3]:(b=Dt(s),e[2]=s,e[3]=b);let m;e[4]!==f||e[5]!==b?(m={defaultValues:f,resolver:b,reValidateMode:"onChange"},e[4]=f,e[5]=b,e[6]=m):m=e[6];let g=Tt(m),[S,$]=N.useState(r),x=is(),v;e[7]!==a||e[8]!==x||e[9]!==l||e[10]!==S?(v=ze=>{x(a(ze,S)),l()},e[7]=a,e[8]=x,e[9]=l,e[10]=S,e[11]=v):v=e[11];let C=v,j;e[12]!==g||e[13]!==C?(j=g.handleSubmit(C),e[12]=g,e[13]=C,e[14]=j):j=e[14];let R;e[15]===Symbol.for("react.memo_cache_sentinel")?(R=(0,n.jsx)(It,{}),e[15]=R):R=e[15];let F;e[16]!==g||e[17]!==s?(F=(0,n.jsx)(es,{children:(0,n.jsx)(St,{schema:s,form:g,renderers:cs,children:R})}),e[16]=g,e[17]=s,e[18]=F):F=e[18];let E;e[19]!==d||e[20]!==g.formState.isValid||e[21]!==o||e[22]!==i||e[23]!==p||e[24]!==S?(E=(0,n.jsx)(as,{onBack:p,isValid:g.formState.isValid,libraries:o,preferredLibrary:S,onLibraryChange:$,displayNames:d,libraryLabel:i}),e[19]=d,e[20]=g.formState.isValid,e[21]=o,e[22]=i,e[23]=p,e[24]=S,e[25]=E):E=e[25];let W;return e[26]!==j||e[27]!==F||e[28]!==E?(W=(0,n.jsxs)("form",{onSubmit:j,className:"space-y-4",children:[F,E]}),e[26]=j,e[27]=F,e[28]=E,e[29]=W):W=e[29],W};function I(){return u().optional().describe(c.of({label:"Password",inputType:"password",placeholder:"password",optionRegex:".*password.*"}))}function Z(t,e){let s=u();return s=e?s.nonempty():s.optional(),s=s.describe(c.of({label:t||"Token",inputType:"password",placeholder:"token",optionRegex:".*token.*"})),s}function Q(){return u().optional().describe(c.of({label:"Warehouse Name",placeholder:"warehouse",optionRegex:".*warehouse.*"}))}function oe(t,e){let s=u();return s=e?s.nonempty():s.optional(),s.describe(c.of({label:t||"URI",optionRegex:".*uri.*"}))}function L(t){return u().nonempty().describe(c.of({label:t||"Host",placeholder:"localhost",optionRegex:".*host.*"}))}function A(){return u().describe(c.of({label:"Database",placeholder:"db name",optionRegex:".*database.*"}))}function ls(){return u().describe(c.of({label:"Schema",placeholder:"schema name",optionRegex:".*schema.*"}))}function T(){return u().nonempty().describe(c.of({label:"Username",placeholder:"username",optionRegex:".*username.*"}))}function P(t){let e=Ye().describe(c.of({label:"Port",inputType:"number",placeholder:t==null?void 0:t.toString()})).transform(Number).refine(s=>s>=0&&s<=65535,{message:"Port must be between 0 and 65535"});return t===void 0?e:e.default(t)}function ue(){return D().default(!1).describe(c.of({label:"Read Only"}))}const be=_({type:w("postgres"),host:L(),port:P(5432).optional(),database:A(),username:T(),password:I(),ssl:D().default(!1).describe(c.of({label:"Use SSL"}))}).describe(c.of({direction:"two-columns"})),fe=_({type:w("mysql"),host:L(),port:P(3306),database:A(),username:T(),password:I(),ssl:D().default(!1).describe(c.of({label:"Use SSL"}))}).describe(c.of({direction:"two-columns"})),ge=_({type:w("sqlite"),database:A().describe(c.of({label:"Database Path"}))}).describe(c.of({direction:"two-columns"})),ye=_({type:w("duckdb"),database:A().describe(c.of({label:"Database Path"})),read_only:ue()}).describe(c.of({direction:"two-columns"})),_e=_({type:w("motherduck"),database:A().default("my_db").describe(c.of({label:"Database Name"})),token:Z()}).describe(c.of({direction:"two-columns"})),we=_({type:w("snowflake"),account:u().nonempty().describe(c.of({label:"Account",optionRegex:".*snowflake.*"})),warehouse:u().optional().describe(c.of({label:"Warehouse",optionRegex:".*snowflake.*"})),database:A(),schema:u().optional().describe(c.of({label:"Schema",optionRegex:".*snowflake.*"})),role:u().optional().describe(c.of({label:"Role"})),authType:M("type",[_({type:w("Password"),username:T(),password:I(),enable_mfa:D().default(!1).describe(c.of({label:"Enable MFA (Duo Push)"}))}),_({type:w("SSO (Browser)"),username:T()}),_({type:w("Key Pair"),username:T(),private_key_path:u().nonempty().describe(c.of({label:"Private Key Path",placeholder:"/path/to/rsa_key.p8"})),private_key_passphrase:u().optional().describe(c.of({label:"Private Key Passphrase",inputType:"password",optionRegex:".*passphrase.*"}))}),_({type:w("OAuth / PAT"),token:Z("Token",!0)})]).default({type:"Password",username:"username",enable_mfa:!1}).describe(c.of({special:"tabs"}))}).describe(c.of({direction:"two-columns"})),Se=_({type:w("bigquery"),project:u().nonempty().describe(c.of({label:"Project ID",optionRegex:".*bigquery.*"})),dataset:u().nonempty().describe(c.of({label:"Dataset",optionRegex:".*bigquery.*"})),credentials_json:u().describe(c.of({label:"Credentials JSON",inputType:"textarea"}))}).describe(c.of({direction:"two-columns"})),xe=_({type:w("clickhouse_connect"),host:L(),port:P(8123).optional(),username:T(),password:I(),secure:D().default(!1).describe(c.of({label:"Use HTTPs"})),proxy_path:u().optional().describe(c.of({label:"Proxy Path",placeholder:"/clickhouse"}))}).describe(c.of({direction:"two-columns"})),ke=_({type:w("timeplus"),host:L().default("localhost"),port:P(8123).optional(),username:T().default("default"),password:I().default("")}).describe(c.of({direction:"two-columns"})),ve=_({type:w("chdb"),database:A().describe(c.of({label:"Database Path"})),read_only:ue()}).describe(c.of({direction:"two-columns"})),$e=_({type:w("trino"),host:L(),port:P(8080),database:A(),schema:ls().optional(),username:T(),password:I(),async_support:D().default(!1).describe(c.of({label:"Async Support"}))}).describe(c.of({direction:"two-columns"})),je=_({type:w("iceberg"),name:u().describe(c.of({label:"Catalog Name"})),catalog:M("type",[_({type:w("REST"),warehouse:Q(),uri:u().optional().describe(c.of({label:"URI",placeholder:"https://",optionRegex:".*uri.*"})),token:Z()}),_({type:w("SQL"),warehouse:Q(),uri:u().optional().describe(c.of({label:"URI",placeholder:"jdbc:iceberg://host:port/database",optionRegex:".*uri.*"}))}),_({type:w("Hive"),warehouse:Q(),uri:oe()}),_({type:w("Glue"),warehouse:Q(),uri:oe()}),_({type:w("DynamoDB"),"dynamodb.profile-name":u().optional().describe(c.of({label:"Profile Name"})),"dynamodb.region":u().optional().describe(c.of({label:"Region"})),"dynamodb.access-key-id":u().optional().describe(c.of({label:"Access Key ID"})),"dynamodb.secret-access-key":u().optional().describe(c.of({label:"Secret Access Key",inputType:"password"})),"dynamodb.session-token":u().optional().describe(c.of({label:"Session Token",inputType:"password"}))})]).default({type:"REST",token:void 0}).describe(c.of({special:"tabs"}))}),Ce=_({type:w("datafusion"),sessionContext:D().optional().describe(c.of({label:"Use Session Context"}))}),Ae=_({type:w("pyspark"),host:L().optional(),port:P().optional()}),Te=_({type:w("redshift"),host:L(),port:P(5439),connectionType:M("type",[_({type:w("IAM credentials"),region:u().describe(c.of({label:"Region"})),aws_access_key_id:u().nonempty().describe(c.of({label:"AWS Access Key ID",inputType:"password",optionRegex:".*aws_access_key_id.*"})),aws_secret_access_key:u().nonempty().describe(c.of({label:"AWS Secret Access Key",inputType:"password",optionRegex:".*aws_secret_access_key.*"})),aws_session_token:u().optional().describe(c.of({label:"AWS Session Token",inputType:"password",optionRegex:".*aws_session_token.*"}))}),_({type:w("DB credentials"),user:T(),password:I()})]).default({type:"IAM credentials",aws_access_key_id:"",aws_secret_access_key:"",region:""}),database:A()}).describe(c.of({direction:"two-columns"})),Re=_({type:w("databricks"),access_token:Z("Access Token",!0),server_hostname:L("Server Hostname"),http_path:oe("HTTP Path",!0),catalog:u().optional().describe(c.of({label:"Catalog"})),schema:u().optional().describe(c.of({label:"Schema"}))}).describe(c.of({direction:"two-columns"})),Le=_({type:w("supabase"),host:L(),port:P(5432).optional(),database:A(),username:T(),password:I(),disable_client_pooling:D().default(!1).describe(c.of({label:"Disable Client-Side Pooling"}))}).describe(c.of({direction:"two-columns"})),ds=M("type",[be,fe,ge,ye,_e,we,Se,xe,ke,ve,$e,je,Ce,Ae,Te,Re,Le]),De={sqlmodel:"SQLModel",sqlalchemy:"SQLAlchemy",duckdb:"DuckDB",clickhouse_connect:"ClickHouse Connect",chdb:"chDB",pyiceberg:"PyIceberg",ibis:"Ibis",motherduck:"MotherDuck",redshift:"Redshift",databricks:"Databricks"};var k=class{constructor(t,e,s){this.connection=t,this.orm=e,this.secrets=s}get imports(){let t=new Set(this.generateImports());switch(this.orm){case"sqlalchemy":t.add("import sqlalchemy");break;case"sqlmodel":t.add("import sqlmodel");break;case"duckdb":t.add("import duckdb");break;case"ibis":t.add("import ibis");break}return t}},ps=t=>`_${t}`,hs=class{constructor(){z(this,"secrets",{})}get imports(){return Object.keys(this.secrets).length===0?new Set:new Set(["import os"])}print(t,e,s){if(t=ps(t),K(e)){let o=pe(e),r=s?`os.environ.get("${o}", "${s}")`:`os.environ.get("${o}")`;return this.secrets[t]=r,t}if(s!=null){let o=`os.environ.get("${e}", "${s}")`;return this.secrets[t]=o,t}return typeof e=="number"||typeof e=="number"?`${e}`:typeof e=="boolean"?O(e):e?`"${e}"`:""}printInFString(t,e,s){if(e===void 0)return"";if(typeof e=="number")return`${e}`;if(typeof e=="boolean")return O(e);let o=this.print(t,e,s);return o.startsWith('"')&&o.endsWith('"')?o.slice(1,-1):`{${o}}`}printPassword(t,e,s,o){let r=s?this.printInFString.bind(this):this.print.bind(this);return K(t)?r(o||"password",t):r(o||"password",e,t)}getSecrets(){return this.secrets}formatSecrets(){return Object.keys(this.secrets).length===0?"":Object.entries(this.secrets).map(([t,e])=>`${t} = ${e}`).join(`
|
|
2
2
|
`)}},ms=class extends k{generateImports(){return[]}generateConnectionCode(){let t=this.connection.ssl?", connect_args={'sslmode': 'require'}":"",e=this.secrets.printPassword(this.connection.password,"POSTGRES_PASSWORD",!0);return y(`
|
|
3
3
|
DATABASE_URL = f"postgresql://${this.secrets.printInFString("username",this.connection.username)}:${e}@${this.secrets.printInFString("host",this.connection.host)}:${this.secrets.printInFString("port",this.connection.port)}/${this.secrets.printInFString("database",this.connection.database)}"
|
|
4
4
|
engine = ${this.orm}.create_engine(DATABASE_URL${t})
|