import { p as proxyCustomElement, H, e as createEvent, h, c as Host } from './p-ae373651.js';
import { e as defaultIconPack, i as useLanguage } from './p-5b3a7f00.js';
import { b as getPreference, s as setPreference } from './p-a83ccdbd.js';
import { S as SyncWithStore } from './p-070aa695.js';
import { d as defineCustomElement$6 } from './p-0a836b64.js';
import { d as defineCustomElement$5 } from './p-85587a5c.js';
import { d as defineCustomElement$4 } from './p-3e0452c4.js';
import { d as defineCustomElement$3 } from './p-550ddac7.js';
import { d as defineCustomElement$2 } from './p-9068e892.js';
import { d as defineCustomElement$1 } from './p-e1f78de7.js';

const rtkSettingsAudioCss = ":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:flex;width:100%;flex-direction:column}audio{visibility:hidden}.group{margin-top:var(--rtk-space-2, 8px);margin-bottom:var(--rtk-space-2, 8px)}.group>*{margin-bottom:var(--rtk-space-2, 8px)}.group>*:last-child{margin-bottom:var(--rtk-space-0, 0px)}.group select{flex:1 1 0%}.row{display:flex;align-items:center;justify-content:space-between;gap:var(--rtk-space-3, 12px)}rtk-audio-visualizer{flex-shrink:0}rtk-button{border-radius:var(--rtk-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity));--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}rtk-button rtk-icon{margin-right:var(--rtk-space-2, 8px)}";
const RtkSettingsAudioStyle0 = rtkSettingsAudioCss;

var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
        r = Reflect.decorate(decorators, target, key, desc);
    else
        for (var i = decorators.length - 1; i >= 0; i--)
            if (d = decorators[i])
                r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
const RtkSettingsAudio = /*@__PURE__*/ proxyCustomElement(class RtkSettingsAudio extends H {
    constructor() {
        super();
        this.__registerHost();
        this.__attachShadow();
        this.stateUpdate = createEvent(this, "rtkStateUpdate", 7);
        /** Icon pack */
        this.iconPack = defaultIconPack;
        /** Language */
        this.t = useLanguage();
    }
    render() {
        var _a, _b;
        if (!this.meeting)
            return null;
        const defaults = {
            meeting: this.meeting,
            states: this.states,
            size: this.size,
            iconPack: this.iconPack,
            t: this.t,
        };
        const states = this.states;
        const initialNotificationSoundsPreference = ((_a = states === null || states === void 0 ? void 0 : states.prefs) === null || _a === void 0 ? void 0 : _a.muteNotificationSounds) === true ||
            getPreference('mute-notification-sounds') === 'true';
        return (h(Host, null, h("rtk-microphone-selector", Object.assign({}, defaults), h("rtk-audio-visualizer", { participant: (_b = this.meeting) === null || _b === void 0 ? void 0 : _b.self, iconPack: this.iconPack, t: this.t, slot: "indicator" })), h("rtk-speaker-selector", Object.assign({}, defaults)), h("div", { class: "group", part: "notification-toggle" }, h("div", { class: "row" }, h("label", { htmlFor: "notification-toggle" }, this.t('settings.notification_sound')), h("rtk-switch", { id: "notification-toggle", checked: !initialNotificationSoundsPreference, onRtkChange: (e) => {
                const { checked } = e.target;
                const muteNotificationSounds = !checked;
                this.stateUpdate.emit({ prefs: { muteNotificationSounds } });
                setPreference('mute-notification-sounds', muteNotificationSounds);
            }, iconPack: this.iconPack, t: this.t })))));
    }
    static get style() { return RtkSettingsAudioStyle0; }
}, [1, "rtk-settings-audio", {
        "meeting": [16],
        "states": [16],
        "size": [513],
        "iconPack": [16],
        "t": [16]
    }]);
__decorate([
    SyncWithStore()
], RtkSettingsAudio.prototype, "meeting", void 0);
__decorate([
    SyncWithStore()
], RtkSettingsAudio.prototype, "states", void 0);
__decorate([
    SyncWithStore()
], RtkSettingsAudio.prototype, "iconPack", void 0);
__decorate([
    SyncWithStore()
], RtkSettingsAudio.prototype, "t", void 0);
function defineCustomElement() {
    if (typeof customElements === "undefined") {
        return;
    }
    const components = ["rtk-settings-audio", "rtk-audio-visualizer", "rtk-button", "rtk-icon", "rtk-microphone-selector", "rtk-speaker-selector", "rtk-switch"];
    components.forEach(tagName => { switch (tagName) {
        case "rtk-settings-audio":
            if (!customElements.get(tagName)) {
                customElements.define(tagName, RtkSettingsAudio);
            }
            break;
        case "rtk-audio-visualizer":
            if (!customElements.get(tagName)) {
                defineCustomElement$6();
            }
            break;
        case "rtk-button":
            if (!customElements.get(tagName)) {
                defineCustomElement$5();
            }
            break;
        case "rtk-icon":
            if (!customElements.get(tagName)) {
                defineCustomElement$4();
            }
            break;
        case "rtk-microphone-selector":
            if (!customElements.get(tagName)) {
                defineCustomElement$3();
            }
            break;
        case "rtk-speaker-selector":
            if (!customElements.get(tagName)) {
                defineCustomElement$2();
            }
            break;
        case "rtk-switch":
            if (!customElements.get(tagName)) {
                defineCustomElement$1();
            }
            break;
    } });
}
defineCustomElement();

export { RtkSettingsAudio as R, defineCustomElement as d };
