import { z } from "zod";
import { connectionConstraintSchema } from "./constraints.js";
const handlePositionSchema = z["enum"]([
    'left',
    'top',
    'right',
    'bottom'
]);
const handleBoundarySchema = z["enum"]([
    'outer',
    'inner'
]);
const handleTypeSchema = z["enum"]([
    'source',
    'target'
]);
const handleTypeDisplaySchema = z["enum"]([
    'artifact',
    'input',
    'output'
]);
const handleLabelVisibilitySchema = z["enum"]([
    'always',
    'hover'
]);
const handleConfigurationSpecificPositionSchema = z.object({
    height: z.number().optional(),
    width: z.number().optional(),
    top: z.number().optional(),
    bottom: z.number().optional(),
    left: z.number().optional(),
    right: z.number().optional()
});
const handleManifestSchema = z.object({
    id: z.string().min(1),
    type: handleTypeSchema,
    handleType: handleTypeDisplaySchema,
    label: z.string().optional(),
    visible: z.union([
        z.boolean(),
        z.string()
    ]).optional(),
    repeat: z.string().optional(),
    itemVar: z.string().optional(),
    indexVar: z.string().optional(),
    showButton: z.boolean().optional(),
    labelVisibility: handleLabelVisibilitySchema.optional(),
    constraints: connectionConstraintSchema.optional(),
    isDefaultForType: z.boolean().optional()
});
const handleGroupManifestSchema = z.object({
    position: handlePositionSchema,
    boundary: handleBoundarySchema.optional(),
    customPositionAndOffsets: handleConfigurationSpecificPositionSchema.optional(),
    handles: z.array(handleManifestSchema),
    visible: z.boolean().optional()
});
const handleGroupOverrideSchema = z.object({
    position: handlePositionSchema,
    handles: z.array(handleManifestSchema),
    visible: z.boolean().optional()
});
export { handleBoundarySchema, handleConfigurationSpecificPositionSchema, handleGroupManifestSchema, handleGroupOverrideSchema, handleLabelVisibilitySchema, handleManifestSchema, handlePositionSchema, handleTypeDisplaySchema, handleTypeSchema };
