{"version":3,"file":"bs-darkmode-toggle.mjs","sources":["../src/main/js/core/Tools.js","../src/main/js/core/OptionResolver.types.js","../src/main/js/core/StateReducer.types.js","../src/main/js/types/ColorModes.js","../src/main/js/core/events/Events.types.js","../node_modules/component-lifecycle/dist/index.mjs","../src/main/js/core/OptionResolver.js","../src/main/js/core/StateReducer.js","../src/main/js/core/storage/providers/CookieStorage.js","../src/main/js/core/storage/providers/LocalStorage.js","../src/main/js/core/storage/providers/NoStorage.js","../src/main/js/core/storage/StorageManager.js","../src/main/js/core/dom/AbstractLayout.js","../src/main/js/core/dom/layouts/ButtonLayout.js","../src/main/js/core/dom/layouts/ToggleLayout.js","../src/main/js/core/dom/DomManager.js","../src/main/js/core/events/EventFactory.js","../src/main/js/DarkModeToggle.js","../src/main/js/types/Methods.js","../src/main/js/monitoring/DarkModeMonitor.js"],"sourcesContent":["export var SanitizeMode;\n(function (SanitizeMode) {\n    SanitizeMode[\"HTML\"] = \"HTML\";\n    SanitizeMode[\"TEXT\"] = \"TEXT\";\n})(SanitizeMode || (SanitizeMode = {}));\n/**\n * Sanitizes a given text string according to the provided options.\n * If the input text is null, it will return null.\n * If the input text is not null, it will sanitize the text according to the provided mode.\n * If the mode is HTML, it will sanitize the text using the sanitizeHTML function.\n * If the mode is TEXT, it will sanitize the text using the sanitizeText function.\n * @param text The text string to sanitize.\n * @param opts The options to use for sanitizing the text.\n * @return The sanitized text string, or null if the input text was null.\n */\nexport function sanitize(text, opts) {\n    if (!text)\n        return text;\n    switch (opts.mode) {\n        case SanitizeMode.HTML:\n            return sanitizeHTML(text);\n        case SanitizeMode.TEXT:\n            return sanitizeText(text);\n    }\n}\n/**\n * Sanitizes a given text string, replacing special characters with their HTML entities.\n * If the input text is null, it will return null.\n * @param text The text string to sanitize.\n * @return The sanitized text string, or null if the input text was null.\n */\nfunction sanitizeText(text) {\n    const map = {\n        \"&\": \"&amp;\",\n        \"<\": \"&lt;\",\n        \">\": \"&gt;\",\n        '\"': \"&quot;\",\n        \"'\": \"&#39;\",\n        \"/\": \"&#x2F;\"\n    };\n    // Using replace with regex for single-pass character mapping compatible with ES5\n    return text.replace(/[&<>\"'/]/g, (m) => map[m]);\n}\n/**\n * Sanitizes HTML content using an allow-list approach to prevent XSS attacks.\n *\n * @param html The HTML string to sanitize\n * @param options Configuration options for allowed tags and attributes\n * @returns Sanitized HTML string\n */\nfunction sanitizeHTML(html) {\n    const config = {\n        allowedTags: [\"b\", \"i\", \"strong\", \"em\", \"span\", \"small\", \"sup\", \"sub\", \"img\"],\n        allowedAttributes: [\"class\", \"style\", \"src\", \"alt\", \"title\", \"data-*\"]\n    };\n    // Implementation using DOMParser for browser compatibility\n    const parser = new DOMParser();\n    const doc = parser.parseFromString(html, \"text/html\");\n    // Sanitize all nodes in the document body\n    const bodyChildren = Array.from(doc.body.childNodes);\n    bodyChildren.forEach((node) => sanitizeNode(node, config));\n    return doc.body.innerHTML;\n}\n/**\n * Sanitizes a single node in the document tree.\n *\n * For element nodes, it removes disallowed tags and attributes.\n * For text nodes, it keeps them as is.\n *\n * Recursively sanitizes all children of an element node.\n *\n * @param node The node to sanitize\n * @param config Configuration options for allowed tags and attributes\n */\nfunction sanitizeNode(node, config) {\n    const sanitizeNodeRecursive = (node) => {\n        var _a;\n        if (node.nodeType === Node.ELEMENT_NODE) {\n            const element = node;\n            const tagName = element.tagName.toLowerCase();\n            // Remove disallowed tags\n            if (!config.allowedTags.includes(tagName)) {\n                // Replace disallowed element with its text content\n                const fragment = document.createDocumentFragment();\n                Array.from(element.childNodes).forEach(child => {\n                    fragment.appendChild(child.cloneNode(true));\n                });\n                (_a = element.parentNode) === null || _a === void 0 ? void 0 : _a.replaceChild(fragment, element);\n                return;\n            }\n            // Remove disallowed attributes\n            Array.from(element.attributes).forEach(attr => {\n                const attrName = attr.name.toLowerCase();\n                const isAllowed = config.allowedAttributes.some(allowed => allowed.endsWith(\"*\") ? attrName.startsWith(allowed.slice(0, -1)) : attrName === allowed);\n                if (isAllowed) {\n                    sanitizeAllowedAttr(element, attr, attrName);\n                }\n                else {\n                    element.removeAttribute(attr.name);\n                }\n            });\n            // Recursively sanitize children\n            const children = Array.from(element.childNodes);\n            children.forEach(sanitizeNodeRecursive);\n        }\n        else if (node.nodeType === Node.TEXT_NODE) {\n            // Text nodes are safe, keep them as is\n            return;\n        }\n    };\n    sanitizeNodeRecursive(node);\n}\n/**\n * Sanitizes an allowed attribute by removing it if its value is a dangerous protocol.\n * Only works for \"src\" and \"href\" attributes.\n * @param element The element to check for the attribute.\n * @param attr The attribute to check the value of.\n * @param attrName The name of the attribute to check (either \"src\" or \"href\").\n */\nfunction sanitizeAllowedAttr(element, attr, attrName) {\n    if (attrName !== \"src\" && attrName !== \"href\")\n        return;\n    const value = attr.value.toLowerCase();\n    // sonar typescript:S1523 - This is security detection, not execution\n    const isDangerousProtocol = value.startsWith(\"javascript:\") ||\n        value.startsWith(\"vbscript:\") ||\n        (value.startsWith(\"data:\") && !value.startsWith(\"data:image/\"));\n    if (isDangerousProtocol) {\n        element.removeAttribute(attr.name);\n    }\n}\n;\n/**\n * Checks if the given string is a valid numeric value.\n *\n * A valid numeric value is a `string` that starts with an optional plus or minus sign,\n * followed by one or more digits, optionally followed by a decimal point and\n * one or more digits.\n *\n * Examples of valid numeric values include \"123\", \"-123\", \"+123.45\", \"-123.45\", etc.\n * Examples of invalid numeric values include \"abc\", \"123abc\", \"123.abc\", etc.\n * @param {string | number} value The string or number to check for being a valid numeric value.\n * @returns {boolean} `true` if the string contains a valid numeric value, `false` otherwise.\n */\nexport function isNumeric(value) {\n    return /^[+-]?\\d+(\\.\\d+)?$/.test(value.toString().trim());\n}\n","export var StorageType;\n(function (StorageType) {\n    StorageType[\"COOKIE\"] = \"cookie\";\n    StorageType[\"LOCAL\"] = \"local\";\n    StorageType[\"NONE\"] = \"none\";\n})(StorageType || (StorageType = {}));\nexport var Layout;\n(function (Layout) {\n    Layout[\"BUTTON\"] = \"button\";\n    Layout[\"TOGGLE\"] = \"toggle\";\n})(Layout || (Layout = {}));\n","export var ActionType;\n(function (ActionType) {\n    ActionType[\"LIGHT\"] = \"light\";\n    ActionType[\"DARK\"] = \"dark\";\n    ActionType[\"TOGGLE\"] = \"toggle\";\n    ActionType[\"OVERRIDE\"] = \"override\";\n})(ActionType || (ActionType = {}));\n","export var ColorModes;\n(function (ColorModes) {\n    ColorModes[\"DARK\"] = \"dark\";\n    ColorModes[\"LIGHT\"] = \"light\";\n    ColorModes[\"NONE\"] = \"none\";\n})(ColorModes || (ColorModes = {}));\n","export var CustomEventTypes;\n(function (CustomEventTypes) {\n    CustomEventTypes[\"CHANGE\"] = \"change\";\n})(CustomEventTypes || (CustomEventTypes = {}));\nexport var PrefixedCustomEventTypes;\n(function (PrefixedCustomEventTypes) {\n    PrefixedCustomEventTypes[\"CHANGE\"] = \"darkmode:change\";\n})(PrefixedCustomEventTypes || (PrefixedCustomEventTypes = {}));\n;\nexport var LegacyEventTypes;\n(function (LegacyEventTypes) {\n    LegacyEventTypes[\"CHANGE\"] = \"change\";\n})(LegacyEventTypes || (LegacyEventTypes = {}));\n","/* Copyright Notice\n * component-lifecycle v2.0.0\n * https://github.com/palcarazm/component-lifecycle#readme\n * @author Pablo Alcaraz Martínez \n * @see https://github.com/palcarazm/\n * @funding GitHub Sponsors\n * @see https://github.com/sponsors/palcarazm\n * @license MIT\n */\nvar t;!function(t){t.Idle=\"idle\",t.Initialized=\"initialized\",t.Attached=\"attached\",t.Disposed=\"disposed\",t.Destroyed=\"destroyed\"}(t||(t={}));var e=function(t,e,i,s){return new(i||(i=Promise))(function(n,o){function r(t){try{a(s.next(t))}catch(t){o(t)}}function d(t){try{a(s.throw(t))}catch(t){o(t)}}function a(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(r,d)}a((s=s.apply(t,e||[])).next())})};class i{constructor(e,i){this.element=e,this._state=t.Idle;const s=this.constructor.getDefaultOptions();this.options=Object.assign(Object.assign({},s),i)}static getDefaultOptions(){return s}get state(){return this._state}isIdle(){return this.is(t.Idle)}isInitialized(){return this.is(t.Initialized)}isAttached(){return this.is(t.Attached)}isDisposed(){return this.is(t.Disposed)}isDestroyed(){return this.is(t.Destroyed)}is(t){return this.state===t}canTransition(t){return n[this._state].includes(t)}transitionTo(i){return e(this,void 0,void 0,function*(){if(this.canTransition(i))switch(i){case t.Initialized:return void(yield this.executeTransition(i,()=>this.doInit(),\"initialized\"));case t.Attached:return void(yield this.executeTransition(i,()=>this.doAttach(),\"attached\"));case t.Disposed:return void(yield this.executeTransition(i,()=>this.doDispose(),\"disposed\"));case t.Destroyed:return void(yield this.executeTransition(i,()=>this.doDestroy(),\"destroyed\"))}else this.emit(\"transition-invalid\",{component:this,from:this._state,to:i})})}executeTransition(t,i,s){return e(this,void 0,void 0,function*(){const e=yield i();e.cancelled?this.emit(\"transition-cancelled\",{component:this,from:this._state,to:t,reason:e.reason}):(this._state=t,this.emit(s,{component:this}))})}init(){return e(this,void 0,void 0,function*(){yield this.transitionTo(t.Initialized)})}attach(){return e(this,void 0,void 0,function*(){yield this.transitionTo(t.Attached)})}dispose(){return e(this,void 0,void 0,function*(){yield this.transitionTo(t.Disposed)})}destroy(){return e(this,void 0,void 0,function*(){yield this.transitionTo(t.Destroyed)})}doInit(){return e(this,void 0,void 0,function*(){return{cancelled:!1}})}doAttach(){return e(this,void 0,void 0,function*(){return{cancelled:!1}})}doDispose(){return e(this,void 0,void 0,function*(){return{cancelled:!1}})}doDestroy(){return e(this,void 0,void 0,function*(){return{cancelled:!1}})}emit(t,e){const i=`${this.PREFIX}:${t}`,s=new CustomEvent(i,{detail:e,bubbles:this.options.bubbleEvents});this.element.dispatchEvent(s)}on(t,e){return this.element.addEventListener(t,e),this}once(t,e){return this.element.addEventListener(t,e,{once:!0}),this}off(t,e){return this.element.removeEventListener(t,e),this}}const s={bubbleEvents:!0},n={[t.Idle]:[t.Initialized],[t.Initialized]:[t.Attached],[t.Attached]:[t.Disposed,t.Destroyed],[t.Disposed]:[t.Attached,t.Destroyed],[t.Destroyed]:[]};var o;!function(t){t.DEBUG=\"DEBUG\",t.INFO=\"INFO\",t.WARN=\"WARN\",t.ERROR=\"ERROR\"}(o||(o={}));class r{constructor(t){this.activeListeners=new Map,this.prefix=t}setLevel(t){if(void 0===this.currentLevel)throw new Error(\"Monitor has not been started. Call start() before setting level.\");return this.currentLevel===t||(this.removeAllListeners(),this.currentLevel=t,this.addListenersForLevel(t)),this}getLevel(){return this.currentLevel}start(t=o.ERROR){if(void 0!==this.currentLevel)throw new Error(\"Monitor has already been started. Call stop() before starting again.\");return this.currentLevel=t,this.addListenersForLevel(t),this}stop(){if(void 0===this.currentLevel)throw new Error(\"Monitor has not been started. Call start() before stopping.\");return this.removeAllListeners(),this.currentLevel=void 0,this}removeAllListeners(){for(const[t,e]of this.activeListeners)document.removeEventListener(t,e);this.activeListeners.clear()}addListenersForLevel(t){t===o.DEBUG&&this.setupDebug(),t!==o.DEBUG&&t!==o.INFO||this.setupInfo(),t!==o.DEBUG&&t!==o.INFO&&t!==o.WARN||this.setupWarn(),this.setupError()}on(t,e){const i=`${this.prefix}:${t}`,s=e;return document.addEventListener(i,s),this.activeListeners.set(i,s),this}setupDebug(){this.on(\"initialized\",t=>{console.debug(`[Component] ${this.prefix}:initialized`,t.detail)}).on(\"attached\",t=>{console.debug(`[Component] ${this.prefix}:attached`,t.detail)}).on(\"disposed\",t=>{console.debug(`[Component] ${this.prefix}:disposed`,t.detail)}).on(\"destroyed\",t=>{console.debug(`[Component] ${this.prefix}:destroyed`,t.detail)})}setupInfo(){}setupWarn(){this.on(\"transition-invalid\",t=>{console.warn(`[Component] ${this.prefix}:transition-invalid`,t.detail)}).on(\"transition-cancelled\",t=>{console.warn(`[Component] ${this.prefix}:transition-cancelled`,t.detail)})}setupError(){}}export{i as Component,t as LifecycleState,o as LogLevels,r as Monitor};\n//# sourceMappingURL=index.mjs.map\n","import { sanitize, SanitizeMode } from \"./Tools\";\nimport { Layout, StorageType } from \"./OptionResolver.types\";\nexport class OptionResolver {\n    /**\n     * Resolves the options for the dark mode toggle by merging user-provided options, HTML data attributes, and defaults.\n     * @param element - The base HTML element to parse attributes\n     * @param options - The user provided initialization options\n     * @returns The option to use\n     */\n    static resolve(element, options = {}) {\n        var _a;\n        let state = null;\n        const attrState = element.dataset.state;\n        if (attrState === \"dark\")\n            state = false;\n        if (attrState === \"light\")\n            state = true;\n        return {\n            state: (_a = state !== null && state !== void 0 ? state : options.state) !== null && _a !== void 0 ? _a : this.DEFAULTS.state,\n            root: sanitize(element.dataset.root || options.root || this.DEFAULTS.root, { mode: SanitizeMode.TEXT }),\n            storage: sanitize(element.dataset.storage || options.storage || this.DEFAULTS.storage, { mode: SanitizeMode.TEXT }),\n            lightLabel: sanitize(element.dataset.lightLabel || options.lightLabel || this.DEFAULTS.lightLabel, { mode: SanitizeMode.HTML }),\n            darkLabel: sanitize(element.dataset.darkLabel || options.darkLabel || this.DEFAULTS.darkLabel, { mode: SanitizeMode.HTML }),\n            lightColorMode: sanitize(element.dataset.lightColorMode || options.lightColorMode || this.DEFAULTS.lightColorMode, { mode: SanitizeMode.TEXT }),\n            darkColorMode: sanitize(element.dataset.darkColorMode || options.darkColorMode || this.DEFAULTS.darkColorMode, { mode: SanitizeMode.TEXT }),\n            style: sanitize(element.dataset.style || options.style || this.DEFAULTS.style, { mode: SanitizeMode.TEXT }),\n            layout: sanitize(element.dataset.layout || options.layout || this.DEFAULTS.layout, { mode: SanitizeMode.TEXT }),\n            lightAriaLabel: sanitize(element.dataset.lightAriaLabel || options.lightAriaLabel || this.DEFAULTS.lightAriaLabel, { mode: SanitizeMode.TEXT }),\n            darkAriaLabel: sanitize(element.dataset.darkAriaLabel || options.darkAriaLabel || this.DEFAULTS.darkAriaLabel, { mode: SanitizeMode.TEXT }),\n        };\n    }\n}\nOptionResolver.DEFAULTS = {\n    state: true,\n    root: \":root\",\n    storage: StorageType.NONE,\n    lightLabel: \"<i class=\\\"bs-darkmode-toggle sun\\\"></i>\",\n    darkLabel: \"<i class=\\\"bs-darkmode-toggle moon\\\"></i>\",\n    lightColorMode: \"light\",\n    darkColorMode: \"dark\",\n    style: \"outline-secondary\",\n    layout: Layout.TOGGLE,\n    lightAriaLabel: \"Switch to dark mode\",\n    darkAriaLabel: \"Switch to light mode\",\n};\n","import { ActionType } from \"./StateReducer.types\";\nexport class StateReducer {\n    constructor(initial, lightColorMode, darkColorMode) {\n        this.lightColorMode = lightColorMode;\n        this.darkColorMode = darkColorMode;\n        this.state = { isLight: initial, theme: this.getTheme(initial) };\n    }\n    /**\n     * Apply an action to the current state.\n     * @param action The action to be performed\n     * @returns A boolean indicating whether the action was successful.\n     */\n    do(action, payload) {\n        switch (action) {\n            case ActionType.LIGHT:\n                if (this.state.isLight)\n                    return false;\n                this.state = { isLight: true, theme: this.getTheme(true) };\n                return true;\n            case ActionType.DARK:\n                if (!this.state.isLight)\n                    return false;\n                this.state = { isLight: false, theme: this.getTheme(false) };\n                return true;\n            case ActionType.TOGGLE: {\n                const newIsLight = !this.state.isLight;\n                this.state = { isLight: newIsLight, theme: this.getTheme(newIsLight) };\n                return true;\n            }\n            case ActionType.OVERRIDE: {\n                if (!payload || typeof payload.isLight !== \"boolean\")\n                    return false;\n                const { isLight } = payload;\n                if (this.state.isLight === isLight)\n                    return false;\n                this.state = { isLight: isLight, theme: this.getTheme(isLight) };\n                return true;\n            }\n        }\n    }\n    /**\n     * Returns the theme based on the given isLight state.\n     * If isLight is true, returns lightColorMode, otherwise returns darkColorMode.\n     * @param isLight - Whether the theme should be light or dark.\n     * @returns The theme string.\n     */\n    getTheme(isLight) {\n        return isLight ? this.lightColorMode : this.darkColorMode;\n    }\n    /**\n     * Get the current state.\n     * @returns An immutable copy of the current state.\n     */\n    get() {\n        return Object.freeze(Object.assign({}, this.state));\n    }\n}\n","export class CookieStorage {\n    /**\n     * Retrieves a value from cookie storage.\n     * @param {string} key The key of the record to retrieve.\n     * @returns {string | null} The value associated with the key, or `null` if not found.\n     * @throws {Error} If cookie storage is unavailable or access is denied.\n     */\n    get(key) {\n        try {\n            const regex = new RegExp(\"(^| )\" + key + \"=([^;]+)\");\n            const match = regex.exec(document.cookie);\n            return match ? decodeURIComponent(match[2]) : null;\n        }\n        catch (error) {\n            throw new Error(`CookieStorage error: ${error instanceof Error ? error.message : String(error)}`);\n        }\n    }\n    /**\n     * Sets a value in cookie storage.\n     * @param {string} key The key of the record to set.\n     * @param {string} value The value to set for the record.\n     * @param {number} ttl The time-to-live for the record.\n     * @throws {Error} If cookie storage is unavailable or access is denied.\n     */\n    set(key, value, ttl) {\n        try {\n            let expires = \"\";\n            const date = new Date();\n            date.setTime(date.getTime() + ttl);\n            expires = \"; expires=\" + date.toUTCString();\n            document.cookie = `${key}=${encodeURIComponent(value)}${expires}; path=/`;\n        }\n        catch (error) {\n            throw new Error(`CookieStorage error: ${error instanceof Error ? error.message : String(error)}`);\n        }\n    }\n    /**\n     * Deletes a value from cookie storage.\n     * @param {string} key The key of the record to delete.\n     * @throws {Error} If cookie storage is unavailable or access is denied.\n     */\n    delete(key) {\n        try {\n            document.cookie = `${key}=; Path=/; Expires=Thu, 01 Jan 1970 00:00:00 UTC;`;\n        }\n        catch (error) {\n            throw new Error(`CookieStorage error: ${error instanceof Error ? error.message : String(error)}`);\n        }\n    }\n}\n","export class LocalStorage {\n    /**\n     * Retrieves a value from localStorage.\n     * @param {string} key The key of the record to retrieve from localStorage.\n     * @returns {string | null} The value associated with the key, or `null` if not found or if localStorage is unavailable.\n     * @throws {Error} If localStorage is unavailable or access is denied.\n     */\n    get(key) {\n        var _a;\n        return ((_a = globalThis.localStorage) === null || _a === void 0 ? void 0 : _a.getItem(key)) || null;\n    }\n    /**\n     * Sets a value in localStorage.\n     * @param {string} key The key of the record to set in localStorage.\n     * @param {string} value The value to set for the record.\n     * @param {number} _ttl The time-to-live for the record (not used in this implementation).\n     * @throws {Error} If localStorage is unavailable or access is denied.\n     */\n    set(key, value, _ttl) {\n        var _a;\n        (_a = globalThis.localStorage) === null || _a === void 0 ? void 0 : _a.setItem(key, value);\n    }\n    /**\n     * Deletes a value from localStorage.\n     * @param {string} key The key of the record to delete from localStorage.\n     * @throws {Error} If localStorage is unavailable or access is denied.\n     */\n    delete(key) {\n        var _a;\n        (_a = globalThis.localStorage) === null || _a === void 0 ? void 0 : _a.removeItem(key);\n    }\n}\n","export class NoStorage {\n    get(_key) {\n        return null;\n    }\n    set(_key, _value, _ttl) {\n        // Do nothing\n    }\n    delete(_key) {\n        // Do nothing\n    }\n}\n","import { StorageType } from \"../OptionResolver.types\";\nimport { CookieStorage } from \"./providers/CookieStorage\";\nimport { LocalStorage } from \"./providers/LocalStorage\";\nimport { NoStorage } from \"./providers/NoStorage\";\nexport class StorageManager {\n    constructor(storageType) {\n        this.provider = this.getProvider(storageType);\n    }\n    /**\n     * Get the storage provider base on requested storage type\n     * @param storageType request type of storage\n     * @returns A storage provider according to requested storage type\n     * @throws Error on storage provider initialization failure\n     */\n    getProvider(storageType) {\n        switch (storageType) {\n            case StorageType.COOKIE:\n                return new CookieStorage();\n            case StorageType.LOCAL:\n                return new LocalStorage();\n            case StorageType.NONE:\n            default:\n                return new NoStorage();\n        }\n    }\n    /**\n     * Allows to set up a different storage type\n     * @param storageType\n     * @throws Error on storage provider initialization failure\n     */\n    setStorageType(storageType) {\n        this.provider = this.getProvider(storageType);\n    }\n    /**\n     * Retrieve the current key stored\n     * @returns A string if key is found, `null` otherwise\n     * @throws Error on storage provider failure\n     */\n    get() {\n        return this.provider.get(StorageManager.STORAGE_KEY);\n    }\n    /**\n     * Store the provided value in current storage\n     * @param value - The value to store\n     * @throws Error on storage provider failure\n     */\n    set(value) {\n        this.provider.set(StorageManager.STORAGE_KEY, value, StorageManager.TTL);\n    }\n    /**\n     * Remove stored value\n     * @throws Error on storage provider failure\n     */\n    delete() {\n        this.provider.delete(StorageManager.STORAGE_KEY);\n    }\n}\nStorageManager.STORAGE_KEY = \"bs-darkmode-theme\";\nStorageManager.TTL = 4 * 3600000; // 4 hours in milliseconds\n","export class AbstractLayout {\n    /**\n     * Constructs an instance of AbstractLayout with the given container and options.\n     * @param {HTMLElement} container - The container element where the layout will be applied.\n     * @param {ResolvedOptions} options - The resolved options to apply to the layout.\n     */\n    constructor(container, options) {\n        this.rootSelector = options.root;\n        this.lightLabel = options.lightLabel;\n        this.darkLabel = options.darkLabel;\n        this.style = options.style;\n        this.lightAriaLabel = options.lightAriaLabel;\n        this.darkAriaLabel = options.darkAriaLabel;\n        container.innerHTML = \"\";\n        this.createControl(container);\n    }\n    /**\n     * Gets the root elements in the layout.\n     *\n     * Implementation note: roots are not cached to avoid re-querying the DOM because roots can change (added or removed) during runtime.\n     * @returns {HTMLElement[]} The root elements in the layout.\n     */\n    get roots() {\n        return Array.from(globalThis.document.querySelectorAll(this.rootSelector));\n    }\n    /**\n     * Returns the aria label based on the given dark mode state.\n     * @param {boolean} isLight - The dark mode state.\n     * @returns {string} The aria label.\n     **/\n    getAriaLabel(isLight) {\n        return isLight ? this.lightAriaLabel : this.darkAriaLabel;\n    }\n    /**\n     * Updated DOM to current state.\n     * - Launch the control state update\n     * - Sets the color scheme of all root elements in the layout based on the given current state.\n     * @param {DarkModeState} state - The darkmode current state.\n     */\n    setState(state) {\n        this.updateControlState(state);\n        this.roots.forEach((el) => {\n            el.dataset[AbstractLayout.BS_ATTRIBUTE] = state.theme;\n        });\n    }\n}\nAbstractLayout.BS_ATTRIBUTE = \"bsTheme\";\n","import { AbstractLayout } from \"../AbstractLayout\";\nexport class ButtonLayout extends AbstractLayout {\n    /**\n     * Creates the control element for the layout and appends it to the container.\n     * @implements AbstractLayout\n     * @param {HTMLElement} container - The container element where the layout will be applied.\n     */\n    createControl(container) {\n        this.button.type = \"button\";\n        this.button.className = `btn btn-${this.style}`;\n        this.button.ariaPressed = \"false\";\n        container.appendChild(this.button);\n    }\n    /**\n     * Lazy initialization getter for the button control element.\n     * If the button element is not already created, it will be created using `document.createElement(\"button\")`.\n     * @returns {HTMLButtonElement} the button control element.\n     */\n    get button() {\n        var _a;\n        (_a = this._button) !== null && _a !== void 0 ? _a : (this._button = globalThis.document.createElement(\"button\"));\n        return this._button;\n    }\n    /**\n     * Update the state of the control element based on the given current state.\n     * @implements AbstractLayout\n     * @param {DarkModeState} state - The darkmode current state.\n     */\n    updateControlState({ isLight }) {\n        const label = isLight ? this.lightLabel : this.darkLabel;\n        this.button.innerHTML = label;\n        this.button.ariaLabel = this.getAriaLabel(isLight);\n        if (isLight) {\n            this.button.classList.add(\"active\");\n            this.button.ariaPressed = \"true\";\n        }\n        else {\n            this.button.classList.remove(\"active\");\n            this.button.ariaPressed = \"false\";\n        }\n    }\n    /**\n     * Attach a callback handler for the control element `change event`.\n     * @implements AbstractLayout\n     * @param {(e: Event) => void} handler - The callback handler to blink\n     */\n    onChange(handler) {\n        this.handler = handler;\n        this.button.addEventListener(\"click\", handler);\n    }\n    /**\n     * Destroys the layout.\n     * If a handler is attached, it will be detached first.\n     * Then, the button control element will be removed from the DOM.\n     */\n    destroy() {\n        if (this.handler)\n            this.button.removeEventListener(\"click\", this.handler);\n        this.handler = undefined;\n        this.button.remove();\n    }\n}\n","import { Methods } from \"bootstrap5-toggle\";\nimport { AbstractLayout } from \"../AbstractLayout\";\nexport class ToggleLayout extends AbstractLayout {\n    /**\n     * Create a Bootstrap Toggle control in the given container.\n     * @implements AbstractLayout\n     * @param container the container for the control\n     */\n    createControl(container) {\n        this.input.type = \"checkbox\";\n        container.appendChild(this.input);\n        this.input.bootstrapToggle({\n            onlabel: this.lightLabel,\n            offlabel: this.darkLabel,\n            onstyle: this.style,\n            offstyle: this.style,\n        });\n    }\n    /**\n     * Lazy initialization getter for the input control element.\n     * If the input element is not already created, it will be created using `document.createElement(\"input\")`.\n     * @returns {BootstrapToggleElement} the button control element.\n     */\n    get input() {\n        var _a;\n        (_a = this._input) !== null && _a !== void 0 ? _a : (this._input = globalThis.document.createElement(\"input\"));\n        return this._input;\n    }\n    /**\n     * Update the state of the control element based on the given current state.\n     *\n     * Implementation note: for performance reasons, rerender is only called if the ariaLabel has changed.\n     * @implements AbstractLayout\n     * @param {DarkModeState} state - The darkmode current state.\n     */\n    updateControlState({ isLight }) {\n        const newAriaLabel = this.getAriaLabel(isLight);\n        if (newAriaLabel !== this.input.ariaLabel) {\n            this.input.ariaLabel = newAriaLabel;\n            this.input.bootstrapToggle(Methods.RERENDER);\n        }\n        this.input.bootstrapToggle(isLight ? Methods.ON : Methods.OFF, true);\n    }\n    /**\n     * Attach a callback handler for the control element `change event`.\n     * @implements AbstractLayout\n     * @param {(e: Event) => void} handler - The callback handler to blink\n     */\n    onChange(handler) {\n        this.handler = handler;\n        this.input.addEventListener(\"change\", handler);\n    }\n    /**\n     * Destroys the layout and removes any event listeners attached to the control element.\n     */\n    destroy() {\n        if (this.handler)\n            this.input.removeEventListener(\"change\", this.handler);\n        this.handler = undefined;\n        this.input.bootstrapToggle(Methods.DESTROY);\n        this.input.remove();\n    }\n}\n","import { Layout } from \"../OptionResolver.types\";\nimport { ButtonLayout } from \"./layouts/ButtonLayout\";\nimport { ToggleLayout } from \"./layouts/ToggleLayout\";\n/**\n * The DOMManager class is responsible for updating the DOM to reflect the current state of the control.\n * It delegates the task to the layout implementation being a facade.\n */\nexport class DomManager {\n    /**\n     * Constructs an instance of DOMManager with the given container, options, and onChange handler.\n     * @param {HTMLElement} container - The container element where the layout will be applied.\n     * @param {ResolvedOptions} options - The resolved options to apply to the layout.\n     * @param {(e: Event) => void} onChange - The callback handler for the control element `change event`.\n     */\n    constructor(container, options, onChange) {\n        switch (options.layout) {\n            case Layout.TOGGLE:\n                this.layout = new ToggleLayout(container, options);\n                break;\n            case Layout.BUTTON:\n                this.layout = new ButtonLayout(container, options);\n                break;\n            default:\n                this.layout = new ToggleLayout(container, options);\n                break;\n        }\n        this.layout.onChange(onChange);\n    }\n    /**\n     * Updated DOM to current state by delegating to the layout.\n     * @param {DarkModeState} state - The darkmode current state.\n     */\n    setState(state) {\n        this.layout.setState(state);\n    }\n    /**\n     * Returns the root elements by delegating to the layout.\n     * @returns {HTMLElement[]} The root elements.\n     */\n    get roots() {\n        return this.layout.roots;\n    }\n    /**\n     * Destroys the layout by delegating to the layout implementation.\n     * This method should be called when the DomManager is no longer needed.\n     */\n    destroy() {\n        this.layout.destroy();\n    }\n}\n","import { LegacyEventTypes, PrefixedCustomEventTypes } from \"./Events.types\";\nexport class EventFactory {\n    /**\n     * Creates the event detail payload for dark mode toggle events.\n     * @static\n     * @param state The current dark mode state.\n     * @param element The source element of the event.\n     * @param roots The root elements affected by the theme change.\n     * @returns The event detail object containing the current state and relevant elements.\n     */\n    static createEventDetail(state, element, roots) {\n        return {\n            isLight: state.isLight,\n            theme: state.theme,\n            source: element,\n            roots: roots,\n        };\n    }\n    /**\n     * Creates a prefixed custom event for dark mode changes.\n     * @static\n     * @param state The current dark mode state.\n     * @param element The source element of the event.\n     * @param roots The root elements affected by the theme change.\n     * @returns A CustomEvent with the appropriate type and detail for dark mode changes.\n     */\n    static createPrefixedEvent(state, element, roots) {\n        return new CustomEvent(PrefixedCustomEventTypes.CHANGE, {\n            detail: this.createEventDetail(state, element, roots),\n            bubbles: true\n        });\n    }\n    /**\n     * Creates a legacy custom event for dark mode changes.\n     * @static\n     * @returns A Event with the legacy type for dark mode changes.\n     */\n    static createLegacyEvent() {\n        return new Event(LegacyEventTypes.CHANGE, { bubbles: true });\n    }\n}\n","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nimport { OptionResolver } from \"./core/OptionResolver\";\nimport { StateReducer } from \"./core/StateReducer\";\nimport { StorageManager } from \"./core/storage/StorageManager\";\nimport { DomManager } from \"./core/dom/DomManager\";\nimport { ActionType } from \"./core/StateReducer.types\";\nimport { ColorModes } from \"./types/ColorModes\";\nimport { EventFactory } from \"./core/events/EventFactory\";\nimport { CustomEventTypes, PrefixedCustomEventTypes } from \"./core/events/Events.types\";\nimport { Component } from \"component-lifecycle\";\nexport class DarkModeToggle extends Component {\n    constructor(element, opts = {}) {\n        super(element);\n        this.PREFIX = \"darkmode\";\n        /**\n         * Handles an external theme change event by updating the state and the DOM\n         * if the root elements of the event and the component share roots.\n         *\n         * Implementation note: for performance reasons, DOM is only updated when the state is updated.\n         * @private\n         * @param e - The external theme change event\n         */\n        this.handleExternalThemeChange = (e) => {\n            var _a, _b;\n            const detail = e === null || e === void 0 ? void 0 : e.detail;\n            if (!detail || typeof detail.isLight !== \"boolean\" || !Array.isArray(detail.roots)) {\n                return;\n            }\n            const { isLight, roots: eventRoots } = detail;\n            const thisRoots = (_a = this.dom) === null || _a === void 0 ? void 0 : _a.roots;\n            const allRootsAffected = thisRoots === null || thisRoots === void 0 ? void 0 : thisRoots.every(root => eventRoots.includes(root));\n            if (allRootsAffected && this.toggleState.do(ActionType.OVERRIDE, { isLight })) {\n                (_b = this.dom) === null || _b === void 0 ? void 0 : _b.setState(this.toggleState.get());\n            }\n        };\n        this.toggleOptions = OptionResolver.resolve(element, opts);\n        this.toggleState = new StateReducer(this.toggleOptions.state, this.toggleOptions.lightColorMode, this.toggleOptions.darkColorMode);\n    }\n    /**\n     * Factory method to create an instance of DarkModeToggle.\n     * @param element the root element for the dark mode toggle component. The component will look for configuration options in this element's attributes.\n     * @param opts the user provided options to configure the dark mode toggle instance. These options will override any configuration found in the element's attributes.\n     * @returns A promise that resolves to the created and initialized DarkModeToggle instance\n     */\n    static create(element_1) {\n        return __awaiter(this, arguments, void 0, function* (element, opts = {}) {\n            const instance = new DarkModeToggle(element, opts);\n            yield instance.init();\n            yield instance.attach();\n            return instance;\n        });\n    }\n    doInit() {\n        return __awaiter(this, void 0, void 0, function* () {\n            try {\n                this.storage = new StorageManager(this.toggleOptions.storage);\n                this.applyPreferredScheme();\n            }\n            catch (error) {\n                this.storage = undefined;\n                return { cancelled: true, reason: `Storage error: ${error instanceof Error ? error.message : String(error)}` };\n            }\n            return { cancelled: false };\n        });\n    }\n    doAttach() {\n        return __awaiter(this, void 0, void 0, function* () {\n            const dom = new DomManager(this.element, this.toggleOptions, (e) => {\n                this.toggle();\n                e.preventDefault();\n            });\n            this.dom = dom;\n            this.element._bsDarkmodeToggle = this;\n            this.setupCrossInstanceSync();\n            this.syncState();\n            return { cancelled: false };\n        });\n    }\n    doDispose() {\n        return __awaiter(this, void 0, void 0, function* () {\n            globalThis.document.removeEventListener(PrefixedCustomEventTypes.CHANGE, this.handleExternalThemeChange);\n            return { cancelled: false };\n        });\n    }\n    doDestroy() {\n        return __awaiter(this, void 0, void 0, function* () {\n            var _a;\n            if (this.isAttached())\n                yield this.dispose();\n            (_a = this.dom) === null || _a === void 0 ? void 0 : _a.destroy();\n            delete this.element._bsDarkmodeToggle;\n            return { cancelled: false };\n        });\n    }\n    /**\n     * Sets up an event listener to handle external theme change events.\n     * When an external theme change event is triggered, this method updates the control state.\n     * @private\n     */\n    setupCrossInstanceSync() {\n        globalThis.document.addEventListener(PrefixedCustomEventTypes.CHANGE, this.handleExternalThemeChange);\n    }\n    /**\n     * Syncs the state of the dark mode toggle by updating the DOM and persisting the current theme to storage.\n     * @private\n     */\n    syncState() {\n        var _a;\n        (_a = this.dom) === null || _a === void 0 ? void 0 : _a.setState(this.toggleState.get());\n        this.persistTheme();\n    }\n    toggle(silent = false) {\n        this.ensureNotDestroyed();\n        if (!this.toggleState.do(ActionType.TOGGLE))\n            return;\n        this.syncState();\n        this.trigger(silent);\n    }\n    light(silent = false) {\n        this.ensureNotDestroyed();\n        if (!this.toggleState.do(ActionType.LIGHT))\n            return;\n        this.syncState();\n        this.trigger(silent);\n    }\n    dark(silent = false) {\n        this.ensureNotDestroyed();\n        if (!this.toggleState.do(ActionType.DARK))\n            return;\n        this.syncState();\n        this.trigger(silent);\n    }\n    setStorageType(type) {\n        var _a;\n        this.ensureNotDestroyed();\n        (_a = this.storage) === null || _a === void 0 ? void 0 : _a.setStorageType(type);\n        this.persistTheme();\n    }\n    /**\n     * Triggers the events if silent is false.\n     * The events are triggered with the current state of the dark mode toggle.\n     * Emits the typed event via Component.emit and dispatches the legacy event manually.\n     * @private\n     * @param {boolean} silent - Whether to trigger the event.\n     */\n    trigger(silent) {\n        var _a;\n        if (silent)\n            return;\n        const legacyEvent = EventFactory.createLegacyEvent();\n        this.element.dispatchEvent(legacyEvent);\n        const roots = ((_a = this.dom) === null || _a === void 0 ? void 0 : _a.roots) || [];\n        const currentState = this.toggleState.get();\n        const eventDetail = EventFactory.createEventDetail(currentState, this.element, roots);\n        this.emit(CustomEventTypes.CHANGE, eventDetail);\n        roots.forEach((root) => {\n            root.dispatchEvent(EventFactory.createPrefixedEvent(currentState, this.element, roots));\n        });\n    }\n    /**\n     * Persist the current theme to the storage.\n     * @private\n     */\n    persistTheme() {\n        var _a;\n        (_a = this.storage) === null || _a === void 0 ? void 0 : _a.set(this.toggleState.get().theme);\n    }\n    /**\n     * Applies the preferred color scheme based on cookies or system preference\n     * @returns a boolean indicating whether a preference was applied (true) or not (false)\n     * @throws Error on storage provider failure\n     */\n    applyPreferredScheme() {\n        return this.applyStoredPreference() || this.applySystemPreference();\n    }\n    /**\n     * Applies the color scheme based on stored preference if available\n     * @returns a boolean indicating whether a preference was applied (true) or not (false)\n     * @throws Error on storage provider failure\n     */\n    applyStoredPreference() {\n        var _a;\n        const value = (_a = this.storage) === null || _a === void 0 ? void 0 : _a.get();\n        if (value === this.toggleOptions.darkColorMode) {\n            this.toggleState.do(ActionType.DARK);\n            return true;\n        }\n        if (value === this.toggleOptions.lightColorMode) {\n            this.toggleState.do(ActionType.LIGHT);\n            return true;\n        }\n        return false;\n    }\n    /**\n     * Applies the color scheme based on system preferences if available\n     * @returns a boolean indicating whether a preference was applied (true) or not (false)\n     */\n    applySystemPreference() {\n        const systemPreference = this.getSystemPreference();\n        if (systemPreference === ColorModes.DARK) {\n            this.toggleState.do(ActionType.DARK);\n            return true;\n        }\n        if (systemPreference === ColorModes.LIGHT) {\n            this.toggleState.do(ActionType.LIGHT);\n            return true;\n        }\n        return false;\n    }\n    /**\n     * Gets the system color scheme preference if available\n     * @returns color scheme preference as `ColorModes`\n     */\n    getSystemPreference() {\n        var _a, _b;\n        try {\n            const darkModeQuery = (_a = globalThis.window) === null || _a === void 0 ? void 0 : _a.matchMedia(\"(prefers-color-scheme: dark)\");\n            const lightModeQuery = (_b = globalThis.window) === null || _b === void 0 ? void 0 : _b.matchMedia(\"(prefers-color-scheme: light)\");\n            if (darkModeQuery === null || darkModeQuery === void 0 ? void 0 : darkModeQuery.matches) {\n                return ColorModes.DARK;\n            }\n            if (lightModeQuery === null || lightModeQuery === void 0 ? void 0 : lightModeQuery.matches) {\n                return ColorModes.LIGHT;\n            }\n            return ColorModes.NONE;\n        }\n        catch (error) {\n            console.warn(\"Unable to detect system color scheme preference:\", error);\n            return ColorModes.NONE;\n        }\n    }\n    /**\n     * Checks if the bs-darkmode-toggle instance has been destroyed.\n     * If it has, throws an error indicating that the instance is no longer usable.\n     * This is a safety measure to prevent accessing methods of a destroyed instance.\n     * @throws {Error} If the instance has been destroyed.\n     */\n    ensureNotDestroyed() {\n        if (this.isDestroyed())\n            throw new Error(\"Accessing to a method of a destroyed bs-darkmode-toggle instance.\");\n    }\n}\n","export var Methods;\n(function (Methods) {\n    Methods[\"LIGHT\"] = \"LIGHT\";\n    Methods[\"DARK\"] = \"DARK\";\n    Methods[\"TOGGLE\"] = \"TOGGLE\";\n    Methods[\"SET_STORAGE\"] = \"SET_STORAGE\";\n    Methods[\"DESTROY\"] = \"DESTROY\";\n})(Methods || (Methods = {}));\n","import { Monitor } from \"component-lifecycle\";\nimport { CustomEventTypes } from \"../core/events/Events.types\";\n/**\n * Custom monitor for darkmode component that logs custom events.\n *\n * Extends the base Monitor to add logging for darkmode:change events at DEBUG level.\n * All other log levels (DEBUG, WARN, ERROR) are handled by the base implementation.\n *\n * @example\n * ```typescript\n * // Start monitoring with INFO level\n * window.Darkmode.MONITOR.start('INFO');\n *\n * // Enable full debugging (lifecycle + custom events)\n * window.Darkmode.MONITOR.start('DEBUG');\n *\n * // Stop monitoring\n * window.Darkmode.MONITOR.stop();\n * ```\n */\nexport class DarkModeMonitor extends Monitor {\n    constructor() {\n        super(\"darkmode\");\n    }\n    /**\n     * Gets the singleton instance of DarkModeMonitor.\n     * @returns The DarkModeMonitor instance.\n     */\n    static getInstance() {\n        if (!DarkModeMonitor.instance) {\n            DarkModeMonitor.instance = new DarkModeMonitor();\n        }\n        return DarkModeMonitor.instance;\n    }\n    /**\n     * Sets up DEBUG level logging.\n     *\n     * Extends base DEBUG behavior by adding logging for darkmode:change events.\n     * Preserves all base functionality by calling super.setupDebug() first.\n     */\n    setupDebug() {\n        super.setupDebug();\n        this.on(CustomEventTypes.CHANGE, (event) => {\n            const detail = event.detail;\n            if (detail) {\n                console.debug(`[darkmode] Theme changed: ${detail.isLight ? \"light\" : \"dark\"} (theme: ${detail.theme})`, { source: detail.source, roots: detail.roots });\n            }\n            else {\n                console.debug(\"[darkmode] Theme changed (no detail available)\");\n            }\n        });\n    }\n}\n"],"names":["SanitizeMode","StorageType","Layout","ActionType","ColorModes","CustomEventTypes","PrefixedCustomEventTypes","LegacyEventTypes","t","sanitize","text","opts","mode","HTML","html","config","allowedTags","allowedAttributes","doc","DOMParser","parseFromString","Array","from","body","childNodes","forEach","node","sanitizeNodeRecursive","_a","nodeType","Node","ELEMENT_NODE","element","tagName","toLowerCase","includes","fragment","document","createDocumentFragment","child","appendChild","cloneNode","parentNode","replaceChild","attributes","attr","attrName","name","some","allowed","endsWith","startsWith","slice","value","removeAttribute","sanitizeAllowedAttr","TEXT_NODE","sanitizeNode","innerHTML","sanitizeHTML","TEXT","map","replace","m","sanitizeText","OptionResolver","resolve","options","state","attrState","dataset","this","DEFAULTS","root","storage","lightLabel","darkLabel","lightColorMode","darkColorMode","style","layout","lightAriaLabel","darkAriaLabel","NONE","TOGGLE","StateReducer","constructor","initial","isLight","theme","getTheme","action","payload","LIGHT","DARK","newIsLight","OVERRIDE","get","Object","freeze","assign","CookieStorage","key","match","RegExp","exec","cookie","decodeURIComponent","error","Error","message","String","set","ttl","expires","date","Date","setTime","getTime","toUTCString","encodeURIComponent","LocalStorage","globalThis","localStorage","getItem","_ttl","setItem","removeItem","NoStorage","_key","_value","StorageManager","storageType","provider","getProvider","COOKIE","LOCAL","setStorageType","STORAGE_KEY","TTL","delete","AbstractLayout","container","rootSelector","createControl","roots","querySelectorAll","getAriaLabel","setState","updateControlState","el","BS_ATTRIBUTE","ButtonLayout","button","type","className","ariaPressed","_button","createElement","label","ariaLabel","classList","add","remove","onChange","handler","addEventListener","destroy","removeEventListener","undefined","ToggleLayout","input","bootstrapToggle","onlabel","offlabel","onstyle","offstyle","_input","newAriaLabel","Methods","RERENDER","ON","OFF","DESTROY","DomManager","BUTTON","EventFactory","createEventDetail","source","createPrefixedEvent","CustomEvent","CHANGE","detail","bubbles","createLegacyEvent","Event","Idle","Initialized","Attached","Disposed","Destroyed","e","i","s","Promise","n","o","r","a","next","d","throw","done","then","apply","_state","getDefaultOptions","isIdle","is","isInitialized","isAttached","isDisposed","isDestroyed","canTransition","transitionTo","executeTransition","doInit","doAttach","doDispose","doDestroy","emit","component","to","cancelled","reason","init","attach","dispose","PREFIX","bubbleEvents","dispatchEvent","on","once","off","DEBUG","INFO","WARN","ERROR","activeListeners","Map","prefix","setLevel","currentLevel","removeAllListeners","addListenersForLevel","getLevel","start","stop","clear","setupDebug","setupInfo","setupWarn","setupError","console","debug","warn","__awaiter","thisArg","_arguments","P","generator","reject","fulfilled","step","rejected","result","DarkModeToggle","Component","super","handleExternalThemeChange","_b","isArray","eventRoots","thisRoots","dom","every","toggleState","do","toggleOptions","create","element_1","arguments","instance","applyPreferredScheme","toggle","preventDefault","_bsDarkmodeToggle","setupCrossInstanceSync","syncState","persistTheme","silent","ensureNotDestroyed","trigger","light","dark","legacyEvent","currentState","eventDetail","applyStoredPreference","applySystemPreference","systemPreference","getSystemPreference","darkModeQuery","window","matchMedia","lightModeQuery","matches","DarkModeMonitor","Monitor","getInstance","event"],"mappings":";;;;;;;;;;4CAAO,IAAIA,ECAAC,EAMAC,ECNAC,ECAAC,ECAAC,EAIAC,EAKAC,ECAPC,ELMG,SAASC,EAASC,EAAMC,GAC3B,IAAKD,EACD,OAAOA,EACX,OAAQC,EAAKC,MACT,KAAKZ,EAAaa,KACd,OA8BZ,SAAsBC,GAClB,MAAMC,EAAS,CACXC,YAAa,CAAC,IAAK,IAAK,SAAU,KAAM,OAAQ,QAAS,MAAO,MAAO,OACvEC,kBAAmB,CAAC,QAAS,QAAS,MAAO,MAAO,QAAS,WAI3DC,GADS,IAAIC,WACAC,gBAAgBN,EAAM,aAIzC,OAFqBO,MAAMC,KAAKJ,EAAIK,KAAKC,YAC5BC,QAASC,GAc1B,SAAsBA,EAAMX,GACxB,MAAMY,EAAyBD,IAC3B,IAAIE,EACJ,GAAIF,EAAKG,WAAaC,KAAKC,aAAc,CACrC,MAAMC,EAAUN,EACVO,EAAUD,EAAQC,QAAQC,cAEhC,IAAKnB,EAAOC,YAAYmB,SAASF,GAAU,CAEvC,MAAMG,EAAWC,SAASC,yBAK1B,OAJAjB,MAAMC,KAAKU,EAAQR,YAAYC,QAAQc,IACnCH,EAASI,YAAYD,EAAME,WAAU,WAEX,QAA7Bb,EAAKI,EAAQU,sBAAwBd,GAAyBA,EAAGe,aAAaP,EAAUJ,GAE7F,CAEAX,MAAMC,KAAKU,EAAQY,YAAYnB,QAAQoB,IACnC,MAAMC,EAAWD,EAAKE,KAAKb,cACTnB,EAAOE,kBAAkB+B,KAAKC,GAAWA,EAAQC,SAAS,KAAOJ,EAASK,WAAWF,EAAQG,MAAM,GAAG,IAAON,IAAaG,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