import{Ki as e,Wi as t,sa as n}from"./src-BOCweS1p.js";import{$ as r,fs as i}from"./app-server-manager-signals-Yn0WSnoY.js";import{P as a,V as o,W as s,h as c,lt as l,u}from"./vscode-api-DjORcpSo.js";import{a as d}from"./statsig-BP9zNYqZ.js";import{n as f}from"./use-auth-CI-WraL2.js";import{i as p,r as m}from"./models-and-reasoning-efforts-Bqf_x2Fv.js";var h=[],g={availableModels:new Set(h),useHiddenModels:!1,defaultModel:m},_=s(c,g);function v(r){let i=t(n()).safeParse(r.available_models),a=e().safeParse(r.use_hidden_models),o=n().safeParse(r.default_model);return{availableModels:new Set(i.success?i.data:h),useHiddenModels:a.success?a.data:g.useHiddenModels,defaultModel:o.success?o.data:g.defaultModel}}var y=l();function b(){let e=(0,y.c)(2),{value:t}=d(`107580212`),n;return e[0]===t?n=e[1]:(n=v(t),e[0]=t,e[1]=n),n}var x=100,S=[`models`,`list`];function C(e,t,n=x){return[...S,e,t??`no-auth`,n]}var w=o(c,({availableModels:e,authMethod:t,defaultModel:n,hostId:a,isAuthLoading:o,limit:s,useHiddenModels:c},{get:l})=>({queryKey:C(a,t,s),enabled:l(r).includes(a)&&!o,staleTime:u.FIVE_MINUTES,queryFn:()=>i(`list-models-for-host`,{hostId:a,includeHidden:!0,cursor:null,limit:s}),select:({data:r})=>p({authMethod:t,availableModels:new Set(e),defaultModel:n,models:r,useHiddenModels:c})}));function T(e){let t=(0,y.c)(10),n=e?.hostId??`local`,r=e?.limit??x,i=f(n),o=i?.authMethod??null,s=i?.isLoading??!1,c=b(),l;t[0]===c.availableModels?l=t[1]:(l=Array.from(c.availableModels).sort(),t[0]=c.availableModels,t[1]=l);let u;return t[2]!==o||t[3]!==n||t[4]!==s||t[5]!==r||t[6]!==c.defaultModel||t[7]!==c.useHiddenModels||t[8]!==l?(u={availableModels:l,authMethod:o,defaultModel:c.defaultModel,hostId:n,isAuthLoading:s,limit:r,useHiddenModels:c.useHiddenModels},t[2]=o,t[3]=n,t[4]=s,t[5]=r,t[6]=c.defaultModel,t[7]=c.useHiddenModels,t[8]=l,t[9]=u):u=t[9],a(w,u)}function E(e){return e!==`pending`}export{v as a,_ as i,T as n,b as r,E as t};
//# sourceMappingURL=model-queries-CuDRhJFc.js.map