import{d as u,a as l,e as d,A as f}from"./tailwind-D5NWkpcg.js";import{l as i,b as c,A as p,a as m,c as h}from"./ext-utils-BLHv4ziY.js";const _=["value"],w=u({inheritAttrs:!1,__name:"Textarea",props:{modelValue:{}},emits:["update:modelValue"],setup(r,{emit:n}){const s=r,a=n;function o(e){const t=e.target;a("update:modelValue",(t==null?void 0:t.value)??"")}return(e,t)=>(d(),l("textarea",f({class:"w-full rounded-md border border-slate-200 bg-white px-3 py-2 text-sm text-slate-900 placeholder:text-slate-400 shadow-sm transition focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/30",value:s.modelValue??""},e.$attrs,{onInput:o}),null,16,_))}});function T(){async function r(){const a=await i(),o=c(a,h);if(!o)return[];const e=await fetch(o);if(!e.ok)return[];const t=await e.json();return Array.isArray(t.data)?t.data:[]}async function n(){const a=await i(),o=c(a,m);if(!o)return[];const e=await fetch(o);if(!e.ok)return[];const t=await e.json();return Array.isArray(t.data)?t.data:[]}async function s(a){const o=await i(),e=c(o,p);if(!e)return{ok:!1,error:"API 端点配置错误"};const t=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});return t.ok?t.json():{ok:!1,error:await t.text().catch(()=>"")||`HTTP ${t.status}`}}return{getNoteFolders:r,getNotes:n,createNote:s}}export{w as _,T as u};
