/*! ███╗ ███╗███████╗████████╗██████╗ ██████╗ ██╗ ██╗██╗ ████╗ ████║██╔════╝╚══██╔══╝██╔══██╗██╔═══██╗ ██║ ██║██║ ██╔████╔██║█████╗ ██║ ██████╔╝██║ ██║ ██║ ██║██║ ██║╚██╔╝██║██╔══╝ ██║ ██╔══██╗██║ ██║ ██║ ██║██║ ██║ ╚═╝ ██║███████╗ ██║ ██║ ██║╚██████╔╝ ╚██████╔╝██║ ╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ * Metro UI v5.1.21 Components Library (https://metroui.org.ua) * Build: 10.11.2025, 13:59:31 * Copyright 2012-2025 by Serhii Pimenov * Licensed under MIT */ (() => { var __defProp = Object.defineProperty; var __export = (target, all) => { for (var name2 in all) __defProp(target, name2, { get: all[name2], enumerable: true }); }; // node_modules/@olton/datetime/dist/datetime.js var isNum = (v5) => !isNaN(v5); var DEFAULT_FORMAT = "YYYY-MM-DDTHH:mm:ss.sss"; var INVALID_DATE = "Invalid date"; var REGEX_FORMAT = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|m{1,2}|s{1,3}/g; var REGEX_FORMAT_STRFTIME = /(%[a-z])/gi; var DEFAULT_FORMAT_STRFTIME = "%Y-%m-%dT%H:%M:%S.%Q%t"; var DEFAULT_LOCALE = { months: "January February March April May June July August September October November December".split(" "), monthsShort: "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "), weekdays: "Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "), weekdaysShort: "Sun Mon Tue Wed Thu Fri Sat".split(" "), weekdaysMin: "Su Mo Tu We Th Fr Sa".split(" "), weekStart: 0 }; var M = { ms: "Milliseconds", s: "Seconds", m: "Minutes", h: "Hours", D: "Date", d: "Day", M: "Month", Y: "FullYear", y: "Year", t: "Time" }; var C = { ms: "ms", s: "second", m: "minute", h: "hour", D: "day", W: "week", d: "weekDay", M: "month", Y: "year", Y2: "year2", t: "time", c: "century", q: "quarter" }; var required = (m5 = "") => { throw new Error("This argument is required!"); }; var isset = (v5, nullable = true) => { try { return nullable ? typeof v5 !== "undefined" : typeof v5 !== "undefined" && v5 !== null; } catch (e2) { return false; } }; var not = (v5) => typeof v5 === "undefined" || v5 === null; var lpad = function(str2, pad, length) { let _str = "" + str2; if (length && _str.length >= length) { return _str; } return Array(length + 1 - _str.length).join(pad) + _str; }; var FormatterSystem = class { constructor() { this.formatters = /* @__PURE__ */ new Map(); this.preprocessors = []; this.postprocessors = []; } // Реєстрація форматера registerFormatter(name2, formatter) { if (this.formatters.has(name2)) { console.warn(`Formatter "${name2}" is already registered. Overriding.`); } this.formatters.set(name2, formatter); } // Видалення форматера unregisterFormatter(name2) { this.formatters.delete(name2); } // Додавання препроцесора (виконується перед форматуванням) addPreprocessor(fn) { this.preprocessors.push(fn); } // Додавання постпроцесора (виконується після форматування) addPostprocessor(fn) { this.postprocessors.push(fn); } // Обробка формату через усі зареєстровані форматери processFormat(instance, format, locale) { let processedFormat = format || DEFAULT_FORMAT; for (const preprocessor of this.preprocessors) { processedFormat = preprocessor(instance, processedFormat, locale) || processedFormat; } for (const [name2, formatter] of this.formatters) { try { processedFormat = formatter(instance, processedFormat, locale) || processedFormat; } catch (error) { console.error(`Error in formatter "${name2}":`, error); } } for (const postprocessor of this.postprocessors) { processedFormat = postprocessor(instance, processedFormat, locale) || processedFormat; } return processedFormat; } // Отримання списку всіх зареєстрованих форматерів getRegisteredFormatters() { return Array.from(this.formatters.keys()); } // Очистка всіх форматерів clear() { this.formatters.clear(); this.preprocessors.length = 0; this.postprocessors.length = 0; } }; var formatterSystem = new FormatterSystem(); var AlignStrategiesSystem = class { constructor() { this.alignStrategies = /* @__PURE__ */ new Map(); this.alignEndStrategies = /* @__PURE__ */ new Map(); this.isInitialized = false; } // Реєстрація стратегії для align registerAlignStrategy(name2, strategy) { if (this.alignStrategies.has(name2)) { console.warn(`Align strategy "${name2}" is already registered. Overriding.`); } this.alignStrategies.set(name2, strategy); } // Реєстрація стратегії для alignEnd registerAlignEndStrategy(name2, strategy) { if (this.alignEndStrategies.has(name2)) { console.warn(`AlignEnd strategy "${name2}" is already registered. Overriding.`); } this.alignEndStrategies.set(name2, strategy); } // Виконання стратегії align executeAlign(date, align) { if (this.alignStrategies.has(align)) { return this.alignStrategies.get(align)(date); } return this.defaultAlign(date, align); } // Виконання стратегії alignEnd executeAlignEnd(date, align) { if (this.alignEndStrategies.has(align)) { return this.alignEndStrategies.get(align)(date); } return this.defaultAlignEnd(date, align); } // Базова логіка align defaultAlign(date, align) { let _date = date.clone ? date.clone() : date; let result, temp; switch (align) { case C.ms: case "ms": result = _date; break; case C.s: case "s": case "second": result = _date.ms(0); break; case C.m: case "m": case "minute": result = this.executeAlign(_date, "s").second(0); break; case C.h: case "h": case "hour": result = this.executeAlign(_date, "m").minute(0); break; case C.D: case "D": case "day": result = this.executeAlign(_date, "h").hour(0); break; case C.M: case "M": case "month": result = this.executeAlign(_date, "D").day(1); break; case C.Y: case "Y": case "year": result = this.executeAlign(_date, "M").month(0); break; case C.W: case "W": case "week": temp = _date.weekDay(); result = this.executeAlign(_date, "D").addDay(-temp); break; default: result = _date; } return result; } // Базова логіка alignEnd defaultAlignEnd(date, align) { let _date = date.clone ? date.clone() : date; let result, temp; switch (align) { case C.ms: case "ms": result = _date; break; case C.s: case "s": case "second": result = _date.ms(999); break; case C.m: case "m": case "minute": result = this.executeAlignEnd(_date, "s").second(59); break; case C.h: case "h": case "hour": result = this.executeAlignEnd(_date, "m").minute(59); break; case C.D: case "D": case "day": result = this.executeAlignEnd(_date, "h").hour(23); break; case C.M: case "M": case "month": result = this.executeAlignEnd(_date, "D").day(1).add(1, "M").add(-1, "D"); break; case C.Y: case "Y": case "year": result = this.executeAlignEnd(_date, "D").month(11).day(31); break; case C.W: case "W": case "week": temp = _date.weekDay(); result = this.executeAlignEnd(_date, "D").addDay(6 - temp); break; default: result = _date; } return result; } // Ініціалізація базових стратегій initializeBuiltInStrategies() { if (this.isInitialized) return; const alignMappings = [ [C.ms, "ms"], [C.s, "s", "second"], [C.m, "m", "minute"], [C.h, "h", "hour"], [C.D, "D", "day"], [C.M, "M", "month"], [C.Y, "Y", "year"], [C.W, "W", "week"] ]; for (const mappings of alignMappings) { const mainKey = mappings[0]; for (const key of mappings) { this.alignStrategies.set(key, (date) => this.defaultAlign(date, mainKey)); this.alignEndStrategies.set(key, (date) => this.defaultAlignEnd(date, mainKey)); } } this.isInitialized = true; } // Отримання списку всіх стратегій getRegisteredAlignStrategies() { return Array.from(this.alignStrategies.keys()); } getRegisteredAlignEndStrategies() { return Array.from(this.alignEndStrategies.keys()); } // Видалення стратегій unregisterAlignStrategy(name2) { this.alignStrategies.delete(name2); } unregisterAlignEndStrategy(name2) { this.alignEndStrategies.delete(name2); } // Очистка всіх стратегій clear() { this.alignStrategies.clear(); this.alignEndStrategies.clear(); this.isInitialized = false; } }; var alignStrategiesSystem = new AlignStrategiesSystem(); var uk_default = { months: "\u0421\u0456\u0447\u0435\u043D\u044C_\u041B\u044E\u0442\u0438\u0439_\u0411\u0435\u0440\u0435\u0437\u0435\u043D\u044C_\u041A\u0432\u0456\u0442\u0435\u043D\u044C_\u0422\u0440\u0430\u0432\u0435\u043D\u044C_\u0427\u0435\u0440\u0432\u0435\u043D\u044C_\u041B\u0438\u043F\u0435\u043D\u044C_\u0421\u0435\u0440\u043F\u0435\u043D\u044C_\u0412\u0435\u0440\u0435\u0441\u0435\u043D\u044C_\u0416\u043E\u0432\u0442\u0435\u043D\u044C_\u041B\u0438\u0441\u0442\u043E\u043F\u0430\u0434_\u0413\u0440\u0443\u0434\u0435\u043D\u044C".split("_"), monthsParental: "\u0421\u0456\u0447\u043D\u044F_\u041B\u044E\u0442\u043E\u0433\u043E_\u0411\u0435\u0440\u0435\u0437\u0435\u043D\u044F_\u041A\u0432\u0456\u0442\u043D\u044F_\u0422\u0440\u0430\u0432\u043D\u044F_\u0427\u0435\u0440\u0432\u043D\u044F_\u041B\u0438\u043F\u043D\u044F_\u0421\u0435\u0440\u043F\u043D\u044F_\u0412\u0435\u0440\u0435\u0441\u043D\u044F_\u0416\u043E\u0432\u0442\u043D\u044F_\u041B\u0438\u0441\u0442\u043E\u043F\u0430\u0434\u0430_\u0413\u0440\u0443\u0434\u043D\u044F".split("_"), monthsShort: "\u0421\u0456\u0447_\u041B\u044E\u0442_\u0411\u0435\u0440_\u041A\u0432\u0456_\u0422\u0440\u0430_\u0427\u0435\u0440_\u041B\u0438\u043F_\u0421\u0435\u0440_\u0412\u0435\u0440_\u0416\u043E\u0432_\u041B\u0438\u0441_\u0413\u0440\u0443".split("_"), weekdays: "\u041D\u0435\u0434\u0456\u043B\u044F_\u041F\u043E\u043D\u0435\u0434\u0456\u043B\u043E\u043A_\u0412\u0456\u0432\u0442\u043E\u0440\u043E\u043A_\u0421\u0435\u0440\u0435\u0434\u0430_\u0427\u0435\u0442\u0432\u0435\u0440_\u041F'\u044F\u0442\u043D\u0438\u0446\u044F_\u0421\u0443\u0431\u043E\u0442\u0430".split("_"), weekdaysShort: "\u041D\u0435\u0434_\u041F\u043E\u043D_\u0412\u0456\u0432_\u0421\u0435\u0440_\u0427\u0435\u0442_\u041F\u0442\u043D_\u0421\u0443\u0431".split("_"), weekdaysMin: "\u041D\u0434_\u041F\u043D_\u0412\u0442_\u0421\u0440_\u0427\u0442_\u041F\u0442_\u0421\u0431".split("_"), weekStart: 1 }; var de_default = { months: "Januar_Februar_M\xE4rz_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"), monthsShort: "Jan_Feb_M\xE4r_Apr_Mai_Jun_Jul_Aug_Sep_Okt_Nov_Dez".split("_"), weekdays: "Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"), weekdaysShort: "Son_Mon_Die_Mit_Don_Fre_Sam".split("_"), weekdaysMin: "So_Mo_Di_Mi_Do_Fr_Sa".split("_"), weekStart: 1 }; var originalFormat = function(fmt, locale) { const format = fmt || DEFAULT_FORMAT; const names = Datetime2.getLocale(locale || this.locale); const year = this.year(), year2 = this.year2(), month = this.month(), day = this.day(), weekDay = this.weekDay(); const hour = this.hour(), minute = this.minute(), second = this.second(), ms = this.ms(); const matches2 = { YY: year2, YYYY: year, M: month + 1, MM: lpad(month + 1, 0, 2), MMM: names.monthsShort[month], MMMM: names.months[month], D: day, DD: lpad(day, 0, 2), d: weekDay, dd: names.weekdaysMin[weekDay], ddd: names.weekdaysShort[weekDay], dddd: names.weekdays[weekDay], H: hour, HH: lpad(hour, 0, 2), m: minute, mm: lpad(minute, 0, 2), s: second, ss: lpad(second, 0, 2), sss: lpad(ms, 0, 3) }; return format.replace(REGEX_FORMAT, (match, $1) => $1 || matches2[match]); }; var Datetime2 = class _Datetime { constructor() { const args = [].slice.call(arguments); this.value = new (Function.prototype.bind.apply(Date, [this].concat(args)))(); this.locale = "en"; this.weekStart = _Datetime.locales["en"].weekStart; this.utcMode = false; this.mutable = true; if (!isNum(this.value.getTime())) { throw new Error(INVALID_DATE); } } static locales = { en: DEFAULT_LOCALE, ua: uk_default, de: de_default }; static isDatetime(val) { return val instanceof _Datetime; } static now(asDate = false) { return datetime2()[asDate ? "val" : "time"](); } static parse(str2 = required()) { return datetime2(Date.parse(str2)); } static setLocale(name2 = required(), locale = required()) { _Datetime.locales[name2] = locale; } static getLocale(name2 = "en") { return isset(_Datetime.locales[name2], false) ? _Datetime.locales[name2] : _Datetime.locales["en"]; } static align(date, align) { const _date = datetime2(date); return alignStrategiesSystem.executeAlign(_date, align); } static alignEnd(date, align) { const _date = datetime2(date); return alignStrategiesSystem.executeAlignEnd(_date, align); } immutable(v5) { this.mutable = !(not(v5) ? true : v5); return this; } utc() { if (!this.utcMode) { this.utcMode = true; } return this; } local() { if (this.utcMode) { this.utcMode = false; } return this; } useLocale(val, override) { this.locale = override ? val : !isset(_Datetime.locales[val], false) ? "en" : val; this.weekStart = _Datetime.getLocale(this.locale).weekStart; return this; } clone() { const c5 = datetime2(this.value); c5.locale = this.locale; c5.weekStart = this.weekStart; c5.mutable = this.mutable; c5.utcMode = this.utcMode; return c5; } align(to2) { if (this.mutable) { this.value = _Datetime.align(this, to2).val(); return this; } return this.clone().immutable(false).align(to2).immutable(!this.mutable); } alignEnd(to2) { if (this.mutable) { this.value = _Datetime.alignEnd(this, to2).val(); return this; } return this.clone().immutable(false).alignEnd(to2).immutable(!this.mutable); } val(val) { if (typeof val === "undefined" || val === null) { return this.value; } if (this.mutable) { this.value = typeof val === "string" ? Date.parse(val) : typeof val === "number" ? new Date(val) : val; return this; } return datetime2(val); } year2() { return +("" + this.year()).slice(-2); } /* Get + Set */ _set(m5, v5) { const fn = "set" + (this.utcMode && m5 !== "t" ? "UTC" : "") + M[m5]; if (this.mutable) { this.value[fn](v5); return this; } const clone = this.clone(); clone.value[fn](v5); return clone; } _get(m5) { const fn = "get" + (this.utcMode && m5 !== "t" ? "UTC" : "") + M[m5]; return this.value[fn](); } _work(part, val) { if (!arguments.length || (typeof val === "undefined" || val === null)) { return this._get(part); } return this._set(part, val); } ms(val) { return this._work("ms", val); } second(val) { return this._work("s", val); } minute(val) { return this._work("m", val); } hour(val) { return this._work("h", val); } day(val) { return this._work("D", val); } month(val) { return this._work("M", val); } year(val) { return this._work("Y", val); } time(val) { return this._work("t", val); } weekDay(val) { if (!arguments.length || not(val)) { return this.utcMode ? this.value.getUTCDay() : this.value.getDay(); } const curr = this.weekDay(); const diff = val - curr; return this.add(diff, C.D); } get(unit) { return typeof this[unit] !== "function" ? this : this[unit](); } set(unit, val) { return typeof this[unit] !== "function" ? this : this[unit](val); } add(val, to2) { switch (to2) { case C.h: case "h": case "hour": return this.time(this.time() + val * 60 * 60 * 1e3); case C.m: case "m": case "minute": return this.time(this.time() + val * 60 * 1e3); case C.s: case "s": case "second": return this.time(this.time() + val * 1e3); case C.ms: case "ms": return this.time(this.time() + val); case C.D: case "D": case "day": return this.day(this.day() + val); case C.W: case "W": case "week": return this.day(this.day() + val * 7); case C.M: case "M": case "month": return this.month(this.month() + val); case C.Y: case "Y": case "year": return this.year(this.year() + val); } return this; } addHour(v5) { return this.add(v5, C.h); } addMinute(v5) { return this.add(v5, C.m); } addSecond(v5) { return this.add(v5, C.s); } addMs(v5) { return this.add(v5, C.ms); } addDay(v5) { return this.add(v5, C.D); } addWeek(v5) { return this.add(v5, C.W); } addMonth(v5) { return this.add(v5, C.M); } addYear(v5) { return this.add(v5, C.Y); } format(fmt, locale) { const processedFormat = formatterSystem.processFormat(this, fmt, locale); return originalFormat.call(this, processedFormat, locale); } valueOf() { return this.value.valueOf(); } toString() { return this.value.toString(); } }; alignStrategiesSystem.initializeBuiltInStrategies(); Datetime2.alignStrategies = alignStrategiesSystem; Datetime2.formatters = formatterSystem; var datetime2 = (...args) => args && args[0] instanceof Datetime2 ? args[0] : new Datetime2(...args); var fnFormat = Datetime2.prototype.format; var buddhistMixin = { buddhist() { return this.year() + 543; } }; Datetime2.formatters.registerFormatter("buddhist", (instance, format, locale) => { const matches2 = { BB: (instance.buddhist() + "").slice(-2), BBBB: instance.buddhist() }; return format.replace(/(\[[^\]]+])|B{4}|B{2}/g, (match, $1) => $1 || matches2[match]); }); Object.assign(Datetime2.prototype, buddhistMixin); var createCalendar = (date, iso) => { let _date = date instanceof Datetime2 ? date.clone().align("month") : datetime2(date); let ws = iso === 0 || iso ? iso : date.weekStart; let wd = ws ? _date.isoWeekDay() : _date.weekDay(); let names = Datetime2.getLocale(_date.locale); let now = datetime2(), i3; const getWeekDays = (wd2, ws2) => { if (ws2 === 0) { return wd2; } let su = wd2[0]; return wd2.slice(1).concat([su]); }; const result = { month: names.months[_date.month()], days: [], weekstart: iso ? 1 : 0, weekdays: getWeekDays(names.weekdaysMin, ws), today: now.format("YYYY-MM-DD"), weekends: [], week: [] }; _date.addDay(ws ? -wd + 1 : -wd); for (i3 = 0; i3 < 42; i3++) { result.days.push(_date.format("YYYY-MM-DD")); _date.add(1, "day"); } result.weekends = result.days.filter(function(v5, i22) { const def = [0, 6, 7, 13, 14, 20, 21, 27, 28, 34, 35, 41]; const iso2 = [5, 6, 12, 13, 19, 20, 26, 27, 33, 34, 40, 41]; return ws === 0 ? def.includes(i22) : iso2.includes(i22); }); _date = now.clone(); wd = ws ? _date.isoWeekDay() : _date.weekDay(); _date.addDay(ws ? -wd + 1 : -wd); for (i3 = 0; i3 < 7; i3++) { result.week.push(_date.format("YYYY-MM-DD")); _date.add(1, "day"); } return result; }; Object.assign(Datetime2.prototype, { // 1 - Monday, 0 - Sunday calendar(weekStart) { return createCalendar(this, weekStart); } }); var centuryMixin = { century() { return Math.ceil(this.year() / 100); } }; Datetime2.formatters.registerFormatter("century", (instance, format, locale) => { const matches2 = { C: instance.century() }; return format.replace(/(\[[^\]]+])|C/g, (match, $1) => $1 || matches2[match]); }); Object.assign(Datetime2.prototype, centuryMixin); Object.assign(Datetime2.prototype, { same(d4) { return this.time() === datetime2(d4).time(); }, /* * align: year, month, day, hour, minute, second, ms = default * */ compare(d4, align, operator = "=") { const date = datetime2(d4); const curr = datetime2(this.value); let t1, t2; operator = operator || "="; if (["<", ">", ">=", "<=", "=", "!="].includes(operator) === false) { operator = "="; } align = (align || "ms").toLowerCase(); t1 = curr.align(align).time(); t2 = date.align(align).time(); switch (operator) { case "<": return t1 < t2; case ">": return t1 > t2; case "<=": return t1 <= t2; case ">=": return t1 >= t2; case "=": return t1 === t2; case "!=": return t1 !== t2; } }, between(d1, d22) { return this.younger(d1) && this.older(d22); }, older(date, align) { return this.compare(date, align, "<"); }, olderOrEqual(date, align) { return this.compare(date, align, "<="); }, younger(date, align) { return this.compare(date, align, ">"); }, youngerOrEqual(date, align) { return this.compare(date, align, ">="); }, equal(date, align) { return this.compare(date, align, "="); }, notEqual(date, align) { return this.compare(date, align, "!="); }, diff(d4) { const date = datetime2(d4); const diff = Math.abs(this.time() - date.time()); const diffMonth = Math.abs(this.month() - date.month() + 12 * (this.year() - date.year())); return { "ms": diff, "second": Math.ceil(diff / 1e3), "minute": Math.ceil(diff / (1e3 * 60)), "hour": Math.ceil(diff / (1e3 * 60 * 60)), "day": Math.ceil(diff / (1e3 * 60 * 60 * 24)), "month": diffMonth, "year": Math.floor(diffMonth / 12) }; }, distance(d4, align) { return this.diff(d4)[align]; } }); Object.assign(Datetime2.prototype, { isLeapYear() { const year = this.year(); return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0; } }); Object.assign(Datetime2.prototype, { dayOfYear() { const dayCount = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334]; const month = this.month(); const day = this.day(); return dayCount[month] + day + (month > 1 && this.isLeapYear() ? 1 : 0); } }); Object.assign(Datetime2.prototype, { daysInMonth() { const curr = datetime2(this.value); return curr.add(1, "month").day(1).add(-1, "day").day(); }, daysInYear() { return this.isLeapYear() ? 366 : 365; }, daysInYearMap() { const result = []; const curr = datetime2(this.value); curr.month(0).day(1); for (let i3 = 0; i3 < 12; i3++) { curr.add(1, "month").add(-1, "day"); result.push(curr.day()); curr.day(1).add(1, "month"); } return result; }, daysInYearObj(locale, shortName) { const map = this.daysInYearMap(); const result = {}; const names = Datetime2.getLocale(locale || this.locale); map.forEach((v5, i3) => result[names[shortName ? "monthsShort" : "months"][i3]] = v5); return result; } }); Object.assign(Datetime2.prototype, { decade() { return Math.floor(this.year() / 10) * 10; }, decadeStart() { const decade = this.decade(); const result = this.mutable ? this : this.clone(); return result.year(decade).month(0).day(1); }, decadeEnd() { const decade = this.decade() + 9; const result = this.mutable ? this : this.clone(); return result.year(decade).month(11).day(31); }, decadeOfMonth() { const part = this.clone().add(1, "month").day(1).add(-1, "day").day() / 3; const day = this.day(); if (day <= part) return 1; if (day <= part * 2) return 2; return 3; } }); Object.assign(Datetime2, { from(str2, format, locale) { let norm, normFormat, fItems, dItems; let iMonth, iDay, iYear, iHour, iMinute, iSecond, iMs; let year, month, day, hour, minute, second, ms; let parsedMonth; const getIndex = function(where, what) { return where.map(function(el) { return el.toLowerCase(); }).indexOf(what.toLowerCase()); }; const monthNameToNumber = function(month2) { let i3 = -1; const names = Datetime2.getLocale(locale || "en"); if (not(month2)) return -1; i3 = getIndex(names.months, month2); if (i3 === -1 && typeof names["monthsParental"] !== "undefined") { i3 = getIndex(names["monthsParental"], month2); } if (i3 === -1) { month2 = month2.substr(0, 3); i3 = getIndex(names.monthsShort, month2); } return i3 === -1 ? -1 : i3 + 1; }; const getPartIndex = function(part) { const parts = { "month": ["M", "mm", "%m"], "day": ["D", "dd", "%d"], "year": ["YY", "YYYY", "yy", "yyyy", "%y"], "hour": ["h", "hh", "%h"], "minute": ["m", "mi", "i", "ii", "%i"], "second": ["s", "ss", "%s"], "ms": ["sss"] }; let result = -1, key, index; for (let i3 = 0; i3 < parts[part].length; i3++) { key = parts[part][i3]; index = fItems.indexOf(key); if (index !== -1) { result = index; break; } } return result; }; if (!format) { return datetime2(); } norm = str2.replace(/[\/,.:\s]/g, "-"); normFormat = format.toLowerCase().replace(/[^a-zA-Z0-9%]/g, "-"); fItems = normFormat.split("-"); dItems = norm.split("-"); if (norm.replace(/-/g, "").trim() === "") { throw new Error(INVALID_DATE); } iMonth = getPartIndex("month"); iDay = getPartIndex("day"); iYear = getPartIndex("year"); iHour = getPartIndex("hour"); iMinute = getPartIndex("minute"); iSecond = getPartIndex("second"); iMs = getPartIndex("ms"); if (iMonth > -1 && dItems[iMonth]) { if (isNaN(parseInt(dItems[iMonth]))) { dItems[iMonth] = monthNameToNumber(dItems[iMonth]); if (dItems[iMonth] === -1) { iMonth = -1; } } else { parsedMonth = parseInt(dItems[iMonth]); if (parsedMonth < 1 || parsedMonth > 12) { iMonth = -1; } } } else { iMonth = -1; } year = iYear > -1 && dItems[iYear] ? dItems[iYear] : 0; month = iMonth > -1 && dItems[iMonth] ? dItems[iMonth] : 1; day = iDay > -1 && dItems[iDay] ? dItems[iDay] : 1; hour = iHour > -1 && dItems[iHour] ? dItems[iHour] : 0; minute = iMinute > -1 && dItems[iMinute] ? dItems[iMinute] : 0; second = iSecond > -1 && dItems[iSecond] ? dItems[iSecond] : 0; ms = iMs > -1 && dItems[iMs] ? dItems[iMs] : 0; if (year && year < 100) { year = year < 50 ? 2e3 + parseInt(year) : 1900 + parseInt(year); } else if (year === 0) { year = (/* @__PURE__ */ new Date()).getFullYear(); } return datetime2(year, month - 1, day, hour, minute, second, ms); } }); var hour12Mixin = { ampm(isLowerCase) { let val = this.hour() < 12 ? "AM" : "PM"; return isLowerCase ? val.toLowerCase() : val; }, hour12: function(h3, p5) { let hour = h3; if (arguments.length === 0) { const hour24 = this.hour(); return hour24 % 12 || 12; } p5 = p5 || "am"; if (p5.toLowerCase() === "pm") { hour += 12; } return this.hour(hour); } }; Datetime2.formatters.registerFormatter("hour12", (instance, format, locale) => { const h12 = instance.hour12(); const matches2 = { a: "[" + instance.ampm(true) + "]", A: "[" + instance.ampm(false) + "]", h: h12, hh: lpad(h12, 0, 2) }; return format.replace(/(\[[^\]]+])|a|A|h{1,2}/g, (match, $1) => $1 || matches2[match]); }); Object.assign(Datetime2.prototype, hour12Mixin); var isoMixin = { isoWeekDay(val) { let wd = (this.weekDay() + 6) % 7 + 1; if (!arguments.length || not(val)) { return wd; } return this.addDay(val - wd); } }; Datetime2.alignStrategies.registerAlignStrategy("isoWeek", (date) => { const cloned = date.clone(); const isoDay = cloned.isoWeekDay(); const daysToSubtract = isoDay - 1; return Datetime2.alignStrategies.executeAlign(cloned, "day").addDay(-daysToSubtract); }); Datetime2.alignStrategies.registerAlignEndStrategy("isoWeek", (date) => { const cloned = date.clone(); const isoDay = cloned.isoWeekDay(); const daysToAdd = 7 - isoDay; return Datetime2.alignStrategies.executeAlignEnd(cloned, "day").addDay(daysToAdd); }); Datetime2.formatters.registerFormatter("iso", (instance, format, locale) => { const matches2 = { I: instance.isoWeekDay() }; return format.replace(/(\[[^\]]+])|I{1,2}/g, (match, $1) => $1 || matches2[match]); }); Object.assign(Datetime2.prototype, isoMixin); Object.assign(Datetime2, { max() { let arr = [].slice.call(arguments); return arr.map((el) => datetime2(el)).sort((a2, b5) => b5.time() - a2.time())[0]; } }); Object.assign(Datetime2.prototype, { max() { return Datetime2.max.apply(this, [this].concat([].slice.call(arguments))); } }); Object.assign(Datetime2, { min() { let arr = [].slice.call(arguments); return arr.map((el) => datetime2(el)).sort((a2, b5) => a2.time() - b5.time())[0]; } }); Object.assign(Datetime2.prototype, { min() { return Datetime2.min.apply(this, [this].concat([].slice.call(arguments))); } }); var originalAdd = Datetime2.prototype.add; var quarterMixin = { quarter() { const month = this.month(); if (month <= 2) return 1; if (month <= 5) return 2; if (month <= 8) return 3; return 4; }, add(val, to2) { if (to2 === "quarter") { return this.month(this.month() + val * 3); } return originalAdd.call(this, val, to2); }, addQuarter(v5) { return this.add(v5, "quarter"); } }; Datetime2.alignStrategies.registerAlignStrategy("quarter", (date) => { const cloned = date.clone(); const quarter = cloned.quarter(); const quarterStartMonth = (quarter - 1) * 3; return Datetime2.alignStrategies.executeAlign(cloned, "day").month(quarterStartMonth).day(1); }); Datetime2.alignStrategies.registerAlignEndStrategy("quarter", (date) => { const cloned = date.clone(); const quarter = cloned.quarter(); const quarterEndMonth = quarter * 3 - 1; const endOfQuarter = cloned.month(quarterEndMonth).day(1); const daysInMonth = endOfQuarter.clone().add(1, "month").day(1).add(-1, "day").day(); return Datetime2.alignStrategies.executeAlignEnd(endOfQuarter.day(daysInMonth), "day"); }); Object.assign(Datetime2.prototype, quarterMixin); Object.assign(Datetime2, { sort(arr, opt2) { let result, _arr; const o2 = {}; if (typeof opt2 === "string" || typeof opt2 !== "object" || not(opt2)) { o2.format = DEFAULT_FORMAT; o2.dir = opt2 && opt2.toUpperCase() === "DESC" ? "DESC" : "ASC"; o2.returnAs = "datetime"; } else { o2.format = opt2.format || DEFAULT_FORMAT; o2.dir = (opt2.dir || "ASC").toUpperCase(); o2.returnAs = opt2.format ? "string" : opt2.returnAs || "datetime"; } _arr = arr.map((el) => datetime2(el)).sort((a2, b5) => a2.valueOf() - b5.valueOf()); if (o2.dir === "DESC") { _arr.reverse(); } switch (o2.returnAs) { case "string": result = _arr.map((el) => el.format(o2.format)); break; case "date": result = _arr.map((el) => el.val()); break; default: result = _arr; } return result; } }); var timezoneMixin = { utcOffset() { return this.value.getTimezoneOffset(); }, timezone() { return this.toTimeString().replace(/.+GMT([+-])(\d{2})(\d{2}).+/, "$1$2:$3"); }, timezoneName() { return this.toTimeString().replace(/.+\((.+?)\)$/, "$1"); } }; Datetime2.formatters.registerFormatter("timezone", (instance, format, locale) => { const matches2 = { Z: instance.utcMode ? "Z" : instance.timezone(), ZZ: instance.timezone().replace(":", ""), ZZZ: "[GMT]" + instance.timezone(), z: instance.timezoneName() }; return format.replace(/(\[[^\]]+])|Z{1,3}|z/g, (match, $1) => $1 || matches2[match]); }); Object.assign(Datetime2.prototype, timezoneMixin); var fnFormat2 = Datetime2.prototype.format; var weekNumberCache = /* @__PURE__ */ new Map(); var MILLISECONDS_PER_DAY = 864e5; var CACHE_TTL = 6e4; var CACHE_SIZE = 1e3; var cleanupCache = () => { const now = Date.now(); for (const [key, value] of weekNumberCache.entries()) { if (now - value.timestamp > CACHE_TTL) { weekNumberCache.delete(key); } } }; Object.assign(Datetime2.prototype, { weekNumber(weekStart = 0) { const cacheKey = `${this.time()}_${weekStart}`; const cached = weekNumberCache.get(cacheKey); if (cached && Date.now() - cached.timestamp < CACHE_TTL) { return cached.value; } const year = this.year(); const newYear = datetime2(year, 0, 1); const newYearWeekDay = newYear.weekDay(); const dayOfYear = Math.floor((this.time() - newYear.time() - (this.utcOffset() - newYear.utcOffset()) * 6e4) / MILLISECONDS_PER_DAY) + 1; const adjustedNewYearWeekDay = (newYearWeekDay - weekStart + 7) % 7; let weekNumber; if (adjustedNewYearWeekDay < 4) { weekNumber = Math.floor((dayOfYear + adjustedNewYearWeekDay - 1) / 7) + 1; if (weekNumber > 52) { const nextYear = datetime2(year + 1, 0, 1); const nextYearWeekDay = (nextYear.weekDay() - weekStart + 7) % 7; weekNumber = nextYearWeekDay < 4 ? 1 : 53; } } else { weekNumber = Math.floor((dayOfYear + adjustedNewYearWeekDay - 1) / 7); if (weekNumber === 0) { if (weekStart === 1 && dayOfYear <= 7 - adjustedNewYearWeekDay) { weekNumber = 1; } else { const lastDayPrevYear = datetime2(year - 1, 11, 31); weekNumber = lastDayPrevYear.weekNumber(weekStart); } } } if (weekNumberCache.size > CACHE_SIZE) { cleanupCache(); } weekNumberCache.set(cacheKey, { value: weekNumber, timestamp: Date.now() }); return weekNumber; }, isoWeekNumber() { const cacheKey = `iso_${this.time()}`; if (weekNumberCache.has(cacheKey)) { return weekNumberCache.get(cacheKey); } const d4 = new Date(this.time()); d4.setHours(0, 0, 0, 0); d4.setDate(d4.getDate() + 3 - (d4.getDay() + 6) % 7); const jan4 = new Date(d4.getFullYear(), 0, 4); jan4.setDate(jan4.getDate() + 3 - (jan4.getDay() + 6) % 7); const weekNumber = 1 + Math.round(((d4.getTime() - jan4.getTime()) / MILLISECONDS_PER_DAY - 3 + (jan4.getDay() + 6) % 7) / 7); weekNumberCache.set(cacheKey, weekNumber); return weekNumber; }, weeksInYear(weekStart = 0) { const cacheKey = `weeks_${this.year()}_${weekStart}`; if (weekNumberCache.has(cacheKey)) { return weekNumberCache.get(cacheKey); } const dec28 = datetime2(this.year(), 11, 28); let weekNum = dec28.weekNumber(weekStart); if (weekNum === 1) { weekNum = 52; } weekNumberCache.set(cacheKey, weekNum); return weekNum; }, format: function(format, locale) { format = format || DEFAULT_FORMAT; const hasWeekTokens = /W{1,4}/.test(format); if (!hasWeekTokens) { return fnFormat2.bind(this)(format, locale); } const weekNum = this.weekNumber(); const isoWeekNum = this.isoWeekNumber(); const matches2 = { W: weekNum, WW: lpad(weekNum, 0, 2), WWW: isoWeekNum, WWWW: lpad(isoWeekNum, 0, 2) }; const result = format.replace(/(\[[^\]]+])|W{1,4}/g, (match, $1) => $1 || matches2[match]); return fnFormat2.bind(this)(result, locale); } }); Object.assign(Datetime2.prototype, { strftime(fmt, locale) { const format = fmt || DEFAULT_FORMAT_STRFTIME; const names = Datetime2.getLocale(locale || this.locale); const year = this.year(), year2 = this.year2(), month = this.month(), day = this.day(), weekDay = this.weekDay(); const hour = this.hour(), hour12 = this.hour12(), minute = this.minute(), second = this.second(), ms = this.ms(), time = this.time(); const aDay = lpad(day, 0, 2), aMonth = lpad(month + 1, 0, 2), aHour = lpad(hour, 0, 2), aHour12 = lpad(hour12, 0, 2), aMinute = lpad(minute, 0, 2), aSecond = lpad(second, 0, 2), aMs = lpad(ms, 0, 3); const that = this; const thursday = function() { return datetime2(that.value).day(that.day() - (that.weekDay() + 6) % 7 + 3); }; const matches2 = { "%a": names.weekdaysShort[weekDay], "%A": names.weekdays[weekDay], "%b": names.monthsShort[month], "%h": names.monthsShort[month], "%B": names.months[month], "%c": this.toString().substring(0, this.toString().indexOf(" (")), "%C": this.century(), "%d": aDay, "%D": [aDay, aMonth, year].join("/"), "%e": day, "%F": [year, aMonth, aDay].join("-"), "%G": thursday().year(), "%g": ("" + thursday().year()).slice(2), "%H": aHour, "%I": aHour12, "%j": lpad(this.dayOfYear(), 0, 3), "%k": aHour, "%l": aHour12, "%m": aMonth, "%n": month + 1, "%M": aMinute, "%p": this.ampm(), "%P": this.ampm(true), "%s": Math.round(time / 1e3), "%S": aSecond, "%u": this.isoWeekDay(), "%V": this.isoWeekNumber(), "%w": weekDay, "%x": this.toLocaleDateString(), "%X": this.toLocaleTimeString(), "%y": year2, "%Y": year, "%z": this.timezone().replace(":", ""), "%Z": this.timezoneName(), "%r": [aHour12, aMinute, aSecond].join(":") + " " + this.ampm(), "%R": [aHour, aMinute].join(":"), "%T": [aHour, aMinute, aSecond].join(":"), "%Q": aMs, "%q": ms, "%t": this.timezone() }; return format.replace( REGEX_FORMAT_STRFTIME, (match) => matches2[match] === 0 || matches2[match] ? matches2[match] : match ); } }); Object.assign(Datetime2, { isToday(date) { const d4 = datetime2(date).align("day"); const c5 = datetime2().align("day"); return d4.time() === c5.time(); } }); Object.assign(Datetime2.prototype, { isToday() { return Datetime2.isToday(this); }, today() { const now = datetime2(); if (!this.mutable) { return now; } return this.val(now.val()); } }); Object.assign(Datetime2, { isTomorrow(date) { const d4 = datetime2(date).align("day"); const c5 = datetime2().align("day").add(1, "day"); return d4.time() === c5.time(); } }); Object.assign(Datetime2.prototype, { isTomorrow() { return Datetime2.isTomorrow(this); }, tomorrow() { if (!this.mutable) { return this.clone().immutable(false).add(1, "day").immutable(!this.mutable); } return this.add(1, "day"); } }); Object.assign(Datetime2.prototype, { toDateString() { return this.value.toDateString(); }, toISOString() { return this.value.toISOString(); }, toJSON() { return this.value.toJSON(); }, toGMTString() { return this.value.toGMTString(); }, toLocaleDateString() { return this.value.toLocaleDateString(); }, toLocaleString() { return this.value.toLocaleString(); }, toLocaleTimeString() { return this.value.toLocaleTimeString(); }, toTimeString() { return this.value.toTimeString(); }, toUTCString() { return this.value.toUTCString(); }, toDate() { return new Date(this.value); } }); Object.assign(Datetime2, { timestamp() { return (/* @__PURE__ */ new Date()).getTime() / 1e3; } }); Object.assign(Datetime2.prototype, { unix(val) { let _val; if (!arguments.length || not(val)) { return Math.floor(this.valueOf() / 1e3); } _val = val * 1e3; if (this.mutable) { return this.time(_val); } return datetime2(this.value).time(_val); }, timestamp() { return this.unix(); } }); Object.assign(Datetime2, { isYesterday(date) { const d4 = datetime2(date).align("day"); const c5 = datetime2().align("day").add(-1, "day"); return d4.time() === c5.time(); } }); Object.assign(Datetime2.prototype, { isYesterday() { return Datetime2.isYesterday(this); }, yesterday() { if (!this.mutable) { return this.clone().immutable(false).add(-1, "day").immutable(!this.mutable); } return this.add(-1, "day"); } }); var getResult = (val) => { let res; let seconds = Math.floor(val / 1e3), minutes = Math.floor(seconds / 60), hours = Math.floor(minutes / 60), days = Math.floor(hours / 24), months = Math.floor(days / 30.44), years = Math.floor(months / 12); if (years >= 1) res = `${years} year`; if (months >= 1 && years < 1) res = `${months} mon`; if (days >= 1 && days <= 30) res = `${days} days`; if (hours && hours < 24) res = `${hours} hour`; if (minutes && (minutes >= 40 && minutes < 60)) res = "less a hour"; if (minutes && minutes < 40) res = `${minutes} min`; if (seconds && seconds >= 30 && seconds < 60) res = `${seconds} sec`; if (seconds < 30) res = `few sec`; return res; }; Object.assign(Datetime2, { timeLapse(d4) { let old = datetime2(d4), now = datetime2(), val = now - old; return getResult(val); } }); Object.assign(Datetime2.prototype, { timeLapse() { let val = datetime2() - +this; return getResult(val); } }); var ParseTimeMixin = { parseTime(t) { if (!isNaN(t)) return Math.abs(+t); const pattern = /([0-9]+d)|([0-9]{1,2}h)|([0-9]{1,2}m)|([0-9]{1,2}s)/gm; const match = t.match(pattern); if (!match) return 0; return match.reduce((acc, val) => { let res; if (val.includes("d")) { res = 1e3 * 60 * 60 * 24 * parseInt(val); } else if (val.includes("h")) { res = 1e3 * 60 * 60 * parseInt(val); } else if (val.includes("m")) { res = 1e3 * 60 * parseInt(val); } else if (val.includes("s")) { res = 1e3 * parseInt(val); } return acc + res; }, 0); } }; Object.assign(Datetime2, ParseTimeMixin); Object.assign(Datetime2.prototype, { moon() { const phases = [ "new-moon", "waxing-crescent", "first-quarter", "waxing-gibbous", "full-moon", "waning-gibbous", "last-quarter", "waning-crescent" ]; const phase = () => { let year = this.year(), month = this.month(), day = this.day(); let e2; let jd; let b5; let c5 = e2 = jd = b5 = 0; if (month < 3) { year--; month += 12; } ++month; c5 = 365.25 * year; e2 = 30.6 * month; jd = c5 + e2 + day - 694039.09; jd /= 29.5305882; b5 = parseInt(jd); jd -= b5; b5 = Math.round(jd * 8); if (b5 >= 8) b5 = 0; return { phase: b5, name: phases[b5] }; }; return phase(); } }); var version = "3.3.0"; var build_time = "01.09.2025, 15:52:51"; var info = () => { console.info(`%c Datetime %c v${version} %c ${build_time} `, "color: #ffffff; font-weight: bold; background: #003152", "color: white; background: darkgreen", "color: white; background: #0080fe;"); }; Datetime2.info = info; // source/datetime/index.js Datetime2.correctDate = (date) => datetime2(date).addDay(1).align("day").addMinute((/* @__PURE__ */ new Date()).getTimezoneOffset()); globalThis.Datetime = Datetime2; globalThis.datetime = datetime2; (() => { "use strict"; const MONTHS = [ "january", "february", "march", "april", "may", "june", "july", "august", "september", "october", "november", "december" ]; const DAYS = ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"]; const getLocale = Datetime2.getLocale; Datetime2.getLocale = function(locale = "en") { let _locale = locale; if (!Metro) { return getLocale.call(this, locale); } if (!Metro.locales[_locale]) { _locale = "en"; } const data = Metro.locales[_locale]; const months = MONTHS.map((el, i3) => data[el]); const monthsShort = MONTHS.map((el, i3) => data[`${el}_short`]); const weekdays = DAYS.map((el, i3) => data[el]); const weekdaysShort = DAYS.map((el, i3) => data[`${el}_short`]); const weekdaysMin = DAYS.map((el, i3) => data[`${el}_short_2`]); return { months, monthsShort, weekdays, weekdaysShort, weekdaysMin, weekStart: data.weekStart }; }; })(); // node_modules/@olton/string/dist/string.js var pr = Object.defineProperty; var ar = (r2, t) => { for (var e2 in t) pr(r2, e2, { get: t[e2], enumerable: true }); }; var qt = {}; ar(qt, { append: () => Xt, camelCase: () => z, capitalize: () => F, chars: () => c, count: () => tt, countChars: () => W, countSubstr: () => rt, countUniqueChars: () => O, countUniqueWords: () => er, countWords: () => rr, dashedName: () => H, decapitalize: () => U, endsWith: () => gt, escapeHtml: () => et, first: () => st, includes: () => wt, insert: () => ht, isAlpha: () => xt, isAlphaDigit: () => _t, isBlank: () => Et, isDigit: () => dt, isEmpty: () => X, isLower: () => At, isString: () => Tt, isUpper: () => St, kebab: () => Z, last: () => nt, lower: () => R, lpad: () => ft, ltrim: () => M2, matches: () => Gt, nvl: () => Bt, pad: () => ct, prepend: () => kt, prune: () => lt, repeat: () => x, reverse: () => K, rpad: () => mt, rtrim: () => q, shorten: () => Lt, shuffle: () => J, slice: () => at, snake: () => Y, split: () => yt, sprintf: () => w, startsWith: () => bt, strip: () => Ct, stripBoom: () => Pt, stripTags: () => Rt, stripTagsAll: () => Ft, substring: () => m, swap: () => V, title: () => Q, trim: () => _, truncate: () => j, truncateWithAlign: () => pt, unescapeHtml: () => ot, unique: () => ut, uniqueWords: () => it, upper: () => G2, vsprintf: () => vt, words: () => a, wrap: () => It, wrapTag: () => Dt }); var $2 = "\\d"; var L = "\\s\\uFEFF\\xA0"; var E = "\\uD800-\\uDBFF"; var A = "\\uDC00-\\uDFFF"; var b = "\\u0300-\\u036F\\u1AB0-\\u1AFF\\u1DC0-\\u1DFF\\u20D0-\\u20FF\\uFE20-\\uFE2F"; var Wt = "\\0-\\u02FF\\u0370-\\u1AAF\\u1B00-\\u1DBF\\u1E00-\\u20CF\\u2100-\\uD7FF\\uE000-\\uFE1F\\uFE30-\\uFFFF"; var $t = "\\u2000-\\u206F"; var zt = "\\x00-\\x2F\\x3A-\\x40\\x5B-\\x60\\x7b-\\xBF\\xD7\\xF7"; var Ht = "\\u2700-\\u27BF"; var B = "a-z\\xB5\\xDF-\\xF6\\xF8-\\xFF\\u0101\\u0103\\u0105\\u0107\\u0109\\u010B\\u010D\\u010F\\u0111\\u0113\\u0115\\u0117\\u0119\\u011B\\u011D\\u011F\\u0121\\u0123\\u0125\\u0127\\u0129\\u012B\\u012D\\u012F\\u0131\\u0133\\u0135\\u0137\\u0138\\u013A\\u013C\\u013E\\u0140\\u0142\\u0144\\u0146\\u0148\\u0149\\u014B\\u014D\\u014F\\u0151\\u0153\\u0155\\u0157\\u0159\\u015B\\u015D\\u015F\\u0161\\u0163\\u0165\\u0167\\u0169\\u016B\\u016D\\u016F\\u0171\\u0173\\u0175\\u0177\\u017A\\u017C\\u017E-\\u0180\\u0183\\u0185\\u0188\\u018C\\u018D\\u0192\\u0195\\u0199-\\u019B\\u019E\\u01A1\\u01A3\\u01A5\\u01A8\\u01AA\\u01AB\\u01AD\\u01B0\\u01B4\\u01B6\\u01B9\\u01BA\\u01BD-\\u01BF\\u01C6\\u01C9\\u01CC\\u01CE\\u01D0\\u01D2\\u01D4\\u01D6\\u01D8\\u01DA\\u01DC\\u01DD\\u01DF\\u01E1\\u01E3\\u01E5\\u01E7\\u01E9\\u01EB\\u01ED\\u01EF\\u01F0\\u01F3\\u01F5\\u01F9\\u01FB\\u01FD\\u01FF\\u0201\\u0203\\u0205\\u0207\\u0209\\u020B\\u020D\\u020F\\u0211\\u0213\\u0215\\u0217\\u0219\\u021B\\u021D\\u021F\\u0221\\u0223\\u0225\\u0227\\u0229\\u022B\\u022D\\u022F\\u0231\\u0233-\\u0239\\u023C\\u023F\\u0240\\u0242\\u0247\\u0249\\u024B\\u024D\\u024F"; var N = "\\x41-\\x5a\\xc0-\\xd6\\xd8-\\xde\\u0100\\u0102\\u0104\\u0106\\u0108\\u010a\\u010c\\u010e\\u0110\\u0112\\u0114\\u0116\\u0118\\u011a\\u011c\\u011e\\u0120\\u0122\\u0124\\u0126\\u0128\\u012a\\u012c\\u012e\\u0130\\u0132\\u0134\\u0136\\u0139\\u013b\\u013d\\u013f\\u0141\\u0143\\u0145\\u0147\\u014a\\u014c\\u014e\\u0150\\u0152\\u0154\\u0156\\u0158\\u015a\\u015c\\u015e\\u0160\\u0162\\u0164\\u0166\\u0168\\u016a\\u016c\\u016e\\u0170\\u0172\\u0174\\u0176\\u0178\\u0179\\u017b\\u017d\\u0181\\u0182\\u0184\\u0186\\u0187\\u0189-\\u018b\\u018e-\\u0191\\u0193\\u0194\\u0196-\\u0198\\u019c\\u019d\\u019f\\u01a0\\u01a2\\u01a4\\u01a6\\u01a7\\u01a9\\u01ac\\u01ae\\u01af\\u01b1-\\u01b3\\u01b5\\u01b7\\u01b8\\u01bc\\u01c4\\u01c5\\u01c7\\u01c8\\u01ca\\u01cb\\u01cd\\u01cf\\u01d1\\u01d3\\u01d5\\u01d7\\u01d9\\u01db\\u01de\\u01e0\\u01e2\\u01e4\\u01e6\\u01e8\\u01ea\\u01ec\\u01ee\\u01f1\\u01f2\\u01f4\\u01f6-\\u01f8\\u01fa\\u01fc\\u01fe\\u0200\\u0202\\u0204\\u0206\\u0208\\u020a\\u020c\\u020e\\u0210\\u0212\\u0214\\u0216\\u0218\\u021a\\u021c\\u021e\\u0220\\u0222\\u0224\\u0226\\u0228\\u022a\\u022c\\u022e\\u0230\\u0232\\u023a\\u023b\\u023d\\u023e\\u0241\\u0243-\\u0246\\u0248\\u024a\\u024c\\u024e"; var vr = new RegExp("([" + Wt + "]|[" + E + "][" + A + "]|[" + E + "](?![" + A + "])|(?:[^" + E + "]|^)[" + A + "])([" + b + "]+)", "g"); var wr = new RegExp("([" + E + "])([" + A + "])", "g"); var yr = new RegExp("((?:[" + Wt + "]|[" + E + "][" + A + "]|[" + E + "](?![" + A + "])|(?:[^" + E + "]|^)[" + A + "])(?:[" + b + "]+))|([" + E + "][" + A + "])|([\\n\\r\\u2028\\u2029])|(.)", "g"); var Cr = new RegExp("[" + L + "]"); var Ut = new RegExp("^[" + L + "]+"); var Zt = new RegExp("[" + L + "]+$"); var Kt = new RegExp("^" + $2 + "+$"); var Jt = /[<>&"'`]/g; var Yt = /(<([^>]+)>)/ig; var D = new RegExp("(?:[" + N + "][" + b + "]*)?(?:[" + B + "][" + b + "]*)+|(?:[" + N + "][" + b + "]*)+(?![" + B + "])|[" + $2 + "]+|[" + Ht + "]|[^" + zt + $t + L + "]+", "g"); var I = /[A-Z\xC0-\xD6\xD8-\xDE]?[a-z\xDF-\xF6\xF8-\xFF]+|[A-Z\xC0-\xD6\xD8-\xDE]+(?![a-z\xDF-\xF6\xF8-\xFF])|\d+/g; var Vt = new RegExp("^(?:[" + B + N + "][" + b + "]*)+$"); var Qt = new RegExp("^((?:[" + B + N + "][" + b + "]*)|[" + $2 + "])+$"); var T = /^[\x01-\xFF]*$/; var u = (r2, t = "") => !r2 && typeof r2 != "number" && typeof r2 != "boolean" ? t : typeof r2 == "string" ? r2 : Array.isArray(r2) ? r2.join("") : JSON.stringify(r2); var Ot = (r2, t) => typeof r2 > "u" || r2 === null ? t : r2; var a = (r2, t, e2) => { let i3; return t ? t instanceof RegExp ? i3 = t : i3 = new RegExp(t, Ot(e2, "")) : i3 = T.test(r2) ? I : D, Ot(u(r2).match(i3), []); }; var F = (r2, t = false) => { let e2 = u(r2), i3 = e2.substring(1); return e2.substring(0, 1).toUpperCase() + (t ? i3.toLowerCase() : i3); }; var z = (r2) => a(u(r2)).map((t, e2) => e2 === 0 ? t.toLowerCase() : F(t)).join(""); var H = (r2) => a(u(r2)).map((t) => t.toLowerCase()).join("-"); var U = (r2) => { let t = u(r2); return t.substring(0, 1).toLowerCase() + t.substr(1); }; var Z = (r2, t = "-") => a(u(r2)).map((e2) => e2.toLowerCase()).join(t); var R = (r2) => u(r2).toLowerCase(); var c = (r2, t = []) => u(r2).split("").filter((e2) => !t.includes(e2)); var K = (r2, t) => c(u(r2), t).reverse().join(""); var tr = (r2 = []) => { let t = [...r2], e2 = t.length, i3, o2; for (; e2 !== 0; ) o2 = Math.floor(Math.random() * e2), e2 -= 1, i3 = t[e2], t[e2] = t[o2], t[o2] = i3; return t; }; var J = (r2) => tr(u(r2).split("")).join(""); var Y = (r2) => a(u(r2)).map((t) => t.toLowerCase()).join("_"); var lr = (r2, t) => { let e2 = t.toLowerCase(), i3 = t.toUpperCase(); return r2 + (t === e2 ? i3 : e2); }; var V = (r2) => u(r2).split("").reduce(lr, ""); var Q = (r2, t, e2 = "") => { let i3 = u(r2), o2 = T.test(i3) ? I : D, n3 = Array.isArray(t) ? t : typeof t != "string" ? [] : t.split(e2); return r2.replace(o2, (s2, p5) => p5 && n3.includes(i3[p5 - 1]) ? R(s2) : F(s2)); }; var G2 = (r2) => u(r2).toUpperCase(); var tt = (r2) => u(r2).length; var v = (r2 = []) => { let t = [...r2]; for (let e2 = 0; e2 < t.length; ++e2) for (let i3 = e2 + 1; i3 < t.length; ++i3) t[e2] === t[i3] && t.splice(i3--, 1); return t; }; var W = (r2, t) => c(r2, t).length; var O = (r2, t) => v(c(r2, t)).length; var rt = (r2, t = "") => { let e2 = u(r2), i3 = u(t); return e2 === "" || i3 === "" ? 0 : e2.split(i3).length - 1; }; var rr = (r2, t, e2) => a(r2, t, e2).length; var er = (r2, t, e2) => v(a(r2, t, e2)).length; var fr = { "<": "<", ">": ">", "&": "&", '"': """, "'": "'", "`": "`" }; function mr(r2) { return fr[r2]; } var et = (r2) => u(r2).replace(Jt, mr); var or = { "<": /(<)|(*3c;)|(*60;)/gi, ">": /(>)|(*3e;)|(*62;)/gi, "&": /(&)|(*26;)|(*38;)/gi, '"': /(")|(*22;)|(*34;)/gi, "'": /(*27;)|(*39;)/gi, "`": /(*60;)|(*96;)/gi }; var cr = Object.keys(or); function hr(r2, t) { return r2.replace(or[t], t); } var ot = (r2) => cr.reduce(hr, u(r2)); var ut = (r2, t) => v(c(r2, t)).join(""); var it = (r2, t, e2) => v(a(r2, t, e2)).join(""); var m = (r2, t, e2) => u(r2).substring(t, e2); var st = (r2, t = 0) => m(u(r2), 0, t); var nt = (r2, t = 0) => { let e2 = u(r2); return e2 ? m(e2, e2.length - t) : ""; }; var ur = "\uFEFF"; var S = (r2, t, e2 = 9007199254740991) => r2 < t ? t : r2 > e2 ? e2 : r2; var g = (r2) => r2 === 1 / 0 ? 9007199254740991 : r2 === -1 / 0 ? -9007199254740991 : ~~r2; var j = (r2, t = 0, e2 = "...") => { let i3 = u(r2), o2 = t ? S(g(t), 0, 9007199254740991) : i3.length; return m(i3, 0, o2) + (i3.length === o2 ? "" : e2); }; var pt = (r2, t = 0, e2 = "...") => { let i3 = j(r2, t, ""); return i3.slice(r2, i3.lastIndexOf(" ")) + e2; }; var at = (r2, t = 1) => { let e2 = u(r2), i3 = [], o2 = Math.round(e2.length / t); for (let n3 = 0; n3 < t; n3++) i3.push(m(e2, n3 * o2, o2)); return i3; }; var lt = (r2, t = 0, e2 = "") => { let i3 = u(r2), o2 = t ? S(g(t), 0, 9007199254740991) : i3.length, n3 = 0, s2 = T.test(i3) ? I : D; return i3.replace(s2, (p5, h3) => { let d4 = h3 + p5.length; d4 <= o2 - e2.length && (n3 = d4); }), i3.substring(0, n3) + e2; }; var x = (r2, t = 0) => { let e2 = u(r2), i3 = t ? S(g(t), 0, 9007199254740991) : e2.length, o2 = e2; if (t === 0) return ""; for (let n3 = 0; n3 < i3 - 1; n3++) e2 += o2; return e2; }; var jt = (r2, t = 0) => { let e2 = r2.length, i3 = t - e2; return x(r2, i3 + 1).substring(0, t); }; var ir = (r2, t = "", e2 = 0, i3 = false) => { let o2 = u(r2), n3 = e2 ? S(g(e2), 0, 9007199254740991) : o2.length, s2 = t.length, p5 = n3 - o2.length, h3 = p5; if (p5 <= 0 || s2 === 0) return o2; let d4 = jt(t, h3); return i3 ? d4 + o2 : o2 + d4; }; var ft = (r2, t = " ", e2 = 0) => ir(r2, t, e2, true); var mt = (r2, t = " ", e2 = 0) => ir(r2, t, e2, false); var ct = (r2, t = "", e2 = 0) => { let i3 = u(r2), o2 = e2 ? S(g(e2), 0, 9007199254740991) : i3.length, n3 = t.length, s2 = o2 - i3.length, p5 = g(s2 / 2), h3 = s2 % 2; return s2 <= 0 || n3 === 0 ? i3 : jt(t, p5) + i3 + jt(t, p5 + h3); }; var ht = (r2, t = "", e2 = 0) => { let i3 = u(r2); return i3.substring(0, e2) + t + i3.substring(e2); }; var gr = Array.prototype.reduce; var xr = Array.prototype.reduceRight; var _ = (r2, t) => M2(q(r2, t), t); var M2 = (r2, t) => { let e2 = u(r2); if (!t) return e2.replace(Ut, ""); if (t === "" || e2 === "") return e2; typeof t != "string" && (t = ""); let i3 = true; return gr.call(e2, (o2, n3) => i3 && t.includes(n3) ? o2 : (i3 = false, o2 + n3), ""); }; var q = (r2, t) => { let e2 = u(r2); if (!t) return e2.replace(Zt, ""); if (t === "" || e2 === "") return e2; typeof t != "string" && (t = ""); let i3 = true; return xr.call(e2, (o2, n3) => i3 && t.includes(n3) ? o2 : (i3 = false, n3 + o2), ""); }; var gt = (r2, t, e2) => u(r2).endsWith(t, e2); var xt = (r2) => Vt.test(u(r2)); var _t = (r2) => Qt.test(u(r2)); var dt = (r2) => Kt.test(u(r2)); var Et = (r2, t = true) => t ? u(r2).length === 0 : _(r2).length === 0; var X = (r2) => _(r2).length === 0; var At = (r2) => R(r2) === r2; var St = (r2) => G2(r2) === r2; var bt = (r2, t, e2) => u(r2).startsWith(t, e2); var Ft = (r2) => u(r2).replace(Yt, ""); var Rt = (r2, t = []) => { let e2 = u(r2), i3 = /<\/?([a-z][a-z0-9]*)\b[^>]*>/gi; return e2.replace(i3, (o2, n3) => t.includes(n3) ? o2 : ""); }; var f = { not_string: /[^s]/, not_bool: /[^t]/, not_type: /[^T]/, not_primitive: /[^v]/, number: /[diefg]/, numeric_arg: /[bcdiefguxX]/, json: /[j]/, not_json: /[^j]/, text: /^[^\x25]+/, modulo: /^\x25{2}/, placeholder: /^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/, key: /^([a-z_][a-z_\d]*)/i, key_access: /^\.([a-z_][a-z_\d]*)/i, index_access: /^\[(\d+)\]/, sign: /^[+-]/ }; function _r(r2, t) { let e2 = 1, i3 = r2.length, o2, n3 = "", s2, p5, h3, d4, Nt2, y4; for (let C5 = 0; C5 < i3; C5++) if (typeof r2[C5] == "string") n3 += r2[C5]; else if (typeof r2[C5] == "object") { if (s2 = r2[C5], s2.keys) { o2 = t[e2]; for (let P4 = 0; P4 < s2.keys.length; P4++) { if (typeof o2 > "u") throw new Error(w('[sprintf] Cannot access property "%s" of undefined value "%s"', s2.keys[P4], s2.keys[P4 - 1])); o2 = o2[s2.keys[P4]]; } } else s2.param_no ? o2 = t[s2.param_no] : o2 = t[e2++]; if (f.not_type.test(s2.type) && f.not_primitive.test(s2.type) && o2 instanceof Function && (o2 = o2()), f.numeric_arg.test(s2.type) && typeof o2 != "number" && isNaN(o2)) throw new TypeError(w("[sprintf] expecting number but found %T", o2)); switch (f.number.test(s2.type) && (Nt2 = o2 >= 0), s2.type) { case "b": o2 = parseInt(o2, 10).toString(2); break; case "c": o2 = String.fromCharCode(parseInt(o2, 10)); break; case "d": case "i": o2 = parseInt(o2, 10); break; case "j": o2 = JSON.stringify(o2, null, s2.width ? parseInt(s2.width) : 0); break; case "e": o2 = s2.precision ? parseFloat(o2).toExponential(s2.precision) : parseFloat(o2).toExponential(); break; case "f": o2 = s2.precision ? parseFloat(o2).toFixed(s2.precision) : parseFloat(o2); break; case "g": o2 = s2.precision ? String(Number(o2.toPrecision(s2.precision))) : parseFloat(o2); break; case "o": o2 = (parseInt(o2, 10) >>> 0).toString(8); break; case "s": o2 = String(o2), o2 = s2.precision ? o2.substring(0, s2.precision) : o2; break; case "t": o2 = String(!!o2), o2 = s2.precision ? o2.substring(0, s2.precision) : o2; break; case "T": o2 = Object.prototype.toString.call(o2).slice(8, -1).toLowerCase(), o2 = s2.precision ? o2.substring(0, s2.precision) : o2; break; case "u": o2 = parseInt(o2, 10) >>> 0; break; case "v": o2 = o2.valueOf(), o2 = s2.precision ? o2.substring(0, s2.precision) : o2; break; case "x": o2 = (parseInt(o2, 10) >>> 0).toString(16); break; case "X": o2 = (parseInt(o2, 10) >>> 0).toString(16).toUpperCase(); break; } f.json.test(s2.type) ? n3 += o2 : (f.number.test(s2.type) && (!Nt2 || s2.sign) ? (y4 = Nt2 ? "+" : "-", o2 = o2.toString().replace(f.sign, "")) : y4 = "", h3 = s2.pad_char ? s2.pad_char === "0" ? "0" : s2.pad_char.charAt(1) : " ", d4 = s2.width - (y4 + o2).length, p5 = s2.width && d4 > 0 ? h3.repeat(d4) : "", n3 += s2.align ? y4 + o2 + p5 : h3 === "0" ? y4 + p5 + o2 : p5 + y4 + o2); } return n3; } var Mt = /* @__PURE__ */ Object.create(null); function dr(r2) { if (Mt[r2]) return Mt[r2]; let t = r2, e2, i3 = [], o2 = 0; for (; t; ) { if ((e2 = f.text.exec(t)) !== null) i3.push(e2[0]); else if ((e2 = f.modulo.exec(t)) !== null) i3.push("%"); else if ((e2 = f.placeholder.exec(t)) !== null) { if (e2[2]) { o2 |= 1; let n3 = [], s2 = e2[2], p5 = []; if ((p5 = f.key.exec(s2)) !== null) for (n3.push(p5[1]); (s2 = s2.substring(p5[0].length)) !== ""; ) if ((p5 = f.key_access.exec(s2)) !== null) n3.push(p5[1]); else if ((p5 = f.index_access.exec(s2)) !== null) n3.push(p5[1]); else throw new SyntaxError("[sprintf] failed to parse named argument key"); else throw new SyntaxError("[sprintf] failed to parse named argument key"); e2[2] = n3; } else o2 |= 2; if (o2 === 3) throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported"); i3.push({ placeholder: e2[0], param_no: e2[1], keys: e2[2], sign: e2[3], pad_char: e2[4], align: e2[5], width: e2[6], precision: e2[7], type: e2[8] }); } else throw new SyntaxError("[sprintf] unexpected placeholder"); t = t.substring(e2[0].length); } return Mt[r2] = i3; } var w = (r2) => _r(dr(r2), arguments); var vt = (r2, t) => w.apply(null, [r2].concat(t || [])); var wt = (r2, t, e2) => u(r2).includes(t, e2); var yt = (r2, t = void 0, e2 = void 0, i3 = true) => u(r2).split(t, e2).map((o2) => i3 ? o2.trim() : o2).filter((o2) => i3 ? !X(o2) : true); var Ct = (r2, t = null, e2 = "") => { let i3 = u(r2), o2; return t ? (o2 = new RegExp(t, "g"), i3.replace(o2, e2)) : i3; }; var Dt = (r2, t = "div", e2 = {}) => { let i3 = u(r2), o2 = Object.keys(e2).map((n3) => `${n3}="${e2[n3]}"`).join(" "); return o2 && (o2 = " " + o2), `<${t}${o2}>${i3}${t}>`; }; var It = (r2, t = "", e2 = "") => t + u(r2) + e2; var Tt = (r2) => typeof r2 == "string"; var Gt = (r2, t, e2 = "") => { let i3 = u(r2), o2; if (!(t instanceof RegExp)) { if (o2 = t ? _(u(t)) : "", !o2) return false; t = new RegExp(o2, e2); } return t.test(i3); }; var Xt = (r2, t = "", e2 = 1) => u(r2) + x(t, e2); var kt = (r2, t = "", e2 = 1) => x(t, e2) + u(r2); var Pt = (r2) => { let t = u(r2); return t === "" ? t : t[0] === ur ? t.substring(1) : t; }; var Lt = (r2, t = 5, e2 = "...") => r2 && `${r2.substring(0, t)}${e2}${r2.substring(r2.length - t)}`; var sr = (r2) => typeof r2 > "u" || r2 === null; var Bt = (r2, ...t) => { if (!sr(r2)) return r2; if (t.length === 0) throw new Error("nvl: No default value provided"); for (let e2 of t) if (typeof e2 < "u" && e2 !== null) return e2; }; var k = class { constructor(t = "", { mutable: e2 = true } = {}) { this.value = t.toString(), this.mutable = e2; } [Symbol.toPrimitive](t) { return t === "number" ? +this.value : this.value; } get [Symbol.toStringTag]() { return "Str"; } val(t) { return typeof t > "u" || t === null ? this.value : (this.value = t.toString(), this); } get length() { return this.value.length; } immutable(t = true) { this.mutable = !t; } toString() { return Array.isArray(this.value) ? this.value.join("") : this.value; } _result(t) { return this.mutable ? (this.value = t, this) : nr(t); } camelCase() { return this._result(z(this.value)); } capitalize(t) { return this._result(F(this.value, t)); } chars(t) { return this._result(c(this.value, t)); } count() { return tt(this.value); } countChars(t) { return W(this.value, t); } countUniqueChars(t) { return O(this.value, t); } countSubstr(t) { return rt(this.value, t); } countWords(t, e2) { return W(this.value, t, e2); } countUniqueWords(t, e2) { return O(this.value, t, e2); } dashedName() { return this._result(H(this.value)); } decapitalize() { return this._result(U(this.value)); } endsWith(t, e2) { return gt(this.value, t, e2); } escapeHtml() { return this._result(et(this.value)); } first() { return this._result(st(this.value)); } includes(t, e2) { return wt(this.value, t, e2); } insert(t, e2) { return this._result(ht(this.value, t, e2)); } isAlpha() { return xt(this.value); } isAlphaDigit() { return _t(this.value); } isBlank(t) { return Et(this.value, t); } isDigit() { return dt(this.value); } isEmpty() { return X(this.value); } isLower() { return At(this.value); } static isString(t) { return Tt(t); } isUpper() { return St(this.value); } kebab(t) { return this._result(Z(this.value, t)); } last(t) { return this._result(nt(this.value, t)); } lower() { return this._result(R(this.value)); } matches(t, e2) { return Gt(this.value, t, e2); } pad(t, e2) { return this._result(ct(this.value, t, e2)); } lpad(t, e2) { return this._result(ft(this.value, t, e2)); } rpad(t, e2) { return this._result(mt(this.value, t, e2)); } prune(t, e2) { return this._result(lt(this.value, t, e2)); } repeat(t) { return this._result(x(this.value, t)); } append(t, e2) { return this._result(Xt(this.value, t, e2)); } prepend(t, e2) { return this._result(kt(this.value, t, e2)); } reverse(t) { return this._result(K(this.value, t)); } shuffle() { return this._result(J(this.value)); } slice(t) { return this._result(at(this.value, t)); } snake() { return this._result(Y(this.value)); } split(t, e2, i3) { return this._result(yt(this.value, t, e2, i3)); } sprintf(...t) { return this._result(w(this.value, ...t)); } vsprintf(...t) { return this._result(vt(this.value, ...t)); } startsWith(t, e2) { return bt(this.value, t, e2); } stripBoom() { return this._result(Pt(this.value)); } stripTags(t) { return this._result(Rt(this.value, t)); } stripTagsAll() { return this._result(Ft(this.value)); } strip(t, e2) { return this._result(Ct(this.value, t, e2)); } substring(t, e2) { return this._result(m(this.value, t, e2)); } swap() { return this._result(V(this.value)); } title(t, e2) { return this._result(Q(this.value, t, e2)); } trim(t) { return this._result(_(this.value, t)); } ltrim(t) { return this._result(M2(this.value, t)); } rtrim(t) { return this._result(q(this.value, t)); } truncate(t, e2) { return this._result(j(this.value, t, e2)); } truncateWithAlign(t, e2) { return this._result(pt(this.value, t, e2)); } unescapeHtml() { return this._result(ot(this.value)); } unique(t) { return this._result(ut(this.value, t)); } uniqueWords(t, e2) { return this._result(it(this.value, t, e2)); } upper() { return this._result(G2(this.value)); } words(t, e2) { return a(this.value, t, e2); } wrap(t, e2) { return this._result(It(this.value, t, e2)); } wrapTag(t) { return this._result(Dt(this.value, t)); } shorten(t, e2) { return this._result(Lt(this.value, t, e2)); } nvl(...t) { return this._result(Bt(this.value, ...t)); } }; Object.assign(k, qt); var nr = (r2, t = true) => new k(r2, { mutable: t }); var Er = "0.10.2"; var Ar = "18.05.2025, 14:39:06"; var Sr = () => { console.info(`%c String %c v${Er} %c ${Ar} `, "color: #000000; font-weight: bold; background: #fff200", "color: white; background: darkgreen", "color: white; background: #0080fe;"); }; k.info = Sr; // source/string/index.js globalThis.Str = k; globalThis.str = nr; // node_modules/@olton/dom/dist/dom.js var numProps = ["opacity", "zIndex"]; function nothing() { return null; } function isSimple(v5) { return typeof v5 === "string" || typeof v5 === "boolean" || typeof v5 === "number"; } function isVisible(elem) { const computedStyle = getComputedStyle(elem); const hasDimensions = !!(elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length); const isNotHiddenByStyles = computedStyle.visibility !== "hidden" && computedStyle.display !== "none" && computedStyle.opacity !== "0" && elem.style.display !== "none"; return hasDimensions && isNotHiddenByStyles; } function isHidden(elem) { const s2 = getComputedStyle(elem); return !isVisible(elem) || +s2.opacity === 0 || elem.hidden || s2.visibility === "hidden"; } function not2(value) { return value === void 0 || value === null; } function camelCase(string) { return string.replace(/-([a-z])/g, function(all, letter) { return letter.toUpperCase(); }); } function dashedName(str2) { return str2.replace(/([A-Z])/g, function(u4) { return "-" + u4.toLowerCase(); }); } function isPlainObject(obj) { let proto; if (!obj || Object.prototype.toString.call(obj) !== "[object Object]") { return false; } proto = obj.prototype !== void 0; if (!proto) { return true; } return proto.constructor && typeof proto.constructor === "function"; } function isEmptyObject(obj) { for (const name2 in obj) { if (hasProp(obj, name2)) return false; } return true; } function isArrayLike(o2) { return o2 instanceof Object && "length" in o2; } function str2arr(str2, sep) { sep = sep || " "; return str2.split(sep).map(function(el) { return ("" + el).trim(); }).filter(function(el) { return el !== ""; }); } function parseUnit(str2, out) { if (!out) out = [0, ""]; str2 = String(str2); out[0] = parseFloat(str2); out[1] = str2.match(/[\d.\-+]*\s*(.*)/)[1] || ""; return out; } function getUnit(val, und) { const split = /[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn|fr|lh|cqw|cqh|cqi|cqb|cqmin|cqmax|q)?$/.exec(val); return typeof split[1] !== "undefined" ? split[1] : und; } function setStyleProp(el, key, val) { key = camelCase(key); if (["scrollLeft", "scrollTop"].indexOf(key) > -1) { el[key] = parseInt(val); } else { el.style[key] = isNaN(val) || numProps.indexOf("" + key) > -1 ? val : parseInt(val) === 0 ? 0 : val + "px"; } } function acceptData(owner) { return owner.nodeType === 1 || owner.nodeType === 9 || !+owner.nodeType; } function normName(name2) { return typeof name2 !== "string" ? void 0 : name2.replace(/-/g, "").toLowerCase(); } function hasProp(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } function isLocalhost(host) { const hostname = host || globalThis.location.hostname; return hostname === "localhost" || hostname === "127.0.0.1" || hostname === "[::1]" || hostname === "" || hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/) !== null; } function isTouch() { return "ontouchstart" in window || navigator.maxTouchPoints > 0; } function isPrivateAddress(host) { const hostname = host || globalThis.location.hostname; return /(^localhost)|(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2\d\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/.test(hostname); } function safeJsonParse(str2) { try { return JSON.parse(str2); } catch (e2) { return str2; } } var matches = Element.prototype.matches; var $3 = (selector, context) => new $3.init(selector, context); $3.version = "1.5.1"; $3.build_time = "18.05.2025, 14:45:23"; $3.info = () => console.info(`%c Dom %c v${$3.version} %c ${$3.build_time} `, "color: white; font-weight: bold; background: #fd6a02", "color: white; background: darkgreen", "color: white; background: #0080fe;"); $3.fn = $3.prototype = Object.create(Array.prototype); $3.prototype.constructor = $3; $3.prototype.uid = ""; $3.extend = $3.fn.extend = function() { let options, name2, target = arguments[0] || {}, i3 = 1, length = arguments.length; if (typeof target !== "object" && typeof target !== "function") { target = {}; } if (i3 === length) { target = this; i3--; } for (; i3 < length; i3++) { if ((options = arguments[i3]) != null) { for (name2 in options) { if (hasProp(options, name2)) target[name2] = options[name2]; } } } return target; }; $3.assign = function() { let options, name2, target = arguments[0] || {}, i3 = 1, length = arguments.length; if (typeof target !== "object" && typeof target !== "function") { target = {}; } if (i3 === length) { target = this; i3--; } for (; i3 < length; i3++) { if ((options = arguments[i3]) != null) { for (name2 in options) { if (hasProp(options, name2) && options[name2] !== void 0) target[name2] = options[name2]; } } } return target; }; (function(workerScript) { try { const blob = new Blob([` var fakeIdToId = {}; onmessage = function (event) { var data = event.data, name = data.name, fakeId = data.fakeId, time; if(data.hasOwnProperty('time')) { time = data.time; } switch (name) { case 'setInterval': fakeIdToId[fakeId] = setInterval(function () { postMessage({fakeId: fakeId}); }, time); break; case 'clearInterval': if (fakeIdToId.hasOwnProperty (fakeId)) { clearInterval(fakeIdToId[fakeId]); delete fakeIdToId[fakeId]; } break; case 'setTimeout': fakeIdToId[fakeId] = setTimeout(function () { postMessage({fakeId: fakeId}); if (fakeIdToId.hasOwnProperty (fakeId)) { delete fakeIdToId[fakeId]; } }, time); break; case 'clearTimeout': if (fakeIdToId.hasOwnProperty (fakeId)) { clearTimeout(fakeIdToId[fakeId]); delete fakeIdToId[fakeId]; } break; } } `]); workerScript = window.URL.createObjectURL(blob); } catch (error) { } let worker, fakeIdToCallback = {}, lastFakeId = 0, maxFakeId = 2147483647, logPrefix = ""; function getFakeId() { do { if (lastFakeId === maxFakeId) { lastFakeId = 0; } else { lastFakeId++; } } while (fakeIdToCallback.hasOwnProperty(lastFakeId)); return lastFakeId; } if (typeof Worker === "undefined") { return; } try { worker = new Worker(workerScript); window.setInterval = function(callback, time) { const fakeId = getFakeId(); fakeIdToCallback[fakeId] = { callback, parameters: Array.prototype.slice.call(arguments, 2) }; worker.postMessage({ name: "setInterval", fakeId, time }); return fakeId; }; window.clearInterval = function(fakeId) { if (fakeIdToCallback.hasOwnProperty(fakeId)) { delete fakeIdToCallback[fakeId]; worker.postMessage({ name: "clearInterval", fakeId }); } }; window.setTimeout = function(callback, time) { const fakeId = getFakeId(); fakeIdToCallback[fakeId] = { callback, parameters: Array.prototype.slice.call(arguments, 2), isTimeout: true }; worker.postMessage({ name: "setTimeout", fakeId, time }); return fakeId; }; window.clearTimeout = function(fakeId) { if (fakeIdToCallback.hasOwnProperty(fakeId)) { delete fakeIdToCallback[fakeId]; worker.postMessage({ name: "clearTimeout", fakeId }); } }; window.setImmediate = function(callback) { return setTimeout(callback, 0); }; window.clearImmediate = function(fakeId) { clearTimeout(fakeId); }; worker.onmessage = function(event) { let data = event.data, fakeId = data.fakeId, request, parameters, callback; if (fakeIdToCallback.hasOwnProperty(fakeId)) { request = fakeIdToCallback[fakeId]; callback = request.callback; parameters = request.parameters; if (request.hasOwnProperty("isTimeout") && request.isTimeout) { delete fakeIdToCallback[fakeId]; } } if (typeof callback === "string") { try { callback = new Function(callback); } catch (error) { console.error(logPrefix + "Error parsing callback code string: ", error); } } if (typeof callback === "function") { callback.apply(window, parameters); } }; worker.onerror = function(event) { console.error(event); }; } catch (error) { console.log(`Can't create worker for Intervals, use standard functions.`); } })(); $3.fn.extend({ _getDefaultElement(sel) { let el; if (not2(sel)) { el = this[0]; } else if (sel instanceof HTMLElement) { el = sel; } else if (sel instanceof $3 && sel.length > 0) { el = sel[0]; } else if (typeof sel === "string") { el = $3(sel)[0]; } else { el = void 0; } return el; }, index: function(sel) { let el, _index = -1; if (this.length === 0) { return _index; } el = this._getDefaultElement(sel); if (!el) { return _index; } if (el && el.parentNode) $3.each(el.parentNode.children, function(i3) { if (this === el) { _index = i3; } }); return _index; }, indexOf: function(sel) { let el, _index = -1; if (this.length === 0) { return _index; } el = this._getDefaultElement(sel); if (!el) { return _index; } this.each(function(i3) { if (this === el) { _index = i3; } }); return _index; }, get: function(i3) { if (i3 === void 0) { return this; } return i3 < 0 ? this[i3 + this.length] : i3 > this.length - 1 ? void 0 : this[i3]; }, eq: function(i3) { if (not2(i3)) { return this; } return this.length > 0 ? $3.extend($3(this.get(i3)), { _prevObj: this }) : this; }, is: function(s2) { let result = false; if (this.length === 0) { return false; } if (s2 instanceof $3) { return this.same(s2); } if (s2 === ":selected") { this.each(function() { if (this.selected) result = true; }); } else if (s2 === ":checked") { this.each(function() { if (this.checked) result = true; }); } else if (s2 === ":visible") { result = false; this.each(function() { if (isVisible(this)) result = true; }); } else if (s2 === ":hidden") { this.each(function() { const styles = getComputedStyle(this); if (this.getAttribute("type") === "hidden" || this.hidden || styles.display === "none" || styles.visibility === "hidden" || parseInt(styles.opacity) === 0) result = true; }); } else if (typeof s2 === "string" && [":selected"].indexOf(s2) === -1) { this.each(function() { if (matches.call(this, s2)) { result = true; } }); } else if (isArrayLike(s2)) { this.each(function() { const el = this; $3.each(s2, function() { const sel = this; if (el === sel) { result = true; } }); }); } else if (typeof s2 === "object" && s2.nodeType === 1) { this.each(function() { if (this === s2) { result = true; } }); } return result; }, same: function(o2) { let result = true; if (!(o2 instanceof $3)) { o2 = $3(o2); } if (this.length !== o2.length) return false; this.each(function() { if (o2.items().indexOf(this) === -1) { result = false; } }); return result; }, last: function() { return this.eq(this.length - 1); }, first: function() { return this.eq(0); }, odd: function() { const result = this.filter(function(el, i3) { return (i3 + 1) % 2 !== 0; }); return $3.extend(result, { _prevObj: this }); }, even: function() { const result = this.filter(function(el, i3) { return (i3 + 1) % 2 === 0; }); return $3.extend(result, { _prevObj: this }); }, filter: function(fn) { if (typeof fn === "string") { const sel = fn; fn = function(el) { return matches.call(el, sel); }; } return $3.extend($3.merge($3(), [].filter.call(this, fn)), { _prevObj: this }); }, find: function(s2) { let res = [], result; if (s2 instanceof $3) return s2; if (this.length === 0) { result = this; } else { this.each(function() { const el = this; if (typeof el.querySelectorAll === "undefined") { return; } res = res.concat([].slice.call(el.querySelectorAll(s2))); }); result = $3.merge($3(), res); } return $3.extend(result, { _prevObj: this }); }, contains: function(s2) { return this.find(s2).length > 0; }, children: function(s2) { let i3, res = []; if (s2 instanceof $3) return s2; this.each(function() { const el = this; for (i3 = 0; i3 < el.children.length; i3++) { if (el.children[i3].nodeType === 1) res.push(el.children[i3]); } }); res = s2 ? res.filter(function(el) { return matches.call(el, s2); }) : res; return $3.extend($3.merge($3(), res), { _prevObj: this }); }, parent: function(s2) { let res = []; if (this.length === 0) { return; } if (s2 instanceof $3) return s2; this.each(function() { if (this.parentNode) { if (res.indexOf(this.parentNode) === -1) res.push(this.parentNode); } }); res = s2 ? res.filter(function(el) { return matches.call(el, s2); }) : res; return res.length ? $3.extend($3.merge($3(), res), { _prevObj: this }) : void 0; }, parents: function(s2) { let res = []; if (this.length === 0) { return; } if (s2 instanceof $3) return s2; this.each(function() { let par = this.parentNode; while (par) { if (par.nodeType === 1 && res.indexOf(par) === -1) { if (!not2(s2)) { if (matches.call(par, s2)) { res.push(par); } } else { res.push(par); } } par = par.parentNode; } }); return $3.extend($3.merge($3(), res), { _prevObj: this }); }, siblings: function(s2) { let res = []; if (this.length === 0) { return void 0; } if (s2 instanceof $3) { return s2; } this.each(function() { const el = this; if (el.parentNode) { $3.each(el.parentNode.children, function() { if (el !== this) res.push(this); }); } }); if (s2) { res = res.filter(function(el) { return matches.call(el, s2); }); } return $3.extend($3.merge($3(), res), { _prevObj: this }); }, _siblingAll: function(dir, s2) { let res = []; if (this.length === 0) { return; } if (s2 instanceof $3) return s2; this.each(function() { let el = this; while (el) { el = el[dir]; if (!el) break; res.push(el); } }); if (s2) { res = res.filter(function(el) { return matches.call(el, s2); }); } return $3.extend($3.merge($3(), res), { _prevObj: this }); }, _sibling: function(dir, s2) { let res = []; if (this.length === 0) { return; } if (s2 instanceof $3) return s2; this.each(function() { const el = this[dir]; if (el && el.nodeType === 1) { res.push(el); } }); if (s2) { res = res.filter(function(el) { return matches.call(el, s2); }); } return $3.extend($3.merge($3(), res), { _prevObj: this }); }, prev: function(s2) { return this._sibling("previousElementSibling", s2); }, next: function(s2) { return this._sibling("nextElementSibling", s2); }, prevAll: function(s2) { return this._siblingAll("previousElementSibling", s2); }, nextAll: function(s2) { return this._siblingAll("nextElementSibling", s2); }, closest: function(s2) { let res = []; if (this.length === 0) { return void 0; } if (!s2) { return this.parent(); } let el = this[0]; while (el) { if (matches.call(el, s2)) { res.push(el); break; } el = el.parentElement; } return $3.extend($3.merge($3(), res.reverse()), { _prevObj: this }); }, has: function(selector) { let res = []; if (this.length === 0) { return; } this.each(function() { const el = $3(this); const child = el.children(selector); if (child.length > 0) { res.push(this); } }); return $3.extend($3.merge($3(), res), { _prevObj: this }); }, back: function(to_start) { let ret; if (to_start === true) { ret = this._prevObj; while (ret) { if (!ret._prevObj) break; ret = ret._prevObj; } } else { ret = this._prevObj ? this._prevObj : this; } return ret; } }); function createScript(script, into = document.body) { const s2 = document.createElement("script"); s2.type = "text/javascript"; if (not2(script)) return $3(s2); const _script = $3(script)[0]; if (_script.src) { s2.src = _script.src; } else { s2.textContent = _script.innerText; } if (_script.type) s2.type = _script.type; if (_script.async) s2.async = _script.async; into.appendChild(s2); if (_script.parentNode) _script.parentNode.removeChild(_script); return s2; } $3.extend({ script: function(el, into) { if (not2(el)) { return; } if (el instanceof $3) { el = el[0]; } if (el.tagName && el.tagName === "SCRIPT") { createScript(el, into); } else { const scripts = $3(el).find("script"); $3.each(scripts, function() { createScript(this, into); }); } }, loadScript: function(url, into = document.body, callback) { const script = document.createElement("script"); script.type = "text/javascript"; script.src = url; script.onload = callback; into.appendChild(script); } }); $3.fn.extend({ script: function(into) { return this.each(function() { $3.script(this, into); }); } }); $3.fn.extend({ _prop: function(prop, value) { if (arguments.length === 1) { return this.length === 0 ? void 0 : this[0][prop]; } if (not2(value)) { value = ""; } return this.each(function() { const el = this; el[prop] = value; if (prop === "innerHTML") { $3.script(el, el); } }); }, prop: function(prop, value) { return arguments.length === 1 ? this._prop(prop) : this._prop(prop, typeof value === "undefined" ? "" : value); }, val: function(value) { if (not2(value)) { return this.length === 0 ? void 0 : this[0].value; } return this.each(function() { const el = $3(this); if (typeof this.value !== "undefined") { this.value = value; } else { el.html(value); } }); }, html: function(value) { const that = this, v5 = []; if (arguments.length === 0) { return this._prop("innerHTML"); } if (value instanceof $3) { value.each(function() { v5.push($3(this).outerHTML()); }); } else { v5.push(value); } that._prop("innerHTML", v5.join("\n")); return this; }, outerHTML: function() { return this._prop("outerHTML"); }, text: function(value) { return arguments.length === 0 ? this._prop("textContent") : this._prop("textContent", typeof value === "undefined" ? "" : value); }, innerText: function(value) { return arguments.length === 0 ? this._prop("innerText") : this._prop("innerText", typeof value === "undefined" ? "" : value); }, empty: function() { return this.each(function() { if (typeof this.innerHTML !== "undefined") this.innerHTML = ""; if (typeof this.value !== "undefined") this.value = ""; }); }, clear: function() { return this.empty(); } }); $3.each = function(ctx, cb) { let index = 0; if (typeof ctx !== "object") { ctx = []; } if (isArrayLike(ctx)) { [].forEach.call(ctx, function(val, key) { cb.apply(val, [key, val]); }); } else { for (const key in ctx) { if (hasProp(ctx, key)) cb.apply(ctx[key], [key, ctx[key], index++]); } } return ctx; }; $3.fn.extend({ each: function(cb) { return $3.each(this, cb); } }); var Data = function(ns) { this.expando = "DATASET:UID:" + ns.toUpperCase(); Data.uid++; }; Data.uid = -1; Data.prototype = { cache: function(owner) { let value = owner[this.expando]; if (!value) { value = {}; if (acceptData(owner)) { if (owner.nodeType) { owner[this.expando] = value; } else { Object.defineProperty(owner, this.expando, { value, configurable: true }); } } } return value; }, set: function(owner, data, value) { let prop, cache = this.cache(owner); if (typeof data === "string") { cache[camelCase(data)] = value; } else { for (prop in data) { if (hasProp(data, prop)) cache[camelCase(prop)] = data[prop]; } } return cache; }, get: function(owner, key) { let value = key === void 0 ? this.cache(owner) : owner[this.expando] && owner[this.expando][camelCase(key)]; if (key) { return value !== void 0 ? value : owner.getAttribute && owner.getAttribute("data-" + dashedName(key)) || void 0; } value = { ...owner[this.expando] }; for (const attr of owner.attributes) { if (attr.name.startsWith("data-")) { const name2 = attr.name.slice(5); value[camelCase(name2)] = attr.value; } } return isEmptyObject(value) ? void 0 : value; }, access: function(owner, key, value) { if (key === void 0 || key && typeof key === "string" && value === void 0) { return this.get(owner, key); } this.set(owner, key, value); return value !== void 0 ? value : key; }, remove: function(owner, key) { let cache = owner[this.expando]; if (cache === void 0) { return; } if (key !== void 0) { const _keys = Array.isArray(key) ? key : [key]; for (const k5 of _keys) { delete cache[camelCase(k5)]; owner.removeAttribute && owner.removeAttribute("data-" + k5); } } if (key === void 0 || isEmptyObject(cache)) { if (owner.nodeType) { owner[this.expando] = void 0; } else { delete owner[this.expando]; } } return true; }, hasData: function(owner) { const cache = owner[this.expando]; return cache !== void 0 && !isEmptyObject(cache); } }; var dataSet = new Data("dom"); $3.extend({ hasData: function(elem) { return dataSet.hasData(elem); }, data: function(elem, key, val) { return dataSet.access(elem, key, val); }, removeData: function(elem, key) { return dataSet.remove(elem, key); }, dataSet: function(ns) { if (not2(ns)) return dataSet; if (["INTERNAL", "DOM"].indexOf(ns.toUpperCase()) > -1) { throw Error("You can not use reserved name for your dataset"); } return new Data(ns); } }); $3.fn.extend({ data: function(key, val) { let res, elem, data; if (this.length === 0) { return; } elem = this[0]; if (arguments.length === 0) { if (elem) { data = dataSet.get(elem); if (elem.nodeType === 1) { for (const a2 of elem.attributes) { if (a2.name.startsWith("data-")) { const name2 = a2.name.slice(5); data[camelCase(name2)] = a2.value; } } } } return data; } if (arguments.length === 1 && (typeof key === "string" || Array.isArray(key))) { res = dataSet.get(elem, key); return safeJsonParse(res); } return this.each(function() { dataSet.set(this, key, val); }); }, removeData: function(key) { if (typeof key === "undefined") { return this; } return this.each(function() { const keys = Array.isArray(key) ? key : key.split(" ").map((el) => el.trim()).filter((el) => el !== ""); for (const k5 of keys) { dataSet.remove(this, k5); } }); }, origin: function(name2, value, def) { if (this.length === 0) { return this; } if (not2(name2) && not2(value)) { return $3.data(this[0]); } if (not2(value)) { const res = $3.data(this[0], "origin-" + name2); return !not2(res) ? res : def; } this.data("origin-" + name2, value); return this; } }); $3.extend({ device: /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()), localhost: isLocalhost(), isLocalhost, touchable: isTouch(), isPrivateAddress, hashCode: function(str2) { let hash = 0, i3, chr; if (str2.length === 0) return hash; for (i3 = 0; i3 < str2.length; i3++) { chr = str2.charCodeAt(i3); hash = (hash << 5) - hash + chr; hash |= 0; } return hash; }, uniqueId: function(salt = "salt") { let name2; if (typeof salt === "function") { name2 = salt.name; } else if (typeof salt === "string" && salt) { name2 = salt; } else if (typeof salt === "string" && salt.length === 0) { name2 = "salt"; } else { name2 = salt.toString(); } return "dom-" + $3.hashCode(name2); }, toArray: function(n3) { let i3, out = []; for (i3 = 0; i3 < n3.length; i3++) { out.push(n3[i3]); } return out; }, import: function(ctx) { const res = []; this.each(ctx, function() { res.push(this); }); return this.merge($3(), res); }, merge: function(first, second) { let len = +second.length, j5 = 0, i3 = first.length; for (; j5 < len; j5++) { first[i3++] = second[j5]; } first.length = i3; return first; }, type: function(obj) { return Object.prototype.toString.call(obj).replace(/^\[object (.+)]$/, "$1").toLowerCase(); }, isSelector: function(selector) { if (typeof selector !== "string" || selector.length === 0 || selector === "#" || selector === ".") { return false; } try { document.querySelector(selector); return true; } catch (error) { return false; } }, remove: function(s2) { return $3(s2).remove(); }, isPlainObject, isEmptyObject, isArrayLike, acceptData, not: not2, parseUnit, getUnit, unit: parseUnit, isVisible, isHidden, matches: function(el, s2) { return matches.call(el, s2); }, random: function(from, to2) { if (arguments.length === 1 && isArrayLike(from)) { return from[Math.floor(Math.random() * from.length)]; } return Math.floor(Math.random() * (to2 - from + 1) + from); }, hasProp, dark: globalThis.matchMedia && globalThis.matchMedia("(prefers-color-scheme: dark)").matches, serializeToArray: function(form) { const _form = $3(form)[0]; if (!_form || _form.nodeName !== "FORM") { console.warn("Element is not a HTMLFromElement"); return; } let i3, j5, q5 = []; for (i3 = _form.elements.length - 1; i3 >= 0; i3 = i3 - 1) { if (_form.elements[i3].name === "") { continue; } switch (_form.elements[i3].nodeName) { case "INPUT": switch (_form.elements[i3].type) { case "checkbox": case "radio": if (_form.elements[i3].checked) { q5.push(_form.elements[i3].name + "=" + encodeURIComponent(_form.elements[i3].value)); } break; case "file": break; default: q5.push(_form.elements[i3].name + "=" + encodeURIComponent(_form.elements[i3].value)); } break; case "TEXTAREA": q5.push(_form.elements[i3].name + "=" + encodeURIComponent(_form.elements[i3].value)); break; case "SELECT": switch (_form.elements[i3].type) { case "select-one": q5.push(_form.elements[i3].name + "=" + encodeURIComponent(_form.elements[i3].value)); break; case "select-multiple": for (j5 = _form.elements[i3].options.length - 1; j5 >= 0; j5 = j5 - 1) { if (_form.elements[i3].options[j5].selected) { q5.push(_form.elements[i3].name + "=" + encodeURIComponent(_form.elements[i3].options[j5].value)); } } break; } break; case "BUTTON": switch (_form.elements[i3].type) { case "reset": case "submit": case "button": q5.push(_form.elements[i3].name + "=" + encodeURIComponent(_form.elements[i3].value)); break; } break; } } return q5; }, serialize: function(form) { return $3.serializeToArray(form).join("&"); }, viewport: function() { const w6 = window, d4 = document, e2 = d4.documentElement, g5 = d4.getElementsByTagName("body")[0], x5 = w6.innerWidth || e2.clientWidth || g5.clientWidth, y4 = w6.innerHeight || e2.clientHeight || g5.clientHeight; return { width: x5, height: y4 }; } }); $3.fn.extend({ items: function() { return $3.toArray(this); } }); var overriddenStop = Event.prototype.stopPropagation; var overriddenPrevent = Event.prototype.preventDefault; Event.prototype.stopPropagation = function() { this.isPropagationStopped = true; overriddenStop.apply(this, arguments); }; Event.prototype.preventDefault = function() { this.isPreventedDefault = true; overriddenPrevent.apply(this, arguments); }; Event.prototype.stop = function(immediate) { return immediate ? this.stopImmediatePropagation() : this.stopPropagation(); }; $3.extend({ events: [], eventHooks: {}, eventUID: -1, /* * el, eventName, handler, selector, ns, id, options * */ setEventHandler: function(obj) { let i3, freeIndex = -1, eventObj, resultIndex; if (this.events.length > 0) { for (i3 = 0; i3 < this.events.length; i3++) { if (this.events[i3].handler === null) { freeIndex = i3; break; } } } eventObj = { element: obj.el, event: obj.event, handler: obj.handler, selector: obj.selector, ns: obj.ns, id: obj.id, options: obj.options }; if (freeIndex === -1) { this.events.push(eventObj); resultIndex = this.events.length - 1; } else { this.events[freeIndex] = eventObj; resultIndex = freeIndex; } return resultIndex; }, getEventHandler: function(index) { if (this.events[index] !== void 0 && this.events[index] !== null) { this.events[index] = null; return this.events[index].handler; } return void 0; }, off: function() { $3.each(this.events, function() { this.element.removeEventListener(this.event, this.handler, true); }); this.events = []; return this; }, getEvents: function() { return this.events; }, getEventHooks: function() { return this.eventHooks; }, addEventHook: function(event, handler, type = "before") { $3.each(str2arr(event), (_5, eventName) => { const key = camelCase(`${type}-${eventName}`); this.eventHooks[key] = handler; }); return this; }, removeEventHook: function(event, type = "before") { $3.each(str2arr(event), (_5, eventName) => { delete this.eventHooks[camelCase(`${type}-${eventName}`)]; }); return this; }, removeEventHooks: function(event) { const that = this; if (not2(event)) { this.eventHooks = {}; } else { $3.each(str2arr(event), function() { delete that.eventHooks[camelCase("before-" + this)]; delete that.eventHooks[camelCase("after-" + this)]; }); } return this; } }); $3.fn.extend({ on: function(eventsList, sel, handler, options) { if (this.length === 0) { return; } if (typeof sel === "function") { options = handler || {}; handler = sel; sel = void 0; } if (typeof options !== "object") { options = {}; } return this.each(function(_5, el) { $3.each(str2arr(eventsList), (_22, ev) => { let h3, event = ev.split("."), name2 = normName(event[0]), ns = options.ns ? options.ns : event[1], index, originEvent; $3.eventUID++; h3 = (e2) => { let target = e2.target; const beforeHook = $3.eventHooks[camelCase("before-" + name2)]; const afterHook = $3.eventHooks[camelCase("after-" + name2)]; if (typeof beforeHook === "function") { beforeHook.call(target, e2); } if (!sel) { handler.call(el, e2); } else { while (target && target !== el) { if (matches.call(target, sel)) { handler.call(target, e2); if (e2.isPropagationStopped) { e2.stopImmediatePropagation(); break; } } target = target.parentNode; } } if (typeof afterHook === "function") { afterHook.call(target, e2); } if (options.once) { index = +$3(el).origin("event-" + e2.type + (sel ? ":" + sel : "") + (ns ? ":" + ns : "")); if (!isNaN(index)) $3.events.splice(index, 1); } }; Object.defineProperty(h3, "name", { value: handler.name && handler.name !== "" ? handler.name : "func_event_" + name2 + "_" + $3.eventUID }); originEvent = name2 + (sel ? ":" + sel : "") + (ns ? ":" + ns : ""); el.addEventListener(name2, h3, !isEmptyObject(options) ? options : false); index = $3.setEventHandler({ el, event: name2, handler: h3, selector: sel, ns, id: $3.eventUID, options: !isEmptyObject(options) ? options : false }); $3(el).origin("event-" + originEvent, index); }); }); }, one: function(events, sel, handler, options = {}) { if (typeof sel === "function") { options = handler || {}; handler = sel; sel = void 0; } options.once = true; return this.on.apply(this, [events, sel, handler, options]); }, off: function(eventsList, sel, options) { if (isPlainObject(sel)) { options = sel; sel = null; } if (!isPlainObject(options)) { options = {}; } if (not2(eventsList) || eventsList.toLowerCase() === "all") { return this.each(function() { const el = this; $3.each($3.events, function() { const e2 = this; if (e2.element === el) { el.removeEventListener(e2.event, e2.handler, e2.options); e2.handler = null; $3(el).origin("event-" + name + (e2.selector ? ":" + e2.selector : "") + (e2.ns ? ":" + e2.ns : ""), null); } }); }); } return this.each(function() { const el = this; $3.each(str2arr(eventsList), function() { let evMap = this.split("."), name2 = normName(evMap[0]), ns = options.ns ? options.ns : evMap[1], originEvent, index; originEvent = "event-" + name2 + (sel ? ":" + sel : "") + (ns ? ":" + ns : ""); index = $3(el).origin(originEvent); if (index !== void 0 && $3.events[index].handler) { el.removeEventListener(name2, $3.events[index].handler, $3.events[index].options); $3.events[index].handler = null; } $3(el).origin(originEvent, null); }); }); }, trigger: function(name2, data) { return this.fire(name2, data); }, fire: function(name2, data) { let _name, e2; if (this.length === 0) { return; } _name = normName(name2); if (["focus", "blur"].indexOf(_name) > -1) { this[0][_name](); return this; } e2 = new CustomEvent(_name, { bubbles: true, cancelable: true, detail: data }); return this.each(function() { this.dispatchEvent(e2); }); } }); "blur focus resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu touchstart touchend touchmove touchcancel".split(" ").forEach( function(name2) { $3.fn[name2] = function(sel, fn, opt2) { return arguments.length > 0 ? this.on(name2, sel, fn, opt2) : this.fire(name2); }; } ); $3.fn.extend({ hover: function(fnOver, fnOut) { return this.mouseenter(fnOver).mouseleave(fnOut || fnOver); } }); $3.ready = function(fn, options) { document.addEventListener("DOMContentLoaded", fn, options || false); }; $3.load = function(fn) { return $3(window).on("load", fn); }; $3.unload = function(fn) { return $3(window).on("unload", fn); }; $3.fn.extend({ unload: function(fn) { return this.length === 0 || this[0].self !== window ? void 0 : $3.unload(fn); } }); $3.beforeunload = function(fn) { if (typeof fn === "string") { return $3(window).on("beforeunload", function(e2) { e2.returnValue = fn; return fn; }); } else { return $3(window).on("beforeunload", fn); } }; $3.fn.extend({ beforeunload: function(fn) { return this.length === 0 || this[0].self !== window ? void 0 : $3.beforeunload(fn); } }); $3.fn.extend({ ready: function(fn) { if (this.length && this[0] === document && typeof fn === "function") { return $3.ready(fn); } } }); $3.ajax = function(p5) { return new Promise(function(resolve, reject) { const xhr = new XMLHttpRequest(); let method = (p5.method || "GET").toUpperCase(); const headers = []; const async = not2(p5.async) ? true : p5.async; let url = p5.url; let data; const exec = function(fn, params) { if (typeof fn === "function") { fn.apply(null, params); } }; const isGet = function(method2) { return ["GET", "JSON"].indexOf(method2) !== -1; }; const plainObjectToData = function(obj) { const _data = []; $3.each(obj, function(k5, v5) { const _v = isSimple(v5) ? v5 : JSON.stringify(v5); _data.push(k5 + "=" + _v); }); return _data.join("&"); }; if (p5.data instanceof HTMLFormElement) { let _action = p5.data.getAttribute("action").trim(); let _method = p5.data.getAttribute("method").trim(); if (not2(url) && _action) { url = _action; } if (_method) { method = _method.toUpperCase(); } } if (p5.timeout) { xhr.timeout = p5.timeout; } if (p5.withCredentials) { xhr.withCredentials = p5.withCredentials; } if (p5.data instanceof HTMLFormElement) { data = $3.serialize(p5.data); } else if (p5.data instanceof HTMLElement && p5.data.getAttribute("type") && p5.data.getAttribute("type").toLowerCase() === "file") { const _name = p5.data.getAttribute("name"); data = new FormData(); for (let i3 = 0; i3 < p5.data.files.length; i3++) { data.append(_name, p5.data.files[i3]); } } else if (isPlainObject(p5.data)) { data = plainObjectToData(p5.data); } else if (p5.data instanceof FormData) { data = p5.data; } else if (typeof p5.data === "string") { data = p5.data; } else { data = new FormData(); data.append("_data", JSON.stringify(p5.data)); } if (isGet(method)) { url += typeof data === "string" ? "?" + data : isEmptyObject(data) ? "" : "?" + JSON.stringify(data); } xhr.open(method, url, async, p5.user, p5.password); if (p5.headers) { $3.each(p5.headers, function(k5, v5) { xhr.setRequestHeader(k5, v5); headers.push(k5); }); } if (!isGet(method)) { if (headers.indexOf("Content-type") === -1 && p5.contentType !== false) { xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); } } xhr.send(data); xhr.addEventListener("load", function(e2) { if (xhr.readyState === 4 && xhr.status < 300) { let _return = p5.returnValue && p5.returnValue === "xhr" ? xhr : xhr.response; if (p5.parseJson) { try { _return = JSON.parse(_return); } catch (ex) { _return = {}; } } exec(resolve, [_return]); exec(p5.onSuccess, [e2, xhr]); } else { exec(reject, [xhr]); exec(p5.onFail, [e2, xhr]); } exec(p5.onLoad, [e2, xhr]); }); $3.each(["readystatechange", "error", "timeout", "progress", "loadstart", "loadend", "abort"], function() { const ev = camelCase("on-" + (this === "readystatechange" ? "state" : this)); xhr.addEventListener(ev, function(e2) { exec(p5[ev], [e2, xhr]); }); }); }); }; ["GET", "POST", "PUT", "PATCH", "DELETE", "JSON"].forEach(function(method) { $3[method.toLowerCase()] = function(url, data, options) { const _options = { method: method === "JSON" ? "GET" : method, url, data, parseJson: method === "JSON" }; return $3.ajax($3.extend({}, _options, options)); }; }); $3.fn.extend({ load: function(url, data, options) { const that = this; if (this.length && this[0].self === window) { return $3.load(url); } return $3.get(url, data, options).then(function(data2) { that.each(function() { this.innerHTML = data2; }); }); } }); $3.fn.extend({ style: function(name2, pseudo) { let el; function _getStyle2(el2, prop, pseudo2) { return ["scrollLeft", "scrollTop"].includes(prop) ? $3(el2)[prop]() : getComputedStyle(el2, pseudo2)[prop]; } if (typeof name2 === "string" && this.length === 0) { return void 0; } if (this.length === 0) { return this; } el = this[0]; if (!name2 || name2 === "all") { return getComputedStyle(el, pseudo); } else { let result = {}; let names = name2.split(", ").map(function(el2) { return ("" + camelCase(el2)).trim(); }); if (names.length === 1) { return _getStyle2(el, names[0], pseudo); } else { $3.each(names, function() { const prop = this; result[this] = _getStyle2(el, prop, pseudo); }); return result; } } }, removeStyleProperty: function(name2) { if (not2(name2) || this.length === 0) return this; const names = name2.split(", ").map(function(el) { return ("" + el).trim(); }); return this.each(function() { const el = this; $3.each(names, function() { el.style.removeProperty(this); }); }); }, removeStyle: function(name2) { if (!name2) return this; const names = str2arr(name2, ", "); return this.each(function() { const el = this; $3.each(names, function() { el.style[this] = ""; }); }); }, css: function(key, val) { key = key || "all"; if (typeof key === "string" && not2(val)) { return this.style(key); } return this.each(function(_5, el) { if (typeof key === "object") { $3.each(key, function(key2, val2) { setStyleProp(el, key2, val2); }); } else if (typeof key === "string") { setStyleProp(el, key, val); } }); }, cssVar: function(name2, val) { if (not2(name2)) return void 0; if (not2(val)) { return getComputedStyle(this[0]).getPropertyValue("--" + name2); } else { return this.each(function() { this.style.setProperty("--" + name2, val); }); } } }); $3.fn.extend({ addClass: function() { }, removeClass: function() { }, toggleClass: function() { }, containsClass: function(cls) { return this.hasClass(cls); }, hasClass: function(cls) { if (not2(cls)) { return false; } let result = false; const classes = cls.split(" ").filter((v5) => ("" + v5).trim() !== ""); this.each(function() { const el = this; $3.each(classes, function() { if (!result && el.classList && el.classList.contains(this)) { result = true; } }); }); return result; }, clearClasses: function() { return this.each(function() { this.className = ""; }); }, cls: function(array = false) { return this.length === 0 ? void 0 : array ? this[0].className.split(" ") : this[0].className; }, removeClassBy: function(mask) { return this.each(function() { const el = $3(this); const classes = el.cls(true); $3.each(classes, function() { const elClass = this; if (elClass.indexOf(mask) > -1) { el.removeClass(elClass); } }); }); }, classNames: function() { const args = Array.prototype.slice.call(arguments, 0); const classes = []; $3.each(args, function(_5, a2) { if (typeof a2 === "string") { classes.push(a2); } else if (isPlainObject(a2)) { $3.each(a2, function(k5, v5) { if (v5) { classes.push(k5); } }); } else { nothing(); } }); return this.each(function() { this.className += " " + classes.join(" "); }); } }); ["add", "remove", "toggle"].forEach(function(method) { $3.fn[method + "Class"] = function(cls) { const _classes = !cls ? [] : Array.isArray(cls) ? cls : cls.split(" ").filter(function(v5) { return !!v5; }); if (!_classes.length) return this; return this.each(function() { const el = this; const hasClassList = typeof el.classList !== "undefined"; if (hasClassList) { $3.each(_classes, function(_5, v5) { el.classList[method](v5); }); } else { el.className += _classes.join(" "); } }); }; }); $3.parseHTML = function(data) { let base, singleTag, result = [], ctx, _context; const regexpSingleTag = /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i; if (typeof data !== "string" || data.trim() === "") { return []; } data = data.trim(); singleTag = regexpSingleTag.exec(data); if (singleTag) { result.push(document.createElement(singleTag[1])); } else { if ($3.isSelector(data)) { const elements = document.querySelectorAll(data); if (elements.length) { for (const el of elements) { result.push(el); } } if (result.length === 0) { result.push(document.createTextNode(data)); } return result; } ctx = document.implementation.createHTMLDocument(""); base = ctx.createElement("base"); base.href = document.location.href; ctx.head.appendChild(base); _context = ctx.body; _context.innerHTML = data; for (let i3 = 0; i3 < _context.childNodes.length; i3++) { result.push(_context.childNodes[i3].cloneNode(true)); } } return result; }; $3.fn.extend({ _size: function(prop, val) { if (this.length === 0) return; if (not2(val)) { const el = this[0]; if (prop === "height") { return el === window ? window.innerHeight : el === document ? el.body.clientHeight : parseInt(getComputedStyle(el).height); } if (prop === "width") { return el === window ? window.innerWidth : el === document ? el.body.clientWidth : parseInt(getComputedStyle(el).width); } } return this.each(function() { const el = this; if (el === window || el === document) { return; } el.style[prop] = isNaN(val) ? val : +val === 0 ? 0 : val + "px"; }); }, height: function(val) { return this._size("height", val); }, width: function(val) { return this._size("width", val); }, _sizeOut: function(prop, val) { let el, size, style, result; if (this.length === 0) { return; } const setter = typeof val === "number"; if (setter) { return this.each(function() { const el2 = this; if (el2 === window || el2 === document) { return; } let h3, style2 = getComputedStyle(el2), bs = prop === "width" ? parseInt(style2["borderLeftWidth"]) + parseInt(style2["borderRightWidth"]) : parseInt(style2["borderTopWidth"]) + parseInt(style2["borderBottomWidth"]), pa = prop === "width" ? parseInt(style2["paddingLeft"]) + parseInt(style2["paddingRight"]) : parseInt(style2["paddingTop"]) + parseInt(style2["paddingBottom"]); h3 = $3(this)[prop](val)[prop]() - bs - pa; el2.style[prop] = h3 + "px"; }); } const includeMargin = val === true; el = this[0]; size = el[prop === "width" ? "offsetWidth" : "offsetHeight"]; style = getComputedStyle(el); result = size + parseInt(style[prop === "width" ? "marginLeft" : "marginTop"]) + parseInt(style[prop === "width" ? "marginRight" : "marginBottom"]); return includeMargin ? result : size; }, outerWidth: function(val) { return this._sizeOut("width", val); }, outerHeight: function(val) { return this._sizeOut("height", val); }, padding: function(p5) { if (this.length === 0) return; const s2 = getComputedStyle(this[0], p5); return { top: parseInt(s2["paddingTop"]), right: parseInt(s2["paddingRight"]), bottom: parseInt(s2["paddingBottom"]), left: parseInt(s2["paddingLeft"]) }; }, margin: function(p5) { if (this.length === 0) return; const s2 = getComputedStyle(this[0], p5); return { top: parseInt(s2["marginTop"]), right: parseInt(s2["marginRight"]), bottom: parseInt(s2["marginBottom"]), left: parseInt(s2["marginLeft"]) }; }, border: function(p5) { if (this.length === 0) return; const s2 = getComputedStyle(this[0], p5); return { top: parseInt(s2["borderTopWidth"]), right: parseInt(s2["borderRightWidth"]), bottom: parseInt(s2["borderBottomWidth"]), left: parseInt(s2["borderLeftWidth"]) }; } }); $3.fn.extend({ offset: function(val) { if (val === void 0) { if (this.length === 0) return void 0; let rect = this[0].getBoundingClientRect(); return { top: rect.top + (window.scrollY || window.pageYOffset || document.documentElement.scrollTop || 0), left: rect.left + (window.scrollX || window.pageXOffset || document.documentElement.scrollLeft || 0) }; } return this.each(function() { let { top, left } = val; let el = $3(this), position = getComputedStyle(this).position; let currentRect = this.getBoundingClientRect(); let currentOffset = { top: currentRect.top + (window.scrollY || window.pageYOffset || 0), left: currentRect.left + (window.scrollX || window.pageXOffset || 0) }; if (position === "static") { el.css("position", "relative"); } if (["absolute", "fixed"].indexOf(position) === -1) { top = top - currentOffset.top; left = left - currentOffset.left; } if (top) el.css("top", top); if (left) el.css("left", left); }); }, position: function(margin = false) { let ml = 0, mt3 = 0, el, style; if (this.length === 0) { return void 0; } el = this[0]; style = getComputedStyle(el); if (margin) { ml = parseInt(style["marginLeft"]); mt3 = parseInt(style["marginTop"]); } return { left: el.offsetLeft - ml, top: el.offsetTop - mt3 }; }, left: function(val, margin) { if (this.length === 0) return; if (not2(val)) { return this.position(margin).left; } if (typeof val === "boolean") { margin = val; return this.position(margin).left; } return this.each(function() { $3(this).css({ left: val }); }); }, top: function(val, margin = false) { if (this.length === 0) return; if (not2(val)) { return this.position(margin).top; } if (typeof val === "boolean") { margin = val; return this.position(margin).top; } return this.each(function() { $3(this).css({ top: val }); }); }, rect: function() { return this.length === 0 ? void 0 : this[0].getBoundingClientRect(); }, pos: function() { if (this.length === 0) return; const el = $3(this[0]); return { top: parseInt(el.style("top")), left: parseInt(el.style("left")) }; } }); $3.fn.extend({ attr: function(name2, val) { const attributes = {}; if (this.length === 0 && arguments.length === 0) { return void 0; } if (this.length && arguments.length === 0) { $3.each(this[0].attributes, function() { attributes[this.name] = this.value; }); return attributes; } if (arguments.length === 1 && typeof name2 === "string") { return this.length && this[0].nodeType === 1 && this[0].hasAttribute(name2) ? this[0].getAttribute(name2) : void 0; } return this.each(function() { const el = this; if (isPlainObject(name2)) { $3.each(name2, function(k5, v5) { el.setAttribute(k5, v5); }); } else { el.setAttribute(name2, val); } }); }, removeAttr: function(name2) { let attributes; if (!name2) { return this.each(function(_5, el) { const attributes2 = $3(el).attr(); $3.each(attributes2, function(k5) { el.removeAttribute(k5); }); }); } attributes = typeof name2 === "string" ? name2.split(",").map(function(el) { return el.trim(); }) : name2; return this.each(function() { const el = this; $3.each(attributes, function() { if (el.hasAttribute(this)) el.removeAttribute(this); }); }); }, toggleAttr: function(name2, val) { return this.each(function() { const el = this; if (not2(val)) { el.removeAttribute(name2); } else { el.setAttribute(name2, val); } }); }, id: function(val) { if (typeof val === "undefined") { return this.length === 1 ? $3(this[0]).attr("id") : this.map((el) => $3(el).attr("id")); } return this.each(function() { $3(this).attr("id", val); }); }, title: function(val) { if (typeof val === "undefined") { return this.length ? $3(this[0]).attr("title") : void 0; } return this.each(function() { $3(this).attr("title", val); }); }, href: function(val) { if (typeof val === "undefined") { return this.length ? this[0].tagName === "A" ? this[0].href : void 0 : void 0; } return this.each(function() { if (this.tagName === "A") { this.href = val; } }); }, name: function(val) { if (typeof val === "undefined") { return this.length ? this[0].name ? this[0].name : void 0 : void 0; } return this.each(function() { if (this.name) { this.name = val; } }); }, src: function(val) { if (typeof val === "undefined") { return this.length ? this[0].src ? this[0].src : void 0 : void 0; } return this.each(function() { if (this.src) { this.src = val; } }); } }); $3.extend({ meta: function(name2) { return not2(name2) ? $3("meta") : $3("meta[name='$name']".replace("$name", name2)); }, metaBy: function(name2) { return not2(name2) ? $3("meta") : $3("meta[$name]".replace("$name", name2)); }, doctype: function() { return $3("doctype"); }, html: function() { return $3("html"); }, head: function() { return $3("html").find("head"); }, body: function() { return $3("body"); }, document: function() { return $3(document); }, window: function() { return $3(window); }, charset: function(val) { if (val) { const m5 = $3("meta[charset]"); if (m5.length > 0) { m5.attr("charset", val); } } return document.characterSet; }, lang: function(val) { if (val) { const h3 = $3("html"); if (h3.length > 0) { h3.attr("lang", val); } } return document.documentElement.lang; }, title: function(val) { if (typeof val === "undefined") { return document.title; } document.title = val; } }); $3.extend({ bind: (fn, ctx) => fn.bind(ctx) }); (function(arr) { arr.forEach(function(item) { ["append", "prepend"].forEach(function(where) { if (hasProp(item, where)) { return; } Object.defineProperty(item, where, { configurable: true, enumerable: true, writable: true, value: function() { const argArr = Array.prototype.slice.call(arguments), docFrag = document.createDocumentFragment(); argArr.forEach(function(argItem) { const isNode = argItem instanceof Node; docFrag.appendChild(isNode ? argItem : document.createTextNode(String(argItem))); }); if (where === "prepend") this.insertBefore(docFrag, this.firstChild); else this.appendChild(docFrag); } }); }); }); })([Element.prototype, Document.prototype, DocumentFragment.prototype]); var normalizeElements = function(s2) { let result; if (typeof s2 === "string") result = $3.isSelector(s2) ? $3(s2) : $3.parseHTML(s2); else if (s2 instanceof HTMLElement) result = [s2]; else if (isArrayLike(s2)) result = s2; return result; }; $3.fn.extend({ appendText: function(text) { return this.each(function(elIndex, el) { el.innerHTML += text; }); }, prependText: function(text) { return this.each(function(elIndex, el) { el.innerHTML = text + el.innerHTML; }); }, append: function(elements) { const _elements = normalizeElements(elements); return this.each(function(elIndex, el) { $3.each(_elements, function() { if (el === this) return; const child = elIndex === 0 ? this : this.cloneNode(true); if (child.tagName && child.tagName === "SCRIPT") { $3.script(child, el); } else { el.append(child); } }); }); }, appendTo: function(elements) { const _elements = normalizeElements(elements); return this.each(function(_5, el) { $3.each(_elements, function(parIndex, parent2) { if (el === this) return; parent2.append(parIndex === 0 ? el : el.cloneNode(true)); }); }); }, prepend: function(elements) { const _elements = normalizeElements(elements); return this.each(function(elIndex, el) { $3.each(_elements, function() { if (el === this) return; const child = elIndex === 0 ? this : this.cloneNode(true); $3.script(child); if (child.tagName && child.tagName !== "SCRIPT") el.prepend(child); }); }); }, prependTo: function(elements) { const _elements = normalizeElements(elements); return this.each(function() { const el = this; $3.each(_elements, function(parIndex, parent2) { if (el === this) return; $3(parent2).prepend(parIndex === 0 ? el : el.cloneNode(true)); }); }); }, insertBefore: function(elements) { const _elements = normalizeElements(elements); return this.each(function() { const el = this; $3.each(_elements, function(elIndex) { if (el === this) return; const parent2 = this.parentNode; if (parent2) { parent2.insertBefore(elIndex === 0 ? el : el.cloneNode(true), this); } }); }); }, insertAfter: function(elements) { const _elements = normalizeElements(elements); return this.each(function() { const el = this; $3.each(_elements, function(elIndex, element2) { if (el === this) return; const parent2 = this.parentNode; if (parent2) { parent2.insertBefore(elIndex === 0 ? el : el.cloneNode(true), element2.nextSibling); } }); }); }, after: function(html) { return this.each(function() { const el = this; if (typeof html === "string") { el.insertAdjacentHTML("afterend", html); } else { $3(html).insertAfter(el); } }); }, before: function(html) { return this.each(function() { const el = this; if (typeof html === "string") { el.insertAdjacentHTML("beforebegin", html); } else { $3(html).insertBefore(el); } }); }, clone: function(deep = false, withData = false) { const res = []; this.each(function() { const el = this.cloneNode(deep); const $el = $3(el); let data; if (withData && $3.hasData(this)) { data = $3(this).data(); $3.each(data, function(k5, v5) { $el.data(k5, v5); }); } res.push(el); }); return $3.merge($3(), res); }, import: function(deep) { const res = []; if (not2(deep)) { deep = false; } this.each(function() { res.push(document.importNode(this, deep)); }); return $3.merge($3(), res); }, adopt: function() { const res = []; this.each(function() { res.push(document.adoptNode(this)); }); return $3.merge($3(), res); }, remove: function(selector) { let i3 = 0, node, out, res = []; if (this.length === 0) { return; } out = selector ? this.filter(function(el) { return matches.call(el, selector); }) : this.items(); for (; (node = out[i3]) != null; i3++) { if (node.parentNode) { res.push(node.parentNode.removeChild(node)); $3.removeData(node); } } return $3.merge($3(), res); }, wrap: function(el) { if (this.length === 0) { return; } const wrapper = $3(normalizeElements(el)); if (!wrapper.length) { return; } const res = []; this.each(function() { let _target, _wrapper; _wrapper = wrapper.clone(true, true); _wrapper.insertBefore(this); _target = _wrapper; while (_target.children().length) { _target = _target.children().eq(0); } _target.append(this); res.push(_wrapper); }); return $3(res); }, wrapAll: function(el) { let wrapper, _wrapper, _target; if (this.length === 0) { return; } wrapper = $3(normalizeElements(el)); if (!wrapper.length) { return; } _wrapper = wrapper.clone(true, true); _wrapper.insertBefore(this[0]); _target = _wrapper; while (_target.children().length) { _target = _target.children().eq(0); } this.each(function() { _target.append(this); }); return _wrapper; }, wrapInner: function(el) { if (this.length === 0) { return; } const wrapper = $3(normalizeElements(el)); if (!wrapper.length) { return; } const res = []; this.each(function() { const elem = $3(this); const html = elem.html(); const wrp = wrapper.clone(true, true); elem.html(wrp.html(html)); res.push(wrp); }); return $3(res); } }); $3.extend({ animation: { duration: 1e3, ease: "linear", elements: {} } }); if (typeof window["setupAnimation"] === "object") { $3.each(window["setupAnimation"], function(key, val) { if (typeof $3.animation[key] !== "undefined" && !not2(val)) $3.animation[key] = val; }); } var transformProps = ["translateX", "translateY", "translateZ", "rotate", "rotateX", "rotateY", "rotateZ", "scale", "scaleX", "scaleY", "scaleZ", "skew", "skewX", "skewY"]; var numberProps = ["opacity", "zIndex"]; var floatProps = ["opacity", "volume"]; var scrollProps = ["scrollLeft", "scrollTop"]; var reverseProps = ["opacity", "volume"]; function _validElement(el) { return el instanceof HTMLElement || el instanceof SVGElement; } function _getRelativeValue(to2, from) { const operator = /^(\*=|\+=|-=)/.exec(to2); if (!operator) return to2; const u4 = getUnit(to2) || 0; const x5 = parseFloat(from); const y4 = parseFloat(to2.replace(operator[0], "")); switch (operator[0][0]) { case "+": return x5 + y4 + u4; case "-": return x5 - y4 + u4; case "*": return x5 * y4 + u4; case "/": return x5 / y4 + u4; } } function _getStyle(el, prop, pseudo) { if (typeof el[prop] !== "undefined") { if (scrollProps.indexOf(prop) > -1) { return prop === "scrollLeft" ? el === window ? scrollX : el.scrollLeft : el === window ? scrollY : el.scrollTop; } else { return el[prop] || 0; } } return el.style[prop] || getComputedStyle(el, pseudo)[prop]; } function _setStyle(el, key, val, unit, toInt) { if (not2(toInt)) { toInt = false; } key = camelCase(key); if (toInt) { val = parseInt(val); } if (_validElement(el)) { if (typeof el[key] !== "undefined") { el[key] = val; } else { el.style[key] = key === "transform" || key.toLowerCase().indexOf("color") > -1 ? val : val + unit; } } else { el[key] = val; } } function _applyStyles(el, mapProps, p5) { $3.each(mapProps, function(key, val) { _setStyle(el, key, val[0] + val[2] * p5, val[3], val[4]); }); } function _getElementTransforms(el) { if (!_validElement(el)) return {}; const str2 = el.style.transform || ""; const reg = /(\w+)\(([^)]*)\)/g; const transforms = {}; let m5; while (m5 = reg.exec(str2)) transforms[m5[1]] = m5[2]; return transforms; } function _getColorArrayFromHex(val) { const a2 = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(val ? val : "#000000"); return a2.slice(1).map(function(v5) { return parseInt(v5, 16); }); } function _getColorArrayFromElement(el, key) { return getComputedStyle(el)[key].replace(/[^\d.,]/g, "").split(",").map(function(v5) { return parseInt(v5); }); } function _applyTransform(el, mapProps, p5) { const t = []; const elTransforms = _getElementTransforms(el); $3.each(mapProps, function(key, val) { let from = val[0], to2 = val[1], delta = val[2], unit = val[3]; key = "" + key; if (key.indexOf("rotate") > -1 || key.indexOf("skew") > -1) { if (unit === "") unit = "deg"; } if (key.indexOf("scale") > -1) { unit = ""; } if (key.indexOf("translate") > -1 && unit === "") { unit = "px"; } if (unit === "turn") { t.push(key + "(" + to2 * p5 + unit + ")"); } else { t.push(key + "(" + (from + delta * p5) + unit + ")"); } }); $3.each(elTransforms, function(key, val) { if (mapProps[key] === void 0) { t.push(key + "(" + val + ")"); } }); el.style.transform = t.join(" "); } function _applyColors(el, mapProps, p5) { $3.each(mapProps, function(key, val) { let i3, result = [0, 0, 0], v5; for (i3 = 0; i3 < 3; i3++) { result[i3] = Math.floor(val[0][i3] + val[2][i3] * p5); } v5 = "rgb(" + result.join(",") + ")"; el.style[key] = v5; }); } function _expandColorValue(val) { const regExp = /^#?([a-f\d])([a-f\d])([a-f\d])$/i; if (val[0] === "#" && val.length === 4) { return "#" + val.replace(regExp, function(m5, r2, g5, b5) { return r2 + r2 + g5 + g5 + b5 + b5; }); } return val[0] === "#" ? val : "#" + val; } function applyProps(el, map, p5) { _applyStyles(el, map.props, p5); _applyTransform(el, map.transform, p5); _applyColors(el, map.color, p5); } function createAnimationMap(el, draw, dir) { const map = { props: {}, transform: {}, color: {} }; let i3, from, to2, delta, unit, temp; const elTransforms = _getElementTransforms(el); if (not2(dir)) { dir = "normal"; } $3.each(draw, function(key, val) { const isTransformProp = transformProps.indexOf("" + key) > -1; const isNumProp = numberProps.indexOf("" + key) > -1; const isColorProp = ("" + key).toLowerCase().indexOf("color") > -1; if (Array.isArray(val) && val.length === 1) { val = val[0]; } if (!Array.isArray(val)) { if (isTransformProp) { from = elTransforms[key] || key === "scale" ? 1 : 0; } else if (isColorProp) { from = _getColorArrayFromElement(el, key); } else { from = _getStyle(el, key, void 0); } from = !isColorProp ? parseUnit(from) : from; to2 = !isColorProp ? parseUnit(_getRelativeValue(val, Array.isArray(from) ? from[0] : from)) : _getColorArrayFromHex(val); } else { from = !isColorProp ? parseUnit(val[0]) : _getColorArrayFromHex(_expandColorValue(val[0])); to2 = !isColorProp ? parseUnit(val[1]) : _getColorArrayFromHex(_expandColorValue(val[1])); } if (reverseProps.indexOf("" + key) > -1 && from[0] === to2[0]) { from[0] = to2[0] > 0 ? 0 : 1; } if (dir === "reverse") { temp = from; from = to2; to2 = temp; } unit = el instanceof HTMLElement && to2[1] === "" && !isNumProp && !isTransformProp ? "px" : to2[1]; if (isColorProp) { delta = [0, 0, 0]; for (i3 = 0; i3 < 3; i3++) { delta[i3] = to2[i3] - from[i3]; } } else { delta = to2[0] - from[0]; } if (isTransformProp) { map.transform[key] = [from[0], to2[0], delta, unit]; } else if (isColorProp) { map.color[key] = [from, to2, delta, unit]; } else { map.props[key] = [from[0], to2[0], delta, unit, floatProps.indexOf("" + key) === -1]; } }); return map; } function minMax(val, min, max) { return Math.min(Math.max(val, min), max); } var Easing = { linear: function() { return function(t) { return t; }; } }; Easing.default = Easing.linear; var eases = { Sine: function() { return function(t) { return 1 - Math.cos(t * Math.PI / 2); }; }, Circ: function() { return function(t) { return 1 - Math.sqrt(1 - t * t); }; }, Back: function() { return function(t) { return t * t * (3 * t - 2); }; }, Bounce: function() { return function(t) { let pow2, b5 = 4; while (t < ((pow2 = Math.pow(2, --b5)) - 1) / 11) { } return 1 / Math.pow(4, 3 - b5) - 7.5625 * Math.pow((pow2 * 3 - 2) / 22 - t, 2); }; }, Elastic: function(amplitude, period) { if (not2(amplitude)) { amplitude = 1; } if (not2(period)) { period = 0.5; } const a2 = minMax(amplitude, 1, 10); const p5 = minMax(period, 0.1, 2); return function(t) { return t === 0 || t === 1 ? t : -a2 * Math.pow(2, 10 * (t - 1)) * Math.sin((t - 1 - p5 / (Math.PI * 2) * Math.asin(1 / a2)) * (Math.PI * 2) / p5); }; } }; ["Quad", "Cubic", "Quart", "Quint", "Expo"].forEach(function(name2, i3) { eases[name2] = function() { return function(t) { return Math.pow(t, i3 + 2); }; }; }); Object.keys(eases).forEach(function(name2) { const easeIn = eases[name2]; Easing["easeIn" + name2] = easeIn; Easing["easeOut" + name2] = function(a2, b5) { return function(t) { return 1 - easeIn(a2, b5)(1 - t); }; }; Easing["easeInOut" + name2] = function(a2, b5) { return function(t) { return t < 0.5 ? easeIn(a2, b5)(t * 2) / 2 : 1 - easeIn(a2, b5)(t * -2 + 2) / 2; }; }; }); var defaultAnimationProps = { id: null, el: null, draw: {}, dur: $3.animation.duration, ease: $3.animation.ease, loop: 0, pause: 0, dir: "normal", defer: 0, onStart: function() { }, onStop: function() { }, onStopAll: function() { }, onPause: function() { }, onPauseAll: function() { }, onResume: function() { }, onResumeAll: function() { }, onFrame: function() { }, onDone: function() { } }; function animate(args) { return new Promise(function(resolve) { const that = this; const props = $3.assign({}, defaultAnimationProps, { dur: $3.animation.duration, ease: $3.animation.ease }, args); let id = props.id, el = props.el, draw = props.draw, dur = props.dur, ease = props.ease, loop = props.loop, onStart = props.onStart, onFrame = props.onFrame, onDone = props.onDone, pauseStart = props.pause, dir = props.dir, defer = props.defer; let map = {}; let easeName = "linear", easeArgs = [], easeFn = Easing.linear, matchArgs; let direction = dir === "alternate" ? "normal" : dir; let replay = false; let animationID = id ? id : +(performance.now() * Math.pow(10, 14)); if (not2(el)) { throw new Error("Unknown element!"); } if (typeof el === "string") { el = document.querySelector(el); } if (typeof draw !== "function" && typeof draw !== "object") { throw new Error("Unknown draw object. Must be a function or object!"); } if (dur === 0) { dur = 1; } if (dir === "alternate" && typeof loop === "number") { loop *= 2; } if (typeof ease === "string") { matchArgs = /\(([^)]+)\)/.exec(ease); easeName = ease.split("(")[0]; easeArgs = matchArgs ? matchArgs[1].split(",").map(function(p5) { return parseFloat(p5); }) : []; easeFn = Easing[easeName] || Easing.linear; } else if (typeof ease === "function") { easeFn = ease; } else { easeFn = Easing.linear; } $3.animation.elements[animationID] = { element: el, id: null, stop: 0, pause: 0, loop: 0, t: -1, started: 0, paused: 0 }; const play = function() { if (typeof draw === "object") { map = createAnimationMap(el, draw, direction); } if (typeof onStart === "function") { onStart.apply(el); } $3.animation.elements[animationID].loop += 1; $3.animation.elements[animationID].started = performance.now(); $3.animation.elements[animationID].duration = dur; $3.animation.elements[animationID].id = requestAnimationFrame(animate1); }; const done = function() { cancelAnimationFrame($3.animation.elements[animationID].id); delete $3.animation.elements[id]; if (typeof onDone === "function") { onDone.apply(el); } resolve(that); }; const animate1 = function(time) { let p5, t; let { stop, pause, started: start } = $3.animation.elements[animationID]; if ($3.animation.elements[animationID].paused) { start = time - $3.animation.elements[animationID].t * dur; $3.animation.elements[animationID].started = start; } t = ((time - start) / dur).toFixed(4); if (t > 1) t = 1; if (t < 0) t = 0; p5 = easeFn.apply(null, easeArgs)(t); $3.animation.elements[animationID].t = t; $3.animation.elements[animationID].p = p5; if (pause) { $3.animation.elements[animationID].id = requestAnimationFrame(animate1); return; } if (stop > 0) { if (stop === 2) { if (typeof draw === "function") { draw.bind(el)(1, 1); } else { applyProps(el, map, 1); } } done(); return; } if (typeof draw === "function") { draw.bind(el)(t, p5); } else { applyProps(el, map, p5); } if (typeof onFrame === "function") { onFrame.apply(el, [t, p5]); } if (t <= 1) { $3.animation.elements[animationID].id = requestAnimationFrame(animate1); } if (t >= 1) { if (loop) { if (dir === "alternate") { direction = direction === "normal" ? "reverse" : "normal"; } if (typeof loop === "boolean") { setTimeout(function() { play(); }, pauseStart); } else { if (loop > $3.animation.elements[animationID].loop) { setTimeout(function() { play(); }, pauseStart); } else { done(); } } } else { if (dir === "alternate" && !replay) { direction = direction === "normal" ? "reverse" : "normal"; replay = true; play(); } else { done(); } } } }; if (defer > 0) { setTimeout(function() { play(); }, defer); } else { play(); } }); } function stopAnimation(id, done) { const an = $3.animation.elements[id]; if (typeof an === "undefined") { return; } if (not2(done)) { done = true; } an.stop = done === true ? 2 : 1; if (typeof an.onStop === "function") { an.onStop.apply(an.element); } } function stopAnimationAll(done, filter) { $3.each($3.animation.elements, function(k5, v5) { if (filter) { if (typeof filter === "string") { if (matches.call(v5.element, filter)) stopAnimation(k5, done); } else if (filter.length) { $3.each(filter, function() { if (v5.element === this) stopAnimation(k5, done); }); } else if (filter instanceof Element) { if (v5.element === filter) stopAnimation(k5, done); } } else { stopAnimation(k5, done); } }); } function pauseAnimation(id) { const an = $3.animation.elements[id]; if (typeof an === "undefined") { return; } an.pause = 1; an.paused = performance.now(); if (typeof an.onPause === "function") { an.onPause.apply(an.element); } } function pauseAnimationAll(filter) { $3.each($3.animation.elements, function(k5, v5) { if (filter) { if (typeof filter === "string") { if (matches.call(v5.element, filter)) pauseAnimation(k5); } else if (filter.length) { $3.each(filter, function() { if (v5.element === this) pauseAnimation(k5); }); } else if (filter instanceof Element) { if (v5.element === filter) pauseAnimation(k5); } } else { pauseAnimation(k5); } }); } function resumeAnimation(id) { const an = $3.animation.elements[id]; if (typeof an === "undefined") { return; } an.pause = 0; an.paused = 0; if (typeof an.onResume === "function") { an.onResume.apply(an.element); } } function resumeAnimationAll(filter) { $3.each($3.animation.elements, function(k5, v5) { if (filter) { if (typeof filter === "string") { if (matches.call(v5.element, filter)) resumeAnimation(k5); } else if (filter.length) { $3.each(filter, function() { if (v5.element === this) resumeAnimation(k5); }); } else if (filter instanceof Element) { if (v5.element === filter) resumeAnimation(k5); } } else { resumeAnimation(k5); } }); } var defaultChainOptions = { loop: false, onChainItem: null, onChainItemComplete: null, onChainComplete: null }; function chain(arr, opt2) { const o2 = $3.extend({}, defaultChainOptions, opt2); if (typeof o2.loop !== "boolean") { o2.loop--; } if (!Array.isArray(arr)) { console.warn("Chain array is not defined!"); return false; } const reducer = function(acc, item) { return acc.then(function() { if (typeof o2["onChainItem"] === "function") { o2["onChainItem"](item); } return animate(item).then(function() { if (typeof o2["onChainItemComplete"] === "function") { o2["onChainItemComplete"](item); } }); }); }; arr.reduce(reducer, Promise.resolve()).then(function() { if (typeof o2["onChainComplete"] === "function") { o2["onChainComplete"](); } if (o2.loop) { chain(arr, o2); } }); } $3.easing = {}; $3.extend($3.easing, Easing); $3.extend({ animate: function(args) { let el, draw, dur, ease, cb; if (arguments.length > 1) { el = $3(arguments[0])[0]; draw = arguments[1]; dur = arguments[2] || $3.animation.duration; ease = arguments[3] || $3.animation.ease; cb = arguments[4]; if (typeof dur === "function") { cb = dur; ease = $3.animation.ease; dur = $3.animation.duration; } if (typeof ease === "function") { cb = ease; ease = $3.animation.ease; } return animate({ el, draw, dur, ease, onDone: cb }); } return animate(args); }, chain, stop: stopAnimation, stopAll: stopAnimationAll, resume: resumeAnimation, resumeAll: resumeAnimationAll, pause: pauseAnimation, pauseAll: pauseAnimationAll }); $3.fn.extend({ /** * args = { draw: {} | function, dur: 1000, ease: "linear", loop: 0, pause: 0, dir: "normal", defer: 0, onFrame: function, onDone: function } * @returns {this} */ animate: function(args) { const that = this; let draw, dur, easing, cb; const a2 = args; let compatibilityMode; compatibilityMode = !Array.isArray(args) && (arguments.length > 1 || arguments.length === 1 && typeof arguments[0].draw === "undefined"); if (compatibilityMode) { draw = arguments[0]; dur = arguments[1] || $3.animation.duration; easing = arguments[2] || $3.animation.ease; cb = arguments[3]; if (typeof dur === "function") { cb = dur; dur = $3.animation.duration; easing = $3.animation.ease; } if (typeof easing === "function") { cb = easing; easing = $3.animation.ease; } return this.each(function() { return $3.animate({ el: this, draw, dur, ease: easing, onDone: cb }); }); } if (Array.isArray(args)) { $3.each(args, function() { const a22 = this; that.each(function() { a22.el = this; $3.animate(a22); }); }); return this; } return this.each(function() { a2.el = this; $3.animate(a2); }); }, chain: function(arr, loop) { return this.each(function() { const el = this; $3.each(arr, function() { this.el = el; }); $3.chain(arr, loop); }); }, /** * * @param done * @returns {this} */ stop: function(done) { return this.each(function() { const el = this; $3.each($3.animation.elements, function(k5, o2) { if (o2.element === el) { stopAnimation(k5, done); } }); }); }, pause: function() { return this.each(function() { const el = this; $3.each($3.animation.elements, function(k5, o2) { if (o2.element === el) { pauseAnimation(k5); } }); }); }, resume: function() { return this.each(function() { const el = this; $3.each($3.animation.elements, function(k5, o2) { if (o2.element === el) { resumeAnimation(k5); } }); }); } }); $3.extend({ hidden: function(el, val, cb) { el = $3(el)[0]; if (typeof val === "undefined") { el.hidden = !el.hidden; return this; } if (typeof val === "string") { val = val.toLowerCase() === "true"; } if (typeof val === "function") { cb = val; val = !el.hidden; } el.hidden = val; if (typeof cb === "function") { $3.bind(cb, el); cb.call(el, arguments); } return this; }, hide: function(el, cb) { const $el = $3(el); el = $el[0]; const inline = el.style.display; const css = getComputedStyle(el, null).display; $el.origin("display", { inline, css }); el.style.display = "none"; if (typeof cb === "function") { $3.bind(cb, el); cb.call(el, arguments); } return this; }, show: function(el, cb) { const $el = $3(el); const display = $el.origin("display"); el = $3(el)[0]; el.style.display = ""; if (display) { const inline = display.inline || ""; const css = display.css || ""; if (inline && inline !== "none") { el.style.display = inline; } else if (css === "none") { el.style.display = "block"; } } else { el.style.display = "block"; } if (parseInt(el.style.opacity) === 0) { el.style.opacity = "1"; } if (typeof cb === "function") { $3.bind(cb, el); cb.call(el, arguments); } return this; }, visible: function(el, mode, cb) { if (mode === void 0) { mode = true; } el.style.visibility = mode ? "visible" : "hidden"; if (typeof cb === "function") { $3.bind(cb, el); cb.call(el, arguments); } return this; }, toggle: function(el, cb) { const func = getComputedStyle(el, null).display !== "none" ? "hide" : "show"; return $3[func](el, cb); } }); $3.fn.extend({ hide: function() { let callback; $3.each(arguments, function() { if (typeof this === "function") { callback = this; } }); return this.each(function() { $3.hide(this, callback); }); }, show: function() { let callback; $3.each(arguments, function() { if (typeof this === "function") { callback = this; } }); return this.each(function() { $3.show(this, callback); }); }, visible: function(mode, cb) { return this.each(function() { $3.visible(this, mode, cb); }); }, toggle: function(cb) { return this.each(function() { $3.toggle(this, cb); }); }, hidden: function(val, cb) { return this.each(function() { $3.hidden(this, val, cb); }); } }); $3.extend({ fx: { off: false } }); $3.fn.extend({ fadeIn: function(dur, easing, cb) { return this.each(function() { const el = this; const $el = $3(el); const visible = !(!isVisible(el) || isVisible(el) && +$el.style("opacity") === 0); if (not2(dur) && not2(easing) && not2(cb)) { cb = null; dur = $3.animation.duration; } else if (typeof dur === "function") { cb = dur; dur = $3.animation.duration; } if (typeof easing === "function") { cb = easing; easing = $3.animation.ease; } if ($3.fx.off) { dur = 0; } if (visible) { if (typeof cb === "function") { $3.bind(cb, this)(); } return this; } const originDisplay = $el.origin("display", void 0, "block"); el.style.opacity = "0"; el.style.display = originDisplay; return $3.animate({ el, draw: { opacity: 1 }, dur, ease: easing, onDone: function() { if (typeof cb === "function") { $3.bind(cb, this)(); } } }); }); }, fadeOut: function(dur, easing, cb) { return this.each(function() { const el = this; const $el = $3(el); if (not2(dur) && not2(easing) && not2(cb)) { cb = null; dur = $3.animation.duration; } else if (typeof dur === "function") { cb = dur; dur = $3.animation.duration; } if (typeof easing === "function") { cb = easing; easing = $3.animation.ease; } $el.origin("display", $el.style("display")); if (!isVisible(el)) { if (typeof cb === "function") { $3.bind(cb, this)(); } return this; } return $3.animate({ el, draw: { opacity: 0 }, dur, ease: easing, onDone: function() { this.style.display = "none"; if (typeof cb === "function") { $3.bind(cb, this)(); } } }); }); }, slideUp: function(dur, easing, cb) { return this.each(function() { const el = this; const $el = $3(el); let currHeight; if ($el.height() === 0) return; if (not2(dur) && not2(easing) && not2(cb)) { cb = null; dur = $3.animation.duration; } else if (typeof dur === "function") { cb = dur; dur = $3.animation.duration; } if (typeof easing === "function") { cb = easing; easing = $3.animation.ease; } currHeight = $el.height(); $el.origin("height", currHeight); $el.origin("display", $3(el).style("display")); $el.css({ overflow: "hidden" }); return $3.animate({ el, draw: { height: 0 }, dur, ease: easing, onDone: function() { $el.hide().removeStyleProperty("overflow, height"); if (typeof cb === "function") { $3.bind(cb, this)(); } } }); }); }, slideDown: function(dur, easing, cb) { return this.each(function() { const el = this; const $el = $3(el); let targetHeight, originDisplay; if (not2(dur) && not2(easing) && not2(cb)) { cb = null; dur = $3.animation.duration; } else if (typeof dur === "function") { cb = dur; dur = $3.animation.duration; } if (typeof easing === "function") { cb = easing; easing = $3.animation.ease; } $el.show().visible(false); targetHeight = +$el.origin("height", void 0, $el.height()); if (parseInt(targetHeight) === 0) { targetHeight = el.scrollHeight; } originDisplay = $el.origin("display", $el.style("display"), "block"); $el.height(0).visible(true); $el.css({ overflow: "hidden", display: originDisplay === "none" ? "block" : originDisplay }); return $3.animate({ el, draw: { height: targetHeight }, dur, ease: easing, onDone: function() { $3(el).removeStyleProperty("overflow, height, visibility"); if (typeof cb === "function") { $3.bind(cb, this)(); } } }); }); }, moveTo: function(x5, y4, dur, ease, cb) { const draw = { top: y4, left: x5 }; if (typeof dur === "function") { cb = dur; dur = $3.animation.duration; ease = $3.animation.ease; } if (typeof ease === "function") { cb = ease; ease = $3.animation.ease; } return this.each(function() { $3.animate({ el: this, draw, dur, ease, onDone: cb }); }); }, centerTo: function(x5, y4, dur, ease, cb) { if (typeof dur === "function") { cb = dur; dur = $3.animation.duration; ease = $3.animation.ease; } if (typeof ease === "function") { cb = ease; ease = $3.animation.ease; } return this.each(function() { const draw = { left: x5 - this.clientWidth / 2, top: y4 - this.clientHeight / 2 }; $3.animate({ el: this, draw, dur, ease, onDone: cb }); }); }, colorTo: function(color, dur, easing, cb) { const draw = { color }; if (typeof dur === "function") { cb = dur; dur = $3.animation.duration; easing = $3.animation.ease; } if (typeof easing === "function") { cb = easing; easing = $3.animation.ease; } return this.each(function() { $3.animate({ el: this, draw, dur, ease: easing, onDone: cb }); }); }, backgroundTo: function(color, dur, easing, cb) { const draw = { backgroundColor: color }; if (typeof dur === "function") { cb = dur; dur = $3.animation.duration; easing = $3.animation.ease; } if (typeof easing === "function") { cb = easing; easing = $3.animation.ease; } return this.each(function() { $3.animate({ el: this, draw, dur, ease: easing, onDone: cb }); }); }, zoomIn: function(dur, easing, cb) { const draw = { scale: [0, 1] }; if (typeof dur === "function") { cb = dur; dur = $3.animation.duration; easing = $3.animation.ease; } if (typeof easing === "function") { cb = easing; easing = $3.animation.ease; } return this.each(function() { $3.animate({ el: this, draw, dur, ease: easing, onDone: cb }); }); }, zoomOut: function(dur = 1e3, ease = "linear", cb = () => { }) { if (typeof dur === "function") { cb = dur; dur = $3.animation.duration; ease = $3.animation.ease; } if (typeof ease === "function") { cb = ease; ease = $3.animation.ease; } return this.each(function() { $3.animate({ el: this, draw: { scale: 0 }, dur, ease, onDone: cb }); }); } }); $3.extend({ scrollTop: function(val) { if (not2(val)) { return window.scrollY; } window.scrollTo(window.scrollX, val); }, scrollLeft: function(val) { if (not2(val)) { return window.scrollX; } window.scrollTo(val, window.scrollY); }, scrollTo: function(x5, y4) { window.scrollTo(x5, y4); }, scrollToElement: function(el) { $3(el).scrollTo(); } }); $3.fn.extend({ scrollTop: function(val) { if (not2(val)) { return this.length === 0 ? void 0 : this[0] === window ? scrollY : this[0].scrollTop; } return this.each(function() { if (this === window) { window.scrollTo(window.scrollX, val); return; } this.scrollTop = val; }); }, scrollLeft: function(val) { if (not2(val)) { return this.length === 0 ? void 0 : this[0] === window ? scrollX : this[0].scrollLeft; } return this.each(function() { if (this === window) { window.scrollTo(val, window.scrollY); return; } this.scrollLeft = val; }); }, scrollTo: function(relativeToViewport = false) { if (this.length === 0) { return this; } const rect = this[0].getBoundingClientRect(); const x5 = rect.left + (relativeToViewport ? 0 : window.scrollX); const y4 = rect.top + (relativeToViewport ? 0 : window.scrollY); window.scrollTo(x5, y4); return this; } }); $3.init = function(sel, ctx) { let parsed; const that = this; if (typeof sel === "string") { sel = sel.trim(); } this.uid = $3.uniqueId(); if (!sel) { return this; } if (typeof sel === "function") { return $3.ready(sel); } if (sel instanceof Element) { this.push(sel); return this; } if (sel instanceof $3) { $3.each(sel, function() { that.push(this); }); return this; } if (sel === "window" || sel === window) { this.push(window); return this; } if (sel === "document" || sel === document) { this.push(document); return this; } if (sel === "body" || sel === document.body) { this.push(document.body); return this; } if (sel === "html" || sel === document.documentElement) { this.push(document.documentElement); return this; } if (sel === "doctype" || sel === document.doctype) { this.push(document.doctype); return this; } if (sel && sel.nodeType) { this.push(sel); return this; } if (isArrayLike(sel)) { $3.each(sel, function() { $3(this).each(function() { that.push(this); }); }); return this; } if (typeof sel !== "string" && (sel.self && sel.self !== window)) { return this; } if (sel === "#" || sel === ".") { return this; } if (sel[0] === "@") { $3("[data-role]").each(function() { const roles = str2arr($3(this).attr("data-role"), ","); if (roles.indexOf(sel.slice(1)) > -1) { that.push(this); } }); } else { parsed = $3.parseHTML(sel); for (let i3 = 0; i3 < parsed.length; i3++) { if (parsed[i3].nodeType === 1) { this.push(parsed[i3]); } } } if (ctx !== void 0) { if (ctx instanceof $3) { this.each(function() { $3(ctx).append(that); }); } else if (ctx instanceof HTMLElement) { $3(ctx).append(that); } else { if (isPlainObject(ctx)) { $3.each(this, function() { for (const name2 in ctx) { if (hasProp(ctx, name2)) this.setAttribute(name2, ctx[name2]); } }); } } } return this; }; $3.init.prototype = $3.fn; // source/dom/index.js globalThis.Dom = $3; if (typeof $ === "undefined") { globalThis.$ = $3; } // node_modules/@olton/hooks/dist/hooks.js var hooks_exports = {}; __export(hooks_exports, { EVENTS: () => EVENTS, info: () => info2, useClickOutside: () => useClickOutside, useCompose: () => useCompose, useCookie: () => useCookie, useCurry: () => useCurry, useDebounce: () => useDebounce, useEvent: () => useEvent, useId: () => useId, useInterval: () => useInterval, useMediaQuery: () => useMediaQuery, useMemo: () => useMemo, usePipe: () => usePipe, useQueue: () => useQueue, useState: () => useState, useThrottle: () => useThrottle, useToggle: () => useToggle }); function useClickOutside(element2, callback) { if (!element2) return { attach: () => { }, detach: () => { } }; const handleClick = (e2) => { if (!element2.contains(e2.target)) { callback(); } }; const attach = () => document.addEventListener("click", handleClick); const detach = () => document.removeEventListener("click", handleClick); return { attach, detach }; } function useCompose(...functions) { if (!functions.every((fn) => typeof fn === "function")) { throw new Error("useCompose: All arguments should be functions"); } switch (functions.length) { // No functions provided case 0: return (x5) => x5; // One function provided case 1: return functions[0]; // Two functions provided case 2: { const [f5, g5] = functions; return (...args) => f5(g5(...args)); } // Three or more functions provided default: return function composed(...args) { let result = functions[functions.length - 1](...args); for (let i3 = functions.length - 2; i3 >= 0; i3--) { result = functions[i3](result); } return result; }; } } function useCookie(name2) { function getCookie() { const matches2 = document.cookie.match( new RegExp(`(?:^|; )${name2.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, "\\$1")}=([^;]*)`) ); return matches2 ? decodeURIComponent(matches2[1]) : null; } function setCookie(value, options = {}) { options = { path: "/", ...options }; document.cookie = `${name2}=${encodeURIComponent(value)}; ${Object.keys(options).map((key) => `${key}=${options[key]}`).join("; ")}`; } function deleteCookie() { setCookie("", { "max-age": -1 }); } return { get: getCookie, set: setCookie, delete: deleteCookie }; } function useCurry(func) { if (typeof func !== "function") { throw new Error("useCurry: \u043F\u0435\u0440\u0432\u044B\u0439 \u0430\u0440\u0433\u0443\u043C\u0435\u043D\u0442 \u0434\u043E\u043B\u0436\u0435\u043D \u0431\u044B\u0442\u044C \u0444\u0443\u043D\u043A\u0446\u0438\u0435\u0439"); } return function curried(...args) { if (args.length >= func.length) { return func.apply(this, args); } return function(...args2) { return curried.apply(this, args.concat(args2)); }; }; } function useDebounce(fn, wait, options = {}) { if (typeof fn !== "function") { throw new Error("useDebounce: \u043F\u0435\u0440\u0432\u044B\u0439 \u0430\u0440\u0433\u0443\u043C\u0435\u043D\u0442 \u0434\u043E\u043B\u0436\u0435\u043D \u0431\u044B\u0442\u044C \u0444\u0443\u043D\u043A\u0446\u0438\u0435\u0439"); } if (wait < 0) { throw new Error("useDebounce: \u0432\u0440\u0435\u043C\u044F \u043E\u0436\u0438\u0434\u0430\u043D\u0438\u044F \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043F\u043E\u043B\u043E\u0436\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u043C \u0447\u0438\u0441\u043B\u043E\u043C"); } let timer = null; let result; function debounced(...args) { const context = this; const callNow = options.immediate && !timer; if (timer !== null) { clearTimeout(timer); } timer = setTimeout(() => { timer = null; if (!options.immediate) { result = fn.apply(context, args); } }, wait); if (callNow) { result = fn.apply(context, args); } return result; } debounced.cancel = function() { if (timer !== null) { clearTimeout(timer); timer = null; } }; return debounced; } var EVENTS = /* @__PURE__ */ ((EVENTS2) => { EVENTS2["LOAD"] = "load"; EVENTS2["VIEWPORT"] = "viewport"; EVENTS2["ATTRIBUTE"] = "attribute"; EVENTS2["CHILDREN"] = "children"; EVENTS2["DATA"] = "data"; return EVENTS2; })(EVENTS || {}); var useEvent = ({ event, root, target, effect }) => { const _target = typeof target === "string" ? document.querySelector(target) : target; if (typeof effect !== "function") { throw Error("Side effect must be a function!"); } if (!_target) { throw Error("Please specify a target element!"); } switch (event) { case "load": { const observer = new MutationObserver((mutations, observer2) => { const el = document.querySelector(target); if (el !== null) { effect(el); observer2.disconnect(); } }); observer.observe(document.body, { childList: true, subtree: true }); break; } case "viewport": { const _root = root instanceof HTMLElement ? root : typeof root === "string" ? document.querySelector(root) : null; const observerOptions = { root: _root, rootMargin: "0px", threshold: 0.5 }; const observer = new IntersectionObserver((entries, observer2) => { for (const entry of entries) { if (entry.isIntersecting) { effect(_target); } } }, observerOptions); observer.observe(_target); break; } case "attribute": { const observer = new MutationObserver((mutations) => { for (const mut of mutations) { if (mut.target === _target && mut.type === "attributes") { effect(_target, mut.attributeName, _target.getAttribute(mut.attributeName)); } } }); observer.observe(_target, { attributes: true }); break; } case "children": { const observer = new MutationObserver((mutations) => { for (const mut of mutations) { if (mut.target === _target && mut.type === "childList") { effect(_target, mut.addedNodes, mut.removedNodes); } } }); observer.observe(_target, { childList: true, subtree: true }); break; } case "data": { const observer = new MutationObserver((mutations) => { for (const mut of mutations) { if (mut.target === _target && mut.type === "characterData") { effect(_target, _target.textContent); } } }); observer.observe(_target, { characterData: true }); break; } default: { if (_target instanceof HTMLElement) { _target.addEventListener(event, (e2) => { effect(_target, e2); }); } } } }; var idStore = /* @__PURE__ */ new Map(); var idCounter = 0; function normalizeKeyForId(keyStr) { return keyStr.replace(/[^a-zA-Z0-9_-]/g, "_"); } function useId(key, options = {}) { const actualKey = key ?? Symbol("id-key"); const { divider = "-", prefix = "id", forceNew = false } = options; if (!forceNew && idStore.has(actualKey)) { return idStore.get(actualKey); } const isClient = typeof document !== "undefined"; const maxAttempts = 1e3; let attempts = 0; const generateId = () => { let keyType; if (key instanceof HTMLElement) { keyType = key.tagName.toLowerCase(); } else if (typeof key === "object" && key !== null) { keyType = "object"; } else if (key !== void 0) { keyType = normalizeKeyForId(String(key)); } else { keyType = "generic"; } return `${prefix}${divider}${keyType}${divider}${idCounter++}`; }; let id = generateId(); if (isClient) { while (document.getElementById(id)) { if (attempts++ > maxAttempts) { throw new Error("useId: \u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u0433\u0435\u043D\u0435\u0440\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0443\u043D\u0438\u043A\u0430\u043B\u044C\u043D\u044B\u0439 ID \u043F\u043E\u0441\u043B\u0435 \u043C\u043D\u043E\u0433\u043E\u0447\u0438\u0441\u043B\u0435\u043D\u043D\u044B\u0445 \u043F\u043E\u043F\u044B\u0442\u043E\u043A"); } id = generateId(); } } idStore.set(actualKey, id); return id; } function useInterval(callback, delay) { let timerId = null; function start() { if (timerId) return; timerId = window.setInterval(() => callback(), delay); } function stop() { if (timerId) { window.clearInterval(timerId); timerId = null; } } return { start, stop }; } function useMediaQuery(query) { const mediaQuery = window.matchMedia(query); function getMatches() { return mediaQuery.matches; } let matches2 = getMatches(); function handleChange() { matches2 = getMatches(); } mediaQuery.addEventListener("change", handleChange); return matches2; } var useMemo = (fn, options = {}) => { const cache = /* @__PURE__ */ new Map(); const { maxSize } = options; const memoized = (...args) => { const key = JSON.stringify(args); if (cache.has(key)) { return cache.get(key); } const result = fn(...args); if (maxSize && cache.size >= maxSize) { const firstKey = cache.keys().next().value; if (typeof firstKey === "string") { cache.delete(firstKey); } } cache.set(key, result); return result; }; memoized.clearCache = () => { cache.clear(); return true; }; return memoized; }; function usePipe(...functions) { if (!functions.every((fn) => typeof fn === "function")) { throw new Error("usePipe: \u0432\u0441\u0435 \u0430\u0440\u0433\u0443\u043C\u0435\u043D\u0442\u044B \u0434\u043E\u043B\u0436\u043D\u044B \u0431\u044B\u0442\u044C \u0444\u0443\u043D\u043A\u0446\u0438\u044F\u043C\u0438"); } switch (functions.length) { case 0: return (x5) => x5; case 1: return functions[0]; case 2: { const [f5, g5] = functions; return (...args) => g5(f5(...args)); } default: return function piped(...args) { let result = functions[0](...args); for (let i3 = 1; i3 < functions.length; i3++) { result = functions[i3](result); } return result; }; } } function useQueue() { const queue = []; return { enqueue: (item) => { queue.push(item); return queue.length; }, dequeue: () => queue.shift(), peek: () => queue[0] || null, size: () => queue.length, isEmpty: () => queue.length === 0, clear: () => { queue.length = 0; } }; } var state = []; var stateIndex = -1; var StateValue = class { constructor(index) { this.index = index; } valueOf() { return state[this.index].value; } toString() { const value = state[this.index].value; return String(value); } [Symbol.toPrimitive](hint) { const value = state[this.index].value; if (hint === "number" && typeof value === "number") return value; if (hint === "string") return String(value); return value; } }; var useState = (initialState, onStateChange) => { const index = stateIndex++; if (!state[index]) { state[index] = { value: initialState }; } const stateValue = new StateValue(index); const setState = (arg) => { const old = state[index].value; const newValue = typeof arg === "function" ? arg(old) : arg; state[index].value = newValue; if (typeof onStateChange === "function") { onStateChange(newValue, old); } }; return [stateValue, setState]; }; function useThrottle(fn, wait, options = {}) { if (typeof fn !== "function") { throw new Error("useThrottle: \u043F\u0435\u0440\u0432\u044B\u0439 \u0430\u0440\u0433\u0443\u043C\u0435\u043D\u0442 \u0434\u043E\u043B\u0436\u0435\u043D \u0431\u044B\u0442\u044C \u0444\u0443\u043D\u043A\u0446\u0438\u0435\u0439"); } if (wait < 0) { throw new Error("useThrottle: \u0432\u0440\u0435\u043C\u044F \u043E\u0436\u0438\u0434\u0430\u043D\u0438\u044F \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043F\u043E\u043B\u043E\u0436\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u043C \u0447\u0438\u0441\u043B\u043E\u043C"); } let timer = null; let lastArgs = null; let lastThis = null; let result; let lastCallTime = null; const { leading = true, trailing = true } = options; function invokeFunction() { result = fn.apply(lastThis, lastArgs); lastArgs = lastThis = null; lastCallTime = Date.now(); } function throttled(...args) { const now = Date.now(); if (!lastCallTime && !leading) { lastCallTime = now; } const remainingTime = wait - (now - lastCallTime); lastArgs = args; lastThis = this; if (remainingTime <= 0 || remainingTime > wait) { if (timer) { clearTimeout(timer); timer = null; } invokeFunction(); } else if (!timer && trailing) { timer = setTimeout(() => { timer = null; if (trailing && lastArgs) { invokeFunction(); } }, remainingTime); } return result; } throttled.cancel = function() { if (timer) { clearTimeout(timer); timer = null; } lastArgs = lastThis = null; lastCallTime = null; }; return throttled; } function useToggle(initialValue = false) { let value = initialValue; return { get: () => value, toggle: () => { value = !value; return value; }, set: (newValue) => { value = newValue; return value; } }; } var version2 = "0.13.0"; var build_time2 = "07.03.2025, 23:32:05"; var info2 = () => { console.info(`%c Hooks %c v${version2} %c ${build_time2} `, "color: #ffffff; font-weight: bold; background: #5c2c05", "color: white; background: darkgreen", "color: white; background: #0080fe;"); }; // source/hooks/index.js globalThis.Hooks = hooks_exports; // node_modules/@olton/farbe/dist/farbe.js var Le = Object.defineProperty; var $e = (e2, t) => { for (var s2 in t) Le(e2, s2, { get: t[s2], enumerable: true }); }; var xe = {}; $e(xe, { Primitives: () => ue, add: () => we, brighten: () => _e, cmyk2rgb: () => de, cmyk2websafe: () => He, colorDefaultProps: () => X2, colorToString: () => he, colorType: () => S2, colorTypes: () => p, create: () => Ne, createColor: () => Me, createColorScheme: () => ke, darken: () => pe, desaturate: () => ve, equal: () => fe, expand: () => Ee, expandHexColor: () => j2, grayscale: () => ce, hex2hsv: () => Ye, hex2rgb: () => ee, hex2websafe: () => Ce, hsl2hsv: () => ie, hsl2websafe: () => Ge, hsv2hex: () => Oe, hsv2hsl: () => se, hsv2rgb: () => H2, hsv2websafe: () => Be, hueShift: () => be, isCMYK: () => T2, isColor: () => y, isDark: () => Z2, isHEX: () => Q2, isHSL: () => I2, isHSLA: () => N2, isHSV: () => K2, isLight: () => oe, isPrimitive: () => Ae, isRGB: () => U2, isRGBA: () => L2, lighten: () => V2, mix: () => g2, multiply: () => re, parse: () => J2, parseColor: () => _2, random: () => qe, randomColor: () => ae, rgb2cmyk: () => le, rgb2hex: () => te, rgb2hsv: () => k2, rgb2websafe: () => F2, rgba2websafe: () => Se, saturate: () => P, shade: () => ge, spin: () => me, test: () => ye, toCMYK: () => D2, toColor: () => x2, toHEX: () => M3, toHSL: () => W2, toHSLA: () => $4, toHSV: () => E2, toRGB: () => c2, toRGBA: () => A2, websafe: () => ne }); var d = class { constructor(t = 0, s2 = 0, n3 = 0) { this.h = t, this.s = s2, this.v = n3; } toString() { return "hsv(" + [Math.round(this.h), Math.round(this.s * 100) + "%", Math.round(this.v * 100) + "%"].join(",") + ")"; } }; var C2 = class { constructor(t = 0, s2 = 0, n3 = 0) { this.h = t, this.s = ("" + s2).includes("%") ? parseInt(s2) / 100 : s2, this.l = ("" + n3).includes("%") ? parseInt(n3) / 100 : n3; } toString() { return "hsl(" + [Math.round(this.h), Math.round(this.s * 100) + "%", Math.round(this.l * 100) + "%"].join(",") + ")"; } }; var B2 = class { constructor(t = 0, s2 = 0, n3 = 0, r2 = 0) { this.h = t, this.s = ("" + s2).includes("%") ? parseInt(s2) / 100 : s2, this.l = ("" + n3).includes("%") ? parseInt(n3) / 100 : n3, this.a = r2; } toString() { return "hsla(" + [Math.round(this.h), Math.round(this.s * 100) + "%", Math.round(this.l * 100) + "%", parseFloat(this.a).toFixed(2)].join(",") + ")"; } }; var b2 = class { constructor(t = 0, s2 = 0, n3 = 0) { this.r = t, this.g = s2, this.b = n3; } toString() { return `rgb(${this.r},${this.g},${this.b})`; } }; var w2 = class { constructor(t = 0, s2 = 0, n3 = 0, r2 = 0) { this.r = t, this.g = s2, this.b = n3, this.a = r2; } toString() { return `rgba(${this.r},${this.g},${this.b},${this.a})`; } }; var G3 = class { constructor(t = 0, s2 = 0, n3 = 0, r2 = 0) { this.c = t, this.m = s2, this.y = n3, this.k = r2; } toString() { return `cmyk(${this.c},${this.m},${this.y},${this.k})`; } }; var q2 = { aliceBlue: "#f0f8ff", antiqueWhite: "#faebd7", aqua: "#00ffff", aquamarine: "#7fffd4", azure: "#f0ffff", beige: "#f5f5dc", bisque: "#ffe4c4", black: "#000000", blanchedAlmond: "#ffebcd", blue: "#0000ff", blueViolet: "#8a2be2", brown: "#a52a2a", burlyWood: "#deb887", cadetBlue: "#5f9ea0", chartreuse: "#7fff00", chocolate: "#d2691e", coral: "#ff7f50", cornflowerBlue: "#6495ed", cornsilk: "#fff8dc", crimson: "#dc143c", cyan: "#00ffff", darkBlue: "#00008b", darkCyan: "#008b8b", darkGoldenRod: "#b8860b", darkGray: "#a9a9a9", darkGreen: "#006400", darkKhaki: "#bdb76b", darkMagenta: "#8b008b", darkOliveGreen: "#556b2f", darkOrange: "#ff8c00", darkOrchid: "#9932cc", darkRed: "#8b0000", darkSalmon: "#e9967a", darkSeaGreen: "#8fbc8f", darkSlateBlue: "#483d8b", darkSlateGray: "#2f4f4f", darkTurquoise: "#00ced1", darkViolet: "#9400d3", deepPink: "#ff1493", deepSkyBlue: "#00bfff", dimGray: "#696969", dodgerBlue: "#1e90ff", fireBrick: "#b22222", floralWhite: "#fffaf0", forestGreen: "#228b22", fuchsia: "#ff00ff", gainsboro: "#DCDCDC", ghostWhite: "#F8F8FF", gold: "#ffd700", goldenRod: "#daa520", gray: "#808080", green: "#008000", greenYellow: "#adff2f", honeyDew: "#f0fff0", hotPink: "#ff69b4", indianRed: "#cd5c5c", indigo: "#4b0082", ivory: "#fffff0", khaki: "#f0e68c", lavender: "#e6e6fa", lavenderBlush: "#fff0f5", lawnGreen: "#7cfc00", lemonChiffon: "#fffacd", lightBlue: "#add8e6", lightCoral: "#f08080", lightCyan: "#e0ffff", lightGoldenRodYellow: "#fafad2", lightGray: "#d3d3d3", lightGreen: "#90ee90", lightPink: "#ffb6c1", lightSalmon: "#ffa07a", lightSeaGreen: "#20b2aa", lightSkyBlue: "#87cefa", lightSlateGray: "#778899", lightSteelBlue: "#b0c4de", lightYellow: "#ffffe0", lime: "#00ff00", limeGreen: "#32dc32", linen: "#faf0e6", magenta: "#ff00ff", maroon: "#800000", mediumAquaMarine: "#66cdaa", mediumBlue: "#0000cd", mediumOrchid: "#ba55d3", mediumPurple: "#9370db", mediumSeaGreen: "#3cb371", mediumSlateBlue: "#7b68ee", mediumSpringGreen: "#00fa9a", mediumTurquoise: "#48d1cc", mediumVioletRed: "#c71585", midnightBlue: "#191970", mintCream: "#f5fffa", mistyRose: "#ffe4e1", moccasin: "#ffe4b5", navajoWhite: "#ffdead", navy: "#000080", oldLace: "#fdd5e6", olive: "#808000", oliveDrab: "#6b8e23", orange: "#ffa500", orangeRed: "#ff4500", orchid: "#da70d6", paleGoldenRod: "#eee8aa", paleGreen: "#98fb98", paleTurquoise: "#afeeee", paleVioletRed: "#db7093", papayaWhip: "#ffefd5", peachPuff: "#ffdab9", peru: "#cd853f", pink: "#ffc0cb", plum: "#dda0dd", powderBlue: "#b0e0e6", purple: "#800080", rebeccaPurple: "#663399", red: "#ff0000", rosyBrown: "#bc8f8f", royalBlue: "#4169e1", saddleBrown: "#8b4513", salmon: "#fa8072", sandyBrown: "#f4a460", seaGreen: "#2e8b57", seaShell: "#fff5ee", sienna: "#a0522d", silver: "#c0c0c0", slyBlue: "#87ceeb", slateBlue: "#6a5acd", slateGray: "#708090", snow: "#fffafa", springGreen: "#00ff7f", steelBlue: "#4682b4", tan: "#d2b48c", teal: "#008080", thistle: "#d8bfd8", tomato: "#ff6347", turquoise: "#40e0d0", violet: "#ee82ee", wheat: "#f5deb3", white: "#ffffff", whiteSmoke: "#f5f5f5", yellow: "#ffff00", yellowGreen: "#9acd32" }; var z2 = { lime: "#a4c400", green: "#60a917", emerald: "#008a00", blue: "#00AFF0", teal: "#00aba9", cyan: "#1ba1e2", cobalt: "#0050ef", indigo: "#6a00ff", violet: "#aa00ff", pink: "#dc4fad", magenta: "#d80073", crimson: "#a20025", red: "#CE352C", orange: "#fa6800", amber: "#f0a30a", yellow: "#fff000", brown: "#825a2c", olive: "#6d8764", steel: "#647687", mauve: "#76608a", taupe: "#87794e" }; var Ve = { color: function(e2, t = q2, s2 = void 0) { return t[e2] !== void 0 ? t[e2] : s2; }, palette: function(e2 = q2) { return Object.keys(e2); }, colors: function(e2 = q2) { return Object.values(e2); } }; var ue = { HSV: d, HSL: C2, HSLA: B2, RGB: b2, RGBA: w2, CMYK: G3 }; var p = { HEX: "hex", RGB: "rgb", RGBA: "rgba", HSV: "hsv", HSL: "hsl", HSLA: "hsla", CMYK: "cmyk", UNKNOWN: "unknown" }; var X2 = { angle: 30, algorithm: 1, step: 0.1, distance: 5, tint1: 0.8, tint2: 0.4, shade1: 0.6, shade2: 0.3, alpha: 1, baseLight: "#ffffff", baseDark: "self" }; function Pe(e2, t) { let s2; switch (t) { case "hex": s2 = e2.map(function(n3) { return M3(n3); }); break; case "rgb": s2 = e2.map(function(n3) { return c2(n3); }); break; case "rgba": s2 = e2.map(function(n3) { return A2(n3, opt.alpha); }); break; case "hsl": s2 = e2.map(function(n3) { return W2(n3); }); break; case "hsla": s2 = e2.map(function(n3) { return $4(n3, opt.alpha); }); break; case "cmyk": s2 = e2.map(function(n3) { return D2(n3); }); break; default: s2 = e2; } return s2; } function R2(e2, t, s2) { return Math.max(t, Math.min(e2, s2)); } function m2(e2, t, s2) { return e2 < t ? t : e2 > s2 ? s2 : e2; } function v2(e2, t) { for (e2 += t; e2 >= 360; ) e2 -= 360; for (; e2 < 0; ) e2 += 360; return e2; } var ye = (e2) => { let t = (a2) => /^#([A-Fa-f0-9]{3}){1,2}$/.test(a2), s2 = (a2) => /^rgb\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*\)$/.test(a2), n3 = (a2) => /^rgba\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*,\s*(0(\.\d+)?|1(\.0+)?)\s*\)$/.test(a2), r2 = (a2) => /^hsv\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*\)$/.test(a2), u4 = (a2) => /^hsl\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*\)$/.test(a2), i3 = (a2) => /^hsla\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*,\s*(0(\.\d+)?|1(\.0+)?)\s*\)$/.test(a2), o2 = (a2) => /^cmyk\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*,\s*\d+\s*\)$/.test(a2); return t(e2) || s2(e2) || r2(e2) || i3(e2) || i3(e2) || n3(e2) || u4(e2) || o2(e2); }; var Me = (e2 = "hex", t = "#000000") => { let s2; return typeof t == "string" && (s2 = _2(t)), y(s2) || (s2 = "#000000"), x2(s2, e2.toLowerCase()); }; var Ne = Me; var j2 = function(e2) { if (y(e2) && typeof e2 != "string") return e2; if (typeof e2 != "string") throw new Error("Value is not a string!"); if (e2[0] === "#" && e2.length === 4) { let t = /^#?([a-f\d])([a-f\d])([a-f\d])$/i; return "#" + e2.replace(t, (s2, n3, r2, u4) => n3 + n3 + r2 + r2 + u4 + u4); } return e2[0] === "#" ? e2 : "#" + e2; }; var Ee = j2; var Z2 = (e2) => { if (e2 = _2(e2), !y(e2)) return; let t = c2(e2); return (t.r * 299 + t.g * 587 + t.b * 114) / 1e3 < 128; }; var oe = (e2) => !Z2(e2); var K2 = (e2) => _2(e2) instanceof d; var I2 = (e2) => _2(e2) instanceof C2; var N2 = (e2) => _2(e2) instanceof B2; var U2 = (e2) => _2(e2) instanceof b2; var L2 = (e2) => _2(e2) instanceof w2; var T2 = (e2) => _2(e2) instanceof G3; var Q2 = (e2) => /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(e2); var y = (e2) => e2 ? typeof e2 == "string" ? ye(e2) : Q2(e2) || U2(e2) || L2(e2) || K2(e2) || I2(e2) || N2(e2) || T2(e2) : false; var S2 = (e2) => Q2(e2) ? p.HEX : U2(e2) ? p.RGB : L2(e2) ? p.RGBA : K2(e2) ? p.HSV : I2(e2) ? p.HSL : N2(e2) ? p.HSLA : T2(e2) ? p.CMYK : p.UNKNOWN; var fe = (e2, t) => !y(e2) || !y(t) ? false : M3(e2) === M3(t); var he = (e2) => e2.toString(); var ee = (e2) => { let t = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(j2(e2)), s2 = [parseInt(t[1], 16), parseInt(t[2], 16), parseInt(t[3], 16)]; return t ? new b2(...s2) : null; }; var te = (e2) => "#" + ((1 << 24) + (e2.r << 16) + (e2.g << 8) + e2.b).toString(16).slice(1); var k2 = (e2) => { let t = new d(), s2, n3, r2, u4 = e2.r / 255, i3 = e2.g / 255, o2 = e2.b / 255, a2 = Math.max(u4, i3, o2), f5 = Math.min(u4, i3, o2), l2 = a2 - f5; return r2 = a2, a2 === 0 ? n3 = 0 : n3 = 1 - f5 / a2, a2 === f5 ? s2 = 0 : a2 === u4 && i3 >= o2 ? s2 = 60 * ((i3 - o2) / l2) : a2 === u4 && i3 < o2 ? s2 = 60 * ((i3 - o2) / l2) + 360 : a2 === i3 ? s2 = 60 * ((o2 - u4) / l2) + 120 : a2 === o2 ? s2 = 60 * ((u4 - i3) / l2) + 240 : s2 = 0, t.h = s2, t.s = n3, t.v = r2, t; }; var H2 = (e2) => { let t, s2, n3, r2 = e2.h, u4 = e2.s * 100, i3 = e2.v * 100, o2 = Math.floor(r2 / 60), a2 = (100 - u4) * i3 / 100, f5 = (i3 - a2) * (r2 % 60 / 60), l2 = a2 + f5, h3 = i3 - f5; switch (o2) { case 0: t = i3, s2 = l2, n3 = a2; break; case 1: t = h3, s2 = i3, n3 = a2; break; case 2: t = a2, s2 = i3, n3 = l2; break; case 3: t = a2, s2 = h3, n3 = i3; break; case 4: t = l2, s2 = a2, n3 = i3; break; case 5: t = i3, s2 = a2, n3 = h3; break; } return new b2(Math.round(t * 255 / 100), Math.round(s2 * 255 / 100), Math.round(n3 * 255 / 100)); }; var Oe = (e2) => te(H2(e2)); var Ye = (e2) => k2(ee(e2)); var le = (e2) => { let t = new G3(), s2 = e2.r / 255, n3 = e2.g / 255, r2 = e2.b / 255; return t.k = Math.min(1 - s2, 1 - n3, 1 - r2), t.c = 1 - t.k === 0 ? 0 : (1 - s2 - t.k) / (1 - t.k), t.m = 1 - t.k === 0 ? 0 : (1 - n3 - t.k) / (1 - t.k), t.y = 1 - t.k === 0 ? 0 : (1 - r2 - t.k) / (1 - t.k), t.c = Math.round(t.c * 100), t.m = Math.round(t.m * 100), t.y = Math.round(t.y * 100), t.k = Math.round(t.k * 100), t; }; var de = (e2) => { let t = Math.floor(255 * (1 - e2.c / 100) * (1 - e2.k / 100)), s2 = Math.ceil(255 * (1 - e2.m / 100) * (1 - e2.k / 100)), n3 = Math.ceil(255 * (1 - e2.y / 100) * (1 - e2.k / 100)); return new b2(t, s2, n3); }; var se = (e2) => { let t, s2, n3, r2; return t = parseInt(e2.h), n3 = (2 - e2.s) * e2.v, s2 = e2.s * e2.v, n3 === 0 ? s2 = 0 : (r2 = n3 <= 1 ? n3 : 2 - n3, r2 === 0 ? s2 = 0 : s2 /= r2), n3 /= 2, Number.isNaN(s2) && (s2 = 0), Number.isNaN(n3) && (n3 = 0), new C2(t, s2, n3); }; var ie = (e2) => { let t, s2, n3, r2; return t = e2.h, r2 = e2.l * 2, s2 = e2.s * (r2 <= 1 ? r2 : 2 - r2), n3 = (r2 + s2) / 2, r2 + s2 === 0 ? s2 = 0 : s2 = 2 * s2 / (r2 + s2), new d(t, s2, n3); }; var F2 = (e2) => new b2(Math.round(e2.r / 51) * 51, Math.round(e2.g / 51) * 51, Math.round(e2.b / 51) * 51); var Se = (e2) => { let t = F2(e2); return new w2(t.r, t.g, t.b, e2.a); }; var Ce = (e2) => te(F2(ee(e2))); var Be = (e2) => k2(F2(c2(e2))); var Ge = (e2) => se(k2(F2(c2(e2)))); var He = (e2) => le(F2(de(e2))); var ne = (e2) => Q2(e2) ? Ce(e2) : U2(e2) ? F2(e2) : L2(e2) ? Se(e2) : K2(e2) ? Be(e2) : I2(e2) ? Ge(e2) : T2(e2) ? He(e2) : e2; var x2 = (e2, t = "rgb", s2 = 1) => { let n3; switch (t.toLowerCase()) { case "hex": n3 = M3(e2); break; case "rgb": n3 = c2(e2); break; case "rgba": n3 = A2(e2, s2); break; case "hsl": n3 = W2(e2); break; case "hsla": n3 = $4(e2, s2); break; case "hsv": n3 = E2(e2); break; case "cmyk": n3 = D2(e2); break; default: n3 = e2; } return n3; }; var M3 = (e2) => typeof e2 == "string" && e2[0] === "#" ? j2(e2) : te(c2(J2(e2))); var c2 = (e2) => { if (U2(e2)) return e2; if (L2(e2)) return new b2(e2.r, e2.g, e2.b); if (K2(e2)) return H2(e2); if (I2(e2) || N2(e2)) return H2(ie(e2)); if (Q2(e2)) return ee(e2); if (T2(e2)) return de(e2); throw new Error("Unknown color format!"); }; var A2 = (e2, t) => { if (L2(e2)) return typeof t < "u" && (e2.a = t), e2; let s2 = c2(e2); return new w2(s2.r, s2.g, s2.b, typeof e2.a < "u" ? e2.a : t); }; var E2 = (e2) => K2(e2) ? e2 : k2(c2(e2)); var W2 = (e2) => I2(e2) ? e2 : se(k2(c2(e2))); var $4 = (e2, t = 1) => { if (N2(e2)) return t && (e2.a = t), e2; let s2 = se(k2(c2(e2))); return s2.a = typeof e2.a < "u" ? e2.a : t, new B2(s2.h, s2.s, s2.l, s2.a); }; var D2 = (e2) => T2(e2) ? e2 : le(c2(e2)); var ce = (e2) => { let t = c2(e2), s2 = S2(e2).toLowerCase(), n3 = Math.round(t.r * 0.2125 + t.g * 0.7154 + t.b * 0.0721), r2 = new b2(n3, n3, n3); return x2(r2, s2); }; var pe = (e2, t = 10) => V2(e2, -1 * Math.abs(t)); var V2 = (e2, t = 10) => { let s2 = S2(e2).toLowerCase(), n3 = $4(e2); return n3.l += t / 100, n3.l = R2(n3.l, 0, 1), x2(n3, s2); }; var be = (e2, t, s2 = 1) => { let n3 = E2(e2), r2 = S2(e2).toLowerCase(), u4 = n3.h; for (u4 += t; u4 >= 360; ) u4 -= 360; for (; u4 < 0; ) u4 += 360; return n3.h = u4, x2(n3, r2, s2); }; var g2 = (e2, t, s2) => { s2 = s2 === 0 ? 0 : s2 || 50; let n3 = new b2(0, 0, 0), r2 = c2(e2), u4 = c2(t), i3 = s2 / 100; return n3.r = Math.round((u4.r - r2.r) * i3 + r2.r), n3.g = Math.round((u4.g - r2.g) * i3 + r2.g), n3.b = Math.round((u4.b - r2.b) * i3 + r2.b), M3(n3); }; var re = (e2, t) => { let s2 = c2(e2), n3 = c2(t), r2 = new b2(); return s2.b = Math.floor(s2.b * n3.b / 255), s2.g = Math.floor(s2.g * n3.g / 255), s2.r = Math.floor(s2.r * n3.r / 255), M3(r2); }; var ge = (e2, t) => { if (!y(e2)) throw new Error(e2 + " is not a valid color value!"); t /= 100; let s2 = S2(e2).toLowerCase(), n3 = c2(e2), r2 = t < 0 ? 0 : 255, u4 = t < 0 ? t * -1 : t, i3, o2, a2, f5; return i3 = Math.round((r2 - n3.r) * u4) + n3.r, o2 = Math.round((r2 - n3.g) * u4) + n3.g, a2 = Math.round((r2 - n3.b) * u4) + n3.b, (s2 === p.RGBA || s2 === p.HSLA) && (f5 = e2.a), x2(new b2(i3, o2, a2), s2, f5); }; var P = (e2, t) => { let s2 = S2(e2).toLowerCase(), n3 = $4(e2); return n3.s += t / 100, n3.s = R2(n3.s, 0, 1), x2(n3, s2); }; var ve = (e2, t) => P(e2, -1 * Math.abs(t)); var me = (e2, t) => { let s2, n3, r2, u4; if (!y(e2)) throw new Error(e2 + " is not a valid color value!"); return s2 = W2(e2), u4 = s2.h + t, u4 > 360 ? u4 = u4 % 360 : u4 < 0 && (u4 = 360 + u4 % 360), s2.h = u4, n3 = S2(e2).toLowerCase(), (n3 === p.RGBA || n3 === p.HSLA) && (r2 = e2.a), n3 === "hsl" ? s2 : x2(s2, n3, r2); }; var _e = (e2, t) => { let s2 = 1, n3 = S2(e2).toLowerCase(), r2 = E2(e2); return (n3 === p.RGBA || n3 === p.HSLA) && (s2 = e2.a), r2.v += t / 100, r2.v = R2(r2.v, 0, 1), x2(r2, n3, s2); }; var we = (e2, t, s2) => { let n3 = J2(e2), r2 = J2(t), u4 = A2(n3, void 0), i3 = A2(r2, void 0), o2 = new w2(), a2 = ("" + s2).toLowerCase() || "hex"; return o2.r = Math.round((u4.r + i3.r) / 2), o2.g = Math.round((u4.g + i3.g) / 2), o2.b = Math.round((u4.b + i3.b) / 2), o2.a = Math.round((u4.a + i3.a) / 2), x2(o2, s2, o2.a); }; var ke = (e2, t, s2 = p.HEX, n3) => { let r2 = Object.assign({}, X2, n3), u4, i3 = [], o2, a2, f5, l2, h3; if (o2 = E2(e2), K2(o2) === false) return console.warn("The value is a not supported color format!"), false; switch (f5 = o2.h, l2 = o2.s, h3 = o2.v, t) { case "monochromatic": case "mono": { if (r2.algorithm === 1) a2 = H2(o2), a2.r = m2(Math.round(a2.r + (255 - a2.r) * r2.tint1), 0, 255), a2.g = m2(Math.round(a2.g + (255 - a2.g) * r2.tint1), 0, 255), a2.b = m2(Math.round(a2.b + (255 - a2.b) * r2.tint1), 0, 255), i3.push(k2(a2)), a2 = H2(o2), a2.r = m2(Math.round(a2.r + (255 - a2.r) * r2.tint2), 0, 255), a2.g = m2(Math.round(a2.g + (255 - a2.g) * r2.tint2), 0, 255), a2.b = m2(Math.round(a2.b + (255 - a2.b) * r2.tint2), 0, 255), i3.push(k2(a2)), i3.push(o2), a2 = H2(o2), a2.r = m2(Math.round(a2.r * r2.shade1), 0, 255), a2.g = m2(Math.round(a2.g * r2.shade1), 0, 255), a2.b = m2(Math.round(a2.b * r2.shade1), 0, 255), i3.push(k2(a2)), a2 = H2(o2), a2.r = m2(Math.round(a2.r * r2.shade2), 0, 255), a2.g = m2(Math.round(a2.g * r2.shade2), 0, 255), a2.b = m2(Math.round(a2.b * r2.shade2), 0, 255), i3.push(k2(a2)); else if (r2.algorithm === 2) for (i3.push(o2), u4 = 1; u4 <= r2.distance; u4++) h3 = R2(h3 - r2.step, 0, 1), l2 = R2(l2 - r2.step, 0, 1), i3.push({ h: f5, s: l2, v: h3 }); else if (r2.algorithm === 3) for (i3.push(o2), u4 = 1; u4 <= r2.distance; u4++) h3 = R2(h3 - r2.step, 0, 1), i3.push({ h: f5, s: l2, v: h3 }); else h3 = R2(o2.v + r2.step * 2, 0, 1), i3.push({ h: f5, s: l2, v: h3 }), h3 = R2(o2.v + r2.step, 0, 1), i3.push({ h: f5, s: l2, v: h3 }), i3.push(o2), l2 = o2.s, h3 = o2.v, h3 = R2(o2.v - r2.step, 0, 1), i3.push({ h: f5, s: l2, v: h3 }), h3 = R2(o2.v - r2.step * 2, 0, 1), i3.push({ h: f5, s: l2, v: h3 }); break; } case "complementary": case "complement": case "comp": { i3.push(o2), f5 = v2(o2.h, 180), i3.push(new d(f5, l2, h3)); break; } case "double-complementary": case "double-complement": case "double": { i3.push(o2), f5 = v2(f5, 180), i3.push(new d(f5, l2, h3)), f5 = v2(f5, r2.angle), i3.push(new d(f5, l2, h3)), f5 = v2(f5, 180), i3.push(new d(f5, l2, h3)); break; } case "analogous": case "analog": { f5 = v2(f5, r2.angle), i3.push(new d(f5, l2, h3)), i3.push(o2), f5 = v2(o2.h, 0 - r2.angle), i3.push(new d(f5, l2, h3)); break; } case "triadic": case "triad": { for (i3.push(o2), u4 = 1; u4 < 3; u4++) f5 = v2(f5, 120), i3.push(new d(f5, l2, h3)); break; } case "tetradic": case "tetra": { i3.push(o2), f5 = v2(o2.h, 180), i3.push(new d(f5, l2, h3)), f5 = v2(o2.h, -1 * r2.angle), i3.push(new d(f5, l2, h3)), f5 = v2(f5, 180), i3.push(new d(f5, l2, h3)); break; } case "square": { for (i3.push(o2), u4 = 1; u4 < 4; u4++) f5 = v2(f5, 90), i3.push(new d(f5, l2, h3)); break; } case "split-complementary": case "split-complement": case "split": { f5 = v2(f5, 180 - r2.angle), i3.push(new d(f5, l2, h3)), i3.push(o2), f5 = v2(o2.h, 180 + r2.angle), i3.push(new d(f5, l2, h3)); break; } case "material": { var O4 = r2.baseLight, Y4 = r2.baseDark === "self" || !r2.baseDark ? re(e2, e2) : r2.baseDark; i3.push({ 50: g2(O4, e2, 10), 100: g2(O4, e2, 30), 200: g2(O4, e2, 50), 300: g2(O4, e2, 70), 400: g2(O4, e2, 85), 500: g2(O4, e2, 100), 600: g2(Y4, e2, 92), 700: g2(Y4, e2, 83), 800: g2(Y4, e2, 74), 900: g2(Y4, e2, 65), A100: V2(P(g2(Y4, e2, 15), 80), 65), A200: V2(P(g2(Y4, e2, 15), 80), 55), A400: V2(P(g2(O4, e2, 100), 55), 10), A700: V2(P(g2(Y4, e2, 83), 65), 10) }); break; } default: console.error("Unknown schema name"); } return t === "material" ? i3[0] : Pe(i3, s2); }; var Ae = (e2) => e2 instanceof d || e2 instanceof C2 || e2 instanceof B2 || e2 instanceof b2 || e2 instanceof w2 || e2 instanceof G3; var _2 = function(e2) { if (Ae(e2)) return e2; let t = ("" + e2).toLowerCase(); typeof q2[t] < "u" && (t = q2[t]), typeof z2[t] < "u" && (t = z2[t]); let s2 = t.replace(/[^\d.,%]/g, "").split(",").map((n3) => isNaN(n3) ? n3 : +n3); return t[0] === "#" ? j2(t) : t.includes("rgba") ? new w2(s2[0], s2[1], s2[2], s2[3]) : t.includes("rgb") ? new b2(s2[0], s2[1], s2[2]) : t.includes("cmyk") ? new G3(s2[0], s2[1], s2[2], s2[3]) : t.includes("hsv") ? new d(s2[0], s2[1], s2[2]) : t.includes("hsla") ? new B2(s2[0], s2[1], s2[2], s2[3]) : t.includes("hsl") ? new C2(s2[0], s2[1], s2[2]) : t; }; var J2 = _2; var ae = (e2 = "hex", t = 1) => { let s2 = (o2, a2) => Math.floor(o2 + Math.random() * (a2 + 1 - o2)), n3, r2, u4, i3; return r2 = s2(0, 255), u4 = s2(0, 255), i3 = s2(0, 255), n3 = "#" + ((1 << 24) + (r2 << 16) + (u4 << 8) + i3).toString(16).slice(1), e2 === "hex" ? n3 : x2(n3, e2, t); }; var qe = ae; var Re = class { _setValue(t) { t || (t = "#000000"), typeof t == "string" && (t = _2(t)), t && y(t) ? this._value = t : this._value = void 0; } _setOptions(t) { this._options = Object.assign({}, X2, t); } constructor(t = "#000000", s2 = null) { this._setValue(t), this._setOptions(s2); } get options() { return this._options; } set options(t) { this._setOptions(t); } get value() { return this._value ? this._value : void 0; } set value(t) { this._setValue(t); } toRGB() { if (this._value) return this._value = c2(this._value), this; } get rgb() { return this._value ? c2(this._value) : void 0; } toRGBA(t) { if (this._value) return L2(this._value) ? t && (this._value = A2(this._value, t)) : this._value = A2(this._value, t || X2.alpha), this; } get rgba() { return this._value ? L2(this._value) ? this._value : A2(this._value, this._options.alpha) : void 0; } toHEX() { if (this._value) return this._value = M3(this._value), this; } get hex() { return this._value ? M3(this._value) : void 0; } toHSV() { if (this._value) return this._value = E2(this._value), this; } get hsv() { return this._value ? E2(this._value) : void 0; } toHSL() { if (this._value) return this._value = W2(this._value), this; } get hsl() { return this._value ? W2(this._value) : void 0; } toHSLA(t) { if (this._value) return N2(this._value) ? t && (this._value = $4(this._value, t)) : this._value = $4(this._value, t), this; } get hsla() { return this._value ? N2(this._value) ? this._value : $4(this._value, this._options.alpha) : void 0; } toCMYK() { if (this._value) return this._value = D2(this._value), this; } get cmyk() { return this._value ? D2(this._value) : void 0; } toWebsafe() { if (this._value) return this._value = ne(this._value), this; } get websafe() { return this._value ? ne(this._value) : void 0; } toString() { return this._value ? he(this._value) : void 0; } darken(t = 10) { if (this._value) return this._value = pe(this._value, t), this; } lighten(t = 10) { if (this._value) return this._value = V2(this._value, t), this; } isDark() { return this._value ? Z2(this._value) : void 0; } isLight() { return this._value ? oe(this._value) : void 0; } hueShift(t) { if (this._value) return this._value = be(this._value, t), this; } grayscale() { if (!(!this._value || this.type === p.UNKNOWN)) return this._value = ce(this._value, ("" + this.type).toLowerCase()), this; } get type() { return S2(this._value); } getScheme(t, s2, n3) { return this._value ? ke(this._value, t, s2, n3) : void 0; } equal(t) { return fe(this._value, t); } random(t, s2) { this._value = ae(t, s2); } channel(t, s2) { let n3 = `${this.type}`.toUpperCase(); if (["red", "green", "blue"].includes(t)) { this.toRGB(); let r2 = { red: "r", green: "g", blue: "b" }; this._value[r2[t]] = s2, this[`to${n3}`](); } if (t === "alpha" && this._value.a && (this._value.a = s2), ["hue", "saturation", "value"].includes(t)) { this.toHSV(); let r2 = { hue: "h", saturation: "s", value: "v" }; this._value[r2[t]] = s2, this[`to${n3}`](); } if (["lightness"].includes(t) && (this.toHSL(), this._value.l = s2, this[`to${n3}`]()), ["cyan", "magenta", "yellow", "black"].includes(t)) { this.toCMYK(); let r2 = { cyan: "c", magenta: "m", yellow: "y", black: "k" }; this._value[r2[t]] = s2, this[`to${n3}`](); } return this; } add(t) { this._setValue(we(this._value, t)); } mix(t, s2) { this._setValue(g2(this._value, t, s2)); } multiply(t) { this._setValue(re(this._value, t)); } shade(t) { this._setValue(ge(this._value, t)); } saturate(t) { this._setValue(P(this._value, t)); } desaturate(t) { this._setValue(ve(this._value, t)); } spin(t) { this._setValue(me(this._value, t)); } brighten(t) { this._setValue(_e(this._value, t)); } }; var ut2 = { ...ue }; var Ke = "1.0.4"; var Fe = "11.08.2024, 23:47:03"; var ot2 = () => { console.info(`%c Farbe %c v${Ke} %c ${Fe} `, "color: #ffffff; font-weight: bold; background: #ff00ff", "color: white; background: darkgreen", "color: white; background: #0080fe;"); }; // source/farbe/index.js globalThis.Farbe = Re; globalThis.farbe = (c5) => new Re(c5); globalThis.Farbe.Routines = xe; globalThis.Farbe.Palette = Ve; globalThis.Farbe.StandardColors = q2; globalThis.Farbe.MetroColors = z2; globalThis.Farbe.Primitives = ut2; globalThis.Farbe.info = ot2; // node_modules/@olton/html/dist/html.js var br = Object.defineProperty; var wr2 = (t, o2) => { for (var r2 in o2) br(t, r2, { get: o2[r2], enumerable: true }); }; function te2(t) { return t.replace(/([A-Z])/g, function(o2) { return "-" + o2.toLowerCase(); }); } function pe2(t = []) { return Array.isArray(t) ? t.join(" ") : t.toString(); } var me2 = ["opacity", "zIndex", "order", "zoom"]; function ee2(t = {}) { return typeof t == "string" ? t : Object.keys(t).map((o2) => { let r2 = te2(o2), a2 = t[o2]; return !me2.includes(r2) && !isNaN(a2) && (a2 += "px"), `${r2}: ${a2}`; }).join(";"); } var ce2 = ["accesskey", "autocapitalize", "autofocus", "contenteditable", "dir", "draggable", "enterkeyhint", "hidden", "inert", "inputmode", "is", "itemid", "itemprop", "itemref", "itemscope", "itemtype", "lang", "nonce", "popover", "spellcheck", "style", "tabindex", "title", "translate", "writingsuggestions"]; var le2 = (t) => { let o2, r2, a2 = [], s2, l2, re3 = /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i; if (typeof t == "string") { if (t = t.trim(), s2 = document.implementation.createHTMLDocument(""), o2 = s2.createElement("base"), o2.href = document.location.href, s2.head.appendChild(o2), l2 = s2.body, r2 = re3.exec(t), r2) return document.createElement(r2[1]); l2.innerHTML = t; for (let se3 = 0; se3 < l2.childNodes.length; se3++) a2.push(l2.childNodes[se3]); return a2[0]; } }; var fe2 = ["onauxclick", "onbeforeinput", "onbeforematch", "onbeforetoggle", "onblur", "oncancel", "oncanplay", "oncanplaythrough", "onchange", "onclick", "onclose", "oncontextlost", "oncontextmenu", "oncontextrestored", "oncopy", "oncuechange", "oncut", "ondblclick", "ondrag", "ondragend", "ondragenter", "ondragleave", "ondragover", "ondragstart", "ondrop", "ondurationchange", "onemptied", "onended", "onerror", "onfocus", "onformdata", "oninput", "oninvalid", "onkeydown", "onkeypress", "onkeyup", "onload", "onloadeddata", "onloadedmetadata", "onloadstart", "onmousedown", "onmouseenter", "onmouseleave", "onmousemove", "onmouseout", "onmouseover", "onmouseup", "onpaste", "onpause", "onplay", "onplaying", "onprogress", "onratechange", "onreset", "onresize", "onscroll", "onscrollend", "onsecuritypolicyviolation", "onseeked", "onseeking", "onselect", "onslotchange", "onstalled", "onsubmit", "onsuspend", "ontimeupdate", "ontoggle", "onvolumechange", "onwaiting", "onwheel"]; var p2 = class { constructor(o2 = {}) { this.options = o2, this.tag = "div"; } selfAttributes() { return []; } get attributes() { return this.getAttributes().join(" "); } getAttributes() { let o2 = [], r2 = ["hidden", "disabled", "required", "readonly", "selected", "open", "multiply", "default"], a2 = ["className", "style", "data", "tag", "events"]; for (let s2 in this.options) if (!a2.includes(s2)) { if (r2.includes(s2) && this.options[s2] === true) { o2.push(s2); continue; } (this.selfAttributes().includes(s2) && !o2.includes(s2) || ce2.includes(s2)) && o2.push(`${s2}="${this.options[s2]}"`); } return this.classes && o2.push(`class="${this.classes}"`), this.styles && o2.push(`style="${this.styles}"`), this.dataSet && o2.push(this.dataSet), this.aria && o2.push(this.aria), o2; } draw() { return this.template(); } get dataSet() { let { data: o2 = {} } = this.options, r2 = []; for (let a2 in o2) r2.push(`data-${te2(a2)}="${o2[a2]}"`); return r2.join(" "); } get aria() { let { aria: o2 = {} } = this.options, r2 = []; for (let a2 in o2) r2.push(`aria-${a2.toLowerCase()}="${o2[a2]}"`); return r2.join(" "); } get events() { let { events: o2 = {}, control: r2 = true } = this.options, a2 = []; for (let s2 in o2) r2 && !fe2.includes(s2) && console.info(`Event ${s2} for element ${this.tag} not specified in HTML specification`), a2.push(`${s2.toLowerCase()}="${o2[s2]}"`); return a2.join(" "); } get classes() { return pe2(this.options.class); } get styles() { return ee2(this.options.style); } template() { return ""; } toString() { return this.draw(); } toElement() { return le2(this.draw()); } }; var b3 = (t) => { if (Array.isArray(t)) return t.map(b3).join(` `); if (typeof t == "string" || typeof t == "number" || typeof t == "boolean") return t; if (t.draw) return t.draw(); throw new Error("Unknown element! " + t); }; var e = class extends p2 { constructor(...o2) { let r2 = {}, a2 = []; for (let s2 of o2) typeof s2 == "object" && !(s2 instanceof p2) ? r2 = s2 : a2.push(s2); super(r2), this.children = a2; } template(o2) { let r2 = this.options.tag ? this.options.tag : this.tag; return ` <${r2} ${this.attributes} ${this.events}>${o2}${r2}> `; } draw() { return this.template(this.children.map(b3).join("")); } }; var n2 = class extends p2 { constructor(o2 = {}) { super(o2), this.options = o2; } template() { return ` <${this.options.tag ? this.options.tag : this.tag} ${this.attributes} ${this.events}/> `; } }; var Tr = (t = [], o2 = document.body, r2 = {}) => { let a2, s2, { clear: l2 = true, where: re3 = "beforeend" } = r2; s2 = typeof o2 == "string" ? document.querySelector(o2) : o2, s2 instanceof HTMLElement || (s2 = document.body), l2 && (s2.innerHTML = ""), Array.isArray(t) || (t = [t]), a2 = t.map(b3).join(""), s2.insertAdjacentHTML(re3, a2); }; var oe2 = (t = "", o2) => { let r2 = document.createElement("style"); return o2 !== void 0 && r2.setAttribute("media", o2), r2.appendChild(document.createTextNode(t)), document.head.appendChild(r2), r2; }; var ne2 = (t) => oe2(t).sheet; var ae2 = (t, o2, r2) => { t.insertRule(o2 + "{" + r2 + "}"); }; var de2 = (t, o2) => { if (typeof t == "string") { oe2(t, o2); return; } let r2 = ne2(o2); for (let a2 in t) ae2(r2, a2, ee2(t[a2])); }; var ge2 = async (t, o2) => { let r2 = await fetch(t, o2), a2, s2; if (!r2.ok) throw new Error("HTTP error: " + r2.status); a2 = await r2.text(), s2 = document.createElement("style"), s2.appendChild(document.createTextNode(a2)), document.body.appendChild(s2); }; var xe2 = async (t, o2) => { let r2 = await fetch(t, o2), a2, s2; if (!r2.ok) throw new Error("HTTP error: " + r2.status); a2 = await r2.text(), s2 = document.createElement("script"), s2.appendChild(document.createTextNode(a2)), document.body.appendChild(s2); }; var Yt2 = {}; wr2(Yt2, { Abbr: () => N3, Address: () => _3, Anchor: () => f2, Area: () => R3, Article: () => q3, Aside: () => H3, AudioTag: () => I3, Base: () => y2, Bdi: () => O2, Bdo: () => U3, Blockquote: () => V3, Body: () => v3, Bold: () => D3, Br: () => L3, Button: () => Z3, Canvas: () => F3, Caption: () => J3, Cite: () => X3, Code: () => Y2, Col: () => K3, Colgroup: () => Q3, Data: () => Kt2, Dd: () => ot3, Details: () => rt2, Dfn: () => nt2, Dialog: () => Wt2, Div: () => at2, Dl: () => tt2, Dt: () => et2, Em: () => it2, Embed: () => mt2, Fieldset: () => lt2, FigCaption: () => gt2, Figure: () => dt2, Footer: () => P2, Form: () => xt2, Frame: () => ht2, Frameset: () => ut3, Head: () => T3, Header: () => M4, Heading: () => j3, Hr: () => E3, Html: () => w3, IFrame: () => wt2, Img: () => S3, Input: () => $5, Ins: () => Tt2, Ital: () => g3, Kbd: () => yt2, Label: () => At2, Legend: () => ft2, Link: () => A3, List: () => m3, ListItem: () => x3, Main: () => Ot2, Map: () => B3, Mark: () => vt2, Meta: () => Ut2, Nav: () => z3, NoEmbed: () => ct2, NoFrames: () => bt2, NoScript: () => kt2, Option: () => Lt2, OptionGroup: () => $t2, Output: () => Et2, Paragraph: () => jt2, Picture: () => Qt2, Pre: () => Ct2, Quoted: () => u2, Rp: () => Jt2, Rt: () => Gt2, Ruby: () => Ft2, Script: () => Nt, Section: () => C3, Select: () => St2, Slot: () => Xt2, Small: () => qt2, Source: () => zt2, Span: () => k3, Strike: () => h, Strong: () => pt2, Sub: () => Ht2, Summary: () => st2, Sup: () => Mt2, Table: () => G4, TableCell: () => d2, TableRow: () => W3, TableSection: () => c3, Template: () => Zt2, Textarea: () => Pt2, Time: () => _t2, Title: () => Vt2, Track: () => Bt2, Var: () => Rt2, VideoTag: () => It2, Wbr: () => Dt2, a: () => He2, abbr: () => Me2, address: () => De, anchor: () => ze, area: () => Ue, article: () => Pe2, aside: () => Be2, audio: () => Ve2, b: () => Ze, base: () => be2, bdi: () => Fe2, bdo: () => Ge2, blockquote: () => Je, body: () => Te, br: () => ke2, button: () => Ke2, canvas: () => Qe, caption: () => Xe, cite: () => io, code: () => po, col: () => Ye2, colgroup: () => to, data: () => gr2, dd: () => lo, details: () => fo, dfn: () => xo, dialog: () => ur2, div: () => uo, dl: () => mo, dt: () => co, em: () => ho, embed: () => yo, fieldset: () => vo, figcaption: () => $o, figure: () => So, footer: () => Ie, form: () => Lo, frame: () => jo, frameset: () => Eo, h1: () => $e2, h2: () => Le2, h3: () => Ee2, h4: () => je, h5: () => Ce2, h6: () => Ne2, head: () => he2, header: () => Re2, hr: () => Se2, html: () => ue2, i: () => wo, iframe: () => No, img: () => Ae2, input: () => ve2, ins: () => qo, ital: () => bo, kbd: () => zo, label: () => Ho, legend: () => ko, li: () => _o, link: () => we2, main: () => ir2, map: () => Oe2, mark: () => Bo, meta: () => pr2, nav: () => _e2, noembed: () => Ao, noframes: () => Co, noscript: () => Ro, ol: () => Po, optgroup: () => Do, option: () => Oo, output: () => Uo, p: () => Vo, picture: () => xr2, pre: () => Zo, q: () => Fo, quoted: () => Go, rp: () => dr2, rt: () => fr2, ruby: () => lr2, s: () => Ko, script: () => Qo, section: () => qe2, select: () => Io, slot: () => hr2, small: () => Wo, source: () => Xo, span: () => ye2, strike: () => Jo, strong: () => To, sub: () => Yo, summary: () => go, sup: () => tr2, table: () => We, tbody: () => eo, td: () => ao, template: () => cr2, textarea: () => er2, tfoot: () => ro, th: () => no, thead: () => oo, time: () => or2, title: () => mr2, tr: () => so, track: () => rr2, ul: () => Mo, variable: () => sr2, video: () => nr2, wbr: () => ar2 }); var w3 = class extends e { tag = "html"; selfAttributes() { return ["lang"]; } }; var ue2 = (...t) => new w3(...t); var T3 = class extends e { tag = "head"; }; var he2 = (...t) => new T3(...t); var y2 = class extends n2 { tag = "base"; selfAttributes() { return ["href", "target"]; } }; var be2 = (t) => new y2(t); var A3 = class extends n2 { tag = "link"; selfAttributes() { return ["href", "crossorigin", "rel", "media", "integrity", "hreflang", "type", "referrerpolicy", "sizes", "imagesrcset", "imagesizes", "as", "blocking", "color", "disabled", "fetchpriority"]; } }; var we2 = (t) => new A3(t); var v3 = class extends e { tag = "body"; }; var Te = (...t) => new v3(...t); var k3 = class extends e { tag = "span"; }; var ye2 = (...t) => new k3(...t); var S3 = class extends n2 { tag = "img"; selfAttributes() { return ["align", "alt", "border", "height", "hspace", "ismap", "longdesc", "lowsrc", "src", "vspace", "width", "usemap"]; } }; var Ae2 = (t = "", o2 = "", r2 = {}) => new S3({ ...r2, src: t, alt: o2 }); var $5 = class extends n2 { tag = "input"; selfAttributes() { return ["accept", "align", "alt", "autocomplete", "autofocus", "border", "checked", "disabled", "form", "formaction", "formenctype", "formmethod", "formnovalidate", "formtarget", "list", "max", "maxlength", "min", "multiple", "name", "pattern", "placeholder", "size", "src", "step", "type", "value"]; } }; var ve2 = (t = {}) => new $5(t); var L3 = class extends n2 { tag = "br"; selfAttributes() { return ["clear"]; } }; var ke2 = (t) => new L3(t); var E3 = class extends n2 { tag = "hr"; }; var Se2 = (t) => new E3(t); var j3 = class extends e { constructor(o2 = "h1", ...r2) { super(...r2), this.tag = o2; } }; var i = (t = "h1", ...o2) => new j3(t, ...o2); var $e2 = (...t) => i("h1", ...t); var Le2 = (...t) => i("h2", ...t); var Ee2 = (...t) => i("h3", ...t); var je = (...t) => i("h4", ...t); var Ce2 = (...t) => i("h5", ...t); var Ne2 = (...t) => i("h6", ...t); var C3 = class extends e { tag = "section"; }; var qe2 = (...t) => new C3(...t); var f2 = class extends e { tag = "a"; selfAttributes() { return ["coords", "download", "hreflang", "name", "rel", "rev", "shape", "target", "type", "href"]; } }; var ze = (...t) => new f2(...t); var He2 = (...t) => new f2(...t); var N3 = class extends e { tag = "abbr"; }; var Me2 = (...t) => new N3(...t); var q3 = class extends e { tag = "article"; }; var Pe2 = (...t) => new q3(...t); var z3 = class extends e { tag = "nav"; }; var _e2 = (...t) => new z3(...t); var H3 = class extends e { tag = "aside"; }; var Be2 = (...t) => new H3(...t); var M4 = class extends e { tag = "header"; }; var Re2 = (...t) => new M4(...t); var P2 = class extends e { tag = "footer"; }; var Ie = (...t) => new P2(...t); var _3 = class extends e { tag = "address"; }; var De = (...t) => new _3(...t); var B3 = class extends e { tag = "map"; selfAttributes() { return ["name"]; } }; var Oe2 = (...t) => new B3(...t); var R3 = class extends n2 { tag = "area"; selfAttributes() { return ["alt", "coords", "hreflang", "nohref", "shape", "target", "type", "href"]; } }; var Ue = (t = {}) => new R3(t); var I3 = class extends e { tag = "audio"; selfAttributes() { return ["autoplay", "controls", "loop", "preload", "src"]; } }; var Ve2 = (...t) => new I3(...t); var D3 = class extends e { tag = "b"; }; var Ze = (...t) => new D3(...t); var O2 = class extends e { tag = "bdi"; }; var Fe2 = (...t) => new O2(...t); var U3 = class extends e { tag = "bdo"; }; var Ge2 = (...t) => new U3(...t); var V3 = class extends e { tag = "blockquote"; selfAttributes() { return ["cite"]; } }; var Je = (...t) => new V3(...t); var Z3 = class extends e { tag = "button"; selfAttributes() { return ["autofocus", "form", "formaction", "formenctype", "formmethod", "formnovalidate", "formtarget", "name", "type", "value"]; } }; var Ke2 = (...t) => new Z3(...t); var F3 = class extends e { tag = "canvas"; selfAttributes() { return ["width", "height"]; } }; var Qe = (...t) => new F3(...t); var G4 = class extends e { tag = "table"; selfAttributes() { return ["align", "background", "bgcolor", "border", "bordercolor", "cellpadding", "cellspacing", "cols", "frame", "height", "rules", "summary", "width"]; } }; var We = (...t) => new G4(...t); var J3 = class extends e { tag = "caption"; selfAttributes() { return ["align", "valign"]; } }; var Xe = (...t) => new J3(...t); var K3 = class extends n2 { tag = "col"; selfAttributes() { return ["align", "valign", "char", "charoff", "span", "width"]; } }; var Ye2 = (t) => new K3(t); var Q3 = class extends n2 { tag = "colgroup"; selfAttributes() { return ["align", "valign", "char", "charoff", "span", "width"]; } }; var to = (t) => new Q3(t); var c3 = class extends e { constructor(o2 = "tbody", ...r2) { super(...r2), this.tag = o2; } selfAttributes() { return ["align", "valign", "char", "charoff", "bgcolor"]; } }; var eo = (...t) => new c3("tbody", ...t); var oo = (...t) => new c3("thead", ...t); var ro = (...t) => new c3("tfoot", ...t); var W3 = class extends e { tag = "tr"; selfAttributes() { return ["align", "bgcolor", "bordercolor", "char", "charoff", "valign"]; } }; var so = (...t) => new W3(...t); var d2 = class extends e { constructor(o2 = "td", ...r2) { super(...r2), this.tag = o2; } selfAttributes() { return ["abbr", "align", "axis", "background", "bgcolor", "bordercolor", "char", "charoff", "colspan", "headers", "height", "nowrap", "rowspan", "scope", "valign", "width"]; } }; var no = (...t) => new d2("th", ...t); var ao = (...t) => new d2("td", ...t); var X3 = class extends e { tag = "cite"; }; var io = (...t) => new X3(...t); var Y2 = class extends e { tag = "code"; }; var po = (...t) => new Y2(...t); var tt2 = class extends e { tag = "dl"; }; var et2 = class extends e { tag = "dt"; }; var ot3 = class extends e { tag = "dd"; }; var mo = (...t) => new tt2(...t); var co = (...t) => new et2(...t); var lo = (...t) => new ot3(...t); var rt2 = class extends e { tag = "details"; }; var fo = (...t) => new rt2(...t); var st2 = class extends e { tag = "summary"; }; var go = (...t) => new st2(...t); var nt2 = class extends e { tag = "dfn"; }; var xo = (...t) => new nt2(...t); var at2 = class extends e { tag = "div"; selfAttributes() { return ["align", "title"]; } }; var uo = (...t) => new at2(...t); var it2 = class extends e { tag = "em"; }; var ho = (...t) => new it2(...t); var g3 = class extends e { tag = "i"; }; var bo = (...t) => new g3(...t); var wo = (...t) => new g3(...t); var pt2 = class extends e { tag = "strong"; }; var To = (...t) => new pt2(...t); var mt2 = class extends e { tag = "embed"; selfAttributes() { return ["align", "height", "hspace", "pluginspace", "src", "type", "vspace", "width"]; } }; var yo = (...t) => new mt2(...t); var ct2 = class extends e { tag = "noembed"; }; var Ao = (...t) => new ct2(...t); var lt2 = class extends e { tag = "fieldset"; selfAttributes() { return ["form", "title"]; } }; var vo = (...t) => new lt2(...t); var ft2 = class extends e { tag = "legend"; selfAttributes() { return ["align", "title"]; } }; var ko = (...t) => new ft2(...t); var dt2 = class extends e { tag = "figure"; }; var So = (...t) => new dt2(...t); var gt2 = class extends e { tag = "figcaption"; }; var $o = (...t) => new gt2(...t); var xt2 = class extends e { tag = "form"; selfAttributes() { return ["accept-charset", "action", "autocomplete", "enctype", "method", "name", "novalidate", "target"]; } }; var Lo = (...t) => new xt2(...t); var ut3 = class extends e { tag = "frameset"; selfAttributes() { return ["border", "bordercolor", "cols", "frameborder", "framespacing", "rows"]; } }; var Eo = (...t) => new ut3(...t); var ht2 = class extends n2 { tag = "frame"; selfAttributes() { return ["bordercolor", "frameborder", "noresize", "name", "src", "scrolling"]; } }; var jo = (t = {}) => new ht2(t); var bt2 = class extends e { tag = "noframes"; }; var Co = (...t) => new bt2(...t); var wt2 = class extends e { tag = "iframe"; selfAttributes() { return ["align", "allowtransparency", "frameborder", "height", "hspace", "marginheight", "marginwidth", "name", "sandbox", "scrolling", "seamless", "src", "srcdoc", "vspace", "width"]; } }; var No = (...t) => new wt2(...t); var Tt2 = class extends e { tag = "ins"; selfAttributes() { return ["cite", "datetime"]; } }; var qo = (...t) => new Tt2(...t); var yt2 = class extends e { tag = "kbd"; }; var zo = (...t) => new yt2(...t); var At2 = class extends e { tag = "label"; selfAttributes() { return ["for"]; } }; var Ho = (...t) => new At2(...t); var m3 = class extends e { constructor(o2 = "ul", ...r2) { super(...r2), this.tag = o2; } selfAttributes() { return this.tag === "ul" ? ["type"] : ["type", "reserved", "start"]; } }; var x3 = class extends e { tag = "li"; selfAttributes() { return ["type", "value"]; } }; var Mo = (...t) => new m3("ul", ...t); var Po = (...t) => new m3("ol", ...t); var _o = (...t) => new x3(...t); var vt2 = class extends e { tag = "mark"; }; var Bo = (...t) => new vt2(...t); var kt2 = class extends e { tag = "noscript"; }; var Ro = (...t) => new kt2(...t); var St2 = class extends e { tag = "select"; selfAttributes() { return ["autofocus", "form", "name", "size"]; } }; var Io = (...t) => new St2(...t); var $t2 = class extends e { tag = "optgroup"; selfAttributes() { return ["label"]; } }; var Do = (...t) => new $t2(...t); var Lt2 = class extends e { tag = "option"; selfAttributes() { return ["label", "value"]; } }; var Oo = (...t) => new Lt2(...t); var Et2 = class extends e { tag = "output"; selfAttributes() { return ["for", "form", "name"]; } }; var Uo = (...t) => new Et2(...t); var jt2 = class extends e { tag = "p"; selfAttributes() { return ["align"]; } }; var Vo = (...t) => new jt2(...t); var Ct2 = class extends e { tag = "pre"; }; var Zo = (...t) => new Ct2(...t); var u2 = class extends e { tag = "q"; selfAttributes() { return ["cite"]; } }; var Fo = (...t) => new u2(...t); var Go = (...t) => new u2(...t); var h = class extends e { tag = "strike"; }; var Jo = (...t) => new h(...t); var Ko = (...t) => new h(...t); var Nt = class extends e { tag = "script"; selfAttributes() { return ["async", "defer", "language", "src", "type"]; } }; var Qo = (...t) => new Nt(...t); var qt2 = class extends e { tag = "small"; }; var Wo = (...t) => new qt2(...t); var zt2 = class extends n2 { tag = "source"; selfAttributes() { return ["media", "src", "type"]; } }; var Xo = (t = {}) => new zt2(t); var Ht2 = class extends e { tag = "sub"; }; var Yo = (...t) => new Ht2(...t); var Mt2 = class extends e { tag = "sup"; }; var tr2 = (...t) => new Mt2(...t); var Pt2 = class extends e { tag = "textarea"; selfAttributes() { return ["autofocus", "cols", "form", "maxlength", "name", "placeholder", "rows", "wrap"]; } }; var er2 = (...t) => new Pt2(...t); var _t2 = class extends e { tag = "time"; selfAttributes() { return ["datetime", "pubdate"]; } }; var or2 = (...t) => new _t2(...t); var Bt2 = class extends n2 { tag = "track"; selfAttributes() { return ["kind", "src", "srclang", "label"]; } }; var rr2 = (t = {}) => new Bt2(t); var Rt2 = class extends e { tag = "var"; }; var sr2 = (...t) => new Rt2(...t); var It2 = class extends e { tag = "video"; selfAttributes() { return ["autoplay", "controls", "height", "loop", "loop", "poster", "preload", "src", "width"]; } }; var nr2 = (...t) => new It2(...t); var Dt2 = class extends n2 { tag = "wbr"; }; var ar2 = (t) => new Dt2(t); var Ot2 = class extends e { tag = "main"; }; var ir2 = (...t) => new Ot2(...t); var Ut2 = class extends n2 { tag = "meta"; selfAttributes() { return ["content", "name", "http-equiv", "charset"]; } }; var pr2 = (t) => new Ut2(t); var Vt2 = class extends e { tag = "title"; }; var mr2 = (t) => new Vt2(t); var Zt2 = class extends e { tag = "template"; selfAttributes() { return ["shadowrootmode", "shadowrootdelegatesfocus", "shadowrootclonable", "shadowrootserializable"]; } }; var cr2 = (...t) => new Zt2(...t); var Ft2 = class extends e { tag = "ruby"; }; var Gt2 = class extends n2 { tag = "rt"; }; var Jt2 = class extends n2 { tag = "rp"; }; var lr2 = (...t) => new Ft2(...t); var fr2 = (t) => new Gt2(t); var dr2 = (t) => new Jt2(t); var Kt2 = class extends e { tag = "data"; }; var gr2 = (...t) => new Kt2(...t); var Qt2 = class extends e { tag = "picture"; }; var xr2 = (...t) => new Qt2(...t); var Wt2 = class extends e { tag = "dialog"; selfAttributes() { return ["open"]; } }; var ur2 = (...t) => new Wt2(...t); var Xt2 = class extends e { tag = "slot"; selfAttributes() { return ["name"]; } }; var hr2 = (...t) => new Xt2(...t); var ie2 = {}; var yr2 = "0.15.1"; var Ar2 = "18.05.2025, 14:41:46"; var am = () => { console.info(`%c Html.js %c v${yr2} %c ${Ar2} `, "color: #ffffff; font-weight: bold; background: #708238", "color: white; background: darkgreen", "color: white; background: #0080fe;"); }; var vr2 = (t = globalThis) => { for (let o2 in Yt2) globalThis[o2] && (ie2[o2] = globalThis[o2]), t[o2] = Yt2[o2]; }; var kr = (t = globalThis) => { for (let o2 in ie2) t[o2] = ie2[o2]; }; var im = { BaseElement: p2, Tag: e, SingleTag: n2, ...Yt2, extract: vr2, restore: kr }; var pm = { addStyle: de2, addCssRule: ae2, createStyleSheet: ne2, createStyleElement: oe2 }; // source/html/index.js globalThis.HTML = { cssLoader: ge2, jsLoader: xe2, render: Tr, ...im, ...pm, info: am }; // node_modules/@olton/guardian/dist/guardian.js var guardian_exports = {}; __export(guardian_exports, { americanExpress: () => fe3, array: () => pr3, base64: () => gr3, between: () => ur3, bigint: () => j4, boolean: () => _r2, bytes: () => Ee3, color: () => Wr, compose: () => I4, contains: () => be3, creditCard: () => ce3, date: () => H4, digits: () => _e3, diners: () => ie3, discover: () => me3, domain: () => Tr2, email: () => nr3, endsWith: () => O3, equal: () => Ue2, finite: () => Er2, float: () => Se3, func: () => W4, great: () => Ne3, greatOrEqual: () => Ce3, hexColor: () => Yr, hslColor: () => Zr, imei: () => br2, info: () => qe3, integer: () => J4, ip: () => Mr, ipv4: () => yr3, ipv6: () => Nr, jcb: () => Ae3, length: () => Rr, less: () => ve3, lessOrEqual: () => Oe3, mastercard: () => ae3, max: () => tr3, maxLength: () => xr3, min: () => rr3, minLength: () => kr2, notNull: () => ge3, notNumber: () => hr3, number: () => fr3, object: () => ir3, parse: () => A4, pattern: () => he3, pipe: () => y3, required: () => sr3, rgbColor: () => Jr, safeInteger: () => Q4, safeParse: () => D4, similar: () => Me3, startsWith: () => C4, string: () => i2, symbol: () => q4, type: () => xe3, unionPay: () => ue3, unknown: () => B4, url: () => Or, visa: () => se2 }); var x4 = Object.defineProperty; var l = Object.getOwnPropertySymbols; var w4 = Object.prototype.hasOwnProperty; var U4 = Object.prototype.propertyIsEnumerable; var E4 = (t, r2, e2) => r2 in t ? x4(t, r2, { enumerable: true, configurable: true, writable: true, value: e2 }) : t[r2] = e2; var d3 = (t, r2) => { for (var e2 in r2 || (r2 = {})) w4.call(r2, e2) && E4(t, e2, r2[e2]); if (l) for (var e2 of l(r2)) U4.call(r2, e2) && E4(t, e2, r2[e2]); return t; }; var o = class extends Error { constructor(r2 = "", e2 = null, c5) { super(r2), this.message = r2, this.name = e2, this.value = c5; } }; var A4 = (t, r2) => { let e2; if (!t) throw new Error("Schema object required for parse data!"); if (typeof t == "function") { if (e2 = t.apply(null, [r2]), e2 instanceof o) throw e2; } else for (let c5 in t) { let s2 = r2[c5], a2 = t[c5]; if (!a2) throw new o(`Guard not defined for field ${c5} in input data!`, "general", r2); if (!r2.hasOwnProperty(c5)) throw new o(`Field ${c5} doesn't exists in input data!`, "general", r2); if (typeof a2 == "function") { if (console.log(a2.name), e2 = a2.apply(null, [s2]), e2 instanceof o) throw e2; } else A4(a2, s2); } return r2; }; var D4 = (t, r2) => { let e2; if (!t) throw new Error("Schema object required for parse data!"); if (typeof t == "function") { if (e2 = t.apply(null, [r2]), e2 instanceof o) return { ok: false, error: e2 }; } else for (let c5 in t) { let s2 = r2[c5], a2 = t[c5]; if (a2) if (typeof a2 == "function") { if (e2 = a2.apply(null, [r2]), e2 instanceof o) return { ok: false, error: e2 }; } else A4(a2, s2); } return { ok: true, output: r2 }; }; var M5 = (...t) => (r2) => t.reduce((e2, c5) => c5(e2), r2); var y3 = M5; var N4 = (...t) => (r2) => t.reduceRight((e2, c5) => c5(e2), r2); var I4 = N4; var v4 = "VAL must be a string"; var i2 = (t = v4) => function(r2) { let e2 = t.replace(/VAL/g, r2); return typeof r2 == "string" ? r2 : new o(e2, "string", r2); }; var f3 = (t) => typeof t != "undefined" && t !== null; var T4 = "VAL must starts with START_VAL"; var C4 = (t, r2 = T4) => { if (!f3(t)) throw new Error("START_VALUE not defined!"); return function(e2) { let c5 = r2.replace(/VAL/g, e2).replace(/START_VAL/g, t); return typeof e2 == "string" && e2.startsWith(t) ? e2 : new o(c5, "startsWith", e2); }; }; var $6 = "VAL must end with END_VAL"; var O3 = (t, r2 = $6) => { if (!f3(t)) throw new Error("END_VALUE not defined!"); return function(e2) { let c5 = r2.replace(/VAL/g, e2).replace(/END_VAL/g, t); return typeof e2 == "string" && e2.endsWith(t) ? e2 : new o(c5, "endsWith", e2); }; }; var B4 = () => function(t) { return t; }; var F4 = "A symbol is required"; var q4 = (t = F4) => function(r2) { return typeof r2 == "symbol" ? r2 : new o(t, "symbol", r2); }; var P3 = "VAL must be a bigint"; var j4 = (t = P3) => function(r2) { let e2 = t.replace(/VAL/g, r2); return typeof r2 == "bigint" ? r2 : new o(e2, "bigint", r2); }; var z4 = "VAL must be valid date object or date string"; var H4 = (t = z4) => function(r2) { let e2 = t.replace(/VAL/g, r2); return typeof r2 == "object" && r2.getTime || typeof r2 == "string" && !isNaN(Date.parse(r2)) ? r2 : new o(e2, "date", r2); }; var X4 = "The value must be a function"; var W4 = (t = X4) => function(r2) { return typeof r2 == "function" ? r2 : new o(t, "function", r2); }; var Y3 = "VAL must be an integer"; var J4 = (t = Y3) => function(r2) { let e2 = t.replace(/VAL/g, r2); return Number.isInteger(r2) ? r2 : new o(e2, "integer", r2); }; var Z4 = "VAL must be an safe integer"; var Q4 = (t = Z4) => function(r2) { let e2 = t.replace(/VAL/g, r2); return Number.isSafeInteger(r2) ? r2 : new o(e2, "safeInteger", r2); }; var K4 = "VAL must be a great then MIN_VALUE"; var rr3 = (t, r2 = K4) => { if (!f3(t)) throw new Error("MIN_VALUE not defined!"); return function(e2) { let c5 = r2.replace(/VAL/g, e2).replace(/MIN_VALUE/g, t), s2 = +e2; return !isNaN(s2) && s2 >= +t ? e2 : new o(c5, "minValue", e2); }; }; var er3 = "VAL must be a less then MAX_VALUE"; var tr3 = (t, r2 = er3) => { if (!f3(t)) throw new Error("MAX_VALUE not defined!"); return function(e2) { let c5 = r2.replace(/VAL/g, e2).replace(/MAX_VALUE/g, t), s2 = +e2; return !isNaN(s2) && s2 <= +t ? e2 : new o(c5, "maxValue", e2); }; }; var or3 = "VAL must be a string in valid email format"; var nr3 = (t = or3) => function(r2) { let e2 = t.replace(/VAL/g, r2); return typeof r2 == "string" && /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r2) ? r2 : new o(e2, "email", r2); }; var cr3 = "Any value required"; var sr3 = (t = cr3) => function(r2) { let e2 = t.replace(/VAL/g, r2); return typeof r2 != "undefined" && r2 !== null && r2 !== "" ? r2 : new o(e2, "required", r2); }; var ar3 = "VAL must be a number"; var fr3 = (t = ar3) => function(r2) { let e2 = t.replace(/VAL/g, r2); return typeof r2 == "number" && !isNaN(+r2) ? r2 : new o(e2, "number", r2); }; var mr3 = "VAL must be an object"; var ir3 = (t, r2 = mr3) => { if (!(typeof t == "object")) throw new o(r2.replace(/VAL/g, t), "object", t); return d3({}, t); }; var Ar3 = "VAL must be between MIN_VAL and MAX_VAL"; var ur3 = (t, r2, e2 = Ar3) => { if (!f3(t)) throw new Error("MIN_VALUE not defined!"); if (!f3(r2)) throw new Error("MAX_VALUE not defined!"); return function(c5) { let s2 = e2.replace(/VAL/g, c5).replace(/MIN_VAL/g, t).replace(/MAX_VAL/g, r2), a2 = +c5; return !isNaN(a2) && c5 >= +t && c5 <= +r2 ? c5 : new o(s2, "between", c5); }; }; var lr3 = "VAL must be a finite number"; var Er2 = (t = lr3) => function(r2) { let e2 = t.replace(/VAL/g, r2); return Number.isFinite(r2) ? r2 : new o(e2, "finite", r2); }; var dr3 = "VAL must be a string in valid base 64 format"; var gr3 = (t = dr3) => function(r2) { let e2 = t.replace(/VAL/g, r2); return typeof r2 == "string" && /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/.test(r2) ? r2 : new o(e2, "base64", r2); }; var Gr = "VAL can`t be a number"; var hr3 = (t = Gr) => function(r2) { let e2 = t.replace(/VAL/g, r2); return isNaN(r2) ? r2 : new o(e2, "notNumber", r2); }; var Lr = "VAL must be a boolean"; var _r2 = (t = Lr) => function(r2) { let e2 = t.replace(/VAL/g, r2); return typeof r2 == "boolean" ? r2 : new o(e2, "boolean", r2); }; var g4 = "VAL must be an array of TYPE"; var pr3 = (t, r2 = g4) => (!t && !r2 && (t = i2(), r2 = g4), typeof t == "string" && (r2 = t, t = i2()), function(e2) { let c5 = r2.replace(/VAL/g, e2).replace(/TYPE/g, t.name); if (!Array.isArray(e2)) return new o(c5, "array", e2); for (let s2 of e2) if (t(s2) instanceof o) return new o(c5, "array", e2); return e2; }); var Sr2 = "VAL must be a valid EMEI"; var Vr = (t) => { let r2 = (s2) => { let a2 = 0; for (; s2 > 0; ) a2 = a2 + s2 % 10, s2 = parseInt("" + s2 / 10, 10); return a2; }, e2 = ("" + t).length; if (e2 !== 15) return false; let c5 = 0; for (let s2 = e2; s2 >= 1; s2--) { let a2 = t % 10; s2 % 2 === 0 && (a2 = 2 * a2), c5 += r2(a2), t = parseInt("" + t / 10, 10); } return c5 % 10 === 0; }; var br2 = (t = Sr2) => function(r2) { let e2 = t.replace(/VAL/g, r2); return Vr(r2) ? r2 : new o(e2, "emei", r2); }; var u3 = "VAL must be a string or array with length N"; var Rr = (t, r2 = u3) => function(e2) { let c5 = r2.replace(/VAL/g, e2).replace(/N/g, t); return (typeof e2 == "string" || Array.isArray(e2)) && e2.length === +t ? e2 : new o(c5, "length", e2); }; var kr2 = (t, r2 = u3) => function(e2) { let c5 = r2.replace(/VAL/g, e2).replace(/N/g, t); return (typeof e2 == "string" || Array.isArray(e2)) && e2.length >= +t ? e2 : new o(c5, "minLength", e2); }; var xr3 = (t, r2 = u3) => function(e2) { let c5 = r2.replace(/VAL/g, e2).replace(/N/g, t); return (typeof e2 == "string" || Array.isArray(e2)) && e2.length <= +t ? e2 : new o(c5, "maxLength", e2); }; var wr3 = "VAL must be a valid ip address ipv4 or ipv6"; var Ur = "VAL must be a valid ipv4 address"; var Dr = "VAL must be a valid ipv6 address"; var G5 = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/; var h2 = /^[a-fA-F0-9]{1, 4}:[a-fA-F0-9]{1, 4}:[a-fA-F0-9]{1, 4}:[a-fA-F0-9]{1, 4}:[a-fA-F0-9]{1, 4}:[a-fA-F0-9]{1, 4}:[a-fA-F0-9]{1, 4}:[a-fA-F0-9]{1, 4}$/; var Mr = (t = wr3) => function(r2) { let e2 = t.replace(/VAL/g, r2); return typeof r2 == "string" && (G5.test(r2) || h2.test(r2)) ? r2 : new o(e2, "ip", r2); }; var yr3 = (t = Ur) => function(r2) { let e2 = t.replace(/VAL/g, r2); return typeof r2 == "string" && G5.test(r2) ? r2 : new o(e2, "ipv4", r2); }; var Nr = (t = Dr) => function(r2) { let e2 = t.replace(/VAL/g, r2); return typeof r2 == "string" && h2.test(r2) ? r2 : new o(e2, "ipv6", r2); }; var Ir = "VAL must be a valid domain name, xn--* for internationalized names"; var vr3 = /^((xn--)?[a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/; var Tr2 = (t = Ir) => function(r2) { let e2 = t.replace(/VAL/g, r2); return typeof r2 == "string" && vr3.test(r2) ? r2 : new o(e2, "domain", r2); }; var Cr2 = "VAL must be a valid url"; var $r = /^(?:(?:(?:https?|ftp|wss?):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i; var Or = (t = Cr2) => function(r2) { let e2 = t.replace(/VAL/g, r2); return typeof r2 == "string" && $r.test(r2) ? r2 : new o(e2, "url", r2); }; var Br = "VAL must be a valid color in HEX, RGB(A), or HSL(A) format"; var Fr = "VAL must be a valid HEX color"; var qr = "VAL must be a valid RGB(a) color"; var Pr = "VAL must be a valid HSL(A) color"; var jr = /^#(?:[\da-f]{3}){1,2}$|^#(?:[\da-f]{4}){1,2}$|^(rgb|hsl)a?\((\s*-?\d+%?\s*,){2}(\s*-?\d+%?\s*)\)$|^(rgb|hsl)a?\((\s*-?\d+%?\s*,){3}\s*(0|(0?\.\d+)|1)\)$/gmi; var zr = /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i; var Hr = /^rgba?\((\s*-?\d+%?\s*,){2}(\s*-?\d+%?\s*)\)$|^rgba?\((\s*-?\d+%?\s*,){3}\s*(0|(0?\.\d+)|1)\)$/gmi; var Xr = /^hsla?\((\s*-?\d+%?\s*,){2}(\s*-?\d+%?\s*)\)$|^hsla?\((\s*-?\d+%?\s*,){3}\s*(0|(0?\.\d+)|1)\)$/gmi; var Wr = (t = Br) => function(r2) { let e2 = t.replace(/VAL/g, r2); return typeof r2 == "string" && jr.test(r2) ? r2 : new o(e2, "color", r2); }; var Yr = (t = Fr) => function(r2) { let e2 = t.replace(/VAL/g, r2); return typeof r2 == "string" && zr.test(r2) ? r2 : new o(e2, "hexColor", r2); }; var Jr = (t = qr) => function(r2) { let e2 = t.replace(/VAL/g, r2); return typeof r2 == "string" && Hr.test(r2) ? r2 : new o(e2, "rgbColor", r2); }; var Zr = (t = Pr) => function(r2) { let e2 = t.replace(/VAL/g, r2); return typeof r2 == "string" && Xr.test(r2) ? r2 : new o(e2, "hslColor", r2); }; var L4 = /^4\d{12}(?:\d{3,6})?$/u; var _4 = /^5[1-5]\d{2}|(?:222\d|22[3-9]\d|2[3-6]\d{2}|27[01]\d|2720)\d{12}$/u; var p3 = /^3[47]\d{13}$/u; var S4 = /^6(?:011|5\d{2})\d{12,15}$/u; var V4 = /^3(?:0[0-5]|[68]\d)\d{11,13}$/u; var b4 = /^(?:2131|1800|35\d{3})\d{11}$/u; var R4 = /^(?:6[27]\d{14,17}|81\d{14,17})$/u; var k4 = "VAL must be a valid CC number (visa, mastercard, american express, discover, diners club, jcb, or union pay)"; var Qr = "VAL must be a valid Visa card number"; var Kr = "VAL must be a valid Mastercard card number"; var re2 = "VAL must be a valid American Express card number"; var ee3 = "VAL must be a valid DISCOVER card number"; var te3 = "VAL must be a valid DINERS CLUB card number"; var oe3 = "VAL must be a valid JCB card number"; var ne3 = "VAL must be a valid Union Pay card number"; var ce3 = (t = k4) => function(r2) { let e2 = t.replace(/VAL/g, r2); return typeof r2 == "string" && (L4.test(r2) || _4.test(r2) || p3.test(r2) || S4.test(r2) || V4.test(r2) || b4.test(r2) || R4.test(r2)) ? r2 : new o(e2, "creditCard", r2); }; var m4 = (t, r2, e2 = k4) => function(c5) { let s2 = e2.replace(/VAL/g, c5); return typeof c5 == "string" && r2.test(c5) ? c5 : new o(s2, t, c5); }; var se2 = (t = Qr) => m4("visa", L4, t); var ae3 = (t = Kr) => m4("mastercard", _4, t); var fe3 = (t = re2) => m4("american express", p3, t); var me3 = (t = ee3) => m4("discover", S4, t); var ie3 = (t = te3) => m4("diners club", V4, t); var Ae3 = (t = oe3) => m4("jcb card", b4, t); var ue3 = (t = ne3) => m4("union pay", R4, t); var le3 = "The length of string must be VAL bytes"; var Ee3 = (t, r2 = le3) => function(e2) { let c5 = r2.replace(/VAL/g, e2); return typeof e2 == "string" && new TextEncoder().encode(e2).length === t ? e2 : new o(c5, "bytes", e2); }; var de3 = "VAL can`t be null or undefined."; var ge3 = (t = de3) => function(r2) { let e2 = t.replace(/VAL/g, r2); return f3(r2) ? r2 : new o(e2, "notNull", r2); }; var Ge3 = "The value must match the pattern"; var he3 = (t, r2 = Ge3) => function(e2) { let c5 = r2.replace(/VAL/g, e2); return (typeof t == "string" ? new RegExp(t, "g") : t).test("" + e2) ? e2 : new o(c5, "pattern", e2); }; var Le3 = "VAL must contains only digits"; var _e3 = (t = Le3) => function(r2) { let e2 = t.replace(/VAL/g, r2); return /^\d+$/g.test("" + r2) ? r2 : new o(e2, "digits", r2); }; var pe3 = "VAL must be a float"; var Se3 = (t = pe3) => function(r2) { let e2 = t.replace(/VAL/g, r2); return !isNaN(r2) && +n % 1 !== 0 || /^\d*\.\d+$/.test(r2) ? r2 : new o(e2, "float", r2); }; var Ve3 = "VAL must must contains OBJ"; var be3 = (t, r2 = Ve3) => function(e2) { let c5 = r2.replace(/VAL/g, e2).replace(/OBJ/g, t); return e2.includes(t) ? e2 : new o(c5, "contains", e2); }; var Re3 = "A VAL must have type TYPE"; function ke3(t) { return Object.prototype.toString.call(t).replace(/^\[object (.+)]$/, "$1").toLowerCase(); } var xe3 = (t = "string", r2 = Re3) => function(e2) { let c5 = r2.replace(/VAL/g, e2).replace(/TYPE/g, t); return t === ke3(e2) ? e2 : new o(c5, "type", e2); }; var we3 = "VAL must be an equal to VALUE"; var Ue2 = (t, r2 = we3) => function(e2) { let c5 = r2.replace(/VAL/g, e2).replace(/VALUE/g, t); return e2 === t ? e2 : new o(c5, "equal", e2); }; var De2 = "VAL must be a similar to VALUE"; var Me3 = (t, r2 = De2) => function(e2) { let c5 = r2.replace(/VAL/g, e2).replace(/VALUE/g, t); return e2 == t ? e2 : new o(c5, "similar", e2); }; var ye3 = "VAL must be a great then VALUE"; var Ne3 = (t, r2 = ye3) => function(e2) { let c5 = r2.replace(/VAL/g, e2).replace(/VALUE/g, t); return e2 > t ? e2 : new o(c5, "great", e2); }; var Ie2 = "VAL must be a less then VALUE"; var ve3 = (t, r2 = Ie2) => function(e2) { let c5 = r2.replace(/VAL/g, e2).replace(/VALUE/g, t); return e2 < t ? e2 : new o(c5, "less", e2); }; var Te2 = "VAL must be a great or equal to VALUE"; var Ce3 = (t, r2 = Te2) => function(e2) { let c5 = r2.replace(/VAL/g, e2).replace(/VALUE/g, t); return e2 >= t ? e2 : new o(c5, "greatOrEqual", e2); }; var $e3 = "VAL must be a less or equal to VALUE"; var Oe3 = (t, r2 = $e3) => function(e2) { let c5 = r2.replace(/VAL/g, e2).replace(/VALUE/g, t); return e2 <= t ? e2 : new o(c5, "lessOrEqual", e2); }; var Be3 = "0.7.3"; var Fe3 = "18.05.2025, 14:43:24"; var qe3 = () => { console.info(`%c Guardian %c v${Be3} %c ${Fe3} `, "color: pink; font-weight: bold; background: #2b1700", "color: white; background: darkgreen", "color: white; background: #0080fe;"); }; // source/guardian/index.js globalThis.G = guardian_exports; // node_modules/@olton/router/dist/router.js var r = class s { static DEBUG_LEVELS = { NONE: 0, ERROR: 1, WARN: 2, INFO: 3, DEBUG: 4, TRACE: 5 }; static DEBUG_LEVEL = s.DEBUG_LEVELS.NONE; static log(e2, t, i3) { if (e2 > s.DEBUG_LEVEL) return; let o2 = { error: "color: #ff5555; font-weight: bold", warn: "color: #ffaa00; font-weight: bold", info: "color: #0080fe; font-weight: bold", debug: "color: #00aa00; font-weight: bold", trace: "color: #888888", data: "color: #555; font-style: italic" }, a2, n3; switch (e2) { case s.DEBUG_LEVELS.ERROR: a2 = "error", n3 = console.error; break; case s.DEBUG_LEVELS.WARN: a2 = "warn", n3 = console.warn; break; case s.DEBUG_LEVELS.INFO: a2 = "info", n3 = console.info; break; case s.DEBUG_LEVELS.DEBUG: a2 = "debug", n3 = console.debug; break; case s.DEBUG_LEVELS.TRACE: a2 = "trace", n3 = console.log; break; default: return; } console.group(`%c Model: ${t}`, o2[a2]), i3 !== void 0 && console.log("%c Data:", o2.data, i3), console.groupEnd(); } static error(e2, t) { s.log(s.DEBUG_LEVELS.ERROR, e2, t); } static warn(e2, t) { s.log(s.DEBUG_LEVELS.WARN, e2, t); } static info(e2, t) { s.log(s.DEBUG_LEVELS.INFO, e2, t); } static debug(e2, t) { s.log(s.DEBUG_LEVELS.DEBUG, e2, t); } static trace(e2, t) { s.log(s.DEBUG_LEVELS.TRACE, e2, t); } }; var E5 = "0.4.1"; var w5 = "18.05.2025, 14:39:57"; var c4 = class { constructor(e2 = {}) { if (r.DEBUG_LEVEL = e2.debug ? 4 : 0, r.debug("[Router] Init Router"), this.routes = {}, this.fallbackRoute = e2.fallback || "/", this.maxRedirects = e2.maxRedirects || 5, this.redirectCount = 0, this.basePath = e2.base || "", this.middleware = [], this.beforeEachHooks = [], this.afterEachHooks = [], this.cache = /* @__PURE__ */ new Map(), this.cacheLimit = e2.cacheLimit ?? 50, this.touchStartX = 0, this.enableSwipeNavigation = e2.enableSwipeNavigation || false, this.current = null, this.redirects = {}, this.useHash = e2.useHash || false, this.events = { beforeNavigate: [], afterNavigate: [], routeNotFound: [], error: [] }, this.plugins = [], this.enableSwipeNavigation && this.initSwipeNavigation(), e2.routes) { r.debug("[Router] Registering routes"); for (let [t, i3] of Object.entries(e2.routes)) this.addRoute(t, i3); } e2.plugins && Array.isArray(e2.plugins) && (r.debug("[Router] Registering plugins"), e2.plugins.forEach((t) => { Array.isArray(t) ? this.usePlugin(t[0], t[1] || {}) : this.usePlugin(t); })), r.debug("[Router] Subscribing to unhandledrejection event"), window.addEventListener("unhandledrejection", this.handleError.bind(this)), r.debug("[Router] Router Initialized"); } on(e2, t) { return r.debug(`[Router] Subscribing to event ${e2}`), this.events[e2] && this.events[e2].push(t), this; } emit(e2, ...t) { if (r.debug(`[Router] Emitting event ${e2}`), this.events[e2]) for (let i3 of this.events[e2]) { let o2 = i3(...t); if (e2 === "beforeNavigate" && o2 === false) return false; } return true; } initSwipeNavigation() { r.debug("[Router] Initializing swipe navigation"), r.debug("[Router] Adding touchstart event listener"), document.addEventListener("touchstart", (e2) => { this.touchStartX = e2.touches[0].clientX; }, { passive: true }), r.debug("[Router] Adding touchend event listener"), document.addEventListener("touchend", (e2) => { let t = e2.changedTouches[0].clientX, i3 = this.touchStartX - t; Math.abs(i3) > 100 && (i3 > 0 ? (r.debug("[Router] Swiping right (forward)"), window.history.forward()) : (r.debug("[Router] Swiping left (backward)"), window.history.back())); }, { passive: true }); } handleError(e2) { r.error("[Router] Error during navigation:", e2), this.emit("error", e2), this.routes["/error"] ? this.navigateTo("/error", true) : this.navigateTo(this.fallbackRoute, true); } sanitizePath(e2) { r.debug("[Router] Sanitizing path:", e2); try { if (!e2) return "/"; let t = new URL(e2, window.location.origin), i3 = decodeURIComponent(t.pathname); return i3 = i3.replace(/[<>'"`;(){}]/g, "").replace(/[\u0000-\u001F\u007F-\u009F]/g, "").replace(/([^/])\/{2,}/g, "$1/").replace(/\/+/g, "/").replace(/(.+)\/$/, "$1").replace(/\.+/g, ".").split("/").filter((o2) => o2 !== ".." && o2 !== ".").join("/"), i3.startsWith("/") || (i3 = "/" + i3), this.isBlockedPath(i3) ? "/" : (r.debug("[Router] Sanitized path:", i3), i3); } catch (t) { return r.error("[Router] Error sanitizing path:", t), "/"; } } isBlockedPath(e2) { return r.debug("[Router] Checking if path is blocked:", e2), [/^\/(api|admin|wp-admin|wp-content|wp-includes)/i, /\.(php|asp|aspx|jsp|cgi|config|env|git|sql|htaccess)$/i, /\/(.+\/)*\.{2,}\//, /javascript:/i, /data:/i, /vbscript:/i, /file:/i].some((i3) => i3.test(e2)); } test(e2) { r.debug("[Router] Testing path:", e2); let t = e2, i3 = this.sanitizePath(e2), o2 = { original: t, sanitized: i3, isBlocked: this.isBlockedPath(i3), isModified: t !== i3 }; return r.debug(`[Router] test result for path ${e2}:`, o2), o2; } beforeEach(e2) { return r.debug("[Router] Adding beforeEach hook"), this.beforeEachHooks.push(e2), this; } afterEach(e2) { return r.debug("[Router] Adding afterEach hook"), this.afterEachHooks.push(e2), this; } use(e2) { return r.debug("[Router] Adding middleware"), this.middleware.push(e2), this; } addRedirect(e2, t) { return r.debug("[Router] Adding redirect from", e2, "to", t), this.redirects[e2] ? false : (this.redirects[e2] = t, this); } addRoute(e2, t) { return r.debug("[Router] Adding route", e2), this.routes[e2] = t, this; } addNestedRoute(e2, t, i3) { r.debug(`[Router] Adding nested route ${t} to ${e2}`); let o2 = `${e2}${t}`.replace(/\/\//g, "/"); return this.addRoute(o2, i3), this; } addLazyRoute(e2, t) { return r.debug("[Router] Adding lazy-loaded route", e2), this.addRoute(e2, async (i3) => { try { let o2 = await t(); return (o2.default || o2)(i3); } catch (o2) { throw o2; } }), this; } addLazyNestedRoute(e2, t, i3) { r.debug("[Router] Adding lazy-loaded nested route", t, "to", e2); let o2 = `${e2}${t}`.replace(/\/\//g, "/"); return this.addLazyRoute(o2, i3), this; } addFallbackRoute(e2) { return r.debug("[Router] Adding fallback route", e2), this.fallbackRoute = e2, this; } add404Route(e2) { return r.debug("[Router] Adding 404 route", e2), this.routes["/404"] = e2, this; } addErrorRoute(e2) { return r.debug("[Router] Adding error route", e2), this.routes["/error"] = e2, this; } addProtectedRoute(e2, t, i3, o2 = "/login") { return r.debug("[Router] Adding protected route", e2), this.addRoute(e2, async (a2) => { if (await i3(a2)) return r.debug("[Router] Guard function passed, executing callback"), t(a2); r.debug("[Router] Guard function failed, redirecting to", o2), await this.navigateTo(o2, true); }), this; } removeRoute(e2) { return r.debug("[Router] Removing route", e2), this.routes[e2] && delete this.routes[e2], this; } updateRoute(e2, t) { return r.debug("[Router] Updating route", e2), this.routes[e2] && (this.routes[e2] = t), this; } getRoutes() { return r.debug("[Router] Getting registered routes"), this.routes; } async navigate(e2) { if (r.debug("[Router] Navigating to", e2), this.redirectCount > this.maxRedirects) { r.error("[Router] Maximum redirect limit reached, redirecting to", this.fallbackRoute), console.error("Maximum redirect limit reached"), this.redirectCount = 0, this.emit("error", new Error("Maximum redirect limit reached")), await this.navigateTo("/error", true); return; } this.redirectCount++; let t = this.matchRoute(this.sanitizePath(e2)); if (t) try { if (r.debug("[Router] Route matched:", t), this.emit("beforeNavigate", t) === false) { r.debug("[Router] Navigation cancelled by beforeNavigate hook"); return; } if (this.redirects[t.path]) { r.debug("[Router] Redirecting to", this.redirects[t.path]), await this.navigateTo(this.redirects[t.path], true); return; } this.redirectCount++; for (let o2 of this.middleware) r.debug("[Router] Executing middleware"), await o2(t); for (let o2 of this.beforeEachHooks) r.debug("[Router] Executing beforeEach hook"), await o2(t); r.debug("[Router] Executing route callback"), await t.callback(t.params); for (let o2 of this.afterEachHooks) r.debug("[Router] Executing afterEach hook"), await o2(t); this.current = t, this.emit("afterNavigate", t), r.debug("[Router] Navigation completed"); } catch (i3) { r.error("[Router] Error during navigation:", i3), console.error("Navigation error:", i3), this.emit("error", i3), this.routes["/error"] && this.routes["/error"](i3); } else r.warn("[Router] Route not found:", e2), this.redirectCount = 0, this.emit("routeNotFound", e2), this.routes["/404"] && this.routes["/404"](); } async navigateTo(e2, t = false) { r.debug(`[Router] Navigating to ${e2} ${t ? "with replace state" : ""}`), this.redirectCount = 0; let i3 = new URL(e2, window.location.origin); t ? (r.debug("[Router] Replacing state with", i3), window.history.replaceState({}, "", i3)) : (r.debug("[Router] Pushing state with", i3), window.history.pushState({}, "", i3)), r.debug("[Router] Navigating to", i3), await this.navigate(i3.pathname); } matchRoute(e2) { if (r.debug("[Router] Matching route for", e2), this.cache.has(e2)) return this.cache.get(e2); r.debug("[Router] Route not found in cache, performing match"); let t = this._performMatch(e2); if (this.cache.size >= this.cacheLimit) { r.debug("[Router] Cache limit reached, removing oldest entry"); let i3 = this.cache.keys().next().value; this.cache.delete(i3); } return r.debug("[Router] Caching result for", e2), this.cache.set(e2, t), t; } _performMatch(e2) { let [t, i3] = e2.split("?"), o2 = new URLSearchParams(i3), a2 = Object.fromEntries(o2); for (let n3 in this.routes) { let d4 = [], h3 = n3.replace(/:([^\/]+)/g, (l2, u4) => (d4.push(u4), "([^/]+)")), g5 = e2.match(new RegExp(`^${h3}$`)); if (g5) { let l2 = g5.slice(1).reduce((u4, b5, R5) => (u4[d4[R5]] = b5, u4), {}); return { path: e2, pattern: h3, callback: this.routes[n3], params: l2, query: a2 }; } } return null; } clearCache() { r.debug("[Router] Clearing cache"), this.cache.clear(); } resetRedirectCount() { r.debug("[Router] Resetting redirect count"), this.redirectCount = 0; } getFullPath(e2) { return r.debug("[Router] Getting full path for", e2), this.useHash ? `#${e2}` : e2; } getPathFromLocation() { return r.debug("[Router] Getting path from location"), this.useHash ? window.location.hash.slice(1) || "/" : window.location.pathname; } listen() { return r.debug("[Router] Starting to listen for navigation events"), this._handleNavigation = () => { this.redirectCount = 0, this.navigate(this.getPathFromLocation()).then((e2) => { }); }, this._handleLinkClick = (e2) => { if (e2.target.tagName === "A") { let t = e2.target.getAttribute("href"); if (t && (this.useHash && t.startsWith("#") || !this.useHash && e2.target.href.startsWith(window.location.origin))) { e2.preventDefault(); let i3 = this.useHash ? t.slice(1) : e2.target.pathname; this.redirectCount = 0, this.navigateTo(i3).then((o2) => { }); } } }, r.debug("[Router] Listening for navigation events"), window.addEventListener(this.useHash ? "hashchange" : "popstate", this._handleNavigation), r.debug("[Router] Listening for link clicks"), document.addEventListener("click", this._handleLinkClick), this._initPlugins(), this.redirectCount = 0, this.navigate(this.getPathFromLocation()).then((e2) => { }), this; } _initPlugins() { r.debug("[Router] Init plugins"), this.plugins.forEach(({ plugin: e2, options: t }) => { typeof e2.onInit == "function" && e2.onInit(this, t); }); } usePlugin(e2, t = {}) { if (!e2) return this; if (r.debug("[Router] Using plugin", e2), typeof e2 == "object" && typeof e2.install == "function") r.debug("[Router] Installing plugin", e2), e2.install(this, t); else if (typeof e2 == "function") r.debug("[Router] Executing plugin", e2), e2(this, t); else return r.warn("Invalid plugin format. Plugin must be an object with install method or a function."), this; return r.debug("[Router] Add plugin to store", e2), this.plugins.push({ plugin: e2, options: t }), r.debug("[Router] Plugin initialized"), this; } destroy() { r.debug("[Router] Destroying router"), this.plugins.forEach(({ plugin: e2, options: t }) => { r.debug("[Router] Destroying plugin", e2), typeof e2.onDestroy == "function" && e2.onDestroy(this, t); }), r.debug("[Router] Removing event listeners"), window.removeEventListener(this.useHash ? "hashchange" : "popstate", this._handleNavigation), document.removeEventListener("click", this._handleLinkClick), window.removeEventListener("unhandledrejection", this.handleError), this._handleNavigation = null, this._handleLinkClick = null, this.routes = {}, this.plugins = [], this.cache.clear(), r.debug("[Router] Router destroyed"); } }; c4.info = () => { console.info(`%c Router %c v${E5} %c ${w5} `, "color: #ffffff; font-weight: bold; background: #ed1cab", "color: white; background: darkgreen", "color: white; background: #0080fe;"); }; var f4 = c4; var p4 = f4; // source/router/index.js globalThis.Router = p4; // node_modules/@olton/model/dist/model.js var EventEmitter = class { /** * Initializes a new EventEmitter instance. * Creates an empty Map where: * - Keys are event names (strings) * - Values are Sets of callback functions */ constructor() { this.events = /* @__PURE__ */ new Map(); } /** * Registers a new event listener for the specified event. * - Creates new Set for event if it doesn't exist * - Adds callback to the Set of listeners * - Returns unsubscribe function for cleanup * * @param {string} eventName - Event identifier * @param {Function} callback - Event handler function * @returns {Function} Unsubscribe function */ on(eventName, callback) { if (!this.events.has(eventName)) { this.events.set(eventName, /* @__PURE__ */ new Set()); } this.events.get(eventName).add(callback); return () => this.off(eventName, callback); } /** * Removes a specific event listener. * - Safely handles non-existent events * - Removes only the specified callback * - Keeps other listeners for the same event intact * * @param {string} eventName - Event to unsubscribe from * @param {Function} callback - Listener to remove */ off(eventName, callback) { if (this.events.has(eventName)) { this.events.get(eventName).delete(callback); } } /** * Triggers all listeners for the specified event. * - Safely handles non-existent events * - Executes each listener in try-catch block * - Continues execution even if one listener fails * - Logs errors without breaking execution * * @param {string} eventName - Event to trigger * @param {*} [data] - Optional data for listeners */ emit(eventName, data) { if (this.events.has(eventName)) { this.events.get(eventName).forEach((callback) => { try { callback(data); } catch (e2) { console.error(`Error when performing an event handler ${eventName}:`, e2); } }); } } }; var event_emitter_default = EventEmitter; var DevToolsStyle = ` `; var dev_tools_style_default = DevToolsStyle; var ModelDevTools = class { constructor(model, options = {}) { this.model = model; this.options = { enabled: true, timeTravel: true, maxSnapshots: 50, ...options }; this.history = []; this.currentIndex = -1; this.initializeDevTools(); } /** * Initializes the model development tools by: * - Creating a global reference at window.__MODEL_DEVTOOLS__ * - Creating the dev tools panel in the DOM * - Setting up model event listeners for debugging */ initializeDevTools() { window.__MODEL_DEVTOOLS__ = this; this.createDevToolsPanel(); this.setupModelListeners(); } /** * Creates the development tools panel in the DOM with: * - A header with title and control buttons * - Content area for debugging information * - Styling from DevToolsWindowStyle * - Close and Time Travel buttons with event handlers * - Toggle button for panel visibility */ createDevToolsPanel() { const panel = document.createElement("div"); panel.id = "model-devtools-panel"; panel.style.cssText = `display: none;`; const header = document.createElement("div"); header.innerHTML = ` ${dev_tools_style_default}
${changeContent}
${formatValue(this.model.data)}
${formatValue(computedValues)}
${this.formatDOMDependencies()}