import{I as e,a as t,f as n,h as r,n as i,u as a}from"./vscode-api-DjORcpSo.js";var o=t(r,`get-settings`,{staleTime:a.FIVE_SECONDS});function s(t){return e(o).data?.values[t.key]??t.default}function c(){return e(o).isLoading}function l(e,t){return e(o).data?.values[t.key]??t.default}async function u(e,t,r,i){let a=e.query.snapshot(o);await a.cancel();let s=a.getData(),c=i?.optimistic??!0;c&&a.setData({values:{...s?.values,[t.key]:r}});try{await p(t,r),c||a.setData({values:{...s?.values,[t.key]:r}})}catch(e){throw a.setData(s),e}finally{await a.invalidate(),n.dispatchMessage(`query-cache-invalidate`,{queryKey:[...a.queryKey]})}}function d(e,t,n){let r=e.query.snapshot(o),i=r.getData();r.setData({values:{...i?.values,[t.key]:n}})}async function f(e){return(await i(`get-setting`,{params:{key:e.key}})).value??e.default}async function p(e,t){await i(`set-setting`,{params:{key:e.key,value:t}})}export{s as a,u as i,f as n,c as o,d as r,p as s,l as t};
//# sourceMappingURL=setting-storage-CwKZnsvR.js.map