import * as i0 from '@angular/core';
import { inject, NgZone, Injectable, EventEmitter, Component, Input, Output, NgModule } from '@angular/core';
import { TranslateService, TranslatePipe } from '@ngx-translate/core';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { LocaleService } from '@seniorsistemas/angular-components/locale';
import { ToastService } from '@seniorsistemas/angular-components/toast';

class SpeechRecognitionService {
    localeService = inject(LocaleService);
    ngZone = inject(NgZone);
    toastService = inject(ToastService);
    translateService = inject(TranslateService);
    hasSupportSpeechRecognition = false;
    isListening = false;
    microphoneStatus$ = new Subject();
    recognition;
    TIMEOUT_NO_MESSAGE = 3000;
    constructor() {
        this.setRecognition();
    }
    listen() {
        const speechSubject = new Subject();
        if (this.isListening) {
            speechSubject.error('Already listening');
        }
        this.hasMicrophoneAccess.then((hasAccess) => {
            if (!hasAccess) {
                this.toastService.show({ severity: 'error', text: this.translateService.instant('platform.angular_components.no_microphone_permission') });
                speechSubject.error('Microphone access is disabled');
                return;
            }
            this.microphoneStatus$.next('active');
            this.isListening = true;
            this.recognition.continuous = true;
            this.recognition.interimResults = true;
            this.recognition.maxAlternatives = 1;
            let silenceTimer;
            const restartSilenceTimer = () => {
                if (silenceTimer !== undefined) {
                    clearTimeout(silenceTimer);
                }
                silenceTimer = setTimeout(() => {
                    this.recognition.stop();
                }, this.TIMEOUT_NO_MESSAGE);
            };
            let fullTranscript = '';
            let interimTranscript = '';
            this.recognition.onresult = (event) => {
                this.ngZone.run(() => {
                    restartSilenceTimer();
                    let interimTranscript = '';
                    for (let i = event.resultIndex; i < event.results.length; ++i) {
                        const transcript = event.results[i][0].transcript;
                        if (event.results[i].isFinal) {
                            fullTranscript += transcript + '\n';
                        }
                        else {
                            interimTranscript += transcript;
                        }
                    }
                    interimTranscript = interimTranscript;
                    speechSubject.next({ text: fullTranscript + interimTranscript, isFinal: false });
                });
            };
            this.recognition.onerror = () => {
                this.ngZone.run(() => {
                    if (silenceTimer !== undefined) {
                        clearTimeout(silenceTimer);
                    }
                    this.isListening = false;
                    speechSubject.error('Speech recognition error');
                    this.microphoneStatus$.next('inactive');
                });
            };
            this.recognition.onend = () => {
                this.ngZone.run(() => {
                    if (silenceTimer !== undefined) {
                        clearTimeout(silenceTimer);
                    }
                    speechSubject.next({ text: fullTranscript + interimTranscript, isFinal: true });
                    this.isListening = false;
                    speechSubject.complete();
                    this.microphoneStatus$.next('inactive');
                });
            };
            this.recognition.start();
        });
        return speechSubject;
    }
    stop() {
        this.recognition.stop();
    }
    setRecognition() {
        const SpeechRecognitionConstructor = window.SpeechRecognition || window.webkitSpeechRecognition;
        if (!SpeechRecognitionConstructor) {
            console.warn('Speech recognition is not supported in this browser.');
            return;
        }
        this.hasSupportSpeechRecognition = true;
        this.recognition = new SpeechRecognitionConstructor();
        this.recognition.lang = this.localeService.getLocaleOptions()?.locale || 'pt-BR';
        this.recognition.interimResults = false;
        this.recognition.maxAlternatives = 1;
        this.localeService.getLocale().subscribe(locale => this.recognition.lang = locale);
    }
    get hasMicrophoneAccess() {
        return new Promise(async (resolve) => {
            const permission = await navigator.permissions.query({ name: 'microphone' });
            if (permission.state === 'denied') {
                resolve(false);
            }
            else if (permission.state === 'granted') {
                resolve(true);
            }
            else if (permission.state === 'prompt') {
                try {
                    navigator.mediaDevices.getUserMedia({ audio: true }).then((stream) => {
                        stream.getTracks().forEach(t => t.stop());
                    }).catch(() => {
                        resolve(false);
                    });
                    permission.onchange = () => {
                        this.ngZone.run(() => {
                            resolve(permission.state === 'granted' ? true : false);
                        });
                    };
                }
                catch (error) {
                    resolve(false);
                }
            }
        });
    }
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SpeechRecognitionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
    static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SpeechRecognitionService, providedIn: 'root' });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SpeechRecognitionService, decorators: [{
            type: Injectable,
            args: [{
                    providedIn: 'root'
                }]
        }], ctorParameters: () => [] });

class TextToSpeechService {
    locale = inject(LocaleService);
    ngZone = inject(NgZone);
    utterance = new SpeechSynthesisUtterance();
    activeVoice;
    voices = [];
    constructor() {
        this.setVoices();
    }
    setVoices() {
        let _voices = speechSynthesis.getVoices();
        if (!_voices.length) {
            speechSynthesis.onvoiceschanged = () => {
                this.ngZone.run(() => {
                    _voices = speechSynthesis.getVoices();
                    const currentLang = this.locale.getLocaleOptions()?.locale || 'pt-BR';
                    this.setActiveVoice(_voices, currentLang);
                    this.locale.getLocale().subscribe((locale) => {
                        this.setActiveVoice(_voices, locale);
                    });
                });
            };
        }
    }
    /**
     * Updates the active voice
     * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SpeechSynthesisVoice/voiceURI)
     * @param voiceUri
     */
    updateVoice(voiceUri) {
        this.activeVoice = this.voices.find((voice) => voice.voiceURI === voiceUri);
    }
    speak(text, speed = 1) {
        return new Promise((resolve) => {
            if (!this.activeVoice) {
                return resolve(true);
            }
            this.utterance.text = text;
            this.utterance.voice = this.activeVoice;
            this.utterance.rate = speed;
            speechSynthesis.speak(this.utterance);
            this.utterance.onend = () => {
                this.ngZone.run(() => {
                    resolve(true);
                });
            };
        });
    }
    pause() {
        speechSynthesis.pause();
    }
    resume() {
        speechSynthesis.resume();
    }
    cancel() {
        speechSynthesis.cancel();
    }
    get hasVoice() {
        return !!this.activeVoice;
    }
    setActiveVoice(voices, lang) {
        const _voice = voices.find((voice) => voice.lang === lang);
        if (_voice) {
            this.activeVoice = _voice;
        }
    }
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TextToSpeechService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
    static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TextToSpeechService, providedIn: 'root' });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TextToSpeechService, decorators: [{
            type: Injectable,
            args: [{
                    providedIn: 'root'
                }]
        }], ctorParameters: () => [] });

/**
 * @description Componente de reconhecimento de voz que integra a Web Speech API para
 * transcrever a fala do usuário em texto, inserída diretamente em um `<textarea>` fornecido.
 * Suporta também text-to-speech para leitura em voz alta do conteúdo do campo.
 *
 * @example
 * ```html
 * <s-speech-recognition
 *   [textAreaElement]="textAreaRef.nativeElement"
 *   (recognizedText)="onTextoReconhecido($event)" />
 * ```
 *
 * @category Inputs
 */
class SpeechRecognitionComponent {
    speechRecognitionService = inject(SpeechRecognitionService);
    textToSpeechService = inject(TextToSpeechService);
    translateService = inject(TranslateService);
    static TOOLBAR_ACTIVE = false;
    /** @description Referência ao elemento `<textarea>` nativo que receberá o texto transcrito. Campo obrigatório. */
    textAreaElement;
    /** @description Quando `true`, mantém o texto existente no campo ao iniciar novo reconhecimento. @default false */
    keepContext = false;
    /** @description Placeholder exibido no textarea durante o reconhecimento de voz. @default '' */
    speechRecognitionPlaceholder = '';
    _recognizedText = '';
    originalTextAreaElementText = '';
    isDoneTextToSpeech = false;
    onDestroy$ = new Subject();
    VOICE_SPEEDS = [0.5, 1, 1.5, 2];
    keydownEventListener = (event) => {
        if (this.disabled) {
            event.preventDefault();
        }
    };
    disabled = false;
    isListeningUserVoice = false;
    voiceSpeed = 1;
    isDisabledMicrophone = false;
    canRenderMicrophone = true;
    canRenderTextToSpeech = true;
    canRenderListeningText = false;
    canRenderDiscard = false;
    canRenderAprove = false;
    canRenderTextToSpeechToolbar = false;
    isPlayingTextToSpeech = false;
    /** @description Emitido quando o reconhecimento de voz é concluído, com o texto transcrito. */
    recognizedText = new EventEmitter();
    ngOnInit() {
        if (!this.hasSpeechRecognitionBrowserApi) {
            return;
        }
        if (!this.textAreaElement) {
            throw new Error('textAreaElement is required');
        }
        this.textAreaElement.placeholder = this.speechRecognitionPlaceholder
            ? this.speechRecognitionPlaceholder
            : this.translateService.instant('platform.angular_components.text_area_speech_recognition_placeholder');
        this.textAreaElement.addEventListener('keydown', this.keydownEventListener);
        this.speechRecognitionService.microphoneStatus$.pipe(takeUntil(this.onDestroy$)).subscribe((status) => {
            if (status === 'active') {
                this.onCloseToolbar();
            }
        });
    }
    onListen() {
        if (this.isDisabledMicrophone || this.isListening) {
            return;
        }
        this.disabled = true;
        this.canRenderMicrophone = false;
        this.canRenderListeningText = true;
        this.originalTextAreaElementText = this.textAreaElement.value;
        this.textAreaElement.value = '';
        this.isListeningUserVoice = true;
        this.speechRecognitionService
            .listen()
            .pipe(takeUntil(this.onDestroy$))
            .subscribe(({ text, isFinal }) => {
            this._recognizedText = text;
            this.setTextAreaValue(text);
            this.scrollTextAreaBottom();
            if (isFinal) {
                this.canRenderAprove = true;
                this.canRenderDiscard = true;
                this.canRenderListeningText = false;
                this.isListeningUserVoice = false;
            }
        }, () => {
            this.isListeningUserVoice = false;
            this.canRenderMicrophone = true;
            this.isDisabledMicrophone = false;
            this.canRenderListeningText = false;
            this.disabled = false;
        });
    }
    scrollTextAreaBottom() {
        setTimeout(() => {
            this.textAreaElement.scrollTop = this.textAreaElement.scrollHeight;
        }, 120);
    }
    onOpenToolbar() {
        if (this.isDisabledTextToSpeech) {
            return;
        }
        this.canRenderTextToSpeechToolbar = true;
        this.canRenderTextToSpeech = false;
        SpeechRecognitionComponent.TOOLBAR_ACTIVE = true;
        this.speak();
    }
    onCloseToolbar() {
        this.canRenderTextToSpeechToolbar = false;
        this.canRenderTextToSpeech = true;
        this.stopTextToSpeech();
        this.voiceSpeed = 1;
        SpeechRecognitionComponent.TOOLBAR_ACTIVE = false;
    }
    onDiscard() {
        this.canRenderAprove = false;
        this.canRenderDiscard = false;
        this.canRenderMicrophone = true;
        this.canRenderTextToSpeechToolbar = false;
        this.canRenderTextToSpeech = true;
        this._recognizedText = '';
        this.setTextAreaValue(this.originalTextAreaElementText);
        this.disabled = false;
        this.stopTextToSpeech();
        SpeechRecognitionComponent.TOOLBAR_ACTIVE = false;
    }
    onAprove() {
        this.canRenderAprove = false;
        this.canRenderDiscard = false;
        this.canRenderMicrophone = true;
        this.canRenderTextToSpeechToolbar = false;
        this.canRenderTextToSpeech = true;
        if (this.keepContext) {
            const breakLine = this.originalTextAreaElementText.length > 0 ? '\n' : '';
            this.originalTextAreaElementText += `${breakLine}${this._recognizedText}`;
        }
        else {
            this.originalTextAreaElementText = this._recognizedText;
        }
        this.recognizedText.emit(this.keepContext ? this.originalTextAreaElementText : this._recognizedText);
        this.scrollTextAreaBottom();
        this._recognizedText = '';
        this.disabled = false;
        this.textToSpeechService.cancel();
        SpeechRecognitionComponent.TOOLBAR_ACTIVE = false;
    }
    ngOnDestroy() {
        this.onDestroy$.next();
        this.onDestroy$.complete();
    }
    toggleTextToSpeech() {
        if (this.isPlayingTextToSpeech) {
            this.textToSpeechService.pause();
        }
        else {
            if (this.isDoneTextToSpeech) {
                this.speak();
            }
            else {
                this.textToSpeechService.resume();
            }
        }
        this.isPlayingTextToSpeech = !this.isPlayingTextToSpeech;
    }
    restartTextToSpeech() {
        this.textToSpeechService.cancel();
        this.speak();
    }
    updateVoiceSpeed() {
        const voiceSpeedIndex = this.VOICE_SPEEDS.indexOf(this.voiceSpeed);
        const nextVoiceSpeedIndex = this.VOICE_SPEEDS[voiceSpeedIndex + 1] ? voiceSpeedIndex + 1 : 0;
        this.voiceSpeed = this.VOICE_SPEEDS[nextVoiceSpeedIndex];
        this.textToSpeechService.cancel();
        this.speak();
    }
    stopListening() {
        this.speechRecognitionService.stop();
    }
    get isListening() {
        return this.speechRecognitionService.isListening;
    }
    get hasSpeechRecognitionBrowserApi() {
        return this.speechRecognitionService.hasSupportSpeechRecognition;
    }
    get isDisabledTextToSpeech() {
        const hasTextToSpeechVoice = this.textToSpeechService.hasVoice;
        return (!this.textToSpeech || !hasTextToSpeechVoice || this.isListening || SpeechRecognitionComponent.TOOLBAR_ACTIVE);
    }
    setTextAreaValue(value) {
        this.textAreaElement.value = value;
    }
    stopTextToSpeech() {
        this.isPlayingTextToSpeech = false;
        this.textToSpeechService.cancel();
    }
    speak() {
        this.isDoneTextToSpeech = false;
        this.isPlayingTextToSpeech = true;
        this.textToSpeechService.speak(this.textToSpeech, this.voiceSpeed).then(() => {
            this.isPlayingTextToSpeech = false;
            this.isDoneTextToSpeech = true;
        });
    }
    get textToSpeech() {
        return this.textAreaElement.value;
    }
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SpeechRecognitionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: SpeechRecognitionComponent, isStandalone: true, selector: "s-speech-recognition", inputs: { textAreaElement: "textAreaElement", keepContext: "keepContext", speechRecognitionPlaceholder: "speechRecognitionPlaceholder" }, outputs: { recognizedText: "recognizedText" }, ngImport: i0, template: "@if(hasSpeechRecognitionBrowserApi) {\n    <section class=\"speech-recognition\">\n        <div class=\"speech-recognition-text\">\n            @if(canRenderMicrophone) {\n                {{ 'platform.angular_components.text_area_before_speech' | translate }}\n            }\n\n            @if(isListeningUserVoice) {\n                {{ 'platform.angular_components.text_area_while_speech' | translate }}\n            }\n\n            @if(canRenderAprove && canRenderDiscard) {\n                {{ 'platform.angular_components.text_area_end_speech' | translate }}\n            }\n        </div>\n        <div class=\"speech-recognition-buttons\">\n            @if(canRenderListeningText) {\n                <span\n                    (click)=\"stopListening()\"\n                    class=\"speech-recognition-item speech-recognition-item-regular\">\n                    <i class=\"far fa-ellipsis-h\"></i>\n                </span>\n            }\n\n            @if(canRenderMicrophone) {\n                <span\n                    (click)=\"onListen()\"\n                    class=\"speech-recognition-item speech-recognition-item-microphone\"\n                    [class.speech-recognition-item-disabled]=\"isDisabledMicrophone || isListening || disabled\">\n                    <i class=\"fas fa-microphone\"></i>\n                </span>\n            }\n\n\n            @if(canRenderAprove) {\n                <span\n                    (click)=\"onAprove()\"\n                    class=\"speech-recognition-item speech-recognition-item-aprove\">\n                    <i class=\"fas fa-check\"></i>\n                </span>\n            }\n\n            @if(canRenderDiscard) {\n                <span\n                    (click)=\"onDiscard()\"\n                    class=\"speech-recognition-item speech-recognition-item-discard\">\n                    <i class=\"fas fa-times\"></i>\n                </span>\n            }\n\n            @if(canRenderTextToSpeech) {\n                <span\n                    (click)=\"onOpenToolbar()\"\n                    class=\"speech-recognition-item speech-recognition-item-regular\"\n                    [class.speech-recognition-item-disabled]=\"isDisabledTextToSpeech\">\n                    <i class=\"fas fa-volume-down\"></i>\n                </span>\n            }\n\n            @if(canRenderTextToSpeechToolbar) {\n                <span\n                    class=\"speech-recognition-item-toolbar\">\n                     <i class=\"fas\" [class.fa-pause]=\"isPlayingTextToSpeech\" [class.fa-play]=\"!isPlayingTextToSpeech\"\n                     (click)=\"toggleTextToSpeech()\"></i>\n                        <i class=\"fas fa-backward\" (click)=\"restartTextToSpeech()\"></i>\n                        <span (click)=\"updateVoiceSpeed()\">\n                            {{ voiceSpeed }}x\n                        </span>\n                        <i class=\"fas fa-times\" (click)=\"onCloseToolbar()\"></i>\n                </span>\n            }\n        </div>\n    </section>\n}\n", styles: [".speech-recognition{display:flex;gap:10px;justify-content:space-between;width:100%}.speech-recognition-buttons{display:flex;gap:10px;position:relative;bottom:15px;margin-right:16px}.speech-recognition-item{display:inline-flex;height:25px;padding:4px 12px;justify-content:center;align-items:center;gap:8px;border-radius:15px;cursor:pointer;transition:background .1s ease-in}.speech-recognition-item i,.speech-recognition-item span{color:#fff}.speech-recognition-item-disabled{cursor:default!important}.speech-recognition-item-disabled *{opacity:.5}.speech-recognition-item-microphone{background:#428bca}.speech-recognition-item-microphone:not(.speech-recognition-item-disabled):hover{background:#063951}.speech-recognition-item-regular{background:#7892a1}.speech-recognition-item-regular:not(.speech-recognition-item-disabled):hover{background:#697882}.speech-recognition-item-aprove{background:#0c9348}.speech-recognition-item-aprove:not(.speech-recognition-item-disabled):hover{background:#063951}.speech-recognition-item-discard{background:#c13018}.speech-recognition-item-discard:not(.speech-recognition-item-disabled):hover{background:#063951}.speech-recognition-item-toolbar{background:#7892a1;display:flex;border-radius:15px;align-items:center;color:#fff;height:25px}.speech-recognition-item-toolbar i,.speech-recognition-item-toolbar span{cursor:pointer}.speech-recognition-item-toolbar i:not(:first-child),.speech-recognition-item-toolbar i:not(:last-child){padding:6px}.speech-recognition-item-toolbar i:first-child{padding-left:10px}.speech-recognition-item-toolbar i:last-child{padding-right:10px}.speech-recognition-text{color:#212533;font-size:12px;font-style:normal;font-weight:400;word-break:break-word}\n"], dependencies: [{ kind: "pipe", type: TranslatePipe, name: "translate" }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SpeechRecognitionComponent, decorators: [{
            type: Component,
            args: [{ selector: 's-speech-recognition', standalone: true, imports: [TranslatePipe], template: "@if(hasSpeechRecognitionBrowserApi) {\n    <section class=\"speech-recognition\">\n        <div class=\"speech-recognition-text\">\n            @if(canRenderMicrophone) {\n                {{ 'platform.angular_components.text_area_before_speech' | translate }}\n            }\n\n            @if(isListeningUserVoice) {\n                {{ 'platform.angular_components.text_area_while_speech' | translate }}\n            }\n\n            @if(canRenderAprove && canRenderDiscard) {\n                {{ 'platform.angular_components.text_area_end_speech' | translate }}\n            }\n        </div>\n        <div class=\"speech-recognition-buttons\">\n            @if(canRenderListeningText) {\n                <span\n                    (click)=\"stopListening()\"\n                    class=\"speech-recognition-item speech-recognition-item-regular\">\n                    <i class=\"far fa-ellipsis-h\"></i>\n                </span>\n            }\n\n            @if(canRenderMicrophone) {\n                <span\n                    (click)=\"onListen()\"\n                    class=\"speech-recognition-item speech-recognition-item-microphone\"\n                    [class.speech-recognition-item-disabled]=\"isDisabledMicrophone || isListening || disabled\">\n                    <i class=\"fas fa-microphone\"></i>\n                </span>\n            }\n\n\n            @if(canRenderAprove) {\n                <span\n                    (click)=\"onAprove()\"\n                    class=\"speech-recognition-item speech-recognition-item-aprove\">\n                    <i class=\"fas fa-check\"></i>\n                </span>\n            }\n\n            @if(canRenderDiscard) {\n                <span\n                    (click)=\"onDiscard()\"\n                    class=\"speech-recognition-item speech-recognition-item-discard\">\n                    <i class=\"fas fa-times\"></i>\n                </span>\n            }\n\n            @if(canRenderTextToSpeech) {\n                <span\n                    (click)=\"onOpenToolbar()\"\n                    class=\"speech-recognition-item speech-recognition-item-regular\"\n                    [class.speech-recognition-item-disabled]=\"isDisabledTextToSpeech\">\n                    <i class=\"fas fa-volume-down\"></i>\n                </span>\n            }\n\n            @if(canRenderTextToSpeechToolbar) {\n                <span\n                    class=\"speech-recognition-item-toolbar\">\n                     <i class=\"fas\" [class.fa-pause]=\"isPlayingTextToSpeech\" [class.fa-play]=\"!isPlayingTextToSpeech\"\n                     (click)=\"toggleTextToSpeech()\"></i>\n                        <i class=\"fas fa-backward\" (click)=\"restartTextToSpeech()\"></i>\n                        <span (click)=\"updateVoiceSpeed()\">\n                            {{ voiceSpeed }}x\n                        </span>\n                        <i class=\"fas fa-times\" (click)=\"onCloseToolbar()\"></i>\n                </span>\n            }\n        </div>\n    </section>\n}\n", styles: [".speech-recognition{display:flex;gap:10px;justify-content:space-between;width:100%}.speech-recognition-buttons{display:flex;gap:10px;position:relative;bottom:15px;margin-right:16px}.speech-recognition-item{display:inline-flex;height:25px;padding:4px 12px;justify-content:center;align-items:center;gap:8px;border-radius:15px;cursor:pointer;transition:background .1s ease-in}.speech-recognition-item i,.speech-recognition-item span{color:#fff}.speech-recognition-item-disabled{cursor:default!important}.speech-recognition-item-disabled *{opacity:.5}.speech-recognition-item-microphone{background:#428bca}.speech-recognition-item-microphone:not(.speech-recognition-item-disabled):hover{background:#063951}.speech-recognition-item-regular{background:#7892a1}.speech-recognition-item-regular:not(.speech-recognition-item-disabled):hover{background:#697882}.speech-recognition-item-aprove{background:#0c9348}.speech-recognition-item-aprove:not(.speech-recognition-item-disabled):hover{background:#063951}.speech-recognition-item-discard{background:#c13018}.speech-recognition-item-discard:not(.speech-recognition-item-disabled):hover{background:#063951}.speech-recognition-item-toolbar{background:#7892a1;display:flex;border-radius:15px;align-items:center;color:#fff;height:25px}.speech-recognition-item-toolbar i,.speech-recognition-item-toolbar span{cursor:pointer}.speech-recognition-item-toolbar i:not(:first-child),.speech-recognition-item-toolbar i:not(:last-child){padding:6px}.speech-recognition-item-toolbar i:first-child{padding-left:10px}.speech-recognition-item-toolbar i:last-child{padding-right:10px}.speech-recognition-text{color:#212533;font-size:12px;font-style:normal;font-weight:400;word-break:break-word}\n"] }]
        }], propDecorators: { textAreaElement: [{
                type: Input,
                args: [{ required: true }]
            }], keepContext: [{
                type: Input
            }], speechRecognitionPlaceholder: [{
                type: Input
            }], recognizedText: [{
                type: Output
            }] } });

class SpeechRecognitionModule {
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SpeechRecognitionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
    static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.14", ngImport: i0, type: SpeechRecognitionModule, imports: [SpeechRecognitionComponent], exports: [SpeechRecognitionComponent] });
    static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SpeechRecognitionModule });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SpeechRecognitionModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [SpeechRecognitionComponent],
                    exports: [SpeechRecognitionComponent],
                }]
        }] });

/**
 * Generated bundle index. Do not edit.
 */

export { SpeechRecognitionComponent, SpeechRecognitionModule, SpeechRecognitionService, TextToSpeechService };
//# sourceMappingURL=seniorsistemas-angular-components-speech-recognition.mjs.map
