import{c as l,m,ak as c,al as f}from"./index-oE_2MbI2.js";import{u as y}from"./useQuery-B63y3s7J.js";import{K as n}from"./constants-uA8MqaDa.js";async function u(s){if(!s.getServerCapabilities()?.prompts)return{prompts:[]};try{return await s.listPrompts()}catch(t){if(t instanceof c&&t.code===f.MethodNotFound)return{prompts:[]};throw t}}async function q(s,e,t){if(!s.getServerCapabilities()?.prompts)throw new Error("Prompts capability not supported");return await s.getPrompt({name:e,arguments:t??{}})}function d(s){const e=l.c(12);let t,r;e[0]!==s?({client:t,...r}=s,e[0]=s,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let i;e[3]!==t?(i=n.mcpPromptsList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>u(t),e[5]=t,e[6]=o):o=e[6];const p=r.staleTime??3e4;let a;return e[7]!==r||e[8]!==i||e[9]!==o||e[10]!==p?(a={...r,queryKey:i,queryFn:o,staleTime:p,retry:!1},e[7]=r,e[8]=i,e[9]=o,e[10]=p,e[11]=a):a=e[11],m(a)}function w(s){const e=l.c(12);let t,r;e[0]!==s?({client:t,...r}=s,e[0]=s,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let i;e[3]!==t?(i=n.mcpPromptsList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>u(t),e[5]=t,e[6]=o):o=e[6];const p=r.staleTime??3e4;let a;return e[7]!==r||e[8]!==i||e[9]!==o||e[10]!==p?(a={...r,queryKey:i,queryFn:o,staleTime:p,retry:!1},e[7]=r,e[8]=i,e[9]=o,e[10]=p,e[11]=a):a=e[11],y(a)}export{w as a,q as g,u as l,d as u};
