@decocms/mesh 2.15.0 → 2.15.1
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/client/assets/{AlertCircle-CIFhWg2i.js → AlertCircle-DlBo4Xw9.js} +1 -1
- package/dist/client/assets/{ArrowLeft-D0vIuW0V.js → ArrowLeft-CCqPW2JN.js} +1 -1
- package/dist/client/assets/{ArrowUp-MjJJcV-O.js → ArrowUp-KvHCnFh3.js} +1 -1
- package/dist/client/assets/{Check-LvJ1lSFr.js → Check-D4dBNJmC.js} +1 -1
- package/dist/client/assets/{ChevronDown-QF_Tgl2v.js → ChevronDown-CJaS1NVA.js} +1 -1
- package/dist/client/assets/{Clock-CiIkKpUg.js → Clock-ljBuaWDA.js} +1 -1
- package/dist/client/assets/{Code01-Du8Lx-Uw.js → Code01-CMazpegY.js} +1 -1
- package/dist/client/assets/{Copy01-CunLN8rc.js → Copy01-Rf_P7R5F.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-WE50knOB.js → DotsHorizontal-Nj82ZW12.js} +1 -1
- package/dist/client/assets/{DotsVertical-CuQjcY-h.js → DotsVertical-f9rnazjX.js} +1 -1
- package/dist/client/assets/{Download01-syi4c4iH.js → Download01-Cnas0PSW.js} +1 -1
- package/dist/client/assets/{Edit01-DVUwOcf8.js → Edit01-MWKLkbpZ.js} +1 -1
- package/dist/client/assets/{File06-BM3BX-NC.js → File06-Dir7h2_j.js} +1 -1
- package/dist/client/assets/{FilterLines-DS1pmySA.js → FilterLines-BgxUhbig.js} +1 -1
- package/dist/client/assets/{FlipBackward-BKppcJN9.js → FlipBackward-B1KVh_65.js} +1 -1
- package/dist/client/assets/{GitBranch01-C3ShOPmQ.js → GitBranch01-CA4KhZZx.js} +1 -1
- package/dist/client/assets/{Grid01-DwtrqYPx.js → Grid01-BgBQwtBY.js} +1 -1
- package/dist/client/assets/{Home02-DlsAgg82.js → Home02-CR-W2ctm.js} +1 -1
- package/dist/client/assets/{Image01-Bw2o5F05.js → Image01-B8cj-qoF.js} +1 -1
- package/dist/client/assets/{Inbox01-CSDhYGLL.js → Inbox01-Bh5pMKE1.js} +1 -1
- package/dist/client/assets/{InfoCircle-xFKFZGrj.js → InfoCircle-CVdyaBb8.js} +1 -1
- package/dist/client/assets/{Key01-S9eZFu7R.js → Key01-BcxLAym0.js} +1 -1
- package/dist/client/assets/{LinkExternal01-Dbxh7ZV2.js → LinkExternal01-D41WE0Cl.js} +1 -1
- package/dist/client/assets/{List-D2PJPXod.js → List-hTdqyLGB.js} +1 -1
- package/dist/client/assets/{Loading01-BhuF3K1g.js → Loading01-Bq_7Os6T.js} +1 -1
- package/dist/client/assets/{Lock01-jUZQmYfl.js → Lock01-DOJDUqUZ.js} +1 -1
- package/dist/client/assets/{Play-BxDRmyN-.js → Play-CoxjBx7-.js} +1 -1
- package/dist/client/assets/{Plus-DCVckKM0.js → Plus-C4F6mby2.js} +1 -1
- package/dist/client/assets/{SearchMd-tLR3QB8E.js → SearchMd-B_A85eif.js} +1 -1
- package/dist/client/assets/{Terminal-DwE3k3eb.js → Terminal-BWurH474.js} +1 -1
- package/dist/client/assets/{Trash01-Dg5Q9OUO.js → Trash01-GrzirNvV.js} +1 -1
- package/dist/client/assets/{Upload01-BJUxi5ck.js → Upload01-Ba_zCXbQ.js} +1 -1
- package/dist/client/assets/{X-DKF1oh5v.js → X-D09jV0HO.js} +1 -1
- package/dist/client/assets/{XClose-BACMQGhN.js → XClose-D9UXYoHK.js} +1 -1
- package/dist/client/assets/{alert-dialog-BryTAX-J.js → alert-dialog-Df8ZsItX.js} +1 -1
- package/dist/client/assets/{auth-catchall-B3H5JOvc.js → auth-catchall-Bu_AmzqF.js} +1 -1
- package/dist/client/assets/{avatar-BtMYdv0U.js → avatar-CrVRRbJ7.js} +1 -1
- package/dist/client/assets/{badge-Do7WFlPI.js → badge-BPKvq16e.js} +1 -1
- package/dist/client/assets/{binder-B3GXUIAu.js → binder-BtPpbY4I.js} +1 -1
- package/dist/client/assets/{button-ClkQLR3o.js → button-Co_HOc3E.js} +1 -1
- package/dist/client/assets/{card-CwMKn79y.js → card-Rz2C5-Lx.js} +1 -1
- package/dist/client/assets/{checkbox-C6hBycBx.js → checkbox-DGIT6WZ3.js} +1 -1
- package/dist/client/assets/{collection-detail-C-m2H10s.js → collection-detail-CIorpvYQ.js} +1 -1
- package/dist/client/assets/{collection-display-button-CdHXoeVD.js → collection-display-button-C_GfVLwh.js} +1 -1
- package/dist/client/assets/{collection-header-CeBQhXWy.js → collection-header-Dl8Ii13M.js} +1 -1
- package/dist/client/assets/{collection-page-pMUw63Yr.js → collection-page-C75JriCh.js} +1 -1
- package/dist/client/assets/{collection-search-CF1o4yO7.js → collection-search-D67e9ppe.js} +1 -1
- package/dist/client/assets/{collection-tab-ChPNT80-.js → collection-tab-DVmiR956.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-jfSAC6dF.js → collection-table-wrapper-DDHrDWif.js} +1 -1
- package/dist/client/assets/{connection-BcYehfdK.js → connection-CmMMEDBY.js} +1 -1
- package/dist/client/assets/{connection-card-DO3ahSdV.js → connection-card-BuCHeT4K.js} +1 -1
- package/dist/client/assets/{connection-detail-i_lj-oMr.js → connection-detail-BsC5t8hY.js} +1 -1
- package/dist/client/assets/{connections-CMzrwOZS.js → connections-B3RW87mz.js} +1 -1
- package/dist/client/assets/constants-B5NZDm4s.js +1 -0
- package/dist/client/assets/{create-organization-dialog-BydMMM5g.js → create-organization-dialog-DQ5uy2r0.js} +1 -1
- package/dist/client/assets/{dialog-Y0g8yyzz.js → dialog-bW33A1d_.js} +1 -1
- package/dist/client/assets/{dropdown-menu-C4Ypstre.js → dropdown-menu-dsr_wyw0.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-Cds2rM_Z.js → dynamic-plugin-layout-IH0Gl52A.js} +1 -1
- package/dist/client/assets/{empty-state-C0gi-aAx.js → empty-state-B1DU5702.js} +1 -1
- package/dist/client/assets/{empty-state-Dx0NLAxy.js → empty-state-By_kA__m.js} +1 -1
- package/dist/client/assets/{env-vars-editor-GTn7Eu5T.js → env-vars-editor-BjH5KdVc.js} +1 -1
- package/dist/client/assets/{error-boundary-D2ZJQHnD.js → error-boundary-BOBkDZ1Y.js} +1 -1
- package/dist/client/assets/{extract-connection-data-nsOyk4eb.js → extract-connection-data-CNcw3HV2.js} +1 -1
- package/dist/client/assets/{file-browser-s8pLbWaW.js → file-browser-BDyBPrc6.js} +2 -2
- package/dist/client/assets/{form-DDdl0439.js → form-ChO7tWCF.js} +1 -1
- package/dist/client/assets/{gateway-detail-NHGkjgTy.js → gateway-detail-CzuSbsFr.js} +1 -1
- package/dist/client/assets/{gateways-Bv1uyRdE.js → gateways-ckyn_Uas.js} +1 -1
- package/dist/client/assets/{grid-view-DNPq1Y__.js → grid-view-CTAOtRDs.js} +1 -1
- package/dist/client/assets/{home-9eTtEa0h.js → home-CpIhQ8D8.js} +1 -1
- package/dist/client/assets/{index-D6aVJNvm.js → index-BUdiVz6f.js} +1 -1
- package/dist/client/assets/{index-hEHbC4y4.js → index-Bc30BcYv.js} +3 -3
- package/dist/client/assets/{index-DqVdeyIE.js → index-CH2G6_zW.js} +1 -1
- package/dist/client/assets/{index-Cbsnfme0.js → index-ChF3uWl9.js} +1 -1
- package/dist/client/assets/{index-C5FDJtAp.js → index-ZiFjEqyT.js} +2 -2
- package/dist/client/assets/{infiniteQueryObserver-BnxPLCEe.js → infiniteQueryObserver-DEh2zauU.js} +1 -1
- package/dist/client/assets/{input-BbWUShhD.js → input-DEsmZ6es.js} +1 -1
- package/dist/client/assets/{layout-BnqnCJOk.js → layout-tF7tb_Qc.js} +1 -1
- package/dist/client/assets/{lazy-highlighter-BHJogLPz.js → lazy-highlighter-B2TKQCpQ.js} +1 -1
- package/dist/client/assets/{localstorage-keys-BZEjwsD0.js → localstorage-keys-DhdYpXZj.js} +1 -1
- package/dist/client/assets/{login-DGLLQl3L.js → login-DtC787Hg.js} +1 -1
- package/dist/client/assets/{mcp-oauth-CkuEWYY4.js → mcp-oauth-D8a9d38x.js} +1 -1
- package/dist/client/assets/{mcp-server-card-D4bCdTAY.js → mcp-server-card-DSQZ-b3I.js} +1 -1
- package/dist/client/assets/{mcp-server-detail-Cy2l0hPz.js → mcp-server-detail-rW4PqaOO.js} +1 -1
- package/dist/client/assets/members-C4HTAJHG.js +3 -0
- package/dist/client/assets/{monaco-editor-BnXEGbzY.js → monaco-editor-BYgR7J38.js} +1 -1
- package/dist/client/assets/{monitoring-vPlAvNfN.js → monitoring-BGY0w02b.js} +1 -1
- package/dist/client/assets/{oauth-callback-I_aRwsB5.js → oauth-callback-BSZdPTYI.js} +1 -1
- package/dist/client/assets/{page-fWJ76jbj.js → page-DcQoSvJk.js} +1 -1
- package/dist/client/assets/{page-DPsdZaOi.js → page-DxMYdFSw.js} +1 -1
- package/dist/client/assets/{pin-to-sidebar-button-DTR_Oj1s.js → pin-to-sidebar-button-BahvsjHH.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-RYQHQ0B6.js → plugin-empty-state-CIiB0IAw.js} +1 -1
- package/dist/client/assets/{plugin-header-BPW1tb_d.js → plugin-header-CvDO4WmD.js} +1 -1
- package/dist/client/assets/{plugins-DN4-aMVD.js → plugins-CyUBsABC.js} +1 -1
- package/dist/client/assets/{popover-DLFe45bO.js → popover-DW05feED.js} +1 -1
- package/dist/client/assets/{project-context-provider-DH0iqA5D.js → project-context-provider-BPo-49FO.js} +1 -1
- package/dist/client/assets/{registry-utils-BPPApxjf.js → registry-utils-DzI73csj.js} +1 -1
- package/dist/client/assets/{resizable-C6uSLZAk.js → resizable-BAPLF4RD.js} +1 -1
- package/dist/client/assets/{resource-tabs-CKatVKnl.js → resource-tabs-CC5dHHUl.js} +1 -1
- package/dist/client/assets/{select-CSzUpxmC.js → select-CVEPeRAQ.js} +1 -1
- package/dist/client/assets/{settings-Dk6-Mm8r.js → settings-BfbdOKrl.js} +1 -1
- package/dist/client/assets/{shell-layout-P7XxC3ZF.js → shell-layout-DJjajsTY.js} +1 -1
- package/dist/client/assets/{spinner-CUAQv_4V.js → spinner-DqooIng7.js} +1 -1
- package/dist/client/assets/{switch-ZAqg3LbP.js → switch-dZML6kqo.js} +1 -1
- package/dist/client/assets/{textarea-BDJhX5-9.js → textarea-DFRypKCQ.js} +1 -1
- package/dist/client/assets/{tool-set-selector-D26m7PpE.js → tool-set-selector-DRx4AOzy.js} +1 -1
- package/dist/client/assets/{tools-list-pl3Bsjpf.js → tools-list-C8nSsOKD.js} +1 -1
- package/dist/client/assets/{tooltip-DXYcokUT.js → tooltip-BJO9sFhZ.js} +1 -1
- package/dist/client/assets/{use-binding-Cmi2FEqF.js → use-binding-C8KxuIY6.js} +1 -1
- package/dist/client/assets/{use-collections-DxMxR_jZ.js → use-collections-g067BPxP.js} +1 -1
- package/dist/client/assets/{use-connection-ClVfoZWG.js → use-connection-BskZam-G.js} +1 -1
- package/dist/client/assets/{use-connection-resources-nXRlJNhx.js → use-connection-resources-YXIBGXnm.js} +1 -1
- package/dist/client/assets/{use-create-gateway-UkmAQbcu.js → use-create-gateway-CCmt4GT8.js} +1 -1
- package/dist/client/assets/{use-gateway-system-prompt-CYi0Zo4K.js → use-gateway-system-prompt-DoCpWoeh.js} +1 -1
- package/dist/client/assets/{use-gateway-D_zdUoI4.js → use-gateway-v7etejE8.js} +1 -1
- package/dist/client/assets/{use-list-state-G6sniPDx.js → use-list-state-C5pgFF_z.js} +1 -1
- package/dist/client/assets/{use-mcp-hlkUt7pz.js → use-mcp-ZNQ-iMEF.js} +1 -1
- package/dist/client/assets/{use-members-3RqzErHO.js → use-members-dVasH0ez.js} +1 -1
- package/dist/client/assets/{use-mobile-DT1cwytU.js → use-mobile-Co7MtEW-.js} +1 -1
- package/dist/client/assets/{use-model-state-Bc4MpPVu.js → use-model-state-B8hL-q1r.js} +2 -2
- package/dist/client/assets/{use-organization-settings-D46q7SyU.js → use-organization-settings-K7SU43aD.js} +1 -1
- package/dist/client/assets/{use-tool-call-BH-yOcTy.js → use-tool-call-BbfSyOCz.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-Dbq7IS1q.js +1 -0
- package/dist/client/assets/{useMutation-DEocBykZ.js → useMutation-4fnzP4bc.js} +1 -1
- package/dist/client/assets/useQuery-Bn2Wcch_.js +1 -0
- package/dist/client/assets/{value-C9Bb1t7X.js → value-zEqR5KPg.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-C5hz9T3M.js → view-mode-toggle-tlrhMsiy.js} +1 -1
- package/dist/client/assets/{workflow-BJoyVBBY.js → workflow-B8_jtBci.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +216 -216
- package/dist/server/migrate.js +154 -144
- package/dist/server/server.js +212 -212
- package/package.json +1 -1
- package/dist/client/assets/constants-BIwbIZhE.js +0 -1
- package/dist/client/assets/members-CXuNIHGD.js +0 -3
- package/dist/client/assets/useInfiniteQuery-Dl93eV8h.js +0 -1
- package/dist/client/assets/useQuery-Dakt0IBq.js +0 -1
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/LICENSE +0 -47
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/README.md +0 -82
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.browser.d.ts +0 -11
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.browser.mjs +0 -43
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.cjs +0 -45
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.cloudflare.cjs +0 -46
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.cloudflare.d.ts +0 -11
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.d.ts +0 -11
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.mjs +0 -46
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.wasm +0 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.d.mts +0 -83
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.d.ts +0 -83
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.js +0 -2
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.js.map +0 -1
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.mjs +0 -2
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.mjs.map +0 -1
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.d.mts +0 -20
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.d.ts +0 -20
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.js +0 -2
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.js.map +0 -1
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.mjs +0 -2
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.mjs.map +0 -1
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/package.json +0 -61
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as v}from"./binder-B3GXUIAu.js";import{bm as T,bl as O,y as t,z as e,Y as p,Z as c,bn as l,bo as P,a3 as x,bp as U,W as i,M as u,X as g,$ as n,U as L,a0 as b,V as B,bq as C}from"./index-C5FDJtAp.js";const W=O.extend({avatar:e().describe("URL or data URI to the assistant's avatar image"),system_prompt:e().describe("System prompt that defines the assistant's behavior"),gateway_id:e().describe("Gateway ID to use for this assistant"),model:t({id:e().describe("Model ID"),connectionId:e().describe("Connection ID that provides the model")}).describe("Selected model reference for this assistant")}),F=T("assistant",W),G=[...F],w=L(()=>u([B(),e(),i(),g(),p(e(),w),c(w)])),f=p(e(),p(e(),w)).optional().describe("Additional provider-specific options. Outer record keyed by provider name, inner by option key"),E=t({type:n("text"),text:e().describe("The text content"),providerOptions:f}),q=t({type:n("text"),text:e().describe("The text content"),providerMetadata:l().optional().describe("Additional provider-specific metadata")}),j=e().describe("File data as URL string"),k=t({type:n("file"),filename:e().optional().describe("Optional filename of the file"),data:j,mediaType:e().describe("IANA media type of the file (e.g., image/png, audio/mp3)"),providerOptions:f}),$=t({type:n("file"),mediaType:e().describe("IANA media type of the file (e.g., image/png, audio/mp3)"),data:e().describe("Generated file data as base64 encoded string")}),J=t({type:n("reasoning"),text:e().describe("The reasoning text"),providerOptions:f}),K=t({type:n("reasoning"),text:e().describe("The reasoning text"),providerMetadata:l().optional().describe("Additional provider-specific metadata")}),z=t({type:n("tool-call"),toolCallId:e().describe("ID of the tool call, used to match with tool result"),toolName:e().describe("Name of the tool being called"),input:e().describe("Arguments of the tool call (JSON-serializable object matching tool input schema)"),providerExecuted:g().optional().describe("Whether the tool call will be executed by the provider"),providerOptions:f}),V=t({type:n("tool-call"),toolCallId:e().describe("ID of the tool call"),toolName:e().describe("Name of the tool being called"),input:e().describe("Stringified JSON object with the tool call arguments"),providerExecuted:g().optional().describe("Whether the tool call will be executed by the provider"),providerMetadata:l().optional().describe("Additional provider-specific metadata")}),H=u([t({type:n("text"),value:e()}),t({type:n("json"),value:w}),t({type:n("error-text"),value:e()}),t({type:n("error-json"),value:w}),t({type:n("content"),value:c(u([t({type:n("text"),text:e().describe("Text content")}),t({type:n("media"),data:e().describe("Base-64 encoded media data"),mediaType:e().describe("IANA media type")})]))})]),A=t({type:n("tool-result"),toolCallId:e().describe("ID of the tool call that this result is associated with"),toolName:e().describe("Name of the tool that generated this result"),output:H.describe("Result of the tool call"),result:b().describe("Unknown result of the tool call"),providerOptions:f}),X=t({type:n("tool-result"),toolCallId:e().describe("ID of the tool call that this result is associated with"),toolName:e().describe("Name of the tool that generated this result"),result:l().describe("Result of the tool call (JSON-serializable)"),isError:g().optional().describe("Whether the result is an error or error message"),providerExecuted:g().optional().describe("Whether the tool result was generated by the provider"),providerMetadata:l().optional().describe("Additional provider-specific metadata")}),Y=u([t({type:n("source"),sourceType:n("url"),id:e().describe("The ID of the source"),url:e().describe("The URL of the source"),title:e().optional().describe("The title of the source"),providerMetadata:l().optional().describe("Additional provider-specific metadata")}),t({type:n("source"),sourceType:n("document"),id:e().describe("The ID of the source"),mediaType:e().describe("IANA media type of the document (e.g., application/pdf)"),title:e().describe("The title of the document"),filename:e().optional().describe("Optional filename of the document"),providerMetadata:l().optional().describe("Additional provider-specific metadata")})]),Z=t({role:n("system"),content:e().describe("System message content"),providerOptions:f}),Q=t({role:n("user"),content:c(u([E,k])).describe("User message content parts (text or file)"),providerOptions:f}),ee=t({role:n("assistant"),content:c(u([E,k,J,z,A])).describe("Assistant message content parts (text, file, reasoning, tool-call, or tool-result)"),providerOptions:f}),te=t({role:n("tool"),content:c(A).describe("Tool message content (tool results)"),providerOptions:f}),oe=u([Z,Q,ee,te]),ae=c(oe).describe("A list of messages forming the prompt"),ie=t({prompt:ae.describe("A language model prompt is a standardized prompt type (array of messages with roles: system, user, assistant, tool)"),maxOutputTokens:i().optional().describe("Maximum number of tokens to generate"),temperature:i().optional().describe("Temperature setting. The range depends on the provider and model"),topP:i().optional().describe("Nucleus sampling parameter"),topK:i().optional().describe("Only sample from the top K options for each subsequent token. Used to remove long tail low probability responses"),presencePenalty:i().optional().describe("Presence penalty setting. It affects the likelihood of the model to repeat information that is already in the prompt"),frequencyPenalty:i().optional().describe("Frequency penalty setting. It affects the likelihood of the model to repeatedly use the same words or phrases"),seed:i().optional().describe("The seed (integer) to use for random sampling. If set and supported by the model, calls will generate deterministic results"),stopSequences:c(e()).optional().describe("Stop sequences. If set, the model will stop generating text when one of the stop sequences is generated"),responseFormat:u([t({type:n("text")}),t({type:n("json"),schema:l().optional().describe("JSON schema that the generated output should conform to"),name:e().optional().describe("Name of output that should be generated"),description:e().optional().describe("Description of the output that should be generated")})]).optional().describe("Response format. The output can either be text or JSON. Default is text"),tools:c(l()).optional().describe("The tools that are available for the model"),toolChoice:l().optional().describe("Specifies how the tool should be selected. Defaults to 'auto'"),includeRawChunks:g().optional().describe("Include raw chunks in the stream. Only applicable for streaming calls"),abortSignal:l().optional().describe("Abort signal for cancelling the operation"),providerOptions:l().optional().describe("Additional provider-specific options")}),ne=t({content:c(u([q,$,K,V,X,Y])).describe("Ordered content that the model has generated (text, tool-calls, reasoning, files, sources)"),finishReason:x(["stop","length","content-filter","tool-calls","error","other","unknown"]).describe("Reason why generation stopped"),usage:P({inputTokens:i().optional(),outputTokens:i().optional(),totalTokens:i().optional(),reasoningTokens:i().optional()}).describe("Usage information for the language model call"),providerMetadata:l().optional().describe("Additional provider-specific metadata"),request:t({body:l().optional().describe("Request HTTP body sent to the provider API")}).optional().describe("Optional request information for telemetry and debugging"),response:t({id:e().optional().describe("ID for the generated response"),timestamp:U().optional().describe("Timestamp for the start of the generated response"),modelId:e().optional().describe("The ID of the response model that was used"),headers:p(e(),e()).optional().describe("Response headers"),body:l().optional().describe("Response HTTP body")}).optional().describe("Optional response information for telemetry and debugging"),warnings:c(l()).describe("Warnings for the call, e.g. unsupported settings")});t({stream:l().describe("ReadableStream of LanguageModelV2StreamPart"),request:t({body:l().optional().describe("Request HTTP body sent to the provider API")}).optional().describe("Optional request information for telemetry and debugging"),response:t({headers:p(e(),e()).optional().describe("Response headers")}).optional().describe("Optional response data")});const se=t({supportedUrls:p(e(),c(e())).describe("Supported URL patterns by media type for the provider")});t({modelId:e().describe("The ID of the model"),logo:e().nullable(),description:e().nullable(),capabilities:c(e()),limits:t({contextWindow:i(),maxOutputTokens:i()}).nullable(),costs:t({input:i(),output:i()}).nullable(),provider:x(["openai","anthropic","google","x-ai","deepseek","openai-compatible","openrouter"]).nullable()});const N=t({modelId:e().describe("The ID of the model"),callOptions:ie}),re=O.extend({logo:e().nullable(),description:e().nullable(),capabilities:c(e()),limits:t({contextWindow:i(),maxOutputTokens:i()}).nullable(),costs:t({input:i(),output:i()}).nullable(),provider:x(["openai","anthropic","google","xai","deepseek","openai-compatible","openrouter"]).nullable()}),le=T("llm",re,{readOnly:!0}),ce=[{name:"LLM_METADATA",inputSchema:t({modelId:e().describe("The ID of the model")}),outputSchema:se},{name:"LLM_DO_STREAM",inputSchema:N,streamable:!0},{name:"LLM_DO_GENERATE",inputSchema:N,outputSchema:ne},...le],de=t({scopes:c(e()).describe("List of scopes available"),stateSchema:p(e(),b()).describe("JSON Schema (draft-07) defining the state structure")}),pe=[{name:"MCP_CONFIGURATION",inputSchema:t({}),outputSchema:de}],ue=t({toolName:e().describe("Name of the tool to invoke on that connection"),transformCode:e().optional().describe("Pure TypeScript function for data transformation of the tool call result. Must be a TypeScript file that declares the Output interface and exports a default function: `interface Output { ... } export default async function(input): Output { ... }`\n The input will match with the tool call outputSchema. If transformCode is not provided, the tool call result will be used as the step output. \n Providing an transformCode is recommended because it both allows you to transform the data and validate it against a JSON Schema - tools are ephemeral and may return unexpected data.")}),me=t({code:e().describe(`Pure TypeScript function for data transformation. Useful to merge data from multiple steps and transform it. Must be a TypeScript file that declares the Output interface and exports a default function: \`interface Output { ... } export default async function(input): Output { ... }\`
|
|
1
|
+
import{c as v}from"./binder-BtPpbY4I.js";import{bn as T,bm as O,y as t,z as e,Y as p,Z as c,bo as l,bp as P,a3 as x,bq as U,W as i,M as u,X as g,$ as n,U as L,a0 as b,V as B,br as C}from"./index-ZiFjEqyT.js";const W=O.extend({avatar:e().describe("URL or data URI to the assistant's avatar image"),system_prompt:e().describe("System prompt that defines the assistant's behavior"),gateway_id:e().describe("Gateway ID to use for this assistant"),model:t({id:e().describe("Model ID"),connectionId:e().describe("Connection ID that provides the model")}).describe("Selected model reference for this assistant")}),F=T("assistant",W),G=[...F],w=L(()=>u([B(),e(),i(),g(),p(e(),w),c(w)])),f=p(e(),p(e(),w)).optional().describe("Additional provider-specific options. Outer record keyed by provider name, inner by option key"),E=t({type:n("text"),text:e().describe("The text content"),providerOptions:f}),q=t({type:n("text"),text:e().describe("The text content"),providerMetadata:l().optional().describe("Additional provider-specific metadata")}),j=e().describe("File data as URL string"),k=t({type:n("file"),filename:e().optional().describe("Optional filename of the file"),data:j,mediaType:e().describe("IANA media type of the file (e.g., image/png, audio/mp3)"),providerOptions:f}),$=t({type:n("file"),mediaType:e().describe("IANA media type of the file (e.g., image/png, audio/mp3)"),data:e().describe("Generated file data as base64 encoded string")}),J=t({type:n("reasoning"),text:e().describe("The reasoning text"),providerOptions:f}),K=t({type:n("reasoning"),text:e().describe("The reasoning text"),providerMetadata:l().optional().describe("Additional provider-specific metadata")}),z=t({type:n("tool-call"),toolCallId:e().describe("ID of the tool call, used to match with tool result"),toolName:e().describe("Name of the tool being called"),input:e().describe("Arguments of the tool call (JSON-serializable object matching tool input schema)"),providerExecuted:g().optional().describe("Whether the tool call will be executed by the provider"),providerOptions:f}),V=t({type:n("tool-call"),toolCallId:e().describe("ID of the tool call"),toolName:e().describe("Name of the tool being called"),input:e().describe("Stringified JSON object with the tool call arguments"),providerExecuted:g().optional().describe("Whether the tool call will be executed by the provider"),providerMetadata:l().optional().describe("Additional provider-specific metadata")}),H=u([t({type:n("text"),value:e()}),t({type:n("json"),value:w}),t({type:n("error-text"),value:e()}),t({type:n("error-json"),value:w}),t({type:n("content"),value:c(u([t({type:n("text"),text:e().describe("Text content")}),t({type:n("media"),data:e().describe("Base-64 encoded media data"),mediaType:e().describe("IANA media type")})]))})]),A=t({type:n("tool-result"),toolCallId:e().describe("ID of the tool call that this result is associated with"),toolName:e().describe("Name of the tool that generated this result"),output:H.describe("Result of the tool call"),result:b().describe("Unknown result of the tool call"),providerOptions:f}),X=t({type:n("tool-result"),toolCallId:e().describe("ID of the tool call that this result is associated with"),toolName:e().describe("Name of the tool that generated this result"),result:l().describe("Result of the tool call (JSON-serializable)"),isError:g().optional().describe("Whether the result is an error or error message"),providerExecuted:g().optional().describe("Whether the tool result was generated by the provider"),providerMetadata:l().optional().describe("Additional provider-specific metadata")}),Y=u([t({type:n("source"),sourceType:n("url"),id:e().describe("The ID of the source"),url:e().describe("The URL of the source"),title:e().optional().describe("The title of the source"),providerMetadata:l().optional().describe("Additional provider-specific metadata")}),t({type:n("source"),sourceType:n("document"),id:e().describe("The ID of the source"),mediaType:e().describe("IANA media type of the document (e.g., application/pdf)"),title:e().describe("The title of the document"),filename:e().optional().describe("Optional filename of the document"),providerMetadata:l().optional().describe("Additional provider-specific metadata")})]),Z=t({role:n("system"),content:e().describe("System message content"),providerOptions:f}),Q=t({role:n("user"),content:c(u([E,k])).describe("User message content parts (text or file)"),providerOptions:f}),ee=t({role:n("assistant"),content:c(u([E,k,J,z,A])).describe("Assistant message content parts (text, file, reasoning, tool-call, or tool-result)"),providerOptions:f}),te=t({role:n("tool"),content:c(A).describe("Tool message content (tool results)"),providerOptions:f}),oe=u([Z,Q,ee,te]),ae=c(oe).describe("A list of messages forming the prompt"),ie=t({prompt:ae.describe("A language model prompt is a standardized prompt type (array of messages with roles: system, user, assistant, tool)"),maxOutputTokens:i().optional().describe("Maximum number of tokens to generate"),temperature:i().optional().describe("Temperature setting. The range depends on the provider and model"),topP:i().optional().describe("Nucleus sampling parameter"),topK:i().optional().describe("Only sample from the top K options for each subsequent token. Used to remove long tail low probability responses"),presencePenalty:i().optional().describe("Presence penalty setting. It affects the likelihood of the model to repeat information that is already in the prompt"),frequencyPenalty:i().optional().describe("Frequency penalty setting. It affects the likelihood of the model to repeatedly use the same words or phrases"),seed:i().optional().describe("The seed (integer) to use for random sampling. If set and supported by the model, calls will generate deterministic results"),stopSequences:c(e()).optional().describe("Stop sequences. If set, the model will stop generating text when one of the stop sequences is generated"),responseFormat:u([t({type:n("text")}),t({type:n("json"),schema:l().optional().describe("JSON schema that the generated output should conform to"),name:e().optional().describe("Name of output that should be generated"),description:e().optional().describe("Description of the output that should be generated")})]).optional().describe("Response format. The output can either be text or JSON. Default is text"),tools:c(l()).optional().describe("The tools that are available for the model"),toolChoice:l().optional().describe("Specifies how the tool should be selected. Defaults to 'auto'"),includeRawChunks:g().optional().describe("Include raw chunks in the stream. Only applicable for streaming calls"),abortSignal:l().optional().describe("Abort signal for cancelling the operation"),providerOptions:l().optional().describe("Additional provider-specific options")}),ne=t({content:c(u([q,$,K,V,X,Y])).describe("Ordered content that the model has generated (text, tool-calls, reasoning, files, sources)"),finishReason:x(["stop","length","content-filter","tool-calls","error","other","unknown"]).describe("Reason why generation stopped"),usage:P({inputTokens:i().optional(),outputTokens:i().optional(),totalTokens:i().optional(),reasoningTokens:i().optional()}).describe("Usage information for the language model call"),providerMetadata:l().optional().describe("Additional provider-specific metadata"),request:t({body:l().optional().describe("Request HTTP body sent to the provider API")}).optional().describe("Optional request information for telemetry and debugging"),response:t({id:e().optional().describe("ID for the generated response"),timestamp:U().optional().describe("Timestamp for the start of the generated response"),modelId:e().optional().describe("The ID of the response model that was used"),headers:p(e(),e()).optional().describe("Response headers"),body:l().optional().describe("Response HTTP body")}).optional().describe("Optional response information for telemetry and debugging"),warnings:c(l()).describe("Warnings for the call, e.g. unsupported settings")});t({stream:l().describe("ReadableStream of LanguageModelV2StreamPart"),request:t({body:l().optional().describe("Request HTTP body sent to the provider API")}).optional().describe("Optional request information for telemetry and debugging"),response:t({headers:p(e(),e()).optional().describe("Response headers")}).optional().describe("Optional response data")});const se=t({supportedUrls:p(e(),c(e())).describe("Supported URL patterns by media type for the provider")});t({modelId:e().describe("The ID of the model"),logo:e().nullable(),description:e().nullable(),capabilities:c(e()),limits:t({contextWindow:i(),maxOutputTokens:i()}).nullable(),costs:t({input:i(),output:i()}).nullable(),provider:x(["openai","anthropic","google","x-ai","deepseek","openai-compatible","openrouter"]).nullable()});const N=t({modelId:e().describe("The ID of the model"),callOptions:ie}),re=O.extend({logo:e().nullable(),description:e().nullable(),capabilities:c(e()),limits:t({contextWindow:i(),maxOutputTokens:i()}).nullable(),costs:t({input:i(),output:i()}).nullable(),provider:x(["openai","anthropic","google","xai","deepseek","openai-compatible","openrouter"]).nullable()}),le=T("llm",re,{readOnly:!0}),ce=[{name:"LLM_METADATA",inputSchema:t({modelId:e().describe("The ID of the model")}),outputSchema:se},{name:"LLM_DO_STREAM",inputSchema:N,streamable:!0},{name:"LLM_DO_GENERATE",inputSchema:N,outputSchema:ne},...le],de=t({scopes:c(e()).describe("List of scopes available"),stateSchema:p(e(),b()).describe("JSON Schema (draft-07) defining the state structure")}),pe=[{name:"MCP_CONFIGURATION",inputSchema:t({}),outputSchema:de}],ue=t({toolName:e().describe("Name of the tool to invoke on that connection"),transformCode:e().optional().describe("Pure TypeScript function for data transformation of the tool call result. Must be a TypeScript file that declares the Output interface and exports a default function: `interface Output { ... } export default async function(input): Output { ... }`\n The input will match with the tool call outputSchema. If transformCode is not provided, the tool call result will be used as the step output. \n Providing an transformCode is recommended because it both allows you to transform the data and validate it against a JSON Schema - tools are ephemeral and may return unexpected data.")}),me=t({code:e().describe(`Pure TypeScript function for data transformation. Useful to merge data from multiple steps and transform it. Must be a TypeScript file that declares the Output interface and exports a default function: \`interface Output { ... } export default async function(input): Output { ... }\`
|
|
2
2
|
The input is the resolved value of the references in the input field. Example:
|
|
3
3
|
{
|
|
4
4
|
"input": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as x,K as F,v as U,x as b,t as v}from"./index-
|
|
1
|
+
import{c as x,K as F,v as U,x as b,t as v}from"./index-ZiFjEqyT.js";import{u as w}from"./useMutation-4fnzP4bc.js";import{u as I}from"./project-context-provider-BPo-49FO.js";function A(n,s,i){const t=[];if(n?.trim()){const e=n.trim(),r=i.map(o=>({field:[String(o)],operator:"contains",value:e}));r.length===1&&r[0]?t.push(r[0]):r.length>1&&t.push({operator:"or",conditions:r})}if(s&&s.length>0)for(const e of s)t.push({field:[e.column],operator:"eq",value:e.value});if(t.length!==0)return t.length===1?t[0]:{operator:"and",conditions:t}}function D(n,s,i){const t=n??i,e=s??"asc";return[{field:[String(t)],direction:e}]}function J(n,s,i,t){const e=x.c(14),{org:r}=I();let o;e[0]!==s?(o=s.toUpperCase(),e[0]=s,e[1]=o):o=e[1];const E=`COLLECTION_${o}_GET`;let a;e[2]!==s||e[3]!==i||e[4]!==r.slug||e[5]!==n?(a=F.collectionItem(r.slug,n,s,i??""),e[2]=s,e[3]=i,e[4]=r.slug,e[5]=n,e[6]=a):a=e[6];let c;e[7]!==E||e[8]!==i||e[9]!==t?(c=async()=>i?await t(E,{id:i}):{item:null},e[7]=E,e[8]=i,e[9]=t,e[10]=c):c=e[10];let u;e[11]!==a||e[12]!==c?(u={queryKey:a,queryFn:c,staleTime:6e4},e[11]=a,e[12]=c,e[13]=u):u=e[13];const{data:l}=U(u);return l.item}function K(n,s,i,t){const e=x.c(11),r=t===void 0?{}:t,{org:o}=I(),{searchTerm:L,filters:E,sortKey:a,sortDirection:c,searchFields:u,defaultSortKey:l,pageSize:_}=r,O=u===void 0?["title","description"]:u,S=l===void 0?"updated_at":l,p=_===void 0?100:_;let y;e[0]!==s?(y=s.toUpperCase(),e[0]=s,e[1]=y):y=e[1];const g=`COLLECTION_${y}_LIST`,f=A(L,E,O),m=D(a,c,S),$=JSON.stringify({where:f,orderBy:m,limit:p}),T=F.collectionList(o.slug,n,s,$);let d;e[2]!==g||e[3]!==m||e[4]!==p||e[5]!==i||e[6]!==f?(d=async()=>{const Q={...f&&{where:f},...m&&{orderBy:m},limit:p,offset:0};return(await i(g,Q))?.items??[]},e[2]=g,e[3]=m,e[4]=p,e[5]=i,e[6]=f,e[7]=d):d=e[7];let h;e[8]!==T||e[9]!==d?(h={queryKey:T,queryFn:d},e[8]=T,e[9]=d,e[10]=h):h=e[10];const{data:C}=U(h);return C}function M(n,s,i){const t=x.c(39),{org:e}=I(),r=b();let o;t[0]!==s?(o=s.toUpperCase(),t[0]=s,t[1]=o):o=t[1];const L=o,E=`COLLECTION_${L}_CREATE`,a=`COLLECTION_${L}_UPDATE`,c=`COLLECTION_${L}_DELETE`;let u;t[2]!==E||t[3]!==i?(u=async d=>(await i(E,{data:d})).item,t[2]=E,t[3]=i,t[4]=u):u=t[4];let l;t[5]!==s||t[6]!==e||t[7]!==r||t[8]!==n?(l=()=>{r.invalidateQueries({queryKey:F.collection(e.slug,n,s)}),v.success("Item created successfully")},t[5]=s,t[6]=e,t[7]=r,t[8]=n,t[9]=l):l=t[9];let _;t[10]!==u||t[11]!==l?(_={mutationFn:u,onSuccess:l,onError:P},t[10]=u,t[11]=l,t[12]=_):_=t[12];const O=w(_);let S;t[13]!==i||t[14]!==a?(S=async d=>{const{id:h,data:C}=d;return(await i(a,{id:h,data:C})).item},t[13]=i,t[14]=a,t[15]=S):S=t[15];let p;t[16]!==s||t[17]!==e||t[18]!==r||t[19]!==n?(p=()=>{r.invalidateQueries({queryKey:F.collection(e.slug,n,s)}),v.success("Item updated successfully")},t[16]=s,t[17]=e,t[18]=r,t[19]=n,t[20]=p):p=t[20];let y;t[21]!==S||t[22]!==p?(y={mutationFn:S,onSuccess:p,onError:B},t[21]=S,t[22]=p,t[23]=y):y=t[23];const q=w(y);let g;t[24]!==c||t[25]!==i?(g=async d=>(await i(c,{id:d})).item.id,t[24]=c,t[25]=i,t[26]=g):g=t[26];let f;t[27]!==s||t[28]!==e||t[29]!==r||t[30]!==n?(f=()=>{r.invalidateQueries({queryKey:F.collection(e.slug,n,s)}),v.success("Item deleted successfully")},t[27]=s,t[28]=e,t[29]=r,t[30]=n,t[31]=f):f=t[31];let m;t[32]!==g||t[33]!==f?(m={mutationFn:g,onSuccess:f,onError:z},t[32]=g,t[33]=f,t[34]=m):m=t[34];const $=w(m);let T;return t[35]!==O||t[36]!==$||t[37]!==q?(T={create:O,update:q,delete:$},t[35]=O,t[36]=$,t[37]=q,t[38]=T):T=t[38],T}function z(n){const s=n instanceof Error?n.message:String(n);v.error(`Failed to delete item: ${s}`)}function B(n){const s=n instanceof Error?n.message:String(n);v.error(`Failed to update item: ${s}`)}function P(n){const s=n instanceof Error?n.message:String(n);v.error(`Failed to create item: ${s}`)}export{M as a,K as b,J as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as l}from"./index-
|
|
1
|
+
import{c as l}from"./index-ZiFjEqyT.js";import{c as r}from"./connection-CmMMEDBY.js";import{u as i}from"./project-context-provider-BPo-49FO.js";import{b as m,a as u,u as C}from"./use-collections-g067BPxP.js";function O(t){const o=l.c(3);let e;o[0]!==t?(e=t===void 0?{}:t,o[0]=t,o[1]=e):e=o[1];const n=e,{org:c}=i();let s;o[2]===Symbol.for("react.memo_cache_sentinel")?(s=r(),o[2]=s):s=o[2];const a=s;return m(c.slug,"CONNECTIONS",a,n)}function S(t){const o=l.c(1),{org:e}=i();let n;o[0]===Symbol.for("react.memo_cache_sentinel")?(n=r(),o[0]=n):n=o[0];const c=n;return C(e.slug,"CONNECTIONS",t,c)}function _(){const t=l.c(1),{org:o}=i();let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=r(),t[0]=e):e=t[0];const n=e;return u(o.slug,"CONNECTIONS",n)}export{_ as a,S as b,O as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as f,K as l}from"./index-
|
|
1
|
+
import{c as f,K as l}from"./index-ZiFjEqyT.js";import{u as y}from"./index-CH2G6_zW.js";async function h(t){const e=`/mcp/${t}`,s={"Content-Type":"application/json",Accept:"application/json, text/event-stream"};try{const o=await fetch(e,{method:"POST",headers:s,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"mesh-prompts",version:"1.0.0"}}})});if(!o.ok)return[];if((await o.json()).error)return[];const i=await fetch(e,{method:"POST",headers:s,body:JSON.stringify({jsonrpc:"2.0",id:2,method:"prompts/list",params:{}})});if(!i.ok)return[];const r=await i.json();return r.error?[]:r.result?.prompts||[]}catch{return[]}}function P(t){const e=f.c(13);let s;e[0]!==t?(s=t.map(q),e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s?(o={queries:s},e[2]=s,e[3]=o):o=e[3];const n=y(o);let i,r;if(e[4]!==t||e[5]!==n){r=new Map;let p;e[8]!==n?(p=n.some(j),e[8]=n,e[9]=p):p=e[9],i=p,t.forEach((u,m)=>{const c=n[m];c?.data?r.set(u,c.data.map(d)):r.set(u,[])}),e[4]=t,e[5]=n,e[6]=i,e[7]=r}else i=e[6],r=e[7];let a;return e[10]!==i||e[11]!==r?(a={promptsMap:r,isLoading:i},e[10]=i,e[11]=r,e[12]=a):a=e[12],a}function d(t){return{name:t.name,description:t.description}}function j(t){return t.isLoading}function q(t){return{queryKey:l.connectionPrompts(t),queryFn:()=>h(t),staleTime:6e4,retry:!1}}async function w(t){const e=`/mcp/${t}`,s={"Content-Type":"application/json",Accept:"application/json, text/event-stream"};try{const o=await fetch(e,{method:"POST",headers:s,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"mesh-resources",version:"1.0.0"}}})});if(!o.ok)return[];if((await o.json()).error)return[];const i=await fetch(e,{method:"POST",headers:s,body:JSON.stringify({jsonrpc:"2.0",id:2,method:"resources/list",params:{}})});if(!i.ok)return[];const r=await i.json();return r.error?[]:r.result?.resources||[]}catch{return[]}}function $(t){const e=f.c(13);let s;e[0]!==t?(s=t.map(O),e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s?(o={queries:s},e[2]=s,e[3]=o):o=e[3];const n=y(o);let i,r;if(e[4]!==t||e[5]!==n){r=new Map;let p;e[8]!==n?(p=n.some(g),e[8]=n,e[9]=p):p=e[9],i=p,t.forEach((u,m)=>{const c=n[m];c?.data?r.set(u,c.data.map(S)):r.set(u,[])}),e[4]=t,e[5]=n,e[6]=i,e[7]=r}else i=e[6],r=e[7];let a;return e[10]!==i||e[11]!==r?(a={resourcesMap:r,isLoading:i},e[10]=i,e[11]=r,e[12]=a):a=e[12],a}function S(t){return{uri:t.uri,name:t.name,description:t.description}}function g(t){return t.isLoading}function O(t){return{queryKey:l.connectionResources(t),queryFn:()=>w(t),staleTime:6e4,retry:!1}}export{$ as a,P as u};
|
package/dist/client/assets/{use-create-gateway-UkmAQbcu.js → use-create-gateway-CCmt4GT8.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as m,f as y}from"./index-
|
|
1
|
+
import{c as m,f as y}from"./index-ZiFjEqyT.js";import{a as f}from"./use-gateway-v7etejE8.js";import{u as p}from"./project-context-provider-BPo-49FO.js";function x(a){const e=m.c(10);let o;e[0]!==a?(o=a===void 0?{}:a,e[0]=a,e[1]=o):o=e[1];const d=o,{navigateOnCreate:u}=d,i=u===void 0?!1:u,{org:r}=p(),c=y(),t=f();let s;e[2]!==t.create||e[3]!==c||e[4]!==i||e[5]!==r?(s=async()=>{const l=await t.create.mutateAsync({title:"New Agent",description:"Agents let you securely expose integrated tools to the outside world.",status:"active",tool_selection_mode:"inclusion",connections:[]});return i&&c({to:"/$org/gateways/$gatewayId",params:{org:r.slug,gatewayId:l.id}}),{id:l.id,gateway:l}},e[2]=t.create,e[3]=c,e[4]=i,e[5]=r,e[6]=s):s=e[6];const g=s;let n;return e[7]!==t.create.isPending||e[8]!==g?(n={createGateway:g,isCreating:t.create.isPending},e[7]=t.create.isPending,e[8]=g,e[9]=n):n=e[9],n}export{x as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as a}from"./index-
|
|
1
|
+
import{c as a}from"./index-ZiFjEqyT.js";import{u as S}from"./project-context-provider-BPo-49FO.js";import{u as L,L as x}from"./localstorage-keys-DhdYpXZj.js";function A(e){const t=a.c(9),{locator:c}=S();let o;t[0]!==c?(o=x.gatewaySystemPrompts(c),t[0]=c,t[1]=o):o=t[1];let s;t[2]===Symbol.for("react.memo_cache_sentinel")?(s={},t[2]=s):s=t[2];const[u,l]=L(o,s),n=e?u[e]??"":"";let r;t[3]!==e||t[4]!==l?(r=f=>{e&&l(p=>({...p,[e]:f}))},t[3]=e,t[4]=l,t[5]=r):r=t[5];const i=r;let m;return t[6]!==i||t[7]!==n?(m=[n,i],t[6]=i,t[7]=n,t[8]=m):m=t[8],m}export{A as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,c as a}from"./index-
|
|
1
|
+
import{r as i,c as a}from"./index-ZiFjEqyT.js";import{c as n}from"./connection-CmMMEDBY.js";import{u as l}from"./project-context-provider-BPo-49FO.js";import{b as u,a as f,u as h}from"./use-collections-g067BPxP.js";const C=({size:o=24,color:e="currentColor",...t})=>i.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},i.createElement("path",{d:"M9 2v3m6-3v3M9 19v3m6-3v3m4-13h3m-3 5h3M2 9h3m-3 5h3m4.8 5h4.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C19 16.72 19 15.88 19 14.2V9.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C16.72 5 15.88 5 14.2 5H9.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C5 7.28 5 8.12 5 9.8v4.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C7.28 19 8.12 19 9.8 19Z"}));C.displayName="CpuChip02";function g(o){const e=a.c(3);let t;e[0]!==o?(t=o===void 0?{}:o,e[0]=o,e[1]=t):t=e[1];const s=t,{org:c}=l();let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=n(),e[2]=r):r=e[2];const m=r;return u(c.slug,"GATEWAY",m,s)}function A(o){const e=a.c(1),{org:t}=l();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=n(),e[0]=s):s=e[0];const c=s;return h(t.slug,"GATEWAY",o??void 0,c)}function G(){const o=a.c(1),{org:e}=l();let t;o[0]===Symbol.for("react.memo_cache_sentinel")?(t=n(),o[0]=t):t=o[0];const s=t;return f(e.slug,"GATEWAY",s)}export{G as a,A as b,C as i,g as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,c as T}from"./index-
|
|
1
|
+
import{r as a,c as T}from"./index-ZiFjEqyT.js";import{u as D}from"./use-mobile-Co7MtEW-.js";const W=({size:l=24,color:e="currentColor",...t})=>a.createElement("svg",{viewBox:"0 0 24 24",width:l,height:l,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},a.createElement("path",{d:"M2.42 12.713c-.136-.215-.204-.323-.242-.49a1.173 1.173 0 0 1 0-.446c.038-.167.106-.274.242-.49C3.546 9.505 6.895 5 12 5s8.455 4.505 9.58 6.287c.137.215.205.323.243.49.029.125.029.322 0 .446-.038.167-.106.274-.242.49C20.455 14.495 17.105 19 12 19c-5.106 0-8.455-4.505-9.58-6.287Z"}),a.createElement("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"}));W.displayName="Eye";function k(l){const e=`deco-filters-${l}`,[t,c]=a.useState(()=>{try{const o=globalThis.localStorage?.getItem(e);if(o)return JSON.parse(o)}catch(o){console.error("Failed to parse stored filters:",o)}return[]});return[t,o=>{c(o);try{globalThis.localStorage?.setItem(e,JSON.stringify(o))}catch(i){console.error("Failed to save filters:",i)}}]}function C(l){const e=T.c(7),[t,c]=a.useState(l),[s,o]=a.useState(l?"desc":null);let i;e[0]!==s||e[1]!==t?(i=h=>{t!==h?(c(h),o("asc")):s==="asc"?o("desc"):s==="desc"&&(c(void 0),o(null))},e[0]=s,e[1]=t,e[2]=i):i=e[2];const u=i;let r;return e[3]!==u||e[4]!==s||e[5]!==t?(r={sortKey:t,sortDirection:s,handleSort:u},e[3]=u,e[4]=s,e[5]=t,e[6]=r):r=e[6],r}function L(l,e){const t=T.c(12),c=e===void 0?"cards":e,s=D(),o=a.useRef(s),i=l?`deco-view-mode-${l}`:"deco-view-mode";let u;t[0]!==c||t[1]!==i?(u=()=>{const d=globalThis.localStorage?.getItem(i);return d==="cards"||d==="table"?d:c},t[0]=c,t[1]=i,t[2]=u):u=t[2];const[r,h]=a.useState(u);let f;t[3]!==i?(f=d=>{h(d),globalThis.localStorage?.setItem(i,d)},t[3]=i,t[4]=f):f=t[4];const p=f;let S,g;t[5]!==s||t[6]!==r?(S=()=>{!o.current&&s&&r==="table"&&h("cards"),o.current=s},g=[s,r],t[5]=s,t[6]=r,t[7]=S,t[8]=g):(S=t[7],g=t[8]),a.useEffect(S,g);let n;return t[9]!==p||t[10]!==r?(n=[r,p],t[9]=p,t[10]=r,t[11]=n):n=t[11],n}function O(l){const e=T.c(20),{namespace:t,resource:c,defaultSortKey:s,defaultViewMode:o}=l,i=s===void 0?"title":s,u=o===void 0?"table":o,[r,h]=a.useState(""),f=a.useDeferredValue(r),p=`${t}-${c}`,[S,g]=k(p),n=`mesh-${c}-filter-visible-${t}`;let d;e[0]!==n?(d=()=>globalThis.localStorage?.getItem(n)==="true",e[0]=n,e[1]=d):d=e[1];const[m,B]=a.useState(d);let y;e[2]!==n?(y=I=>{B(I),globalThis.localStorage?.setItem(n,String(I))},e[2]=n,e[3]=y):y=e[3];const b=y;let M;e[4]!==m||e[5]!==b?(M=()=>{b(!m)},e[4]=m,e[5]=b,e[6]=M):M=e[6];const w=M,[V,$]=L(`mesh-${c}-${t}`,u),{sortKey:x,sortDirection:F,handleSort:K}=C(i),E=x;let v;return e[7]!==m||e[8]!==S||e[9]!==K||e[10]!==r||e[11]!==f||e[12]!==b||e[13]!==g||e[14]!==$||e[15]!==F||e[16]!==E||e[17]!==w||e[18]!==V?(v={search:r,searchTerm:f,setSearch:h,filters:S,setFilters:g,filterBarVisible:m,setFilterBarVisible:b,toggleFilterBar:w,viewMode:V,setViewMode:$,sortKey:E,sortDirection:F,handleSort:K},e[7]=m,e[8]=S,e[9]=K,e[10]=r,e[11]=f,e[12]=b,e[13]=g,e[14]=$,e[15]=F,e[16]=E,e[17]=w,e[18]=V,e[19]=v):v=e[19],v}export{W as s,O as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as E,K as b}from"./index-
|
|
1
|
+
import{c as E,K as b}from"./index-ZiFjEqyT.js";import{u as j}from"./useQuery-Bn2Wcch_.js";function T(g){const e=E.c(18),{url:o,token:r,enabled:w}=g,$=w===void 0?!0:w;let i;e[0]!==r||e[1]!==o?(i=b.mcpTools(o,r),e[0]=r,e[1]=o,e[2]=i):i=e[2];let s;e[3]!==r||e[4]!==o?(s=async()=>{if(!o)return[];const m={"Content-Type":"application/json",Accept:"application/json, text/event-stream"};r&&(m.Authorization=`Bearer ${r}`);const u=await fetch(o,{method:"POST",headers:m,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"mesh-mcp",version:"1.0.0"}}})});if(!u.ok)throw new Error(`MCP initialization failed: ${u.status}`);const h=await u.json();if(h.error)throw new Error(`MCP initialization error: ${h.error.message} (code: ${h.error.code})`);const y=await fetch(o,{method:"POST",headers:m,body:JSON.stringify({jsonrpc:"2.0",id:2,method:"tools/list",params:{}})});if(!y.ok)throw new Error(`Failed to list tools: ${y.status}`);const l=await y.json();if(l.error)throw new Error(`Failed to list tools: ${l.error.message} (code: ${l.error.code})`);return l.result?.tools||[]},e[3]=r,e[4]=o,e[5]=s):s=e[5];const d=$&&!!o;let a;e[6]!==i||e[7]!==s||e[8]!==d?(a={queryKey:i,queryFn:s,enabled:d,staleTime:3e4,retry:!1},e[6]=i,e[7]=s,e[8]=d,e[9]=a):a=e[9];const t=j(a),f=o?t.isLoading?"connecting":t.isError?"error":"ready":"disconnected";let n;e[10]!==t.data?(n=t.data||[],e[10]=t.data,e[11]=n):n=e[11];const p=t.error;let c;return e[12]!==t.isLoading||e[13]!==t.refetch||e[14]!==f||e[15]!==n||e[16]!==p?(c={tools:n,state:f,error:p,isLoading:t.isLoading,refetch:t.refetch},e[12]=t.isLoading,e[13]=t.refetch,e[14]=f,e[15]=n,e[16]=p,e[17]=c):c=e[17],c}export{T as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as o,v as n,K as u,a as i}from"./index-
|
|
1
|
+
import{c as o,v as n,K as u,a as i}from"./index-ZiFjEqyT.js";import{u as a}from"./project-context-provider-BPo-49FO.js";function p(){const e=o.c(4),{locator:s}=a();let t;e[0]!==s?(t=u.members(s),e[0]=s,e[1]=t):t=e[1];let r;return e[2]!==t?(r={queryKey:t,queryFn:m},e[2]=t,e[3]=r):r=e[3],n(r)}function m(){return i.organization.listMembers()}export{p as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as m,r}from"./index-
|
|
1
|
+
import{c as m,r}from"./index-ZiFjEqyT.js";const a=768,o=()=>globalThis.innerWidth<a;function u(){const e=m.c(2),[l,n]=r.useState(o);let t,s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=()=>{const i=()=>n(o),c=globalThis.matchMedia(`(max-width: ${a-1}px)`);return c.addEventListener("change",i),n(o),()=>c.removeEventListener("change",i)},s=[],e[0]=t,e[1]=s):(t=e[0],s=e[1]),r.useEffect(t,s),l}export{u};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{r as z,c as q,j as p,x as ga,d as kt,K as Pt,t as Fe,I as va,J as ya,L as ba,M as J,z as g,_ as ke,Q as Dt,U as xa,V as _a,W as wa,X as V,Y as Ie,Z as Re,y as O,$ as _,a0 as ie,a1 as Ea,a2 as M,a3 as Ia,a4 as Sa,f as $t,v as Na}from"./index-C5FDJtAp.js";import{c as G,B as Pe}from"./button-ClkQLR3o.js";import{u as Qe}from"./project-context-provider-DH0iqA5D.js";import{g as Ta,h as Ra,j as Ca,k as Aa,c as ja,l as Oa,S as lt,m as Ma}from"./index-hEHbC4y4.js";import{u as ka}from"./use-gateway-system-prompt-CYi0Zo4K.js";import{I as Pa,E as Da}from"./empty-state-C0gi-aAx.js";import{b as Xe,a as Ke,P as et}from"./popover-DLFe45bO.js";import{t as $a}from"./ChevronDown-QF_Tgl2v.js";import{i as Za}from"./use-gateway-D_zdUoI4.js";import{i as La}from"./Edit01-DVUwOcf8.js";import{c as tt,b as at,T as st,a as Zt}from"./tooltip-DXYcokUT.js";import{a as Ua}from"./use-connection-ClVfoZWG.js";import{O as za,a as Ba,g as Fa}from"./well-known-mcp-D13f-8h2.js";import{g as Va}from"./generate-id-Dyweu44Y.js";import{s as ct}from"./Clock-CiIkKpUg.js";import{i as qa}from"./SearchMd-tLR3QB8E.js";import{s as Ja}from"./Trash01-Dg5Q9OUO.js";import{u as Wa,L as Ga}from"./localstorage-keys-BZEjwsD0.js";var Se;(function(t){t.assertEqual=r=>{};function e(r){}t.assertIs=e;function a(r){throw new Error}t.assertNever=a,t.arrayToEnum=r=>{const n={};for(const i of r)n[i]=i;return n},t.getValidEnumValues=r=>{const n=t.objectKeys(r).filter(o=>typeof r[r[o]]!="number"),i={};for(const o of n)i[o]=r[o];return t.objectValues(i)},t.objectValues=r=>t.objectKeys(r).map(function(n){return r[n]}),t.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const n=[];for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&n.push(i);return n},t.find=(r,n)=>{for(const i of r)if(n(i))return i},t.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function s(r,n=" | "){return r.map(i=>typeof i=="string"?`'${i}'`:i).join(n)}t.joinValues=s,t.jsonStringifyReplacer=(r,n)=>typeof n=="bigint"?n.toString():n})(Se||(Se={}));var ut;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(ut||(ut={}));Se.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);Se.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"]);class De extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}format(e){const a=e||function(n){return n.message},s={_errors:[]},r=n=>{for(const i of n.issues)if(i.code==="invalid_union")i.unionErrors.map(r);else if(i.code==="invalid_return_type")r(i.returnTypeError);else if(i.code==="invalid_arguments")r(i.argumentsError);else if(i.path.length===0)s._errors.push(a(i));else{let o=s,c=0;for(;c<i.path.length;){const l=i.path[c];c===i.path.length-1?(o[l]=o[l]||{_errors:[]},o[l]._errors.push(a(i))):o[l]=o[l]||{_errors:[]},o=o[l],c++}}};return r(this),s}static assert(e){if(!(e instanceof De))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Se.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){const a=Object.create(null),s=[];for(const r of this.issues)if(r.path.length>0){const n=r.path[0];a[n]=a[n]||[],a[n].push(e(r))}else s.push(e(r));return{formErrors:s,fieldErrors:a}}get formErrors(){return this.flatten()}}De.create=t=>new De(t);var dt;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(dt||(dt={}));var E;(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"})(E||(E={}));const Lt=({size:t=24,color:e="currentColor",...a})=>z.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...a},z.createElement("path",{d:"m15 9-6 6m0-6 6 6m7-3c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));Lt.displayName="XCircle";function gn(){const t=q.c(7);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=p.jsx("div",{className:"size-6 rounded-lg bg-muted animate-pulse"}),t[0]=e):e=t[0];let a;t[1]===Symbol.for("react.memo_cache_sentinel")?(a=p.jsxs("div",{className:"flex items-center gap-3",children:[e,p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsx("div",{className:"h-3.5 w-28 rounded bg-muted animate-pulse"}),p.jsx("div",{className:"h-3 w-40 rounded bg-muted/60 animate-pulse"})]})]}),t[1]=a):a=t[1];let s;t[2]===Symbol.for("react.memo_cache_sentinel")?(s=p.jsx("div",{className:"flex items-center h-12 flex-none border-b border-border/80 px-4",children:p.jsxs("div",{className:"flex items-center justify-between gap-3 w-full",children:[a,p.jsxs("div",{className:"flex items-end gap-2",children:[p.jsx("div",{className:"h-6 w-6 rounded-full bg-muted animate-pulse"}),p.jsx("div",{className:"h-6 w-6 rounded-lg bg-muted animate-pulse"})]})]})}),t[2]=s):s=t[2];let r;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=p.jsx("div",{className:"flex-1 overflow-hidden px-4 py-4",children:p.jsxs("div",{className:"mx-auto flex w-full max-w-2xl flex-col gap-4",children:[p.jsx(je,{align:"right",width:"w-3/4"}),p.jsx(je,{align:"left",width:"w-full",lines:3}),p.jsx(je,{align:"right",width:"w-2/3"}),p.jsx(je,{align:"left",width:"w-5/6",lines:2})]})}),t[3]=r):r=t[3];let n;t[4]===Symbol.for("react.memo_cache_sentinel")?(n=p.jsx("div",{className:"relative flex flex-1 flex-col gap-2 p-2.5",children:p.jsx("div",{className:"relative flex-1",children:p.jsxs("div",{className:"space-y-2 p-2",children:[p.jsx("div",{className:"h-3 w-full rounded bg-muted/40 animate-pulse"}),p.jsx("div",{className:"h-3 w-4/5 rounded bg-muted/40 animate-pulse"})]})})}),t[4]=n):n=t[4];let i;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=p.jsx("div",{className:"flex items-center gap-1",children:p.jsx("div",{className:"size-8 rounded-full bg-muted/60 animate-pulse"})}),t[5]=i):i=t[5];let o;return t[6]===Symbol.for("react.memo_cache_sentinel")?(o=p.jsxs("div",{className:"flex h-full w-full flex-col bg-sidebar",children:[s,r,p.jsx("div",{className:"px-4 py-4",children:p.jsx("div",{className:"mx-auto w-full max-w-2xl",children:p.jsxs("div",{className:"relative flex min-h-[130px] flex-col rounded-xl border border-border bg-background shadow-sm",children:[n,p.jsxs("div",{className:"flex items-center justify-between px-2.5 pb-2.5",children:[i,p.jsxs("div",{className:"flex items-center gap-1",children:[p.jsx("div",{className:"h-8 w-32 rounded-lg bg-muted/60 animate-pulse"}),p.jsx("div",{className:"size-8 rounded-full bg-muted animate-pulse"})]})]})]})})})]}),t[6]=o):o=t[6],o}function je(t){const e=q.c(22),{align:a,width:s,lines:r}=t,n=s===void 0?"w-full":s,i=r===void 0?1:r,o=a==="right"?"flex-row-reverse":"flex-row";let c;e[0]!==o?(c=G("flex w-full gap-4 px-4 py-2",o),e[0]=o,e[1]=c):c=e[1];const l=a==="right"?"ml-auto max-w-3/4 items-end":"w-full items-start";let d;e[2]!==l?(d=G("flex min-w-0 flex-col gap-2",l),e[2]=l,e[3]=d):d=e[3];let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=p.jsx("div",{className:"h-3 w-16 rounded bg-muted/40 animate-pulse"}),e[4]=m):m=e[4];const h=a==="right"?"bg-muted":"bg-transparent border border-border/40";let f;e[5]!==h||e[6]!==n?(f=G("min-w-0 rounded-2xl p-4",h,n),e[5]=h,e[6]=n,e[7]=f):f=e[7];let v;e[8]!==i?(v=Array.from({length:i}),e[8]=i,e[9]=v):v=e[9];let y;e[10]!==i||e[11]!==v?(y=p.jsx("div",{className:"space-y-2",children:v.map((u,T)=>p.jsx("div",{className:G("h-3 rounded bg-muted-foreground/20 animate-pulse",T===i-1?"w-3/4":"w-full"),style:{animationDelay:`${T*.1}s`}},T))}),e[10]=i,e[11]=v,e[12]=y):y=e[12];let b;e[13]!==y||e[14]!==f?(b=p.jsx("div",{className:f,children:y}),e[13]=y,e[14]=f,e[15]=b):b=e[15];let x;e[16]!==b||e[17]!==d?(x=p.jsxs("div",{className:d,children:[m,b]}),e[16]=b,e[17]=d,e[18]=x):x=e[18];let S;return e[19]!==x||e[20]!==c?(S=p.jsx("div",{className:c,children:x}),e[19]=x,e[20]=c,e[21]=S):S=e[21],S}function vn(){const t=q.c(5),e=ga(),{org:a}=Qe();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},t[0]=s):s=t[0];const r=kt(s);let n;return t[1]!==a||t[2]!==r||t[3]!==e?(n=i=>{const c=i.toolCall.toolName.match(/^COLLECTION_([A-Z_]+)_(CREATE|UPDATE|DELETE)$/);if(!c||!c[1])return;const l=c[1],d=r.connectionId;if(!d)return;e.invalidateQueries({queryKey:Pt.collection(a.slug,d,l)});const m=l.toLowerCase().replace(/_/g," ");Fe.success(`${m} updated`)},t[1]=a,t[2]=r,t[3]=e,t[4]=n):n=t[4],n}var Ut="vercel.ai.error",Ya=Symbol.for(Ut),pt,mt,oe=class zt extends(mt=Error,pt=Ya,mt){constructor({name:e,message:a,cause:s}){super(a),this[pt]=!0,this.name=e,this.cause=s}static isInstance(e){return zt.hasMarker(e,Ut)}static hasMarker(e,a){const s=Symbol.for(a);return e!=null&&typeof e=="object"&&s in e&&typeof e[s]=="boolean"&&e[s]===!0}};function Bt(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var Ft="AI_InvalidArgumentError",Vt=`vercel.ai.error.${Ft}`,Ha=Symbol.for(Vt),ft,ht,Qa=class extends(ht=oe,ft=Ha,ht){constructor({message:t,cause:e,argument:a}){super({name:Ft,message:t,cause:e}),this[ft]=!0,this.argument=a}static isInstance(t){return oe.hasMarker(t,Vt)}},qt="AI_JSONParseError",Jt=`vercel.ai.error.${qt}`,Xa=Symbol.for(Jt),gt,vt,yt=class extends(vt=oe,gt=Xa,vt){constructor({text:t,cause:e}){super({name:qt,message:`JSON parsing failed: Text: ${t}.
|
|
1
|
+
import{r as z,c as q,j as p,x as ga,d as kt,K as Pt,t as Fe,I as va,J as ya,L as ba,M as J,z as g,_ as ke,Q as Dt,U as xa,V as _a,W as wa,X as V,Y as Ie,Z as Re,y as O,$ as _,a0 as ie,a1 as Ea,a2 as M,a3 as Ia,a4 as Sa,f as $t,v as Na}from"./index-ZiFjEqyT.js";import{c as G,B as Pe}from"./button-Co_HOc3E.js";import{u as Qe}from"./project-context-provider-BPo-49FO.js";import{g as Ta,h as Ra,j as Ca,k as Aa,c as ja,l as Oa,S as lt,m as Ma}from"./index-Bc30BcYv.js";import{u as ka}from"./use-gateway-system-prompt-DoCpWoeh.js";import{I as Pa,E as Da}from"./empty-state-B1DU5702.js";import{b as Xe,a as Ke,P as et}from"./popover-DW05feED.js";import{t as $a}from"./ChevronDown-CJaS1NVA.js";import{i as Za}from"./use-gateway-v7etejE8.js";import{i as La}from"./Edit01-MWKLkbpZ.js";import{c as tt,b as at,T as st,a as Zt}from"./tooltip-BJO9sFhZ.js";import{a as Ua}from"./use-connection-BskZam-G.js";import{O as za,a as Ba,g as Fa}from"./well-known-mcp-D13f-8h2.js";import{g as Va}from"./generate-id-Dyweu44Y.js";import{s as ct}from"./Clock-ljBuaWDA.js";import{i as qa}from"./SearchMd-B_A85eif.js";import{s as Ja}from"./Trash01-GrzirNvV.js";import{u as Wa,L as Ga}from"./localstorage-keys-DhdYpXZj.js";var Se;(function(t){t.assertEqual=r=>{};function e(r){}t.assertIs=e;function a(r){throw new Error}t.assertNever=a,t.arrayToEnum=r=>{const n={};for(const i of r)n[i]=i;return n},t.getValidEnumValues=r=>{const n=t.objectKeys(r).filter(o=>typeof r[r[o]]!="number"),i={};for(const o of n)i[o]=r[o];return t.objectValues(i)},t.objectValues=r=>t.objectKeys(r).map(function(n){return r[n]}),t.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const n=[];for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&n.push(i);return n},t.find=(r,n)=>{for(const i of r)if(n(i))return i},t.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function s(r,n=" | "){return r.map(i=>typeof i=="string"?`'${i}'`:i).join(n)}t.joinValues=s,t.jsonStringifyReplacer=(r,n)=>typeof n=="bigint"?n.toString():n})(Se||(Se={}));var ut;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(ut||(ut={}));Se.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);Se.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"]);class De extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}format(e){const a=e||function(n){return n.message},s={_errors:[]},r=n=>{for(const i of n.issues)if(i.code==="invalid_union")i.unionErrors.map(r);else if(i.code==="invalid_return_type")r(i.returnTypeError);else if(i.code==="invalid_arguments")r(i.argumentsError);else if(i.path.length===0)s._errors.push(a(i));else{let o=s,c=0;for(;c<i.path.length;){const l=i.path[c];c===i.path.length-1?(o[l]=o[l]||{_errors:[]},o[l]._errors.push(a(i))):o[l]=o[l]||{_errors:[]},o=o[l],c++}}};return r(this),s}static assert(e){if(!(e instanceof De))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Se.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){const a=Object.create(null),s=[];for(const r of this.issues)if(r.path.length>0){const n=r.path[0];a[n]=a[n]||[],a[n].push(e(r))}else s.push(e(r));return{formErrors:s,fieldErrors:a}}get formErrors(){return this.flatten()}}De.create=t=>new De(t);var dt;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(dt||(dt={}));var E;(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"})(E||(E={}));const Lt=({size:t=24,color:e="currentColor",...a})=>z.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...a},z.createElement("path",{d:"m15 9-6 6m0-6 6 6m7-3c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));Lt.displayName="XCircle";function gn(){const t=q.c(7);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=p.jsx("div",{className:"size-6 rounded-lg bg-muted animate-pulse"}),t[0]=e):e=t[0];let a;t[1]===Symbol.for("react.memo_cache_sentinel")?(a=p.jsxs("div",{className:"flex items-center gap-3",children:[e,p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsx("div",{className:"h-3.5 w-28 rounded bg-muted animate-pulse"}),p.jsx("div",{className:"h-3 w-40 rounded bg-muted/60 animate-pulse"})]})]}),t[1]=a):a=t[1];let s;t[2]===Symbol.for("react.memo_cache_sentinel")?(s=p.jsx("div",{className:"flex items-center h-12 flex-none border-b border-border/80 px-4",children:p.jsxs("div",{className:"flex items-center justify-between gap-3 w-full",children:[a,p.jsxs("div",{className:"flex items-end gap-2",children:[p.jsx("div",{className:"h-6 w-6 rounded-full bg-muted animate-pulse"}),p.jsx("div",{className:"h-6 w-6 rounded-lg bg-muted animate-pulse"})]})]})}),t[2]=s):s=t[2];let r;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=p.jsx("div",{className:"flex-1 overflow-hidden px-4 py-4",children:p.jsxs("div",{className:"mx-auto flex w-full max-w-2xl flex-col gap-4",children:[p.jsx(je,{align:"right",width:"w-3/4"}),p.jsx(je,{align:"left",width:"w-full",lines:3}),p.jsx(je,{align:"right",width:"w-2/3"}),p.jsx(je,{align:"left",width:"w-5/6",lines:2})]})}),t[3]=r):r=t[3];let n;t[4]===Symbol.for("react.memo_cache_sentinel")?(n=p.jsx("div",{className:"relative flex flex-1 flex-col gap-2 p-2.5",children:p.jsx("div",{className:"relative flex-1",children:p.jsxs("div",{className:"space-y-2 p-2",children:[p.jsx("div",{className:"h-3 w-full rounded bg-muted/40 animate-pulse"}),p.jsx("div",{className:"h-3 w-4/5 rounded bg-muted/40 animate-pulse"})]})})}),t[4]=n):n=t[4];let i;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=p.jsx("div",{className:"flex items-center gap-1",children:p.jsx("div",{className:"size-8 rounded-full bg-muted/60 animate-pulse"})}),t[5]=i):i=t[5];let o;return t[6]===Symbol.for("react.memo_cache_sentinel")?(o=p.jsxs("div",{className:"flex h-full w-full flex-col bg-sidebar",children:[s,r,p.jsx("div",{className:"px-4 py-4",children:p.jsx("div",{className:"mx-auto w-full max-w-2xl",children:p.jsxs("div",{className:"relative flex min-h-[130px] flex-col rounded-xl border border-border bg-background shadow-sm",children:[n,p.jsxs("div",{className:"flex items-center justify-between px-2.5 pb-2.5",children:[i,p.jsxs("div",{className:"flex items-center gap-1",children:[p.jsx("div",{className:"h-8 w-32 rounded-lg bg-muted/60 animate-pulse"}),p.jsx("div",{className:"size-8 rounded-full bg-muted animate-pulse"})]})]})]})})})]}),t[6]=o):o=t[6],o}function je(t){const e=q.c(22),{align:a,width:s,lines:r}=t,n=s===void 0?"w-full":s,i=r===void 0?1:r,o=a==="right"?"flex-row-reverse":"flex-row";let c;e[0]!==o?(c=G("flex w-full gap-4 px-4 py-2",o),e[0]=o,e[1]=c):c=e[1];const l=a==="right"?"ml-auto max-w-3/4 items-end":"w-full items-start";let d;e[2]!==l?(d=G("flex min-w-0 flex-col gap-2",l),e[2]=l,e[3]=d):d=e[3];let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=p.jsx("div",{className:"h-3 w-16 rounded bg-muted/40 animate-pulse"}),e[4]=m):m=e[4];const h=a==="right"?"bg-muted":"bg-transparent border border-border/40";let f;e[5]!==h||e[6]!==n?(f=G("min-w-0 rounded-2xl p-4",h,n),e[5]=h,e[6]=n,e[7]=f):f=e[7];let v;e[8]!==i?(v=Array.from({length:i}),e[8]=i,e[9]=v):v=e[9];let y;e[10]!==i||e[11]!==v?(y=p.jsx("div",{className:"space-y-2",children:v.map((u,T)=>p.jsx("div",{className:G("h-3 rounded bg-muted-foreground/20 animate-pulse",T===i-1?"w-3/4":"w-full"),style:{animationDelay:`${T*.1}s`}},T))}),e[10]=i,e[11]=v,e[12]=y):y=e[12];let b;e[13]!==y||e[14]!==f?(b=p.jsx("div",{className:f,children:y}),e[13]=y,e[14]=f,e[15]=b):b=e[15];let x;e[16]!==b||e[17]!==d?(x=p.jsxs("div",{className:d,children:[m,b]}),e[16]=b,e[17]=d,e[18]=x):x=e[18];let S;return e[19]!==x||e[20]!==c?(S=p.jsx("div",{className:c,children:x}),e[19]=x,e[20]=c,e[21]=S):S=e[21],S}function vn(){const t=q.c(5),e=ga(),{org:a}=Qe();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},t[0]=s):s=t[0];const r=kt(s);let n;return t[1]!==a||t[2]!==r||t[3]!==e?(n=i=>{const c=i.toolCall.toolName.match(/^COLLECTION_([A-Z_]+)_(CREATE|UPDATE|DELETE)$/);if(!c||!c[1])return;const l=c[1],d=r.connectionId;if(!d)return;e.invalidateQueries({queryKey:Pt.collection(a.slug,d,l)});const m=l.toLowerCase().replace(/_/g," ");Fe.success(`${m} updated`)},t[1]=a,t[2]=r,t[3]=e,t[4]=n):n=t[4],n}var Ut="vercel.ai.error",Ya=Symbol.for(Ut),pt,mt,oe=class zt extends(mt=Error,pt=Ya,mt){constructor({name:e,message:a,cause:s}){super(a),this[pt]=!0,this.name=e,this.cause=s}static isInstance(e){return zt.hasMarker(e,Ut)}static hasMarker(e,a){const s=Symbol.for(a);return e!=null&&typeof e=="object"&&s in e&&typeof e[s]=="boolean"&&e[s]===!0}};function Bt(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var Ft="AI_InvalidArgumentError",Vt=`vercel.ai.error.${Ft}`,Ha=Symbol.for(Vt),ft,ht,Qa=class extends(ht=oe,ft=Ha,ht){constructor({message:t,cause:e,argument:a}){super({name:Ft,message:t,cause:e}),this[ft]=!0,this.argument=a}static isInstance(t){return oe.hasMarker(t,Vt)}},qt="AI_JSONParseError",Jt=`vercel.ai.error.${qt}`,Xa=Symbol.for(Jt),gt,vt,yt=class extends(vt=oe,gt=Xa,vt){constructor({text:t,cause:e}){super({name:qt,message:`JSON parsing failed: Text: ${t}.
|
|
2
2
|
Error message: ${Bt(e)}`,cause:e}),this[gt]=!0,this.text=t}static isInstance(t){return oe.hasMarker(t,Jt)}},Wt="AI_TypeValidationError",Gt=`vercel.ai.error.${Wt}`,Ka=Symbol.for(Gt),bt,xt,xe=class Ve extends(xt=oe,bt=Ka,xt){constructor({value:e,cause:a}){super({name:Wt,message:`Type validation failed: Value: ${JSON.stringify(e)}.
|
|
3
3
|
Error message: ${Bt(a)}`,cause:a}),this[bt]=!0,this.value=e}static isInstance(e){return oe.hasMarker(e,Gt)}static wrap({value:e,cause:a}){return Ve.isInstance(a)&&a.value===e?a:new Ve({value:e,cause:a})}},Ce=({prefix:t,size:e=16,alphabet:a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:s="-"}={})=>{const r=()=>{const n=a.length,i=new Array(e);for(let o=0;o<e;o++)i[o]=a[Math.random()*n|0];return i.join("")};if(t==null)return r;if(a.includes(s))throw new Qa({argument:"separator",message:`The separator "${s}" must not be part of the alphabet "${a}".`});return()=>`${t}${s}${r()}`},es=Ce();function _t(t=globalThis){var e,a,s;return t.window?"runtime/browser":(e=t.navigator)!=null&&e.userAgent?`runtime/${t.navigator.userAgent.toLowerCase()}`:(s=(a=t.process)==null?void 0:a.versions)!=null&&s.node?`runtime/node.js/${t.process.version.substring(0)}`:t.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function pe(t){if(t==null)return{};const e={};if(t instanceof Headers)t.forEach((a,s)=>{e[s.toLowerCase()]=a});else{Array.isArray(t)||(t=Object.entries(t));for(const[a,s]of t)s!=null&&(e[a.toLowerCase()]=s)}return e}function wt(t,...e){const a=new Headers(pe(t)),s=a.get("user-agent")||"";return a.set("user-agent",[s,...e].filter(Boolean).join(" ")),Object.fromEntries(a.entries())}var ts=/"__proto__"\s*:/,as=/"constructor"\s*:/;function Et(t){const e=JSON.parse(t);return e===null||typeof e!="object"||ts.test(t)===!1&&as.test(t)===!1?e:ss(e)}function ss(t){let e=[t];for(;e.length;){const a=e;e=[];for(const s of a){if(Object.prototype.hasOwnProperty.call(s,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(s,"constructor")&&Object.prototype.hasOwnProperty.call(s.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const r in s){const n=s[r];n&&typeof n=="object"&&e.push(n)}}}return t}function rs(t){const{stackTraceLimit:e}=Error;try{Error.stackTraceLimit=0}catch{return Et(t)}try{return Et(t)}finally{Error.stackTraceLimit=e}}function rt(t){if(t.type==="object"||Array.isArray(t.type)&&t.type.includes("object")){t.additionalProperties=!1;const{properties:a}=t;if(a!=null)for(const s of Object.keys(a))a[s]=de(a[s])}t.items!=null&&(t.items=Array.isArray(t.items)?t.items.map(de):de(t.items)),t.anyOf!=null&&(t.anyOf=t.anyOf.map(de)),t.allOf!=null&&(t.allOf=t.allOf.map(de)),t.oneOf!=null&&(t.oneOf=t.oneOf.map(de));const{definitions:e}=t;if(e!=null)for(const a of Object.keys(e))e[a]=de(e[a]);return t}function de(t){return typeof t=="boolean"?t:rt(t)}var ns=Symbol("Let zodToJsonSchema decide on which parser to use"),It={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},os=t=>typeof t=="string"?{...It,name:t}:{...It,...t};function Y(){return{}}function is(t,e){var a,s,r;const n={type:"array"};return(a=t.type)!=null&&a._def&&((r=(s=t.type)==null?void 0:s._def)==null?void 0:r.typeName)!==E.ZodAny&&(n.items=j(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&(n.minItems=t.minLength.value),t.maxLength&&(n.maxItems=t.maxLength.value),t.exactLength&&(n.minItems=t.exactLength.value,n.maxItems=t.exactLength.value),n}function ls(t){const e={type:"integer",format:"int64"};if(!t.checks)return e;for(const a of t.checks)switch(a.kind){case"min":a.inclusive?e.minimum=a.value:e.exclusiveMinimum=a.value;break;case"max":a.inclusive?e.maximum=a.value:e.exclusiveMaximum=a.value;break;case"multipleOf":e.multipleOf=a.value;break}return e}function cs(){return{type:"boolean"}}function Yt(t,e){return j(t.type._def,e)}var us=(t,e)=>j(t.innerType._def,e);function Ht(t,e,a){const s=a??e.dateStrategy;if(Array.isArray(s))return{anyOf:s.map((r,n)=>Ht(t,e,r))};switch(s){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return ds(t)}}var ds=t=>{const e={type:"integer",format:"unix-time"};for(const a of t.checks)switch(a.kind){case"min":e.minimum=a.value;break;case"max":e.maximum=a.value;break}return e};function ps(t,e){return{...j(t.innerType._def,e),default:t.defaultValue()}}function ms(t,e){return e.effectStrategy==="input"?j(t.schema._def,e):Y()}function fs(t){return{type:"string",enum:Array.from(t.values)}}var hs=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function gs(t,e){const a=[j(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),j(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(r=>!!r),s=[];return a.forEach(r=>{if(hs(r))s.push(...r.allOf);else{let n=r;if("additionalProperties"in r&&r.additionalProperties===!1){const{additionalProperties:i,...o}=r;n=o}s.push(n)}}),s.length?{allOf:s}:void 0}function vs(t){const e=typeof t.value;return e!=="bigint"&&e!=="number"&&e!=="boolean"&&e!=="string"?{type:Array.isArray(t.value)?"array":"object"}:{type:e==="bigint"?"integer":e,const:t.value}}var Ue=void 0,K={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(Ue===void 0&&(Ue=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Ue),uuid:/^[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}$/,ipv4:/^(?:(?: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])$/,ipv4Cidr:/^(?:(?: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])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([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])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function Qt(t,e){const a={type:"string"};if(t.checks)for(const s of t.checks)switch(s.kind){case"min":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,s.value):s.value;break;case"max":a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,s.value):s.value;break;case"email":switch(e.emailStrategy){case"format:email":ee(a,"email",s.message,e);break;case"format:idn-email":ee(a,"idn-email",s.message,e);break;case"pattern:zod":F(a,K.email,s.message,e);break}break;case"url":ee(a,"uri",s.message,e);break;case"uuid":ee(a,"uuid",s.message,e);break;case"regex":F(a,s.regex,s.message,e);break;case"cuid":F(a,K.cuid,s.message,e);break;case"cuid2":F(a,K.cuid2,s.message,e);break;case"startsWith":F(a,RegExp(`^${ze(s.value,e)}`),s.message,e);break;case"endsWith":F(a,RegExp(`${ze(s.value,e)}$`),s.message,e);break;case"datetime":ee(a,"date-time",s.message,e);break;case"date":ee(a,"date",s.message,e);break;case"time":ee(a,"time",s.message,e);break;case"duration":ee(a,"duration",s.message,e);break;case"length":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,s.value):s.value,a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,s.value):s.value;break;case"includes":{F(a,RegExp(ze(s.value,e)),s.message,e);break}case"ip":{s.version!=="v6"&&ee(a,"ipv4",s.message,e),s.version!=="v4"&&ee(a,"ipv6",s.message,e);break}case"base64url":F(a,K.base64url,s.message,e);break;case"jwt":F(a,K.jwt,s.message,e);break;case"cidr":{s.version!=="v6"&&F(a,K.ipv4Cidr,s.message,e),s.version!=="v4"&&F(a,K.ipv6Cidr,s.message,e);break}case"emoji":F(a,K.emoji(),s.message,e);break;case"ulid":{F(a,K.ulid,s.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{ee(a,"binary",s.message,e);break}case"contentEncoding:base64":{a.contentEncoding="base64";break}case"pattern:zod":{F(a,K.base64,s.message,e);break}}break}case"nanoid":F(a,K.nanoid,s.message,e)}return a}function ze(t,e){return e.patternStrategy==="escape"?bs(t):t}var ys=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function bs(t){let e="";for(let a=0;a<t.length;a++)ys.has(t[a])||(e+="\\"),e+=t[a];return e}function ee(t,e,a,s){var r;t.format||(r=t.anyOf)!=null&&r.some(n=>n.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format}),delete t.format),t.anyOf.push({format:e,...a&&s.errorMessages&&{errorMessage:{format:a}}})):t.format=e}function F(t,e,a,s){var r;t.pattern||(r=t.allOf)!=null&&r.some(n=>n.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern}),delete t.pattern),t.allOf.push({pattern:St(e,s),...a&&s.errorMessages&&{errorMessage:{pattern:a}}})):t.pattern=St(e,s)}function St(t,e){var a;if(!e.applyRegexFlags||!t.flags)return t.source;const s={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},r=s.i?t.source.toLowerCase():t.source;let n="",i=!1,o=!1,c=!1;for(let l=0;l<r.length;l++){if(i){n+=r[l],i=!1;continue}if(s.i){if(o){if(r[l].match(/[a-z]/)){c?(n+=r[l],n+=`${r[l-2]}-${r[l]}`.toUpperCase(),c=!1):r[l+1]==="-"&&((a=r[l+2])!=null&&a.match(/[a-z]/))?(n+=r[l],c=!0):n+=`${r[l]}${r[l].toUpperCase()}`;continue}}else if(r[l].match(/[a-z]/)){n+=`[${r[l]}${r[l].toUpperCase()}]`;continue}}if(s.m){if(r[l]==="^"){n+=`(^|(?<=[\r
|
|
4
4
|
]))`;continue}else if(r[l]==="$"){n+=`($|(?=[\r
|
|
5
5
|
]))`;continue}}if(s.s&&r[l]==="."){n+=o?`${r[l]}\r
|
|
6
6
|
`:`[${r[l]}\r
|
|
7
|
-
]`;continue}n+=r[l],r[l]==="\\"?i=!0:o&&r[l]==="]"?o=!1:!o&&r[l]==="["&&(o=!0)}try{new RegExp(n)}catch{return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),t.source}return n}function Xt(t,e){var a,s,r,n,i,o;const c={type:"object",additionalProperties:(a=j(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]}))!=null?a:e.allowedAdditionalProperties};if(((s=t.keyType)==null?void 0:s._def.typeName)===E.ZodString&&((r=t.keyType._def.checks)!=null&&r.length)){const{type:l,...d}=Qt(t.keyType._def,e);return{...c,propertyNames:d}}else{if(((n=t.keyType)==null?void 0:n._def.typeName)===E.ZodEnum)return{...c,propertyNames:{enum:t.keyType._def.values}};if(((i=t.keyType)==null?void 0:i._def.typeName)===E.ZodBranded&&t.keyType._def.type._def.typeName===E.ZodString&&((o=t.keyType._def.type._def.checks)!=null&&o.length)){const{type:l,...d}=Yt(t.keyType._def,e);return{...c,propertyNames:d}}}return c}function xs(t,e){if(e.mapStrategy==="record")return Xt(t,e);const a=j(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||Y(),s=j(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||Y();return{type:"array",maxItems:125,items:{type:"array",items:[a,s],minItems:2,maxItems:2}}}function _s(t){const e=t.values,s=Object.keys(t.values).filter(n=>typeof e[e[n]]!="number").map(n=>e[n]),r=Array.from(new Set(s.map(n=>typeof n)));return{type:r.length===1?r[0]==="string"?"string":"number":["string","number"],enum:s}}function ws(){return{not:Y()}}function Es(){return{type:"null"}}var qe={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Is(t,e){const a=t.options instanceof Map?Array.from(t.options.values()):t.options;if(a.every(s=>s._def.typeName in qe&&(!s._def.checks||!s._def.checks.length))){const s=a.reduce((r,n)=>{const i=qe[n._def.typeName];return i&&!r.includes(i)?[...r,i]:r},[]);return{type:s.length>1?s:s[0]}}else if(a.every(s=>s._def.typeName==="ZodLiteral"&&!s.description)){const s=a.reduce((r,n)=>{const i=typeof n._def.value;switch(i){case"string":case"number":case"boolean":return[...r,i];case"bigint":return[...r,"integer"];case"object":if(n._def.value===null)return[...r,"null"];default:return r}},[]);if(s.length===a.length){const r=s.filter((n,i,o)=>o.indexOf(n)===i);return{type:r.length>1?r:r[0],enum:a.reduce((n,i)=>n.includes(i._def.value)?n:[...n,i._def.value],[])}}}else if(a.every(s=>s._def.typeName==="ZodEnum"))return{type:"string",enum:a.reduce((s,r)=>[...s,...r._def.values.filter(n=>!s.includes(n))],[])};return Ss(t,e)}var Ss=(t,e)=>{const a=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((s,r)=>j(s._def,{...e,currentPath:[...e.currentPath,"anyOf",`${r}`]})).filter(s=>!!s&&(!e.strictUnions||typeof s=="object"&&Object.keys(s).length>0));return a.length?{anyOf:a}:void 0};function Ns(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return{type:[qe[t.innerType._def.typeName],"null"]};const a=j(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return a&&{anyOf:[a,{type:"null"}]}}function Ts(t){const e={type:"number"};if(!t.checks)return e;for(const a of t.checks)switch(a.kind){case"int":e.type="integer";break;case"min":a.inclusive?e.minimum=a.value:e.exclusiveMinimum=a.value;break;case"max":a.inclusive?e.maximum=a.value:e.exclusiveMaximum=a.value;break;case"multipleOf":e.multipleOf=a.value;break}return e}function Rs(t,e){const a={type:"object",properties:{}},s=[],r=t.shape();for(const i in r){let o=r[i];if(o===void 0||o._def===void 0)continue;const c=As(o),l=j(o._def,{...e,currentPath:[...e.currentPath,"properties",i],propertyPath:[...e.currentPath,"properties",i]});l!==void 0&&(a.properties[i]=l,c||s.push(i))}s.length&&(a.required=s);const n=Cs(t,e);return n!==void 0&&(a.additionalProperties=n),a}function Cs(t,e){if(t.catchall._def.typeName!=="ZodNever")return j(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function As(t){try{return t.isOptional()}catch{return!0}}var js=(t,e)=>{var a;if(e.currentPath.toString()===((a=e.propertyPath)==null?void 0:a.toString()))return j(t.innerType._def,e);const s=j(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return s?{anyOf:[{not:Y()},s]}:Y()},Os=(t,e)=>{if(e.pipeStrategy==="input")return j(t.in._def,e);if(e.pipeStrategy==="output")return j(t.out._def,e);const a=j(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),s=j(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",a?"1":"0"]});return{allOf:[a,s].filter(r=>r!==void 0)}};function Ms(t,e){return j(t.type._def,e)}function ks(t,e){const s={type:"array",uniqueItems:!0,items:j(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&(s.minItems=t.minSize.value),t.maxSize&&(s.maxItems=t.maxSize.value),s}function Ps(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((a,s)=>j(a._def,{...e,currentPath:[...e.currentPath,"items",`${s}`]})).reduce((a,s)=>s===void 0?a:[...a,s],[]),additionalItems:j(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((a,s)=>j(a._def,{...e,currentPath:[...e.currentPath,"items",`${s}`]})).reduce((a,s)=>s===void 0?a:[...a,s],[])}}function Ds(){return{not:Y()}}function $s(){return Y()}var Zs=(t,e)=>j(t.innerType._def,e),Ls=(t,e,a)=>{switch(e){case E.ZodString:return Qt(t,a);case E.ZodNumber:return Ts(t);case E.ZodObject:return Rs(t,a);case E.ZodBigInt:return ls(t);case E.ZodBoolean:return cs();case E.ZodDate:return Ht(t,a);case E.ZodUndefined:return Ds();case E.ZodNull:return Es();case E.ZodArray:return is(t,a);case E.ZodUnion:case E.ZodDiscriminatedUnion:return Is(t,a);case E.ZodIntersection:return gs(t,a);case E.ZodTuple:return Ps(t,a);case E.ZodRecord:return Xt(t,a);case E.ZodLiteral:return vs(t);case E.ZodEnum:return fs(t);case E.ZodNativeEnum:return _s(t);case E.ZodNullable:return Ns(t,a);case E.ZodOptional:return js(t,a);case E.ZodMap:return xs(t,a);case E.ZodSet:return ks(t,a);case E.ZodLazy:return()=>t.getter()._def;case E.ZodPromise:return Ms(t,a);case E.ZodNaN:case E.ZodNever:return ws();case E.ZodEffects:return ms(t,a);case E.ZodAny:return Y();case E.ZodUnknown:return $s();case E.ZodDefault:return ps(t,a);case E.ZodBranded:return Yt(t,a);case E.ZodReadonly:return Zs(t,a);case E.ZodCatch:return us(t,a);case E.ZodPipeline:return Os(t,a);case E.ZodFunction:case E.ZodVoid:case E.ZodSymbol:return;default:return(s=>{})()}},Us=(t,e)=>{let a=0;for(;a<t.length&&a<e.length&&t[a]===e[a];a++);return[(t.length-a).toString(),...e.slice(a)].join("/")};function j(t,e,a=!1){var s;const r=e.seen.get(t);if(e.override){const c=(s=e.override)==null?void 0:s.call(e,t,e,r,a);if(c!==ns)return c}if(r&&!a){const c=zs(r,e);if(c!==void 0)return c}const n={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,n);const i=Ls(t,t.typeName,e),o=typeof i=="function"?j(i(),e):i;if(o&&Bs(t,e,o),e.postProcess){const c=e.postProcess(o,t,e);return n.jsonSchema=o,c}return n.jsonSchema=o,o}var zs=(t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:Us(e.currentPath,t.path)};case"none":case"seen":return t.path.length<e.currentPath.length&&t.path.every((a,s)=>e.currentPath[s]===a)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),Y()):e.$refStrategy==="seen"?Y():void 0}},Bs=(t,e,a)=>(t.description&&(a.description=t.description),a),Fs=t=>{const e=os(t),a=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,currentPath:a,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([s,r])=>[r._def,{def:r._def,path:[...e.basePath,e.definitionPath,s],jsonSchema:void 0}]))}},Vs=(t,e)=>{var a;const s=Fs(e);let r=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((l,[d,m])=>{var h;return{...l,[d]:(h=j(m._def,{...s,currentPath:[...s.basePath,s.definitionPath,d]},!0))!=null?h:Y()}},{}):void 0;const n=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,i=(a=j(t._def,n===void 0?s:{...s,currentPath:[...s.basePath,s.definitionPath,n]},!1))!=null?a:Y(),o=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;o!==void 0&&(i.title=o);const c=n===void 0?r?{...i,[s.definitionPath]:r}:i:{$ref:[...s.$refStrategy==="relative"?[]:s.basePath,s.definitionPath,n].join("/"),[s.definitionPath]:{...r,[n]:i}};return c.$schema="http://json-schema.org/draft-07/schema#",c},Je=Symbol.for("vercel.ai.schema");function qs(t){let e;return()=>(e==null&&(e=t()),e)}function $e(t,{validate:e}={}){return{[Je]:!0,_type:void 0,get jsonSchema(){return typeof t=="function"&&(t=t()),t},validate:e}}function Js(t){return typeof t=="object"&&t!==null&&Je in t&&t[Je]===!0&&"jsonSchema"in t&&"validate"in t}function nt(t){return t==null?$e({properties:{},additionalProperties:!1}):Js(t)?t:"~standard"in t?t["~standard"].vendor==="zod"?Kt(t):Ws(t):t()}function Ws(t){return $e(()=>rt(t["~standard"].jsonSchema.input({target:"draft-07"})),{validate:async e=>{const a=await t["~standard"].validate(e);return"value"in a?{success:!0,value:a.value}:{success:!1,error:new xe({value:e,cause:a.issues})}}})}function Gs(t,e){var a;const s=(a=void 0)!=null?a:!1;return $e(()=>Vs(t,{$refStrategy:s?"root":"none"}),{validate:async r=>{const n=await t.safeParseAsync(r);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}}})}function Ys(t,e){var a;const s=(a=void 0)!=null?a:!1;return $e(()=>rt(ba(t,{target:"draft-7",io:"input",reused:s?"ref":"inline"})),{validate:async r=>{const n=await ya(t,r);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}}})}function Hs(t){return"_zod"in t}function Kt(t,e){return Hs(t)?Ys(t):Gs(t)}async function Nt({value:t,schema:e}){const a=await Ne({value:t,schema:e});if(!a.success)throw xe.wrap({value:t,cause:a.error});return a.value}async function Ne({value:t,schema:e}){const a=nt(e);try{if(a.validate==null)return{success:!0,value:t,rawValue:t};const s=await a.validate(t);return s.success?{success:!0,value:s.value,rawValue:t}:{success:!1,error:xe.wrap({value:t,cause:s.error}),rawValue:t}}catch(s){return{success:!1,error:xe.wrap({value:t,cause:s}),rawValue:t}}}async function me({text:t,schema:e}){try{const a=rs(t);return e==null?{success:!0,value:a,rawValue:a}:await Ne({value:a,schema:e})}catch(a){return{success:!1,error:yt.isInstance(a)?a:new yt({text:t,cause:a}),rawValue:void 0}}}function Qs({stream:t,schema:e}){return t.pipeThrough(new TextDecoderStream).pipeThrough(new va).pipeThrough(new TransformStream({async transform({data:a},s){a!=="[DONE]"&&s.enqueue(await me({text:a,schema:e}))}}))}async function ce(t){return typeof t=="function"&&(t=t()),Promise.resolve(t)}var Xs=Object.defineProperty,Ks=(t,e)=>{for(var a in e)Xs(t,a,{get:e[a],enumerable:!0})},ea="AI_NoObjectGeneratedError",ta=`vercel.ai.error.${ea}`,er=Symbol.for(ta),aa,ue=class extends oe{constructor({message:t="No object generated.",cause:e,text:a,response:s,usage:r,finishReason:n}){super({name:ea,message:t,cause:e}),this[aa]=!0,this.text=a,this.response=s,this.usage=r,this.finishReason=n}static isInstance(t){return oe.hasMarker(t,ta)}};aa=er;var sa="AI_UIMessageStreamError",ra=`vercel.ai.error.${sa}`,tr=Symbol.for(ra),na,ve=class extends oe{constructor({chunkType:t,chunkId:e,message:a}){super({name:sa,message:a}),this[na]=!0,this.chunkType=t,this.chunkId=e}static isInstance(t){return oe.hasMarker(t,ra)}};na=tr;var Tt="6.0.35",oa=J([g(),ke(Uint8Array),ke(ArrayBuffer),Dt(t=>{var e,a;return(a=(e=globalThis.Buffer)==null?void 0:e.isBuffer(t))!=null?a:!1},{message:"Must be a Buffer"})]),Te=xa(()=>J([_a(),g(),wa(),V(),Ie(g(),Te.optional()),Re(Te)])),C=Ie(g(),Ie(g(),Te.optional())),ia=O({type:_("text"),text:g(),providerOptions:C.optional()}),ar=O({type:_("image"),image:J([oa,ke(URL)]),mediaType:g().optional(),providerOptions:C.optional()}),la=O({type:_("file"),data:J([oa,ke(URL)]),filename:g().optional(),mediaType:g(),providerOptions:C.optional()}),sr=O({type:_("reasoning"),text:g(),providerOptions:C.optional()}),rr=O({type:_("tool-call"),toolCallId:g(),toolName:g(),input:ie(),providerOptions:C.optional(),providerExecuted:V().optional()}),nr=Ea("type",[O({type:_("text"),value:g(),providerOptions:C.optional()}),O({type:_("json"),value:Te,providerOptions:C.optional()}),O({type:_("execution-denied"),reason:g().optional(),providerOptions:C.optional()}),O({type:_("error-text"),value:g(),providerOptions:C.optional()}),O({type:_("error-json"),value:Te,providerOptions:C.optional()}),O({type:_("content"),value:Re(J([O({type:_("text"),text:g(),providerOptions:C.optional()}),O({type:_("media"),data:g(),mediaType:g()}),O({type:_("file-data"),data:g(),mediaType:g(),filename:g().optional(),providerOptions:C.optional()}),O({type:_("file-url"),url:g(),providerOptions:C.optional()}),O({type:_("file-id"),fileId:J([g(),Ie(g(),g())]),providerOptions:C.optional()}),O({type:_("image-data"),data:g(),mediaType:g(),providerOptions:C.optional()}),O({type:_("image-url"),url:g(),providerOptions:C.optional()}),O({type:_("image-file-id"),fileId:J([g(),Ie(g(),g())]),providerOptions:C.optional()}),O({type:_("custom"),providerOptions:C.optional()})]))})]),ca=O({type:_("tool-result"),toolCallId:g(),toolName:g(),output:nr,providerOptions:C.optional()}),or=O({type:_("tool-approval-request"),approvalId:g(),toolCallId:g()}),ir=O({type:_("tool-approval-response"),approvalId:g(),approved:V(),reason:g().optional()}),lr=O({role:_("system"),content:g(),providerOptions:C.optional()}),cr=O({role:_("user"),content:J([g(),Re(J([ia,ar,la]))]),providerOptions:C.optional()}),ur=O({role:_("assistant"),content:J([g(),Re(J([ia,la,sr,rr,ca,or]))]),providerOptions:C.optional()}),dr=O({role:_("tool"),content:Re(J([ca,ir])),providerOptions:C.optional()});J([lr,cr,ur,dr]);function ua(t,e){if(t===void 0&&e===void 0)return;if(t===void 0)return e;if(e===void 0)return t;const a={...t};for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)){const r=e[s];if(r===void 0)continue;const n=s in t?t[s]:void 0,i=r!==null&&typeof r=="object"&&!Array.isArray(r)&&!(r instanceof Date)&&!(r instanceof RegExp),o=n!=null&&typeof n=="object"&&!Array.isArray(n)&&!(n instanceof Date)&&!(n instanceof RegExp);i&&o?a[s]=ua(n,r):a[s]=r}return a}var pr={};Ks(pr,{array:()=>gr,choice:()=>vr,json:()=>yr,object:()=>hr,text:()=>fr});function mr(t){const e=["ROOT"];let a=-1,s=null;function r(c,l,d){switch(c){case'"':{a=l,e.pop(),e.push(d),e.push("INSIDE_STRING");break}case"f":case"t":case"n":{a=l,s=l,e.pop(),e.push(d),e.push("INSIDE_LITERAL");break}case"-":{e.pop(),e.push(d),e.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{a=l,e.pop(),e.push(d),e.push("INSIDE_NUMBER");break}case"{":{a=l,e.pop(),e.push(d),e.push("INSIDE_OBJECT_START");break}case"[":{a=l,e.pop(),e.push(d),e.push("INSIDE_ARRAY_START");break}}}function n(c,l){switch(c){case",":{e.pop(),e.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{a=l,e.pop();break}}}function i(c,l){switch(c){case",":{e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{a=l,e.pop();break}}}for(let c=0;c<t.length;c++){const l=t[c];switch(e[e.length-1]){case"ROOT":r(l,c,"FINISH");break;case"INSIDE_OBJECT_START":{switch(l){case'"':{e.pop(),e.push("INSIDE_OBJECT_KEY");break}case"}":{a=c,e.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{l==='"'&&(e.pop(),e.push("INSIDE_OBJECT_KEY"));break}case"INSIDE_OBJECT_KEY":{l==='"'&&(e.pop(),e.push("INSIDE_OBJECT_AFTER_KEY"));break}case"INSIDE_OBJECT_AFTER_KEY":{l===":"&&(e.pop(),e.push("INSIDE_OBJECT_BEFORE_VALUE"));break}case"INSIDE_OBJECT_BEFORE_VALUE":{r(l,c,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{n(l,c);break}case"INSIDE_STRING":{switch(l){case'"':{e.pop(),a=c;break}case"\\":{e.push("INSIDE_STRING_ESCAPE");break}default:a=c}break}case"INSIDE_ARRAY_START":{l==="]"?(a=c,e.pop()):(a=c,r(l,c,"INSIDE_ARRAY_AFTER_VALUE"));break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(l){case",":{e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{a=c,e.pop();break}default:{a=c;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{r(l,c,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{e.pop(),a=c;break}case"INSIDE_NUMBER":{switch(l){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{a=c;break}case"e":case"E":case"-":case".":break;case",":{e.pop(),e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(l,c),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&n(l,c);break}case"}":{e.pop(),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&n(l,c);break}case"]":{e.pop(),e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(l,c);break}default:{e.pop();break}}break}case"INSIDE_LITERAL":{const m=t.substring(s,c+1);!"false".startsWith(m)&&!"true".startsWith(m)&&!"null".startsWith(m)?(e.pop(),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?n(l,c):e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(l,c)):a=c;break}}}let o=t.slice(0,a+1);for(let c=e.length-1;c>=0;c--)switch(e[c]){case"INSIDE_STRING":{o+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{o+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{o+="]";break}case"INSIDE_LITERAL":{const d=t.substring(s,t.length);"true".startsWith(d)?o+="true".slice(d.length):"false".startsWith(d)?o+="false".slice(d.length):"null".startsWith(d)&&(o+="null".slice(d.length))}}return o}async function Ae(t){if(t===void 0)return{value:void 0,state:"undefined-input"};let e=await me({text:t});return e.success?{value:e.value,state:"successful-parse"}:(e=await me({text:mr(t)}),e.success?{value:e.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var fr=()=>({name:"text",responseFormat:Promise.resolve({type:"text"}),async parseCompleteOutput({text:t}){return t},async parsePartialOutput({text:t}){return{partial:t}},createElementStreamTransform(){}}),hr=({schema:t,name:e,description:a})=>{const s=nt(t);return{name:"object",responseFormat:ce(s.jsonSchema).then(r=>({type:"json",schema:r,...e!=null&&{name:e},...a!=null&&{description:a}})),async parseCompleteOutput({text:r},n){const i=await me({text:r});if(!i.success)throw new ue({message:"No object generated: could not parse the response.",cause:i.error,text:r,response:n.response,usage:n.usage,finishReason:n.finishReason});const o=await Ne({value:i.value,schema:s});if(!o.success)throw new ue({message:"No object generated: response did not match schema.",cause:o.error,text:r,response:n.response,usage:n.usage,finishReason:n.finishReason});return o.value},async parsePartialOutput({text:r}){const n=await Ae(r);switch(n.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:n.value}}},createElementStreamTransform(){}}},gr=({element:t,name:e,description:a})=>{const s=nt(t);return{name:"array",responseFormat:ce(s.jsonSchema).then(r=>{const{$schema:n,...i}=r;return{type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{elements:{type:"array",items:i}},required:["elements"],additionalProperties:!1},...e!=null&&{name:e},...a!=null&&{description:a}}}),async parseCompleteOutput({text:r},n){const i=await me({text:r});if(!i.success)throw new ue({message:"No object generated: could not parse the response.",cause:i.error,text:r,response:n.response,usage:n.usage,finishReason:n.finishReason});const o=i.value;if(o==null||typeof o!="object"||!("elements"in o)||!Array.isArray(o.elements))throw new ue({message:"No object generated: response did not match schema.",cause:new xe({value:o,cause:"response must be an object with an elements array"}),text:r,response:n.response,usage:n.usage,finishReason:n.finishReason});for(const c of o.elements){const l=await Ne({value:c,schema:s});if(!l.success)throw new ue({message:"No object generated: response did not match schema.",cause:l.error,text:r,response:n.response,usage:n.usage,finishReason:n.finishReason})}return o.elements},async parsePartialOutput({text:r}){const n=await Ae(r);switch(n.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const i=n.value;if(i==null||typeof i!="object"||!("elements"in i)||!Array.isArray(i.elements))return;const o=n.state==="repaired-parse"&&i.elements.length>0?i.elements.slice(0,-1):i.elements,c=[];for(const l of o){const d=await Ne({value:l,schema:s});d.success&&c.push(d.value)}return{partial:c}}}},createElementStreamTransform(){let r=0;return new TransformStream({transform({partialOutput:n},i){if(n!=null)for(;r<n.length;r++)i.enqueue(n[r])}})}}},vr=({options:t,name:e,description:a})=>({name:"choice",responseFormat:Promise.resolve({type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{result:{type:"string",enum:t}},required:["result"],additionalProperties:!1},...e!=null&&{name:e},...a!=null&&{description:a}}),async parseCompleteOutput({text:s},r){const n=await me({text:s});if(!n.success)throw new ue({message:"No object generated: could not parse the response.",cause:n.error,text:s,response:r.response,usage:r.usage,finishReason:r.finishReason});const i=n.value;if(i==null||typeof i!="object"||!("result"in i)||typeof i.result!="string"||!t.includes(i.result))throw new ue({message:"No object generated: response did not match schema.",cause:new xe({value:i,cause:"response must be an object that contains a choice value."}),text:s,response:r.response,usage:r.usage,finishReason:r.finishReason});return i.result},async parsePartialOutput({text:s}){const r=await Ae(s);switch(r.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const n=r.value;if(n==null||typeof n!="object"||!("result"in n)||typeof n.result!="string")return;const i=t.filter(o=>o.startsWith(n.result));return r.state==="successful-parse"?i.includes(n.result)?{partial:n.result}:void 0:i.length===1?{partial:i[0]}:void 0}}},createElementStreamTransform(){}}),yr=({name:t,description:e}={})=>({name:"json",responseFormat:Promise.resolve({type:"json",...t!=null&&{name:t},...e!=null&&{description:e}}),async parseCompleteOutput({text:a},s){const r=await me({text:a});if(!r.success)throw new ue({message:"No object generated: could not parse the response.",cause:r.error,text:a,response:s.response,usage:s.usage,finishReason:s.finishReason});return r.value},async parsePartialOutput({text:a}){const s=await Ae(a);switch(s.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return s.value===void 0?void 0:{partial:s.value}}},createElementStreamTransform(){}});Ce({prefix:"aitxt",size:24});(class extends TransformStream{constructor(){super({transform(t,e){e.enqueue(`data: ${JSON.stringify(t)}
|
|
7
|
+
]`;continue}n+=r[l],r[l]==="\\"?i=!0:o&&r[l]==="]"?o=!1:!o&&r[l]==="["&&(o=!0)}try{new RegExp(n)}catch{return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),t.source}return n}function Xt(t,e){var a,s,r,n,i,o;const c={type:"object",additionalProperties:(a=j(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]}))!=null?a:e.allowedAdditionalProperties};if(((s=t.keyType)==null?void 0:s._def.typeName)===E.ZodString&&((r=t.keyType._def.checks)!=null&&r.length)){const{type:l,...d}=Qt(t.keyType._def,e);return{...c,propertyNames:d}}else{if(((n=t.keyType)==null?void 0:n._def.typeName)===E.ZodEnum)return{...c,propertyNames:{enum:t.keyType._def.values}};if(((i=t.keyType)==null?void 0:i._def.typeName)===E.ZodBranded&&t.keyType._def.type._def.typeName===E.ZodString&&((o=t.keyType._def.type._def.checks)!=null&&o.length)){const{type:l,...d}=Yt(t.keyType._def,e);return{...c,propertyNames:d}}}return c}function xs(t,e){if(e.mapStrategy==="record")return Xt(t,e);const a=j(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||Y(),s=j(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||Y();return{type:"array",maxItems:125,items:{type:"array",items:[a,s],minItems:2,maxItems:2}}}function _s(t){const e=t.values,s=Object.keys(t.values).filter(n=>typeof e[e[n]]!="number").map(n=>e[n]),r=Array.from(new Set(s.map(n=>typeof n)));return{type:r.length===1?r[0]==="string"?"string":"number":["string","number"],enum:s}}function ws(){return{not:Y()}}function Es(){return{type:"null"}}var qe={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Is(t,e){const a=t.options instanceof Map?Array.from(t.options.values()):t.options;if(a.every(s=>s._def.typeName in qe&&(!s._def.checks||!s._def.checks.length))){const s=a.reduce((r,n)=>{const i=qe[n._def.typeName];return i&&!r.includes(i)?[...r,i]:r},[]);return{type:s.length>1?s:s[0]}}else if(a.every(s=>s._def.typeName==="ZodLiteral"&&!s.description)){const s=a.reduce((r,n)=>{const i=typeof n._def.value;switch(i){case"string":case"number":case"boolean":return[...r,i];case"bigint":return[...r,"integer"];case"object":if(n._def.value===null)return[...r,"null"];default:return r}},[]);if(s.length===a.length){const r=s.filter((n,i,o)=>o.indexOf(n)===i);return{type:r.length>1?r:r[0],enum:a.reduce((n,i)=>n.includes(i._def.value)?n:[...n,i._def.value],[])}}}else if(a.every(s=>s._def.typeName==="ZodEnum"))return{type:"string",enum:a.reduce((s,r)=>[...s,...r._def.values.filter(n=>!s.includes(n))],[])};return Ss(t,e)}var Ss=(t,e)=>{const a=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((s,r)=>j(s._def,{...e,currentPath:[...e.currentPath,"anyOf",`${r}`]})).filter(s=>!!s&&(!e.strictUnions||typeof s=="object"&&Object.keys(s).length>0));return a.length?{anyOf:a}:void 0};function Ns(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return{type:[qe[t.innerType._def.typeName],"null"]};const a=j(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return a&&{anyOf:[a,{type:"null"}]}}function Ts(t){const e={type:"number"};if(!t.checks)return e;for(const a of t.checks)switch(a.kind){case"int":e.type="integer";break;case"min":a.inclusive?e.minimum=a.value:e.exclusiveMinimum=a.value;break;case"max":a.inclusive?e.maximum=a.value:e.exclusiveMaximum=a.value;break;case"multipleOf":e.multipleOf=a.value;break}return e}function Rs(t,e){const a={type:"object",properties:{}},s=[],r=t.shape();for(const i in r){let o=r[i];if(o===void 0||o._def===void 0)continue;const c=As(o),l=j(o._def,{...e,currentPath:[...e.currentPath,"properties",i],propertyPath:[...e.currentPath,"properties",i]});l!==void 0&&(a.properties[i]=l,c||s.push(i))}s.length&&(a.required=s);const n=Cs(t,e);return n!==void 0&&(a.additionalProperties=n),a}function Cs(t,e){if(t.catchall._def.typeName!=="ZodNever")return j(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function As(t){try{return t.isOptional()}catch{return!0}}var js=(t,e)=>{var a;if(e.currentPath.toString()===((a=e.propertyPath)==null?void 0:a.toString()))return j(t.innerType._def,e);const s=j(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return s?{anyOf:[{not:Y()},s]}:Y()},Os=(t,e)=>{if(e.pipeStrategy==="input")return j(t.in._def,e);if(e.pipeStrategy==="output")return j(t.out._def,e);const a=j(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),s=j(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",a?"1":"0"]});return{allOf:[a,s].filter(r=>r!==void 0)}};function Ms(t,e){return j(t.type._def,e)}function ks(t,e){const s={type:"array",uniqueItems:!0,items:j(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&(s.minItems=t.minSize.value),t.maxSize&&(s.maxItems=t.maxSize.value),s}function Ps(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((a,s)=>j(a._def,{...e,currentPath:[...e.currentPath,"items",`${s}`]})).reduce((a,s)=>s===void 0?a:[...a,s],[]),additionalItems:j(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((a,s)=>j(a._def,{...e,currentPath:[...e.currentPath,"items",`${s}`]})).reduce((a,s)=>s===void 0?a:[...a,s],[])}}function Ds(){return{not:Y()}}function $s(){return Y()}var Zs=(t,e)=>j(t.innerType._def,e),Ls=(t,e,a)=>{switch(e){case E.ZodString:return Qt(t,a);case E.ZodNumber:return Ts(t);case E.ZodObject:return Rs(t,a);case E.ZodBigInt:return ls(t);case E.ZodBoolean:return cs();case E.ZodDate:return Ht(t,a);case E.ZodUndefined:return Ds();case E.ZodNull:return Es();case E.ZodArray:return is(t,a);case E.ZodUnion:case E.ZodDiscriminatedUnion:return Is(t,a);case E.ZodIntersection:return gs(t,a);case E.ZodTuple:return Ps(t,a);case E.ZodRecord:return Xt(t,a);case E.ZodLiteral:return vs(t);case E.ZodEnum:return fs(t);case E.ZodNativeEnum:return _s(t);case E.ZodNullable:return Ns(t,a);case E.ZodOptional:return js(t,a);case E.ZodMap:return xs(t,a);case E.ZodSet:return ks(t,a);case E.ZodLazy:return()=>t.getter()._def;case E.ZodPromise:return Ms(t,a);case E.ZodNaN:case E.ZodNever:return ws();case E.ZodEffects:return ms(t,a);case E.ZodAny:return Y();case E.ZodUnknown:return $s();case E.ZodDefault:return ps(t,a);case E.ZodBranded:return Yt(t,a);case E.ZodReadonly:return Zs(t,a);case E.ZodCatch:return us(t,a);case E.ZodPipeline:return Os(t,a);case E.ZodFunction:case E.ZodVoid:case E.ZodSymbol:return;default:return(s=>{})()}},Us=(t,e)=>{let a=0;for(;a<t.length&&a<e.length&&t[a]===e[a];a++);return[(t.length-a).toString(),...e.slice(a)].join("/")};function j(t,e,a=!1){var s;const r=e.seen.get(t);if(e.override){const c=(s=e.override)==null?void 0:s.call(e,t,e,r,a);if(c!==ns)return c}if(r&&!a){const c=zs(r,e);if(c!==void 0)return c}const n={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,n);const i=Ls(t,t.typeName,e),o=typeof i=="function"?j(i(),e):i;if(o&&Bs(t,e,o),e.postProcess){const c=e.postProcess(o,t,e);return n.jsonSchema=o,c}return n.jsonSchema=o,o}var zs=(t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:Us(e.currentPath,t.path)};case"none":case"seen":return t.path.length<e.currentPath.length&&t.path.every((a,s)=>e.currentPath[s]===a)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),Y()):e.$refStrategy==="seen"?Y():void 0}},Bs=(t,e,a)=>(t.description&&(a.description=t.description),a),Fs=t=>{const e=os(t),a=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,currentPath:a,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([s,r])=>[r._def,{def:r._def,path:[...e.basePath,e.definitionPath,s],jsonSchema:void 0}]))}},Vs=(t,e)=>{var a;const s=Fs(e);let r=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((l,[d,m])=>{var h;return{...l,[d]:(h=j(m._def,{...s,currentPath:[...s.basePath,s.definitionPath,d]},!0))!=null?h:Y()}},{}):void 0;const n=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,i=(a=j(t._def,n===void 0?s:{...s,currentPath:[...s.basePath,s.definitionPath,n]},!1))!=null?a:Y(),o=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;o!==void 0&&(i.title=o);const c=n===void 0?r?{...i,[s.definitionPath]:r}:i:{$ref:[...s.$refStrategy==="relative"?[]:s.basePath,s.definitionPath,n].join("/"),[s.definitionPath]:{...r,[n]:i}};return c.$schema="http://json-schema.org/draft-07/schema#",c},Je=Symbol.for("vercel.ai.schema");function qs(t){let e;return()=>(e==null&&(e=t()),e)}function $e(t,{validate:e}={}){return{[Je]:!0,_type:void 0,get jsonSchema(){return typeof t=="function"&&(t=t()),t},validate:e}}function Js(t){return typeof t=="object"&&t!==null&&Je in t&&t[Je]===!0&&"jsonSchema"in t&&"validate"in t}function nt(t){return t==null?$e({properties:{},additionalProperties:!1}):Js(t)?t:"~standard"in t?t["~standard"].vendor==="zod"?Kt(t):Ws(t):t()}function Ws(t){return $e(()=>rt(t["~standard"].jsonSchema.input({target:"draft-07"})),{validate:async e=>{const a=await t["~standard"].validate(e);return"value"in a?{success:!0,value:a.value}:{success:!1,error:new xe({value:e,cause:a.issues})}}})}function Gs(t,e){var a;const s=(a=void 0)!=null?a:!1;return $e(()=>Vs(t,{$refStrategy:s?"root":"none"}),{validate:async r=>{const n=await t.safeParseAsync(r);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}}})}function Ys(t,e){var a;const s=(a=void 0)!=null?a:!1;return $e(()=>rt(ba(t,{target:"draft-7",io:"input",reused:s?"ref":"inline"})),{validate:async r=>{const n=await ya(t,r);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}}})}function Hs(t){return"_zod"in t}function Kt(t,e){return Hs(t)?Ys(t):Gs(t)}async function Nt({value:t,schema:e}){const a=await Ne({value:t,schema:e});if(!a.success)throw xe.wrap({value:t,cause:a.error});return a.value}async function Ne({value:t,schema:e}){const a=nt(e);try{if(a.validate==null)return{success:!0,value:t,rawValue:t};const s=await a.validate(t);return s.success?{success:!0,value:s.value,rawValue:t}:{success:!1,error:xe.wrap({value:t,cause:s.error}),rawValue:t}}catch(s){return{success:!1,error:xe.wrap({value:t,cause:s}),rawValue:t}}}async function me({text:t,schema:e}){try{const a=rs(t);return e==null?{success:!0,value:a,rawValue:a}:await Ne({value:a,schema:e})}catch(a){return{success:!1,error:yt.isInstance(a)?a:new yt({text:t,cause:a}),rawValue:void 0}}}function Qs({stream:t,schema:e}){return t.pipeThrough(new TextDecoderStream).pipeThrough(new va).pipeThrough(new TransformStream({async transform({data:a},s){a!=="[DONE]"&&s.enqueue(await me({text:a,schema:e}))}}))}async function ce(t){return typeof t=="function"&&(t=t()),Promise.resolve(t)}var Xs=Object.defineProperty,Ks=(t,e)=>{for(var a in e)Xs(t,a,{get:e[a],enumerable:!0})},ea="AI_NoObjectGeneratedError",ta=`vercel.ai.error.${ea}`,er=Symbol.for(ta),aa,ue=class extends oe{constructor({message:t="No object generated.",cause:e,text:a,response:s,usage:r,finishReason:n}){super({name:ea,message:t,cause:e}),this[aa]=!0,this.text=a,this.response=s,this.usage=r,this.finishReason=n}static isInstance(t){return oe.hasMarker(t,ta)}};aa=er;var sa="AI_UIMessageStreamError",ra=`vercel.ai.error.${sa}`,tr=Symbol.for(ra),na,ve=class extends oe{constructor({chunkType:t,chunkId:e,message:a}){super({name:sa,message:a}),this[na]=!0,this.chunkType=t,this.chunkId=e}static isInstance(t){return oe.hasMarker(t,ra)}};na=tr;var Tt="6.0.37",oa=J([g(),ke(Uint8Array),ke(ArrayBuffer),Dt(t=>{var e,a;return(a=(e=globalThis.Buffer)==null?void 0:e.isBuffer(t))!=null?a:!1},{message:"Must be a Buffer"})]),Te=xa(()=>J([_a(),g(),wa(),V(),Ie(g(),Te.optional()),Re(Te)])),C=Ie(g(),Ie(g(),Te.optional())),ia=O({type:_("text"),text:g(),providerOptions:C.optional()}),ar=O({type:_("image"),image:J([oa,ke(URL)]),mediaType:g().optional(),providerOptions:C.optional()}),la=O({type:_("file"),data:J([oa,ke(URL)]),filename:g().optional(),mediaType:g(),providerOptions:C.optional()}),sr=O({type:_("reasoning"),text:g(),providerOptions:C.optional()}),rr=O({type:_("tool-call"),toolCallId:g(),toolName:g(),input:ie(),providerOptions:C.optional(),providerExecuted:V().optional()}),nr=Ea("type",[O({type:_("text"),value:g(),providerOptions:C.optional()}),O({type:_("json"),value:Te,providerOptions:C.optional()}),O({type:_("execution-denied"),reason:g().optional(),providerOptions:C.optional()}),O({type:_("error-text"),value:g(),providerOptions:C.optional()}),O({type:_("error-json"),value:Te,providerOptions:C.optional()}),O({type:_("content"),value:Re(J([O({type:_("text"),text:g(),providerOptions:C.optional()}),O({type:_("media"),data:g(),mediaType:g()}),O({type:_("file-data"),data:g(),mediaType:g(),filename:g().optional(),providerOptions:C.optional()}),O({type:_("file-url"),url:g(),providerOptions:C.optional()}),O({type:_("file-id"),fileId:J([g(),Ie(g(),g())]),providerOptions:C.optional()}),O({type:_("image-data"),data:g(),mediaType:g(),providerOptions:C.optional()}),O({type:_("image-url"),url:g(),providerOptions:C.optional()}),O({type:_("image-file-id"),fileId:J([g(),Ie(g(),g())]),providerOptions:C.optional()}),O({type:_("custom"),providerOptions:C.optional()})]))})]),ca=O({type:_("tool-result"),toolCallId:g(),toolName:g(),output:nr,providerOptions:C.optional()}),or=O({type:_("tool-approval-request"),approvalId:g(),toolCallId:g()}),ir=O({type:_("tool-approval-response"),approvalId:g(),approved:V(),reason:g().optional()}),lr=O({role:_("system"),content:g(),providerOptions:C.optional()}),cr=O({role:_("user"),content:J([g(),Re(J([ia,ar,la]))]),providerOptions:C.optional()}),ur=O({role:_("assistant"),content:J([g(),Re(J([ia,la,sr,rr,ca,or]))]),providerOptions:C.optional()}),dr=O({role:_("tool"),content:Re(J([ca,ir])),providerOptions:C.optional()});J([lr,cr,ur,dr]);function ua(t,e){if(t===void 0&&e===void 0)return;if(t===void 0)return e;if(e===void 0)return t;const a={...t};for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)){const r=e[s];if(r===void 0)continue;const n=s in t?t[s]:void 0,i=r!==null&&typeof r=="object"&&!Array.isArray(r)&&!(r instanceof Date)&&!(r instanceof RegExp),o=n!=null&&typeof n=="object"&&!Array.isArray(n)&&!(n instanceof Date)&&!(n instanceof RegExp);i&&o?a[s]=ua(n,r):a[s]=r}return a}var pr={};Ks(pr,{array:()=>gr,choice:()=>vr,json:()=>yr,object:()=>hr,text:()=>fr});function mr(t){const e=["ROOT"];let a=-1,s=null;function r(c,l,d){switch(c){case'"':{a=l,e.pop(),e.push(d),e.push("INSIDE_STRING");break}case"f":case"t":case"n":{a=l,s=l,e.pop(),e.push(d),e.push("INSIDE_LITERAL");break}case"-":{e.pop(),e.push(d),e.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{a=l,e.pop(),e.push(d),e.push("INSIDE_NUMBER");break}case"{":{a=l,e.pop(),e.push(d),e.push("INSIDE_OBJECT_START");break}case"[":{a=l,e.pop(),e.push(d),e.push("INSIDE_ARRAY_START");break}}}function n(c,l){switch(c){case",":{e.pop(),e.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{a=l,e.pop();break}}}function i(c,l){switch(c){case",":{e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{a=l,e.pop();break}}}for(let c=0;c<t.length;c++){const l=t[c];switch(e[e.length-1]){case"ROOT":r(l,c,"FINISH");break;case"INSIDE_OBJECT_START":{switch(l){case'"':{e.pop(),e.push("INSIDE_OBJECT_KEY");break}case"}":{a=c,e.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{l==='"'&&(e.pop(),e.push("INSIDE_OBJECT_KEY"));break}case"INSIDE_OBJECT_KEY":{l==='"'&&(e.pop(),e.push("INSIDE_OBJECT_AFTER_KEY"));break}case"INSIDE_OBJECT_AFTER_KEY":{l===":"&&(e.pop(),e.push("INSIDE_OBJECT_BEFORE_VALUE"));break}case"INSIDE_OBJECT_BEFORE_VALUE":{r(l,c,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{n(l,c);break}case"INSIDE_STRING":{switch(l){case'"':{e.pop(),a=c;break}case"\\":{e.push("INSIDE_STRING_ESCAPE");break}default:a=c}break}case"INSIDE_ARRAY_START":{l==="]"?(a=c,e.pop()):(a=c,r(l,c,"INSIDE_ARRAY_AFTER_VALUE"));break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(l){case",":{e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{a=c,e.pop();break}default:{a=c;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{r(l,c,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{e.pop(),a=c;break}case"INSIDE_NUMBER":{switch(l){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{a=c;break}case"e":case"E":case"-":case".":break;case",":{e.pop(),e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(l,c),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&n(l,c);break}case"}":{e.pop(),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&n(l,c);break}case"]":{e.pop(),e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(l,c);break}default:{e.pop();break}}break}case"INSIDE_LITERAL":{const m=t.substring(s,c+1);!"false".startsWith(m)&&!"true".startsWith(m)&&!"null".startsWith(m)?(e.pop(),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?n(l,c):e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(l,c)):a=c;break}}}let o=t.slice(0,a+1);for(let c=e.length-1;c>=0;c--)switch(e[c]){case"INSIDE_STRING":{o+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{o+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{o+="]";break}case"INSIDE_LITERAL":{const d=t.substring(s,t.length);"true".startsWith(d)?o+="true".slice(d.length):"false".startsWith(d)?o+="false".slice(d.length):"null".startsWith(d)&&(o+="null".slice(d.length))}}return o}async function Ae(t){if(t===void 0)return{value:void 0,state:"undefined-input"};let e=await me({text:t});return e.success?{value:e.value,state:"successful-parse"}:(e=await me({text:mr(t)}),e.success?{value:e.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var fr=()=>({name:"text",responseFormat:Promise.resolve({type:"text"}),async parseCompleteOutput({text:t}){return t},async parsePartialOutput({text:t}){return{partial:t}},createElementStreamTransform(){}}),hr=({schema:t,name:e,description:a})=>{const s=nt(t);return{name:"object",responseFormat:ce(s.jsonSchema).then(r=>({type:"json",schema:r,...e!=null&&{name:e},...a!=null&&{description:a}})),async parseCompleteOutput({text:r},n){const i=await me({text:r});if(!i.success)throw new ue({message:"No object generated: could not parse the response.",cause:i.error,text:r,response:n.response,usage:n.usage,finishReason:n.finishReason});const o=await Ne({value:i.value,schema:s});if(!o.success)throw new ue({message:"No object generated: response did not match schema.",cause:o.error,text:r,response:n.response,usage:n.usage,finishReason:n.finishReason});return o.value},async parsePartialOutput({text:r}){const n=await Ae(r);switch(n.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:n.value}}},createElementStreamTransform(){}}},gr=({element:t,name:e,description:a})=>{const s=nt(t);return{name:"array",responseFormat:ce(s.jsonSchema).then(r=>{const{$schema:n,...i}=r;return{type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{elements:{type:"array",items:i}},required:["elements"],additionalProperties:!1},...e!=null&&{name:e},...a!=null&&{description:a}}}),async parseCompleteOutput({text:r},n){const i=await me({text:r});if(!i.success)throw new ue({message:"No object generated: could not parse the response.",cause:i.error,text:r,response:n.response,usage:n.usage,finishReason:n.finishReason});const o=i.value;if(o==null||typeof o!="object"||!("elements"in o)||!Array.isArray(o.elements))throw new ue({message:"No object generated: response did not match schema.",cause:new xe({value:o,cause:"response must be an object with an elements array"}),text:r,response:n.response,usage:n.usage,finishReason:n.finishReason});for(const c of o.elements){const l=await Ne({value:c,schema:s});if(!l.success)throw new ue({message:"No object generated: response did not match schema.",cause:l.error,text:r,response:n.response,usage:n.usage,finishReason:n.finishReason})}return o.elements},async parsePartialOutput({text:r}){const n=await Ae(r);switch(n.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const i=n.value;if(i==null||typeof i!="object"||!("elements"in i)||!Array.isArray(i.elements))return;const o=n.state==="repaired-parse"&&i.elements.length>0?i.elements.slice(0,-1):i.elements,c=[];for(const l of o){const d=await Ne({value:l,schema:s});d.success&&c.push(d.value)}return{partial:c}}}},createElementStreamTransform(){let r=0;return new TransformStream({transform({partialOutput:n},i){if(n!=null)for(;r<n.length;r++)i.enqueue(n[r])}})}}},vr=({options:t,name:e,description:a})=>({name:"choice",responseFormat:Promise.resolve({type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{result:{type:"string",enum:t}},required:["result"],additionalProperties:!1},...e!=null&&{name:e},...a!=null&&{description:a}}),async parseCompleteOutput({text:s},r){const n=await me({text:s});if(!n.success)throw new ue({message:"No object generated: could not parse the response.",cause:n.error,text:s,response:r.response,usage:r.usage,finishReason:r.finishReason});const i=n.value;if(i==null||typeof i!="object"||!("result"in i)||typeof i.result!="string"||!t.includes(i.result))throw new ue({message:"No object generated: response did not match schema.",cause:new xe({value:i,cause:"response must be an object that contains a choice value."}),text:s,response:r.response,usage:r.usage,finishReason:r.finishReason});return i.result},async parsePartialOutput({text:s}){const r=await Ae(s);switch(r.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const n=r.value;if(n==null||typeof n!="object"||!("result"in n)||typeof n.result!="string")return;const i=t.filter(o=>o.startsWith(n.result));return r.state==="successful-parse"?i.includes(n.result)?{partial:n.result}:void 0:i.length===1?{partial:i[0]}:void 0}}},createElementStreamTransform(){}}),yr=({name:t,description:e}={})=>({name:"json",responseFormat:Promise.resolve({type:"json",...t!=null&&{name:t},...e!=null&&{description:e}}),async parseCompleteOutput({text:a},s){const r=await me({text:a});if(!r.success)throw new ue({message:"No object generated: could not parse the response.",cause:r.error,text:a,response:s.response,usage:s.usage,finishReason:s.finishReason});return r.value},async parsePartialOutput({text:a}){const s=await Ae(a);switch(s.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return s.value===void 0?void 0:{partial:s.value}}},createElementStreamTransform(){}});Ce({prefix:"aitxt",size:24});(class extends TransformStream{constructor(){super({transform(t,e){e.enqueue(`data: ${JSON.stringify(t)}
|
|
8
8
|
|
|
9
9
|
`)},flush(t){t.enqueue(`data: [DONE]
|
|
10
10
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as f,v as y,x as p,K as m}from"./index-
|
|
1
|
+
import{c as f,v as y,x as p,K as m}from"./index-ZiFjEqyT.js";import{u as T}from"./useMutation-4fnzP4bc.js";import{c as S}from"./connection-CmMMEDBY.js";function N(t){const e=f.c(8);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=S(),e[0]=n):n=e[0];const u=n;let r;e[1]!==t?(r=m.organizationSettings(t),e[1]=t,e[2]=r):r=e[2];let s;e[3]!==t?(s=async()=>{const i=await u("ORGANIZATION_SETTINGS_GET",{});return i||{organizationId:t,sidebar_items:null,enabled_plugins:null,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}},e[3]=t,e[4]=s):s=e[4];let l;e[5]!==r||e[6]!==s?(l={queryKey:r,queryFn:s,staleTime:6e4},e[5]=r,e[6]=s,e[7]=l):l=e[7];const{data:c}=y(l);return c}function C(t){const e=f.c(11),n=p();let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=S(),e[0]=u):u=e[0];const r=u;let s;e[1]!==t?(s=async o=>await r("ORGANIZATION_SETTINGS_UPDATE",{organizationId:t,...o}),e[1]=t,e[2]=s):s=e[2];let l;e[3]!==t||e[4]!==n?(l=o=>{n.setQueryData(m.organizationSettings(t),o)},e[3]=t,e[4]=n,e[5]=l):l=e[5];let c;e[6]!==s||e[7]!==l?(c={mutationFn:s,onSuccess:l},e[6]=s,e[7]=l,e[8]=c):c=e[8];const i=T(c);let a;return e[9]!==i?(a={update:i},e[9]=i,e[10]=a):a=e[10],a}export{C as a,N as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as p,K as C,v as T}from"./index-
|
|
1
|
+
import{c as p,K as C,v as T}from"./index-ZiFjEqyT.js";import{u as q}from"./useQuery-Bn2Wcch_.js";import{u as K}from"./useMutation-4fnzP4bc.js";function E(a){const e=p.c(23);let o,l,t,s,r;e[0]!==a?({toolCaller:t,toolName:r,toolInputParams:s,scope:l,...o}=a,e[0]=a,e[1]=o,e[2]=l,e[3]=t,e[4]=s,e[5]=r):(o=e[1],l=e[2],t=e[3],s=e[4],r=e[5]);let i,c,m,u;if(e[6]!==o||e[7]!==l||e[8]!==s||e[9]!==r){const y=JSON.stringify(s);u=T,i=o,c=o.staleTime??6e4,m=C.toolCall(l,r,y),e[6]=o,e[7]=l,e[8]=s,e[9]=r,e[10]=i,e[11]=c,e[12]=m,e[13]=u}else i=e[10],c=e[11],m=e[12],u=e[13];let n;e[14]!==t||e[15]!==s||e[16]!==r?(n=async()=>await t(r,s),e[14]=t,e[15]=s,e[16]=r,e[17]=n):n=e[17];let f;return e[18]!==i||e[19]!==c||e[20]!==m||e[21]!==n?(f={...i,staleTime:c,queryKey:m,queryFn:n},e[18]=i,e[19]=c,e[20]=m,e[21]=n,e[22]=f):f=e[22],u(f)}function F(a){const e=p.c(3),{toolCaller:o,toolName:l}=a;let t;return e[0]!==o||e[1]!==l?(t={mutationFn:async s=>await o(l,s),onSuccess:S,onError:N},e[0]=o,e[1]=l,e[2]=t):t=e[2],K(t)}function N(a){console.error("tool call mutation error",a)}function S(a){console.log("tool call mutation success",a)}function I(a){const e=p.c(14),{toolCaller:o,toolName:l,toolInputParams:t,scope:s,staleTime:r,refetchInterval:i,enabled:c}=a,m=r===void 0?6e4:r;let u;e[0]!==s||e[1]!==t||e[2]!==l?(u=C.toolCall(s,l,JSON.stringify(t??{})),e[0]=s,e[1]=t,e[2]=l,e[3]=u):u=e[3];let n;e[4]!==o||e[5]!==t||e[6]!==l?(n=async()=>await o(l,t??{}),e[4]=o,e[5]=t,e[6]=l,e[7]=n):n=e[7];let f;return e[8]!==c||e[9]!==i||e[10]!==m||e[11]!==u||e[12]!==n?(f={queryKey:u,queryFn:n,enabled:c,staleTime:m,refetchInterval:i},e[8]=c,e[9]=i,e[10]=m,e[11]=u,e[12]=n,e[13]=f):f=e[13],q(f)}export{I as a,F as b,E as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{I as u}from"./infiniteQueryObserver-DEh2zauU.js";import{a7 as i}from"./index-ZiFjEqyT.js";function t(e,r){return i(e,u,r)}export{t as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{b0 as l,b2 as b,bP as n,bQ as d,b1 as h,x as p,r as o,ba as m,bR as v}from"./index-ZiFjEqyT.js";var y=class extends l{#s;#i=void 0;#t;#e;constructor(t,s){super(),this.#s=t,this.setOptions(s),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const s=this.options;this.options=this.#s.defaultMutationOptions(t),b(this.options,s)||this.#s.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#t,observer:this}),s?.mutationKey&&this.options.mutationKey&&n(s.mutationKey)!==n(this.options.mutationKey)?this.reset():this.#t?.state.status==="pending"&&this.#t.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#t?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#o(t)}getCurrentResult(){return this.#i}reset(){this.#t?.removeObserver(this),this.#t=void 0,this.#r(),this.#o()}mutate(t,s){return this.#e=s,this.#t?.removeObserver(this),this.#t=this.#s.getMutationCache().build(this.#s,this.options),this.#t.addObserver(this),this.#t.execute(t)}#r(){const t=this.#t?.state??d();this.#i={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#o(t){h.batch(()=>{if(this.#e&&this.hasListeners()){const s=this.#i.variables,r=this.#i.context,e={client:this.#s,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#e.onSuccess?.(t.data,s,r,e)}catch(i){Promise.reject(i)}try{this.#e.onSettled?.(t.data,null,s,r,e)}catch(i){Promise.reject(i)}}else if(t?.type==="error"){try{this.#e.onError?.(t.error,s,r,e)}catch(i){Promise.reject(i)}try{this.#e.onSettled?.(void 0,t.error,s,r,e)}catch(i){Promise.reject(i)}}}this.listeners.forEach(s=>{s(this.#i)})})}};function O(t,s){const r=p(s),[e]=o.useState(()=>new y(r,t));o.useEffect(()=>{e.setOptions(t)},[e,t]);const i=o.useSyncExternalStore(o.useCallback(a=>e.subscribe(h.batchCalls(a)),[e]),()=>e.getCurrentResult(),()=>e.getCurrentResult()),u=o.useCallback((a,c)=>{e.mutate(a,c).catch(m)},[e]);if(i.error&&v(e.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:u,mutateAsync:i.mutate}}export{O as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a7 as u,b4 as s}from"./index-ZiFjEqyT.js";function o(e,r){return u(e,s,r)}export{o as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as z,an as A,j as c,aj as M,al as ge,H as h,ai as he,ao as X,ap as pe,ah as be,aq as me,h as ve,c as Y}from"./index-C5FDJtAp.js";import{c as Z}from"./button-ClkQLR3o.js";var ee="Toggle",te=z.forwardRef((t,e)=>{const{pressed:r,defaultPressed:n,onPressedChange:a,...o}=t,[i,s]=A({prop:r,onChange:a,defaultProp:n??!1,caller:ee});return c.jsx(M.button,{type:"button","aria-pressed":i,"data-state":i?"on":"off","data-disabled":t.disabled?"":void 0,...o,ref:e,onClick:ge(t.onClick,()=>{t.disabled||s(!i)})})});te.displayName=ee;var b="ToggleGroup",[re]=he(b,[X]),ne=X(),S=h.forwardRef((t,e)=>{const{type:r,...n}=t;if(r==="single"){const a=n;return c.jsx(we,{...a,ref:e})}if(r==="multiple"){const a=n;return c.jsx(ye,{...a,ref:e})}throw new Error(`Missing prop \`type\` expected on \`${b}\``)});S.displayName=b;var[ae,ie]=re(b),we=h.forwardRef((t,e)=>{const{value:r,defaultValue:n,onValueChange:a=()=>{},...o}=t,[i,s]=A({prop:r,defaultProp:n??"",onChange:a,caller:b});return c.jsx(ae,{scope:t.__scopeToggleGroup,type:"single",value:h.useMemo(()=>i?[i]:[],[i]),onItemActivate:s,onItemDeactivate:h.useCallback(()=>s(""),[s]),children:c.jsx(oe,{...o,ref:e})})}),ye=h.forwardRef((t,e)=>{const{value:r,defaultValue:n,onValueChange:a=()=>{},...o}=t,[i,s]=A({prop:r,defaultProp:n??[],onChange:a,caller:b}),l=h.useCallback(f=>s((d=[])=>[...d,f]),[s]),u=h.useCallback(f=>s((d=[])=>d.filter(xe=>xe!==f)),[s]);return c.jsx(ae,{scope:t.__scopeToggleGroup,type:"multiple",value:i,onItemActivate:l,onItemDeactivate:u,children:c.jsx(oe,{...o,ref:e})})});S.displayName=b;var[$e,Ne]=re(b),oe=h.forwardRef((t,e)=>{const{__scopeToggleGroup:r,disabled:n=!1,rovingFocus:a=!0,orientation:o,dir:i,loop:s=!0,...l}=t,u=ne(r),f=be(i),d={role:"group",dir:f,...l};return c.jsx($e,{scope:r,rovingFocus:a,disabled:n,children:a?c.jsx(me,{asChild:!0,...u,orientation:o,dir:f,loop:s,children:c.jsx(M.div,{...d,ref:e})}):c.jsx(M.div,{...d,ref:e})})}),k="ToggleGroupItem",se=h.forwardRef((t,e)=>{const r=ie(k,t.__scopeToggleGroup),n=Ne(k,t.__scopeToggleGroup),a=ne(t.__scopeToggleGroup),o=r.value.includes(t.value),i=n.disabled||t.disabled,s={...t,pressed:o,disabled:i},l=h.useRef(null);return n.rovingFocus?c.jsx(pe,{asChild:!0,...a,focusable:!i,active:o,ref:l,children:c.jsx(D,{...s,ref:e})}):c.jsx(D,{...s,ref:e})});se.displayName=k;var D=h.forwardRef((t,e)=>{const{__scopeToggleGroup:r,value:n,...a}=t,o=ie(k,r),i={role:"radio","aria-checked":t.pressed,"aria-pressed":void 0},s=o.type==="single"?i:void 0;return c.jsx(te,{...s,...a,ref:e,onPressedChange:l=>{l?o.onItemActivate(n):o.onItemDeactivate(n)}})}),Ge=S,Pe=se;const Re=ve("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-2 min-w-9",sm:"h-7 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),le=z.createContext({size:"default",variant:"default"});function Ye(t){const e=Y.c(20);let r,n,a,o,i;e[0]!==t?({className:n,variant:i,size:o,children:r,...a}=t,e[0]=t,e[1]=r,e[2]=n,e[3]=a,e[4]=o,e[5]=i):(r=e[1],n=e[2],a=e[3],o=e[4],i=e[5]);let s;e[6]!==n?(s=Z("group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs",n),e[6]=n,e[7]=s):s=e[7];let l;e[8]!==o||e[9]!==i?(l={variant:i,size:o},e[8]=o,e[9]=i,e[10]=l):l=e[10];let u;e[11]!==r||e[12]!==l?(u=c.jsx(le.Provider,{value:l,children:r}),e[11]=r,e[12]=l,e[13]=u):u=e[13];let f;return e[14]!==a||e[15]!==o||e[16]!==s||e[17]!==u||e[18]!==i?(f=c.jsx(Ge,{"data-slot":"toggle-group","data-variant":i,"data-size":o,className:s,...a,children:u}),e[14]=a,e[15]=o,e[16]=s,e[17]=u,e[18]=i,e[19]=f):f=e[19],f}function Ze(t){const e=Y.c(18);let r,n,a,o,i;e[0]!==t?({className:n,children:r,variant:i,size:o,...a}=t,e[0]=t,e[1]=r,e[2]=n,e[3]=a,e[4]=o,e[5]=i):(r=e[1],n=e[2],a=e[3],o=e[4],i=e[5]);const s=z.useContext(le),l=s.variant||i,u=s.size||o;let f;e[6]!==n||e[7]!==s.size||e[8]!==s.variant||e[9]!==o||e[10]!==i?(f=Z(Re({variant:s.variant||i,size:s.size||o}),"min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l",n),e[6]=n,e[7]=s.size,e[8]=s.variant,e[9]=o,e[10]=i,e[11]=f):f=e[11];let d;return e[12]!==r||e[13]!==a||e[14]!==l||e[15]!==u||e[16]!==f?(d=c.jsx(Pe,{"data-slot":"toggle-group-item","data-variant":l,"data-size":u,className:f,...a,children:r}),e[12]=r,e[13]=a,e[14]=l,e[15]=u,e[16]=f,e[17]=d):d=e[17],d}function V(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function fe(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function G(){}var y=.7,j=1/y,w="\\s*([+-]?\\d+)\\s*",$="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",p="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ke=/^#([0-9a-f]{3,8})$/,je=new RegExp(`^rgb\\(${w},${w},${w}\\)$`),Ce=new RegExp(`^rgb\\(${p},${p},${p}\\)$`),Te=new RegExp(`^rgba\\(${w},${w},${w},${$}\\)$`),_e=new RegExp(`^rgba\\(${p},${p},${p},${$}\\)$`),Me=new RegExp(`^hsl\\(${$},${p},${p}\\)$`),Ie=new RegExp(`^hsla\\(${$},${p},${p},${$}\\)$`),F={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};V(G,N,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:O,formatHex:O,formatHex8:Ee,formatHsl:He,formatRgb:B,toString:B});function O(){return this.rgb().formatHex()}function Ee(){return this.rgb().formatHex8()}function He(){return ue(this).formatHsl()}function B(){return this.rgb().formatRgb()}function N(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=ke.exec(t))?(r=e[1].length,e=parseInt(e[1],16),r===6?L(e):r===3?new x(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?P(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?P(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=je.exec(t))?new x(e[1],e[2],e[3],1):(e=Ce.exec(t))?new x(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Te.exec(t))?P(e[1],e[2],e[3],e[4]):(e=_e.exec(t))?P(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Me.exec(t))?K(e[1],e[2]/100,e[3]/100,1):(e=Ie.exec(t))?K(e[1],e[2]/100,e[3]/100,e[4]):F.hasOwnProperty(t)?L(F[t]):t==="transparent"?new x(NaN,NaN,NaN,0):null}function L(t){return new x(t>>16&255,t>>8&255,t&255,1)}function P(t,e,r,n){return n<=0&&(t=e=r=NaN),new x(t,e,r,n)}function ze(t){return t instanceof G||(t=N(t)),t?(t=t.rgb(),new x(t.r,t.g,t.b,t.opacity)):new x}function I(t,e,r,n){return arguments.length===1?ze(t):new x(t,e,r,n??1)}function x(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}V(x,I,fe(G,{brighter(t){return t=t==null?j:Math.pow(j,t),new x(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?y:Math.pow(y,t),new x(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new x(v(this.r),v(this.g),v(this.b),C(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:U,formatHex:U,formatHex8:Ae,formatRgb:J,toString:J}));function U(){return`#${m(this.r)}${m(this.g)}${m(this.b)}`}function Ae(){return`#${m(this.r)}${m(this.g)}${m(this.b)}${m((isNaN(this.opacity)?1:this.opacity)*255)}`}function J(){const t=C(this.opacity);return`${t===1?"rgb(":"rgba("}${v(this.r)}, ${v(this.g)}, ${v(this.b)}${t===1?")":`, ${t})`}`}function C(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function v(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function m(t){return t=v(t),(t<16?"0":"")+t.toString(16)}function K(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new g(t,e,r,n)}function ue(t){if(t instanceof g)return new g(t.h,t.s,t.l,t.opacity);if(t instanceof G||(t=N(t)),!t)return new g;if(t instanceof g)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,a=Math.min(e,r,n),o=Math.max(e,r,n),i=NaN,s=o-a,l=(o+a)/2;return s?(e===o?i=(r-n)/s+(r<n)*6:r===o?i=(n-e)/s+2:i=(e-r)/s+4,s/=l<.5?o+a:2-o-a,i*=60):s=l>0&&l<1?0:i,new g(i,s,l,t.opacity)}function Se(t,e,r,n){return arguments.length===1?ue(t):new g(t,e,r,n??1)}function g(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}V(g,Se,fe(G,{brighter(t){return t=t==null?j:Math.pow(j,t),new g(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?y:Math.pow(y,t),new g(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,a=2*r-n;return new x(T(t>=240?t-240:t+120,a,n),T(t,a,n),T(t<120?t+240:t-120,a,n),this.opacity)},clamp(){return new g(Q(this.h),R(this.s),R(this.l),C(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=C(this.opacity);return`${t===1?"hsl(":"hsla("}${Q(this.h)}, ${R(this.s)*100}%, ${R(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Q(t){return t=(t||0)%360,t<0?t+360:t}function R(t){return Math.max(0,Math.min(1,t||0))}function T(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}const q=t=>()=>t;function Ve(t,e){return function(r){return t+r*e}}function qe(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function De(t){return(t=+t)==1?ce:function(e,r){return r-e?qe(e,r,t):q(isNaN(e)?r:e)}}function ce(t,e){var r=e-t;return r?Ve(t,r):q(isNaN(t)?e:t)}const W=(function t(e){var r=De(e);function n(a,o){var i=r((a=I(a)).r,(o=I(o)).r),s=r(a.g,o.g),l=r(a.b,o.b),u=ce(a.opacity,o.opacity);return function(f){return a.r=i(f),a.g=s(f),a.b=l(f),a.opacity=u(f),a+""}}return n.gamma=t,n})(1);function Fe(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,n=e.slice(),a;return function(o){for(a=0;a<r;++a)n[a]=t[a]*(1-o)+e[a]*o;return n}}function Oe(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Be(t,e){var r=e?e.length:0,n=t?Math.min(r,t.length):0,a=new Array(n),o=new Array(r),i;for(i=0;i<n;++i)a[i]=de(t[i],e[i]);for(;i<r;++i)o[i]=e[i];return function(s){for(i=0;i<n;++i)o[i]=a[i](s);return o}}function Le(t,e){var r=new Date;return t=+t,e=+e,function(n){return r.setTime(t*(1-n)+e*n),r}}function E(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function Ue(t,e){var r={},n={},a;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(a in e)a in t?r[a]=de(t[a],e[a]):n[a]=e[a];return function(o){for(a in r)n[a]=r[a](o);return n}}var H=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,_=new RegExp(H.source,"g");function Je(t){return function(){return t}}function Ke(t){return function(e){return t(e)+""}}function Qe(t,e){var r=H.lastIndex=_.lastIndex=0,n,a,o,i=-1,s=[],l=[];for(t=t+"",e=e+"";(n=H.exec(t))&&(a=_.exec(e));)(o=a.index)>r&&(o=e.slice(r,o),s[i]?s[i]+=o:s[++i]=o),(n=n[0])===(a=a[0])?s[i]?s[i]+=a:s[++i]=a:(s[++i]=null,l.push({i,x:E(n,a)})),r=_.lastIndex;return r<e.length&&(o=e.slice(r),s[i]?s[i]+=o:s[++i]=o),s.length<2?l[0]?Ke(l[0].x):Je(e):(e=l.length,function(u){for(var f=0,d;f<e;++f)s[(d=l[f]).i]=d.x(u);return s.join("")})}function de(t,e){var r=typeof e,n;return e==null||r==="boolean"?q(e):(r==="number"?E:r==="string"?(n=N(e))?(e=n,W):Qe:e instanceof N?W:e instanceof Date?Le:Oe(e)?Fe:Array.isArray(e)?Be:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?Ue:E)(t,e)}export{Ze as T,W as a,Qe as b,N as c,de as d,Ye as e,E as i};
|
|
1
|
+
import{r as z,an as A,j as c,aj as M,al as ge,H as h,ai as he,ao as X,ap as pe,ah as be,aq as me,h as ve,c as Y}from"./index-ZiFjEqyT.js";import{c as Z}from"./button-Co_HOc3E.js";var ee="Toggle",te=z.forwardRef((t,e)=>{const{pressed:r,defaultPressed:n,onPressedChange:a,...o}=t,[i,s]=A({prop:r,onChange:a,defaultProp:n??!1,caller:ee});return c.jsx(M.button,{type:"button","aria-pressed":i,"data-state":i?"on":"off","data-disabled":t.disabled?"":void 0,...o,ref:e,onClick:ge(t.onClick,()=>{t.disabled||s(!i)})})});te.displayName=ee;var b="ToggleGroup",[re]=he(b,[X]),ne=X(),S=h.forwardRef((t,e)=>{const{type:r,...n}=t;if(r==="single"){const a=n;return c.jsx(we,{...a,ref:e})}if(r==="multiple"){const a=n;return c.jsx(ye,{...a,ref:e})}throw new Error(`Missing prop \`type\` expected on \`${b}\``)});S.displayName=b;var[ae,ie]=re(b),we=h.forwardRef((t,e)=>{const{value:r,defaultValue:n,onValueChange:a=()=>{},...o}=t,[i,s]=A({prop:r,defaultProp:n??"",onChange:a,caller:b});return c.jsx(ae,{scope:t.__scopeToggleGroup,type:"single",value:h.useMemo(()=>i?[i]:[],[i]),onItemActivate:s,onItemDeactivate:h.useCallback(()=>s(""),[s]),children:c.jsx(oe,{...o,ref:e})})}),ye=h.forwardRef((t,e)=>{const{value:r,defaultValue:n,onValueChange:a=()=>{},...o}=t,[i,s]=A({prop:r,defaultProp:n??[],onChange:a,caller:b}),l=h.useCallback(f=>s((d=[])=>[...d,f]),[s]),u=h.useCallback(f=>s((d=[])=>d.filter(xe=>xe!==f)),[s]);return c.jsx(ae,{scope:t.__scopeToggleGroup,type:"multiple",value:i,onItemActivate:l,onItemDeactivate:u,children:c.jsx(oe,{...o,ref:e})})});S.displayName=b;var[$e,Ne]=re(b),oe=h.forwardRef((t,e)=>{const{__scopeToggleGroup:r,disabled:n=!1,rovingFocus:a=!0,orientation:o,dir:i,loop:s=!0,...l}=t,u=ne(r),f=be(i),d={role:"group",dir:f,...l};return c.jsx($e,{scope:r,rovingFocus:a,disabled:n,children:a?c.jsx(me,{asChild:!0,...u,orientation:o,dir:f,loop:s,children:c.jsx(M.div,{...d,ref:e})}):c.jsx(M.div,{...d,ref:e})})}),k="ToggleGroupItem",se=h.forwardRef((t,e)=>{const r=ie(k,t.__scopeToggleGroup),n=Ne(k,t.__scopeToggleGroup),a=ne(t.__scopeToggleGroup),o=r.value.includes(t.value),i=n.disabled||t.disabled,s={...t,pressed:o,disabled:i},l=h.useRef(null);return n.rovingFocus?c.jsx(pe,{asChild:!0,...a,focusable:!i,active:o,ref:l,children:c.jsx(D,{...s,ref:e})}):c.jsx(D,{...s,ref:e})});se.displayName=k;var D=h.forwardRef((t,e)=>{const{__scopeToggleGroup:r,value:n,...a}=t,o=ie(k,r),i={role:"radio","aria-checked":t.pressed,"aria-pressed":void 0},s=o.type==="single"?i:void 0;return c.jsx(te,{...s,...a,ref:e,onPressedChange:l=>{l?o.onItemActivate(n):o.onItemDeactivate(n)}})}),Ge=S,Pe=se;const Re=ve("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-2 min-w-9",sm:"h-7 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),le=z.createContext({size:"default",variant:"default"});function Ye(t){const e=Y.c(20);let r,n,a,o,i;e[0]!==t?({className:n,variant:i,size:o,children:r,...a}=t,e[0]=t,e[1]=r,e[2]=n,e[3]=a,e[4]=o,e[5]=i):(r=e[1],n=e[2],a=e[3],o=e[4],i=e[5]);let s;e[6]!==n?(s=Z("group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs",n),e[6]=n,e[7]=s):s=e[7];let l;e[8]!==o||e[9]!==i?(l={variant:i,size:o},e[8]=o,e[9]=i,e[10]=l):l=e[10];let u;e[11]!==r||e[12]!==l?(u=c.jsx(le.Provider,{value:l,children:r}),e[11]=r,e[12]=l,e[13]=u):u=e[13];let f;return e[14]!==a||e[15]!==o||e[16]!==s||e[17]!==u||e[18]!==i?(f=c.jsx(Ge,{"data-slot":"toggle-group","data-variant":i,"data-size":o,className:s,...a,children:u}),e[14]=a,e[15]=o,e[16]=s,e[17]=u,e[18]=i,e[19]=f):f=e[19],f}function Ze(t){const e=Y.c(18);let r,n,a,o,i;e[0]!==t?({className:n,children:r,variant:i,size:o,...a}=t,e[0]=t,e[1]=r,e[2]=n,e[3]=a,e[4]=o,e[5]=i):(r=e[1],n=e[2],a=e[3],o=e[4],i=e[5]);const s=z.useContext(le),l=s.variant||i,u=s.size||o;let f;e[6]!==n||e[7]!==s.size||e[8]!==s.variant||e[9]!==o||e[10]!==i?(f=Z(Re({variant:s.variant||i,size:s.size||o}),"min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l",n),e[6]=n,e[7]=s.size,e[8]=s.variant,e[9]=o,e[10]=i,e[11]=f):f=e[11];let d;return e[12]!==r||e[13]!==a||e[14]!==l||e[15]!==u||e[16]!==f?(d=c.jsx(Pe,{"data-slot":"toggle-group-item","data-variant":l,"data-size":u,className:f,...a,children:r}),e[12]=r,e[13]=a,e[14]=l,e[15]=u,e[16]=f,e[17]=d):d=e[17],d}function V(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function fe(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function G(){}var y=.7,j=1/y,w="\\s*([+-]?\\d+)\\s*",$="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",p="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ke=/^#([0-9a-f]{3,8})$/,je=new RegExp(`^rgb\\(${w},${w},${w}\\)$`),Ce=new RegExp(`^rgb\\(${p},${p},${p}\\)$`),Te=new RegExp(`^rgba\\(${w},${w},${w},${$}\\)$`),_e=new RegExp(`^rgba\\(${p},${p},${p},${$}\\)$`),Me=new RegExp(`^hsl\\(${$},${p},${p}\\)$`),Ie=new RegExp(`^hsla\\(${$},${p},${p},${$}\\)$`),F={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};V(G,N,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:O,formatHex:O,formatHex8:Ee,formatHsl:He,formatRgb:B,toString:B});function O(){return this.rgb().formatHex()}function Ee(){return this.rgb().formatHex8()}function He(){return ue(this).formatHsl()}function B(){return this.rgb().formatRgb()}function N(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=ke.exec(t))?(r=e[1].length,e=parseInt(e[1],16),r===6?L(e):r===3?new x(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?P(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?P(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=je.exec(t))?new x(e[1],e[2],e[3],1):(e=Ce.exec(t))?new x(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Te.exec(t))?P(e[1],e[2],e[3],e[4]):(e=_e.exec(t))?P(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Me.exec(t))?K(e[1],e[2]/100,e[3]/100,1):(e=Ie.exec(t))?K(e[1],e[2]/100,e[3]/100,e[4]):F.hasOwnProperty(t)?L(F[t]):t==="transparent"?new x(NaN,NaN,NaN,0):null}function L(t){return new x(t>>16&255,t>>8&255,t&255,1)}function P(t,e,r,n){return n<=0&&(t=e=r=NaN),new x(t,e,r,n)}function ze(t){return t instanceof G||(t=N(t)),t?(t=t.rgb(),new x(t.r,t.g,t.b,t.opacity)):new x}function I(t,e,r,n){return arguments.length===1?ze(t):new x(t,e,r,n??1)}function x(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}V(x,I,fe(G,{brighter(t){return t=t==null?j:Math.pow(j,t),new x(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?y:Math.pow(y,t),new x(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new x(v(this.r),v(this.g),v(this.b),C(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:U,formatHex:U,formatHex8:Ae,formatRgb:J,toString:J}));function U(){return`#${m(this.r)}${m(this.g)}${m(this.b)}`}function Ae(){return`#${m(this.r)}${m(this.g)}${m(this.b)}${m((isNaN(this.opacity)?1:this.opacity)*255)}`}function J(){const t=C(this.opacity);return`${t===1?"rgb(":"rgba("}${v(this.r)}, ${v(this.g)}, ${v(this.b)}${t===1?")":`, ${t})`}`}function C(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function v(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function m(t){return t=v(t),(t<16?"0":"")+t.toString(16)}function K(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new g(t,e,r,n)}function ue(t){if(t instanceof g)return new g(t.h,t.s,t.l,t.opacity);if(t instanceof G||(t=N(t)),!t)return new g;if(t instanceof g)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,a=Math.min(e,r,n),o=Math.max(e,r,n),i=NaN,s=o-a,l=(o+a)/2;return s?(e===o?i=(r-n)/s+(r<n)*6:r===o?i=(n-e)/s+2:i=(e-r)/s+4,s/=l<.5?o+a:2-o-a,i*=60):s=l>0&&l<1?0:i,new g(i,s,l,t.opacity)}function Se(t,e,r,n){return arguments.length===1?ue(t):new g(t,e,r,n??1)}function g(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}V(g,Se,fe(G,{brighter(t){return t=t==null?j:Math.pow(j,t),new g(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?y:Math.pow(y,t),new g(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,a=2*r-n;return new x(T(t>=240?t-240:t+120,a,n),T(t,a,n),T(t<120?t+240:t-120,a,n),this.opacity)},clamp(){return new g(Q(this.h),R(this.s),R(this.l),C(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=C(this.opacity);return`${t===1?"hsl(":"hsla("}${Q(this.h)}, ${R(this.s)*100}%, ${R(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Q(t){return t=(t||0)%360,t<0?t+360:t}function R(t){return Math.max(0,Math.min(1,t||0))}function T(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}const q=t=>()=>t;function Ve(t,e){return function(r){return t+r*e}}function qe(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function De(t){return(t=+t)==1?ce:function(e,r){return r-e?qe(e,r,t):q(isNaN(e)?r:e)}}function ce(t,e){var r=e-t;return r?Ve(t,r):q(isNaN(t)?e:t)}const W=(function t(e){var r=De(e);function n(a,o){var i=r((a=I(a)).r,(o=I(o)).r),s=r(a.g,o.g),l=r(a.b,o.b),u=ce(a.opacity,o.opacity);return function(f){return a.r=i(f),a.g=s(f),a.b=l(f),a.opacity=u(f),a+""}}return n.gamma=t,n})(1);function Fe(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,n=e.slice(),a;return function(o){for(a=0;a<r;++a)n[a]=t[a]*(1-o)+e[a]*o;return n}}function Oe(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Be(t,e){var r=e?e.length:0,n=t?Math.min(r,t.length):0,a=new Array(n),o=new Array(r),i;for(i=0;i<n;++i)a[i]=de(t[i],e[i]);for(;i<r;++i)o[i]=e[i];return function(s){for(i=0;i<n;++i)o[i]=a[i](s);return o}}function Le(t,e){var r=new Date;return t=+t,e=+e,function(n){return r.setTime(t*(1-n)+e*n),r}}function E(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function Ue(t,e){var r={},n={},a;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(a in e)a in t?r[a]=de(t[a],e[a]):n[a]=e[a];return function(o){for(a in r)n[a]=r[a](o);return n}}var H=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,_=new RegExp(H.source,"g");function Je(t){return function(){return t}}function Ke(t){return function(e){return t(e)+""}}function Qe(t,e){var r=H.lastIndex=_.lastIndex=0,n,a,o,i=-1,s=[],l=[];for(t=t+"",e=e+"";(n=H.exec(t))&&(a=_.exec(e));)(o=a.index)>r&&(o=e.slice(r,o),s[i]?s[i]+=o:s[++i]=o),(n=n[0])===(a=a[0])?s[i]?s[i]+=a:s[++i]=a:(s[++i]=null,l.push({i,x:E(n,a)})),r=_.lastIndex;return r<e.length&&(o=e.slice(r),s[i]?s[i]+=o:s[++i]=o),s.length<2?l[0]?Ke(l[0].x):Je(e):(e=l.length,function(u){for(var f=0,d;f<e;++f)s[(d=l[f]).i]=d.x(u);return s.join("")})}function de(t,e){var r=typeof e,n;return e==null||r==="boolean"?q(e):(r==="number"?E:r==="string"?(n=N(e))?(e=n,W):Qe:e instanceof N?W:e instanceof Date?Le:Oe(e)?Fe:Array.isArray(e)?Be:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?Ue:E)(t,e)}export{Ze as T,W as a,Qe as b,N as c,de as d,Ye as e,E as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as Y,r as V,j as i}from"./index-
|
|
1
|
+
import{c as Y,r as V,j as i}from"./index-ZiFjEqyT.js";import{c as n}from"./button-Co_HOc3E.js";const Z={sm:{button:"size-7",icon:"size-4"},md:{button:"size-9",icon:"size-5"},lg:{button:"size-12",icon:"size-6"}};function oe(J){const e=Y.c(66),{value:o,onValueChange:l,options:t,size:D,fullWidth:F,className:W}=J,K=D===void 0?"sm":D,w=F===void 0?!1:F,G=V.useRef(null),H=V.useRef(null);let R;e[0]===Symbol.for("react.memo_cache_sentinel")?(R={left:0,width:0,opacity:0},e[0]=R):R=e[0];const[N,O]=V.useState(R);let _;e[1]===Symbol.for("react.memo_cache_sentinel")?(_=S=>{if(!S.current)return;const{offsetLeft:U,offsetWidth:X}=S.current;O({left:U,width:X,opacity:1})},e[1]=_):_=e[1];const Q=_;let C;e[2]!==t[0].value||e[3]!==o?(C=()=>{const S=o===t[0].value?G:H;Q(S)},e[2]=t[0].value,e[3]=o,e[4]=C):C=e[4];let E;e[5]!==t||e[6]!==o?(E=[o,t],e[5]=t,e[6]=o,e[7]=E):E=e[7],V.useEffect(C,E);const s=Z[K];let a;e[8]!==W?(a=n("relative flex gap-0 bg-muted rounded-lg",W),e[8]=W,e[9]=a):a=e[9];let c;e[10]!==l||e[11]!==t[0].value?(c=()=>l(t[0].value),e[10]=l,e[11]=t[0].value,e[12]=c):c=e[12];const $=w?"flex-1 h-12 px-4":s.button,I=!w&&t[0].label?"px-3":"";let r;e[13]!==I||e[14]!==$?(r=n("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",$,I),e[13]=I,e[14]=$,e[15]=r):r=e[15];const P=o===t[0].value?"text-foreground":"text-muted-foreground";let u;e[16]!==s.icon||e[17]!==P?(u=n("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",s.icon,P),e[16]=s.icon,e[17]=P,e[18]=u):u=e[18];let f;e[19]!==t[0].icon||e[20]!==u?(f=i.jsx("span",{className:u,children:t[0].icon}),e[19]=t[0].icon,e[20]=u,e[21]=f):f=e[21];let d;e[22]!==t[0].label||e[23]!==t[0].value||e[24]!==o?(d=t[0].label&&i.jsx("span",{className:n("text-xs transition-colors ease-out duration-200 whitespace-nowrap",o===t[0].value?"text-foreground":"text-muted-foreground"),children:t[0].label}),e[22]=t[0].label,e[23]=t[0].value,e[24]=o,e[25]=d):d=e[25];let m;e[26]!==r||e[27]!==f||e[28]!==d||e[29]!==c?(m=i.jsxs("button",{ref:G,type:"button",onClick:c,className:r,children:[f,d]}),e[26]=r,e[27]=f,e[28]=d,e[29]=c,e[30]=m):m=e[30];let x;e[31]!==l||e[32]!==t[1].value?(x=()=>l(t[1].value),e[31]=l,e[32]=t[1].value,e[33]=x):x=e[33];const L=w?"flex-1 h-12 px-4":s.button,M=!w&&t[1].label?"px-3":"";let p;e[34]!==L||e[35]!==M?(p=n("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",L,M),e[34]=L,e[35]=M,e[36]=p):p=e[36];const T=o===t[1].value?"text-foreground":"text-muted-foreground";let b;e[37]!==s.icon||e[38]!==T?(b=n("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",s.icon,T),e[37]=s.icon,e[38]=T,e[39]=b):b=e[39];let v;e[40]!==t[1].icon||e[41]!==b?(v=i.jsx("span",{className:b,children:t[1].icon}),e[40]=t[1].icon,e[41]=b,e[42]=v):v=e[42];let g;e[43]!==t[1].label||e[44]!==t[1].value||e[45]!==o?(g=t[1].label&&i.jsx("span",{className:n("text-xs transition-colors ease-out duration-200 whitespace-nowrap",o===t[1].value?"text-foreground":"text-muted-foreground"),children:t[1].label}),e[43]=t[1].label,e[44]=t[1].value,e[45]=o,e[46]=g):g=e[46];let h;e[47]!==x||e[48]!==p||e[49]!==v||e[50]!==g?(h=i.jsxs("button",{ref:H,type:"button",onClick:x,className:p,children:[v,g]}),e[47]=x,e[48]=p,e[49]=v,e[50]=g,e[51]=h):h=e[51];const q=w?"h-12":s.button;let y;e[52]!==q?(y=n("absolute z-0 bg-background rounded-lg border-shadow transition-all [transition-timing-function:var(--ease-out-cubic)] duration-200",q),e[52]=q,e[53]=y):y=e[53];const A=`${N.left}px`,B=`${N.width}px`;let j;e[54]!==N.opacity||e[55]!==A||e[56]!==B?(j={left:A,width:B,opacity:N.opacity},e[54]=N.opacity,e[55]=A,e[56]=B,e[57]=j):j=e[57];let z;e[58]!==y||e[59]!==j?(z=i.jsx("div",{className:y,style:j}),e[58]=y,e[59]=j,e[60]=z):z=e[60];let k;return e[61]!==m||e[62]!==h||e[63]!==z||e[64]!==a?(k=i.jsxs("div",{className:a,children:[m,h,z]}),e[61]=m,e[62]=h,e[63]=z,e[64]=a,e[65]=k):k=e[65],k}export{oe as V};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as L,f as P,r as v,j as e,c as k}from"./index-
|
|
1
|
+
import{a as L,f as P,r as v,j as e,c as k}from"./index-ZiFjEqyT.js";import{d as _}from"./well-known-mcp-D13f-8h2.js";import{C as R}from"./collection-tab-DVmiR956.js";import{a as z,u as A}from"./use-connection-BskZam-G.js";import{u as B}from"./project-context-provider-BPo-49FO.js";import{B as y}from"./button-Co_HOc3E.js";import{E as F}from"./empty-state-B1DU5702.js";import{C as M}from"./collection-header-Dl8Ii13M.js";import{b as O,a as H}from"./use-binding-C8KxuIY6.js";import{i as T}from"./Loading01-Bq_7Os6T.js";import"./generate-id-Dyweu44Y.js";import"./connection-CmMMEDBY.js";import"./collection-display-button-C_GfVLwh.js";import"./dropdown-menu-dsr_wyw0.js";import"./Grid01-BgBQwtBY.js";import"./ArrowUp-KvHCnFh3.js";import"./Check-D4dBNJmC.js";import"./List-hTdqyLGB.js";import"./tooltip-BJO9sFhZ.js";import"./view-mode-toggle-tlrhMsiy.js";import"./collection-search-D67e9ppe.js";import"./SearchMd-B_A85eif.js";import"./input-DEsmZ6es.js";import"./card-Rz2C5-Lx.js";import"./Copy01-Rf_P7R5F.js";import"./DotsVertical-f9rnazjX.js";import"./Edit01-MWKLkbpZ.js";import"./use-list-state-C5pgFF_z.js";import"./use-mobile-Co7MtEW-.js";import"./Trash01-GrzirNvV.js";import"./collection-table-wrapper-DDHrDWif.js";import"./empty-state-By_kA__m.js";import"./Inbox01-Bh5pMKE1.js";import"./avatar-CrVRRbJ7.js";import"./useQuery-Bn2Wcch_.js";import"./pin-to-sidebar-button-BahvsjHH.js";import"./use-organization-settings-K7SU43aD.js";import"./useMutation-4fnzP4bc.js";import"./use-collections-g067BPxP.js";import"./constants-B5NZDm4s.js";import"./alert-dialog-Df8ZsItX.js";import"./Plus-C4F6mby2.js";import"./layout-tF7tb_Qc.js";import"./ArrowLeft-CCqPW2JN.js";import"./binder-BtPpbY4I.js";function V({title:i,description:t,wellKnownMcp:o,imageSrc:n,onConnected:s}){const r=z(),{org:{slug:m}}=B(),{data:h}=L.useSession(),p=P(),[a,N]=v.useState(!1),l=async()=>{if(!(!o||!h?.user?.id)){N(!0);try{const c=await r.create.mutateAsync(o);s?.(c.id),p({to:"/$org/mcps/$connectionId",params:{org:m,connectionId:c.id}})}finally{N(!1)}}},j=()=>{p({to:"/$org/mcps",params:{org:m},search:{action:"create"}})};return e.jsx(F,{image:n?e.jsx("img",{src:n,alt:i,width:336,height:320,className:"max-w-full h-auto"}):null,title:i,description:t,actions:e.jsxs(e.Fragment,{children:[e.jsxs(y,{variant:"outline",onClick:l,disabled:a||!o,children:[o?.icon&&e.jsx("img",{src:o.icon,alt:"",className:"size-4"}),a?"Installing...":`Install ${o?.title||"MCP"}`]}),e.jsx(y,{variant:"outline",onClick:j,children:"Custom Connection"})]})})}function q(i){const t=k.c(28),{bindingName:o,collectionName:n,title:s,emptyState:r,wellKnownMcp:m}=i,{org:h}=B(),p=A();let a;t[0]!==p||t[1]!==o?(a={connections:p,binding:o},t[0]=p,t[1]=o,t[2]=a):a=t[2];const l=O(a)[0],j=H(l);let c;if(t[3]!==n||t[4]!==j){let C;t[6]!==n?(C=$=>$.name.toLowerCase()===n.toLowerCase(),t[6]=n,t[7]=C):C=t[7],c=j.find(C),t[3]=n,t[4]=j,t[5]=c}else c=t[5];const S=c,[E,W]=v.useState(null),b=l&&S&&(l.id||E);let d;t[8]!==s?(d=e.jsx(M,{title:s}),t[8]=s,t[9]=d):d=t[9];let I;t[10]===Symbol.for("react.memo_cache_sentinel")?(I=e.jsx(T,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t[10]=I):I=t[10];let f;t[11]!==s?(f=s.toLowerCase(),t[11]=s,t[12]=f):f=t[12];let u;t[13]!==f?(u=e.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[I,e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Loading ",f,"..."]})]}),t[13]=f,t[14]=u):u=t[14];let g;t[15]!==S||t[16]!==l||t[17]!==r||t[18]!==h||t[19]!==b||t[20]!==m?(g=b?e.jsx(R,{connectionId:l.id,org:h.slug,activeCollection:S}):e.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:e.jsx(V,{title:r.title,description:r.description,wellKnownMcp:m,imageSrc:r.imageSrc,onConnected:C=>{W(C)}})}),t[15]=S,t[16]=l,t[17]=r,t[18]=h,t[19]=b,t[20]=m,t[21]=g):g=t[21];let x;t[22]!==u||t[23]!==g?(x=e.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:e.jsx(v.Suspense,{fallback:u,children:g})}),t[22]=u,t[23]=g,t[24]=x):x=t[24];let w;return t[25]!==d||t[26]!==x?(w=e.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[d,x]}),t[25]=d,t[26]=x,t[27]=w):w=t[27],w}function zt(){const i=k.c(1);let t;return i[0]===Symbol.for("react.memo_cache_sentinel")?(t=e.jsx(q,{bindingName:"WORKFLOW",collectionName:"workflow",title:"Workflows",emptyState:{title:"Create Workflows",description:"Install MCP Studio to create and manage automated workflows with multiple steps and integrations."},wellKnownMcp:_()}),i[0]=t):t=i[0],t}export{zt as default};
|