import{b4 as a}from"./index-D5GfLbIx.js";const e="/sl/projection/toolbar";function s(t,o){return{key:t,value:o,Key:t,Value:o}}function c(t,o){return{name:t,visible:o,Name:t,Visible:o}}function l(t){return{note:t,Note:t}}function n(t){return{fileName:t,FileName:t}}async function r(t){const o=(await t).data;if(!o?.success)throw new Error(o?.message??"请求失败");if(o.data==null)throw new Error("服务端返回空数据");return o.data}const i={getState:()=>r(a.get(`${e}/state`)),setAlign:(t,o)=>r(a.post(`${e}/align`,s(t,o))),setSelect:(t,o)=>r(a.post(`${e}/select`,s(t,o))),setDisplay:(t,o)=>r(a.post(`${e}/display`,s(t,o))),setLayerVisibility:(t,o)=>r(a.post(`${e}/layer`,c(t,o))),startRecording:t=>r(a.post(`${e}/recording/start`,l(t??""))),stopRecording:()=>r(a.post(`${e}/recording/stop`)),deleteRecording:t=>r(a.delete(`${e}/recording/${encodeURIComponent(t)}`)),startPlayback:t=>r(a.post(`${e}/playback/start`,n(t))),stopPlayback:()=>r(a.post(`${e}/playback/stop`)),toggleViewMode:()=>r(a.post(`${e}/view/toggle`)),setCameraFollow:(t,o)=>r(a.post(`${e}/camera/follow`,{carId:t??void 0,enabled:o,CarId:t??void 0,Enabled:o})),locateCamera:t=>r(a.post(`${e}/camera/locate`,{carId:t,CarId:t}))};export{i as w};
