import { t as __exportAll } from "./chunk-D7D4PA-g.js";
import { r as useActionHandler } from "./request-handler-guINVc1G.js";
import { t as __decorate } from "./decorate-CQ_JIwqD.js";
import { Expose } from "class-transformer";
import { IsNotEmpty, IsString } from "class-validator";
//#region .svelte-kit/adapter-bun/entries/pages/actions/project/package/_page.server.ts.js
var _page_server_ts_exports = /* @__PURE__ */ __exportAll({ actions: () => actions });
var AddComponentBody = class {
	componentNames;
};
__decorate([
	Expose(),
	IsString({ each: true }),
	IsNotEmpty()
], AddComponentBody.prototype, "componentNames", void 0);
var addComponentsProjectAction = useActionHandler(async ({ body, project }) => {
	return await Promise.all(body.componentNames.map((componentName) => project.client.package.installComponent(componentName)));
}, { body: AddComponentBody });
var AddSystemBody = class {
	systemNames;
};
__decorate([
	Expose(),
	IsString({ each: true }),
	IsNotEmpty()
], AddSystemBody.prototype, "systemNames", void 0);
var addSystemsProjectAction = useActionHandler(async ({ body, project }) => {
	return await Promise.all(body.systemNames.map((systemName) => project.client.package.installSystem(systemName)));
}, { body: AddSystemBody });
var CreateComponentBody = class {
	componentName;
};
__decorate([
	Expose(),
	IsString(),
	IsNotEmpty()
], CreateComponentBody.prototype, "componentName", void 0);
var createComponentProjectAction = useActionHandler(async ({ body, project }) => {
	return project.client.package.createComponent(body.componentName);
}, { body: CreateComponentBody });
var CreateSystemBody = class {
	systemName;
};
__decorate([
	Expose(),
	IsString(),
	IsNotEmpty()
], CreateSystemBody.prototype, "systemName", void 0);
var createSystemProjectAction = useActionHandler(async ({ body, project }) => {
	return project.client.package.createSystem(body.systemName);
}, { body: CreateSystemBody });
var GetComponentManifestBody = class {
	componentPaths;
};
__decorate([
	Expose(),
	IsString({ each: true }),
	IsNotEmpty()
], GetComponentManifestBody.prototype, "componentPaths", void 0);
var getComponentsManifestsAction = useActionHandler(async ({ body, project }) => {
	return await Promise.all(body.componentPaths.map((path) => project.client.package.getComponentManifest(path)));
}, { body: GetComponentManifestBody });
var getComponentsAction = useActionHandler(async ({ project }) => {
	return await project.client.package.getComponents();
});
var GetSystemManifestBody = class {
	systemPaths;
};
__decorate([
	Expose(),
	IsString({ each: true }),
	IsNotEmpty()
], GetSystemManifestBody.prototype, "systemPaths", void 0);
var actions = {
	"add-components": addComponentsProjectAction,
	"add-systems": addSystemsProjectAction,
	"create-component": createComponentProjectAction,
	"create-system": createSystemProjectAction,
	"get-components-manifests": getComponentsManifestsAction,
	"get-systems-manifests": useActionHandler(async ({ body, project }) => {
		return await Promise.all(body.systemPaths.map((path) => project.client.package.getSystemManifest(path)));
	}, { body: GetSystemManifestBody }),
	"get-components": getComponentsAction,
	"get-systems": useActionHandler(async ({ project }) => {
		return await project.client.package.getSystems();
	})
};
//#endregion
//#region .svelte-kit/adapter-bun/nodes/6.js
const index = 6;
const server_id = "src/routes/actions/project/package/+page.server.ts";
const imports = [];
const stylesheets = [];
const fonts = [];
//#endregion
export { fonts, imports, index, _page_server_ts_exports as server, server_id, stylesheets };

//# sourceMappingURL=6-Dl_h_OyU.js.map