import{n as e,r as t,t as n}from"./index-jy40eMQa.js";var r=`/api`;const i={async login(n,i){let a=await t.post(`${r}/auth/login`,{email:n,password:i,deviceName:`Admin Panel`,deviceType:`Web Admin`});return a.data.success&&a.data.accessToken&&(e.setAccessToken(a.data.accessToken),e.setRefreshToken(a.data.refreshToken),e.setTokenExpires(a.data.expiresAt)),a.data},async logout(){try{let n=e.getAccessToken();n&&await t.post(`${r}/auth/logout`,{},{headers:{Authorization:`Bearer ${n}`}})}finally{e.clearTokens()}},async getStatistics(){return n.get(`/admin/statistics`)},async getUsers(e){return n.get(`/admin/users`,{params:e})},async getUserDetail(e){return n.get(`/admin/users/${e}`)},async setUserStatus(e,t){return n.put(`/admin/users/${e}/status`,{disabled:t})},async resetUserPassword(e){return n.post(`/admin/users/${e}/reset-password`)},async getUserBookmarks(e,t){return n.get(`/admin/users/${e}/bookmarks`,{params:t})},async deleteUserBookmark(e,t){return n.delete(`/admin/users/${e}/bookmarks/${t}`)},async forceDeviceLogout(e){return n.post(`/admin/devices/${e}/force-logout`)},async setDeviceStatus(e,t){return n.put(`/admin/devices/${e}/status`,{disabled:t})}};export{i as t};