import{c as o}from"./BzArsHZA.js";import{R as i}from"./CYgJF_JY.js";const w=async t=>{const a={data:void 0,error:void 0};try{const r=await o.GET("/api/datasets/{dataset_id}",{params:{path:{dataset_id:t}}});if(r.error)throw new Error(JSON.stringify(r.error,null,2));if(!r.data)throw new Error("No data");a.data=r.data}catch(r){a.error="Error loading dataset: "+String(r)}return a},p=async()=>{const t={data:void 0,error:void 0};try{const{data:a}=await o.GET("/api/datasets");if(!a)throw new Error("No data");const r=a.sort((s,d)=>Date.parse(d.created_at)-Date.parse(s.created_at))[0].dataset_id,e=await o.GET("/api/datasets/{dataset_id}",{params:{path:{dataset_id:r}}});if(e.error)throw new Error(JSON.stringify(e.error,null,2));if(!e.data)throw new Error("No data");t.data=e.data}catch(a){t.error="Error loading dataset: "+String(a)}return t};function l(t,a){throw new i(t,a.toString())}new TextEncoder;export{w as a,p as l,l as r};
