import{aQ as t}from"./index-DrvLDslf.js";const a="/sl/projection/map-edit",r="/sl/projection/ai-config";async function o(e){const{data:s}=await e;if(!s?.success)throw new Error(s?.message??"request failed");return s.data}const n={createSite:e=>o(t.post(`${a}/objects/site`,e)),createTrack:(e,s)=>o(t.post(`${a}/objects/${e}`,s)),createImage:e=>o(t.post(`${a}/objects/image`,e)),createText:e=>o(t.post(`${a}/objects/text`,e)),createModel:e=>o(t.post(`${a}/objects/model`,e)),createCar:e=>o(t.post(`${a}/objects/car`,e)),deleteObject:(e,s)=>o(t.delete(`${a}/objects/${e}/${s}`)),batch:e=>o(t.post(`${a}/objects/batch`,{ops:e})),copyFieldsTo:(e,s,p,c)=>o(t.post(`${a}/objects/${e}/${s}/fields/copy-to`,{fieldNames:p,targets:c})),pick:()=>o(t.post(`${a}/pick`)),dashboardSummary:()=>o(t.get(`${a}/dashboard/summary`)),uploadAsset:(e,s)=>o(t.post(`${a}/assets/upload`,{filename:e,data:s},{headers:{"Content-Type":"multipart/form-data"}})),aiMapGenerate:e=>o(t.post(`${a}/ai/map-generate`,e)),projectSave:e=>o(t.post(`${a}/project/save`,{path:e??""})),projectLoad:e=>o(t.post(`${a}/project/load`,{path:e})),projectCurrent:()=>o(t.get(`${a}/project/current`)),projectBrowse:e=>o(t.get(`${a}/project/browse`,{params:e?{dir:e}:{}})),projectNativePickOpen:e=>o(t.post(`${a}/project/native-pick-open`,{initialDir:e??""})),projectNativePickSave:(e,s)=>o(t.post(`${a}/project/native-pick-save`,{initialDir:e??"",suggestedFileName:s??"project.current.json"})),sampleSitesAlongTrack:(e,s)=>o(t.post(`${a}/objects/track/${e}/sample-sites`,s)),getViewFilter:()=>o(t.get(`${a}/view-filter`)),setViewFilter:e=>o(t.post(`${a}/view-filter`,e))},$={get:()=>o(t.get(`${r}/`)),save:e=>o(t.post(`${r}/`,e))};export{$ as a,n as m};
