var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
import { z } from 'zod';
import { ZDataCaptureItemMethodsFields } from './methods/fields.js';
export const ZDataCaptureItemMethods = z
    .object({
    borderColor: z.string().optional().nullable(),
    callToActionLabel: z.string(),
    cardBackgroundColor: z.string().optional().nullable(),
    fields: z.array(ZDataCaptureItemMethodsFields),
    icon: z.string(),
    id: z.string().uuid().optional(),
    isEu: z.boolean(),
    isVisible: z.boolean(),
    itemId: z.string().uuid().optional(),
    moduleId: z.string().optional().nullable(),
    orderIndex: z.number().optional(),
    talentName: z.string(),
    talentPrivacyPolicyText: z.string().optional().nullable(),
    talentPrivacyPolicyURL: z.string().optional().nullable(),
    title: z.string().optional().nullable(),
    versionId: z.string().optional().nullable()
})
    .transform((_a) => {
    var { fields } = _a, rest = __rest(_a, ["fields"]);
    return (Object.assign({ fields: rest.id
            ? fields.map((_a) => {
                var { id, methodId } = _a, field = __rest(_a, ["id", "methodId"]);
                return (Object.assign({ methodId: rest.id }, field));
            })
            : fields }, rest));
});
