UNPKG

@public-ui/themes

Version:

Contains the style guides and themes of various corporate designs for KoliBri - The accessible HTML-Standard.

1 lines 129 kB
{"version":3,"file":"index.mjs","sources":["../../components/dist/esm/index-ebe5a881.js","../../components/dist/esm/events-bad0a075.js","../../components/dist/esm/browser-f629a56a.js","../../components/dist/esm/bem-e4c3a2e6.js","../../components/dist/esm/bem-dabd96cc.js","../../components/dist/esm/index.js","../../default/src/index.ts","../../ecl/src/ecl-ec/index.ts","../../ecl/src/ecl-eu/index.ts"],"sourcesContent":["/*!\n * KoliBri - The accessible HTML-Standard\n */\nvar commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\nvar loglevel = {exports: {}};\n\n/*\n* loglevel - https://github.com/pimterry/loglevel\n*\n* Copyright (c) 2013 Tim Perry\n* Licensed under the MIT license.\n*/\n\n(function (module) {\n(function (root, definition) {\n if (module.exports) {\n module.exports = definition();\n } else {\n root.log = definition();\n }\n}(commonjsGlobal, function () {\n\n // Slightly dubious tricks to cut down minimized file size\n var noop = function() {};\n var undefinedType = \"undefined\";\n var isIE = (typeof window !== undefinedType) && (typeof window.navigator !== undefinedType) && (\n /Trident\\/|MSIE /.test(window.navigator.userAgent)\n );\n\n var logMethods = [\n \"trace\",\n \"debug\",\n \"info\",\n \"warn\",\n \"error\"\n ];\n\n var _loggersByName = {};\n var defaultLogger = null;\n\n // Cross-browser bind equivalent that works at least back to IE6\n function bindMethod(obj, methodName) {\n var method = obj[methodName];\n if (typeof method.bind === 'function') {\n return method.bind(obj);\n } else {\n try {\n return Function.prototype.bind.call(method, obj);\n } catch (e) {\n // Missing bind shim or IE8 + Modernizr, fallback to wrapping\n return function() {\n return Function.prototype.apply.apply(method, [obj, arguments]);\n };\n }\n }\n }\n\n // Trace() doesn't print the message in IE, so for that case we need to wrap it\n function traceForIE() {\n if (console.log) {\n if (console.log.apply) {\n console.log.apply(console, arguments);\n } else {\n // In old IE, native console methods themselves don't have apply().\n Function.prototype.apply.apply(console.log, [console, arguments]);\n }\n }\n if (console.trace) console.trace();\n }\n\n // Build the best logging method possible for this env\n // Wherever possible we want to bind, not wrap, to preserve stack traces\n function realMethod(methodName) {\n if (methodName === 'debug') {\n methodName = 'log';\n }\n\n if (typeof console === undefinedType) {\n return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives\n } else if (methodName === 'trace' && isIE) {\n return traceForIE;\n } else if (console[methodName] !== undefined) {\n return bindMethod(console, methodName);\n } else if (console.log !== undefined) {\n return bindMethod(console, 'log');\n } else {\n return noop;\n }\n }\n\n // These private functions always need `this` to be set properly\n\n function replaceLoggingMethods() {\n /*jshint validthis:true */\n var level = this.getLevel();\n\n // Replace the actual methods.\n for (var i = 0; i < logMethods.length; i++) {\n var methodName = logMethods[i];\n this[methodName] = (i < level) ?\n noop :\n this.methodFactory(methodName, level, this.name);\n }\n\n // Define log.log as an alias for log.debug\n this.log = this.debug;\n\n // Return any important warnings.\n if (typeof console === undefinedType && level < this.levels.SILENT) {\n return \"No console available for logging\";\n }\n }\n\n // In old IE versions, the console isn't present until you first open it.\n // We build realMethod() replacements here that regenerate logging methods\n function enableLoggingWhenConsoleArrives(methodName) {\n return function () {\n if (typeof console !== undefinedType) {\n replaceLoggingMethods.call(this);\n this[methodName].apply(this, arguments);\n }\n };\n }\n\n // By default, we use closely bound real methods wherever possible, and\n // otherwise we wait for a console to appear, and then try again.\n function defaultMethodFactory(methodName, _level, _loggerName) {\n /*jshint validthis:true */\n return realMethod(methodName) ||\n enableLoggingWhenConsoleArrives.apply(this, arguments);\n }\n\n function Logger(name, factory) {\n // Private instance variables.\n var self = this;\n /**\n * The level inherited from a parent logger (or a global default). We\n * cache this here rather than delegating to the parent so that it stays\n * in sync with the actual logging methods that we have installed (the\n * parent could change levels but we might not have rebuilt the loggers\n * in this child yet).\n * @type {number}\n */\n var inheritedLevel;\n /**\n * The default level for this logger, if any. If set, this overrides\n * `inheritedLevel`.\n * @type {number|null}\n */\n var defaultLevel;\n /**\n * A user-specific level for this logger. If set, this overrides\n * `defaultLevel`.\n * @type {number|null}\n */\n var userLevel;\n\n var storageKey = \"loglevel\";\n if (typeof name === \"string\") {\n storageKey += \":\" + name;\n } else if (typeof name === \"symbol\") {\n storageKey = undefined;\n }\n\n function persistLevelIfPossible(levelNum) {\n var levelName = (logMethods[levelNum] || 'silent').toUpperCase();\n\n if (typeof window === undefinedType || !storageKey) return;\n\n // Use localStorage if available\n try {\n window.localStorage[storageKey] = levelName;\n return;\n } catch (ignore) {}\n\n // Use session cookie as fallback\n try {\n window.document.cookie =\n encodeURIComponent(storageKey) + \"=\" + levelName + \";\";\n } catch (ignore) {}\n }\n\n function getPersistedLevel() {\n var storedLevel;\n\n if (typeof window === undefinedType || !storageKey) return;\n\n try {\n storedLevel = window.localStorage[storageKey];\n } catch (ignore) {}\n\n // Fallback to cookies if local storage gives us nothing\n if (typeof storedLevel === undefinedType) {\n try {\n var cookie = window.document.cookie;\n var cookieName = encodeURIComponent(storageKey);\n var location = cookie.indexOf(cookieName + \"=\");\n if (location !== -1) {\n storedLevel = /^([^;]+)/.exec(\n cookie.slice(location + cookieName.length + 1)\n )[1];\n }\n } catch (ignore) {}\n }\n\n // If the stored level is not valid, treat it as if nothing was stored.\n if (self.levels[storedLevel] === undefined) {\n storedLevel = undefined;\n }\n\n return storedLevel;\n }\n\n function clearPersistedLevel() {\n if (typeof window === undefinedType || !storageKey) return;\n\n // Use localStorage if available\n try {\n window.localStorage.removeItem(storageKey);\n } catch (ignore) {}\n\n // Use session cookie as fallback\n try {\n window.document.cookie =\n encodeURIComponent(storageKey) + \"=; expires=Thu, 01 Jan 1970 00:00:00 UTC\";\n } catch (ignore) {}\n }\n\n function normalizeLevel(input) {\n var level = input;\n if (typeof level === \"string\" && self.levels[level.toUpperCase()] !== undefined) {\n level = self.levels[level.toUpperCase()];\n }\n if (typeof level === \"number\" && level >= 0 && level <= self.levels.SILENT) {\n return level;\n } else {\n throw new TypeError(\"log.setLevel() called with invalid level: \" + input);\n }\n }\n\n /*\n *\n * Public logger API - see https://github.com/pimterry/loglevel for details\n *\n */\n\n self.name = name;\n\n self.levels = { \"TRACE\": 0, \"DEBUG\": 1, \"INFO\": 2, \"WARN\": 3,\n \"ERROR\": 4, \"SILENT\": 5};\n\n self.methodFactory = factory || defaultMethodFactory;\n\n self.getLevel = function () {\n if (userLevel != null) {\n return userLevel;\n } else if (defaultLevel != null) {\n return defaultLevel;\n } else {\n return inheritedLevel;\n }\n };\n\n self.setLevel = function (level, persist) {\n userLevel = normalizeLevel(level);\n if (persist !== false) { // defaults to true\n persistLevelIfPossible(userLevel);\n }\n\n // NOTE: in v2, this should call rebuild(), which updates children.\n return replaceLoggingMethods.call(self);\n };\n\n self.setDefaultLevel = function (level) {\n defaultLevel = normalizeLevel(level);\n if (!getPersistedLevel()) {\n self.setLevel(level, false);\n }\n };\n\n self.resetLevel = function () {\n userLevel = null;\n clearPersistedLevel();\n replaceLoggingMethods.call(self);\n };\n\n self.enableAll = function(persist) {\n self.setLevel(self.levels.TRACE, persist);\n };\n\n self.disableAll = function(persist) {\n self.setLevel(self.levels.SILENT, persist);\n };\n\n self.rebuild = function () {\n if (defaultLogger !== self) {\n inheritedLevel = normalizeLevel(defaultLogger.getLevel());\n }\n replaceLoggingMethods.call(self);\n\n if (defaultLogger === self) {\n for (var childName in _loggersByName) {\n _loggersByName[childName].rebuild();\n }\n }\n };\n\n // Initialize all the internal levels.\n inheritedLevel = normalizeLevel(\n defaultLogger ? defaultLogger.getLevel() : \"WARN\"\n );\n var initialLevel = getPersistedLevel();\n if (initialLevel != null) {\n userLevel = normalizeLevel(initialLevel);\n }\n replaceLoggingMethods.call(self);\n }\n\n /*\n *\n * Top-level API\n *\n */\n\n defaultLogger = new Logger();\n\n defaultLogger.getLogger = function getLogger(name) {\n if ((typeof name !== \"symbol\" && typeof name !== \"string\") || name === \"\") {\n throw new TypeError(\"You must supply a name when creating a logger.\");\n }\n\n var logger = _loggersByName[name];\n if (!logger) {\n logger = _loggersByName[name] = new Logger(\n name,\n defaultLogger.methodFactory\n );\n }\n return logger;\n };\n\n // Grab the current global log variable in case of overwrite\n var _log = (typeof window !== undefinedType) ? window.log : undefined;\n defaultLogger.noConflict = function() {\n if (typeof window !== undefinedType &&\n window.log === defaultLogger) {\n window.log = _log;\n }\n\n return defaultLogger;\n };\n\n defaultLogger.getLoggers = function getLoggers() {\n return _loggersByName;\n };\n\n // ES6 default export, for compatibility\n defaultLogger['default'] = defaultLogger;\n\n return defaultLogger;\n}));\n}(loglevel));\n\nconst h = loglevel.exports;\n\nconst I=(t,e)=>s=>s(t,e),P=(t,e)=>s=>s(t,e,{append:!1}),$=()=>{const t=typeof process<\"u\"&&process.env?process.env:{},e=t.NODE_ENV===\"test\",s=\"VITEST\"in t,a=\"JEST_WORKER_ID\"in t,o=\"PLAYWRIGHT_TEST_BASE_URL\"in t,r=t.CI===\"true\",i=t.TEST===\"true\"||t.IS_TEST===\"true\",c=typeof navigator<\"u\"&&navigator.webdriver===!0,m=typeof navigator<\"u\"&&/playwright|puppeteer|webdriver|selenium|testcafe/i.test(navigator.userAgent);return e||s||a||o||r||i||c||m},n$1={A11yUi:{CSS_STYLE_CACHE:new Map,IS_TEST_ENVIRONMENT:$(),PERFORMANCE_MEASURES:new Map,STYLING_TASK_QUEUE:new Map,THEMES:new Map,showAverageTimes:()=>{const t={};for(const[s,a]of n$1.A11yUi.PERFORMANCE_MEASURES.entries())t[s]=[a.totalTime/a.count,a.count];const e=Object.entries(t).sort((s,a)=>a[1][0]-s[1][0]);return console.table(Object.fromEntries(e.map(([s,[a,o]])=>[s,{\"avg (ms)\":parseFloat(a.toFixed(2)),count:o}]))),t}}};let d=!0,f$1=!1;const j=/^[a-z][a-z0-9]{1,}(-[a-z0-9]+)?$/,F=t=>typeof t==\"string\"&&j.test(t),E=t=>{if(!F(t))throw new Error(`[Theming] The theme identifier \"${typeof t==\"string\"?t:\"\"}\" (Type: ${typeof t}) is not valid. Please use only follow this pattern: /^[a-z][a-z0-9]{1,}(-[a-z0-9]+)?$/`)},g=t=>t.replace(/\\/\\*[\\s\\S]*?\\*\\//g,\"\").replace(/\\s*([{}:;,])\\s*/g,\"$1\").replace(/\\s+/g,\" \").replace(/;\\}/g,\"}\").trim(),Y=(t,e,s,a)=>u$1(t,e,s,a),u$1=(t,e,s,a)=>{a=a??{},a.append=a.append??!1,E(t),d&&!f$1&&(f$1=!0,h.warn(`[Theming] The theme process is locked. This means that the theme \"${t}\" should not be patched.\n\n import { register } from 'adopted-style-sheets';\n import { defineCustomElements } from '...';\n import { THEME } from '...';\n\n register(THEME, defineCustomElements)\n .then(() => {\n // run your app or website\n })\n .catch(console.warn);`));let o=n$1.A11yUi.THEMES.get(t);if(o||(o=new Map,n$1.A11yUi.THEMES.set(t,o)),a.append&&o.has(e)){const r=o.get(e);o.set(e,g(`${r}${s}`));}else o.set(e,g(s));},k=(t,e,s,a)=>p(t,e,s,a),p=(t,e,s,a)=>(E(t),typeof e==\"object\"&&e!==null&&Object.getOwnPropertyNames(e).forEach(o=>{const r=e[o],i=o.toLowerCase(),c=typeof a?.transformTagName==\"function\"&&![\"GLOBAL\",\"PROPERTIES\"].includes(o)?a.transformTagName(i):o;typeof r==\"string\"&&r.length>0&&u$1(t,c.toUpperCase(),r,s);}),t),S=t=>{if(t instanceof HTMLElement){if(typeof t.dataset.theme==\"string\")return t;{let e=t.parentNode;for(;e instanceof ShadowRoot;)e=e.host;return S(e)}}else return null},A=(t={})=>t.themeEncroachCss===\"false\"||t.themeReset===\"true\"?!1:{mode:t.themeEncroachCssMode===\"after\"||t.themeEncroachCssMode===\"before\"?t.themeEncroachCssMode:\"before\"},C=()=>typeof n$1.A11yUi.Theme==\"object\"&&n$1.A11yUi.Theme!==null&&typeof n$1.A11yUi.Theme.cache==\"boolean\"&&typeof n$1.A11yUi.Theme.encroachCss==\"object\"&&n$1.A11yUi.Theme.encroachCss!==null&&typeof n$1.A11yUi.Theme.encroachCss.mode==\"string\"&&typeof n$1.A11yUi.Theme.name==\"string\",G=()=>!(typeof n$1.A11yUi.Theme==\"object\"&&n$1.A11yUi.Theme!==null)||n$1.A11yUi.Theme.name!==\"default\",b=t=>{if(C())return n$1.A11yUi.Theme;{const e={cache:!0,encroachCss:A(),loglevel:\"silent\",mode:\"csr\",name:null},s=S(t);return s instanceof HTMLElement&&(e.cache=s.dataset.themeCache!==\"false\",e.encroachCss=A(s.dataset),e.loglevel=s.dataset.themeLoglevel===\"debug\"?s.dataset.themeLoglevel:\"silent\",e.mode=s.dataset.themeMode===\"ssr\"?s.dataset.themeMode:\"csr\",e.name=s.dataset.theme||null),e}},B=(t,e)=>({cache:e.cache!==!1,detect:e.detect===\"auto\"?\"auto\":\"fixed\",encroachCss:e.encroachCss===!1?!1:typeof e.encroachCss==\"object\"&&e.encroachCss!=null&&(e.encroachCss.mode===\"after\"||e.encroachCss.mode===\"before\")?e.encroachCss:{mode:\"before\"},loglevel:e.loglevel===\"debug\"?e.loglevel:\"silent\",mode:e.mode===\"ssr\"?e.mode:\"csr\",name:typeof e.name==\"string\"?e.name:t}),K=(t,e)=>{C()===!1&&G()&&typeof e==\"object\"&&e!==null&&(e=B(t,e),e.detect===\"fixed\"?(e.name===null&&typeof t==\"string\"&&(e.name=t),t===e.name&&(n$1.A11yUi.Theme=e,h.info(`[Theming] Theme \"${t}\" was set as default theme.`))):f$1||(f$1=!0,h.warn(\"[Theming] The presetting of theme options is only relevant by using 'fixed' detection mode.\")));};let U=!1;const V=(t,e,s={})=>{U||(U=!0,d=!1,typeof window<\"u\"&&(window.A11yUi=n$1.A11yUi)),typeof t==\"function\"?t=new Set([t]):Array.isArray(t)&&(t=new Set(t)),t instanceof Set&&t.forEach(o=>{typeof o==\"function\"&&o.length===1?K(o((r,i,c)=>p(r,i,c,s)),{cache:s.theme?.cache,detect:s.theme?.detect,encroachCss:s.theme?.encroachCss,mode:s.theme?.mode,name:s.theme?.name}):h.error(\"[Theming] An attempt was made to load an incompatible theme.\");}),d=!0,typeof e==\"function\"?e=new Set([e]):Array.isArray(e)&&(e=new Set(e));const a=[];return e.forEach(o=>{const r=o();r instanceof Promise&&a.push(r);}),Promise.all(a)};const w=new Set,W=/--[^;]+/g,q=/:/,J=typeof MutationObserver<\"u\";let M=25,N=()=>{M=Math.min(25+Math.log2(n$1.A11yUi.STYLING_TASK_QUEUE.size+1)*20,250);};const X=(t,e)=>{let s=e.match(W);if(Array.isArray(s)){s=s.filter(o=>q.test(o));const a=document.createElement(\"style\");a.innerHTML=`.${t} {${s.join(\";\")}}`,document.querySelector(\"head\")?.appendChild(a);}w.add(t);},y=(t,e)=>{const s=n$1.A11yUi.THEMES.get(t);return s instanceof Map&&s.has(e)?s.get(e):\"\"},Z=t=>{for(const e of Array.from(t.childNodes))if(e instanceof HTMLStyleElement&&e.tagName===\"STYLE\"&&e.dataset.themingFallback===void 0)t.removeChild(e);else break},ee=(t,e)=>{try{if(n$1.A11yUi.Theme?.mode===\"ssr\")throw new Error(\"SSR\");const s=[];e.forEach(a=>{const o=new CSSStyleSheet;o.replaceSync(a),s.push(o);}),t.adoptedStyleSheets=s;}catch{[...e].reverse().forEach((a,o)=>{if(typeof a!=\"string\"||a.length===0)return;const r=document.createElement(\"style\");switch(r.dataset.themingFallback=\"\",o){case 4:r.dataset.themingBaseA11y=\"\";break;case 3:r.dataset.themingBaseGlobal=\"\";break;case 2:r.dataset.themingBaseComponent=\"\";break;case 1:r.dataset.themingCustomGlobal=\"\";break;case 0:r.dataset.themingCustomComponent=\"\";break;default:r.dataset.themingUnknown=\"\";break}r.innerHTML=a,t.insertBefore(r,t.firstChild);});}},te=(t,e,s)=>{if(s!==!1){const a=[...Array.from(t.childNodes).filter(r=>r instanceof HTMLStyleElement&&r.tagName===\"STYLE\")];let o;try{o=[...Array.from(t.adoptedStyleSheets)];}catch{o=[];}s?.mode===\"before\"?(a.reverse().forEach(r=>e.unshift(r.innerHTML)),o.reverse().forEach(r=>e.unshift(Array.from(r.cssRules).map(i=>i.cssText).join(\"\")))):s?.mode===\"after\"&&(a.forEach(r=>e.push(r.innerHTML)),o.forEach(r=>e.push(Array.from(r.cssRules).map(i=>i.cssText).join(\"\"))));}},se=(t,e,s)=>{const a=e.name||\"default\";let o;try{if(t.shadowRoot===null)throw new Error(\"ShadowRoot is null\");o=t.shadowRoot;}catch{o=t;}if(n$1.A11yUi.CSS_STYLE_CACHE.get(a)?.has(t.tagName))v(t,o,n$1.A11yUi.CSS_STYLE_CACHE.get(a)?.get(t.tagName),s);else {const r=y(a,\"PROPERTIES\"),i=y(a,\"GLOBAL\"),c=y(a,t.tagName);w.has(a)===!1&&X(a,i);const m=[r,i,c];te(o,m,e.encroachCss),e.cache===!0&&(n$1.A11yUi.CSS_STYLE_CACHE.has(a)===!1&&n$1.A11yUi.CSS_STYLE_CACHE.set(a,new Map),n$1.A11yUi.CSS_STYLE_CACHE.get(a)?.set(t.tagName,m)),v(t,o,m,s);}},v=(t,e,s,a)=>{const o=performance.now();if(Z(e),ee(e,s),H(t),a(),n$1.A11yUi.PERFORMANCE_MEASURES.has(t.tagName)){const r=n$1.A11yUi.PERFORMANCE_MEASURES.get(t.tagName);r.count+=1,r.totalTime+=performance.now()-o;}else n$1.A11yUi.PERFORMANCE_MEASURES.set(t.tagName,{count:1,totalTime:performance.now()-o});},L=t=>{const e=n$1.A11yUi.STYLING_TASK_QUEUE.get(t);if(e){const{resetCss:s,themeDetails:a}=e;se(t,a,s),H(t);}};let T=t=>{const e=setTimeout(()=>{clearTimeout(e),t.classList.contains(\"hydrated\")?L(t):T(t);},M);};const ae={attributes:!0,attributeFilter:[\"class\"],childList:!1,subtree:!1},oe={attributes:!0,attributeFilter:[],childList:!1,subtree:!1},R=J?new MutationObserver((t,e)=>{for(const s of t){const a=s.target;a.classList.contains(\"hydrated\")&&(L(a),e.observe(a,oe));}}):null;R&&(T=t=>R.observe(t,ae),N=()=>{});let _=t=>{const e=getComputedStyle(t).getPropertyValue(\"--theme-visibility-delay\").trim();if(e.endsWith(\"ms\"))return parseFloat(e);if(e.endsWith(\"s\"))return parseFloat(e)*1e3;{const s=parseFloat(e);return isNaN(s)?0:s}};n$1.A11yUi.IS_TEST_ENVIRONMENT&&(_=()=>0);const O=(t,e)=>{t.style.setProperty(\"visibility\",e),t.dataset.themed=\"\";},re=(t,e)=>{const s=t.style.visibility||null;n$1.A11yUi.STYLING_TASK_QUEUE.set(t,{resetCss:()=>{const a=_(t);a>0?setTimeout(()=>{O(t,s);},a):O(t,s);},themeDetails:e}),t.style.setProperty(\"visibility\",\"hidden\",\"important\"),T(t);},H=t=>{n$1.A11yUi.STYLING_TASK_QUEUE.delete(t),N();},ne=(t,e)=>{re(t,{...n$1.A11yUi.Theme,...e});};class ie{Prefix;Key;Tag;createTheme=(e,s)=>P(e,s);createTranslation=(e,s)=>I(e,s);constructor(e,s,a){this.Prefix=e,this.Key=Object.getOwnPropertyNames(s),this.Tag=Object.getOwnPropertyNames(a);}}\n\nvar KeyEnum;\n(function (KeyEnum) {\n KeyEnum[KeyEnum[\"error\"] = 0] = \"error\";\n KeyEnum[KeyEnum[\"warning\"] = 1] = \"warning\";\n KeyEnum[KeyEnum[\"info\"] = 2] = \"info\";\n KeyEnum[KeyEnum[\"success\"] = 3] = \"success\";\n KeyEnum[KeyEnum[\"message\"] = 4] = \"message\";\n KeyEnum[KeyEnum[\"close\"] = 5] = \"close\";\n KeyEnum[KeyEnum[\"form-description\"] = 6] = \"form-description\";\n KeyEnum[KeyEnum[\"of\"] = 7] = \"of\";\n KeyEnum[KeyEnum[\"characters\"] = 8] = \"characters\";\n KeyEnum[KeyEnum[\"new\"] = 9] = \"new\";\n KeyEnum[KeyEnum[\"no-entries\"] = 10] = \"no-entries\";\n KeyEnum[KeyEnum[\"change-order\"] = 11] = \"change-order\";\n KeyEnum[KeyEnum[\"action-running\"] = 12] = \"action-running\";\n KeyEnum[KeyEnum[\"action-done\"] = 13] = \"action-done\";\n KeyEnum[KeyEnum[\"page-first\"] = 14] = \"page-first\";\n KeyEnum[KeyEnum[\"page-back\"] = 15] = \"page-back\";\n KeyEnum[KeyEnum[\"page-next\"] = 16] = \"page-next\";\n KeyEnum[KeyEnum[\"page-last\"] = 17] = \"page-last\";\n KeyEnum[KeyEnum[\"entries-per-site\"] = 18] = \"entries-per-site\";\n KeyEnum[KeyEnum[\"page-current\"] = 19] = \"page-current\";\n KeyEnum[KeyEnum[\"page-selected\"] = 20] = \"page-selected\";\n KeyEnum[KeyEnum[\"page-per-site\"] = 21] = \"page-per-site\";\n KeyEnum[KeyEnum[\"logo-description\"] = 22] = \"logo-description\";\n KeyEnum[KeyEnum[\"open-link-in-tab\"] = 23] = \"open-link-in-tab\";\n KeyEnum[KeyEnum[\"kolibri-logo\"] = 24] = \"kolibri-logo\";\n})(KeyEnum || (KeyEnum = {}));\n\nvar TagEnum;\n(function (TagEnum) {\n TagEnum[TagEnum[\"abbr\"] = 0] = \"abbr\";\n TagEnum[TagEnum[\"accordion\"] = 1] = \"accordion\";\n TagEnum[TagEnum[\"accordion-group\"] = 2] = \"accordion-group\";\n TagEnum[TagEnum[\"alert\"] = 3] = \"alert\";\n TagEnum[TagEnum[\"avatar\"] = 4] = \"avatar\";\n TagEnum[TagEnum[\"badge\"] = 5] = \"badge\";\n TagEnum[TagEnum[\"breadcrumb\"] = 6] = \"breadcrumb\";\n TagEnum[TagEnum[\"button\"] = 7] = \"button\";\n TagEnum[TagEnum[\"button-link\"] = 8] = \"button-link\";\n TagEnum[TagEnum[\"card\"] = 9] = \"card\";\n TagEnum[TagEnum[\"combobox\"] = 10] = \"combobox\";\n TagEnum[TagEnum[\"details\"] = 11] = \"details\";\n TagEnum[TagEnum[\"drawer\"] = 12] = \"drawer\";\n TagEnum[TagEnum[\"form\"] = 13] = \"form\";\n TagEnum[TagEnum[\"heading\"] = 14] = \"heading\";\n TagEnum[TagEnum[\"icon\"] = 15] = \"icon\";\n TagEnum[TagEnum[\"image\"] = 16] = \"image\";\n TagEnum[TagEnum[\"input-checkbox\"] = 17] = \"input-checkbox\";\n TagEnum[TagEnum[\"input-color\"] = 18] = \"input-color\";\n TagEnum[TagEnum[\"input-date\"] = 19] = \"input-date\";\n TagEnum[TagEnum[\"input-email\"] = 20] = \"input-email\";\n TagEnum[TagEnum[\"input-file\"] = 21] = \"input-file\";\n TagEnum[TagEnum[\"input-number\"] = 22] = \"input-number\";\n TagEnum[TagEnum[\"input-password\"] = 23] = \"input-password\";\n TagEnum[TagEnum[\"input-radio\"] = 24] = \"input-radio\";\n TagEnum[TagEnum[\"input-range\"] = 25] = \"input-range\";\n TagEnum[TagEnum[\"input-text\"] = 26] = \"input-text\";\n TagEnum[TagEnum[\"kolibri\"] = 27] = \"kolibri\";\n TagEnum[TagEnum[\"link\"] = 28] = \"link\";\n TagEnum[TagEnum[\"link-button\"] = 29] = \"link-button\";\n TagEnum[TagEnum[\"logo\"] = 30] = \"logo\";\n TagEnum[TagEnum[\"modal\"] = 31] = \"modal\";\n TagEnum[TagEnum[\"nav\"] = 32] = \"nav\";\n TagEnum[TagEnum[\"pagination\"] = 33] = \"pagination\";\n TagEnum[TagEnum[\"popover-button\"] = 34] = \"popover-button\";\n TagEnum[TagEnum[\"progress\"] = 35] = \"progress\";\n TagEnum[TagEnum[\"select\"] = 36] = \"select\";\n TagEnum[TagEnum[\"separator\"] = 37] = \"separator\";\n TagEnum[TagEnum[\"single-select\"] = 38] = \"single-select\";\n TagEnum[TagEnum[\"skip-nav\"] = 39] = \"skip-nav\";\n TagEnum[TagEnum[\"spin\"] = 40] = \"spin\";\n TagEnum[TagEnum[\"split-button\"] = 41] = \"split-button\";\n TagEnum[TagEnum[\"symbol\"] = 42] = \"symbol\";\n TagEnum[TagEnum[\"table\"] = 43] = \"table\";\n TagEnum[TagEnum[\"table-stateful\"] = 44] = \"table-stateful\";\n TagEnum[TagEnum[\"table-stateless\"] = 45] = \"table-stateless\";\n TagEnum[TagEnum[\"tabs\"] = 46] = \"tabs\";\n TagEnum[TagEnum[\"textarea\"] = 47] = \"textarea\";\n TagEnum[TagEnum[\"toast-container\"] = 48] = \"toast-container\";\n TagEnum[TagEnum[\"toolbar\"] = 49] = \"toolbar\";\n TagEnum[TagEnum[\"tooltip\"] = 50] = \"tooltip\";\n TagEnum[TagEnum[\"tree\"] = 51] = \"tree\";\n TagEnum[TagEnum[\"tree-item\"] = 52] = \"tree-item\";\n})(TagEnum || (TagEnum = {}));\n\nconst getWindow = () => (typeof window === 'undefined' ? null : window);\nconst getDocument = () => (typeof getWindow().document === 'undefined' ? null : getWindow().document);\nlet DEV_MODE = false;\nlet EXPERIMENTAL_MODE = false;\nlet COLOR_CONTRAST_ANALYSIS = false;\nconst getDevMode = () => DEV_MODE === true;\nconst setDevMode = (mode) => {\n DEV_MODE = mode === true;\n};\nconst getExperimentalMode = () => EXPERIMENTAL_MODE === true;\nconst setExperimentalMode = (mode) => {\n EXPERIMENTAL_MODE = mode === true;\n};\nconst getColorContrastAnalysis = () => COLOR_CONTRAST_ANALYSIS === true;\nconst setColorContrastAnalysis = (mode) => {\n COLOR_CONTRAST_ANALYSIS = mode === true;\n};\nconst LOG_STYLE = 'color: white; background: #666; font-weight: bold; padding: .25em .5em; border-radius: 3px; border: 1px solid #000';\nconst mapToArray = (msg) => {\n return Array.isArray(msg) ? msg : [msg];\n};\nconst getLogLabel = (label) => {\n return `%c${label}`;\n};\nconst handleClassifier = (label, classifier) => {\n if (typeof classifier === 'string' && classifier.length > 0) {\n return `${getLogLabel(label)} | ${classifier}`;\n }\n else {\n return getLogLabel(label);\n }\n};\nconst getShield = (label, options) => {\n return [handleClassifier(label, options === null || options === void 0 ? void 0 : options.classifier), `${LOG_STYLE};${(options === null || options === void 0 ? void 0 : options.overwriteStyle) || ''}`];\n};\nconst isDevModeOrForceLog = (devMode, forceLog) => devMode() || forceLog === true;\nclass Logger {\n constructor(label, devMode) {\n this.label = label;\n this.devMode = devMode;\n }\n debug(msg, options) {\n if (isDevModeOrForceLog(this.devMode, options === null || options === void 0 ? void 0 : options.forceLog)) {\n console.debug(...getShield(this.label, options), ...mapToArray(msg));\n }\n }\n info(msg, options) {\n if (isDevModeOrForceLog(this.devMode, options === null || options === void 0 ? void 0 : options.forceLog)) {\n console.info(...getShield(this.label, options), ...mapToArray(msg));\n }\n }\n trace(msg, options) {\n if (isDevModeOrForceLog(this.devMode, options === null || options === void 0 ? void 0 : options.forceLog)) {\n console.trace(...getShield(this.label, options), ...mapToArray(msg));\n }\n }\n warn(msg, options) {\n if (isDevModeOrForceLog(this.devMode, options === null || options === void 0 ? void 0 : options.forceLog)) {\n console.warn(...getShield(this.label, options), ...mapToArray(msg));\n }\n }\n error(msg, options) {\n console.error(...getShield(this.label, options), ...mapToArray(msg));\n }\n throw(msg, options) {\n if (isDevModeOrForceLog(this.devMode, options === null || options === void 0 ? void 0 : options.forceLog)) {\n throw new Error(...getShield(this.label, options), ...mapToArray(msg));\n }\n }\n}\nconst Log = new Logger('KoliBri', getDevMode);\n\nconst a11yCache = new Set();\nconst a11yHint = (msg, options) => {\n if (a11yCache.has(msg) === false || !!(options === null || options === void 0 ? void 0 : options.force)) {\n a11yCache.add(msg);\n Log.debug([msg].concat((options === null || options === void 0 ? void 0 : options.details) || []), {\n classifier: `✋ a11y`,\n forceLog: !!(options === null || options === void 0 ? void 0 : options.force),\n overwriteStyle: '; background-color: #09f',\n });\n }\n};\nconst deprecatedCache = new Set();\nconst deprecatedHint = (msg, options) => {\n if (deprecatedCache.has(msg) === false || !!(options === null || options === void 0 ? void 0 : options.force)) {\n deprecatedCache.add(msg);\n Log.warn([msg].concat((options === null || options === void 0 ? void 0 : options.details) || []), {\n classifier: `🔥 deprecated`,\n forceLog: !!(options === null || options === void 0 ? void 0 : options.force),\n overwriteStyle: '; background-color: #f00',\n });\n }\n};\nconst devCache = new Set();\nconst devHint = (msg, options) => {\n if (devCache.has(msg) === false || !!(options === null || options === void 0 ? void 0 : options.force)) {\n devCache.add(msg);\n Log.debug([msg].concat((options === null || options === void 0 ? void 0 : options.details) || []), {\n classifier: `💻 dev`,\n forceLog: !!(options === null || options === void 0 ? void 0 : options.force),\n overwriteStyle: '; background-color: #f09',\n });\n }\n};\nconst devWarning = (msg, options) => {\n if (devCache.has(msg) === false || !!(options === null || options === void 0 ? void 0 : options.force)) {\n devCache.add(msg);\n Log.warn([msg].concat((options === null || options === void 0 ? void 0 : options.details) || []), {\n classifier: `⚠️ dev`,\n forceLog: !!(options === null || options === void 0 ? void 0 : options.force),\n overwriteStyle: '; background-color: #f09',\n });\n }\n};\nconst featureCache = new Set();\nconst featureHint = (msg, done = false, options) => {\n if (featureCache.has(msg) === false || !!(options === null || options === void 0 ? void 0 : options.force)) {\n featureCache.add(msg);\n msg += done === true ? ' ✅' : '';\n Log.debug([msg].concat((options === null || options === void 0 ? void 0 : options.details) || []), {\n classifier: `🌟 feature`,\n forceLog: !!(options === null || options === void 0 ? void 0 : options.force),\n overwriteStyle: '; background-color: #309',\n });\n }\n};\ndevHint(`We appreciate any feedback, comments, screenshots, or demo links of an application based on KoliBri (kolibri@itzbund.de). Thank you!`);\nconst uiUxCache = new Set();\nconst uiUxHint = (msg, options) => {\n if (uiUxCache.has(msg) === false || !!(options === null || options === void 0 ? void 0 : options.force)) {\n uiUxCache.add(msg);\n Log.debug([msg].concat((options === null || options === void 0 ? void 0 : options.details) || []), {\n classifier: `📑 ui/ux`,\n forceLog: !!(options === null || options === void 0 ? void 0 : options.force),\n overwriteStyle: '; background-color: #060;',\n });\n }\n};\nconst a11yHintDisabled = () => {\n a11yHint(`\"Disabled\" limits accessibility and visibility. From an accessibility perspective, we recommend using the readonly attribute instead of disabled.\\n- https://uxdesign.cc/is-it-ok-to-grey-out-disabled-buttons-8afa74a0fae`);\n};\nconst a11yHintLabelingLandmarks = (value) => {\n if (typeof value !== 'string' || value === '') {\n a11yHint(`Some structural elements, such as the nav tag, can be used multiple times on a webpage. To distinguish between similarly named structural elements, it is necessary to set an ARIA label.\\n- https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/Navigation_Role#accessibility_concerns`);\n }\n};\nconst uiUxHintMillerscheZahl = (className, length = 8) => {\n if (length > 7) {\n uiUxHint(`[${className}] Within navigation structures, it is recommended to use no more than 7 menu items.\n\nLink:\n- https://en.wikipedia.org/wiki/The_Magical_Number_Seven,_Plus_or_Minus_Two`);\n }\n};\n\nvar n=.2126,r=.7152,t=.0722,e=1/12.92;function u(n){return Math.pow((n+.055)/1.055,2.4)}function a(a){var i=a[0]/255,c=a[1]/255,o=a[2]/255,s=i<=.03928?i*e:u(i),f=c<=.03928?c*e:u(c),l=o<=.03928?o*e:u(o);return s*n+f*r+l*t}function i(n){var r=255;8===(n=n.replace(/^#/,\"\")).length&&(r=parseInt(n.slice(6,8),16),n=n.substring(0,6)),4===n.length&&(r=parseInt(n.slice(3,4).repeat(2),16),n=n.substring(0,3)),3===n.length&&(n=n[0]+n[0]+n[1]+n[1]+n[2]+n[2]);var t=parseInt(n,16);return [t>>16,t>>8&255,255&t,r]}function c(n,r){return (Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function o(n,r){return c(a(n),a(r))}function s(n,r){return o(i(n),i(r))}function f(n){return n>=7?\"AAA\":n>=4.5?\"AA\":n>=3?\"AA Large\":\"Fail\"}\n\nvar rgbaConvert = {exports: {}};\n\nrgbaConvert.exports = arr;\nrgbaConvert.exports.arr = arr;\nrgbaConvert.exports.obj = obj;\nrgbaConvert.exports.css = css;\nrgbaConvert.exports.hex = hex;\nrgbaConvert.exports.num = num;\n\nfunction arr(data) {\n var a = parse(data);\n if (a.length == 3) {\n return a.concat(255)\n } else {\n a[3] = Math.round(a[3]);\n return a\n }\n}\n\nfunction obj(data) {\n var a = parse(data);\n return {\n r: a[0],\n g: a[1],\n b: a[2],\n a: a.length == 3\n ? 255\n : Math.round(a[3])\n }\n}\n\nfunction css(data) {\n var a = parse(data);\n if (a.length == 3) a.push(255);\n\n return a[3] == 255\n ? 'rgb(' + a[0] + ', ' + a[1] + ', ' + a[2] + ')'\n : a[3] == 0\n ? 'rgba(' + a[0] + ', ' + a[1] + ', ' + a[2] + ', 0)'\n : 'rgba(' + a[0] + ', ' + a[1] + ', ' + a[2] + ', ' + String(a[3] / 255).substr(1) + ')'\n}\n\nfunction hex(data) {\n var a = parse(data);\n if (a.length == 3) a.push(255);\n var opaque = a[3] == 255;\n var r = num2hex(a[0]);\n var g = num2hex(a[1]);\n var b = num2hex(a[2]);\n var a = num2hex(Math.round(a[3]));\n var is = isshort(r, g, b, a);\n if (opaque) {\n return is\n ? '#' + r.charAt(0) + g.charAt(0) + b.charAt(0)\n : '#' + r + g + b\n }\n return is\n ? '#' + r.charAt(0) + g.charAt(0) + b.charAt(0) + a.charAt(0)\n : '#' + r + g + b + a\n}\n\nfunction num(data) {\n var a = parse(data);\n if (a.length == 3) a.push(255);\n else a[3] = Math.round(a[3]);\n return ((a[3] << 24) >>> 0 | a[0] << 16 | a[1] << 8 | a[2]) >>> 0\n}\n\nfunction parse(data) {\n if (typeof data == 'string') {\n data = data.toLowerCase();\n return name(data)\n || hex3(data)\n || hex6(data)\n || rgb(data)\n || rgba(data)\n || [0, 0, 0, 255]\n }\n return object(data)\n || array(data)\n || number(data)\n || [0, 0, 0, 255]\n}\n\nfunction num2hex(num) {\n var s = num.toString(16);\n return s.length == 1\n ? '0' + s\n : s\n}\n\nfunction isshort(r, g, b, a) {\n var h = ['ff', '00', '11', '22', '33', '44', '55', '66',\n '77', '88', '99', 'aa', 'bb', 'cc', 'dd', 'ee'];\n return h.indexOf(r) != -1\n && h.indexOf(g) != -1\n && h.indexOf(b) != -1\n && h.indexOf(a) != -1\n}\n\nfunction name(str) {\n if (str == 'red') return [255, 0, 0]\n if (str == 'green') return [0, 255, 0]\n if (str == 'blue') return [0, 0, 255]\n if (str == 'black') return [0, 0, 0]\n if (str == 'white') return [255, 255, 255]\n if (str == 'cyan') return [0, 255, 255]\n if (str == 'gray') return [128, 128, 128]\n if (str == 'grey') return [128, 128, 128]\n if (str == 'magenta') return [255, 0, 255]\n // ok, not the real css `pink` but my personal `magenta` alias\n // `pink` is simpler than `fuchsia`, whatever...\n if (str == 'pink') return [255, 0, 255]\n if (str == 'yellow') return [255, 255, 0]\n}\n\nfunction hex2num(str) {\n return str.length == 1\n ? parseInt(str + str, 16)\n : parseInt(str, 16)\n}\n\nfunction hex3(str) {\n var s = str.replace(/^#/,'');\n var l = s.length;\n if (l == 3 || l == 4) {\n var r = hex2num(s[0]);\n var g = hex2num(s[1]);\n var b = hex2num(s[2]);\n var a = l == 3\n ? 255\n : hex2num(s[3]);\n\n if (isNaN(r) || isNaN(g) || isNaN(b) || isNaN(a)) return\n\n return [r, g, b, a]\n }\n}\n\nfunction hex6(str) {\n var s = str.replace(/^#/,'');\n var l = s.length;\n if (l == 6 || l == 8) {\n var r = hex2num(s.slice(0, 2));\n var g = hex2num(s.slice(2, 4));\n var b = hex2num(s.slice(4, 6));\n var a = l == 6\n ? 255\n : hex2num(s.slice(6, 8));\n\n if (isNaN(r) || isNaN(g) || isNaN(b) || isNaN(a)) return\n\n return [r, g, b, a]\n }\n}\n\nfunction getnum(val, integer) {\n if (typeof val != 'number') return -1\n if (integer === true && Math.floor(val) !== val) return -1\n return val >= 0 && val <= 255\n ? val\n : -1\n}\n\nfunction object(obj) {\n if (Object.prototype.toString.call(obj) === '[object Object]'\n && Object.getPrototypeOf(obj) === Object.getPrototypeOf({})) {\n var r = getnum(obj.r != undefined ? obj.r : obj.red != undefined ? obj.red : 0, true);\n var g = getnum(obj.g != undefined ? obj.g : obj.green != undefined ? obj.green : 0, true);\n var b = getnum(obj.b != undefined ? obj.b : obj.blue != undefined ? obj.blue : 0, true);\n var a = getnum(obj.a != undefined ? obj.a : obj.alpha != undefined ? obj.alpha : 255, true);\n if (r != -1 && g != -1 && b != -1 && a != -1) {\n return [r, g, b, a]\n }\n }\n}\n\nfunction array(arr) {\n if (Array.isArray(arr) && (arr.length == 3 || arr.length == 4)) {\n var r = getnum(arr[0], true);\n var g = getnum(arr[1], true);\n var b = getnum(arr[2], true);\n var a = getnum(arr[3] != undefined ? arr[3] : 255, true);\n if (r != -1 && g != -1 && b != -1 && a != -1) {\n return [r, g, b, a]\n }\n }\n}\n\nfunction number(num) {\n if (typeof num == 'number' && Math.floor(num) == num && num <= 4294967295 && num >= 0) {\n var a = num >> 24 & 255;\n var r = num >> 16 & 255;\n var g = num >> 8 & 255;\n var b = num & 255;\n return [r, g, b, a]\n }\n}\n\nfunction rgb(str) {\n if (str.substr(0, 4) == 'rgb(') {\n str = str.match(/^rgb\\(([^)]+)\\)/)[1];\n var t = str.split(/ *, */).map(Number);\n var r = getnum(t[0], true);\n var g = getnum(t[1], true);\n var b = getnum(t[2], true);\n if (r != -1 && g != -1 && b != -1) {\n return [r, g, b, 255]\n }\n }\n}\n\nfunction rgba(str) {\n if (str.substr(0, 5) == 'rgba(') {\n str = str.match(/^rgba\\(([^)]+)\\)/)[1];\n var t = str.split(/ *, */).map(Number);\n var r = getnum(t[0], true);\n var g = getnum(t[1], true);\n var b = getnum(t[2], true);\n var a = getnum(t[3] * 255);\n if (r != -1 && g != -1 && b != -1 && a != -1) {\n return [r, g, b, a]\n }\n }\n}\n\nconst rgba$1 = rgbaConvert.exports;\n\nconst pushNodes = (set, domNodes) => {\n domNodes.forEach((domNode) => {\n if (set.has(domNode) === false) {\n set.add(domNode);\n }\n });\n};\nconst querySelectorAll = (selector, node = document) => {\n if (node instanceof Document ||\n node instanceof HTMLElement ||\n node instanceof ShadowRoot) {\n const domNodes = new Set();\n pushNodes(domNodes, node.querySelectorAll(selector));\n const nodeList = node.querySelectorAll('[class*=\"hydrated\"]');\n for (let i = 0; i < nodeList.length; i++) {\n const shadowRoot = nodeList[i].shadowRoot;\n if (typeof shadowRoot === \"object\" && shadowRoot !== null) {\n pushNodes(domNodes, querySelectorAll(selector, shadowRoot));\n }\n else {\n pushNodes(domNodes, querySelectorAll(selector, nodeList[i]));\n }\n }\n return Array.from(domNodes);\n }\n else {\n throw new Error(`The parameter document for the method querySelectorAll is not type of Document, HTMLElement or ShadowRoot.`);\n }\n};\n\nconst querySelector = (selector, node = document) => {\n if (node instanceof Document ||\n node instanceof HTMLElement ||\n node instanceof ShadowRoot) {\n let domNode = node.querySelector(selector);\n if (domNode === null) {\n const nodeList = node.querySelectorAll('[class*=\"hydrated\"]');\n for (let i = 0; i < nodeList.length; i++) {\n const shadowRoot = nodeList[i].shadowRoot;\n if (typeof shadowRoot === \"object\" && shadowRoot !== null) {\n domNode = querySelector(selector, shadowRoot);\n }\n else {\n domNode = querySelector(selector, nodeList[i]);\n }\n if (domNode !== null) {\n break;\n }\n }\n }\n return domNode;\n }\n else {\n throw new Error(`The parameter document for the method querySelector is not type of Document, HTMLElement or ShadowRoot.`);\n }\n};\n\nconst OBJECT_OBJECT = /\\[object Object\\]/;\nconst objectObjectHandler = (value, cb) => {\n if (typeof value === 'string' && OBJECT_OBJECT.test(value)) {\n return;\n }\n cb();\n};\nconst emptyStringByArrayHandler = (value, cb) => {\n if (typeof value === 'string' && value === '') {\n return;\n }\n cb();\n};\nconst setEventTarget = (event, target) => {\n if (getExperimentalMode()) {\n Log.debug([event, target]);\n Log.debug(`↑ We propagate the (submit) event to this target.`);\n }\n Object.defineProperty(event, 'target', {\n value: target,\n writable: false,\n });\n};\nconst patchState = (component) => {\n var _a, _b, _c;\n (_a = component.nextHooks) === null || _a === void 0 ? void 0 : _a.forEach((hooks, key) => {\n var _a;\n const beforePatch = hooks.get('beforePatch');\n if (typeof beforePatch === 'function') {\n beforePatch((_a = component.nextState) === null || _a === void 0 ? void 0 : _a.get(key), component.nextState, component, key);\n }\n });\n if (((_b = component.nextState) === null || _b === void 0 ? void 0 : _b.size) > 0) {\n component.state = Object.assign(Object.assign({}, component.state), Object.fromEntries(component.nextState));\n delete component.nextState;\n (_c = component.nextHooks) === null || _c === void 0 ? void 0 : _c.forEach((hooks, key) => {\n const afterPatch = hooks.get('afterPatch');\n if (typeof afterPatch === 'function') {\n afterPatch(component.state[key], component.state, component, key);\n }\n });\n }\n delete component.nextHooks;\n};\nconst setState = (component, propName, value, hooks = {}) => {\n var _a, _b;\n if (component.nextHooks === undefined) {\n component.nextHooks = new Map();\n }\n if (component.nextState === undefined) {\n component.nextState = new Map();\n }\n const nextHooks = component.nextHooks.get(propName);\n if (nextHooks instanceof Map === false) {\n component.nextHooks.set(propName, new Map());\n }\n if (typeof hooks.afterPatch === 'function') {\n (_a = component.nextHooks.get(propName)) === null || _a === void 0 ? void 0 : _a.set('afterPatch', hooks.afterPatch);\n }\n if (typeof hooks.beforePatch === 'function') {\n (_b = component.nextHooks.get(propName)) === null || _b === void 0 ? void 0 : _b.set('beforePatch', hooks.beforePatch);\n }\n component.nextState.set(propName, value);\n patchState(component);\n};\nconst logWarn = (component, propName, value, requiredGeneric) => {\n devHint(`[${component.constructor.name}] The property value: (${value}) for '${propName}' is not valid. Allowed values are: ${Array.from(requiredGeneric).join(', ')}`);\n};\nfunction watchValidator(component, propName, validationFunction, requiredGeneric, value, options = {}) {\n if (validationFunction(value)) {\n setState(component, propName, value, options.hooks);\n }\n else if (value === undefined && options.required !== true && validationFunction(options.defaultValue)) {\n setState(component, propName, options.defaultValue, options.hooks);\n }\n else {\n if (!options.required) {\n requiredGeneric.add(null);\n }\n logWarn(component, propName, value, requiredGeneric);\n }\n}\nconst watchBoolean = (component, propName, value, options) => {\n watchValidator(component, propName, (value) => typeof value === 'boolean', new Set(['Boolean {true, false}']), value, options);\n};\nconst watchString = (component, propName, value, options = {}) => {\n const minLength = typeof options.minLength === 'number' ? options === null || options === void 0 ? void 0 : options.minLength : 0;\n watchValidator(component, propName, (value) => typeof value === 'string' && value.length >= minLength && (typeof (options === null || options === void 0 ? void 0 : options.maxLength) === 'undefined' || value.length <= options.maxLength), new Set([`String`]), value, options);\n};\nconst watchNumber = (component, propName, value, options) => {\n watchValidator(component, propName, (value) => typeof value === 'number' &&\n (typeof (options === null || options === void 0 ? void 0 : options.min) === 'undefined' || (typeof (options === null || options === void 0 ? void 0 : options.min) === 'number' && value >= options.min)) &&\n (typeof (options === null || options === void 0 ? void 0 : options.max) === 'undefined' || (typeof (options === null || options === void 0 ? void 0 : options.max) === 'number' && value <= options.max)), new Set(['Number']), value, options);\n};\nconst watchJsonArrayString = (component, propName, itemValidation, value, arrayValidation = (items) => items === items, options = {}) => {\n emptyStringByArrayHandler(value, () => {\n objectObjectHandler(value, () => {\n if (typeof value === 'undefined') {\n value = [];\n }\n try {\n try {\n value = parseJson(value);\n }\n catch (e) {\n }\n if (Array.isArray(value)) {\n const invalid = value.find((item) => !itemValidation(item));\n if (invalid === undefined && arrayValidation(value)) {\n setState(component, propName, value, options.hooks);\n }\n else {\n objectObjectHandler(invalid, () => {\n Log.debug(invalid);\n throw new Error(`↑ The schema for the property (_options) is not valid. The value will not be changed.`);\n });\n }\n }\n else {\n objectObjectHandler(value, () => {\n Log.debug(value);\n throw new Error(`↑ The schema for the property (_options) is not valid. The value will not be changed.`);\n });\n }\n }\n catch (error) {\n Log.debug(error);\n }\n });\n });\n};\nconst stringifyJson = (value) => {\n try {\n return JSON.stringify(value).replace(/\"/g, \"'\");\n }\n catch (error) {\n Log.warn(['stringifyJson', value]);\n Log.error(`↑ The JSON could not be converted to a string. A stringifiable JSON is expected.`);\n throw new Error();\n }\n};\nconst JSON_CHARS = /^[{[]/;\nconst parseJson = (value) => {\n if (typeof value === 'string') {\n try {\n return JSON.parse(value);\n }\n catch (error) {\n if (JSON_CHARS.test(value)) {\n try {\n return JSON.parse(value.replace(/'/g, '\"'));\n }\n catch (error) {\n Log.warn(['parseJson', value]);\n Log.error(`↑ The JSON string could not be parsed. Make sure that single quotes in the text are escaped (&#8216;).`);\n }\n }\n }\n }\n throw new Error();\n};\nconst mapBoolean2String = (value) => {\n return typeof value === 'boolean' ? (value === true ? 'true' : 'false') : undefined;\n};\nconst mapStringOrBoolean2String = (value) => {\n return typeof value === 'string' ? value : mapBoolean2String(value);\n};\nconst koliBriQuerySelector = (selector, node) => querySelector(selector, node || getDocument());\nconst koliBriQuerySelectorAll = (selector, node) => querySelectorAll(selector, node || getDocument());\nlet DEFAULT_COL