import { _asyncToGenerator } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js";
import { request } from "../../../../utils/index.js";
import { CONFIG } from "./shared.js";
//#region src/plus/saasDevice/devicePlanning/api/workAreas.ts
const getWorkAreas = function() {
	var _ref = _asyncToGenerator(function* () {
		const response = yield request.getRequest().get("/tenant/device/workarea", { relation_count: [
			"smartDevices",
			"dumbDevices",
			"integratedDevices"
		] }, CONFIG);
		return (response === null || response === void 0 ? void 0 : response.data) || [];
	});
	return function getWorkAreas() {
		return _ref.apply(this, arguments);
	};
}();
const createWorkArea = function() {
	var _ref2 = _asyncToGenerator(function* (payload) {
		const response = yield request.getRequest().post("/tenant/device/workarea", payload, CONFIG);
		return (response === null || response === void 0 ? void 0 : response.data) || null;
	});
	return function createWorkArea(_x) {
		return _ref2.apply(this, arguments);
	};
}();
const updateWorkArea = function() {
	var _ref3 = _asyncToGenerator(function* (id, payload) {
		const response = yield request.getRequest().put(`/tenant/device/workarea/${id}`, payload, CONFIG);
		return (response === null || response === void 0 ? void 0 : response.data) || null;
	});
	return function updateWorkArea(_x2, _x3) {
		return _ref3.apply(this, arguments);
	};
}();
const sortWorkAreas = (ids) => request.getRequest().post("/tenant/device/workarea/sort", { ids }, CONFIG);
const deleteWorkArea = (id) => request.getRequest().remove(`/tenant/device/workarea/${id}`, {}, CONFIG);
const getWorkAreaDetail = function() {
	var _ref4 = _asyncToGenerator(function* (params) {
		return request.getRequest().get(`/tenant/device/workarea`, params, CONFIG);
	});
	return function getWorkAreaDetail(_x4) {
		return _ref4.apply(this, arguments);
	};
}();
//#endregion
export { createWorkArea, deleteWorkArea, getWorkAreaDetail, getWorkAreas, sortWorkAreas, updateWorkArea };
