@public-ui/components 2.0.4-rc.0 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +1 -1
- package/dist/cjs/{app-globals-89c51fdc.js → app-globals-e9fc6d21.js} +1 -1
- package/dist/cjs/{app-globals-89c51fdc.js.map → app-globals-e9fc6d21.js.map} +1 -1
- package/dist/cjs/{controller-a8d3a10e.js → controller-bb17ecb2.js} +1 -1
- package/dist/cjs/{controller-a8d3a10e.js.map → controller-bb17ecb2.js.map} +1 -1
- package/dist/cjs/{dev.utils-1c97740c.js → dev.utils-a62aae5d.js} +1 -1
- package/dist/cjs/{dev.utils-1c97740c.js.map → dev.utils-a62aae5d.js.map} +1 -1
- package/dist/cjs/{devtools-d6fd8409.js → devtools-bc91efcc.js} +1 -1
- package/dist/cjs/{devtools-d6fd8409.js.map → devtools-bc91efcc.js.map} +1 -1
- package/dist/cjs/{i18n-4dc5dcfa.js → i18n-9ed77419.js} +1 -1
- package/dist/cjs/{i18n-4dc5dcfa.js.map → i18n-9ed77419.js.map} +1 -1
- package/dist/cjs/{index-a28d0d64.js → index-bc8c7a6b.js} +1 -1
- package/dist/cjs/{index-a28d0d64.js.map → index-bc8c7a6b.js.map} +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/kol-abbr.cjs.entry.js +1 -1
- package/dist/cjs/kol-accordion.cjs.entry.js +1 -1
- package/dist/cjs/kol-alert-wc_3.cjs.entry.js +1 -1
- package/dist/cjs/kol-avatar-wc.cjs.entry.js +1 -1
- package/dist/cjs/kol-badge.cjs.entry.js +1 -1
- package/dist/cjs/kol-card.cjs.entry.js +1 -1
- package/dist/cjs/kol-form.cjs.entry.js +1 -1
- package/dist/cjs/kol-input-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/kol-input-color.cjs.entry.js +1 -1
- package/dist/cjs/kol-input-date.cjs.entry.js +1 -1
- package/dist/cjs/kol-input-email.cjs.entry.js +1 -1
- package/dist/cjs/kol-input-file.cjs.entry.js +1 -1
- package/dist/cjs/kol-input-number.cjs.entry.js +1 -1
- package/dist/cjs/kol-input-password.cjs.entry.js +1 -1
- package/dist/cjs/kol-input-radio.cjs.entry.js +1 -1
- package/dist/cjs/kol-input-range.cjs.entry.js +1 -1
- package/dist/cjs/kol-input-text.cjs.entry.js +1 -1
- package/dist/cjs/kol-input.cjs.entry.js +1 -1
- package/dist/cjs/kol-kolibri.cjs.entry.js +1 -1
- package/dist/cjs/kol-link-wc.cjs.entry.js +1 -1
- package/dist/cjs/kol-logo.cjs.entry.js +1 -1
- package/dist/cjs/kol-modal.cjs.entry.js +1 -1
- package/dist/cjs/kol-nav.cjs.entry.js +1 -1
- package/dist/cjs/kol-pagination.cjs.entry.js +1 -1
- package/dist/cjs/kol-select.cjs.entry.js +1 -1
- package/dist/cjs/kol-spin.cjs.entry.js +1 -1
- package/dist/cjs/kol-symbol.cjs.entry.js +1 -1
- package/dist/cjs/kol-table.cjs.entry.js +1 -1
- package/dist/cjs/kol-tabs.cjs.entry.js +1 -1
- package/dist/cjs/kol-textarea.cjs.entry.js +1 -1
- package/dist/cjs/kol-toast-container.cjs.entry.js +1 -1
- package/dist/cjs/kol-version.cjs.entry.js +1 -1
- package/dist/cjs/kolibri.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/components/dev.utils.js +1 -1
- package/dist/components/dev.utils.js.map +1 -1
- package/dist/esm/{app-globals-922be9d8.js → app-globals-28862c38.js} +1 -1
- package/dist/esm/{app-globals-922be9d8.js.map → app-globals-28862c38.js.map} +1 -1
- package/dist/esm/{controller-433f1c31.js → controller-90bf3a75.js} +1 -1
- package/dist/esm/{controller-433f1c31.js.map → controller-90bf3a75.js.map} +1 -1
- package/dist/esm/{dev.utils-d2e25c84.js → dev.utils-69ed2492.js} +1 -1
- package/dist/esm/{dev.utils-d2e25c84.js.map → dev.utils-69ed2492.js.map} +1 -1
- package/dist/esm/{devtools-e9d54bcb.js → devtools-29c45907.js} +1 -1
- package/dist/esm/{devtools-e9d54bcb.js.map → devtools-29c45907.js.map} +1 -1
- package/dist/esm/{i18n-346a0ba2.js → i18n-6e523906.js} +1 -1
- package/dist/esm/{i18n-346a0ba2.js.map → i18n-6e523906.js.map} +1 -1
- package/dist/esm/{index-88a06abd.js → index-7c986198.js} +1 -1
- package/dist/esm/{index-88a06abd.js.map → index-7c986198.js.map} +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/kol-abbr.entry.js +1 -1
- package/dist/esm/kol-accordion.entry.js +1 -1
- package/dist/esm/kol-alert-wc_3.entry.js +1 -1
- package/dist/esm/kol-avatar-wc.entry.js +1 -1
- package/dist/esm/kol-badge.entry.js +1 -1
- package/dist/esm/kol-card.entry.js +1 -1
- package/dist/esm/kol-form.entry.js +1 -1
- package/dist/esm/kol-input-checkbox.entry.js +1 -1
- package/dist/esm/kol-input-color.entry.js +1 -1
- package/dist/esm/kol-input-date.entry.js +1 -1
- package/dist/esm/kol-input-email.entry.js +1 -1
- package/dist/esm/kol-input-file.entry.js +1 -1
- package/dist/esm/kol-input-number.entry.js +1 -1
- package/dist/esm/kol-input-password.entry.js +1 -1
- package/dist/esm/kol-input-radio.entry.js +1 -1
- package/dist/esm/kol-input-range.entry.js +1 -1
- package/dist/esm/kol-input-text.entry.js +1 -1
- package/dist/esm/kol-input.entry.js +1 -1
- package/dist/esm/kol-kolibri.entry.js +1 -1
- package/dist/esm/kol-link-wc.entry.js +1 -1
- package/dist/esm/kol-logo.entry.js +1 -1
- package/dist/esm/kol-modal.entry.js +1 -1
- package/dist/esm/kol-nav.entry.js +1 -1
- package/dist/esm/kol-pagination.entry.js +1 -1
- package/dist/esm/kol-select.entry.js +1 -1
- package/dist/esm/kol-spin.entry.js +1 -1
- package/dist/esm/kol-symbol.entry.js +1 -1
- package/dist/esm/kol-table.entry.js +1 -1
- package/dist/esm/kol-tabs.entry.js +1 -1
- package/dist/esm/kol-textarea.entry.js +1 -1
- package/dist/esm/kol-toast-container.entry.js +1 -1
- package/dist/esm/kol-version.entry.js +1 -1
- package/dist/esm/kolibri.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/kolibri/app-globals-28862c38.js +4 -0
- package/dist/kolibri/{controller-433f1c31.js → controller-90bf3a75.js} +1 -1
- package/dist/kolibri/{dev.utils-d2e25c84.js → dev.utils-69ed2492.js} +1 -1
- package/dist/kolibri/{dev.utils-d2e25c84.js.map → dev.utils-69ed2492.js.map} +1 -1
- package/dist/kolibri/{devtools-e9d54bcb.js → devtools-29c45907.js} +1 -1
- package/dist/kolibri/{i18n-346a0ba2.js → i18n-6e523906.js} +1 -1
- package/dist/kolibri/{index-88a06abd.js → index-7c986198.js} +1 -1
- package/dist/kolibri/index.esm.js +1 -1
- package/dist/kolibri/kol-abbr.entry.js +1 -1
- package/dist/kolibri/kol-accordion.entry.js +1 -1
- package/dist/kolibri/kol-alert-wc_3.entry.js +1 -1
- package/dist/kolibri/kol-avatar-wc.entry.js +1 -1
- package/dist/kolibri/kol-badge.entry.js +1 -1
- package/dist/kolibri/kol-card.entry.js +1 -1
- package/dist/kolibri/kol-form.entry.js +1 -1
- package/dist/kolibri/kol-input-checkbox.entry.js +1 -1
- package/dist/kolibri/kol-input-color.entry.js +1 -1
- package/dist/kolibri/kol-input-date.entry.js +1 -1
- package/dist/kolibri/kol-input-email.entry.js +1 -1
- package/dist/kolibri/kol-input-file.entry.js +1 -1
- package/dist/kolibri/kol-input-number.entry.js +1 -1
- package/dist/kolibri/kol-input-password.entry.js +1 -1
- package/dist/kolibri/kol-input-radio.entry.js +1 -1
- package/dist/kolibri/kol-input-range.entry.js +1 -1
- package/dist/kolibri/kol-input-text.entry.js +1 -1
- package/dist/kolibri/kol-input.entry.js +1 -1
- package/dist/kolibri/kol-kolibri.entry.js +1 -1
- package/dist/kolibri/kol-link-wc.entry.js +1 -1
- package/dist/kolibri/kol-logo.entry.js +1 -1
- package/dist/kolibri/kol-modal.entry.js +1 -1
- package/dist/kolibri/kol-nav.entry.js +1 -1
- package/dist/kolibri/kol-pagination.entry.js +1 -1
- package/dist/kolibri/kol-select.entry.js +1 -1
- package/dist/kolibri/kol-spin.entry.js +1 -1
- package/dist/kolibri/kol-symbol.entry.js +1 -1
- package/dist/kolibri/kol-table.entry.js +1 -1
- package/dist/kolibri/kol-tabs.entry.js +1 -1
- package/dist/kolibri/kol-textarea.entry.js +1 -1
- package/dist/kolibri/kol-toast-container.entry.js +1 -1
- package/dist/kolibri/kol-toast-container.entry.js.map +1 -1
- package/dist/kolibri/kol-version.entry.js +1 -1
- package/dist/kolibri/kolibri.esm.js +1 -1
- package/package.json +1 -1
- package/dist/kolibri/app-globals-922be9d8.js +0 -4
- /package/dist/kolibri/{app-globals-922be9d8.js.map → app-globals-28862c38.js.map} +0 -0
- /package/dist/kolibri/{controller-433f1c31.js.map → controller-90bf3a75.js.map} +0 -0
- /package/dist/kolibri/{devtools-e9d54bcb.js.map → devtools-29c45907.js.map} +0 -0
- /package/dist/kolibri/{i18n-346a0ba2.js.map → i18n-6e523906.js.map} +0 -0
- /package/dist/kolibri/{index-88a06abd.js.map → index-7c986198.js.map} +0 -0
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["ModalService","constructor","this","lockedElements","Map","modalStack","lockElement","htmlElement","tabIndex","getAttribute","HTMLAnchorElement","HTMLButtonElement","HTMLInputElement","HTMLSelectElement","HTMLTextAreaElement","dataset","kolModal","undefined","set","setAttribute","style","userSelect","unlockElement","value","removeAttribute","delete","unlockLockedElements","forEach","bind","lockFocus","hostElement","excludeElement","HTMLElement","ShadowRoot","shadowRoot","i","children","length","error","renderModalIfExists","activeElement","has","get","timeout","setTimeout","clearTimeout","focus","size","modalKeys","Array","from","keys","modalRef","_value","display","getDocument","body","maxHeight","overflow","openModal","Log","warn","closeModal","_a","WINDOW","DOCUMENT","configKoliBri","window","Window","document","Document","console","getWindow","META_CONFIG","DEV_MODE","EXPERIMENTAL_MODE","COLOR_CONTRAST_ANALYSIS","getDevMode","getExperimentalMode","getColorContrastAnalysis","mapToArray","msg","isArray","handleClassifier","classifier","shield","label","getShield","options","overwriteStyle","debug","forceLog","info","trace","Error","initMeta","meta","querySelector","hasAttribute","includes","getKoliBri","kolibri","KoliBri","Object","defineProperty","writable","initKoliBri","Modal","renderDevAdvice","adviceShown","nonce","Math","floor","random","toString","processEnv"],"sources":["src/components/modal/service.ts","src/utils/dev.utils.ts"],"sourcesContent":["import { getDocument, Log } from '../../utils/dev.utils';\n\ntype ModalContext = {\n\tactiveElement?: HTMLElement;\n};\n\ntype LockedElementContext = {\n\ttabIndex?: string;\n};\n\n/**\n * The modal service is only working client-side!\n */\nexport class ModalService {\n\tprivate lockedElements: Map<HTMLElement, LockedElementContext> = new Map();\n\tprivate modalStack: Map<HTMLElement, ModalContext> = new Map();\n\n\tprivate lockElement(htmlElement: HTMLElement) {\n\t\tconst tabIndex: string | null = htmlElement.getAttribute('tabindex');\n\t\tif (\n\t\t\thtmlElement instanceof HTMLAnchorElement ||\n\t\t\thtmlElement instanceof HTMLButtonElement ||\n\t\t\thtmlElement instanceof HTMLInputElement ||\n\t\t\thtmlElement instanceof HTMLSelectElement ||\n\t\t\thtmlElement instanceof HTMLTextAreaElement ||\n\t\t\ttypeof tabIndex === 'string' ||\n\t\t\thtmlElement.dataset.kolModal !== undefined\n\t\t) {\n\t\t\tif (typeof tabIndex === 'string') {\n\t\t\t\tthis.lockedElements.set(htmlElement, {\n\t\t\t\t\ttabIndex,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tthis.lockedElements.set(htmlElement, {});\n\t\t\t}\n\t\t\thtmlElement.setAttribute('tabindex', '-1');\n\t\t\thtmlElement.setAttribute('aria-hidden', 'true');\n\t\t\thtmlElement.style.userSelect = 'none';\n\t\t}\n\t}\n\n\tprivate unlockElement(value: LockedElementContext, htmlElement: HTMLElement) {\n\t\tif (typeof value.tabIndex === 'string') {\n\t\t\thtmlElement.setAttribute('tabindex', value.tabIndex);\n\t\t} else {\n\t\t\thtmlElement.removeAttribute('tabindex');\n\t\t}\n\t\thtmlElement.removeAttribute('aria-hidden');\n\t\thtmlElement.style.userSelect = 'unset';\n\t\tthis.lockedElements.delete(htmlElement);\n\t}\n\n\tprivate unlockLockedElements(lockedElements: Map<HTMLElement, LockedElementContext>) {\n\t\tlockedElements.forEach(this.unlockElement.bind(this));\n\t}\n\n\tprivate lockFocus(hostElement: HTMLElement | ShadowRoot | null, excludeElement?: HTMLElement) {\n\t\ttry {\n\t\t\tif (hostElement !== excludeElement && (hostElement instanceof HTMLElement || hostElement instanceof ShadowRoot)) {\n\t\t\t\tif (hostElement instanceof HTMLElement) {\n\t\t\t\t\tthis.lockElement(hostElement);\n\t\t\t\t\tthis.lockFocus(hostElement.shadowRoot, excludeElement);\n\t\t\t\t}\n\t\t\t\tfor (let i = 0; i < hostElement.children.length; i++) {\n\t\t\t\t\tthis.lockFocus(hostElement.children[i] as HTMLElement, excludeElement);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (error) {\n\t\t\t/**\n\t\t\t * Try is needed for SSR.\n\t\t\t * - no HTMLElement is available\n\t\t\t * - no ShadowRoot is available\n\t\t\t */\n\t\t}\n\t}\n\n\tprivate renderModalIfExists(activeElement?: HTMLElement) {\n\t\tif (activeElement instanceof HTMLElement) {\n\t\t\tif (this.lockedElements.has(activeElement)) {\n\t\t\t\tthis.unlockElement(this.lockedElements.get(activeElement) as LockedElementContext, activeElement);\n\t\t\t}\n\t\t\tconst timeout = setTimeout(() => {\n\t\t\t\tclearTimeout(timeout);\n\t\t\t\tactiveElement.focus();\n\t\t\t}, 500);\n\t\t}\n\t\tthis.unlockLockedElements(this.lockedElements);\n\t\tif (this.modalStack.size > 0) {\n\t\t\tconst modalKeys = Array.from(this.modalStack.keys());\n\t\t\tconst modalRef = modalKeys[modalKeys.length - 1] as HTMLElement & {\n\t\t\t\t_activeElement: HTMLElement | null; // typo sugger\n\t\t\t};\n\t\t\tthis.modalStack.forEach((_value: ModalContext, htmlElement: HTMLElement) => {\n\t\t\t\tif (modalRef === htmlElement) {\n\t\t\t\t\thtmlElement.style.display = 'inline';\n\t\t\t\t} else {\n\t\t\t\t\thtmlElement.style.display = `none`;\n\t\t\t\t}\n\t\t\t});\n\t\t\tgetDocument().body.style.maxHeight = '100vh';\n\t\t\tgetDocument().body.style.overflow = 'hidden';\n\t\t\tthis.lockFocus(getDocument().body, modalRef);\n\t\t} else {\n\t\t\tgetDocument().body.style.maxHeight = 'unset';\n\t\t\tgetDocument().body.style.overflow = 'unset';\n\t\t}\n\t}\n\n\tpublic openModal(modalRef: HTMLElement, activeElement?: HTMLElement): void {\n\t\tif (modalRef instanceof HTMLElement === false) {\n\t\t\tLog.warn(`[KolModalService] Die DOM-Referenz des Modals ist nicht valide.`);\n\t\t} else {\n\t\t\tthis.modalStack.set(modalRef, {\n\t\t\t\tactiveElement,\n\t\t\t});\n\t\t\tthis.renderModalIfExists();\n\t\t}\n\t}\n\n\tpublic closeModal(modalRef: HTMLElement): void {\n\t\tif (modalRef instanceof HTMLElement === false) {\n\t\t\tLog.warn(`[KolModalService] Die DOM-Referenz des Modals ist nicht valide.`);\n\t\t} else {\n\t\t\tconst activeElement = this.modalStack.get(modalRef)?.activeElement;\n\t\t\tthis.modalStack.delete(modalRef);\n\t\t\tthis.renderModalIfExists(activeElement);\n\t\t}\n\t}\n}\n","import { processEnv } from '@public-ui/schema';\n\nimport { ModalService } from '../components/modal/service';\n\nlet WINDOW: Window | null = null;\nlet DOCUMENT: Document | null = null;\n\nexport const configKoliBri = (window: Window): void => {\n\tif (window instanceof Window) {\n\t\tWINDOW = window;\n\t\tif (WINDOW.document instanceof Document) {\n\t\t\tDOCUMENT = window.document;\n\t\t} else {\n\t\t\tconsole.warn(`The given Window has no valid Document.`);\n\t\t}\n\t} else {\n\t\tconsole.warn(`The given Window is not valid.`);\n\t}\n};\n\nexport const getWindow = (): Window => (WINDOW || typeof window === 'undefined' ? (null as unknown as Window) : window);\nexport const getDocument = (): Document => (DOCUMENT || typeof getWindow().document === 'undefined' ? (null as unknown as Document) : getWindow().document);\n\nlet META_CONFIG: string | null = null;\nlet DEV_MODE: boolean | null = null;\nlet EXPERIMENTAL_MODE: boolean | null = null;\nlet COLOR_CONTRAST_ANALYSIS: boolean | null = null;\n\nexport const getDevMode = (): boolean => DEV_MODE === true;\nexport const getExperimentalMode = (): boolean => EXPERIMENTAL_MODE === true;\nexport const getColorContrastAnalysis = (): boolean => COLOR_CONTRAST_ANALYSIS === true;\n\ntype LogShield = {\n\tlabel: string;\n\tstyle: string;\n};\n\ntype LogShieldOptions = {\n\tclassifier?: string;\n\tforceLog?: boolean;\n\toverwriteStyle?: string;\n};\n\nexport class Log {\n\tprivate static shield: LogShield = {\n\t\tlabel: '%cKoliBri',\n\t\tstyle: 'color: white; background: #666; font-weight: bold; padding: .25em .5em; border-radius: 3px; border: 1px solid #000',\n\t};\n\n\tprivate static mapToArray(msg: unknown | unknown[]): unknown[] {\n\t\treturn Array.isArray(msg) ? msg : [msg];\n\t}\n\n\tprivate static handleClassifier(classifier?: string): string {\n\t\tif (typeof classifier === 'string' && classifier.length > 0) {\n\t\t\treturn `${Log.shield.label} | ${classifier}`;\n\t\t} else {\n\t\t\treturn Log.shield.label;\n\t\t}\n\t}\n\n\tprivate static getShield(options?: LogShieldOptions): string[] {\n\t\treturn [Log.handleClassifier(options?.classifier), `${Log.shield.style};${options?.overwriteStyle || ''}`];\n\t}\n\n\tpublic static debug(msg: unknown | unknown[], options?: LogShieldOptions): void {\n\t\tif (DEV_MODE || options?.forceLog === true) {\n\t\t\tconsole.debug(...Log.getShield(options), ...Log.mapToArray(msg));\n\t\t}\n\t}\n\n\tpublic static info(msg: unknown | unknown[], options?: LogShieldOptions): void {\n\t\tif (DEV_MODE || options?.forceLog === true) {\n\t\t\tconsole.info(...Log.getShield(options), ...Log.mapToArray(msg));\n\t\t}\n\t}\n\n\tpublic static trace(msg: unknown | unknown[], options?: LogShieldOptions): void {\n\t\tif (DEV_MODE || options?.forceLog === true) {\n\t\t\tconsole.trace(...Log.getShield(options), ...Log.mapToArray(msg));\n\t\t}\n\t}\n\n\tpublic static warn(msg: unknown | unknown[], options?: LogShieldOptions): void {\n\t\tif (DEV_MODE || options?.forceLog === true) {\n\t\t\tconsole.warn(...Log.getShield(options), ...Log.mapToArray(msg));\n\t\t}\n\t}\n\n\tpublic static error(msg: unknown | unknown[], options?: LogShieldOptions): void {\n\t\tif (DEV_MODE || options?.forceLog === true) {\n\t\t\tconsole.error(...Log.getShield(options), ...Log.mapToArray(msg));\n\t\t}\n\t}\n\n\tpublic static throw(msg: unknown | unknown[], options?: LogShieldOptions): void {\n\t\tif (DEV_MODE || options?.forceLog === true) {\n\t\t\tthrow new Error(...Log.getShield(options), ...Log.mapToArray(msg));\n\t\t}\n\t}\n}\n\nconst initMeta = (): void => {\n\tif (DEV_MODE === null && EXPERIMENTAL_MODE === null && COLOR_CONTRAST_ANALYSIS === null) {\n\t\tconst meta = getDocument().querySelector('meta[name=\"kolibri\"]');\n\t\tif (meta && meta.hasAttribute('content')) {\n\t\t\tMETA_CONFIG = meta.getAttribute('content');\n\t\t\tif (typeof META_CONFIG === 'string') {\n\t\t\t\tDEV_MODE = META_CONFIG.includes('dev-mode=true');\n\t\t\t\tEXPERIMENTAL_MODE = META_CONFIG.includes('experimental-mode=true');\n\t\t\t\tCOLOR_CONTRAST_ANALYSIS = META_CONFIG.includes('color-contrast-analysis=true');\n\t\t\t}\n\t\t}\n\t} else {\n\t\tconsole.warn(`You can only initialize DEV_MODE and COLOR_CONTRAST_ANALYSIS once.`);\n\t}\n};\n\nconst getKoliBri = (): Record<string, unknown> => {\n\tlet kolibri = getWindow().KoliBri;\n\tif (kolibri === undefined) {\n\t\tkolibri = {};\n\t\tObject.defineProperty(getWindow(), 'KoliBri', {\n\t\t\tvalue: kolibri,\n\t\t\twritable: false,\n\t\t});\n\t}\n\treturn kolibri;\n};\n\nexport const initKoliBri = (): void => {\n\tif (getKoliBri().Modal === undefined) {\n\t\tconst Modal = new ModalService();\n\t\tObject.defineProperty(getKoliBri(), 'Modal', {\n\t\t\tget: function (): ModalService {\n\t\t\t\treturn Modal;\n\t\t\t},\n\t\t});\n\t\tinitMeta();\n\t\tLog.debug(\n\t\t\t`\n\t,--. ,--. ,--. ,--. ,-----. ,--.\n\t| .' / ,---. | | \\`--' | |) /_ ,--.--. \\`--'\n\t| . ' | .-. | | | ,--. | .-. \\\\ | .--' ,--.\n\t| |\\\\ \\\\ | '-' | | | | | | '--' / | | | |\n\t\\`--' \\`--´ \\`---´ \\`--' \\`--' \\`------´ \\`--' \\`--'\n\t🚹 The accessible HTML-Standard | 👉 https://public-ui.github.io | 2.0.4-rc.0\n\t\t`,\n\t\t\t{\n\t\t\t\tforceLog: true,\n\t\t\t}\n\t\t);\n\t} else {\n\t\tconsole.warn(`You can only initialize KoliBri once.`);\n\t}\n};\nexport { getKoliBri };\n\nexport const renderDevAdvice = (): void => {\n\tif (getKoliBri().adviceShown !== true) {\n\t\tObject.defineProperty(getKoliBri(), 'adviceShown', {\n\t\t\tget: function () {\n\t\t\t\treturn true;\n\t\t\t},\n\t\t});\n\t\tLog.debug(\n\t\t\t`\nYou are using the KoliBri component library. If you have any suggestions for improvement or find a problem, please contact us:\n\nTicket: https://github.com/public-ui/kolibri/issues/new/choose (for privacy reasons, please use email)\nEmail: kolibri@itzbund.de\n`\n\t\t);\n\t}\n};\n\nlet nonce = (): string => Math.floor(Math.random() * 16777215).toString(16);\n\nif (processEnv === 'test') {\n\tnonce = (): string => 'nonce';\n}\n\nexport { nonce };\n"],"mappings":"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"}
|
1
|
+
{"version":3,"names":["ModalService","constructor","this","lockedElements","Map","modalStack","lockElement","htmlElement","tabIndex","getAttribute","HTMLAnchorElement","HTMLButtonElement","HTMLInputElement","HTMLSelectElement","HTMLTextAreaElement","dataset","kolModal","undefined","set","setAttribute","style","userSelect","unlockElement","value","removeAttribute","delete","unlockLockedElements","forEach","bind","lockFocus","hostElement","excludeElement","HTMLElement","ShadowRoot","shadowRoot","i","children","length","error","renderModalIfExists","activeElement","has","get","timeout","setTimeout","clearTimeout","focus","size","modalKeys","Array","from","keys","modalRef","_value","display","getDocument","body","maxHeight","overflow","openModal","Log","warn","closeModal","_a","WINDOW","DOCUMENT","configKoliBri","window","Window","document","Document","console","getWindow","META_CONFIG","DEV_MODE","EXPERIMENTAL_MODE","COLOR_CONTRAST_ANALYSIS","getDevMode","getExperimentalMode","getColorContrastAnalysis","mapToArray","msg","isArray","handleClassifier","classifier","shield","label","getShield","options","overwriteStyle","debug","forceLog","info","trace","Error","initMeta","meta","querySelector","hasAttribute","includes","getKoliBri","kolibri","KoliBri","Object","defineProperty","writable","initKoliBri","Modal","renderDevAdvice","adviceShown","nonce","Math","floor","random","toString","processEnv"],"sources":["src/components/modal/service.ts","src/utils/dev.utils.ts"],"sourcesContent":["import { getDocument, Log } from '../../utils/dev.utils';\n\ntype ModalContext = {\n\tactiveElement?: HTMLElement;\n};\n\ntype LockedElementContext = {\n\ttabIndex?: string;\n};\n\n/**\n * The modal service is only working client-side!\n */\nexport class ModalService {\n\tprivate lockedElements: Map<HTMLElement, LockedElementContext> = new Map();\n\tprivate modalStack: Map<HTMLElement, ModalContext> = new Map();\n\n\tprivate lockElement(htmlElement: HTMLElement) {\n\t\tconst tabIndex: string | null = htmlElement.getAttribute('tabindex');\n\t\tif (\n\t\t\thtmlElement instanceof HTMLAnchorElement ||\n\t\t\thtmlElement instanceof HTMLButtonElement ||\n\t\t\thtmlElement instanceof HTMLInputElement ||\n\t\t\thtmlElement instanceof HTMLSelectElement ||\n\t\t\thtmlElement instanceof HTMLTextAreaElement ||\n\t\t\ttypeof tabIndex === 'string' ||\n\t\t\thtmlElement.dataset.kolModal !== undefined\n\t\t) {\n\t\t\tif (typeof tabIndex === 'string') {\n\t\t\t\tthis.lockedElements.set(htmlElement, {\n\t\t\t\t\ttabIndex,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tthis.lockedElements.set(htmlElement, {});\n\t\t\t}\n\t\t\thtmlElement.setAttribute('tabindex', '-1');\n\t\t\thtmlElement.setAttribute('aria-hidden', 'true');\n\t\t\thtmlElement.style.userSelect = 'none';\n\t\t}\n\t}\n\n\tprivate unlockElement(value: LockedElementContext, htmlElement: HTMLElement) {\n\t\tif (typeof value.tabIndex === 'string') {\n\t\t\thtmlElement.setAttribute('tabindex', value.tabIndex);\n\t\t} else {\n\t\t\thtmlElement.removeAttribute('tabindex');\n\t\t}\n\t\thtmlElement.removeAttribute('aria-hidden');\n\t\thtmlElement.style.userSelect = 'unset';\n\t\tthis.lockedElements.delete(htmlElement);\n\t}\n\n\tprivate unlockLockedElements(lockedElements: Map<HTMLElement, LockedElementContext>) {\n\t\tlockedElements.forEach(this.unlockElement.bind(this));\n\t}\n\n\tprivate lockFocus(hostElement: HTMLElement | ShadowRoot | null, excludeElement?: HTMLElement) {\n\t\ttry {\n\t\t\tif (hostElement !== excludeElement && (hostElement instanceof HTMLElement || hostElement instanceof ShadowRoot)) {\n\t\t\t\tif (hostElement instanceof HTMLElement) {\n\t\t\t\t\tthis.lockElement(hostElement);\n\t\t\t\t\tthis.lockFocus(hostElement.shadowRoot, excludeElement);\n\t\t\t\t}\n\t\t\t\tfor (let i = 0; i < hostElement.children.length; i++) {\n\t\t\t\t\tthis.lockFocus(hostElement.children[i] as HTMLElement, excludeElement);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (error) {\n\t\t\t/**\n\t\t\t * Try is needed for SSR.\n\t\t\t * - no HTMLElement is available\n\t\t\t * - no ShadowRoot is available\n\t\t\t */\n\t\t}\n\t}\n\n\tprivate renderModalIfExists(activeElement?: HTMLElement) {\n\t\tif (activeElement instanceof HTMLElement) {\n\t\t\tif (this.lockedElements.has(activeElement)) {\n\t\t\t\tthis.unlockElement(this.lockedElements.get(activeElement) as LockedElementContext, activeElement);\n\t\t\t}\n\t\t\tconst timeout = setTimeout(() => {\n\t\t\t\tclearTimeout(timeout);\n\t\t\t\tactiveElement.focus();\n\t\t\t}, 500);\n\t\t}\n\t\tthis.unlockLockedElements(this.lockedElements);\n\t\tif (this.modalStack.size > 0) {\n\t\t\tconst modalKeys = Array.from(this.modalStack.keys());\n\t\t\tconst modalRef = modalKeys[modalKeys.length - 1] as HTMLElement & {\n\t\t\t\t_activeElement: HTMLElement | null; // typo sugger\n\t\t\t};\n\t\t\tthis.modalStack.forEach((_value: ModalContext, htmlElement: HTMLElement) => {\n\t\t\t\tif (modalRef === htmlElement) {\n\t\t\t\t\thtmlElement.style.display = 'inline';\n\t\t\t\t} else {\n\t\t\t\t\thtmlElement.style.display = `none`;\n\t\t\t\t}\n\t\t\t});\n\t\t\tgetDocument().body.style.maxHeight = '100vh';\n\t\t\tgetDocument().body.style.overflow = 'hidden';\n\t\t\tthis.lockFocus(getDocument().body, modalRef);\n\t\t} else {\n\t\t\tgetDocument().body.style.maxHeight = 'unset';\n\t\t\tgetDocument().body.style.overflow = 'unset';\n\t\t}\n\t}\n\n\tpublic openModal(modalRef: HTMLElement, activeElement?: HTMLElement): void {\n\t\tif (modalRef instanceof HTMLElement === false) {\n\t\t\tLog.warn(`[KolModalService] Die DOM-Referenz des Modals ist nicht valide.`);\n\t\t} else {\n\t\t\tthis.modalStack.set(modalRef, {\n\t\t\t\tactiveElement,\n\t\t\t});\n\t\t\tthis.renderModalIfExists();\n\t\t}\n\t}\n\n\tpublic closeModal(modalRef: HTMLElement): void {\n\t\tif (modalRef instanceof HTMLElement === false) {\n\t\t\tLog.warn(`[KolModalService] Die DOM-Referenz des Modals ist nicht valide.`);\n\t\t} else {\n\t\t\tconst activeElement = this.modalStack.get(modalRef)?.activeElement;\n\t\t\tthis.modalStack.delete(modalRef);\n\t\t\tthis.renderModalIfExists(activeElement);\n\t\t}\n\t}\n}\n","import { processEnv } from '@public-ui/schema';\n\nimport { ModalService } from '../components/modal/service';\n\nlet WINDOW: Window | null = null;\nlet DOCUMENT: Document | null = null;\n\nexport const configKoliBri = (window: Window): void => {\n\tif (window instanceof Window) {\n\t\tWINDOW = window;\n\t\tif (WINDOW.document instanceof Document) {\n\t\t\tDOCUMENT = window.document;\n\t\t} else {\n\t\t\tconsole.warn(`The given Window has no valid Document.`);\n\t\t}\n\t} else {\n\t\tconsole.warn(`The given Window is not valid.`);\n\t}\n};\n\nexport const getWindow = (): Window => (WINDOW || typeof window === 'undefined' ? (null as unknown as Window) : window);\nexport const getDocument = (): Document => (DOCUMENT || typeof getWindow().document === 'undefined' ? (null as unknown as Document) : getWindow().document);\n\nlet META_CONFIG: string | null = null;\nlet DEV_MODE: boolean | null = null;\nlet EXPERIMENTAL_MODE: boolean | null = null;\nlet COLOR_CONTRAST_ANALYSIS: boolean | null = null;\n\nexport const getDevMode = (): boolean => DEV_MODE === true;\nexport const getExperimentalMode = (): boolean => EXPERIMENTAL_MODE === true;\nexport const getColorContrastAnalysis = (): boolean => COLOR_CONTRAST_ANALYSIS === true;\n\ntype LogShield = {\n\tlabel: string;\n\tstyle: string;\n};\n\ntype LogShieldOptions = {\n\tclassifier?: string;\n\tforceLog?: boolean;\n\toverwriteStyle?: string;\n};\n\nexport class Log {\n\tprivate static shield: LogShield = {\n\t\tlabel: '%cKoliBri',\n\t\tstyle: 'color: white; background: #666; font-weight: bold; padding: .25em .5em; border-radius: 3px; border: 1px solid #000',\n\t};\n\n\tprivate static mapToArray(msg: unknown | unknown[]): unknown[] {\n\t\treturn Array.isArray(msg) ? msg : [msg];\n\t}\n\n\tprivate static handleClassifier(classifier?: string): string {\n\t\tif (typeof classifier === 'string' && classifier.length > 0) {\n\t\t\treturn `${Log.shield.label} | ${classifier}`;\n\t\t} else {\n\t\t\treturn Log.shield.label;\n\t\t}\n\t}\n\n\tprivate static getShield(options?: LogShieldOptions): string[] {\n\t\treturn [Log.handleClassifier(options?.classifier), `${Log.shield.style};${options?.overwriteStyle || ''}`];\n\t}\n\n\tpublic static debug(msg: unknown | unknown[], options?: LogShieldOptions): void {\n\t\tif (DEV_MODE || options?.forceLog === true) {\n\t\t\tconsole.debug(...Log.getShield(options), ...Log.mapToArray(msg));\n\t\t}\n\t}\n\n\tpublic static info(msg: unknown | unknown[], options?: LogShieldOptions): void {\n\t\tif (DEV_MODE || options?.forceLog === true) {\n\t\t\tconsole.info(...Log.getShield(options), ...Log.mapToArray(msg));\n\t\t}\n\t}\n\n\tpublic static trace(msg: unknown | unknown[], options?: LogShieldOptions): void {\n\t\tif (DEV_MODE || options?.forceLog === true) {\n\t\t\tconsole.trace(...Log.getShield(options), ...Log.mapToArray(msg));\n\t\t}\n\t}\n\n\tpublic static warn(msg: unknown | unknown[], options?: LogShieldOptions): void {\n\t\tif (DEV_MODE || options?.forceLog === true) {\n\t\t\tconsole.warn(...Log.getShield(options), ...Log.mapToArray(msg));\n\t\t}\n\t}\n\n\tpublic static error(msg: unknown | unknown[], options?: LogShieldOptions): void {\n\t\tif (DEV_MODE || options?.forceLog === true) {\n\t\t\tconsole.error(...Log.getShield(options), ...Log.mapToArray(msg));\n\t\t}\n\t}\n\n\tpublic static throw(msg: unknown | unknown[], options?: LogShieldOptions): void {\n\t\tif (DEV_MODE || options?.forceLog === true) {\n\t\t\tthrow new Error(...Log.getShield(options), ...Log.mapToArray(msg));\n\t\t}\n\t}\n}\n\nconst initMeta = (): void => {\n\tif (DEV_MODE === null && EXPERIMENTAL_MODE === null && COLOR_CONTRAST_ANALYSIS === null) {\n\t\tconst meta = getDocument().querySelector('meta[name=\"kolibri\"]');\n\t\tif (meta && meta.hasAttribute('content')) {\n\t\t\tMETA_CONFIG = meta.getAttribute('content');\n\t\t\tif (typeof META_CONFIG === 'string') {\n\t\t\t\tDEV_MODE = META_CONFIG.includes('dev-mode=true');\n\t\t\t\tEXPERIMENTAL_MODE = META_CONFIG.includes('experimental-mode=true');\n\t\t\t\tCOLOR_CONTRAST_ANALYSIS = META_CONFIG.includes('color-contrast-analysis=true');\n\t\t\t}\n\t\t}\n\t} else {\n\t\tconsole.warn(`You can only initialize DEV_MODE and COLOR_CONTRAST_ANALYSIS once.`);\n\t}\n};\n\nconst getKoliBri = (): Record<string, unknown> => {\n\tlet kolibri = getWindow().KoliBri;\n\tif (kolibri === undefined) {\n\t\tkolibri = {};\n\t\tObject.defineProperty(getWindow(), 'KoliBri', {\n\t\t\tvalue: kolibri,\n\t\t\twritable: false,\n\t\t});\n\t}\n\treturn kolibri;\n};\n\nexport const initKoliBri = (): void => {\n\tif (getKoliBri().Modal === undefined) {\n\t\tconst Modal = new ModalService();\n\t\tObject.defineProperty(getKoliBri(), 'Modal', {\n\t\t\tget: function (): ModalService {\n\t\t\t\treturn Modal;\n\t\t\t},\n\t\t});\n\t\tinitMeta();\n\t\tLog.debug(\n\t\t\t`\n\t,--. ,--. ,--. ,--. ,-----. ,--.\n\t| .' / ,---. | | \\`--' | |) /_ ,--.--. \\`--'\n\t| . ' | .-. | | | ,--. | .-. \\\\ | .--' ,--.\n\t| |\\\\ \\\\ | '-' | | | | | | '--' / | | | |\n\t\\`--' \\`--´ \\`---´ \\`--' \\`--' \\`------´ \\`--' \\`--'\n\t🚹 The accessible HTML-Standard | 👉 https://public-ui.github.io | 2.0.4\n\t\t`,\n\t\t\t{\n\t\t\t\tforceLog: true,\n\t\t\t}\n\t\t);\n\t} else {\n\t\tconsole.warn(`You can only initialize KoliBri once.`);\n\t}\n};\nexport { getKoliBri };\n\nexport const renderDevAdvice = (): void => {\n\tif (getKoliBri().adviceShown !== true) {\n\t\tObject.defineProperty(getKoliBri(), 'adviceShown', {\n\t\t\tget: function () {\n\t\t\t\treturn true;\n\t\t\t},\n\t\t});\n\t\tLog.debug(\n\t\t\t`\nYou are using the KoliBri component library. If you have any suggestions for improvement or find a problem, please contact us:\n\nTicket: https://github.com/public-ui/kolibri/issues/new/choose (for privacy reasons, please use email)\nEmail: kolibri@itzbund.de\n`\n\t\t);\n\t}\n};\n\nlet nonce = (): string => Math.floor(Math.random() * 16777215).toString(16);\n\nif (processEnv === 'test') {\n\tnonce = (): string => 'nonce';\n}\n\nexport { nonce };\n"],"mappings":"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"}
|
@@ -1,4 +1,4 @@
|
|
1
1
|
/*!
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
3
3
|
*/
|
4
|
-
import{aI as t,aJ as o,aj as a,aK as s,aL as e,j as l,aM as n}from"./index-807d8631.js";import{i as r,b as i,r as
|
4
|
+
import{aI as t,aJ as o,aj as a,aK as s,aL as e,j as l,aM as n}from"./index-807d8631.js";import{i as r,b as i,r as L,d as c,L as d,a as f,e as p,g as m}from"./dev.utils-69ed2492.js";function h(t,e){try{Object.defineProperty(m(),t,{get:function(){return e}})}catch(e){d.debug(`KoliBri property ${t} is already bind.`)}}const g=(t,e)=>d.debug(`${t} ${e?"":"not "}activated`),u=()=>{if(r(),i()){L(),h("a11yColorContrast",o),h("querySelector",a),h("querySelectorAll",s),h("querySelectorColors",e),h("utils",(function(){return t})),h("parseJson",l),h("stringifyJson",n);const r=c().body,d=c().createElement("svg");if(d.setAttribute("aria-label","KoliBri-DevTools"),d.setAttribute("xmlns","http://www.w3.org/2000/svg"),d.setAttribute("role","toolbar"),d.setAttribute("style","position: fixed;color: black;font-size: 200%;bottom: 0.25rem;right: 0.25rem;"),d.innerHTML='<svg\n xmlns="http://www.w3.org/2000/svg"\n width="50"\n height="50"\n viewBox="0 0 600 600"\n>\n <path d="M353 322L213 304V434L353 322Z" fill="#047" />\n <path d="M209 564V304L149 434L209 564Z" fill="#047" />\n <path d="M357 316L417 250L361 210L275 244L357 316Z" fill="#047" />\n <path d="M353 318L35 36L213 300L353 318Z" fill="#047" />\n <path d="M329 218L237 92L250 222L272 241L329 218Z" fill="#047" />\n <path d="M391 286L565 272L421 252L391 286Z" fill="#047" />\n</svg>',c().body.appendChild(d),g("Development mode",i()),g("Experimental mode",f()),g("Color contrast analysis",p()),p()){const e=setTimeout((()=>{clearTimeout(e),setInterval((()=>{t.queryHtmlElementColors(c().createElement("div"),o(r),!1,!1)}),1e4)}),2500)}}};export{u as initialize};
|
@@ -1,4 +1,4 @@
|
|
1
1
|
/*!
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
3
3
|
*/
|
4
|
-
import{d as e}from"./index-807d8631.js";import{g as i}from"./index-
|
4
|
+
import{d as e}from"./index-807d8631.js";import{g as i}from"./index-7c986198.js";const n={error:"Fehler",warning:"Warnung",info:"Hinweis",success:"Erfolg",message:"Nachricht",close:"Schließen","form-description":"Formular-Felder, die mit einem Sternchen (*) gekennzeichnet sind, sind Pflichtangaben.",of:"von",characters:"Zeichen",new:"Neu","no-entries":"Es sind keine Einträge vorhanden.","change-order":"Sortierung von {{colLabel}} ändern","action-running":"Aktion wird ausgeführt...","action-done":"Aktion abgeschlossen",pagination:"Paginierung","page-first":"Direkt zur ersten Seite","page-back":"Eine Seite zurück","page-next":"Eine Seite weiter","page-last":"Direkt zur letzten Seite","entries-per-site":"Einträge pro Seite","page-current":"Seite {{page}}","page-selected":"Seite {{page}} ist ausgewählt","page-per-site":"{{entries}} Einträge pro Seite","nav-maximize":"Navigation maximieren","nav-minimize":"Navigation minimieren","logo-description":"Logo {{orgShort}}. Bundesadler mit Flaggenstab und Schriftzug {{orgLong}}","open-link-in-tab":"Öffnet in neuem Tab.","kolibri-logo":"Logo von KoliBri","table-pagination-label":"Paginierung für die Tabelle {{label}}","avatar-alt":"Avatar von {{name}}","toast-close-all":"Alle schließen","error-list":"Fehlerliste","error-list-message":"Bitte korrigieren Sie folgende Fehler:",version:"Versionsnummer","table-visible-range":"Einträge {{start}} bis {{end}} von {{total}}"},a={error:"Error",warning:"Warning",info:"Note",success:"Success",message:"Message",close:"Close","form-description":"Form fields marked with an asterisk (*) are mandatory.",of:"of",characters:"characters",new:"New","no-entries":"No entries available.","change-order":"Change order of {{colLabel}}","action-running":"Action is running...","action-done":"Action done",pagination:"Pagination","page-first":"Directly to the first page","page-back":"One page back","page-next":"One page further","page-last":"Directly to the last page","entries-per-site":"Entries per page","page-current":"Page {{page}}","page-selected":"Page {{page}} is selected","page-per-site":"{{entries}} entries per page","nav-maximize":"Maximize navigation","nav-minimize":"Minimize navigation","logo-description":"Logo {{orgShort}}. Federal eagle with flag staff and lettering {{orgLong}}","open-link-in-tab":"Opens in new tab.","kolibri-logo":"KoliBri logo","table-pagination-label":"Pagination for table {{label}}","avatar-alt":"Avatar of {{name}}","toast-close-all":"Close all","error-list":"Error list","error-list-message":"Please correct the following errors",version:"Version number","table-visible-range":"Entries {{start}} to {{end}} of {{total}}"},r=e=>Object.keys(e).reduce(((i,n)=>(i[`kol-${n}`]=e[n],i)),{}),t=new Set([e=>e("en",r(a)),e=>e("de",r(n))]),o=(n,a)=>{const r=i();if(void 0===r)return e("[I18n] I18nService not available! Please call the global register function."),n;let o=r.translate(n,a);return o===n&&(e("[I18n] Locales not initialized! Initialize default locales automatically."),t.forEach((e=>e(((e,i)=>(r.addResourceBundle(e,i),e))))),o=r.translate(n,a)),o};export{o as a,t};
|
@@ -1,4 +1,4 @@
|
|
1
1
|
/*!
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
3
3
|
*/
|
4
|
-
import{_ as t}from"./index-807d8631.js";import{g as e}from"./dev.utils-d2e25c84.js";const i={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){console&&console[t]&&console[t].apply(console,e)}};class s{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.init(t,e)}init(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=e.prefix||"i18next:",this.logger=t||i,this.options=e,this.debug=e.debug}log(){for(var t=arguments.length,e=new Array(t),s=0;s<t;s++)e[s]=arguments[s];return this.forward(e,"log","",!0)}warn(){for(var t=arguments.length,e=new Array(t),s=0;s<t;s++)e[s]=arguments[s];return this.forward(e,"warn","",!0)}error(){for(var t=arguments.length,e=new Array(t),s=0;s<t;s++)e[s]=arguments[s];return this.forward(e,"error","")}deprecate(){for(var t=arguments.length,e=new Array(t),s=0;s<t;s++)e[s]=arguments[s];return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(t,e,s,n){return n&&!this.debug?null:("string"==typeof t[0]&&(t[0]=`${s}${this.prefix} ${t[0]}`),this.logger[e](t))}create(t){return new s(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new s(this.logger,t)}}var n=new s;class r{constructor(){this.observers={}}on(t,e){return t.split(" ").forEach((t=>{this.observers[t]=this.observers[t]||[],this.observers[t].push(e)})),this}off(t,e){this.observers[t]&&(e?this.observers[t]=this.observers[t].filter((t=>t!==e)):delete this.observers[t])}emit(t){for(var e=arguments.length,s=new Array(e>1?e-1:0),n=1;n<e;n++)s[n-1]=arguments[n];if(this.observers[t]){[].concat(this.observers[t]).forEach((t=>{t(...s)}))}if(this.observers["*"]){[].concat(this.observers["*"]).forEach((e=>{e.apply(e,[t,...s])}))}}}function f(){let t,e;const s=new Promise(((s,n)=>{t=s,e=n}));return s.resolve=t,s.reject=e,s}function o(t){return null==t?"":""+t}function u(t,e,s){t.forEach((t=>{e[t]&&(s[t]=e[t])}))}function h(t,e,s){function n(t){return t&&t.indexOf("###")>-1?t.replace(/###/g,"."):t}function i(){return!t||"string"==typeof t}const o="string"!=typeof e?[].concat(e):e.split(".");for(;o.length>1;){if(i())return{};const e=n(o.shift());!t[e]&&s&&(t[e]=new s),t=Object.prototype.hasOwnProperty.call(t,e)?t[e]:{}}return i()?{}:{obj:t,k:n(o.shift())}}function a(t,e,s){const{obj:n,k:i}=h(t,e,Object);n[i]=s}function l(t,e,s,n){const{obj:i,k:o}=h(t,e,Object);i[o]=i[o]||[],n&&(i[o]=i[o].concat(s)),n||i[o].push(s)}function c(t,e){const{obj:s,k:n}=h(t,e);if(s)return s[n]}function d(t,e,s){const n=c(t,s);return void 0!==n?n:c(e,s)}function g(t,e,s){for(const n in e)"__proto__"!==n&&"constructor"!==n&&(n in t?"string"==typeof t[n]||t[n]instanceof String||"string"==typeof e[n]||e[n]instanceof String?s&&(t[n]=e[n]):g(t[n],e[n],s):t[n]=e[n]);return t}function p(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var y={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function m(t){return"string"==typeof t?t.replace(/[&<>"'\/]/g,(t=>y[t])):t}const b=[" ",",","?","!",";"];function $(t,e,s){e=e||"",s=s||"";const n=b.filter((t=>e.indexOf(t)<0&&s.indexOf(t)<0));if(0===n.length)return!0;const i=new RegExp(`(${n.map((t=>"?"===t?"\\?":t)).join("|")})`);let o=!i.test(t);if(!o){const e=t.indexOf(s);e>0&&!i.test(t.substring(0,e))&&(o=!0)}return o}function v(t,e){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(!t)return;if(t[e])return t[e];const n=e.split(s);let i=t;for(let t=0;t<n.length;++t){if(!i)return;if("string"==typeof i[n[t]]&&t+1<n.length)return;if(void 0===i[n[t]]){let o=2,r=n.slice(t,t+o).join(s),a=i[r];for(;void 0===a&&n.length>t+o;)o++,r=n.slice(t,t+o).join(s),a=i[r];if(void 0===a)return;if(null===a)return null;if(e.endsWith(r)){if("string"==typeof a)return a;if(r&&"string"==typeof a[r])return a[r]}const l=n.slice(t+o).join(s);return l?v(a,l,s):void 0}i=i[n[t]]}return i}function w(t){return t&&t.indexOf("_")>0?t.replace("_","-"):t}class j extends r{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=e,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const e=this.options.ns.indexOf(t);e>-1&&this.options.ns.splice(e,1)}getResource(t,e,s){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,o=void 0!==n.ignoreJSONStructure?n.ignoreJSONStructure:this.options.ignoreJSONStructure;let r=[t,e];s&&"string"!=typeof s&&(r=r.concat(s)),s&&"string"==typeof s&&(r=r.concat(i?s.split(i):s)),t.indexOf(".")>-1&&(r=t.split("."));const a=c(this.data,r);return a||!o||"string"!=typeof s?a:v(this.data&&this.data[t]&&this.data[t][e],s,i)}addResource(t,e,s,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1};const o=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator;let r=[t,e];s&&(r=r.concat(o?s.split(o):s)),t.indexOf(".")>-1&&(r=t.split("."),n=e,e=r[1]),this.addNamespaces(e),a(this.data,r,n),i.silent||this.emit("added",t,e,s,n)}addResources(t,e,s){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(const n in s)"string"!=typeof s[n]&&"[object Array]"!==Object.prototype.toString.apply(s[n])||this.addResource(t,e,n,s[n],{silent:!0});n.silent||this.emit("added",t,e,s)}addResourceBundle(t,e,s,n,i){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},r=[t,e];t.indexOf(".")>-1&&(r=t.split("."),n=s,s=e,e=r[1]),this.addNamespaces(e);let l=c(this.data,r)||{};n?g(l,s,i):l={...l,...s},a(this.data,r,l),o.silent||this.emit("added",t,e,s)}removeResourceBundle(t,e){this.hasResourceBundle(t,e)&&delete this.data[t][e],this.removeNamespaces(e),this.emit("removed",t,e)}hasResourceBundle(t,e){return void 0!==this.getResource(t,e)}getResourceBundle(t,e){return e||(e=this.options.defaultNS),"v1"===this.options.compatibilityAPI?{...this.getResource(t,e)}:this.getResource(t,e)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const e=this.getDataByLanguage(t);return!!(e&&Object.keys(e)||[]).find((t=>e[t]&&Object.keys(e[t]).length>0))}toJSON(){return this.data}}var N={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,s,n,i){return t.forEach((t=>{this.processors[t]&&(e=this.processors[t].process(e,s,n,i))})),e}};const k={};class x extends r{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),u(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=e,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=n.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==t)return!1;const s=this.resolve(t,e);return s&&void 0!==s.res}extractFromKey(t,e){let s=void 0!==e.nsSeparator?e.nsSeparator:this.options.nsSeparator;void 0===s&&(s=":");const n=void 0!==e.keySeparator?e.keySeparator:this.options.keySeparator;let i=e.ns||this.options.defaultNS||[];const o=s&&t.indexOf(s)>-1,r=!(this.options.userDefinedKeySeparator||e.keySeparator||this.options.userDefinedNsSeparator||e.nsSeparator||$(t,s,n));if(o&&!r){const e=t.match(this.interpolator.nestingRegexp);if(e&&e.length>0)return{key:t,namespaces:i};const o=t.split(s);(s!==n||s===n&&this.options.ns.indexOf(o[0])>-1)&&(i=o.shift()),t=o.join(n)}return"string"==typeof i&&(i=[i]),{key:t,namespaces:i}}translate(t,e,s){if("object"!=typeof e&&this.options.overloadTranslationOptionHandler&&(e=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof e&&(e={...e}),e||(e={}),null==t)return"";Array.isArray(t)||(t=[String(t)]);const n=void 0!==e.returnDetails?e.returnDetails:this.options.returnDetails,i=void 0!==e.keySeparator?e.keySeparator:this.options.keySeparator,{key:o,namespaces:r}=this.extractFromKey(t[t.length-1],e),a=r[r.length-1],l=e.lng||this.language,u=e.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(l&&"cimode"===l.toLowerCase()){if(u){const t=e.nsSeparator||this.options.nsSeparator;return n?{res:`${a}${t}${o}`,usedKey:o,exactUsedKey:o,usedLng:l,usedNS:a,usedParams:this.getUsedParamsDetails(e)}:`${a}${t}${o}`}return n?{res:o,usedKey:o,exactUsedKey:o,usedLng:l,usedNS:a,usedParams:this.getUsedParamsDetails(e)}:o}const c=this.resolve(t,e);let h=c&&c.res;const p=c&&c.usedKey||o,g=c&&c.exactUsedKey||o,d=Object.prototype.toString.apply(h),f=void 0!==e.joinArrays?e.joinArrays:this.options.joinArrays,m=!this.i18nFormat||this.i18nFormat.handleAsObject;if(m&&h&&("string"!=typeof h&&"boolean"!=typeof h&&"number"!=typeof h)&&["[object Number]","[object Function]","[object RegExp]"].indexOf(d)<0&&("string"!=typeof f||"[object Array]"!==d)){if(!e.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const t=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,h,{...e,ns:r}):`key '${o} (${this.language})' returned an object instead of string.`;return n?(c.res=t,c.usedParams=this.getUsedParamsDetails(e),c):t}if(i){const t="[object Array]"===d,s=t?[]:{},n=t?g:p;for(const t in h)if(Object.prototype.hasOwnProperty.call(h,t)){const o=`${n}${i}${t}`;s[t]=this.translate(o,{...e,joinArrays:!1,ns:r}),s[t]===o&&(s[t]=h[t])}h=s}}else if(m&&"string"==typeof f&&"[object Array]"===d)h=h.join(f),h&&(h=this.extendTranslation(h,t,e,s));else{let n=!1,r=!1;const u=void 0!==e.count&&"string"!=typeof e.count,p=x.hasDefaultValue(e),g=u?this.pluralResolver.getSuffix(l,e.count,e):"",d=e.ordinal&&u?this.pluralResolver.getSuffix(l,e.count,{ordinal:!1}):"",f=u&&!e.ordinal&&0===e.count&&this.pluralResolver.shouldUseIntlApi()&&e[`defaultValue${this.options.pluralSeparator}zero`]||e[`defaultValue${g}`]||e[`defaultValue${d}`]||e.defaultValue;!this.isValidLookup(h)&&p&&(n=!0,h=f),this.isValidLookup(h)||(r=!0,h=o);const m=(e.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&r?void 0:h,y=p&&f!==h&&this.options.updateMissing;if(r||n||y){if(this.logger.log(y?"updateKey":"missingKey",l,a,o,y?f:h),i){const t=this.resolve(o,{...e,keySeparator:!1});t&&t.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let t=[];const s=this.languageUtils.getFallbackCodes(this.options.fallbackLng,e.lng||this.language);if("fallback"===this.options.saveMissingTo&&s&&s[0])for(let e=0;e<s.length;e++)t.push(s[e]);else"all"===this.options.saveMissingTo?t=this.languageUtils.toResolveHierarchy(e.lng||this.language):t.push(e.lng||this.language);const n=(t,s,n)=>{const i=p&&n!==h?n:m;this.options.missingKeyHandler?this.options.missingKeyHandler(t,a,s,i,y,e):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(t,a,s,i,y,e),this.emit("missingKey",t,a,s,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&u?t.forEach((t=>{this.pluralResolver.getSuffixes(t,e).forEach((s=>{n([t],o+s,e[`defaultValue${s}`]||f)}))})):n(t,o,f))}h=this.extendTranslation(h,t,e,c,s),r&&h===o&&this.options.appendNamespaceToMissingKey&&(h=`${a}:${o}`),(r||n)&&this.options.parseMissingKeyHandler&&(h="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${a}:${o}`:o,n?h:void 0):this.options.parseMissingKeyHandler(h))}return n?(c.res=h,c.usedParams=this.getUsedParamsDetails(e),c):h}extendTranslation(t,e,s,n,i){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...s},s.lng||this.language||n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init({...s,interpolation:{...this.options.interpolation,...s.interpolation}});const r="string"==typeof t&&(s&&s.interpolation&&void 0!==s.interpolation.skipOnVariables?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let a;if(r){const e=t.match(this.interpolator.nestingRegexp);a=e&&e.length}let l=s.replace&&"string"!=typeof s.replace?s.replace:s;if(this.options.interpolation.defaultVariables&&(l={...this.options.interpolation.defaultVariables,...l}),t=this.interpolator.interpolate(t,l,s.lng||this.language,s),r){const e=t.match(this.interpolator.nestingRegexp);a<(e&&e.length)&&(s.nest=!1)}!s.lng&&"v1"!==this.options.compatibilityAPI&&n&&n.res&&(s.lng=n.usedLng),!1!==s.nest&&(t=this.interpolator.nest(t,(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return i&&i[0]===n[0]&&!s.context?(o.logger.warn(`It seems you are nesting recursively key: ${n[0]} in key: ${e[0]}`),null):o.translate(...n,e)}),s)),s.interpolation&&this.interpolator.reset()}const r=s.postProcess||this.options.postProcess,a="string"==typeof r?[r]:r;return null!=t&&a&&a.length&&!1!==s.applyPostProcessor&&(t=N.handle(a,t,e,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...n,usedParams:this.getUsedParamsDetails(s)},...s}:s,this)),t}resolve(t){let e,s,n,i,o,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof t&&(t=[t]),t.forEach((t=>{if(this.isValidLookup(e))return;const a=this.extractFromKey(t,r),l=a.key;s=l;let u=a.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));const c=void 0!==r.count&&"string"!=typeof r.count,h=c&&!r.ordinal&&0===r.count&&this.pluralResolver.shouldUseIntlApi(),p=void 0!==r.context&&("string"==typeof r.context||"number"==typeof r.context)&&""!==r.context,g=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);u.forEach((t=>{this.isValidLookup(e)||(o=t,!k[`${g[0]}-${t}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(o)&&(k[`${g[0]}-${t}`]=!0,this.logger.warn(`key "${s}" for languages "${g.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),g.forEach((s=>{if(this.isValidLookup(e))return;i=s;const o=[l];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(o,l,s,t,r);else{let t;c&&(t=this.pluralResolver.getSuffix(s,r.count,r));const e=`${this.options.pluralSeparator}zero`,n=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(o.push(l+t),r.ordinal&&0===t.indexOf(n)&&o.push(l+t.replace(n,this.options.pluralSeparator)),h&&o.push(l+e)),p){const s=`${l}${this.options.contextSeparator}${r.context}`;o.push(s),c&&(o.push(s+t),r.ordinal&&0===t.indexOf(n)&&o.push(s+t.replace(n,this.options.pluralSeparator)),h&&o.push(s+e))}}let a;for(;a=o.pop();)this.isValidLookup(e)||(n=a,e=this.getResource(s,t,a,r))})))}))})),{res:e,usedKey:s,exactUsedKey:n,usedLng:i,usedNS:o}}isValidLookup(t){return!(void 0===t||!this.options.returnNull&&null===t||!this.options.returnEmptyString&&""===t)}getResource(t,e,s){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,e,s,n):this.resourceStore.getResource(t,e,s,n)}getUsedParamsDetails(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],s=t.replace&&"string"!=typeof t.replace;let n=s?t.replace:t;if(s&&void 0!==t.count&&(n.count=t.count),this.options.interpolation.defaultVariables&&(n={...this.options.interpolation.defaultVariables,...n}),!s){n={...n};for(const t of e)delete n[t]}return n}static hasDefaultValue(t){const e="defaultValue";for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&e===s.substring(0,12)&&void 0!==t[s])return!0;return!1}}function O(t){return t.charAt(0).toUpperCase()+t.slice(1)}class S{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=n.create("languageUtils")}getScriptPartFromCode(t){if(!(t=w(t))||t.indexOf("-")<0)return null;const e=t.split("-");return 2===e.length?null:(e.pop(),"x"===e[e.length-1].toLowerCase()?null:this.formatLanguageCode(e.join("-")))}getLanguagePartFromCode(t){if(!(t=w(t))||t.indexOf("-")<0)return t;const e=t.split("-");return this.formatLanguageCode(e[0])}formatLanguageCode(t){if("string"==typeof t&&t.indexOf("-")>-1){const e=["hans","hant","latn","cyrl","cans","mong","arab"];let s=t.split("-");return this.options.lowerCaseLng?s=s.map((t=>t.toLowerCase())):2===s.length?(s[0]=s[0].toLowerCase(),s[1]=s[1].toUpperCase(),e.indexOf(s[1].toLowerCase())>-1&&(s[1]=O(s[1].toLowerCase()))):3===s.length&&(s[0]=s[0].toLowerCase(),2===s[1].length&&(s[1]=s[1].toUpperCase()),"sgn"!==s[0]&&2===s[2].length&&(s[2]=s[2].toUpperCase()),e.indexOf(s[1].toLowerCase())>-1&&(s[1]=O(s[1].toLowerCase())),e.indexOf(s[2].toLowerCase())>-1&&(s[2]=O(s[2].toLowerCase()))),s.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let e;return t.forEach((t=>{if(e)return;const s=this.formatLanguageCode(t);this.options.supportedLngs&&!this.isSupportedCode(s)||(e=s)})),!e&&this.options.supportedLngs&&t.forEach((t=>{if(e)return;const s=this.getLanguagePartFromCode(t);if(this.isSupportedCode(s))return e=s;e=this.options.supportedLngs.find((t=>t===s?t:t.indexOf("-")<0&&s.indexOf("-")<0?void 0:0===t.indexOf(s)?t:void 0))})),e||(e=this.getFallbackCodes(this.options.fallbackLng)[0]),e}getFallbackCodes(t,e){if(!t)return[];if("function"==typeof t&&(t=t(e)),"string"==typeof t&&(t=[t]),"[object Array]"===Object.prototype.toString.apply(t))return t;if(!e)return t.default||[];let s=t[e];return s||(s=t[this.getScriptPartFromCode(e)]),s||(s=t[this.formatLanguageCode(e)]),s||(s=t[this.getLanguagePartFromCode(e)]),s||(s=t.default),s||[]}toResolveHierarchy(t,e){const s=this.getFallbackCodes(e||this.options.fallbackLng||[],t),n=[],i=t=>{t&&(this.isSupportedCode(t)?n.push(t):this.logger.warn(`rejecting language code not found in supportedLngs: ${t}`))};return"string"==typeof t&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(t)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(t)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(t))):"string"==typeof t&&i(this.formatLanguageCode(t)),s.forEach((t=>{n.indexOf(t)<0&&i(this.formatLanguageCode(t))})),n}}let R=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],L={1:function(t){return Number(t>1)},2:function(t){return Number(1!=t)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(0==t?0:1==t?1:2==t?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(1==t?0:t>=2&&t<=4?1:2)},7:function(t){return Number(1==t?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(1==t?0:2==t?1:8!=t&&11!=t?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(1==t?0:2==t?1:t<7?2:t<11?3:4)},11:function(t){return Number(1==t||11==t?0:2==t||12==t?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(0!==t)},14:function(t){return Number(1==t?0:2==t?1:3==t?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:0!==t?1:2)},17:function(t){return Number(1==t||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(0==t?0:1==t?1:2)},19:function(t){return Number(1==t?0:0==t||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(1==t?0:0==t||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(1==t?0:2==t?1:(t<0||t>10)&&t%10==0?2:3)}};const P=["v1","v2","v3"],A=["v4"],I={zero:0,one:1,two:2,few:3,many:4,other:5};function C(){const t={};return R.forEach((e=>{e.lngs.forEach((s=>{t[s]={numbers:e.nr,plurals:L[e.fc]}}))})),t}class B{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=t,this.options=e,this.logger=n.create("pluralResolver"),this.options.compatibilityJSON&&!A.includes(this.options.compatibilityJSON)||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=C()}addRule(t,e){this.rules[t]=e}getRule(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(w(t),{type:e.ordinal?"ordinal":"cardinal"})}catch(t){return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const s=this.getRule(t,e);return this.shouldUseIntlApi()?s&&s.resolvedOptions().pluralCategories.length>1:s&&s.numbers.length>1}getPluralFormsOfKey(t,e){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(t,s).map((t=>`${e}${t}`))}getSuffixes(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const s=this.getRule(t,e);return s?this.shouldUseIntlApi()?s.resolvedOptions().pluralCategories.sort(((t,e)=>I[t]-I[e])).map((t=>`${this.options.prepend}${e.ordinal?`ordinal${this.options.prepend}`:""}${t}`)):s.numbers.map((s=>this.getSuffix(t,s,e))):[]}getSuffix(t,e){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=this.getRule(t,s);return n?this.shouldUseIntlApi()?`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${n.select(e)}`:this.getSuffixRetroCompatible(n,e):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,e){const s=t.noAbs?t.plurals(e):t.plurals(Math.abs(e));let n=t.numbers[s];this.options.simplifyPluralSuffix&&2===t.numbers.length&&1===t.numbers[0]&&(2===n?n="plural":1===n&&(n=""));const i=()=>this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString();return"v1"===this.options.compatibilityJSON?1===n?"":"number"==typeof n?`_plural_${n.toString()}`:i():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===t.numbers.length&&1===t.numbers[0]?i():this.options.prepend&&s.toString()?this.options.prepend+s.toString():s.toString()}shouldUseIntlApi(){return!P.includes(this.options.compatibilityJSON)}}function E(t,e,s){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=d(t,e,s);return!o&&i&&"string"==typeof s&&(o=v(t,s,n),void 0===o&&(o=v(e,s,n))),o}class K{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=n.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(t=>t),this.init(t)}init(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const e=t.interpolation;this.escape=void 0!==e.escape?e.escape:m,this.escapeValue=void 0===e.escapeValue||e.escapeValue,this.useRawValueToEscape=void 0!==e.useRawValueToEscape&&e.useRawValueToEscape,this.prefix=e.prefix?p(e.prefix):e.prefixEscaped||"{{",this.suffix=e.suffix?p(e.suffix):e.suffixEscaped||"}}",this.formatSeparator=e.formatSeparator?e.formatSeparator:e.formatSeparator||",",this.unescapePrefix=e.unescapeSuffix?"":e.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":e.unescapeSuffix||"",this.nestingPrefix=e.nestingPrefix?p(e.nestingPrefix):e.nestingPrefixEscaped||p("$t("),this.nestingSuffix=e.nestingSuffix?p(e.nestingSuffix):e.nestingSuffixEscaped||p(")"),this.nestingOptionsSeparator=e.nestingOptionsSeparator?e.nestingOptionsSeparator:e.nestingOptionsSeparator||",",this.maxReplaces=e.maxReplaces?e.maxReplaces:1e3,this.alwaysFormat=void 0!==e.alwaysFormat&&e.alwaysFormat,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=`${this.prefix}(.+?)${this.suffix}`;this.regexp=new RegExp(t,"g");const e=`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`;this.regexpUnescape=new RegExp(e,"g");const s=`${this.nestingPrefix}(.+?)${this.nestingSuffix}`;this.nestingRegexp=new RegExp(s,"g")}interpolate(t,e,s,n){let i,r,a;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function u(t){return t.replace(/\$/g,"$$$$")}const c=t=>{if(t.indexOf(this.formatSeparator)<0){const i=E(e,l,t,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,s,{...n,...e,interpolationkey:t}):i}const i=t.split(this.formatSeparator),o=i.shift().trim(),r=i.join(this.formatSeparator).trim();return this.format(E(e,l,o,this.options.keySeparator,this.options.ignoreJSONStructure),r,s,{...n,...e,interpolationkey:o})};this.resetRegExp();const h=n&&n.missingInterpolationHandler||this.options.missingInterpolationHandler,p=n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,g=[{regex:this.regexpUnescape,safeValue:t=>u(t)},{regex:this.regexp,safeValue:t=>this.escapeValue?u(this.escape(t)):u(t)}];return g.forEach((e=>{for(a=0;i=e.regex.exec(t);){const s=i[1].trim();if(r=c(s),void 0===r)if("function"==typeof h){const e=h(t,i,n);r="string"==typeof e?e:""}else if(n&&Object.prototype.hasOwnProperty.call(n,s))r="";else{if(p){r=i[0];continue}this.logger.warn(`missed to pass in variable ${s} for interpolating ${t}`),r=""}else"string"==typeof r||this.useRawValueToEscape||(r=o(r));const l=e.safeValue(r);if(t=t.replace(i[0],l),p?(e.regex.lastIndex+=r.length,e.regex.lastIndex-=i[0].length):e.regex.lastIndex=0,a++,a>=this.maxReplaces)break}})),t}nest(t,e){let s,n,i,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};function a(t,e){const s=this.nestingOptionsSeparator;if(t.indexOf(s)<0)return t;const n=t.split(new RegExp(`${s}[ ]*{`));let o=`{${n[1]}`;t=n[0],o=this.interpolate(o,i);const r=o.match(/'/g),a=o.match(/"/g);(r&&r.length%2==0&&!a||a.length%2!=0)&&(o=o.replace(/'/g,'"'));try{i=JSON.parse(o),e&&(i={...e,...i})}catch(e){return this.logger.warn(`failed parsing options string in nesting for key ${t}`,e),`${t}${s}${o}`}return delete i.defaultValue,t}for(;s=this.nestingRegexp.exec(t);){let l=[];i={...r},i=i.replace&&"string"!=typeof i.replace?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;let u=!1;if(-1!==s[0].indexOf(this.formatSeparator)&&!/{.*}/.test(s[1])){const t=s[1].split(this.formatSeparator).map((t=>t.trim()));s[1]=t.shift(),l=t,u=!0}if(n=e(a.call(this,s[1].trim(),i),i),n&&s[0]===t&&"string"!=typeof n)return n;"string"!=typeof n&&(n=o(n)),n||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${t}`),n=""),u&&(n=l.reduce(((t,e)=>this.format(t,e,r.lng,{...r,interpolationkey:s[1].trim()})),n.trim())),t=t.replace(s[0],n),this.regexp.lastIndex=0}return t}}function z(t){let e=t.toLowerCase().trim();const s={};if(t.indexOf("(")>-1){const n=t.split("(");e=n[0].toLowerCase().trim();const i=n[1].substring(0,n[1].length-1);if("currency"===e&&i.indexOf(":")<0)s.currency||(s.currency=i.trim());else if("relativetime"===e&&i.indexOf(":")<0)s.range||(s.range=i.trim());else{i.split(";").forEach((t=>{if(!t)return;const[e,...n]=t.split(":"),i=n.join(":").trim().replace(/^'+|'+$/g,"");s[e.trim()]||(s[e.trim()]=i),"false"===i&&(s[e.trim()]=!1),"true"===i&&(s[e.trim()]=!0),isNaN(i)||(s[e.trim()]=parseInt(i,10))}))}}return{formatName:e,formatOptions:s}}function T(t){const e={};return function(s,n,i){const o=n+JSON.stringify(i);let r=e[o];return r||(r=t(w(n),i),e[o]=r),r(s)}}class V{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=n.create("formatter"),this.options=t,this.formats={number:T(((t,e)=>{const s=new Intl.NumberFormat(t,{...e});return t=>s.format(t)})),currency:T(((t,e)=>{const s=new Intl.NumberFormat(t,{...e,style:"currency"});return t=>s.format(t)})),datetime:T(((t,e)=>{const s=new Intl.DateTimeFormat(t,{...e});return t=>s.format(t)})),relativetime:T(((t,e)=>{const s=new Intl.RelativeTimeFormat(t,{...e});return t=>s.format(t,e.range||"day")})),list:T(((t,e)=>{const s=new Intl.ListFormat(t,{...e});return t=>s.format(t)}))},this.init(t)}init(t){const e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=e.formatSeparator?e.formatSeparator:e.formatSeparator||","}add(t,e){this.formats[t.toLowerCase().trim()]=e}addCached(t,e){this.formats[t.toLowerCase().trim()]=T(e)}format(t,e,s){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=e.split(this.formatSeparator).reduce(((t,e)=>{const{formatName:i,formatOptions:o}=z(e);if(this.formats[i]){let e=t;try{const r=n&&n.formatParams&&n.formatParams[n.interpolationkey]||{},a=r.locale||r.lng||n.locale||n.lng||s;e=this.formats[i](t,a,{...o,...n,...r})}catch(t){this.logger.warn(t)}return e}return this.logger.warn(`there was no format function for ${i}`),t}),t);return i}}function F(t,e){void 0!==t.pending[e]&&(delete t.pending[e],t.pendingCount--)}class _ extends r{constructor(t,e,s){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(),this.backend=t,this.store=e,this.services=s,this.languageUtils=s.languageUtils,this.options=i,this.logger=n.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(s,i.backend,i)}queueLoad(t,e,s,n){const i={},o={},r={},a={};return t.forEach((t=>{let n=!0;e.forEach((e=>{const r=`${t}|${e}`;!s.reload&&this.store.hasResourceBundle(t,e)?this.state[r]=2:this.state[r]<0||(1===this.state[r]?void 0===o[r]&&(o[r]=!0):(this.state[r]=1,n=!1,void 0===o[r]&&(o[r]=!0),void 0===i[r]&&(i[r]=!0),void 0===a[e]&&(a[e]=!0)))})),n||(r[t]=!0)})),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(r),toLoadNamespaces:Object.keys(a)}}loaded(t,e,s){const n=t.split("|"),i=n[0],o=n[1];e&&this.emit("failedLoading",i,o,e),s&&this.store.addResourceBundle(i,o,s),this.state[t]=e?-1:2;const r={};this.queue.forEach((s=>{l(s.loaded,[i],o),F(s,t),e&&s.errors.push(e),0!==s.pendingCount||s.done||(Object.keys(s.loaded).forEach((t=>{r[t]||(r[t]={});const e=s.loaded[t];e.length&&e.forEach((e=>{void 0===r[t][e]&&(r[t][e]=!0)}))})),s.done=!0,s.errors.length?s.callback(s.errors):s.callback())})),this.emit("loaded",r),this.queue=this.queue.filter((t=>!t.done))}read(t,e,s){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;if(!t.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:t,ns:e,fcName:s,tried:n,wait:i,callback:o});this.readingCalls++;const r=(r,a)=>{if(this.readingCalls--,this.waitingReads.length>0){const t=this.waitingReads.shift();this.read(t.lng,t.ns,t.fcName,t.tried,t.wait,t.callback)}r&&a&&n<this.maxRetries?setTimeout((()=>{this.read.call(this,t,e,s,n+1,2*i,o)}),i):o(r,a)},a=this.backend[s].bind(this.backend);if(2!==a.length)return a(t,e,r);try{const s=a(t,e);s&&"function"==typeof s.then?s.then((t=>r(null,t))).catch(r):r(null,s)}catch(t){r(t)}}prepareLoading(t,e){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();"string"==typeof t&&(t=this.languageUtils.toResolveHierarchy(t)),"string"==typeof e&&(e=[e]);const i=this.queueLoad(t,e,s,n);if(!i.toLoad.length)return i.pending.length||n(),null;i.toLoad.forEach((t=>{this.loadOne(t)}))}load(t,e,s){this.prepareLoading(t,e,{},s)}reload(t,e,s){this.prepareLoading(t,e,{reload:!0},s)}loadOne(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const s=t.split("|"),n=s[0],i=s[1];this.read(n,i,"read",void 0,void 0,((s,o)=>{s&&this.logger.warn(`${e}loading namespace ${i} for language ${n} failed`,s),!s&&o&&this.logger.log(`${e}loaded namespace ${i} for language ${n}`,o),this.loaded(t,s,o)}))}saveMissing(t,e,s,n,i){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(e))this.logger.warn(`did not save key "${s}" as the namespace "${e}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");else if(null!=s&&""!==s){if(this.backend&&this.backend.create){const a={...o,isUpdate:i},l=this.backend.create.bind(this.backend);if(l.length<6)try{let i;i=5===l.length?l(t,e,s,n,a):l(t,e,s,n),i&&"function"==typeof i.then?i.then((t=>r(null,t))).catch(r):r(null,i)}catch(t){r(t)}else l(t,e,s,n,r,a)}t&&t[0]&&this.store.addResource(t[0],e,s,n)}}}function D(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){let e={};if("object"==typeof t[1]&&(e=t[1]),"string"==typeof t[1]&&(e.defaultValue=t[1]),"string"==typeof t[2]&&(e.tDescription=t[2]),"object"==typeof t[2]||"object"==typeof t[3]){const s=t[3]||t[2];Object.keys(s).forEach((t=>{e[t]=s[t]}))}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function M(t){return"string"==typeof t.ns&&(t.ns=[t.ns]),"string"==typeof t.fallbackLng&&(t.fallbackLng=[t.fallbackLng]),"string"==typeof t.fallbackNS&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t}function U(){}function J(t){Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach((e=>{"function"==typeof t[e]&&(t[e]=t[e].bind(t))}))}class W extends r{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;if(super(),this.options=M(t),this.services={},this.logger=n,this.modules={external:[]},J(this),e&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,e),this;setTimeout((()=>{this.init(t,e)}),0)}}init(){var t=this;let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;"function"==typeof e&&(s=e,e={}),!e.defaultNS&&!1!==e.defaultNS&&e.ns&&("string"==typeof e.ns?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const i=D();function o(t){return t?"function"==typeof t?new t:t:null}if(this.options={...i,...this.options,...M(e)},"v1"!==this.options.compatibilityAPI&&(this.options.interpolation={...i.interpolation,...this.options.interpolation}),void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator),!this.options.isClone){let e;this.modules.logger?n.init(o(this.modules.logger),this.options):n.init(null,this.options),this.modules.formatter?e=this.modules.formatter:"undefined"!=typeof Intl&&(e=V);const s=new S(this.options);this.store=new j(this.options.resources,this.options);const r=this.services;r.logger=n,r.resourceStore=this.store,r.languageUtils=s,r.pluralResolver=new B(s,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!e||this.options.interpolation.format&&this.options.interpolation.format!==i.interpolation.format||(r.formatter=o(e),r.formatter.init(r,this.options),this.options.interpolation.format=r.formatter.format.bind(r.formatter)),r.interpolator=new K(this.options),r.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},r.backendConnector=new _(o(this.modules.backend),r.resourceStore,r,this.options),r.backendConnector.on("*",(function(e){for(var s=arguments.length,n=new Array(s>1?s-1:0),i=1;i<s;i++)n[i-1]=arguments[i];t.emit(e,...n)})),this.modules.languageDetector&&(r.languageDetector=o(this.modules.languageDetector),r.languageDetector.init&&r.languageDetector.init(r,this.options.detection,this.options)),this.modules.i18nFormat&&(r.i18nFormat=o(this.modules.i18nFormat),r.i18nFormat.init&&r.i18nFormat.init(this)),this.translator=new x(this.services,this.options),this.translator.on("*",(function(e){for(var s=arguments.length,n=new Array(s>1?s-1:0),i=1;i<s;i++)n[i-1]=arguments[i];t.emit(e,...n)})),this.modules.external.forEach((t=>{t.init&&t.init(this)}))}if(this.format=this.options.interpolation.format,s||(s=U),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const t=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);t.length>0&&"dev"!==t[0]&&(this.options.lng=t[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((e=>{this[e]=function(){return t.store[e](...arguments)}}));["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((e=>{this[e]=function(){return t.store[e](...arguments),t}}));const r=f(),a=()=>{const t=(t,e)=>{this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),r.resolve(e),s(t,e)};if(this.languages&&"v1"!==this.options.compatibilityAPI&&!this.isInitialized)return t(null,this.t.bind(this));this.changeLanguage(this.options.lng,t)};return this.options.resources||!this.options.initImmediate?a():setTimeout(a,0),r}loadResources(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:U;const s="string"==typeof t?t:this.language;if("function"==typeof t&&(e=t),!this.options.resources||this.options.partialBundledLanguages){if(s&&"cimode"===s.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return e();const t=[],n=e=>{if(!e)return;if("cimode"===e)return;this.services.languageUtils.toResolveHierarchy(e).forEach((e=>{"cimode"!==e&&t.indexOf(e)<0&&t.push(e)}))};if(s)n(s);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((t=>n(t)))}this.options.preload&&this.options.preload.forEach((t=>n(t))),this.services.backendConnector.load(t,this.options.ns,(t=>{t||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),e(t)}))}else e(null)}reloadResources(t,e,s){const n=f();return t||(t=this.languages),e||(e=this.options.ns),s||(s=U),this.services.backendConnector.reload(t,e,(t=>{n.resolve(),s(t)})),n}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===t.type&&(this.modules.backend=t),("logger"===t.type||t.log&&t.warn&&t.error)&&(this.modules.logger=t),"languageDetector"===t.type&&(this.modules.languageDetector=t),"i18nFormat"===t.type&&(this.modules.i18nFormat=t),"postProcessor"===t.type&&N.addPostProcessor(t),"formatter"===t.type&&(this.modules.formatter=t),"3rdParty"===t.type&&this.modules.external.push(t),this}setResolvedLanguage(t){if(t&&this.languages&&!(["cimode","dev"].indexOf(t)>-1))for(let t=0;t<this.languages.length;t++){const e=this.languages[t];if(!(["cimode","dev"].indexOf(e)>-1)&&this.store.hasLanguageSomeTranslations(e)){this.resolvedLanguage=e;break}}}changeLanguage(t,e){var s=this;this.isLanguageChangingTo=t;const n=f();this.emit("languageChanging",t);const i=t=>{this.language=t,this.languages=this.services.languageUtils.toResolveHierarchy(t),this.resolvedLanguage=void 0,this.setResolvedLanguage(t)},o=(t,o)=>{o?(i(o),this.translator.changeLanguage(o),this.isLanguageChangingTo=void 0,this.emit("languageChanged",o),this.logger.log("languageChanged",o)):this.isLanguageChangingTo=void 0,n.resolve((function(){return s.t(...arguments)})),e&&e(t,(function(){return s.t(...arguments)}))},r=e=>{t||e||!this.services.languageDetector||(e=[]);const s="string"==typeof e?e:this.services.languageUtils.getBestMatchFromCodes(e);s&&(this.language||i(s),this.translator.language||this.translator.changeLanguage(s),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(s)),this.loadResources(s,(t=>{o(t,s)}))};return t||!this.services.languageDetector||this.services.languageDetector.async?!t&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(r):this.services.languageDetector.detect(r):r(t):r(this.services.languageDetector.detect()),n}getFixedT(t,e,s){var n=this;const i=function(t,e){let o;if("object"!=typeof e){for(var r=arguments.length,a=new Array(r>2?r-2:0),l=2;l<r;l++)a[l-2]=arguments[l];o=n.options.overloadTranslationOptionHandler([t,e].concat(a))}else o={...e};o.lng=o.lng||i.lng,o.lngs=o.lngs||i.lngs,o.ns=o.ns||i.ns,o.keyPrefix=o.keyPrefix||s||i.keyPrefix;const u=n.options.keySeparator||".";let c;return c=o.keyPrefix&&Array.isArray(t)?t.map((t=>`${o.keyPrefix}${u}${t}`)):o.keyPrefix?`${o.keyPrefix}${u}${t}`:t,n.t(c,o)};return"string"==typeof t?i.lng=t:i.lngs=t,i.ns=e,i.keyPrefix=s,i}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const s=e.lng||this.resolvedLanguage||this.languages[0],n=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===s.toLowerCase())return!0;const o=(t,e)=>{const s=this.services.backendConnector.state[`${t}|${e}`];return-1===s||2===s};if(e.precheck){const t=e.precheck(this,o);if(void 0!==t)return t}return!!this.hasResourceBundle(s,t)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!o(s,t)||n&&!o(i,t)))}loadNamespaces(t,e){const s=f();return this.options.ns?("string"==typeof t&&(t=[t]),t.forEach((t=>{this.options.ns.indexOf(t)<0&&this.options.ns.push(t)})),this.loadResources((t=>{s.resolve(),e&&e(t)})),s):(e&&e(),Promise.resolve())}loadLanguages(t,e){const s=f();"string"==typeof t&&(t=[t]);const n=this.options.preload||[],i=t.filter((t=>n.indexOf(t)<0));return i.length?(this.options.preload=n.concat(i),this.loadResources((t=>{s.resolve(),e&&e(t)})),s):(e&&e(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const e=this.services&&this.services.languageUtils||new S(D());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(e.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){return new W(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}cloneInstance(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:U;const s=t.forkResourceStore;s&&delete t.forkResourceStore;const n={...this.options,...t,isClone:!0},i=new W(n);void 0===t.debug&&void 0===t.prefix||(i.logger=i.logger.clone(t));return["store","services","language"].forEach((t=>{i[t]=this[t]})),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},s&&(i.store=new j(this.store.data,n),i.services.resourceStore=i.store),i.translator=new x(i.services,n),i.translator.on("*",(function(t){for(var e=arguments.length,s=new Array(e>1?e-1:0),n=1;n<e;n++)s[n-1]=arguments[n];i.emit(t,...s)})),i.init(n,e),i.translator.options=n,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const q=W.createInstance();q.createInstance=W.createInstance;class H{constructor(){}static async createInstance(t,e){return Array.isArray(e)?e=new Set(e):"function"==typeof e&&(e=new Set([e])),H.instance=new H,q.isInitialized?await q.loadNamespaces(H.namespace):await q.init({ns:[H.namespace],lng:t}),void 0!==e&&e.forEach((t=>t(((t,e)=>(H.instance.addResourceBundle(t,e),t))))),this.instance}static addResourceBundle(t,e){q.addResourceBundle(t,H.namespace,e,!0)}addResourceBundle(t,e){H.addResourceBundle(t,e)}translate(t,e){return q.t(t,Object.assign({ns:H.namespace,count:null==e?void 0:e.count},null==e?void 0:e.placeholders))}}H.namespace="KoliBri";const Y=async(s,n,i)=>{var o,r;return void 0===e().I18n&&Object.defineProperty(e(),"I18n",{value:await H.createInstance(null!==(r=null===(o=null==i?void 0:i.translation)||void 0===o?void 0:o.name)&&void 0!==r?r:"de",null==i?void 0:i.translations),writable:!1}),await t(s,n,i)},G=()=>e().I18n;export{G as g,Y as r};
|
4
|
+
import{_ as t}from"./index-807d8631.js";import{g as e}from"./dev.utils-69ed2492.js";const i={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){console&&console[t]&&console[t].apply(console,e)}};class s{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.init(t,e)}init(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=e.prefix||"i18next:",this.logger=t||i,this.options=e,this.debug=e.debug}log(){for(var t=arguments.length,e=new Array(t),s=0;s<t;s++)e[s]=arguments[s];return this.forward(e,"log","",!0)}warn(){for(var t=arguments.length,e=new Array(t),s=0;s<t;s++)e[s]=arguments[s];return this.forward(e,"warn","",!0)}error(){for(var t=arguments.length,e=new Array(t),s=0;s<t;s++)e[s]=arguments[s];return this.forward(e,"error","")}deprecate(){for(var t=arguments.length,e=new Array(t),s=0;s<t;s++)e[s]=arguments[s];return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(t,e,s,n){return n&&!this.debug?null:("string"==typeof t[0]&&(t[0]=`${s}${this.prefix} ${t[0]}`),this.logger[e](t))}create(t){return new s(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new s(this.logger,t)}}var n=new s;class r{constructor(){this.observers={}}on(t,e){return t.split(" ").forEach((t=>{this.observers[t]=this.observers[t]||[],this.observers[t].push(e)})),this}off(t,e){this.observers[t]&&(e?this.observers[t]=this.observers[t].filter((t=>t!==e)):delete this.observers[t])}emit(t){for(var e=arguments.length,s=new Array(e>1?e-1:0),n=1;n<e;n++)s[n-1]=arguments[n];if(this.observers[t]){[].concat(this.observers[t]).forEach((t=>{t(...s)}))}if(this.observers["*"]){[].concat(this.observers["*"]).forEach((e=>{e.apply(e,[t,...s])}))}}}function f(){let t,e;const s=new Promise(((s,n)=>{t=s,e=n}));return s.resolve=t,s.reject=e,s}function o(t){return null==t?"":""+t}function u(t,e,s){t.forEach((t=>{e[t]&&(s[t]=e[t])}))}function h(t,e,s){function n(t){return t&&t.indexOf("###")>-1?t.replace(/###/g,"."):t}function i(){return!t||"string"==typeof t}const o="string"!=typeof e?[].concat(e):e.split(".");for(;o.length>1;){if(i())return{};const e=n(o.shift());!t[e]&&s&&(t[e]=new s),t=Object.prototype.hasOwnProperty.call(t,e)?t[e]:{}}return i()?{}:{obj:t,k:n(o.shift())}}function a(t,e,s){const{obj:n,k:i}=h(t,e,Object);n[i]=s}function l(t,e,s,n){const{obj:i,k:o}=h(t,e,Object);i[o]=i[o]||[],n&&(i[o]=i[o].concat(s)),n||i[o].push(s)}function c(t,e){const{obj:s,k:n}=h(t,e);if(s)return s[n]}function d(t,e,s){const n=c(t,s);return void 0!==n?n:c(e,s)}function g(t,e,s){for(const n in e)"__proto__"!==n&&"constructor"!==n&&(n in t?"string"==typeof t[n]||t[n]instanceof String||"string"==typeof e[n]||e[n]instanceof String?s&&(t[n]=e[n]):g(t[n],e[n],s):t[n]=e[n]);return t}function p(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var y={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function m(t){return"string"==typeof t?t.replace(/[&<>"'\/]/g,(t=>y[t])):t}const b=[" ",",","?","!",";"];function $(t,e,s){e=e||"",s=s||"";const n=b.filter((t=>e.indexOf(t)<0&&s.indexOf(t)<0));if(0===n.length)return!0;const i=new RegExp(`(${n.map((t=>"?"===t?"\\?":t)).join("|")})`);let o=!i.test(t);if(!o){const e=t.indexOf(s);e>0&&!i.test(t.substring(0,e))&&(o=!0)}return o}function v(t,e){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(!t)return;if(t[e])return t[e];const n=e.split(s);let i=t;for(let t=0;t<n.length;++t){if(!i)return;if("string"==typeof i[n[t]]&&t+1<n.length)return;if(void 0===i[n[t]]){let o=2,r=n.slice(t,t+o).join(s),a=i[r];for(;void 0===a&&n.length>t+o;)o++,r=n.slice(t,t+o).join(s),a=i[r];if(void 0===a)return;if(null===a)return null;if(e.endsWith(r)){if("string"==typeof a)return a;if(r&&"string"==typeof a[r])return a[r]}const l=n.slice(t+o).join(s);return l?v(a,l,s):void 0}i=i[n[t]]}return i}function w(t){return t&&t.indexOf("_")>0?t.replace("_","-"):t}class j extends r{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=e,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const e=this.options.ns.indexOf(t);e>-1&&this.options.ns.splice(e,1)}getResource(t,e,s){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,o=void 0!==n.ignoreJSONStructure?n.ignoreJSONStructure:this.options.ignoreJSONStructure;let r=[t,e];s&&"string"!=typeof s&&(r=r.concat(s)),s&&"string"==typeof s&&(r=r.concat(i?s.split(i):s)),t.indexOf(".")>-1&&(r=t.split("."));const a=c(this.data,r);return a||!o||"string"!=typeof s?a:v(this.data&&this.data[t]&&this.data[t][e],s,i)}addResource(t,e,s,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1};const o=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator;let r=[t,e];s&&(r=r.concat(o?s.split(o):s)),t.indexOf(".")>-1&&(r=t.split("."),n=e,e=r[1]),this.addNamespaces(e),a(this.data,r,n),i.silent||this.emit("added",t,e,s,n)}addResources(t,e,s){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(const n in s)"string"!=typeof s[n]&&"[object Array]"!==Object.prototype.toString.apply(s[n])||this.addResource(t,e,n,s[n],{silent:!0});n.silent||this.emit("added",t,e,s)}addResourceBundle(t,e,s,n,i){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},r=[t,e];t.indexOf(".")>-1&&(r=t.split("."),n=s,s=e,e=r[1]),this.addNamespaces(e);let l=c(this.data,r)||{};n?g(l,s,i):l={...l,...s},a(this.data,r,l),o.silent||this.emit("added",t,e,s)}removeResourceBundle(t,e){this.hasResourceBundle(t,e)&&delete this.data[t][e],this.removeNamespaces(e),this.emit("removed",t,e)}hasResourceBundle(t,e){return void 0!==this.getResource(t,e)}getResourceBundle(t,e){return e||(e=this.options.defaultNS),"v1"===this.options.compatibilityAPI?{...this.getResource(t,e)}:this.getResource(t,e)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const e=this.getDataByLanguage(t);return!!(e&&Object.keys(e)||[]).find((t=>e[t]&&Object.keys(e[t]).length>0))}toJSON(){return this.data}}var N={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,s,n,i){return t.forEach((t=>{this.processors[t]&&(e=this.processors[t].process(e,s,n,i))})),e}};const k={};class x extends r{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),u(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=e,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=n.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==t)return!1;const s=this.resolve(t,e);return s&&void 0!==s.res}extractFromKey(t,e){let s=void 0!==e.nsSeparator?e.nsSeparator:this.options.nsSeparator;void 0===s&&(s=":");const n=void 0!==e.keySeparator?e.keySeparator:this.options.keySeparator;let i=e.ns||this.options.defaultNS||[];const o=s&&t.indexOf(s)>-1,r=!(this.options.userDefinedKeySeparator||e.keySeparator||this.options.userDefinedNsSeparator||e.nsSeparator||$(t,s,n));if(o&&!r){const e=t.match(this.interpolator.nestingRegexp);if(e&&e.length>0)return{key:t,namespaces:i};const o=t.split(s);(s!==n||s===n&&this.options.ns.indexOf(o[0])>-1)&&(i=o.shift()),t=o.join(n)}return"string"==typeof i&&(i=[i]),{key:t,namespaces:i}}translate(t,e,s){if("object"!=typeof e&&this.options.overloadTranslationOptionHandler&&(e=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof e&&(e={...e}),e||(e={}),null==t)return"";Array.isArray(t)||(t=[String(t)]);const n=void 0!==e.returnDetails?e.returnDetails:this.options.returnDetails,i=void 0!==e.keySeparator?e.keySeparator:this.options.keySeparator,{key:o,namespaces:r}=this.extractFromKey(t[t.length-1],e),a=r[r.length-1],l=e.lng||this.language,u=e.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(l&&"cimode"===l.toLowerCase()){if(u){const t=e.nsSeparator||this.options.nsSeparator;return n?{res:`${a}${t}${o}`,usedKey:o,exactUsedKey:o,usedLng:l,usedNS:a,usedParams:this.getUsedParamsDetails(e)}:`${a}${t}${o}`}return n?{res:o,usedKey:o,exactUsedKey:o,usedLng:l,usedNS:a,usedParams:this.getUsedParamsDetails(e)}:o}const c=this.resolve(t,e);let h=c&&c.res;const p=c&&c.usedKey||o,g=c&&c.exactUsedKey||o,d=Object.prototype.toString.apply(h),f=void 0!==e.joinArrays?e.joinArrays:this.options.joinArrays,m=!this.i18nFormat||this.i18nFormat.handleAsObject;if(m&&h&&("string"!=typeof h&&"boolean"!=typeof h&&"number"!=typeof h)&&["[object Number]","[object Function]","[object RegExp]"].indexOf(d)<0&&("string"!=typeof f||"[object Array]"!==d)){if(!e.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const t=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,h,{...e,ns:r}):`key '${o} (${this.language})' returned an object instead of string.`;return n?(c.res=t,c.usedParams=this.getUsedParamsDetails(e),c):t}if(i){const t="[object Array]"===d,s=t?[]:{},n=t?g:p;for(const t in h)if(Object.prototype.hasOwnProperty.call(h,t)){const o=`${n}${i}${t}`;s[t]=this.translate(o,{...e,joinArrays:!1,ns:r}),s[t]===o&&(s[t]=h[t])}h=s}}else if(m&&"string"==typeof f&&"[object Array]"===d)h=h.join(f),h&&(h=this.extendTranslation(h,t,e,s));else{let n=!1,r=!1;const u=void 0!==e.count&&"string"!=typeof e.count,p=x.hasDefaultValue(e),g=u?this.pluralResolver.getSuffix(l,e.count,e):"",d=e.ordinal&&u?this.pluralResolver.getSuffix(l,e.count,{ordinal:!1}):"",f=u&&!e.ordinal&&0===e.count&&this.pluralResolver.shouldUseIntlApi()&&e[`defaultValue${this.options.pluralSeparator}zero`]||e[`defaultValue${g}`]||e[`defaultValue${d}`]||e.defaultValue;!this.isValidLookup(h)&&p&&(n=!0,h=f),this.isValidLookup(h)||(r=!0,h=o);const m=(e.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&r?void 0:h,y=p&&f!==h&&this.options.updateMissing;if(r||n||y){if(this.logger.log(y?"updateKey":"missingKey",l,a,o,y?f:h),i){const t=this.resolve(o,{...e,keySeparator:!1});t&&t.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let t=[];const s=this.languageUtils.getFallbackCodes(this.options.fallbackLng,e.lng||this.language);if("fallback"===this.options.saveMissingTo&&s&&s[0])for(let e=0;e<s.length;e++)t.push(s[e]);else"all"===this.options.saveMissingTo?t=this.languageUtils.toResolveHierarchy(e.lng||this.language):t.push(e.lng||this.language);const n=(t,s,n)=>{const i=p&&n!==h?n:m;this.options.missingKeyHandler?this.options.missingKeyHandler(t,a,s,i,y,e):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(t,a,s,i,y,e),this.emit("missingKey",t,a,s,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&u?t.forEach((t=>{this.pluralResolver.getSuffixes(t,e).forEach((s=>{n([t],o+s,e[`defaultValue${s}`]||f)}))})):n(t,o,f))}h=this.extendTranslation(h,t,e,c,s),r&&h===o&&this.options.appendNamespaceToMissingKey&&(h=`${a}:${o}`),(r||n)&&this.options.parseMissingKeyHandler&&(h="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${a}:${o}`:o,n?h:void 0):this.options.parseMissingKeyHandler(h))}return n?(c.res=h,c.usedParams=this.getUsedParamsDetails(e),c):h}extendTranslation(t,e,s,n,i){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...s},s.lng||this.language||n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init({...s,interpolation:{...this.options.interpolation,...s.interpolation}});const r="string"==typeof t&&(s&&s.interpolation&&void 0!==s.interpolation.skipOnVariables?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let a;if(r){const e=t.match(this.interpolator.nestingRegexp);a=e&&e.length}let l=s.replace&&"string"!=typeof s.replace?s.replace:s;if(this.options.interpolation.defaultVariables&&(l={...this.options.interpolation.defaultVariables,...l}),t=this.interpolator.interpolate(t,l,s.lng||this.language,s),r){const e=t.match(this.interpolator.nestingRegexp);a<(e&&e.length)&&(s.nest=!1)}!s.lng&&"v1"!==this.options.compatibilityAPI&&n&&n.res&&(s.lng=n.usedLng),!1!==s.nest&&(t=this.interpolator.nest(t,(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return i&&i[0]===n[0]&&!s.context?(o.logger.warn(`It seems you are nesting recursively key: ${n[0]} in key: ${e[0]}`),null):o.translate(...n,e)}),s)),s.interpolation&&this.interpolator.reset()}const r=s.postProcess||this.options.postProcess,a="string"==typeof r?[r]:r;return null!=t&&a&&a.length&&!1!==s.applyPostProcessor&&(t=N.handle(a,t,e,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...n,usedParams:this.getUsedParamsDetails(s)},...s}:s,this)),t}resolve(t){let e,s,n,i,o,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof t&&(t=[t]),t.forEach((t=>{if(this.isValidLookup(e))return;const a=this.extractFromKey(t,r),l=a.key;s=l;let u=a.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));const c=void 0!==r.count&&"string"!=typeof r.count,h=c&&!r.ordinal&&0===r.count&&this.pluralResolver.shouldUseIntlApi(),p=void 0!==r.context&&("string"==typeof r.context||"number"==typeof r.context)&&""!==r.context,g=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);u.forEach((t=>{this.isValidLookup(e)||(o=t,!k[`${g[0]}-${t}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(o)&&(k[`${g[0]}-${t}`]=!0,this.logger.warn(`key "${s}" for languages "${g.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),g.forEach((s=>{if(this.isValidLookup(e))return;i=s;const o=[l];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(o,l,s,t,r);else{let t;c&&(t=this.pluralResolver.getSuffix(s,r.count,r));const e=`${this.options.pluralSeparator}zero`,n=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(o.push(l+t),r.ordinal&&0===t.indexOf(n)&&o.push(l+t.replace(n,this.options.pluralSeparator)),h&&o.push(l+e)),p){const s=`${l}${this.options.contextSeparator}${r.context}`;o.push(s),c&&(o.push(s+t),r.ordinal&&0===t.indexOf(n)&&o.push(s+t.replace(n,this.options.pluralSeparator)),h&&o.push(s+e))}}let a;for(;a=o.pop();)this.isValidLookup(e)||(n=a,e=this.getResource(s,t,a,r))})))}))})),{res:e,usedKey:s,exactUsedKey:n,usedLng:i,usedNS:o}}isValidLookup(t){return!(void 0===t||!this.options.returnNull&&null===t||!this.options.returnEmptyString&&""===t)}getResource(t,e,s){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,e,s,n):this.resourceStore.getResource(t,e,s,n)}getUsedParamsDetails(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],s=t.replace&&"string"!=typeof t.replace;let n=s?t.replace:t;if(s&&void 0!==t.count&&(n.count=t.count),this.options.interpolation.defaultVariables&&(n={...this.options.interpolation.defaultVariables,...n}),!s){n={...n};for(const t of e)delete n[t]}return n}static hasDefaultValue(t){const e="defaultValue";for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&e===s.substring(0,12)&&void 0!==t[s])return!0;return!1}}function O(t){return t.charAt(0).toUpperCase()+t.slice(1)}class S{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=n.create("languageUtils")}getScriptPartFromCode(t){if(!(t=w(t))||t.indexOf("-")<0)return null;const e=t.split("-");return 2===e.length?null:(e.pop(),"x"===e[e.length-1].toLowerCase()?null:this.formatLanguageCode(e.join("-")))}getLanguagePartFromCode(t){if(!(t=w(t))||t.indexOf("-")<0)return t;const e=t.split("-");return this.formatLanguageCode(e[0])}formatLanguageCode(t){if("string"==typeof t&&t.indexOf("-")>-1){const e=["hans","hant","latn","cyrl","cans","mong","arab"];let s=t.split("-");return this.options.lowerCaseLng?s=s.map((t=>t.toLowerCase())):2===s.length?(s[0]=s[0].toLowerCase(),s[1]=s[1].toUpperCase(),e.indexOf(s[1].toLowerCase())>-1&&(s[1]=O(s[1].toLowerCase()))):3===s.length&&(s[0]=s[0].toLowerCase(),2===s[1].length&&(s[1]=s[1].toUpperCase()),"sgn"!==s[0]&&2===s[2].length&&(s[2]=s[2].toUpperCase()),e.indexOf(s[1].toLowerCase())>-1&&(s[1]=O(s[1].toLowerCase())),e.indexOf(s[2].toLowerCase())>-1&&(s[2]=O(s[2].toLowerCase()))),s.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let e;return t.forEach((t=>{if(e)return;const s=this.formatLanguageCode(t);this.options.supportedLngs&&!this.isSupportedCode(s)||(e=s)})),!e&&this.options.supportedLngs&&t.forEach((t=>{if(e)return;const s=this.getLanguagePartFromCode(t);if(this.isSupportedCode(s))return e=s;e=this.options.supportedLngs.find((t=>t===s?t:t.indexOf("-")<0&&s.indexOf("-")<0?void 0:0===t.indexOf(s)?t:void 0))})),e||(e=this.getFallbackCodes(this.options.fallbackLng)[0]),e}getFallbackCodes(t,e){if(!t)return[];if("function"==typeof t&&(t=t(e)),"string"==typeof t&&(t=[t]),"[object Array]"===Object.prototype.toString.apply(t))return t;if(!e)return t.default||[];let s=t[e];return s||(s=t[this.getScriptPartFromCode(e)]),s||(s=t[this.formatLanguageCode(e)]),s||(s=t[this.getLanguagePartFromCode(e)]),s||(s=t.default),s||[]}toResolveHierarchy(t,e){const s=this.getFallbackCodes(e||this.options.fallbackLng||[],t),n=[],i=t=>{t&&(this.isSupportedCode(t)?n.push(t):this.logger.warn(`rejecting language code not found in supportedLngs: ${t}`))};return"string"==typeof t&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(t)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(t)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(t))):"string"==typeof t&&i(this.formatLanguageCode(t)),s.forEach((t=>{n.indexOf(t)<0&&i(this.formatLanguageCode(t))})),n}}let R=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],L={1:function(t){return Number(t>1)},2:function(t){return Number(1!=t)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(0==t?0:1==t?1:2==t?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(1==t?0:t>=2&&t<=4?1:2)},7:function(t){return Number(1==t?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(1==t?0:2==t?1:8!=t&&11!=t?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(1==t?0:2==t?1:t<7?2:t<11?3:4)},11:function(t){return Number(1==t||11==t?0:2==t||12==t?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(0!==t)},14:function(t){return Number(1==t?0:2==t?1:3==t?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:0!==t?1:2)},17:function(t){return Number(1==t||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(0==t?0:1==t?1:2)},19:function(t){return Number(1==t?0:0==t||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(1==t?0:0==t||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(1==t?0:2==t?1:(t<0||t>10)&&t%10==0?2:3)}};const P=["v1","v2","v3"],A=["v4"],I={zero:0,one:1,two:2,few:3,many:4,other:5};function C(){const t={};return R.forEach((e=>{e.lngs.forEach((s=>{t[s]={numbers:e.nr,plurals:L[e.fc]}}))})),t}class B{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=t,this.options=e,this.logger=n.create("pluralResolver"),this.options.compatibilityJSON&&!A.includes(this.options.compatibilityJSON)||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=C()}addRule(t,e){this.rules[t]=e}getRule(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(w(t),{type:e.ordinal?"ordinal":"cardinal"})}catch(t){return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const s=this.getRule(t,e);return this.shouldUseIntlApi()?s&&s.resolvedOptions().pluralCategories.length>1:s&&s.numbers.length>1}getPluralFormsOfKey(t,e){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(t,s).map((t=>`${e}${t}`))}getSuffixes(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const s=this.getRule(t,e);return s?this.shouldUseIntlApi()?s.resolvedOptions().pluralCategories.sort(((t,e)=>I[t]-I[e])).map((t=>`${this.options.prepend}${e.ordinal?`ordinal${this.options.prepend}`:""}${t}`)):s.numbers.map((s=>this.getSuffix(t,s,e))):[]}getSuffix(t,e){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=this.getRule(t,s);return n?this.shouldUseIntlApi()?`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${n.select(e)}`:this.getSuffixRetroCompatible(n,e):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,e){const s=t.noAbs?t.plurals(e):t.plurals(Math.abs(e));let n=t.numbers[s];this.options.simplifyPluralSuffix&&2===t.numbers.length&&1===t.numbers[0]&&(2===n?n="plural":1===n&&(n=""));const i=()=>this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString();return"v1"===this.options.compatibilityJSON?1===n?"":"number"==typeof n?`_plural_${n.toString()}`:i():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===t.numbers.length&&1===t.numbers[0]?i():this.options.prepend&&s.toString()?this.options.prepend+s.toString():s.toString()}shouldUseIntlApi(){return!P.includes(this.options.compatibilityJSON)}}function E(t,e,s){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=d(t,e,s);return!o&&i&&"string"==typeof s&&(o=v(t,s,n),void 0===o&&(o=v(e,s,n))),o}class K{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=n.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(t=>t),this.init(t)}init(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const e=t.interpolation;this.escape=void 0!==e.escape?e.escape:m,this.escapeValue=void 0===e.escapeValue||e.escapeValue,this.useRawValueToEscape=void 0!==e.useRawValueToEscape&&e.useRawValueToEscape,this.prefix=e.prefix?p(e.prefix):e.prefixEscaped||"{{",this.suffix=e.suffix?p(e.suffix):e.suffixEscaped||"}}",this.formatSeparator=e.formatSeparator?e.formatSeparator:e.formatSeparator||",",this.unescapePrefix=e.unescapeSuffix?"":e.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":e.unescapeSuffix||"",this.nestingPrefix=e.nestingPrefix?p(e.nestingPrefix):e.nestingPrefixEscaped||p("$t("),this.nestingSuffix=e.nestingSuffix?p(e.nestingSuffix):e.nestingSuffixEscaped||p(")"),this.nestingOptionsSeparator=e.nestingOptionsSeparator?e.nestingOptionsSeparator:e.nestingOptionsSeparator||",",this.maxReplaces=e.maxReplaces?e.maxReplaces:1e3,this.alwaysFormat=void 0!==e.alwaysFormat&&e.alwaysFormat,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=`${this.prefix}(.+?)${this.suffix}`;this.regexp=new RegExp(t,"g");const e=`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`;this.regexpUnescape=new RegExp(e,"g");const s=`${this.nestingPrefix}(.+?)${this.nestingSuffix}`;this.nestingRegexp=new RegExp(s,"g")}interpolate(t,e,s,n){let i,r,a;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function u(t){return t.replace(/\$/g,"$$$$")}const c=t=>{if(t.indexOf(this.formatSeparator)<0){const i=E(e,l,t,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,s,{...n,...e,interpolationkey:t}):i}const i=t.split(this.formatSeparator),o=i.shift().trim(),r=i.join(this.formatSeparator).trim();return this.format(E(e,l,o,this.options.keySeparator,this.options.ignoreJSONStructure),r,s,{...n,...e,interpolationkey:o})};this.resetRegExp();const h=n&&n.missingInterpolationHandler||this.options.missingInterpolationHandler,p=n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,g=[{regex:this.regexpUnescape,safeValue:t=>u(t)},{regex:this.regexp,safeValue:t=>this.escapeValue?u(this.escape(t)):u(t)}];return g.forEach((e=>{for(a=0;i=e.regex.exec(t);){const s=i[1].trim();if(r=c(s),void 0===r)if("function"==typeof h){const e=h(t,i,n);r="string"==typeof e?e:""}else if(n&&Object.prototype.hasOwnProperty.call(n,s))r="";else{if(p){r=i[0];continue}this.logger.warn(`missed to pass in variable ${s} for interpolating ${t}`),r=""}else"string"==typeof r||this.useRawValueToEscape||(r=o(r));const l=e.safeValue(r);if(t=t.replace(i[0],l),p?(e.regex.lastIndex+=r.length,e.regex.lastIndex-=i[0].length):e.regex.lastIndex=0,a++,a>=this.maxReplaces)break}})),t}nest(t,e){let s,n,i,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};function a(t,e){const s=this.nestingOptionsSeparator;if(t.indexOf(s)<0)return t;const n=t.split(new RegExp(`${s}[ ]*{`));let o=`{${n[1]}`;t=n[0],o=this.interpolate(o,i);const r=o.match(/'/g),a=o.match(/"/g);(r&&r.length%2==0&&!a||a.length%2!=0)&&(o=o.replace(/'/g,'"'));try{i=JSON.parse(o),e&&(i={...e,...i})}catch(e){return this.logger.warn(`failed parsing options string in nesting for key ${t}`,e),`${t}${s}${o}`}return delete i.defaultValue,t}for(;s=this.nestingRegexp.exec(t);){let l=[];i={...r},i=i.replace&&"string"!=typeof i.replace?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;let u=!1;if(-1!==s[0].indexOf(this.formatSeparator)&&!/{.*}/.test(s[1])){const t=s[1].split(this.formatSeparator).map((t=>t.trim()));s[1]=t.shift(),l=t,u=!0}if(n=e(a.call(this,s[1].trim(),i),i),n&&s[0]===t&&"string"!=typeof n)return n;"string"!=typeof n&&(n=o(n)),n||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${t}`),n=""),u&&(n=l.reduce(((t,e)=>this.format(t,e,r.lng,{...r,interpolationkey:s[1].trim()})),n.trim())),t=t.replace(s[0],n),this.regexp.lastIndex=0}return t}}function z(t){let e=t.toLowerCase().trim();const s={};if(t.indexOf("(")>-1){const n=t.split("(");e=n[0].toLowerCase().trim();const i=n[1].substring(0,n[1].length-1);if("currency"===e&&i.indexOf(":")<0)s.currency||(s.currency=i.trim());else if("relativetime"===e&&i.indexOf(":")<0)s.range||(s.range=i.trim());else{i.split(";").forEach((t=>{if(!t)return;const[e,...n]=t.split(":"),i=n.join(":").trim().replace(/^'+|'+$/g,"");s[e.trim()]||(s[e.trim()]=i),"false"===i&&(s[e.trim()]=!1),"true"===i&&(s[e.trim()]=!0),isNaN(i)||(s[e.trim()]=parseInt(i,10))}))}}return{formatName:e,formatOptions:s}}function T(t){const e={};return function(s,n,i){const o=n+JSON.stringify(i);let r=e[o];return r||(r=t(w(n),i),e[o]=r),r(s)}}class V{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=n.create("formatter"),this.options=t,this.formats={number:T(((t,e)=>{const s=new Intl.NumberFormat(t,{...e});return t=>s.format(t)})),currency:T(((t,e)=>{const s=new Intl.NumberFormat(t,{...e,style:"currency"});return t=>s.format(t)})),datetime:T(((t,e)=>{const s=new Intl.DateTimeFormat(t,{...e});return t=>s.format(t)})),relativetime:T(((t,e)=>{const s=new Intl.RelativeTimeFormat(t,{...e});return t=>s.format(t,e.range||"day")})),list:T(((t,e)=>{const s=new Intl.ListFormat(t,{...e});return t=>s.format(t)}))},this.init(t)}init(t){const e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=e.formatSeparator?e.formatSeparator:e.formatSeparator||","}add(t,e){this.formats[t.toLowerCase().trim()]=e}addCached(t,e){this.formats[t.toLowerCase().trim()]=T(e)}format(t,e,s){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=e.split(this.formatSeparator).reduce(((t,e)=>{const{formatName:i,formatOptions:o}=z(e);if(this.formats[i]){let e=t;try{const r=n&&n.formatParams&&n.formatParams[n.interpolationkey]||{},a=r.locale||r.lng||n.locale||n.lng||s;e=this.formats[i](t,a,{...o,...n,...r})}catch(t){this.logger.warn(t)}return e}return this.logger.warn(`there was no format function for ${i}`),t}),t);return i}}function F(t,e){void 0!==t.pending[e]&&(delete t.pending[e],t.pendingCount--)}class _ extends r{constructor(t,e,s){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(),this.backend=t,this.store=e,this.services=s,this.languageUtils=s.languageUtils,this.options=i,this.logger=n.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(s,i.backend,i)}queueLoad(t,e,s,n){const i={},o={},r={},a={};return t.forEach((t=>{let n=!0;e.forEach((e=>{const r=`${t}|${e}`;!s.reload&&this.store.hasResourceBundle(t,e)?this.state[r]=2:this.state[r]<0||(1===this.state[r]?void 0===o[r]&&(o[r]=!0):(this.state[r]=1,n=!1,void 0===o[r]&&(o[r]=!0),void 0===i[r]&&(i[r]=!0),void 0===a[e]&&(a[e]=!0)))})),n||(r[t]=!0)})),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(r),toLoadNamespaces:Object.keys(a)}}loaded(t,e,s){const n=t.split("|"),i=n[0],o=n[1];e&&this.emit("failedLoading",i,o,e),s&&this.store.addResourceBundle(i,o,s),this.state[t]=e?-1:2;const r={};this.queue.forEach((s=>{l(s.loaded,[i],o),F(s,t),e&&s.errors.push(e),0!==s.pendingCount||s.done||(Object.keys(s.loaded).forEach((t=>{r[t]||(r[t]={});const e=s.loaded[t];e.length&&e.forEach((e=>{void 0===r[t][e]&&(r[t][e]=!0)}))})),s.done=!0,s.errors.length?s.callback(s.errors):s.callback())})),this.emit("loaded",r),this.queue=this.queue.filter((t=>!t.done))}read(t,e,s){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;if(!t.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:t,ns:e,fcName:s,tried:n,wait:i,callback:o});this.readingCalls++;const r=(r,a)=>{if(this.readingCalls--,this.waitingReads.length>0){const t=this.waitingReads.shift();this.read(t.lng,t.ns,t.fcName,t.tried,t.wait,t.callback)}r&&a&&n<this.maxRetries?setTimeout((()=>{this.read.call(this,t,e,s,n+1,2*i,o)}),i):o(r,a)},a=this.backend[s].bind(this.backend);if(2!==a.length)return a(t,e,r);try{const s=a(t,e);s&&"function"==typeof s.then?s.then((t=>r(null,t))).catch(r):r(null,s)}catch(t){r(t)}}prepareLoading(t,e){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();"string"==typeof t&&(t=this.languageUtils.toResolveHierarchy(t)),"string"==typeof e&&(e=[e]);const i=this.queueLoad(t,e,s,n);if(!i.toLoad.length)return i.pending.length||n(),null;i.toLoad.forEach((t=>{this.loadOne(t)}))}load(t,e,s){this.prepareLoading(t,e,{},s)}reload(t,e,s){this.prepareLoading(t,e,{reload:!0},s)}loadOne(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const s=t.split("|"),n=s[0],i=s[1];this.read(n,i,"read",void 0,void 0,((s,o)=>{s&&this.logger.warn(`${e}loading namespace ${i} for language ${n} failed`,s),!s&&o&&this.logger.log(`${e}loaded namespace ${i} for language ${n}`,o),this.loaded(t,s,o)}))}saveMissing(t,e,s,n,i){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(e))this.logger.warn(`did not save key "${s}" as the namespace "${e}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");else if(null!=s&&""!==s){if(this.backend&&this.backend.create){const a={...o,isUpdate:i},l=this.backend.create.bind(this.backend);if(l.length<6)try{let i;i=5===l.length?l(t,e,s,n,a):l(t,e,s,n),i&&"function"==typeof i.then?i.then((t=>r(null,t))).catch(r):r(null,i)}catch(t){r(t)}else l(t,e,s,n,r,a)}t&&t[0]&&this.store.addResource(t[0],e,s,n)}}}function D(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){let e={};if("object"==typeof t[1]&&(e=t[1]),"string"==typeof t[1]&&(e.defaultValue=t[1]),"string"==typeof t[2]&&(e.tDescription=t[2]),"object"==typeof t[2]||"object"==typeof t[3]){const s=t[3]||t[2];Object.keys(s).forEach((t=>{e[t]=s[t]}))}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function M(t){return"string"==typeof t.ns&&(t.ns=[t.ns]),"string"==typeof t.fallbackLng&&(t.fallbackLng=[t.fallbackLng]),"string"==typeof t.fallbackNS&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t}function U(){}function J(t){Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach((e=>{"function"==typeof t[e]&&(t[e]=t[e].bind(t))}))}class W extends r{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;if(super(),this.options=M(t),this.services={},this.logger=n,this.modules={external:[]},J(this),e&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,e),this;setTimeout((()=>{this.init(t,e)}),0)}}init(){var t=this;let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;"function"==typeof e&&(s=e,e={}),!e.defaultNS&&!1!==e.defaultNS&&e.ns&&("string"==typeof e.ns?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const i=D();function o(t){return t?"function"==typeof t?new t:t:null}if(this.options={...i,...this.options,...M(e)},"v1"!==this.options.compatibilityAPI&&(this.options.interpolation={...i.interpolation,...this.options.interpolation}),void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator),!this.options.isClone){let e;this.modules.logger?n.init(o(this.modules.logger),this.options):n.init(null,this.options),this.modules.formatter?e=this.modules.formatter:"undefined"!=typeof Intl&&(e=V);const s=new S(this.options);this.store=new j(this.options.resources,this.options);const r=this.services;r.logger=n,r.resourceStore=this.store,r.languageUtils=s,r.pluralResolver=new B(s,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!e||this.options.interpolation.format&&this.options.interpolation.format!==i.interpolation.format||(r.formatter=o(e),r.formatter.init(r,this.options),this.options.interpolation.format=r.formatter.format.bind(r.formatter)),r.interpolator=new K(this.options),r.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},r.backendConnector=new _(o(this.modules.backend),r.resourceStore,r,this.options),r.backendConnector.on("*",(function(e){for(var s=arguments.length,n=new Array(s>1?s-1:0),i=1;i<s;i++)n[i-1]=arguments[i];t.emit(e,...n)})),this.modules.languageDetector&&(r.languageDetector=o(this.modules.languageDetector),r.languageDetector.init&&r.languageDetector.init(r,this.options.detection,this.options)),this.modules.i18nFormat&&(r.i18nFormat=o(this.modules.i18nFormat),r.i18nFormat.init&&r.i18nFormat.init(this)),this.translator=new x(this.services,this.options),this.translator.on("*",(function(e){for(var s=arguments.length,n=new Array(s>1?s-1:0),i=1;i<s;i++)n[i-1]=arguments[i];t.emit(e,...n)})),this.modules.external.forEach((t=>{t.init&&t.init(this)}))}if(this.format=this.options.interpolation.format,s||(s=U),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const t=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);t.length>0&&"dev"!==t[0]&&(this.options.lng=t[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((e=>{this[e]=function(){return t.store[e](...arguments)}}));["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((e=>{this[e]=function(){return t.store[e](...arguments),t}}));const r=f(),a=()=>{const t=(t,e)=>{this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),r.resolve(e),s(t,e)};if(this.languages&&"v1"!==this.options.compatibilityAPI&&!this.isInitialized)return t(null,this.t.bind(this));this.changeLanguage(this.options.lng,t)};return this.options.resources||!this.options.initImmediate?a():setTimeout(a,0),r}loadResources(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:U;const s="string"==typeof t?t:this.language;if("function"==typeof t&&(e=t),!this.options.resources||this.options.partialBundledLanguages){if(s&&"cimode"===s.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return e();const t=[],n=e=>{if(!e)return;if("cimode"===e)return;this.services.languageUtils.toResolveHierarchy(e).forEach((e=>{"cimode"!==e&&t.indexOf(e)<0&&t.push(e)}))};if(s)n(s);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((t=>n(t)))}this.options.preload&&this.options.preload.forEach((t=>n(t))),this.services.backendConnector.load(t,this.options.ns,(t=>{t||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),e(t)}))}else e(null)}reloadResources(t,e,s){const n=f();return t||(t=this.languages),e||(e=this.options.ns),s||(s=U),this.services.backendConnector.reload(t,e,(t=>{n.resolve(),s(t)})),n}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===t.type&&(this.modules.backend=t),("logger"===t.type||t.log&&t.warn&&t.error)&&(this.modules.logger=t),"languageDetector"===t.type&&(this.modules.languageDetector=t),"i18nFormat"===t.type&&(this.modules.i18nFormat=t),"postProcessor"===t.type&&N.addPostProcessor(t),"formatter"===t.type&&(this.modules.formatter=t),"3rdParty"===t.type&&this.modules.external.push(t),this}setResolvedLanguage(t){if(t&&this.languages&&!(["cimode","dev"].indexOf(t)>-1))for(let t=0;t<this.languages.length;t++){const e=this.languages[t];if(!(["cimode","dev"].indexOf(e)>-1)&&this.store.hasLanguageSomeTranslations(e)){this.resolvedLanguage=e;break}}}changeLanguage(t,e){var s=this;this.isLanguageChangingTo=t;const n=f();this.emit("languageChanging",t);const i=t=>{this.language=t,this.languages=this.services.languageUtils.toResolveHierarchy(t),this.resolvedLanguage=void 0,this.setResolvedLanguage(t)},o=(t,o)=>{o?(i(o),this.translator.changeLanguage(o),this.isLanguageChangingTo=void 0,this.emit("languageChanged",o),this.logger.log("languageChanged",o)):this.isLanguageChangingTo=void 0,n.resolve((function(){return s.t(...arguments)})),e&&e(t,(function(){return s.t(...arguments)}))},r=e=>{t||e||!this.services.languageDetector||(e=[]);const s="string"==typeof e?e:this.services.languageUtils.getBestMatchFromCodes(e);s&&(this.language||i(s),this.translator.language||this.translator.changeLanguage(s),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(s)),this.loadResources(s,(t=>{o(t,s)}))};return t||!this.services.languageDetector||this.services.languageDetector.async?!t&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(r):this.services.languageDetector.detect(r):r(t):r(this.services.languageDetector.detect()),n}getFixedT(t,e,s){var n=this;const i=function(t,e){let o;if("object"!=typeof e){for(var r=arguments.length,a=new Array(r>2?r-2:0),l=2;l<r;l++)a[l-2]=arguments[l];o=n.options.overloadTranslationOptionHandler([t,e].concat(a))}else o={...e};o.lng=o.lng||i.lng,o.lngs=o.lngs||i.lngs,o.ns=o.ns||i.ns,o.keyPrefix=o.keyPrefix||s||i.keyPrefix;const u=n.options.keySeparator||".";let c;return c=o.keyPrefix&&Array.isArray(t)?t.map((t=>`${o.keyPrefix}${u}${t}`)):o.keyPrefix?`${o.keyPrefix}${u}${t}`:t,n.t(c,o)};return"string"==typeof t?i.lng=t:i.lngs=t,i.ns=e,i.keyPrefix=s,i}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const s=e.lng||this.resolvedLanguage||this.languages[0],n=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===s.toLowerCase())return!0;const o=(t,e)=>{const s=this.services.backendConnector.state[`${t}|${e}`];return-1===s||2===s};if(e.precheck){const t=e.precheck(this,o);if(void 0!==t)return t}return!!this.hasResourceBundle(s,t)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!o(s,t)||n&&!o(i,t)))}loadNamespaces(t,e){const s=f();return this.options.ns?("string"==typeof t&&(t=[t]),t.forEach((t=>{this.options.ns.indexOf(t)<0&&this.options.ns.push(t)})),this.loadResources((t=>{s.resolve(),e&&e(t)})),s):(e&&e(),Promise.resolve())}loadLanguages(t,e){const s=f();"string"==typeof t&&(t=[t]);const n=this.options.preload||[],i=t.filter((t=>n.indexOf(t)<0));return i.length?(this.options.preload=n.concat(i),this.loadResources((t=>{s.resolve(),e&&e(t)})),s):(e&&e(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const e=this.services&&this.services.languageUtils||new S(D());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(e.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){return new W(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}cloneInstance(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:U;const s=t.forkResourceStore;s&&delete t.forkResourceStore;const n={...this.options,...t,isClone:!0},i=new W(n);void 0===t.debug&&void 0===t.prefix||(i.logger=i.logger.clone(t));return["store","services","language"].forEach((t=>{i[t]=this[t]})),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},s&&(i.store=new j(this.store.data,n),i.services.resourceStore=i.store),i.translator=new x(i.services,n),i.translator.on("*",(function(t){for(var e=arguments.length,s=new Array(e>1?e-1:0),n=1;n<e;n++)s[n-1]=arguments[n];i.emit(t,...s)})),i.init(n,e),i.translator.options=n,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const q=W.createInstance();q.createInstance=W.createInstance;class H{constructor(){}static async createInstance(t,e){return Array.isArray(e)?e=new Set(e):"function"==typeof e&&(e=new Set([e])),H.instance=new H,q.isInitialized?await q.loadNamespaces(H.namespace):await q.init({ns:[H.namespace],lng:t}),void 0!==e&&e.forEach((t=>t(((t,e)=>(H.instance.addResourceBundle(t,e),t))))),this.instance}static addResourceBundle(t,e){q.addResourceBundle(t,H.namespace,e,!0)}addResourceBundle(t,e){H.addResourceBundle(t,e)}translate(t,e){return q.t(t,Object.assign({ns:H.namespace,count:null==e?void 0:e.count},null==e?void 0:e.placeholders))}}H.namespace="KoliBri";const Y=async(s,n,i)=>{var o,r;return void 0===e().I18n&&Object.defineProperty(e(),"I18n",{value:await H.createInstance(null!==(r=null===(o=null==i?void 0:i.translation)||void 0===o?void 0:o.name)&&void 0!==r?r:"de",null==i?void 0:i.translations),writable:!1}),await t(s,n,i)},G=()=>e().I18n;export{G as g,Y as r};
|
@@ -1,4 +1,4 @@
|
|
1
1
|
/*!
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
3
3
|
*/
|
4
|
-
export{s as setCurrentLocation}from"./ariaCurrentService-6fe36ebc.js";export{r as register}from"./index-
|
4
|
+
export{s as setCurrentLocation}from"./ariaCurrentService-6fe36ebc.js";export{r as register}from"./index-7c986198.js";export{c as BUNDESAEMTER,e as BUNDESANSTALTEN,a as BUNDESMINISTERIEN,f as BUND_LOGO_TEXT_MAP,b as Bundesamt,d as Bundesanstalt,B as Bundesministerium}from"./bund-ad41b762.js";export{t as translations}from"./i18n-6e523906.js";export{T as ToasterService}from"./toaster-bd34d3c2.js";export{c as configKoliBri}from"./dev.utils-69ed2492.js";export{K as KoliBriDevHelper}from"./index-807d8631.js";
|
@@ -1,4 +1,4 @@
|
|
1
1
|
/*!
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
3
3
|
*/
|
4
|
-
import{r as t,h as n,H as e}from"./index-0b7aa54b.js";import{v as i,a as o}from"./index-807d8631.js";import{n as a}from"./dev.utils-
|
4
|
+
import{r as t,h as n,H as e}from"./index-0b7aa54b.js";import{v as i,a as o}from"./index-807d8631.js";import{n as a}from"./dev.utils-69ed2492.js";const l="/*\n * This file contains all rules for accessibility.\n */\n@layer kol-global {\n\t:host {\n\t\t/*\n\t\t * Minimum size of interactive elements.\n\t\t */\n\t\t--a11y-min-size: 44px;\n\t\t/*\n\t\t * No element should be used without a background and font color whose contrast ratio has\n\t\t * not been checked. By initially setting the background color to white and the font color\n\t\t * to black, the contrast ratio is ensured and explicit adjustment is forced.\n\t\t */\n\t\tbackground-color: white;\n\t\tcolor: black;\n\t\t/*\n\t\t * Verdana is an accessible font that can be used without requiring additional loading time.\n\t\t */\n\t\tfont-family: Verdana;\n\t}\n\n\t* {\n\t\t/*\n\t\t * This rule enables the word dividing for all texts. That is important for high zoom levels.\n\t\t */\n\t\thyphens: auto;\n\t\t/*\n\t\t * Letter spacing is required for all texts.\n\t\t */\n\t\tletter-spacing: inherit;\n\t\t/*\n\t\t * This rule enables the word dividing for all texts. That is important for high zoom levels.\n\t\t */\n\t\tword-break: break-word;\n\t\t/*\n\t\t * Word spacing is required for all texts.\n\t\t */\n\t\tword-spacing: inherit;\n\t}\n\n\t/*\n\t * All interactive elements should have a minimum size of 44px.\n\t */\n\t/* input:not([type='checkbox'], [type='radio'], [type='range']), */\n\t/* option, */\n\t/* select, */\n\t/* textarea, */\n\t[role='button'],\n\tbutton:not([role='link']),\n\tkol-input .input {\n\t\tmin-height: var(--a11y-min-size);\n\t\tmin-width: var(--a11y-min-size);\n\t}\n\n\t/*\n\t * Some interactive elements should not inherit the font-family and font-size.\n\t */\n\ta,\n\tbutton,\n\th1,\n\th2,\n\th3,\n\th4,\n\th5,\n\th6,\n\tinput,\n\toption,\n\tselect,\n\ttextarea {\n\t\t/*\n\t\t * All elements should inherit the font family from his parent element.\n\t\t */\n\t\tfont-family: inherit;\n\t\t/*\n\t\t * All elements should inherit the font size from his parent element.\n\t\t */\n\t\tfont-size: inherit;\n\t}\n}\n\n/**\n * Sometimes we need the semantic element for accessibility reasons,\n * but we don't want to show it.\n *\n * - https://www.a11yproject.com/posts/how-to-hide-content/\n */\n.visually-hidden {\n\tclip: rect(0 0 0 0);\n\tclip-path: inset(50%);\n\theight: 1px;\n\toverflow: hidden;\n\tposition: absolute;\n\twhite-space: nowrap;\n\twidth: 1px;\n}\n\n@layer kol-global {\n\t/*\n\t * Dieses CSS stellt sicher, dass der Standard-Style\n\t * von A und Button resettet werden.\n\t */\n\t:is(a, button) {\n\t\tbackground-color: transparent;\n\t\tborder: none;\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t\twidth: 100%; /* 100% needed for custom width from outside */\n\t}\n\n\t/*\n\t * Ensure elements with hidden attribute to be actually not visible\n\t * @see https://meowni.ca/hidden.is.a.lie.html\n\t */\n\t[hidden] {\n\t\tdisplay: none !important;\n\t}\n}\n\n@layer kol-global {\n\t:host {\n\t\t/*\n\t\t * The max-width is needed to prevent the table from overflowing the\n\t\t * parent node, if the table is wider than the parent node.\n\t\t */\n\t\tmax-width: 100%;\n\t}\n\n\t* {\n\t\t/*\n\t\t * We prefer to box-sizing: border-box for all elements.\n\t\t */\n\t\tbox-sizing: border-box;\n\t}\n\n\t/* KolSpan is a layout component with icons in all directions and a label text in the middle. */\n\tkol-span-wc {\n\t\tdisplay: grid;\n\t\tplace-items: center;\n\t}\n\n\t/* The sub span in KolSpan is the horizontal span with icon left and right and the label text in the middle. */\n\tkol-span-wc > span {\n\t\tdisplay: flex;\n\t\tplace-items: center;\n\t}\n\n\ta,\n\tbutton {\n\t\tcursor: pointer;\n\t}\n\n\t/* This is the text label. */\n\t.icon-only > kol-span-wc > span > span {\n\t\tdisplay: none;\n\t}\n}\n\n@layer kol-component {\n\t:host > abbr {\n\t\tcursor: help;\n\t}\n}\n",s=l,r=class{constructor(n){t(this,n),this.nonce=a(),this._label=void 0,this._tooltipAlign="top",this.state={_label:"",_tooltipAlign:"top"}}render(){return n(e,null,n("abbr",{"aria-labelledby":this.nonce,role:"definition",tabindex:"0",title:this.state._label},n("span",{title:""},n("slot",null))),n("kol-tooltip-wc",{_align:this.state._tooltipAlign,_id:this.nonce,_label:this.state._label}))}validateLabel(t){i(this,t,{required:!0})}validateTooltipAlign(t){o(this,t)}componentWillLoad(){this.validateLabel(this._label),this.validateTooltipAlign(this._tooltipAlign)}static get watchers(){return{_label:["validateLabel"],_tooltipAlign:["validateTooltipAlign"]}}};r.style={default:s};export{r as kol_abbr};
|
@@ -1,4 +1,4 @@
|
|
1
1
|
/*!
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
3
3
|
*/
|
4
|
-
import{r as t,h as n,H as e,g as i}from"./index-0b7aa54b.js";import{f as o,b as a,v as s,s as r,c as l}from"./index-807d8631.js";import{n as d}from"./dev.utils-
|
4
|
+
import{r as t,h as n,H as e,g as i}from"./index-0b7aa54b.js";import{f as o,b as a,v as s,s as r,c as l}from"./index-807d8631.js";import{n as d}from"./dev.utils-69ed2492.js";import{w as h}from"./validation-223a4d10.js";const c="/*\n * This file contains all rules for accessibility.\n */\n@layer kol-global {\n\t:host {\n\t\t/*\n\t\t * Minimum size of interactive elements.\n\t\t */\n\t\t--a11y-min-size: 44px;\n\t\t/*\n\t\t * No element should be used without a background and font color whose contrast ratio has\n\t\t * not been checked. By initially setting the background color to white and the font color\n\t\t * to black, the contrast ratio is ensured and explicit adjustment is forced.\n\t\t */\n\t\tbackground-color: white;\n\t\tcolor: black;\n\t\t/*\n\t\t * Verdana is an accessible font that can be used without requiring additional loading time.\n\t\t */\n\t\tfont-family: Verdana;\n\t}\n\n\t* {\n\t\t/*\n\t\t * This rule enables the word dividing for all texts. That is important for high zoom levels.\n\t\t */\n\t\thyphens: auto;\n\t\t/*\n\t\t * Letter spacing is required for all texts.\n\t\t */\n\t\tletter-spacing: inherit;\n\t\t/*\n\t\t * This rule enables the word dividing for all texts. That is important for high zoom levels.\n\t\t */\n\t\tword-break: break-word;\n\t\t/*\n\t\t * Word spacing is required for all texts.\n\t\t */\n\t\tword-spacing: inherit;\n\t}\n\n\t/*\n\t * All interactive elements should have a minimum size of 44px.\n\t */\n\t/* input:not([type='checkbox'], [type='radio'], [type='range']), */\n\t/* option, */\n\t/* select, */\n\t/* textarea, */\n\t[role='button'],\n\tbutton:not([role='link']),\n\tkol-input .input {\n\t\tmin-height: var(--a11y-min-size);\n\t\tmin-width: var(--a11y-min-size);\n\t}\n\n\t/*\n\t * Some interactive elements should not inherit the font-family and font-size.\n\t */\n\ta,\n\tbutton,\n\th1,\n\th2,\n\th3,\n\th4,\n\th5,\n\th6,\n\tinput,\n\toption,\n\tselect,\n\ttextarea {\n\t\t/*\n\t\t * All elements should inherit the font family from his parent element.\n\t\t */\n\t\tfont-family: inherit;\n\t\t/*\n\t\t * All elements should inherit the font size from his parent element.\n\t\t */\n\t\tfont-size: inherit;\n\t}\n}\n\n/**\n * Sometimes we need the semantic element for accessibility reasons,\n * but we don't want to show it.\n *\n * - https://www.a11yproject.com/posts/how-to-hide-content/\n */\n.visually-hidden {\n\tclip: rect(0 0 0 0);\n\tclip-path: inset(50%);\n\theight: 1px;\n\toverflow: hidden;\n\tposition: absolute;\n\twhite-space: nowrap;\n\twidth: 1px;\n}\n\n@layer kol-global {\n\t/*\n\t * Dieses CSS stellt sicher, dass der Standard-Style\n\t * von A und Button resettet werden.\n\t */\n\t:is(a, button) {\n\t\tbackground-color: transparent;\n\t\tborder: none;\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t\twidth: 100%; /* 100% needed for custom width from outside */\n\t}\n\n\t/*\n\t * Ensure elements with hidden attribute to be actually not visible\n\t * @see https://meowni.ca/hidden.is.a.lie.html\n\t */\n\t[hidden] {\n\t\tdisplay: none !important;\n\t}\n}\n\n@layer kol-global {\n\t:host {\n\t\t/*\n\t\t * The max-width is needed to prevent the table from overflowing the\n\t\t * parent node, if the table is wider than the parent node.\n\t\t */\n\t\tmax-width: 100%;\n\t}\n\n\t* {\n\t\t/*\n\t\t * We prefer to box-sizing: border-box for all elements.\n\t\t */\n\t\tbox-sizing: border-box;\n\t}\n\n\t/* KolSpan is a layout component with icons in all directions and a label text in the middle. */\n\tkol-span-wc {\n\t\tdisplay: grid;\n\t\tplace-items: center;\n\t}\n\n\t/* The sub span in KolSpan is the horizontal span with icon left and right and the label text in the middle. */\n\tkol-span-wc > span {\n\t\tdisplay: flex;\n\t\tplace-items: center;\n\t}\n\n\ta,\n\tbutton {\n\t\tcursor: pointer;\n\t}\n\n\t/* This is the text label. */\n\t.icon-only > kol-span-wc > span > span {\n\t\tdisplay: none;\n\t}\n}\n\n@layer kol-component {\n\t:host {\n\t\tdisplay: block;\n\t}\n}\n\n@layer kol-component {\n\t/* For animation technique see https://css-tricks.com/css-grid-can-do-auto-height-transitions/ */\n\t.wrapper {\n\t\tdisplay: grid;\n\t\tgrid-template-rows: 0fr;\n\t\toverflow: hidden;\n\t\ttransition: grid-template-rows 0.3s;\n\t}\n\n\t.accordion.open .wrapper {\n\t\tgrid-template-rows: 1fr;\n\t}\n\n\t.animation-wrapper {\n\t\tmin-height: 0;\n\t\ttransition: visibility 0.3s;\n\t\t/* This property is important to keep in sync with the visual transition (template-rows). Without it interactive elements within the accordion would stay focusable. */\n\t\tvisibility: hidden;\n\t}\n\n\t.accordion.open .animation-wrapper {\n\t\tvisibility: visible;\n\t}\n\n\t@media (prefers-reduced-motion) {\n\t\t.animation-wrapper,\n\t\t.wrapper {\n\t\t\ttransition-duration: 0s;\n\t\t}\n\t} /*\n * Inside a button, the caption text is always centered.\n * So we have to align the text to the left.\n */\n\t.accordion kol-heading-wc kol-button-wc button kol-span-wc {\n\t\tjustify-items: start;\n\t}\n}\n",p=c;o("[KolAccordion] Anfrage nach einer KolAccordionGroup bei dem immer nur ein Accordion geöffnet ist.\n\n- onClick auf der KolAccordion anwenden\n- Click-Event prüft den _open-Status der Accordions\n- Logik Öffnet und Schließt entsprechend"),o("[KolAccordion] Tab-Sperre des Inhalts im geschlossenen Zustand.");const u=class{constructor(n){t(this,n),this.nonce=d(),this.catchRef=t=>{a(this.host,t)},this.onClick=t=>{this._open=!this._open,setTimeout((()=>{var n;"function"==typeof(null===(n=this.state._on)||void 0===n?void 0:n.onClick)&&this.state._on.onClick(t,!0===this._open)}))},this._label=void 0,this._level=1,this._on=void 0,this._open=!1,this.state={_label:"",_level:1}}render(){return n(e,null,n("div",{class:{accordion:!0,open:!0===this.state._open}},n("kol-heading-wc",{_label:"",_level:this.state._level,class:"accordion-heading"},n("kol-button-wc",{class:"accordion-button",ref:this.catchRef,slot:"expert",_ariaControls:this.nonce,_ariaExpanded:this.state._open,_icons:this.state._open?"codicon codicon-remove":"codicon codicon-add",_label:this.state._label,_on:{onClick:this.onClick}})),n("div",{class:"wrapper"},n("div",{class:"animation-wrapper"},n("div",{"aria-hidden":!1===this.state._open?"true":void 0,class:"content",id:this.nonce},n("slot",null))))))}validateLabel(t){s(this,t,{required:!0})}validateLevel(t){h(this,t)}validateOn(t){"object"==typeof t&&null!==t&&"function"==typeof t.onClick&&r(this,"_on",t)}validateOpen(t){l(this,t)}componentWillLoad(){this.validateLabel(this._label),this.validateLevel(this._level),this.validateOn(this._on),this.validateOpen(this._open)}get host(){return i(this)}static get watchers(){return{_label:["validateLabel"],_level:["validateLevel"],_on:["validateOn"],_open:["validateOpen"]}}};u.style={default:p};export{u as kol_accordion};
|
@@ -1,4 +1,4 @@
|
|
1
1
|
/*!
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
3
3
|
*/
|
4
|
-
import{r as t,h as i,H as s,g as e}from"./index-0b7aa54b.js";import{n as a,m as l,v as n,s as h,w as o,av as d,aw as r,ax as c,ay as u,b as v,$ as f,am as _,az as b,aA as p,aB as y,a7 as m,aC as g,F as L,H as w,aq as C,q as k,J as A,aD as x,as as S,L as V,a as j,aE as H,aF as T,C as I,aG as K}from"./index-807d8631.js";import{a as E}from"./i18n-
|
4
|
+
import{r as t,h as i,H as s,g as e}from"./index-0b7aa54b.js";import{n as a,m as l,v as n,s as h,w as o,av as d,aw as r,ax as c,ay as u,b as v,$ as f,am as _,az as b,aA as p,aB as y,a7 as m,aC as g,F as L,H as w,aq as C,q as k,J as A,aD as x,as as S,L as V,a as j,aE as H,aF as T,C as I,aG as K}from"./index-807d8631.js";import{a as E}from"./i18n-6e523906.js";import{L as O}from"./dev.utils-69ed2492.js";import{w as $}from"./validation-223a4d10.js";import{s as B,t as N}from"./events-fa760b68.js";import{p as q,a as D}from"./controller-90bf3a75.js";import{A as W}from"./associated.controller-ac43f4c8.js";import"./index-7c986198.js";const F=t=>i("kol-icon",{class:"heading-icon",_label:"string"==typeof t.label&&t.label.length>0?"":t.ariaLabel,_icons:t.icon}),R=t=>{switch(t.type){case"error":return i(F,{ariaLabel:E("kol-error"),icon:"codicon codicon-error",label:t.label});case"info":return i(F,{ariaLabel:E("kol-info"),icon:"codicon codicon-info",label:t.label});case"warning":return i(F,{ariaLabel:E("kol-warning"),icon:"codicon codicon-warning",label:t.label});case"success":return i(F,{ariaLabel:E("kol-success"),icon:"codicon codicon-pass",label:t.label});default:return i(F,{ariaLabel:E("kol-message"),icon:"codicon codicon-comment",label:t.label})}},z=class{constructor(a){t(this,a),this.close=()=>{var t;void 0!==(null===(t=this._on)||void 0===t?void 0:t.onClose)&&this._on.onClose(new Event("Close"))},this.on={onClick:this.close},this.validateOnValue=t=>"object"==typeof t&&null!==t&&"function"==typeof t.onClose,this._alert=!1,this._hasCloser=!1,this._label=void 0,this._level=1,this._on=void 0,this._type="default",this._variant="msg",this.state={_level:1}}render(){var t;if(this.state._alert){try{O.debug(["Navigator should vibrate ...",navigator.vibrate([100,75,100,75,100])])}catch(t){O.debug("Navigator does not support vibration.")}setTimeout((()=>{this.validateAlert(!1)}),1e4)}return i(s,{class:{alert:!0,[this.state._type]:!0,[this.state._variant]:!0,hasCloser:!!this.state._hasCloser},role:this.state._alert?"alert":void 0},i("div",{class:"heading"},i(R,{label:this.state._label,type:this.state._type}),i("div",{class:"heading-content"},"string"==typeof this.state._label&&(null===(t=this.state._label)||void 0===t?void 0:t.length)>0&&i("kol-heading-wc",{_label:this.state._label,_level:this.state._level}),"msg"===this.state._variant&&i("div",{class:"content"},i("slot",null))),this.state._hasCloser&&i("kol-button-wc",{class:"close",_hideLabel:!0,_icons:{left:{icon:"codicon codicon-close"}},_label:E("kol-close"),_on:this.on,_tooltipAlign:"left"})),"card"===this.state._variant&&i("div",{class:"content"},i("slot",null)))}validateAlert(t){a(this,"_alert",t)}validateHasCloser(t){l(this,t)}validateLabel(t){n(this,t)}validateLevel(t){$(this,t)}validateOn(t){this.validateOnValue(t)&&h(this,"_on",{onClose:t.onClose})}validateType(t){o(this,"_type",(t=>"string"==typeof t&&d.includes(t)),new Set(`String {${d.join(", ")}`),t)}validateVariant(t){o(this,"_variant",(t=>"string"==typeof t&&r.includes(t)),new Set(`AlertVariant {${r.join(", ")}`),t)}componentWillLoad(){this.validateAlert(this._alert),this.validateHasCloser(this._hasCloser),this.validateLabel(this._label),this.validateLevel(this._level),this.validateOn(this._on),this.validateType(this._type),this.validateVariant(this._variant)}static get watchers(){return{_alert:["validateAlert"],_hasCloser:["validateHasCloser"],_label:["validateLabel"],_level:["validateLevel"],_on:["validateOn"],_type:["validateType"],_variant:["validateVariant"]}}},G=class{render(){const t=I(this.state._label);return i(s,null,i("button",Object.assign({ref:this.catchRef,accessKey:this.state._accessKey||void 0,"aria-controls":this.state._ariaControls,"aria-expanded":c(this.state._ariaExpanded),"aria-label":this.state._hideLabel&&"string"==typeof this.state._label?this.state._label:void 0,"aria-selected":u(this.state._ariaSelected),class:{button:!0,[this.state._variant]:"custom"!==this.state._variant,[this.state._customClass]:"custom"===this.state._variant&&"string"==typeof this.state._customClass&&this.state._customClass.length>0,"icon-only":!0===this.state._hideLabel,"hide-label":!0===this.state._hideLabel},disabled:this.state._disabled,id:this.state._id,name:this.state._name},this.state._on,{onClick:this.onClick,role:this.state._role,tabIndex:this.state._tabIndex,type:this.state._type}),i("kol-span-wc",{class:"button-inner",_accessKey:this.state._accessKey,_icons:this.state._icons,_hideLabel:this.state._hideLabel,_label:t?"":this.state._label},i("slot",{name:"expert",slot:"expert"}))),i("kol-tooltip-wc",{"aria-hidden":"true",hidden:t||!this.state._hideLabel,_accessKey:this._accessKey,_align:this.state._tooltipAlign,_label:"string"==typeof this.state._label?this.state._label:""}))}constructor(a){t(this,a),this.catchRef=t=>{this.ref=t,v(this.host,this.ref)},this.onClick=t=>{var a,e;"submit"===this.state._type?q({form:this.host,ref:this.ref}):"reset"===this.state._type?D({form:this.host,ref:this.ref}):(B(t),N("click",this.host,this.state._value),this.controller.setFormAssociatedValue(this.state._value),"function"==typeof(null===(a=this.state._on)||void 0===a?void 0:a.onClick)&&(f(t,this.ref),null===(e=this.state._on)||void 0===e||e.onClick(t,this.state._value)))},this._accessKey=void 0,this._ariaControls=void 0,this._ariaExpanded=void 0,this._ariaSelected=void 0,this._customClass=void 0,this._disabled=!1,this._hideLabel=!1,this._icons=void 0,this._id=void 0,this._label=void 0,this._name=void 0,this._on=void 0,this._role=void 0,this._syncValueBySelector=void 0,this._tabIndex=void 0,this._tooltipAlign="top",this._type="button",this._value=void 0,this._variant="normal",this.state={_icons:{},_label:"",_on:{},_type:"button",_variant:"normal"},this.controller=new W(this,"button",this.host)}validateAccessKey(t){_(this,t)}validateAriaControls(t){b(this,t)}validateAriaExpanded(t){p(this,t)}validateAriaSelected(t){y(this,t)}validateCustomClass(t){m(this,t)}validateDisabled(t){g(this,t),!0===t&&L()}validateHideLabel(t){w(this,t)}validateIcons(t){C(this,t)}validateId(t){k(this,"_id",t)}validateLabel(t){A(this,t,{required:!0})}validateName(t){this.controller.validateName(t)}validateOn(t){x(this,t)}validateRole(t){S(this,t)}validateSyncValueBySelector(t){this.controller.validateSyncValueBySelector(t)}validateTabIndex(t){V(this,t)}validateTooltipAlign(t){j(this,t)}validateType(t){H(this,t)}validateValue(t){h(this,"_value",t),this.controller.setFormAssociatedValue(this.state._value)}validateVariant(t){T(this,t)}componentWillLoad(){this.validateAccessKey(this._accessKey),this.validateAriaControls(this._ariaControls),this.validateAriaExpanded(this._ariaExpanded),this.validateAriaSelected(this._ariaSelected),this.validateCustomClass(this._customClass),this.validateDisabled(this._disabled),this.validateHideLabel(this._hideLabel),this.validateIcons(this._icons),this.validateId(this._id),this.validateLabel(this._label),this.validateName(this._name),this.validateOn(this._on),this.validateRole(this._role),this.validateSyncValueBySelector(this._syncValueBySelector),this.validateTabIndex(this._tabIndex),this.validateTooltipAlign(this._tooltipAlign),this.validateType(this._type),this.validateValue(this._value),this.validateVariant(this._variant)}get host(){return e(this)}static get watchers(){return{_accessKey:["validateAccessKey"],_ariaControls:["validateAriaControls"],_ariaExpanded:["validateAriaExpanded"],_ariaSelected:["validateAriaSelected"],_customClass:["validateCustomClass"],_disabled:["validateDisabled"],_hideLabel:["validateHideLabel"],_icons:["validateIcons"],_id:["validateId"],_label:["validateLabel"],_name:["validateName"],_on:["validateOn"],_role:["validateRole"],_syncValueBySelector:["validateSyncValueBySelector"],_tabIndex:["validateTabIndex"],_tooltipAlign:["validateTooltipAlign"],_type:["validateType"],_value:["validateValue"],_variant:["validateVariant"]}}},J=class{constructor(a){t(this,a),this.renderHeadline=(t,a)=>{const e="number"==typeof a&&a>0&&a<=6?`h${a}`:"strong",s=this._variant||e;return i(e,{class:{headline:!0,[`headline-${s}`]:!0}},t,i("slot",{name:"expert"}))},this.renderSecondaryHeadline=(t,a)=>{switch(a){case 1:return i("span",{class:"secondary-headline"},t);case 2:return i("h2",{class:"secondary-headline"},t);case 3:return i("h3",{class:"secondary-headline"},t);case 4:return i("h4",{class:"secondary-headline"},t);case 5:return i("h5",{class:"secondary-headline"},t);case 6:return i("h6",{class:"secondary-headline"},t);default:return i("strong",{class:"secondary-headline"},t)}},this._label=void 0,this._level=1,this._secondaryHeadline=void 0,this._variant=void 0,this.state={_label:"",_level:1}}validateLabel(t){A(this,t)}validateLevel(t){$(this,t)}validateSecondaryHeadline(t){k(this,"_secondaryHeadline",t)}validateVariant(t){K(this,t)}componentWillLoad(){this.validateLabel(this._label),this.validateLevel(this._level),this.validateSecondaryHeadline(this._secondaryHeadline),this.validateVariant(this._variant)}render(){return i(s,null,"string"==typeof this.state._secondaryHeadline&&this.state._secondaryHeadline.length>0?i("hgroup",null,this.renderHeadline(this.state._label,this.state._level),this.state._secondaryHeadline&&this.renderSecondaryHeadline(this.state._secondaryHeadline,this.state._level+1)):this.renderHeadline(this.state._label,this.state._level))}static get watchers(){return{_label:["validateLabel"],_level:["validateLevel"],_secondaryHeadline:["validateSecondaryHeadline"],_variant:["validateVariant"]}}};export{z as kol_alert_wc,G as kol_button_wc,J as kol_heading_wc};
|
@@ -1,4 +1,4 @@
|
|
1
1
|
/*!
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
3
3
|
*/
|
4
|
-
import{r as
|
4
|
+
import{r as t,h as s,H as a}from"./index-0b7aa54b.js";import{x as i,v as r}from"./index-807d8631.js";import{a as e}from"./i18n-6e523906.js";import"./index-7c986198.js";import"./dev.utils-69ed2492.js";const n=a=>0===a.length?"":a[0].toUpperCase(),l=a=>{const t=a.split(/\s+/),s=t.at(0),e=t.at(-1);return t.length>=2&&s&&e?`${n(s)}${n(e)}`:n(a)},o=class{constructor(a){t(this,a),this._src=void 0,this._label=void 0,this.state={_src:"",_label:""}}render(){return s(a,null,s("div",{"aria-label":e("kol-avatar-alt",{placeholders:{name:this.state._label}}),class:"container",role:"img"},this.state._src?s("img",{alt:"","aria-hidden":"true",class:"image",src:this.state._src}):s("span",{"aria-hidden":"true",class:"initials"},l(this.state._label.trim()))))}validateSrc(a){i(this,a)}validateLabel(a){r(this,a,{required:!0})}componentWillLoad(){this.validateSrc(this._src),this.validateLabel(this._label)}static get watchers(){return{_src:["validateSrc"],_label:["validateLabel"]}}};export{o as kol_avatar_wc};
|
@@ -1,4 +1,4 @@
|
|
1
1
|
/*!
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
3
3
|
*/
|
4
|
-
import{r as t,h as n,H as e}from"./index-0b7aa54b.js";import{f as i,g as o,i as s,o as a,j as l,s as r}from"./index-807d8631.js";import{n as h}from"./dev.utils-
|
4
|
+
import{r as t,h as n,H as e}from"./index-0b7aa54b.js";import{f as i,g as o,i as s,o as a,j as l,s as r}from"./index-807d8631.js";import{n as h}from"./dev.utils-69ed2492.js";const d="/*\n * This file contains all rules for accessibility.\n */\n@layer kol-global {\n\t:host {\n\t\t/*\n\t\t * Minimum size of interactive elements.\n\t\t */\n\t\t--a11y-min-size: 44px;\n\t\t/*\n\t\t * No element should be used without a background and font color whose contrast ratio has\n\t\t * not been checked. By initially setting the background color to white and the font color\n\t\t * to black, the contrast ratio is ensured and explicit adjustment is forced.\n\t\t */\n\t\tbackground-color: white;\n\t\tcolor: black;\n\t\t/*\n\t\t * Verdana is an accessible font that can be used without requiring additional loading time.\n\t\t */\n\t\tfont-family: Verdana;\n\t}\n\n\t* {\n\t\t/*\n\t\t * This rule enables the word dividing for all texts. That is important for high zoom levels.\n\t\t */\n\t\thyphens: auto;\n\t\t/*\n\t\t * Letter spacing is required for all texts.\n\t\t */\n\t\tletter-spacing: inherit;\n\t\t/*\n\t\t * This rule enables the word dividing for all texts. That is important for high zoom levels.\n\t\t */\n\t\tword-break: break-word;\n\t\t/*\n\t\t * Word spacing is required for all texts.\n\t\t */\n\t\tword-spacing: inherit;\n\t}\n\n\t/*\n\t * All interactive elements should have a minimum size of 44px.\n\t */\n\t/* input:not([type='checkbox'], [type='radio'], [type='range']), */\n\t/* option, */\n\t/* select, */\n\t/* textarea, */\n\t[role='button'],\n\tbutton:not([role='link']),\n\tkol-input .input {\n\t\tmin-height: var(--a11y-min-size);\n\t\tmin-width: var(--a11y-min-size);\n\t}\n\n\t/*\n\t * Some interactive elements should not inherit the font-family and font-size.\n\t */\n\ta,\n\tbutton,\n\th1,\n\th2,\n\th3,\n\th4,\n\th5,\n\th6,\n\tinput,\n\toption,\n\tselect,\n\ttextarea {\n\t\t/*\n\t\t * All elements should inherit the font family from his parent element.\n\t\t */\n\t\tfont-family: inherit;\n\t\t/*\n\t\t * All elements should inherit the font size from his parent element.\n\t\t */\n\t\tfont-size: inherit;\n\t}\n}\n\n/**\n * Sometimes we need the semantic element for accessibility reasons,\n * but we don't want to show it.\n *\n * - https://www.a11yproject.com/posts/how-to-hide-content/\n */\n.visually-hidden {\n\tclip: rect(0 0 0 0);\n\tclip-path: inset(50%);\n\theight: 1px;\n\toverflow: hidden;\n\tposition: absolute;\n\twhite-space: nowrap;\n\twidth: 1px;\n}\n\n@layer kol-global {\n\t/*\n\t * Dieses CSS stellt sicher, dass der Standard-Style\n\t * von A und Button resettet werden.\n\t */\n\t:is(a, button) {\n\t\tbackground-color: transparent;\n\t\tborder: none;\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t\twidth: 100%; /* 100% needed for custom width from outside */\n\t}\n\n\t/*\n\t * Ensure elements with hidden attribute to be actually not visible\n\t * @see https://meowni.ca/hidden.is.a.lie.html\n\t */\n\t[hidden] {\n\t\tdisplay: none !important;\n\t}\n}\n\n@layer kol-global {\n\t:host {\n\t\t/*\n\t\t * The max-width is needed to prevent the table from overflowing the\n\t\t * parent node, if the table is wider than the parent node.\n\t\t */\n\t\tmax-width: 100%;\n\t}\n\n\t* {\n\t\t/*\n\t\t * We prefer to box-sizing: border-box for all elements.\n\t\t */\n\t\tbox-sizing: border-box;\n\t}\n\n\t/* KolSpan is a layout component with icons in all directions and a label text in the middle. */\n\tkol-span-wc {\n\t\tdisplay: grid;\n\t\tplace-items: center;\n\t}\n\n\t/* The sub span in KolSpan is the horizontal span with icon left and right and the label text in the middle. */\n\tkol-span-wc > span {\n\t\tdisplay: flex;\n\t\tplace-items: center;\n\t}\n\n\ta,\n\tbutton {\n\t\tcursor: pointer;\n\t}\n\n\t/* This is the text label. */\n\t.icon-only > kol-span-wc > span > span {\n\t\tdisplay: none;\n\t}\n}\n\n@layer kol-component {\n\t:host > span {\n\t\tdisplay: inline-flex;\n\t\tplace-items: center;\n\t\toutline: transparent solid 1px; /* Visible with forced colors */\n\t}\n\n\t:host > span > kol-button-wc button {\n\t\tcolor: inherit;\n\t}\n}\n",c=d;i("[KolBadge] Optimierung des _color-Properties (rgba, rgb, hex usw.).");const u=class{constructor(n){t(this,n),this.bgColorStr="#000",this.colorStr="#fff",this.id=h(),this.handleColorChange=t=>{const n=o(t);this.bgColorStr=n.backgroundColor,this.colorStr=n.foregroundColor},this._color="#000",this._icons=void 0,this._label=void 0,this._smartButton=void 0,this.state={_color:{backgroundColor:"#000",foregroundColor:"#fff"}}}renderSmartButton(t){return n("kol-button-wc",{_ariaControls:this.id,_customClass:t._customClass,_disabled:t._disabled,_hideLabel:!0,_icons:t._icons,_id:t._id,_label:t._label,_on:t._on,_tooltipAlign:t._tooltipAlign,_variant:t._variant})}render(){const t="object"==typeof this.state._smartButton&&null!==this.state._smartButton;return n(e,null,n("span",{class:{"smart-button":"object"==typeof this.state._smartButton&&null!==this.state._smartButton},style:{backgroundColor:this.bgColorStr,color:this.colorStr}},n("kol-span-wc",{id:t?this.id:void 0,_allowMarkdown:!0,_icons:this._icons,_label:this._label}),t&&this.renderSmartButton(this.state._smartButton)))}validateColor(t){s(this,t,{defaultValue:"#000",hooks:{beforePatch:this.handleColorChange}})}validateSmartButton(t){a(t,(()=>{try{t=l(t)}catch(t){}r(this,"_smartButton",t)}))}componentWillLoad(){this.validateColor(this._color),this.validateSmartButton(this._smartButton)}static get watchers(){return{_color:["validateColor"],_smartButton:["validateSmartButton"]}}};u.style={default:c};export{u as kol_badge};
|