export { F as FileUploadRejectionReason } from './bal-file-upload.type-2a70f4ec.js';
export { B as BalDate, i as i18nBalDate } from './date-5fb27ee4.js';
export { i as i18nBalClose } from './bal-close.i18n-f2daa707.js';
export { i as i18nBalDatepicker } from './bal-datepicker.i18n-63a3cb67.js';
export { i as i18nBalTimeInput } from './bal-time-input.i18n-157c7092.js';
export { i as i18nBalInputStepper } from './bal-input-stepper.i18n-aaa4a009.js';
export { i as i18nBalLabel } from './bal-label.i18n-4212be56.js';
export { a as BalSnackbarController, B as BalToastController, c as balSnackbarController, b as balToastController, i as initialize, i as initializeBaloiseDesignSystem, s as setupConfig } from './initialize-9743d528.js';
export { n as newBalStepOption } from './bal-step.util-3905ad56.js';
export { n as newBalTabOption } from './bal-tab.util-933315fe.js';
import { g as getAppRoot, c as componentOnReady } from './helpers-b53ad333.js';
export { c as componentOnReady, e as deepReady, g as getAppRoot, i as isDescendant, s as shallowReady, f as wait, b as waitAfterFramePaint, d as waitAfterIdleCallback, w as waitForComponent, a as waitForDesignSystem } from './helpers-b53ad333.js';
export { s as scrollToFirstInvalidField } from './form-fb8dd9f5.js';
export { B as BalScrollHandler } from './scroll-15b6b91b.js';
import { b as balBrowser } from './browser-a623d3a0.js';
export { b as balBrowser } from './browser-a623d3a0.js';
import { b as balDevice } from './device-85159a44.js';
export { B as BalDevice, b as balDevice } from './device-85159a44.js';
import { g as getOverlays, a as getOverlay } from './overlays-b346ddf5.js';
import { B as BalWindowResizeListener, b as balBreakpoints } from './breakpoints.subject-bd83ea04.js';
export { c as BalBreakpointSubject, d as BalBreakpointsUtil, a as balBreakpointSubject, b as balBreakpoints } from './breakpoints.subject-bd83ea04.js';
export { a as attachToConfig, d as detachFromConfig, o as onBalConfigChange, u as updateBalAllowedLanguages, b as updateBalAnimated, c as updateBalIcons, e as updateBalLanguage, f as updateBalRegion, g as useBalConfig } from './config.utils-8fe5be10.js';
export { d as defaultConfig } from './config.default-7d48bb87.js';
import { S as Subject } from './listener-aa4bfae3.js';
export { B as BalSwipeSubject } from './swipe.subject-72b9937d.js';
import './index.esm-ec4cba26.js';
import './index-82aff103.js';
import './_commonjsHelpers-1c8beb5f.js';
import './index-4d3658f6.js';
import './icons.constant-47b0ca12.js';
import './tokens.esm-7faeb0d0.js';
import './log-cf8e52ef.js';

const i18nBalFieldLabel = {
    de: {
        optional: ' (optional)',
    },
    en: {
        optional: ' (optional)',
    },
    fr: {
        optional: ' (optionnel)',
    },
    it: {
        optional: ' (opzionale)',
    },
    nl: {
        optional: ' (optioneel)',
    },
    es: {
        optional: ' (opcional)',
    },
    pl: {
        optional: ' (opcjonalnie)',
    },
    pt: {
        optional: ' (opcional)',
    },
    sv: {
        optional: ' (frivillig)',
    },
    fi: {
        optional: ' (valinnainen)',
    },
};

const newBalCheckboxOption = (option) => {
    return Object.assign(Object.assign({ interface: 'checkbox', labelHidden: false, flat: false, disabled: false, readonly: false, required: false, nonSubmit: false, invalid: false, checked: false, hidden: false }, option), { label: '', html: option.label });
};

const newBalRadioOption = (option) => {
    return Object.assign(Object.assign({ interface: 'radio', labelHidden: false, flat: false, disabled: false, readonly: false, required: false, nonSubmit: false, invisible: false, invalid: false, hidden: false }, option), { label: '', html: option.label });
};

const newBalOptionValue = (value, label, disabled = false, data) => {
    return {
        value,
        label,
        disabled,
        data,
    };
};
const newBalSingleOptionValue = (valueAndLabel, disabled = false, data) => {
    return newBalOptionValue(valueAndLabel, valueAndLabel, disabled, data);
};

class BalOrientationSubject extends Subject {
    constructor() {
        super(observer => observer.orientationListener(this.state));
        this.listener = new BalWindowResizeListener();
        this.state = balDevice.orientation.toObject();
        this.listener.connect();
        this.listener.add(() => {
            const newState = balDevice.orientation.toObject();
            if (!this.isEqual(newState)) {
                this.state = newState;
                this.notify(undefined);
            }
        });
    }
    attach(observer) {
        super.attach(observer);
        observer.orientationListener(this.state);
    }
    isEqual(newState) {
        return newState.landscape === this.state.landscape && newState.portrait === this.state.portrait;
    }
}
const balOrientationSubject = new BalOrientationSubject();

class BalModalController {
    constructor() {
        this.tag = 'bal-modal';
    }
    create(options) {
        if (typeof customElements !== 'undefined' && balBrowser.hasDocument) {
            return customElements.whenDefined(this.tag).then(() => {
                const element = document.createElement(this.tag);
                Object.assign(element, options);
                getAppRoot(document).appendChild(element);
                return new Promise(resolve => componentOnReady(element, resolve));
            });
        }
        return Promise.resolve();
    }
    async dismissAll(data, role) {
        if (balBrowser.hasDocument) {
            const overlays = getOverlays(document, this.tag);
            await Promise.all(overlays.map(o => o.dismiss(data, role)));
        }
    }
    dismiss(data, role, id) {
        if (balBrowser.hasDocument) {
            const overlay = getOverlay(document, this.tag, id);
            if (!overlay) {
                return Promise.reject('overlay does not exist');
            }
            return overlay.dismiss(data, role);
        }
        return Promise.resolve(false);
    }
    async getTop() {
        if (balBrowser.hasDocument) {
            return getOverlay(document, this.tag);
        }
        return;
    }
}
const balModalController = new BalModalController();

const hasTouchSupport = () => balDevice.hasTouchScreen;
const isBrowser = (browser) => {
    if (browser === 'Safari') {
        return balBrowser.isSafari;
    }
    return false;
};
const getPlatforms = (_win) => balBreakpoints.detect();
const isPlatform = (winOrPlatform, platform) => {
    if (typeof winOrPlatform === 'string') {
        platform = winOrPlatform;
    }
    if (platform) {
        return balBreakpoints.detect().includes(platform);
    }
    return false;
};
const NewBalOptionValue = newBalOptionValue;
const NewBalSingleOptionValue = newBalSingleOptionValue;

export { BalModalController, BalOrientationSubject, NewBalOptionValue, NewBalSingleOptionValue, balModalController, balOrientationSubject, getPlatforms, hasTouchSupport, i18nBalFieldLabel, isBrowser, isPlatform, newBalCheckboxOption, newBalOptionValue, newBalRadioOption, newBalSingleOptionValue };
