UNPKG

rosetty-solid

Version:

[![Maintainability](https://api.codeclimate.com/v1/badges/a777c53f5370b6900930/maintainability)](https://codeclimate.com/github/qlaffont/rosetty-solid/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/a777c53f5370b6900930/test_cover

1,311 lines (1,296 loc) 47.5 kB
var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __commonJS = (cb, mod) => function __require() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); // node_modules/.pnpm/dayjs@1.11.10/node_modules/dayjs/dayjs.min.js var require_dayjs_min = __commonJS({ "node_modules/.pnpm/dayjs@1.11.10/node_modules/dayjs/dayjs.min.js"(exports, module) { !function(t, e) { "object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = "undefined" != typeof globalThis ? globalThis : t || self).dayjs = e(); }(exports, function() { var t = 1e3, e = 6e4, n = 36e5, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o2 = "week", c = "month", f2 = "quarter", h = "year", d = "date", l = "Invalid Date", $ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y2 = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(t2) { var e2 = ["th", "st", "nd", "rd"], n2 = t2 % 100; return "[" + t2 + (e2[(n2 - 20) % 10] || e2[n2] || e2[0]) + "]"; } }, m = function(t2, e2, n2) { var r2 = String(t2); return !r2 || r2.length >= e2 ? t2 : "" + Array(e2 + 1 - r2.length).join(n2) + t2; }, v = { s: m, z: function(t2) { var e2 = -t2.utcOffset(), n2 = Math.abs(e2), r2 = Math.floor(n2 / 60), i2 = n2 % 60; return (e2 <= 0 ? "+" : "-") + m(r2, 2, "0") + ":" + m(i2, 2, "0"); }, m: function t2(e2, n2) { if (e2.date() < n2.date()) return -t2(n2, e2); var r2 = 12 * (n2.year() - e2.year()) + (n2.month() - e2.month()), i2 = e2.clone().add(r2, c), s2 = n2 - i2 < 0, u2 = e2.clone().add(r2 + (s2 ? -1 : 1), c); return +(-(r2 + (n2 - i2) / (s2 ? i2 - u2 : u2 - i2)) || 0); }, a: function(t2) { return t2 < 0 ? Math.ceil(t2) || 0 : Math.floor(t2); }, p: function(t2) { return { M: c, y: h, w: o2, d: a, D: d, h: u, m: s, s: i, ms: r, Q: f2 }[t2] || String(t2 || "").toLowerCase().replace(/s$/, ""); }, u: function(t2) { return void 0 === t2; } }, g = "en", D = {}; D[g] = M; var p2 = "$isDayjsObject", S = function(t2) { return t2 instanceof _ || !(!t2 || !t2[p2]); }, w = function t2(e2, n2, r2) { var i2; if (!e2) return g; if ("string" == typeof e2) { var s2 = e2.toLowerCase(); D[s2] && (i2 = s2), n2 && (D[s2] = n2, i2 = s2); var u2 = e2.split("-"); if (!i2 && u2.length > 1) return t2(u2[0]); } else { var a2 = e2.name; D[a2] = e2, i2 = a2; } return !r2 && i2 && (g = i2), i2 || !r2 && g; }, O = function(t2, e2) { if (S(t2)) return t2.clone(); var n2 = "object" == typeof e2 ? e2 : {}; return n2.date = t2, n2.args = arguments, new _(n2); }, b2 = v; b2.l = w, b2.i = S, b2.w = function(t2, e2) { return O(t2, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset }); }; var _ = function() { function M2(t2) { this.$L = w(t2.locale, null, true), this.parse(t2), this.$x = this.$x || t2.x || {}, this[p2] = true; } var m2 = M2.prototype; return m2.parse = function(t2) { this.$d = function(t3) { var e2 = t3.date, n2 = t3.utc; if (null === e2) return /* @__PURE__ */ new Date(NaN); if (b2.u(e2)) return /* @__PURE__ */ new Date(); if (e2 instanceof Date) return new Date(e2); if ("string" == typeof e2 && !/Z$/i.test(e2)) { var r2 = e2.match($); if (r2) { var i2 = r2[2] - 1 || 0, s2 = (r2[7] || "0").substring(0, 3); return n2 ? new Date(Date.UTC(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2)) : new Date(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2); } } return new Date(e2); }(t2), this.init(); }, m2.init = function() { var t2 = this.$d; this.$y = t2.getFullYear(), this.$M = t2.getMonth(), this.$D = t2.getDate(), this.$W = t2.getDay(), this.$H = t2.getHours(), this.$m = t2.getMinutes(), this.$s = t2.getSeconds(), this.$ms = t2.getMilliseconds(); }, m2.$utils = function() { return b2; }, m2.isValid = function() { return !(this.$d.toString() === l); }, m2.isSame = function(t2, e2) { var n2 = O(t2); return this.startOf(e2) <= n2 && n2 <= this.endOf(e2); }, m2.isAfter = function(t2, e2) { return O(t2) < this.startOf(e2); }, m2.isBefore = function(t2, e2) { return this.endOf(e2) < O(t2); }, m2.$g = function(t2, e2, n2) { return b2.u(t2) ? this[e2] : this.set(n2, t2); }, m2.unix = function() { return Math.floor(this.valueOf() / 1e3); }, m2.valueOf = function() { return this.$d.getTime(); }, m2.startOf = function(t2, e2) { var n2 = this, r2 = !!b2.u(e2) || e2, f3 = b2.p(t2), l2 = function(t3, e3) { var i2 = b2.w(n2.$u ? Date.UTC(n2.$y, e3, t3) : new Date(n2.$y, e3, t3), n2); return r2 ? i2 : i2.endOf(a); }, $2 = function(t3, e3) { return b2.w(n2.toDate()[t3].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n2); }, y3 = this.$W, M3 = this.$M, m3 = this.$D, v2 = "set" + (this.$u ? "UTC" : ""); switch (f3) { case h: return r2 ? l2(1, 0) : l2(31, 11); case c: return r2 ? l2(1, M3) : l2(0, M3 + 1); case o2: var g2 = this.$locale().weekStart || 0, D2 = (y3 < g2 ? y3 + 7 : y3) - g2; return l2(r2 ? m3 - D2 : m3 + (6 - D2), M3); case a: case d: return $2(v2 + "Hours", 0); case u: return $2(v2 + "Minutes", 1); case s: return $2(v2 + "Seconds", 2); case i: return $2(v2 + "Milliseconds", 3); default: return this.clone(); } }, m2.endOf = function(t2) { return this.startOf(t2, false); }, m2.$set = function(t2, e2) { var n2, o3 = b2.p(t2), f3 = "set" + (this.$u ? "UTC" : ""), l2 = (n2 = {}, n2[a] = f3 + "Date", n2[d] = f3 + "Date", n2[c] = f3 + "Month", n2[h] = f3 + "FullYear", n2[u] = f3 + "Hours", n2[s] = f3 + "Minutes", n2[i] = f3 + "Seconds", n2[r] = f3 + "Milliseconds", n2)[o3], $2 = o3 === a ? this.$D + (e2 - this.$W) : e2; if (o3 === c || o3 === h) { var y3 = this.clone().set(d, 1); y3.$d[l2]($2), y3.init(), this.$d = y3.set(d, Math.min(this.$D, y3.daysInMonth())).$d; } else l2 && this.$d[l2]($2); return this.init(), this; }, m2.set = function(t2, e2) { return this.clone().$set(t2, e2); }, m2.get = function(t2) { return this[b2.p(t2)](); }, m2.add = function(r2, f3) { var d2, l2 = this; r2 = Number(r2); var $2 = b2.p(f3), y3 = function(t2) { var e2 = O(l2); return b2.w(e2.date(e2.date() + Math.round(t2 * r2)), l2); }; if ($2 === c) return this.set(c, this.$M + r2); if ($2 === h) return this.set(h, this.$y + r2); if ($2 === a) return y3(1); if ($2 === o2) return y3(7); var M3 = (d2 = {}, d2[s] = e, d2[u] = n, d2[i] = t, d2)[$2] || 1, m3 = this.$d.getTime() + r2 * M3; return b2.w(m3, this); }, m2.subtract = function(t2, e2) { return this.add(-1 * t2, e2); }, m2.format = function(t2) { var e2 = this, n2 = this.$locale(); if (!this.isValid()) return n2.invalidDate || l; var r2 = t2 || "YYYY-MM-DDTHH:mm:ssZ", i2 = b2.z(this), s2 = this.$H, u2 = this.$m, a2 = this.$M, o3 = n2.weekdays, c2 = n2.months, f3 = n2.meridiem, h2 = function(t3, n3, i3, s3) { return t3 && (t3[n3] || t3(e2, r2)) || i3[n3].slice(0, s3); }, d2 = function(t3) { return b2.s(s2 % 12 || 12, t3, "0"); }, $2 = f3 || function(t3, e3, n3) { var r3 = t3 < 12 ? "AM" : "PM"; return n3 ? r3.toLowerCase() : r3; }; return r2.replace(y2, function(t3, r3) { return r3 || function(t4) { switch (t4) { case "YY": return String(e2.$y).slice(-2); case "YYYY": return b2.s(e2.$y, 4, "0"); case "M": return a2 + 1; case "MM": return b2.s(a2 + 1, 2, "0"); case "MMM": return h2(n2.monthsShort, a2, c2, 3); case "MMMM": return h2(c2, a2); case "D": return e2.$D; case "DD": return b2.s(e2.$D, 2, "0"); case "d": return String(e2.$W); case "dd": return h2(n2.weekdaysMin, e2.$W, o3, 2); case "ddd": return h2(n2.weekdaysShort, e2.$W, o3, 3); case "dddd": return o3[e2.$W]; case "H": return String(s2); case "HH": return b2.s(s2, 2, "0"); case "h": return d2(1); case "hh": return d2(2); case "a": return $2(s2, u2, true); case "A": return $2(s2, u2, false); case "m": return String(u2); case "mm": return b2.s(u2, 2, "0"); case "s": return String(e2.$s); case "ss": return b2.s(e2.$s, 2, "0"); case "SSS": return b2.s(e2.$ms, 3, "0"); case "Z": return i2; } return null; }(t3) || i2.replace(":", ""); }); }, m2.utcOffset = function() { return 15 * -Math.round(this.$d.getTimezoneOffset() / 15); }, m2.diff = function(r2, d2, l2) { var $2, y3 = this, M3 = b2.p(d2), m3 = O(r2), v2 = (m3.utcOffset() - this.utcOffset()) * e, g2 = this - m3, D2 = function() { return b2.m(y3, m3); }; switch (M3) { case h: $2 = D2() / 12; break; case c: $2 = D2(); break; case f2: $2 = D2() / 3; break; case o2: $2 = (g2 - v2) / 6048e5; break; case a: $2 = (g2 - v2) / 864e5; break; case u: $2 = g2 / n; break; case s: $2 = g2 / e; break; case i: $2 = g2 / t; break; default: $2 = g2; } return l2 ? $2 : b2.a($2); }, m2.daysInMonth = function() { return this.endOf(c).$D; }, m2.$locale = function() { return D[this.$L]; }, m2.locale = function(t2, e2) { if (!t2) return this.$L; var n2 = this.clone(), r2 = w(t2, e2, true); return r2 && (n2.$L = r2), n2; }, m2.clone = function() { return b2.w(this.$d, this); }, m2.toDate = function() { return new Date(this.valueOf()); }, m2.toJSON = function() { return this.isValid() ? this.toISOString() : null; }, m2.toISOString = function() { return this.$d.toISOString(); }, m2.toString = function() { return this.$d.toUTCString(); }, M2; }(), k = _.prototype; return O.prototype = k, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", c], ["$y", h], ["$D", d]].forEach(function(t2) { k[t2[1]] = function(e2) { return this.$g(e2, t2[0], t2[1]); }; }), O.extend = function(t2, e2) { return t2.$i || (t2(e2, _, O), t2.$i = true), O; }, O.locale = w, O.isDayjs = S, O.unix = function(t2) { return O(1e3 * t2); }, O.en = D[g], O.Ls = D, O.p = {}, O; }); } }); // node_modules/.pnpm/dayjs@1.11.10/node_modules/dayjs/plugin/duration.js var require_duration = __commonJS({ "node_modules/.pnpm/dayjs@1.11.10/node_modules/dayjs/plugin/duration.js"(exports, module) { !function(t, s) { "object" == typeof exports && "undefined" != typeof module ? module.exports = s() : "function" == typeof define && define.amd ? define(s) : (t = "undefined" != typeof globalThis ? globalThis : t || self).dayjs_plugin_duration = s(); }(exports, function() { var t, s, n = 1e3, i = 6e4, e = 36e5, r = 864e5, o2 = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, u = 31536e6, d = 2628e6, a = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/, h = { years: u, months: d, days: r, hours: e, minutes: i, seconds: n, milliseconds: 1, weeks: 6048e5 }, c = function(t2) { return t2 instanceof g; }, f2 = function(t2, s2, n2) { return new g(t2, n2, s2.$l); }, m = function(t2) { return s.p(t2) + "s"; }, l = function(t2) { return t2 < 0; }, $ = function(t2) { return l(t2) ? Math.ceil(t2) : Math.floor(t2); }, y2 = function(t2) { return Math.abs(t2); }, v = function(t2, s2) { return t2 ? l(t2) ? { negative: true, format: "" + y2(t2) + s2 } : { negative: false, format: "" + t2 + s2 } : { negative: false, format: "" }; }, g = function() { function l2(t2, s2, n2) { var i2 = this; if (this.$d = {}, this.$l = n2, void 0 === t2 && (this.$ms = 0, this.parseFromMilliseconds()), s2) return f2(t2 * h[m(s2)], this); if ("number" == typeof t2) return this.$ms = t2, this.parseFromMilliseconds(), this; if ("object" == typeof t2) return Object.keys(t2).forEach(function(s3) { i2.$d[m(s3)] = t2[s3]; }), this.calMilliseconds(), this; if ("string" == typeof t2) { var e2 = t2.match(a); if (e2) { var r2 = e2.slice(2).map(function(t3) { return null != t3 ? Number(t3) : 0; }); return this.$d.years = r2[0], this.$d.months = r2[1], this.$d.weeks = r2[2], this.$d.days = r2[3], this.$d.hours = r2[4], this.$d.minutes = r2[5], this.$d.seconds = r2[6], this.calMilliseconds(), this; } } return this; } var y3 = l2.prototype; return y3.calMilliseconds = function() { var t2 = this; this.$ms = Object.keys(this.$d).reduce(function(s2, n2) { return s2 + (t2.$d[n2] || 0) * h[n2]; }, 0); }, y3.parseFromMilliseconds = function() { var t2 = this.$ms; this.$d.years = $(t2 / u), t2 %= u, this.$d.months = $(t2 / d), t2 %= d, this.$d.days = $(t2 / r), t2 %= r, this.$d.hours = $(t2 / e), t2 %= e, this.$d.minutes = $(t2 / i), t2 %= i, this.$d.seconds = $(t2 / n), t2 %= n, this.$d.milliseconds = t2; }, y3.toISOString = function() { var t2 = v(this.$d.years, "Y"), s2 = v(this.$d.months, "M"), n2 = +this.$d.days || 0; this.$d.weeks && (n2 += 7 * this.$d.weeks); var i2 = v(n2, "D"), e2 = v(this.$d.hours, "H"), r2 = v(this.$d.minutes, "M"), o3 = this.$d.seconds || 0; this.$d.milliseconds && (o3 += this.$d.milliseconds / 1e3, o3 = Math.round(1e3 * o3) / 1e3); var u2 = v(o3, "S"), d2 = t2.negative || s2.negative || i2.negative || e2.negative || r2.negative || u2.negative, a2 = e2.format || r2.format || u2.format ? "T" : "", h2 = (d2 ? "-" : "") + "P" + t2.format + s2.format + i2.format + a2 + e2.format + r2.format + u2.format; return "P" === h2 || "-P" === h2 ? "P0D" : h2; }, y3.toJSON = function() { return this.toISOString(); }, y3.format = function(t2) { var n2 = t2 || "YYYY-MM-DDTHH:mm:ss", i2 = { Y: this.$d.years, YY: s.s(this.$d.years, 2, "0"), YYYY: s.s(this.$d.years, 4, "0"), M: this.$d.months, MM: s.s(this.$d.months, 2, "0"), D: this.$d.days, DD: s.s(this.$d.days, 2, "0"), H: this.$d.hours, HH: s.s(this.$d.hours, 2, "0"), m: this.$d.minutes, mm: s.s(this.$d.minutes, 2, "0"), s: this.$d.seconds, ss: s.s(this.$d.seconds, 2, "0"), SSS: s.s(this.$d.milliseconds, 3, "0") }; return n2.replace(o2, function(t3, s2) { return s2 || String(i2[t3]); }); }, y3.as = function(t2) { return this.$ms / h[m(t2)]; }, y3.get = function(t2) { var s2 = this.$ms, n2 = m(t2); return "milliseconds" === n2 ? s2 %= 1e3 : s2 = "weeks" === n2 ? $(s2 / h[n2]) : this.$d[n2], s2 || 0; }, y3.add = function(t2, s2, n2) { var i2; return i2 = s2 ? t2 * h[m(s2)] : c(t2) ? t2.$ms : f2(t2, this).$ms, f2(this.$ms + i2 * (n2 ? -1 : 1), this); }, y3.subtract = function(t2, s2) { return this.add(t2, s2, true); }, y3.locale = function(t2) { var s2 = this.clone(); return s2.$l = t2, s2; }, y3.clone = function() { return f2(this.$ms, this); }, y3.humanize = function(s2) { return t().add(this.$ms, "ms").locale(this.$l).fromNow(!s2); }, y3.valueOf = function() { return this.asMilliseconds(); }, y3.milliseconds = function() { return this.get("milliseconds"); }, y3.asMilliseconds = function() { return this.as("milliseconds"); }, y3.seconds = function() { return this.get("seconds"); }, y3.asSeconds = function() { return this.as("seconds"); }, y3.minutes = function() { return this.get("minutes"); }, y3.asMinutes = function() { return this.as("minutes"); }, y3.hours = function() { return this.get("hours"); }, y3.asHours = function() { return this.as("hours"); }, y3.days = function() { return this.get("days"); }, y3.asDays = function() { return this.as("days"); }, y3.weeks = function() { return this.get("weeks"); }, y3.asWeeks = function() { return this.as("weeks"); }, y3.months = function() { return this.get("months"); }, y3.asMonths = function() { return this.as("months"); }, y3.years = function() { return this.get("years"); }, y3.asYears = function() { return this.as("years"); }, l2; }(), p2 = function(t2, s2, n2) { return t2.add(s2.years() * n2, "y").add(s2.months() * n2, "M").add(s2.days() * n2, "d").add(s2.hours() * n2, "h").add(s2.minutes() * n2, "m").add(s2.seconds() * n2, "s").add(s2.milliseconds() * n2, "ms"); }; return function(n2, i2, e2) { t = e2, s = e2().$utils(), e2.duration = function(t2, s2) { var n3 = e2.locale(); return f2(t2, { $l: n3 }, s2); }, e2.isDuration = c; var r2 = i2.prototype.add, o3 = i2.prototype.subtract; i2.prototype.add = function(t2, s2) { return c(t2) ? p2(this, t2, 1) : r2.bind(this)(t2, s2); }, i2.prototype.subtract = function(t2, s2) { return c(t2) ? p2(this, t2, -1) : o3.bind(this)(t2, s2); }; }; }); } }); // node_modules/.pnpm/dayjs@1.11.10/node_modules/dayjs/plugin/localizedFormat.js var require_localizedFormat = __commonJS({ "node_modules/.pnpm/dayjs@1.11.10/node_modules/dayjs/plugin/localizedFormat.js"(exports, module) { !function(e, t) { "object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_plugin_localizedFormat = t(); }(exports, function() { var e = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }; return function(t, o2, n) { var r = o2.prototype, i = r.format; n.en.formats = e, r.format = function(t2) { void 0 === t2 && (t2 = "YYYY-MM-DDTHH:mm:ssZ"); var o3 = this.$locale().formats, n2 = function(t3, o4) { return t3.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(t4, n3, r2) { var i2 = r2 && r2.toUpperCase(); return n3 || o4[r2] || e[r2] || o4[i2].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(e2, t5, o5) { return t5 || o5.slice(1); }); }); }(t2, void 0 === o3 ? {} : o3); return i.call(this, n2); }; }; }); } }); // node_modules/.pnpm/dayjs@1.11.10/node_modules/dayjs/plugin/relativeTime.js var require_relativeTime = __commonJS({ "node_modules/.pnpm/dayjs@1.11.10/node_modules/dayjs/plugin/relativeTime.js"(exports, module) { !function(r, e) { "object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (r = "undefined" != typeof globalThis ? globalThis : r || self).dayjs_plugin_relativeTime = e(); }(exports, function() { return function(r, e, t) { r = r || {}; var n = e.prototype, o2 = { future: "in %s", past: "%s ago", s: "a few seconds", m: "a minute", mm: "%d minutes", h: "an hour", hh: "%d hours", d: "a day", dd: "%d days", M: "a month", MM: "%d months", y: "a year", yy: "%d years" }; function i(r2, e2, t2, o3) { return n.fromToBase(r2, e2, t2, o3); } t.en.relativeTime = o2, n.fromToBase = function(e2, n2, i2, d2, u) { for (var f2, a, s, l = i2.$locale().relativeTime || o2, h = r.thresholds || [{ l: "s", r: 44, d: "second" }, { l: "m", r: 89 }, { l: "mm", r: 44, d: "minute" }, { l: "h", r: 89 }, { l: "hh", r: 21, d: "hour" }, { l: "d", r: 35 }, { l: "dd", r: 25, d: "day" }, { l: "M", r: 45 }, { l: "MM", r: 10, d: "month" }, { l: "y", r: 17 }, { l: "yy", d: "year" }], m = h.length, c = 0; c < m; c += 1) { var y2 = h[c]; y2.d && (f2 = d2 ? t(e2).diff(i2, y2.d, true) : i2.diff(e2, y2.d, true)); var p2 = (r.rounding || Math.round)(Math.abs(f2)); if (s = f2 > 0, p2 <= y2.r || !y2.r) { p2 <= 1 && c > 0 && (y2 = h[c - 1]); var v = l[y2.l]; u && (p2 = u("" + p2)), a = "string" == typeof v ? v.replace("%d", p2) : v(p2, n2, y2.l, s); break; } } if (n2) return a; var M = s ? l.future : l.past; return "function" == typeof M ? M(a) : M.replace("%s", a); }, n.to = function(r2, e2) { return i(r2, e2, this, true); }, n.from = function(r2, e2) { return i(r2, e2, this); }; var d = function(r2) { return r2.$u ? t.utc() : t(); }; n.toNow = function(r2) { return this.to(d(this), r2); }, n.fromNow = function(r2) { return this.from(d(this), r2); }; }; }); } }); // node_modules/.pnpm/dlv@1.1.3/node_modules/dlv/dist/dlv.umd.js var require_dlv_umd = __commonJS({ "node_modules/.pnpm/dlv@1.1.3/node_modules/dlv/dist/dlv.umd.js"(exports, module) { !function(t, n) { "object" == typeof exports && "undefined" != typeof module ? module.exports = function(t2, n2, e, i, o2) { for (n2 = n2.split ? n2.split(".") : n2, i = 0; i < n2.length; i++) t2 = t2 ? t2[n2[i]] : o2; return t2 === o2 ? e : t2; } : "function" == typeof define && define.amd ? define(function() { return function(t2, n2, e, i, o2) { for (n2 = n2.split ? n2.split(".") : n2, i = 0; i < n2.length; i++) t2 = t2 ? t2[n2[i]] : o2; return t2 === o2 ? e : t2; }; }) : t.dlv = function(t2, n2, e, i, o2) { for (n2 = n2.split ? n2.split(".") : n2, i = 0; i < n2.length; i++) t2 = t2 ? t2[n2[i]] : o2; return t2 === o2 ? e : t2; }; }(exports); } }); // node_modules/.pnpm/solid-js@1.8.7/node_modules/solid-js/dist/solid.js var sharedConfig = { context: void 0, registry: void 0 }; function setHydrateContext(context) { sharedConfig.context = context; } function nextHydrateContext() { return { ...sharedConfig.context, id: `${sharedConfig.context.id}${sharedConfig.context.count++}-`, count: 0 }; } var equalFn = (a, b2) => a === b2; var signalOptions = { equals: equalFn }; var ERROR = null; var runEffects = runQueue; var STALE = 1; var PENDING = 2; var UNOWNED = { owned: null, cleanups: null, context: null, owner: null }; var Owner = null; var Transition = null; var Scheduler = null; var ExternalSourceFactory = null; var Listener = null; var Updates = null; var Effects = null; var ExecCount = 0; function createSignal(value, options) { options = options ? Object.assign({}, signalOptions, options) : signalOptions; const s = { value, observers: null, observerSlots: null, comparator: options.equals || void 0 }; const setter = (value2) => { if (typeof value2 === "function") { if (Transition && Transition.running && Transition.sources.has(s)) value2 = value2(s.tValue); else value2 = value2(s.value); } return writeSignal(s, value2); }; return [readSignal.bind(s), setter]; } function createRenderEffect(fn, value, options) { const c = createComputation(fn, value, false, STALE); if (Scheduler && Transition && Transition.running) Updates.push(c); else updateComputation(c); } function createMemo(fn, value, options) { options = options ? Object.assign({}, signalOptions, options) : signalOptions; const c = createComputation(fn, value, true, 0); c.observers = null; c.observerSlots = null; c.comparator = options.equals || void 0; if (Scheduler && Transition && Transition.running) { c.tState = STALE; Updates.push(c); } else updateComputation(c); return readSignal.bind(c); } function untrack(fn) { if (Listener === null) return fn(); const listener = Listener; Listener = null; try { return fn(); } finally { Listener = listener; } } function onCleanup(fn) { if (Owner === null) ; else if (Owner.cleanups === null) Owner.cleanups = [fn]; else Owner.cleanups.push(fn); return fn; } function startTransition(fn) { if (Transition && Transition.running) { fn(); return Transition.done; } const l = Listener; const o2 = Owner; return Promise.resolve().then(() => { Listener = l; Owner = o2; let t; if (Scheduler || SuspenseContext) { t = Transition || (Transition = { sources: /* @__PURE__ */ new Set(), effects: [], promises: /* @__PURE__ */ new Set(), disposed: /* @__PURE__ */ new Set(), queue: /* @__PURE__ */ new Set(), running: true }); t.done || (t.done = new Promise((res) => t.resolve = res)); t.running = true; } runUpdates(fn, false); Listener = Owner = null; return t ? t.done : void 0; }); } var [transPending, setTransPending] = /* @__PURE__ */ createSignal(false); function createContext(defaultValue, options) { const id = Symbol("context"); return { id, Provider: createProvider(id), defaultValue }; } function useContext(context) { return Owner && Owner.context && Owner.context[context.id] !== void 0 ? Owner.context[context.id] : context.defaultValue; } function children(fn) { const children2 = createMemo(fn); const memo = createMemo(() => resolveChildren(children2())); memo.toArray = () => { const c = memo(); return Array.isArray(c) ? c : c != null ? [c] : []; }; return memo; } var SuspenseContext; function readSignal() { const runningTransition = Transition && Transition.running; if (this.sources && (runningTransition ? this.tState : this.state)) { if ((runningTransition ? this.tState : this.state) === STALE) updateComputation(this); else { const updates = Updates; Updates = null; runUpdates(() => lookUpstream(this), false); Updates = updates; } } if (Listener) { const sSlot = this.observers ? this.observers.length : 0; if (!Listener.sources) { Listener.sources = [this]; Listener.sourceSlots = [sSlot]; } else { Listener.sources.push(this); Listener.sourceSlots.push(sSlot); } if (!this.observers) { this.observers = [Listener]; this.observerSlots = [Listener.sources.length - 1]; } else { this.observers.push(Listener); this.observerSlots.push(Listener.sources.length - 1); } } if (runningTransition && Transition.sources.has(this)) return this.tValue; return this.value; } function writeSignal(node, value, isComp) { let current = Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value; if (!node.comparator || !node.comparator(current, value)) { if (Transition) { const TransitionRunning = Transition.running; if (TransitionRunning || !isComp && Transition.sources.has(node)) { Transition.sources.add(node); node.tValue = value; } if (!TransitionRunning) node.value = value; } else node.value = value; if (node.observers && node.observers.length) { runUpdates(() => { for (let i = 0; i < node.observers.length; i += 1) { const o2 = node.observers[i]; const TransitionRunning = Transition && Transition.running; if (TransitionRunning && Transition.disposed.has(o2)) continue; if (TransitionRunning ? !o2.tState : !o2.state) { if (o2.pure) Updates.push(o2); else Effects.push(o2); if (o2.observers) markDownstream(o2); } if (!TransitionRunning) o2.state = STALE; else o2.tState = STALE; } if (Updates.length > 1e6) { Updates = []; if (false) ; throw new Error(); } }, false); } } return value; } function updateComputation(node) { if (!node.fn) return; cleanNode(node); const time = ExecCount; runComputation( node, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value, time ); if (Transition && !Transition.running && Transition.sources.has(node)) { queueMicrotask(() => { runUpdates(() => { Transition && (Transition.running = true); Listener = Owner = node; runComputation(node, node.tValue, time); Listener = Owner = null; }, false); }); } } function runComputation(node, value, time) { let nextValue; const owner = Owner, listener = Listener; Listener = Owner = node; try { nextValue = node.fn(value); } catch (err) { if (node.pure) { if (Transition && Transition.running) { node.tState = STALE; node.tOwned && node.tOwned.forEach(cleanNode); node.tOwned = void 0; } else { node.state = STALE; node.owned && node.owned.forEach(cleanNode); node.owned = null; } } node.updatedAt = time + 1; return handleError(err); } finally { Listener = listener; Owner = owner; } if (!node.updatedAt || node.updatedAt <= time) { if (node.updatedAt != null && "observers" in node) { writeSignal(node, nextValue, true); } else if (Transition && Transition.running && node.pure) { Transition.sources.add(node); node.tValue = nextValue; } else node.value = nextValue; node.updatedAt = time; } } function createComputation(fn, init, pure, state = STALE, options) { const c = { fn, state, updatedAt: null, owned: null, sources: null, sourceSlots: null, cleanups: null, value: init, owner: Owner, context: Owner ? Owner.context : null, pure }; if (Transition && Transition.running) { c.state = 0; c.tState = state; } if (Owner === null) ; else if (Owner !== UNOWNED) { if (Transition && Transition.running && Owner.pure) { if (!Owner.tOwned) Owner.tOwned = [c]; else Owner.tOwned.push(c); } else { if (!Owner.owned) Owner.owned = [c]; else Owner.owned.push(c); } } if (ExternalSourceFactory) { const [track, trigger] = createSignal(void 0, { equals: false }); const ordinary = ExternalSourceFactory(c.fn, trigger); onCleanup(() => ordinary.dispose()); const triggerInTransition = () => startTransition(trigger).then(() => inTransition.dispose()); const inTransition = ExternalSourceFactory(c.fn, triggerInTransition); c.fn = (x2) => { track(); return Transition && Transition.running ? inTransition.track(x2) : ordinary.track(x2); }; } return c; } function runTop(node) { const runningTransition = Transition && Transition.running; if ((runningTransition ? node.tState : node.state) === 0) return; if ((runningTransition ? node.tState : node.state) === PENDING) return lookUpstream(node); if (node.suspense && untrack(node.suspense.inFallback)) return node.suspense.effects.push(node); const ancestors = [node]; while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) { if (runningTransition && Transition.disposed.has(node)) return; if (runningTransition ? node.tState : node.state) ancestors.push(node); } for (let i = ancestors.length - 1; i >= 0; i--) { node = ancestors[i]; if (runningTransition) { let top = node, prev = ancestors[i + 1]; while ((top = top.owner) && top !== prev) { if (Transition.disposed.has(top)) return; } } if ((runningTransition ? node.tState : node.state) === STALE) { updateComputation(node); } else if ((runningTransition ? node.tState : node.state) === PENDING) { const updates = Updates; Updates = null; runUpdates(() => lookUpstream(node, ancestors[0]), false); Updates = updates; } } } function runUpdates(fn, init) { if (Updates) return fn(); let wait = false; if (!init) Updates = []; if (Effects) wait = true; else Effects = []; ExecCount++; try { const res = fn(); completeUpdates(wait); return res; } catch (err) { if (!wait) Effects = null; Updates = null; handleError(err); } } function completeUpdates(wait) { if (Updates) { if (Scheduler && Transition && Transition.running) scheduleQueue(Updates); else runQueue(Updates); Updates = null; } if (wait) return; let res; if (Transition) { if (!Transition.promises.size && !Transition.queue.size) { const sources = Transition.sources; const disposed = Transition.disposed; Effects.push.apply(Effects, Transition.effects); res = Transition.resolve; for (const e2 of Effects) { "tState" in e2 && (e2.state = e2.tState); delete e2.tState; } Transition = null; runUpdates(() => { for (const d of disposed) cleanNode(d); for (const v of sources) { v.value = v.tValue; if (v.owned) { for (let i = 0, len = v.owned.length; i < len; i++) cleanNode(v.owned[i]); } if (v.tOwned) v.owned = v.tOwned; delete v.tValue; delete v.tOwned; v.tState = 0; } setTransPending(false); }, false); } else if (Transition.running) { Transition.running = false; Transition.effects.push.apply(Transition.effects, Effects); Effects = null; setTransPending(true); return; } } const e = Effects; Effects = null; if (e.length) runUpdates(() => runEffects(e), false); if (res) res(); } function runQueue(queue) { for (let i = 0; i < queue.length; i++) runTop(queue[i]); } function scheduleQueue(queue) { for (let i = 0; i < queue.length; i++) { const item = queue[i]; const tasks = Transition.queue; if (!tasks.has(item)) { tasks.add(item); Scheduler(() => { tasks.delete(item); runUpdates(() => { Transition.running = true; runTop(item); }, false); Transition && (Transition.running = false); }); } } } function lookUpstream(node, ignore) { const runningTransition = Transition && Transition.running; if (runningTransition) node.tState = 0; else node.state = 0; for (let i = 0; i < node.sources.length; i += 1) { const source = node.sources[i]; if (source.sources) { const state = runningTransition ? source.tState : source.state; if (state === STALE) { if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount)) runTop(source); } else if (state === PENDING) lookUpstream(source, ignore); } } } function markDownstream(node) { const runningTransition = Transition && Transition.running; for (let i = 0; i < node.observers.length; i += 1) { const o2 = node.observers[i]; if (runningTransition ? !o2.tState : !o2.state) { if (runningTransition) o2.tState = PENDING; else o2.state = PENDING; if (o2.pure) Updates.push(o2); else Effects.push(o2); o2.observers && markDownstream(o2); } } } function cleanNode(node) { let i; if (node.sources) { while (node.sources.length) { const source = node.sources.pop(), index = node.sourceSlots.pop(), obs = source.observers; if (obs && obs.length) { const n = obs.pop(), s = source.observerSlots.pop(); if (index < obs.length) { n.sourceSlots[s] = index; obs[index] = n; source.observerSlots[index] = s; } } } } if (Transition && Transition.running && node.pure) { if (node.tOwned) { for (i = node.tOwned.length - 1; i >= 0; i--) cleanNode(node.tOwned[i]); delete node.tOwned; } reset(node, true); } else if (node.owned) { for (i = node.owned.length - 1; i >= 0; i--) cleanNode(node.owned[i]); node.owned = null; } if (node.cleanups) { for (i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i](); node.cleanups = null; } if (Transition && Transition.running) node.tState = 0; else node.state = 0; } function reset(node, top) { if (!top) { node.tState = 0; Transition.disposed.add(node); } if (node.owned) { for (let i = 0; i < node.owned.length; i++) reset(node.owned[i]); } } function castError(err) { if (err instanceof Error) return err; return new Error(typeof err === "string" ? err : "Unknown error", { cause: err }); } function runErrors(err, fns, owner) { try { for (const f2 of fns) f2(err); } catch (e) { handleError(e, owner && owner.owner || null); } } function handleError(err, owner = Owner) { const fns = ERROR && owner && owner.context && owner.context[ERROR]; const error = castError(err); if (!fns) throw error; if (Effects) Effects.push({ fn() { runErrors(error, fns, owner); }, state: STALE }); else runErrors(error, fns, owner); } function resolveChildren(children2) { if (typeof children2 === "function" && !children2.length) return resolveChildren(children2()); if (Array.isArray(children2)) { const results = []; for (let i = 0; i < children2.length; i++) { const result = resolveChildren(children2[i]); Array.isArray(result) ? results.push.apply(results, result) : results.push(result); } return results; } return children2; } function createProvider(id, options) { return function provider(props) { let res; createRenderEffect( () => res = untrack(() => { Owner.context = { ...Owner.context, [id]: props.value }; return children(() => props.children); }), void 0 ); return res; }; } var hydrationEnabled = false; function createComponent(Comp, props) { if (hydrationEnabled) { if (sharedConfig.context) { const c = sharedConfig.context; setHydrateContext(nextHydrateContext()); const r = untrack(() => Comp(props || {})); setHydrateContext(c); return r; } } return untrack(() => Comp(props || {})); } // node_modules/.pnpm/solid-js@1.8.7/node_modules/solid-js/web/dist/web.js var booleans = [ "allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "inert", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected" ]; /* @__PURE__ */ new Set([ "className", "value", "readOnly", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans ]); // node_modules/.pnpm/rosetty@2.1.0/node_modules/rosetty/dist/index.js var import_dayjs = __toESM(require_dayjs_min(), 1); var import_duration = __toESM(require_duration(), 1); var import_localizedFormat = __toESM(require_localizedFormat(), 1); var import_relativeTime = __toESM(require_relativeTime(), 1); // node_modules/.pnpm/rosetta@1.1.0/node_modules/rosetta/dist/index.mjs var import_dlv = __toESM(require_dlv_umd(), 1); // node_modules/.pnpm/templite@1.2.0/node_modules/templite/dist/templite.mjs var RGX = /{{(.*?)}}/g; function templite_default(str, mix) { return str.replace(RGX, (x2, key, y2) => { x2 = 0; y2 = mix; key = key.trim().split("."); while (y2 && x2 < key.length) { y2 = y2[key[x2++]]; } return y2 != null ? y2 : ""; }); } // node_modules/.pnpm/rosetta@1.1.0/node_modules/rosetta/dist/index.mjs function dist_default(obj) { var locale = "", tree = obj || {}; return { set(lang, table) { tree[lang] = Object.assign(tree[lang] || {}, table); }, locale(lang) { return locale = lang || locale; }, table(lang) { return tree[lang]; }, t(key, params, lang) { var val = (0, import_dlv.default)(tree[lang || locale], key, ""); if (typeof val === "function") return val(params); if (typeof val === "string") return templite_default(val, params); return val; } }; } // node_modules/.pnpm/rosetty@2.1.0/node_modules/rosetty/dist/index.js var o = import_dayjs.default; o.extend(import_relativeTime.default); o.extend(import_duration.default); o.extend(import_localizedFormat.default); var x = (u, l, s) => { let n = u, r, a; if (typeof u != "object") throw new Error("rosetty: data must be an object with at least one language"); n = Object.keys(n).reduce((e, t) => (typeof n[t] == "object" && typeof n[t].dict == "object" && typeof n[t].locale == "object" && (e[t] = n[t]), e), {}); let c = dist_default(Object.entries(n)?.map(([e, t]) => [e, t.dict])?.reduce((e, [t, i]) => ({ ...e, [t]: i }), {})), m = (e) => { if (!n[e]) throw new Error(`rosetty: language ${e} not found`); r = n[e], a = e, c.locale(e); }; return l && m(l), { changeLang: m, languages: Object.keys(n), getCurrentLang: () => a, t: (e, t, i) => { if (a) if (i) { let g = dist_default(i); return g.locale(a), g.t(e, t) || (s ? e : void 0); } else return c.t(e, t) || (s ? e : void 0); else return s ? e : void 0; }, displayNames: (e, t) => new Intl.DisplayNames([r?.locale.name], t).of(e), listFormat: (e, t) => new Intl.ListFormat(r?.locale.name, t).format(e), numberFormat: (e, t) => new Intl.NumberFormat(r?.locale.name, t).format(e), pluralRules: (e, t) => new Intl.PluralRules(r?.locale.name, t).select(e), format: (e, t) => o(e).locale(r.locale).format(t), formatRelative: (e, t) => o(e).locale(r.locale).from(o(t), true), formatDistance: (e, t) => o(e).locale(r.locale).from(o(t), true), formatDistanceToNow: (e) => o(e).locale(r.locale).fromNow(true), formatDuration: (e) => o.duration(e).locale(r.locale.name).humanize() }; }; // src/index.tsx var RosettyContext = createContext(); var RosettyProvider = (props) => { const r = x(props.languages, props.defaultLanguage, props.translateFallback); const [lastUpdate, setLastUpdate] = createSignal(0); const [actualLang, setActualLang] = createSignal(props.defaultLanguage); const changeLang = (lang) => { r.changeLang(lang); setActualLang(r.getCurrentLang()); setLastUpdate(Date.now()); }; return createComponent(RosettyContext.Provider, { get value() { return { ...r, actualLang, changeLang, lastUpdate: lastUpdate() }; }, get children() { return props.children; } }); }; function useRosetty() { const client = useContext(RosettyContext); if (!client) { throw new Error("No RosettyClient set, use RosettyProvider to set one"); } return client; } export { RosettyContext, RosettyProvider, useRosetty };