"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.seedProviderSupportedLanguages = seedProviderSupportedLanguages;
const uuid_1 = require("uuid");
const index_1 = require("../index");
const tables_1 = require("../tables");
// Copy of ProvidersLanguages from src/app/src/constants/index.ts
const ProvidersLanguages = [
    {
        name: 'Afrikaans (South Africa)',
        code: 'af-ZA',
        SpeechSynthesisLanguage: 'af-ZA',
        SpeechSynthesisVoiceName: 'af-ZA-WillemNeural',
    },
    {
        name: 'Amharic (Ethiopia)',
        code: 'am-ET',
        SpeechSynthesisLanguage: 'am-ET',
        SpeechSynthesisVoiceName: 'am-ET-AmehaNeural',
    },
    {
        name: 'Arabic (EG)',
        code: 'ar-EG',
        SpeechSynthesisLanguage: 'ar-EG',
        SpeechSynthesisVoiceName: 'ar-EG-ShakirNeural',
    },
    {
        name: 'Arabic (SA)',
        code: 'ar-SA',
        SpeechSynthesisLanguage: 'ar-SA',
        SpeechSynthesisVoiceName: 'ar-SA-HamedNeural',
    },
    {
        name: 'Arabic (AE)',
        code: 'ar-AE',
        SpeechSynthesisLanguage: 'ar-AE',
        SpeechSynthesisVoiceName: 'ar-AE-HamdanNeural',
    },
    {
        name: 'Arabic (LB)',
        code: 'ar-LB',
        SpeechSynthesisLanguage: 'ar-LB',
        SpeechSynthesisVoiceName: 'ar-LB-RamiNeural',
    },
    {
        name: 'Arabic (OM)',
        code: 'ar-OM',
        SpeechSynthesisLanguage: 'ar-OM',
        SpeechSynthesisVoiceName: 'ar-OM-AyshaNeural',
    },
    {
        name: 'Bulgarian (BG)',
        code: 'bg-BG',
        SpeechSynthesisLanguage: 'bg-BG',
        SpeechSynthesisVoiceName: 'bg-BG-KalinaNeural',
    },
    {
        name: 'Catalan (ES)',
        code: 'ca-ES',
        SpeechSynthesisLanguage: 'ca-ES',
        SpeechSynthesisVoiceName: 'ca-ES-EnricNeural',
    },
    {
        name: 'Chinese (ZH‑CN)',
        code: 'zh-CN',
        SpeechSynthesisLanguage: 'zh-CN',
        SpeechSynthesisVoiceName: 'zh-CN-XiaoxiaoNeural',
    },
    {
        name: 'Chinese (ZH‑TW)',
        code: 'zh-TW',
        SpeechSynthesisLanguage: 'zh-TW',
        SpeechSynthesisVoiceName: 'zh-TW-YunJheNeural',
    },
    {
        name: 'Chinese (ZH‑HK)',
        code: 'zh-HK',
        SpeechSynthesisLanguage: 'zh-HK',
        SpeechSynthesisVoiceName: 'zh-HK-WanLungNeural',
    },
    {
        name: 'Croatian (HR)',
        code: 'hr-HR',
        SpeechSynthesisLanguage: 'hr-HR',
        SpeechSynthesisVoiceName: 'hr-HR-GabrijelaNeural',
    },
    {
        name: 'Czech (CZ)',
        code: 'cs-CZ',
        SpeechSynthesisLanguage: 'cs-CZ',
        SpeechSynthesisVoiceName: 'cs-CZ-VlastaNeural',
    },
    {
        name: 'Danish (DK)',
        code: 'da-DK',
        SpeechSynthesisLanguage: 'da-DK',
        SpeechSynthesisVoiceName: 'da-DK-JeppeNeural',
    },
    {
        name: 'Dutch (NL)',
        code: 'nl-NL',
        SpeechSynthesisLanguage: 'nl-NL',
        SpeechSynthesisVoiceName: 'nl-NL-ColetteNeural',
    },
    {
        name: 'Dutch (BE)',
        code: 'nl-BE',
        SpeechSynthesisLanguage: 'nl-BE',
        SpeechSynthesisVoiceName: 'nl-BE-DenaNeural',
    },
    {
        name: 'Estonian (EE)',
        code: 'et-EE',
        SpeechSynthesisLanguage: 'et-EE',
        SpeechSynthesisVoiceName: 'et-EE-KatriNeural',
    },
    {
        name: 'English (US)',
        code: 'en-US',
        SpeechSynthesisLanguage: 'en-US',
        SpeechSynthesisVoiceName: 'en-US-AndrewMultilingualNeural',
    },
    {
        name: 'Filipino (PH)',
        code: 'fil-PH',
        SpeechSynthesisLanguage: 'fil-PH',
        SpeechSynthesisVoiceName: 'fil-PH-AngeloNeural',
    },
    {
        name: 'Finnish (FI)',
        code: 'fi-FI',
        SpeechSynthesisLanguage: 'fi-FI',
        SpeechSynthesisVoiceName: 'fi-FI-HeidiNeural',
    },
    {
        name: 'French (FR)',
        code: 'fr-FR',
        SpeechSynthesisLanguage: 'fr-FR',
        SpeechSynthesisVoiceName: 'fr-FR-HenriNeural',
    },
    {
        name: 'French (CA)',
        code: 'fr-CA',
        SpeechSynthesisLanguage: 'fr-CA',
        SpeechSynthesisVoiceName: 'fr-CA-CarolineNeural',
    },
    {
        name: 'French (CH)',
        code: 'fr-CH',
        SpeechSynthesisLanguage: 'fr-CH',
        SpeechSynthesisVoiceName: 'fr-FR-JeromeNeural',
    },
    {
        name: 'Galician (ES)',
        code: 'gl-ES',
        SpeechSynthesisLanguage: 'gl-ES',
        SpeechSynthesisVoiceName: 'gl-ES-InesNeural',
    },
    {
        name: 'Georgian (GE)',
        code: 'ka-GE',
        SpeechSynthesisLanguage: 'ka-GE',
        SpeechSynthesisVoiceName: 'ka-GE-NinoNeural',
    },
    {
        name: 'German (DE)',
        code: 'de-DE',
        SpeechSynthesisLanguage: 'de-DE',
        SpeechSynthesisVoiceName: 'de-DE-ConradNeural',
    },
    {
        name: 'German (AT)',
        code: 'de-AT',
        SpeechSynthesisLanguage: 'de-AT',
        SpeechSynthesisVoiceName: 'de-AT-IngridNeural',
    },
    {
        name: 'German (CH)',
        code: 'de-CH',
        SpeechSynthesisLanguage: 'de-CH',
        SpeechSynthesisVoiceName: 'de-CH-LeniNeural',
    },
    {
        name: 'Greek (GR)',
        code: 'el-GR',
        SpeechSynthesisLanguage: 'el-GR',
        SpeechSynthesisVoiceName: 'el-GR-AthinaNeural',
    },
    {
        name: 'Hebrew (IL)',
        code: 'he-IL',
        SpeechSynthesisLanguage: 'he-IL',
        SpeechSynthesisVoiceName: 'he-IL-HilaNeural',
    },
    {
        name: 'Hindi (IN)',
        code: 'hi-IN',
        SpeechSynthesisLanguage: 'hi-IN',
        SpeechSynthesisVoiceName: 'hi-IN-AaravNeural',
    },
    {
        name: 'Hungarian (HU)',
        code: 'hu-HU',
        SpeechSynthesisLanguage: 'hu-HU',
        SpeechSynthesisVoiceName: 'hu-HU-SzabolcsNeural',
    },
    {
        name: 'Indonesian (ID)',
        code: 'id-ID',
        SpeechSynthesisLanguage: 'id-ID',
        SpeechSynthesisVoiceName: 'id-ID-ArdiNeural',
    },
    {
        name: 'Italian (IT)',
        code: 'it-IT',
        SpeechSynthesisLanguage: 'it-IT',
        SpeechSynthesisVoiceName: 'it-IT-LisandroNeural',
    },
    {
        name: 'Japanese (JP)',
        code: 'ja-JP',
        SpeechSynthesisLanguage: 'ja-JP',
        SpeechSynthesisVoiceName: 'ja-JP-NanamiNeural',
    },
    {
        name: 'Kannada (IN)',
        code: 'kn-IN',
        SpeechSynthesisLanguage: 'kn-IN',
        SpeechSynthesisVoiceName: 'kn-IN-GaganNeural',
    },
    {
        name: 'Korean (KR)',
        code: 'ko-KR',
        SpeechSynthesisLanguage: 'ko-KR',
        SpeechSynthesisVoiceName: 'ko-KR-SunHiNeural',
    },
    {
        name: 'Malay (MY)',
        code: 'ms-MY',
        SpeechSynthesisLanguage: 'ms-MY',
        SpeechSynthesisVoiceName: 'ms-MY-YasminNeural',
    },
    {
        name: 'Mongolian (MN)',
        code: 'mn-MN',
        SpeechSynthesisLanguage: 'mn-MN',
        SpeechSynthesisVoiceName: 'mn-MN-BataaNeural',
    },
    {
        name: 'Nepali (NP)',
        code: 'ne-NP',
        SpeechSynthesisLanguage: 'ne-NP',
        SpeechSynthesisVoiceName: 'ne-NP-SagarNeural',
    },
    {
        name: 'Norwegian (NB)',
        code: 'nb-NO',
        SpeechSynthesisLanguage: 'nb-NO',
        SpeechSynthesisVoiceName: 'nb-NO-HuldaNeural',
    },
    {
        name: 'Polish (PL)',
        code: 'pl-PL',
        SpeechSynthesisLanguage: 'pl-PL',
        SpeechSynthesisVoiceName: 'pl-PL-PaulinaNeural',
    },
    {
        name: 'Portuguese (BR)',
        code: 'pt-BR',
        SpeechSynthesisLanguage: 'pt-BR',
        SpeechSynthesisVoiceName: 'pt-BR-HumbertoNeural',
    },
    {
        name: 'Portuguese (PT)',
        code: 'pt-PT',
        SpeechSynthesisLanguage: 'pt-PT',
        SpeechSynthesisVoiceName: 'pt-BR-ValerioNeural',
    },
    {
        name: 'Romanian (RO)',
        code: 'ro-RO',
        SpeechSynthesisLanguage: 'ro-RO',
        SpeechSynthesisVoiceName: 'ro-RO-EmilNeural',
    },
    {
        name: 'Russian (RU)',
        code: 'ru-RU',
        SpeechSynthesisLanguage: 'ru-RU',
        SpeechSynthesisVoiceName: 'ru-RU-DmitryNeural',
    },
    {
        name: 'Slovak (SK)',
        code: 'sk-SK',
        SpeechSynthesisLanguage: 'sk-SK',
        SpeechSynthesisVoiceName: 'sk-SK-FilipNeural',
    },
    {
        name: 'Slovenian (SI)',
        code: 'sl-SI',
        SpeechSynthesisLanguage: 'sl-SI',
        SpeechSynthesisVoiceName: 'sl-SI-LadoNeural',
    },
    {
        name: 'Spanish (ES)',
        code: 'es-ES',
        SpeechSynthesisLanguage: 'es-ES',
        SpeechSynthesisVoiceName: 'es-ES-AlvaroNeural',
    },
    {
        name: 'Spanish (MX)',
        code: 'es-MX',
        SpeechSynthesisLanguage: 'es-MX',
        SpeechSynthesisVoiceName: 'es-MX-JorgeNeural',
    },
    {
        name: 'Swedish (SE)',
        code: 'sv-SE',
        SpeechSynthesisLanguage: 'sv-SE',
        SpeechSynthesisVoiceName: 'sv-SE-HedvigNeural',
    },
    {
        name: 'Tamil (IN)',
        code: 'ta-IN',
        SpeechSynthesisLanguage: 'ta-IN',
        SpeechSynthesisVoiceName: 'ta-IN-PallaviNeural',
    },
    {
        name: 'Telugu (IN)',
        code: 'te-IN',
        SpeechSynthesisLanguage: 'te-IN',
        SpeechSynthesisVoiceName: 'te-IN-MohanNeural',
    },
    {
        name: 'Thai (TH)',
        code: 'th-TH',
        SpeechSynthesisLanguage: 'th-TH',
        SpeechSynthesisVoiceName: 'th-TH-PattaraNeural',
    },
    {
        name: 'Turkish (TR)',
        code: 'tr-TR',
        SpeechSynthesisLanguage: 'tr-TR',
        SpeechSynthesisVoiceName: 'tr-TR-AhmetNeural',
    },
    {
        name: 'Ukrainian (UA)',
        code: 'uk-UA',
        SpeechSynthesisLanguage: 'uk-UA',
        SpeechSynthesisVoiceName: 'uk-UA-OstapNeural',
    },
    {
        name: 'Urdu (PK)',
        code: 'ur-PK',
        SpeechSynthesisLanguage: 'ur-PK',
        SpeechSynthesisVoiceName: 'ur-PK-AsadNeural',
    },
    {
        name: 'Vietnamese (VN)',
        code: 'vi-VN',
        SpeechSynthesisLanguage: 'vi-VN',
        SpeechSynthesisVoiceName: 'vi-VN-NamMinhNeural',
    },
    {
        name: 'Welsh (GB)',
        code: 'cy-GB',
        SpeechSynthesisLanguage: 'cy-GB',
        SpeechSynthesisVoiceName: 'cy-GB-NiaNeural',
    },
    {
        name: 'Zulu (ZA)',
        code: 'zu-ZA',
        SpeechSynthesisLanguage: 'zu-ZA',
        SpeechSynthesisVoiceName: 'zu-ZA-ThembaNeural',
    },
];
async function seedProviderSupportedLanguages() {
    try {
        const db = (0, index_1.getDb)();
        // To avoid accumulating duplicates when this seed is run multiple times,
        // clear the table first, then insert the canonical list.
        await db.delete(tables_1.providerSupportedLanguagesTable);
        for (const lang of ProvidersLanguages) {
            await db.insert(tables_1.providerSupportedLanguagesTable).values({
                id: (0, uuid_1.v4)(),
                name: lang.name,
                code: lang.code,
                SpeechSynthesisLanguage: lang.SpeechSynthesisLanguage,
                SpeechSynthesisVoiceName: lang.SpeechSynthesisVoiceName,
            });
        }
        console.log('Seeded provider supported languages');
    }
    catch (error) {
        console.error('Failed to seed provider supported languages:', error);
        throw error;
    }
}
if (require.main === module) {
    seedProviderSupportedLanguages().catch((err) => {
        console.error('Failed to seed provider supported languages:', err);
        process.exit(1);
    });
}
//# sourceMappingURL=providerSupportedLanguages.js.map