"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SoundDefinitionCatalogSchema = void 0;
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const zod_1 = require("zod");
// SoundReference zod schema
const SoundReferenceSchema = zod_1.z.object({
    name: zod_1.z.string(),
    is3D: zod_1.z.boolean().optional(),
    stream: zod_1.z.boolean().optional(),
    volume: zod_1.z.number().optional(),
    weight: zod_1.z.number().optional(),
    pitch: zod_1.z.number().optional(),
    load_on_low_memory: zod_1.z.boolean().optional(),
});
// SoundDefinition zod schema
const SoundDefinitionSchema = zod_1.z.object({
    category: zod_1.z.string().optional(),
    __use_legacy_max_distance: zod_1.z.union([zod_1.z.literal("true"), zod_1.z.literal("false"), zod_1.z.boolean()]).optional(),
    max_distance: zod_1.z.number().optional().nullable(),
    min_distance: zod_1.z.number().optional().nullable(),
    sounds: zod_1.z.array(zod_1.z.union([zod_1.z.string(), SoundReferenceSchema])),
});
// Catalog w/ format_version zod schema
const CatalogWithFormatVersionSchema = zod_1.z.object({
    format_version: zod_1.z.string(),
    sound_definitions: zod_1.z.record(zod_1.z.string(), SoundDefinitionSchema),
});
// Flat Catalog zod Schema
const FlatCatalogEntrySchema = zod_1.z.object({
    sounds: zod_1.z.array(zod_1.z.union([
        zod_1.z.string(),
        zod_1.z.object({
            name: zod_1.z.string(),
        }),
    ])),
});
// Catalog w/o format_version
const CatalogWithoutFormatVersionSchema = zod_1.z.record(zod_1.z.string(), FlatCatalogEntrySchema);
// Union of both forms for runtime validation
exports.SoundDefinitionCatalogSchema = zod_1.z.union([
    CatalogWithFormatVersionSchema,
    CatalogWithoutFormatVersionSchema,
]);

//# sourceMappingURL=../maps/minecraft/ISoundDefinitionCatalog.js.map
