@marimo-team/frontend 0.23.16-dev76 → 0.23.16-dev9
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-BalYv0pK.js → CellStatus-BwCqFeIT.js} +1 -1
- package/dist/assets/{ConnectedDataExplorerComponent-DI7mV-Gw.js → ConnectedDataExplorerComponent-CMaZapRd.js} +1 -1
- package/dist/assets/{ErrorBoundary-C7_5jjWi.js → ErrorBoundary-DzTD8LVq.js} +1 -1
- package/dist/assets/{ImperativeModal-BIavOiUv.js → ImperativeModal-fY-ZfT0b.js} +1 -1
- package/dist/assets/JsonOutput-B0aYK7up.js +53 -0
- package/dist/assets/{LazyAnyLanguageCodeMirror-sVm_hz8A.js → LazyAnyLanguageCodeMirror-B2JvSXP-.js} +2 -2
- package/dist/assets/{MarimoErrorOutput-DO2k2fA5.js → MarimoErrorOutput-2CXbNUBb.js} +1 -1
- package/dist/assets/{RSPContexts-CgC81f0I.js → RSPContexts-WiCgGm__.js} +1 -1
- package/dist/assets/{RenderHTML-BCvU9dYz.js → RenderHTML-uBc4LkCP.js} +1 -1
- package/dist/assets/{RunButton-BKRupqr7.js → RunButton-DLoWn_Jd.js} +1 -1
- package/dist/assets/{add-cell-with-ai-CEZtaZCK.js → add-cell-with-ai-C1L7x0xr.js} +1 -1
- package/dist/assets/{add-connection-dialog-CEp3SJR2.js → add-connection-dialog-BgQ7HuWu.js} +1 -1
- package/dist/assets/{agent-panel-By4A-Cqr.js → agent-panel-D3_CUvz_.js} +1 -1
- package/dist/assets/ai-model-dropdown-C7iiWBqP.js +5 -0
- package/dist/assets/{alert-dialog-BXegNC0I.js → alert-dialog-Bb8Lz8ko.js} +1 -1
- package/dist/assets/{any-language-editor-DCpZRrpx.js → any-language-editor--tRHs8C_.js} +1 -1
- package/dist/assets/{app-config-button-NrM9ywXA.js → app-config-button-DhmeKMjL.js} +1 -1
- package/dist/assets/{button-eIihcbUw.js → button-DDGiD1NW.js} +1 -1
- package/dist/assets/{cache-panel-wllSTlbM.js → cache-panel-DcQUeUpg.js} +1 -1
- package/dist/assets/{capabilities-B09j1Eor.js → capabilities-DoEg0XwL.js} +1 -1
- package/dist/assets/{cell-editor-DdofA9oQ.js → cell-editor-DD0zaU_N.js} +10 -10
- package/dist/assets/{cell-link-DqBkyAFe.js → cell-link-C0hhYyNu.js} +1 -1
- package/dist/assets/{cells-Cf7bHHq3.js → cells-aqfX084m.js} +6 -6
- package/dist/assets/{chat-display-BG08ltQ3.js → chat-display-DomMe89U.js} +1 -1
- package/dist/assets/{chat-panel-P2CzCtXJ.js → chat-panel-DzLbxcWT.js} +1 -1
- package/dist/assets/{chat-ui-fAJZAoTD.js → chat-ui-BpWZ6JeY.js} +1 -1
- package/dist/assets/{column-preview-BgZLUEOj.js → column-preview-D5Btj8aG.js} +1 -1
- package/dist/assets/{command-CAJLPEBq.js → command-Dqxie4gq.js} +1 -1
- package/dist/assets/{command-palette-DrI24FoL.js → command-palette-CNp7T2c5.js} +1 -1
- package/dist/assets/{common-CD6Mj8n6.js → common-BrPgvCtD.js} +1 -1
- package/dist/assets/{components-BH6gDVv6.js → components-1i9OlkxM.js} +1 -1
- package/dist/assets/{config-COUOIPEq.js → config-BJVx3eBW.js} +1 -1
- package/dist/assets/{config-BbOTTCYY.js → config-CR3KxW53.js} +1 -1
- package/dist/assets/{copy-BtTOqPTS.js → copy-Bxb1_Gtw.js} +1 -1
- package/dist/assets/{copy-icon-C2pG0ZNK.js → copy-icon-neDQUo4Q.js} +1 -1
- package/dist/assets/{createReducer-C7kZ8zEe.js → createReducer-DGx5Af-C.js} +1 -1
- package/dist/assets/{datasource-ySAiC9gr.js → datasource-wn1PTlXA.js} +1 -1
- package/dist/assets/{dates-D-kIKDYA.js → dates-C2LWzsCZ.js} +1 -1
- package/dist/assets/{dependency-graph-panel-BF23EwcD.js → dependency-graph-panel-B8Q8RQNh.js} +1 -1
- package/dist/assets/{dialog-D1DEsRZ2.js → dialog-BCVepWLJ.js} +1 -1
- package/dist/assets/{dist-ByVeMWkr.js → dist-BLN8PNJV.js} +1 -1
- package/dist/assets/dist-CiVShZKM.js +2 -0
- package/dist/assets/{documentation-panel-e9Fi9R7e.js → documentation-panel-hFyikugH.js} +1 -1
- package/dist/assets/{download-BomYt3nl.js → download-CkMUlfM3.js} +1 -1
- package/dist/assets/{dropdown-menu-BFZLnWeO.js → dropdown-menu-dHmZR8bI.js} +1 -1
- package/dist/assets/{edit-page-C37w54dQ.js → edit-page-jUsez4HZ.js} +5 -5
- package/dist/assets/{error-banner-B6eIlxzg.js → error-banner-BSxEOIn2.js} +1 -1
- package/dist/assets/{error-entries-Birw-8VX.js → error-entries-NXVkubuN.js} +1 -1
- package/dist/assets/{error-panel-DdsUL6b7.js → error-panel-DAseRhAS.js} +1 -1
- package/dist/assets/{es-1D83cgiu.js → es-gYgfF8y5.js} +1 -1
- package/dist/assets/{esm-BL7jQmzn.js → esm-B30N1GS0.js} +1 -1
- package/dist/assets/{field-BeZbVzXA.js → field-BsxD35VE.js} +1 -1
- package/dist/assets/file-explorer-panel-D7VHUIPp.js +26 -0
- package/dist/assets/{file-icons-Cb54mIL8.js → file-icons-Chripuk-.js} +1 -1
- package/dist/assets/{file-name-input-BWFcK1ey.js → file-name-input-B1NJd3KY.js} +1 -1
- package/dist/assets/{floating-outline-wz-WSRgP.js → floating-outline-BOqWJRw_.js} +1 -1
- package/dist/assets/{focus-DiEyfiAG.js → focus-tOmGbv38.js} +1 -1
- package/dist/assets/{form-CgWNb44_.js → form-CIXAzTfC.js} +1 -1
- package/dist/assets/{formats-ClEFGPy-.js → formats-DzmLpc9A.js} +1 -1
- package/dist/assets/{formatting-B_41gSF5.js → formatting-CDf6w1Kt.js} +1 -1
- package/dist/assets/{fullscreen-dUjPYOmm.js → fullscreen-CTDqNQr6.js} +1 -1
- package/dist/assets/{gallery-page-CWQQAYpa.js → gallery-page-CJ3ms1Hn.js} +1 -1
- package/dist/assets/{glide-data-editor-lMARFWHS.js → glide-data-editor-j2igs9Y_.js} +1 -1
- package/dist/assets/{home-page-DJ4jJsZj.js → home-page-DO_MqQAB.js} +1 -1
- package/dist/assets/{html-to-image-CwmX28T9.js → html-to-image-B-nAUvDC.js} +1 -1
- package/dist/assets/index-wLUfvfaV.js +38 -0
- package/dist/assets/{index-BjlEpvLC.css → index-xs-zSSrX.css} +1 -1
- package/dist/assets/{input-CqrUjynb.js → input-JxFwu-3G.js} +1 -1
- package/dist/assets/{kiosk-mode-ABm3oYgq.js → kiosk-mode-QsYGYiC8.js} +1 -1
- package/dist/assets/{label-BElwWzf0.js → label-CqjrpwRC.js} +1 -1
- package/dist/assets/{layout-BOwE7yok.js → layout-1Z2AhO6k.js} +3 -3
- package/dist/assets/{links-CToBjIIj.js → links-CZr5bjvo.js} +1 -1
- package/dist/assets/{logs-panel-iFV4ZJ9b.js → logs-panel-B6AfYQb6.js} +1 -1
- package/dist/assets/{markdown-renderer-QvXG0CRk.js → markdown-renderer-Cs1sISb9.js} +1 -1
- package/dist/assets/{menu-items-DbSLBfXR.js → menu-items-CCi6aOPm.js} +1 -1
- package/dist/assets/{mermaid-Bh0flEIb.js → mermaid-CYN0wOyG.js} +1 -1
- package/dist/assets/{name-cell-input-C6cukQ9k.js → name-cell-input-2sM8a_OS.js} +1 -1
- package/dist/assets/{numbers-CeeaFKqu.js → numbers-rmawRqQP.js} +1 -1
- package/dist/assets/{outline-panel-BPlg9_CE.js → outline-panel-BXWCkGu_.js} +1 -1
- package/dist/assets/{packages-panel-BzQF60rG.js → packages-panel-CJfHGfax.js} +1 -1
- package/dist/assets/{pair-with-agent-modal-CKOYwOYw.js → pair-with-agent-modal-C9nKHvCp.js} +1 -1
- package/dist/assets/{panels-CW-PUlv2.js → panels-Ch_sUzTx.js} +1 -1
- package/dist/assets/{popover-DrHQ3KEt.js → popover-Bcz1Zikb.js} +1 -1
- package/dist/assets/process-output-BFSCpqNt.js +1 -0
- package/dist/assets/{radio-group-CLBjGkt5.js → radio-group-PT0_zVHo.js} +1 -1
- package/dist/assets/{readonly-code-display-D63oRtBP.js → readonly-code-display-CFbCSGms.js} +1 -1
- package/dist/assets/{readonly-python-code-CW_G5e4E.js → readonly-python-code-DB23yd7T.js} +1 -1
- package/dist/assets/{renderShortcut-BZLr8D7H.js → renderShortcut-Bl8_FVn8.js} +1 -1
- package/dist/assets/{reveal-component-DqMRxmUr.js → reveal-component-fwTDxf5N.js} +57 -57
- package/dist/assets/{run-page-s6Mf8p78.js → run-page-D9-9chbw.js} +1 -1
- package/dist/assets/{runs-D51Xwrsk.js → runs-DBTXqJHS.js} +1 -1
- package/dist/assets/{scratchpad-panel-CXsxdMB-.js → scratchpad-panel-BLC2oQ_3.js} +1 -1
- package/dist/assets/{scroll-to-bottom-button-Cgr10kaJ.js → scroll-to-bottom-button-C8yfT4wq.js} +1 -1
- package/dist/assets/{secrets-panel-Cc5KDBk6.js → secrets-panel-6J6wcuVR.js} +1 -1
- package/dist/assets/{select-B5TFNjmU.js → select-BP75_5jJ.js} +1 -1
- package/dist/assets/{session-CEFnN9Cq.js → session-BmukRjSi.js} +1 -1
- package/dist/assets/{session-panel-CmHetqAb.js → session-panel-Dz-DQDeV.js} +1 -1
- package/dist/assets/{share-CYpcX4N4.js → share-852X_cqy.js} +1 -1
- package/dist/assets/{skeleton-B_4CZVEm.js → skeleton-xuR254Kw.js} +1 -1
- package/dist/assets/{snippets-panel-CXpGflMO.js → snippets-panel-DwAjNUqR.js} +1 -1
- package/dist/assets/{spec-CzqcmYQk.js → spec-C7opZZRp.js} +1 -1
- package/dist/assets/{state-BXbiRXZk.js → state-BpkJVsmT.js} +1 -1
- package/dist/assets/{state-BvdK8eiw.js → state-D10U2MwA.js} +1 -1
- package/dist/assets/{state-WBgc7MiA.js → state-DDag0B_B.js} +1 -1
- package/dist/assets/{state-DBzEQtWz.js → state-Tc7pRohh.js} +1 -1
- package/dist/assets/{strings-Djnbwmfl.js → strings--BknHX9C.js} +1 -1
- package/dist/assets/{swiper-component-DInvCxhI.js → swiper-component-Che9MNs4.js} +1 -1
- package/dist/assets/{switch-CvweaCXq.js → switch-DLGijIXN.js} +1 -1
- package/dist/assets/{terminal-D3IQBBYo.js → terminal-DaLxAnKx.js} +1 -1
- package/dist/assets/{textarea-CpFfEUet.js → textarea-aocYW9hl.js} +1 -1
- package/dist/assets/{tooltip-CFX4fYHU.js → tooltip-4bZlU7jl.js} +1 -1
- package/dist/assets/{tooltip-HLb6RxVp.js → tooltip-B7U4xkIN.js} +1 -1
- package/dist/assets/{tracing-CKn3gWHw.js → tracing-BmBBYynL.js} +1 -1
- package/dist/assets/{tracing-panel-BU-o_LCd.js → tracing-panel-AReiFUol.js} +2 -2
- package/dist/assets/{tree-actions-CsC2XmGo.js → tree-actions-Bz3fJ7p-.js} +1 -1
- package/dist/assets/{useBoolean-D89u30n-.js → useBoolean-CA7K8rap.js} +1 -1
- package/dist/assets/{useCellActionButton-CRfIEVB5.js → useCellActionButton-BG7n5b0H.js} +1 -1
- package/dist/assets/{useDeleteCell-EPH4kcG7.js → useDeleteCell-DQP-NBq2.js} +1 -1
- package/dist/assets/{useDependencyPanelTab-CZnK7N2L.js → useDependencyPanelTab-BrkWlCTP.js} +1 -1
- package/dist/assets/useEventListener-C0195JsF.js +1 -0
- package/dist/assets/{useHotkey-DIuRH8Wu.js → useHotkey-DLZvrRZT.js} +1 -1
- package/dist/assets/{useIframeCapabilities-Ccb4fvKc.js → useIframeCapabilities-j6fR_dBA.js} +1 -1
- package/dist/assets/{useInstallPackage-BRbUAUFn.js → useInstallPackage-WiYBwhUO.js} +1 -1
- package/dist/assets/{useInterval-CC0vKpWm.js → useInterval-CWBTUy5W.js} +1 -1
- package/dist/assets/{useNotebookActions-DJKDd0gM.js → useNotebookActions-COdGI2fR.js} +1 -1
- package/dist/assets/{useRunCells-CSSF_mJ0.js → useRunCells-BtSwerrU.js} +1 -1
- package/dist/assets/{useSplitCell-9Qz93yPZ.js → useSplitCell-jH70A2Sz.js} +1 -1
- package/dist/assets/{useTheme-KXqAyDPC.js → useTheme-Bxv9B31g.js} +1 -1
- package/dist/assets/{utils-Z80SV4_d.js → utils-BWBBpCkT.js} +1 -1
- package/dist/assets/{vega-component-Cie3ag_T.js → vega-component-DSvWLXIy.js} +1 -1
- package/dist/assets/{write-secret-modal-DEEn7sZV.js → write-secret-modal-3-v-dHVj.js} +1 -1
- package/dist/index.html +67 -67
- package/package.json +1 -1
- package/src/components/data-table/column-formatting/feature.ts +2 -1
- package/src/components/editor/file-tree/__tests__/file-render-mode.test.ts +27 -0
- package/src/components/editor/file-tree/__tests__/file-viewer.test.tsx +150 -0
- package/src/components/editor/file-tree/file-preview-metadata.tsx +51 -0
- package/src/components/editor/file-tree/file-render-mode.ts +32 -0
- package/src/components/editor/file-tree/file-viewer.tsx +76 -50
- package/src/components/editor/output/CalloutOutput.tsx +17 -3
- package/src/components/slides/__tests__/slide-scroll-hint.test.tsx +198 -0
- package/src/components/slides/reveal-component.tsx +3 -2
- package/src/components/slides/slide-scroll-hint.tsx +161 -0
- package/src/components/ui/input.tsx +1 -1
- package/src/core/codemirror/keymaps/__tests__/keymaps.test.ts +31 -2
- package/src/core/codemirror/keymaps/keymaps.ts +12 -0
- package/src/core/hotkeys/hotkeys.ts +0 -2
- package/src/core/i18n/__tests__/locale-provider.test.tsx +54 -118
- package/src/core/i18n/__tests__/locale.test.ts +113 -0
- package/src/core/i18n/locale-provider.tsx +1 -19
- package/src/core/i18n/locale.ts +71 -0
- package/src/core/network/types.ts +3 -1
- package/src/css/admonition.css +52 -71
- package/src/plugins/impl/FormPlugin.tsx +1 -1
- package/src/plugins/impl/__tests__/FormPlugin.test.tsx +162 -0
- package/src/plugins/layout/CalloutPlugin.tsx +8 -1
- package/src/stories/callout.stories.tsx +12 -0
- package/dist/assets/JsonOutput-DnGSkLeP.js +0 -53
- package/dist/assets/ai-model-dropdown-DXgLphFa.js +0 -5
- package/dist/assets/dist-BCMBu0rO.js +0 -2
- package/dist/assets/file-explorer-panel-DbdoJbbF.js +0 -26
- package/dist/assets/index-D73cl2ti.js +0 -38
- package/dist/assets/process-output-BEhIGfkO.js +0 -1
- package/dist/assets/useEventListener-B_w3A283.js +0 -1
- package/src/components/editor/output/CalloutOutput.styles.ts +0 -22
package/dist/assets/{LazyAnyLanguageCodeMirror-sVm_hz8A.js → LazyAnyLanguageCodeMirror-B2JvSXP-.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./any-language-editor
|
|
2
|
-
import{s as e}from"./chunk-LvLJmgfZ.js";import{t as i}from"./react-Bj1aDYRI.js";import{t as o}from"./createLucideIcon-w-Qo9n0R.js";import{t as m}from"./preload-helper-TXkS1QI3.js";let r,a,s=(async()=>{r=o("between-horizontal-start",[["rect",{width:"13",height:"7",x:"8",y:"3",rx:"1",key:"pkso9a"}],["path",{d:"m2 9 3 3-3 3",key:"1agib5"}],["rect",{width:"13",height:"7",x:"8",y:"14",rx:"1",key:"1q5fc1"}]]),a=(0,e(i(),1).lazy)(()=>m(()=>import("./any-language-editor
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./any-language-editor--tRHs8C_.js","./copy-icon-neDQUo4Q.js","./button-DDGiD1NW.js","./useEventListener-C0195JsF.js","./objects-BlG0ZrO0.js","./compiler-runtime-B3qBwwSJ.js","./react-Bj1aDYRI.js","./chunk-LvLJmgfZ.js","./jsx-runtime-Blw4afVn.js","./cn-DYvqRARy.js","./clsx-XrBBnd7s.js","./tooltip-4bZlU7jl.js","./fullscreen-CTDqNQr6.js","./react-dom-CSu739Rf.js","./dist-BLN8PNJV.js","./use-toast-BwJoaaDM.js","./copy-Bxb1_Gtw.js","./check-rzLRd0j9.js","./createLucideIcon-w-Qo9n0R.js","./copy-3iHFdt22.js","./error-banner-BSxEOIn2.js","./alert-dialog-Bb8Lz8ko.js","./errors-PgHhDa-M.js","./zod-H_cgTO0M.js","./dist-D5ToCtv8.js","./dist-12S8I4CH.js","./dist-BJZAIIze.js","./dist-D35OyUMQ.js","./dist-DYEuVkEX.js","./dist-DnjsPBRJ.js","./dist-aRc_dRed.js","./dist-ByK00N0T.js","./dist-C5kf6g-d.js","./dist-DcwTQG1A.js","./dist-BaKJ0-Tb.js","./dist-CPjTeT8p.js","./dist-DNGKAtWk.js","./dist-56ul6-mm.js","./dist-3N7-WLqi.js","./dist-CM-lWxt3.js","./esm-B30N1GS0.js","./extends-B9D0JO9U.js","./objectWithoutPropertiesLoose-CboCOq4o.js","./dist-CiVShZKM.js","./esm-Cmv0Nuxi.js","./dist-DokId-qM.js","./dist-98K4fusX.js","./dist-OgwOt8T2.js","./dist-DI1-Z60I.js","./dist-B8g3pNYJ.js","./dist-CpbbK4-I.js","./apl-DVqFAlEd.js","./asciiarmor-B45BhOLj.js","./asn1-C4T2ctU6.js","./brainfuck-kVh8Eud4.js","./clike-O0gwXilc.js","./clojure-CsbMWxp9.js","./cmake-FpJvOdyj.js","./cobol-Duxbpsru.js","./coffeescript-D-Unz9IP.js","./commonlisp-_nR12oc7.js","./crystal-dj3W4b1A.js","./css-0BG6A_BC.js","./cypher-CKPokaoH.js","./d-BrbqzVa2.js","./diff-BmdR9FsO.js","./dtd-DbCXDVgi.js","./dylan-CLLzL2Js.js","./ecl-BC7x2nzk.js","./eiffel-CDU836rz.js","./elm-D-_bXARs.js","./erlang-CwDZk2zM.js","./factor-DMrXrOH8.js","./simple-mode-DBSzUJLA.js","./forth-D6FsO_8x.js","./fortran-D4BMbIkG.js","./gas-JFjzcgdY.js","./gherkin-Cyu-qGaF.js","./groovy-CZaE9eN-.js","./haskell-Dc6o0IGr.js","./haxe-Bsf0tzqs.js","./idl-1W91kQ8_.js","./javascript-BZ81-2rO.js","./julia-BZOsq0r_.js","./livescript-CNZfmikk.js","./lua-DXGRliwd.js","./mathematica-BoUj8M7D.js","./mbox-DLVP8LAe.js","./mirc-kI4d5fMu.js","./mllike-CD9vBc_2.js","./modelica-DgfsLJuF.js","./mscgen-B1HDwshJ.js","./mumps-D_-b9TZD.js","./nsis-Ccvd1gbp.js","./ntriples-COX9JFZ8.js","./octave-BejycR79.js","./oz-CFFivrGn.js","./pascal-B_p9jkCs.js","./perl-C-SFBTly.js","./pig-BhxDMp2k.js","./powershell-c59M-9N2.js","./properties-D1JNwCKy.js","./protobuf-DQS7ex8R.js","./pug-BtXi5KiX.js","./puppet-DaQvhvew.js","./python-XHl3eRTS.js","./q-DppnoRE3.js","./r-D8-F_FWj.js","./rpm-CegJhNNO.js","./ruby-YMIxufV1.js","./sas-wTtX9UIQ.js","./scheme-BGenom3k.js","./shell-Bu1sLaiP.js","./sieve-ffe6rUQh.js","./smalltalk-NU5EGjHp.js","./sparql-uqVktnwO.js","./stex-FMMSUPAS.js","./stylus-B2E6Ulaz.js","./swift-Rmnn7ATv.js","./tcl-ZPWCn2nn.js","./textile-uhA33kFk.js","./toml-BFZv2Mv7.js","./troff-B5eayHop.js","./ttcn-cfg-CfbkL3Q_.js","./ttcn-BM0Yp8NY.js","./turtle-DvetLxrv.js","./vb-i5Z8scch.js","./vbscript-BiPYgIyi.js","./velocity-Dw3R3YoX.js","./verilog-B8FhJcX6.js","./vhdl-BqPEoXdJ.js","./webidl-mMO-qW5Q.js","./xquery-DvqNwq7L.js","./yacas-Dku9Z6Kf.js","./z80-DvazU5Tr.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{s as e}from"./chunk-LvLJmgfZ.js";import{t as i}from"./react-Bj1aDYRI.js";import{t as o}from"./createLucideIcon-w-Qo9n0R.js";import{t as m}from"./preload-helper-TXkS1QI3.js";let r,a,s=(async()=>{r=o("between-horizontal-start",[["rect",{width:"13",height:"7",x:"8",y:"3",rx:"1",key:"pkso9a"}],["path",{d:"m2 9 3 3-3 3",key:"1agib5"}],["rect",{width:"13",height:"7",x:"8",y:"14",rx:"1",key:"1q5fc1"}]]),a=(0,e(i(),1).lazy)(()=>m(()=>import("./any-language-editor--tRHs8C_.js").then(async t=>(await t.__tla,t)),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134]),import.meta.url))})();export{s as __tla,r as n,a as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{s as le}from"./chunk-LvLJmgfZ.js";import{d as ae,f as ie,i as Qe,l as oe,n as Re,p as Ve,u as ce}from"./useEvent-D91BmmQi.js";import{t as He}from"./react-Bj1aDYRI.js";import{E as Ke,Ki as Y,Kn as de,Mi as Ge,Ni as me,Nn as pe,Sr as Je,rt as Xe,vr as Ye,y as Ze,zn as Z}from"./cells-
|
|
1
|
+
import{s as le}from"./chunk-LvLJmgfZ.js";import{d as ae,f as ie,i as Qe,l as oe,n as Re,p as Ve,u as ce}from"./useEvent-D91BmmQi.js";import{t as He}from"./react-Bj1aDYRI.js";import{E as Ke,Ki as Y,Kn as de,Mi as Ge,Ni as me,Nn as pe,Sr as Je,rt as Xe,vr as Ye,y as Ze,zn as Z}from"./cells-aqfX084m.js";import{t as A}from"./compiler-runtime-B3qBwwSJ.js";import{g as et,p as tt}from"./useEventListener-C0195JsF.js";import{t as st}from"./invariant-CkiqGLcK.js";import{a as rt,i as nt,x as lt}from"./utils-BWBBpCkT.js";import{t as ue}from"./cn-DYvqRARy.js";import{t as at}from"./jsx-runtime-Blw4afVn.js";import{a as it,i as ot,o as ct,r as dt,t as mt}from"./config-BJVx3eBW.js";import{a as pt,p as ut,r as xt,t as ht}from"./dropdown-menu-dHmZR8bI.js";import{t as Q}from"./tooltip-4bZlU7jl.js";import{r as xe,t as z}from"./button-DDGiD1NW.js";import{n as ft}from"./strings--BknHX9C.js";import{t as he}from"./createLucideIcon-w-Qo9n0R.js";import{t as gt}from"./check-rzLRd0j9.js";import{r as fe}from"./x-C-Eq0ag8.js";import{t as jt}from"./chevron-right-BS_NcSch.js";import{t as yt}from"./hat-glasses-BttHlyvs.js";import{t as bt}from"./package-Bxz_8e44.js";import{t as vt}from"./sparkles-DUCpRFlS.js";import{l as ge,r as Nt}from"./datasource-wn1PTlXA.js";import{a as It}from"./dist-CPjTeT8p.js";import{t as wt}from"./uuid-ImXS-885.js";import{t as kt}from"./use-toast-BwJoaaDM.js";import{t as $t}from"./RenderHTML-uBc4LkCP.js";import{t as je}from"./kbd-C5HnBH5U.js";import{t as q}from"./links-wcQA1Np1.js";import{r as _t,t as At}from"./alert-jlwhGxSb.js";import{o as Tt,t as Ft}from"./useInstallPackage-WiYBwhUO.js";import{a as St,n as Ct}from"./state-Tc7pRohh.js";import{n as $}from"./cell-link-C0hhYyNu.js";var L=he("square-arrow-out-up-right",[["path",{d:"M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6",key:"y09zxi"}],["path",{d:"m21 3-9 9",key:"mpx6sq"}],["path",{d:"M15 3h6v6",key:"1q9fwt"}]]),ye=he("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]),be=String.raw`_cell_([^\W_][\w-]*?)(_\w*)`,ve=String.raw`(?<!_)${be}`;`${be}`;var Mt=new RegExp(ve),ee=new RegExp(ve,"g");function Ne(t){let e=[];ee.lastIndex=0;let n=0,r=ee.exec(t);for(;r!==null;)r.index>n&&e.push(t.slice(n,r.index)),e.push({cellId:r[1],name:r[2]}),n=r.index+r[0].length,r=ee.exec(t);return n<t.length&&e.push(t.slice(n)),e}function zt(t){return Mt.test(t)}function Et(t){let e=null,n=t.cursor();do n.name==="ExpressionStatement"&&(e=n.node);while(n.next());return e}function Pt(t){let e=t.split(`
|
|
2
2
|
`),n=" ",r=Et(It.parse(t));if(!r)return["def _():",...te(e,n),`${n}return`,"","","_()"].join(`
|
|
3
3
|
`);let a=t.slice(0,r.from).trim(),l=t.slice(r.from).trim(),o=a.split(`
|
|
4
4
|
`),i=l.split(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as Ce}from"./chunk-LvLJmgfZ.js";import{t as ye}from"./react-Bj1aDYRI.js";import{$ as Se,Y as ke,et as _e}from"./input-CqrUjynb.js";import{D as Le,F as xe,I as v,L as Me,N as w,P as S,T as Fe,V as R,c as Ie,j as k,k as Pe,l as We,p as Ae,w as Ke,x as ne}from"./usePress-5hBv4sjD.js";import{t as He}from"./context-BFPaAUK_.js";var Be=class{get currentNode(){return this._currentNode}set currentNode(e){if(!k(this.root,e))throw Error("Cannot set currentNode to a node that is not contained by the root node.");let t=[],r=e,n=e;for(this._currentNode=e;r&&r!==this.root;)if(r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let i=r,l=this._doc.createTreeWalker(i,this.whatToShow,{acceptNode:this._acceptNode});t.push(l),l.currentNode=n,this._currentSetFor.add(l),r=n=i.host}else r=r.parentNode;let o=this._doc.createTreeWalker(this.root,this.whatToShow,{acceptNode:this._acceptNode});t.push(o),o.currentNode=n,this._currentSetFor.add(o),this._walkerStack=t}get doc(){return this._doc}firstChild(){let e=this.currentNode,t=this.nextNode();return k(e,t)?(t&&(this.currentNode=t),t):(this.currentNode=e,null)}lastChild(){let e=this._walkerStack[0].lastChild();return e&&(this.currentNode=e),e}nextNode(){var t;let e=this._walkerStack[0].nextNode();if(e){if(e.shadowRoot){let r;if(typeof this.filter=="function"?r=this.filter(e):(t=this.filter)!=null&&t.acceptNode&&(r=this.filter.acceptNode(e)),r===NodeFilter.FILTER_ACCEPT)return this.currentNode=e,e;let n=this.nextNode();return n&&(this.currentNode=n),n}return e&&(this.currentNode=e),e}else if(this._walkerStack.length>1){this._walkerStack.shift();let r=this.nextNode();return r&&(this.currentNode=r),r}else return null}previousNode(){var r;let e=this._walkerStack[0];if(e.currentNode===e.root){if(this._currentSetFor.has(e))if(this._currentSetFor.delete(e),this._walkerStack.length>1){this._walkerStack.shift();let n=this.previousNode();return n&&(this.currentNode=n),n}else return null;return null}let t=e.previousNode();if(t){if(t.shadowRoot){let n;if(typeof this.filter=="function"?n=this.filter(t):(r=this.filter)!=null&&r.acceptNode&&(n=this.filter.acceptNode(t)),n===NodeFilter.FILTER_ACCEPT)return t&&(this.currentNode=t),t;let o=this.lastChild();return o&&(this.currentNode=o),o}return t&&(this.currentNode=t),t}else if(this._walkerStack.length>1){this._walkerStack.shift();let n=this.previousNode();return n&&(this.currentNode=n),n}else return null}nextSibling(){return null}previousSibling(){return null}parentNode(){return null}constructor(e,t,r,n){this._walkerStack=[],this._currentSetFor=new Set,this._acceptNode=i=>{var l;if(i.nodeType===Node.ELEMENT_NODE){let a=i.shadowRoot;if(a){let d=this._doc.createTreeWalker(a,this.whatToShow,{acceptNode:this._acceptNode});return this._walkerStack.unshift(d),NodeFilter.FILTER_ACCEPT}else{if(typeof this.filter=="function")return this.filter(i);if((l=this.filter)!=null&&l.acceptNode)return this.filter.acceptNode(i);if(this.filter===null)return NodeFilter.FILTER_ACCEPT}}return NodeFilter.FILTER_SKIP},this._doc=e,this.root=t,this.filter=n??null,this.whatToShow=r??NodeFilter.SHOW_ALL,this._currentNode=t,this._walkerStack.unshift(e.createTreeWalker(t,r,this._acceptNode));let o=t.shadowRoot;if(o){let i=this._doc.createTreeWalker(o,this.whatToShow,{acceptNode:this._acceptNode});this._walkerStack.unshift(i)}}};function oe(e,t,r,n){return xe()?new Be(e,t,r,n):e.createTreeWalker(t,r,n)}var h=Ce(ye(),1);function De(e,t){let r=(0,h.useRef)(!0),n=(0,h.useRef)(null),o=Ae(e);(0,h.useEffect)(()=>(r.current=!0,()=>{r.current=!1}),[]),(0,h.useEffect)(()=>{let i=n.current;r.current?r.current=!1:(!i||t.some((l,a)=>!Object.is(l,i[a])))&&o(),n.current=t},t)}function z(e,t){if(!e)return!1;let r=window.getComputedStyle(e),n=document.scrollingElement||document.documentElement,o=/(auto|scroll)/.test(r.overflow+r.overflowX+r.overflowY);return e===n&&r.overflow!=="hidden"&&(o=!0),o&&t&&(o=e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth),o}function Oe(e,t){let r=e;for(z(r,t)&&(r=r.parentElement);r&&!z(r,t);)r=r.parentElement;return r||document.scrollingElement||document.documentElement}function ie(e,t){let r=[],n=document.scrollingElement||document.documentElement;do z(e,t)&&r.push(e),e=e.parentElement;while(e&&e!==n);return r}function je(e){return Ke()?e.metaKey:e.ctrlKey}var ze=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Ve(e){return e instanceof HTMLInputElement&&!ze.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}var qe=0,q=new Map;function Ue(e){let[t,r]=(0,h.useState)();return R(()=>{if(!e)return;let n=q.get(e);if(n)r(n.element.id);else{let o=`react-aria-description-${qe++}`;r(o);let i=document.createElement("div");i.id=o,i.style.display="none",i.textContent=e,document.body.appendChild(i),n={refCount:0,element:i},q.set(e,n)}return n.refCount++,()=>{n&&--n.refCount===0&&(n.element.remove(),q.delete(e))}},[e]),{"aria-describedby":e?t:void 0}}function U(e,t,r={}){let{block:n="nearest",inline:o="nearest"}=r;if(e===t)return;let i=e.scrollTop,l=e.scrollLeft,a=t.getBoundingClientRect(),d=e.getBoundingClientRect(),c=window.getComputedStyle(t),s=window.getComputedStyle(e),f=document.scrollingElement||document.documentElement,u=e===f?0:d.top,N=e===f?e.clientHeight:d.bottom,b=e===f?0:d.left,P=e===f?e.clientWidth:d.right,_=parseInt(c.scrollMarginTop,10)||0,pe=parseInt(c.scrollMarginBottom,10)||0,Ne=parseInt(c.scrollMarginLeft,10)||0,me=parseInt(c.scrollMarginRight,10)||0,be=parseInt(s.scrollPaddingTop,10)||0,ve=parseInt(s.scrollPaddingBottom,10)||0,Ee=parseInt(s.scrollPaddingLeft,10)||0,ge=parseInt(s.scrollPaddingRight,10)||0,Q=parseInt(s.borderTopWidth,10)||0,Z=parseInt(s.borderBottomWidth,10)||0,ee=parseInt(s.borderLeftWidth,10)||0,te=parseInt(s.borderRightWidth,10)||0,W=a.top-_,A=a.bottom+pe,K=a.left-Ne,H=a.right+me,Te=e===f?0:ee+te,we=e===f?0:Q+Z,re=e.offsetWidth-e.clientWidth-Te,Re=e.offsetHeight-e.clientHeight-we,B=u+Q+be,D=N-Z-ve-Re,L=b+ee+Ee,x=P-te-ge;s.direction==="rtl"&&!Le()?L+=re:x-=re;let O=W<B||A>D,j=K<L||H>x;if(O&&n==="start")i+=W-B;else if(O&&n==="center")i+=(W+A)/2-(B+D)/2;else if(O&&n==="end")i+=A-D;else if(O&&n==="nearest"){let M=W-B,F=A-D;i+=Math.abs(M)<=Math.abs(F)?M:F}if(j&&o==="start")l+=K-L;else if(j&&o==="center")l+=(K+H)/2-(L+x)/2;else if(j&&o==="end")l+=H-x;else if(j&&o==="nearest"){let M=K-L,F=H-x;l+=Math.abs(M)<=Math.abs(F)?M:F}e.scrollTo({left:l,top:i})}function $e(e,t={}){let{containingElement:r}=t;if(e&&e.isConnected){let l=document.scrollingElement||document.documentElement;if(window.getComputedStyle(l).overflow!=="hidden"&&!ne()){var n;let{left:a,top:d}=e.getBoundingClientRect();e==null||(n=e.scrollIntoView)==null||n.call(e,{block:"nearest"});let{left:c,top:s}=e.getBoundingClientRect();if(Math.abs(a-c)>1||Math.abs(d-s)>1){var o,i;r==null||(o=r.scrollIntoView)==null||o.call(r,{block:"center",inline:"center"}),(i=e.scrollIntoView)==null||i.call(e,{block:"nearest"})}}else{let{left:a,top:d}=e.getBoundingClientRect(),c=ie(e,!0);for(let u of c)U(u,e);let{left:s,top:f}=e.getBoundingClientRect();if(Math.abs(a-s)>1||Math.abs(d-f)>1){c=r?ie(r,!0):[];for(let u of c)U(u,r,{block:"center",inline:"center"})}}}}var $=new Map;function Ye(e){let{locale:t}=He(),r=t+(e?Object.entries(e).sort((o,i)=>o[0]<i[0]?-1:1).join():"");if($.has(r))return $.get(r);let n=new Intl.Collator(t,e);return $.set(r,n),n}var le=h.createContext(null),Y="react-aria-focus-scope-restore",p=null;function Ge(e){let{children:t,contain:r,restoreFocus:n,autoFocus:o}=e,i=(0,h.useRef)(null),l=(0,h.useRef)(null),a=(0,h.useRef)([]),{parentNode:d}=(0,h.useContext)(le)||{},c=(0,h.useMemo)(()=>new X({scopeRef:a}),[a]);R(()=>{let u=d||m.root;if(m.getTreeNode(u.scopeRef)&&p&&!V(p,u.scopeRef)){let N=m.getTreeNode(p);N&&(u=N)}u.addChild(c),m.addNode(c)},[c,d]),R(()=>{let u=m.getTreeNode(a);u&&(u.contain=!!r)},[r]),R(()=>{var P;let u=(P=i.current)==null?void 0:P.nextSibling,N=[],b=_=>_.stopPropagation();for(;u&&u!==l.current;)N.push(u),u.addEventListener(Y,b),u=u.nextSibling;return a.current=N,()=>{for(let _ of N)_.removeEventListener(Y,b)}},[t]),rt(a,n,r),Ze(a,r),nt(a,n,r),tt(a,o),(0,h.useEffect)(()=>{let u=w(v(a.current?a.current[0]:void 0)),N=null;if(T(u,a.current)){for(let b of m.traverse())b.scopeRef&&T(u,b.scopeRef.current)&&(N=b);N===m.getTreeNode(a)&&(p=N.scopeRef)}},[a]),R(()=>()=>{var N,b;let u=((b=(N=m.getTreeNode(a))==null?void 0:N.parent)==null?void 0:b.scopeRef)??null;(a===p||V(a,p))&&(!u||m.getTreeNode(u))&&(p=u),m.removeTreeNode(a)},[a]);let s=(0,h.useMemo)(()=>Je(a),[]),f=(0,h.useMemo)(()=>({focusManager:s,parentNode:c}),[c,s]);return h.createElement(le.Provider,{value:f},h.createElement("span",{"data-focus-scope-start":!0,hidden:!0,ref:i}),t,h.createElement("span",{"data-focus-scope-end":!0,hidden:!0,ref:l}))}function Je(e){return{focusNext(t={}){let r=e.current,{from:n,tabbable:o,wrap:i,accept:l}=t,a=n||w(v(r[0]??void 0)),d=r[0].previousElementSibling,c=g(y(r),{tabbable:o,accept:l},r);c.currentNode=T(a,r)?a:d;let s=c.nextNode();return!s&&i&&(c.currentNode=d,s=c.nextNode()),s&&E(s,!0),s},focusPrevious(t={}){let r=e.current,{from:n,tabbable:o,wrap:i,accept:l}=t,a=n||w(v(r[0]??void 0)),d=r[r.length-1].nextElementSibling,c=g(y(r),{tabbable:o,accept:l},r);c.currentNode=T(a,r)?a:d;let s=c.previousNode();return!s&&i&&(c.currentNode=d,s=c.previousNode()),s&&E(s,!0),s},focusFirst(t={}){let r=e.current,{tabbable:n,accept:o}=t,i=g(y(r),{tabbable:n,accept:o},r);i.currentNode=r[0].previousElementSibling;let l=i.nextNode();return l&&E(l,!0),l},focusLast(t={}){let r=e.current,{tabbable:n,accept:o}=t,i=g(y(r),{tabbable:n,accept:o},r);i.currentNode=r[r.length-1].nextElementSibling;let l=i.previousNode();return l&&E(l,!0),l}}}function y(e){return e[0].parentElement}function I(e){let t=m.getTreeNode(p);for(;t&&t.scopeRef!==e;){if(t.contain)return!1;t=t.parent}return!0}function Xe(e){if(!e.form)return Array.from(v(e).querySelectorAll(`input[type="radio"][name="${CSS.escape(e.name)}"]`)).filter(n=>!n.form);let t=e.form.elements.namedItem(e.name),r=Me(e);return t instanceof r.RadioNodeList?Array.from(t).filter(n=>n instanceof r.HTMLInputElement):t instanceof r.HTMLInputElement?[t]:[]}function Qe(e){if(e.checked)return!0;let t=Xe(e);return t.length>0&&!t.some(r=>r.checked)}function Ze(e,t){let r=(0,h.useRef)(void 0),n=(0,h.useRef)(void 0);R(()=>{let o=e.current;if(!t){n.current&&(n.current=(cancelAnimationFrame(n.current),void 0));return}let i=v(o?o[0]:void 0),l=c=>{if(c.key!=="Tab"||c.altKey||c.ctrlKey||c.metaKey||!I(e)||c.isComposing)return;let s=w(i),f=e.current;if(!f||!T(s,f))return;let u=g(y(f),{tabbable:!0},f);if(!s)return;u.currentNode=s;let N=c.shiftKey?u.previousNode():u.nextNode();N||(N=(u.currentNode=c.shiftKey?f[f.length-1].nextElementSibling:f[0].previousElementSibling,c.shiftKey?u.previousNode():u.nextNode())),c.preventDefault(),N&&E(N,!0)},a=c=>{(!p||V(p,e))&&T(S(c),e.current)?(p=e,r.current=S(c)):I(e)&&!C(S(c),e)?r.current?r.current.focus():p&&p.current&&G(p.current):I(e)&&(r.current=S(c))},d=c=>{n.current&&cancelAnimationFrame(n.current),n.current=requestAnimationFrame(()=>{let s=_e(),f=(s==="virtual"||s===null)&&Fe()&&ne(),u=w(i);if(!f&&u&&I(e)&&!C(u,e)){p=e;let b=S(c);if(b&&b.isConnected){var N;r.current=b,(N=r.current)==null||N.focus()}else p.current&&G(p.current)}})};return i.addEventListener("keydown",l,!1),i.addEventListener("focusin",a,!1),o==null||o.forEach(c=>c.addEventListener("focusin",a,!1)),o==null||o.forEach(c=>c.addEventListener("focusout",d,!1)),()=>{i.removeEventListener("keydown",l,!1),i.removeEventListener("focusin",a,!1),o==null||o.forEach(c=>c.removeEventListener("focusin",a,!1)),o==null||o.forEach(c=>c.removeEventListener("focusout",d,!1))}},[e,t]),R(()=>()=>{n.current&&cancelAnimationFrame(n.current)},[n])}function ce(e){return C(e)}function T(e,t){return!e||!t?!1:t.some(r=>k(r,e))}function C(e,t=null){if(e instanceof Element&&e.closest("[data-react-aria-top-layer]"))return!0;for(let{scopeRef:r}of m.traverse(m.getTreeNode(t)))if(r&&T(e,r.current))return!0;return!1}function et(e){return C(e,p)}function V(e,t){var n;let r=(n=m.getTreeNode(t))==null?void 0:n.parent;for(;r;){if(r.scopeRef===e)return!0;r=r.parent}return!1}function E(e,t=!1){if(e!=null&&!t)try{Se(e)}catch{}else if(e!=null)try{e.focus()}catch{}}function se(e,t=!0){let r=e[0].previousElementSibling,n=y(e),o=g(n,{tabbable:t},e);o.currentNode=r;let i=o.nextNode();return t&&!i&&(n=y(e),o=g(n,{tabbable:!1},e),o.currentNode=r,i=o.nextNode()),i}function G(e,t=!0){E(se(e,t))}function tt(e,t){let r=h.useRef(t);(0,h.useEffect)(()=>{r.current&&(p=e,!T(w(v(e.current?e.current[0]:void 0)),p.current)&&e.current&&G(e.current)),r.current=!1},[e])}function rt(e,t,r){R(()=>{if(t||r)return;let n=e.current,o=v(n?n[0]:void 0),i=l=>{let a=S(l);T(a,e.current)?p=e:ce(a)||(p=null)};return o.addEventListener("focusin",i,!1),n==null||n.forEach(l=>l.addEventListener("focusin",i,!1)),()=>{o.removeEventListener("focusin",i,!1),n==null||n.forEach(l=>l.removeEventListener("focusin",i,!1))}},[e,t,r])}function ae(e){let t=m.getTreeNode(p);for(;t&&t.scopeRef!==e;){if(t.nodeToRestore)return!1;t=t.parent}return(t==null?void 0:t.scopeRef)===e}function nt(e,t,r){let n=(0,h.useRef)(typeof document<"u"?w(v(e.current?e.current[0]:void 0)):null);R(()=>{let o=e.current,i=v(o?o[0]:void 0);if(!t||r)return;let l=()=>{(!p||V(p,e))&&T(w(i),e.current)&&(p=e)};return i.addEventListener("focusin",l,!1),o==null||o.forEach(a=>a.addEventListener("focusin",l,!1)),()=>{i.removeEventListener("focusin",l,!1),o==null||o.forEach(a=>a.removeEventListener("focusin",l,!1))}},[e,r]),R(()=>{let o=v(e.current?e.current[0]:void 0);if(!t)return;let i=l=>{if(l.key!=="Tab"||l.altKey||l.ctrlKey||l.metaKey||!I(e)||l.isComposing)return;let a=o.activeElement;if(!C(a,e)||!ae(e))return;let d=m.getTreeNode(e);if(!d)return;let c=d.nodeToRestore,s=g(o.body,{tabbable:!0});s.currentNode=a;let f=l.shiftKey?s.previousNode():s.nextNode();if((!c||!c.isConnected||c===o.body)&&(c=void 0,d.nodeToRestore=void 0),(!f||!C(f,e))&&c){s.currentNode=c;do f=l.shiftKey?s.previousNode():s.nextNode();while(C(f,e));l.preventDefault(),l.stopPropagation(),f?E(f,!0):ce(c)?E(c,!0):a.blur()}};return r||o.addEventListener("keydown",i,!0),()=>{r||o.removeEventListener("keydown",i,!0)}},[e,t,r]),R(()=>{let o=v(e.current?e.current[0]:void 0);if(!t)return;let i=m.getTreeNode(e);if(i)return i.nodeToRestore=n.current??void 0,()=>{let l=m.getTreeNode(e);if(!l)return;let a=l.nodeToRestore,d=w(o);if(t&&a&&(d&&C(d,e)||d===o.body&&ae(e))){let c=m.clone();requestAnimationFrame(()=>{if(o.activeElement===o.body){let s=c.getTreeNode(e);for(;s;){if(s.nodeToRestore&&s.nodeToRestore.isConnected){ue(s.nodeToRestore);return}s=s.parent}for(s=c.getTreeNode(e);s;){if(s.scopeRef&&s.scopeRef.current&&m.getTreeNode(s.scopeRef)){ue(se(s.scopeRef.current,!0));return}s=s.parent}}})}}},[e,t])}function ue(e){e.dispatchEvent(new CustomEvent(Y,{bubbles:!0,cancelable:!0}))&&E(e)}function g(e,t,r){let n=t!=null&&t.tabbable?We:Ie,o=v((e==null?void 0:e.nodeType)===Node.ELEMENT_NODE?e:null),i=oe(o,e||o,NodeFilter.SHOW_ELEMENT,{acceptNode(l){return k(t==null?void 0:t.from,l)||t!=null&&t.tabbable&&l.tagName==="INPUT"&&l.getAttribute("type")==="radio"&&(!Qe(l)||i.currentNode.tagName==="INPUT"&&i.currentNode.type==="radio"&&i.currentNode.name===l.name)?NodeFilter.FILTER_REJECT:n(l)&&(!r||T(l,r))&&(!(t!=null&&t.accept)||t.accept(l))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t!=null&&t.from&&(i.currentNode=t.from),i}function ot(e,t={}){return{focusNext(r={}){let n=e.current;if(!n)return null;let{from:o,tabbable:i=t.tabbable,wrap:l=t.wrap,accept:a=t.accept}=r,d=o||w(v(n)),c=g(n,{tabbable:i,accept:a});k(n,d)&&(c.currentNode=d);let s=c.nextNode();return!s&&l&&(c.currentNode=n,s=c.nextNode()),s&&E(s,!0),s},focusPrevious(r=t){let n=e.current;if(!n)return null;let{from:o,tabbable:i=t.tabbable,wrap:l=t.wrap,accept:a=t.accept}=r,d=o||w(v(n)),c=g(n,{tabbable:i,accept:a});if(k(n,d))c.currentNode=d;else{let f=J(c);return f&&E(f,!0),f??null}let s=c.previousNode();if(!s&&l){c.currentNode=n;let f=J(c);if(!f)return null;s=f}return s&&E(s,!0),s??null},focusFirst(r=t){let n=e.current;if(!n)return null;let{tabbable:o=t.tabbable,accept:i=t.accept}=r,l=g(n,{tabbable:o,accept:i}).nextNode();return l&&E(l,!0),l},focusLast(r=t){let n=e.current;if(!n)return null;let{tabbable:o=t.tabbable,accept:i=t.accept}=r,l=J(g(n,{tabbable:o,accept:i}));return l&&E(l,!0),l??null}}}function J(e){let t,r;do r=e.lastChild(),r&&(t=r);while(r);return t}var it=class he{get size(){return this.fastMap.size}getTreeNode(t){return this.fastMap.get(t)}addTreeNode(t,r,n){let o=this.fastMap.get(r??null);if(!o)return;let i=new X({scopeRef:t});o.addChild(i),i.parent=o,this.fastMap.set(t,i),n&&(i.nodeToRestore=n)}addNode(t){this.fastMap.set(t.scopeRef,t)}removeTreeNode(t){if(t===null)return;let r=this.fastMap.get(t);if(!r)return;let n=r.parent;for(let i of this.traverse())i!==r&&r.nodeToRestore&&i.nodeToRestore&&r.scopeRef&&r.scopeRef.current&&T(i.nodeToRestore,r.scopeRef.current)&&(i.nodeToRestore=r.nodeToRestore);let o=r.children;n&&(n.removeChild(r),o.size>0&&o.forEach(i=>n&&n.addChild(i))),this.fastMap.delete(r.scopeRef)}*traverse(t=this.root){if(t.scopeRef!=null&&(yield t),t.children.size>0)for(let r of t.children)yield*this.traverse(r)}clone(){var r;let t=new he;for(let n of this.traverse())t.addTreeNode(n.scopeRef,((r=n.parent)==null?void 0:r.scopeRef)??null,n.nodeToRestore);return t}constructor(){this.fastMap=new Map,this.root=new X({scopeRef:null}),this.fastMap.set(null,this.root)}},X=class{addChild(e){this.children.add(e),e.parent=this}removeChild(e){this.children.delete(e),e.parent=void 0}constructor(e){this.children=new Set,this.contain=!1,this.scopeRef=e.scopeRef}},m=new it,de={border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"};function fe(e={}){let{style:t,isFocusable:r}=e,[n,o]=(0,h.useState)(!1),{focusWithinProps:i}=ke({isDisabled:!r,onFocusWithinChange:a=>o(a)}),l=(0,h.useMemo)(()=>n?t:t?{...de,...t}:de,[n]);return{visuallyHiddenProps:{...i,style:l}}}function lt(e){let{children:t,elementType:r="div",isFocusable:n,style:o,...i}=e,{visuallyHiddenProps:l}=fe(e);return h.createElement(r,Pe(i,l),t)}var ct=(0,h.createContext)(null);(0,h.createContext)(null),(0,h.createContext)(null),(0,h.createContext)(null),(0,h.createContext)(null);var st=(0,h.createContext)({}),at=(0,h.createContext)(null);(0,h.createContext)(null);export{z as _,fe as a,g as c,U as d,$e as f,Oe as g,Ve as h,lt as i,ot as l,je as m,at as n,et as o,Ue as p,st as r,Ge as s,ct as t,Ye as u,De as v,oe as y};
|
|
1
|
+
import{s as Ce}from"./chunk-LvLJmgfZ.js";import{t as ye}from"./react-Bj1aDYRI.js";import{$ as Se,Y as ke,et as _e}from"./input-JxFwu-3G.js";import{D as Le,F as xe,I as v,L as Me,N as w,P as S,T as Fe,V as R,c as Ie,j as k,k as Pe,l as We,p as Ae,w as Ke,x as ne}from"./usePress-5hBv4sjD.js";import{t as He}from"./context-BFPaAUK_.js";var Be=class{get currentNode(){return this._currentNode}set currentNode(e){if(!k(this.root,e))throw Error("Cannot set currentNode to a node that is not contained by the root node.");let t=[],r=e,n=e;for(this._currentNode=e;r&&r!==this.root;)if(r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let i=r,l=this._doc.createTreeWalker(i,this.whatToShow,{acceptNode:this._acceptNode});t.push(l),l.currentNode=n,this._currentSetFor.add(l),r=n=i.host}else r=r.parentNode;let o=this._doc.createTreeWalker(this.root,this.whatToShow,{acceptNode:this._acceptNode});t.push(o),o.currentNode=n,this._currentSetFor.add(o),this._walkerStack=t}get doc(){return this._doc}firstChild(){let e=this.currentNode,t=this.nextNode();return k(e,t)?(t&&(this.currentNode=t),t):(this.currentNode=e,null)}lastChild(){let e=this._walkerStack[0].lastChild();return e&&(this.currentNode=e),e}nextNode(){var t;let e=this._walkerStack[0].nextNode();if(e){if(e.shadowRoot){let r;if(typeof this.filter=="function"?r=this.filter(e):(t=this.filter)!=null&&t.acceptNode&&(r=this.filter.acceptNode(e)),r===NodeFilter.FILTER_ACCEPT)return this.currentNode=e,e;let n=this.nextNode();return n&&(this.currentNode=n),n}return e&&(this.currentNode=e),e}else if(this._walkerStack.length>1){this._walkerStack.shift();let r=this.nextNode();return r&&(this.currentNode=r),r}else return null}previousNode(){var r;let e=this._walkerStack[0];if(e.currentNode===e.root){if(this._currentSetFor.has(e))if(this._currentSetFor.delete(e),this._walkerStack.length>1){this._walkerStack.shift();let n=this.previousNode();return n&&(this.currentNode=n),n}else return null;return null}let t=e.previousNode();if(t){if(t.shadowRoot){let n;if(typeof this.filter=="function"?n=this.filter(t):(r=this.filter)!=null&&r.acceptNode&&(n=this.filter.acceptNode(t)),n===NodeFilter.FILTER_ACCEPT)return t&&(this.currentNode=t),t;let o=this.lastChild();return o&&(this.currentNode=o),o}return t&&(this.currentNode=t),t}else if(this._walkerStack.length>1){this._walkerStack.shift();let n=this.previousNode();return n&&(this.currentNode=n),n}else return null}nextSibling(){return null}previousSibling(){return null}parentNode(){return null}constructor(e,t,r,n){this._walkerStack=[],this._currentSetFor=new Set,this._acceptNode=i=>{var l;if(i.nodeType===Node.ELEMENT_NODE){let a=i.shadowRoot;if(a){let d=this._doc.createTreeWalker(a,this.whatToShow,{acceptNode:this._acceptNode});return this._walkerStack.unshift(d),NodeFilter.FILTER_ACCEPT}else{if(typeof this.filter=="function")return this.filter(i);if((l=this.filter)!=null&&l.acceptNode)return this.filter.acceptNode(i);if(this.filter===null)return NodeFilter.FILTER_ACCEPT}}return NodeFilter.FILTER_SKIP},this._doc=e,this.root=t,this.filter=n??null,this.whatToShow=r??NodeFilter.SHOW_ALL,this._currentNode=t,this._walkerStack.unshift(e.createTreeWalker(t,r,this._acceptNode));let o=t.shadowRoot;if(o){let i=this._doc.createTreeWalker(o,this.whatToShow,{acceptNode:this._acceptNode});this._walkerStack.unshift(i)}}};function oe(e,t,r,n){return xe()?new Be(e,t,r,n):e.createTreeWalker(t,r,n)}var h=Ce(ye(),1);function De(e,t){let r=(0,h.useRef)(!0),n=(0,h.useRef)(null),o=Ae(e);(0,h.useEffect)(()=>(r.current=!0,()=>{r.current=!1}),[]),(0,h.useEffect)(()=>{let i=n.current;r.current?r.current=!1:(!i||t.some((l,a)=>!Object.is(l,i[a])))&&o(),n.current=t},t)}function z(e,t){if(!e)return!1;let r=window.getComputedStyle(e),n=document.scrollingElement||document.documentElement,o=/(auto|scroll)/.test(r.overflow+r.overflowX+r.overflowY);return e===n&&r.overflow!=="hidden"&&(o=!0),o&&t&&(o=e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth),o}function Oe(e,t){let r=e;for(z(r,t)&&(r=r.parentElement);r&&!z(r,t);)r=r.parentElement;return r||document.scrollingElement||document.documentElement}function ie(e,t){let r=[],n=document.scrollingElement||document.documentElement;do z(e,t)&&r.push(e),e=e.parentElement;while(e&&e!==n);return r}function je(e){return Ke()?e.metaKey:e.ctrlKey}var ze=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Ve(e){return e instanceof HTMLInputElement&&!ze.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}var qe=0,q=new Map;function Ue(e){let[t,r]=(0,h.useState)();return R(()=>{if(!e)return;let n=q.get(e);if(n)r(n.element.id);else{let o=`react-aria-description-${qe++}`;r(o);let i=document.createElement("div");i.id=o,i.style.display="none",i.textContent=e,document.body.appendChild(i),n={refCount:0,element:i},q.set(e,n)}return n.refCount++,()=>{n&&--n.refCount===0&&(n.element.remove(),q.delete(e))}},[e]),{"aria-describedby":e?t:void 0}}function U(e,t,r={}){let{block:n="nearest",inline:o="nearest"}=r;if(e===t)return;let i=e.scrollTop,l=e.scrollLeft,a=t.getBoundingClientRect(),d=e.getBoundingClientRect(),c=window.getComputedStyle(t),s=window.getComputedStyle(e),f=document.scrollingElement||document.documentElement,u=e===f?0:d.top,N=e===f?e.clientHeight:d.bottom,b=e===f?0:d.left,P=e===f?e.clientWidth:d.right,_=parseInt(c.scrollMarginTop,10)||0,pe=parseInt(c.scrollMarginBottom,10)||0,Ne=parseInt(c.scrollMarginLeft,10)||0,me=parseInt(c.scrollMarginRight,10)||0,be=parseInt(s.scrollPaddingTop,10)||0,ve=parseInt(s.scrollPaddingBottom,10)||0,Ee=parseInt(s.scrollPaddingLeft,10)||0,ge=parseInt(s.scrollPaddingRight,10)||0,Q=parseInt(s.borderTopWidth,10)||0,Z=parseInt(s.borderBottomWidth,10)||0,ee=parseInt(s.borderLeftWidth,10)||0,te=parseInt(s.borderRightWidth,10)||0,W=a.top-_,A=a.bottom+pe,K=a.left-Ne,H=a.right+me,Te=e===f?0:ee+te,we=e===f?0:Q+Z,re=e.offsetWidth-e.clientWidth-Te,Re=e.offsetHeight-e.clientHeight-we,B=u+Q+be,D=N-Z-ve-Re,L=b+ee+Ee,x=P-te-ge;s.direction==="rtl"&&!Le()?L+=re:x-=re;let O=W<B||A>D,j=K<L||H>x;if(O&&n==="start")i+=W-B;else if(O&&n==="center")i+=(W+A)/2-(B+D)/2;else if(O&&n==="end")i+=A-D;else if(O&&n==="nearest"){let M=W-B,F=A-D;i+=Math.abs(M)<=Math.abs(F)?M:F}if(j&&o==="start")l+=K-L;else if(j&&o==="center")l+=(K+H)/2-(L+x)/2;else if(j&&o==="end")l+=H-x;else if(j&&o==="nearest"){let M=K-L,F=H-x;l+=Math.abs(M)<=Math.abs(F)?M:F}e.scrollTo({left:l,top:i})}function $e(e,t={}){let{containingElement:r}=t;if(e&&e.isConnected){let l=document.scrollingElement||document.documentElement;if(window.getComputedStyle(l).overflow!=="hidden"&&!ne()){var n;let{left:a,top:d}=e.getBoundingClientRect();e==null||(n=e.scrollIntoView)==null||n.call(e,{block:"nearest"});let{left:c,top:s}=e.getBoundingClientRect();if(Math.abs(a-c)>1||Math.abs(d-s)>1){var o,i;r==null||(o=r.scrollIntoView)==null||o.call(r,{block:"center",inline:"center"}),(i=e.scrollIntoView)==null||i.call(e,{block:"nearest"})}}else{let{left:a,top:d}=e.getBoundingClientRect(),c=ie(e,!0);for(let u of c)U(u,e);let{left:s,top:f}=e.getBoundingClientRect();if(Math.abs(a-s)>1||Math.abs(d-f)>1){c=r?ie(r,!0):[];for(let u of c)U(u,r,{block:"center",inline:"center"})}}}}var $=new Map;function Ye(e){let{locale:t}=He(),r=t+(e?Object.entries(e).sort((o,i)=>o[0]<i[0]?-1:1).join():"");if($.has(r))return $.get(r);let n=new Intl.Collator(t,e);return $.set(r,n),n}var le=h.createContext(null),Y="react-aria-focus-scope-restore",p=null;function Ge(e){let{children:t,contain:r,restoreFocus:n,autoFocus:o}=e,i=(0,h.useRef)(null),l=(0,h.useRef)(null),a=(0,h.useRef)([]),{parentNode:d}=(0,h.useContext)(le)||{},c=(0,h.useMemo)(()=>new X({scopeRef:a}),[a]);R(()=>{let u=d||m.root;if(m.getTreeNode(u.scopeRef)&&p&&!V(p,u.scopeRef)){let N=m.getTreeNode(p);N&&(u=N)}u.addChild(c),m.addNode(c)},[c,d]),R(()=>{let u=m.getTreeNode(a);u&&(u.contain=!!r)},[r]),R(()=>{var P;let u=(P=i.current)==null?void 0:P.nextSibling,N=[],b=_=>_.stopPropagation();for(;u&&u!==l.current;)N.push(u),u.addEventListener(Y,b),u=u.nextSibling;return a.current=N,()=>{for(let _ of N)_.removeEventListener(Y,b)}},[t]),rt(a,n,r),Ze(a,r),nt(a,n,r),tt(a,o),(0,h.useEffect)(()=>{let u=w(v(a.current?a.current[0]:void 0)),N=null;if(T(u,a.current)){for(let b of m.traverse())b.scopeRef&&T(u,b.scopeRef.current)&&(N=b);N===m.getTreeNode(a)&&(p=N.scopeRef)}},[a]),R(()=>()=>{var N,b;let u=((b=(N=m.getTreeNode(a))==null?void 0:N.parent)==null?void 0:b.scopeRef)??null;(a===p||V(a,p))&&(!u||m.getTreeNode(u))&&(p=u),m.removeTreeNode(a)},[a]);let s=(0,h.useMemo)(()=>Je(a),[]),f=(0,h.useMemo)(()=>({focusManager:s,parentNode:c}),[c,s]);return h.createElement(le.Provider,{value:f},h.createElement("span",{"data-focus-scope-start":!0,hidden:!0,ref:i}),t,h.createElement("span",{"data-focus-scope-end":!0,hidden:!0,ref:l}))}function Je(e){return{focusNext(t={}){let r=e.current,{from:n,tabbable:o,wrap:i,accept:l}=t,a=n||w(v(r[0]??void 0)),d=r[0].previousElementSibling,c=g(y(r),{tabbable:o,accept:l},r);c.currentNode=T(a,r)?a:d;let s=c.nextNode();return!s&&i&&(c.currentNode=d,s=c.nextNode()),s&&E(s,!0),s},focusPrevious(t={}){let r=e.current,{from:n,tabbable:o,wrap:i,accept:l}=t,a=n||w(v(r[0]??void 0)),d=r[r.length-1].nextElementSibling,c=g(y(r),{tabbable:o,accept:l},r);c.currentNode=T(a,r)?a:d;let s=c.previousNode();return!s&&i&&(c.currentNode=d,s=c.previousNode()),s&&E(s,!0),s},focusFirst(t={}){let r=e.current,{tabbable:n,accept:o}=t,i=g(y(r),{tabbable:n,accept:o},r);i.currentNode=r[0].previousElementSibling;let l=i.nextNode();return l&&E(l,!0),l},focusLast(t={}){let r=e.current,{tabbable:n,accept:o}=t,i=g(y(r),{tabbable:n,accept:o},r);i.currentNode=r[r.length-1].nextElementSibling;let l=i.previousNode();return l&&E(l,!0),l}}}function y(e){return e[0].parentElement}function I(e){let t=m.getTreeNode(p);for(;t&&t.scopeRef!==e;){if(t.contain)return!1;t=t.parent}return!0}function Xe(e){if(!e.form)return Array.from(v(e).querySelectorAll(`input[type="radio"][name="${CSS.escape(e.name)}"]`)).filter(n=>!n.form);let t=e.form.elements.namedItem(e.name),r=Me(e);return t instanceof r.RadioNodeList?Array.from(t).filter(n=>n instanceof r.HTMLInputElement):t instanceof r.HTMLInputElement?[t]:[]}function Qe(e){if(e.checked)return!0;let t=Xe(e);return t.length>0&&!t.some(r=>r.checked)}function Ze(e,t){let r=(0,h.useRef)(void 0),n=(0,h.useRef)(void 0);R(()=>{let o=e.current;if(!t){n.current&&(n.current=(cancelAnimationFrame(n.current),void 0));return}let i=v(o?o[0]:void 0),l=c=>{if(c.key!=="Tab"||c.altKey||c.ctrlKey||c.metaKey||!I(e)||c.isComposing)return;let s=w(i),f=e.current;if(!f||!T(s,f))return;let u=g(y(f),{tabbable:!0},f);if(!s)return;u.currentNode=s;let N=c.shiftKey?u.previousNode():u.nextNode();N||(N=(u.currentNode=c.shiftKey?f[f.length-1].nextElementSibling:f[0].previousElementSibling,c.shiftKey?u.previousNode():u.nextNode())),c.preventDefault(),N&&E(N,!0)},a=c=>{(!p||V(p,e))&&T(S(c),e.current)?(p=e,r.current=S(c)):I(e)&&!C(S(c),e)?r.current?r.current.focus():p&&p.current&&G(p.current):I(e)&&(r.current=S(c))},d=c=>{n.current&&cancelAnimationFrame(n.current),n.current=requestAnimationFrame(()=>{let s=_e(),f=(s==="virtual"||s===null)&&Fe()&&ne(),u=w(i);if(!f&&u&&I(e)&&!C(u,e)){p=e;let b=S(c);if(b&&b.isConnected){var N;r.current=b,(N=r.current)==null||N.focus()}else p.current&&G(p.current)}})};return i.addEventListener("keydown",l,!1),i.addEventListener("focusin",a,!1),o==null||o.forEach(c=>c.addEventListener("focusin",a,!1)),o==null||o.forEach(c=>c.addEventListener("focusout",d,!1)),()=>{i.removeEventListener("keydown",l,!1),i.removeEventListener("focusin",a,!1),o==null||o.forEach(c=>c.removeEventListener("focusin",a,!1)),o==null||o.forEach(c=>c.removeEventListener("focusout",d,!1))}},[e,t]),R(()=>()=>{n.current&&cancelAnimationFrame(n.current)},[n])}function ce(e){return C(e)}function T(e,t){return!e||!t?!1:t.some(r=>k(r,e))}function C(e,t=null){if(e instanceof Element&&e.closest("[data-react-aria-top-layer]"))return!0;for(let{scopeRef:r}of m.traverse(m.getTreeNode(t)))if(r&&T(e,r.current))return!0;return!1}function et(e){return C(e,p)}function V(e,t){var n;let r=(n=m.getTreeNode(t))==null?void 0:n.parent;for(;r;){if(r.scopeRef===e)return!0;r=r.parent}return!1}function E(e,t=!1){if(e!=null&&!t)try{Se(e)}catch{}else if(e!=null)try{e.focus()}catch{}}function se(e,t=!0){let r=e[0].previousElementSibling,n=y(e),o=g(n,{tabbable:t},e);o.currentNode=r;let i=o.nextNode();return t&&!i&&(n=y(e),o=g(n,{tabbable:!1},e),o.currentNode=r,i=o.nextNode()),i}function G(e,t=!0){E(se(e,t))}function tt(e,t){let r=h.useRef(t);(0,h.useEffect)(()=>{r.current&&(p=e,!T(w(v(e.current?e.current[0]:void 0)),p.current)&&e.current&&G(e.current)),r.current=!1},[e])}function rt(e,t,r){R(()=>{if(t||r)return;let n=e.current,o=v(n?n[0]:void 0),i=l=>{let a=S(l);T(a,e.current)?p=e:ce(a)||(p=null)};return o.addEventListener("focusin",i,!1),n==null||n.forEach(l=>l.addEventListener("focusin",i,!1)),()=>{o.removeEventListener("focusin",i,!1),n==null||n.forEach(l=>l.removeEventListener("focusin",i,!1))}},[e,t,r])}function ae(e){let t=m.getTreeNode(p);for(;t&&t.scopeRef!==e;){if(t.nodeToRestore)return!1;t=t.parent}return(t==null?void 0:t.scopeRef)===e}function nt(e,t,r){let n=(0,h.useRef)(typeof document<"u"?w(v(e.current?e.current[0]:void 0)):null);R(()=>{let o=e.current,i=v(o?o[0]:void 0);if(!t||r)return;let l=()=>{(!p||V(p,e))&&T(w(i),e.current)&&(p=e)};return i.addEventListener("focusin",l,!1),o==null||o.forEach(a=>a.addEventListener("focusin",l,!1)),()=>{i.removeEventListener("focusin",l,!1),o==null||o.forEach(a=>a.removeEventListener("focusin",l,!1))}},[e,r]),R(()=>{let o=v(e.current?e.current[0]:void 0);if(!t)return;let i=l=>{if(l.key!=="Tab"||l.altKey||l.ctrlKey||l.metaKey||!I(e)||l.isComposing)return;let a=o.activeElement;if(!C(a,e)||!ae(e))return;let d=m.getTreeNode(e);if(!d)return;let c=d.nodeToRestore,s=g(o.body,{tabbable:!0});s.currentNode=a;let f=l.shiftKey?s.previousNode():s.nextNode();if((!c||!c.isConnected||c===o.body)&&(c=void 0,d.nodeToRestore=void 0),(!f||!C(f,e))&&c){s.currentNode=c;do f=l.shiftKey?s.previousNode():s.nextNode();while(C(f,e));l.preventDefault(),l.stopPropagation(),f?E(f,!0):ce(c)?E(c,!0):a.blur()}};return r||o.addEventListener("keydown",i,!0),()=>{r||o.removeEventListener("keydown",i,!0)}},[e,t,r]),R(()=>{let o=v(e.current?e.current[0]:void 0);if(!t)return;let i=m.getTreeNode(e);if(i)return i.nodeToRestore=n.current??void 0,()=>{let l=m.getTreeNode(e);if(!l)return;let a=l.nodeToRestore,d=w(o);if(t&&a&&(d&&C(d,e)||d===o.body&&ae(e))){let c=m.clone();requestAnimationFrame(()=>{if(o.activeElement===o.body){let s=c.getTreeNode(e);for(;s;){if(s.nodeToRestore&&s.nodeToRestore.isConnected){ue(s.nodeToRestore);return}s=s.parent}for(s=c.getTreeNode(e);s;){if(s.scopeRef&&s.scopeRef.current&&m.getTreeNode(s.scopeRef)){ue(se(s.scopeRef.current,!0));return}s=s.parent}}})}}},[e,t])}function ue(e){e.dispatchEvent(new CustomEvent(Y,{bubbles:!0,cancelable:!0}))&&E(e)}function g(e,t,r){let n=t!=null&&t.tabbable?We:Ie,o=v((e==null?void 0:e.nodeType)===Node.ELEMENT_NODE?e:null),i=oe(o,e||o,NodeFilter.SHOW_ELEMENT,{acceptNode(l){return k(t==null?void 0:t.from,l)||t!=null&&t.tabbable&&l.tagName==="INPUT"&&l.getAttribute("type")==="radio"&&(!Qe(l)||i.currentNode.tagName==="INPUT"&&i.currentNode.type==="radio"&&i.currentNode.name===l.name)?NodeFilter.FILTER_REJECT:n(l)&&(!r||T(l,r))&&(!(t!=null&&t.accept)||t.accept(l))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t!=null&&t.from&&(i.currentNode=t.from),i}function ot(e,t={}){return{focusNext(r={}){let n=e.current;if(!n)return null;let{from:o,tabbable:i=t.tabbable,wrap:l=t.wrap,accept:a=t.accept}=r,d=o||w(v(n)),c=g(n,{tabbable:i,accept:a});k(n,d)&&(c.currentNode=d);let s=c.nextNode();return!s&&l&&(c.currentNode=n,s=c.nextNode()),s&&E(s,!0),s},focusPrevious(r=t){let n=e.current;if(!n)return null;let{from:o,tabbable:i=t.tabbable,wrap:l=t.wrap,accept:a=t.accept}=r,d=o||w(v(n)),c=g(n,{tabbable:i,accept:a});if(k(n,d))c.currentNode=d;else{let f=J(c);return f&&E(f,!0),f??null}let s=c.previousNode();if(!s&&l){c.currentNode=n;let f=J(c);if(!f)return null;s=f}return s&&E(s,!0),s??null},focusFirst(r=t){let n=e.current;if(!n)return null;let{tabbable:o=t.tabbable,accept:i=t.accept}=r,l=g(n,{tabbable:o,accept:i}).nextNode();return l&&E(l,!0),l},focusLast(r=t){let n=e.current;if(!n)return null;let{tabbable:o=t.tabbable,accept:i=t.accept}=r,l=J(g(n,{tabbable:o,accept:i}));return l&&E(l,!0),l??null}}}function J(e){let t,r;do r=e.lastChild(),r&&(t=r);while(r);return t}var it=class he{get size(){return this.fastMap.size}getTreeNode(t){return this.fastMap.get(t)}addTreeNode(t,r,n){let o=this.fastMap.get(r??null);if(!o)return;let i=new X({scopeRef:t});o.addChild(i),i.parent=o,this.fastMap.set(t,i),n&&(i.nodeToRestore=n)}addNode(t){this.fastMap.set(t.scopeRef,t)}removeTreeNode(t){if(t===null)return;let r=this.fastMap.get(t);if(!r)return;let n=r.parent;for(let i of this.traverse())i!==r&&r.nodeToRestore&&i.nodeToRestore&&r.scopeRef&&r.scopeRef.current&&T(i.nodeToRestore,r.scopeRef.current)&&(i.nodeToRestore=r.nodeToRestore);let o=r.children;n&&(n.removeChild(r),o.size>0&&o.forEach(i=>n&&n.addChild(i))),this.fastMap.delete(r.scopeRef)}*traverse(t=this.root){if(t.scopeRef!=null&&(yield t),t.children.size>0)for(let r of t.children)yield*this.traverse(r)}clone(){var r;let t=new he;for(let n of this.traverse())t.addTreeNode(n.scopeRef,((r=n.parent)==null?void 0:r.scopeRef)??null,n.nodeToRestore);return t}constructor(){this.fastMap=new Map,this.root=new X({scopeRef:null}),this.fastMap.set(null,this.root)}},X=class{addChild(e){this.children.add(e),e.parent=this}removeChild(e){this.children.delete(e),e.parent=void 0}constructor(e){this.children=new Set,this.contain=!1,this.scopeRef=e.scopeRef}},m=new it,de={border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"};function fe(e={}){let{style:t,isFocusable:r}=e,[n,o]=(0,h.useState)(!1),{focusWithinProps:i}=ke({isDisabled:!r,onFocusWithinChange:a=>o(a)}),l=(0,h.useMemo)(()=>n?t:t?{...de,...t}:de,[n]);return{visuallyHiddenProps:{...i,style:l}}}function lt(e){let{children:t,elementType:r="div",isFocusable:n,style:o,...i}=e,{visuallyHiddenProps:l}=fe(e);return h.createElement(r,Pe(i,l),t)}var ct=(0,h.createContext)(null);(0,h.createContext)(null),(0,h.createContext)(null),(0,h.createContext)(null),(0,h.createContext)(null);var st=(0,h.createContext)({}),at=(0,h.createContext)(null);(0,h.createContext)(null);export{z as _,fe as a,g as c,U as d,$e as f,Oe as g,Ve as h,lt as i,ot as l,je as m,at as n,et as o,Ue as p,st as r,Ge as s,ct as t,Ye as u,De as v,oe as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as x}from"./chunk-LvLJmgfZ.js";import{i as E,p as T,u as M}from"./useEvent-D91BmmQi.js";import{t as C}from"./react-Bj1aDYRI.js";import{Mi as S,Ni as f,Tn as H,at as j,kn as N,p as I,vt as L}from"./cells-
|
|
1
|
+
import{s as x}from"./chunk-LvLJmgfZ.js";import{i as E,p as T,u as M}from"./useEvent-D91BmmQi.js";import{t as C}from"./react-Bj1aDYRI.js";import{Mi as S,Ni as f,Tn as H,at as j,kn as N,p as I,vt as L}from"./cells-aqfX084m.js";import{t as g}from"./compiler-runtime-B3qBwwSJ.js";import{g as w}from"./useEventListener-C0195JsF.js";import{c as k}from"./utils-BWBBpCkT.js";import{t as V}from"./jsx-runtime-Blw4afVn.js";import{t as $}from"./tooltip-4bZlU7jl.js";import{t as A}from"./copy-icon-neDQUo4Q.js";import{t as F}from"./usePress-5hBv4sjD.js";import{n as O}from"./useDebounce-JDKr83KO.js";import{t as _}from"./useRunCells-BtSwerrU.js";var W=g(),m=x(C(),1),l=x(V(),1);const q=e=>{let t=(0,W.c)(16),r,n,i;t[0]===e?(r=t[1],n=t[2],i=t[3]):({href:n,children:r,...i}=e,t[0]=e,t[1]=r,t[2]=n,t[3]=i);let a=(0,m.useRef)(null),o;t[4]===n?o=t[5]:(o=()=>{let h=new URL(globalThis.location.href);h.hash=n,globalThis.history.pushState({},"",h.toString()),globalThis.dispatchEvent(new HashChangeEvent("hashchange"));let R=n.slice(1),v=document.getElementById(R);v&&v.scrollIntoView({behavior:"smooth",block:"start"})},t[4]=n,t[5]=o);let s=o,c;t[6]===s?c=t[7]:(c={onPress:()=>{s()}},t[6]=s,t[7]=c);let{pressProps:d}=F(c),u;t[8]===s?u=t[9]:(u=h=>{h.preventDefault(),s()},t[8]=s,t[9]=u);let b=u,p;return t[10]!==r||t[11]!==b||t[12]!==n||t[13]!==d||t[14]!==i?(p=(0,l.jsx)("a",{ref:a,href:n,...d,onClick:b,...i,children:r}),t[10]=r,t[11]=b,t[12]=n,t[13]=d,t[14]=i,t[15]=p):p=t[15],p};async function z(e){let t=I().inOrderIds.at(0);if(t)try{let r=await H.request({document:e,cellId:t});if(!r||r.options.length===0)return;let n=e.split(".").pop()??e,i=r.options[0],a=r.options.find(o=>o.name===n)??i;a!=null&&a.completion_info&&E.set(N,{documentation:a.completion_info})}catch(r){w.debug(`Doc lookup failed for "${e}"`,r)}}var P=g();const D=e=>{let t=(0,P.c)(8),{qualifiedName:r,children:n}=e,i;t[0]===r?i=t[1]:(i=()=>{z(r)},t[0]=r,t[1]=i);let a=O(i,100),o;t[2]===a?o=t[3]:(o=()=>a.cancel(),t[2]=a,t[3]=o);let s;return t[4]!==n||t[5]!==a||t[6]!==o?(s=(0,l.jsx)("span",{onMouseEnter:a,onMouseLeave:o,children:n}),t[4]=n,t[5]=a,t[6]=o,t[7]=s):s=t[7],s};function B(e){if(typeof e!="object"||!e)return!1;let t=e;return!(t.trusted!==!0||t.notebookCode!==void 0&&typeof t.notebookCode!="string")}function U(){let e=window==null?void 0:window.__MARIMO_EXPORT_CONTEXT__;return B(e)?e:void 0}function y(){var e;return((e=U())==null?void 0:e.trusted)===!0}function X(){if(E.get(_)||y()||E.get(k))return!0;try{if(j()==="read")return!0}catch{}return!1}var G=T(e=>{let t=e(_),r=e(k);if(t||r||y())return!1;let n=!0;try{n=j()==="read"}catch{return!0}return!n});function J(){return M(G)}var K=g(),Y=e=>{if(e instanceof f.Element&&!/^[A-Za-z][\w-]*$/.test(e.name))return m.createElement(m.Fragment)},Z=(e,t)=>{if(t instanceof f.Element&&t.name==="body"){if((0,m.isValidElement)(e)&&"props"in e){let r=e.props.children;return(0,l.jsx)(l.Fragment,{children:r})}return}},Q=(e,t)=>{if(t instanceof f.Element&&t.name==="html"){if((0,m.isValidElement)(e)&&"props"in e){let r=e.props.children;return(0,l.jsx)(l.Fragment,{children:r})}return}},tt=e=>{if(e instanceof f.Element&&e.attribs&&e.name==="iframe"){let t=document.createElement("iframe");return Object.entries(e.attribs).forEach(([r,n])=>{r.startsWith('"')&&r.endsWith('"')&&(r=r.slice(1,-1)),t.setAttribute(r,n)}),(0,l.jsx)("div",{dangerouslySetInnerHTML:{__html:t.outerHTML}})}},et=e=>{if(e instanceof f.Element&&e.name==="script"){let t=e.attribs.src;if(!t)return;if(!X())return w.warn(`[RenderHTML] refusing <script src> in untrusted context: ${t}`),(0,l.jsx)(l.Fragment,{});if(![...document.querySelectorAll("script[src]")].some(r=>r.getAttribute("src")===t)){let r=document.createElement("script");r.src=t,document.head.append(r)}return(0,l.jsx)(l.Fragment,{})}},rt=(e,t)=>{if(t instanceof f.Element&&t.name==="a"){let r=t.attribs.href;if(r!=null&&r.startsWith("#")&&!r.startsWith("#code/")){let n=null;return(0,m.isValidElement)(e)&&"props"in e&&(n=e.props.children),(0,l.jsx)(q,{href:r,...t.attribs,children:n})}}},nt=(e,t,r)=>{var n,i;if(t instanceof f.Element&&t.name==="div"&&((i=(n=t.attribs)==null?void 0:n.class)!=null&&i.includes("codehilite")))return(0,l.jsx)(lt,{children:e},r)},it=(e,t,r)=>{var i;if(!(t instanceof f.Element)||t.name!=="img")return;let n=(i=t.attribs)==null?void 0:i.src;if(!(!n||!(0,m.isValidElement)(e))&&!/^data:/i.test(n))return(0,m.cloneElement)(e,{key:`${n}-${r}`})},at=(e,t,r)=>{var n;if(!(!(t instanceof f.Element)||t.name!=="input")&&((n=t.attribs)==null?void 0:n.type)==="checkbox"&&(0,m.isValidElement)(e))return(0,m.cloneElement)(e,{key:`checkbox-${r}-${"checked"in t.attribs}`})},ot=(e,t)=>{var r;if(t instanceof f.Element&&((r=t.attribs)!=null&&r["data-marimo-doc"])){let n=t.attribs["data-marimo-doc"];return(0,l.jsx)(D,{qualifiedName:n,children:e})}},st=(e,t)=>{var r,n;if(t instanceof f.Element&&((r=t.attribs)!=null&&r["data-tooltip"])){if((((n=t.name)==null?void 0:n.toLowerCase())??"").startsWith("marimo-"))return;let i=t.attribs["data-tooltip"];return(0,l.jsx)($,{content:i,children:e})}},lt=e=>{let t=(0,K.c)(3),{children:r}=e,n=(0,m.useRef)(null),i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=(0,l.jsx)("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",children:(0,l.jsx)(A,{tooltip:!1,className:"p-1",value:()=>{var s;let o=(s=n.current)==null?void 0:s.firstChild;return o&&o.textContent||""}})}),t[0]=i):i=t[0];let a;return t[1]===r?a=t[2]:(a=(0,l.jsxs)("div",{className:"relative group codehilite-wrapper",ref:n,children:[r,i]}),t[1]=r,t[2]=a),a};const ct=({html:e,additionalReplacements:t=[],alwaysSanitizeHtml:r=!0})=>(0,l.jsx)(mt,{html:e,alwaysSanitizeHtml:r,additionalReplacements:t});var mt=({html:e,additionalReplacements:t=[],alwaysSanitizeHtml:r})=>{let n=J();return ft({html:(0,m.useMemo)(()=>r||n?L(e):e,[e,r,n]),additionalReplacements:t})};function ft({html:e,additionalReplacements:t=[]}){let r=[Y,tt,et,...t],n=[nt,rt,ot,st,Z,Q],i=[it,at];return S(e,{replace:(a,o)=>{for(let s of r){let c=s(a,o);if(c)return c}return a},transform:(a,o,s)=>{let c=a;for(let d of n){let u=d(c,o,s);if(u){c=u;break}}for(let d of i){let u=d(c,o,s);u&&(c=u)}return c}})}export{y as n,ct as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as S}from"./chunk-LvLJmgfZ.js";import{t as D}from"./react-Bj1aDYRI.js";import{t as x}from"./compiler-runtime-B3qBwwSJ.js";import{_ as M}from"./useEventListener-
|
|
1
|
+
import{s as S}from"./chunk-LvLJmgfZ.js";import{t as D}from"./react-Bj1aDYRI.js";import{t as x}from"./compiler-runtime-B3qBwwSJ.js";import{_ as M}from"./useEventListener-C0195JsF.js";import{h as w,u as q}from"./config-CR3KxW53.js";import{n as E,t as T}from"./cn-DYvqRARy.js";import{t as F}from"./jsx-runtime-Blw4afVn.js";import{t as O}from"./tooltip-4bZlU7jl.js";import{r as W}from"./button-DDGiD1NW.js";import{r as L}from"./requests-9-v2bhoi.js";import{t as V}from"./createLucideIcon-w-Qo9n0R.js";import{i as N}from"./useDeleteCell-DQP-NBq2.js";import{C as B,O as I,ut as P,w as K}from"./input-JxFwu-3G.js";import{t as U}from"./square-DFICx2Qv.js";import{N as H,P as C,V as G,j as _,k as J}from"./usePress-5hBv4sjD.js";import{l as Q}from"./RSPContexts-WiCgGm__.js";import{t as X}from"./context-BFPaAUK_.js";import{a as z}from"./renderShortcut-Bl8_FVn8.js";var Y=V("hard-drive-download",[["path",{d:"M12 2v8",key:"1q4o3n"}],["path",{d:"m16 6-4 4-4-4",key:"6wukr"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",key:"w68u3i"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M10 18h.01",key:"h775k"}]]),y=S(D(),1);function Z(n,e){let{"aria-label":t,"aria-labelledby":a,orientation:r="horizontal"}=n,[o,c]=(0,y.useState)(!1);G(()=>{var i;c(!!(e.current&&((i=e.current.parentElement)!=null&&i.closest('[role="toolbar"]'))))});let{direction:u}=X(),m=u==="rtl"&&r==="horizontal",f=Q(e),l=i=>{if(_(i.currentTarget,C(i))){if(r==="horizontal"&&i.key==="ArrowRight"||r==="vertical"&&i.key==="ArrowDown")m?f.focusPrevious():f.focusNext();else if(r==="horizontal"&&i.key==="ArrowLeft"||r==="vertical"&&i.key==="ArrowUp")m?f.focusNext():f.focusPrevious();else if(i.key==="Tab"){i.stopPropagation(),s.current=H(),i.shiftKey?f.focusFirst():f.focusLast();return}else return;i.stopPropagation(),i.preventDefault()}},s=(0,y.useRef)(null),b=i=>{!_(i.currentTarget,i.relatedTarget)&&!s.current&&(s.current=C(i))},p=i=>{if(s.current&&!_(i.currentTarget,i.relatedTarget)&&_(e.current,C(i))){var h;(h=s.current)==null||h.focus(),s.current=null}};return{toolbarProps:{...P(n,{labelable:!0}),role:o?"group":"toolbar","aria-orientation":r,"aria-label":t,"aria-labelledby":t==null?a:void 0,onKeyDownCapture:o?void 0:l,onFocusCapture:o?void 0:p,onBlurCapture:o?void 0:b}}}var $=(0,y.createContext)({}),ee=(0,y.forwardRef)(function(n,e){[n,e]=B(n,e,$);let{toolbarProps:t}=Z(n,e),a=K({...n,values:{orientation:n.orientation||"horizontal"},defaultClassName:"react-aria-Toolbar"}),r=P(n,{global:!0});return delete r.id,y.createElement(I.div,{...J(r,a,t),ref:e,slot:n.slot||void 0,"data-orientation":n.orientation||"horizontal"},a.children)}),te=x(),re=200;function R(n){let e=(0,te.c)(3),[t,a]=(0,y.useState)(!1),r,o;return e[0]===n?(r=e[1],o=e[2]):(r=()=>{if(!n)return;a(!1);let c=setTimeout(()=>{a(!0)},re);return()=>clearTimeout(c)},o=[n],e[0]=n,e[1]=r,e[2]=o),(0,y.useEffect)(r,o),n&&t}var A=x(),g=S(F(),1),oe=E("rounded-full shadow-xs-solid border p-[5px] transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 [&>svg]:size-3 active:shadow-none bg-background",{variants:{variant:{default:"hover:bg-accent hover:text-accent-foreground",stale:"bg-(--yellow-3) hover:bg-(--yellow-4) text-(--yellow-11)",green:"hover:bg-(--grass-2) hover:text-(--grass-11) hover:border-[var(--grass-7)],",disabled:"opacity-50 cursor-not-allowed",danger:"hover:bg-(--red-3) hover:text-(--red-11)"}},defaultVariants:{variant:"default"}});const k=n=>{let e=(0,A.c)(18),t,a,r,o,c,u,m;if(e[0]!==n){let{children:s,tooltip:b,disabled:p,variant:i,...h}=n;t=s,m=b;let d=p===void 0?!1:p;a=d,r=h,o=v=>{var j;d||((j=h.onClick)==null||j.call(h,v))},c=W.preventFocus,u=T(oe({variant:i}),h.className),e[0]=n,e[1]=t,e[2]=a,e[3]=r,e[4]=o,e[5]=c,e[6]=u,e[7]=m}else t=e[1],a=e[2],r=e[3],o=e[4],c=e[5],u=e[6],m=e[7];let f;e[8]!==t||e[9]!==a||e[10]!==r||e[11]!==o||e[12]!==c||e[13]!==u?(f=(0,g.jsx)("button",{disabled:a,...r,onClick:o,onMouseDown:c,className:u,children:t}),e[8]=t,e[9]=a,e[10]=r,e[11]=o,e[12]=c,e[13]=u,e[14]=f):f=e[14];let l=f;if(m){let s;return e[15]!==l||e[16]!==m?(s=(0,g.jsx)(O,{content:m,side:"top",delayDuration:200,usePortal:!1,children:l}),e[15]=l,e[16]=m,e[17]=s):s=e[17],s}return l},ae=n=>{let e=(0,A.c)(5),{children:t,className:a}=n,r;e[0]===a?r=e[1]:(r=T("flex items-center gap-1 bg-background m-[2px] rounded-full",a),e[0]=a,e[1]=r);let o;return e[2]!==t||e[3]!==r?(o=(0,g.jsx)(ee,{className:r,children:t}),e[2]=t,e[3]=r,e[4]=o):o=e[4],o};var ne=x();const ie=n=>{let e=(0,ne.c)(9),{connectionState:t,status:a}=n,{sendInterrupt:r}=L(),o=R(a==="running"),c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=z("global.interrupt"),e[0]=c):c=e[0];let u;e[1]!==t||e[2]!==o?(u=w(t)||!o,e[1]=t,e[2]=o,e[3]=u):u=e[3];let m=o?r:M.NOOP,f=o?"stale":"disabled",l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=(0,g.jsx)(U,{strokeWidth:1.5}),e[4]=l):l=e[4];let s;return e[5]!==u||e[6]!==m||e[7]!==f?(s=(0,g.jsx)(k,{tooltip:c,disabled:u,onClick:m,variant:f,"data-testid":"run-button",children:l}),e[5]=u,e[6]=m,e[7]=f,e[8]=s):s=e[8],s};var le=x();function se({connectionState:n,needsRun:e,loading:t,inactive:a}){return w(n)?"disabled":e&&!t?"stale":t||a?"disabled":"green"}const de=n=>{let e=(0,le.c)(27),{onClick:t,connectionState:a,needsRun:r,status:o,config:c,edited:u}=n,m=o==="disabled-transitively",f=o==="running"||o==="queued",l,s;e[0]!==m||e[1]!==c.disabled||e[2]!==a||e[3]!==u||e[4]!==f||e[5]!==r?(l=w(a)||f||!c.disabled&&m&&!u,s=se({connectionState:a,needsRun:r,loading:f,inactive:l}),e[0]=m,e[1]=c.disabled,e[2]=a,e[3]=u,e[4]=f,e[5]=r,e[6]=l,e[7]=s):(l=e[6],s=e[7]);let b=s;if(c.disabled){let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=(0,g.jsx)(Y,{}),e[8]=d):d=e[8];let v;return e[9]!==l||e[10]!==t||e[11]!==b?(v=(0,g.jsx)(k,{tooltip:"Add code to notebook",disabled:l,onClick:t,variant:b,"data-testid":"run-button",children:d}),e[9]=l,e[10]=t,e[11]=b,e[12]=v):v=e[12],v}if(!c.disabled&&m&&!u){let d;e[13]===Symbol.for("react.memo_cache_sentinel")?(d=(0,g.jsx)(N,{strokeWidth:1.2}),e[13]=d):d=e[13];let v;return e[14]!==l||e[15]!==t||e[16]!==b?(v=(0,g.jsx)(k,{disabled:l,tooltip:"This cell can't be run because it has a disabled ancestor",onClick:t,variant:b,"data-testid":"run-button",children:d}),e[14]=l,e[15]=t,e[16]=b,e[17]=v):v=e[17],v}let p;if(w(a)){let d;e[18]===a?d=e[19]:(d=q(a),e[18]=a,e[19]=d),p=d}else if(o==="queued")p="This cell is already queued to run";else if(o==="running")p="This cell is already running.";else{let d;e[20]===Symbol.for("react.memo_cache_sentinel")?(d=z("cell.run"),e[20]=d):d=e[20],p=d}let i;e[21]===Symbol.for("react.memo_cache_sentinel")?(i=(0,g.jsx)(N,{strokeWidth:1.2}),e[21]=i):i=e[21];let h;return e[22]!==l||e[23]!==t||e[24]!==p||e[25]!==b?(h=(0,g.jsx)(k,{tooltip:p,disabled:l,onClick:t,variant:b,"data-testid":"run-button",children:i}),e[22]=l,e[23]=t,e[24]=p,e[25]=b,e[26]=h):h=e[26],h};export{R as a,k as i,ie as n,ae as r,de as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var fi=Object.defineProperty;var gi=(t,e,a)=>e in t?fi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a;var D=(t,e,a)=>gi(t,typeof e!="symbol"?e+"":e,a);import{s as Ca,t as yi}from"./chunk-LvLJmgfZ.js";import{f as Dr,i as Zr,l as vi,n as St,o as xi,u as Fr}from"./useEvent-D91BmmQi.js";import{t as bi}from"./react-Bj1aDYRI.js";import{$i as _i,Cr as wi,E as zr,Fr as ki,Hn as Ci,Ki as Ii,Kt as Ur,Lr as Ti,Nt as Ei,Qi as qr,Qt as Si,Ri as Ai,Rr as Vr,Tr as Oi,Wi as Ri,bt as Ia,d as Ni,hi as Mi,nt as Wr,sr as ji,xi as Pi,y as qe,zn as $i}from"./cells-
|
|
1
|
+
var fi=Object.defineProperty;var gi=(t,e,a)=>e in t?fi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a;var D=(t,e,a)=>gi(t,typeof e!="symbol"?e+"":e,a);import{s as Ca,t as yi}from"./chunk-LvLJmgfZ.js";import{f as Dr,i as Zr,l as vi,n as St,o as xi,u as Fr}from"./useEvent-D91BmmQi.js";import{t as bi}from"./react-Bj1aDYRI.js";import{$i as _i,Cr as wi,E as zr,Fr as ki,Hn as Ci,Ki as Ii,Kt as Ur,Lr as Ti,Nt as Ei,Qi as qr,Qt as Si,Ri as Ai,Rr as Vr,Tr as Oi,Wi as Ri,bt as Ia,d as Ni,hi as Mi,nt as Wr,sr as ji,xi as Pi,y as qe,zn as $i}from"./cells-aqfX084m.js";import{B as pe,D as Li,E as Br,H as Di,I as at,J as Kr,L as G,M as V,N as Jr,O as Zi,P as O,R as m,S as Fi,T as U,V as K,W as Yr,b as rt,k as w,w as we,x as Bt}from"./zod-H_cgTO0M.js";import{t as At}from"./compiler-runtime-B3qBwwSJ.js";import{T as zi,t as Ui}from"./ai-model-dropdown-C7iiWBqP.js";import{f as qi,g as oe}from"./useEventListener-C0195JsF.js";import{n as Vi}from"./utils-BWBBpCkT.js";import{o as Wi}from"./config-CR3KxW53.js";import{t as Ta}from"./cn-DYvqRARy.js";import{t as Bi}from"./jsx-runtime-Blw4afVn.js";import{d as Ki}from"./popover-Bcz1Zikb.js";import{a as Hr,c as Ji,p as Yi,r as Hi,t as Gi}from"./dropdown-menu-dHmZR8bI.js";import{t as Kt}from"./tooltip-4bZlU7jl.js";import{t as Ve}from"./button-DDGiD1NW.js";import{Gt as Qi,Qt as Jt,Tt as Yt,Wt as Xi,Zt as Ht,at as Ea,dt as Gr,en as eo,qt as Qr,st as Xr,ut as es,wt as to}from"./dist-12S8I4CH.js";import{t as ao}from"./createReducer-DGx5Af-C.js";import{h as ro,n as so,o as no,r as io}from"./dist-DYEuVkEX.js";import{i as oo}from"./strings--BknHX9C.js";import{r as lo,t as uo}from"./requests-9-v2bhoi.js";import{t as Sa}from"./createLucideIcon-w-Qo9n0R.js";import{r as co,t as po}from"./fileToBase64-C2Yy-YXq.js";import{t as ts}from"./x-C-Eq0ag8.js";import{a as mo,f as ho,n as as}from"./markdown-renderer-Cs1sISb9.js";import{t as rs}from"./file-CJH9JNGH.js";import{t as fo}from"./image-5XI2VU-q.js";import{t as go}from"./spinner-D-V4psAa.js";import{i as yo,t as vo}from"./useDeleteCell-DQP-NBq2.js";import{r as xo}from"./input-JxFwu-3G.js";import{t as bo}from"./sparkles-DUCpRFlS.js";import{a as st,c as _o,i as gt,n as wo,o as Ot,s as Rt,t as ko}from"./datasource-wn1PTlXA.js";import{a as Co}from"./dist-DcwTQG1A.js";import{t as Io}from"./uuid-ImXS-885.js";import{t as Aa}from"./use-toast-BwJoaaDM.js";import{a as To}from"./session-BmukRjSi.js";import{r as Eo}from"./useTheme-Bxv9B31g.js";import{n as So}from"./useRunCells-BtSwerrU.js";import{t as Ao}from"./blob-C3EfaMOb.js";import{a as Oo}from"./errors-PgHhDa-M.js";import{i as Oa}from"./cell-link-C0hhYyNu.js";import{r as Ro,t as No}from"./html-to-image-B-nAUvDC.js";import{n as Ra}from"./renderShortcut-Bl8_FVn8.js";import{n as Mo}from"./icons-CIPE8AIY.js";import{r as jo,t as Po}from"./esm-B30N1GS0.js";import{t as $o}from"./process-output-BFSCpqNt.js";import{i as Lo,r as Do,t as Zo}from"./error-entries-NXVkubuN.js";var ss=Sa("circle-stop",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]]),ns=Sa("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]),is=Sa("send-horizontal",[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]]),os="vercel.ai.error",Fo=Symbol.for(os),ls,ds,xe=class ii extends(ds=Error,ls=Fo,ds){constructor({name:e,message:a,cause:r}){super(a),this[ls]=!0,this.name=e,this.cause=r}static isInstance(e){return ii.hasMarker(e,os)}static hasMarker(e,a){let r=Symbol.for(a);return typeof e=="object"&&!!e&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function us(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var cs="AI_InvalidArgumentError",ps=`vercel.ai.error.${cs}`,zo=Symbol.for(ps),ms,hs,Uo=class extends(hs=xe,ms=zo,hs){constructor({message:t,cause:e,argument:a}){super({name:cs,message:t,cause:e}),this[ms]=!0,this.argument=a}static isInstance(t){return xe.hasMarker(t,ps)}},fs="AI_JSONParseError",gs=`vercel.ai.error.${fs}`,qo=Symbol.for(gs),ys,vs,xs=class extends(vs=xe,ys=qo,vs){constructor({text:t,cause:e}){super({name:fs,message:`JSON parsing failed: Text: ${t}.
|
|
2
2
|
Error message: ${us(e)}`,cause:e}),this[ys]=!0,this.text=t}static isInstance(t){return xe.hasMarker(t,gs)}},bs="AI_TypeValidationError",_s=`vercel.ai.error.${bs}`,Vo=Symbol.for(_s),ws,ks,We=class Sr extends(ks=xe,ws=Vo,ks){constructor({value:e,cause:a,context:r}){let s="Type validation failed";if(r!=null&&r.field&&(s+=` for ${r.field}`),(r==null?void 0:r.entityName)||(r==null?void 0:r.entityId)){s+=" (";let n=[];r.entityName&&n.push(r.entityName),r.entityId&&n.push(`id: "${r.entityId}"`),s+=n.join(", "),s+=")"}super({name:bs,message:`${s}: Value: ${JSON.stringify(e)}.
|
|
3
3
|
Error message: ${us(a)}`,cause:a}),this[ws]=!0,this.value=e,this.context=r}static isInstance(e){return xe.hasMarker(e,_s)}static wrap({value:e,cause:a,context:r}){var s,n,o;return Sr.isInstance(a)&&a.value===e&&((s=a.context)==null?void 0:s.field)===(r==null?void 0:r.field)&&((n=a.context)==null?void 0:n.entityName)===(r==null?void 0:r.entityName)&&((o=a.context)==null?void 0:o.entityId)===(r==null?void 0:r.entityId)?a:new Sr({value:e,cause:a,context:r})}},W;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function a(s){throw Error()}t.assertNever=a,t.arrayToEnum=s=>{let n={};for(let o of s)n[o]=o;return n},t.getValidEnumValues=s=>{let n=t.objectKeys(s).filter(i=>typeof s[s[i]]!="number"),o={};for(let i of n)o[i]=s[i];return t.objectValues(o)},t.objectValues=s=>t.objectKeys(s).map(function(n){return s[n]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let n=[];for(let o in s)Object.prototype.hasOwnProperty.call(s,o)&&n.push(o);return n},t.find=(s,n)=>{for(let o of s)if(n(o))return o},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,n=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(n)}t.joinValues=r,t.jsonStringifyReplacer=(s,n)=>typeof n=="bigint"?n.toString():n})(W||(W={}));var Wo;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(Wo||(Wo={}));const E=W.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Be=t=>{switch(typeof t){case"undefined":return E.undefined;case"string":return E.string;case"number":return Number.isNaN(t)?E.nan:E.number;case"boolean":return E.boolean;case"function":return E.function;case"bigint":return E.bigint;case"symbol":return E.symbol;case"object":return Array.isArray(t)?E.array:t===null?E.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?E.promise:typeof Map<"u"&&t instanceof Map?E.map:typeof Set<"u"&&t instanceof Set?E.set:typeof Date<"u"&&t instanceof Date?E.date:E.object;default:return E.unknown}},x=W.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);var Oe=class oi extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}format(e){let a=e||function(n){return n.message},r={_errors:[]},s=n=>{for(let o of n.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)r._errors.push(a(o));else{let i=r,d=0;for(;d<o.path.length;){let l=o.path[d];d===o.path.length-1?(i[l]=i[l]||{_errors:[]},i[l]._errors.push(a(o))):i[l]=i[l]||{_errors:[]},i=i[l],d++}}};return s(this),r}static assert(e){if(!(e instanceof oi))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,W.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){let a=Object.create(null),r=[];for(let s of this.issues)if(s.path.length>0){let n=s.path[0];a[n]=a[n]||[],a[n].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:a}}get formErrors(){return this.flatten()}};Oe.create=t=>new Oe(t);var Nt=(t,e)=>{let a;switch(t.code){case x.invalid_type:a=t.received===E.undefined?"Required":`Expected ${t.expected}, received ${t.received}`;break;case x.invalid_literal:a=`Invalid literal value, expected ${JSON.stringify(t.expected,W.jsonStringifyReplacer)}`;break;case x.unrecognized_keys:a=`Unrecognized key(s) in object: ${W.joinValues(t.keys,", ")}`;break;case x.invalid_union:a="Invalid input";break;case x.invalid_union_discriminator:a=`Invalid discriminator value. Expected ${W.joinValues(t.options)}`;break;case x.invalid_enum_value:a=`Invalid enum value. Expected ${W.joinValues(t.options)}, received '${t.received}'`;break;case x.invalid_arguments:a="Invalid function arguments";break;case x.invalid_return_type:a="Invalid function return type";break;case x.invalid_date:a="Invalid date";break;case x.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(a=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(a=`${a} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?a=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?a=`Invalid input: must end with "${t.validation.endsWith}"`:W.assertNever(t.validation):a=t.validation==="regex"?"Invalid":`Invalid ${t.validation}`;break;case x.too_small:a=t.type==="array"?`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"||t.type==="bigint"?`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:"Invalid input";break;case x.too_big:a=t.type==="array"?`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:"Invalid input";break;case x.custom:a="Invalid input";break;case x.invalid_intersection_types:a="Intersection results could not be merged";break;case x.not_multiple_of:a=`Number must be a multiple of ${t.multipleOf}`;break;case x.not_finite:a="Number must be finite";break;default:a=e.defaultError,W.assertNever(t)}return{message:a}},Bo=Nt;function Na(){return Bo}const Ma=t=>{let{data:e,path:a,errorMaps:r,issueData:s}=t,n=[...a,...s.path||[]],o={...s,path:n};if(s.message!==void 0)return{...s,path:n,message:s.message};let i="",d=r.filter(l=>!!l).slice().reverse();for(let l of d)i=l(o,{data:e,defaultError:i}).message;return{...s,path:n,message:i}};function I(t,e){let a=Na(),r=Ma({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,a,a===Nt?void 0:Nt].filter(s=>!!s)});t.common.issues.push(r)}var ge=class li{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,a){let r=[];for(let s of a){if(s.status==="aborted")return L;s.status==="dirty"&&e.dirty(),r.push(s.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,a){let r=[];for(let s of a){let n=await s.key,o=await s.value;r.push({key:n,value:o})}return li.mergeObjectSync(e,r)}static mergeObjectSync(e,a){let r={};for(let s of a){let{key:n,value:o}=s;if(n.status==="aborted"||o.status==="aborted")return L;n.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),n.value!=="__proto__"&&(o.value!==void 0||s.alwaysSet)&&(r[n.value]=o.value)}return{status:e.value,value:r}}};const L=Object.freeze({status:"aborted"}),ja=t=>({status:"dirty",value:t}),fe=t=>({status:"valid",value:t}),Cs=t=>t.status==="aborted",Is=t=>t.status==="dirty",yt=t=>t.status==="valid",Gt=t=>typeof Promise<"u"&&t instanceof Promise;var M;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(M||(M={}));var Re=class{constructor(t,e,a,r){this._cachedPath=[],this.parent=t,this.data=e,this._path=a,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Ts=(t,e)=>{if(yt(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){return this._error||(this._error=new Oe(t.common.issues)),this._error}}};function F(t){if(!t)return{};let{errorMap:e,invalid_type_error:a,required_error:r,description:s}=t;if(e&&(a||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(n,o)=>{let{message:i}=t;return n.code==="invalid_enum_value"?{message:i??o.defaultError}:o.data===void 0?{message:i??r??o.defaultError}:n.code==="invalid_type"?{message:i??a??o.defaultError}:{message:o.defaultError}},description:s}}var z=class{get description(){return this._def.description}_getType(t){return Be(t.data)}_getOrReturnCtx(t,e){return e||{common:t.parent.common,data:t.data,parsedType:Be(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new ge,ctx:{common:t.parent.common,data:t.data,parsedType:Be(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let e=this._parse(t);if(Gt(e))throw Error("Synchronous parse encountered promise.");return e}_parseAsync(t){let e=this._parse(t);return Promise.resolve(e)}parse(t,e){let a=this.safeParse(t,e);if(a.success)return a.data;throw a.error}safeParse(t,e){let a={common:{issues:[],async:(e==null?void 0:e.async)??!1,contextualErrorMap:e==null?void 0:e.errorMap},path:(e==null?void 0:e.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Be(t)};return Ts(a,this._parseSync({data:t,path:a.path,parent:a}))}"~validate"(t){var a,r;let e={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Be(t)};if(!this["~standard"].async)try{let s=this._parseSync({data:t,path:[],parent:e});return yt(s)?{value:s.value}:{issues:e.common.issues}}catch(s){(r=(a=s==null?void 0:s.message)==null?void 0:a.toLowerCase())!=null&&r.includes("encountered")&&(this["~standard"].async=!0),e.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:e}).then(s=>yt(s)?{value:s.value}:{issues:e.common.issues})}async parseAsync(t,e){let a=await this.safeParseAsync(t,e);if(a.success)return a.data;throw a.error}async safeParseAsync(t,e){let a={common:{issues:[],contextualErrorMap:e==null?void 0:e.errorMap,async:!0},path:(e==null?void 0:e.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Be(t)},r=this._parse({data:t,path:a.path,parent:a});return Ts(a,await(Gt(r)?r:Promise.resolve(r)))}refine(t,e){let a=r=>typeof e=="string"||e===void 0?{message:e}:typeof e=="function"?e(r):e;return this._refinement((r,s)=>{let n=t(r),o=()=>s.addIssue({code:x.custom,...a(r)});return typeof Promise<"u"&&n instanceof Promise?n.then(i=>i?!0:(o(),!1)):n?!0:(o(),!1)})}refinement(t,e){return this._refinement((a,r)=>t(a)?!0:(r.addIssue(typeof e=="function"?e(a,r):e),!1))}_refinement(t){return new $e({schema:this,typeName:_.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return Le.create(this,this._def)}nullable(){return it.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return xt.create(this)}promise(){return Mt.create(this,this._def)}or(t){return ta.create([this,t],this._def)}and(t){return aa.create(this,t,this._def)}transform(t){return new $e({...F(this._def),schema:this,typeName:_.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let e=typeof t=="function"?t:()=>t;return new oa({...F(this._def),innerType:this,defaultValue:e,typeName:_.ZodDefault})}brand(){return new Rs({typeName:_.ZodBranded,type:this,...F(this._def)})}catch(t){let e=typeof t=="function"?t:()=>t;return new la({...F(this._def),innerType:this,catchValue:e,typeName:_.ZodCatch})}describe(t){let e=this.constructor;return new e({...this._def,description:t})}pipe(t){return Ns.create(this,t)}readonly(){return da.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Ko=/^c[^\s-]{8,}$/i,Jo=/^[0-9a-z]+$/,Yo=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Ho=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Go=/^[a-z0-9_-]{21}$/i,Qo=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Xo=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,el=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,tl="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Es,al=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,rl=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,sl=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,nl=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,il=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ol=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ss="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",ll=RegExp(`^${Ss}$`);function As(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision??(e=`${e}(\\.\\d+)?`);let a=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${a}`}function dl(t){return RegExp(`^${As(t)}$`)}function ul(t){let e=`${Ss}T${As(t)}`,a=[];return a.push(t.local?"Z?":"Z"),t.offset&&a.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${a.join("|")})`,RegExp(`^${e}$`)}function cl(t,e){return!!((e==="v4"||!e)&&al.test(t)||(e==="v6"||!e)&&sl.test(t))}function pl(t,e){if(!Qo.test(t))return!1;try{let[a]=t.split(".");if(!a)return!1;let r=a.replace(/-/g,"+").replace(/_/g,"/").padEnd(a.length+(4-a.length%4)%4,"="),s=JSON.parse(atob(r));return!(typeof s!="object"||!s||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function ml(t,e){return!!((e==="v4"||!e)&&rl.test(t)||(e==="v6"||!e)&&nl.test(t))}var Qt=class Wt extends z{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==E.string){let s=this._getOrReturnCtx(e);return I(s,{code:x.invalid_type,expected:E.string,received:s.parsedType}),L}let a=new ge,r;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(r=this._getOrReturnCtx(e,r),I(r,{code:x.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),a.dirty());else if(s.kind==="max")e.data.length>s.value&&(r=this._getOrReturnCtx(e,r),I(r,{code:x.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),a.dirty());else if(s.kind==="length"){let n=e.data.length>s.value,o=e.data.length<s.value;(n||o)&&(r=this._getOrReturnCtx(e,r),n?I(r,{code:x.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):o&&I(r,{code:x.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),a.dirty())}else if(s.kind==="email")el.test(e.data)||(r=this._getOrReturnCtx(e,r),I(r,{validation:"email",code:x.invalid_string,message:s.message}),a.dirty());else if(s.kind==="emoji")Es||(Es=new RegExp(tl,"u")),Es.test(e.data)||(r=this._getOrReturnCtx(e,r),I(r,{validation:"emoji",code:x.invalid_string,message:s.message}),a.dirty());else if(s.kind==="uuid")Ho.test(e.data)||(r=this._getOrReturnCtx(e,r),I(r,{validation:"uuid",code:x.invalid_string,message:s.message}),a.dirty());else if(s.kind==="nanoid")Go.test(e.data)||(r=this._getOrReturnCtx(e,r),I(r,{validation:"nanoid",code:x.invalid_string,message:s.message}),a.dirty());else if(s.kind==="cuid")Ko.test(e.data)||(r=this._getOrReturnCtx(e,r),I(r,{validation:"cuid",code:x.invalid_string,message:s.message}),a.dirty());else if(s.kind==="cuid2")Jo.test(e.data)||(r=this._getOrReturnCtx(e,r),I(r,{validation:"cuid2",code:x.invalid_string,message:s.message}),a.dirty());else if(s.kind==="ulid")Yo.test(e.data)||(r=this._getOrReturnCtx(e,r),I(r,{validation:"ulid",code:x.invalid_string,message:s.message}),a.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),I(r,{validation:"url",code:x.invalid_string,message:s.message}),a.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),I(r,{validation:"regex",code:x.invalid_string,message:s.message}),a.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(r=this._getOrReturnCtx(e,r),I(r,{code:x.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),a.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(r=this._getOrReturnCtx(e,r),I(r,{code:x.invalid_string,validation:{startsWith:s.value},message:s.message}),a.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(r=this._getOrReturnCtx(e,r),I(r,{code:x.invalid_string,validation:{endsWith:s.value},message:s.message}),a.dirty()):s.kind==="datetime"?ul(s).test(e.data)||(r=this._getOrReturnCtx(e,r),I(r,{code:x.invalid_string,validation:"datetime",message:s.message}),a.dirty()):s.kind==="date"?ll.test(e.data)||(r=this._getOrReturnCtx(e,r),I(r,{code:x.invalid_string,validation:"date",message:s.message}),a.dirty()):s.kind==="time"?dl(s).test(e.data)||(r=this._getOrReturnCtx(e,r),I(r,{code:x.invalid_string,validation:"time",message:s.message}),a.dirty()):s.kind==="duration"?Xo.test(e.data)||(r=this._getOrReturnCtx(e,r),I(r,{validation:"duration",code:x.invalid_string,message:s.message}),a.dirty()):s.kind==="ip"?cl(e.data,s.version)||(r=this._getOrReturnCtx(e,r),I(r,{validation:"ip",code:x.invalid_string,message:s.message}),a.dirty()):s.kind==="jwt"?pl(e.data,s.alg)||(r=this._getOrReturnCtx(e,r),I(r,{validation:"jwt",code:x.invalid_string,message:s.message}),a.dirty()):s.kind==="cidr"?ml(e.data,s.version)||(r=this._getOrReturnCtx(e,r),I(r,{validation:"cidr",code:x.invalid_string,message:s.message}),a.dirty()):s.kind==="base64"?il.test(e.data)||(r=this._getOrReturnCtx(e,r),I(r,{validation:"base64",code:x.invalid_string,message:s.message}),a.dirty()):s.kind==="base64url"?ol.test(e.data)||(r=this._getOrReturnCtx(e,r),I(r,{validation:"base64url",code:x.invalid_string,message:s.message}),a.dirty()):W.assertNever(s);return{status:a.value,value:e.data}}_regex(e,a,r){return this.refinement(s=>e.test(s),{validation:a,code:x.invalid_string,...M.errToObj(r)})}_addCheck(e){return new Wt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...M.errToObj(e)})}url(e){return this._addCheck({kind:"url",...M.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...M.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...M.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...M.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...M.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...M.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...M.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...M.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...M.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...M.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...M.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...M.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:(e==null?void 0:e.precision)===void 0?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...M.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:(e==null?void 0:e.precision)===void 0?null:e==null?void 0:e.precision,...M.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...M.errToObj(e)})}regex(e,a){return this._addCheck({kind:"regex",regex:e,...M.errToObj(a)})}includes(e,a){return this._addCheck({kind:"includes",value:e,position:a==null?void 0:a.position,...M.errToObj(a==null?void 0:a.message)})}startsWith(e,a){return this._addCheck({kind:"startsWith",value:e,...M.errToObj(a)})}endsWith(e,a){return this._addCheck({kind:"endsWith",value:e,...M.errToObj(a)})}min(e,a){return this._addCheck({kind:"min",value:e,...M.errToObj(a)})}max(e,a){return this._addCheck({kind:"max",value:e,...M.errToObj(a)})}length(e,a){return this._addCheck({kind:"length",value:e,...M.errToObj(a)})}nonempty(e){return this.min(1,M.errToObj(e))}trim(){return new Wt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Wt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Wt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e}get maxLength(){let e=null;for(let a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e}};Qt.create=t=>new Qt({checks:[],typeName:_.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...F(t)});function hl(t,e){let a=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,s=a>r?a:r;return Number.parseInt(t.toFixed(s).replace(".",""))%Number.parseInt(e.toFixed(s).replace(".",""))/10**s}var Pa=class Ar extends z{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==E.number){let s=this._getOrReturnCtx(e);return I(s,{code:x.invalid_type,expected:E.number,received:s.parsedType}),L}let a,r=new ge;for(let s of this._def.checks)s.kind==="int"?W.isInteger(e.data)||(a=this._getOrReturnCtx(e,a),I(a,{code:x.invalid_type,expected:"integer",received:"float",message:s.message}),r.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(a=this._getOrReturnCtx(e,a),I(a,{code:x.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(a=this._getOrReturnCtx(e,a),I(a,{code:x.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="multipleOf"?hl(e.data,s.value)!==0&&(a=this._getOrReturnCtx(e,a),I(a,{code:x.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(a=this._getOrReturnCtx(e,a),I(a,{code:x.not_finite,message:s.message}),r.dirty()):W.assertNever(s);return{status:r.value,value:e.data}}gte(e,a){return this.setLimit("min",e,!0,M.toString(a))}gt(e,a){return this.setLimit("min",e,!1,M.toString(a))}lte(e,a){return this.setLimit("max",e,!0,M.toString(a))}lt(e,a){return this.setLimit("max",e,!1,M.toString(a))}setLimit(e,a,r,s){return new Ar({...this._def,checks:[...this._def.checks,{kind:e,value:a,inclusive:r,message:M.toString(s)}]})}_addCheck(e){return new Ar({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:M.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:M.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:M.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:M.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:M.toString(e)})}multipleOf(e,a){return this._addCheck({kind:"multipleOf",value:e,message:M.toString(a)})}finite(e){return this._addCheck({kind:"finite",message:M.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:-(2**53-1),message:M.toString(e)})._addCheck({kind:"max",inclusive:!0,value:2**53-1,message:M.toString(e)})}get minValue(){let e=null;for(let a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e}get maxValue(){let e=null;for(let a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&W.isInteger(e.value))}get isFinite(){let e=null,a=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(a===null||r.value>a)&&(a=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(a)&&Number.isFinite(e)}};Pa.create=t=>new Pa({checks:[],typeName:_.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...F(t)});var $a=class Or extends z{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==E.bigint)return this._getInvalidInput(e);let a,r=new ge;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(a=this._getOrReturnCtx(e,a),I(a,{code:x.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(a=this._getOrReturnCtx(e,a),I(a,{code:x.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(a=this._getOrReturnCtx(e,a),I(a,{code:x.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):W.assertNever(s);return{status:r.value,value:e.data}}_getInvalidInput(e){let a=this._getOrReturnCtx(e);return I(a,{code:x.invalid_type,expected:E.bigint,received:a.parsedType}),L}gte(e,a){return this.setLimit("min",e,!0,M.toString(a))}gt(e,a){return this.setLimit("min",e,!1,M.toString(a))}lte(e,a){return this.setLimit("max",e,!0,M.toString(a))}lt(e,a){return this.setLimit("max",e,!1,M.toString(a))}setLimit(e,a,r,s){return new Or({...this._def,checks:[...this._def.checks,{kind:e,value:a,inclusive:r,message:M.toString(s)}]})}_addCheck(e){return new Or({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:M.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:M.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:M.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:M.toString(e)})}multipleOf(e,a){return this._addCheck({kind:"multipleOf",value:e,message:M.toString(a)})}get minValue(){let e=null;for(let a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e}get maxValue(){let e=null;for(let a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e}};$a.create=t=>new $a({checks:[],typeName:_.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...F(t)});var La=class extends z{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==E.boolean){let e=this._getOrReturnCtx(t);return I(e,{code:x.invalid_type,expected:E.boolean,received:e.parsedType}),L}return fe(t.data)}};La.create=t=>new La({typeName:_.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...F(t)});var Da=class di extends z{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==E.date){let s=this._getOrReturnCtx(e);return I(s,{code:x.invalid_type,expected:E.date,received:s.parsedType}),L}if(Number.isNaN(e.data.getTime()))return I(this._getOrReturnCtx(e),{code:x.invalid_date}),L;let a=new ge,r;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(r=this._getOrReturnCtx(e,r),I(r,{code:x.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),a.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(r=this._getOrReturnCtx(e,r),I(r,{code:x.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),a.dirty()):W.assertNever(s);return{status:a.value,value:new Date(e.data.getTime())}}_addCheck(e){return new di({...this._def,checks:[...this._def.checks,e]})}min(e,a){return this._addCheck({kind:"min",value:e.getTime(),message:M.toString(a)})}max(e,a){return this._addCheck({kind:"max",value:e.getTime(),message:M.toString(a)})}get minDate(){let e=null;for(let a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e==null?null:new Date(e)}};Da.create=t=>new Da({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:_.ZodDate,...F(t)});var Za=class extends z{_parse(t){if(this._getType(t)!==E.symbol){let e=this._getOrReturnCtx(t);return I(e,{code:x.invalid_type,expected:E.symbol,received:e.parsedType}),L}return fe(t.data)}};Za.create=t=>new Za({typeName:_.ZodSymbol,...F(t)});var Xt=class extends z{_parse(t){if(this._getType(t)!==E.undefined){let e=this._getOrReturnCtx(t);return I(e,{code:x.invalid_type,expected:E.undefined,received:e.parsedType}),L}return fe(t.data)}};Xt.create=t=>new Xt({typeName:_.ZodUndefined,...F(t)});var ea=class extends z{_parse(t){if(this._getType(t)!==E.null){let e=this._getOrReturnCtx(t);return I(e,{code:x.invalid_type,expected:E.null,received:e.parsedType}),L}return fe(t.data)}};ea.create=t=>new ea({typeName:_.ZodNull,...F(t)});var Fa=class extends z{constructor(){super(...arguments),this._any=!0}_parse(t){return fe(t.data)}};Fa.create=t=>new Fa({typeName:_.ZodAny,...F(t)});var vt=class extends z{constructor(){super(...arguments),this._unknown=!0}_parse(t){return fe(t.data)}};vt.create=t=>new vt({typeName:_.ZodUnknown,...F(t)});var Ke=class extends z{_parse(t){let e=this._getOrReturnCtx(t);return I(e,{code:x.invalid_type,expected:E.never,received:e.parsedType}),L}};Ke.create=t=>new Ke({typeName:_.ZodNever,...F(t)});var za=class extends z{_parse(t){if(this._getType(t)!==E.undefined){let e=this._getOrReturnCtx(t);return I(e,{code:x.invalid_type,expected:E.void,received:e.parsedType}),L}return fe(t.data)}};za.create=t=>new za({typeName:_.ZodVoid,...F(t)});var xt=class xa extends z{_parse(e){let{ctx:a,status:r}=this._processInputParams(e),s=this._def;if(a.parsedType!==E.array)return I(a,{code:x.invalid_type,expected:E.array,received:a.parsedType}),L;if(s.exactLength!==null){let o=a.data.length>s.exactLength.value,i=a.data.length<s.exactLength.value;(o||i)&&(I(a,{code:o?x.too_big:x.too_small,minimum:i?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&a.data.length<s.minLength.value&&(I(a,{code:x.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&a.data.length>s.maxLength.value&&(I(a,{code:x.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),a.common.async)return Promise.all([...a.data].map((o,i)=>s.type._parseAsync(new Re(a,o,a.path,i)))).then(o=>ge.mergeArray(r,o));let n=[...a.data].map((o,i)=>s.type._parseSync(new Re(a,o,a.path,i)));return ge.mergeArray(r,n)}get element(){return this._def.type}min(e,a){return new xa({...this._def,minLength:{value:e,message:M.toString(a)}})}max(e,a){return new xa({...this._def,maxLength:{value:e,message:M.toString(a)}})}length(e,a){return new xa({...this._def,exactLength:{value:e,message:M.toString(a)}})}nonempty(e){return this.min(1,e)}};xt.create=(t,e)=>new xt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:_.ZodArray,...F(e)});function bt(t){if(t instanceof ke){let e={};for(let a in t.shape){let r=t.shape[a];e[a]=Le.create(bt(r))}return new ke({...t._def,shape:()=>e})}else return t instanceof xt?new xt({...t._def,type:bt(t.element)}):t instanceof Le?Le.create(bt(t.unwrap())):t instanceof it?it.create(bt(t.unwrap())):t instanceof nt?nt.create(t.items.map(e=>bt(e))):t}var ke=class Se extends z{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape();return this._cached={shape:e,keys:W.objectKeys(e)},this._cached}_parse(e){if(this._getType(e)!==E.object){let d=this._getOrReturnCtx(e);return I(d,{code:x.invalid_type,expected:E.object,received:d.parsedType}),L}let{status:a,ctx:r}=this._processInputParams(e),{shape:s,keys:n}=this._getCached(),o=[];if(!(this._def.catchall instanceof Ke&&this._def.unknownKeys==="strip"))for(let d in r.data)n.includes(d)||o.push(d);let i=[];for(let d of n){let l=s[d],u=r.data[d];i.push({key:{status:"valid",value:d},value:l._parse(new Re(r,u,r.path,d)),alwaysSet:d in r.data})}if(this._def.catchall instanceof Ke){let d=this._def.unknownKeys;if(d==="passthrough")for(let l of o)i.push({key:{status:"valid",value:l},value:{status:"valid",value:r.data[l]}});else if(d==="strict")o.length>0&&(I(r,{code:x.unrecognized_keys,keys:o}),a.dirty());else if(d!=="strip")throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let d=this._def.catchall;for(let l of o){let u=r.data[l];i.push({key:{status:"valid",value:l},value:d._parse(new Re(r,u,r.path,l)),alwaysSet:l in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let d=[];for(let l of i){let u=await l.key,c=await l.value;d.push({key:u,value:c,alwaysSet:l.alwaysSet})}return d}).then(d=>ge.mergeObjectSync(a,d)):ge.mergeObjectSync(a,i)}get shape(){return this._def.shape()}strict(e){return M.errToObj,new Se({...this._def,unknownKeys:"strict",...e===void 0?{}:{errorMap:(a,r)=>{var n,o;let s=((o=(n=this._def).errorMap)==null?void 0:o.call(n,a,r).message)??r.defaultError;return a.code==="unrecognized_keys"?{message:M.errToObj(e).message??s}:{message:s}}}})}strip(){return new Se({...this._def,unknownKeys:"strip"})}passthrough(){return new Se({...this._def,unknownKeys:"passthrough"})}extend(e){return new Se({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Se({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:_.ZodObject})}setKey(e,a){return this.augment({[e]:a})}catchall(e){return new Se({...this._def,catchall:e})}pick(e){let a={};for(let r of W.objectKeys(e))e[r]&&this.shape[r]&&(a[r]=this.shape[r]);return new Se({...this._def,shape:()=>a})}omit(e){let a={};for(let r of W.objectKeys(this.shape))e[r]||(a[r]=this.shape[r]);return new Se({...this._def,shape:()=>a})}deepPartial(){return bt(this)}partial(e){let a={};for(let r of W.objectKeys(this.shape)){let s=this.shape[r];e&&!e[r]?a[r]=s:a[r]=s.optional()}return new Se({...this._def,shape:()=>a})}required(e){let a={};for(let r of W.objectKeys(this.shape))if(e&&!e[r])a[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof Le;)s=s._def.innerType;a[r]=s}return new Se({...this._def,shape:()=>a})}keyof(){return Os(W.objectKeys(this.shape))}};ke.create=(t,e)=>new ke({shape:()=>t,unknownKeys:"strip",catchall:Ke.create(),typeName:_.ZodObject,...F(e)}),ke.strictCreate=(t,e)=>new ke({shape:()=>t,unknownKeys:"strict",catchall:Ke.create(),typeName:_.ZodObject,...F(e)}),ke.lazycreate=(t,e)=>new ke({shape:t,unknownKeys:"strip",catchall:Ke.create(),typeName:_.ZodObject,...F(e)});var ta=class extends z{_parse(t){let{ctx:e}=this._processInputParams(t),a=this._def.options;function r(s){for(let o of s)if(o.result.status==="valid")return o.result;for(let o of s)if(o.result.status==="dirty")return e.common.issues.push(...o.ctx.common.issues),o.result;let n=s.map(o=>new Oe(o.ctx.common.issues));return I(e,{code:x.invalid_union,unionErrors:n}),L}if(e.common.async)return Promise.all(a.map(async s=>{let n={...e,common:{...e.common,issues:[]},parent:null};return{result:await s._parseAsync({data:e.data,path:e.path,parent:n}),ctx:n}})).then(r);{let s,n=[];for(let i of a){let d={...e,common:{...e.common,issues:[]},parent:null},l=i._parseSync({data:e.data,path:e.path,parent:d});if(l.status==="valid")return l;l.status==="dirty"&&!s&&(s={result:l,ctx:d}),d.common.issues.length&&n.push(d.common.issues)}if(s)return e.common.issues.push(...s.ctx.common.issues),s.result;let o=n.map(i=>new Oe(i));return I(e,{code:x.invalid_union,unionErrors:o}),L}}get options(){return this._def.options}};ta.create=(t,e)=>new ta({options:t,typeName:_.ZodUnion,...F(e)});var Je=t=>t instanceof ra?Je(t.schema):t instanceof $e?Je(t.innerType()):t instanceof sa?[t.value]:t instanceof na?t.options:t instanceof ia?W.objectValues(t.enum):t instanceof oa?Je(t._def.innerType):t instanceof Xt?[void 0]:t instanceof ea?[null]:t instanceof Le?[void 0,...Je(t.unwrap())]:t instanceof it?[null,...Je(t.unwrap())]:t instanceof Rs||t instanceof da?Je(t.unwrap()):t instanceof la?Je(t._def.innerType):[],fl=class ui extends z{_parse(e){let{ctx:a}=this._processInputParams(e);if(a.parsedType!==E.object)return I(a,{code:x.invalid_type,expected:E.object,received:a.parsedType}),L;let r=this.discriminator,s=a.data[r],n=this.optionsMap.get(s);return n?a.common.async?n._parseAsync({data:a.data,path:a.path,parent:a}):n._parseSync({data:a.data,path:a.path,parent:a}):(I(a,{code:x.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),L)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,a,r){let s=new Map;for(let n of a){let o=Je(n.shape[e]);if(!o.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let i of o){if(s.has(i))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);s.set(i,n)}}return new ui({typeName:_.ZodDiscriminatedUnion,discriminator:e,options:a,optionsMap:s,...F(r)})}};function Ua(t,e){let a=Be(t),r=Be(e);if(t===e)return{valid:!0,data:t};if(a===E.object&&r===E.object){let s=W.objectKeys(e),n=W.objectKeys(t).filter(i=>s.indexOf(i)!==-1),o={...t,...e};for(let i of n){let d=Ua(t[i],e[i]);if(!d.valid)return{valid:!1};o[i]=d.data}return{valid:!0,data:o}}else if(a===E.array&&r===E.array){if(t.length!==e.length)return{valid:!1};let s=[];for(let n=0;n<t.length;n++){let o=t[n],i=e[n],d=Ua(o,i);if(!d.valid)return{valid:!1};s.push(d.data)}return{valid:!0,data:s}}else return a===E.date&&r===E.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var aa=class extends z{_parse(t){let{status:e,ctx:a}=this._processInputParams(t),r=(s,n)=>{if(Cs(s)||Cs(n))return L;let o=Ua(s.value,n.value);return o.valid?((Is(s)||Is(n))&&e.dirty(),{status:e.value,value:o.data}):(I(a,{code:x.invalid_intersection_types}),L)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([s,n])=>r(s,n)):r(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}};aa.create=(t,e,a)=>new aa({left:t,right:e,typeName:_.ZodIntersection,...F(a)});var nt=class ci extends z{_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.parsedType!==E.array)return I(r,{code:x.invalid_type,expected:E.array,received:r.parsedType}),L;if(r.data.length<this._def.items.length)return I(r,{code:x.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),L;!this._def.rest&&r.data.length>this._def.items.length&&(I(r,{code:x.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),a.dirty());let s=[...r.data].map((n,o)=>{let i=this._def.items[o]||this._def.rest;return i?i._parse(new Re(r,n,r.path,o)):null}).filter(n=>!!n);return r.common.async?Promise.all(s).then(n=>ge.mergeArray(a,n)):ge.mergeArray(a,s)}get items(){return this._def.items}rest(e){return new ci({...this._def,rest:e})}};nt.create=(t,e)=>{if(!Array.isArray(t))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new nt({items:t,typeName:_.ZodTuple,rest:null,...F(e)})};var gl=class Rr extends z{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.parsedType!==E.object)return I(r,{code:x.invalid_type,expected:E.object,received:r.parsedType}),L;let s=[],n=this._def.keyType,o=this._def.valueType;for(let i in r.data)s.push({key:n._parse(new Re(r,i,r.path,i)),value:o._parse(new Re(r,r.data[i],r.path,i)),alwaysSet:i in r.data});return r.common.async?ge.mergeObjectAsync(a,s):ge.mergeObjectSync(a,s)}get element(){return this._def.valueType}static create(e,a,r){return a instanceof z?new Rr({keyType:e,valueType:a,typeName:_.ZodRecord,...F(r)}):new Rr({keyType:Qt.create(),valueType:e,typeName:_.ZodRecord,...F(a)})}},qa=class extends z{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:e,ctx:a}=this._processInputParams(t);if(a.parsedType!==E.map)return I(a,{code:x.invalid_type,expected:E.map,received:a.parsedType}),L;let r=this._def.keyType,s=this._def.valueType,n=[...a.data.entries()].map(([o,i],d)=>({key:r._parse(new Re(a,o,a.path,[d,"key"])),value:s._parse(new Re(a,i,a.path,[d,"value"]))}));if(a.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let i of n){let d=await i.key,l=await i.value;if(d.status==="aborted"||l.status==="aborted")return L;(d.status==="dirty"||l.status==="dirty")&&e.dirty(),o.set(d.value,l.value)}return{status:e.value,value:o}})}else{let o=new Map;for(let i of n){let d=i.key,l=i.value;if(d.status==="aborted"||l.status==="aborted")return L;(d.status==="dirty"||l.status==="dirty")&&e.dirty(),o.set(d.value,l.value)}return{status:e.value,value:o}}}};qa.create=(t,e,a)=>new qa({valueType:e,keyType:t,typeName:_.ZodMap,...F(a)});var Va=class Nr extends z{_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.parsedType!==E.set)return I(r,{code:x.invalid_type,expected:E.set,received:r.parsedType}),L;let s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(I(r,{code:x.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),a.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(I(r,{code:x.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),a.dirty());let n=this._def.valueType;function o(d){let l=new Set;for(let u of d){if(u.status==="aborted")return L;u.status==="dirty"&&a.dirty(),l.add(u.value)}return{status:a.value,value:l}}let i=[...r.data.values()].map((d,l)=>n._parse(new Re(r,d,r.path,l)));return r.common.async?Promise.all(i).then(d=>o(d)):o(i)}min(e,a){return new Nr({...this._def,minSize:{value:e,message:M.toString(a)}})}max(e,a){return new Nr({...this._def,maxSize:{value:e,message:M.toString(a)}})}size(e,a){return this.min(e,a).max(e,a)}nonempty(e){return this.min(1,e)}};Va.create=(t,e)=>new Va({valueType:t,minSize:null,maxSize:null,typeName:_.ZodSet,...F(e)});var yl=class ba extends z{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:a}=this._processInputParams(e);if(a.parsedType!==E.function)return I(a,{code:x.invalid_type,expected:E.function,received:a.parsedType}),L;function r(i,d){return Ma({data:i,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,Na(),Nt].filter(l=>!!l),issueData:{code:x.invalid_arguments,argumentsError:d}})}function s(i,d){return Ma({data:i,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,Na(),Nt].filter(l=>!!l),issueData:{code:x.invalid_return_type,returnTypeError:d}})}let n={errorMap:a.common.contextualErrorMap},o=a.data;if(this._def.returns instanceof Mt){let i=this;return fe(async function(...d){let l=new Oe([]),u=await i._def.args.parseAsync(d,n).catch(h=>{throw l.addIssue(r(d,h)),l}),c=await Reflect.apply(o,this,u);return await i._def.returns._def.type.parseAsync(c,n).catch(h=>{throw l.addIssue(s(c,h)),l})})}else{let i=this;return fe(function(...d){let l=i._def.args.safeParse(d,n);if(!l.success)throw new Oe([r(d,l.error)]);let u=Reflect.apply(o,this,l.data),c=i._def.returns.safeParse(u,n);if(!c.success)throw new Oe([s(u,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ba({...this._def,args:nt.create(e).rest(vt.create())})}returns(e){return new ba({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,a,r){return new ba({args:e||nt.create([]).rest(vt.create()),returns:a||vt.create(),typeName:_.ZodFunction,...F(r)})}},ra=class extends z{get schema(){return this._def.getter()}_parse(t){let{ctx:e}=this._processInputParams(t);return this._def.getter()._parse({data:e.data,path:e.path,parent:e})}};ra.create=(t,e)=>new ra({getter:t,typeName:_.ZodLazy,...F(e)});var sa=class extends z{_parse(t){if(t.data!==this._def.value){let e=this._getOrReturnCtx(t);return I(e,{received:e.data,code:x.invalid_literal,expected:this._def.value}),L}return{status:"valid",value:t.data}}get value(){return this._def.value}};sa.create=(t,e)=>new sa({value:t,typeName:_.ZodLiteral,...F(e)});function Os(t,e){return new na({values:t,typeName:_.ZodEnum,...F(e)})}var na=class Mr extends z{_parse(e){if(typeof e.data!="string"){let a=this._getOrReturnCtx(e),r=this._def.values;return I(a,{expected:W.joinValues(r),received:a.parsedType,code:x.invalid_type}),L}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let a=this._getOrReturnCtx(e),r=this._def.values;return I(a,{received:a.data,code:x.invalid_enum_value,options:r}),L}return fe(e.data)}get options(){return this._def.values}get enum(){let e={};for(let a of this._def.values)e[a]=a;return e}get Values(){let e={};for(let a of this._def.values)e[a]=a;return e}get Enum(){let e={};for(let a of this._def.values)e[a]=a;return e}extract(e,a=this._def){return Mr.create(e,{...this._def,...a})}exclude(e,a=this._def){return Mr.create(this.options.filter(r=>!e.includes(r)),{...this._def,...a})}};na.create=Os;var ia=class extends z{_parse(t){let e=W.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(t);if(a.parsedType!==E.string&&a.parsedType!==E.number){let r=W.objectValues(e);return I(a,{expected:W.joinValues(r),received:a.parsedType,code:x.invalid_type}),L}if(this._cache||(this._cache=new Set(W.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let r=W.objectValues(e);return I(a,{received:a.data,code:x.invalid_enum_value,options:r}),L}return fe(t.data)}get enum(){return this._def.values}};ia.create=(t,e)=>new ia({values:t,typeName:_.ZodNativeEnum,...F(e)});var Mt=class extends z{unwrap(){return this._def.type}_parse(t){let{ctx:e}=this._processInputParams(t);return e.parsedType!==E.promise&&e.common.async===!1?(I(e,{code:x.invalid_type,expected:E.promise,received:e.parsedType}),L):fe((e.parsedType===E.promise?e.data:Promise.resolve(e.data)).then(a=>this._def.type.parseAsync(a,{path:e.path,errorMap:e.common.contextualErrorMap})))}};Mt.create=(t,e)=>new Mt({type:t,typeName:_.ZodPromise,...F(e)});var $e=class extends z{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:e,ctx:a}=this._processInputParams(t),r=this._def.effect||null,s={addIssue:n=>{I(a,n),n.fatal?e.abort():e.dirty()},get path(){return a.path}};if(s.addIssue=s.addIssue.bind(s),r.type==="preprocess"){let n=r.transform(a.data,s);if(a.common.async)return Promise.resolve(n).then(async o=>{if(e.value==="aborted")return L;let i=await this._def.schema._parseAsync({data:o,path:a.path,parent:a});return i.status==="aborted"?L:i.status==="dirty"||e.value==="dirty"?ja(i.value):i});{if(e.value==="aborted")return L;let o=this._def.schema._parseSync({data:n,path:a.path,parent:a});return o.status==="aborted"?L:o.status==="dirty"||e.value==="dirty"?ja(o.value):o}}if(r.type==="refinement"){let n=o=>{let i=r.refinement(o,s);if(a.common.async)return Promise.resolve(i);if(i instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(a.common.async===!1){let o=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return o.status==="aborted"?L:(o.status==="dirty"&&e.dirty(),n(o.value),{status:e.value,value:o.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(o=>o.status==="aborted"?L:(o.status==="dirty"&&e.dirty(),n(o.value).then(()=>({status:e.value,value:o.value}))))}if(r.type==="transform")if(a.common.async===!1){let n=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!yt(n))return L;let o=r.transform(n.value,s);if(o instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:e.value,value:o}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(n=>yt(n)?Promise.resolve(r.transform(n.value,s)).then(o=>({status:e.value,value:o})):L);W.assertNever(r)}};$e.create=(t,e,a)=>new $e({schema:t,typeName:_.ZodEffects,effect:e,...F(a)}),$e.createWithPreprocess=(t,e,a)=>new $e({schema:e,effect:{type:"preprocess",transform:t},typeName:_.ZodEffects,...F(a)});var Le=class extends z{_parse(t){return this._getType(t)===E.undefined?fe(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Le.create=(t,e)=>new Le({innerType:t,typeName:_.ZodOptional,...F(e)});var it=class extends z{_parse(t){return this._getType(t)===E.null?fe(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};it.create=(t,e)=>new it({innerType:t,typeName:_.ZodNullable,...F(e)});var oa=class extends z{_parse(t){let{ctx:e}=this._processInputParams(t),a=e.data;return e.parsedType===E.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:e.path,parent:e})}removeDefault(){return this._def.innerType}};oa.create=(t,e)=>new oa({innerType:t,typeName:_.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...F(e)});var la=class extends z{_parse(t){let{ctx:e}=this._processInputParams(t),a={...e,common:{...e.common,issues:[]}},r=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return Gt(r)?r.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Oe(a.common.issues)},input:a.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new Oe(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}};la.create=(t,e)=>new la({innerType:t,typeName:_.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...F(e)});var Wa=class extends z{_parse(t){if(this._getType(t)!==E.nan){let e=this._getOrReturnCtx(t);return I(e,{code:x.invalid_type,expected:E.nan,received:e.parsedType}),L}return{status:"valid",value:t.data}}};Wa.create=t=>new Wa({typeName:_.ZodNaN,...F(t)});var Rs=class extends z{_parse(t){let{ctx:e}=this._processInputParams(t),a=e.data;return this._def.type._parse({data:a,path:e.path,parent:e})}unwrap(){return this._def.type}},Ns=class pi extends z{_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?L:s.status==="dirty"?(a.dirty(),ja(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{let s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?L:s.status==="dirty"?(a.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(e,a){return new pi({in:e,out:a,typeName:_.ZodPipeline})}},da=class extends z{_parse(t){let e=this._def.innerType._parse(t),a=r=>(yt(r)&&(r.value=Object.freeze(r.value)),r);return Gt(e)?e.then(r=>a(r)):a(e)}unwrap(){return this._def.innerType}};da.create=(t,e)=>new da({innerType:t,typeName:_.ZodReadonly,...F(e)}),ke.lazycreate;var _;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(_||(_={})),Qt.create,Pa.create,Wa.create,$a.create,La.create,Da.create,Za.create,Xt.create,ea.create,Fa.create,vt.create,Ke.create,za.create,xt.create,ke.create,ke.strictCreate,ta.create,fl.create,aa.create,nt.create,gl.create,qa.create,Va.create,yl.create,ra.create,sa.create,na.create,ia.create,Mt.create,$e.create,Le.create,it.create,$e.createWithPreprocess,Ns.create;var Ba=class extends Error{constructor(t,e){super(t),this.name="ParseError",this.type=e.type,this.field=e.field,this.value=e.value,this.line=e.line}},Ms=10,vl=13,ot=32;function Ka(t){}function xl(t){if(typeof t=="function")throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");let{onEvent:e=Ka,onError:a=Ka,onRetry:r=Ka,onComment:s,maxBufferSize:n}=t,o=[],i=0,d=!0,l,u="",c=0,h,f=!1;function k(y){if(f)throw Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(d&&(d=!1,y.charCodeAt(0)===239&&y.charCodeAt(1)===187&&y.charCodeAt(2)===191&&(y=y.slice(3))),o.length===0){let j=b(y);j!==""&&(o.push(j),i=j.length),p();return}if(y.indexOf(`
|
|
4
4
|
`)===-1&&y.indexOf("\r")===-1){o.push(y),i+=y.length,p();return}o.push(y);let v=o.join("");o.length=0,i=0;let S=b(v);S!==""&&(o.push(S),i=S.length),p()}function p(){n!==void 0&&(i+u.length<=n||(f=!0,o.length=0,i=0,l=void 0,u="",c=0,h=void 0,a(new Ba(`Buffered data exceeded max buffer size of ${n} characters`,{type:"max-buffer-size-exceeded"}))))}function b(y){let v=0;if(y.indexOf("\r")===-1){let S=y.indexOf(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var gt=Object.defineProperty;var ft=(t,e,s)=>e in t?gt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var ue=(t,e,s)=>ft(t,typeof e!="symbol"?e+"":e,s);import{s as Re}from"./chunk-LvLJmgfZ.js";import{u as yt}from"./useEvent-D91BmmQi.js";import{t as _t}from"./react-Bj1aDYRI.js";import{Dt as Te,E as wt,rr as y}from"./cells-Cf7bHHq3.js";import{D as ce,P as w,R as u,T as F,_ as xt,i as St,k as x}from"./zod-H_cgTO0M.js";import{t as M}from"./compiler-runtime-B3qBwwSJ.js";import{_ as kt}from"./useEventListener-B_w3A283.js";import{c as vt}from"./utils-Z80SV4_d.js";import{t as ae}from"./cn-DYvqRARy.js";import{t as $t}from"./jsx-runtime-Blw4afVn.js";import{a as jt,c as Le,i as Ct,o as Ne,r as At,s as Rt,t as Tt}from"./popover-DrHQ3KEt.js";import{c as Lt,i as Nt,n as Dt,r as It,s as Pt,t as Et}from"./select-B5TFNjmU.js";import{t as De}from"./button-eIihcbUw.js";import{r as ie}from"./strings-Djnbwmfl.js";import{t as Ft}from"./createLucideIcon-w-Qo9n0R.js";import{r as qt,t as Bt}from"./x-C-Eq0ag8.js";import{t as Ot}from"./circle-plus-BluydVNx.js";import{t as Mt}from"./database-zap-CKO8g4BU.js";import{c as i,o as Ut,t as Kt,u as Ht}from"./form-CgWNb44_.js";import{n as Se}from"./DeferredRequestRegistry-C8EV1PoE.js";import{a as Wt,c as zt,d as Gt,g as Vt,l as Zt,o as Qt,p as Jt,s as Yt,u as Xt}from"./textarea-CpFfEUet.js";import{r as es}from"./useTheme-KXqAyDPC.js";import{a as ts,c as ss,l as rs,n as os,r as ns,t as cs}from"./dialog-D1DEsRZ2.js";import{n as as}from"./ImperativeModal-BIavOiUv.js";import{t as be}from"./links-wcQA1Np1.js";import{t as is}from"./useIframeCapabilities-Ccb4fvKc.js";import{r as ls}from"./html-to-image-CwmX28T9.js";import{o as ds}from"./focus-DiEyfiAG.js";import{n as ps}from"./useAsyncData-Bg5iAViP.js";import{a as hs,c as ke,i as ge,o as fe,s as ms,t as us}from"./command-CAJLPEBq.js";import{n as bs,t as gs}from"./azure-nN8APleF.js";import{t as fs}from"./request-registry-DHocQ_4I.js";import{n as ys,t as _s}from"./write-secret-modal-DEEn7sZV.js";import{t as ws}from"./github-_JH-0hIO.js";var ve=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"}]]),$e="env:";function ho(t){return t}function U(t){return typeof t=="string"?t.startsWith($e):!1}function Ie(t){return`${$e}${t}`}function Pe(t){return t.replace($e,"")}var xs=M(),P=Re(_t(),1),n=Re($t(),1);function Ss(t,e){if(!e)return{recommended:[],other:[...t]};let s;try{s=new RegExp(e,"i")}catch{return{recommended:[],other:[...t]}}let o=[],r=[];for(let l of t)s.test(l)?o.push(l):r.push(l);return{recommended:o,other:r}}const ks=t=>{let e=(0,xs.c)(67),{value:s,onChange:o,placeholder:r,secretsOnly:l,recommendedKeys:a,otherKeys:c,onCreateSecret:d,className:p}=t,h=l===void 0?!1:l,[g,m]=(0,P.useState)(!1),[b,f]=(0,P.useState)(""),_;e[0]===b?_=e[1]:(_=b.trim(),e[0]=b,e[1]=_);let S=_,k=!h&&S.length>0&&S!==s,v;e:{if(!s){v=null;break e}if(U(s)){let $;e[2]===s?$=e[3]:($=s,e[2]=s,e[3]=$),v=$;break e}v=s}let R=v,C;e[4]===o?C=e[5]:(C=$=>{o(Ie($)),m(!1),f("")},e[4]=o,e[5]=C);let A=C,T;e[6]===o?T=e[7]:(T=$=>{o($),m(!1),f("")},e[6]=o,e[7]=T);let L=T,I;e[8]===o?I=e[9]:(I=()=>{o(""),f(""),m(!1)},e[8]=o,e[9]=I);let ne=I,K;e[10]===p?K=e[11]:(K=ae("flex w-full min-w-48 mb-1 items-center gap-1",p),e[10]=p,e[11]=K);let de;e[12]===Symbol.for("react.memo_cache_sentinel")?(de=$=>{m($),$||f("")},e[12]=de):de=e[12];let H;e[13]===s?H=e[14]:(H=ae("flex h-6 min-w-0 flex-1 shadow-xs-solid items-center justify-between","rounded-sm border border-input bg-background px-1.5 text-sm font-code ring-offset-background placeholder:text-muted-foreground","hover:shadow-sm-solid focus:outline-hidden focus:ring-1 focus:ring-ring focus:border-primary focus:shadow-md-solid",U(s)&&"bg-accent"),e[13]=s,e[14]=H);let W;e[15]!==R||e[16]!==r||e[17]!==s?(W=(0,n.jsx)("span",{className:"truncate flex-1 min-w-0 text-left flex items-center gap-1.5",children:R?(0,n.jsxs)(n.Fragment,{children:[U(s)&&(0,n.jsx)(Se,{className:"h-3 w-3 shrink-0 opacity-70"}),(0,n.jsx)("span",{className:"truncate",children:R})]}):(0,n.jsx)("span",{className:"text-muted-foreground",children:r})}),e[15]=R,e[16]=r,e[17]=s,e[18]=W):W=e[18];let pe;e[19]===Symbol.for("react.memo_cache_sentinel")?(pe=(0,n.jsx)(qt,{className:"ml-1 h-4 w-4 opacity-50 shrink-0"}),e[19]=pe):pe=e[19];let z;e[20]!==g||e[21]!==W||e[22]!==H?(z=(0,n.jsx)(Ct,{asChild:!0,children:(0,n.jsxs)("button",{type:"button",className:H,"aria-expanded":g,children:[W,pe]})}),e[20]=g,e[21]=W,e[22]=H,e[23]=z):z=e[23];let we=h?"Search secrets...":"Type a value or search secrets...",G;e[24]!==b||e[25]!==we?(G=(0,n.jsx)(hs,{placeholder:we,rootClassName:"px-1 h-8",autoFocus:!0,value:b,onValueChange:f}),e[24]=b,e[25]=we,e[26]=G):G=e[26];let V;e[27]!==L||e[28]!==k||e[29]!==S?(V=k&&(0,n.jsx)(ge,{children:(0,n.jsxs)(fe,{value:`use custom value ${S}`,onSelect:()=>L(S),children:['Use "',S,'"']})}),e[27]=L,e[28]=k,e[29]=S,e[30]=V):V=e[30];let Z;e[31]===k?Z=e[32]:(Z=k&&(0,n.jsx)(ke,{}),e[31]=k,e[32]=Z);let xe=`create new secret ${S}`,Q;e[33]!==d||e[34]!==S?(Q=()=>{let $=S||void 0;m(!1),f(""),d($)},e[33]=d,e[34]=S,e[35]=Q):Q=e[35];let he;e[36]===Symbol.for("react.memo_cache_sentinel")?(he=(0,n.jsx)(Ot,{className:"mr-2 h-3.5 w-3.5"}),e[36]=he):he=e[36];let J;e[37]!==xe||e[38]!==Q?(J=(0,n.jsx)(ge,{className:"mt-0",children:(0,n.jsxs)(fe,{value:xe,onSelect:Q,children:[he,"Create a new secret"]})}),e[37]=xe,e[38]=Q,e[39]=J):J=e[39];let Y;e[40]!==a||e[41]!==A?(Y=a.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ke,{className:"mt-0"}),(0,n.jsx)(ge,{heading:"Recommended",children:a.map($=>(0,n.jsxs)(fe,{value:$,onSelect:()=>A($),children:[(0,n.jsx)(Se,{className:"mr-2 h-3 w-3 opacity-70"}),$]},$))})]}),e[40]=a,e[41]=A,e[42]=Y):Y=e[42];let X;e[43]!==c||e[44]!==a.length||e[45]!==A?(X=c.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ke,{className:"mt-0"}),(0,n.jsx)(ge,{heading:a.length>0?"Other":void 0,children:c.map($=>(0,n.jsxs)(fe,{value:$,onSelect:()=>A($),children:[(0,n.jsx)(Se,{className:"mr-2 h-3 w-3 opacity-70"}),$]},$))})]}),e[43]=c,e[44]=a.length,e[45]=A,e[46]=X):X=e[46];let ee;e[47]!==V||e[48]!==Z||e[49]!==J||e[50]!==Y||e[51]!==X?(ee=(0,n.jsxs)(ms,{className:"max-h-60 overscroll-contain",children:[V,Z,J,Y,X]}),e[47]=V,e[48]=Z,e[49]=J,e[50]=Y,e[51]=X,e[52]=ee):ee=e[52];let te;e[53]!==G||e[54]!==ee?(te=(0,n.jsx)(At,{className:"w-(--radix-popover-trigger-width) p-0",align:"start",children:(0,n.jsxs)(us,{children:[G,ee]})}),e[53]=G,e[54]=ee,e[55]=te):te=e[55];let se;e[56]!==g||e[57]!==z||e[58]!==te?(se=(0,n.jsxs)(Tt,{modal:!0,open:g,onOpenChange:de,children:[z,te]}),e[56]=g,e[57]=z,e[58]=te,e[59]=se):se=e[59];let re;e[60]!==ne||e[61]!==s?(re=s&&(0,n.jsx)("button",{type:"button","aria-label":"Clear",className:ae("flex h-6 w-6 shrink-0 items-center justify-center rounded-sm","text-muted-foreground hover:bg-muted hover:text-foreground","focus:outline-hidden focus:ring-1 focus:ring-ring"),onClick:ne,children:(0,n.jsx)(Bt,{className:"h-3.5 w-3.5"})}),e[60]=ne,e[61]=s,e[62]=re):re=e[62];let me;return e[63]!==se||e[64]!==re||e[65]!==K?(me=(0,n.jsxs)("div",{className:K,children:[se,re]}),e[63]=se,e[64]=re,e[65]=K,e[66]=me):me=e[66],me};var vs=M(),Ee=(0,P.createContext)({providerNames:[],secretKeys:[],loading:!1,error:void 0,refreshSecrets:kt.NOOP});const $s=()=>(0,P.use)(Ee),js=t=>{let e=(0,vs.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:l,error:a,refetch:c}=ps(Ls,o);r==null||r.secretKeys,r==null||r.providerNames;let d;e[1]===(r==null?void 0:r.secretKeys)?d=e[2]:(d=(r==null?void 0:r.secretKeys)||[],e[1]=r==null?void 0:r.secretKeys,e[2]=d);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]!==a||e[6]!==l||e[7]!==c||e[8]!==d||e[9]!==p?(h={secretKeys:d,providerNames:p,loading:l,error:a,refreshSecrets:c},e[5]=a,e[6]=l,e[7]=c,e[8]=d,e[9]=p,e[10]=h):h=e[10];let g=h,m;return e[11]!==s||e[12]!==g?(m=(0,n.jsx)(Ee,{value:g,children:s}),e[11]=s,e[12]=g,e[13]=m):m=e[13],m},Cs={isMatch:t=>{if(t instanceof xt){let{optionRegex:e}=i.parse(t.description||"");return!!e}return!1},Component:({schema:t,form:e,path:s})=>{let{secretKeys:o,providerNames:r,refreshSecrets:l}=$s(),{openModal:a,closeModal:c}=as(),{label:d,description:p,placeholder:h,optionRegex:g="",inputType:m}=i.parse(t.description||""),b=m==="password",{recommended:f,other:_}=Ss(o,g);return(0,n.jsx)(zt,{control:e.control,name:s,render:({field:S})=>(0,n.jsxs)(Zt,{children:[(0,n.jsx)(Xt,{children:d}),(0,n.jsx)(Qt,{children:p}),(0,n.jsx)(Wt,{children:(0,n.jsx)(ks,{value:S.value?String(S.value):"",onChange:S.onChange,placeholder:h,secretsOnly:b,recommendedKeys:f,otherKeys:_,onCreateSecret:k=>{a((0,n.jsx)(_s,{providerNames:r,initialValue:k,onSuccess:v=>{l(),S.onChange(Ie(v)),c()},onClose:c}))}})}),(0,n.jsx)(Gt,{})]})})}};function As(t){return t.provider!=="env"}function Rs(t){return t.name}function Ts(t){return t.keys}async function Ls(){let t=await fs.request({}),e=ys(t.secrets).filter(As).map(Rs);return{secretKeys:t.secrets.flatMap(Ts).toSorted(),providerNames:e}}var le=M(),Ns=[Cs];const je=t=>{let e=(0,le.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},Ce=t=>{let e=(0,le.c)(9),{name:s,color:o,icon:r,onSelect:l}=t,a;e[0]===o?a=e[1]:(a={backgroundColor:o},e[0]=o,e[1]=a);let c;e[2]===s?c=e[3]:(c=(0,n.jsx)("span",{className:"text-white font-medium text-lg",children:s}),e[2]=s,e[3]=c);let d;return e[4]!==r||e[5]!==l||e[6]!==a||e[7]!==c?(d=(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:a,onClick:l,children:[r,c]}),e[4]=r,e[5]=l,e[6]=a,e[7]=c,e[8]=d):d=e[8],d},Ds=t=>{let e=(0,le.c)(25),{onBack:s,isValid:o,libraries:r,preferredLibrary:l,onLibraryChange:a,displayNames:c,libraryLabel:d}=t,p=d===void 0?"Preferred library":d,h;e[0]===s?h=e[1]:(h=(0,n.jsx)(De,{type:"button",variant:"outline",onClick:s,children:"Back"}),e[0]=s,e[1]=h);let g=!o,m;e[2]===g?m=e[3]:(m=(0,n.jsx)(De,{type:"submit",disabled:g,children:"Add"}),e[2]=g,e[3]=m);let b;e[4]!==h||e[5]!==m?(b=(0,n.jsxs)("div",{className:"flex gap-2",children:[h,m]}),e[4]=h,e[5]=m,e[6]=b):b=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=(0,n.jsx)(Pt,{children:(0,n.jsx)(Lt,{placeholder:"Select a library"})}),e[7]=f):f=e[7];let _;e[8]===p?_=e[9]:(_=(0,n.jsxs)("div",{className:"flex flex-col gap-1 items-end",children:[f,(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:p})]}),e[8]=p,e[9]=_);let S;if(e[10]!==c||e[11]!==r){let C;e[13]===c?C=e[14]:(C=A=>(0,n.jsx)(Nt,{value:A,children:c[A]??A},A),e[13]=c,e[14]=C),S=r.map(C),e[10]=c,e[11]=r,e[12]=S}else S=e[12];let k;e[15]===S?k=e[16]:(k=(0,n.jsx)(Dt,{children:(0,n.jsx)(It,{children:S})}),e[15]=S,e[16]=k);let v;e[17]!==a||e[18]!==l||e[19]!==_||e[20]!==k?(v=(0,n.jsx)("div",{children:(0,n.jsxs)(Et,{value:l,onValueChange:a,children:[_,k]})}),e[17]=a,e[18]=l,e[19]=_,e[20]=k,e[21]=v):v=e[21];let R;return e[22]!==v||e[23]!==b?(R=(0,n.jsxs)("div",{className:"flex gap-2 justify-between",children:[b,v]}),e[22]=v,e[23]=b,e[24]=R):R=e[24],R};function Is(){let t=(0,le.c)(4),{createNewCell:e}=wt(),s=ds(),o=yt(vt),r;return t[0]!==o||t[1]!==e||t[2]!==s?(r=l=>{/\bmo\./.test(l)&&ls({autoInstantiate:o,createNewCell:e,fromCellId:s}),e({code:l,before:!1,cellId:s??"__end__",skipIfCodeExists:!0})},t[0]=o,t[1]=e,t[2]=s,t[3]=r):r=t[3],r}const Fe=t=>{let e=(0,le.c)(30),{schema:s,libraries:o,preferredLibrary:r,displayNames:l,libraryLabel:a,generateCode:c,onSubmit:d,onBack:p}=t,h;e[0]===s?h=e[1]:(h=Ut(s),e[0]=s,e[1]=h);let g=h,m;e[2]===s?m=e[3]:(m=Jt(s),e[2]=s,e[3]=m);let b;e[4]!==g||e[5]!==m?(b={defaultValues:g,resolver:m,reValidateMode:"onChange"},e[4]=g,e[5]=m,e[6]=b):b=e[6];let f=Vt(b),[_,S]=P.useState(r),k=Is(),v;e[7]!==c||e[8]!==k||e[9]!==d||e[10]!==_?(v=ne=>{k(c(ne,_)),d()},e[7]=c,e[8]=k,e[9]=d,e[10]=_,e[11]=v):v=e[11];let R=v,C;e[12]!==f||e[13]!==R?(C=f.handleSubmit(R),e[12]=f,e[13]=R,e[14]=C):C=e[14];let A;e[15]===Symbol.for("react.memo_cache_sentinel")?(A=(0,n.jsx)(Yt,{}),e[15]=A):A=e[15];let T;e[16]!==f||e[17]!==s?(T=(0,n.jsx)(js,{children:(0,n.jsx)(Kt,{schema:s,form:f,renderers:Ns,children:A})}),e[16]=f,e[17]=s,e[18]=T):T=e[18];let L;e[19]!==l||e[20]!==f.formState.isValid||e[21]!==o||e[22]!==a||e[23]!==p||e[24]!==_?(L=(0,n.jsx)(Ds,{onBack:p,isValid:f.formState.isValid,libraries:o,preferredLibrary:_,onLibraryChange:S,displayNames:l,libraryLabel:a}),e[19]=l,e[20]=f.formState.isValid,e[21]=o,e[22]=a,e[23]=p,e[24]=_,e[25]=L):L=e[25];let I;return e[26]!==C||e[27]!==T||e[28]!==L?(I=(0,n.jsxs)("form",{onSubmit:C,className:"space-y-4",children:[T,L]}),e[26]=C,e[27]=T,e[28]=L,e[29]=I):I=e[29],I};function q(){return u().optional().describe(i.of({label:"Password",inputType:"password",optionRegex:"(password|passwd|pgpassword|db.?pass(word)?)"}))}function ye(t,e){let s=u();return s=e?s.nonempty():s.optional(),s=s.describe(i.of({label:t||"Token",inputType:"password",optionRegex:"(token|api.?key|access.?token|auth.?token|(^|_)pat(_|$))"})),s}function _e(){return u().optional().describe(i.of({label:"Warehouse Name",optionRegex:"(warehouse|snowflake.?warehouse)"}))}function Ae(t,e){let s=u();return s=e?s.nonempty():s.optional(),s.describe(i.of({label:t||"URI",optionRegex:"(uri|url|connection.?string|database.?url|jdbc)"}))}function E(t){return u().nonempty().describe(i.of({label:t||"Host",optionRegex:"^(?!.*(kubernetes|gpg)).*(host(name)?|pghost|db.?host|database.?host|mysql.?host|postgres.?host|server.?host)"}))}function N(){return u().describe(i.of({label:"Database",optionRegex:"(database|db.?name|pgdatabase|^DB$|^DATABASE$)"}))}function Ps(){return u().describe(i.of({label:"Schema",optionRegex:"(^SCHEMA$|db.?schema|postgres.?schema|pg.?schema|_SCHEMA$)"}))}function D(){return u().nonempty().describe(i.of({label:"Username",optionRegex:"(username|pguser|db.?user|^USER$|_USER$)"}))}function B(t){let e=St().describe(i.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 qe(){return F().default(!1).describe(i.of({label:"Read Only"}))}const Be=w({type:x("postgres"),host:E(),port:B(5432).optional(),database:N(),username:D(),password:q(),ssl:F().default(!1).describe(i.of({label:"Use SSL"}))}).describe(i.of({direction:"two-columns"})),Oe=w({type:x("mysql"),host:E(),port:B(3306),database:N(),username:D(),password:q(),ssl:F().default(!1).describe(i.of({label:"Use SSL"}))}).describe(i.of({direction:"two-columns"})),Me=w({type:x("sqlite"),database:N().describe(i.of({label:"Database Path"}))}).describe(i.of({direction:"two-columns"})),Ue=w({type:x("duckdb"),database:N().describe(i.of({label:"Database Path"})),read_only:qe()}).describe(i.of({direction:"two-columns"})),Ke=w({type:x("motherduck"),database:N().default("my_db").describe(i.of({label:"Database Name"})),token:ye()}).describe(i.of({direction:"two-columns"})),He=w({type:x("snowflake"),account:u().nonempty().describe(i.of({label:"Account",optionRegex:"(snowflake.?account|^SNOWFLAKE_ACCOUNT$|account.?id)"})),warehouse:u().optional().describe(i.of({label:"Warehouse",optionRegex:"(snowflake.?warehouse|warehouse)"})),database:N(),schema:u().optional().describe(i.of({label:"Schema",optionRegex:"(snowflake.?schema|^SCHEMA$|_SCHEMA$)"})),role:u().optional().describe(i.of({label:"Role"})),authType:ce("type",[w({type:x("Password"),username:D(),password:q(),enable_mfa:F().default(!1).describe(i.of({label:"Enable MFA (Duo Push)"}))}),w({type:x("SSO (Browser)"),username:D()}),w({type:x("Key Pair"),username:D(),private_key_path:u().nonempty().describe(i.of({label:"Private Key Path",placeholder:"/path/to/rsa_key.p8"})),private_key_passphrase:u().optional().describe(i.of({label:"Private Key Passphrase",inputType:"password",optionRegex:"(passphrase|private.?key.?passphrase|key.?passphrase)"}))}),w({type:x("OAuth / PAT"),token:ye("Token",!0)})]).default({type:"Password",username:"username",enable_mfa:!1}).describe(i.of({special:"tabs"}))}).describe(i.of({direction:"two-columns"})),We=w({type:x("bigquery"),project:u().nonempty().describe(i.of({label:"Project ID",optionRegex:"(bigquery.?project|gcp.?project|google.?cloud.?project|project.?id)"})),dataset:u().nonempty().describe(i.of({label:"Dataset",optionRegex:"(bigquery.?dataset|dataset)"})),credentials_json:u().describe(i.of({label:"Credentials JSON",inputType:"textarea"}))}).describe(i.of({direction:"two-columns"})),ze=w({type:x("clickhouse_connect"),host:E(),port:B(8123).optional(),username:D(),password:q(),secure:F().default(!1).describe(i.of({label:"Use HTTPs"})),proxy_path:u().optional().describe(i.of({label:"Proxy Path",placeholder:"/clickhouse"}))}).describe(i.of({direction:"two-columns"})),Ge=w({type:x("timeplus"),host:E().default("localhost"),port:B(8123).optional(),username:D().default("default"),password:q().default("")}).describe(i.of({direction:"two-columns"})),Ve=w({type:x("chdb"),database:N().describe(i.of({label:"Database Path"})),read_only:qe()}).describe(i.of({direction:"two-columns"})),Ze=w({type:x("trino"),host:E(),port:B(8080),database:N(),schema:Ps().optional(),username:D(),password:q(),async_support:F().default(!1).describe(i.of({label:"Async Support"}))}).describe(i.of({direction:"two-columns"})),Qe=w({type:x("iceberg"),name:u().describe(i.of({label:"Catalog Name"})),catalog:ce("type",[w({type:x("REST"),warehouse:_e(),uri:u().optional().describe(i.of({label:"URI",placeholder:"https://",optionRegex:"(uri|url|connection.?string|database.?url|jdbc)"})),token:ye()}),w({type:x("SQL"),warehouse:_e(),uri:u().optional().describe(i.of({label:"URI",placeholder:"jdbc:iceberg://host:port/database",optionRegex:"(uri|url|connection.?string|database.?url|jdbc)"}))}),w({type:x("Hive"),warehouse:_e(),uri:Ae()}),w({type:x("Glue"),warehouse:_e(),uri:Ae()}),w({type:x("DynamoDB"),"dynamodb.profile-name":u().optional().describe(i.of({label:"Profile Name"})),"dynamodb.region":u().optional().describe(i.of({label:"Region"})),"dynamodb.access-key-id":u().optional().describe(i.of({label:"Access Key ID",inputType:"password",optionRegex:"(access.?key.?id|aws.?access.?key)"})),"dynamodb.secret-access-key":u().optional().describe(i.of({label:"Secret Access Key",inputType:"password",optionRegex:"(secret.?access.?key|aws.?secret)"})),"dynamodb.session-token":u().optional().describe(i.of({label:"Session Token",inputType:"password",optionRegex:"(session.?token|aws.?session)"}))})]).default({type:"REST",token:void 0}).describe(i.of({special:"tabs"}))}),Je=w({type:x("datafusion"),sessionContext:F().optional().describe(i.of({label:"Use Session Context"}))}),Ye=w({type:x("pyspark"),host:E().optional(),port:B().optional()}),Xe=w({type:x("redshift"),host:E(),port:B(5439),connectionType:ce("type",[w({type:x("IAM credentials"),region:u().describe(i.of({label:"Region"})),aws_access_key_id:u().nonempty().describe(i.of({label:"AWS Access Key ID",inputType:"password",optionRegex:"(access.?key.?id|aws.?access.?key)"})),aws_secret_access_key:u().nonempty().describe(i.of({label:"AWS Secret Access Key",inputType:"password",optionRegex:"(secret.?access.?key|aws.?secret)"})),aws_session_token:u().optional().describe(i.of({label:"AWS Session Token",inputType:"password",optionRegex:"(session.?token|aws.?session)"}))}),w({type:x("DB credentials"),user:D(),password:q()})]).default({type:"IAM credentials",aws_access_key_id:"",aws_secret_access_key:"",region:""}),database:N()}).describe(i.of({direction:"two-columns"})),et=w({type:x("databricks"),access_token:ye("Access Token",!0),server_hostname:E("Server Hostname"),http_path:Ae("HTTP Path",!0),catalog:u().optional().describe(i.of({label:"Catalog"})),schema:u().optional().describe(i.of({label:"Schema"}))}).describe(i.of({direction:"two-columns"})),tt=w({type:x("supabase"),host:E(),port:B(5432).optional(),database:N(),username:D(),password:q(),disable_client_pooling:F().default(!1).describe(i.of({label:"Disable Client-Side Pooling"}))}).describe(i.of({direction:"two-columns"})),Es=ce("type",[Be,Oe,Me,Ue,Ke,He,We,ze,Ge,Ve,Ze,Qe,Je,Ye,Xe,et,tt]),st={sqlmodel:"SQLModel",sqlalchemy:"SQLAlchemy",duckdb:"DuckDB",clickhouse_connect:"ClickHouse Connect",chdb:"chDB",pyiceberg:"PyIceberg",ibis:"Ibis",motherduck:"MotherDuck",redshift:"Redshift",databricks:"Databricks"};var j=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}},Fs=t=>`_${t}`,qs=class{constructor(){ue(this,"secrets",{})}get imports(){return Object.keys(this.secrets).length===0?new Set:new Set(["import os"])}print(t,e,s){if(t=Fs(t),U(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"?oe(e):e?`"${e}"`:""}printInFString(t,e,s){if(e===void 0)return"";if(typeof e=="number")return`${e}`;if(typeof e=="boolean")return oe(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 U(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 gt=Object.defineProperty;var ft=(t,e,s)=>e in t?gt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var ue=(t,e,s)=>ft(t,typeof e!="symbol"?e+"":e,s);import{s as Re}from"./chunk-LvLJmgfZ.js";import{u as yt}from"./useEvent-D91BmmQi.js";import{t as _t}from"./react-Bj1aDYRI.js";import{Dt as Te,E as wt,rr as y}from"./cells-aqfX084m.js";import{D as ce,P as w,R as u,T as F,_ as xt,i as St,k as x}from"./zod-H_cgTO0M.js";import{t as M}from"./compiler-runtime-B3qBwwSJ.js";import{_ as kt}from"./useEventListener-C0195JsF.js";import{c as vt}from"./utils-BWBBpCkT.js";import{t as ae}from"./cn-DYvqRARy.js";import{t as $t}from"./jsx-runtime-Blw4afVn.js";import{a as jt,c as Le,i as Ct,o as Ne,r as At,s as Rt,t as Tt}from"./popover-Bcz1Zikb.js";import{c as Lt,i as Nt,n as Dt,r as It,s as Pt,t as Et}from"./select-BP75_5jJ.js";import{t as De}from"./button-DDGiD1NW.js";import{r as ie}from"./strings--BknHX9C.js";import{t as Ft}from"./createLucideIcon-w-Qo9n0R.js";import{r as qt,t as Bt}from"./x-C-Eq0ag8.js";import{t as Ot}from"./circle-plus-BluydVNx.js";import{t as Mt}from"./database-zap-CKO8g4BU.js";import{c as i,o as Ut,t as Kt,u as Ht}from"./form-CIXAzTfC.js";import{n as Se}from"./DeferredRequestRegistry-C8EV1PoE.js";import{a as Wt,c as zt,d as Gt,g as Vt,l as Zt,o as Qt,p as Jt,s as Yt,u as Xt}from"./textarea-aocYW9hl.js";import{r as es}from"./useTheme-Bxv9B31g.js";import{a as ts,c as ss,l as rs,n as os,r as ns,t as cs}from"./dialog-BCVepWLJ.js";import{n as as}from"./ImperativeModal-fY-ZfT0b.js";import{t as be}from"./links-wcQA1Np1.js";import{t as is}from"./useIframeCapabilities-j6fR_dBA.js";import{r as ls}from"./html-to-image-B-nAUvDC.js";import{o as ds}from"./focus-tOmGbv38.js";import{n as ps}from"./useAsyncData-Bg5iAViP.js";import{a as hs,c as ke,i as ge,o as fe,s as ms,t as us}from"./command-Dqxie4gq.js";import{n as bs,t as gs}from"./azure-nN8APleF.js";import{t as fs}from"./request-registry-DHocQ_4I.js";import{n as ys,t as _s}from"./write-secret-modal-3-v-dHVj.js";import{t as ws}from"./github-_JH-0hIO.js";var ve=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"}]]),$e="env:";function ho(t){return t}function U(t){return typeof t=="string"?t.startsWith($e):!1}function Ie(t){return`${$e}${t}`}function Pe(t){return t.replace($e,"")}var xs=M(),P=Re(_t(),1),n=Re($t(),1);function Ss(t,e){if(!e)return{recommended:[],other:[...t]};let s;try{s=new RegExp(e,"i")}catch{return{recommended:[],other:[...t]}}let o=[],r=[];for(let l of t)s.test(l)?o.push(l):r.push(l);return{recommended:o,other:r}}const ks=t=>{let e=(0,xs.c)(67),{value:s,onChange:o,placeholder:r,secretsOnly:l,recommendedKeys:a,otherKeys:c,onCreateSecret:d,className:p}=t,h=l===void 0?!1:l,[g,m]=(0,P.useState)(!1),[b,f]=(0,P.useState)(""),_;e[0]===b?_=e[1]:(_=b.trim(),e[0]=b,e[1]=_);let S=_,k=!h&&S.length>0&&S!==s,v;e:{if(!s){v=null;break e}if(U(s)){let $;e[2]===s?$=e[3]:($=s,e[2]=s,e[3]=$),v=$;break e}v=s}let R=v,C;e[4]===o?C=e[5]:(C=$=>{o(Ie($)),m(!1),f("")},e[4]=o,e[5]=C);let A=C,T;e[6]===o?T=e[7]:(T=$=>{o($),m(!1),f("")},e[6]=o,e[7]=T);let L=T,I;e[8]===o?I=e[9]:(I=()=>{o(""),f(""),m(!1)},e[8]=o,e[9]=I);let ne=I,K;e[10]===p?K=e[11]:(K=ae("flex w-full min-w-48 mb-1 items-center gap-1",p),e[10]=p,e[11]=K);let de;e[12]===Symbol.for("react.memo_cache_sentinel")?(de=$=>{m($),$||f("")},e[12]=de):de=e[12];let H;e[13]===s?H=e[14]:(H=ae("flex h-6 min-w-0 flex-1 shadow-xs-solid items-center justify-between","rounded-sm border border-input bg-background px-1.5 text-sm font-code ring-offset-background placeholder:text-muted-foreground","hover:shadow-sm-solid focus:outline-hidden focus:ring-1 focus:ring-ring focus:border-primary focus:shadow-md-solid",U(s)&&"bg-accent"),e[13]=s,e[14]=H);let W;e[15]!==R||e[16]!==r||e[17]!==s?(W=(0,n.jsx)("span",{className:"truncate flex-1 min-w-0 text-left flex items-center gap-1.5",children:R?(0,n.jsxs)(n.Fragment,{children:[U(s)&&(0,n.jsx)(Se,{className:"h-3 w-3 shrink-0 opacity-70"}),(0,n.jsx)("span",{className:"truncate",children:R})]}):(0,n.jsx)("span",{className:"text-muted-foreground",children:r})}),e[15]=R,e[16]=r,e[17]=s,e[18]=W):W=e[18];let pe;e[19]===Symbol.for("react.memo_cache_sentinel")?(pe=(0,n.jsx)(qt,{className:"ml-1 h-4 w-4 opacity-50 shrink-0"}),e[19]=pe):pe=e[19];let z;e[20]!==g||e[21]!==W||e[22]!==H?(z=(0,n.jsx)(Ct,{asChild:!0,children:(0,n.jsxs)("button",{type:"button",className:H,"aria-expanded":g,children:[W,pe]})}),e[20]=g,e[21]=W,e[22]=H,e[23]=z):z=e[23];let we=h?"Search secrets...":"Type a value or search secrets...",G;e[24]!==b||e[25]!==we?(G=(0,n.jsx)(hs,{placeholder:we,rootClassName:"px-1 h-8",autoFocus:!0,value:b,onValueChange:f}),e[24]=b,e[25]=we,e[26]=G):G=e[26];let V;e[27]!==L||e[28]!==k||e[29]!==S?(V=k&&(0,n.jsx)(ge,{children:(0,n.jsxs)(fe,{value:`use custom value ${S}`,onSelect:()=>L(S),children:['Use "',S,'"']})}),e[27]=L,e[28]=k,e[29]=S,e[30]=V):V=e[30];let Z;e[31]===k?Z=e[32]:(Z=k&&(0,n.jsx)(ke,{}),e[31]=k,e[32]=Z);let xe=`create new secret ${S}`,Q;e[33]!==d||e[34]!==S?(Q=()=>{let $=S||void 0;m(!1),f(""),d($)},e[33]=d,e[34]=S,e[35]=Q):Q=e[35];let he;e[36]===Symbol.for("react.memo_cache_sentinel")?(he=(0,n.jsx)(Ot,{className:"mr-2 h-3.5 w-3.5"}),e[36]=he):he=e[36];let J;e[37]!==xe||e[38]!==Q?(J=(0,n.jsx)(ge,{className:"mt-0",children:(0,n.jsxs)(fe,{value:xe,onSelect:Q,children:[he,"Create a new secret"]})}),e[37]=xe,e[38]=Q,e[39]=J):J=e[39];let Y;e[40]!==a||e[41]!==A?(Y=a.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ke,{className:"mt-0"}),(0,n.jsx)(ge,{heading:"Recommended",children:a.map($=>(0,n.jsxs)(fe,{value:$,onSelect:()=>A($),children:[(0,n.jsx)(Se,{className:"mr-2 h-3 w-3 opacity-70"}),$]},$))})]}),e[40]=a,e[41]=A,e[42]=Y):Y=e[42];let X;e[43]!==c||e[44]!==a.length||e[45]!==A?(X=c.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ke,{className:"mt-0"}),(0,n.jsx)(ge,{heading:a.length>0?"Other":void 0,children:c.map($=>(0,n.jsxs)(fe,{value:$,onSelect:()=>A($),children:[(0,n.jsx)(Se,{className:"mr-2 h-3 w-3 opacity-70"}),$]},$))})]}),e[43]=c,e[44]=a.length,e[45]=A,e[46]=X):X=e[46];let ee;e[47]!==V||e[48]!==Z||e[49]!==J||e[50]!==Y||e[51]!==X?(ee=(0,n.jsxs)(ms,{className:"max-h-60 overscroll-contain",children:[V,Z,J,Y,X]}),e[47]=V,e[48]=Z,e[49]=J,e[50]=Y,e[51]=X,e[52]=ee):ee=e[52];let te;e[53]!==G||e[54]!==ee?(te=(0,n.jsx)(At,{className:"w-(--radix-popover-trigger-width) p-0",align:"start",children:(0,n.jsxs)(us,{children:[G,ee]})}),e[53]=G,e[54]=ee,e[55]=te):te=e[55];let se;e[56]!==g||e[57]!==z||e[58]!==te?(se=(0,n.jsxs)(Tt,{modal:!0,open:g,onOpenChange:de,children:[z,te]}),e[56]=g,e[57]=z,e[58]=te,e[59]=se):se=e[59];let re;e[60]!==ne||e[61]!==s?(re=s&&(0,n.jsx)("button",{type:"button","aria-label":"Clear",className:ae("flex h-6 w-6 shrink-0 items-center justify-center rounded-sm","text-muted-foreground hover:bg-muted hover:text-foreground","focus:outline-hidden focus:ring-1 focus:ring-ring"),onClick:ne,children:(0,n.jsx)(Bt,{className:"h-3.5 w-3.5"})}),e[60]=ne,e[61]=s,e[62]=re):re=e[62];let me;return e[63]!==se||e[64]!==re||e[65]!==K?(me=(0,n.jsxs)("div",{className:K,children:[se,re]}),e[63]=se,e[64]=re,e[65]=K,e[66]=me):me=e[66],me};var vs=M(),Ee=(0,P.createContext)({providerNames:[],secretKeys:[],loading:!1,error:void 0,refreshSecrets:kt.NOOP});const $s=()=>(0,P.use)(Ee),js=t=>{let e=(0,vs.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:l,error:a,refetch:c}=ps(Ls,o);r==null||r.secretKeys,r==null||r.providerNames;let d;e[1]===(r==null?void 0:r.secretKeys)?d=e[2]:(d=(r==null?void 0:r.secretKeys)||[],e[1]=r==null?void 0:r.secretKeys,e[2]=d);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]!==a||e[6]!==l||e[7]!==c||e[8]!==d||e[9]!==p?(h={secretKeys:d,providerNames:p,loading:l,error:a,refreshSecrets:c},e[5]=a,e[6]=l,e[7]=c,e[8]=d,e[9]=p,e[10]=h):h=e[10];let g=h,m;return e[11]!==s||e[12]!==g?(m=(0,n.jsx)(Ee,{value:g,children:s}),e[11]=s,e[12]=g,e[13]=m):m=e[13],m},Cs={isMatch:t=>{if(t instanceof xt){let{optionRegex:e}=i.parse(t.description||"");return!!e}return!1},Component:({schema:t,form:e,path:s})=>{let{secretKeys:o,providerNames:r,refreshSecrets:l}=$s(),{openModal:a,closeModal:c}=as(),{label:d,description:p,placeholder:h,optionRegex:g="",inputType:m}=i.parse(t.description||""),b=m==="password",{recommended:f,other:_}=Ss(o,g);return(0,n.jsx)(zt,{control:e.control,name:s,render:({field:S})=>(0,n.jsxs)(Zt,{children:[(0,n.jsx)(Xt,{children:d}),(0,n.jsx)(Qt,{children:p}),(0,n.jsx)(Wt,{children:(0,n.jsx)(ks,{value:S.value?String(S.value):"",onChange:S.onChange,placeholder:h,secretsOnly:b,recommendedKeys:f,otherKeys:_,onCreateSecret:k=>{a((0,n.jsx)(_s,{providerNames:r,initialValue:k,onSuccess:v=>{l(),S.onChange(Ie(v)),c()},onClose:c}))}})}),(0,n.jsx)(Gt,{})]})})}};function As(t){return t.provider!=="env"}function Rs(t){return t.name}function Ts(t){return t.keys}async function Ls(){let t=await fs.request({}),e=ys(t.secrets).filter(As).map(Rs);return{secretKeys:t.secrets.flatMap(Ts).toSorted(),providerNames:e}}var le=M(),Ns=[Cs];const je=t=>{let e=(0,le.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},Ce=t=>{let e=(0,le.c)(9),{name:s,color:o,icon:r,onSelect:l}=t,a;e[0]===o?a=e[1]:(a={backgroundColor:o},e[0]=o,e[1]=a);let c;e[2]===s?c=e[3]:(c=(0,n.jsx)("span",{className:"text-white font-medium text-lg",children:s}),e[2]=s,e[3]=c);let d;return e[4]!==r||e[5]!==l||e[6]!==a||e[7]!==c?(d=(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:a,onClick:l,children:[r,c]}),e[4]=r,e[5]=l,e[6]=a,e[7]=c,e[8]=d):d=e[8],d},Ds=t=>{let e=(0,le.c)(25),{onBack:s,isValid:o,libraries:r,preferredLibrary:l,onLibraryChange:a,displayNames:c,libraryLabel:d}=t,p=d===void 0?"Preferred library":d,h;e[0]===s?h=e[1]:(h=(0,n.jsx)(De,{type:"button",variant:"outline",onClick:s,children:"Back"}),e[0]=s,e[1]=h);let g=!o,m;e[2]===g?m=e[3]:(m=(0,n.jsx)(De,{type:"submit",disabled:g,children:"Add"}),e[2]=g,e[3]=m);let b;e[4]!==h||e[5]!==m?(b=(0,n.jsxs)("div",{className:"flex gap-2",children:[h,m]}),e[4]=h,e[5]=m,e[6]=b):b=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=(0,n.jsx)(Pt,{children:(0,n.jsx)(Lt,{placeholder:"Select a library"})}),e[7]=f):f=e[7];let _;e[8]===p?_=e[9]:(_=(0,n.jsxs)("div",{className:"flex flex-col gap-1 items-end",children:[f,(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:p})]}),e[8]=p,e[9]=_);let S;if(e[10]!==c||e[11]!==r){let C;e[13]===c?C=e[14]:(C=A=>(0,n.jsx)(Nt,{value:A,children:c[A]??A},A),e[13]=c,e[14]=C),S=r.map(C),e[10]=c,e[11]=r,e[12]=S}else S=e[12];let k;e[15]===S?k=e[16]:(k=(0,n.jsx)(Dt,{children:(0,n.jsx)(It,{children:S})}),e[15]=S,e[16]=k);let v;e[17]!==a||e[18]!==l||e[19]!==_||e[20]!==k?(v=(0,n.jsx)("div",{children:(0,n.jsxs)(Et,{value:l,onValueChange:a,children:[_,k]})}),e[17]=a,e[18]=l,e[19]=_,e[20]=k,e[21]=v):v=e[21];let R;return e[22]!==v||e[23]!==b?(R=(0,n.jsxs)("div",{className:"flex gap-2 justify-between",children:[b,v]}),e[22]=v,e[23]=b,e[24]=R):R=e[24],R};function Is(){let t=(0,le.c)(4),{createNewCell:e}=wt(),s=ds(),o=yt(vt),r;return t[0]!==o||t[1]!==e||t[2]!==s?(r=l=>{/\bmo\./.test(l)&&ls({autoInstantiate:o,createNewCell:e,fromCellId:s}),e({code:l,before:!1,cellId:s??"__end__",skipIfCodeExists:!0})},t[0]=o,t[1]=e,t[2]=s,t[3]=r):r=t[3],r}const Fe=t=>{let e=(0,le.c)(30),{schema:s,libraries:o,preferredLibrary:r,displayNames:l,libraryLabel:a,generateCode:c,onSubmit:d,onBack:p}=t,h;e[0]===s?h=e[1]:(h=Ut(s),e[0]=s,e[1]=h);let g=h,m;e[2]===s?m=e[3]:(m=Jt(s),e[2]=s,e[3]=m);let b;e[4]!==g||e[5]!==m?(b={defaultValues:g,resolver:m,reValidateMode:"onChange"},e[4]=g,e[5]=m,e[6]=b):b=e[6];let f=Vt(b),[_,S]=P.useState(r),k=Is(),v;e[7]!==c||e[8]!==k||e[9]!==d||e[10]!==_?(v=ne=>{k(c(ne,_)),d()},e[7]=c,e[8]=k,e[9]=d,e[10]=_,e[11]=v):v=e[11];let R=v,C;e[12]!==f||e[13]!==R?(C=f.handleSubmit(R),e[12]=f,e[13]=R,e[14]=C):C=e[14];let A;e[15]===Symbol.for("react.memo_cache_sentinel")?(A=(0,n.jsx)(Yt,{}),e[15]=A):A=e[15];let T;e[16]!==f||e[17]!==s?(T=(0,n.jsx)(js,{children:(0,n.jsx)(Kt,{schema:s,form:f,renderers:Ns,children:A})}),e[16]=f,e[17]=s,e[18]=T):T=e[18];let L;e[19]!==l||e[20]!==f.formState.isValid||e[21]!==o||e[22]!==a||e[23]!==p||e[24]!==_?(L=(0,n.jsx)(Ds,{onBack:p,isValid:f.formState.isValid,libraries:o,preferredLibrary:_,onLibraryChange:S,displayNames:l,libraryLabel:a}),e[19]=l,e[20]=f.formState.isValid,e[21]=o,e[22]=a,e[23]=p,e[24]=_,e[25]=L):L=e[25];let I;return e[26]!==C||e[27]!==T||e[28]!==L?(I=(0,n.jsxs)("form",{onSubmit:C,className:"space-y-4",children:[T,L]}),e[26]=C,e[27]=T,e[28]=L,e[29]=I):I=e[29],I};function q(){return u().optional().describe(i.of({label:"Password",inputType:"password",optionRegex:"(password|passwd|pgpassword|db.?pass(word)?)"}))}function ye(t,e){let s=u();return s=e?s.nonempty():s.optional(),s=s.describe(i.of({label:t||"Token",inputType:"password",optionRegex:"(token|api.?key|access.?token|auth.?token|(^|_)pat(_|$))"})),s}function _e(){return u().optional().describe(i.of({label:"Warehouse Name",optionRegex:"(warehouse|snowflake.?warehouse)"}))}function Ae(t,e){let s=u();return s=e?s.nonempty():s.optional(),s.describe(i.of({label:t||"URI",optionRegex:"(uri|url|connection.?string|database.?url|jdbc)"}))}function E(t){return u().nonempty().describe(i.of({label:t||"Host",optionRegex:"^(?!.*(kubernetes|gpg)).*(host(name)?|pghost|db.?host|database.?host|mysql.?host|postgres.?host|server.?host)"}))}function N(){return u().describe(i.of({label:"Database",optionRegex:"(database|db.?name|pgdatabase|^DB$|^DATABASE$)"}))}function Ps(){return u().describe(i.of({label:"Schema",optionRegex:"(^SCHEMA$|db.?schema|postgres.?schema|pg.?schema|_SCHEMA$)"}))}function D(){return u().nonempty().describe(i.of({label:"Username",optionRegex:"(username|pguser|db.?user|^USER$|_USER$)"}))}function B(t){let e=St().describe(i.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 qe(){return F().default(!1).describe(i.of({label:"Read Only"}))}const Be=w({type:x("postgres"),host:E(),port:B(5432).optional(),database:N(),username:D(),password:q(),ssl:F().default(!1).describe(i.of({label:"Use SSL"}))}).describe(i.of({direction:"two-columns"})),Oe=w({type:x("mysql"),host:E(),port:B(3306),database:N(),username:D(),password:q(),ssl:F().default(!1).describe(i.of({label:"Use SSL"}))}).describe(i.of({direction:"two-columns"})),Me=w({type:x("sqlite"),database:N().describe(i.of({label:"Database Path"}))}).describe(i.of({direction:"two-columns"})),Ue=w({type:x("duckdb"),database:N().describe(i.of({label:"Database Path"})),read_only:qe()}).describe(i.of({direction:"two-columns"})),Ke=w({type:x("motherduck"),database:N().default("my_db").describe(i.of({label:"Database Name"})),token:ye()}).describe(i.of({direction:"two-columns"})),He=w({type:x("snowflake"),account:u().nonempty().describe(i.of({label:"Account",optionRegex:"(snowflake.?account|^SNOWFLAKE_ACCOUNT$|account.?id)"})),warehouse:u().optional().describe(i.of({label:"Warehouse",optionRegex:"(snowflake.?warehouse|warehouse)"})),database:N(),schema:u().optional().describe(i.of({label:"Schema",optionRegex:"(snowflake.?schema|^SCHEMA$|_SCHEMA$)"})),role:u().optional().describe(i.of({label:"Role"})),authType:ce("type",[w({type:x("Password"),username:D(),password:q(),enable_mfa:F().default(!1).describe(i.of({label:"Enable MFA (Duo Push)"}))}),w({type:x("SSO (Browser)"),username:D()}),w({type:x("Key Pair"),username:D(),private_key_path:u().nonempty().describe(i.of({label:"Private Key Path",placeholder:"/path/to/rsa_key.p8"})),private_key_passphrase:u().optional().describe(i.of({label:"Private Key Passphrase",inputType:"password",optionRegex:"(passphrase|private.?key.?passphrase|key.?passphrase)"}))}),w({type:x("OAuth / PAT"),token:ye("Token",!0)})]).default({type:"Password",username:"username",enable_mfa:!1}).describe(i.of({special:"tabs"}))}).describe(i.of({direction:"two-columns"})),We=w({type:x("bigquery"),project:u().nonempty().describe(i.of({label:"Project ID",optionRegex:"(bigquery.?project|gcp.?project|google.?cloud.?project|project.?id)"})),dataset:u().nonempty().describe(i.of({label:"Dataset",optionRegex:"(bigquery.?dataset|dataset)"})),credentials_json:u().describe(i.of({label:"Credentials JSON",inputType:"textarea"}))}).describe(i.of({direction:"two-columns"})),ze=w({type:x("clickhouse_connect"),host:E(),port:B(8123).optional(),username:D(),password:q(),secure:F().default(!1).describe(i.of({label:"Use HTTPs"})),proxy_path:u().optional().describe(i.of({label:"Proxy Path",placeholder:"/clickhouse"}))}).describe(i.of({direction:"two-columns"})),Ge=w({type:x("timeplus"),host:E().default("localhost"),port:B(8123).optional(),username:D().default("default"),password:q().default("")}).describe(i.of({direction:"two-columns"})),Ve=w({type:x("chdb"),database:N().describe(i.of({label:"Database Path"})),read_only:qe()}).describe(i.of({direction:"two-columns"})),Ze=w({type:x("trino"),host:E(),port:B(8080),database:N(),schema:Ps().optional(),username:D(),password:q(),async_support:F().default(!1).describe(i.of({label:"Async Support"}))}).describe(i.of({direction:"two-columns"})),Qe=w({type:x("iceberg"),name:u().describe(i.of({label:"Catalog Name"})),catalog:ce("type",[w({type:x("REST"),warehouse:_e(),uri:u().optional().describe(i.of({label:"URI",placeholder:"https://",optionRegex:"(uri|url|connection.?string|database.?url|jdbc)"})),token:ye()}),w({type:x("SQL"),warehouse:_e(),uri:u().optional().describe(i.of({label:"URI",placeholder:"jdbc:iceberg://host:port/database",optionRegex:"(uri|url|connection.?string|database.?url|jdbc)"}))}),w({type:x("Hive"),warehouse:_e(),uri:Ae()}),w({type:x("Glue"),warehouse:_e(),uri:Ae()}),w({type:x("DynamoDB"),"dynamodb.profile-name":u().optional().describe(i.of({label:"Profile Name"})),"dynamodb.region":u().optional().describe(i.of({label:"Region"})),"dynamodb.access-key-id":u().optional().describe(i.of({label:"Access Key ID",inputType:"password",optionRegex:"(access.?key.?id|aws.?access.?key)"})),"dynamodb.secret-access-key":u().optional().describe(i.of({label:"Secret Access Key",inputType:"password",optionRegex:"(secret.?access.?key|aws.?secret)"})),"dynamodb.session-token":u().optional().describe(i.of({label:"Session Token",inputType:"password",optionRegex:"(session.?token|aws.?session)"}))})]).default({type:"REST",token:void 0}).describe(i.of({special:"tabs"}))}),Je=w({type:x("datafusion"),sessionContext:F().optional().describe(i.of({label:"Use Session Context"}))}),Ye=w({type:x("pyspark"),host:E().optional(),port:B().optional()}),Xe=w({type:x("redshift"),host:E(),port:B(5439),connectionType:ce("type",[w({type:x("IAM credentials"),region:u().describe(i.of({label:"Region"})),aws_access_key_id:u().nonempty().describe(i.of({label:"AWS Access Key ID",inputType:"password",optionRegex:"(access.?key.?id|aws.?access.?key)"})),aws_secret_access_key:u().nonempty().describe(i.of({label:"AWS Secret Access Key",inputType:"password",optionRegex:"(secret.?access.?key|aws.?secret)"})),aws_session_token:u().optional().describe(i.of({label:"AWS Session Token",inputType:"password",optionRegex:"(session.?token|aws.?session)"}))}),w({type:x("DB credentials"),user:D(),password:q()})]).default({type:"IAM credentials",aws_access_key_id:"",aws_secret_access_key:"",region:""}),database:N()}).describe(i.of({direction:"two-columns"})),et=w({type:x("databricks"),access_token:ye("Access Token",!0),server_hostname:E("Server Hostname"),http_path:Ae("HTTP Path",!0),catalog:u().optional().describe(i.of({label:"Catalog"})),schema:u().optional().describe(i.of({label:"Schema"}))}).describe(i.of({direction:"two-columns"})),tt=w({type:x("supabase"),host:E(),port:B(5432).optional(),database:N(),username:D(),password:q(),disable_client_pooling:F().default(!1).describe(i.of({label:"Disable Client-Side Pooling"}))}).describe(i.of({direction:"two-columns"})),Es=ce("type",[Be,Oe,Me,Ue,Ke,He,We,ze,Ge,Ve,Ze,Qe,Je,Ye,Xe,et,tt]),st={sqlmodel:"SQLModel",sqlalchemy:"SQLAlchemy",duckdb:"DuckDB",clickhouse_connect:"ClickHouse Connect",chdb:"chDB",pyiceberg:"PyIceberg",ibis:"Ibis",motherduck:"MotherDuck",redshift:"Redshift",databricks:"Databricks"};var j=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}},Fs=t=>`_${t}`,qs=class{constructor(){ue(this,"secrets",{})}get imports(){return Object.keys(this.secrets).length===0?new Set:new Set(["import os"])}print(t,e,s){if(t=Fs(t),U(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"?oe(e):e?`"${e}"`:""}printInFString(t,e,s){if(e===void 0)return"";if(typeof e=="number")return`${e}`;if(typeof e=="boolean")return oe(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 U(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
|
`)}},Bs=class extends j{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})
|