export { F as FileUploadRejectionReason } from './bal-file-upload.type-rBUN7c88.js';
export { i as i18nBalClose } from './bal-close.i18n-Ct27z6g9.js';
export { B as BalDate, i as i18nBalDate } from './date-W0XtD641.js';
export { i as i18nBalInputStepper } from './bal-input-stepper.i18n-DEb5iNGc.js';
export { i as i18nBalLabel } from './bal-label.i18n-JHAE10yr.js';
export { i as i18nBalTimeInput } from './bal-time-input.i18n-B4aDEwd8.js';
export { n as newBalStepOption } from './bal-step.util-DIC_sxLd.js';
export { n as newBalTabOption } from './bal-tab.util-BmVI6cLw.js';
export { B as BalSnackbarController, a as BalToastController, b as balSnackbarController, c as balToastController, i as initialize, i as initializeBaloiseDesignSystem, s as setupConfig } from './initialize-BS5FhjDS.js';
import { b as balBrowser } from './browser-B1u-Mq75.js';
import { b as balDevice } from './device-TtMibDFL.js';
export { B as BalDevice } from './device-TtMibDFL.js';
export { n as newBalOption } from './option-BLp4ll3i.js';
export { s as scrollToFirstInvalidField } from './form-FCLKfv6B.js';
import { g as getAppRoot, c as componentOnReady } from './helpers-BNj87EbG.js';
export { d as deepReady, i as isDescendant, s as shallowReady, w as wait, a as waitAfterFramePaint, b as waitAfterIdleCallback, e as waitAfterLargestContentfulPaintCallback, f as waitForComponent, h as waitForDesignSystem, j as waitOnLoadEventCallback } from './helpers-BNj87EbG.js';
export { I as INVALID_VALUE } from './mask-util-DuObDTix.js';
export { B as BalScrollHandler } from './scroll-X92R_eyZ.js';
import { g as getOverlays, a as getOverlay } from './overlays-DuvWMrlA.js';
import { B as BalWindowResizeListener, b as balBreakpoints } from './breakpoints.subject-C32mP6rF.js';
export { c as BalBreakpointSubject, d as BalBreakpointsUtil, a as balBreakpointSubject } from './breakpoints.subject-C32mP6rF.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-B7jugjyM.js';
export { d as defaultConfig } from './config.default-RE8-gLMQ.js';
import { S as Subject } from './listener-CClDIhvK.js';
export { B as BalSwipeSubject } from './swipe.subject-BXuaiulg.js';
import './index-BdVwMG9u.js';
import './tokens.esm-C22U88Bg.js';
import './log-CwssmmaV.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 }, 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, invalid: 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 = /*@__PURE__*/ new BalOrientationSubject();

class BalModalController {
    constructor() {
        this.tag = 'bal-modal';
    }
    create(options) {
        /* tslint:disable-next-line */
        if (typeof customElements !== 'undefined' && balBrowser.hasDocument) {
            return customElements.whenDefined(this.tag).then(() => {
                const element = document.createElement(this.tag);
                // convert the passed in overlay options into props
                // that get passed down into the new overlay
                Object.assign(element, options);
                // append the overlay element to the document body
                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();

/**
 * deprecated: Please use balDevice.hasTouchScreen
 */
const hasTouchSupport = () => balDevice.hasTouchScreen;
/**
 * deprecated: Please use balBrowser.isSafari
 */
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;
};
/**
 * deprecated
 */
const NewBalOptionValue = newBalOptionValue;
const NewBalSingleOptionValue = newBalSingleOptionValue;

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