//#region src/voice/tts/config-slice.ts
function asRecord(value) {
	return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
}
/** Collect provider-id → raw config entries from the `providers` map. */
function collectTtsProviderConfigEntries(config) {
	const providers = asRecord((config ?? {}).providers);
	if (!providers) return {};
	const entries = {};
	for (const [providerId, value] of Object.entries(providers)) entries[providerId] = { ...asRecord(value) ?? {} };
	return entries;
}
/** Resolve the raw config slice for one provider id. */
function resolveTtsProviderConfigSlice(providerId, config) {
	return collectTtsProviderConfigEntries(config)[providerId] ?? {};
}
/**
* Build the `rawConfig` object passed into `SpeechProviderPlugin.resolveConfig`.
* Includes the full TTS block plus a normalized `providers` map.
*/
function buildTtsResolveRawConfig(providerId, config) {
	const entries = collectTtsProviderConfigEntries(config);
	return {
		...config,
		providers: entries,
		[providerId]: entries[providerId] ?? {}
	};
}
//#endregion
export { buildTtsResolveRawConfig, collectTtsProviderConfigEntries, resolveTtsProviderConfigSlice };

//# sourceMappingURL=config-slice.js.map