import { useActiveEntities } from "../../store/active-entities.js";
import { useWorkspace } from "../../store/store.js";
import Form_default from "../../components/Form/Form.vue.js";
import { computed, createBlock, defineComponent, openBlock } from "vue";
import { cookieSchema } from "@scalar/oas-utils/entities/cookie";
//#region src/views/Cookies/CookieForm.vue?vue&type=script&setup=true&lang.ts
var CookieForm_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
	__name: "CookieForm",
	setup(__props) {
		const { activeCookieId } = useActiveEntities();
		const { cookies, cookieMutators } = useWorkspace();
		const fields = [
			{
				label: "Name",
				key: "name",
				placeholder: "session_id"
			},
			{
				label: "Value",
				key: "value",
				placeholder: "my-cookie-session-id"
			},
			{
				label: "Domain",
				key: "domain",
				placeholder: "example.com"
			}
		];
		const activeCookie = computed(() => cookies[activeCookieId.value] || cookieSchema.parse({
			name: "",
			value: "",
			domain: "",
			path: ""
		}));
		const updateCookie = (key, value) => {
			cookieMutators.edit(activeCookieId.value, key, value);
		};
		return (_ctx, _cache) => {
			return openBlock(), createBlock(Form_default, {
				data: activeCookie.value,
				onUpdate: updateCookie,
				options: fields
			}, null, 8, ["data"]);
		};
	}
});
//#endregion
export { CookieForm_vue_vue_type_script_setup_true_lang_default as default };

//# sourceMappingURL=CookieForm.vue.script.js.map