var __create = Object.create; var __defProp = Object.defineProperty; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __getOwnPropNames = Object.getOwnPropertyNames; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __markAsModule = (target) => __defProp(target, "__esModule", {value: true}); var __commonJS = (callback, module) => () => { if (!module) { module = {exports: {}}; callback(module.exports, module); } return module.exports; }; var __export = (target, all) => { for (var name2 in all) __defProp(target, name2, {get: all[name2], enumerable: true}); }; var __exportStar = (target, module, desc) => { if (module && typeof module === "object" || typeof module === "function") { for (let key of __getOwnPropNames(module)) if (!__hasOwnProp.call(target, key) && key !== "default") __defProp(target, key, {get: () => module[key], enumerable: !(desc = __getOwnPropDesc(module, key)) || desc.enumerable}); } return target; }; var __toModule = (module) => { return __exportStar(__markAsModule(__defProp(module != null ? __create(__getProtoOf(module)) : {}, "default", module && module.__esModule && "default" in module ? {get: () => module.default, enumerable: true} : {value: module, enumerable: true})), module); }; // node_modules/dayjs/plugin/customParseFormat.js var require_customParseFormat = __commonJS((exports, module) => { !function(e2, t2) { typeof exports == "object" && typeof module != "undefined" ? module.exports = t2() : typeof define == "function" && define.amd ? define(t2) : (e2 = typeof globalThis != "undefined" ? globalThis : e2 || self).dayjs_plugin_customParseFormat = t2(); }(exports, function() { "use strict"; var e2 = {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"}, t2 = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, n2 = /\d\d/, r2 = /\d\d?/, i = /\d*[^-_:/,()\s\d]+/, o2 = {}, s2 = function(e3) { return (e3 = +e3) + (e3 > 68 ? 1900 : 2e3); }; var a2 = function(e3) { return function(t3) { this[e3] = +t3; }; }, f = [/[+-]\d\d:?(\d\d)?|Z/, function(e3) { (this.zone || (this.zone = {})).offset = function(e4) { if (!e4) return 0; if (e4 === "Z") return 0; var t3 = e4.match(/([+-]|\d\d)/g), n3 = 60 * t3[1] + (+t3[2] || 0); return n3 === 0 ? 0 : t3[0] === "+" ? -n3 : n3; }(e3); }], h = function(e3) { var t3 = o2[e3]; return t3 && (t3.indexOf ? t3 : t3.s.concat(t3.f)); }, u = function(e3, t3) { var n3, r3 = o2.meridiem; if (r3) { for (var i2 = 1; i2 <= 24; i2 += 1) if (e3.indexOf(r3(i2, 0, t3)) > -1) { n3 = i2 > 12; break; } } else n3 = e3 === (t3 ? "pm" : "PM"); return n3; }, d = {A: [i, function(e3) { this.afternoon = u(e3, false); }], a: [i, function(e3) { this.afternoon = u(e3, true); }], S: [/\d/, function(e3) { this.milliseconds = 100 * +e3; }], SS: [n2, function(e3) { this.milliseconds = 10 * +e3; }], SSS: [/\d{3}/, function(e3) { this.milliseconds = +e3; }], s: [r2, a2("seconds")], ss: [r2, a2("seconds")], m: [r2, a2("minutes")], mm: [r2, a2("minutes")], H: [r2, a2("hours")], h: [r2, a2("hours")], HH: [r2, a2("hours")], hh: [r2, a2("hours")], D: [r2, a2("day")], DD: [n2, a2("day")], Do: [i, function(e3) { var t3 = o2.ordinal, n3 = e3.match(/\d+/); if (this.day = n3[0], t3) for (var r3 = 1; r3 <= 31; r3 += 1) t3(r3).replace(/\[|\]/g, "") === e3 && (this.day = r3); }], M: [r2, a2("month")], MM: [n2, a2("month")], MMM: [i, function(e3) { var t3 = h("months"), n3 = (h("monthsShort") || t3.map(function(e4) { return e4.slice(0, 3); })).indexOf(e3) + 1; if (n3 < 1) throw new Error(); this.month = n3 % 12 || n3; }], MMMM: [i, function(e3) { var t3 = h("months").indexOf(e3) + 1; if (t3 < 1) throw new Error(); this.month = t3 % 12 || t3; }], Y: [/[+-]?\d+/, a2("year")], YY: [n2, function(e3) { this.year = s2(e3); }], YYYY: [/\d{4}/, a2("year")], Z: f, ZZ: f}; function c2(n3) { var r3, i2; r3 = n3, i2 = o2 && o2.formats; for (var s3 = (n3 = r3.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(t3, n4, r4) { var o3 = r4 && r4.toUpperCase(); return n4 || i2[r4] || e2[r4] || i2[o3].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(e3, t4, n5) { return t4 || n5.slice(1); }); })).match(t2), a3 = s3.length, f2 = 0; f2 < a3; f2 += 1) { var h2 = s3[f2], u2 = d[h2], c3 = u2 && u2[0], l = u2 && u2[1]; s3[f2] = l ? {regex: c3, parser: l} : h2.replace(/^\[|\]$/g, ""); } return function(e3) { for (var t3 = {}, n4 = 0, r4 = 0; n4 < a3; n4 += 1) { var i3 = s3[n4]; if (typeof i3 == "string") r4 += i3.length; else { var o3 = i3.regex, f3 = i3.parser, h3 = e3.slice(r4), u3 = o3.exec(h3)[0]; f3.call(t3, u3), e3 = e3.replace(u3, ""); } } return function(e4) { var t4 = e4.afternoon; if (t4 !== void 0) { var n5 = e4.hours; t4 ? n5 < 12 && (e4.hours += 12) : n5 === 12 && (e4.hours = 0), delete e4.afternoon; } }(t3), t3; }; } return function(e3, t3, n3) { n3.p.customParseFormat = true, e3 && e3.parseTwoDigitYear && (s2 = e3.parseTwoDigitYear); var r3 = t3.prototype, i2 = r3.parse; r3.parse = function(e4) { var t4 = e4.date, r4 = e4.utc, s3 = e4.args; this.$u = r4; var a3 = s3[1]; if (typeof a3 == "string") { var f2 = s3[2] === true, h2 = s3[3] === true, u2 = f2 || h2, d2 = s3[2]; h2 && (d2 = s3[2]), o2 = this.$locale(), !f2 && d2 && (o2 = n3.Ls[d2]), this.$d = function(e5, t5, n4) { try { if (["x", "X"].indexOf(t5) > -1) return new Date((t5 === "X" ? 1e3 : 1) * e5); var r5 = c2(t5)(e5), i3 = r5.year, o3 = r5.month, s4 = r5.day, a4 = r5.hours, f3 = r5.minutes, h3 = r5.seconds, u3 = r5.milliseconds, d3 = r5.zone, l2 = new Date(), m2 = s4 || (i3 || o3 ? 1 : l2.getDate()), M3 = i3 || l2.getFullYear(), Y2 = 0; i3 && !o3 || (Y2 = o3 > 0 ? o3 - 1 : l2.getMonth()); var p2 = a4 || 0, v = f3 || 0, D2 = h3 || 0, g = u3 || 0; return d3 ? new Date(Date.UTC(M3, Y2, m2, p2, v, D2, g + 60 * d3.offset * 1e3)) : n4 ? new Date(Date.UTC(M3, Y2, m2, p2, v, D2, g)) : new Date(M3, Y2, m2, p2, v, D2, g); } catch (e6) { return new Date(""); } }(t4, a3, r4), this.init(), d2 && d2 !== true && (this.$L = this.locale(d2).$L), u2 && t4 != this.format(a3) && (this.$d = new Date("")), o2 = {}; } else if (a3 instanceof Array) for (var l = a3.length, m = 1; m <= l; m += 1) { s3[1] = a3[m - 1]; var M2 = n3.apply(this, s3); if (M2.isValid()) { this.$d = M2.$d, this.$L = M2.$L, this.init(); break; } m === l && (this.$d = new Date("")); } else i2.call(this, e4); }; }; }); }); // node_modules/dayjs/plugin/localeData.js var require_localeData = __commonJS((exports, module) => { !function(n2, e2) { typeof exports == "object" && typeof module != "undefined" ? module.exports = e2() : typeof define == "function" && define.amd ? define(e2) : (n2 = typeof globalThis != "undefined" ? globalThis : n2 || self).dayjs_plugin_localeData = e2(); }(exports, function() { "use strict"; return function(n2, e2, t2) { var r2 = e2.prototype, o2 = function(n3) { return n3 && (n3.indexOf ? n3 : n3.s); }, u = function(n3, e3, t3, r3, u2) { var i2 = n3.name ? n3 : n3.$locale(), a3 = o2(i2[e3]), s3 = o2(i2[t3]), f = a3 || s3.map(function(n4) { return n4.slice(0, r3); }); if (!u2) return f; var d = i2.weekStart; return f.map(function(n4, e4) { return f[(e4 + (d || 0)) % 7]; }); }, i = function() { return t2.Ls[t2.locale()]; }, a2 = function(n3, e3) { return n3.formats[e3] || function(n4) { return n4.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(n5, e4, t3) { return e4 || t3.slice(1); }); }(n3.formats[e3.toUpperCase()]); }, s2 = function() { var n3 = this; return {months: function(e3) { return e3 ? e3.format("MMMM") : u(n3, "months"); }, monthsShort: function(e3) { return e3 ? e3.format("MMM") : u(n3, "monthsShort", "months", 3); }, firstDayOfWeek: function() { return n3.$locale().weekStart || 0; }, weekdays: function(e3) { return e3 ? e3.format("dddd") : u(n3, "weekdays"); }, weekdaysMin: function(e3) { return e3 ? e3.format("dd") : u(n3, "weekdaysMin", "weekdays", 2); }, weekdaysShort: function(e3) { return e3 ? e3.format("ddd") : u(n3, "weekdaysShort", "weekdays", 3); }, longDateFormat: function(e3) { return a2(n3.$locale(), e3); }, meridiem: this.$locale().meridiem, ordinal: this.$locale().ordinal}; }; r2.localeData = function() { return s2.bind(this)(); }, t2.localeData = function() { var n3 = i(); return {firstDayOfWeek: function() { return n3.weekStart || 0; }, weekdays: function() { return t2.weekdays(); }, weekdaysShort: function() { return t2.weekdaysShort(); }, weekdaysMin: function() { return t2.weekdaysMin(); }, months: function() { return t2.months(); }, monthsShort: function() { return t2.monthsShort(); }, longDateFormat: function(e3) { return a2(n3, e3); }, meridiem: n3.meridiem, ordinal: n3.ordinal}; }, t2.months = function() { return u(i(), "months"); }, t2.monthsShort = function() { return u(i(), "monthsShort", "months", 3); }, t2.weekdays = function(n3) { return u(i(), "weekdays", null, null, n3); }, t2.weekdaysShort = function(n3) { return u(i(), "weekdaysShort", "weekdays", 3, n3); }, t2.weekdaysMin = function(n3) { return u(i(), "weekdaysMin", "weekdays", 2, n3); }; }; }); }); // node_modules/dayjs/plugin/timezone.js var require_timezone = __commonJS((exports, module) => { !function(t2, e2) { typeof exports == "object" && typeof module != "undefined" ? module.exports = e2() : typeof define == "function" && define.amd ? define(e2) : (t2 = typeof globalThis != "undefined" ? globalThis : t2 || self).dayjs_plugin_timezone = e2(); }(exports, function() { "use strict"; var t2 = {year: 0, month: 1, day: 2, hour: 3, minute: 4, second: 5}, e2 = {}; return function(n2, i, o2) { var r2, a2 = function(t3, n3, i2) { i2 === void 0 && (i2 = {}); var o3 = new Date(t3), r3 = function(t4, n4) { n4 === void 0 && (n4 = {}); var i3 = n4.timeZoneName || "short", o4 = t4 + "|" + i3, r4 = e2[o4]; return r4 || (r4 = new Intl.DateTimeFormat("en-US", {hour12: false, timeZone: t4, year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZoneName: i3}), e2[o4] = r4), r4; }(n3, i2); return r3.formatToParts(o3); }, u = function(e3, n3) { for (var i2 = a2(e3, n3), r3 = [], u2 = 0; u2 < i2.length; u2 += 1) { var f2 = i2[u2], s3 = f2.type, m = f2.value, c2 = t2[s3]; c2 >= 0 && (r3[c2] = parseInt(m, 10)); } var d = r3[3], l = d === 24 ? 0 : d, v = r3[0] + "-" + r3[1] + "-" + r3[2] + " " + l + ":" + r3[4] + ":" + r3[5] + ":000", h = +e3; return (o2.utc(v).valueOf() - (h -= h % 1e3)) / 6e4; }, f = i.prototype; f.tz = function(t3, e3) { t3 === void 0 && (t3 = r2); var n3 = this.utcOffset(), i2 = this.toDate(), a3 = i2.toLocaleString("en-US", {timeZone: t3}), u2 = Math.round((i2 - new Date(a3)) / 1e3 / 60), f2 = o2(a3).$set("millisecond", this.$ms).utcOffset(15 * -Math.round(i2.getTimezoneOffset() / 15) - u2, true); if (e3) { var s3 = f2.utcOffset(); f2 = f2.add(n3 - s3, "minute"); } return f2.$x.$timezone = t3, f2; }, f.offsetName = function(t3) { var e3 = this.$x.$timezone || o2.tz.guess(), n3 = a2(this.valueOf(), e3, {timeZoneName: t3}).find(function(t4) { return t4.type.toLowerCase() === "timezonename"; }); return n3 && n3.value; }; var s2 = f.startOf; f.startOf = function(t3, e3) { if (!this.$x || !this.$x.$timezone) return s2.call(this, t3, e3); var n3 = o2(this.format("YYYY-MM-DD HH:mm:ss:SSS")); return s2.call(n3, t3, e3).tz(this.$x.$timezone, true); }, o2.tz = function(t3, e3, n3) { var i2 = n3 && e3, a3 = n3 || e3 || r2, f2 = u(+o2(), a3); if (typeof t3 != "string") return o2(t3).tz(a3); var s3 = function(t4, e4, n4) { var i3 = t4 - 60 * e4 * 1e3, o3 = u(i3, n4); if (e4 === o3) return [i3, e4]; var r3 = u(i3 -= 60 * (o3 - e4) * 1e3, n4); return o3 === r3 ? [i3, o3] : [t4 - 60 * Math.min(o3, r3) * 1e3, Math.max(o3, r3)]; }(o2.utc(t3, i2).valueOf(), f2, a3), m = s3[0], c2 = s3[1], d = o2(m).utcOffset(c2); return d.$x.$timezone = a3, d; }, o2.tz.guess = function() { return Intl.DateTimeFormat().resolvedOptions().timeZone; }, o2.tz.setDefault = function(t3) { r2 = t3; }; }; }); }); // node_modules/dayjs/plugin/utc.js var require_utc = __commonJS((exports, module) => { !function(t2, i) { typeof exports == "object" && typeof module != "undefined" ? module.exports = i() : typeof define == "function" && define.amd ? define(i) : (t2 = typeof globalThis != "undefined" ? globalThis : t2 || self).dayjs_plugin_utc = i(); }(exports, function() { "use strict"; var t2 = "minute", i = /[+-]\d\d(?::?\d\d)?/g, e2 = /([+-]|\d\d)/g; return function(s2, f, n2) { var u = f.prototype; n2.utc = function(t3) { var i2 = {date: t3, utc: true, args: arguments}; return new f(i2); }, u.utc = function(i2) { var e3 = n2(this.toDate(), {locale: this.$L, utc: true}); return i2 ? e3.add(this.utcOffset(), t2) : e3; }, u.local = function() { return n2(this.toDate(), {locale: this.$L, utc: false}); }; var o2 = u.parse; u.parse = function(t3) { t3.utc && (this.$u = true), this.$utils().u(t3.$offset) || (this.$offset = t3.$offset), o2.call(this, t3); }; var r2 = u.init; u.init = function() { if (this.$u) { var t3 = this.$d; this.$y = t3.getUTCFullYear(), this.$M = t3.getUTCMonth(), this.$D = t3.getUTCDate(), this.$W = t3.getUTCDay(), this.$H = t3.getUTCHours(), this.$m = t3.getUTCMinutes(), this.$s = t3.getUTCSeconds(), this.$ms = t3.getUTCMilliseconds(); } else r2.call(this); }; var a2 = u.utcOffset; u.utcOffset = function(s3, f2) { var n3 = this.$utils().u; if (n3(s3)) return this.$u ? 0 : n3(this.$offset) ? a2.call(this) : this.$offset; if (typeof s3 == "string" && (s3 = function(t3) { t3 === void 0 && (t3 = ""); var s4 = t3.match(i); if (!s4) return null; var f3 = ("" + s4[0]).match(e2) || ["-", 0, 0], n4 = f3[0], u3 = 60 * +f3[1] + +f3[2]; return u3 === 0 ? 0 : n4 === "+" ? u3 : -u3; }(s3), s3 === null)) return this; var u2 = Math.abs(s3) <= 16 ? 60 * s3 : s3, o3 = this; if (f2) return o3.$offset = u2, o3.$u = s3 === 0, o3; if (s3 !== 0) { var r3 = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset(); (o3 = this.local().add(u2 + r3, t2)).$offset = u2, o3.$x.$localOffset = r3; } else o3 = this.utc(); return o3; }; var h = u.format; u.format = function(t3) { var i2 = t3 || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : ""); return h.call(this, i2); }, u.valueOf = function() { var t3 = this.$utils().u(this.$offset) ? 0 : this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset()); return this.$d.valueOf() - 6e4 * t3; }, u.isUTC = function() { return !!this.$u; }, u.toISOString = function() { return this.toDate().toISOString(); }, u.toString = function() { return this.toDate().toUTCString(); }; var l = u.toDate; u.toDate = function(t3) { return t3 === "s" && this.$offset ? n2(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : l.call(this); }; var c2 = u.diff; u.diff = function(t3, i2, e3) { if (t3 && this.$u === t3.$u) return c2.call(this, t3, i2, e3); var s3 = this.local(), f2 = n2(t3).local(); return c2.call(s3, f2, i2, e3); }; }; }); }); // node_modules/dayjs/dayjs.min.js var require_dayjs_min = __commonJS((exports, module) => { !function(t2, e2) { typeof exports == "object" && typeof module != "undefined" ? module.exports = e2() : typeof define == "function" && define.amd ? define(e2) : (t2 = typeof globalThis != "undefined" ? globalThis : t2 || self).dayjs = e2(); }(exports, function() { "use strict"; var t2 = 1e3, e2 = 6e4, n2 = 36e5, r2 = "millisecond", i = "second", s2 = "minute", u = "hour", a2 = "day", o2 = "week", f = "month", h = "quarter", c2 = "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+)?$/, y = /\[([^\]]+)]|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, M2 = {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(t3) { var e3 = ["th", "st", "nd", "rd"], n3 = t3 % 100; return "[" + t3 + (e3[(n3 - 20) % 10] || e3[n3] || e3[0]) + "]"; }}, m = function(t3, e3, n3) { var r3 = String(t3); return !r3 || r3.length >= e3 ? t3 : "" + Array(e3 + 1 - r3.length).join(n3) + t3; }, v = {s: m, z: function(t3) { var e3 = -t3.utcOffset(), n3 = Math.abs(e3), r3 = Math.floor(n3 / 60), i2 = n3 % 60; return (e3 <= 0 ? "+" : "-") + m(r3, 2, "0") + ":" + m(i2, 2, "0"); }, m: function t3(e3, n3) { if (e3.date() < n3.date()) return -t3(n3, e3); var r3 = 12 * (n3.year() - e3.year()) + (n3.month() - e3.month()), i2 = e3.clone().add(r3, f), s3 = n3 - i2 < 0, u2 = e3.clone().add(r3 + (s3 ? -1 : 1), f); return +(-(r3 + (n3 - i2) / (s3 ? i2 - u2 : u2 - i2)) || 0); }, a: function(t3) { return t3 < 0 ? Math.ceil(t3) || 0 : Math.floor(t3); }, p: function(t3) { return {M: f, y: c2, w: o2, d: a2, D: d, h: u, m: s2, s: i, ms: r2, Q: h}[t3] || String(t3 || "").toLowerCase().replace(/s$/, ""); }, u: function(t3) { return t3 === void 0; }}, g = "en", D2 = {}; D2[g] = M2; var p2 = function(t3) { return t3 instanceof _; }, S2 = function t3(e3, n3, r3) { var i2; if (!e3) return g; if (typeof e3 == "string") { var s3 = e3.toLowerCase(); D2[s3] && (i2 = s3), n3 && (D2[s3] = n3, i2 = s3); var u2 = e3.split("-"); if (!i2 && u2.length > 1) return t3(u2[0]); } else { var a3 = e3.name; D2[a3] = e3, i2 = a3; } return !r3 && i2 && (g = i2), i2 || !r3 && g; }, w = function(t3, e3) { if (p2(t3)) return t3.clone(); var n3 = typeof e3 == "object" ? e3 : {}; return n3.date = t3, n3.args = arguments, new _(n3); }, O = v; O.l = S2, O.i = p2, O.w = function(t3, e3) { return w(t3, {locale: e3.$L, utc: e3.$u, x: e3.$x, $offset: e3.$offset}); }; var _ = function() { function M3(t3) { this.$L = S2(t3.locale, null, true), this.parse(t3); } var m2 = M3.prototype; return m2.parse = function(t3) { this.$d = function(t4) { var e3 = t4.date, n3 = t4.utc; if (e3 === null) return new Date(NaN); if (O.u(e3)) return new Date(); if (e3 instanceof Date) return new Date(e3); if (typeof e3 == "string" && !/Z$/i.test(e3)) { var r3 = e3.match($); if (r3) { var i2 = r3[2] - 1 || 0, s3 = (r3[7] || "0").substring(0, 3); return n3 ? new Date(Date.UTC(r3[1], i2, r3[3] || 1, r3[4] || 0, r3[5] || 0, r3[6] || 0, s3)) : new Date(r3[1], i2, r3[3] || 1, r3[4] || 0, r3[5] || 0, r3[6] || 0, s3); } } return new Date(e3); }(t3), this.$x = t3.x || {}, this.init(); }, m2.init = function() { var t3 = this.$d; this.$y = t3.getFullYear(), this.$M = t3.getMonth(), this.$D = t3.getDate(), this.$W = t3.getDay(), this.$H = t3.getHours(), this.$m = t3.getMinutes(), this.$s = t3.getSeconds(), this.$ms = t3.getMilliseconds(); }, m2.$utils = function() { return O; }, m2.isValid = function() { return !(this.$d.toString() === l); }, m2.isSame = function(t3, e3) { var n3 = w(t3); return this.startOf(e3) <= n3 && n3 <= this.endOf(e3); }, m2.isAfter = function(t3, e3) { return w(t3) < this.startOf(e3); }, m2.isBefore = function(t3, e3) { return this.endOf(e3) < w(t3); }, m2.$g = function(t3, e3, n3) { return O.u(t3) ? this[e3] : this.set(n3, t3); }, m2.unix = function() { return Math.floor(this.valueOf() / 1e3); }, m2.valueOf = function() { return this.$d.getTime(); }, m2.startOf = function(t3, e3) { var n3 = this, r3 = !!O.u(e3) || e3, h2 = O.p(t3), l2 = function(t4, e4) { var i2 = O.w(n3.$u ? Date.UTC(n3.$y, e4, t4) : new Date(n3.$y, e4, t4), n3); return r3 ? i2 : i2.endOf(a2); }, $2 = function(t4, e4) { return O.w(n3.toDate()[t4].apply(n3.toDate("s"), (r3 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e4)), n3); }, y2 = this.$W, M4 = this.$M, m3 = this.$D, v2 = "set" + (this.$u ? "UTC" : ""); switch (h2) { case c2: return r3 ? l2(1, 0) : l2(31, 11); case f: return r3 ? l2(1, M4) : l2(0, M4 + 1); case o2: var g2 = this.$locale().weekStart || 0, D3 = (y2 < g2 ? y2 + 7 : y2) - g2; return l2(r3 ? m3 - D3 : m3 + (6 - D3), M4); case a2: case d: return $2(v2 + "Hours", 0); case u: return $2(v2 + "Minutes", 1); case s2: return $2(v2 + "Seconds", 2); case i: return $2(v2 + "Milliseconds", 3); default: return this.clone(); } }, m2.endOf = function(t3) { return this.startOf(t3, false); }, m2.$set = function(t3, e3) { var n3, o3 = O.p(t3), h2 = "set" + (this.$u ? "UTC" : ""), l2 = (n3 = {}, n3[a2] = h2 + "Date", n3[d] = h2 + "Date", n3[f] = h2 + "Month", n3[c2] = h2 + "FullYear", n3[u] = h2 + "Hours", n3[s2] = h2 + "Minutes", n3[i] = h2 + "Seconds", n3[r2] = h2 + "Milliseconds", n3)[o3], $2 = o3 === a2 ? this.$D + (e3 - this.$W) : e3; if (o3 === f || o3 === c2) { var y2 = this.clone().set(d, 1); y2.$d[l2]($2), y2.init(), this.$d = y2.set(d, Math.min(this.$D, y2.daysInMonth())).$d; } else l2 && this.$d[l2]($2); return this.init(), this; }, m2.set = function(t3, e3) { return this.clone().$set(t3, e3); }, m2.get = function(t3) { return this[O.p(t3)](); }, m2.add = function(r3, h2) { var d2, l2 = this; r3 = Number(r3); var $2 = O.p(h2), y2 = function(t3) { var e3 = w(l2); return O.w(e3.date(e3.date() + Math.round(t3 * r3)), l2); }; if ($2 === f) return this.set(f, this.$M + r3); if ($2 === c2) return this.set(c2, this.$y + r3); if ($2 === a2) return y2(1); if ($2 === o2) return y2(7); var M4 = (d2 = {}, d2[s2] = e2, d2[u] = n2, d2[i] = t2, d2)[$2] || 1, m3 = this.$d.getTime() + r3 * M4; return O.w(m3, this); }, m2.subtract = function(t3, e3) { return this.add(-1 * t3, e3); }, m2.format = function(t3) { var e3 = this, n3 = this.$locale(); if (!this.isValid()) return n3.invalidDate || l; var r3 = t3 || "YYYY-MM-DDTHH:mm:ssZ", i2 = O.z(this), s3 = this.$H, u2 = this.$m, a3 = this.$M, o3 = n3.weekdays, f2 = n3.months, h2 = function(t4, n4, i3, s4) { return t4 && (t4[n4] || t4(e3, r3)) || i3[n4].slice(0, s4); }, c3 = function(t4) { return O.s(s3 % 12 || 12, t4, "0"); }, d2 = n3.meridiem || function(t4, e4, n4) { var r4 = t4 < 12 ? "AM" : "PM"; return n4 ? r4.toLowerCase() : r4; }, $2 = {YY: String(this.$y).slice(-2), YYYY: O.s(this.$y, 4, "0"), M: a3 + 1, MM: O.s(a3 + 1, 2, "0"), MMM: h2(n3.monthsShort, a3, f2, 3), MMMM: h2(f2, a3), D: this.$D, DD: O.s(this.$D, 2, "0"), d: String(this.$W), dd: h2(n3.weekdaysMin, this.$W, o3, 2), ddd: h2(n3.weekdaysShort, this.$W, o3, 3), dddd: o3[this.$W], H: String(s3), HH: O.s(s3, 2, "0"), h: c3(1), hh: c3(2), a: d2(s3, u2, true), A: d2(s3, u2, false), m: String(u2), mm: O.s(u2, 2, "0"), s: String(this.$s), ss: O.s(this.$s, 2, "0"), SSS: O.s(this.$ms, 3, "0"), Z: i2}; return r3.replace(y, function(t4, e4) { return e4 || $2[t4] || i2.replace(":", ""); }); }, m2.utcOffset = function() { return 15 * -Math.round(this.$d.getTimezoneOffset() / 15); }, m2.diff = function(r3, d2, l2) { var $2, y2 = O.p(d2), M4 = w(r3), m3 = (M4.utcOffset() - this.utcOffset()) * e2, v2 = this - M4, g2 = O.m(this, M4); return g2 = ($2 = {}, $2[c2] = g2 / 12, $2[f] = g2, $2[h] = g2 / 3, $2[o2] = (v2 - m3) / 6048e5, $2[a2] = (v2 - m3) / 864e5, $2[u] = v2 / n2, $2[s2] = v2 / e2, $2[i] = v2 / t2, $2)[y2] || v2, l2 ? g2 : O.a(g2); }, m2.daysInMonth = function() { return this.endOf(f).$D; }, m2.$locale = function() { return D2[this.$L]; }, m2.locale = function(t3, e3) { if (!t3) return this.$L; var n3 = this.clone(), r3 = S2(t3, e3, true); return r3 && (n3.$L = r3), n3; }, m2.clone = function() { return O.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(); }, M3; }(), T = _.prototype; return w.prototype = T, [["$ms", r2], ["$s", i], ["$m", s2], ["$H", u], ["$W", a2], ["$M", f], ["$y", c2], ["$D", d]].forEach(function(t3) { T[t3[1]] = function(e3) { return this.$g(e3, t3[0], t3[1]); }; }), w.extend = function(t3, e3) { return t3.$i || (t3(e3, _, w), t3.$i = true), w; }, w.locale = S2, w.isDayjs = p2, w.unix = function(t3) { return w(1e3 * t3); }, w.en = D2[g], w.Ls = D2, w.p = {}, w; }); }); // node_modules/dayjs/locale/ar.js var require_ar = __commonJS((exports, module) => { !function(e2, t2) { typeof exports == "object" && typeof module != "undefined" ? module.exports = t2(require_dayjs_min()) : typeof define == "function" && define.amd ? define(["dayjs"], t2) : (e2 = typeof globalThis != "undefined" ? globalThis : e2 || self).dayjs_locale_ar = t2(e2.dayjs); }(exports, function(e2) { "use strict"; function t2(e3) { return e3 && typeof e3 == "object" && "default" in e3 ? e3 : {default: e3}; } var n2 = t2(e2), r2 = "\u064A\u0646\u0627\u064A\u0631_\u0641\u0628\u0631\u0627\u064A\u0631_\u0645\u0627\u0631\u0633_\u0623\u0628\u0631\u064A\u0644_\u0645\u0627\u064A\u0648_\u064A\u0648\u0646\u064A\u0648_\u064A\u0648\u0644\u064A\u0648_\u0623\u063A\u0633\u0637\u0633_\u0633\u0628\u062A\u0645\u0628\u0631_\u0623\u0643\u062A\u0648\u0628\u0631_\u0646\u0648\u0641\u0645\u0628\u0631_\u062F\u064A\u0633\u0645\u0628\u0631".split("_"), _ = {1: "\u0661", 2: "\u0662", 3: "\u0663", 4: "\u0664", 5: "\u0665", 6: "\u0666", 7: "\u0667", 8: "\u0668", 9: "\u0669", 0: "\u0660"}, d = {"\u0661": "1", "\u0662": "2", "\u0663": "3", "\u0664": "4", "\u0665": "5", "\u0666": "6", "\u0667": "7", "\u0668": "8", "\u0669": "9", "\u0660": "0"}, o2 = {name: "ar", weekdays: "\u0627\u0644\u0623\u062D\u062F_\u0627\u0644\u0625\u062B\u0646\u064A\u0646_\u0627\u0644\u062B\u0644\u0627\u062B\u0627\u0621_\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621_\u0627\u0644\u062E\u0645\u064A\u0633_\u0627\u0644\u062C\u0645\u0639\u0629_\u0627\u0644\u0633\u0628\u062A".split("_"), weekdaysShort: "\u0623\u062D\u062F_\u0625\u062B\u0646\u064A\u0646_\u062B\u0644\u0627\u062B\u0627\u0621_\u0623\u0631\u0628\u0639\u0627\u0621_\u062E\u0645\u064A\u0633_\u062C\u0645\u0639\u0629_\u0633\u0628\u062A".split("_"), weekdaysMin: "\u062D_\u0646_\u062B_\u0631_\u062E_\u062C_\u0633".split("_"), months: r2, monthsShort: r2, weekStart: 6, relativeTime: {future: "\u0628\u0639\u062F %s", past: "\u0645\u0646\u0630 %s", s: "\u062B\u0627\u0646\u064A\u0629 \u0648\u0627\u062D\u062F\u0629", m: "\u062F\u0642\u064A\u0642\u0629 \u0648\u0627\u062D\u062F\u0629", mm: "%d \u062F\u0642\u0627\u0626\u0642", h: "\u0633\u0627\u0639\u0629 \u0648\u0627\u062D\u062F\u0629", hh: "%d \u0633\u0627\u0639\u0627\u062A", d: "\u064A\u0648\u0645 \u0648\u0627\u062D\u062F", dd: "%d \u0623\u064A\u0627\u0645", M: "\u0634\u0647\u0631 \u0648\u0627\u062D\u062F", MM: "%d \u0623\u0634\u0647\u0631", y: "\u0639\u0627\u0645 \u0648\u0627\u062D\u062F", yy: "%d \u0623\u0639\u0648\u0627\u0645"}, preparse: function(e3) { return e3.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function(e4) { return d[e4]; }).replace(/،/g, ","); }, postformat: function(e3) { return e3.replace(/\d/g, function(e4) { return _[e4]; }).replace(/,/g, "\u060C"); }, ordinal: function(e3) { return e3; }, formats: {LT: "HH:mm", LTS: "HH:mm:ss", L: "D/\u200FM/\u200FYYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY HH:mm", LLLL: "dddd D MMMM YYYY HH:mm"}}; return n2.default.locale(o2, null, true), o2; }); }); // node_modules/dayjs/locale/bs.js var require_bs = __commonJS((exports, module) => { !function(e2, t2) { typeof exports == "object" && typeof module != "undefined" ? module.exports = t2(require_dayjs_min()) : typeof define == "function" && define.amd ? define(["dayjs"], t2) : (e2 = typeof globalThis != "undefined" ? globalThis : e2 || self).dayjs_locale_bs = t2(e2.dayjs); }(exports, function(e2) { "use strict"; function t2(e3) { return e3 && typeof e3 == "object" && "default" in e3 ? e3 : {default: e3}; } var _ = t2(e2), a2 = {name: "bs", weekdays: "nedjelja_ponedjeljak_utorak_srijeda_\u010Detvrtak_petak_subota".split("_"), months: "januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"), weekStart: 1, weekdaysShort: "ned._pon._uto._sri._\u010Det._pet._sub.".split("_"), monthsShort: "jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"), weekdaysMin: "ne_po_ut_sr_\u010De_pe_su".split("_"), ordinal: function(e3) { return e3; }, formats: {LT: "H:mm", LTS: "H:mm:ss", L: "DD.MM.YYYY", LL: "D. MMMM YYYY", LLL: "D. MMMM YYYY H:mm", LLLL: "dddd, D. MMMM YYYY H:mm"}}; return _.default.locale(a2, null, true), a2; }); }); // node_modules/dayjs/locale/ca.js var require_ca = __commonJS((exports, module) => { !function(e2, s2) { typeof exports == "object" && typeof module != "undefined" ? module.exports = s2(require_dayjs_min()) : typeof define == "function" && define.amd ? define(["dayjs"], s2) : (e2 = typeof globalThis != "undefined" ? globalThis : e2 || self).dayjs_locale_ca = s2(e2.dayjs); }(exports, function(e2) { "use strict"; function s2(e3) { return e3 && typeof e3 == "object" && "default" in e3 ? e3 : {default: e3}; } var t2 = s2(e2), _ = {name: "ca", weekdays: "Diumenge_Dilluns_Dimarts_Dimecres_Dijous_Divendres_Dissabte".split("_"), weekdaysShort: "Dg._Dl._Dt._Dc._Dj._Dv._Ds.".split("_"), weekdaysMin: "Dg_Dl_Dt_Dc_Dj_Dv_Ds".split("_"), months: "Gener_Febrer_Mar\xE7_Abril_Maig_Juny_Juliol_Agost_Setembre_Octubre_Novembre_Desembre".split("_"), monthsShort: "Gen._Febr._Mar\xE7_Abr._Maig_Juny_Jul._Ag._Set._Oct._Nov._Des.".split("_"), weekStart: 1, formats: {LT: "H:mm", LTS: "H:mm:ss", L: "DD/MM/YYYY", LL: "D MMMM [de] YYYY", LLL: "D MMMM [de] YYYY [a les] H:mm", LLLL: "dddd D MMMM [de] YYYY [a les] H:mm", ll: "D MMM YYYY", lll: "D MMM YYYY, H:mm", llll: "ddd D MMM YYYY, H:mm"}, relativeTime: {future: "d'aqu\xED %s", past: "fa %s", s: "uns segons", m: "un minut", mm: "%d minuts", h: "una hora", hh: "%d hores", d: "un dia", dd: "%d dies", M: "un mes", MM: "%d mesos", y: "un any", yy: "%d anys"}, ordinal: function(e3) { return "" + e3 + (e3 === 1 || e3 === 3 ? "r" : e3 === 2 ? "n" : e3 === 4 ? "t" : "\xE8"); }}; return t2.default.locale(_, null, true), _; }); }); // node_modules/dayjs/locale/cs.js var require_cs = __commonJS((exports, module) => { !function(e2, n2) { typeof exports == "object" && typeof module != "undefined" ? module.exports = n2(require_dayjs_min()) : typeof define == "function" && define.amd ? define(["dayjs"], n2) : (e2 = typeof globalThis != "undefined" ? globalThis : e2 || self).dayjs_locale_cs = n2(e2.dayjs); }(exports, function(e2) { "use strict"; function n2(e3) { return e3 && typeof e3 == "object" && "default" in e3 ? e3 : {default: e3}; } var t2 = n2(e2); function s2(e3) { return e3 > 1 && e3 < 5 && ~~(e3 / 10) != 1; } function r2(e3, n3, t3, r3) { var d2 = e3 + " "; switch (t3) { case "s": return n3 || r3 ? "p\xE1r sekund" : "p\xE1r sekundami"; case "m": return n3 ? "minuta" : r3 ? "minutu" : "minutou"; case "mm": return n3 || r3 ? d2 + (s2(e3) ? "minuty" : "minut") : d2 + "minutami"; case "h": return n3 ? "hodina" : r3 ? "hodinu" : "hodinou"; case "hh": return n3 || r3 ? d2 + (s2(e3) ? "hodiny" : "hodin") : d2 + "hodinami"; case "d": return n3 || r3 ? "den" : "dnem"; case "dd": return n3 || r3 ? d2 + (s2(e3) ? "dny" : "dn\xED") : d2 + "dny"; case "M": return n3 || r3 ? "m\u011Bs\xEDc" : "m\u011Bs\xEDcem"; case "MM": return n3 || r3 ? d2 + (s2(e3) ? "m\u011Bs\xEDce" : "m\u011Bs\xEDc\u016F") : d2 + "m\u011Bs\xEDci"; case "y": return n3 || r3 ? "rok" : "rokem"; case "yy": return n3 || r3 ? d2 + (s2(e3) ? "roky" : "let") : d2 + "lety"; } } var d = {name: "cs", weekdays: "ned\u011Ble_pond\u011Bl\xED_\xFAter\xFD_st\u0159eda_\u010Dtvrtek_p\xE1tek_sobota".split("_"), weekdaysShort: "ne_po_\xFAt_st_\u010Dt_p\xE1_so".split("_"), weekdaysMin: "ne_po_\xFAt_st_\u010Dt_p\xE1_so".split("_"), months: "leden_\xFAnor_b\u0159ezen_duben_kv\u011Bten_\u010Derven_\u010Dervenec_srpen_z\xE1\u0159\xED_\u0159\xEDjen_listopad_prosinec".split("_"), monthsShort: "led_\xFAno_b\u0159e_dub_kv\u011B_\u010Dvn_\u010Dvc_srp_z\xE1\u0159_\u0159\xEDj_lis_pro".split("_"), weekStart: 1, yearStart: 4, ordinal: function(e3) { return e3 + "."; }, formats: {LT: "H:mm", LTS: "H:mm:ss", L: "DD.MM.YYYY", LL: "D. MMMM YYYY", LLL: "D. MMMM YYYY H:mm", LLLL: "dddd D. MMMM YYYY H:mm", l: "D. M. YYYY"}, relativeTime: {future: "za %s", past: "p\u0159ed %s", s: r2, m: r2, mm: r2, h: r2, hh: r2, d: r2, dd: r2, M: r2, MM: r2, y: r2, yy: r2}}; return t2.default.locale(d, null, true), d; }); }); // node_modules/dayjs/locale/cy.js var require_cy = __commonJS((exports, module) => { !function(d, e2) { typeof exports == "object" && typeof module != "undefined" ? module.exports = e2(require_dayjs_min()) : typeof define == "function" && define.amd ? define(["dayjs"], e2) : (d = typeof globalThis != "undefined" ? globalThis : d || self).dayjs_locale_cy = e2(d.dayjs); }(exports, function(d) { "use strict"; function e2(d2) { return d2 && typeof d2 == "object" && "default" in d2 ? d2 : {default: d2}; } var _ = e2(d), a2 = {name: "cy", weekdays: "Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"), months: "Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"), weekStart: 1, weekdaysShort: "Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"), monthsShort: "Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"), weekdaysMin: "Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"), ordinal: function(d2) { return d2; }, formats: {LT: "HH:mm", LTS: "HH:mm:ss", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY HH:mm", LLLL: "dddd, D MMMM YYYY HH:mm"}, relativeTime: {future: "mewn %s", past: "%s yn \xF4l", s: "ychydig eiliadau", m: "munud", mm: "%d munud", h: "awr", hh: "%d awr", d: "diwrnod", dd: "%d diwrnod", M: "mis", MM: "%d mis", y: "blwyddyn", yy: "%d flynedd"}}; return _.default.locale(a2, null, true), a2; }); }); // node_modules/dayjs/locale/da.js var require_da = __commonJS((exports, module) => { !function(e2, t2) { typeof exports == "object" && typeof module != "undefined" ? module.exports = t2(require_dayjs_min()) : typeof define == "function" && define.amd ? define(["dayjs"], t2) : (e2 = typeof globalThis != "undefined" ? globalThis : e2 || self).dayjs_locale_da = t2(e2.dayjs); }(exports, function(e2) { "use strict"; function t2(e3) { return e3 && typeof e3 == "object" && "default" in e3 ? e3 : {default: e3}; } var d = t2(e2), n2 = {name: "da", weekdays: "s\xF8ndag_mandag_tirsdag_onsdag_torsdag_fredag_l\xF8rdag".split("_"), weekdaysShort: "s\xF8n._man._tirs._ons._tors._fre._l\xF8r.".split("_"), weekdaysMin: "s\xF8._ma._ti._on._to._fr._l\xF8.".split("_"), months: "januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"), monthsShort: "jan._feb._mar._apr._maj_juni_juli_aug._sept._okt._nov._dec.".split("_"), weekStart: 1, ordinal: function(e3) { return e3 + "."; }, formats: {LT: "HH:mm", LTS: "HH:mm:ss", L: "DD.MM.YYYY", LL: "D. MMMM YYYY", LLL: "D. MMMM YYYY HH:mm", LLLL: "dddd [d.] D. MMMM YYYY [kl.] HH:mm"}, relativeTime: {future: "om %s", past: "%s siden", s: "f\xE5 sekunder", m: "et minut", mm: "%d minutter", h: "en time", hh: "%d timer", d: "en dag", dd: "%d dage", M: "en m\xE5ned", MM: "%d m\xE5neder", y: "et \xE5r", yy: "%d \xE5r"}}; return d.default.locale(n2, null, true), n2; }); }); // node_modules/dayjs/locale/de.js var require_de = __commonJS((exports, module) => { !function(e2, n2) { typeof exports == "object" && typeof module != "undefined" ? module.exports = n2(require_dayjs_min()) : typeof define == "function" && define.amd ? define(["dayjs"], n2) : (e2 = typeof globalThis != "undefined" ? globalThis : e2 || self).dayjs_locale_de = n2(e2.dayjs); }(exports, function(e2) { "use strict"; function n2(e3) { return e3 && typeof e3 == "object" && "default" in e3 ? e3 : {default: e3}; } var t2 = n2(e2), a2 = {s: "ein paar Sekunden", m: ["eine Minute", "einer Minute"], mm: "%d Minuten", h: ["eine Stunde", "einer Stunde"], hh: "%d Stunden", d: ["ein Tag", "einem Tag"], dd: ["%d Tage", "%d Tagen"], M: ["ein Monat", "einem Monat"], MM: ["%d Monate", "%d Monaten"], y: ["ein Jahr", "einem Jahr"], yy: ["%d Jahre", "%d Jahren"]}; function i(e3, n3, t3) { var i2 = a2[t3]; return Array.isArray(i2) && (i2 = i2[n3 ? 0 : 1]), i2.replace("%d", e3); } var r2 = {name: "de", weekdays: "Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"), weekdaysShort: "So._Mo._Di._Mi._Do._Fr._Sa.".split("_"), weekdaysMin: "So_Mo_Di_Mi_Do_Fr_Sa".split("_"), months: "Januar_Februar_M\xE4rz_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"), monthsShort: "Jan._Feb._M\xE4rz_Apr._Mai_Juni_Juli_Aug._Sept._Okt._Nov._Dez.".split("_"), ordinal: function(e3) { return e3 + "."; }, weekStart: 1, yearStart: 4, formats: {LTS: "HH:mm:ss", LT: "HH:mm", L: "DD.MM.YYYY", LL: "D. MMMM YYYY", LLL: "D. MMMM YYYY HH:mm", LLLL: "dddd, D. MMMM YYYY HH:mm"}, relativeTime: {future: "in %s", past: "vor %s", s: i, m: i, mm: i, h: i, hh: i, d: i, dd: i, M: i, MM: i, y: i, yy: i}}; return t2.default.locale(r2, null, true), r2; }); }); // node_modules/dayjs/locale/en.js var require_en = __commonJS((exports, module) => { !function(e2, n2) { typeof exports == "object" && typeof module != "undefined" ? module.exports = n2() : typeof define == "function" && define.amd ? define(n2) : (e2 = typeof globalThis != "undefined" ? globalThis : e2 || self).dayjs_locale_en = n2(); }(exports, function() { "use strict"; return {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(e2) { var n2 = ["th", "st", "nd", "rd"], t2 = e2 % 100; return "[" + e2 + (n2[(t2 - 20) % 10] || n2[t2] || n2[0]) + "]"; }}; }); }); // node_modules/dayjs/locale/es.js var require_es = __commonJS((exports, module) => { !function(e2, o2) { typeof exports == "object" && typeof module != "undefined" ? module.exports = o2(require_dayjs_min()) : typeof define == "function" && define.amd ? define(["dayjs"], o2) : (e2 = typeof globalThis != "undefined" ? globalThis : e2 || self).dayjs_locale_es = o2(e2.dayjs); }(exports, function(e2) { "use strict"; function o2(e3) { return e3 && typeof e3 == "object" && "default" in e3 ? e3 : {default: e3}; } var s2 = o2(e2), d = {name: "es", monthsShort: "ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"), weekdays: "domingo_lunes_martes_mi\xE9rcoles_jueves_viernes_s\xE1bado".split("_"), weekdaysShort: "dom._lun._mar._mi\xE9._jue._vie._s\xE1b.".split("_"), weekdaysMin: "do_lu_ma_mi_ju_vi_s\xE1".split("_"), months: "enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"), weekStart: 1, formats: {LT: "H:mm", LTS: "H:mm:ss", L: "DD/MM/YYYY", LL: "D [de] MMMM [de] YYYY", LLL: "D [de] MMMM [de] YYYY H:mm", LLLL: "dddd, D [de] MMMM [de] YYYY H:mm"}, relativeTime: {future: "en %s", past: "hace %s", s: "unos segundos", m: "un minuto", mm: "%d minutos", h: "una hora", hh: "%d horas", d: "un d\xEDa", dd: "%d d\xEDas", M: "un mes", MM: "%d meses", y: "un a\xF1o", yy: "%d a\xF1os"}, ordinal: function(e3) { return e3 + "\xBA"; }}; return s2.default.locale(d, null, true), d; }); }); // node_modules/dayjs/locale/fa.js var require_fa = __commonJS((exports, module) => { !function(_, e2) { typeof exports == "object" && typeof module != "undefined" ? module.exports = e2(require_dayjs_min()) : typeof define == "function" && define.amd ? define(["dayjs"], e2) : (_ = typeof globalThis != "undefined" ? globalThis : _ || self).dayjs_locale_fa = e2(_.dayjs); }(exports, function(_) { "use strict"; function e2(_2) { return _2 && typeof _2 == "object" && "default" in _2 ? _2 : {default: _2}; } var t2 = e2(_), d = {name: "fa", weekdays: "\u06CC\u06A9\u200C\u0634\u0646\u0628\u0647_\u062F\u0648\u0634\u0646\u0628\u0647_\u0633\u0647\u200C\u0634\u0646\u0628\u0647_\u0686\u0647\u0627\u0631\u0634\u0646\u0628\u0647_\u067E\u0646\u062C\u200C\u0634\u0646\u0628\u0647_\u062C\u0645\u0639\u0647_\u0634\u0646\u0628\u0647".split("_"), weekdaysShort: "\u06CC\u06A9\u200C_\u062F\u0648_\u0633\u0647\u200C_\u0686\u0647_\u067E\u0646_\u062C\u0645_\u0634\u0646".split("_"), weekdaysMin: "\u06CC_\u062F_\u0633_\u0686_\u067E_\u062C_\u0634".split("_"), weekStart: 6, months: "\u0641\u0631\u0648\u0631\u062F\u06CC\u0646_\u0627\u0631\u062F\u06CC\u0628\u0647\u0634\u062A_\u062E\u0631\u062F\u0627\u062F_\u062A\u06CC\u0631_\u0645\u0631\u062F\u0627\u062F_\u0634\u0647\u0631\u06CC\u0648\u0631_\u0645\u0647\u0631_\u0622\u0628\u0627\u0646_\u0622\u0630\u0631_\u062F\u06CC_\u0628\u0647\u0645\u0646_\u0627\u0633\u0641\u0646\u062F".split("_"), monthsShort: "\u0641\u0631\u0648_\u0627\u0631\u062F_\u062E\u0631\u062F_\u062A\u06CC\u0631_\u0645\u0631\u062F_\u0634\u0647\u0631_\u0645\u0647\u0631_\u0622\u0628\u0627_\u0622\u0630\u0631_\u062F\u06CC_\u0628\u0647\u0645_\u0627\u0633\u0641".split("_"), ordinal: function(_2) { return _2; }, formats: {LT: "HH:mm", LTS: "HH:mm:ss", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY HH:mm", LLLL: "dddd, D MMMM YYYY HH:mm"}, relativeTime: {future: "\u062F\u0631 %s", past: "%s \u0642\u0628\u0644", s: "\u0686\u0646\u062F \u062B\u0627\u0646\u06CC\u0647", m: "\u06CC\u06A9 \u062F\u0642\u06CC\u0642\u0647", mm: "%d \u062F\u0642\u06CC\u0642\u0647", h: "\u06CC\u06A9 \u0633\u0627\u0639\u062A", hh: "%d \u0633\u0627\u0639\u062A", d: "\u06CC\u06A9 \u0631\u0648\u0632", dd: "%d \u0631\u0648\u0632", M: "\u06CC\u06A9 \u0645\u0627\u0647", MM: "%d \u0645\u0627\u0647", y: "\u06CC\u06A9 \u0633\u0627\u0644", yy: "%d \u0633\u0627\u0644"}}; return t2.default.locale(d, null, true), d; }); }); // node_modules/dayjs/locale/fi.js var require_fi = __commonJS((exports, module) => { !function(u, e2) { typeof exports == "object" && typeof module != "undefined" ? module.exports = e2(require_dayjs_min()) : typeof define == "function" && define.amd ? define(["dayjs"], e2) : (u = typeof globalThis != "undefined" ? globalThis : u || self).dayjs_locale_fi = e2(u.dayjs); }(exports, function(u) { "use strict"; function e2(u2) { return u2 && typeof u2 == "object" && "default" in u2 ? u2 : {default: u2}; } var t2 = e2(u); function n2(u2, e3, t3, n3) { var i2 = {s: "muutama sekunti", m: "minuutti", mm: "%d minuuttia", h: "tunti", hh: "%d tuntia", d: "p\xE4iv\xE4", dd: "%d p\xE4iv\xE4\xE4", M: "kuukausi", MM: "%d kuukautta", y: "vuosi", yy: "%d vuotta", numbers: "nolla_yksi_kaksi_kolme_nelj\xE4_viisi_kuusi_seitsem\xE4n_kahdeksan_yhdeks\xE4n".split("_")}, a2 = {s: "muutaman sekunnin", m: "minuutin", mm: "%d minuutin", h: "tunnin", hh: "%d tunnin", d: "p\xE4iv\xE4n", dd: "%d p\xE4iv\xE4n", M: "kuukauden", MM: "%d kuukauden", y: "vuoden", yy: "%d vuoden", numbers: "nollan_yhden_kahden_kolmen_nelj\xE4n_viiden_kuuden_seitsem\xE4n_kahdeksan_yhdeks\xE4n".split("_")}, s2 = n3 && !e3 ? a2 : i2, _ = s2[t3]; return u2 < 10 ? _.replace("%d", s2.numbers[u2]) : _.replace("%d", u2); } var i = {name: "fi", weekdays: "sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"), weekdaysShort: "su_ma_ti_ke_to_pe_la".split("_"), weekdaysMin: "su_ma_ti_ke_to_pe_la".split("_"), months: "tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kes\xE4kuu_hein\xE4kuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"), monthsShort: "tammi_helmi_maalis_huhti_touko_kes\xE4_hein\xE4_elo_syys_loka_marras_joulu".split("_"), ordinal: function(u2) { return u2 + "."; }, weekStart: 1, yearStart: 4, relativeTime: {future: "%s p\xE4\xE4st\xE4", past: "%s sitten", s: n2, m: n2, mm: n2, h: n2, hh: n2, d: n2, dd: n2, M: n2, MM: n2, y: n2, yy: n2}, formats: {LT: "HH.mm", LTS: "HH.mm.ss", L: "DD.MM.YYYY", LL: "D. MMMM[ta] YYYY", LLL: "D. MMMM[ta] YYYY, [klo] HH.mm", LLLL: "dddd, D. MMMM[ta] YYYY, [klo] HH.mm", l: "D.M.YYYY", ll: "D. MMM YYYY", lll: "D. MMM YYYY, [klo] HH.mm", llll: "ddd, D. MMM YYYY, [klo] HH.mm"}}; return t2.default.locale(i, null, true), i; }); }); // node_modules/dayjs/locale/fr.js var require_fr = __commonJS((exports, module) => { !function(e2, n2) { typeof exports == "object" && typeof module != "undefined" ? module.exports = n2(require_dayjs_min()) : typeof define == "function" && define.amd ? define(["dayjs"], n2) : (e2 = typeof globalThis != "undefined" ? globalThis : e2 || self).dayjs_locale_fr = n2(e2.dayjs); }(exports, function(e2) { "use strict"; function n2(e3) { return e3 && typeof e3 == "object" && "default" in e3 ? e3 : {default: e3}; } var t2 = n2(e2), i = {name: "fr", weekdays: "dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"), weekdaysShort: "dim._lun._mar._mer._jeu._ven._sam.".split("_"), weekdaysMin: "di_lu_ma_me_je_ve_sa".split("_"), months: "janvier_f\xE9vrier_mars_avril_mai_juin_juillet_ao\xFBt_septembre_octobre_novembre_d\xE9cembre".split("_"), monthsShort: "janv._f\xE9vr._mars_avr._mai_juin_juil._ao\xFBt_sept._oct._nov._d\xE9c.".split("_"), weekStart: 1, yearStart: 4, formats: {LT: "HH:mm", LTS: "HH:mm:ss", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY HH:mm", LLLL: "dddd D MMMM YYYY HH:mm"}, relativeTime: {future: "dans %s", past: "il y a %s", s: "quelques secondes", m: "une minute", mm: "%d minutes", h: "une heure", hh: "%d heures", d: "un jour", dd: "%d jours", M: "un mois", MM: "%d mois", y: "un an", yy: "%d ans"}, ordinal: function(e3) { return "" + e3 + (e3 === 1 ? "er" : ""); }}; return t2.default.locale(i, null, true), i; }); }); // node_modules/dayjs/locale/hi.js var require_hi = __commonJS((exports, module) => { !function(_, e2) { typeof exports == "object" && typeof module != "undefined" ? module.exports = e2(require_dayjs_min()) : typeof define == "function" && define.amd ? define(["dayjs"], e2) : (_ = typeof globalThis != "undefined" ? globalThis : _ || self).dayjs_locale_hi = e2(_.dayjs); }(exports, function(_) { "use strict"; function e2(_2) { return _2 && typeof _2 == "object" && "default" in _2 ? _2 : {default: _2}; } var t2 = e2(_), d = {name: "hi", weekdays: "\u0930\u0935\u093F\u0935\u093E\u0930_\u0938\u094B\u092E\u0935\u093E\u0930_\u092E\u0902\u0917\u0932\u0935\u093E\u0930_\u092C\u0941\u0927\u0935\u093E\u0930_\u0917\u0941\u0930\u0942\u0935\u093E\u0930_\u0936\u0941\u0915\u094D\u0930\u0935\u093E\u0930_\u0936\u0928\u093F\u0935\u093E\u0930".split("_"), months: "\u091C\u0928\u0935\u0930\u0940_\u092B\u093C\u0930\u0935\u0930\u0940_\u092E\u093E\u0930\u094D\u091A_\u0905\u092A\u094D\u0930\u0948\u0932_\u092E\u0908_\u091C\u0942\u0928_\u091C\u0941\u0932\u093E\u0908_\u0905\u0917\u0938\u094D\u0924_\u0938\u093F\u0924\u092E\u094D\u092C\u0930_\u0905\u0915\u094D\u091F\u0942\u092C\u0930_\u0928\u0935\u092E\u094D\u092C\u0930_\u0926\u093F\u0938\u092E\u094D\u092C\u0930".split("_"), weekdaysShort: "\u0930\u0935\u093F_\u0938\u094B\u092E_\u092E\u0902\u0917\u0932_\u092C\u0941\u0927_\u0917\u0941\u0930\u0942_\u0936\u0941\u0915\u094D\u0930_\u0936\u0928\u093F".split("_"), monthsShort: "\u091C\u0928._\u092B\u093C\u0930._\u092E\u093E\u0930\u094D\u091A_\u0905\u092A\u094D\u0930\u0948._\u092E\u0908_\u091C\u0942\u0928_\u091C\u0941\u0932._\u0905\u0917._\u0938\u093F\u0924._\u0905\u0915\u094D\u091F\u0942._\u0928\u0935._\u0926\u093F\u0938.".split("_"), weekdaysMin: "\u0930_\u0938\u094B_\u092E\u0902_\u092C\u0941_\u0917\u0941_\u0936\u0941_\u0936".split("_"), ordinal: function(_2) { return _2; }, formats: {LT: "A h:mm \u092C\u091C\u0947", LTS: "A h:mm:ss \u092C\u091C\u0947", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY, A h:mm \u092C\u091C\u0947", LLLL: "dddd, D MMMM YYYY, A h:mm \u092C\u091C\u0947"}, relativeTime: {future: "%s \u092E\u0947\u0902", past: "%s \u092A\u0939\u0932\u0947", s: "\u0915\u0941\u091B \u0939\u0940 \u0915\u094D\u0937\u0923", m: "\u090F\u0915 \u092E\u093F\u0928\u091F", mm: "%d \u092E\u093F\u0928\u091F", h: "\u090F\u0915 \u0918\u0902\u091F\u093E", hh: "%d \u0918\u0902\u091F\u0947", d: "\u090F\u0915 \u0926\u093F\u0928", dd: "%d \u0926\u093F\u0928", M: "\u090F\u0915 \u092E\u0939\u0940\u0928\u0947", MM: "%d \u092E\u0939\u0940\u0928\u0947", y: "\u090F\u0915 \u0935\u0930\u094D\u0937", yy: "%d \u0935\u0930\u094D\u0937"}}; return t2.default.locale(d, null, true), d; }); }); // node_modules/dayjs/locale/hu.js var require_hu = __commonJS((exports, module) => { !function(e2, n2) { typeof exports == "object" && typeof module != "undefined" ? module.exports = n2(require_dayjs_min()) : typeof define == "function" && define.amd ? define(["dayjs"], n2) : (e2 = typeof globalThis != "undefined" ? globalThis : e2 || self).dayjs_locale_hu = n2(e2.dayjs); }(exports, function(e2) { "use strict"; function n2(e3) { return e3 && typeof e3 == "object" && "default" in e3 ? e3 : {default: e3}; } var t2 = n2(e2), r2 = {name: "hu", weekdays: "vas\xE1rnap_h\xE9tf\u0151_kedd_szerda_cs\xFCt\xF6rt\xF6k_p\xE9ntek_szombat".split("_"), weekdaysShort: "vas_h\xE9t_kedd_sze_cs\xFCt_p\xE9n_szo".split("_"), weekdaysMin: "v_h_k_sze_cs_p_szo".split("_"), months: "janu\xE1r_febru\xE1r_m\xE1rcius_\xE1prilis_m\xE1jus_j\xFAnius_j\xFAlius_augusztus_szeptember_okt\xF3ber_november_december".split("_"), monthsShort: "jan_feb_m\xE1rc_\xE1pr_m\xE1j_j\xFAn_j\xFAl_aug_szept_okt_nov_dec".split("_"), ordinal: function(e3) { return e3 + "."; }, weekStart: 1, relativeTime: {future: "%s m\xFAlva", past: "%s", s: function(e3, n3, t3, r3) { return "n\xE9h\xE1ny m\xE1sodperc" + (r3 || n3 ? "" : "e"); }, m: function(e3, n3, t3, r3) { return "egy perc" + (r3 || n3 ? "" : "e"); }, mm: function(e3, n3, t3, r3) { return e3 + " perc" + (r3 || n3 ? "" : "e"); }, h: function(e3, n3, t3, r3) { return "egy " + (r3 || n3 ? "\xF3ra" : "\xF3r\xE1ja"); }, hh: function(e3, n3, t3, r3) { return e3 + " " + (r3 || n3 ? "\xF3ra" : "\xF3r\xE1ja"); }, d: function(e3, n3, t3, r3) { return "egy " + (r3 || n3 ? "nap" : "napja"); }, dd: function(e3, n3, t3, r3) { return e3 + " " + (r3 || n3 ? "nap" : "napja"); }, M: function(e3, n3, t3, r3) { return "egy " + (r3 || n3 ? "h\xF3nap" : "h\xF3napja"); }, MM: function(e3, n3, t3, r3) { return e3 + " " + (r3 || n3 ? "h\xF3nap" : "h\xF3napja"); }, y: function(e3, n3, t3, r3) { return "egy " + (r3 || n3 ? "\xE9v" : "\xE9ve"); }, yy: function(e3, n3, t3, r3) { return e3 + " " + (r3 || n3 ? "\xE9v" : "\xE9ve"); }}, formats: {LT: "H:mm", LTS: "H:mm:ss", L: "YYYY.MM.DD.", LL: "YYYY. MMMM D.", LLL: "YYYY. MMMM D. H:mm", LLLL: "YYYY. MMMM D., dddd H:mm"}}; return t2.default.locale(r2, null, true), r2; }); }); // node_modules/dayjs/locale/hy-am.js var require_hy_am = __commonJS((exports, module) => { !function(_, e2) { typeof exports == "object" && typeof module != "undefined" ? module.exports = e2(require_dayjs_min()) : typeof define == "function" && define.amd ? define(["dayjs"], e2) : (_ = typeof globalThis != "undefined" ? globalThis : _ || self).dayjs_locale_hy_am = e2(_.dayjs); }(exports, function(_) { "use strict"; function e2(_2) { return _2 && typeof _2 == "object" && "default" in _2 ? _2 : {default: _2}; } var t2 = e2(_), d = {name: "hy-am", weekdays: "\u056F\u056B\u0580\u0561\u056F\u056B_\u0565\u0580\u056F\u0578\u0582\u0577\u0561\u0562\u0569\u056B_\u0565\u0580\u0565\u0584\u0577\u0561\u0562\u0569\u056B_\u0579\u0578\u0580\u0565\u0584\u0577\u0561\u0562\u0569\u056B_\u0570\u056B\u0576\u0563\u0577\u0561\u0562\u0569\u056B_\u0578\u0582\u0580\u0562\u0561\u0569_\u0577\u0561\u0562\u0561\u0569".split("_"), months: "\u0570\u0578\u0582\u0576\u057E\u0561\u0580\u056B_\u0583\u0565\u057F\u0580\u057E\u0561\u0580\u056B_\u0574\u0561\u0580\u057F\u056B_\u0561\u057A\u0580\u056B\u056C\u056B_\u0574\u0561\u0575\u056B\u057D\u056B_\u0570\u0578\u0582\u0576\u056B\u057D\u056B_\u0570\u0578\u0582\u056C\u056B\u057D\u056B_\u0585\u0563\u0578\u057D\u057F\u0578\u057D\u056B_\u057D\u0565\u057A\u057F\u0565\u0574\u0562\u0565\u0580\u056B_\u0570\u0578\u056F\u057F\u0565\u0574\u0562\u0565\u0580\u056B_\u0576\u0578\u0575\u0565\u0574\u0562\u0565\u0580\u056B_\u0564\u0565\u056F\u057F\u0565\u0574\u0562\u0565\u0580\u056B".split("_"), weekStart: 1, weekdaysShort: "\u056F\u0580\u056F_\u0565\u0580\u056F_\u0565\u0580\u0584_\u0579\u0580\u0584_\u0570\u0576\u0563_\u0578\u0582\u0580\u0562_\u0577\u0562\u0569".split("_"), monthsShort: "\u0570\u0576\u057E_\u0583\u057F\u0580_\u0574\u0580\u057F_\u0561\u057A\u0580_\u0574\u0575\u057D_\u0570\u0576\u057D_\u0570\u056C\u057D_\u0585\u0563\u057D_\u057D\u057A\u057F_\u0570\u056F\u057F_\u0576\u0574\u0562_\u0564\u056F\u057F".split("_"), weekdaysMin: "\u056F\u0580\u056F_\u0565\u0580\u056F_\u0565\u0580\u0584_\u0579\u0580\u0584_\u0570\u0576\u0563_\u0578\u0582\u0580\u0562_\u0577\u0562\u0569".split("_"), ordinal: function(_2) { return _2; }, formats: {LT: "HH:mm", LTS: "HH:mm:ss", L: "DD.MM.YYYY", LL: "D MMMM YYYY \u0569.", LLL: "D MMMM YYYY \u0569., HH:mm", LLLL: "dddd, D MMMM YYYY \u0569., HH:mm"}, relativeTime: {future: "%s \u0570\u0565\u057F\u0578", past: "%s \u0561\u057C\u0561\u057B", s: "\u0574\u056B \u0584\u0561\u0576\u056B \u057E\u0561\u0575\u0580\u056F\u0575\u0561\u0576", m: "\u0580\u0578\u057A\u0565", mm: "%d \u0580\u0578\u057A\u0565", h: "\u056A\u0561\u0574", hh: "%d \u056A\u0561\u0574", d: "\u0585\u0580", dd: "%d \u0585\u0580", M: "\u0561\u0574\u056B\u057D", MM: "%d \u0561\u0574\u056B\u057D", y: "\u057F\u0561\u0580\u056B", yy: "%d \u057F\u0561\u0580\u056B"}}; return t2.default.locale(d, null, true), d; }); }); // node_modules/dayjs/locale/id.js var require_id = __commonJS((exports, module) => { !function(e2, a2) { typeof exports == "object" && typeof module != "undefined" ? module.exports = a2(require_dayjs_min()) : typeof define == "function" && define.amd ? define(["dayjs"], a2) : (e2 = typeof globalThis != "undefined" ? globalThis : e2 || self).dayjs_locale_id = a2(e2.dayjs); }(exports, function(e2) { "use strict"; function a2(e3) { return e3 && typeof e3 == "object" && "default" in e3 ? e3 : {default: e3}; } var t2 = a2(e2), _ = {name: "id", weekdays: "Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"), months: "Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"), weekdaysShort: "Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"), monthsShort: "Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des".split("_"), weekdaysMin: "Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"), weekStart: 1, formats: {LT: "HH.mm", LTS: "HH.mm.ss", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY [pukul] HH.mm", LLLL: "dddd, D MMMM YYYY [pukul] HH.mm"}, relativeTime: {future: "dalam %s", past: "%s yang lalu", s: "beberapa detik", m: "semenit", mm: "%d menit", h: "sejam", hh: "%d jam", d: "sehari", dd: "%d hari", M: "sebulan", MM: "%d bulan", y: "setahun", yy: "%d tahun"}, ordinal: function(e3) { return e3 + "."; }}; return t2.default.locale(_, null, true), _; }); }); // node_modules/dayjs/locale/it.js var require_it = __commonJS((exports, module) => { !function(e2, o2) { typeof exports == "object" && typeof module != "undefined" ? module.exports = o2(require_dayjs_min()) : typeof define == "function" && define.amd ? define(["dayjs"], o2) : (e2 = typeof globalThis != "undefined" ? globalThis : e2 || self).dayjs_locale_it = o2(e2.dayjs); }(exports, function(e2) { "use strict"; function o2(e3) { return e3 && typeof e3 == "object" && "default" in e3 ? e3 : {default: e3}; } var t2 = o2(e2), n2 = {name: "it", weekdays: "domenica_luned\xEC_marted\xEC_mercoled\xEC_gioved\xEC_venerd\xEC_sabato".split("_"), weekdaysShort: "dom_lun_mar_mer_gio_ven_sab".split("_"), weekdaysMin: "do_lu_ma_me_gi_ve_sa".split("_"), months: "gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"), weekStart: 1, monthsShort: "gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"), formats: {LT: "HH:mm", LTS: "HH:mm:ss", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY HH:mm", LLLL: "dddd D MMMM YYYY HH:mm"}, relativeTime: {future: "tra %s", past: "%s fa", s: "qualche secondo", m: "un minuto", mm: "%d minuti", h: "un' ora", hh: "%d ore", d: "un giorno", dd: "%d giorni", M: "un mese", MM: "%d mesi", y: "un anno", yy: "%d anni"}, ordinal: function(e3) { return e3 + "\xBA"; }}; return t2.default.locale(n2, null, true), n2; }); }); // node_modules/dayjs/locale/ja.js var require_ja = __commonJS((exports, module) => { !function(e2, _) { typeof exports == "object" && typeof module != "undefined" ? module.exports = _(require_dayjs_min()) : typeof define == "function" && define.amd ? define(["dayjs"], _) : (e2 = typeof globalThis != "undefined" ? globalThis : e2 || self).dayjs_locale_ja = _(e2.dayjs); }(exports, function(e2) { "use strict"; function _(e3) { return e3 && typeof e3 == "object" && "default" in e3 ? e3 : {default: e3}; } var t2 = _(e2), d = {name: "ja", weekdays: "\u65E5\u66DC\u65E5_\u6708\u66DC\u65E5_\u706B\u66DC\u65E5_\u6C34\u66DC\u65E5_\u6728\u66DC\u65E5_\u91D1\u66DC\u65E5_\u571F\u66DC\u65E5".split("_"), weekdaysShort: "\u65E5_\u6708_\u706B_\u6C34_\u6728_\u91D1_\u571F".split("_"), weekdaysMin: "\u65E5_\u6708_\u706B_\u6C34_\u6728_\u91D1_\u571F".split("_"), months: "1\u6708_2\u6708_3\u6708_4\u6708_5\u6708_6\u6708_7\u6708_8\u6708_9\u6708_10\u6708_11\u6708_12\u6708".split("_"), monthsShort: "1\u6708_2\u6708_3\u6708_4\u6708_5\u6708_6\u6708_7\u6708_8\u6708_9\u6708_10\u6708_11\u6708_12\u6708".split("_"), ordinal: function(e3) { return e3 + "\u65E5"; }, formats: {LT: "HH:mm", LTS: "HH:mm:ss", L: "YYYY/MM/DD", LL: "YYYY\u5E74M\u6708D\u65E5", LLL: "YYYY\u5E74M\u6708D\u65E5 HH:mm", LLLL: "YYYY\u5E74M\u6708D\u65E5 dddd HH:mm", l: "YYYY/MM/DD", ll: "YYYY\u5E74M\u6708D\u65E5", lll: "YYYY\u5E74M\u6708D\u65E5 HH:mm", llll: "YYYY\u5E74M\u6708D\u65E5(ddd) HH:mm"}, meridiem: function(e3) { return e3 < 12 ? "\u5348\u524D" : "\u5348\u5F8C"; }, relativeTime: {future: "%s\u5F8C", past: "%s\u524D", s: "\u6570\u79D2", m: "1\u5206", mm: "%d\u5206", h: "1\u6642\u9593", hh: "%d\u6642\u9593", d: "1\u65E5", dd: "%d\u65E5", M: "1\u30F6\u6708", MM: "%d\u30F6\u6708", y: "1\u5E74", yy: "%d\u5E74"}}; return t2.default.locale(d, null, true), d; }); }); // node_modules/dayjs/locale/ka.js var require_ka = __commonJS((exports, module) => { !function(_, e2) { typeof exports == "object" && typeof module != "undefined" ? module.exports = e2(require_dayjs_min()) : typeof define == "function" && define.amd ? define(["dayjs"], e2) : (_ = typeof globalThis != "undefined" ? globalThis : _ || self).dayjs_locale_ka = e2(_.dayjs); }(exports, function(_) { "use strict"; function e2(_2) { return _2 && typeof _2 == "object" && "default" in _2 ? _2 : {default: _2}; } var t2 = e2(_), d = {name: "ka", weekdays: "\u10D9\u10D5\u10D8\u10E0\u10D0_\u10DD\u10E0\u10E8\u10D0\u10D1\u10D0\u10D7\u10D8_\u10E1\u10D0\u10DB\u10E8\u10D0\u10D1\u10D0\u10D7\u10D8_\u10DD\u10D7\u10EE\u10E8\u10D0\u10D1\u10D0\u10D7\u10D8_\u10EE\u10E3\u10D7\u10E8\u10D0\u10D1\u10D0\u10D7\u10D8_\u10DE\u10D0\u10E0\u10D0\u10E1\u10D9\u10D4\u10D5\u10D8_\u10E8\u10D0\u10D1\u10D0\u10D7\u10D8".split("_"), weekdaysShort: "\u10D9\u10D5\u10D8_\u10DD\u10E0\u10E8_\u10E1\u10D0\u10DB_\u10DD\u10D7\u10EE_\u10EE\u10E3\u10D7_\u10DE\u10D0\u10E0_\u10E8\u10D0\u10D1".split("_"), weekdaysMin: "\u10D9\u10D5_\u10DD\u10E0_\u10E1\u10D0_\u10DD\u10D7_\u10EE\u10E3_\u10DE\u10D0_\u10E8\u10D0".split("_"), months: "\u10D8\u10D0\u10DC\u10D5\u10D0\u10E0\u10D8_\u10D7\u10D4\u10D1\u10D4\u10E0\u10D5\u10D0\u10DA\u10D8_\u10DB\u10D0\u10E0\u10E2\u10D8_\u10D0\u10DE\u10E0\u10D8\u10DA\u10D8_\u10DB\u10D0\u10D8\u10E1\u10D8_\u10D8\u10D5\u10DC\u10D8\u10E1\u10D8_\u10D8\u10D5\u10DA\u10D8\u10E1\u10D8_\u10D0\u10D2\u10D5\u10D8\u10E1\u10E2\u10DD_\u10E1\u10D4\u10E5\u10E2\u10D4\u10DB\u10D1\u10D4\u10E0\u10D8_\u10DD\u10E5\u10E2\u10DD\u10DB\u10D1\u10D4\u10E0\u10D8_\u10DC\u10DD\u10D4\u10DB\u10D1\u10D4\u10E0\u10D8_\u10D3\u10D4\u10D9\u10D4\u10DB\u10D1\u10D4\u10E0\u10D8".split("_"), monthsShort: "\u10D8\u10D0\u10DC_\u10D7\u10D4\u10D1_\u10DB\u10D0\u10E0_\u10D0\u10DE\u10E0_\u10DB\u10D0\u10D8_\u10D8\u10D5\u10DC_\u10D8\u10D5\u10DA_\u10D0\u10D2\u10D5_\u10E1\u10D4\u10E5_\u10DD\u10E5\u10E2_\u10DC\u10DD\u10D4_\u10D3\u10D4\u10D9".split("_"), weekStart: 1, formats: {LT: "h:mm A", LTS: "h:mm:ss A", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY h:mm A", LLLL: "dddd, D MMMM YYYY h:mm A"}, relativeTime: {future: "%s \u10E8\u10D4\u10DB\u10D3\u10D4\u10D2", past: "%s \u10EC\u10D8\u10DC", s: "\u10EC\u10D0\u10DB\u10D8", m: "\u10EC\u10E3\u10D7\u10D8", mm: "%d \u10EC\u10E3\u10D7\u10D8", h: "\u10E1\u10D0\u10D0\u10D7\u10D8", hh: "%d \u10E1\u10D0\u10D0\u10D7\u10D8\u10E1", d: "\u10D3\u10E6\u10D4\u10E1", dd: "%d \u10D3\u10E6\u10D8\u10E1 \u10D2\u10D0\u10DC\u10DB\u10D0\u10D5\u10DA\u10DD\u10D1\u10D0\u10E8\u10D8", M: "\u10D7\u10D5\u10D8\u10E1", MM: "%d \u10D7\u10D5\u10D8\u10E1", y: "\u10EC\u10D4\u10DA\u10D8", yy: "%d \u10EC\u10DA\u10D8\u10E1"}, ordinal: function(_2) { return _2; }}; return t2.default.locale(d, null, true), d; }); }); // node_modules/dayjs/locale/km.js var require_km = __commonJS((exports, module) => { !function(_, e2) { typeof exports == "object" && typeof module != "undefined" ? module.exports = e2(require_dayjs_min()) : typeof define == "function" && define.amd ? define(["dayjs"], e2) : (_ = typeof globalThis != "undefined" ? globalThis : _ || self).dayjs_locale_km = e2(_.dayjs); }(exports, function(_) { "use strict"; function e2(_2) { return _2 && typeof _2 == "object" && "default" in _2 ? _2 : {default: _2}; } var t2 = e2(_), d = {name: "km", weekdays: "\u17A2\u17B6\u1791\u17B7\u178F\u17D2\u1799_\u1785\u17D0\u1793\u17D2\u1791_\u17A2\u1784\u17D2\u1782\u17B6\u179A_\u1796\u17BB\u1792_\u1796\u17D2\u179A\u17A0\u179F\u17D2\u1794\u178F\u17B7\u17CD_\u179F\u17BB\u1780\u17D2\u179A_\u179F\u17C5\u179A\u17CD".split("_"), months: "\u1798\u1780\u179A\u17B6_\u1780\u17BB\u1798\u17D2\u1797\u17C8_\u1798\u17B8\u1793\u17B6_\u1798\u17C1\u179F\u17B6_\u17A7\u179F\u1797\u17B6_\u1798\u17B7\u1790\u17BB\u1793\u17B6_\u1780\u1780\u17D2\u1780\u178A\u17B6_\u179F\u17B8\u17A0\u17B6_\u1780\u1789\u17D2\u1789\u17B6_\u178F\u17BB\u179B\u17B6_\u179C\u17B7\u1785\u17D2\u1786\u17B7\u1780\u17B6_\u1792\u17D2\u1793\u17BC".split("_"), weekStart: 1, weekdaysShort: "\u17A2\u17B6_\u1785_\u17A2_\u1796_\u1796\u17D2\u179A_\u179F\u17BB_\u179F".split("_"), monthsShort: "\u1798\u1780\u179A\u17B6_\u1780\u17BB\u1798\u17D2\u1797\u17C8_\u1798\u17B8\u1793\u17B6_\u1798\u17C1\u179F\u17B6_\u17A7\u179F\u1797\u17B6_\u1798\u17B7\u1790\u17BB\u1793\u17B6_\u1780\u1780\u17D2\u1780\u178A\u17B6_\u179F\u17B8\u17A0\u17B6_\u1780\u1789\u17D2\u1789\u17B6_\u178F\u17BB\u179B\u17B6_\u179C\u17B7\u1785\u17D2\u1786\u17B7\u1780\u17B6_\u1792\u17D2\u1793\u17BC".split("_"), weekdaysMin: "\u17A2\u17B6_\u1785_\u17A2_\u1796_\u1796\u17D2\u179A_\u179F\u17BB_\u179F".split("_"), ordinal: function(_2) { return _2; }, formats: {LT: "HH:mm", LTS: "HH:mm:ss", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY HH:mm", LLLL: "dddd, D MMMM YYYY HH:mm"}, relativeTime: {future: "%s\u1791\u17C0\u178F", past: "%s\u1798\u17BB\u1793", s: "\u1794\u17C9\u17BB\u1793\u17D2\u1798\u17B6\u1793\u179C\u17B7\u1793\u17B6\u1791\u17B8", m: "\u1798\u17BD\u1799\u1793\u17B6\u1791\u17B8", mm: "%d \u1793\u17B6\u1791\u17B8", h: "\u1798\u17BD\u1799\u1798\u17C9\u17C4\u1784", hh: "%d \u1798\u17C9\u17C4\u1784", d: "\u1798\u17BD\u1799\u1790\u17D2\u1784\u17C3", dd: "%d \u1790\u17D2\u1784\u17C3", M: "\u1798\u17BD\u1799\u1781\u17C2", MM: "%d \u1781\u17C2", y: "\u1798\u17BD\u1799\u1786\u17D2\u1793\u17B6\u17C6", yy: "%d \u1786\u17D2\u1793\u17B6\u17C6"}}; return t2.default.locale(d, null, true), d; }); }); // node_modules/dayjs/locale/ku.js var require_ku = __commonJS((exports, module) => { !function(e2, t2) { typeof exports == "object" && typeof module != "undefined" ? t2(exports, require_dayjs_min()) : typeof define == "function" && define.amd ? define(["exports", "dayjs"], t2) : t2((e2 = typeof globalThis != "undefined" ? globalThis : e2 || self).dayjs_locale_ku = {}, e2.dayjs); }(exports, function(e2, t2) { "use strict"; function n2(e3) { return e3 && typeof e3 == "object" && "default" in e3 ? e3 : {default: e3}; } var r2 = n2(t2), d = {1: "\u0661", 2: "\u0662", 3: "\u0663", 4: "\u0664", 5: "\u0665", 6: "\u0666", 7: "\u0667", 8: "\u0668", 9: "\u0669", 0: "\u0660"}, o2 = {"\u0661": "1", "\u0662": "2", "\u0663": "3", "\u0664": "4", "\u0665": "5", "\u0666": "6", "\u0667": "7", "\u0668": "8", "\u0669": "9", "\u0660": "0"}, u = ["\u06A9\u0627\u0646\u0648\u0648\u0646\u06CC \u062F\u0648\u0648\u06D5\u0645", "\u0634\u0648\u0628\u0627\u062A", "\u0626\u0627\u062F\u0627\u0631", "\u0646\u06CC\u0633\u0627\u0646", "\u0626\u0627\u06CC\u0627\u0631", "\u062D\u0648\u0632\u06D5\u06CC\u0631\u0627\u0646", "\u062A\u06D5\u0645\u0645\u0648\u0648\u0632", "\u0626\u0627\u0628", "\u0626\u06D5\u06CC\u0644\u0648\u0648\u0644", "\u062A\u0634\u0631\u06CC\u0646\u06CC \u06CC\u06D5\u06A9\u06D5\u0645", "\u062A\u0634\u0631\u06CC\u0646\u06CC \u062F\u0648\u0648\u06D5\u0645", "\u06A9\u0627\u0646\u0648\u0648\u0646\u06CC \u06CC\u06D5\u06A9\u06D5\u0645"], i = {name: "ku", months: u, monthsShort: u, weekdays: "\u06CC\u06D5\u06A9\u0634\u06D5\u0645\u0645\u06D5_\u062F\u0648\u0648\u0634\u06D5\u0645\u0645\u06D5_\u0633\u06CE\u0634\u06D5\u0645\u0645\u06D5_\u0686\u0648\u0627\u0631\u0634\u06D5\u0645\u0645\u06D5_\u067E\u06CE\u0646\u062C\u0634\u06D5\u0645\u0645\u06D5_\u0647\u06D5\u06CC\u0646\u06CC_\u0634\u06D5\u0645\u0645\u06D5".split("_"), weekdaysShort: "\u06CC\u06D5\u06A9\u0634\u06D5\u0645_\u062F\u0648\u0648\u0634\u06D5\u0645_\u0633\u06CE\u0634\u06D5\u0645_\u0686\u0648\u0627\u0631\u0634\u06D5\u0645_\u067E\u06CE\u0646\u062C\u0634\u06D5\u0645_\u0647\u06D5\u06CC\u0646\u06CC_\u0634\u06D5\u0645\u0645\u06D5".split("_"), weekStart: 6, weekdaysMin: "\u06CC_\u062F_\u0633_\u0686_\u067E_\u0647\u0640_\u0634".split("_"), preparse: function(e3) { return e3.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function(e4) { return o2[e4]; }).replace(/،/g, ","); }, postformat: function(e3) { return e3.replace(/\d/g, function(e4) { return d[e4]; }).replace(/,/g, "\u060C"); }, ordinal: function(e3) { return e3; }, formats: {LT: "HH:mm", LTS: "HH:mm:ss", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY HH:mm", LLLL: "dddd, D MMMM YYYY HH:mm"}, meridiem: function(e3) { return e3 < 12 ? "\u067E.\u0646" : "\u062F.\u0646"; }, relativeTime: {future: "\u0644\u06D5 %s", past: "\u0644\u06D5\u0645\u06D5\u0648\u067E\u06CE\u0634 %s", s: "\u0686\u06D5\u0646\u062F \u0686\u0631\u06A9\u06D5\u06CC\u06D5\u06A9", m: "\u06CC\u06D5\u06A9 \u062E\u0648\u0644\u06D5\u06A9", mm: "%d \u062E\u0648\u0644\u06D5\u06A9", h: "\u06CC\u06D5\u06A9 \u06A9\u0627\u062A\u0698\u0645\u06CE\u0631", hh: "%d \u06A9\u0627\u062A\u0698\u0645\u06CE\u0631", d: "\u06CC\u06D5\u06A9 \u0695\u06C6\u0698", dd: "%d \u0695\u06C6\u0698", M: "\u06CC\u06D5\u06A9 \u0645\u0627\u0646\u06AF", MM: "%d \u0645\u0627\u0646\u06AF", y: "\u06CC\u06D5\u06A9 \u0633\u0627\u06B5", yy: "%d \u0633\u0627\u06B5"}}; r2.default.locale(i, null, true), e2.default = i, e2.englishToArabicNumbersMap = d, Object.defineProperty(e2, "__esModule", {value: true}); }); }); // node_modules/dayjs/locale/ms.js var require_ms = __commonJS((exports, module) => { !function(e2, a2) { typeof exports == "object" && typeof module != "undefined" ? module.exports = a2(require_dayjs_min()) : typeof define == "function" && define.amd ? define(["dayjs"], a2) : (e2 = typeof globalThis != "undefined" ? globalThis : e2 || self).dayjs_locale_ms = a2(e2.dayjs); }(exports, function(e2) { "use strict"; function a2(e3) { return e3 && typeof e3 == "object" && "default" in e3 ? e3 : {default: e3}; } var t2 = a2(e2), s2 = {name: "ms", weekdays: "Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"), weekdaysShort: "Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"), weekdaysMin: "Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"), months: "Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"), monthsShort: "Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"), weekStart: 1, formats: {LT: "HH.mm", LTS: "HH.mm.ss", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY HH.mm", LLLL: "dddd, D MMMM YYYY HH.mm"}, relativeTime: {future: "dalam %s", past: "%s yang lepas", s: "beberapa saat", m: "seminit", mm: "%d minit", h: "sejam", hh: "%d jam", d: "sehari", dd: "%d hari", M: "sebulan", MM: "%d bulan", y: "setahun", yy: "%d tahun"}, ordinal: function(e3) { return e3 + "."; }}; return t2.default.locale(s2, null, true), s2; }); }); // node_modules/dayjs/locale/my.js var require_my = __commonJS((exports, module) => { !function(_, e2) { typeof exports == "object" && typeof module != "undefined" ? module.exports = e2(require_dayjs_min()) : typeof define == "function" && define.amd ? define(["dayjs"], e2) : (_ = typeof globalThis != "undefined" ? globalThis : _ || self).dayjs_locale_my = e2(_.dayjs); }(exports, function(_) { "use strict"; function e2(_2) { return _2 && typeof _2 == "object" && "default" in _2 ? _2 : {default: _2}; } var t2 = e2(_), d = {name: "my", weekdays: "\u1010\u1014\u1004\u103A\u1039\u1002\u1014\u103D\u1031_\u1010\u1014\u1004\u103A\u1039\u101C\u102C_\u1021\u1004\u103A\u1039\u1002\u102B_\u1017\u102F\u1012\u1039\u1013\u101F\u1030\u1038_\u1000\u103C\u102C\u101E\u1015\u1010\u1031\u1038_\u101E\u1031\u102C\u1000\u103C\u102C_\u1005\u1014\u1031".split("_"), months: "\u1007\u1014\u103A\u1014\u101D\u102B\u101B\u102E_\u1016\u1031\u1016\u1031\u102C\u103A\u101D\u102B\u101B\u102E_\u1019\u1010\u103A_\u1027\u1015\u103C\u102E_\u1019\u1031_\u1007\u103D\u1014\u103A_\u1007\u1030\u101C\u102D\u102F\u1004\u103A_\u101E\u103C\u1002\u102F\u1010\u103A_\u1005\u1000\u103A\u1010\u1004\u103A\u1018\u102C_\u1021\u1031\u102C\u1000\u103A\u1010\u102D\u102F\u1018\u102C_\u1014\u102D\u102F\u101D\u1004\u103A\u1018\u102C_\u1012\u102E\u1007\u1004\u103A\u1018\u102C".split("_"), weekStart: 1, weekdaysShort: "\u1014\u103D\u1031_\u101C\u102C_\u1002\u102B_\u101F\u1030\u1038_\u1000\u103C\u102C_\u101E\u1031\u102C_\u1014\u1031".split("_"), monthsShort: "\u1007\u1014\u103A_\u1016\u1031_\u1019\u1010\u103A_\u1015\u103C\u102E_\u1019\u1031_\u1007\u103D\u1014\u103A_\u101C\u102D\u102F\u1004\u103A_\u101E\u103C_\u1005\u1000\u103A_\u1021\u1031\u102C\u1000\u103A_\u1014\u102D\u102F_\u1012\u102E".split("_"), weekdaysMin: "\u1014\u103D\u1031_\u101C\u102C_\u1002\u102B_\u101F\u1030\u1038_\u1000\u103C\u102C_\u101E\u1031\u102C_\u1014\u1031".split("_"), ordinal: function(_2) { return _2; }, formats: {LT: "HH:mm", LTS: "HH:mm:ss", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY HH:mm", LLLL: "dddd D MMMM YYYY HH:mm"}, relativeTime: {future: "\u101C\u102C\u1019\u100A\u103A\u1037 %s \u1019\u103E\u102C", past: "\u101C\u103D\u1014\u103A\u1001\u1032\u1037\u101E\u1031\u102C %s \u1000", s: "\u1005\u1000\u1039\u1000\u1014\u103A.\u1021\u1014\u100A\u103A\u1038\u1004\u101A\u103A", m: "\u1010\u1005\u103A\u1019\u102D\u1014\u1005\u103A", mm: "%d \u1019\u102D\u1014\u1005\u103A", h: "\u1010\u1005\u103A\u1014\u102C\u101B\u102E", hh: "%d \u1014\u102C\u101B\u102E", d: "\u1010\u1005\u103A\u101B\u1000\u103A", dd: "%d \u101B\u1000\u103A", M: "\u1010\u1005\u103A\u101C", MM: "%d \u101C", y: "\u1010\u1005\u103A\u1014\u103E\u1005\u103A", yy: "%d \u1014\u103E\u1005\u103A"}}; return t2.default.locale(d, null, true), d; }); }); // node_modules/dayjs/locale/nl.js var require_nl = __commonJS((exports, module) => { !function(e2, a2) { typeof exports == "object" && typeof module != "undefined" ? module.exports = a2(require_dayjs_min()) : typeof define == "function" && define.amd ? define(["dayjs"], a2) : (e2 = typeof globalThis != "undefined" ? globalThis : e2 || self).dayjs_locale_nl = a2(e2.dayjs); }(exports, function(e2) { "use strict"; function a2(e3) { return e3 && typeof e3 == "object" && "default" in e3 ? e3 : {default: e3}; } var d = a2(e2), n2 = {name: "nl", weekdays: "zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"), weekdaysShort: "zo._ma._di._wo._do._vr._za.".split("_"), weekdaysMin: "zo_ma_di_wo_do_vr_za".split("_"), months: "januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"), monthsShort: "jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"), ordinal: function(e3) { return "[" + e3 + (e3 === 1 || e3 === 8 || e3 >= 20 ? "ste" : "de") + "]"; }, weekStart: 1, yearStart: 4, formats: {LT: "HH:mm", LTS: "HH:mm:ss", L: "DD-MM-YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY HH:mm", LLLL: "dddd D MMMM YYYY HH:mm"}, relativeTime: {future: "over %s", past: "%s geleden", s: "een paar seconden", m: "een minuut", mm: "%d minuten", h: "een uur", hh: "%d uur", d: "een dag", dd: "%d dagen", M: "een maand", MM: "%d maanden", y: "een jaar", yy: "%d jaar"}}; return d.default.locale(n2, null, true), n2; }); }); // node_modules/dayjs/locale/pl.js var require_pl = __commonJS((exports, module) => { !function(e2, t2) { typeof exports == "object" && typeof module != "undefined" ? module.exports = t2(require_dayjs_min()) : typeof define == "function" && define.amd ? define(["dayjs"], t2) : (e2 = typeof globalThis != "undefined" ? globalThis : e2 || self).dayjs_locale_pl = t2(e2.dayjs); }(exports, function(e2) { "use strict"; function t2(e3) { return e3 && typeof e3 == "object" && "default" in e3 ? e3 : {default: e3}; } var i = t2(e2); function a2(e3) { return e3 % 10 < 5 && e3 % 10 > 1 && ~~(e3 / 10) % 10 != 1; } function n2(e3, t3, i2) { var n3 = e3 + " "; switch (i2) { case "m": return t3 ? "minuta" : "minut\u0119"; case "mm": return n3 + (a2(e3) ? "minuty" : "minut"); case "h": return t3 ? "godzina" : "godzin\u0119"; case "hh": return n3 + (a2(e3) ? "godziny" : "godzin"); case "MM": return n3 + (a2(e3) ? "miesi\u0105ce" : "miesi\u0119cy"); case "yy": return n3 + (a2(e3) ? "lata" : "lat"); } } var r2 = "stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_wrze\u015Bnia_pa\u017Adziernika_listopada_grudnia".split("_"), _ = "stycze\u0144_luty_marzec_kwiecie\u0144_maj_czerwiec_lipiec_sierpie\u0144_wrzesie\u0144_pa\u017Adziernik_listopad_grudzie\u0144".split("_"), s2 = /D MMMM/, d = function(e3, t3) { return s2.test(t3) ? r2[e3.month()] : _[e3.month()]; }; d.s = _, d.f = r2; var o2 = {name: "pl", weekdays: "niedziela_poniedzia\u0142ek_wtorek_\u015Broda_czwartek_pi\u0105tek_sobota".split("_"), weekdaysShort: "ndz_pon_wt_\u015Br_czw_pt_sob".split("_"), weekdaysMin: "Nd_Pn_Wt_\u015Ar_Cz_Pt_So".split("_"), months: d, monthsShort: "sty_lut_mar_kwi_maj_cze_lip_sie_wrz_pa\u017A_lis_gru".split("_"), ordinal: function(e3) { return e3 + "."; }, weekStart: 1, yearStart: 4, relativeTime: {future: "za %s", past: "%s temu", s: "kilka sekund", m: n2, mm: n2, h: n2, hh: n2, d: "1 dzie\u0144", dd: "%d dni", M: "miesi\u0105c", MM: n2, y: "rok", yy: n2}, formats: {LT: "HH:mm", LTS: "HH:mm:ss", L: "DD.MM.YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY HH:mm", LLLL: "dddd, D MMMM YYYY HH:mm"}}; return i.default.locale(o2, null, true), o2; }); }); // node_modules/dayjs/locale/pt-br.js var require_pt_br = __commonJS((exports, module) => { !function(e2, o2) { typeof exports == "object" && typeof module != "undefined" ? module.exports = o2(require_dayjs_min()) : typeof define == "function" && define.amd ? define(["dayjs"], o2) : (e2 = typeof globalThis != "undefined" ? globalThis : e2 || self).dayjs_locale_pt_br = o2(e2.dayjs); }(exports, function(e2) { "use strict"; function o2(e3) { return e3 && typeof e3 == "object" && "default" in e3 ? e3 : {default: e3}; } var a2 = o2(e2), s2 = {name: "pt-br", weekdays: "domingo_segunda-feira_ter\xE7a-feira_quarta-feira_quinta-feira_sexta-feira_s\xE1bado".split("_"), weekdaysShort: "dom_seg_ter_qua_qui_sex_s\xE1b".split("_"), weekdaysMin: "Do_2\xAA_3\xAA_4\xAA_5\xAA_6\xAA_S\xE1".split("_"), months: "janeiro_fevereiro_mar\xE7o_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"), monthsShort: "jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"), ordinal: function(e3) { return e3 + "\xBA"; }, formats: {LT: "HH:mm", LTS: "HH:mm:ss", L: "DD/MM/YYYY", LL: "D [de] MMMM [de] YYYY", LLL: "D [de] MMMM [de] YYYY [\xE0s] HH:mm", LLLL: "dddd, D [de] MMMM [de] YYYY [\xE0s] HH:mm"}, relativeTime: {future: "em %s", past: "h\xE1 %s", s: "poucos segundos", m: "um minuto", mm: "%d minutos", h: "uma hora", hh: "%d horas", d: "um dia", dd: "%d dias", M: "um m\xEAs", MM: "%d meses", y: "um ano", yy: "%d anos"}}; return a2.default.locale(s2, null, true), s2; }); }); // node_modules/dayjs/locale/pt.js var require_pt = __commonJS((exports, module) => { !function(e2, a2) { typeof exports == "object" && typeof module != "undefined" ? module.exports = a2(require_dayjs_min()) : typeof define == "function" && define.amd ? define(["dayjs"], a2) : (e2 = typeof globalThis != "undefined" ? globalThis : e2 || self).dayjs_locale_pt = a2(e2.dayjs); }(exports, function(e2) { "use strict"; function a2(e3) { return e3 && typeof e3 == "object" && "default" in e3 ? e3 : {default: e3}; } var o2 = a2(e2), t2 = {name: "pt", weekdays: "domingo_segunda-feira_ter\xE7a-feira_quarta-feira_quinta-feira_sexta-feira_s\xE1bado".split("_"), weekdaysShort: "dom_seg_ter_qua_qui_sex_sab".split("_"), weekdaysMin: "Do_2\xAA_3\xAA_4\xAA_5\xAA_6\xAA_Sa".split("_"), months: "janeiro_fevereiro_mar\xE7o_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"), monthsShort: "jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"), ordinal: function(e3) { return e3 + "\xBA"; }, weekStart: 1, yearStart: 4, formats: {LT: "HH:mm", LTS: "HH:mm:ss", L: "DD/MM/YYYY", LL: "D [de] MMMM [de] YYYY", LLL: "D [de] MMMM [de] YYYY [\xE0s] HH:mm", LLLL: "dddd, D [de] MMMM [de] YYYY [\xE0s] HH:mm"}, relativeTime: {future: "em %s", past: "h\xE1 %s", s: "alguns segundos", m: "um minuto", mm: "%d minutos", h: "uma hora", hh: "%d horas", d: "um dia", dd: "%d dias", M: "um m\xEAs", MM: "%d meses", y: "um ano", yy: "%d anos"}}; return o2.default.locale(t2, null, true), t2; }); }); // node_modules/dayjs/locale/ro.js var require_ro = __commonJS((exports, module) => { !function(e2, i) { typeof exports == "object" && typeof module != "undefined" ? module.exports = i(require_dayjs_min()) : typeof define == "function" && define.amd ? define(["dayjs"], i) : (e2 = typeof globalThis != "undefined" ? globalThis : e2 || self).dayjs_locale_ro = i(e2.dayjs); }(exports, function(e2) { "use strict"; function i(e3) { return e3 && typeof e3 == "object" && "default" in e3 ? e3 : {default: e3}; } var t2 = i(e2), _ = {name: "ro", weekdays: "Duminic\u0103_Luni_Mar\u021Bi_Miercuri_Joi_Vineri_S\xE2mb\u0103t\u0103".split("_"), weekdaysShort: "Dum_Lun_Mar_Mie_Joi_Vin_S\xE2m".split("_"), weekdaysMin: "Du_Lu_Ma_Mi_Jo_Vi_S\xE2".split("_"), months: "Ianuarie_Februarie_Martie_Aprilie_Mai_Iunie_Iulie_August_Septembrie_Octombrie_Noiembrie_Decembrie".split("_"), monthsShort: "Ian._Febr._Mart._Apr._Mai_Iun._Iul._Aug._Sept._Oct._Nov._Dec.".split("_"), weekStart: 1, formats: {LT: "H:mm", LTS: "H:mm:ss", L: "DD.MM.YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY H:mm", LLLL: "dddd, D MMMM YYYY H:mm"}, relativeTime: {future: "peste %s", past: "acum %s", s: "c\xE2teva secunde", m: "un minut", mm: "%d minute", h: "o or\u0103", hh: "%d ore", d: "o zi", dd: "%d zile", M: "o lun\u0103", MM: "%d luni", y: "un an", yy: "%d ani"}, ordinal: function(e3) { return e3; }}; return t2.default.locale(_, null, true), _; }); }); // node_modules/dayjs/locale/ru.js var require_ru = __commonJS((exports, module) => { !function(_, t2) { typeof exports == "object" && typeof module != "undefined" ? module.exports = t2(require_dayjs_min()) : typeof define == "function" && define.amd ? define(["dayjs"], t2) : (_ = typeof globalThis != "undefined" ? globalThis : _ || self).dayjs_locale_ru = t2(_.dayjs); }(exports, function(_) { "use strict"; function t2(_2) { return _2 && typeof _2 == "object" && "default" in _2 ? _2 : {default: _2}; } var e2 = t2(_), n2 = "\u044F\u043D\u0432\u0430\u0440\u044F_\u0444\u0435\u0432\u0440\u0430\u043B\u044F_\u043C\u0430\u0440\u0442\u0430_\u0430\u043F\u0440\u0435\u043B\u044F_\u043C\u0430\u044F_\u0438\u044E\u043D\u044F_\u0438\u044E\u043B\u044F_\u0430\u0432\u0433\u0443\u0441\u0442\u0430_\u0441\u0435\u043D\u0442\u044F\u0431\u0440\u044F_\u043E\u043A\u0442\u044F\u0431\u0440\u044F_\u043D\u043E\u044F\u0431\u0440\u044F_\u0434\u0435\u043A\u0430\u0431\u0440\u044F".split("_"), s2 = "\u044F\u043D\u0432\u0430\u0440\u044C_\u0444\u0435\u0432\u0440\u0430\u043B\u044C_\u043C\u0430\u0440\u0442_\u0430\u043F\u0440\u0435\u043B\u044C_\u043C\u0430\u0439_\u0438\u044E\u043D\u044C_\u0438\u044E\u043B\u044C_\u0430\u0432\u0433\u0443\u0441\u0442_\u0441\u0435\u043D\u0442\u044F\u0431\u0440\u044C_\u043E\u043A\u0442\u044F\u0431\u0440\u044C_\u043D\u043E\u044F\u0431\u0440\u044C_\u0434\u0435\u043A\u0430\u0431\u0440\u044C".split("_"), r2 = "\u044F\u043D\u0432._\u0444\u0435\u0432\u0440._\u043C\u0430\u0440._\u0430\u043F\u0440._\u043C\u0430\u044F_\u0438\u044E\u043D\u044F_\u0438\u044E\u043B\u044F_\u0430\u0432\u0433._\u0441\u0435\u043D\u0442._\u043E\u043A\u0442._\u043D\u043E\u044F\u0431._\u0434\u0435\u043A.".split("_"), o2 = "\u044F\u043D\u0432._\u0444\u0435\u0432\u0440._\u043C\u0430\u0440\u0442_\u0430\u043F\u0440._\u043C\u0430\u0439_\u0438\u044E\u043D\u044C_\u0438\u044E\u043B\u044C_\u0430\u0432\u0433._\u0441\u0435\u043D\u0442._\u043E\u043A\u0442._\u043D\u043E\u044F\u0431._\u0434\u0435\u043A.".split("_"), i = /D[oD]?(\[[^[\]]*\]|\s)+MMMM?/; function d(_2, t3, e3) { var n3, s3; return e3 === "m" ? t3 ? "\u043C\u0438\u043D\u0443\u0442\u0430" : "\u043C\u0438\u043D\u0443\u0442\u0443" : _2 + " " + (n3 = +_2, s3 = {mm: t3 ? "\u043C\u0438\u043D\u0443\u0442\u0430_\u043C\u0438\u043D\u0443\u0442\u044B_\u043C\u0438\u043D\u0443\u0442" : "\u043C\u0438\u043D\u0443\u0442\u0443_\u043C\u0438\u043D\u0443\u0442\u044B_\u043C\u0438\u043D\u0443\u0442", hh: "\u0447\u0430\u0441_\u0447\u0430\u0441\u0430_\u0447\u0430\u0441\u043E\u0432", dd: "\u0434\u0435\u043D\u044C_\u0434\u043D\u044F_\u0434\u043D\u0435\u0439", MM: "\u043C\u0435\u0441\u044F\u0446_\u043C\u0435\u0441\u044F\u0446\u0430_\u043C\u0435\u0441\u044F\u0446\u0435\u0432", yy: "\u0433\u043E\u0434_\u0433\u043E\u0434\u0430_\u043B\u0435\u0442"}[e3].split("_"), n3 % 10 == 1 && n3 % 100 != 11 ? s3[0] : n3 % 10 >= 2 && n3 % 10 <= 4 && (n3 % 100 < 10 || n3 % 100 >= 20) ? s3[1] : s3[2]); } var u = function(_2, t3) { return i.test(t3) ? n2[_2.month()] : s2[_2.month()]; }; u.s = s2, u.f = n2; var a2 = function(_2, t3) { return i.test(t3) ? r2[_2.month()] : o2[_2.month()]; }; a2.s = o2, a2.f = r2; var m = {name: "ru", weekdays: "\u0432\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u0435_\u043F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A_\u0432\u0442\u043E\u0440\u043D\u0438\u043A_\u0441\u0440\u0435\u0434\u0430_\u0447\u0435\u0442\u0432\u0435\u0440\u0433_\u043F\u044F\u0442\u043D\u0438\u0446\u0430_\u0441\u0443\u0431\u0431\u043E\u0442\u0430".split("_"), weekdaysShort: "\u0432\u0441\u043A_\u043F\u043D\u0434_\u0432\u0442\u0440_\u0441\u0440\u0434_\u0447\u0442\u0432_\u043F\u0442\u043D_\u0441\u0431\u0442".split("_"), weekdaysMin: "\u0432\u0441_\u043F\u043D_\u0432\u0442_\u0441\u0440_\u0447\u0442_\u043F\u0442_\u0441\u0431".split("_"), months: u, monthsShort: a2, weekStart: 1, yearStart: 4, formats: {LT: "H:mm", LTS: "H:mm:ss", L: "DD.MM.YYYY", LL: "D MMMM YYYY \u0433.", LLL: "D MMMM YYYY \u0433., H:mm", LLLL: "dddd, D MMMM YYYY \u0433., H:mm"}, relativeTime: {future: "\u0447\u0435\u0440\u0435\u0437 %s", past: "%s \u043D\u0430\u0437\u0430\u0434", s: "\u043D\u0435\u0441\u043A\u043E\u043B\u044C\u043A\u043E \u0441\u0435\u043A\u0443\u043D\u0434", m: d, mm: d, h: "\u0447\u0430\u0441", hh: d, d: "\u0434\u0435\u043D\u044C", dd: d, M: "\u043C\u0435\u0441\u044F\u0446", MM: d, y: "\u0433\u043E\u0434", yy: d}, ordinal: function(_2) { return _2; }, meridiem: function(_2) { return _2 < 4 ? "\u043D\u043E\u0447\u0438" : _2 < 12 ? "\u0443\u0442\u0440\u0430" : _2 < 17 ? "\u0434\u043D\u044F" : "\u0432\u0435\u0447\u0435\u0440\u0430"; }}; return e2.default.locale(m, null, true), m; }); }); // node_modules/dayjs/locale/sv.js var require_sv = __commonJS((exports, module) => { !function(e2, t2) { typeof exports == "object" && typeof module != "undefined" ? module.exports = t2(require_dayjs_min()) : typeof define == "function" && define.amd ? define(["dayjs"], t2) : (e2 = typeof globalThis != "undefined" ? globalThis : e2 || self).dayjs_locale_sv = t2(e2.dayjs); }(exports, function(e2) { "use strict"; function t2(e3) { return e3 && typeof e3 == "object" && "default" in e3 ? e3 : {default: e3}; } var a2 = t2(e2), d = {name: "sv", weekdays: "s\xF6ndag_m\xE5ndag_tisdag_onsdag_torsdag_fredag_l\xF6rdag".split("_"), weekdaysShort: "s\xF6n_m\xE5n_tis_ons_tor_fre_l\xF6r".split("_"), weekdaysMin: "s\xF6_m\xE5_ti_on_to_fr_l\xF6".split("_"), months: "januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"), monthsShort: "jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"), weekStart: 1, yearStart: 4, ordinal: function(e3) { var t3 = e3 % 10; return "[" + e3 + (t3 === 1 || t3 === 2 ? "a" : "e") + "]"; }, formats: {LT: "HH:mm", LTS: "HH:mm:ss", L: "YYYY-MM-DD", LL: "D MMMM YYYY", LLL: "D MMMM YYYY [kl.] HH:mm", LLLL: "dddd D MMMM YYYY [kl.] HH:mm", lll: "D MMM YYYY HH:mm", llll: "ddd D MMM YYYY HH:mm"}, relativeTime: {future: "om %s", past: "f\xF6r %s sedan", s: "n\xE5gra sekunder", m: "en minut", mm: "%d minuter", h: "en timme", hh: "%d timmar", d: "en dag", dd: "%d dagar", M: "en m\xE5nad", MM: "%d m\xE5nader", y: "ett \xE5r", yy: "%d \xE5r"}}; return a2.default.locale(d, null, true), d; }); }); // node_modules/dayjs/locale/tr.js var require_tr = __commonJS((exports, module) => { !function(a2, e2) { typeof exports == "object" && typeof module != "undefined" ? module.exports = e2(require_dayjs_min()) : typeof define == "function" && define.amd ? define(["dayjs"], e2) : (a2 = typeof globalThis != "undefined" ? globalThis : a2 || self).dayjs_locale_tr = e2(a2.dayjs); }(exports, function(a2) { "use strict"; function e2(a3) { return a3 && typeof a3 == "object" && "default" in a3 ? a3 : {default: a3}; } var t2 = e2(a2), _ = {name: "tr", weekdays: "Pazar_Pazartesi_Sal\u0131_\xC7ar\u015Famba_Per\u015Fembe_Cuma_Cumartesi".split("_"), weekdaysShort: "Paz_Pts_Sal_\xC7ar_Per_Cum_Cts".split("_"), weekdaysMin: "Pz_Pt_Sa_\xC7a_Pe_Cu_Ct".split("_"), months: "Ocak_\u015Eubat_Mart_Nisan_May\u0131s_Haziran_Temmuz_A\u011Fustos_Eyl\xFCl_Ekim_Kas\u0131m_Aral\u0131k".split("_"), monthsShort: "Oca_\u015Eub_Mar_Nis_May_Haz_Tem_A\u011Fu_Eyl_Eki_Kas_Ara".split("_"), weekStart: 1, formats: {LT: "HH:mm", LTS: "HH:mm:ss", L: "DD.MM.YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY HH:mm", LLLL: "dddd, D MMMM YYYY HH:mm"}, relativeTime: {future: "%s sonra", past: "%s \xF6nce", s: "birka\xE7 saniye", m: "bir dakika", mm: "%d dakika", h: "bir saat", hh: "%d saat", d: "bir g\xFCn", dd: "%d g\xFCn", M: "bir ay", MM: "%d ay", y: "bir y\u0131l", yy: "%d y\u0131l"}, ordinal: function(a3) { return a3 + "."; }}; return t2.default.locale(_, null, true), _; }); }); // node_modules/dayjs/locale/uk.js var require_uk = __commonJS((exports, module) => { !function(_, e2) { typeof exports == "object" && typeof module != "undefined" ? module.exports = e2(require_dayjs_min()) : typeof define == "function" && define.amd ? define(["dayjs"], e2) : (_ = typeof globalThis != "undefined" ? globalThis : _ || self).dayjs_locale_uk = e2(_.dayjs); }(exports, function(_) { "use strict"; function e2(_2) { return _2 && typeof _2 == "object" && "default" in _2 ? _2 : {default: _2}; } var t2 = e2(_), s2 = "\u0441\u0456\u0447\u043D\u044F_\u043B\u044E\u0442\u043E\u0433\u043E_\u0431\u0435\u0440\u0435\u0437\u043D\u044F_\u043A\u0432\u0456\u0442\u043D\u044F_\u0442\u0440\u0430\u0432\u043D\u044F_\u0447\u0435\u0440\u0432\u043D\u044F_\u043B\u0438\u043F\u043D\u044F_\u0441\u0435\u0440\u043F\u043D\u044F_\u0432\u0435\u0440\u0435\u0441\u043D\u044F_\u0436\u043E\u0432\u0442\u043D\u044F_\u043B\u0438\u0441\u0442\u043E\u043F\u0430\u0434\u0430_\u0433\u0440\u0443\u0434\u043D\u044F".split("_"), n2 = "\u0441\u0456\u0447\u0435\u043D\u044C_\u043B\u044E\u0442\u0438\u0439_\u0431\u0435\u0440\u0435\u0437\u0435\u043D\u044C_\u043A\u0432\u0456\u0442\u0435\u043D\u044C_\u0442\u0440\u0430\u0432\u0435\u043D\u044C_\u0447\u0435\u0440\u0432\u0435\u043D\u044C_\u043B\u0438\u043F\u0435\u043D\u044C_\u0441\u0435\u0440\u043F\u0435\u043D\u044C_\u0432\u0435\u0440\u0435\u0441\u0435\u043D\u044C_\u0436\u043E\u0432\u0442\u0435\u043D\u044C_\u043B\u0438\u0441\u0442\u043E\u043F\u0430\u0434_\u0433\u0440\u0443\u0434\u0435\u043D\u044C".split("_"), o2 = /D[oD]?(\[[^[\]]*\]|\s)+MMMM?/; function d(_2, e3, t3) { var s3, n3; return t3 === "m" ? e3 ? "\u0445\u0432\u0438\u043B\u0438\u043D\u0430" : "\u0445\u0432\u0438\u043B\u0438\u043D\u0443" : t3 === "h" ? e3 ? "\u0433\u043E\u0434\u0438\u043D\u0430" : "\u0433\u043E\u0434\u0438\u043D\u0443" : _2 + " " + (s3 = +_2, n3 = {ss: e3 ? "\u0441\u0435\u043A\u0443\u043D\u0434\u0430_\u0441\u0435\u043A\u0443\u043D\u0434\u0438_\u0441\u0435\u043A\u0443\u043D\u0434" : "\u0441\u0435\u043A\u0443\u043D\u0434\u0443_\u0441\u0435\u043A\u0443\u043D\u0434\u0438_\u0441\u0435\u043A\u0443\u043D\u0434", mm: e3 ? "\u0445\u0432\u0438\u043B\u0438\u043D\u0430_\u0445\u0432\u0438\u043B\u0438\u043D\u0438_\u0445\u0432\u0438\u043B\u0438\u043D" : "\u0445\u0432\u0438\u043B\u0438\u043D\u0443_\u0445\u0432\u0438\u043B\u0438\u043D\u0438_\u0445\u0432\u0438\u043B\u0438\u043D", hh: e3 ? "\u0433\u043E\u0434\u0438\u043D\u0430_\u0433\u043E\u0434\u0438\u043D\u0438_\u0433\u043E\u0434\u0438\u043D" : "\u0433\u043E\u0434\u0438\u043D\u0443_\u0433\u043E\u0434\u0438\u043D\u0438_\u0433\u043E\u0434\u0438\u043D", dd: "\u0434\u0435\u043D\u044C_\u0434\u043D\u0456_\u0434\u043D\u0456\u0432", MM: "\u043C\u0456\u0441\u044F\u0446\u044C_\u043C\u0456\u0441\u044F\u0446\u0456_\u043C\u0456\u0441\u044F\u0446\u0456\u0432", yy: "\u0440\u0456\u043A_\u0440\u043E\u043A\u0438_\u0440\u043E\u043A\u0456\u0432"}[t3].split("_"), s3 % 10 == 1 && s3 % 100 != 11 ? n3[0] : s3 % 10 >= 2 && s3 % 10 <= 4 && (s3 % 100 < 10 || s3 % 100 >= 20) ? n3[1] : n3[2]); } var i = function(_2, e3) { return o2.test(e3) ? s2[_2.month()] : n2[_2.month()]; }; i.s = n2, i.f = s2; var r2 = {name: "uk", weekdays: "\u043D\u0435\u0434\u0456\u043B\u044F_\u043F\u043E\u043D\u0435\u0434\u0456\u043B\u043E\u043A_\u0432\u0456\u0432\u0442\u043E\u0440\u043E\u043A_\u0441\u0435\u0440\u0435\u0434\u0430_\u0447\u0435\u0442\u0432\u0435\u0440_\u043F\u2019\u044F\u0442\u043D\u0438\u0446\u044F_\u0441\u0443\u0431\u043E\u0442\u0430".split("_"), weekdaysShort: "\u043D\u0434\u043B_\u043F\u043D\u0434_\u0432\u0442\u0440_\u0441\u0440\u0434_\u0447\u0442\u0432_\u043F\u0442\u043D_\u0441\u0431\u0442".split("_"), weekdaysMin: "\u043D\u0434_\u043F\u043D_\u0432\u0442_\u0441\u0440_\u0447\u0442_\u043F\u0442_\u0441\u0431".split("_"), months: i, monthsShort: "\u0441\u0456\u0447_\u043B\u044E\u0442_\u0431\u0435\u0440_\u043A\u0432\u0456\u0442_\u0442\u0440\u0430\u0432_\u0447\u0435\u0440\u0432_\u043B\u0438\u043F_\u0441\u0435\u0440\u043F_\u0432\u0435\u0440_\u0436\u043E\u0432\u0442_\u043B\u0438\u0441\u0442_\u0433\u0440\u0443\u0434".split("_"), weekStart: 1, relativeTime: {future: "\u0437\u0430 %s", past: "%s \u0442\u043E\u043C\u0443", s: "\u0434\u0435\u043A\u0456\u043B\u044C\u043A\u0430 \u0441\u0435\u043A\u0443\u043D\u0434", m: d, mm: d, h: d, hh: d, d: "\u0434\u0435\u043D\u044C", dd: d, M: "\u043C\u0456\u0441\u044F\u0446\u044C", MM: d, y: "\u0440\u0456\u043A", yy: d}, ordinal: function(_2) { return _2; }, formats: {LT: "HH:mm", LTS: "HH:mm:ss", L: "DD.MM.YYYY", LL: "D MMMM YYYY \u0440.", LLL: "D MMMM YYYY \u0440., HH:mm", LLLL: "dddd, D MMMM YYYY \u0440., HH:mm"}}; return t2.default.locale(r2, null, true), r2; }); }); // node_modules/dayjs/locale/vi.js var require_vi = __commonJS((exports, module) => { !function(t2, n2) { typeof exports == "object" && typeof module != "undefined" ? module.exports = n2(require_dayjs_min()) : typeof define == "function" && define.amd ? define(["dayjs"], n2) : (t2 = typeof globalThis != "undefined" ? globalThis : t2 || self).dayjs_locale_vi = n2(t2.dayjs); }(exports, function(t2) { "use strict"; function n2(t3) { return t3 && typeof t3 == "object" && "default" in t3 ? t3 : {default: t3}; } var h = n2(t2), _ = {name: "vi", weekdays: "ch\u1EE7 nh\u1EADt_th\u1EE9 hai_th\u1EE9 ba_th\u1EE9 t\u01B0_th\u1EE9 n\u0103m_th\u1EE9 s\xE1u_th\u1EE9 b\u1EA3y".split("_"), months: "th\xE1ng 1_th\xE1ng 2_th\xE1ng 3_th\xE1ng 4_th\xE1ng 5_th\xE1ng 6_th\xE1ng 7_th\xE1ng 8_th\xE1ng 9_th\xE1ng 10_th\xE1ng 11_th\xE1ng 12".split("_"), weekStart: 1, weekdaysShort: "CN_T2_T3_T4_T5_T6_T7".split("_"), monthsShort: "Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12".split("_"), weekdaysMin: "CN_T2_T3_T4_T5_T6_T7".split("_"), ordinal: function(t3) { return t3; }, formats: {LT: "HH:mm", LTS: "HH:mm:ss", L: "DD/MM/YYYY", LL: "D MMMM [n\u0103m] YYYY", LLL: "D MMMM [n\u0103m] YYYY HH:mm", LLLL: "dddd, D MMMM [n\u0103m] YYYY HH:mm", l: "DD/M/YYYY", ll: "D MMM YYYY", lll: "D MMM YYYY HH:mm", llll: "ddd, D MMM YYYY HH:mm"}, relativeTime: {future: "%s t\u1EDBi", past: "%s tr\u01B0\u1EDBc", s: "v\xE0i gi\xE2y", m: "m\u1ED9t ph\xFAt", mm: "%d ph\xFAt", h: "m\u1ED9t gi\u1EDD", hh: "%d gi\u1EDD", d: "m\u1ED9t ng\xE0y", dd: "%d ng\xE0y", M: "m\u1ED9t th\xE1ng", MM: "%d th\xE1ng", y: "m\u1ED9t n\u0103m", yy: "%d n\u0103m"}}; return h.default.locale(_, null, true), _; }); }); // node_modules/dayjs/locale/zh-cn.js var require_zh_cn = __commonJS((exports, module) => { !function(e2, _) { typeof exports == "object" && typeof module != "undefined" ? module.exports = _(require_dayjs_min()) : typeof define == "function" && define.amd ? define(["dayjs"], _) : (e2 = typeof globalThis != "undefined" ? globalThis : e2 || self).dayjs_locale_zh_cn = _(e2.dayjs); }(exports, function(e2) { "use strict"; function _(e3) { return e3 && typeof e3 == "object" && "default" in e3 ? e3 : {default: e3}; } var t2 = _(e2), d = {name: "zh-cn", weekdays: "\u661F\u671F\u65E5_\u661F\u671F\u4E00_\u661F\u671F\u4E8C_\u661F\u671F\u4E09_\u661F\u671F\u56DB_\u661F\u671F\u4E94_\u661F\u671F\u516D".split("_"), weekdaysShort: "\u5468\u65E5_\u5468\u4E00_\u5468\u4E8C_\u5468\u4E09_\u5468\u56DB_\u5468\u4E94_\u5468\u516D".split("_"), weekdaysMin: "\u65E5_\u4E00_\u4E8C_\u4E09_\u56DB_\u4E94_\u516D".split("_"), months: "\u4E00\u6708_\u4E8C\u6708_\u4E09\u6708_\u56DB\u6708_\u4E94\u6708_\u516D\u6708_\u4E03\u6708_\u516B\u6708_\u4E5D\u6708_\u5341\u6708_\u5341\u4E00\u6708_\u5341\u4E8C\u6708".split("_"), monthsShort: "1\u6708_2\u6708_3\u6708_4\u6708_5\u6708_6\u6708_7\u6708_8\u6708_9\u6708_10\u6708_11\u6708_12\u6708".split("_"), ordinal: function(e3, _2) { return _2 === "W" ? e3 + "\u5468" : e3 + "\u65E5"; }, weekStart: 1, yearStart: 4, formats: {LT: "HH:mm", LTS: "HH:mm:ss", L: "YYYY/MM/DD", LL: "YYYY\u5E74M\u6708D\u65E5", LLL: "YYYY\u5E74M\u6708D\u65E5Ah\u70B9mm\u5206", LLLL: "YYYY\u5E74M\u6708D\u65E5ddddAh\u70B9mm\u5206", l: "YYYY/M/D", ll: "YYYY\u5E74M\u6708D\u65E5", lll: "YYYY\u5E74M\u6708D\u65E5 HH:mm", llll: "YYYY\u5E74M\u6708D\u65E5dddd HH:mm"}, relativeTime: {future: "%s\u5185", past: "%s\u524D", s: "\u51E0\u79D2", m: "1 \u5206\u949F", mm: "%d \u5206\u949F", h: "1 \u5C0F\u65F6", hh: "%d \u5C0F\u65F6", d: "1 \u5929", dd: "%d \u5929", M: "1 \u4E2A\u6708", MM: "%d \u4E2A\u6708", y: "1 \u5E74", yy: "%d \u5E74"}, meridiem: function(e3, _2) { var t3 = 100 * e3 + _2; return t3 < 600 ? "\u51CC\u6668" : t3 < 900 ? "\u65E9\u4E0A" : t3 < 1100 ? "\u4E0A\u5348" : t3 < 1300 ? "\u4E2D\u5348" : t3 < 1800 ? "\u4E0B\u5348" : "\u665A\u4E0A"; }}; return t2.default.locale(d, null, true), d; }); }); // node_modules/dayjs/locale/zh-tw.js var require_zh_tw = __commonJS((exports, module) => { !function(_, e2) { typeof exports == "object" && typeof module != "undefined" ? module.exports = e2(require_dayjs_min()) : typeof define == "function" && define.amd ? define(["dayjs"], e2) : (_ = typeof globalThis != "undefined" ? globalThis : _ || self).dayjs_locale_zh_tw = e2(_.dayjs); }(exports, function(_) { "use strict"; function e2(_2) { return _2 && typeof _2 == "object" && "default" in _2 ? _2 : {default: _2}; } var t2 = e2(_), d = {name: "zh-tw", weekdays: "\u661F\u671F\u65E5_\u661F\u671F\u4E00_\u661F\u671F\u4E8C_\u661F\u671F\u4E09_\u661F\u671F\u56DB_\u661F\u671F\u4E94_\u661F\u671F\u516D".split("_"), weekdaysShort: "\u9031\u65E5_\u9031\u4E00_\u9031\u4E8C_\u9031\u4E09_\u9031\u56DB_\u9031\u4E94_\u9031\u516D".split("_"), weekdaysMin: "\u65E5_\u4E00_\u4E8C_\u4E09_\u56DB_\u4E94_\u516D".split("_"), months: "\u4E00\u6708_\u4E8C\u6708_\u4E09\u6708_\u56DB\u6708_\u4E94\u6708_\u516D\u6708_\u4E03\u6708_\u516B\u6708_\u4E5D\u6708_\u5341\u6708_\u5341\u4E00\u6708_\u5341\u4E8C\u6708".split("_"), monthsShort: "1\u6708_2\u6708_3\u6708_4\u6708_5\u6708_6\u6708_7\u6708_8\u6708_9\u6708_10\u6708_11\u6708_12\u6708".split("_"), ordinal: function(_2, e3) { return e3 === "W" ? _2 + "\u9031" : _2 + "\u65E5"; }, formats: {LT: "HH:mm", LTS: "HH:mm:ss", L: "YYYY/MM/DD", LL: "YYYY\u5E74M\u6708D\u65E5", LLL: "YYYY\u5E74M\u6708D\u65E5 HH:mm", LLLL: "YYYY\u5E74M\u6708D\u65E5dddd HH:mm", l: "YYYY/M/D", ll: "YYYY\u5E74M\u6708D\u65E5", lll: "YYYY\u5E74M\u6708D\u65E5 HH:mm", llll: "YYYY\u5E74M\u6708D\u65E5dddd HH:mm"}, relativeTime: {future: "%s\u5167", past: "%s\u524D", s: "\u5E7E\u79D2", m: "1 \u5206\u9418", mm: "%d \u5206\u9418", h: "1 \u5C0F\u6642", hh: "%d \u5C0F\u6642", d: "1 \u5929", dd: "%d \u5929", M: "1 \u500B\u6708", MM: "%d \u500B\u6708", y: "1 \u5E74", yy: "%d \u5E74"}, meridiem: function(_2, e3) { var t3 = 100 * _2 + e3; return t3 < 600 ? "\u51CC\u6668" : t3 < 900 ? "\u65E9\u4E0A" : t3 < 1100 ? "\u4E0A\u5348" : t3 < 1300 ? "\u4E2D\u5348" : t3 < 1800 ? "\u4E0B\u5348" : "\u665A\u4E0A"; }}; return t2.default.locale(d, null, true), d; }); }); // node_modules/trix/dist/trix.js var require_trix = __commonJS((exports, module) => { (function() { }).call(exports), function() { var t2; window.Set == null && (window.Set = t2 = function() { function t3() { this.clear(); } return t3.prototype.clear = function() { return this.values = []; }, t3.prototype.has = function(t4) { return this.values.indexOf(t4) !== -1; }, t3.prototype.add = function(t4) { return this.has(t4) || this.values.push(t4), this; }, t3.prototype["delete"] = function(t4) { var e2; return (e2 = this.values.indexOf(t4)) === -1 ? false : (this.values.splice(e2, 1), true); }, t3.prototype.forEach = function() { var t4; return (t4 = this.values).forEach.apply(t4, arguments); }, t3; }()); }.call(exports), function(t2) { function e2() { } function n2(t3, e3) { return function() { t3.apply(e3, arguments); }; } function i(t3) { if (typeof this != "object") throw new TypeError("Promises must be constructed via new"); if (typeof t3 != "function") throw new TypeError("not a function"); this._state = 0, this._handled = false, this._value = void 0, this._deferreds = [], c2(t3, this); } function o2(t3, e3) { for (; t3._state === 3; ) t3 = t3._value; return t3._state === 0 ? void t3._deferreds.push(e3) : (t3._handled = true, void h(function() { var n3 = t3._state === 1 ? e3.onFulfilled : e3.onRejected; if (n3 === null) return void (t3._state === 1 ? r2 : s2)(e3.promise, t3._value); var i2; try { i2 = n3(t3._value); } catch (o3) { return void s2(e3.promise, o3); } r2(e3.promise, i2); })); } function r2(t3, e3) { try { if (e3 === t3) throw new TypeError("A promise cannot be resolved with itself."); if (e3 && (typeof e3 == "object" || typeof e3 == "function")) { var o3 = e3.then; if (e3 instanceof i) return t3._state = 3, t3._value = e3, void a2(t3); if (typeof o3 == "function") return void c2(n2(o3, e3), t3); } t3._state = 1, t3._value = e3, a2(t3); } catch (r3) { s2(t3, r3); } } function s2(t3, e3) { t3._state = 2, t3._value = e3, a2(t3); } function a2(t3) { t3._state === 2 && t3._deferreds.length === 0 && setTimeout(function() { t3._handled || p2(t3._value); }, 1); for (var e3 = 0, n3 = t3._deferreds.length; n3 > e3; e3++) o2(t3, t3._deferreds[e3]); t3._deferreds = null; } function u(t3, e3, n3) { this.onFulfilled = typeof t3 == "function" ? t3 : null, this.onRejected = typeof e3 == "function" ? e3 : null, this.promise = n3; } function c2(t3, e3) { var n3 = false; try { t3(function(t4) { n3 || (n3 = true, r2(e3, t4)); }, function(t4) { n3 || (n3 = true, s2(e3, t4)); }); } catch (i2) { if (n3) return; n3 = true, s2(e3, i2); } } var l = setTimeout, h = typeof setImmediate == "function" && setImmediate || function(t3) { l(t3, 1); }, p2 = function(t3) { typeof console != "undefined" && console && console.warn("Possible Unhandled Promise Rejection:", t3); }; i.prototype["catch"] = function(t3) { return this.then(null, t3); }, i.prototype.then = function(t3, n3) { var r3 = new i(e2); return o2(this, new u(t3, n3, r3)), r3; }, i.all = function(t3) { var e3 = Array.prototype.slice.call(t3); return new i(function(t4, n3) { function i2(r4, s3) { try { if (s3 && (typeof s3 == "object" || typeof s3 == "function")) { var a3 = s3.then; if (typeof a3 == "function") return void a3.call(s3, function(t5) { i2(r4, t5); }, n3); } e3[r4] = s3, --o3 === 0 && t4(e3); } catch (u2) { n3(u2); } } if (e3.length === 0) return t4([]); for (var o3 = e3.length, r3 = 0; r3 < e3.length; r3++) i2(r3, e3[r3]); }); }, i.resolve = function(t3) { return t3 && typeof t3 == "object" && t3.constructor === i ? t3 : new i(function(e3) { e3(t3); }); }, i.reject = function(t3) { return new i(function(e3, n3) { n3(t3); }); }, i.race = function(t3) { return new i(function(e3, n3) { for (var i2 = 0, o3 = t3.length; o3 > i2; i2++) t3[i2].then(e3, n3); }); }, i._setImmediateFn = function(t3) { h = t3; }, i._setUnhandledRejectionFn = function(t3) { p2 = t3; }, typeof module != "undefined" && module.exports ? module.exports = i : t2.Promise || (t2.Promise = i); }(exports), function() { var t2 = typeof window.customElements == "object", e2 = typeof document.registerElement == "function", n2 = t2 || e2; n2 || (typeof WeakMap == "undefined" && !function() { var t3 = Object.defineProperty, e3 = Date.now() % 1e9, n3 = function() { this.name = "__st" + (1e9 * Math.random() >>> 0) + (e3++ + "__"); }; n3.prototype = {set: function(e4, n4) { var i = e4[this.name]; return i && i[0] === e4 ? i[1] = n4 : t3(e4, this.name, {value: [e4, n4], writable: true}), this; }, get: function(t4) { var e4; return (e4 = t4[this.name]) && e4[0] === t4 ? e4[1] : void 0; }, delete: function(t4) { var e4 = t4[this.name]; return e4 && e4[0] === t4 ? (e4[0] = e4[1] = void 0, true) : false; }, has: function(t4) { var e4 = t4[this.name]; return e4 ? e4[0] === t4 : false; }}, window.WeakMap = n3; }(), function(t3) { function e3(t4) { A.push(t4), b || (b = true, g(i)); } function n3(t4) { return window.ShadowDOMPolyfill && window.ShadowDOMPolyfill.wrapIfNeeded(t4) || t4; } function i() { b = false; var t4 = A; A = [], t4.sort(function(t5, e5) { return t5.uid_ - e5.uid_; }); var e4 = false; t4.forEach(function(t5) { var n4 = t5.takeRecords(); o2(t5), n4.length && (t5.callback_(n4, t5), e4 = true); }), e4 && i(); } function o2(t4) { t4.nodes_.forEach(function(e4) { var n4 = m.get(e4); n4 && n4.forEach(function(e5) { e5.observer === t4 && e5.removeTransientObservers(); }); }); } function r2(t4, e4) { for (var n4 = t4; n4; n4 = n4.parentNode) { var i2 = m.get(n4); if (i2) for (var o3 = 0; o3 < i2.length; o3++) { var r3 = i2[o3], s3 = r3.options; if (n4 === t4 || s3.subtree) { var a3 = e4(s3); a3 && r3.enqueue(a3); } } } } function s2(t4) { this.callback_ = t4, this.nodes_ = [], this.records_ = [], this.uid_ = ++C3; } function a2(t4, e4) { this.type = t4, this.target = e4, this.addedNodes = [], this.removedNodes = [], this.previousSibling = null, this.nextSibling = null, this.attributeName = null, this.attributeNamespace = null, this.oldValue = null; } function u(t4) { var e4 = new a2(t4.type, t4.target); return e4.addedNodes = t4.addedNodes.slice(), e4.removedNodes = t4.removedNodes.slice(), e4.previousSibling = t4.previousSibling, e4.nextSibling = t4.nextSibling, e4.attributeName = t4.attributeName, e4.attributeNamespace = t4.attributeNamespace, e4.oldValue = t4.oldValue, e4; } function c2(t4, e4) { return x = new a2(t4, e4); } function l(t4) { return w ? w : (w = u(x), w.oldValue = t4, w); } function h() { x = w = void 0; } function p2(t4) { return t4 === w || t4 === x; } function d(t4, e4) { return t4 === e4 ? t4 : w && p2(t4) ? w : null; } function f(t4, e4, n4) { this.observer = t4, this.target = e4, this.options = n4, this.transientObservedNodes = []; } if (!t3.JsMutationObserver) { var g, m = new WeakMap(); if (/Trident|Edge/.test(navigator.userAgent)) g = setTimeout; else if (window.setImmediate) g = window.setImmediate; else { var v = [], y = String(Math.random()); window.addEventListener("message", function(t4) { if (t4.data === y) { var e4 = v; v = [], e4.forEach(function(t5) { t5(); }); } }), g = function(t4) { v.push(t4), window.postMessage(y, "*"); }; } var b = false, A = [], C3 = 0; s2.prototype = {observe: function(t4, e4) { if (t4 = n3(t4), !e4.childList && !e4.attributes && !e4.characterData || e4.attributeOldValue && !e4.attributes || e4.attributeFilter && e4.attributeFilter.length && !e4.attributes || e4.characterDataOldValue && !e4.characterData) throw new SyntaxError(); var i2 = m.get(t4); i2 || m.set(t4, i2 = []); for (var o3, r3 = 0; r3 < i2.length; r3++) if (i2[r3].observer === this) { o3 = i2[r3], o3.removeListeners(), o3.options = e4; break; } o3 || (o3 = new f(this, t4, e4), i2.push(o3), this.nodes_.push(t4)), o3.addListeners(); }, disconnect: function() { this.nodes_.forEach(function(t4) { for (var e4 = m.get(t4), n4 = 0; n4 < e4.length; n4++) { var i2 = e4[n4]; if (i2.observer === this) { i2.removeListeners(), e4.splice(n4, 1); break; } } }, this), this.records_ = []; }, takeRecords: function() { var t4 = this.records_; return this.records_ = [], t4; }}; var x, w; f.prototype = {enqueue: function(t4) { var n4 = this.observer.records_, i2 = n4.length; if (n4.length > 0) { var o3 = n4[i2 - 1], r3 = d(o3, t4); if (r3) return void (n4[i2 - 1] = r3); } else e3(this.observer); n4[i2] = t4; }, addListeners: function() { this.addListeners_(this.target); }, addListeners_: function(t4) { var e4 = this.options; e4.attributes && t4.addEventListener("DOMAttrModified", this, true), e4.characterData && t4.addEventListener("DOMCharacterDataModified", this, true), e4.childList && t4.addEventListener("DOMNodeInserted", this, true), (e4.childList || e4.subtree) && t4.addEventListener("DOMNodeRemoved", this, true); }, removeListeners: function() { this.removeListeners_(this.target); }, removeListeners_: function(t4) { var e4 = this.options; e4.attributes && t4.removeEventListener("DOMAttrModified", this, true), e4.characterData && t4.removeEventListener("DOMCharacterDataModified", this, true), e4.childList && t4.removeEventListener("DOMNodeInserted", this, true), (e4.childList || e4.subtree) && t4.removeEventListener("DOMNodeRemoved", this, true); }, addTransientObserver: function(t4) { if (t4 !== this.target) { this.addListeners_(t4), this.transientObservedNodes.push(t4); var e4 = m.get(t4); e4 || m.set(t4, e4 = []), e4.push(this); } }, removeTransientObservers: function() { var t4 = this.transientObservedNodes; this.transientObservedNodes = [], t4.forEach(function(t5) { this.removeListeners_(t5); for (var e4 = m.get(t5), n4 = 0; n4 < e4.length; n4++) if (e4[n4] === this) { e4.splice(n4, 1); break; } }, this); }, handleEvent: function(t4) { switch (t4.stopImmediatePropagation(), t4.type) { case "DOMAttrModified": var e4 = t4.attrName, n4 = t4.relatedNode.namespaceURI, i2 = t4.target, o3 = new c2("attributes", i2); o3.attributeName = e4, o3.attributeNamespace = n4; var s3 = t4.attrChange === MutationEvent.ADDITION ? null : t4.prevValue; r2(i2, function(t5) { return !t5.attributes || t5.attributeFilter && t5.attributeFilter.length && t5.attributeFilter.indexOf(e4) === -1 && t5.attributeFilter.indexOf(n4) === -1 ? void 0 : t5.attributeOldValue ? l(s3) : o3; }); break; case "DOMCharacterDataModified": var i2 = t4.target, o3 = c2("characterData", i2), s3 = t4.prevValue; r2(i2, function(t5) { return t5.characterData ? t5.characterDataOldValue ? l(s3) : o3 : void 0; }); break; case "DOMNodeRemoved": this.addTransientObserver(t4.target); case "DOMNodeInserted": var a3, u2, p3 = t4.target; t4.type === "DOMNodeInserted" ? (a3 = [p3], u2 = []) : (a3 = [], u2 = [p3]); var d2 = p3.previousSibling, f2 = p3.nextSibling, o3 = c2("childList", t4.target.parentNode); o3.addedNodes = a3, o3.removedNodes = u2, o3.previousSibling = d2, o3.nextSibling = f2, r2(t4.relatedNode, function(t5) { return t5.childList ? o3 : void 0; }); } h(); }}, t3.JsMutationObserver = s2, t3.MutationObserver || (t3.MutationObserver = s2, s2._isPolyfilled = true); } }(self), function() { "use strict"; if (!window.performance || !window.performance.now) { var t3 = Date.now(); window.performance = {now: function() { return Date.now() - t3; }}; } window.requestAnimationFrame || (window.requestAnimationFrame = function() { var t4 = window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame; return t4 ? function(e4) { return t4(function() { e4(performance.now()); }); } : function(t5) { return window.setTimeout(t5, 1e3 / 60); }; }()), window.cancelAnimationFrame || (window.cancelAnimationFrame = function() { return window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || function(t4) { clearTimeout(t4); }; }()); var e3 = function() { var t4 = document.createEvent("Event"); return t4.initEvent("foo", true, true), t4.preventDefault(), t4.defaultPrevented; }(); if (!e3) { var n3 = Event.prototype.preventDefault; Event.prototype.preventDefault = function() { this.cancelable && (n3.call(this), Object.defineProperty(this, "defaultPrevented", {get: function() { return true; }, configurable: true})); }; } var i = /Trident/.test(navigator.userAgent); if ((!window.CustomEvent || i && typeof window.CustomEvent != "function") && (window.CustomEvent = function(t4, e4) { e4 = e4 || {}; var n4 = document.createEvent("CustomEvent"); return n4.initCustomEvent(t4, Boolean(e4.bubbles), Boolean(e4.cancelable), e4.detail), n4; }, window.CustomEvent.prototype = window.Event.prototype), !window.Event || i && typeof window.Event != "function") { var o2 = window.Event; window.Event = function(t4, e4) { e4 = e4 || {}; var n4 = document.createEvent("Event"); return n4.initEvent(t4, Boolean(e4.bubbles), Boolean(e4.cancelable)), n4; }, window.Event.prototype = o2.prototype; } }(window.WebComponents), window.CustomElements = window.CustomElements || {flags: {}}, function(t3) { var e3 = t3.flags, n3 = [], i = function(t4) { n3.push(t4); }, o2 = function() { n3.forEach(function(e4) { e4(t3); }); }; t3.addModule = i, t3.initializeModules = o2, t3.hasNative = Boolean(document.registerElement), t3.isIE = /Trident/.test(navigator.userAgent), t3.useNative = !e3.register && t3.hasNative && !window.ShadowDOMPolyfill && (!window.HTMLImports || window.HTMLImports.useNative); }(window.CustomElements), window.CustomElements.addModule(function(t3) { function e3(t4, e4) { n3(t4, function(t5) { return e4(t5) ? true : void i(t5, e4); }), i(t4, e4); } function n3(t4, e4, i2) { var o3 = t4.firstElementChild; if (!o3) for (o3 = t4.firstChild; o3 && o3.nodeType !== Node.ELEMENT_NODE; ) o3 = o3.nextSibling; for (; o3; ) e4(o3, i2) !== true && n3(o3, e4, i2), o3 = o3.nextElementSibling; return null; } function i(t4, n4) { for (var i2 = t4.shadowRoot; i2; ) e3(i2, n4), i2 = i2.olderShadowRoot; } function o2(t4, e4) { r2(t4, e4, []); } function r2(t4, e4, n4) { if (t4 = window.wrap(t4), !(n4.indexOf(t4) >= 0)) { n4.push(t4); for (var i2, o3 = t4.querySelectorAll("link[rel=" + s2 + "]"), a2 = 0, u = o3.length; u > a2 && (i2 = o3[a2]); a2++) i2.import && r2(i2.import, e4, n4); e4(t4); } } var s2 = window.HTMLImports ? window.HTMLImports.IMPORT_LINK_TYPE : "none"; t3.forDocumentTree = o2, t3.forSubtree = e3; }), window.CustomElements.addModule(function(t3) { function e3(t4, e4) { return n3(t4, e4) || i(t4, e4); } function n3(e4, n4) { return t3.upgrade(e4, n4) ? true : void (n4 && s2(e4)); } function i(t4, e4) { b(t4, function(t5) { return n3(t5, e4) ? true : void 0; }); } function o2(t4) { w.push(t4), x || (x = true, setTimeout(r2)); } function r2() { x = false; for (var t4, e4 = w, n4 = 0, i2 = e4.length; i2 > n4 && (t4 = e4[n4]); n4++) t4(); w = []; } function s2(t4) { C3 ? o2(function() { a2(t4); }) : a2(t4); } function a2(t4) { t4.__upgraded__ && !t4.__attached && (t4.__attached = true, t4.attachedCallback && t4.attachedCallback()); } function u(t4) { c2(t4), b(t4, function(t5) { c2(t5); }); } function c2(t4) { C3 ? o2(function() { l(t4); }) : l(t4); } function l(t4) { t4.__upgraded__ && t4.__attached && (t4.__attached = false, t4.detachedCallback && t4.detachedCallback()); } function h(t4) { for (var e4 = t4, n4 = window.wrap(document); e4; ) { if (e4 == n4) return true; e4 = e4.parentNode || e4.nodeType === Node.DOCUMENT_FRAGMENT_NODE && e4.host; } } function p2(t4) { if (t4.shadowRoot && !t4.shadowRoot.__watched) { y.dom && console.log("watching shadow-root for: ", t4.localName); for (var e4 = t4.shadowRoot; e4; ) g(e4), e4 = e4.olderShadowRoot; } } function d(t4, n4) { if (y.dom) { var i2 = n4[0]; if (i2 && i2.type === "childList" && i2.addedNodes && i2.addedNodes) { for (var o3 = i2.addedNodes[0]; o3 && o3 !== document && !o3.host; ) o3 = o3.parentNode; var r3 = o3 && (o3.URL || o3._URL || o3.host && o3.host.localName) || ""; r3 = r3.split("/?").shift().split("/").pop(); } console.group("mutations (%d) [%s]", n4.length, r3 || ""); } var s3 = h(t4); n4.forEach(function(t5) { t5.type === "childList" && (E(t5.addedNodes, function(t6) { t6.localName && e3(t6, s3); }), E(t5.removedNodes, function(t6) { t6.localName && u(t6); })); }), y.dom && console.groupEnd(); } function f(t4) { for (t4 = window.wrap(t4), t4 || (t4 = window.wrap(document)); t4.parentNode; ) t4 = t4.parentNode; var e4 = t4.__observer; e4 && (d(t4, e4.takeRecords()), r2()); } function g(t4) { if (!t4.__observer) { var e4 = new MutationObserver(d.bind(this, t4)); e4.observe(t4, {childList: true, subtree: true}), t4.__observer = e4; } } function m(t4) { t4 = window.wrap(t4), y.dom && console.group("upgradeDocument: ", t4.baseURI.split("/").pop()); var n4 = t4 === window.wrap(document); e3(t4, n4), g(t4), y.dom && console.groupEnd(); } function v(t4) { A(t4, m); } var y = t3.flags, b = t3.forSubtree, A = t3.forDocumentTree, C3 = window.MutationObserver._isPolyfilled && y["throttle-attached"]; t3.hasPolyfillMutations = C3, t3.hasThrottledAttached = C3; var x = false, w = [], E = Array.prototype.forEach.call.bind(Array.prototype.forEach), S2 = Element.prototype.createShadowRoot; S2 && (Element.prototype.createShadowRoot = function() { var t4 = S2.call(this); return window.CustomElements.watchShadow(this), t4; }), t3.watchShadow = p2, t3.upgradeDocumentTree = v, t3.upgradeDocument = m, t3.upgradeSubtree = i, t3.upgradeAll = e3, t3.attached = s2, t3.takeRecords = f; }), window.CustomElements.addModule(function(t3) { function e3(e4, i2) { if (e4.localName === "template" && window.HTMLTemplateElement && HTMLTemplateElement.decorate && HTMLTemplateElement.decorate(e4), !e4.__upgraded__ && e4.nodeType === Node.ELEMENT_NODE) { var o3 = e4.getAttribute("is"), r3 = t3.getRegisteredDefinition(e4.localName) || t3.getRegisteredDefinition(o3); if (r3 && (o3 && r3.tag == e4.localName || !o3 && !r3.extends)) return n3(e4, r3, i2); } } function n3(e4, n4, o3) { return s2.upgrade && console.group("upgrade:", e4.localName), n4.is && e4.setAttribute("is", n4.is), i(e4, n4), e4.__upgraded__ = true, r2(e4), o3 && t3.attached(e4), t3.upgradeSubtree(e4, o3), s2.upgrade && console.groupEnd(), e4; } function i(t4, e4) { Object.__proto__ ? t4.__proto__ = e4.prototype : (o2(t4, e4.prototype, e4.native), t4.__proto__ = e4.prototype); } function o2(t4, e4, n4) { for (var i2 = {}, o3 = e4; o3 !== n4 && o3 !== HTMLElement.prototype; ) { for (var r3, s3 = Object.getOwnPropertyNames(o3), a2 = 0; r3 = s3[a2]; a2++) i2[r3] || (Object.defineProperty(t4, r3, Object.getOwnPropertyDescriptor(o3, r3)), i2[r3] = 1); o3 = Object.getPrototypeOf(o3); } } function r2(t4) { t4.createdCallback && t4.createdCallback(); } var s2 = t3.flags; t3.upgrade = e3, t3.upgradeWithDefinition = n3, t3.implementPrototype = i; }), window.CustomElements.addModule(function(t3) { function e3(e4, i2) { var u2 = i2 || {}; if (!e4) throw new Error("document.registerElement: first argument `name` must not be empty"); if (e4.indexOf("-") < 0) throw new Error("document.registerElement: first argument ('name') must contain a dash ('-'). Argument provided was '" + String(e4) + "'."); if (o2(e4)) throw new Error("Failed to execute 'registerElement' on 'Document': Registration failed for type '" + String(e4) + "'. The type name is invalid."); if (c2(e4)) throw new Error("DuplicateDefinitionError: a type with name '" + String(e4) + "' is already registered"); return u2.prototype || (u2.prototype = Object.create(HTMLElement.prototype)), u2.__name = e4.toLowerCase(), u2.extends && (u2.extends = u2.extends.toLowerCase()), u2.lifecycle = u2.lifecycle || {}, u2.ancestry = r2(u2.extends), s2(u2), a2(u2), n3(u2.prototype), l(u2.__name, u2), u2.ctor = h(u2), u2.ctor.prototype = u2.prototype, u2.prototype.constructor = u2.ctor, t3.ready && m(document), u2.ctor; } function n3(t4) { if (!t4.setAttribute._polyfilled) { var e4 = t4.setAttribute; t4.setAttribute = function(t5, n5) { i.call(this, t5, n5, e4); }; var n4 = t4.removeAttribute; t4.removeAttribute = function(t5) { i.call(this, t5, null, n4); }, t4.setAttribute._polyfilled = true; } } function i(t4, e4, n4) { t4 = t4.toLowerCase(); var i2 = this.getAttribute(t4); n4.apply(this, arguments); var o3 = this.getAttribute(t4); this.attributeChangedCallback && o3 !== i2 && this.attributeChangedCallback(t4, i2, o3); } function o2(t4) { for (var e4 = 0; e4 < C3.length; e4++) if (t4 === C3[e4]) return true; } function r2(t4) { var e4 = c2(t4); return e4 ? r2(e4.extends).concat([e4]) : []; } function s2(t4) { for (var e4, n4 = t4.extends, i2 = 0; e4 = t4.ancestry[i2]; i2++) n4 = e4.is && e4.tag; t4.tag = n4 || t4.__name, n4 && (t4.is = t4.__name); } function a2(t4) { if (!Object.__proto__) { var e4 = HTMLElement.prototype; if (t4.is) { var n4 = document.createElement(t4.tag); e4 = Object.getPrototypeOf(n4); } for (var i2, o3 = t4.prototype, r3 = false; o3; ) o3 == e4 && (r3 = true), i2 = Object.getPrototypeOf(o3), i2 && (o3.__proto__ = i2), o3 = i2; r3 || console.warn(t4.tag + " prototype not found in prototype chain for " + t4.is), t4.native = e4; } } function u(t4) { return y(E(t4.tag), t4); } function c2(t4) { return t4 ? x[t4.toLowerCase()] : void 0; } function l(t4, e4) { x[t4] = e4; } function h(t4) { return function() { return u(t4); }; } function p2(t4, e4, n4) { return t4 === w ? d(e4, n4) : S2(t4, e4); } function d(t4, e4) { t4 && (t4 = t4.toLowerCase()), e4 && (e4 = e4.toLowerCase()); var n4 = c2(e4 || t4); if (n4) { if (t4 == n4.tag && e4 == n4.is) return new n4.ctor(); if (!e4 && !n4.is) return new n4.ctor(); } var i2; return e4 ? (i2 = d(t4), i2.setAttribute("is", e4), i2) : (i2 = E(t4), t4.indexOf("-") >= 0 && b(i2, HTMLElement), i2); } function f(t4, e4) { var n4 = t4[e4]; t4[e4] = function() { var t5 = n4.apply(this, arguments); return v(t5), t5; }; } var g, m = (t3.isIE, t3.upgradeDocumentTree), v = t3.upgradeAll, y = t3.upgradeWithDefinition, b = t3.implementPrototype, A = t3.useNative, C3 = ["annotation-xml", "color-profile", "font-face", "font-face-src", "font-face-uri", "font-face-format", "font-face-name", "missing-glyph"], x = {}, w = "http://www.w3.org/1999/xhtml", E = document.createElement.bind(document), S2 = document.createElementNS.bind(document); g = Object.__proto__ || A ? function(t4, e4) { return t4 instanceof e4; } : function(t4, e4) { if (t4 instanceof e4) return true; for (var n4 = t4; n4; ) { if (n4 === e4.prototype) return true; n4 = n4.__proto__; } return false; }, f(Node.prototype, "cloneNode"), f(document, "importNode"), document.registerElement = e3, document.createElement = d, document.createElementNS = p2, t3.registry = x, t3.instanceof = g, t3.reservedTagList = C3, t3.getRegisteredDefinition = c2, document.register = document.registerElement; }), function(t3) { function e3() { r2(window.wrap(document)), window.CustomElements.ready = true; var t4 = window.requestAnimationFrame || function(t5) { setTimeout(t5, 16); }; t4(function() { setTimeout(function() { window.CustomElements.readyTime = Date.now(), window.HTMLImports && (window.CustomElements.elapsed = window.CustomElements.readyTime - window.HTMLImports.readyTime), document.dispatchEvent(new CustomEvent("WebComponentsReady", {bubbles: true})); }); }); } var n3 = t3.useNative, i = t3.initializeModules; if (t3.isIE, n3) { var o2 = function() { }; t3.watchShadow = o2, t3.upgrade = o2, t3.upgradeAll = o2, t3.upgradeDocumentTree = o2, t3.upgradeSubtree = o2, t3.takeRecords = o2, t3.instanceof = function(t4, e4) { return t4 instanceof e4; }; } else i(); var r2 = t3.upgradeDocumentTree, s2 = t3.upgradeDocument; if (window.wrap || (window.ShadowDOMPolyfill ? (window.wrap = window.ShadowDOMPolyfill.wrapIfNeeded, window.unwrap = window.ShadowDOMPolyfill.unwrapIfNeeded) : window.wrap = window.unwrap = function(t4) { return t4; }), window.HTMLImports && (window.HTMLImports.__importsParsingHook = function(t4) { t4.import && s2(wrap(t4.import)); }), document.readyState === "complete" || t3.flags.eager) e3(); else if (document.readyState !== "interactive" || window.attachEvent || window.HTMLImports && !window.HTMLImports.ready) { var a2 = window.HTMLImports && !window.HTMLImports.ready ? "HTMLImportsLoaded" : "DOMContentLoaded"; window.addEventListener(a2, e3); } else e3(); }(window.CustomElements)); }.call(exports), function() { }.call(exports), function() { var t2 = this; (function() { (function() { this.Trix = {VERSION: "1.3.1", ZERO_WIDTH_SPACE: "\uFEFF", NON_BREAKING_SPACE: "\xA0", OBJECT_REPLACEMENT_CHARACTER: "\uFFFC", browser: {composesExistingText: /Android.*Chrome/.test(navigator.userAgent), forcesObjectResizing: /Trident.*rv:11/.test(navigator.userAgent), supportsInputEvents: function() { var t3, e3, n2, i; if (typeof InputEvent == "undefined") return false; for (i = ["data", "getTargetRanges", "inputType"], t3 = 0, e3 = i.length; e3 > t3; t3++) if (n2 = i[t3], !(n2 in InputEvent.prototype)) return false; return true; }()}, config: {}}; }).call(this); }).call(t2); var e2 = t2.Trix; (function() { (function() { e2.BasicObject = function() { function t3() { } var e3, n2, i; return t3.proxyMethod = function(t4) { var i2, o2, r2, s2, a2; return r2 = n2(t4), i2 = r2.name, s2 = r2.toMethod, a2 = r2.toProperty, o2 = r2.optional, this.prototype[i2] = function() { var t5, n3; return t5 = s2 != null ? o2 ? typeof this[s2] == "function" ? this[s2]() : void 0 : this[s2]() : a2 != null ? this[a2] : void 0, o2 ? (n3 = t5 != null ? t5[i2] : void 0, n3 != null ? e3.call(n3, t5, arguments) : void 0) : (n3 = t5[i2], e3.call(n3, t5, arguments)); }; }, n2 = function(t4) { var e4, n3; if (!(n3 = t4.match(i))) throw new Error("can't parse @proxyMethod expression: " + t4); return e4 = {name: n3[4]}, n3[2] != null ? e4.toMethod = n3[1] : e4.toProperty = n3[1], n3[3] != null && (e4.optional = true), e4; }, e3 = Function.prototype.apply, i = /^(.+?)(\(\))?(\?)?\.(.+?)$/, t3; }(); }).call(this), function() { var t3 = function(t4, e3) { function i() { this.constructor = t4; } for (var o2 in e3) n2.call(e3, o2) && (t4[o2] = e3[o2]); return i.prototype = e3.prototype, t4.prototype = new i(), t4.__super__ = e3.prototype, t4; }, n2 = {}.hasOwnProperty; e2.Object = function(n3) { function i() { this.id = ++o2; } var o2; return t3(i, n3), o2 = 0, i.fromJSONString = function(t4) { return this.fromJSON(JSON.parse(t4)); }, i.prototype.hasSameConstructorAs = function(t4) { return this.constructor === (t4 != null ? t4.constructor : void 0); }, i.prototype.isEqualTo = function(t4) { return this === t4; }, i.prototype.inspect = function() { var t4, e3, n4; return t4 = function() { var t5, i2, o3; i2 = (t5 = this.contentsForInspection()) != null ? t5 : {}, o3 = []; for (e3 in i2) n4 = i2[e3], o3.push(e3 + "=" + n4); return o3; }.call(this), "#<" + this.constructor.name + ":" + this.id + (t4.length ? " " + t4.join(", ") : "") + ">"; }, i.prototype.contentsForInspection = function() { }, i.prototype.toJSONString = function() { return JSON.stringify(this); }, i.prototype.toUTF16String = function() { return e2.UTF16String.box(this); }, i.prototype.getCacheKey = function() { return this.id.toString(); }, i; }(e2.BasicObject); }.call(this), function() { e2.extend = function(t3) { var e3, n2; for (e3 in t3) n2 = t3[e3], this[e3] = n2; return this; }; }.call(this), function() { e2.extend({defer: function(t3) { return setTimeout(t3, 1); }}); }.call(this), function() { var t3, n2; e2.extend({normalizeSpaces: function(t4) { return t4.replace(RegExp("" + e2.ZERO_WIDTH_SPACE, "g"), "").replace(RegExp("" + e2.NON_BREAKING_SPACE, "g"), " "); }, normalizeNewlines: function(t4) { return t4.replace(/\r\n/g, "\n"); }, breakableWhitespacePattern: RegExp("[^\\S" + e2.NON_BREAKING_SPACE + "]"), squishBreakableWhitespace: function(t4) { return t4.replace(RegExp("" + e2.breakableWhitespacePattern.source, "g"), " ").replace(/\ {2,}/g, " "); }, summarizeStringChange: function(t4, i) { var o2, r2, s2, a2; return t4 = e2.UTF16String.box(t4), i = e2.UTF16String.box(i), i.length < t4.length ? (r2 = n2(t4, i), a2 = r2[0], o2 = r2[1]) : (s2 = n2(i, t4), o2 = s2[0], a2 = s2[1]), {added: o2, removed: a2}; }}), n2 = function(n3, i) { var o2, r2, s2, a2, u; return n3.isEqualTo(i) ? ["", ""] : (r2 = t3(n3, i), a2 = r2.utf16String.length, s2 = a2 ? (u = r2.offset, r2, o2 = n3.codepoints.slice(0, u).concat(n3.codepoints.slice(u + a2)), t3(i, e2.UTF16String.fromCodepoints(o2))) : t3(i, n3), [r2.utf16String.toString(), s2.utf16String.toString()]); }, t3 = function(t4, e3) { var n3, i, o2; for (n3 = 0, i = t4.length, o2 = e3.length; i > n3 && t4.charAt(n3).isEqualTo(e3.charAt(n3)); ) n3++; for (; i > n3 + 1 && t4.charAt(i - 1).isEqualTo(e3.charAt(o2 - 1)); ) i--, o2--; return {utf16String: t4.slice(n3, i), offset: n3}; }; }.call(this), function() { e2.extend({copyObject: function(t3) { var e3, n2, i; t3 == null && (t3 = {}), n2 = {}; for (e3 in t3) i = t3[e3], n2[e3] = i; return n2; }, objectsAreEqual: function(t3, e3) { var n2, i; if (t3 == null && (t3 = {}), e3 == null && (e3 = {}), Object.keys(t3).length !== Object.keys(e3).length) return false; for (n2 in t3) if (i = t3[n2], i !== e3[n2]) return false; return true; }}); }.call(this), function() { var t3 = [].slice; e2.extend({arraysAreEqual: function(t4, e3) { var n2, i, o2, r2; if (t4 == null && (t4 = []), e3 == null && (e3 = []), t4.length !== e3.length) return false; for (i = n2 = 0, o2 = t4.length; o2 > n2; i = ++n2) if (r2 = t4[i], r2 !== e3[i]) return false; return true; }, arrayStartsWith: function(t4, n2) { return t4 == null && (t4 = []), n2 == null && (n2 = []), e2.arraysAreEqual(t4.slice(0, n2.length), n2); }, spliceArray: function() { var e3, n2, i; return n2 = arguments[0], e3 = 2 <= arguments.length ? t3.call(arguments, 1) : [], i = n2.slice(0), i.splice.apply(i, e3), i; }, summarizeArrayChange: function(t4, e3) { var n2, i, o2, r2, s2, a2, u, c2, l, h, p2; for (t4 == null && (t4 = []), e3 == null && (e3 = []), n2 = [], h = [], o2 = new Set(), r2 = 0, u = t4.length; u > r2; r2++) p2 = t4[r2], o2.add(p2); for (i = new Set(), s2 = 0, c2 = e3.length; c2 > s2; s2++) p2 = e3[s2], i.add(p2), o2.has(p2) || n2.push(p2); for (a2 = 0, l = t4.length; l > a2; a2++) p2 = t4[a2], i.has(p2) || h.push(p2); return {added: n2, removed: h}; }}); }.call(this), function() { var t3, n2, i, o2; t3 = null, n2 = null, o2 = null, i = null, e2.extend({getAllAttributeNames: function() { return t3 != null ? t3 : t3 = e2.getTextAttributeNames().concat(e2.getBlockAttributeNames()); }, getBlockConfig: function(t4) { return e2.config.blockAttributes[t4]; }, getBlockAttributeNames: function() { return n2 != null ? n2 : n2 = Object.keys(e2.config.blockAttributes); }, getTextConfig: function(t4) { return e2.config.textAttributes[t4]; }, getTextAttributeNames: function() { return o2 != null ? o2 : o2 = Object.keys(e2.config.textAttributes); }, getListAttributeNames: function() { var t4, n3; return i != null ? i : i = function() { var i2, o3; i2 = e2.config.blockAttributes, o3 = []; for (t4 in i2) n3 = i2[t4].listAttribute, n3 != null && o3.push(n3); return o3; }(); }}); }.call(this), function() { var t3, n2, i, o2, r2, s2 = [].indexOf || function(t4) { for (var e3 = 0, n3 = this.length; n3 > e3; e3++) if (e3 in this && this[e3] === t4) return e3; return -1; }; t3 = document.documentElement, n2 = (i = (o2 = (r2 = t3.matchesSelector) != null ? r2 : t3.webkitMatchesSelector) != null ? o2 : t3.msMatchesSelector) != null ? i : t3.mozMatchesSelector, e2.extend({handleEvent: function(n3, i2) { var o3, r3, s3, a2, u, c2, l, h, p2, d, f, g; return h = i2 != null ? i2 : {}, c2 = h.onElement, u = h.matchingSelector, g = h.withCallback, a2 = h.inPhase, l = h.preventDefault, d = h.times, r3 = c2 != null ? c2 : t3, p2 = u, o3 = g, f = a2 === "capturing", s3 = function(t4) { var n4; return d != null && --d === 0 && s3.destroy(), n4 = e2.findClosestElementFromNode(t4.target, {matchingSelector: p2}), n4 != null && (g != null && g.call(n4, t4, n4), l) ? t4.preventDefault() : void 0; }, s3.destroy = function() { return r3.removeEventListener(n3, s3, f); }, r3.addEventListener(n3, s3, f), s3; }, handleEventOnce: function(t4, n3) { return n3 == null && (n3 = {}), n3.times = 1, e2.handleEvent(t4, n3); }, triggerEvent: function(n3, i2) { var o3, r3, s3, a2, u, c2, l; return l = i2 != null ? i2 : {}, c2 = l.onElement, r3 = l.bubbles, s3 = l.cancelable, o3 = l.attributes, a2 = c2 != null ? c2 : t3, r3 = r3 !== false, s3 = s3 !== false, u = document.createEvent("Events"), u.initEvent(n3, r3, s3), o3 != null && e2.extend.call(u, o3), a2.dispatchEvent(u); }, elementMatchesSelector: function(t4, e3) { return (t4 != null ? t4.nodeType : void 0) === 1 ? n2.call(t4, e3) : void 0; }, findClosestElementFromNode: function(t4, n3) { var i2, o3, r3; for (o3 = n3 != null ? n3 : {}, i2 = o3.matchingSelector, r3 = o3.untilNode; t4 != null && t4.nodeType !== Node.ELEMENT_NODE; ) t4 = t4.parentNode; if (t4 != null) { if (i2 == null) return t4; if (t4.closest && r3 == null) return t4.closest(i2); for (; t4 && t4 !== r3; ) { if (e2.elementMatchesSelector(t4, i2)) return t4; t4 = t4.parentNode; } } }, findInnerElement: function(t4) { for (; t4 != null ? t4.firstElementChild : void 0; ) t4 = t4.firstElementChild; return t4; }, innerElementIsActive: function(t4) { return document.activeElement !== t4 && e2.elementContainsNode(t4, document.activeElement); }, elementContainsNode: function(t4, e3) { if (t4 && e3) for (; e3; ) { if (e3 === t4) return true; e3 = e3.parentNode; } }, findNodeFromContainerAndOffset: function(t4, e3) { var n3; if (t4) return t4.nodeType === Node.TEXT_NODE ? t4 : e3 === 0 ? (n3 = t4.firstChild) != null ? n3 : t4 : t4.childNodes.item(e3 - 1); }, findElementFromContainerAndOffset: function(t4, n3) { var i2; return i2 = e2.findNodeFromContainerAndOffset(t4, n3), e2.findClosestElementFromNode(i2); }, findChildIndexOfNode: function(t4) { var e3; if (t4 != null ? t4.parentNode : void 0) { for (e3 = 0; t4 = t4.previousSibling; ) e3++; return e3; } }, removeNode: function(t4) { var e3; return t4 != null && (e3 = t4.parentNode) != null ? e3.removeChild(t4) : void 0; }, walkTree: function(t4, e3) { var n3, i2, o3, r3, s3; return o3 = e3 != null ? e3 : {}, i2 = o3.onlyNodesOfType, r3 = o3.usingFilter, n3 = o3.expandEntityReferences, s3 = function() { switch (i2) { case "element": return NodeFilter.SHOW_ELEMENT; case "text": return NodeFilter.SHOW_TEXT; case "comment": return NodeFilter.SHOW_COMMENT; default: return NodeFilter.SHOW_ALL; } }(), document.createTreeWalker(t4, s3, r3 != null ? r3 : null, n3 === true); }, tagName: function(t4) { var e3; return t4 != null && (e3 = t4.tagName) != null ? e3.toLowerCase() : void 0; }, makeElement: function(t4, e3) { var n3, i2, o3, r3, s3, a2, u, c2, l, h, p2, d, f, g; if (e3 == null && (e3 = {}), typeof t4 == "object" ? (e3 = t4, t4 = e3.tagName) : e3 = {attributes: e3}, o3 = document.createElement(t4), e3.editable != null && (e3.attributes == null && (e3.attributes = {}), e3.attributes.contenteditable = e3.editable), e3.attributes) { l = e3.attributes; for (a2 in l) g = l[a2], o3.setAttribute(a2, g); } if (e3.style) { h = e3.style; for (a2 in h) g = h[a2], o3.style[a2] = g; } if (e3.data) { p2 = e3.data; for (a2 in p2) g = p2[a2], o3.dataset[a2] = g; } if (e3.className) for (d = e3.className.split(" "), r3 = 0, u = d.length; u > r3; r3++) i2 = d[r3], o3.classList.add(i2); if (e3.textContent && (o3.textContent = e3.textContent), e3.childNodes) for (f = [].concat(e3.childNodes), s3 = 0, c2 = f.length; c2 > s3; s3++) n3 = f[s3], o3.appendChild(n3); return o3; }, getBlockTagNames: function() { var t4, n3; return e2.blockTagNames != null ? e2.blockTagNames : e2.blockTagNames = function() { var i2, o3; i2 = e2.config.blockAttributes, o3 = []; for (t4 in i2) n3 = i2[t4].tagName, n3 && o3.push(n3); return o3; }(); }, nodeIsBlockContainer: function(t4) { return e2.nodeIsBlockStartComment(t4 != null ? t4.firstChild : void 0); }, nodeProbablyIsBlockContainer: function(t4) { var n3, i2; return n3 = e2.tagName(t4), s2.call(e2.getBlockTagNames(), n3) >= 0 && (i2 = e2.tagName(t4.firstChild), s2.call(e2.getBlockTagNames(), i2) < 0); }, nodeIsBlockStart: function(t4, n3) { var i2; return i2 = (n3 != null ? n3 : {strict: true}).strict, i2 ? e2.nodeIsBlockStartComment(t4) : e2.nodeIsBlockStartComment(t4) || !e2.nodeIsBlockStartComment(t4.firstChild) && e2.nodeProbablyIsBlockContainer(t4); }, nodeIsBlockStartComment: function(t4) { return e2.nodeIsCommentNode(t4) && (t4 != null ? t4.data : void 0) === "block"; }, nodeIsCommentNode: function(t4) { return (t4 != null ? t4.nodeType : void 0) === Node.COMMENT_NODE; }, nodeIsCursorTarget: function(t4, n3) { var i2; return i2 = (n3 != null ? n3 : {}).name, t4 ? e2.nodeIsTextNode(t4) ? t4.data === e2.ZERO_WIDTH_SPACE ? i2 ? t4.parentNode.dataset.trixCursorTarget === i2 : true : void 0 : e2.nodeIsCursorTarget(t4.firstChild) : void 0; }, nodeIsAttachmentElement: function(t4) { return e2.elementMatchesSelector(t4, e2.AttachmentView.attachmentSelector); }, nodeIsEmptyTextNode: function(t4) { return e2.nodeIsTextNode(t4) && (t4 != null ? t4.data : void 0) === ""; }, nodeIsTextNode: function(t4) { return (t4 != null ? t4.nodeType : void 0) === Node.TEXT_NODE; }}); }.call(this), function() { var t3, n2, i, o2, r2; t3 = e2.copyObject, o2 = e2.objectsAreEqual, e2.extend({normalizeRange: i = function(t4) { var e3; if (t4 != null) return Array.isArray(t4) || (t4 = [t4, t4]), [n2(t4[0]), n2((e3 = t4[1]) != null ? e3 : t4[0])]; }, rangeIsCollapsed: function(t4) { var e3, n3, o3; if (t4 != null) return n3 = i(t4), o3 = n3[0], e3 = n3[1], r2(o3, e3); }, rangesAreEqual: function(t4, e3) { var n3, o3, s2, a2, u, c2; if (t4 != null && e3 != null) return s2 = i(t4), o3 = s2[0], n3 = s2[1], a2 = i(e3), c2 = a2[0], u = a2[1], r2(o3, c2) && r2(n3, u); }}), n2 = function(e3) { return typeof e3 == "number" ? e3 : t3(e3); }, r2 = function(t4, e3) { return typeof t4 == "number" ? t4 === e3 : o2(t4, e3); }; }.call(this), function() { var t3, n2, i, o2, r2, s2, a2; e2.registerElement = function(t4, e3) { var n3, i2; return e3 == null && (e3 = {}), t4 = t4.toLowerCase(), e3 = a2(e3), i2 = s2(e3), (n3 = i2.defaultCSS) && (delete i2.defaultCSS, o2(n3, t4)), r2(t4, i2); }, o2 = function(t4, e3) { var n3; return n3 = i(e3), n3.textContent = t4.replace(/%t/g, e3); }, i = function(e3) { var n3, i2; return n3 = document.createElement("style"), n3.setAttribute("type", "text/css"), n3.setAttribute("data-tag-name", e3.toLowerCase()), (i2 = t3()) && n3.setAttribute("nonce", i2), document.head.insertBefore(n3, document.head.firstChild), n3; }, t3 = function() { var t4; return (t4 = n2("trix-csp-nonce") || n2("csp-nonce")) ? t4.getAttribute("content") : void 0; }, n2 = function(t4) { return document.head.querySelector("meta[name=" + t4 + "]"); }, s2 = function(t4) { var e3, n3, i2; n3 = {}; for (e3 in t4) i2 = t4[e3], n3[e3] = typeof i2 == "function" ? {value: i2} : i2; return n3; }, a2 = function() { var t4; return t4 = function(t5) { var e3, n3, i2, o3, r3; for (e3 = {}, r3 = ["initialize", "connect", "disconnect"], n3 = 0, o3 = r3.length; o3 > n3; n3++) i2 = r3[n3], e3[i2] = t5[i2], delete t5[i2]; return e3; }, window.customElements ? function(e3) { var n3, i2, o3, r3, s3; return s3 = t4(e3), o3 = s3.initialize, n3 = s3.connect, i2 = s3.disconnect, o3 && (r3 = n3, n3 = function() { return this.initialized || (this.initialized = true, o3.call(this)), r3 != null ? r3.call(this) : void 0; }), n3 && (e3.connectedCallback = n3), i2 && (e3.disconnectedCallback = i2), e3; } : function(e3) { var n3, i2, o3, r3; return r3 = t4(e3), o3 = r3.initialize, n3 = r3.connect, i2 = r3.disconnect, o3 && (e3.createdCallback = o3), n3 && (e3.attachedCallback = n3), i2 && (e3.detachedCallback = i2), e3; }; }(), r2 = function() { return window.customElements ? function(t4, e3) { var n3; return n3 = function() { return typeof Reflect == "object" ? Reflect.construct(HTMLElement, [], n3) : HTMLElement.apply(this); }, Object.setPrototypeOf(n3.prototype, HTMLElement.prototype), Object.setPrototypeOf(n3, HTMLElement), Object.defineProperties(n3.prototype, e3), window.customElements.define(t4, n3), n3; } : function(t4, e3) { var n3, i2; return i2 = Object.create(HTMLElement.prototype, e3), n3 = document.registerElement(t4, {prototype: i2}), Object.defineProperty(i2, "constructor", {value: n3}), n3; }; }(); }.call(this), function() { var t3, n2; e2.extend({getDOMSelection: function() { var t4; return t4 = window.getSelection(), t4.rangeCount > 0 ? t4 : void 0; }, getDOMRange: function() { var n3, i; return (n3 = (i = e2.getDOMSelection()) != null ? i.getRangeAt(0) : void 0) && !t3(n3) ? n3 : void 0; }, setDOMRange: function(t4) { var n3; return n3 = window.getSelection(), n3.removeAllRanges(), n3.addRange(t4), e2.selectionChangeObserver.update(); }}), t3 = function(t4) { return n2(t4.startContainer) || n2(t4.endContainer); }, n2 = function(t4) { return !Object.getPrototypeOf(t4); }; }.call(this), function() { var t3; t3 = {"application/x-trix-feature-detection": "test"}, e2.extend({dataTransferIsPlainText: function(t4) { var e3, n2, i; return i = t4.getData("text/plain"), n2 = t4.getData("text/html"), i && n2 ? (e3 = new DOMParser().parseFromString(n2, "text/html").body, e3.textContent === i ? !e3.querySelector("*") : void 0) : i != null ? i.length : void 0; }, dataTransferIsWritable: function(e3) { var n2, i; if ((e3 != null ? e3.setData : void 0) != null) { for (n2 in t3) if (i = t3[n2], !function() { try { return e3.setData(n2, i), e3.getData(n2) === i; } catch (t4) { } }()) return; return true; } }, keyEventIsKeyboardCommand: function() { return /Mac|^iP/.test(navigator.platform) ? function(t4) { return t4.metaKey; } : function(t4) { return t4.ctrlKey; }; }()}); }.call(this), function() { e2.extend({RTL_PATTERN: /[\u05BE\u05C0\u05C3\u05D0-\u05EA\u05F0-\u05F4\u061B\u061F\u0621-\u063A\u0640-\u064A\u066D\u0671-\u06B7\u06BA-\u06BE\u06C0-\u06CE\u06D0-\u06D5\u06E5\u06E6\u200F\u202B\u202E\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE72\uFE74\uFE76-\uFEFC]/, getDirection: function() { var t3, n2, i, o2; return n2 = e2.makeElement("input", {dir: "auto", name: "x", dirName: "x.dir"}), t3 = e2.makeElement("form"), t3.appendChild(n2), i = function() { try { return new FormData(t3).has(n2.dirName); } catch (e3) { } }(), o2 = function() { try { return n2.matches(":dir(ltr),:dir(rtl)"); } catch (t4) { } }(), i ? function(e3) { return n2.value = e3, new FormData(t3).get(n2.dirName); } : o2 ? function(t4) { return n2.value = t4, n2.matches(":dir(rtl)") ? "rtl" : "ltr"; } : function(t4) { var n3; return n3 = t4.trim().charAt(0), e2.RTL_PATTERN.test(n3) ? "rtl" : "ltr"; }; }()}); }.call(this), function() { }.call(this), function() { var t3, n2 = function(t4, e3) { function n3() { this.constructor = t4; } for (var o2 in e3) i.call(e3, o2) && (t4[o2] = e3[o2]); return n3.prototype = e3.prototype, t4.prototype = new n3(), t4.__super__ = e3.prototype, t4; }, i = {}.hasOwnProperty; t3 = e2.arraysAreEqual, e2.Hash = function(i2) { function o2(t4) { t4 == null && (t4 = {}), this.values = s2(t4), o2.__super__.constructor.apply(this, arguments); } var r2, s2, a2, u, c2; return n2(o2, i2), o2.fromCommonAttributesOfObjects = function(t4) { var e3, n3, i3, o3, s3, a3; if (t4 == null && (t4 = []), !t4.length) return new this(); for (e3 = r2(t4[0]), i3 = e3.getKeys(), a3 = t4.slice(1), n3 = 0, o3 = a3.length; o3 > n3; n3++) s3 = a3[n3], i3 = e3.getKeysCommonToHash(r2(s3)), e3 = e3.slice(i3); return e3; }, o2.box = function(t4) { return r2(t4); }, o2.prototype.add = function(t4, e3) { return this.merge(u(t4, e3)); }, o2.prototype.remove = function(t4) { return new e2.Hash(s2(this.values, t4)); }, o2.prototype.get = function(t4) { return this.values[t4]; }, o2.prototype.has = function(t4) { return t4 in this.values; }, o2.prototype.merge = function(t4) { return new e2.Hash(a2(this.values, c2(t4))); }, o2.prototype.slice = function(t4) { var n3, i3, o3, r3; for (r3 = {}, n3 = 0, o3 = t4.length; o3 > n3; n3++) i3 = t4[n3], this.has(i3) && (r3[i3] = this.values[i3]); return new e2.Hash(r3); }, o2.prototype.getKeys = function() { return Object.keys(this.values); }, o2.prototype.getKeysCommonToHash = function(t4) { var e3, n3, i3, o3, s3; for (t4 = r2(t4), o3 = this.getKeys(), s3 = [], e3 = 0, i3 = o3.length; i3 > e3; e3++) n3 = o3[e3], this.values[n3] === t4.values[n3] && s3.push(n3); return s3; }, o2.prototype.isEqualTo = function(e3) { return t3(this.toArray(), r2(e3).toArray()); }, o2.prototype.isEmpty = function() { return this.getKeys().length === 0; }, o2.prototype.toArray = function() { var t4, e3, n3; return (this.array != null ? this.array : this.array = function() { var i3; e3 = [], i3 = this.values; for (t4 in i3) n3 = i3[t4], e3.push(t4, n3); return e3; }.call(this)).slice(0); }, o2.prototype.toObject = function() { return s2(this.values); }, o2.prototype.toJSON = function() { return this.toObject(); }, o2.prototype.contentsForInspection = function() { return {values: JSON.stringify(this.values)}; }, u = function(t4, e3) { var n3; return n3 = {}, n3[t4] = e3, n3; }, a2 = function(t4, e3) { var n3, i3, o3; i3 = s2(t4); for (n3 in e3) o3 = e3[n3], i3[n3] = o3; return i3; }, s2 = function(t4, e3) { var n3, i3, o3, r3, s3; for (r3 = {}, s3 = Object.keys(t4).sort(), n3 = 0, o3 = s3.length; o3 > n3; n3++) i3 = s3[n3], i3 !== e3 && (r3[i3] = t4[i3]); return r3; }, r2 = function(t4) { return t4 instanceof e2.Hash ? t4 : new e2.Hash(t4); }, c2 = function(t4) { return t4 instanceof e2.Hash ? t4.values : t4; }, o2; }(e2.Object); }.call(this), function() { e2.ObjectGroup = function() { function t3(t4, e3) { var n2, i; this.objects = t4 != null ? t4 : [], i = e3.depth, n2 = e3.asTree, n2 && (this.depth = i, this.objects = this.constructor.groupObjects(this.objects, {asTree: n2, depth: this.depth + 1})); } return t3.groupObjects = function(t4, e3) { var n2, i, o2, r2, s2, a2, u, c2, l; for (t4 == null && (t4 = []), l = e3 != null ? e3 : {}, o2 = l.depth, n2 = l.asTree, n2 && o2 == null && (o2 = 0), c2 = [], s2 = 0, a2 = t4.length; a2 > s2; s2++) { if (u = t4[s2], r2) { if ((typeof u.canBeGrouped == "function" ? u.canBeGrouped(o2) : void 0) && (typeof (i = r2[r2.length - 1]).canBeGroupedWith == "function" ? i.canBeGroupedWith(u, o2) : void 0)) { r2.push(u); continue; } c2.push(new this(r2, {depth: o2, asTree: n2})), r2 = null; } (typeof u.canBeGrouped == "function" ? u.canBeGrouped(o2) : void 0) ? r2 = [u] : c2.push(u); } return r2 && c2.push(new this(r2, {depth: o2, asTree: n2})), c2; }, t3.prototype.getObjects = function() { return this.objects; }, t3.prototype.getDepth = function() { return this.depth; }, t3.prototype.getCacheKey = function() { var t4, e3, n2, i, o2; for (e3 = ["objectGroup"], o2 = this.getObjects(), t4 = 0, n2 = o2.length; n2 > t4; t4++) i = o2[t4], e3.push(i.getCacheKey()); return e3.join("/"); }, t3; }(); }.call(this), function() { var t3 = function(t4, e3) { function i() { this.constructor = t4; } for (var o2 in e3) n2.call(e3, o2) && (t4[o2] = e3[o2]); return i.prototype = e3.prototype, t4.prototype = new i(), t4.__super__ = e3.prototype, t4; }, n2 = {}.hasOwnProperty; e2.ObjectMap = function(e3) { function n3(t4) { var e4, n4, i, o2, r2; for (t4 == null && (t4 = []), this.objects = {}, i = 0, o2 = t4.length; o2 > i; i++) r2 = t4[i], n4 = JSON.stringify(r2), (e4 = this.objects)[n4] == null && (e4[n4] = r2); } return t3(n3, e3), n3.prototype.find = function(t4) { var e4; return e4 = JSON.stringify(t4), this.objects[e4]; }, n3; }(e2.BasicObject); }.call(this), function() { e2.ElementStore = function() { function t3(t4) { this.reset(t4); } var e3; return t3.prototype.add = function(t4) { var n2; return n2 = e3(t4), this.elements[n2] = t4; }, t3.prototype.remove = function(t4) { var n2, i; return n2 = e3(t4), (i = this.elements[n2]) ? (delete this.elements[n2], i) : void 0; }, t3.prototype.reset = function(t4) { var e4, n2, i; for (t4 == null && (t4 = []), this.elements = {}, n2 = 0, i = t4.length; i > n2; n2++) e4 = t4[n2], this.add(e4); return t4; }, e3 = function(t4) { return t4.dataset.trixStoreKey; }, t3; }(); }.call(this), function() { }.call(this), function() { var t3 = function(t4, e3) { function i() { this.constructor = t4; } for (var o2 in e3) n2.call(e3, o2) && (t4[o2] = e3[o2]); return i.prototype = e3.prototype, t4.prototype = new i(), t4.__super__ = e3.prototype, t4; }, n2 = {}.hasOwnProperty; e2.Operation = function(e3) { function n3() { return n3.__super__.constructor.apply(this, arguments); } return t3(n3, e3), n3.prototype.isPerforming = function() { return this.performing === true; }, n3.prototype.hasPerformed = function() { return this.performed === true; }, n3.prototype.hasSucceeded = function() { return this.performed && this.succeeded; }, n3.prototype.hasFailed = function() { return this.performed && !this.succeeded; }, n3.prototype.getPromise = function() { return this.promise != null ? this.promise : this.promise = new Promise(function(t4) { return function(e4, n4) { return t4.performing = true, t4.perform(function(i, o2) { return t4.succeeded = i, t4.performing = false, t4.performed = true, t4.succeeded ? e4(o2) : n4(o2); }); }; }(this)); }, n3.prototype.perform = function(t4) { return t4(false); }, n3.prototype.release = function() { var t4; return (t4 = this.promise) != null && typeof t4.cancel == "function" && t4.cancel(), this.promise = null, this.performing = null, this.performed = null, this.succeeded = null; }, n3.proxyMethod("getPromise().then"), n3.proxyMethod("getPromise().catch"), n3; }(e2.BasicObject); }.call(this), function() { var t3, n2, i, o2, r2, s2 = function(t4, e3) { function n3() { this.constructor = t4; } for (var i2 in e3) a2.call(e3, i2) && (t4[i2] = e3[i2]); return n3.prototype = e3.prototype, t4.prototype = new n3(), t4.__super__ = e3.prototype, t4; }, a2 = {}.hasOwnProperty; e2.UTF16String = function(t4) { function e3(t5, e4) { this.ucs2String = t5, this.codepoints = e4, this.length = this.codepoints.length, this.ucs2Length = this.ucs2String.length; } return s2(e3, t4), e3.box = function(t5) { return t5 == null && (t5 = ""), t5 instanceof this ? t5 : this.fromUCS2String(t5 != null ? t5.toString() : void 0); }, e3.fromUCS2String = function(t5) { return new this(t5, o2(t5)); }, e3.fromCodepoints = function(t5) { return new this(r2(t5), t5); }, e3.prototype.offsetToUCS2Offset = function(t5) { return r2(this.codepoints.slice(0, Math.max(0, t5))).length; }, e3.prototype.offsetFromUCS2Offset = function(t5) { return o2(this.ucs2String.slice(0, Math.max(0, t5))).length; }, e3.prototype.slice = function() { var t5; return this.constructor.fromCodepoints((t5 = this.codepoints).slice.apply(t5, arguments)); }, e3.prototype.charAt = function(t5) { return this.slice(t5, t5 + 1); }, e3.prototype.isEqualTo = function(t5) { return this.constructor.box(t5).ucs2String === this.ucs2String; }, e3.prototype.toJSON = function() { return this.ucs2String; }, e3.prototype.getCacheKey = function() { return this.ucs2String; }, e3.prototype.toString = function() { return this.ucs2String; }, e3; }(e2.BasicObject), t3 = (typeof Array.from == "function" ? Array.from("\u{1F47C}").length : void 0) === 1, n2 = (typeof " ".codePointAt == "function" ? " ".codePointAt(0) : void 0) != null, i = (typeof String.fromCodePoint == "function" ? String.fromCodePoint(32, 128124) : void 0) === " \u{1F47C}", o2 = t3 && n2 ? function(t4) { return Array.from(t4).map(function(t5) { return t5.codePointAt(0); }); } : function(t4) { var e3, n3, i2, o3, r3; for (o3 = [], e3 = 0, i2 = t4.length; i2 > e3; ) r3 = t4.charCodeAt(e3++), r3 >= 55296 && 56319 >= r3 && i2 > e3 && (n3 = t4.charCodeAt(e3++), (64512 & n3) === 56320 ? r3 = ((1023 & r3) << 10) + (1023 & n3) + 65536 : e3--), o3.push(r3); return o3; }, r2 = i ? function(t4) { return String.fromCodePoint.apply(String, t4); } : function(t4) { var e3, n3, i2; return e3 = function() { var e4, o3, r3; for (r3 = [], e4 = 0, o3 = t4.length; o3 > e4; e4++) i2 = t4[e4], n3 = "", i2 > 65535 && (i2 -= 65536, n3 += String.fromCharCode(i2 >>> 10 & 1023 | 55296), i2 = 56320 | 1023 & i2), r3.push(n3 + String.fromCharCode(i2)); return r3; }(), e3.join(""); }; }.call(this), function() { }.call(this), function() { }.call(this), function() { e2.config.lang = {attachFiles: "Attach Files", bold: "Bold", bullets: "Bullets", byte: "Byte", bytes: "Bytes", captionPlaceholder: "Add a caption\u2026", code: "Code", heading1: "Heading", indent: "Increase Level", italic: "Italic", link: "Link", numbers: "Numbers", outdent: "Decrease Level", quote: "Quote", redo: "Redo", remove: "Remove", strike: "Strikethrough", undo: "Undo", unlink: "Unlink", url: "URL", urlPlaceholder: "Enter a URL\u2026", GB: "GB", KB: "KB", MB: "MB", PB: "PB", TB: "TB"}; }.call(this), function() { e2.config.css = {attachment: "attachment", attachmentCaption: "attachment__caption", attachmentCaptionEditor: "attachment__caption-editor", attachmentMetadata: "attachment__metadata", attachmentMetadataContainer: "attachment__metadata-container", attachmentName: "attachment__name", attachmentProgress: "attachment__progress", attachmentSize: "attachment__size", attachmentToolbar: "attachment__toolbar", attachmentGallery: "attachment-gallery"}; }.call(this), function() { var t3; e2.config.blockAttributes = t3 = {default: {tagName: "div", parse: false}, quote: {tagName: "blockquote", nestable: true}, heading1: {tagName: "h1", terminal: true, breakOnReturn: true, group: false}, code: {tagName: "pre", terminal: true, text: {plaintext: true}}, bulletList: {tagName: "ul", parse: false}, bullet: {tagName: "li", listAttribute: "bulletList", group: false, nestable: true, test: function(n2) { return e2.tagName(n2.parentNode) === t3[this.listAttribute].tagName; }}, numberList: {tagName: "ol", parse: false}, number: {tagName: "li", listAttribute: "numberList", group: false, nestable: true, test: function(n2) { return e2.tagName(n2.parentNode) === t3[this.listAttribute].tagName; }}, attachmentGallery: {tagName: "div", exclusive: true, terminal: true, parse: false, group: false}}; }.call(this), function() { var t3, n2; t3 = e2.config.lang, n2 = [t3.bytes, t3.KB, t3.MB, t3.GB, t3.TB, t3.PB], e2.config.fileSize = {prefix: "IEC", precision: 2, formatter: function(e3) { var i, o2, r2, s2, a2; switch (e3) { case 0: return "0 " + t3.bytes; case 1: return "1 " + t3.byte; default: return i = function() { switch (this.prefix) { case "SI": return 1e3; case "IEC": return 1024; } }.call(this), o2 = Math.floor(Math.log(e3) / Math.log(i)), r2 = e3 / Math.pow(i, o2), s2 = r2.toFixed(this.precision), a2 = s2.replace(/0*$/, "").replace(/\.$/, ""), a2 + " " + n2[o2]; } }}; }.call(this), function() { e2.config.textAttributes = {bold: {tagName: "strong", inheritable: true, parser: function(t3) { var e3; return e3 = window.getComputedStyle(t3), e3.fontWeight === "bold" || e3.fontWeight >= 600; }}, italic: {tagName: "em", inheritable: true, parser: function(t3) { var e3; return e3 = window.getComputedStyle(t3), e3.fontStyle === "italic"; }}, href: {groupTagName: "a", parser: function(t3) { var n2, i, o2; return n2 = e2.AttachmentView.attachmentSelector, o2 = "a:not(" + n2 + ")", (i = e2.findClosestElementFromNode(t3, {matchingSelector: o2})) ? i.getAttribute("href") : void 0; }}, strike: {tagName: "del", inheritable: true}, frozen: {style: {backgroundColor: "highlight"}}}; }.call(this), function() { var t3, n2, i, o2, r2; r2 = "[data-trix-serialize=false]", o2 = ["contenteditable", "data-trix-id", "data-trix-store-key", "data-trix-mutable", "data-trix-placeholder", "tabindex"], n2 = "data-trix-serialized-attributes", i = "[" + n2 + "]", t3 = new RegExp("", "g"), e2.extend({serializers: {"application/json": function(t4) { var n3; if (t4 instanceof e2.Document) n3 = t4; else { if (!(t4 instanceof HTMLElement)) throw new Error("unserializable object"); n3 = e2.Document.fromHTML(t4.innerHTML); } return n3.toSerializableDocument().toJSONString(); }, "text/html": function(s2) { var a2, u, c2, l, h, p2, d, f, g, m, v, y, b, A, C3, x, w; if (s2 instanceof e2.Document) l = e2.DocumentView.render(s2); else { if (!(s2 instanceof HTMLElement)) throw new Error("unserializable object"); l = s2.cloneNode(true); } for (A = l.querySelectorAll(r2), h = 0, g = A.length; g > h; h++) c2 = A[h], e2.removeNode(c2); for (p2 = 0, m = o2.length; m > p2; p2++) for (a2 = o2[p2], C3 = l.querySelectorAll("[" + a2 + "]"), d = 0, v = C3.length; v > d; d++) c2 = C3[d], c2.removeAttribute(a2); for (x = l.querySelectorAll(i), f = 0, y = x.length; y > f; f++) { c2 = x[f]; try { u = JSON.parse(c2.getAttribute(n2)), c2.removeAttribute(n2); for (b in u) w = u[b], c2.setAttribute(b, w); } catch (E) { } } return l.innerHTML.replace(t3, ""); }}, deserializers: {"application/json": function(t4) { return e2.Document.fromJSONString(t4); }, "text/html": function(t4) { return e2.Document.fromHTML(t4); }}, serializeToContentType: function(t4, n3) { var i2; if (i2 = e2.serializers[n3]) return i2(t4); throw new Error("unknown content type: " + n3); }, deserializeFromContentType: function(t4, n3) { var i2; if (i2 = e2.deserializers[n3]) return i2(t4); throw new Error("unknown content type: " + n3); }}); }.call(this), function() { var t3; t3 = e2.config.lang, e2.config.toolbar = {getDefaultHTML: function() { return '
\n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n\n \n \n \n\n \n\n \n \n \n \n
\n\n
\n \n
'; }}; }.call(this), function() { e2.config.undoInterval = 5e3; }.call(this), function() { e2.config.attachments = {preview: {presentation: "gallery", caption: {name: true, size: true}}, file: {caption: {size: true}}}; }.call(this), function() { e2.config.keyNames = {8: "backspace", 9: "tab", 13: "return", 27: "escape", 37: "left", 39: "right", 46: "delete", 68: "d", 72: "h", 79: "o"}; }.call(this), function() { e2.config.input = {level2Enabled: true, getLevel: function() { return this.level2Enabled && e2.browser.supportsInputEvents ? 2 : 0; }, pickFiles: function(t3) { var n2; return n2 = e2.makeElement("input", {type: "file", multiple: true, hidden: true, id: this.fileInputId}), n2.addEventListener("change", function() { return t3(n2.files), e2.removeNode(n2); }), e2.removeNode(document.getElementById(this.fileInputId)), document.body.appendChild(n2), n2.click(); }, fileInputId: "trix-file-input-" + Date.now().toString(16)}; }.call(this), function() { }.call(this), function() { e2.registerElement("trix-toolbar", {defaultCSS: "%t {\n display: block;\n}\n\n%t {\n white-space: nowrap;\n}\n\n%t [data-trix-dialog] {\n display: none;\n}\n\n%t [data-trix-dialog][data-trix-active] {\n display: block;\n}\n\n%t [data-trix-dialog] [data-trix-validate]:invalid {\n background-color: #ffdddd;\n}", initialize: function() { return this.innerHTML === "" ? this.innerHTML = e2.config.toolbar.getDefaultHTML() : void 0; }}); }.call(this), function() { var t3 = function(t4, e3) { function i2() { this.constructor = t4; } for (var o2 in e3) n2.call(e3, o2) && (t4[o2] = e3[o2]); return i2.prototype = e3.prototype, t4.prototype = new i2(), t4.__super__ = e3.prototype, t4; }, n2 = {}.hasOwnProperty, i = [].indexOf || function(t4) { for (var e3 = 0, n3 = this.length; n3 > e3; e3++) if (e3 in this && this[e3] === t4) return e3; return -1; }; e2.ObjectView = function(n3) { function o2(t4, e3) { this.object = t4, this.options = e3 != null ? e3 : {}, this.childViews = [], this.rootView = this; } return t3(o2, n3), o2.prototype.getNodes = function() { var t4, e3, n4, i2, o3; for (this.nodes == null && (this.nodes = this.createNodes()), i2 = this.nodes, o3 = [], t4 = 0, e3 = i2.length; e3 > t4; t4++) n4 = i2[t4], o3.push(n4.cloneNode(true)); return o3; }, o2.prototype.invalidate = function() { var t4; return this.nodes = null, this.childViews = [], (t4 = this.parentView) != null ? t4.invalidate() : void 0; }, o2.prototype.invalidateViewForObject = function(t4) { var e3; return (e3 = this.findViewForObject(t4)) != null ? e3.invalidate() : void 0; }, o2.prototype.findOrCreateCachedChildView = function(t4, e3) { var n4; return (n4 = this.getCachedViewForObject(e3)) ? this.recordChildView(n4) : (n4 = this.createChildView.apply(this, arguments), this.cacheViewForObject(n4, e3)), n4; }, o2.prototype.createChildView = function(t4, n4, i2) { var o3; return i2 == null && (i2 = {}), n4 instanceof e2.ObjectGroup && (i2.viewClass = t4, t4 = e2.ObjectGroupView), o3 = new t4(n4, i2), this.recordChildView(o3); }, o2.prototype.recordChildView = function(t4) { return t4.parentView = this, t4.rootView = this.rootView, this.childViews.push(t4), t4; }, o2.prototype.getAllChildViews = function() { var t4, e3, n4, i2, o3; for (o3 = [], i2 = this.childViews, e3 = 0, n4 = i2.length; n4 > e3; e3++) t4 = i2[e3], o3.push(t4), o3 = o3.concat(t4.getAllChildViews()); return o3; }, o2.prototype.findElement = function() { return this.findElementForObject(this.object); }, o2.prototype.findElementForObject = function(t4) { var e3; return (e3 = t4 != null ? t4.id : void 0) ? this.rootView.element.querySelector("[data-trix-id='" + e3 + "']") : void 0; }, o2.prototype.findViewForObject = function(t4) { var e3, n4, i2, o3; for (i2 = this.getAllChildViews(), e3 = 0, n4 = i2.length; n4 > e3; e3++) if (o3 = i2[e3], o3.object === t4) return o3; }, o2.prototype.getViewCache = function() { return this.rootView !== this ? this.rootView.getViewCache() : this.isViewCachingEnabled() ? this.viewCache != null ? this.viewCache : this.viewCache = {} : void 0; }, o2.prototype.isViewCachingEnabled = function() { return this.shouldCacheViews !== false; }, o2.prototype.enableViewCaching = function() { return this.shouldCacheViews = true; }, o2.prototype.disableViewCaching = function() { return this.shouldCacheViews = false; }, o2.prototype.getCachedViewForObject = function(t4) { var e3; return (e3 = this.getViewCache()) != null ? e3[t4.getCacheKey()] : void 0; }, o2.prototype.cacheViewForObject = function(t4, e3) { var n4; return (n4 = this.getViewCache()) != null ? n4[e3.getCacheKey()] = t4 : void 0; }, o2.prototype.garbageCollectCachedViews = function() { var t4, e3, n4, o3, r2, s2; if (t4 = this.getViewCache()) { s2 = this.getAllChildViews().concat(this), n4 = function() { var t5, e4, n5; for (n5 = [], t5 = 0, e4 = s2.length; e4 > t5; t5++) r2 = s2[t5], n5.push(r2.object.getCacheKey()); return n5; }(), o3 = []; for (e3 in t4) i.call(n4, e3) < 0 && o3.push(delete t4[e3]); return o3; } }, o2; }(e2.BasicObject); }.call(this), function() { var t3 = function(t4, e3) { function i() { this.constructor = t4; } for (var o2 in e3) n2.call(e3, o2) && (t4[o2] = e3[o2]); return i.prototype = e3.prototype, t4.prototype = new i(), t4.__super__ = e3.prototype, t4; }, n2 = {}.hasOwnProperty; e2.ObjectGroupView = function(e3) { function n3() { n3.__super__.constructor.apply(this, arguments), this.objectGroup = this.object, this.viewClass = this.options.viewClass, delete this.options.viewClass; } return t3(n3, e3), n3.prototype.getChildViews = function() { var t4, e4, n4, i; if (!this.childViews.length) for (i = this.objectGroup.getObjects(), t4 = 0, e4 = i.length; e4 > t4; t4++) n4 = i[t4], this.findOrCreateCachedChildView(this.viewClass, n4, this.options); return this.childViews; }, n3.prototype.createNodes = function() { var t4, e4, n4, i, o2, r2, s2, a2, u; for (t4 = this.createContainerElement(), s2 = this.getChildViews(), e4 = 0, i = s2.length; i > e4; e4++) for (u = s2[e4], a2 = u.getNodes(), n4 = 0, o2 = a2.length; o2 > n4; n4++) r2 = a2[n4], t4.appendChild(r2); return [t4]; }, n3.prototype.createContainerElement = function(t4) { return t4 == null && (t4 = this.objectGroup.getDepth()), this.getChildViews()[0].createContainerElement(t4); }, n3; }(e2.ObjectView); }.call(this), function() { var t3 = function(t4, e3) { function i() { this.constructor = t4; } for (var o2 in e3) n2.call(e3, o2) && (t4[o2] = e3[o2]); return i.prototype = e3.prototype, t4.prototype = new i(), t4.__super__ = e3.prototype, t4; }, n2 = {}.hasOwnProperty; e2.Controller = function(e3) { function n3() { return n3.__super__.constructor.apply(this, arguments); } return t3(n3, e3), n3; }(e2.BasicObject); }.call(this), function() { var t3, n2, i, o2, r2, s2, a2 = function(t4, e3) { return function() { return t4.apply(e3, arguments); }; }, u = function(t4, e3) { function n3() { this.constructor = t4; } for (var i2 in e3) c2.call(e3, i2) && (t4[i2] = e3[i2]); return n3.prototype = e3.prototype, t4.prototype = new n3(), t4.__super__ = e3.prototype, t4; }, c2 = {}.hasOwnProperty, l = [].indexOf || function(t4) { for (var e3 = 0, n3 = this.length; n3 > e3; e3++) if (e3 in this && this[e3] === t4) return e3; return -1; }; t3 = e2.findClosestElementFromNode, i = e2.nodeIsEmptyTextNode, n2 = e2.nodeIsBlockStartComment, o2 = e2.normalizeSpaces, r2 = e2.summarizeStringChange, s2 = e2.tagName, e2.MutationObserver = function(e3) { function c3(t4) { this.element = t4, this.didMutate = a2(this.didMutate, this), this.observer = new window.MutationObserver(this.didMutate), this.start(); } var h, p2, d, f; return u(c3, e3), p2 = "data-trix-mutable", d = "[" + p2 + "]", f = {attributes: true, childList: true, characterData: true, characterDataOldValue: true, subtree: true}, c3.prototype.start = function() { return this.reset(), this.observer.observe(this.element, f); }, c3.prototype.stop = function() { return this.observer.disconnect(); }, c3.prototype.didMutate = function(t4) { var e4, n3; return (e4 = this.mutations).push.apply(e4, this.findSignificantMutations(t4)), this.mutations.length ? ((n3 = this.delegate) != null && typeof n3.elementDidMutate == "function" && n3.elementDidMutate(this.getMutationSummary()), this.reset()) : void 0; }, c3.prototype.reset = function() { return this.mutations = []; }, c3.prototype.findSignificantMutations = function(t4) { var e4, n3, i2, o3; for (o3 = [], e4 = 0, n3 = t4.length; n3 > e4; e4++) i2 = t4[e4], this.mutationIsSignificant(i2) && o3.push(i2); return o3; }, c3.prototype.mutationIsSignificant = function(t4) { var e4, n3, i2, o3; if (this.nodeIsMutable(t4.target)) return false; for (o3 = this.nodesModifiedByMutation(t4), e4 = 0, n3 = o3.length; n3 > e4; e4++) if (i2 = o3[e4], this.nodeIsSignificant(i2)) return true; return false; }, c3.prototype.nodeIsSignificant = function(t4) { return t4 !== this.element && !this.nodeIsMutable(t4) && !i(t4); }, c3.prototype.nodeIsMutable = function(e4) { return t3(e4, {matchingSelector: d}); }, c3.prototype.nodesModifiedByMutation = function(t4) { var e4; switch (e4 = [], t4.type) { case "attributes": t4.attributeName !== p2 && e4.push(t4.target); break; case "characterData": e4.push(t4.target.parentNode), e4.push(t4.target); break; case "childList": e4.push.apply(e4, t4.addedNodes), e4.push.apply(e4, t4.removedNodes); } return e4; }, c3.prototype.getMutationSummary = function() { return this.getTextMutationSummary(); }, c3.prototype.getTextMutationSummary = function() { var t4, e4, n3, i2, o3, r3, s3, a3, u2, c4, h2; for (a3 = this.getTextChangesFromCharacterData(), n3 = a3.additions, o3 = a3.deletions, h2 = this.getTextChangesFromChildList(), u2 = h2.additions, r3 = 0, s3 = u2.length; s3 > r3; r3++) e4 = u2[r3], l.call(n3, e4) < 0 && n3.push(e4); return o3.push.apply(o3, h2.deletions), c4 = {}, (t4 = n3.join("")) && (c4.textAdded = t4), (i2 = o3.join("")) && (c4.textDeleted = i2), c4; }, c3.prototype.getMutationsByType = function(t4) { var e4, n3, i2, o3, r3; for (o3 = this.mutations, r3 = [], e4 = 0, n3 = o3.length; n3 > e4; e4++) i2 = o3[e4], i2.type === t4 && r3.push(i2); return r3; }, c3.prototype.getTextChangesFromChildList = function() { var t4, e4, i2, r3, s3, a3, u2, c4, l2, p3, d2; for (t4 = [], u2 = [], a3 = this.getMutationsByType("childList"), e4 = 0, r3 = a3.length; r3 > e4; e4++) s3 = a3[e4], t4.push.apply(t4, s3.addedNodes), u2.push.apply(u2, s3.removedNodes); return c4 = t4.length === 0 && u2.length === 1 && n2(u2[0]), c4 ? (p3 = [], d2 = ["\n"]) : (p3 = h(t4), d2 = h(u2)), {additions: function() { var t5, e5, n3; for (n3 = [], i2 = t5 = 0, e5 = p3.length; e5 > t5; i2 = ++t5) l2 = p3[i2], l2 !== d2[i2] && n3.push(o2(l2)); return n3; }(), deletions: function() { var t5, e5, n3; for (n3 = [], i2 = t5 = 0, e5 = d2.length; e5 > t5; i2 = ++t5) l2 = d2[i2], l2 !== p3[i2] && n3.push(o2(l2)); return n3; }()}; }, c3.prototype.getTextChangesFromCharacterData = function() { var t4, e4, n3, i2, s3, a3, u2, c4; return e4 = this.getMutationsByType("characterData"), e4.length && (c4 = e4[0], n3 = e4[e4.length - 1], s3 = o2(c4.oldValue), i2 = o2(n3.target.data), a3 = r2(s3, i2), t4 = a3.added, u2 = a3.removed), {additions: t4 ? [t4] : [], deletions: u2 ? [u2] : []}; }, h = function(t4) { var e4, n3, i2, o3; for (t4 == null && (t4 = []), o3 = [], e4 = 0, n3 = t4.length; n3 > e4; e4++) switch (i2 = t4[e4], i2.nodeType) { case Node.TEXT_NODE: o3.push(i2.data); break; case Node.ELEMENT_NODE: s2(i2) === "br" ? o3.push("\n") : o3.push.apply(o3, h(i2.childNodes)); } return o3; }, c3; }(e2.BasicObject); }.call(this), function() { var t3 = function(t4, e3) { function i() { this.constructor = t4; } for (var o2 in e3) n2.call(e3, o2) && (t4[o2] = e3[o2]); return i.prototype = e3.prototype, t4.prototype = new i(), t4.__super__ = e3.prototype, t4; }, n2 = {}.hasOwnProperty; e2.FileVerificationOperation = function(e3) { function n3(t4) { this.file = t4; } return t3(n3, e3), n3.prototype.perform = function(t4) { var e4; return e4 = new FileReader(), e4.onerror = function() { return t4(false); }, e4.onload = function(n4) { return function() { e4.onerror = null; try { e4.abort(); } catch (i) { } return t4(true, n4.file); }; }(this), e4.readAsArrayBuffer(this.file); }, n3; }(e2.Operation); }.call(this), function() { var t3, n2, i = function(t4, e3) { function n3() { this.constructor = t4; } for (var i2 in e3) o2.call(e3, i2) && (t4[i2] = e3[i2]); return n3.prototype = e3.prototype, t4.prototype = new n3(), t4.__super__ = e3.prototype, t4; }, o2 = {}.hasOwnProperty; t3 = e2.handleEvent, n2 = e2.innerElementIsActive, e2.InputController = function(o3) { function r2(n3) { var i2; this.element = n3, this.mutationObserver = new e2.MutationObserver(this.element), this.mutationObserver.delegate = this; for (i2 in this.events) t3(i2, {onElement: this.element, withCallback: this.handlerFor(i2)}); } return i(r2, o3), r2.prototype.events = {}, r2.prototype.elementDidMutate = function() { }, r2.prototype.editorWillSyncDocumentView = function() { return this.mutationObserver.stop(); }, r2.prototype.editorDidSyncDocumentView = function() { return this.mutationObserver.start(); }, r2.prototype.requestRender = function() { var t4; return (t4 = this.delegate) != null && typeof t4.inputControllerDidRequestRender == "function" ? t4.inputControllerDidRequestRender() : void 0; }, r2.prototype.requestReparse = function() { var t4; return (t4 = this.delegate) != null && typeof t4.inputControllerDidRequestReparse == "function" && t4.inputControllerDidRequestReparse(), this.requestRender(); }, r2.prototype.attachFiles = function(t4) { var n3, i2; return i2 = function() { var i3, o4, r3; for (r3 = [], i3 = 0, o4 = t4.length; o4 > i3; i3++) n3 = t4[i3], r3.push(new e2.FileVerificationOperation(n3)); return r3; }(), Promise.all(i2).then(function(t5) { return function(e3) { return t5.handleInput(function() { var t6, n4; return (t6 = this.delegate) != null && t6.inputControllerWillAttachFiles(), (n4 = this.responder) != null && n4.insertFiles(e3), this.requestRender(); }); }; }(this)); }, r2.prototype.handlerFor = function(t4) { return function(e3) { return function(i2) { return i2.defaultPrevented ? void 0 : e3.handleInput(function() { return n2(this.element) ? void 0 : (this.eventName = t4, this.events[t4].call(this, i2)); }); }; }(this); }, r2.prototype.handleInput = function(t4) { var e3, n3; try { return (e3 = this.delegate) != null && e3.inputControllerWillHandleInput(), t4.call(this); } finally { (n3 = this.delegate) != null && n3.inputControllerDidHandleInput(); } }, r2.prototype.createLinkHTML = function(t4, e3) { var n3; return n3 = document.createElement("a"), n3.href = t4, n3.textContent = e3 != null ? e3 : t4, n3.outerHTML; }, r2; }(e2.BasicObject); }.call(this), function() { var t3, n2, i, o2, r2, s2, a2, u, c2, l, h, p2, d, f = function(t4, e3) { function n3() { this.constructor = t4; } for (var i2 in e3) g.call(e3, i2) && (t4[i2] = e3[i2]); return n3.prototype = e3.prototype, t4.prototype = new n3(), t4.__super__ = e3.prototype, t4; }, g = {}.hasOwnProperty, m = [].indexOf || function(t4) { for (var e3 = 0, n3 = this.length; n3 > e3; e3++) if (e3 in this && this[e3] === t4) return e3; return -1; }; c2 = e2.makeElement, l = e2.objectsAreEqual, d = e2.tagName, n2 = e2.browser, a2 = e2.keyEventIsKeyboardCommand, o2 = e2.dataTransferIsWritable, i = e2.dataTransferIsPlainText, u = e2.config.keyNames, e2.Level0InputController = function(n3) { function s3() { s3.__super__.constructor.apply(this, arguments), this.resetInputSummary(); } var d2; return f(s3, n3), d2 = 0, s3.prototype.setInputSummary = function(t4) { var e3, n4; t4 == null && (t4 = {}), this.inputSummary.eventName = this.eventName; for (e3 in t4) n4 = t4[e3], this.inputSummary[e3] = n4; return this.inputSummary; }, s3.prototype.resetInputSummary = function() { return this.inputSummary = {}; }, s3.prototype.reset = function() { return this.resetInputSummary(), e2.selectionChangeObserver.reset(); }, s3.prototype.elementDidMutate = function(t4) { var e3; return this.isComposing() ? (e3 = this.delegate) != null && typeof e3.inputControllerDidAllowUnhandledInput == "function" ? e3.inputControllerDidAllowUnhandledInput() : void 0 : this.handleInput(function() { return this.mutationIsSignificant(t4) && (this.mutationIsExpected(t4) ? this.requestRender() : this.requestReparse()), this.reset(); }); }, s3.prototype.mutationIsExpected = function(t4) { var e3, n4, i2, o3, r3, s4, a3, u2, c3, l2; return a3 = t4.textAdded, u2 = t4.textDeleted, this.inputSummary.preferDocument ? true : (e3 = a3 != null ? a3 === this.inputSummary.textAdded : !this.inputSummary.textAdded, n4 = u2 != null ? this.inputSummary.didDelete : !this.inputSummary.didDelete, c3 = (a3 === "\n" || a3 === " \n") && !e3, l2 = u2 === "\n" && !n4, s4 = c3 && !l2 || l2 && !c3, s4 && (o3 = this.getSelectedRange()) && (i2 = c3 ? a3.replace(/\n$/, "").length || -1 : (a3 != null ? a3.length : void 0) || 1, (r3 = this.responder) != null ? r3.positionIsBlockBreak(o3[1] + i2) : void 0) ? true : e3 && n4); }, s3.prototype.mutationIsSignificant = function(t4) { var e3, n4, i2; return i2 = Object.keys(t4).length > 0, e3 = ((n4 = this.compositionInput) != null ? n4.getEndData() : void 0) === "", i2 || !e3; }, s3.prototype.events = {keydown: function(t4) { var n4, i2, o3, r3, s4, c3, l2, h2, p3; if (this.isComposing() || this.resetInputSummary(), this.inputSummary.didInput = true, r3 = u[t4.keyCode]) { for (i2 = this.keys, h2 = ["ctrl", "alt", "shift", "meta"], o3 = 0, c3 = h2.length; c3 > o3; o3++) l2 = h2[o3], t4[l2 + "Key"] && (l2 === "ctrl" && (l2 = "control"), i2 = i2 != null ? i2[l2] : void 0); (i2 != null ? i2[r3] : void 0) != null && (this.setInputSummary({keyName: r3}), e2.selectionChangeObserver.reset(), i2[r3].call(this, t4)); } return a2(t4) && (n4 = String.fromCharCode(t4.keyCode).toLowerCase()) && (s4 = function() { var e3, n5, i3, o4; for (i3 = ["alt", "shift"], o4 = [], e3 = 0, n5 = i3.length; n5 > e3; e3++) l2 = i3[e3], t4[l2 + "Key"] && o4.push(l2); return o4; }(), s4.push(n4), (p3 = this.delegate) != null ? p3.inputControllerDidReceiveKeyboardCommand(s4) : void 0) ? t4.preventDefault() : void 0; }, keypress: function(t4) { var e3, n4, i2; if (this.inputSummary.eventName == null && !t4.metaKey && (!t4.ctrlKey || t4.altKey)) return (i2 = p2(t4)) ? ((e3 = this.delegate) != null && e3.inputControllerWillPerformTyping(), (n4 = this.responder) != null && n4.insertString(i2), this.setInputSummary({textAdded: i2, didDelete: this.selectionIsExpanded()})) : void 0; }, textInput: function(t4) { var e3, n4, i2, o3; return e3 = t4.data, o3 = this.inputSummary.textAdded, o3 && o3 !== e3 && o3.toUpperCase() === e3 ? (n4 = this.getSelectedRange(), this.setSelectedRange([n4[0], n4[1] + o3.length]), (i2 = this.responder) != null && i2.insertString(e3), this.setInputSummary({textAdded: e3}), this.setSelectedRange(n4)) : void 0; }, dragenter: function(t4) { return t4.preventDefault(); }, dragstart: function(t4) { var e3, n4; return n4 = t4.target, this.serializeSelectionToDataTransfer(t4.dataTransfer), this.draggedRange = this.getSelectedRange(), (e3 = this.delegate) != null && typeof e3.inputControllerDidStartDrag == "function" ? e3.inputControllerDidStartDrag() : void 0; }, dragover: function(t4) { var e3, n4; return !this.draggedRange && !this.canAcceptDataTransfer(t4.dataTransfer) || (t4.preventDefault(), e3 = {x: t4.clientX, y: t4.clientY}, l(e3, this.draggingPoint)) ? void 0 : (this.draggingPoint = e3, (n4 = this.delegate) != null && typeof n4.inputControllerDidReceiveDragOverPoint == "function" ? n4.inputControllerDidReceiveDragOverPoint(this.draggingPoint) : void 0); }, dragend: function() { var t4; return (t4 = this.delegate) != null && typeof t4.inputControllerDidCancelDrag == "function" && t4.inputControllerDidCancelDrag(), this.draggedRange = null, this.draggingPoint = null; }, drop: function(t4) { var n4, i2, o3, r3, s4, a3, u2, c3, l2; return t4.preventDefault(), o3 = (s4 = t4.dataTransfer) != null ? s4.files : void 0, r3 = {x: t4.clientX, y: t4.clientY}, (a3 = this.responder) != null && a3.setLocationRangeFromPointRange(r3), (o3 != null ? o3.length : void 0) ? this.attachFiles(o3) : this.draggedRange ? ((u2 = this.delegate) != null && u2.inputControllerWillMoveText(), (c3 = this.responder) != null && c3.moveTextFromRange(this.draggedRange), this.draggedRange = null, this.requestRender()) : (i2 = t4.dataTransfer.getData("application/x-trix-document")) && (n4 = e2.Document.fromJSONString(i2), (l2 = this.responder) != null && l2.insertDocument(n4), this.requestRender()), this.draggedRange = null, this.draggingPoint = null; }, cut: function(t4) { var e3, n4; return ((e3 = this.responder) != null ? e3.selectionIsExpanded() : void 0) && (this.serializeSelectionToDataTransfer(t4.clipboardData) && t4.preventDefault(), (n4 = this.delegate) != null && n4.inputControllerWillCutText(), this.deleteInDirection("backward"), t4.defaultPrevented) ? this.requestRender() : void 0; }, copy: function(t4) { var e3; return ((e3 = this.responder) != null ? e3.selectionIsExpanded() : void 0) && this.serializeSelectionToDataTransfer(t4.clipboardData) ? t4.preventDefault() : void 0; }, paste: function(t4) { var n4, o3, s4, a3, u2, c3, l2, p3, f2, g2, v, y, b, A, C3, x, w, E, S2, R, k, D2, L2; return n4 = (p3 = t4.clipboardData) != null ? p3 : t4.testClipboardData, l2 = {clipboard: n4}, n4 == null || h(t4) ? void this.getPastedHTMLUsingHiddenElement(function(t5) { return function(e3) { var n5, i2, o4; return l2.type = "text/html", l2.html = e3, (n5 = t5.delegate) != null && n5.inputControllerWillPaste(l2), (i2 = t5.responder) != null && i2.insertHTML(l2.html), t5.requestRender(), (o4 = t5.delegate) != null ? o4.inputControllerDidPaste(l2) : void 0; }; }(this)) : ((a3 = n4.getData("URL")) ? (l2.type = "text/html", L2 = (c3 = n4.getData("public.url-name")) ? e2.squishBreakableWhitespace(c3).trim() : a3, l2.html = this.createLinkHTML(a3, L2), (f2 = this.delegate) != null && f2.inputControllerWillPaste(l2), this.setInputSummary({textAdded: L2, didDelete: this.selectionIsExpanded()}), (C3 = this.responder) != null && C3.insertHTML(l2.html), this.requestRender(), (x = this.delegate) != null && x.inputControllerDidPaste(l2)) : i(n4) ? (l2.type = "text/plain", l2.string = n4.getData("text/plain"), (w = this.delegate) != null && w.inputControllerWillPaste(l2), this.setInputSummary({textAdded: l2.string, didDelete: this.selectionIsExpanded()}), (E = this.responder) != null && E.insertString(l2.string), this.requestRender(), (S2 = this.delegate) != null && S2.inputControllerDidPaste(l2)) : (u2 = n4.getData("text/html")) ? (l2.type = "text/html", l2.html = u2, (R = this.delegate) != null && R.inputControllerWillPaste(l2), (k = this.responder) != null && k.insertHTML(l2.html), this.requestRender(), (D2 = this.delegate) != null && D2.inputControllerDidPaste(l2)) : m.call(n4.types, "Files") >= 0 && (s4 = (g2 = n4.items) != null && (v = g2[0]) != null && typeof v.getAsFile == "function" ? v.getAsFile() : void 0) && (!s4.name && (o3 = r2(s4)) && (s4.name = "pasted-file-" + ++d2 + "." + o3), l2.type = "File", l2.file = s4, (y = this.delegate) != null && y.inputControllerWillAttachFiles(), (b = this.responder) != null && b.insertFile(l2.file), this.requestRender(), (A = this.delegate) != null && A.inputControllerDidPaste(l2)), t4.preventDefault()); }, compositionstart: function(t4) { return this.getCompositionInput().start(t4.data); }, compositionupdate: function(t4) { return this.getCompositionInput().update(t4.data); }, compositionend: function(t4) { return this.getCompositionInput().end(t4.data); }, beforeinput: function() { return this.inputSummary.didInput = true; }, input: function(t4) { return this.inputSummary.didInput = true, t4.stopPropagation(); }}, s3.prototype.keys = {backspace: function(t4) { var e3; return (e3 = this.delegate) != null && e3.inputControllerWillPerformTyping(), this.deleteInDirection("backward", t4); }, delete: function(t4) { var e3; return (e3 = this.delegate) != null && e3.inputControllerWillPerformTyping(), this.deleteInDirection("forward", t4); }, return: function() { var t4, e3; return this.setInputSummary({preferDocument: true}), (t4 = this.delegate) != null && t4.inputControllerWillPerformTyping(), (e3 = this.responder) != null ? e3.insertLineBreak() : void 0; }, tab: function(t4) { var e3, n4; return ((e3 = this.responder) != null ? e3.canIncreaseNestingLevel() : void 0) ? ((n4 = this.responder) != null && n4.increaseNestingLevel(), this.requestRender(), t4.preventDefault()) : void 0; }, left: function(t4) { var e3; return this.selectionIsInCursorTarget() ? (t4.preventDefault(), (e3 = this.responder) != null ? e3.moveCursorInDirection("backward") : void 0) : void 0; }, right: function(t4) { var e3; return this.selectionIsInCursorTarget() ? (t4.preventDefault(), (e3 = this.responder) != null ? e3.moveCursorInDirection("forward") : void 0) : void 0; }, control: {d: function(t4) { var e3; return (e3 = this.delegate) != null && e3.inputControllerWillPerformTyping(), this.deleteInDirection("forward", t4); }, h: function(t4) { var e3; return (e3 = this.delegate) != null && e3.inputControllerWillPerformTyping(), this.deleteInDirection("backward", t4); }, o: function(t4) { var e3, n4; return t4.preventDefault(), (e3 = this.delegate) != null && e3.inputControllerWillPerformTyping(), (n4 = this.responder) != null && n4.insertString("\n", {updatePosition: false}), this.requestRender(); }}, shift: {return: function(t4) { var e3, n4; return (e3 = this.delegate) != null && e3.inputControllerWillPerformTyping(), (n4 = this.responder) != null && n4.insertString("\n"), this.requestRender(), t4.preventDefault(); }, tab: function(t4) { var e3, n4; return ((e3 = this.responder) != null ? e3.canDecreaseNestingLevel() : void 0) ? ((n4 = this.responder) != null && n4.decreaseNestingLevel(), this.requestRender(), t4.preventDefault()) : void 0; }, left: function(t4) { return this.selectionIsInCursorTarget() ? (t4.preventDefault(), this.expandSelectionInDirection("backward")) : void 0; }, right: function(t4) { return this.selectionIsInCursorTarget() ? (t4.preventDefault(), this.expandSelectionInDirection("forward")) : void 0; }}, alt: {backspace: function() { var t4; return this.setInputSummary({preferDocument: false}), (t4 = this.delegate) != null ? t4.inputControllerWillPerformTyping() : void 0; }}, meta: {backspace: function() { var t4; return this.setInputSummary({preferDocument: false}), (t4 = this.delegate) != null ? t4.inputControllerWillPerformTyping() : void 0; }}}, s3.prototype.getCompositionInput = function() { return this.isComposing() ? this.compositionInput : this.compositionInput = new t3(this); }, s3.prototype.isComposing = function() { return this.compositionInput != null && !this.compositionInput.isEnded(); }, s3.prototype.deleteInDirection = function(t4, e3) { var n4; return ((n4 = this.responder) != null ? n4.deleteInDirection(t4) : void 0) !== false ? this.setInputSummary({didDelete: true}) : e3 ? (e3.preventDefault(), this.requestRender()) : void 0; }, s3.prototype.serializeSelectionToDataTransfer = function(t4) { var n4, i2; if (o2(t4)) return n4 = (i2 = this.responder) != null ? i2.getSelectedDocument().toSerializableDocument() : void 0, t4.setData("application/x-trix-document", JSON.stringify(n4)), t4.setData("text/html", e2.DocumentView.render(n4).innerHTML), t4.setData("text/plain", n4.toString().replace(/\n$/, "")), true; }, s3.prototype.canAcceptDataTransfer = function(t4) { var e3, n4, i2, o3, r3, s4; for (s4 = {}, o3 = (i2 = t4 != null ? t4.types : void 0) != null ? i2 : [], e3 = 0, n4 = o3.length; n4 > e3; e3++) r3 = o3[e3], s4[r3] = true; return s4.Files || s4["application/x-trix-document"] || s4["text/html"] || s4["text/plain"]; }, s3.prototype.getPastedHTMLUsingHiddenElement = function(t4) { var n4, i2, o3; return i2 = this.getSelectedRange(), o3 = {position: "absolute", left: window.pageXOffset + "px", top: window.pageYOffset + "px", opacity: 0}, n4 = c2({style: o3, tagName: "div", editable: true}), document.body.appendChild(n4), n4.focus(), requestAnimationFrame(function(o4) { return function() { var r3; return r3 = n4.innerHTML, e2.removeNode(n4), o4.setSelectedRange(i2), t4(r3); }; }(this)); }, s3.proxyMethod("responder?.getSelectedRange"), s3.proxyMethod("responder?.setSelectedRange"), s3.proxyMethod("responder?.expandSelectionInDirection"), s3.proxyMethod("responder?.selectionIsInCursorTarget"), s3.proxyMethod("responder?.selectionIsExpanded"), s3; }(e2.InputController), r2 = function(t4) { var e3, n3; return (e3 = t4.type) != null && (n3 = e3.match(/\/(\w+)$/)) != null ? n3[1] : void 0; }, s2 = (typeof " ".codePointAt == "function" ? " ".codePointAt(0) : void 0) != null, p2 = function(t4) { var n3; return t4.key && s2 && t4.key.codePointAt(0) === t4.keyCode ? t4.key : (t4.which === null ? n3 = t4.keyCode : t4.which !== 0 && t4.charCode !== 0 && (n3 = t4.charCode), n3 != null && u[n3] !== "escape" ? e2.UTF16String.fromCodepoints([n3]).toString() : void 0); }, h = function(t4) { var e3, n3, i2, o3, r3, s3, a3, u2, c3, l2; if (u2 = t4.clipboardData) { if (m.call(u2.types, "text/html") >= 0) { for (c3 = u2.types, i2 = 0, s3 = c3.length; s3 > i2; i2++) if (l2 = c3[i2], e3 = /^CorePasteboardFlavorType/.test(l2), n3 = /^dyn\./.test(l2) && u2.getData(l2), a3 = e3 || n3) return true; return false; } return o3 = m.call(u2.types, "com.apple.webarchive") >= 0, r3 = m.call(u2.types, "com.apple.flat-rtfd") >= 0, o3 || r3; } }, t3 = function(t4) { function e3(t5) { var e4; this.inputController = t5, e4 = this.inputController, this.responder = e4.responder, this.delegate = e4.delegate, this.inputSummary = e4.inputSummary, this.data = {}; } return f(e3, t4), e3.prototype.start = function(t5) { var e4, n3; return this.data.start = t5, this.isSignificant() ? (this.inputSummary.eventName === "keypress" && this.inputSummary.textAdded && (e4 = this.responder) != null && e4.deleteInDirection("left"), this.selectionIsExpanded() || (this.insertPlaceholder(), this.requestRender()), this.range = (n3 = this.responder) != null ? n3.getSelectedRange() : void 0) : void 0; }, e3.prototype.update = function(t5) { var e4; return this.data.update = t5, this.isSignificant() && (e4 = this.selectPlaceholder()) ? (this.forgetPlaceholder(), this.range = e4) : void 0; }, e3.prototype.end = function(t5) { var e4, n3, i2, o3; return this.data.end = t5, this.isSignificant() ? (this.forgetPlaceholder(), this.canApplyToDocument() ? (this.setInputSummary({preferDocument: true, didInput: false}), (e4 = this.delegate) != null && e4.inputControllerWillPerformTyping(), (n3 = this.responder) != null && n3.setSelectedRange(this.range), (i2 = this.responder) != null && i2.insertString(this.data.end), (o3 = this.responder) != null ? o3.setSelectedRange(this.range[0] + this.data.end.length) : void 0) : this.data.start != null || this.data.update != null ? (this.requestReparse(), this.inputController.reset()) : void 0) : this.inputController.reset(); }, e3.prototype.getEndData = function() { return this.data.end; }, e3.prototype.isEnded = function() { return this.getEndData() != null; }, e3.prototype.isSignificant = function() { return n2.composesExistingText ? this.inputSummary.didInput : true; }, e3.prototype.canApplyToDocument = function() { var t5, e4; return ((t5 = this.data.start) != null ? t5.length : void 0) === 0 && ((e4 = this.data.end) != null ? e4.length : void 0) > 0 && this.range != null; }, e3.proxyMethod("inputController.setInputSummary"), e3.proxyMethod("inputController.requestRender"), e3.proxyMethod("inputController.requestReparse"), e3.proxyMethod("responder?.selectionIsExpanded"), e3.proxyMethod("responder?.insertPlaceholder"), e3.proxyMethod("responder?.selectPlaceholder"), e3.proxyMethod("responder?.forgetPlaceholder"), e3; }(e2.BasicObject); }.call(this), function() { var t3, n2, i, o2 = function(t4, e3) { return function() { return t4.apply(e3, arguments); }; }, r2 = function(t4, e3) { function n3() { this.constructor = t4; } for (var i2 in e3) s2.call(e3, i2) && (t4[i2] = e3[i2]); return n3.prototype = e3.prototype, t4.prototype = new n3(), t4.__super__ = e3.prototype, t4; }, s2 = {}.hasOwnProperty, a2 = [].indexOf || function(t4) { for (var e3 = 0, n3 = this.length; n3 > e3; e3++) if (e3 in this && this[e3] === t4) return e3; return -1; }; t3 = e2.dataTransferIsPlainText, n2 = e2.keyEventIsKeyboardCommand, i = e2.objectsAreEqual, e2.Level2InputController = function(s3) { function u() { return this.render = o2(this.render, this), u.__super__.constructor.apply(this, arguments); } var c2, l, h, p2, d, f; return r2(u, s3), u.prototype.elementDidMutate = function() { var t4; return this.scheduledRender ? this.composing && (t4 = this.delegate) != null && typeof t4.inputControllerDidAllowUnhandledInput == "function" ? t4.inputControllerDidAllowUnhandledInput() : void 0 : this.reparse(); }, u.prototype.scheduleRender = function() { return this.scheduledRender != null ? this.scheduledRender : this.scheduledRender = requestAnimationFrame(this.render); }, u.prototype.render = function() { var t4; return cancelAnimationFrame(this.scheduledRender), this.scheduledRender = null, this.composing || (t4 = this.delegate) != null && t4.render(), typeof this.afterRender == "function" && this.afterRender(), this.afterRender = null; }, u.prototype.reparse = function() { var t4; return (t4 = this.delegate) != null ? t4.reparse() : void 0; }, u.prototype.events = {keydown: function(t4) { var e3, i2, o3, r3; if (n2(t4)) { if (e3 = l(t4), (r3 = this.delegate) != null ? r3.inputControllerDidReceiveKeyboardCommand(e3) : void 0) return t4.preventDefault(); } else if (o3 = t4.key, t4.altKey && (o3 += "+Alt"), t4.shiftKey && (o3 += "+Shift"), i2 = this.keys[o3]) return this.withEvent(t4, i2); }, paste: function(t4) { var e3, n3, i2, o3, r3, s4, a3, u2, c3; return h(t4) ? (t4.preventDefault(), this.attachFiles(t4.clipboardData.files)) : p2(t4) ? (t4.preventDefault(), n3 = {type: "text/plain", string: t4.clipboardData.getData("text/plain")}, (i2 = this.delegate) != null && i2.inputControllerWillPaste(n3), (o3 = this.responder) != null && o3.insertString(n3.string), this.render(), (r3 = this.delegate) != null ? r3.inputControllerDidPaste(n3) : void 0) : (e3 = (s4 = t4.clipboardData) != null ? s4.getData("URL") : void 0) ? (t4.preventDefault(), n3 = {type: "text/html", html: this.createLinkHTML(e3)}, (a3 = this.delegate) != null && a3.inputControllerWillPaste(n3), (u2 = this.responder) != null && u2.insertHTML(n3.html), this.render(), (c3 = this.delegate) != null ? c3.inputControllerDidPaste(n3) : void 0) : void 0; }, beforeinput: function(t4) { var e3; return (e3 = this.inputTypes[t4.inputType]) ? (this.withEvent(t4, e3), this.scheduleRender()) : void 0; }, input: function() { return e2.selectionChangeObserver.reset(); }, dragstart: function(t4) { var e3, n3; return ((e3 = this.responder) != null ? e3.selectionContainsAttachments() : void 0) ? (t4.dataTransfer.setData("application/x-trix-dragging", true), this.dragging = {range: (n3 = this.responder) != null ? n3.getSelectedRange() : void 0, point: d(t4)}) : void 0; }, dragenter: function(t4) { return c2(t4) ? t4.preventDefault() : void 0; }, dragover: function(t4) { var e3, n3; if (this.dragging) { if (t4.preventDefault(), e3 = d(t4), !i(e3, this.dragging.point)) return this.dragging.point = e3, (n3 = this.responder) != null ? n3.setLocationRangeFromPointRange(e3) : void 0; } else if (c2(t4)) return t4.preventDefault(); }, drop: function(t4) { var e3, n3, i2, o3; return this.dragging ? (t4.preventDefault(), (n3 = this.delegate) != null && n3.inputControllerWillMoveText(), (i2 = this.responder) != null && i2.moveTextFromRange(this.dragging.range), this.dragging = null, this.scheduleRender()) : c2(t4) ? (t4.preventDefault(), e3 = d(t4), (o3 = this.responder) != null && o3.setLocationRangeFromPointRange(e3), this.attachFiles(t4.dataTransfer.files)) : void 0; }, dragend: function() { var t4; return this.dragging ? ((t4 = this.responder) != null && t4.setSelectedRange(this.dragging.range), this.dragging = null) : void 0; }, compositionend: function() { return this.composing ? (this.composing = false, this.scheduleRender()) : void 0; }}, u.prototype.keys = {ArrowLeft: function() { var t4, e3; return ((t4 = this.responder) != null ? t4.shouldManageMovingCursorInDirection("backward") : void 0) ? (this.event.preventDefault(), (e3 = this.responder) != null ? e3.moveCursorInDirection("backward") : void 0) : void 0; }, ArrowRight: function() { var t4, e3; return ((t4 = this.responder) != null ? t4.shouldManageMovingCursorInDirection("forward") : void 0) ? (this.event.preventDefault(), (e3 = this.responder) != null ? e3.moveCursorInDirection("forward") : void 0) : void 0; }, Backspace: function() { var t4, e3, n3; return ((t4 = this.responder) != null ? t4.shouldManageDeletingInDirection("backward") : void 0) ? (this.event.preventDefault(), (e3 = this.delegate) != null && e3.inputControllerWillPerformTyping(), (n3 = this.responder) != null && n3.deleteInDirection("backward"), this.render()) : void 0; }, Tab: function() { var t4, e3; return ((t4 = this.responder) != null ? t4.canIncreaseNestingLevel() : void 0) ? (this.event.preventDefault(), (e3 = this.responder) != null && e3.increaseNestingLevel(), this.render()) : void 0; }, "Tab+Shift": function() { var t4, e3; return ((t4 = this.responder) != null ? t4.canDecreaseNestingLevel() : void 0) ? (this.event.preventDefault(), (e3 = this.responder) != null && e3.decreaseNestingLevel(), this.render()) : void 0; }}, u.prototype.inputTypes = {deleteByComposition: function() { return this.deleteInDirection("backward", {recordUndoEntry: false}); }, deleteByCut: function() { return this.deleteInDirection("backward"); }, deleteByDrag: function() { return this.event.preventDefault(), this.withTargetDOMRange(function() { var t4; return this.deleteByDragRange = (t4 = this.responder) != null ? t4.getSelectedRange() : void 0; }); }, deleteCompositionText: function() { return this.deleteInDirection("backward", {recordUndoEntry: false}); }, deleteContent: function() { return this.deleteInDirection("backward"); }, deleteContentBackward: function() { return this.deleteInDirection("backward"); }, deleteContentForward: function() { return this.deleteInDirection("forward"); }, deleteEntireSoftLine: function() { return this.deleteInDirection("forward"); }, deleteHardLineBackward: function() { return this.deleteInDirection("backward"); }, deleteHardLineForward: function() { return this.deleteInDirection("forward"); }, deleteSoftLineBackward: function() { return this.deleteInDirection("backward"); }, deleteSoftLineForward: function() { return this.deleteInDirection("forward"); }, deleteWordBackward: function() { return this.deleteInDirection("backward"); }, deleteWordForward: function() { return this.deleteInDirection("forward"); }, formatBackColor: function() { return this.activateAttributeIfSupported("backgroundColor", this.event.data); }, formatBold: function() { return this.toggleAttributeIfSupported("bold"); }, formatFontColor: function() { return this.activateAttributeIfSupported("color", this.event.data); }, formatFontName: function() { return this.activateAttributeIfSupported("font", this.event.data); }, formatIndent: function() { var t4; return ((t4 = this.responder) != null ? t4.canIncreaseNestingLevel() : void 0) ? this.withTargetDOMRange(function() { var t5; return (t5 = this.responder) != null ? t5.increaseNestingLevel() : void 0; }) : void 0; }, formatItalic: function() { return this.toggleAttributeIfSupported("italic"); }, formatJustifyCenter: function() { return this.toggleAttributeIfSupported("justifyCenter"); }, formatJustifyFull: function() { return this.toggleAttributeIfSupported("justifyFull"); }, formatJustifyLeft: function() { return this.toggleAttributeIfSupported("justifyLeft"); }, formatJustifyRight: function() { return this.toggleAttributeIfSupported("justifyRight"); }, formatOutdent: function() { var t4; return ((t4 = this.responder) != null ? t4.canDecreaseNestingLevel() : void 0) ? this.withTargetDOMRange(function() { var t5; return (t5 = this.responder) != null ? t5.decreaseNestingLevel() : void 0; }) : void 0; }, formatRemove: function() { return this.withTargetDOMRange(function() { var t4, e3, n3, i2; i2 = []; for (t4 in (e3 = this.responder) != null ? e3.getCurrentAttributes() : void 0) i2.push((n3 = this.responder) != null ? n3.removeCurrentAttribute(t4) : void 0); return i2; }); }, formatSetBlockTextDirection: function() { return this.activateAttributeIfSupported("blockDir", this.event.data); }, formatSetInlineTextDirection: function() { return this.activateAttributeIfSupported("textDir", this.event.data); }, formatStrikeThrough: function() { return this.toggleAttributeIfSupported("strike"); }, formatSubscript: function() { return this.toggleAttributeIfSupported("sub"); }, formatSuperscript: function() { return this.toggleAttributeIfSupported("sup"); }, formatUnderline: function() { return this.toggleAttributeIfSupported("underline"); }, historyRedo: function() { var t4; return (t4 = this.delegate) != null ? t4.inputControllerWillPerformRedo() : void 0; }, historyUndo: function() { var t4; return (t4 = this.delegate) != null ? t4.inputControllerWillPerformUndo() : void 0; }, insertCompositionText: function() { return this.composing = true, this.insertString(this.event.data); }, insertFromComposition: function() { return this.composing = false, this.insertString(this.event.data); }, insertFromDrop: function() { var t4, e3; return (t4 = this.deleteByDragRange) ? (this.deleteByDragRange = null, (e3 = this.delegate) != null && e3.inputControllerWillMoveText(), this.withTargetDOMRange(function() { var e4; return (e4 = this.responder) != null ? e4.moveTextFromRange(t4) : void 0; })) : void 0; }, insertFromPaste: function() { var n3, i2, o3, r3, s4, a3, u2, c3, l2, h2, p3; return n3 = this.event.dataTransfer, s4 = {dataTransfer: n3}, (i2 = n3.getData("URL")) ? (this.event.preventDefault(), s4.type = "text/html", p3 = (r3 = n3.getData("public.url-name")) ? e2.squishBreakableWhitespace(r3).trim() : i2, s4.html = this.createLinkHTML(i2, p3), (a3 = this.delegate) != null && a3.inputControllerWillPaste(s4), this.withTargetDOMRange(function() { var t4; return (t4 = this.responder) != null ? t4.insertHTML(s4.html) : void 0; }), this.afterRender = function(t4) { return function() { var e3; return (e3 = t4.delegate) != null ? e3.inputControllerDidPaste(s4) : void 0; }; }(this)) : t3(n3) ? (s4.type = "text/plain", s4.string = n3.getData("text/plain"), (u2 = this.delegate) != null && u2.inputControllerWillPaste(s4), this.withTargetDOMRange(function() { var t4; return (t4 = this.responder) != null ? t4.insertString(s4.string) : void 0; }), this.afterRender = function(t4) { return function() { var e3; return (e3 = t4.delegate) != null ? e3.inputControllerDidPaste(s4) : void 0; }; }(this)) : (o3 = n3.getData("text/html")) ? (this.event.preventDefault(), s4.type = "text/html", s4.html = o3, (c3 = this.delegate) != null && c3.inputControllerWillPaste(s4), this.withTargetDOMRange(function() { var t4; return (t4 = this.responder) != null ? t4.insertHTML(s4.html) : void 0; }), this.afterRender = function(t4) { return function() { var e3; return (e3 = t4.delegate) != null ? e3.inputControllerDidPaste(s4) : void 0; }; }(this)) : ((l2 = n3.files) != null ? l2.length : void 0) ? (s4.type = "File", s4.file = n3.files[0], (h2 = this.delegate) != null && h2.inputControllerWillPaste(s4), this.withTargetDOMRange(function() { var t4; return (t4 = this.responder) != null ? t4.insertFile(s4.file) : void 0; }), this.afterRender = function(t4) { return function() { var e3; return (e3 = t4.delegate) != null ? e3.inputControllerDidPaste(s4) : void 0; }; }(this)) : void 0; }, insertFromYank: function() { return this.insertString(this.event.data); }, insertLineBreak: function() { return this.insertString("\n"); }, insertLink: function() { return this.activateAttributeIfSupported("href", this.event.data); }, insertOrderedList: function() { return this.toggleAttributeIfSupported("number"); }, insertParagraph: function() { var t4; return (t4 = this.delegate) != null && t4.inputControllerWillPerformTyping(), this.withTargetDOMRange(function() { var t5; return (t5 = this.responder) != null ? t5.insertLineBreak() : void 0; }); }, insertReplacementText: function() { return this.insertString(this.event.dataTransfer.getData("text/plain"), {updatePosition: false}); }, insertText: function() { var t4, e3; return this.insertString((t4 = this.event.data) != null ? t4 : (e3 = this.event.dataTransfer) != null ? e3.getData("text/plain") : void 0); }, insertTranspose: function() { return this.insertString(this.event.data); }, insertUnorderedList: function() { return this.toggleAttributeIfSupported("bullet"); }}, u.prototype.insertString = function(t4, e3) { var n3; return t4 == null && (t4 = ""), (n3 = this.delegate) != null && n3.inputControllerWillPerformTyping(), this.withTargetDOMRange(function() { var n4; return (n4 = this.responder) != null ? n4.insertString(t4, e3) : void 0; }); }, u.prototype.toggleAttributeIfSupported = function(t4) { var n3; return a2.call(e2.getAllAttributeNames(), t4) >= 0 ? ((n3 = this.delegate) != null && n3.inputControllerWillPerformFormatting(t4), this.withTargetDOMRange(function() { var e3; return (e3 = this.responder) != null ? e3.toggleCurrentAttribute(t4) : void 0; })) : void 0; }, u.prototype.activateAttributeIfSupported = function(t4, n3) { var i2; return a2.call(e2.getAllAttributeNames(), t4) >= 0 ? ((i2 = this.delegate) != null && i2.inputControllerWillPerformFormatting(t4), this.withTargetDOMRange(function() { var e3; return (e3 = this.responder) != null ? e3.setCurrentAttribute(t4, n3) : void 0; })) : void 0; }, u.prototype.deleteInDirection = function(t4, e3) { var n3, i2, o3, r3; return o3 = (e3 != null ? e3 : {recordUndoEntry: true}).recordUndoEntry, o3 && (r3 = this.delegate) != null && r3.inputControllerWillPerformTyping(), i2 = function(e4) { return function() { var n4; return (n4 = e4.responder) != null ? n4.deleteInDirection(t4) : void 0; }; }(this), (n3 = this.getTargetDOMRange({minLength: 2})) ? this.withTargetDOMRange(n3, i2) : i2(); }, u.prototype.withTargetDOMRange = function(t4, n3) { var i2; return typeof t4 == "function" && (n3 = t4, t4 = this.getTargetDOMRange()), t4 ? (i2 = this.responder) != null ? i2.withTargetDOMRange(t4, n3.bind(this)) : void 0 : (e2.selectionChangeObserver.reset(), n3.call(this)); }, u.prototype.getTargetDOMRange = function(t4) { var e3, n3, i2, o3; return i2 = (t4 != null ? t4 : {minLength: 0}).minLength, (o3 = typeof (e3 = this.event).getTargetRanges == "function" ? e3.getTargetRanges() : void 0) && o3.length && (n3 = f(o3[0]), i2 === 0 || n3.toString().length >= i2) ? n3 : void 0; }, f = function(t4) { var e3; return e3 = document.createRange(), e3.setStart(t4.startContainer, t4.startOffset), e3.setEnd(t4.endContainer, t4.endOffset), e3; }, u.prototype.withEvent = function(t4, e3) { var n3; this.event = t4; try { n3 = e3.call(this); } finally { this.event = null; } return n3; }, c2 = function(t4) { var e3, n3; return a2.call((e3 = (n3 = t4.dataTransfer) != null ? n3.types : void 0) != null ? e3 : [], "Files") >= 0; }, h = function(t4) { var e3; return (e3 = t4.clipboardData) ? a2.call(e3.types, "Files") >= 0 && e3.types.length === 1 && e3.files.length >= 1 : void 0; }, p2 = function(t4) { var e3; return (e3 = t4.clipboardData) ? a2.call(e3.types, "text/plain") >= 0 && e3.types.length === 1 : void 0; }, l = function(t4) { var e3; return e3 = [], t4.altKey && e3.push("alt"), t4.shiftKey && e3.push("shift"), e3.push(t4.key), e3; }, d = function(t4) { return {x: t4.clientX, y: t4.clientY}; }, u; }(e2.InputController); }.call(this), function() { var t3, n2, i, o2, r2, s2, a2, u, c2 = function(t4, e3) { return function() { return t4.apply(e3, arguments); }; }, l = function(t4, e3) { function n3() { this.constructor = t4; } for (var i2 in e3) h.call(e3, i2) && (t4[i2] = e3[i2]); return n3.prototype = e3.prototype, t4.prototype = new n3(), t4.__super__ = e3.prototype, t4; }, h = {}.hasOwnProperty; n2 = e2.defer, i = e2.handleEvent, s2 = e2.makeElement, u = e2.tagName, a2 = e2.config, r2 = a2.lang, t3 = a2.css, o2 = a2.keyNames, e2.AttachmentEditorController = function(a3) { function h2(t4, e3, n3, i2) { this.attachmentPiece = t4, this.element = e3, this.container = n3, this.options = i2 != null ? i2 : {}, this.didBlurCaption = c2(this.didBlurCaption, this), this.didChangeCaption = c2(this.didChangeCaption, this), this.didInputCaption = c2(this.didInputCaption, this), this.didKeyDownCaption = c2(this.didKeyDownCaption, this), this.didClickActionButton = c2(this.didClickActionButton, this), this.didClickToolbar = c2(this.didClickToolbar, this), this.attachment = this.attachmentPiece.attachment, u(this.element) === "a" && (this.element = this.element.firstChild), this.install(); } var p2; return l(h2, a3), p2 = function(t4) { return function() { var e3; return e3 = t4.apply(this, arguments), e3["do"](), this.undos == null && (this.undos = []), this.undos.push(e3.undo); }; }, h2.prototype.install = function() { return this.makeElementMutable(), this.addToolbar(), this.attachment.isPreviewable() ? this.installCaptionEditor() : void 0; }, h2.prototype.uninstall = function() { var t4, e3; for (this.savePendingCaption(); e3 = this.undos.pop(); ) e3(); return (t4 = this.delegate) != null ? t4.didUninstallAttachmentEditor(this) : void 0; }, h2.prototype.savePendingCaption = function() { var t4, e3, n3; return this.pendingCaption != null ? (t4 = this.pendingCaption, this.pendingCaption = null, t4 ? (e3 = this.delegate) != null && typeof e3.attachmentEditorDidRequestUpdatingAttributesForAttachment == "function" ? e3.attachmentEditorDidRequestUpdatingAttributesForAttachment({caption: t4}, this.attachment) : void 0 : (n3 = this.delegate) != null && typeof n3.attachmentEditorDidRequestRemovingAttributeForAttachment == "function" ? n3.attachmentEditorDidRequestRemovingAttributeForAttachment("caption", this.attachment) : void 0) : void 0; }, h2.prototype.makeElementMutable = p2(function() { return {do: function(t4) { return function() { return t4.element.dataset.trixMutable = true; }; }(this), undo: function(t4) { return function() { return delete t4.element.dataset.trixMutable; }; }(this)}; }), h2.prototype.addToolbar = p2(function() { var n3; return n3 = s2({tagName: "div", className: t3.attachmentToolbar, data: {trixMutable: true}, childNodes: s2({tagName: "div", className: "trix-button-row", childNodes: s2({tagName: "span", className: "trix-button-group trix-button-group--actions", childNodes: s2({tagName: "button", className: "trix-button trix-button--remove", textContent: r2.remove, attributes: {title: r2.remove}, data: {trixAction: "remove"}})})})}), this.attachment.isPreviewable() && n3.appendChild(s2({tagName: "div", className: t3.attachmentMetadataContainer, childNodes: s2({tagName: "span", className: t3.attachmentMetadata, childNodes: [s2({tagName: "span", className: t3.attachmentName, textContent: this.attachment.getFilename(), attributes: {title: this.attachment.getFilename()}}), s2({tagName: "span", className: t3.attachmentSize, textContent: this.attachment.getFormattedFilesize()})]})})), i("click", {onElement: n3, withCallback: this.didClickToolbar}), i("click", {onElement: n3, matchingSelector: "[data-trix-action]", withCallback: this.didClickActionButton}), {do: function(t4) { return function() { return t4.element.appendChild(n3); }; }(this), undo: function() { return function() { return e2.removeNode(n3); }; }(this)}; }), h2.prototype.installCaptionEditor = p2(function() { var o3, a4, u2, c3, l2; return c3 = s2({tagName: "textarea", className: t3.attachmentCaptionEditor, attributes: {placeholder: r2.captionPlaceholder}, data: {trixMutable: true}}), c3.value = this.attachmentPiece.getCaption(), l2 = c3.cloneNode(), l2.classList.add("trix-autoresize-clone"), l2.tabIndex = -1, o3 = function() { return l2.value = c3.value, c3.style.height = l2.scrollHeight + "px"; }, i("input", {onElement: c3, withCallback: o3}), i("input", {onElement: c3, withCallback: this.didInputCaption}), i("keydown", {onElement: c3, withCallback: this.didKeyDownCaption}), i("change", {onElement: c3, withCallback: this.didChangeCaption}), i("blur", {onElement: c3, withCallback: this.didBlurCaption}), u2 = this.element.querySelector("figcaption"), a4 = u2.cloneNode(), {do: function(e3) { return function() { return u2.style.display = "none", a4.appendChild(c3), a4.appendChild(l2), a4.classList.add(t3.attachmentCaption + "--editing"), u2.parentElement.insertBefore(a4, u2), o3(), e3.options.editCaption ? n2(function() { return c3.focus(); }) : void 0; }; }(this), undo: function() { return e2.removeNode(a4), u2.style.display = null; }}; }), h2.prototype.didClickToolbar = function(t4) { return t4.preventDefault(), t4.stopPropagation(); }, h2.prototype.didClickActionButton = function(t4) { var e3, n3; switch (e3 = t4.target.getAttribute("data-trix-action")) { case "remove": return (n3 = this.delegate) != null ? n3.attachmentEditorDidRequestRemovalOfAttachment(this.attachment) : void 0; } }, h2.prototype.didKeyDownCaption = function(t4) { var e3; return o2[t4.keyCode] === "return" ? (t4.preventDefault(), this.savePendingCaption(), (e3 = this.delegate) != null && typeof e3.attachmentEditorDidRequestDeselectingAttachment == "function" ? e3.attachmentEditorDidRequestDeselectingAttachment(this.attachment) : void 0) : void 0; }, h2.prototype.didInputCaption = function(t4) { return this.pendingCaption = t4.target.value.replace(/\s/g, " ").trim(); }, h2.prototype.didChangeCaption = function() { return this.savePendingCaption(); }, h2.prototype.didBlurCaption = function() { return this.savePendingCaption(); }, h2; }(e2.BasicObject); }.call(this), function() { var t3, n2, i, o2 = function(t4, e3) { function n3() { this.constructor = t4; } for (var i2 in e3) r2.call(e3, i2) && (t4[i2] = e3[i2]); return n3.prototype = e3.prototype, t4.prototype = new n3(), t4.__super__ = e3.prototype, t4; }, r2 = {}.hasOwnProperty; i = e2.makeElement, t3 = e2.config.css, e2.AttachmentView = function(r3) { function s2() { s2.__super__.constructor.apply(this, arguments), this.attachment = this.object, this.attachment.uploadProgressDelegate = this, this.attachmentPiece = this.options.piece; } var a2; return o2(s2, r3), s2.attachmentSelector = "[data-trix-attachment]", s2.prototype.createContentNodes = function() { return []; }, s2.prototype.createNodes = function() { var e3, n3, o3, r4, s3, u, c2; if (e3 = r4 = i({tagName: "figure", className: this.getClassName(), data: this.getData(), editable: false}), (n3 = this.getHref()) && (r4 = i({tagName: "a", editable: false, attributes: {href: n3, tabindex: -1}}), e3.appendChild(r4)), this.attachment.hasContent()) r4.innerHTML = this.attachment.getContent(); else for (c2 = this.createContentNodes(), o3 = 0, s3 = c2.length; s3 > o3; o3++) u = c2[o3], r4.appendChild(u); return r4.appendChild(this.createCaptionElement()), this.attachment.isPending() && (this.progressElement = i({tagName: "progress", attributes: {class: t3.attachmentProgress, value: this.attachment.getUploadProgress(), max: 100}, data: {trixMutable: true, trixStoreKey: ["progressElement", this.attachment.id].join("/")}}), e3.appendChild(this.progressElement)), [a2("left"), e3, a2("right")]; }, s2.prototype.createCaptionElement = function() { var e3, n3, o3, r4, s3, a3, u; return o3 = i({tagName: "figcaption", className: t3.attachmentCaption}), (e3 = this.attachmentPiece.getCaption()) ? (o3.classList.add(t3.attachmentCaption + "--edited"), o3.textContent = e3) : (n3 = this.getCaptionConfig(), n3.name && (r4 = this.attachment.getFilename()), n3.size && (a3 = this.attachment.getFormattedFilesize()), r4 && (s3 = i({tagName: "span", className: t3.attachmentName, textContent: r4}), o3.appendChild(s3)), a3 && (r4 && o3.appendChild(document.createTextNode(" ")), u = i({tagName: "span", className: t3.attachmentSize, textContent: a3}), o3.appendChild(u))), o3; }, s2.prototype.getClassName = function() { var e3, n3; return n3 = [t3.attachment, t3.attachment + "--" + this.attachment.getType()], (e3 = this.attachment.getExtension()) && n3.push(t3.attachment + "--" + e3), n3.join(" "); }, s2.prototype.getData = function() { var t4, e3; return e3 = {trixAttachment: JSON.stringify(this.attachment), trixContentType: this.attachment.getContentType(), trixId: this.attachment.id}, t4 = this.attachmentPiece.attributes, t4.isEmpty() || (e3.trixAttributes = JSON.stringify(t4)), this.attachment.isPending() && (e3.trixSerialize = false), e3; }, s2.prototype.getHref = function() { return n2(this.attachment.getContent(), "a") ? void 0 : this.attachment.getHref(); }, s2.prototype.getCaptionConfig = function() { var t4, n3, i2; return i2 = this.attachment.getType(), t4 = e2.copyObject((n3 = e2.config.attachments[i2]) != null ? n3.caption : void 0), i2 === "file" && (t4.name = true), t4; }, s2.prototype.findProgressElement = function() { var t4; return (t4 = this.findElement()) != null ? t4.querySelector("progress") : void 0; }, a2 = function(t4) { return i({tagName: "span", textContent: e2.ZERO_WIDTH_SPACE, data: {trixCursorTarget: t4, trixSerialize: false}}); }, s2.prototype.attachmentDidChangeUploadProgress = function() { var t4, e3; return e3 = this.attachment.getUploadProgress(), (t4 = this.findProgressElement()) != null ? t4.value = e3 : void 0; }, s2; }(e2.ObjectView), n2 = function(t4, e3) { var n3; return n3 = i("div"), n3.innerHTML = t4 != null ? t4 : "", n3.querySelector(e3); }; }.call(this), function() { var t3, n2 = function(t4, e3) { function n3() { this.constructor = t4; } for (var o2 in e3) i.call(e3, o2) && (t4[o2] = e3[o2]); return n3.prototype = e3.prototype, t4.prototype = new n3(), t4.__super__ = e3.prototype, t4; }, i = {}.hasOwnProperty; t3 = e2.makeElement, e2.PreviewableAttachmentView = function(i2) { function o2() { o2.__super__.constructor.apply(this, arguments), this.attachment.previewDelegate = this; } return n2(o2, i2), o2.prototype.createContentNodes = function() { return this.image = t3({tagName: "img", attributes: {src: ""}, data: {trixMutable: true}}), this.refresh(this.image), [this.image]; }, o2.prototype.createCaptionElement = function() { var t4; return t4 = o2.__super__.createCaptionElement.apply(this, arguments), t4.textContent || t4.setAttribute("data-trix-placeholder", e2.config.lang.captionPlaceholder), t4; }, o2.prototype.refresh = function(t4) { var e3; return t4 == null && (t4 = (e3 = this.findElement()) != null ? e3.querySelector("img") : void 0), t4 ? this.updateAttributesForImage(t4) : void 0; }, o2.prototype.updateAttributesForImage = function(t4) { var e3, n3, i3, o3, r2, s2; return r2 = this.attachment.getURL(), n3 = this.attachment.getPreviewURL(), t4.src = n3 || r2, n3 === r2 ? t4.removeAttribute("data-trix-serialized-attributes") : (i3 = JSON.stringify({src: r2}), t4.setAttribute("data-trix-serialized-attributes", i3)), s2 = this.attachment.getWidth(), e3 = this.attachment.getHeight(), s2 != null && (t4.width = s2), e3 != null && (t4.height = e3), o3 = ["imageElement", this.attachment.id, t4.src, t4.width, t4.height].join("/"), t4.dataset.trixStoreKey = o3; }, o2.prototype.attachmentDidChangeAttributes = function() { return this.refresh(this.image), this.refresh(); }, o2; }(e2.AttachmentView); }.call(this), function() { var t3, n2, i, o2 = function(t4, e3) { function n3() { this.constructor = t4; } for (var i2 in e3) r2.call(e3, i2) && (t4[i2] = e3[i2]); return n3.prototype = e3.prototype, t4.prototype = new n3(), t4.__super__ = e3.prototype, t4; }, r2 = {}.hasOwnProperty; i = e2.makeElement, t3 = e2.findInnerElement, n2 = e2.getTextConfig, e2.PieceView = function(r3) { function s2() { var t4; s2.__super__.constructor.apply(this, arguments), this.piece = this.object, this.attributes = this.piece.getAttributes(), t4 = this.options, this.textConfig = t4.textConfig, this.context = t4.context, this.piece.attachment ? this.attachment = this.piece.attachment : this.string = this.piece.toString(); } var a2; return o2(s2, r3), s2.prototype.createNodes = function() { var e3, n3, i2, o3, r4, s3; if (s3 = this.attachment ? this.createAttachmentNodes() : this.createStringNodes(), e3 = this.createElement()) { for (i2 = t3(e3), n3 = 0, o3 = s3.length; o3 > n3; n3++) r4 = s3[n3], i2.appendChild(r4); s3 = [e3]; } return s3; }, s2.prototype.createAttachmentNodes = function() { var t4, n3; return t4 = this.attachment.isPreviewable() ? e2.PreviewableAttachmentView : e2.AttachmentView, n3 = this.createChildView(t4, this.piece.attachment, {piece: this.piece}), n3.getNodes(); }, s2.prototype.createStringNodes = function() { var t4, e3, n3, o3, r4, s3, a3, u, c2, l; if ((u = this.textConfig) != null ? u.plaintext : void 0) return [document.createTextNode(this.string)]; for (a3 = [], c2 = this.string.split("\n"), n3 = e3 = 0, o3 = c2.length; o3 > e3; n3 = ++e3) l = c2[n3], n3 > 0 && (t4 = i("br"), a3.push(t4)), (r4 = l.length) && (s3 = document.createTextNode(this.preserveSpaces(l)), a3.push(s3)); return a3; }, s2.prototype.createElement = function() { var t4, e3, o3, r4, s3, a3, u, c2, l; c2 = {}, a3 = this.attributes; for (r4 in a3) if (l = a3[r4], (t4 = n2(r4)) && (t4.tagName && (s3 = i(t4.tagName), o3 ? (o3.appendChild(s3), o3 = s3) : e3 = o3 = s3), t4.styleProperty && (c2[t4.styleProperty] = l), t4.style)) { u = t4.style; for (r4 in u) l = u[r4], c2[r4] = l; } if (Object.keys(c2).length) { e3 == null && (e3 = i("span")); for (r4 in c2) l = c2[r4], e3.style[r4] = l; } return e3; }, s2.prototype.createContainerElement = function() { var t4, e3, o3, r4, s3; r4 = this.attributes; for (o3 in r4) if (s3 = r4[o3], (e3 = n2(o3)) && e3.groupTagName) return t4 = {}, t4[o3] = s3, i(e3.groupTagName, t4); }, a2 = e2.NON_BREAKING_SPACE, s2.prototype.preserveSpaces = function(t4) { return this.context.isLast && (t4 = t4.replace(/\ $/, a2)), t4 = t4.replace(/(\S)\ {3}(\S)/g, "$1 " + a2 + " $2").replace(/\ {2}/g, a2 + " ").replace(/\ {2}/g, " " + a2), (this.context.isFirst || this.context.followsWhitespace) && (t4 = t4.replace(/^\ /, a2)), t4; }, s2; }(e2.ObjectView); }.call(this), function() { var t3 = function(t4, e3) { function i() { this.constructor = t4; } for (var o2 in e3) n2.call(e3, o2) && (t4[o2] = e3[o2]); return i.prototype = e3.prototype, t4.prototype = new i(), t4.__super__ = e3.prototype, t4; }, n2 = {}.hasOwnProperty; e2.TextView = function(n3) { function i() { i.__super__.constructor.apply(this, arguments), this.text = this.object, this.textConfig = this.options.textConfig; } var o2; return t3(i, n3), i.prototype.createNodes = function() { var t4, n4, i2, r2, s2, a2, u, c2, l, h; for (a2 = [], c2 = e2.ObjectGroup.groupObjects(this.getPieces()), r2 = c2.length - 1, i2 = n4 = 0, s2 = c2.length; s2 > n4; i2 = ++n4) u = c2[i2], t4 = {}, i2 === 0 && (t4.isFirst = true), i2 === r2 && (t4.isLast = true), o2(l) && (t4.followsWhitespace = true), h = this.findOrCreateCachedChildView(e2.PieceView, u, {textConfig: this.textConfig, context: t4}), a2.push.apply(a2, h.getNodes()), l = u; return a2; }, i.prototype.getPieces = function() { var t4, e3, n4, i2, o3; for (i2 = this.text.getPieces(), o3 = [], t4 = 0, e3 = i2.length; e3 > t4; t4++) n4 = i2[t4], n4.hasAttribute("blockBreak") || o3.push(n4); return o3; }, o2 = function(t4) { return /\s$/.test(t4 != null ? t4.toString() : void 0); }, i; }(e2.ObjectView); }.call(this), function() { var t3, n2, i, o2 = function(t4, e3) { function n3() { this.constructor = t4; } for (var i2 in e3) r2.call(e3, i2) && (t4[i2] = e3[i2]); return n3.prototype = e3.prototype, t4.prototype = new n3(), t4.__super__ = e3.prototype, t4; }, r2 = {}.hasOwnProperty; i = e2.makeElement, n2 = e2.getBlockConfig, t3 = e2.config.css, e2.BlockView = function(r3) { function s2() { s2.__super__.constructor.apply(this, arguments), this.block = this.object, this.attributes = this.block.getAttributes(); } return o2(s2, r3), s2.prototype.createNodes = function() { var t4, o3, r4, s3, a2, u, c2, l, h, p2, d; if (o3 = document.createComment("block"), c2 = [o3], this.block.isEmpty() ? c2.push(i("br")) : (p2 = (l = n2(this.block.getLastAttribute())) != null ? l.text : void 0, d = this.findOrCreateCachedChildView(e2.TextView, this.block.text, {textConfig: p2}), c2.push.apply(c2, d.getNodes()), this.shouldAddExtraNewlineElement() && c2.push(i("br"))), this.attributes.length) return c2; for (h = e2.config.blockAttributes["default"].tagName, this.block.isRTL() && (t4 = {dir: "rtl"}), r4 = i({tagName: h, attributes: t4}), s3 = 0, a2 = c2.length; a2 > s3; s3++) u = c2[s3], r4.appendChild(u); return [r4]; }, s2.prototype.createContainerElement = function(e3) { var o3, r4, s3, a2, u; return o3 = this.attributes[e3], u = n2(o3).tagName, e3 === 0 && this.block.isRTL() && (r4 = {dir: "rtl"}), o3 === "attachmentGallery" && (a2 = this.block.getBlockBreakPosition(), s3 = t3.attachmentGallery + " " + t3.attachmentGallery + "--" + a2), i({tagName: u, className: s3, attributes: r4}); }, s2.prototype.shouldAddExtraNewlineElement = function() { return /\n\n$/.test(this.block.toString()); }, s2; }(e2.ObjectView); }.call(this), function() { var t3, n2, i = function(t4, e3) { function n3() { this.constructor = t4; } for (var i2 in e3) o2.call(e3, i2) && (t4[i2] = e3[i2]); return n3.prototype = e3.prototype, t4.prototype = new n3(), t4.__super__ = e3.prototype, t4; }, o2 = {}.hasOwnProperty; t3 = e2.defer, n2 = e2.makeElement, e2.DocumentView = function(o3) { function r2() { r2.__super__.constructor.apply(this, arguments), this.element = this.options.element, this.elementStore = new e2.ElementStore(), this.setDocument(this.object); } var s2, a2, u; return i(r2, o3), r2.render = function(t4) { var e3, i2; return e3 = n2("div"), i2 = new this(t4, {element: e3}), i2.render(), i2.sync(), e3; }, r2.prototype.setDocument = function(t4) { return t4.isEqualTo(this.document) ? void 0 : this.document = this.object = t4; }, r2.prototype.render = function() { var t4, i2, o4, r3, s3, a3, u2; if (this.childViews = [], this.shadowElement = n2("div"), !this.document.isEmpty()) { for (s3 = e2.ObjectGroup.groupObjects(this.document.getBlocks(), {asTree: true}), a3 = [], t4 = 0, i2 = s3.length; i2 > t4; t4++) r3 = s3[t4], u2 = this.findOrCreateCachedChildView(e2.BlockView, r3), a3.push(function() { var t5, e3, n3, i3; for (n3 = u2.getNodes(), i3 = [], t5 = 0, e3 = n3.length; e3 > t5; t5++) o4 = n3[t5], i3.push(this.shadowElement.appendChild(o4)); return i3; }.call(this)); return a3; } }, r2.prototype.isSynced = function() { return s2(this.shadowElement, this.element); }, r2.prototype.sync = function() { var t4; for (t4 = this.createDocumentFragmentForSync(); this.element.lastChild; ) this.element.removeChild(this.element.lastChild); return this.element.appendChild(t4), this.didSync(); }, r2.prototype.didSync = function() { return this.elementStore.reset(a2(this.element)), t3(function(t4) { return function() { return t4.garbageCollectCachedViews(); }; }(this)); }, r2.prototype.createDocumentFragmentForSync = function() { var t4, e3, n3, i2, o4, r3, s3, u2, c2, l; for (e3 = document.createDocumentFragment(), u2 = this.shadowElement.childNodes, n3 = 0, o4 = u2.length; o4 > n3; n3++) s3 = u2[n3], e3.appendChild(s3.cloneNode(true)); for (c2 = a2(e3), i2 = 0, r3 = c2.length; r3 > i2; i2++) t4 = c2[i2], (l = this.elementStore.remove(t4)) && t4.parentNode.replaceChild(l, t4); return e3; }, a2 = function(t4) { return t4.querySelectorAll("[data-trix-store-key]"); }, s2 = function(t4, e3) { return u(t4.innerHTML) === u(e3.innerHTML); }, u = function(t4) { return t4.replace(/ /g, " "); }, r2; }(e2.ObjectView); }.call(this), function() { var t3, n2, i, o2, r2, s2 = function(t4, e3) { return function() { return t4.apply(e3, arguments); }; }, a2 = function(t4, e3) { function n3() { this.constructor = t4; } for (var i2 in e3) u.call(e3, i2) && (t4[i2] = e3[i2]); return n3.prototype = e3.prototype, t4.prototype = new n3(), t4.__super__ = e3.prototype, t4; }, u = {}.hasOwnProperty; i = e2.findClosestElementFromNode, o2 = e2.handleEvent, r2 = e2.innerElementIsActive, n2 = e2.defer, t3 = e2.AttachmentView.attachmentSelector, e2.CompositionController = function(u2) { function c2(n3, i2) { this.element = n3, this.composition = i2, this.didClickAttachment = s2(this.didClickAttachment, this), this.didBlur = s2(this.didBlur, this), this.didFocus = s2(this.didFocus, this), this.documentView = new e2.DocumentView(this.composition.document, {element: this.element}), o2("focus", {onElement: this.element, withCallback: this.didFocus}), o2("blur", {onElement: this.element, withCallback: this.didBlur}), o2("click", {onElement: this.element, matchingSelector: "a[contenteditable=false]", preventDefault: true}), o2("mousedown", {onElement: this.element, matchingSelector: t3, withCallback: this.didClickAttachment}), o2("click", {onElement: this.element, matchingSelector: "a" + t3, preventDefault: true}); } return a2(c2, u2), c2.prototype.didFocus = function() { var t4, e3, n3; return t4 = function(t5) { return function() { var e4; return t5.focused ? void 0 : (t5.focused = true, (e4 = t5.delegate) != null && typeof e4.compositionControllerDidFocus == "function" ? e4.compositionControllerDidFocus() : void 0); }; }(this), (e3 = (n3 = this.blurPromise) != null ? n3.then(t4) : void 0) != null ? e3 : t4(); }, c2.prototype.didBlur = function() { return this.blurPromise = new Promise(function(t4) { return function(e3) { return n2(function() { var n3; return r2(t4.element) || (t4.focused = null, (n3 = t4.delegate) != null && typeof n3.compositionControllerDidBlur == "function" && n3.compositionControllerDidBlur()), t4.blurPromise = null, e3(); }); }; }(this)); }, c2.prototype.didClickAttachment = function(t4, e3) { var n3, o3, r3; return n3 = this.findAttachmentForElement(e3), o3 = i(t4.target, {matchingSelector: "figcaption"}) != null, (r3 = this.delegate) != null && typeof r3.compositionControllerDidSelectAttachment == "function" ? r3.compositionControllerDidSelectAttachment(n3, {editCaption: o3}) : void 0; }, c2.prototype.getSerializableElement = function() { return this.isEditingAttachment() ? this.documentView.shadowElement : this.element; }, c2.prototype.render = function() { var t4, e3, n3; return this.revision !== this.composition.revision && (this.documentView.setDocument(this.composition.document), this.documentView.render(), this.revision = this.composition.revision), this.canSyncDocumentView() && !this.documentView.isSynced() && ((t4 = this.delegate) != null && typeof t4.compositionControllerWillSyncDocumentView == "function" && t4.compositionControllerWillSyncDocumentView(), this.documentView.sync(), (e3 = this.delegate) != null && typeof e3.compositionControllerDidSyncDocumentView == "function" && e3.compositionControllerDidSyncDocumentView()), (n3 = this.delegate) != null && typeof n3.compositionControllerDidRender == "function" ? n3.compositionControllerDidRender() : void 0; }, c2.prototype.rerenderViewForObject = function(t4) { return this.invalidateViewForObject(t4), this.render(); }, c2.prototype.invalidateViewForObject = function(t4) { return this.documentView.invalidateViewForObject(t4); }, c2.prototype.isViewCachingEnabled = function() { return this.documentView.isViewCachingEnabled(); }, c2.prototype.enableViewCaching = function() { return this.documentView.enableViewCaching(); }, c2.prototype.disableViewCaching = function() { return this.documentView.disableViewCaching(); }, c2.prototype.refreshViewCache = function() { return this.documentView.garbageCollectCachedViews(); }, c2.prototype.isEditingAttachment = function() { return this.attachmentEditor != null; }, c2.prototype.installAttachmentEditorForAttachment = function(t4, n3) { var i2, o3, r3; if (((r3 = this.attachmentEditor) != null ? r3.attachment : void 0) !== t4 && (o3 = this.documentView.findElementForObject(t4))) return this.uninstallAttachmentEditor(), i2 = this.composition.document.getAttachmentPieceForAttachment(t4), this.attachmentEditor = new e2.AttachmentEditorController(i2, o3, this.element, n3), this.attachmentEditor.delegate = this; }, c2.prototype.uninstallAttachmentEditor = function() { var t4; return (t4 = this.attachmentEditor) != null ? t4.uninstall() : void 0; }, c2.prototype.didUninstallAttachmentEditor = function() { return this.attachmentEditor = null, this.render(); }, c2.prototype.attachmentEditorDidRequestUpdatingAttributesForAttachment = function(t4, e3) { var n3; return (n3 = this.delegate) != null && typeof n3.compositionControllerWillUpdateAttachment == "function" && n3.compositionControllerWillUpdateAttachment(e3), this.composition.updateAttributesForAttachment(t4, e3); }, c2.prototype.attachmentEditorDidRequestRemovingAttributeForAttachment = function(t4, e3) { var n3; return (n3 = this.delegate) != null && typeof n3.compositionControllerWillUpdateAttachment == "function" && n3.compositionControllerWillUpdateAttachment(e3), this.composition.removeAttributeForAttachment(t4, e3); }, c2.prototype.attachmentEditorDidRequestRemovalOfAttachment = function(t4) { var e3; return (e3 = this.delegate) != null && typeof e3.compositionControllerDidRequestRemovalOfAttachment == "function" ? e3.compositionControllerDidRequestRemovalOfAttachment(t4) : void 0; }, c2.prototype.attachmentEditorDidRequestDeselectingAttachment = function(t4) { var e3; return (e3 = this.delegate) != null && typeof e3.compositionControllerDidRequestDeselectingAttachment == "function" ? e3.compositionControllerDidRequestDeselectingAttachment(t4) : void 0; }, c2.prototype.canSyncDocumentView = function() { return !this.isEditingAttachment(); }, c2.prototype.findAttachmentForElement = function(t4) { return this.composition.document.getAttachmentById(parseInt(t4.dataset.trixId, 10)); }, c2; }(e2.BasicObject); }.call(this), function() { var t3, n2, i, o2 = function(t4, e3) { return function() { return t4.apply(e3, arguments); }; }, r2 = function(t4, e3) { function n3() { this.constructor = t4; } for (var i2 in e3) s2.call(e3, i2) && (t4[i2] = e3[i2]); return n3.prototype = e3.prototype, t4.prototype = new n3(), t4.__super__ = e3.prototype, t4; }, s2 = {}.hasOwnProperty; n2 = e2.handleEvent, i = e2.triggerEvent, t3 = e2.findClosestElementFromNode, e2.ToolbarController = function(e3) { function s3(t4) { this.element = t4, this.didKeyDownDialogInput = o2(this.didKeyDownDialogInput, this), this.didClickDialogButton = o2(this.didClickDialogButton, this), this.didClickAttributeButton = o2(this.didClickAttributeButton, this), this.didClickActionButton = o2(this.didClickActionButton, this), this.attributes = {}, this.actions = {}, this.resetDialogInputs(), n2("mousedown", {onElement: this.element, matchingSelector: a2, withCallback: this.didClickActionButton}), n2("mousedown", {onElement: this.element, matchingSelector: c2, withCallback: this.didClickAttributeButton}), n2("click", {onElement: this.element, matchingSelector: v, preventDefault: true}), n2("click", {onElement: this.element, matchingSelector: l, withCallback: this.didClickDialogButton}), n2("keydown", {onElement: this.element, matchingSelector: h, withCallback: this.didKeyDownDialogInput}); } var a2, u, c2, l, h, p2, d, f, g, m, v; return r2(s3, e3), c2 = "[data-trix-attribute]", a2 = "[data-trix-action]", v = c2 + ", " + a2, p2 = "[data-trix-dialog]", u = p2 + "[data-trix-active]", l = p2 + " [data-trix-method]", h = p2 + " [data-trix-input]", s3.prototype.didClickActionButton = function(t4, e4) { var n3, i2, o3; return (i2 = this.delegate) != null && i2.toolbarDidClickButton(), t4.preventDefault(), n3 = d(e4), this.getDialog(n3) ? this.toggleDialog(n3) : (o3 = this.delegate) != null ? o3.toolbarDidInvokeAction(n3) : void 0; }, s3.prototype.didClickAttributeButton = function(t4, e4) { var n3, i2, o3; return (i2 = this.delegate) != null && i2.toolbarDidClickButton(), t4.preventDefault(), n3 = f(e4), this.getDialog(n3) ? this.toggleDialog(n3) : (o3 = this.delegate) != null && o3.toolbarDidToggleAttribute(n3), this.refreshAttributeButtons(); }, s3.prototype.didClickDialogButton = function(e4, n3) { var i2, o3; return i2 = t3(n3, {matchingSelector: p2}), o3 = n3.getAttribute("data-trix-method"), this[o3].call(this, i2); }, s3.prototype.didKeyDownDialogInput = function(t4, e4) { var n3, i2; return t4.keyCode === 13 && (t4.preventDefault(), n3 = e4.getAttribute("name"), i2 = this.getDialog(n3), this.setAttribute(i2)), t4.keyCode === 27 ? (t4.preventDefault(), this.hideDialog()) : void 0; }, s3.prototype.updateActions = function(t4) { return this.actions = t4, this.refreshActionButtons(); }, s3.prototype.refreshActionButtons = function() { return this.eachActionButton(function(t4) { return function(e4, n3) { return e4.disabled = t4.actions[n3] === false; }; }(this)); }, s3.prototype.eachActionButton = function(t4) { var e4, n3, i2, o3, r3; for (o3 = this.element.querySelectorAll(a2), r3 = [], n3 = 0, i2 = o3.length; i2 > n3; n3++) e4 = o3[n3], r3.push(t4(e4, d(e4))); return r3; }, s3.prototype.updateAttributes = function(t4) { return this.attributes = t4, this.refreshAttributeButtons(); }, s3.prototype.refreshAttributeButtons = function() { return this.eachAttributeButton(function(t4) { return function(e4, n3) { return e4.disabled = t4.attributes[n3] === false, t4.attributes[n3] || t4.dialogIsVisible(n3) ? (e4.setAttribute("data-trix-active", ""), e4.classList.add("trix-active")) : (e4.removeAttribute("data-trix-active"), e4.classList.remove("trix-active")); }; }(this)); }, s3.prototype.eachAttributeButton = function(t4) { var e4, n3, i2, o3, r3; for (o3 = this.element.querySelectorAll(c2), r3 = [], n3 = 0, i2 = o3.length; i2 > n3; n3++) e4 = o3[n3], r3.push(t4(e4, f(e4))); return r3; }, s3.prototype.applyKeyboardCommand = function(t4) { var e4, n3, o3, r3, s4, a3, u2; for (s4 = JSON.stringify(t4.sort()), u2 = this.element.querySelectorAll("[data-trix-key]"), r3 = 0, a3 = u2.length; a3 > r3; r3++) if (e4 = u2[r3], o3 = e4.getAttribute("data-trix-key").split("+"), n3 = JSON.stringify(o3.sort()), n3 === s4) return i("mousedown", {onElement: e4}), true; return false; }, s3.prototype.dialogIsVisible = function(t4) { var e4; return (e4 = this.getDialog(t4)) ? e4.hasAttribute("data-trix-active") : void 0; }, s3.prototype.toggleDialog = function(t4) { return this.dialogIsVisible(t4) ? this.hideDialog() : this.showDialog(t4); }, s3.prototype.showDialog = function(t4) { var e4, n3, i2, o3, r3, s4, a3, u2, c3, l2; for (this.hideDialog(), (a3 = this.delegate) != null && a3.toolbarWillShowDialog(), i2 = this.getDialog(t4), i2.setAttribute("data-trix-active", ""), i2.classList.add("trix-active"), u2 = i2.querySelectorAll("input[disabled]"), o3 = 0, s4 = u2.length; s4 > o3; o3++) n3 = u2[o3], n3.removeAttribute("disabled"); return (e4 = f(i2)) && (r3 = m(i2, t4)) && (r3.value = (c3 = this.attributes[e4]) != null ? c3 : "", r3.select()), (l2 = this.delegate) != null ? l2.toolbarDidShowDialog(t4) : void 0; }, s3.prototype.setAttribute = function(t4) { var e4, n3, i2; return e4 = f(t4), n3 = m(t4, e4), n3.willValidate && !n3.checkValidity() ? (n3.setAttribute("data-trix-validate", ""), n3.classList.add("trix-validate"), n3.focus()) : ((i2 = this.delegate) != null && i2.toolbarDidUpdateAttribute(e4, n3.value), this.hideDialog()); }, s3.prototype.removeAttribute = function(t4) { var e4, n3; return e4 = f(t4), (n3 = this.delegate) != null && n3.toolbarDidRemoveAttribute(e4), this.hideDialog(); }, s3.prototype.hideDialog = function() { var t4, e4; return (t4 = this.element.querySelector(u)) ? (t4.removeAttribute("data-trix-active"), t4.classList.remove("trix-active"), this.resetDialogInputs(), (e4 = this.delegate) != null ? e4.toolbarDidHideDialog(g(t4)) : void 0) : void 0; }, s3.prototype.resetDialogInputs = function() { var t4, e4, n3, i2, o3; for (i2 = this.element.querySelectorAll(h), o3 = [], t4 = 0, n3 = i2.length; n3 > t4; t4++) e4 = i2[t4], e4.setAttribute("disabled", "disabled"), e4.removeAttribute("data-trix-validate"), o3.push(e4.classList.remove("trix-validate")); return o3; }, s3.prototype.getDialog = function(t4) { return this.element.querySelector("[data-trix-dialog=" + t4 + "]"); }, m = function(t4, e4) { return e4 == null && (e4 = f(t4)), t4.querySelector("[data-trix-input][name='" + e4 + "']"); }, d = function(t4) { return t4.getAttribute("data-trix-action"); }, f = function(t4) { var e4; return (e4 = t4.getAttribute("data-trix-attribute")) != null ? e4 : t4.getAttribute("data-trix-dialog-attribute"); }, g = function(t4) { return t4.getAttribute("data-trix-dialog"); }, s3; }(e2.BasicObject); }.call(this), function() { var t3 = function(t4, e3) { function i() { this.constructor = t4; } for (var o2 in e3) n2.call(e3, o2) && (t4[o2] = e3[o2]); return i.prototype = e3.prototype, t4.prototype = new i(), t4.__super__ = e3.prototype, t4; }, n2 = {}.hasOwnProperty; e2.ImagePreloadOperation = function(e3) { function n3(t4) { this.url = t4; } return t3(n3, e3), n3.prototype.perform = function(t4) { var e4; return e4 = new Image(), e4.onload = function(n4) { return function() { return e4.width = n4.width = e4.naturalWidth, e4.height = n4.height = e4.naturalHeight, t4(true, e4); }; }(this), e4.onerror = function() { return t4(false); }, e4.src = this.url; }, n3; }(e2.Operation); }.call(this), function() { var t3 = function(t4, e3) { return function() { return t4.apply(e3, arguments); }; }, n2 = function(t4, e3) { function n3() { this.constructor = t4; } for (var o2 in e3) i.call(e3, o2) && (t4[o2] = e3[o2]); return n3.prototype = e3.prototype, t4.prototype = new n3(), t4.__super__ = e3.prototype, t4; }, i = {}.hasOwnProperty; e2.Attachment = function(i2) { function o2(n3) { n3 == null && (n3 = {}), this.releaseFile = t3(this.releaseFile, this), o2.__super__.constructor.apply(this, arguments), this.attributes = e2.Hash.box(n3), this.didChangeAttributes(); } return n2(o2, i2), o2.previewablePattern = /^image(\/(gif|png|jpe?g)|$)/, o2.attachmentForFile = function(t4) { var e3, n3; return n3 = this.attributesForFile(t4), e3 = new this(n3), e3.setFile(t4), e3; }, o2.attributesForFile = function(t4) { return new e2.Hash({filename: t4.name, filesize: t4.size, contentType: t4.type}); }, o2.fromJSON = function(t4) { return new this(t4); }, o2.prototype.getAttribute = function(t4) { return this.attributes.get(t4); }, o2.prototype.hasAttribute = function(t4) { return this.attributes.has(t4); }, o2.prototype.getAttributes = function() { return this.attributes.toObject(); }, o2.prototype.setAttributes = function(t4) { var e3, n3, i3; return t4 == null && (t4 = {}), e3 = this.attributes.merge(t4), this.attributes.isEqualTo(e3) ? void 0 : (this.attributes = e3, this.didChangeAttributes(), (n3 = this.previewDelegate) != null && typeof n3.attachmentDidChangeAttributes == "function" && n3.attachmentDidChangeAttributes(this), (i3 = this.delegate) != null && typeof i3.attachmentDidChangeAttributes == "function" ? i3.attachmentDidChangeAttributes(this) : void 0); }, o2.prototype.didChangeAttributes = function() { return this.isPreviewable() ? this.preloadURL() : void 0; }, o2.prototype.isPending = function() { return this.file != null && !(this.getURL() || this.getHref()); }, o2.prototype.isPreviewable = function() { return this.attributes.has("previewable") ? this.attributes.get("previewable") : this.constructor.previewablePattern.test(this.getContentType()); }, o2.prototype.getType = function() { return this.hasContent() ? "content" : this.isPreviewable() ? "preview" : "file"; }, o2.prototype.getURL = function() { return this.attributes.get("url"); }, o2.prototype.getHref = function() { return this.attributes.get("href"); }, o2.prototype.getFilename = function() { var t4; return (t4 = this.attributes.get("filename")) != null ? t4 : ""; }, o2.prototype.getFilesize = function() { return this.attributes.get("filesize"); }, o2.prototype.getFormattedFilesize = function() { var t4; return t4 = this.attributes.get("filesize"), typeof t4 == "number" ? e2.config.fileSize.formatter(t4) : ""; }, o2.prototype.getExtension = function() { var t4; return (t4 = this.getFilename().match(/\.(\w+)$/)) != null ? t4[1].toLowerCase() : void 0; }, o2.prototype.getContentType = function() { return this.attributes.get("contentType"); }, o2.prototype.hasContent = function() { return this.attributes.has("content"); }, o2.prototype.getContent = function() { return this.attributes.get("content"); }, o2.prototype.getWidth = function() { return this.attributes.get("width"); }, o2.prototype.getHeight = function() { return this.attributes.get("height"); }, o2.prototype.getFile = function() { return this.file; }, o2.prototype.setFile = function(t4) { return this.file = t4, this.isPreviewable() ? this.preloadFile() : void 0; }, o2.prototype.releaseFile = function() { return this.releasePreloadedFile(), this.file = null; }, o2.prototype.getUploadProgress = function() { var t4; return (t4 = this.uploadProgress) != null ? t4 : 0; }, o2.prototype.setUploadProgress = function(t4) { var e3; return this.uploadProgress !== t4 ? (this.uploadProgress = t4, (e3 = this.uploadProgressDelegate) != null && typeof e3.attachmentDidChangeUploadProgress == "function" ? e3.attachmentDidChangeUploadProgress(this) : void 0) : void 0; }, o2.prototype.toJSON = function() { return this.getAttributes(); }, o2.prototype.getCacheKey = function() { return [o2.__super__.getCacheKey.apply(this, arguments), this.attributes.getCacheKey(), this.getPreviewURL()].join("/"); }, o2.prototype.getPreviewURL = function() { return this.previewURL || this.preloadingURL; }, o2.prototype.setPreviewURL = function(t4) { var e3, n3; return t4 !== this.getPreviewURL() ? (this.previewURL = t4, (e3 = this.previewDelegate) != null && typeof e3.attachmentDidChangeAttributes == "function" && e3.attachmentDidChangeAttributes(this), (n3 = this.delegate) != null && typeof n3.attachmentDidChangePreviewURL == "function" ? n3.attachmentDidChangePreviewURL(this) : void 0) : void 0; }, o2.prototype.preloadURL = function() { return this.preload(this.getURL(), this.releaseFile); }, o2.prototype.preloadFile = function() { return this.file ? (this.fileObjectURL = URL.createObjectURL(this.file), this.preload(this.fileObjectURL)) : void 0; }, o2.prototype.releasePreloadedFile = function() { return this.fileObjectURL ? (URL.revokeObjectURL(this.fileObjectURL), this.fileObjectURL = null) : void 0; }, o2.prototype.preload = function(t4, n3) { var i3; return t4 && t4 !== this.getPreviewURL() ? (this.preloadingURL = t4, i3 = new e2.ImagePreloadOperation(t4), i3.then(function(e3) { return function(i4) { var o3, r2; return r2 = i4.width, o3 = i4.height, e3.getWidth() && e3.getHeight() || e3.setAttributes({width: r2, height: o3}), e3.preloadingURL = null, e3.setPreviewURL(t4), typeof n3 == "function" ? n3() : void 0; }; }(this))["catch"](function(t5) { return function() { return t5.preloadingURL = null, typeof n3 == "function" ? n3() : void 0; }; }(this))) : void 0; }, o2; }(e2.Object); }.call(this), function() { var t3 = function(t4, e3) { function i() { this.constructor = t4; } for (var o2 in e3) n2.call(e3, o2) && (t4[o2] = e3[o2]); return i.prototype = e3.prototype, t4.prototype = new i(), t4.__super__ = e3.prototype, t4; }, n2 = {}.hasOwnProperty; e2.Piece = function(n3) { function i(t4, n4) { n4 == null && (n4 = {}), i.__super__.constructor.apply(this, arguments), this.attributes = e2.Hash.box(n4); } return t3(i, n3), i.types = {}, i.registerType = function(t4, e3) { return e3.type = t4, this.types[t4] = e3; }, i.fromJSON = function(t4) { var e3; return (e3 = this.types[t4.type]) ? e3.fromJSON(t4) : void 0; }, i.prototype.copyWithAttributes = function(t4) { return new this.constructor(this.getValue(), t4); }, i.prototype.copyWithAdditionalAttributes = function(t4) { return this.copyWithAttributes(this.attributes.merge(t4)); }, i.prototype.copyWithoutAttribute = function(t4) { return this.copyWithAttributes(this.attributes.remove(t4)); }, i.prototype.copy = function() { return this.copyWithAttributes(this.attributes); }, i.prototype.getAttribute = function(t4) { return this.attributes.get(t4); }, i.prototype.getAttributesHash = function() { return this.attributes; }, i.prototype.getAttributes = function() { return this.attributes.toObject(); }, i.prototype.getCommonAttributes = function() { var t4, e3, n4; return (n4 = pieceList.getPieceAtIndex(0)) ? (t4 = n4.attributes, e3 = t4.getKeys(), pieceList.eachPiece(function(n5) { return e3 = t4.getKeysCommonToHash(n5.attributes), t4 = t4.slice(e3); }), t4.toObject()) : {}; }, i.prototype.hasAttribute = function(t4) { return this.attributes.has(t4); }, i.prototype.hasSameStringValueAsPiece = function(t4) { return t4 != null && this.toString() === t4.toString(); }, i.prototype.hasSameAttributesAsPiece = function(t4) { return t4 != null && (this.attributes === t4.attributes || this.attributes.isEqualTo(t4.attributes)); }, i.prototype.isBlockBreak = function() { return false; }, i.prototype.isEqualTo = function(t4) { return i.__super__.isEqualTo.apply(this, arguments) || this.hasSameConstructorAs(t4) && this.hasSameStringValueAsPiece(t4) && this.hasSameAttributesAsPiece(t4); }, i.prototype.isEmpty = function() { return this.length === 0; }, i.prototype.isSerializable = function() { return true; }, i.prototype.toJSON = function() { return {type: this.constructor.type, attributes: this.getAttributes()}; }, i.prototype.contentsForInspection = function() { return {type: this.constructor.type, attributes: this.attributes.inspect()}; }, i.prototype.canBeGrouped = function() { return this.hasAttribute("href"); }, i.prototype.canBeGroupedWith = function(t4) { return this.getAttribute("href") === t4.getAttribute("href"); }, i.prototype.getLength = function() { return this.length; }, i.prototype.canBeConsolidatedWith = function() { return false; }, i; }(e2.Object); }.call(this), function() { var t3 = function(t4, e3) { function i() { this.constructor = t4; } for (var o2 in e3) n2.call(e3, o2) && (t4[o2] = e3[o2]); return i.prototype = e3.prototype, t4.prototype = new i(), t4.__super__ = e3.prototype, t4; }, n2 = {}.hasOwnProperty; e2.Piece.registerType("attachment", e2.AttachmentPiece = function(n3) { function i(t4) { this.attachment = t4, i.__super__.constructor.apply(this, arguments), this.length = 1, this.ensureAttachmentExclusivelyHasAttribute("href"), this.attachment.hasContent() || this.removeProhibitedAttributes(); } return t3(i, n3), i.fromJSON = function(t4) { return new this(e2.Attachment.fromJSON(t4.attachment), t4.attributes); }, i.permittedAttributes = ["caption", "presentation"], i.prototype.ensureAttachmentExclusivelyHasAttribute = function(t4) { return this.hasAttribute(t4) ? (this.attachment.hasAttribute(t4) || this.attachment.setAttributes(this.attributes.slice(t4)), this.attributes = this.attributes.remove(t4)) : void 0; }, i.prototype.removeProhibitedAttributes = function() { var t4; return t4 = this.attributes.slice(this.constructor.permittedAttributes), t4.isEqualTo(this.attributes) ? void 0 : this.attributes = t4; }, i.prototype.getValue = function() { return this.attachment; }, i.prototype.isSerializable = function() { return !this.attachment.isPending(); }, i.prototype.getCaption = function() { var t4; return (t4 = this.attributes.get("caption")) != null ? t4 : ""; }, i.prototype.isEqualTo = function(t4) { var e3; return i.__super__.isEqualTo.apply(this, arguments) && this.attachment.id === (t4 != null && (e3 = t4.attachment) != null ? e3.id : void 0); }, i.prototype.toString = function() { return e2.OBJECT_REPLACEMENT_CHARACTER; }, i.prototype.toJSON = function() { var t4; return t4 = i.__super__.toJSON.apply(this, arguments), t4.attachment = this.attachment, t4; }, i.prototype.getCacheKey = function() { return [i.__super__.getCacheKey.apply(this, arguments), this.attachment.getCacheKey()].join("/"); }, i.prototype.toConsole = function() { return JSON.stringify(this.toString()); }, i; }(e2.Piece)); }.call(this), function() { var t3, n2 = function(t4, e3) { function n3() { this.constructor = t4; } for (var o2 in e3) i.call(e3, o2) && (t4[o2] = e3[o2]); return n3.prototype = e3.prototype, t4.prototype = new n3(), t4.__super__ = e3.prototype, t4; }, i = {}.hasOwnProperty; t3 = e2.normalizeNewlines, e2.Piece.registerType("string", e2.StringPiece = function(e3) { function i2(e4) { i2.__super__.constructor.apply(this, arguments), this.string = t3(e4), this.length = this.string.length; } return n2(i2, e3), i2.fromJSON = function(t4) { return new this(t4.string, t4.attributes); }, i2.prototype.getValue = function() { return this.string; }, i2.prototype.toString = function() { return this.string.toString(); }, i2.prototype.isBlockBreak = function() { return this.toString() === "\n" && this.getAttribute("blockBreak") === true; }, i2.prototype.toJSON = function() { var t4; return t4 = i2.__super__.toJSON.apply(this, arguments), t4.string = this.string, t4; }, i2.prototype.canBeConsolidatedWith = function(t4) { return t4 != null && this.hasSameConstructorAs(t4) && this.hasSameAttributesAsPiece(t4); }, i2.prototype.consolidateWith = function(t4) { return new this.constructor(this.toString() + t4.toString(), this.attributes); }, i2.prototype.splitAtOffset = function(t4) { var e4, n3; return t4 === 0 ? (e4 = null, n3 = this) : t4 === this.length ? (e4 = this, n3 = null) : (e4 = new this.constructor(this.string.slice(0, t4), this.attributes), n3 = new this.constructor(this.string.slice(t4), this.attributes)), [e4, n3]; }, i2.prototype.toConsole = function() { var t4; return t4 = this.string, t4.length > 15 && (t4 = t4.slice(0, 14) + "\u2026"), JSON.stringify(t4.toString()); }, i2; }(e2.Piece)); }.call(this), function() { var t3, n2 = function(t4, e3) { function n3() { this.constructor = t4; } for (var o3 in e3) i.call(e3, o3) && (t4[o3] = e3[o3]); return n3.prototype = e3.prototype, t4.prototype = new n3(), t4.__super__ = e3.prototype, t4; }, i = {}.hasOwnProperty, o2 = [].slice; t3 = e2.spliceArray, e2.SplittableList = function(e3) { function i2(t4) { t4 == null && (t4 = []), i2.__super__.constructor.apply(this, arguments), this.objects = t4.slice(0), this.length = this.objects.length; } var r2, s2, a2; return n2(i2, e3), i2.box = function(t4) { return t4 instanceof this ? t4 : new this(t4); }, i2.prototype.indexOf = function(t4) { return this.objects.indexOf(t4); }, i2.prototype.splice = function() { var e4; return e4 = 1 <= arguments.length ? o2.call(arguments, 0) : [], new this.constructor(t3.apply(null, [this.objects].concat(o2.call(e4)))); }, i2.prototype.eachObject = function(t4) { var e4, n3, i3, o3, r3, s3; for (r3 = this.objects, s3 = [], n3 = e4 = 0, i3 = r3.length; i3 > e4; n3 = ++e4) o3 = r3[n3], s3.push(t4(o3, n3)); return s3; }, i2.prototype.insertObjectAtIndex = function(t4, e4) { return this.splice(e4, 0, t4); }, i2.prototype.insertSplittableListAtIndex = function(t4, e4) { return this.splice.apply(this, [e4, 0].concat(o2.call(t4.objects))); }, i2.prototype.insertSplittableListAtPosition = function(t4, e4) { var n3, i3, o3; return o3 = this.splitObjectAtPosition(e4), i3 = o3[0], n3 = o3[1], new this.constructor(i3).insertSplittableListAtIndex(t4, n3); }, i2.prototype.editObjectAtIndex = function(t4, e4) { return this.replaceObjectAtIndex(e4(this.objects[t4]), t4); }, i2.prototype.replaceObjectAtIndex = function(t4, e4) { return this.splice(e4, 1, t4); }, i2.prototype.removeObjectAtIndex = function(t4) { return this.splice(t4, 1); }, i2.prototype.getObjectAtIndex = function(t4) { return this.objects[t4]; }, i2.prototype.getSplittableListInRange = function(t4) { var e4, n3, i3, o3; return i3 = this.splitObjectsAtRange(t4), n3 = i3[0], e4 = i3[1], o3 = i3[2], new this.constructor(n3.slice(e4, o3 + 1)); }, i2.prototype.selectSplittableList = function(t4) { var e4, n3; return n3 = function() { var n4, i3, o3, r3; for (o3 = this.objects, r3 = [], n4 = 0, i3 = o3.length; i3 > n4; n4++) e4 = o3[n4], t4(e4) && r3.push(e4); return r3; }.call(this), new this.constructor(n3); }, i2.prototype.removeObjectsInRange = function(t4) { var e4, n3, i3, o3; return i3 = this.splitObjectsAtRange(t4), n3 = i3[0], e4 = i3[1], o3 = i3[2], new this.constructor(n3).splice(e4, o3 - e4 + 1); }, i2.prototype.transformObjectsInRange = function(t4, e4) { var n3, i3, o3, r3, s3, a3, u; return s3 = this.splitObjectsAtRange(t4), r3 = s3[0], i3 = s3[1], a3 = s3[2], u = function() { var t5, s4, u2; for (u2 = [], n3 = t5 = 0, s4 = r3.length; s4 > t5; n3 = ++t5) o3 = r3[n3], u2.push(n3 >= i3 && a3 >= n3 ? e4(o3) : o3); return u2; }(), new this.constructor(u); }, i2.prototype.splitObjectsAtRange = function(t4) { var e4, n3, i3, o3, s3, u; return o3 = this.splitObjectAtPosition(a2(t4)), n3 = o3[0], e4 = o3[1], i3 = o3[2], s3 = new this.constructor(n3).splitObjectAtPosition(r2(t4) + i3), n3 = s3[0], u = s3[1], [n3, e4, u - 1]; }, i2.prototype.getObjectAtPosition = function(t4) { var e4, n3, i3; return i3 = this.findIndexAndOffsetAtPosition(t4), e4 = i3.index, n3 = i3.offset, this.objects[e4]; }, i2.prototype.splitObjectAtPosition = function(t4) { var e4, n3, i3, o3, r3, s3, a3, u, c2, l; return s3 = this.findIndexAndOffsetAtPosition(t4), e4 = s3.index, r3 = s3.offset, o3 = this.objects.slice(0), e4 != null ? r3 === 0 ? (c2 = e4, l = 0) : (i3 = this.getObjectAtIndex(e4), a3 = i3.splitAtOffset(r3), n3 = a3[0], u = a3[1], o3.splice(e4, 1, n3, u), c2 = e4 + 1, l = n3.getLength() - r3) : (c2 = o3.length, l = 0), [o3, c2, l]; }, i2.prototype.consolidate = function() { var t4, e4, n3, i3, o3, r3; for (i3 = [], o3 = this.objects[0], r3 = this.objects.slice(1), t4 = 0, e4 = r3.length; e4 > t4; t4++) n3 = r3[t4], (typeof o3.canBeConsolidatedWith == "function" ? o3.canBeConsolidatedWith(n3) : void 0) ? o3 = o3.consolidateWith(n3) : (i3.push(o3), o3 = n3); return o3 != null && i3.push(o3), new this.constructor(i3); }, i2.prototype.consolidateFromIndexToIndex = function(t4, e4) { var n3, i3, r3; return i3 = this.objects.slice(0), r3 = i3.slice(t4, e4 + 1), n3 = new this.constructor(r3).consolidate().toArray(), this.splice.apply(this, [t4, r3.length].concat(o2.call(n3))); }, i2.prototype.findIndexAndOffsetAtPosition = function(t4) { var e4, n3, i3, o3, r3, s3, a3; for (e4 = 0, a3 = this.objects, i3 = n3 = 0, o3 = a3.length; o3 > n3; i3 = ++n3) { if (s3 = a3[i3], r3 = e4 + s3.getLength(), t4 >= e4 && r3 > t4) return {index: i3, offset: t4 - e4}; e4 = r3; } return {index: null, offset: null}; }, i2.prototype.findPositionAtIndexAndOffset = function(t4, e4) { var n3, i3, o3, r3, s3, a3; for (s3 = 0, a3 = this.objects, n3 = i3 = 0, o3 = a3.length; o3 > i3; n3 = ++i3) if (r3 = a3[n3], t4 > n3) s3 += r3.getLength(); else if (n3 === t4) { s3 += e4; break; } return s3; }, i2.prototype.getEndPosition = function() { var t4, e4; return this.endPosition != null ? this.endPosition : this.endPosition = function() { var n3, i3, o3; for (e4 = 0, o3 = this.objects, n3 = 0, i3 = o3.length; i3 > n3; n3++) t4 = o3[n3], e4 += t4.getLength(); return e4; }.call(this); }, i2.prototype.toString = function() { return this.objects.join(""); }, i2.prototype.toArray = function() { return this.objects.slice(0); }, i2.prototype.toJSON = function() { return this.toArray(); }, i2.prototype.isEqualTo = function(t4) { return i2.__super__.isEqualTo.apply(this, arguments) || s2(this.objects, t4 != null ? t4.objects : void 0); }, s2 = function(t4, e4) { var n3, i3, o3, r3, s3; if (e4 == null && (e4 = []), t4.length !== e4.length) return false; for (s3 = true, i3 = n3 = 0, o3 = t4.length; o3 > n3; i3 = ++n3) r3 = t4[i3], s3 && !r3.isEqualTo(e4[i3]) && (s3 = false); return s3; }, i2.prototype.contentsForInspection = function() { var t4; return {objects: "[" + function() { var e4, n3, i3, o3; for (i3 = this.objects, o3 = [], e4 = 0, n3 = i3.length; n3 > e4; e4++) t4 = i3[e4], o3.push(t4.inspect()); return o3; }.call(this).join(", ") + "]"}; }, a2 = function(t4) { return t4[0]; }, r2 = function(t4) { return t4[1]; }, i2; }(e2.Object); }.call(this), function() { var t3 = function(t4, e3) { function i() { this.constructor = t4; } for (var o2 in e3) n2.call(e3, o2) && (t4[o2] = e3[o2]); return i.prototype = e3.prototype, t4.prototype = new i(), t4.__super__ = e3.prototype, t4; }, n2 = {}.hasOwnProperty; e2.Text = function(n3) { function i(t4) { var n4; t4 == null && (t4 = []), i.__super__.constructor.apply(this, arguments), this.pieceList = new e2.SplittableList(function() { var e3, i2, o2; for (o2 = [], e3 = 0, i2 = t4.length; i2 > e3; e3++) n4 = t4[e3], n4.isEmpty() || o2.push(n4); return o2; }()); } return t3(i, n3), i.textForAttachmentWithAttributes = function(t4, n4) { var i2; return i2 = new e2.AttachmentPiece(t4, n4), new this([i2]); }, i.textForStringWithAttributes = function(t4, n4) { var i2; return i2 = new e2.StringPiece(t4, n4), new this([i2]); }, i.fromJSON = function(t4) { var n4, i2; return i2 = function() { var i3, o2, r2; for (r2 = [], i3 = 0, o2 = t4.length; o2 > i3; i3++) n4 = t4[i3], r2.push(e2.Piece.fromJSON(n4)); return r2; }(), new this(i2); }, i.prototype.copy = function() { return this.copyWithPieceList(this.pieceList); }, i.prototype.copyWithPieceList = function(t4) { return new this.constructor(t4.consolidate().toArray()); }, i.prototype.copyUsingObjectMap = function(t4) { var e3, n4; return n4 = function() { var n5, i2, o2, r2, s2; for (o2 = this.getPieces(), s2 = [], n5 = 0, i2 = o2.length; i2 > n5; n5++) e3 = o2[n5], s2.push((r2 = t4.find(e3)) != null ? r2 : e3); return s2; }.call(this), new this.constructor(n4); }, i.prototype.appendText = function(t4) { return this.insertTextAtPosition(t4, this.getLength()); }, i.prototype.insertTextAtPosition = function(t4, e3) { return this.copyWithPieceList(this.pieceList.insertSplittableListAtPosition(t4.pieceList, e3)); }, i.prototype.removeTextAtRange = function(t4) { return this.copyWithPieceList(this.pieceList.removeObjectsInRange(t4)); }, i.prototype.replaceTextAtRange = function(t4, e3) { return this.removeTextAtRange(e3).insertTextAtPosition(t4, e3[0]); }, i.prototype.moveTextFromRangeToPosition = function(t4, e3) { var n4, i2; if (!(t4[0] <= e3 && e3 <= t4[1])) return i2 = this.getTextAtRange(t4), n4 = i2.getLength(), t4[0] < e3 && (e3 -= n4), this.removeTextAtRange(t4).insertTextAtPosition(i2, e3); }, i.prototype.addAttributeAtRange = function(t4, e3, n4) { var i2; return i2 = {}, i2[t4] = e3, this.addAttributesAtRange(i2, n4); }, i.prototype.addAttributesAtRange = function(t4, e3) { return this.copyWithPieceList(this.pieceList.transformObjectsInRange(e3, function(e4) { return e4.copyWithAdditionalAttributes(t4); })); }, i.prototype.removeAttributeAtRange = function(t4, e3) { return this.copyWithPieceList(this.pieceList.transformObjectsInRange(e3, function(e4) { return e4.copyWithoutAttribute(t4); })); }, i.prototype.setAttributesAtRange = function(t4, e3) { return this.copyWithPieceList(this.pieceList.transformObjectsInRange(e3, function(e4) { return e4.copyWithAttributes(t4); })); }, i.prototype.getAttributesAtPosition = function(t4) { var e3, n4; return (e3 = (n4 = this.pieceList.getObjectAtPosition(t4)) != null ? n4.getAttributes() : void 0) != null ? e3 : {}; }, i.prototype.getCommonAttributes = function() { var t4, n4; return t4 = function() { var t5, e3, i2, o2; for (i2 = this.pieceList.toArray(), o2 = [], t5 = 0, e3 = i2.length; e3 > t5; t5++) n4 = i2[t5], o2.push(n4.getAttributes()); return o2; }.call(this), e2.Hash.fromCommonAttributesOfObjects(t4).toObject(); }, i.prototype.getCommonAttributesAtRange = function(t4) { var e3; return (e3 = this.getTextAtRange(t4).getCommonAttributes()) != null ? e3 : {}; }, i.prototype.getExpandedRangeForAttributeAtOffset = function(t4, e3) { var n4, i2, o2; for (n4 = o2 = e3, i2 = this.getLength(); n4 > 0 && this.getCommonAttributesAtRange([n4 - 1, o2])[t4]; ) n4--; for (; i2 > o2 && this.getCommonAttributesAtRange([e3, o2 + 1])[t4]; ) o2++; return [n4, o2]; }, i.prototype.getTextAtRange = function(t4) { return this.copyWithPieceList(this.pieceList.getSplittableListInRange(t4)); }, i.prototype.getStringAtRange = function(t4) { return this.pieceList.getSplittableListInRange(t4).toString(); }, i.prototype.getStringAtPosition = function(t4) { return this.getStringAtRange([t4, t4 + 1]); }, i.prototype.startsWithString = function(t4) { return this.getStringAtRange([0, t4.length]) === t4; }, i.prototype.endsWithString = function(t4) { var e3; return e3 = this.getLength(), this.getStringAtRange([e3 - t4.length, e3]) === t4; }, i.prototype.getAttachmentPieces = function() { var t4, e3, n4, i2, o2; for (i2 = this.pieceList.toArray(), o2 = [], t4 = 0, e3 = i2.length; e3 > t4; t4++) n4 = i2[t4], n4.attachment != null && o2.push(n4); return o2; }, i.prototype.getAttachments = function() { var t4, e3, n4, i2, o2; for (i2 = this.getAttachmentPieces(), o2 = [], t4 = 0, e3 = i2.length; e3 > t4; t4++) n4 = i2[t4], o2.push(n4.attachment); return o2; }, i.prototype.getAttachmentAndPositionById = function(t4) { var e3, n4, i2, o2, r2, s2; for (o2 = 0, r2 = this.pieceList.toArray(), e3 = 0, n4 = r2.length; n4 > e3; e3++) { if (i2 = r2[e3], ((s2 = i2.attachment) != null ? s2.id : void 0) === t4) return {attachment: i2.attachment, position: o2}; o2 += i2.length; } return {attachment: null, position: null}; }, i.prototype.getAttachmentById = function(t4) { var e3, n4, i2; return i2 = this.getAttachmentAndPositionById(t4), e3 = i2.attachment, n4 = i2.position, e3; }, i.prototype.getRangeOfAttachment = function(t4) { var e3, n4; return n4 = this.getAttachmentAndPositionById(t4.id), t4 = n4.attachment, e3 = n4.position, t4 != null ? [e3, e3 + 1] : void 0; }, i.prototype.updateAttributesForAttachment = function(t4, e3) { var n4; return (n4 = this.getRangeOfAttachment(e3)) ? this.addAttributesAtRange(t4, n4) : this; }, i.prototype.getLength = function() { return this.pieceList.getEndPosition(); }, i.prototype.isEmpty = function() { return this.getLength() === 0; }, i.prototype.isEqualTo = function(t4) { var e3; return i.__super__.isEqualTo.apply(this, arguments) || (t4 != null && (e3 = t4.pieceList) != null ? e3.isEqualTo(this.pieceList) : void 0); }, i.prototype.isBlockBreak = function() { return this.getLength() === 1 && this.pieceList.getObjectAtIndex(0).isBlockBreak(); }, i.prototype.eachPiece = function(t4) { return this.pieceList.eachObject(t4); }, i.prototype.getPieces = function() { return this.pieceList.toArray(); }, i.prototype.getPieceAtPosition = function(t4) { return this.pieceList.getObjectAtPosition(t4); }, i.prototype.contentsForInspection = function() { return {pieceList: this.pieceList.inspect()}; }, i.prototype.toSerializableText = function() { var t4; return t4 = this.pieceList.selectSplittableList(function(t5) { return t5.isSerializable(); }), this.copyWithPieceList(t4); }, i.prototype.toString = function() { return this.pieceList.toString(); }, i.prototype.toJSON = function() { return this.pieceList.toJSON(); }, i.prototype.toConsole = function() { var t4; return JSON.stringify(function() { var e3, n4, i2, o2; for (i2 = this.pieceList.toArray(), o2 = [], e3 = 0, n4 = i2.length; n4 > e3; e3++) t4 = i2[e3], o2.push(JSON.parse(t4.toConsole())); return o2; }.call(this)); }, i.prototype.getDirection = function() { return e2.getDirection(this.toString()); }, i.prototype.isRTL = function() { return this.getDirection() === "rtl"; }, i; }(e2.Object); }.call(this), function() { var t3, n2, i, o2, r2, s2 = function(t4, e3) { function n3() { this.constructor = t4; } for (var i2 in e3) a2.call(e3, i2) && (t4[i2] = e3[i2]); return n3.prototype = e3.prototype, t4.prototype = new n3(), t4.__super__ = e3.prototype, t4; }, a2 = {}.hasOwnProperty, u = [].indexOf || function(t4) { for (var e3 = 0, n3 = this.length; n3 > e3; e3++) if (e3 in this && this[e3] === t4) return e3; return -1; }, c2 = [].slice; t3 = e2.arraysAreEqual, r2 = e2.spliceArray, i = e2.getBlockConfig, n2 = e2.getBlockAttributeNames, o2 = e2.getListAttributeNames, e2.Block = function(n3) { function a3(t4, n4) { t4 == null && (t4 = new e2.Text()), n4 == null && (n4 = []), a3.__super__.constructor.apply(this, arguments), this.text = h(t4), this.attributes = n4; } var l, h, p2, d, f, g, m, v, y; return s2(a3, n3), a3.fromJSON = function(t4) { var n4; return n4 = e2.Text.fromJSON(t4.text), new this(n4, t4.attributes); }, a3.prototype.isEmpty = function() { return this.text.isBlockBreak(); }, a3.prototype.isEqualTo = function(e3) { return a3.__super__.isEqualTo.apply(this, arguments) || this.text.isEqualTo(e3 != null ? e3.text : void 0) && t3(this.attributes, e3 != null ? e3.attributes : void 0); }, a3.prototype.copyWithText = function(t4) { return new this.constructor(t4, this.attributes); }, a3.prototype.copyWithoutText = function() { return this.copyWithText(null); }, a3.prototype.copyWithAttributes = function(t4) { return new this.constructor(this.text, t4); }, a3.prototype.copyWithoutAttributes = function() { return this.copyWithAttributes(null); }, a3.prototype.copyUsingObjectMap = function(t4) { var e3; return this.copyWithText((e3 = t4.find(this.text)) ? e3 : this.text.copyUsingObjectMap(t4)); }, a3.prototype.addAttribute = function(t4) { var e3; return e3 = this.attributes.concat(d(t4)), this.copyWithAttributes(e3); }, a3.prototype.removeAttribute = function(t4) { var e3, n4; return n4 = i(t4).listAttribute, e3 = g(g(this.attributes, t4), n4), this.copyWithAttributes(e3); }, a3.prototype.removeLastAttribute = function() { return this.removeAttribute(this.getLastAttribute()); }, a3.prototype.getLastAttribute = function() { return f(this.attributes); }, a3.prototype.getAttributes = function() { return this.attributes.slice(0); }, a3.prototype.getAttributeLevel = function() { return this.attributes.length; }, a3.prototype.getAttributeAtLevel = function(t4) { return this.attributes[t4 - 1]; }, a3.prototype.hasAttribute = function(t4) { return u.call(this.attributes, t4) >= 0; }, a3.prototype.hasAttributes = function() { return this.getAttributeLevel() > 0; }, a3.prototype.getLastNestableAttribute = function() { return f(this.getNestableAttributes()); }, a3.prototype.getNestableAttributes = function() { var t4, e3, n4, o3, r3; for (o3 = this.attributes, r3 = [], e3 = 0, n4 = o3.length; n4 > e3; e3++) t4 = o3[e3], i(t4).nestable && r3.push(t4); return r3; }, a3.prototype.getNestingLevel = function() { return this.getNestableAttributes().length; }, a3.prototype.decreaseNestingLevel = function() { var t4; return (t4 = this.getLastNestableAttribute()) ? this.removeAttribute(t4) : this; }, a3.prototype.increaseNestingLevel = function() { var t4, e3, n4; return (t4 = this.getLastNestableAttribute()) ? (n4 = this.attributes.lastIndexOf(t4), e3 = r2.apply(null, [this.attributes, n4 + 1, 0].concat(c2.call(d(t4)))), this.copyWithAttributes(e3)) : this; }, a3.prototype.getListItemAttributes = function() { var t4, e3, n4, o3, r3; for (o3 = this.attributes, r3 = [], e3 = 0, n4 = o3.length; n4 > e3; e3++) t4 = o3[e3], i(t4).listAttribute && r3.push(t4); return r3; }, a3.prototype.isListItem = function() { var t4; return (t4 = i(this.getLastAttribute())) != null ? t4.listAttribute : void 0; }, a3.prototype.isTerminalBlock = function() { var t4; return (t4 = i(this.getLastAttribute())) != null ? t4.terminal : void 0; }, a3.prototype.breaksOnReturn = function() { var t4; return (t4 = i(this.getLastAttribute())) != null ? t4.breakOnReturn : void 0; }, a3.prototype.findLineBreakInDirectionFromPosition = function(t4, e3) { var n4, i2; return i2 = this.toString(), n4 = function() { switch (t4) { case "forward": return i2.indexOf("\n", e3); case "backward": return i2.slice(0, e3).lastIndexOf("\n"); } }(), n4 !== -1 ? n4 : void 0; }, a3.prototype.contentsForInspection = function() { return {text: this.text.inspect(), attributes: this.attributes}; }, a3.prototype.toString = function() { return this.text.toString(); }, a3.prototype.toJSON = function() { return {text: this.text, attributes: this.attributes}; }, a3.prototype.getDirection = function() { return this.text.getDirection(); }, a3.prototype.isRTL = function() { return this.text.isRTL(); }, a3.prototype.getLength = function() { return this.text.getLength(); }, a3.prototype.canBeConsolidatedWith = function(t4) { return !this.hasAttributes() && !t4.hasAttributes() && this.getDirection() === t4.getDirection(); }, a3.prototype.consolidateWith = function(t4) { var n4, i2; return n4 = e2.Text.textForStringWithAttributes("\n"), i2 = this.getTextWithoutBlockBreak().appendText(n4), this.copyWithText(i2.appendText(t4.text)); }, a3.prototype.splitAtOffset = function(t4) { var e3, n4; return t4 === 0 ? (e3 = null, n4 = this) : t4 === this.getLength() ? (e3 = this, n4 = null) : (e3 = this.copyWithText(this.text.getTextAtRange([0, t4])), n4 = this.copyWithText(this.text.getTextAtRange([t4, this.getLength()]))), [e3, n4]; }, a3.prototype.getBlockBreakPosition = function() { return this.text.getLength() - 1; }, a3.prototype.getTextWithoutBlockBreak = function() { return m(this.text) ? this.text.getTextAtRange([0, this.getBlockBreakPosition()]) : this.text.copy(); }, a3.prototype.canBeGrouped = function(t4) { return this.attributes[t4]; }, a3.prototype.canBeGroupedWith = function(t4, e3) { var n4, r3, s3, a4; return s3 = t4.getAttributes(), r3 = s3[e3], n4 = this.attributes[e3], !(n4 !== r3 || i(n4).group === false && (a4 = s3[e3 + 1], u.call(o2(), a4) < 0) || this.getDirection() !== t4.getDirection() && !t4.isEmpty()); }, h = function(t4) { return t4 = y(t4), t4 = l(t4); }, y = function(t4) { var n4, i2, o3, r3, s3, a4; return r3 = false, a4 = t4.getPieces(), i2 = 2 <= a4.length ? c2.call(a4, 0, n4 = a4.length - 1) : (n4 = 0, []), o3 = a4[n4++], o3 == null ? t4 : (i2 = function() { var t5, e3, n5; for (n5 = [], t5 = 0, e3 = i2.length; e3 > t5; t5++) s3 = i2[t5], s3.isBlockBreak() ? (r3 = true, n5.push(v(s3))) : n5.push(s3); return n5; }(), r3 ? new e2.Text(c2.call(i2).concat([o3])) : t4); }, p2 = e2.Text.textForStringWithAttributes("\n", {blockBreak: true}), l = function(t4) { return m(t4) ? t4 : t4.appendText(p2); }, m = function(t4) { var e3, n4; return n4 = t4.getLength(), n4 === 0 ? false : (e3 = t4.getTextAtRange([n4 - 1, n4]), e3.isBlockBreak()); }, v = function(t4) { return t4.copyWithoutAttribute("blockBreak"); }, d = function(t4) { var e3; return e3 = i(t4).listAttribute, e3 != null ? [e3, t4] : [t4]; }, f = function(t4) { return t4.slice(-1)[0]; }, g = function(t4, e3) { var n4; return n4 = t4.lastIndexOf(e3), n4 === -1 ? t4 : r2(t4, n4, 1); }, a3; }(e2.Object); }.call(this), function() { var t3, n2, i, o2 = function(t4, e3) { function n3() { this.constructor = t4; } for (var i2 in e3) r2.call(e3, i2) && (t4[i2] = e3[i2]); return n3.prototype = e3.prototype, t4.prototype = new n3(), t4.__super__ = e3.prototype, t4; }, r2 = {}.hasOwnProperty, s2 = [].indexOf || function(t4) { for (var e3 = 0, n3 = this.length; n3 > e3; e3++) if (e3 in this && this[e3] === t4) return e3; return -1; }, a2 = [].slice; n2 = e2.tagName, i = e2.walkTree, t3 = e2.nodeIsAttachmentElement, e2.HTMLSanitizer = function(r3) { function u(t4, e3) { var n3; n3 = e3 != null ? e3 : {}, this.allowedAttributes = n3.allowedAttributes, this.forbiddenProtocols = n3.forbiddenProtocols, this.forbiddenElements = n3.forbiddenElements, this.allowedAttributes == null && (this.allowedAttributes = c2), this.forbiddenProtocols == null && (this.forbiddenProtocols = h), this.forbiddenElements == null && (this.forbiddenElements = l), this.body = p2(t4); } var c2, l, h, p2; return o2(u, r3), c2 = "style href src width height class".split(" "), h = "javascript:".split(" "), l = "script iframe".split(" "), u.sanitize = function(t4, e3) { var n3; return n3 = new this(t4, e3), n3.sanitize(), n3; }, u.prototype.sanitize = function() { return this.sanitizeElements(), this.normalizeListElementNesting(); }, u.prototype.getHTML = function() { return this.body.innerHTML; }, u.prototype.getBody = function() { return this.body; }, u.prototype.sanitizeElements = function() { var t4, n3, o3, r4, s3; for (s3 = i(this.body), r4 = []; s3.nextNode(); ) switch (o3 = s3.currentNode, o3.nodeType) { case Node.ELEMENT_NODE: this.elementIsRemovable(o3) ? r4.push(o3) : this.sanitizeElement(o3); break; case Node.COMMENT_NODE: r4.push(o3); } for (t4 = 0, n3 = r4.length; n3 > t4; t4++) o3 = r4[t4], e2.removeNode(o3); return this.body; }, u.prototype.sanitizeElement = function(t4) { var e3, n3, i2, o3, r4; for (t4.hasAttribute("href") && (o3 = t4.protocol, s2.call(this.forbiddenProtocols, o3) >= 0 && t4.removeAttribute("href")), r4 = a2.call(t4.attributes), e3 = 0, n3 = r4.length; n3 > e3; e3++) i2 = r4[e3].name, s2.call(this.allowedAttributes, i2) >= 0 || i2.indexOf("data-trix") === 0 || t4.removeAttribute(i2); return t4; }, u.prototype.normalizeListElementNesting = function() { var t4, e3, i2, o3, r4; for (r4 = a2.call(this.body.querySelectorAll("ul,ol")), t4 = 0, e3 = r4.length; e3 > t4; t4++) i2 = r4[t4], (o3 = i2.previousElementSibling) && n2(o3) === "li" && o3.appendChild(i2); return this.body; }, u.prototype.elementIsRemovable = function(t4) { return (t4 != null ? t4.nodeType : void 0) === Node.ELEMENT_NODE ? this.elementIsForbidden(t4) || this.elementIsntSerializable(t4) : void 0; }, u.prototype.elementIsForbidden = function(t4) { var e3; return e3 = n2(t4), s2.call(this.forbiddenElements, e3) >= 0; }, u.prototype.elementIsntSerializable = function(e3) { return e3.getAttribute("data-trix-serialize") === "false" && !t3(e3); }, p2 = function(t4) { var e3, n3, i2, o3, r4; for (t4 == null && (t4 = ""), t4 = t4.replace(/<\/html[^>]*>[^]*$/i, ""), e3 = document.implementation.createHTMLDocument(""), e3.documentElement.innerHTML = t4, r4 = e3.head.querySelectorAll("style"), i2 = 0, o3 = r4.length; o3 > i2; i2++) n3 = r4[i2], e3.body.appendChild(n3); return e3.body; }, u; }(e2.BasicObject); }.call(this), function() { var t3, n2, i, o2, r2, s2, a2, u, c2, l, h, p2 = function(t4, e3) { function n3() { this.constructor = t4; } for (var i2 in e3) d.call(e3, i2) && (t4[i2] = e3[i2]); return n3.prototype = e3.prototype, t4.prototype = new n3(), t4.__super__ = e3.prototype, t4; }, d = {}.hasOwnProperty, f = [].indexOf || function(t4) { for (var e3 = 0, n3 = this.length; n3 > e3; e3++) if (e3 in this && this[e3] === t4) return e3; return -1; }; t3 = e2.arraysAreEqual, s2 = e2.makeElement, l = e2.tagName, r2 = e2.getBlockTagNames, h = e2.walkTree, o2 = e2.findClosestElementFromNode, i = e2.elementContainsNode, a2 = e2.nodeIsAttachmentElement, u = e2.normalizeSpaces, n2 = e2.breakableWhitespacePattern, c2 = e2.squishBreakableWhitespace, e2.HTMLParser = function(d2) { function g(t4, e3) { this.html = t4, this.referenceElement = (e3 != null ? e3 : {}).referenceElement, this.blocks = [], this.blockElements = [], this.processedElements = []; } var m, v, y, b, A, C3, x, w, E, S2, R, k; return p2(g, d2), g.parse = function(t4, e3) { var n3; return n3 = new this(t4, e3), n3.parse(), n3; }, g.prototype.getDocument = function() { return e2.Document.fromJSON(this.blocks); }, g.prototype.parse = function() { var t4, n3; try { for (this.createHiddenContainer(), t4 = e2.HTMLSanitizer.sanitize(this.html).getHTML(), this.containerElement.innerHTML = t4, n3 = h(this.containerElement, {usingFilter: x}); n3.nextNode(); ) this.processNode(n3.currentNode); return this.translateBlockElementMarginsToNewlines(); } finally { this.removeHiddenContainer(); } }, g.prototype.createHiddenContainer = function() { return this.referenceElement ? (this.containerElement = this.referenceElement.cloneNode(false), this.containerElement.removeAttribute("id"), this.containerElement.setAttribute("data-trix-internal", ""), this.containerElement.style.display = "none", this.referenceElement.parentNode.insertBefore(this.containerElement, this.referenceElement.nextSibling)) : (this.containerElement = s2({tagName: "div", style: {display: "none"}}), document.body.appendChild(this.containerElement)); }, g.prototype.removeHiddenContainer = function() { return e2.removeNode(this.containerElement); }, x = function(t4) { return l(t4) === "style" ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT; }, g.prototype.processNode = function(t4) { switch (t4.nodeType) { case Node.TEXT_NODE: if (!this.isInsignificantTextNode(t4)) return this.appendBlockForTextNode(t4), this.processTextNode(t4); break; case Node.ELEMENT_NODE: return this.appendBlockForElement(t4), this.processElement(t4); } }, g.prototype.appendBlockForTextNode = function(e3) { var n3, i2, o3; return i2 = e3.parentNode, i2 === this.currentBlockElement && this.isBlockElement(e3.previousSibling) ? this.appendStringWithAttributes("\n") : i2 !== this.containerElement && !this.isBlockElement(i2) || (n3 = this.getBlockAttributes(i2), t3(n3, (o3 = this.currentBlock) != null ? o3.attributes : void 0)) ? void 0 : (this.currentBlock = this.appendBlockForAttributesWithElement(n3, i2), this.currentBlockElement = i2); }, g.prototype.appendBlockForElement = function(e3) { var n3, o3, r3, s3; if (r3 = this.isBlockElement(e3), o3 = i(this.currentBlockElement, e3), r3 && !this.isBlockElement(e3.firstChild)) { if ((!this.isInsignificantTextNode(e3.firstChild) || !this.isBlockElement(e3.firstElementChild)) && (n3 = this.getBlockAttributes(e3), e3.firstChild)) return o3 && t3(n3, this.currentBlock.attributes) ? this.appendStringWithAttributes("\n") : (this.currentBlock = this.appendBlockForAttributesWithElement(n3, e3), this.currentBlockElement = e3); } else if (this.currentBlockElement && !o3 && !r3) return (s3 = this.findParentBlockElement(e3)) ? this.appendBlockForElement(s3) : (this.currentBlock = this.appendEmptyBlock(), this.currentBlockElement = null); }, g.prototype.findParentBlockElement = function(t4) { var e3; for (e3 = t4.parentElement; e3 && e3 !== this.containerElement; ) { if (this.isBlockElement(e3) && f.call(this.blockElements, e3) >= 0) return e3; e3 = e3.parentElement; } return null; }, g.prototype.processTextNode = function(t4) { var e3, n3; return n3 = t4.data, v(t4.parentNode) || (n3 = c2(n3), R((e3 = t4.previousSibling) != null ? e3.textContent : void 0) && (n3 = A(n3))), this.appendStringWithAttributes(n3, this.getTextAttributes(t4.parentNode)); }, g.prototype.processElement = function(t4) { var e3, n3, i2, o3, r3; if (a2(t4)) return e3 = w(t4, "attachment"), Object.keys(e3).length && (o3 = this.getTextAttributes(t4), this.appendAttachmentWithAttributes(e3, o3), t4.innerHTML = ""), this.processedElements.push(t4); switch (l(t4)) { case "br": return this.isExtraBR(t4) || this.isBlockElement(t4.nextSibling) || this.appendStringWithAttributes("\n", this.getTextAttributes(t4)), this.processedElements.push(t4); case "img": e3 = {url: t4.getAttribute("src"), contentType: "image"}, i2 = b(t4); for (n3 in i2) r3 = i2[n3], e3[n3] = r3; return this.appendAttachmentWithAttributes(e3, this.getTextAttributes(t4)), this.processedElements.push(t4); case "tr": if (t4.parentNode.firstChild !== t4) return this.appendStringWithAttributes("\n"); break; case "td": if (t4.parentNode.firstChild !== t4) return this.appendStringWithAttributes(" | "); } }, g.prototype.appendBlockForAttributesWithElement = function(t4, e3) { var n3; return this.blockElements.push(e3), n3 = m(t4), this.blocks.push(n3), n3; }, g.prototype.appendEmptyBlock = function() { return this.appendBlockForAttributesWithElement([], null); }, g.prototype.appendStringWithAttributes = function(t4, e3) { return this.appendPiece(S2(t4, e3)); }, g.prototype.appendAttachmentWithAttributes = function(t4, e3) { return this.appendPiece(E(t4, e3)); }, g.prototype.appendPiece = function(t4) { return this.blocks.length === 0 && this.appendEmptyBlock(), this.blocks[this.blocks.length - 1].text.push(t4); }, g.prototype.appendStringToTextAtIndex = function(t4, e3) { var n3, i2; return i2 = this.blocks[e3].text, n3 = i2[i2.length - 1], (n3 != null ? n3.type : void 0) === "string" ? n3.string += t4 : i2.push(S2(t4)); }, g.prototype.prependStringToTextAtIndex = function(t4, e3) { var n3, i2; return i2 = this.blocks[e3].text, n3 = i2[0], (n3 != null ? n3.type : void 0) === "string" ? n3.string = t4 + n3.string : i2.unshift(S2(t4)); }, S2 = function(t4, e3) { var n3; return e3 == null && (e3 = {}), n3 = "string", t4 = u(t4), {string: t4, attributes: e3, type: n3}; }, E = function(t4, e3) { var n3; return e3 == null && (e3 = {}), n3 = "attachment", {attachment: t4, attributes: e3, type: n3}; }, m = function(t4) { var e3; return t4 == null && (t4 = {}), e3 = [], {text: e3, attributes: t4}; }, g.prototype.getTextAttributes = function(t4) { var n3, i2, r3, s3, u2, c3, l2, h2, p3, d3, f2, g2; r3 = {}, p3 = e2.config.textAttributes; for (n3 in p3) if (u2 = p3[n3], u2.tagName && o2(t4, {matchingSelector: u2.tagName, untilNode: this.containerElement})) r3[n3] = true; else if (u2.parser) { if (g2 = u2.parser(t4)) { for (i2 = false, d3 = this.findBlockElementAncestors(t4), c3 = 0, h2 = d3.length; h2 > c3; c3++) if (s3 = d3[c3], u2.parser(s3) === g2) { i2 = true; break; } i2 || (r3[n3] = g2); } } else u2.styleProperty && (g2 = t4.style[u2.styleProperty]) && (r3[n3] = g2); if (a2(t4)) { f2 = w(t4, "attributes"); for (l2 in f2) g2 = f2[l2], r3[l2] = g2; } return r3; }, g.prototype.getBlockAttributes = function(t4) { var n3, i2, o3, r3; for (i2 = []; t4 && t4 !== this.containerElement; ) { r3 = e2.config.blockAttributes; for (n3 in r3) o3 = r3[n3], o3.parse !== false && l(t4) === o3.tagName && ((typeof o3.test == "function" ? o3.test(t4) : void 0) || !o3.test) && (i2.push(n3), o3.listAttribute && i2.push(o3.listAttribute)); t4 = t4.parentNode; } return i2.reverse(); }, g.prototype.findBlockElementAncestors = function(t4) { var e3, n3; for (e3 = []; t4 && t4 !== this.containerElement; ) n3 = l(t4), f.call(r2(), n3) >= 0 && e3.push(t4), t4 = t4.parentNode; return e3; }, w = function(t4, e3) { try { return JSON.parse(t4.getAttribute("data-trix-" + e3)); } catch (n3) { return {}; } }, b = function(t4) { var e3, n3, i2; return i2 = t4.getAttribute("width"), n3 = t4.getAttribute("height"), e3 = {}, i2 && (e3.width = parseInt(i2, 10)), n3 && (e3.height = parseInt(n3, 10)), e3; }, g.prototype.isBlockElement = function(t4) { var e3; if ((t4 != null ? t4.nodeType : void 0) === Node.ELEMENT_NODE && !a2(t4) && !o2(t4, {matchingSelector: "td", untilNode: this.containerElement})) return e3 = l(t4), f.call(r2(), e3) >= 0 || window.getComputedStyle(t4).display === "block"; }, g.prototype.isInsignificantTextNode = function(t4) { var e3, n3, i2; if ((t4 != null ? t4.nodeType : void 0) === Node.TEXT_NODE && k(t4.data) && (n3 = t4.parentNode, i2 = t4.previousSibling, e3 = t4.nextSibling, (!C3(n3.previousSibling) || this.isBlockElement(n3.previousSibling)) && !v(n3))) return !i2 || this.isBlockElement(i2) || !e3 || this.isBlockElement(e3); }, g.prototype.isExtraBR = function(t4) { return l(t4) === "br" && this.isBlockElement(t4.parentNode) && t4.parentNode.lastChild === t4; }, v = function(t4) { var e3; return e3 = window.getComputedStyle(t4).whiteSpace, e3 === "pre" || e3 === "pre-wrap" || e3 === "pre-line"; }, C3 = function(t4) { return t4 && !R(t4.textContent); }, g.prototype.translateBlockElementMarginsToNewlines = function() { var t4, e3, n3, i2, o3, r3, s3, a3; for (e3 = this.getMarginOfDefaultBlockElement(), s3 = this.blocks, a3 = [], i2 = n3 = 0, o3 = s3.length; o3 > n3; i2 = ++n3) t4 = s3[i2], (r3 = this.getMarginOfBlockElementAtIndex(i2)) && (r3.top > 2 * e3.top && this.prependStringToTextAtIndex("\n", i2), a3.push(r3.bottom > 2 * e3.bottom ? this.appendStringToTextAtIndex("\n", i2) : void 0)); return a3; }, g.prototype.getMarginOfBlockElementAtIndex = function(t4) { var e3, n3; return !(e3 = this.blockElements[t4]) || !e3.textContent || (n3 = l(e3), f.call(r2(), n3) >= 0 || f.call(this.processedElements, e3) >= 0) ? void 0 : y(e3); }, g.prototype.getMarginOfDefaultBlockElement = function() { var t4; return t4 = s2(e2.config.blockAttributes["default"].tagName), this.containerElement.appendChild(t4), y(t4); }, y = function(t4) { var e3; return e3 = window.getComputedStyle(t4), e3.display === "block" ? {top: parseInt(e3.marginTop), bottom: parseInt(e3.marginBottom)} : void 0; }, A = function(t4) { return t4.replace(RegExp("^" + n2.source + "+"), ""); }, k = function(t4) { return RegExp("^" + n2.source + "*$").test(t4); }, R = function(t4) { return /\s$/.test(t4); }, g; }(e2.BasicObject); }.call(this), function() { var t3, n2, i, o2, r2 = function(t4, e3) { function n3() { this.constructor = t4; } for (var i2 in e3) s2.call(e3, i2) && (t4[i2] = e3[i2]); return n3.prototype = e3.prototype, t4.prototype = new n3(), t4.__super__ = e3.prototype, t4; }, s2 = {}.hasOwnProperty, a2 = [].slice, u = [].indexOf || function(t4) { for (var e3 = 0, n3 = this.length; n3 > e3; e3++) if (e3 in this && this[e3] === t4) return e3; return -1; }; t3 = e2.arraysAreEqual, i = e2.normalizeRange, o2 = e2.rangeIsCollapsed, n2 = e2.getBlockConfig, e2.Document = function(s3) { function c2(t4) { t4 == null && (t4 = []), c2.__super__.constructor.apply(this, arguments), t4.length === 0 && (t4 = [new e2.Block()]), this.blockList = e2.SplittableList.box(t4); } var l; return r2(c2, s3), c2.fromJSON = function(t4) { var n3, i2; return i2 = function() { var i3, o3, r3; for (r3 = [], i3 = 0, o3 = t4.length; o3 > i3; i3++) n3 = t4[i3], r3.push(e2.Block.fromJSON(n3)); return r3; }(), new this(i2); }, c2.fromHTML = function(t4, n3) { return e2.HTMLParser.parse(t4, n3).getDocument(); }, c2.fromString = function(t4, n3) { var i2; return i2 = e2.Text.textForStringWithAttributes(t4, n3), new this([new e2.Block(i2)]); }, c2.prototype.isEmpty = function() { var t4; return this.blockList.length === 1 && (t4 = this.getBlockAtIndex(0), t4.isEmpty() && !t4.hasAttributes()); }, c2.prototype.copy = function(t4) { var e3; return t4 == null && (t4 = {}), e3 = t4.consolidateBlocks ? this.blockList.consolidate().toArray() : this.blockList.toArray(), new this.constructor(e3); }, c2.prototype.copyUsingObjectsFromDocument = function(t4) { var n3; return n3 = new e2.ObjectMap(t4.getObjects()), this.copyUsingObjectMap(n3); }, c2.prototype.copyUsingObjectMap = function(t4) { var e3, n3, i2; return n3 = function() { var n4, o3, r3, s4; for (r3 = this.getBlocks(), s4 = [], n4 = 0, o3 = r3.length; o3 > n4; n4++) e3 = r3[n4], s4.push((i2 = t4.find(e3)) ? i2 : e3.copyUsingObjectMap(t4)); return s4; }.call(this), new this.constructor(n3); }, c2.prototype.copyWithBaseBlockAttributes = function(t4) { var e3, n3, i2; return t4 == null && (t4 = []), i2 = function() { var i3, o3, r3, s4; for (r3 = this.getBlocks(), s4 = [], i3 = 0, o3 = r3.length; o3 > i3; i3++) n3 = r3[i3], e3 = t4.concat(n3.getAttributes()), s4.push(n3.copyWithAttributes(e3)); return s4; }.call(this), new this.constructor(i2); }, c2.prototype.replaceBlock = function(t4, e3) { var n3; return n3 = this.blockList.indexOf(t4), n3 === -1 ? this : new this.constructor(this.blockList.replaceObjectAtIndex(e3, n3)); }, c2.prototype.insertDocumentAtRange = function(t4, e3) { var n3, r3, s4, a3, u2, c3, l2; return r3 = t4.blockList, u2 = (e3 = i(e3))[0], c3 = this.locationFromPosition(u2), s4 = c3.index, a3 = c3.offset, l2 = this, n3 = this.getBlockAtPosition(u2), o2(e3) && n3.isEmpty() && !n3.hasAttributes() ? l2 = new this.constructor(l2.blockList.removeObjectAtIndex(s4)) : n3.getBlockBreakPosition() === a3 && u2++, l2 = l2.removeTextAtRange(e3), new this.constructor(l2.blockList.insertSplittableListAtPosition(r3, u2)); }, c2.prototype.mergeDocumentAtRange = function(e3, n3) { var o3, r3, s4, a3, u2, c3, l2, h, p2, d, f, g; return f = (n3 = i(n3))[0], d = this.locationFromPosition(f), r3 = this.getBlockAtIndex(d.index).getAttributes(), o3 = e3.getBaseBlockAttributes(), g = r3.slice(-o3.length), t3(o3, g) ? (l2 = r3.slice(0, -o3.length), c3 = e3.copyWithBaseBlockAttributes(l2)) : c3 = e3.copy({consolidateBlocks: true}).copyWithBaseBlockAttributes(r3), s4 = c3.getBlockCount(), a3 = c3.getBlockAtIndex(0), t3(r3, a3.getAttributes()) ? (u2 = a3.getTextWithoutBlockBreak(), p2 = this.insertTextAtRange(u2, n3), s4 > 1 && (c3 = new this.constructor(c3.getBlocks().slice(1)), h = f + u2.getLength(), p2 = p2.insertDocumentAtRange(c3, h))) : p2 = this.insertDocumentAtRange(c3, n3), p2; }, c2.prototype.insertTextAtRange = function(t4, e3) { var n3, o3, r3, s4, a3; return a3 = (e3 = i(e3))[0], s4 = this.locationFromPosition(a3), o3 = s4.index, r3 = s4.offset, n3 = this.removeTextAtRange(e3), new this.constructor(n3.blockList.editObjectAtIndex(o3, function(e4) { return e4.copyWithText(e4.text.insertTextAtPosition(t4, r3)); })); }, c2.prototype.removeTextAtRange = function(t4) { var e3, n3, r3, s4, a3, u2, c3, l2, h, p2, d, f, g, m, v, y, b, A, C3, x, w; return p2 = t4 = i(t4), l2 = p2[0], A = p2[1], o2(t4) ? this : (d = this.locationRangeFromRange(t4), u2 = d[0], y = d[1], a3 = u2.index, c3 = u2.offset, s4 = this.getBlockAtIndex(a3), v = y.index, b = y.offset, m = this.getBlockAtIndex(v), f = A - l2 === 1 && s4.getBlockBreakPosition() === c3 && m.getBlockBreakPosition() !== b && m.text.getStringAtPosition(b) === "\n", f ? r3 = this.blockList.editObjectAtIndex(v, function(t5) { return t5.copyWithText(t5.text.removeTextAtRange([b, b + 1])); }) : (h = s4.text.getTextAtRange([0, c3]), C3 = m.text.getTextAtRange([b, m.getLength()]), x = h.appendText(C3), g = a3 !== v && c3 === 0, w = g && s4.getAttributeLevel() >= m.getAttributeLevel(), n3 = w ? m.copyWithText(x) : s4.copyWithText(x), e3 = v + 1 - a3, r3 = this.blockList.splice(a3, e3, n3)), new this.constructor(r3)); }, c2.prototype.moveTextFromRangeToPosition = function(t4, e3) { var n3, o3, r3, s4, u2, c3, l2, h, p2, d; return c3 = t4 = i(t4), p2 = c3[0], r3 = c3[1], e3 >= p2 && r3 >= e3 ? this : (o3 = this.getDocumentAtRange(t4), h = this.removeTextAtRange(t4), u2 = e3 > p2, u2 && (e3 -= o3.getLength()), l2 = o3.getBlocks(), s4 = l2[0], n3 = 2 <= l2.length ? a2.call(l2, 1) : [], n3.length === 0 ? (d = s4.getTextWithoutBlockBreak(), u2 && (e3 += 1)) : d = s4.text, h = h.insertTextAtRange(d, e3), n3.length === 0 ? h : (o3 = new this.constructor(n3), e3 += d.getLength(), h.insertDocumentAtRange(o3, e3))); }, c2.prototype.addAttributeAtRange = function(t4, e3, i2) { var o3; return o3 = this.blockList, this.eachBlockAtRange(i2, function(i3, r3, s4) { return o3 = o3.editObjectAtIndex(s4, function() { return n2(t4) ? i3.addAttribute(t4, e3) : r3[0] === r3[1] ? i3 : i3.copyWithText(i3.text.addAttributeAtRange(t4, e3, r3)); }); }), new this.constructor(o3); }, c2.prototype.addAttribute = function(t4, e3) { var n3; return n3 = this.blockList, this.eachBlock(function(i2, o3) { return n3 = n3.editObjectAtIndex(o3, function() { return i2.addAttribute(t4, e3); }); }), new this.constructor(n3); }, c2.prototype.removeAttributeAtRange = function(t4, e3) { var i2; return i2 = this.blockList, this.eachBlockAtRange(e3, function(e4, o3, r3) { return n2(t4) ? i2 = i2.editObjectAtIndex(r3, function() { return e4.removeAttribute(t4); }) : o3[0] !== o3[1] ? i2 = i2.editObjectAtIndex(r3, function() { return e4.copyWithText(e4.text.removeAttributeAtRange(t4, o3)); }) : void 0; }), new this.constructor(i2); }, c2.prototype.updateAttributesForAttachment = function(t4, e3) { var n3, i2, o3, r3; return o3 = (i2 = this.getRangeOfAttachment(e3))[0], n3 = this.locationFromPosition(o3).index, r3 = this.getTextAtIndex(n3), new this.constructor(this.blockList.editObjectAtIndex(n3, function(n4) { return n4.copyWithText(r3.updateAttributesForAttachment(t4, e3)); })); }, c2.prototype.removeAttributeForAttachment = function(t4, e3) { var n3; return n3 = this.getRangeOfAttachment(e3), this.removeAttributeAtRange(t4, n3); }, c2.prototype.insertBlockBreakAtRange = function(t4) { var n3, o3, r3, s4; return s4 = (t4 = i(t4))[0], r3 = this.locationFromPosition(s4).offset, o3 = this.removeTextAtRange(t4), r3 === 0 && (n3 = [new e2.Block()]), new this.constructor(o3.blockList.insertSplittableListAtPosition(new e2.SplittableList(n3), s4)); }, c2.prototype.applyBlockAttributeAtRange = function(t4, e3, i2) { var o3, r3, s4, a3; return s4 = this.expandRangeToLineBreaksAndSplitBlocks(i2), r3 = s4.document, i2 = s4.range, o3 = n2(t4), o3.listAttribute ? (r3 = r3.removeLastListAttributeAtRange(i2, {exceptAttributeName: t4}), a3 = r3.convertLineBreaksToBlockBreaksInRange(i2), r3 = a3.document, i2 = a3.range) : r3 = o3.exclusive ? r3.removeBlockAttributesAtRange(i2) : o3.terminal ? r3.removeLastTerminalAttributeAtRange(i2) : r3.consolidateBlocksAtRange(i2), r3.addAttributeAtRange(t4, e3, i2); }, c2.prototype.removeLastListAttributeAtRange = function(t4, e3) { var i2; return e3 == null && (e3 = {}), i2 = this.blockList, this.eachBlockAtRange(t4, function(t5, o3, r3) { var s4; if ((s4 = t5.getLastAttribute()) && n2(s4).listAttribute && s4 !== e3.exceptAttributeName) return i2 = i2.editObjectAtIndex(r3, function() { return t5.removeAttribute(s4); }); }), new this.constructor(i2); }, c2.prototype.removeLastTerminalAttributeAtRange = function(t4) { var e3; return e3 = this.blockList, this.eachBlockAtRange(t4, function(t5, i2, o3) { var r3; if ((r3 = t5.getLastAttribute()) && n2(r3).terminal) return e3 = e3.editObjectAtIndex(o3, function() { return t5.removeAttribute(r3); }); }), new this.constructor(e3); }, c2.prototype.removeBlockAttributesAtRange = function(t4) { var e3; return e3 = this.blockList, this.eachBlockAtRange(t4, function(t5, n3, i2) { return t5.hasAttributes() ? e3 = e3.editObjectAtIndex(i2, function() { return t5.copyWithoutAttributes(); }) : void 0; }), new this.constructor(e3); }, c2.prototype.expandRangeToLineBreaksAndSplitBlocks = function(t4) { var e3, n3, o3, r3, s4, a3, u2, c3, l2; return a3 = t4 = i(t4), l2 = a3[0], r3 = a3[1], c3 = this.locationFromPosition(l2), o3 = this.locationFromPosition(r3), e3 = this, u2 = e3.getBlockAtIndex(c3.index), (c3.offset = u2.findLineBreakInDirectionFromPosition("backward", c3.offset)) != null && (s4 = e3.positionFromLocation(c3), e3 = e3.insertBlockBreakAtRange([s4, s4 + 1]), o3.index += 1, o3.offset -= e3.getBlockAtIndex(c3.index).getLength(), c3.index += 1), c3.offset = 0, o3.offset === 0 && o3.index > c3.index ? (o3.index -= 1, o3.offset = e3.getBlockAtIndex(o3.index).getBlockBreakPosition()) : (n3 = e3.getBlockAtIndex(o3.index), n3.text.getStringAtRange([o3.offset - 1, o3.offset]) === "\n" ? o3.offset -= 1 : o3.offset = n3.findLineBreakInDirectionFromPosition("forward", o3.offset), o3.offset !== n3.getBlockBreakPosition() && (s4 = e3.positionFromLocation(o3), e3 = e3.insertBlockBreakAtRange([s4, s4 + 1]))), l2 = e3.positionFromLocation(c3), r3 = e3.positionFromLocation(o3), t4 = i([l2, r3]), {document: e3, range: t4}; }, c2.prototype.convertLineBreaksToBlockBreaksInRange = function(t4) { var e3, n3, o3; return n3 = (t4 = i(t4))[0], o3 = this.getStringAtRange(t4).slice(0, -1), e3 = this, o3.replace(/.*?\n/g, function(t5) { return n3 += t5.length, e3 = e3.insertBlockBreakAtRange([n3 - 1, n3]); }), {document: e3, range: t4}; }, c2.prototype.consolidateBlocksAtRange = function(t4) { var e3, n3, o3, r3, s4; return o3 = t4 = i(t4), s4 = o3[0], n3 = o3[1], r3 = this.locationFromPosition(s4).index, e3 = this.locationFromPosition(n3).index, new this.constructor(this.blockList.consolidateFromIndexToIndex(r3, e3)); }, c2.prototype.getDocumentAtRange = function(t4) { var e3; return t4 = i(t4), e3 = this.blockList.getSplittableListInRange(t4).toArray(), new this.constructor(e3); }, c2.prototype.getStringAtRange = function(t4) { var e3, n3, o3; return o3 = t4 = i(t4), n3 = o3[o3.length - 1], n3 !== this.getLength() && (e3 = -1), this.getDocumentAtRange(t4).toString().slice(0, e3); }, c2.prototype.getBlockAtIndex = function(t4) { return this.blockList.getObjectAtIndex(t4); }, c2.prototype.getBlockAtPosition = function(t4) { var e3; return e3 = this.locationFromPosition(t4).index, this.getBlockAtIndex(e3); }, c2.prototype.getTextAtIndex = function(t4) { var e3; return (e3 = this.getBlockAtIndex(t4)) != null ? e3.text : void 0; }, c2.prototype.getTextAtPosition = function(t4) { var e3; return e3 = this.locationFromPosition(t4).index, this.getTextAtIndex(e3); }, c2.prototype.getPieceAtPosition = function(t4) { var e3, n3, i2; return i2 = this.locationFromPosition(t4), e3 = i2.index, n3 = i2.offset, this.getTextAtIndex(e3).getPieceAtPosition(n3); }, c2.prototype.getCharacterAtPosition = function(t4) { var e3, n3, i2; return i2 = this.locationFromPosition(t4), e3 = i2.index, n3 = i2.offset, this.getTextAtIndex(e3).getStringAtRange([n3, n3 + 1]); }, c2.prototype.getLength = function() { return this.blockList.getEndPosition(); }, c2.prototype.getBlocks = function() { return this.blockList.toArray(); }, c2.prototype.getBlockCount = function() { return this.blockList.length; }, c2.prototype.getEditCount = function() { return this.editCount; }, c2.prototype.eachBlock = function(t4) { return this.blockList.eachObject(t4); }, c2.prototype.eachBlockAtRange = function(t4, e3) { var n3, o3, r3, s4, a3, u2, c3, l2, h, p2, d, f; if (u2 = t4 = i(t4), d = u2[0], r3 = u2[1], p2 = this.locationFromPosition(d), o3 = this.locationFromPosition(r3), p2.index === o3.index) return n3 = this.getBlockAtIndex(p2.index), f = [p2.offset, o3.offset], e3(n3, f, p2.index); for (h = [], a3 = s4 = c3 = p2.index, l2 = o3.index; l2 >= c3 ? l2 >= s4 : s4 >= l2; a3 = l2 >= c3 ? ++s4 : --s4) (n3 = this.getBlockAtIndex(a3)) ? (f = function() { switch (a3) { case p2.index: return [p2.offset, n3.text.getLength()]; case o3.index: return [0, o3.offset]; default: return [0, n3.text.getLength()]; } }(), h.push(e3(n3, f, a3))) : h.push(void 0); return h; }, c2.prototype.getCommonAttributesAtRange = function(t4) { var n3, r3, s4; return r3 = (t4 = i(t4))[0], o2(t4) ? this.getCommonAttributesAtPosition(r3) : (s4 = [], n3 = [], this.eachBlockAtRange(t4, function(t5, e3) { return e3[0] !== e3[1] ? (s4.push(t5.text.getCommonAttributesAtRange(e3)), n3.push(l(t5))) : void 0; }), e2.Hash.fromCommonAttributesOfObjects(s4).merge(e2.Hash.fromCommonAttributesOfObjects(n3)).toObject()); }, c2.prototype.getCommonAttributesAtPosition = function(t4) { var n3, i2, o3, r3, s4, a3, c3, h, p2, d; if (p2 = this.locationFromPosition(t4), s4 = p2.index, h = p2.offset, o3 = this.getBlockAtIndex(s4), !o3) return {}; r3 = l(o3), n3 = o3.text.getAttributesAtPosition(h), i2 = o3.text.getAttributesAtPosition(h - 1), a3 = function() { var t5, n4; t5 = e2.config.textAttributes, n4 = []; for (c3 in t5) d = t5[c3], d.inheritable && n4.push(c3); return n4; }(); for (c3 in i2) d = i2[c3], (d === n3[c3] || u.call(a3, c3) >= 0) && (r3[c3] = d); return r3; }, c2.prototype.getRangeOfCommonAttributeAtPosition = function(t4, e3) { var n3, o3, r3, s4, a3, u2, c3, l2, h; return a3 = this.locationFromPosition(e3), r3 = a3.index, s4 = a3.offset, h = this.getTextAtIndex(r3), u2 = h.getExpandedRangeForAttributeAtOffset(t4, s4), l2 = u2[0], o3 = u2[1], c3 = this.positionFromLocation({index: r3, offset: l2}), n3 = this.positionFromLocation({index: r3, offset: o3}), i([c3, n3]); }, c2.prototype.getBaseBlockAttributes = function() { var t4, e3, n3, i2, o3, r3, s4; for (t4 = this.getBlockAtIndex(0).getAttributes(), n3 = i2 = 1, s4 = this.getBlockCount(); s4 >= 1 ? s4 > i2 : i2 > s4; n3 = s4 >= 1 ? ++i2 : --i2) e3 = this.getBlockAtIndex(n3).getAttributes(), r3 = Math.min(t4.length, e3.length), t4 = function() { var n4, i3, s5; for (s5 = [], o3 = n4 = 0, i3 = r3; (i3 >= 0 ? i3 > n4 : n4 > i3) && e3[o3] === t4[o3]; o3 = i3 >= 0 ? ++n4 : --n4) s5.push(e3[o3]); return s5; }(); return t4; }, l = function(t4) { var e3, n3; return n3 = {}, (e3 = t4.getLastAttribute()) && (n3[e3] = true), n3; }, c2.prototype.getAttachmentById = function(t4) { var e3, n3, i2, o3; for (o3 = this.getAttachments(), n3 = 0, i2 = o3.length; i2 > n3; n3++) if (e3 = o3[n3], e3.id === t4) return e3; }, c2.prototype.getAttachmentPieces = function() { var t4; return t4 = [], this.blockList.eachObject(function(e3) { var n3; return n3 = e3.text, t4 = t4.concat(n3.getAttachmentPieces()); }), t4; }, c2.prototype.getAttachments = function() { var t4, e3, n3, i2, o3; for (i2 = this.getAttachmentPieces(), o3 = [], t4 = 0, e3 = i2.length; e3 > t4; t4++) n3 = i2[t4], o3.push(n3.attachment); return o3; }, c2.prototype.getRangeOfAttachment = function(t4) { var e3, n3, o3, r3, s4, a3, u2; for (r3 = 0, s4 = this.blockList.toArray(), n3 = e3 = 0, o3 = s4.length; o3 > e3; n3 = ++e3) { if (a3 = s4[n3].text, u2 = a3.getRangeOfAttachment(t4)) return i([r3 + u2[0], r3 + u2[1]]); r3 += a3.getLength(); } }, c2.prototype.getLocationRangeOfAttachment = function(t4) { var e3; return e3 = this.getRangeOfAttachment(t4), this.locationRangeFromRange(e3); }, c2.prototype.getAttachmentPieceForAttachment = function(t4) { var e3, n3, i2, o3; for (o3 = this.getAttachmentPieces(), e3 = 0, n3 = o3.length; n3 > e3; e3++) if (i2 = o3[e3], i2.attachment === t4) return i2; }, c2.prototype.findRangesForBlockAttribute = function(t4) { var e3, n3, i2, o3, r3, s4, a3; for (r3 = 0, s4 = [], a3 = this.getBlocks(), n3 = 0, i2 = a3.length; i2 > n3; n3++) e3 = a3[n3], o3 = e3.getLength(), e3.hasAttribute(t4) && s4.push([r3, r3 + o3]), r3 += o3; return s4; }, c2.prototype.findRangesForTextAttribute = function(t4, e3) { var n3, i2, o3, r3, s4, a3, u2, c3, l2, h; for (h = (e3 != null ? e3 : {}).withValue, a3 = 0, u2 = [], c3 = [], r3 = function(e4) { return h != null ? e4.getAttribute(t4) === h : e4.hasAttribute(t4); }, l2 = this.getPieces(), n3 = 0, i2 = l2.length; i2 > n3; n3++) s4 = l2[n3], o3 = s4.getLength(), r3(s4) && (u2[1] === a3 ? u2[1] = a3 + o3 : c3.push(u2 = [a3, a3 + o3])), a3 += o3; return c3; }, c2.prototype.locationFromPosition = function(t4) { var e3, n3; return n3 = this.blockList.findIndexAndOffsetAtPosition(Math.max(0, t4)), n3.index != null ? n3 : (e3 = this.getBlocks(), {index: e3.length - 1, offset: e3[e3.length - 1].getLength()}); }, c2.prototype.positionFromLocation = function(t4) { return this.blockList.findPositionAtIndexAndOffset(t4.index, t4.offset); }, c2.prototype.locationRangeFromPosition = function(t4) { return i(this.locationFromPosition(t4)); }, c2.prototype.locationRangeFromRange = function(t4) { var e3, n3, o3, r3; if (t4 = i(t4)) return r3 = t4[0], n3 = t4[1], o3 = this.locationFromPosition(r3), e3 = this.locationFromPosition(n3), i([o3, e3]); }, c2.prototype.rangeFromLocationRange = function(t4) { var e3, n3; return t4 = i(t4), e3 = this.positionFromLocation(t4[0]), o2(t4) || (n3 = this.positionFromLocation(t4[1])), i([e3, n3]); }, c2.prototype.isEqualTo = function(t4) { return this.blockList.isEqualTo(t4 != null ? t4.blockList : void 0); }, c2.prototype.getTexts = function() { var t4, e3, n3, i2, o3; for (i2 = this.getBlocks(), o3 = [], e3 = 0, n3 = i2.length; n3 > e3; e3++) t4 = i2[e3], o3.push(t4.text); return o3; }, c2.prototype.getPieces = function() { var t4, e3, n3, i2, o3; for (n3 = [], i2 = this.getTexts(), t4 = 0, e3 = i2.length; e3 > t4; t4++) o3 = i2[t4], n3.push.apply(n3, o3.getPieces()); return n3; }, c2.prototype.getObjects = function() { return this.getBlocks().concat(this.getTexts()).concat(this.getPieces()); }, c2.prototype.toSerializableDocument = function() { var t4; return t4 = [], this.blockList.eachObject(function(e3) { return t4.push(e3.copyWithText(e3.text.toSerializableText())); }), new this.constructor(t4); }, c2.prototype.toString = function() { return this.blockList.toString(); }, c2.prototype.toJSON = function() { return this.blockList.toJSON(); }, c2.prototype.toConsole = function() { var t4; return JSON.stringify(function() { var e3, n3, i2, o3; for (i2 = this.blockList.toArray(), o3 = [], e3 = 0, n3 = i2.length; n3 > e3; e3++) t4 = i2[e3], o3.push(JSON.parse(t4.text.toConsole())); return o3; }.call(this)); }, c2; }(e2.Object); }.call(this), function() { e2.LineBreakInsertion = function() { function t3(t4) { var e3; this.composition = t4, this.document = this.composition.document, e3 = this.composition.getSelectedRange(), this.startPosition = e3[0], this.endPosition = e3[1], this.startLocation = this.document.locationFromPosition(this.startPosition), this.endLocation = this.document.locationFromPosition(this.endPosition), this.block = this.document.getBlockAtIndex(this.endLocation.index), this.breaksOnReturn = this.block.breaksOnReturn(), this.previousCharacter = this.block.text.getStringAtPosition(this.endLocation.offset - 1), this.nextCharacter = this.block.text.getStringAtPosition(this.endLocation.offset); } return t3.prototype.shouldInsertBlockBreak = function() { return this.block.hasAttributes() && this.block.isListItem() && !this.block.isEmpty() ? this.startLocation.offset !== 0 : this.breaksOnReturn && this.nextCharacter !== "\n"; }, t3.prototype.shouldBreakFormattedBlock = function() { return this.block.hasAttributes() && !this.block.isListItem() && (this.breaksOnReturn && this.nextCharacter === "\n" || this.previousCharacter === "\n"); }, t3.prototype.shouldDecreaseListLevel = function() { return this.block.hasAttributes() && this.block.isListItem() && this.block.isEmpty(); }, t3.prototype.shouldPrependListItem = function() { return this.block.isListItem() && this.startLocation.offset === 0 && !this.block.isEmpty(); }, t3.prototype.shouldRemoveLastBlockAttribute = function() { return this.block.hasAttributes() && !this.block.isListItem() && this.block.isEmpty(); }, t3; }(); }.call(this), function() { var t3, n2, i, o2, r2, s2, a2, u, c2, l, h = function(t4, e3) { function n3() { this.constructor = t4; } for (var i2 in e3) p2.call(e3, i2) && (t4[i2] = e3[i2]); return n3.prototype = e3.prototype, t4.prototype = new n3(), t4.__super__ = e3.prototype, t4; }, p2 = {}.hasOwnProperty; s2 = e2.normalizeRange, c2 = e2.rangesAreEqual, u = e2.rangeIsCollapsed, a2 = e2.objectsAreEqual, t3 = e2.arrayStartsWith, l = e2.summarizeArrayChange, i = e2.getAllAttributeNames, o2 = e2.getBlockConfig, r2 = e2.getTextConfig, n2 = e2.extend, e2.Composition = function(p3) { function d() { this.document = new e2.Document(), this.attachments = [], this.currentAttributes = {}, this.revision = 0; } var f; return h(d, p3), d.prototype.setDocument = function(t4) { var e3; return t4.isEqualTo(this.document) ? void 0 : (this.document = t4, this.refreshAttachments(), this.revision++, (e3 = this.delegate) != null && typeof e3.compositionDidChangeDocument == "function" ? e3.compositionDidChangeDocument(t4) : void 0); }, d.prototype.getSnapshot = function() { return {document: this.document, selectedRange: this.getSelectedRange()}; }, d.prototype.loadSnapshot = function(t4) { var n3, i2, o3, r3; return n3 = t4.document, r3 = t4.selectedRange, (i2 = this.delegate) != null && typeof i2.compositionWillLoadSnapshot == "function" && i2.compositionWillLoadSnapshot(), this.setDocument(n3 != null ? n3 : new e2.Document()), this.setSelection(r3 != null ? r3 : [0, 0]), (o3 = this.delegate) != null && typeof o3.compositionDidLoadSnapshot == "function" ? o3.compositionDidLoadSnapshot() : void 0; }, d.prototype.insertText = function(t4, e3) { var n3, i2, o3, r3; return r3 = (e3 != null ? e3 : {updatePosition: true}).updatePosition, i2 = this.getSelectedRange(), this.setDocument(this.document.insertTextAtRange(t4, i2)), o3 = i2[0], n3 = o3 + t4.getLength(), r3 && this.setSelection(n3), this.notifyDelegateOfInsertionAtRange([o3, n3]); }, d.prototype.insertBlock = function(t4) { var n3; return t4 == null && (t4 = new e2.Block()), n3 = new e2.Document([t4]), this.insertDocument(n3); }, d.prototype.insertDocument = function(t4) { var n3, i2, o3; return t4 == null && (t4 = new e2.Document()), i2 = this.getSelectedRange(), this.setDocument(this.document.insertDocumentAtRange(t4, i2)), o3 = i2[0], n3 = o3 + t4.getLength(), this.setSelection(n3), this.notifyDelegateOfInsertionAtRange([o3, n3]); }, d.prototype.insertString = function(t4, n3) { var i2, o3; return i2 = this.getCurrentTextAttributes(), o3 = e2.Text.textForStringWithAttributes(t4, i2), this.insertText(o3, n3); }, d.prototype.insertBlockBreak = function() { var t4, e3, n3; return e3 = this.getSelectedRange(), this.setDocument(this.document.insertBlockBreakAtRange(e3)), n3 = e3[0], t4 = n3 + 1, this.setSelection(t4), this.notifyDelegateOfInsertionAtRange([n3, t4]); }, d.prototype.insertLineBreak = function() { var t4, n3; return n3 = new e2.LineBreakInsertion(this), n3.shouldDecreaseListLevel() ? (this.decreaseListLevel(), this.setSelection(n3.startPosition)) : n3.shouldPrependListItem() ? (t4 = new e2.Document([n3.block.copyWithoutText()]), this.insertDocument(t4)) : n3.shouldInsertBlockBreak() ? this.insertBlockBreak() : n3.shouldRemoveLastBlockAttribute() ? this.removeLastBlockAttribute() : n3.shouldBreakFormattedBlock() ? this.breakFormattedBlock(n3) : this.insertString("\n"); }, d.prototype.insertHTML = function(t4) { var n3, i2, o3, r3; return n3 = e2.Document.fromHTML(t4), o3 = this.getSelectedRange(), this.setDocument(this.document.mergeDocumentAtRange(n3, o3)), r3 = o3[0], i2 = r3 + n3.getLength() - 1, this.setSelection(i2), this.notifyDelegateOfInsertionAtRange([r3, i2]); }, d.prototype.replaceHTML = function(t4) { var n3, i2, o3; return n3 = e2.Document.fromHTML(t4).copyUsingObjectsFromDocument(this.document), i2 = this.getLocationRange({strict: false}), o3 = this.document.rangeFromLocationRange(i2), this.setDocument(n3), this.setSelection(o3); }, d.prototype.insertFile = function(t4) { return this.insertFiles([t4]); }, d.prototype.insertFiles = function(t4) { var n3, i2, o3, r3, s3, a3; for (i2 = [], r3 = 0, s3 = t4.length; s3 > r3; r3++) o3 = t4[r3], ((a3 = this.delegate) != null ? a3.compositionShouldAcceptFile(o3) : void 0) && (n3 = e2.Attachment.attachmentForFile(o3), i2.push(n3)); return this.insertAttachments(i2); }, d.prototype.insertAttachment = function(t4) { return this.insertAttachments([t4]); }, d.prototype.insertAttachments = function(t4) { var n3, i2, o3, r3, s3, a3, u2, c3, l2; for (c3 = new e2.Text(), r3 = 0, s3 = t4.length; s3 > r3; r3++) n3 = t4[r3], l2 = n3.getType(), a3 = (u2 = e2.config.attachments[l2]) != null ? u2.presentation : void 0, o3 = this.getCurrentTextAttributes(), a3 && (o3.presentation = a3), i2 = e2.Text.textForAttachmentWithAttributes(n3, o3), c3 = c3.appendText(i2); return this.insertText(c3); }, d.prototype.shouldManageDeletingInDirection = function(t4) { var e3; if (e3 = this.getLocationRange(), u(e3)) { if (t4 === "backward" && e3[0].offset === 0) return true; if (this.shouldManageMovingCursorInDirection(t4)) return true; } else if (e3[0].index !== e3[1].index) return true; return false; }, d.prototype.deleteInDirection = function(t4, e3) { var n3, i2, o3, r3, s3, a3, c3, l2; return r3 = (e3 != null ? e3 : {}).length, s3 = this.getLocationRange(), a3 = this.getSelectedRange(), c3 = u(a3), c3 ? o3 = t4 === "backward" && s3[0].offset === 0 : l2 = s3[0].index !== s3[1].index, o3 && this.canDecreaseBlockAttributeLevel() && (i2 = this.getBlock(), i2.isListItem() ? this.decreaseListLevel() : this.decreaseBlockAttributeLevel(), this.setSelection(a3[0]), i2.isEmpty()) ? false : (c3 && (a3 = this.getExpandedRangeInDirection(t4, {length: r3}), t4 === "backward" && (n3 = this.getAttachmentAtRange(a3))), n3 ? (this.editAttachment(n3), false) : (this.setDocument(this.document.removeTextAtRange(a3)), this.setSelection(a3[0]), o3 || l2 ? false : void 0)); }, d.prototype.moveTextFromRange = function(t4) { var e3; return e3 = this.getSelectedRange()[0], this.setDocument(this.document.moveTextFromRangeToPosition(t4, e3)), this.setSelection(e3); }, d.prototype.removeAttachment = function(t4) { var e3; return (e3 = this.document.getRangeOfAttachment(t4)) ? (this.stopEditingAttachment(), this.setDocument(this.document.removeTextAtRange(e3)), this.setSelection(e3[0])) : void 0; }, d.prototype.removeLastBlockAttribute = function() { var t4, e3, n3, i2; return n3 = this.getSelectedRange(), i2 = n3[0], e3 = n3[1], t4 = this.document.getBlockAtPosition(e3), this.removeCurrentAttribute(t4.getLastAttribute()), this.setSelection(i2); }, f = " ", d.prototype.insertPlaceholder = function() { return this.placeholderPosition = this.getPosition(), this.insertString(f); }, d.prototype.selectPlaceholder = function() { return this.placeholderPosition != null ? (this.setSelectedRange([this.placeholderPosition, this.placeholderPosition + f.length]), this.getSelectedRange()) : void 0; }, d.prototype.forgetPlaceholder = function() { return this.placeholderPosition = null; }, d.prototype.hasCurrentAttribute = function(t4) { var e3; return e3 = this.currentAttributes[t4], e3 != null && e3 !== false; }, d.prototype.toggleCurrentAttribute = function(t4) { var e3; return (e3 = !this.currentAttributes[t4]) ? this.setCurrentAttribute(t4, e3) : this.removeCurrentAttribute(t4); }, d.prototype.canSetCurrentAttribute = function(t4) { return o2(t4) ? this.canSetCurrentBlockAttribute(t4) : this.canSetCurrentTextAttribute(t4); }, d.prototype.canSetCurrentTextAttribute = function() { var t4, e3, n3, i2, o3; if (e3 = this.getSelectedDocument()) { for (o3 = e3.getAttachments(), n3 = 0, i2 = o3.length; i2 > n3; n3++) if (t4 = o3[n3], !t4.hasContent()) return false; return true; } }, d.prototype.canSetCurrentBlockAttribute = function() { var t4; if (t4 = this.getBlock()) return !t4.isTerminalBlock(); }, d.prototype.setCurrentAttribute = function(t4, e3) { return o2(t4) ? this.setBlockAttribute(t4, e3) : (this.setTextAttribute(t4, e3), this.currentAttributes[t4] = e3, this.notifyDelegateOfCurrentAttributesChange()); }, d.prototype.setTextAttribute = function(t4, n3) { var i2, o3, r3, s3; if (o3 = this.getSelectedRange()) return r3 = o3[0], i2 = o3[1], r3 !== i2 ? this.setDocument(this.document.addAttributeAtRange(t4, n3, o3)) : t4 === "href" ? (s3 = e2.Text.textForStringWithAttributes(n3, {href: n3}), this.insertText(s3)) : void 0; }, d.prototype.setBlockAttribute = function(t4, e3) { var n3, i2; if (i2 = this.getSelectedRange()) return this.canSetCurrentAttribute(t4) ? (n3 = this.getBlock(), this.setDocument(this.document.applyBlockAttributeAtRange(t4, e3, i2)), this.setSelection(i2)) : void 0; }, d.prototype.removeCurrentAttribute = function(t4) { return o2(t4) ? (this.removeBlockAttribute(t4), this.updateCurrentAttributes()) : (this.removeTextAttribute(t4), delete this.currentAttributes[t4], this.notifyDelegateOfCurrentAttributesChange()); }, d.prototype.removeTextAttribute = function(t4) { var e3; if (e3 = this.getSelectedRange()) return this.setDocument(this.document.removeAttributeAtRange(t4, e3)); }, d.prototype.removeBlockAttribute = function(t4) { var e3; if (e3 = this.getSelectedRange()) return this.setDocument(this.document.removeAttributeAtRange(t4, e3)); }, d.prototype.canDecreaseNestingLevel = function() { var t4; return ((t4 = this.getBlock()) != null ? t4.getNestingLevel() : void 0) > 0; }, d.prototype.canIncreaseNestingLevel = function() { var e3, n3, i2; if (e3 = this.getBlock()) return ((i2 = o2(e3.getLastNestableAttribute())) != null ? i2.listAttribute : 0) ? (n3 = this.getPreviousBlock()) ? t3(n3.getListItemAttributes(), e3.getListItemAttributes()) : void 0 : e3.getNestingLevel() > 0; }, d.prototype.decreaseNestingLevel = function() { var t4; if (t4 = this.getBlock()) return this.setDocument(this.document.replaceBlock(t4, t4.decreaseNestingLevel())); }, d.prototype.increaseNestingLevel = function() { var t4; if (t4 = this.getBlock()) return this.setDocument(this.document.replaceBlock(t4, t4.increaseNestingLevel())); }, d.prototype.canDecreaseBlockAttributeLevel = function() { var t4; return ((t4 = this.getBlock()) != null ? t4.getAttributeLevel() : void 0) > 0; }, d.prototype.decreaseBlockAttributeLevel = function() { var t4, e3; return (t4 = (e3 = this.getBlock()) != null ? e3.getLastAttribute() : void 0) ? this.removeCurrentAttribute(t4) : void 0; }, d.prototype.decreaseListLevel = function() { var t4, e3, n3, i2, o3, r3; for (r3 = this.getSelectedRange()[0], o3 = this.document.locationFromPosition(r3).index, n3 = o3, t4 = this.getBlock().getAttributeLevel(); (e3 = this.document.getBlockAtIndex(n3 + 1)) && e3.isListItem() && e3.getAttributeLevel() > t4; ) n3++; return r3 = this.document.positionFromLocation({index: o3, offset: 0}), i2 = this.document.positionFromLocation({index: n3, offset: 0}), this.setDocument(this.document.removeLastListAttributeAtRange([r3, i2])); }, d.prototype.updateCurrentAttributes = function() { var t4, e3, n3, o3, r3, s3; if (s3 = this.getSelectedRange({ignoreLock: true})) { for (e3 = this.document.getCommonAttributesAtRange(s3), r3 = i(), n3 = 0, o3 = r3.length; o3 > n3; n3++) t4 = r3[n3], e3[t4] || this.canSetCurrentAttribute(t4) || (e3[t4] = false); if (!a2(e3, this.currentAttributes)) return this.currentAttributes = e3, this.notifyDelegateOfCurrentAttributesChange(); } }, d.prototype.getCurrentAttributes = function() { return n2.call({}, this.currentAttributes); }, d.prototype.getCurrentTextAttributes = function() { var t4, e3, n3, i2; t4 = {}, n3 = this.currentAttributes; for (e3 in n3) i2 = n3[e3], i2 !== false && r2(e3) && (t4[e3] = i2); return t4; }, d.prototype.freezeSelection = function() { return this.setCurrentAttribute("frozen", true); }, d.prototype.thawSelection = function() { return this.removeCurrentAttribute("frozen"); }, d.prototype.hasFrozenSelection = function() { return this.hasCurrentAttribute("frozen"); }, d.proxyMethod("getSelectionManager().getPointRange"), d.proxyMethod("getSelectionManager().setLocationRangeFromPointRange"), d.proxyMethod("getSelectionManager().createLocationRangeFromDOMRange"), d.proxyMethod("getSelectionManager().locationIsCursorTarget"), d.proxyMethod("getSelectionManager().selectionIsExpanded"), d.proxyMethod("delegate?.getSelectionManager"), d.prototype.setSelection = function(t4) { var e3, n3; return e3 = this.document.locationRangeFromRange(t4), (n3 = this.delegate) != null ? n3.compositionDidRequestChangingSelectionToLocationRange(e3) : void 0; }, d.prototype.getSelectedRange = function() { var t4; return (t4 = this.getLocationRange()) ? this.document.rangeFromLocationRange(t4) : void 0; }, d.prototype.setSelectedRange = function(t4) { var e3; return e3 = this.document.locationRangeFromRange(t4), this.getSelectionManager().setLocationRange(e3); }, d.prototype.getPosition = function() { var t4; return (t4 = this.getLocationRange()) ? this.document.positionFromLocation(t4[0]) : void 0; }, d.prototype.getLocationRange = function(t4) { var e3, n3; return (e3 = (n3 = this.targetLocationRange) != null ? n3 : this.getSelectionManager().getLocationRange(t4)) != null ? e3 : s2({index: 0, offset: 0}); }, d.prototype.withTargetLocationRange = function(t4, e3) { var n3; this.targetLocationRange = t4; try { n3 = e3(); } finally { this.targetLocationRange = null; } return n3; }, d.prototype.withTargetRange = function(t4, e3) { var n3; return n3 = this.document.locationRangeFromRange(t4), this.withTargetLocationRange(n3, e3); }, d.prototype.withTargetDOMRange = function(t4, e3) { var n3; return n3 = this.createLocationRangeFromDOMRange(t4, {strict: false}), this.withTargetLocationRange(n3, e3); }, d.prototype.getExpandedRangeInDirection = function(t4, e3) { var n3, i2, o3, r3; return i2 = (e3 != null ? e3 : {}).length, o3 = this.getSelectedRange(), r3 = o3[0], n3 = o3[1], t4 === "backward" ? i2 ? r3 -= i2 : r3 = this.translateUTF16PositionFromOffset(r3, -1) : i2 ? n3 += i2 : n3 = this.translateUTF16PositionFromOffset(n3, 1), s2([r3, n3]); }, d.prototype.shouldManageMovingCursorInDirection = function(t4) { var e3; return this.editingAttachment ? true : (e3 = this.getExpandedRangeInDirection(t4), this.getAttachmentAtRange(e3) != null); }, d.prototype.moveCursorInDirection = function(t4) { var e3, n3, i2, o3; return this.editingAttachment ? i2 = this.document.getRangeOfAttachment(this.editingAttachment) : (o3 = this.getSelectedRange(), i2 = this.getExpandedRangeInDirection(t4), n3 = !c2(o3, i2)), this.setSelectedRange(t4 === "backward" ? i2[0] : i2[1]), n3 && (e3 = this.getAttachmentAtRange(i2)) ? this.editAttachment(e3) : void 0; }, d.prototype.expandSelectionInDirection = function(t4, e3) { var n3, i2; return n3 = (e3 != null ? e3 : {}).length, i2 = this.getExpandedRangeInDirection(t4, {length: n3}), this.setSelectedRange(i2); }, d.prototype.expandSelectionForEditing = function() { return this.hasCurrentAttribute("href") ? this.expandSelectionAroundCommonAttribute("href") : void 0; }, d.prototype.expandSelectionAroundCommonAttribute = function(t4) { var e3, n3; return e3 = this.getPosition(), n3 = this.document.getRangeOfCommonAttributeAtPosition(t4, e3), this.setSelectedRange(n3); }, d.prototype.selectionContainsAttachments = function() { var t4; return ((t4 = this.getSelectedAttachments()) != null ? t4.length : void 0) > 0; }, d.prototype.selectionIsInCursorTarget = function() { return this.editingAttachment || this.positionIsCursorTarget(this.getPosition()); }, d.prototype.positionIsCursorTarget = function(t4) { var e3; return (e3 = this.document.locationFromPosition(t4)) ? this.locationIsCursorTarget(e3) : void 0; }, d.prototype.positionIsBlockBreak = function(t4) { var e3; return (e3 = this.document.getPieceAtPosition(t4)) != null ? e3.isBlockBreak() : void 0; }, d.prototype.getSelectedDocument = function() { var t4; return (t4 = this.getSelectedRange()) ? this.document.getDocumentAtRange(t4) : void 0; }, d.prototype.getSelectedAttachments = function() { var t4; return (t4 = this.getSelectedDocument()) != null ? t4.getAttachments() : void 0; }, d.prototype.getAttachments = function() { return this.attachments.slice(0); }, d.prototype.refreshAttachments = function() { var t4, e3, n3, i2, o3, r3, s3, a3, u2, c3, h2, p4; for (n3 = this.document.getAttachments(), a3 = l(this.attachments, n3), t4 = a3.added, h2 = a3.removed, this.attachments = n3, i2 = 0, r3 = h2.length; r3 > i2; i2++) e3 = h2[i2], e3.delegate = null, (u2 = this.delegate) != null && typeof u2.compositionDidRemoveAttachment == "function" && u2.compositionDidRemoveAttachment(e3); for (p4 = [], o3 = 0, s3 = t4.length; s3 > o3; o3++) e3 = t4[o3], e3.delegate = this, p4.push((c3 = this.delegate) != null && typeof c3.compositionDidAddAttachment == "function" ? c3.compositionDidAddAttachment(e3) : void 0); return p4; }, d.prototype.attachmentDidChangeAttributes = function(t4) { var e3; return this.revision++, (e3 = this.delegate) != null && typeof e3.compositionDidEditAttachment == "function" ? e3.compositionDidEditAttachment(t4) : void 0; }, d.prototype.attachmentDidChangePreviewURL = function(t4) { var e3; return this.revision++, (e3 = this.delegate) != null && typeof e3.compositionDidChangeAttachmentPreviewURL == "function" ? e3.compositionDidChangeAttachmentPreviewURL(t4) : void 0; }, d.prototype.editAttachment = function(t4, e3) { var n3; if (t4 !== this.editingAttachment) return this.stopEditingAttachment(), this.editingAttachment = t4, (n3 = this.delegate) != null && typeof n3.compositionDidStartEditingAttachment == "function" ? n3.compositionDidStartEditingAttachment(this.editingAttachment, e3) : void 0; }, d.prototype.stopEditingAttachment = function() { var t4; if (this.editingAttachment) return (t4 = this.delegate) != null && typeof t4.compositionDidStopEditingAttachment == "function" && t4.compositionDidStopEditingAttachment(this.editingAttachment), this.editingAttachment = null; }, d.prototype.updateAttributesForAttachment = function(t4, e3) { return this.setDocument(this.document.updateAttributesForAttachment(t4, e3)); }, d.prototype.removeAttributeForAttachment = function(t4, e3) { return this.setDocument(this.document.removeAttributeForAttachment(t4, e3)); }, d.prototype.breakFormattedBlock = function(t4) { var n3, i2, o3, r3, s3; return i2 = t4.document, n3 = t4.block, r3 = t4.startPosition, s3 = [r3 - 1, r3], n3.getBlockBreakPosition() === t4.startLocation.offset ? (n3.breaksOnReturn() && t4.nextCharacter === "\n" ? r3 += 1 : i2 = i2.removeTextAtRange(s3), s3 = [r3, r3]) : t4.nextCharacter === "\n" ? t4.previousCharacter === "\n" ? s3 = [r3 - 1, r3 + 1] : (s3 = [r3, r3 + 1], r3 += 1) : t4.startLocation.offset - 1 !== 0 && (r3 += 1), o3 = new e2.Document([n3.removeLastAttribute().copyWithoutText()]), this.setDocument(i2.insertDocumentAtRange(o3, s3)), this.setSelection(r3); }, d.prototype.getPreviousBlock = function() { var t4, e3; return (e3 = this.getLocationRange()) && (t4 = e3[0].index, t4 > 0) ? this.document.getBlockAtIndex(t4 - 1) : void 0; }, d.prototype.getBlock = function() { var t4; return (t4 = this.getLocationRange()) ? this.document.getBlockAtIndex(t4[0].index) : void 0; }, d.prototype.getAttachmentAtRange = function(t4) { var n3; return n3 = this.document.getDocumentAtRange(t4), n3.toString() === e2.OBJECT_REPLACEMENT_CHARACTER + "\n" ? n3.getAttachments()[0] : void 0; }, d.prototype.notifyDelegateOfCurrentAttributesChange = function() { var t4; return (t4 = this.delegate) != null && typeof t4.compositionDidChangeCurrentAttributes == "function" ? t4.compositionDidChangeCurrentAttributes(this.currentAttributes) : void 0; }, d.prototype.notifyDelegateOfInsertionAtRange = function(t4) { var e3; return (e3 = this.delegate) != null && typeof e3.compositionDidPerformInsertionAtRange == "function" ? e3.compositionDidPerformInsertionAtRange(t4) : void 0; }, d.prototype.translateUTF16PositionFromOffset = function(t4, e3) { var n3, i2; return i2 = this.document.toUTF16String(), n3 = i2.offsetFromUCS2Offset(t4), i2.offsetToUCS2Offset(n3 + e3); }, d; }(e2.BasicObject); }.call(this), function() { var t3 = function(t4, e3) { function i() { this.constructor = t4; } for (var o2 in e3) n2.call(e3, o2) && (t4[o2] = e3[o2]); return i.prototype = e3.prototype, t4.prototype = new i(), t4.__super__ = e3.prototype, t4; }, n2 = {}.hasOwnProperty; e2.UndoManager = function(e3) { function n3(t4) { this.composition = t4, this.undoEntries = [], this.redoEntries = []; } var i; return t3(n3, e3), n3.prototype.recordUndoEntry = function(t4, e4) { var n4, o2, r2, s2, a2; return s2 = e4 != null ? e4 : {}, o2 = s2.context, n4 = s2.consolidatable, r2 = this.undoEntries.slice(-1)[0], n4 && i(r2, t4, o2) ? void 0 : (a2 = this.createEntry({description: t4, context: o2}), this.undoEntries.push(a2), this.redoEntries = []); }, n3.prototype.undo = function() { var t4, e4; return (e4 = this.undoEntries.pop()) ? (t4 = this.createEntry(e4), this.redoEntries.push(t4), this.composition.loadSnapshot(e4.snapshot)) : void 0; }, n3.prototype.redo = function() { var t4, e4; return (t4 = this.redoEntries.pop()) ? (e4 = this.createEntry(t4), this.undoEntries.push(e4), this.composition.loadSnapshot(t4.snapshot)) : void 0; }, n3.prototype.canUndo = function() { return this.undoEntries.length > 0; }, n3.prototype.canRedo = function() { return this.redoEntries.length > 0; }, n3.prototype.createEntry = function(t4) { var e4, n4, i2; return i2 = t4 != null ? t4 : {}, n4 = i2.description, e4 = i2.context, {description: n4 != null ? n4.toString() : void 0, context: JSON.stringify(e4), snapshot: this.composition.getSnapshot()}; }, i = function(t4, e4, n4) { return (t4 != null ? t4.description : void 0) === (e4 != null ? e4.toString() : void 0) && (t4 != null ? t4.context : void 0) === JSON.stringify(n4); }, n3; }(e2.BasicObject); }.call(this), function() { var t3; e2.attachmentGalleryFilter = function(e3) { var n2; return n2 = new t3(e3), n2.perform(), n2.getSnapshot(); }, t3 = function() { function t4(t5) { this.document = t5.document, this.selectedRange = t5.selectedRange; } var e3, n2, i; return e3 = "attachmentGallery", n2 = "presentation", i = "gallery", t4.prototype.perform = function() { return this.removeBlockAttribute(), this.applyBlockAttribute(); }, t4.prototype.getSnapshot = function() { return {document: this.document, selectedRange: this.selectedRange}; }, t4.prototype.removeBlockAttribute = function() { var t5, n3, i2, o2, r2; for (o2 = this.findRangesOfBlocks(), r2 = [], t5 = 0, n3 = o2.length; n3 > t5; t5++) i2 = o2[t5], r2.push(this.document = this.document.removeAttributeAtRange(e3, i2)); return r2; }, t4.prototype.applyBlockAttribute = function() { var t5, n3, i2, o2, r2, s2; for (i2 = 0, r2 = this.findRangesOfPieces(), s2 = [], t5 = 0, n3 = r2.length; n3 > t5; t5++) o2 = r2[t5], o2[1] - o2[0] > 1 && (o2[0] += i2, o2[1] += i2, this.document.getCharacterAtPosition(o2[1]) !== "\n" && (this.document = this.document.insertBlockBreakAtRange(o2[1]), o2[1] < this.selectedRange[1] && this.moveSelectedRangeForward(), o2[1]++, i2++), o2[0] !== 0 && this.document.getCharacterAtPosition(o2[0] - 1) !== "\n" && (this.document = this.document.insertBlockBreakAtRange(o2[0]), o2[0] < this.selectedRange[0] && this.moveSelectedRangeForward(), o2[0]++, i2++), s2.push(this.document = this.document.applyBlockAttributeAtRange(e3, true, o2))); return s2; }, t4.prototype.findRangesOfBlocks = function() { return this.document.findRangesForBlockAttribute(e3); }, t4.prototype.findRangesOfPieces = function() { return this.document.findRangesForTextAttribute(n2, {withValue: i}); }, t4.prototype.moveSelectedRangeForward = function() { return this.selectedRange[0] += 1, this.selectedRange[1] += 1; }, t4; }(); }.call(this), function() { var t3 = function(t4, e3) { return function() { return t4.apply(e3, arguments); }; }; e2.Editor = function() { function n2(n3, o2, r2) { this.composition = n3, this.selectionManager = o2, this.element = r2, this.insertFiles = t3(this.insertFiles, this), this.undoManager = new e2.UndoManager(this.composition), this.filters = i.slice(0); } var i; return i = [e2.attachmentGalleryFilter], n2.prototype.loadDocument = function(t4) { return this.loadSnapshot({document: t4, selectedRange: [0, 0]}); }, n2.prototype.loadHTML = function(t4) { return t4 == null && (t4 = ""), this.loadDocument(e2.Document.fromHTML(t4, {referenceElement: this.element})); }, n2.prototype.loadJSON = function(t4) { var n3, i2; return n3 = t4.document, i2 = t4.selectedRange, n3 = e2.Document.fromJSON(n3), this.loadSnapshot({document: n3, selectedRange: i2}); }, n2.prototype.loadSnapshot = function(t4) { return this.undoManager = new e2.UndoManager(this.composition), this.composition.loadSnapshot(t4); }, n2.prototype.getDocument = function() { return this.composition.document; }, n2.prototype.getSelectedDocument = function() { return this.composition.getSelectedDocument(); }, n2.prototype.getSnapshot = function() { return this.composition.getSnapshot(); }, n2.prototype.toJSON = function() { return this.getSnapshot(); }, n2.prototype.deleteInDirection = function(t4) { return this.composition.deleteInDirection(t4); }, n2.prototype.insertAttachment = function(t4) { return this.composition.insertAttachment(t4); }, n2.prototype.insertAttachments = function(t4) { return this.composition.insertAttachments(t4); }, n2.prototype.insertDocument = function(t4) { return this.composition.insertDocument(t4); }, n2.prototype.insertFile = function(t4) { return this.composition.insertFile(t4); }, n2.prototype.insertFiles = function(t4) { return this.composition.insertFiles(t4); }, n2.prototype.insertHTML = function(t4) { return this.composition.insertHTML(t4); }, n2.prototype.insertString = function(t4) { return this.composition.insertString(t4); }, n2.prototype.insertText = function(t4) { return this.composition.insertText(t4); }, n2.prototype.insertLineBreak = function() { return this.composition.insertLineBreak(); }, n2.prototype.getSelectedRange = function() { return this.composition.getSelectedRange(); }, n2.prototype.getPosition = function() { return this.composition.getPosition(); }, n2.prototype.getClientRectAtPosition = function(t4) { var e3; return e3 = this.getDocument().locationRangeFromRange([t4, t4 + 1]), this.selectionManager.getClientRectAtLocationRange(e3); }, n2.prototype.expandSelectionInDirection = function(t4) { return this.composition.expandSelectionInDirection(t4); }, n2.prototype.moveCursorInDirection = function(t4) { return this.composition.moveCursorInDirection(t4); }, n2.prototype.setSelectedRange = function(t4) { return this.composition.setSelectedRange(t4); }, n2.prototype.activateAttribute = function(t4, e3) { return e3 == null && (e3 = true), this.composition.setCurrentAttribute(t4, e3); }, n2.prototype.attributeIsActive = function(t4) { return this.composition.hasCurrentAttribute(t4); }, n2.prototype.canActivateAttribute = function(t4) { return this.composition.canSetCurrentAttribute(t4); }, n2.prototype.deactivateAttribute = function(t4) { return this.composition.removeCurrentAttribute(t4); }, n2.prototype.canDecreaseNestingLevel = function() { return this.composition.canDecreaseNestingLevel(); }, n2.prototype.canIncreaseNestingLevel = function() { return this.composition.canIncreaseNestingLevel(); }, n2.prototype.decreaseNestingLevel = function() { return this.canDecreaseNestingLevel() ? this.composition.decreaseNestingLevel() : void 0; }, n2.prototype.increaseNestingLevel = function() { return this.canIncreaseNestingLevel() ? this.composition.increaseNestingLevel() : void 0; }, n2.prototype.canRedo = function() { return this.undoManager.canRedo(); }, n2.prototype.canUndo = function() { return this.undoManager.canUndo(); }, n2.prototype.recordUndoEntry = function(t4, e3) { var n3, i2, o2; return o2 = e3 != null ? e3 : {}, i2 = o2.context, n3 = o2.consolidatable, this.undoManager.recordUndoEntry(t4, {context: i2, consolidatable: n3}); }, n2.prototype.redo = function() { return this.canRedo() ? this.undoManager.redo() : void 0; }, n2.prototype.undo = function() { return this.canUndo() ? this.undoManager.undo() : void 0; }, n2; }(); }.call(this), function() { var t3 = function(t4, e3) { function i() { this.constructor = t4; } for (var o2 in e3) n2.call(e3, o2) && (t4[o2] = e3[o2]); return i.prototype = e3.prototype, t4.prototype = new i(), t4.__super__ = e3.prototype, t4; }, n2 = {}.hasOwnProperty; e2.ManagedAttachment = function(e3) { function n3(t4, e4) { var n4; this.attachmentManager = t4, this.attachment = e4, n4 = this.attachment, this.id = n4.id, this.file = n4.file; } return t3(n3, e3), n3.prototype.remove = function() { return this.attachmentManager.requestRemovalOfAttachment(this.attachment); }, n3.proxyMethod("attachment.getAttribute"), n3.proxyMethod("attachment.hasAttribute"), n3.proxyMethod("attachment.setAttribute"), n3.proxyMethod("attachment.getAttributes"), n3.proxyMethod("attachment.setAttributes"), n3.proxyMethod("attachment.isPending"), n3.proxyMethod("attachment.isPreviewable"), n3.proxyMethod("attachment.getURL"), n3.proxyMethod("attachment.getHref"), n3.proxyMethod("attachment.getFilename"), n3.proxyMethod("attachment.getFilesize"), n3.proxyMethod("attachment.getFormattedFilesize"), n3.proxyMethod("attachment.getExtension"), n3.proxyMethod("attachment.getContentType"), n3.proxyMethod("attachment.getFile"), n3.proxyMethod("attachment.setFile"), n3.proxyMethod("attachment.releaseFile"), n3.proxyMethod("attachment.getUploadProgress"), n3.proxyMethod("attachment.setUploadProgress"), n3; }(e2.BasicObject); }.call(this), function() { var t3 = function(t4, e3) { function i() { this.constructor = t4; } for (var o2 in e3) n2.call(e3, o2) && (t4[o2] = e3[o2]); return i.prototype = e3.prototype, t4.prototype = new i(), t4.__super__ = e3.prototype, t4; }, n2 = {}.hasOwnProperty; e2.AttachmentManager = function(n3) { function i(t4) { var e3, n4, i2; for (t4 == null && (t4 = []), this.managedAttachments = {}, n4 = 0, i2 = t4.length; i2 > n4; n4++) e3 = t4[n4], this.manageAttachment(e3); } return t3(i, n3), i.prototype.getAttachments = function() { var t4, e3, n4, i2; n4 = this.managedAttachments, i2 = []; for (e3 in n4) t4 = n4[e3], i2.push(t4); return i2; }, i.prototype.manageAttachment = function(t4) { var n4, i2; return (n4 = this.managedAttachments)[i2 = t4.id] != null ? n4[i2] : n4[i2] = new e2.ManagedAttachment(this, t4); }, i.prototype.attachmentIsManaged = function(t4) { return t4.id in this.managedAttachments; }, i.prototype.requestRemovalOfAttachment = function(t4) { var e3; return this.attachmentIsManaged(t4) && (e3 = this.delegate) != null && typeof e3.attachmentManagerDidRequestRemovalOfAttachment == "function" ? e3.attachmentManagerDidRequestRemovalOfAttachment(t4) : void 0; }, i.prototype.unmanageAttachment = function(t4) { var e3; return e3 = this.managedAttachments[t4.id], delete this.managedAttachments[t4.id], e3; }, i; }(e2.BasicObject); }.call(this), function() { var t3, n2, i, o2, r2, s2, a2, u, c2, l, h; t3 = e2.elementContainsNode, n2 = e2.findChildIndexOfNode, r2 = e2.nodeIsBlockStart, s2 = e2.nodeIsBlockStartComment, o2 = e2.nodeIsBlockContainer, a2 = e2.nodeIsCursorTarget, u = e2.nodeIsEmptyTextNode, c2 = e2.nodeIsTextNode, i = e2.nodeIsAttachmentElement, l = e2.tagName, h = e2.walkTree, e2.LocationMapper = function() { function e3(t4) { this.element = t4; } var p2, d, f, g; return e3.prototype.findLocationFromContainerAndOffset = function(e4, i2, o3) { var s3, u2, l2, p3, g2, m, v; for (m = (o3 != null ? o3 : {strict: true}).strict, u2 = 0, l2 = false, p3 = {index: 0, offset: 0}, (s3 = this.findAttachmentElementParentForNode(e4)) && (e4 = s3.parentNode, i2 = n2(s3)), v = h(this.element, {usingFilter: f}); v.nextNode(); ) { if (g2 = v.currentNode, g2 === e4 && c2(e4)) { a2(g2) || (p3.offset += i2); break; } if (g2.parentNode === e4) { if (u2++ === i2) break; } else if (!t3(e4, g2) && u2 > 0) break; r2(g2, {strict: m}) ? (l2 && p3.index++, p3.offset = 0, l2 = true) : p3.offset += d(g2); } return p3; }, e3.prototype.findContainerAndOffsetFromLocation = function(t4) { var e4, i2, s3, u2, l2; if (t4.index === 0 && t4.offset === 0) { for (e4 = this.element, u2 = 0; e4.firstChild; ) if (e4 = e4.firstChild, o2(e4)) { u2 = 1; break; } return [e4, u2]; } if (l2 = this.findNodeAndOffsetFromLocation(t4), i2 = l2[0], s3 = l2[1], i2) { if (c2(i2)) d(i2) === 0 ? (e4 = i2.parentNode.parentNode, u2 = n2(i2.parentNode), a2(i2, {name: "right"}) && u2++) : (e4 = i2, u2 = t4.offset - s3); else { if (e4 = i2.parentNode, !r2(i2.previousSibling) && !o2(e4)) for (; i2 === e4.lastChild && (i2 = e4, e4 = e4.parentNode, !o2(e4)); ) ; u2 = n2(i2), t4.offset !== 0 && u2++; } return [e4, u2]; } }, e3.prototype.findNodeAndOffsetFromLocation = function(t4) { var e4, n3, i2, o3, r3, s3, u2, l2; for (u2 = 0, l2 = this.getSignificantNodesForIndex(t4.index), n3 = 0, i2 = l2.length; i2 > n3; n3++) { if (e4 = l2[n3], o3 = d(e4), t4.offset <= u2 + o3) if (c2(e4)) { if (r3 = e4, s3 = u2, t4.offset === s3 && a2(r3)) break; } else r3 || (r3 = e4, s3 = u2); if (u2 += o3, u2 > t4.offset) break; } return [r3, s3]; }, e3.prototype.findAttachmentElementParentForNode = function(t4) { for (; t4 && t4 !== this.element; ) { if (i(t4)) return t4; t4 = t4.parentNode; } }, e3.prototype.getSignificantNodesForIndex = function(t4) { var e4, n3, i2, o3, r3; for (i2 = [], r3 = h(this.element, {usingFilter: p2}), o3 = false; r3.nextNode(); ) if (n3 = r3.currentNode, s2(n3)) { if (typeof e4 != "undefined" && e4 !== null ? e4++ : e4 = 0, e4 === t4) o3 = true; else if (o3) break; } else o3 && i2.push(n3); return i2; }, d = function(t4) { var e4; return t4.nodeType === Node.TEXT_NODE ? a2(t4) ? 0 : (e4 = t4.textContent, e4.length) : l(t4) === "br" || i(t4) ? 1 : 0; }, p2 = function(t4) { return g(t4) === NodeFilter.FILTER_ACCEPT ? f(t4) : NodeFilter.FILTER_REJECT; }, g = function(t4) { return u(t4) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT; }, f = function(t4) { return i(t4.parentNode) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT; }, e3; }(); }.call(this), function() { var t3, n2, i = [].slice; t3 = e2.getDOMRange, n2 = e2.setDOMRange, e2.PointMapper = function() { function e3() { } return e3.prototype.createDOMRangeFromPoint = function(e4) { var i2, o2, r2, s2, a2, u, c2, l; if (c2 = e4.x, l = e4.y, document.caretPositionFromPoint) return a2 = document.caretPositionFromPoint(c2, l), r2 = a2.offsetNode, o2 = a2.offset, i2 = document.createRange(), i2.setStart(r2, o2), i2; if (document.caretRangeFromPoint) return document.caretRangeFromPoint(c2, l); if (document.body.createTextRange) { s2 = t3(); try { u = document.body.createTextRange(), u.moveToPoint(c2, l), u.select(); } catch (h) { } return i2 = t3(), n2(s2), i2; } }, e3.prototype.getClientRectsForDOMRange = function(t4) { var e4, n3, o2; return n3 = i.call(t4.getClientRects()), o2 = n3[0], e4 = n3[n3.length - 1], [o2, e4]; }, e3; }(); }.call(this), function() { var t3, n2 = function(t4, e3) { return function() { return t4.apply(e3, arguments); }; }, i = function(t4, e3) { function n3() { this.constructor = t4; } for (var i2 in e3) o2.call(e3, i2) && (t4[i2] = e3[i2]); return n3.prototype = e3.prototype, t4.prototype = new n3(), t4.__super__ = e3.prototype, t4; }, o2 = {}.hasOwnProperty, r2 = [].indexOf || function(t4) { for (var e3 = 0, n3 = this.length; n3 > e3; e3++) if (e3 in this && this[e3] === t4) return e3; return -1; }; t3 = e2.getDOMRange, e2.SelectionChangeObserver = function(e3) { function o3() { this.run = n2(this.run, this), this.update = n2(this.update, this), this.selectionManagers = []; } var s2; return i(o3, e3), o3.prototype.start = function() { return this.started ? void 0 : (this.started = true, "onselectionchange" in document ? document.addEventListener("selectionchange", this.update, true) : this.run()); }, o3.prototype.stop = function() { return this.started ? (this.started = false, document.removeEventListener("selectionchange", this.update, true)) : void 0; }, o3.prototype.registerSelectionManager = function(t4) { return r2.call(this.selectionManagers, t4) < 0 ? (this.selectionManagers.push(t4), this.start()) : void 0; }, o3.prototype.unregisterSelectionManager = function(t4) { var e4; return this.selectionManagers = function() { var n3, i2, o4, r3; for (o4 = this.selectionManagers, r3 = [], n3 = 0, i2 = o4.length; i2 > n3; n3++) e4 = o4[n3], e4 !== t4 && r3.push(e4); return r3; }.call(this), this.selectionManagers.length === 0 ? this.stop() : void 0; }, o3.prototype.notifySelectionManagersOfSelectionChange = function() { var t4, e4, n3, i2, o4; for (n3 = this.selectionManagers, i2 = [], t4 = 0, e4 = n3.length; e4 > t4; t4++) o4 = n3[t4], i2.push(o4.selectionDidChange()); return i2; }, o3.prototype.update = function() { var e4; return e4 = t3(), s2(e4, this.domRange) ? void 0 : (this.domRange = e4, this.notifySelectionManagersOfSelectionChange()); }, o3.prototype.reset = function() { return this.domRange = null, this.update(); }, o3.prototype.run = function() { return this.started ? (this.update(), requestAnimationFrame(this.run)) : void 0; }, s2 = function(t4, e4) { return (t4 != null ? t4.startContainer : void 0) === (e4 != null ? e4.startContainer : void 0) && (t4 != null ? t4.startOffset : void 0) === (e4 != null ? e4.startOffset : void 0) && (t4 != null ? t4.endContainer : void 0) === (e4 != null ? e4.endContainer : void 0) && (t4 != null ? t4.endOffset : void 0) === (e4 != null ? e4.endOffset : void 0); }, o3; }(e2.BasicObject), e2.selectionChangeObserver == null && (e2.selectionChangeObserver = new e2.SelectionChangeObserver()); }.call(this), function() { var t3, n2, i, o2, r2, s2, a2, u, c2, l, h = function(t4, e3) { return function() { return t4.apply(e3, arguments); }; }, p2 = function(t4, e3) { function n3() { this.constructor = t4; } for (var i2 in e3) d.call(e3, i2) && (t4[i2] = e3[i2]); return n3.prototype = e3.prototype, t4.prototype = new n3(), t4.__super__ = e3.prototype, t4; }, d = {}.hasOwnProperty; i = e2.getDOMSelection, n2 = e2.getDOMRange, l = e2.setDOMRange, t3 = e2.elementContainsNode, s2 = e2.nodeIsCursorTarget, r2 = e2.innerElementIsActive, o2 = e2.handleEvent, a2 = e2.normalizeRange, u = e2.rangeIsCollapsed, c2 = e2.rangesAreEqual, e2.SelectionManager = function(d2) { function f(t4) { this.element = t4, this.selectionDidChange = h(this.selectionDidChange, this), this.didMouseDown = h(this.didMouseDown, this), this.locationMapper = new e2.LocationMapper(this.element), this.pointMapper = new e2.PointMapper(), this.lockCount = 0, o2("mousedown", {onElement: this.element, withCallback: this.didMouseDown}); } return p2(f, d2), f.prototype.getLocationRange = function(t4) { var e3, i2; return t4 == null && (t4 = {}), e3 = t4.strict === false ? this.createLocationRangeFromDOMRange(n2(), {strict: false}) : t4.ignoreLock ? this.currentLocationRange : (i2 = this.lockedLocationRange) != null ? i2 : this.currentLocationRange; }, f.prototype.setLocationRange = function(t4) { var e3; if (!this.lockedLocationRange) return t4 = a2(t4), (e3 = this.createDOMRangeFromLocationRange(t4)) ? (l(e3), this.updateCurrentLocationRange(t4)) : void 0; }, f.prototype.setLocationRangeFromPointRange = function(t4) { var e3, n3; return t4 = a2(t4), n3 = this.getLocationAtPoint(t4[0]), e3 = this.getLocationAtPoint(t4[1]), this.setLocationRange([n3, e3]); }, f.prototype.getClientRectAtLocationRange = function(t4) { var e3; return (e3 = this.createDOMRangeFromLocationRange(t4)) ? this.getClientRectsForDOMRange(e3)[1] : void 0; }, f.prototype.locationIsCursorTarget = function(t4) { var e3, n3, i2; return i2 = this.findNodeAndOffsetFromLocation(t4), e3 = i2[0], n3 = i2[1], s2(e3); }, f.prototype.lock = function() { return this.lockCount++ === 0 ? (this.updateCurrentLocationRange(), this.lockedLocationRange = this.getLocationRange()) : void 0; }, f.prototype.unlock = function() { var t4; return --this.lockCount === 0 && (t4 = this.lockedLocationRange, this.lockedLocationRange = null, t4 != null) ? this.setLocationRange(t4) : void 0; }, f.prototype.clearSelection = function() { var t4; return (t4 = i()) != null ? t4.removeAllRanges() : void 0; }, f.prototype.selectionIsCollapsed = function() { var t4; return ((t4 = n2()) != null ? t4.collapsed : void 0) === true; }, f.prototype.selectionIsExpanded = function() { return !this.selectionIsCollapsed(); }, f.prototype.createLocationRangeFromDOMRange = function(t4, e3) { var n3, i2; if (t4 != null && this.domRangeWithinElement(t4) && (i2 = this.findLocationFromContainerAndOffset(t4.startContainer, t4.startOffset, e3))) return t4.collapsed || (n3 = this.findLocationFromContainerAndOffset(t4.endContainer, t4.endOffset, e3)), a2([i2, n3]); }, f.proxyMethod("locationMapper.findLocationFromContainerAndOffset"), f.proxyMethod("locationMapper.findContainerAndOffsetFromLocation"), f.proxyMethod("locationMapper.findNodeAndOffsetFromLocation"), f.proxyMethod("pointMapper.createDOMRangeFromPoint"), f.proxyMethod("pointMapper.getClientRectsForDOMRange"), f.prototype.didMouseDown = function() { return this.pauseTemporarily(); }, f.prototype.pauseTemporarily = function() { var e3, n3, i2, r3; return this.paused = true, n3 = function(e4) { return function() { var n4, o3, s3; for (e4.paused = false, clearTimeout(r3), o3 = 0, s3 = i2.length; s3 > o3; o3++) n4 = i2[o3], n4.destroy(); return t3(document, e4.element) ? e4.selectionDidChange() : void 0; }; }(this), r3 = setTimeout(n3, 200), i2 = function() { var t4, i3, r4, s3; for (r4 = ["mousemove", "keydown"], s3 = [], t4 = 0, i3 = r4.length; i3 > t4; t4++) e3 = r4[t4], s3.push(o2(e3, {onElement: document, withCallback: n3})); return s3; }(); }, f.prototype.selectionDidChange = function() { return this.paused || r2(this.element) ? void 0 : this.updateCurrentLocationRange(); }, f.prototype.updateCurrentLocationRange = function(t4) { var e3; return (t4 != null ? t4 : t4 = this.createLocationRangeFromDOMRange(n2())) && !c2(t4, this.currentLocationRange) ? (this.currentLocationRange = t4, (e3 = this.delegate) != null && typeof e3.locationRangeDidChange == "function" ? e3.locationRangeDidChange(this.currentLocationRange.slice(0)) : void 0) : void 0; }, f.prototype.createDOMRangeFromLocationRange = function(t4) { var e3, n3, i2, o3; return i2 = this.findContainerAndOffsetFromLocation(t4[0]), n3 = u(t4) ? i2 : (o3 = this.findContainerAndOffsetFromLocation(t4[1])) != null ? o3 : i2, i2 != null && n3 != null ? (e3 = document.createRange(), e3.setStart.apply(e3, i2), e3.setEnd.apply(e3, n3), e3) : void 0; }, f.prototype.getLocationAtPoint = function(t4) { var e3, n3; return (e3 = this.createDOMRangeFromPoint(t4)) && (n3 = this.createLocationRangeFromDOMRange(e3)) != null ? n3[0] : void 0; }, f.prototype.domRangeWithinElement = function(e3) { return e3.collapsed ? t3(this.element, e3.startContainer) : t3(this.element, e3.startContainer) && t3(this.element, e3.endContainer); }, f; }(e2.BasicObject); }.call(this), function() { var t3, n2, i, o2, r2 = function(t4, e3) { function n3() { this.constructor = t4; } for (var i2 in e3) s2.call(e3, i2) && (t4[i2] = e3[i2]); return n3.prototype = e3.prototype, t4.prototype = new n3(), t4.__super__ = e3.prototype, t4; }, s2 = {}.hasOwnProperty, a2 = [].slice; i = e2.rangeIsCollapsed, o2 = e2.rangesAreEqual, n2 = e2.objectsAreEqual, t3 = e2.getBlockConfig, e2.EditorController = function(s3) { function u(t4) { var n3, i2; this.editorElement = t4.editorElement, n3 = t4.document, i2 = t4.html, this.selectionManager = new e2.SelectionManager(this.editorElement), this.selectionManager.delegate = this, this.composition = new e2.Composition(), this.composition.delegate = this, this.attachmentManager = new e2.AttachmentManager(this.composition.getAttachments()), this.attachmentManager.delegate = this, this.inputController = new e2["Level" + e2.config.input.getLevel() + "InputController"](this.editorElement), this.inputController.delegate = this, this.inputController.responder = this.composition, this.compositionController = new e2.CompositionController(this.editorElement, this.composition), this.compositionController.delegate = this, this.toolbarController = new e2.ToolbarController(this.editorElement.toolbarElement), this.toolbarController.delegate = this, this.editor = new e2.Editor(this.composition, this.selectionManager, this.editorElement), n3 != null ? this.editor.loadDocument(n3) : this.editor.loadHTML(i2); } var c2; return r2(u, s3), u.prototype.registerSelectionManager = function() { return e2.selectionChangeObserver.registerSelectionManager(this.selectionManager); }, u.prototype.unregisterSelectionManager = function() { return e2.selectionChangeObserver.unregisterSelectionManager(this.selectionManager); }, u.prototype.render = function() { return this.compositionController.render(); }, u.prototype.reparse = function() { return this.composition.replaceHTML(this.editorElement.innerHTML); }, u.prototype.compositionDidChangeDocument = function() { return this.notifyEditorElement("document-change"), this.handlingInput ? void 0 : this.render(); }, u.prototype.compositionDidChangeCurrentAttributes = function(t4) { return this.currentAttributes = t4, this.toolbarController.updateAttributes(this.currentAttributes), this.updateCurrentActions(), this.notifyEditorElement("attributes-change", {attributes: this.currentAttributes}); }, u.prototype.compositionDidPerformInsertionAtRange = function(t4) { return this.pasting ? this.pastedRange = t4 : void 0; }, u.prototype.compositionShouldAcceptFile = function(t4) { return this.notifyEditorElement("file-accept", {file: t4}); }, u.prototype.compositionDidAddAttachment = function(t4) { var e3; return e3 = this.attachmentManager.manageAttachment(t4), this.notifyEditorElement("attachment-add", {attachment: e3}); }, u.prototype.compositionDidEditAttachment = function(t4) { var e3; return this.compositionController.rerenderViewForObject(t4), e3 = this.attachmentManager.manageAttachment(t4), this.notifyEditorElement("attachment-edit", {attachment: e3}), this.notifyEditorElement("change"); }, u.prototype.compositionDidChangeAttachmentPreviewURL = function(t4) { return this.compositionController.invalidateViewForObject(t4), this.notifyEditorElement("change"); }, u.prototype.compositionDidRemoveAttachment = function(t4) { var e3; return e3 = this.attachmentManager.unmanageAttachment(t4), this.notifyEditorElement("attachment-remove", {attachment: e3}); }, u.prototype.compositionDidStartEditingAttachment = function(t4, e3) { return this.attachmentLocationRange = this.composition.document.getLocationRangeOfAttachment(t4), this.compositionController.installAttachmentEditorForAttachment(t4, e3), this.selectionManager.setLocationRange(this.attachmentLocationRange); }, u.prototype.compositionDidStopEditingAttachment = function() { return this.compositionController.uninstallAttachmentEditor(), this.attachmentLocationRange = null; }, u.prototype.compositionDidRequestChangingSelectionToLocationRange = function(t4) { return !this.loadingSnapshot || this.isFocused() ? (this.requestedLocationRange = t4, this.compositionRevisionWhenLocationRangeRequested = this.composition.revision, this.handlingInput ? void 0 : this.render()) : void 0; }, u.prototype.compositionWillLoadSnapshot = function() { return this.loadingSnapshot = true; }, u.prototype.compositionDidLoadSnapshot = function() { return this.compositionController.refreshViewCache(), this.render(), this.loadingSnapshot = false; }, u.prototype.getSelectionManager = function() { return this.selectionManager; }, u.proxyMethod("getSelectionManager().setLocationRange"), u.proxyMethod("getSelectionManager().getLocationRange"), u.prototype.attachmentManagerDidRequestRemovalOfAttachment = function(t4) { return this.removeAttachment(t4); }, u.prototype.compositionControllerWillSyncDocumentView = function() { return this.inputController.editorWillSyncDocumentView(), this.selectionManager.lock(), this.selectionManager.clearSelection(); }, u.prototype.compositionControllerDidSyncDocumentView = function() { return this.inputController.editorDidSyncDocumentView(), this.selectionManager.unlock(), this.updateCurrentActions(), this.notifyEditorElement("sync"); }, u.prototype.compositionControllerDidRender = function() { return this.requestedLocationRange != null && (this.compositionRevisionWhenLocationRangeRequested === this.composition.revision && this.selectionManager.setLocationRange(this.requestedLocationRange), this.requestedLocationRange = null, this.compositionRevisionWhenLocationRangeRequested = null), this.renderedCompositionRevision !== this.composition.revision && (this.runEditorFilters(), this.composition.updateCurrentAttributes(), this.notifyEditorElement("render")), this.renderedCompositionRevision = this.composition.revision; }, u.prototype.compositionControllerDidFocus = function() { return this.isFocusedInvisibly() && this.setLocationRange({index: 0, offset: 0}), this.toolbarController.hideDialog(), this.notifyEditorElement("focus"); }, u.prototype.compositionControllerDidBlur = function() { return this.notifyEditorElement("blur"); }, u.prototype.compositionControllerDidSelectAttachment = function(t4, e3) { return this.toolbarController.hideDialog(), this.composition.editAttachment(t4, e3); }, u.prototype.compositionControllerDidRequestDeselectingAttachment = function(t4) { var e3, n3; return e3 = (n3 = this.attachmentLocationRange) != null ? n3 : this.composition.document.getLocationRangeOfAttachment(t4), this.selectionManager.setLocationRange(e3[1]); }, u.prototype.compositionControllerWillUpdateAttachment = function(t4) { return this.editor.recordUndoEntry("Edit Attachment", {context: t4.id, consolidatable: true}); }, u.prototype.compositionControllerDidRequestRemovalOfAttachment = function(t4) { return this.removeAttachment(t4); }, u.prototype.inputControllerWillHandleInput = function() { return this.handlingInput = true, this.requestedRender = false; }, u.prototype.inputControllerDidRequestRender = function() { return this.requestedRender = true; }, u.prototype.inputControllerDidHandleInput = function() { return this.handlingInput = false, this.requestedRender ? (this.requestedRender = false, this.render()) : void 0; }, u.prototype.inputControllerDidAllowUnhandledInput = function() { return this.notifyEditorElement("change"); }, u.prototype.inputControllerDidRequestReparse = function() { return this.reparse(); }, u.prototype.inputControllerWillPerformTyping = function() { return this.recordTypingUndoEntry(); }, u.prototype.inputControllerWillPerformFormatting = function(t4) { return this.recordFormattingUndoEntry(t4); }, u.prototype.inputControllerWillCutText = function() { return this.editor.recordUndoEntry("Cut"); }, u.prototype.inputControllerWillPaste = function(t4) { return this.editor.recordUndoEntry("Paste"), this.pasting = true, this.notifyEditorElement("before-paste", {paste: t4}); }, u.prototype.inputControllerDidPaste = function(t4) { return t4.range = this.pastedRange, this.pastedRange = null, this.pasting = null, this.notifyEditorElement("paste", {paste: t4}); }, u.prototype.inputControllerWillMoveText = function() { return this.editor.recordUndoEntry("Move"); }, u.prototype.inputControllerWillAttachFiles = function() { return this.editor.recordUndoEntry("Drop Files"); }, u.prototype.inputControllerWillPerformUndo = function() { return this.editor.undo(); }, u.prototype.inputControllerWillPerformRedo = function() { return this.editor.redo(); }, u.prototype.inputControllerDidReceiveKeyboardCommand = function(t4) { return this.toolbarController.applyKeyboardCommand(t4); }, u.prototype.inputControllerDidStartDrag = function() { return this.locationRangeBeforeDrag = this.selectionManager.getLocationRange(); }, u.prototype.inputControllerDidReceiveDragOverPoint = function(t4) { return this.selectionManager.setLocationRangeFromPointRange(t4); }, u.prototype.inputControllerDidCancelDrag = function() { return this.selectionManager.setLocationRange(this.locationRangeBeforeDrag), this.locationRangeBeforeDrag = null; }, u.prototype.locationRangeDidChange = function(t4) { return this.composition.updateCurrentAttributes(), this.updateCurrentActions(), this.attachmentLocationRange && !o2(this.attachmentLocationRange, t4) && this.composition.stopEditingAttachment(), this.notifyEditorElement("selection-change"); }, u.prototype.toolbarDidClickButton = function() { return this.getLocationRange() ? void 0 : this.setLocationRange({index: 0, offset: 0}); }, u.prototype.toolbarDidInvokeAction = function(t4) { return this.invokeAction(t4); }, u.prototype.toolbarDidToggleAttribute = function(t4) { return this.recordFormattingUndoEntry(t4), this.composition.toggleCurrentAttribute(t4), this.render(), this.selectionFrozen ? void 0 : this.editorElement.focus(); }, u.prototype.toolbarDidUpdateAttribute = function(t4, e3) { return this.recordFormattingUndoEntry(t4), this.composition.setCurrentAttribute(t4, e3), this.render(), this.selectionFrozen ? void 0 : this.editorElement.focus(); }, u.prototype.toolbarDidRemoveAttribute = function(t4) { return this.recordFormattingUndoEntry(t4), this.composition.removeCurrentAttribute(t4), this.render(), this.selectionFrozen ? void 0 : this.editorElement.focus(); }, u.prototype.toolbarWillShowDialog = function() { return this.composition.expandSelectionForEditing(), this.freezeSelection(); }, u.prototype.toolbarDidShowDialog = function(t4) { return this.notifyEditorElement("toolbar-dialog-show", {dialogName: t4}); }, u.prototype.toolbarDidHideDialog = function(t4) { return this.thawSelection(), this.editorElement.focus(), this.notifyEditorElement("toolbar-dialog-hide", {dialogName: t4}); }, u.prototype.freezeSelection = function() { return this.selectionFrozen ? void 0 : (this.selectionManager.lock(), this.composition.freezeSelection(), this.selectionFrozen = true, this.render()); }, u.prototype.thawSelection = function() { return this.selectionFrozen ? (this.composition.thawSelection(), this.selectionManager.unlock(), this.selectionFrozen = false, this.render()) : void 0; }, u.prototype.actions = {undo: {test: function() { return this.editor.canUndo(); }, perform: function() { return this.editor.undo(); }}, redo: {test: function() { return this.editor.canRedo(); }, perform: function() { return this.editor.redo(); }}, link: {test: function() { return this.editor.canActivateAttribute("href"); }}, increaseNestingLevel: {test: function() { return this.editor.canIncreaseNestingLevel(); }, perform: function() { return this.editor.increaseNestingLevel() && this.render(); }}, decreaseNestingLevel: {test: function() { return this.editor.canDecreaseNestingLevel(); }, perform: function() { return this.editor.decreaseNestingLevel() && this.render(); }}, attachFiles: {test: function() { return true; }, perform: function() { return e2.config.input.pickFiles(this.editor.insertFiles); }}}, u.prototype.canInvokeAction = function(t4) { var e3, n3; return this.actionIsExternal(t4) ? true : !!((e3 = this.actions[t4]) != null && (n3 = e3.test) != null ? n3.call(this) : void 0); }, u.prototype.invokeAction = function(t4) { var e3, n3; return this.actionIsExternal(t4) ? this.notifyEditorElement("action-invoke", {actionName: t4}) : (e3 = this.actions[t4]) != null && (n3 = e3.perform) != null ? n3.call(this) : void 0; }, u.prototype.actionIsExternal = function(t4) { return /^x-./.test(t4); }, u.prototype.getCurrentActions = function() { var t4, e3; e3 = {}; for (t4 in this.actions) e3[t4] = this.canInvokeAction(t4); return e3; }, u.prototype.updateCurrentActions = function() { var t4; return t4 = this.getCurrentActions(), n2(t4, this.currentActions) ? void 0 : (this.currentActions = t4, this.toolbarController.updateActions(this.currentActions), this.notifyEditorElement("actions-change", {actions: this.currentActions})); }, u.prototype.runEditorFilters = function() { var t4, e3, n3, i2, o3, r3, s4, a3; for (a3 = this.composition.getSnapshot(), o3 = this.editor.filters, n3 = 0, i2 = o3.length; i2 > n3; n3++) e3 = o3[n3], t4 = a3.document, s4 = a3.selectedRange, a3 = (r3 = e3.call(this.editor, a3)) != null ? r3 : {}, a3.document == null && (a3.document = t4), a3.selectedRange == null && (a3.selectedRange = s4); return c2(a3, this.composition.getSnapshot()) ? void 0 : this.composition.loadSnapshot(a3); }, c2 = function(t4, e3) { return o2(t4.selectedRange, e3.selectedRange) && t4.document.isEqualTo(e3.document); }, u.prototype.updateInputElement = function() { var t4, n3; return t4 = this.compositionController.getSerializableElement(), n3 = e2.serializeToContentType(t4, "text/html"), this.editorElement.setInputElementValue(n3); }, u.prototype.notifyEditorElement = function(t4, e3) { switch (t4) { case "document-change": this.documentChangedSinceLastRender = true; break; case "render": this.documentChangedSinceLastRender && (this.documentChangedSinceLastRender = false, this.notifyEditorElement("change")); break; case "change": case "attachment-add": case "attachment-edit": case "attachment-remove": this.updateInputElement(); } return this.editorElement.notify(t4, e3); }, u.prototype.removeAttachment = function(t4) { return this.editor.recordUndoEntry("Delete Attachment"), this.composition.removeAttachment(t4), this.render(); }, u.prototype.recordFormattingUndoEntry = function(e3) { var n3, o3; return n3 = t3(e3), o3 = this.selectionManager.getLocationRange(), n3 || !i(o3) ? this.editor.recordUndoEntry("Formatting", {context: this.getUndoContext(), consolidatable: true}) : void 0; }, u.prototype.recordTypingUndoEntry = function() { return this.editor.recordUndoEntry("Typing", {context: this.getUndoContext(this.currentAttributes), consolidatable: true}); }, u.prototype.getUndoContext = function() { var t4; return t4 = 1 <= arguments.length ? a2.call(arguments, 0) : [], [this.getLocationContext(), this.getTimeContext()].concat(a2.call(t4)); }, u.prototype.getLocationContext = function() { var t4; return t4 = this.selectionManager.getLocationRange(), i(t4) ? t4[0].index : t4; }, u.prototype.getTimeContext = function() { return e2.config.undoInterval > 0 ? Math.floor(new Date().getTime() / e2.config.undoInterval) : 0; }, u.prototype.isFocused = function() { var t4; return this.editorElement === ((t4 = this.editorElement.ownerDocument) != null ? t4.activeElement : void 0); }, u.prototype.isFocusedInvisibly = function() { return this.isFocused() && !this.getLocationRange(); }, u; }(e2.Controller); }.call(this), function() { var t3, n2, i, o2, r2, s2, a2, u = [].indexOf || function(t4) { for (var e3 = 0, n3 = this.length; n3 > e3; e3++) if (e3 in this && this[e3] === t4) return e3; return -1; }; n2 = e2.browser, s2 = e2.makeElement, a2 = e2.triggerEvent, o2 = e2.handleEvent, r2 = e2.handleEventOnce, i = e2.findClosestElementFromNode, t3 = e2.AttachmentView.attachmentSelector, e2.registerElement("trix-editor", function() { var c2, l, h, p2, d, f, g, m, v; return g = 0, l = function(t4) { return !document.querySelector(":focus") && t4.hasAttribute("autofocus") && document.querySelector("[autofocus]") === t4 ? t4.focus() : void 0; }, m = function(t4) { return t4.hasAttribute("contenteditable") ? void 0 : (t4.setAttribute("contenteditable", ""), r2("focus", {onElement: t4, withCallback: function() { return h(t4); }})); }, h = function(t4) { return d(t4), v(t4); }, d = function(t4) { return (typeof document.queryCommandSupported == "function" ? document.queryCommandSupported("enableObjectResizing") : void 0) ? (document.execCommand("enableObjectResizing", false, false), o2("mscontrolselect", {onElement: t4, preventDefault: true})) : void 0; }, v = function() { var t4; return (typeof document.queryCommandSupported == "function" ? document.queryCommandSupported("DefaultParagraphSeparator") : void 0) && (t4 = e2.config.blockAttributes["default"].tagName, t4 === "div" || t4 === "p") ? document.execCommand("DefaultParagraphSeparator", false, t4) : void 0; }, c2 = function(t4) { return t4.hasAttribute("role") ? void 0 : t4.setAttribute("role", "textbox"); }, f = function(t4) { var e3; if (!t4.hasAttribute("aria-label") && !t4.hasAttribute("aria-labelledby")) return (e3 = function() { var e4, n3, i2; return i2 = function() { var n4, i3, o3, r3; for (o3 = t4.labels, r3 = [], n4 = 0, i3 = o3.length; i3 > n4; n4++) e4 = o3[n4], e4.contains(t4) || r3.push(e4.textContent); return r3; }(), (n3 = i2.join(" ")) ? t4.setAttribute("aria-label", n3) : t4.removeAttribute("aria-label"); })(), o2("focus", {onElement: t4, withCallback: e3}); }, p2 = function() { return n2.forcesObjectResizing ? {display: "inline", width: "auto"} : {display: "inline-block", width: "1px"}; }(), {defaultCSS: "%t {\n display: block;\n}\n\n%t:empty:not(:focus)::before {\n content: attr(placeholder);\n color: graytext;\n cursor: text;\n pointer-events: none;\n}\n\n%t a[contenteditable=false] {\n cursor: text;\n}\n\n%t img {\n max-width: 100%;\n height: auto;\n}\n\n%t " + t3 + " figcaption textarea {\n resize: none;\n}\n\n%t " + t3 + " figcaption textarea.trix-autoresize-clone {\n position: absolute;\n left: -9999px;\n max-height: 0px;\n}\n\n%t " + t3 + " figcaption[data-trix-placeholder]:empty::before {\n content: attr(data-trix-placeholder);\n color: graytext;\n}\n\n%t [data-trix-cursor-target] {\n display: " + p2.display + " !important;\n width: " + p2.width + " !important;\n padding: 0 !important;\n margin: 0 !important;\n border: none !important;\n}\n\n%t [data-trix-cursor-target=left] {\n vertical-align: top !important;\n margin-left: -1px !important;\n}\n\n%t [data-trix-cursor-target=right] {\n vertical-align: bottom !important;\n margin-right: -1px !important;\n}", trixId: {get: function() { return this.hasAttribute("trix-id") ? this.getAttribute("trix-id") : (this.setAttribute("trix-id", ++g), this.trixId); }}, labels: {get: function() { var t4, e3, n3; return e3 = [], this.id && this.ownerDocument && e3.push.apply(e3, this.ownerDocument.querySelectorAll("label[for='" + this.id + "']")), (t4 = i(this, {matchingSelector: "label"})) && ((n3 = t4.control) === this || n3 === null) && e3.push(t4), e3; }}, toolbarElement: {get: function() { var t4, e3, n3; return this.hasAttribute("toolbar") ? (e3 = this.ownerDocument) != null ? e3.getElementById(this.getAttribute("toolbar")) : void 0 : this.parentNode ? (n3 = "trix-toolbar-" + this.trixId, this.setAttribute("toolbar", n3), t4 = s2("trix-toolbar", {id: n3}), this.parentNode.insertBefore(t4, this), t4) : void 0; }}, inputElement: {get: function() { var t4, e3, n3; return this.hasAttribute("input") ? (n3 = this.ownerDocument) != null ? n3.getElementById(this.getAttribute("input")) : void 0 : this.parentNode ? (e3 = "trix-input-" + this.trixId, this.setAttribute("input", e3), t4 = s2("input", {type: "hidden", id: e3}), this.parentNode.insertBefore(t4, this.nextElementSibling), t4) : void 0; }}, editor: {get: function() { var t4; return (t4 = this.editorController) != null ? t4.editor : void 0; }}, name: {get: function() { var t4; return (t4 = this.inputElement) != null ? t4.name : void 0; }}, value: {get: function() { var t4; return (t4 = this.inputElement) != null ? t4.value : void 0; }, set: function(t4) { var e3; return this.defaultValue = t4, (e3 = this.editor) != null ? e3.loadHTML(this.defaultValue) : void 0; }}, notify: function(t4, e3) { return this.editorController ? a2("trix-" + t4, {onElement: this, attributes: e3}) : void 0; }, setInputElementValue: function(t4) { var e3; return (e3 = this.inputElement) != null ? e3.value = t4 : void 0; }, initialize: function() { return this.hasAttribute("data-trix-internal") ? void 0 : (m(this), c2(this), f(this)); }, connect: function() { return this.hasAttribute("data-trix-internal") ? void 0 : (this.editorController || (a2("trix-before-initialize", {onElement: this}), this.editorController = new e2.EditorController({editorElement: this, html: this.defaultValue = this.value}), requestAnimationFrame(function(t4) { return function() { return a2("trix-initialize", {onElement: t4}); }; }(this))), this.editorController.registerSelectionManager(), this.registerResetListener(), this.registerClickListener(), l(this)); }, disconnect: function() { var t4; return (t4 = this.editorController) != null && t4.unregisterSelectionManager(), this.unregisterResetListener(), this.unregisterClickListener(); }, registerResetListener: function() { return this.resetListener = this.resetBubbled.bind(this), window.addEventListener("reset", this.resetListener, false); }, unregisterResetListener: function() { return window.removeEventListener("reset", this.resetListener, false); }, registerClickListener: function() { return this.clickListener = this.clickBubbled.bind(this), window.addEventListener("click", this.clickListener, false); }, unregisterClickListener: function() { return window.removeEventListener("click", this.clickListener, false); }, resetBubbled: function(t4) { var e3; if (!t4.defaultPrevented && t4.target === ((e3 = this.inputElement) != null ? e3.form : void 0)) return this.reset(); }, clickBubbled: function(t4) { var e3; if (!(t4.defaultPrevented || this.contains(t4.target) || !(e3 = i(t4.target, {matchingSelector: "label"})) || u.call(this.labels, e3) < 0)) return this.focus(); }, reset: function() { return this.value = this.defaultValue; }}; }()); }.call(this), function() { }.call(this); }).call(this), typeof module == "object" && module.exports ? module.exports = e2 : typeof define == "function" && define.amd && define(e2); }.call(exports); }); // node_modules/choices.js/public/assets/scripts/choices.js var require_choices = __commonJS((exports, module) => { /*! choices.js v10.2.0 | © 2022 Josh Johnson | https://github.com/jshjohnson/Choices#readme */ (function webpackUniversalModuleDefinition(root2, factory) { if (typeof exports === "object" && typeof module === "object") module.exports = factory(); else if (typeof define === "function" && define.amd) define([], factory); else if (typeof exports === "object") exports["Choices"] = factory(); else root2["Choices"] = factory(); })(window, function() { return function() { "use strict"; var __webpack_modules__ = { 282: function(__unused_webpack_module, exports2, __webpack_require__2) { Object.defineProperty(exports2, "__esModule", { value: true }); exports2.clearChoices = exports2.activateChoices = exports2.filterChoices = exports2.addChoice = void 0; var constants_1 = __webpack_require__2(883); var addChoice = function(_a) { var value = _a.value, label = _a.label, id = _a.id, groupId = _a.groupId, disabled = _a.disabled, elementId = _a.elementId, customProperties = _a.customProperties, placeholder = _a.placeholder, keyCode = _a.keyCode; return { type: constants_1.ACTION_TYPES.ADD_CHOICE, value, label, id, groupId, disabled, elementId, customProperties, placeholder, keyCode }; }; exports2.addChoice = addChoice; var filterChoices = function(results) { return { type: constants_1.ACTION_TYPES.FILTER_CHOICES, results }; }; exports2.filterChoices = filterChoices; var activateChoices = function(active) { if (active === void 0) { active = true; } return { type: constants_1.ACTION_TYPES.ACTIVATE_CHOICES, active }; }; exports2.activateChoices = activateChoices; var clearChoices = function() { return { type: constants_1.ACTION_TYPES.CLEAR_CHOICES }; }; exports2.clearChoices = clearChoices; }, 783: function(__unused_webpack_module, exports2, __webpack_require__2) { Object.defineProperty(exports2, "__esModule", { value: true }); exports2.addGroup = void 0; var constants_1 = __webpack_require__2(883); var addGroup = function(_a) { var value = _a.value, id = _a.id, active = _a.active, disabled = _a.disabled; return { type: constants_1.ACTION_TYPES.ADD_GROUP, value, id, active, disabled }; }; exports2.addGroup = addGroup; }, 464: function(__unused_webpack_module, exports2, __webpack_require__2) { Object.defineProperty(exports2, "__esModule", { value: true }); exports2.highlightItem = exports2.removeItem = exports2.addItem = void 0; var constants_1 = __webpack_require__2(883); var addItem = function(_a) { var value = _a.value, label = _a.label, id = _a.id, choiceId = _a.choiceId, groupId = _a.groupId, customProperties = _a.customProperties, placeholder = _a.placeholder, keyCode = _a.keyCode; return { type: constants_1.ACTION_TYPES.ADD_ITEM, value, label, id, choiceId, groupId, customProperties, placeholder, keyCode }; }; exports2.addItem = addItem; var removeItem = function(id, choiceId) { return { type: constants_1.ACTION_TYPES.REMOVE_ITEM, id, choiceId }; }; exports2.removeItem = removeItem; var highlightItem = function(id, highlighted) { return { type: constants_1.ACTION_TYPES.HIGHLIGHT_ITEM, id, highlighted }; }; exports2.highlightItem = highlightItem; }, 137: function(__unused_webpack_module, exports2, __webpack_require__2) { Object.defineProperty(exports2, "__esModule", { value: true }); exports2.setIsLoading = exports2.resetTo = exports2.clearAll = void 0; var constants_1 = __webpack_require__2(883); var clearAll = function() { return { type: constants_1.ACTION_TYPES.CLEAR_ALL }; }; exports2.clearAll = clearAll; var resetTo = function(state2) { return { type: constants_1.ACTION_TYPES.RESET_TO, state: state2 }; }; exports2.resetTo = resetTo; var setIsLoading = function(isLoading) { return { type: constants_1.ACTION_TYPES.SET_IS_LOADING, isLoading }; }; exports2.setIsLoading = setIsLoading; }, 373: function(__unused_webpack_module, exports2, __webpack_require__2) { var __spreadArray = this && this.__spreadArray || function(to, from, pack) { if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { if (ar || !(i in from)) { if (!ar) ar = Array.prototype.slice.call(from, 0, i); ar[i] = from[i]; } } return to.concat(ar || Array.prototype.slice.call(from)); }; var __importDefault = this && this.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { default: mod }; }; Object.defineProperty(exports2, "__esModule", { value: true }); var deepmerge_1 = __importDefault(__webpack_require__2(996)); var fuse_js_1 = __importDefault(__webpack_require__2(221)); var choices_1 = __webpack_require__2(282); var groups_1 = __webpack_require__2(783); var items_1 = __webpack_require__2(464); var misc_1 = __webpack_require__2(137); var components_1 = __webpack_require__2(520); var constants_1 = __webpack_require__2(883); var defaults_1 = __webpack_require__2(789); var utils_1 = __webpack_require__2(799); var reducers_1 = __webpack_require__2(655); var store_1 = __importDefault(__webpack_require__2(744)); var templates_1 = __importDefault(__webpack_require__2(686)); var IS_IE11 = "-ms-scroll-limit" in document.documentElement.style && "-ms-ime-align" in document.documentElement.style; var USER_DEFAULTS = {}; var Choices2 = function() { function Choices3(element, userConfig) { if (element === void 0) { element = "[data-choice]"; } if (userConfig === void 0) { userConfig = {}; } var _this = this; if (userConfig.allowHTML === void 0) { console.warn("Deprecation warning: allowHTML will default to false in a future release. To render HTML in Choices, you will need to set it to true. Setting allowHTML will suppress this message."); } this.config = deepmerge_1.default.all([defaults_1.DEFAULT_CONFIG, Choices3.defaults.options, userConfig], { arrayMerge: function(_, sourceArray) { return __spreadArray([], sourceArray, true); } }); var invalidConfigOptions = (0, utils_1.diff)(this.config, defaults_1.DEFAULT_CONFIG); if (invalidConfigOptions.length) { console.warn("Unknown config option(s) passed", invalidConfigOptions.join(", ")); } var passedElement = typeof element === "string" ? document.querySelector(element) : element; if (!(passedElement instanceof HTMLInputElement || passedElement instanceof HTMLSelectElement)) { throw TypeError("Expected one of the following types text|select-one|select-multiple"); } this._isTextElement = passedElement.type === constants_1.TEXT_TYPE; this._isSelectOneElement = passedElement.type === constants_1.SELECT_ONE_TYPE; this._isSelectMultipleElement = passedElement.type === constants_1.SELECT_MULTIPLE_TYPE; this._isSelectElement = this._isSelectOneElement || this._isSelectMultipleElement; this.config.searchEnabled = this._isSelectMultipleElement || this.config.searchEnabled; if (!["auto", "always"].includes("".concat(this.config.renderSelectedChoices))) { this.config.renderSelectedChoices = "auto"; } if (userConfig.addItemFilter && typeof userConfig.addItemFilter !== "function") { var re = userConfig.addItemFilter instanceof RegExp ? userConfig.addItemFilter : new RegExp(userConfig.addItemFilter); this.config.addItemFilter = re.test.bind(re); } if (this._isTextElement) { this.passedElement = new components_1.WrappedInput({ element: passedElement, classNames: this.config.classNames, delimiter: this.config.delimiter }); } else { this.passedElement = new components_1.WrappedSelect({ element: passedElement, classNames: this.config.classNames, template: function(data3) { return _this._templates.option(data3); } }); } this.initialised = false; this._store = new store_1.default(); this._initialState = reducers_1.defaultState; this._currentState = reducers_1.defaultState; this._prevState = reducers_1.defaultState; this._currentValue = ""; this._canSearch = !!this.config.searchEnabled; this._isScrollingOnIe = false; this._highlightPosition = 0; this._wasTap = true; this._placeholderValue = this._generatePlaceholderValue(); this._baseId = (0, utils_1.generateId)(this.passedElement.element, "choices-"); this._direction = this.passedElement.dir; if (!this._direction) { var elementDirection = window.getComputedStyle(this.passedElement.element).direction; var documentDirection = window.getComputedStyle(document.documentElement).direction; if (elementDirection !== documentDirection) { this._direction = elementDirection; } } this._idNames = { itemChoice: "item-choice" }; if (this._isSelectElement) { this._presetGroups = this.passedElement.optionGroups; this._presetOptions = this.passedElement.options; } this._presetChoices = this.config.choices; this._presetItems = this.config.items; if (this.passedElement.value && this._isTextElement) { var splitValues = this.passedElement.value.split(this.config.delimiter); this._presetItems = this._presetItems.concat(splitValues); } if (this.passedElement.options) { this.passedElement.options.forEach(function(option3) { _this._presetChoices.push({ value: option3.value, label: option3.innerHTML, selected: !!option3.selected, disabled: option3.disabled || option3.parentNode.disabled, placeholder: option3.value === "" || option3.hasAttribute("placeholder"), customProperties: (0, utils_1.parseCustomProperties)(option3.dataset.customProperties) }); }); } this._render = this._render.bind(this); this._onFocus = this._onFocus.bind(this); this._onBlur = this._onBlur.bind(this); this._onKeyUp = this._onKeyUp.bind(this); this._onKeyDown = this._onKeyDown.bind(this); this._onClick = this._onClick.bind(this); this._onTouchMove = this._onTouchMove.bind(this); this._onTouchEnd = this._onTouchEnd.bind(this); this._onMouseDown = this._onMouseDown.bind(this); this._onMouseOver = this._onMouseOver.bind(this); this._onFormReset = this._onFormReset.bind(this); this._onSelectKey = this._onSelectKey.bind(this); this._onEnterKey = this._onEnterKey.bind(this); this._onEscapeKey = this._onEscapeKey.bind(this); this._onDirectionKey = this._onDirectionKey.bind(this); this._onDeleteKey = this._onDeleteKey.bind(this); if (this.passedElement.isActive) { if (!this.config.silent) { console.warn("Trying to initialise Choices on element already initialised", { element }); } this.initialised = true; return; } this.init(); } Object.defineProperty(Choices3, "defaults", { get: function() { return Object.preventExtensions({ get options() { return USER_DEFAULTS; }, get templates() { return templates_1.default; } }); }, enumerable: false, configurable: true }); Choices3.prototype.init = function() { if (this.initialised) { return; } this._createTemplates(); this._createElements(); this._createStructure(); this._store.subscribe(this._render); this._render(); this._addEventListeners(); var shouldDisable = !this.config.addItems || this.passedElement.element.hasAttribute("disabled"); if (shouldDisable) { this.disable(); } this.initialised = true; var callbackOnInit = this.config.callbackOnInit; if (callbackOnInit && typeof callbackOnInit === "function") { callbackOnInit.call(this); } }; Choices3.prototype.destroy = function() { if (!this.initialised) { return; } this._removeEventListeners(); this.passedElement.reveal(); this.containerOuter.unwrap(this.passedElement.element); this.clearStore(); if (this._isSelectElement) { this.passedElement.options = this._presetOptions; } this._templates = templates_1.default; this.initialised = false; }; Choices3.prototype.enable = function() { if (this.passedElement.isDisabled) { this.passedElement.enable(); } if (this.containerOuter.isDisabled) { this._addEventListeners(); this.input.enable(); this.containerOuter.enable(); } return this; }; Choices3.prototype.disable = function() { if (!this.passedElement.isDisabled) { this.passedElement.disable(); } if (!this.containerOuter.isDisabled) { this._removeEventListeners(); this.input.disable(); this.containerOuter.disable(); } return this; }; Choices3.prototype.highlightItem = function(item2, runEvent) { if (runEvent === void 0) { runEvent = true; } if (!item2 || !item2.id) { return this; } var id = item2.id, _a = item2.groupId, groupId = _a === void 0 ? -1 : _a, _b = item2.value, value = _b === void 0 ? "" : _b, _c = item2.label, label = _c === void 0 ? "" : _c; var group = groupId >= 0 ? this._store.getGroupById(groupId) : null; this._store.dispatch((0, items_1.highlightItem)(id, true)); if (runEvent) { this.passedElement.triggerEvent(constants_1.EVENTS.highlightItem, { id, value, label, groupValue: group && group.value ? group.value : null }); } return this; }; Choices3.prototype.unhighlightItem = function(item2) { if (!item2 || !item2.id) { return this; } var id = item2.id, _a = item2.groupId, groupId = _a === void 0 ? -1 : _a, _b = item2.value, value = _b === void 0 ? "" : _b, _c = item2.label, label = _c === void 0 ? "" : _c; var group = groupId >= 0 ? this._store.getGroupById(groupId) : null; this._store.dispatch((0, items_1.highlightItem)(id, false)); this.passedElement.triggerEvent(constants_1.EVENTS.highlightItem, { id, value, label, groupValue: group && group.value ? group.value : null }); return this; }; Choices3.prototype.highlightAll = function() { var _this = this; this._store.items.forEach(function(item2) { return _this.highlightItem(item2); }); return this; }; Choices3.prototype.unhighlightAll = function() { var _this = this; this._store.items.forEach(function(item2) { return _this.unhighlightItem(item2); }); return this; }; Choices3.prototype.removeActiveItemsByValue = function(value) { var _this = this; this._store.activeItems.filter(function(item2) { return item2.value === value; }).forEach(function(item2) { return _this._removeItem(item2); }); return this; }; Choices3.prototype.removeActiveItems = function(excludedId) { var _this = this; this._store.activeItems.filter(function(_a) { var id = _a.id; return id !== excludedId; }).forEach(function(item2) { return _this._removeItem(item2); }); return this; }; Choices3.prototype.removeHighlightedItems = function(runEvent) { var _this = this; if (runEvent === void 0) { runEvent = false; } this._store.highlightedActiveItems.forEach(function(item2) { _this._removeItem(item2); if (runEvent) { _this._triggerChange(item2.value); } }); return this; }; Choices3.prototype.showDropdown = function(preventInputFocus) { var _this = this; if (this.dropdown.isActive) { return this; } requestAnimationFrame(function() { _this.dropdown.show(); _this.containerOuter.open(_this.dropdown.distanceFromTopWindow); if (!preventInputFocus && _this._canSearch) { _this.input.focus(); } _this.passedElement.triggerEvent(constants_1.EVENTS.showDropdown, {}); }); return this; }; Choices3.prototype.hideDropdown = function(preventInputBlur) { var _this = this; if (!this.dropdown.isActive) { return this; } requestAnimationFrame(function() { _this.dropdown.hide(); _this.containerOuter.close(); if (!preventInputBlur && _this._canSearch) { _this.input.removeActiveDescendant(); _this.input.blur(); } _this.passedElement.triggerEvent(constants_1.EVENTS.hideDropdown, {}); }); return this; }; Choices3.prototype.getValue = function(valueOnly) { if (valueOnly === void 0) { valueOnly = false; } var values = this._store.activeItems.reduce(function(selectedItems, item2) { var itemValue = valueOnly ? item2.value : item2; selectedItems.push(itemValue); return selectedItems; }, []); return this._isSelectOneElement ? values[0] : values; }; Choices3.prototype.setValue = function(items) { var _this = this; if (!this.initialised) { return this; } items.forEach(function(value) { return _this._setChoiceOrItem(value); }); return this; }; Choices3.prototype.setChoiceByValue = function(value) { var _this = this; if (!this.initialised || this._isTextElement) { return this; } var choiceValue = Array.isArray(value) ? value : [value]; choiceValue.forEach(function(val) { return _this._findAndSelectChoiceByValue(val); }); return this; }; Choices3.prototype.setChoices = function(choicesArrayOrFetcher, value, label, replaceChoices) { var _this = this; if (choicesArrayOrFetcher === void 0) { choicesArrayOrFetcher = []; } if (value === void 0) { value = "value"; } if (label === void 0) { label = "label"; } if (replaceChoices === void 0) { replaceChoices = false; } if (!this.initialised) { throw new ReferenceError("setChoices was called on a non-initialized instance of Choices"); } if (!this._isSelectElement) { throw new TypeError("setChoices can't be used with INPUT based Choices"); } if (typeof value !== "string" || !value) { throw new TypeError("value parameter must be a name of 'value' field in passed objects"); } if (replaceChoices) { this.clearChoices(); } if (typeof choicesArrayOrFetcher === "function") { var fetcher_1 = choicesArrayOrFetcher(this); if (typeof Promise === "function" && fetcher_1 instanceof Promise) { return new Promise(function(resolve) { return requestAnimationFrame(resolve); }).then(function() { return _this._handleLoadingState(true); }).then(function() { return fetcher_1; }).then(function(data3) { return _this.setChoices(data3, value, label, replaceChoices); }).catch(function(err) { if (!_this.config.silent) { console.error(err); } }).then(function() { return _this._handleLoadingState(false); }).then(function() { return _this; }); } if (!Array.isArray(fetcher_1)) { throw new TypeError(".setChoices first argument function must return either array of choices or Promise, got: ".concat(typeof fetcher_1)); } return this.setChoices(fetcher_1, value, label, false); } if (!Array.isArray(choicesArrayOrFetcher)) { throw new TypeError(".setChoices must be called either with array of choices with a function resulting into Promise of array of choices"); } this.containerOuter.removeLoadingState(); this._startLoading(); choicesArrayOrFetcher.forEach(function(groupOrChoice) { if (groupOrChoice.choices) { _this._addGroup({ id: groupOrChoice.id ? parseInt("".concat(groupOrChoice.id), 10) : null, group: groupOrChoice, valueKey: value, labelKey: label }); } else { var choice = groupOrChoice; _this._addChoice({ value: choice[value], label: choice[label], isSelected: !!choice.selected, isDisabled: !!choice.disabled, placeholder: !!choice.placeholder, customProperties: choice.customProperties }); } }); this._stopLoading(); return this; }; Choices3.prototype.clearChoices = function() { this._store.dispatch((0, choices_1.clearChoices)()); return this; }; Choices3.prototype.clearStore = function() { this._store.dispatch((0, misc_1.clearAll)()); return this; }; Choices3.prototype.clearInput = function() { var shouldSetInputWidth = !this._isSelectOneElement; this.input.clear(shouldSetInputWidth); if (!this._isTextElement && this._canSearch) { this._isSearching = false; this._store.dispatch((0, choices_1.activateChoices)(true)); } return this; }; Choices3.prototype._render = function() { if (this._store.isLoading()) { return; } this._currentState = this._store.state; var stateChanged = this._currentState.choices !== this._prevState.choices || this._currentState.groups !== this._prevState.groups || this._currentState.items !== this._prevState.items; var shouldRenderChoices = this._isSelectElement; var shouldRenderItems = this._currentState.items !== this._prevState.items; if (!stateChanged) { return; } if (shouldRenderChoices) { this._renderChoices(); } if (shouldRenderItems) { this._renderItems(); } this._prevState = this._currentState; }; Choices3.prototype._renderChoices = function() { var _this = this; var _a = this._store, activeGroups = _a.activeGroups, activeChoices = _a.activeChoices; var choiceListFragment = document.createDocumentFragment(); this.choiceList.clear(); if (this.config.resetScrollPosition) { requestAnimationFrame(function() { return _this.choiceList.scrollToTop(); }); } if (activeGroups.length >= 1 && !this._isSearching) { var activePlaceholders = activeChoices.filter(function(activeChoice) { return activeChoice.placeholder === true && activeChoice.groupId === -1; }); if (activePlaceholders.length >= 1) { choiceListFragment = this._createChoicesFragment(activePlaceholders, choiceListFragment); } choiceListFragment = this._createGroupsFragment(activeGroups, activeChoices, choiceListFragment); } else if (activeChoices.length >= 1) { choiceListFragment = this._createChoicesFragment(activeChoices, choiceListFragment); } if (choiceListFragment.childNodes && choiceListFragment.childNodes.length > 0) { var activeItems = this._store.activeItems; var canAddItem = this._canAddItem(activeItems, this.input.value); if (canAddItem.response) { this.choiceList.append(choiceListFragment); this._highlightChoice(); } else { var notice = this._getTemplate("notice", canAddItem.notice); this.choiceList.append(notice); } } else { var dropdownItem = void 0; var notice = void 0; if (this._isSearching) { notice = typeof this.config.noResultsText === "function" ? this.config.noResultsText() : this.config.noResultsText; dropdownItem = this._getTemplate("notice", notice, "no-results"); } else { notice = typeof this.config.noChoicesText === "function" ? this.config.noChoicesText() : this.config.noChoicesText; dropdownItem = this._getTemplate("notice", notice, "no-choices"); } this.choiceList.append(dropdownItem); } }; Choices3.prototype._renderItems = function() { var activeItems = this._store.activeItems || []; this.itemList.clear(); var itemListFragment = this._createItemsFragment(activeItems); if (itemListFragment.childNodes) { this.itemList.append(itemListFragment); } }; Choices3.prototype._createGroupsFragment = function(groups, choices, fragment) { var _this = this; if (fragment === void 0) { fragment = document.createDocumentFragment(); } var getGroupChoices = function(group) { return choices.filter(function(choice) { if (_this._isSelectOneElement) { return choice.groupId === group.id; } return choice.groupId === group.id && (_this.config.renderSelectedChoices === "always" || !choice.selected); }); }; if (this.config.shouldSort) { groups.sort(this.config.sorter); } groups.forEach(function(group) { var groupChoices = getGroupChoices(group); if (groupChoices.length >= 1) { var dropdownGroup = _this._getTemplate("choiceGroup", group); fragment.appendChild(dropdownGroup); _this._createChoicesFragment(groupChoices, fragment, true); } }); return fragment; }; Choices3.prototype._createChoicesFragment = function(choices, fragment, withinGroup) { var _this = this; if (fragment === void 0) { fragment = document.createDocumentFragment(); } if (withinGroup === void 0) { withinGroup = false; } var _a = this.config, renderSelectedChoices = _a.renderSelectedChoices, searchResultLimit = _a.searchResultLimit, renderChoiceLimit = _a.renderChoiceLimit; var filter = this._isSearching ? utils_1.sortByScore : this.config.sorter; var appendChoice = function(choice) { var shouldRender = renderSelectedChoices === "auto" ? _this._isSelectOneElement || !choice.selected : true; if (shouldRender) { var dropdownItem = _this._getTemplate("choice", choice, _this.config.itemSelectText); fragment.appendChild(dropdownItem); } }; var rendererableChoices = choices; if (renderSelectedChoices === "auto" && !this._isSelectOneElement) { rendererableChoices = choices.filter(function(choice) { return !choice.selected; }); } var _b = rendererableChoices.reduce(function(acc, choice) { if (choice.placeholder) { acc.placeholderChoices.push(choice); } else { acc.normalChoices.push(choice); } return acc; }, { placeholderChoices: [], normalChoices: [] }), placeholderChoices = _b.placeholderChoices, normalChoices = _b.normalChoices; if (this.config.shouldSort || this._isSearching) { normalChoices.sort(filter); } var choiceLimit = rendererableChoices.length; var sortedChoices = this._isSelectOneElement ? __spreadArray(__spreadArray([], placeholderChoices, true), normalChoices, true) : normalChoices; if (this._isSearching) { choiceLimit = searchResultLimit; } else if (renderChoiceLimit && renderChoiceLimit > 0 && !withinGroup) { choiceLimit = renderChoiceLimit; } for (var i = 0; i < choiceLimit; i += 1) { if (sortedChoices[i]) { appendChoice(sortedChoices[i]); } } return fragment; }; Choices3.prototype._createItemsFragment = function(items, fragment) { var _this = this; if (fragment === void 0) { fragment = document.createDocumentFragment(); } var _a = this.config, shouldSortItems = _a.shouldSortItems, sorter = _a.sorter, removeItemButton = _a.removeItemButton; if (shouldSortItems && !this._isSelectOneElement) { items.sort(sorter); } if (this._isTextElement) { this.passedElement.value = items.map(function(_a2) { var value = _a2.value; return value; }).join(this.config.delimiter); } else { this.passedElement.options = items; } var addItemToFragment = function(item2) { var listItem = _this._getTemplate("item", item2, removeItemButton); fragment.appendChild(listItem); }; items.forEach(addItemToFragment); return fragment; }; Choices3.prototype._triggerChange = function(value) { if (value === void 0 || value === null) { return; } this.passedElement.triggerEvent(constants_1.EVENTS.change, { value }); }; Choices3.prototype._selectPlaceholderChoice = function(placeholderChoice) { this._addItem({ value: placeholderChoice.value, label: placeholderChoice.label, choiceId: placeholderChoice.id, groupId: placeholderChoice.groupId, placeholder: placeholderChoice.placeholder }); this._triggerChange(placeholderChoice.value); }; Choices3.prototype._handleButtonAction = function(activeItems, element) { if (!activeItems || !element || !this.config.removeItems || !this.config.removeItemButton) { return; } var itemId = element.parentNode && element.parentNode.dataset.id; var itemToRemove = itemId && activeItems.find(function(item2) { return item2.id === parseInt(itemId, 10); }); if (!itemToRemove) { return; } this._removeItem(itemToRemove); this._triggerChange(itemToRemove.value); if (this._isSelectOneElement && this._store.placeholderChoice) { this._selectPlaceholderChoice(this._store.placeholderChoice); } }; Choices3.prototype._handleItemAction = function(activeItems, element, hasShiftKey) { var _this = this; if (hasShiftKey === void 0) { hasShiftKey = false; } if (!activeItems || !element || !this.config.removeItems || this._isSelectOneElement) { return; } var passedId = element.dataset.id; activeItems.forEach(function(item2) { if (item2.id === parseInt("".concat(passedId), 10) && !item2.highlighted) { _this.highlightItem(item2); } else if (!hasShiftKey && item2.highlighted) { _this.unhighlightItem(item2); } }); this.input.focus(); }; Choices3.prototype._handleChoiceAction = function(activeItems, element) { if (!activeItems || !element) { return; } var id = element.dataset.id; var choice = id && this._store.getChoiceById(id); if (!choice) { return; } var passedKeyCode = activeItems[0] && activeItems[0].keyCode ? activeItems[0].keyCode : void 0; var hasActiveDropdown = this.dropdown.isActive; choice.keyCode = passedKeyCode; this.passedElement.triggerEvent(constants_1.EVENTS.choice, { choice }); if (!choice.selected && !choice.disabled) { var canAddItem = this._canAddItem(activeItems, choice.value); if (canAddItem.response) { this._addItem({ value: choice.value, label: choice.label, choiceId: choice.id, groupId: choice.groupId, customProperties: choice.customProperties, placeholder: choice.placeholder, keyCode: choice.keyCode }); this._triggerChange(choice.value); } } this.clearInput(); if (hasActiveDropdown && this._isSelectOneElement) { this.hideDropdown(true); this.containerOuter.focus(); } }; Choices3.prototype._handleBackspace = function(activeItems) { if (!this.config.removeItems || !activeItems) { return; } var lastItem = activeItems[activeItems.length - 1]; var hasHighlightedItems = activeItems.some(function(item2) { return item2.highlighted; }); if (this.config.editItems && !hasHighlightedItems && lastItem) { this.input.value = lastItem.value; this.input.setWidth(); this._removeItem(lastItem); this._triggerChange(lastItem.value); } else { if (!hasHighlightedItems) { this.highlightItem(lastItem, false); } this.removeHighlightedItems(true); } }; Choices3.prototype._startLoading = function() { this._store.dispatch((0, misc_1.setIsLoading)(true)); }; Choices3.prototype._stopLoading = function() { this._store.dispatch((0, misc_1.setIsLoading)(false)); }; Choices3.prototype._handleLoadingState = function(setLoading) { if (setLoading === void 0) { setLoading = true; } var placeholderItem = this.itemList.getChild(".".concat(this.config.classNames.placeholder)); if (setLoading) { this.disable(); this.containerOuter.addLoadingState(); if (this._isSelectOneElement) { if (!placeholderItem) { placeholderItem = this._getTemplate("placeholder", this.config.loadingText); if (placeholderItem) { this.itemList.append(placeholderItem); } } else { placeholderItem.innerHTML = this.config.loadingText; } } else { this.input.placeholder = this.config.loadingText; } } else { this.enable(); this.containerOuter.removeLoadingState(); if (this._isSelectOneElement) { if (placeholderItem) { placeholderItem.innerHTML = this._placeholderValue || ""; } } else { this.input.placeholder = this._placeholderValue || ""; } } }; Choices3.prototype._handleSearch = function(value) { if (!this.input.isFocussed) { return; } var choices = this._store.choices; var _a = this.config, searchFloor = _a.searchFloor, searchChoices = _a.searchChoices; var hasUnactiveChoices = choices.some(function(option3) { return !option3.active; }); if (value !== null && typeof value !== "undefined" && value.length >= searchFloor) { var resultCount = searchChoices ? this._searchChoices(value) : 0; this.passedElement.triggerEvent(constants_1.EVENTS.search, { value, resultCount }); } else if (hasUnactiveChoices) { this._isSearching = false; this._store.dispatch((0, choices_1.activateChoices)(true)); } }; Choices3.prototype._canAddItem = function(activeItems, value) { var canAddItem = true; var notice = typeof this.config.addItemText === "function" ? this.config.addItemText(value) : this.config.addItemText; if (!this._isSelectOneElement) { var isDuplicateValue = (0, utils_1.existsInArray)(activeItems, value); if (this.config.maxItemCount > 0 && this.config.maxItemCount <= activeItems.length) { canAddItem = false; notice = typeof this.config.maxItemText === "function" ? this.config.maxItemText(this.config.maxItemCount) : this.config.maxItemText; } if (!this.config.duplicateItemsAllowed && isDuplicateValue && canAddItem) { canAddItem = false; notice = typeof this.config.uniqueItemText === "function" ? this.config.uniqueItemText(value) : this.config.uniqueItemText; } if (this._isTextElement && this.config.addItems && canAddItem && typeof this.config.addItemFilter === "function" && !this.config.addItemFilter(value)) { canAddItem = false; notice = typeof this.config.customAddItemText === "function" ? this.config.customAddItemText(value) : this.config.customAddItemText; } } return { response: canAddItem, notice }; }; Choices3.prototype._searchChoices = function(value) { var newValue = typeof value === "string" ? value.trim() : value; var currentValue = typeof this._currentValue === "string" ? this._currentValue.trim() : this._currentValue; if (newValue.length < 1 && newValue === "".concat(currentValue, " ")) { return 0; } var haystack = this._store.searchableChoices; var needle = newValue; var options2 = Object.assign(this.config.fuseOptions, { keys: __spreadArray([], this.config.searchFields, true), includeMatches: true }); var fuse = new fuse_js_1.default(haystack, options2); var results = fuse.search(needle); this._currentValue = newValue; this._highlightPosition = 0; this._isSearching = true; this._store.dispatch((0, choices_1.filterChoices)(results)); return results.length; }; Choices3.prototype._addEventListeners = function() { var documentElement = document.documentElement; documentElement.addEventListener("touchend", this._onTouchEnd, true); this.containerOuter.element.addEventListener("keydown", this._onKeyDown, true); this.containerOuter.element.addEventListener("mousedown", this._onMouseDown, true); documentElement.addEventListener("click", this._onClick, { passive: true }); documentElement.addEventListener("touchmove", this._onTouchMove, { passive: true }); this.dropdown.element.addEventListener("mouseover", this._onMouseOver, { passive: true }); if (this._isSelectOneElement) { this.containerOuter.element.addEventListener("focus", this._onFocus, { passive: true }); this.containerOuter.element.addEventListener("blur", this._onBlur, { passive: true }); } this.input.element.addEventListener("keyup", this._onKeyUp, { passive: true }); this.input.element.addEventListener("focus", this._onFocus, { passive: true }); this.input.element.addEventListener("blur", this._onBlur, { passive: true }); if (this.input.element.form) { this.input.element.form.addEventListener("reset", this._onFormReset, { passive: true }); } this.input.addEventListeners(); }; Choices3.prototype._removeEventListeners = function() { var documentElement = document.documentElement; documentElement.removeEventListener("touchend", this._onTouchEnd, true); this.containerOuter.element.removeEventListener("keydown", this._onKeyDown, true); this.containerOuter.element.removeEventListener("mousedown", this._onMouseDown, true); documentElement.removeEventListener("click", this._onClick); documentElement.removeEventListener("touchmove", this._onTouchMove); this.dropdown.element.removeEventListener("mouseover", this._onMouseOver); if (this._isSelectOneElement) { this.containerOuter.element.removeEventListener("focus", this._onFocus); this.containerOuter.element.removeEventListener("blur", this._onBlur); } this.input.element.removeEventListener("keyup", this._onKeyUp); this.input.element.removeEventListener("focus", this._onFocus); this.input.element.removeEventListener("blur", this._onBlur); if (this.input.element.form) { this.input.element.form.removeEventListener("reset", this._onFormReset); } this.input.removeEventListeners(); }; Choices3.prototype._onKeyDown = function(event) { var keyCode = event.keyCode; var activeItems = this._store.activeItems; var hasFocusedInput = this.input.isFocussed; var hasActiveDropdown = this.dropdown.isActive; var hasItems = this.itemList.hasChildren(); var keyString = String.fromCharCode(keyCode); var wasPrintableChar = /[^\x00-\x1F]/.test(keyString); var BACK_KEY = constants_1.KEY_CODES.BACK_KEY, DELETE_KEY = constants_1.KEY_CODES.DELETE_KEY, ENTER_KEY = constants_1.KEY_CODES.ENTER_KEY, A_KEY = constants_1.KEY_CODES.A_KEY, ESC_KEY = constants_1.KEY_CODES.ESC_KEY, UP_KEY = constants_1.KEY_CODES.UP_KEY, DOWN_KEY = constants_1.KEY_CODES.DOWN_KEY, PAGE_UP_KEY = constants_1.KEY_CODES.PAGE_UP_KEY, PAGE_DOWN_KEY = constants_1.KEY_CODES.PAGE_DOWN_KEY; if (!this._isTextElement && !hasActiveDropdown && wasPrintableChar) { this.showDropdown(); if (!this.input.isFocussed) { this.input.value += event.key.toLowerCase(); } } switch (keyCode) { case A_KEY: return this._onSelectKey(event, hasItems); case ENTER_KEY: return this._onEnterKey(event, activeItems, hasActiveDropdown); case ESC_KEY: return this._onEscapeKey(hasActiveDropdown); case UP_KEY: case PAGE_UP_KEY: case DOWN_KEY: case PAGE_DOWN_KEY: return this._onDirectionKey(event, hasActiveDropdown); case DELETE_KEY: case BACK_KEY: return this._onDeleteKey(event, activeItems, hasFocusedInput); default: } }; Choices3.prototype._onKeyUp = function(_a) { var target = _a.target, keyCode = _a.keyCode; var value = this.input.value; var activeItems = this._store.activeItems; var canAddItem = this._canAddItem(activeItems, value); var backKey = constants_1.KEY_CODES.BACK_KEY, deleteKey = constants_1.KEY_CODES.DELETE_KEY; if (this._isTextElement) { var canShowDropdownNotice = canAddItem.notice && value; if (canShowDropdownNotice) { var dropdownItem = this._getTemplate("notice", canAddItem.notice); this.dropdown.element.innerHTML = dropdownItem.outerHTML; this.showDropdown(true); } else { this.hideDropdown(true); } } else { var wasRemovalKeyCode = keyCode === backKey || keyCode === deleteKey; var userHasRemovedValue = wasRemovalKeyCode && target && !target.value; var canReactivateChoices = !this._isTextElement && this._isSearching; var canSearch = this._canSearch && canAddItem.response; if (userHasRemovedValue && canReactivateChoices) { this._isSearching = false; this._store.dispatch((0, choices_1.activateChoices)(true)); } else if (canSearch) { this._handleSearch(this.input.rawValue); } } this._canSearch = this.config.searchEnabled; }; Choices3.prototype._onSelectKey = function(event, hasItems) { var ctrlKey = event.ctrlKey, metaKey = event.metaKey; var hasCtrlDownKeyPressed = ctrlKey || metaKey; if (hasCtrlDownKeyPressed && hasItems) { this._canSearch = false; var shouldHightlightAll = this.config.removeItems && !this.input.value && this.input.element === document.activeElement; if (shouldHightlightAll) { this.highlightAll(); } } }; Choices3.prototype._onEnterKey = function(event, activeItems, hasActiveDropdown) { var target = event.target; var enterKey = constants_1.KEY_CODES.ENTER_KEY; var targetWasButton = target && target.hasAttribute("data-button"); if (this._isTextElement && target && target.value) { var value = this.input.value; var canAddItem = this._canAddItem(activeItems, value); if (canAddItem.response) { this.hideDropdown(true); this._addItem({ value }); this._triggerChange(value); this.clearInput(); } } if (targetWasButton) { this._handleButtonAction(activeItems, target); event.preventDefault(); } if (hasActiveDropdown) { var highlightedChoice = this.dropdown.getChild(".".concat(this.config.classNames.highlightedState)); if (highlightedChoice) { if (activeItems[0]) { activeItems[0].keyCode = enterKey; } this._handleChoiceAction(activeItems, highlightedChoice); } event.preventDefault(); } else if (this._isSelectOneElement) { this.showDropdown(); event.preventDefault(); } }; Choices3.prototype._onEscapeKey = function(hasActiveDropdown) { if (hasActiveDropdown) { this.hideDropdown(true); this.containerOuter.focus(); } }; Choices3.prototype._onDirectionKey = function(event, hasActiveDropdown) { var keyCode = event.keyCode, metaKey = event.metaKey; var downKey = constants_1.KEY_CODES.DOWN_KEY, pageUpKey = constants_1.KEY_CODES.PAGE_UP_KEY, pageDownKey = constants_1.KEY_CODES.PAGE_DOWN_KEY; if (hasActiveDropdown || this._isSelectOneElement) { this.showDropdown(); this._canSearch = false; var directionInt = keyCode === downKey || keyCode === pageDownKey ? 1 : -1; var skipKey = metaKey || keyCode === pageDownKey || keyCode === pageUpKey; var selectableChoiceIdentifier = "[data-choice-selectable]"; var nextEl2 = void 0; if (skipKey) { if (directionInt > 0) { nextEl2 = this.dropdown.element.querySelector("".concat(selectableChoiceIdentifier, ":last-of-type")); } else { nextEl2 = this.dropdown.element.querySelector(selectableChoiceIdentifier); } } else { var currentEl = this.dropdown.element.querySelector(".".concat(this.config.classNames.highlightedState)); if (currentEl) { nextEl2 = (0, utils_1.getAdjacentEl)(currentEl, selectableChoiceIdentifier, directionInt); } else { nextEl2 = this.dropdown.element.querySelector(selectableChoiceIdentifier); } } if (nextEl2) { if (!(0, utils_1.isScrolledIntoView)(nextEl2, this.choiceList.element, directionInt)) { this.choiceList.scrollToChildElement(nextEl2, directionInt); } this._highlightChoice(nextEl2); } event.preventDefault(); } }; Choices3.prototype._onDeleteKey = function(event, activeItems, hasFocusedInput) { var target = event.target; if (!this._isSelectOneElement && !target.value && hasFocusedInput) { this._handleBackspace(activeItems); event.preventDefault(); } }; Choices3.prototype._onTouchMove = function() { if (this._wasTap) { this._wasTap = false; } }; Choices3.prototype._onTouchEnd = function(event) { var target = (event || event.touches[0]).target; var touchWasWithinContainer = this._wasTap && this.containerOuter.element.contains(target); if (touchWasWithinContainer) { var containerWasExactTarget = target === this.containerOuter.element || target === this.containerInner.element; if (containerWasExactTarget) { if (this._isTextElement) { this.input.focus(); } else if (this._isSelectMultipleElement) { this.showDropdown(); } } event.stopPropagation(); } this._wasTap = true; }; Choices3.prototype._onMouseDown = function(event) { var target = event.target; if (!(target instanceof HTMLElement)) { return; } if (IS_IE11 && this.choiceList.element.contains(target)) { var firstChoice = this.choiceList.element.firstElementChild; var isOnScrollbar = this._direction === "ltr" ? event.offsetX >= firstChoice.offsetWidth : event.offsetX < firstChoice.offsetLeft; this._isScrollingOnIe = isOnScrollbar; } if (target === this.input.element) { return; } var item2 = target.closest("[data-button],[data-item],[data-choice]"); if (item2 instanceof HTMLElement) { var hasShiftKey = event.shiftKey; var activeItems = this._store.activeItems; var dataset = item2.dataset; if ("button" in dataset) { this._handleButtonAction(activeItems, item2); } else if ("item" in dataset) { this._handleItemAction(activeItems, item2, hasShiftKey); } else if ("choice" in dataset) { this._handleChoiceAction(activeItems, item2); } } event.preventDefault(); }; Choices3.prototype._onMouseOver = function(_a) { var target = _a.target; if (target instanceof HTMLElement && "choice" in target.dataset) { this._highlightChoice(target); } }; Choices3.prototype._onClick = function(_a) { var target = _a.target; var clickWasWithinContainer = this.containerOuter.element.contains(target); if (clickWasWithinContainer) { if (!this.dropdown.isActive && !this.containerOuter.isDisabled) { if (this._isTextElement) { if (document.activeElement !== this.input.element) { this.input.focus(); } } else { this.showDropdown(); this.containerOuter.focus(); } } else if (this._isSelectOneElement && target !== this.input.element && !this.dropdown.element.contains(target)) { this.hideDropdown(); } } else { var hasHighlightedItems = this._store.highlightedActiveItems.length > 0; if (hasHighlightedItems) { this.unhighlightAll(); } this.containerOuter.removeFocusState(); this.hideDropdown(true); } }; Choices3.prototype._onFocus = function(_a) { var _b; var _this = this; var target = _a.target; var focusWasWithinContainer = target && this.containerOuter.element.contains(target); if (!focusWasWithinContainer) { return; } var focusActions = (_b = {}, _b[constants_1.TEXT_TYPE] = function() { if (target === _this.input.element) { _this.containerOuter.addFocusState(); } }, _b[constants_1.SELECT_ONE_TYPE] = function() { _this.containerOuter.addFocusState(); if (target === _this.input.element) { _this.showDropdown(true); } }, _b[constants_1.SELECT_MULTIPLE_TYPE] = function() { if (target === _this.input.element) { _this.showDropdown(true); _this.containerOuter.addFocusState(); } }, _b); focusActions[this.passedElement.element.type](); }; Choices3.prototype._onBlur = function(_a) { var _b; var _this = this; var target = _a.target; var blurWasWithinContainer = target && this.containerOuter.element.contains(target); if (blurWasWithinContainer && !this._isScrollingOnIe) { var activeItems = this._store.activeItems; var hasHighlightedItems_1 = activeItems.some(function(item2) { return item2.highlighted; }); var blurActions = (_b = {}, _b[constants_1.TEXT_TYPE] = function() { if (target === _this.input.element) { _this.containerOuter.removeFocusState(); if (hasHighlightedItems_1) { _this.unhighlightAll(); } _this.hideDropdown(true); } }, _b[constants_1.SELECT_ONE_TYPE] = function() { _this.containerOuter.removeFocusState(); if (target === _this.input.element || target === _this.containerOuter.element && !_this._canSearch) { _this.hideDropdown(true); } }, _b[constants_1.SELECT_MULTIPLE_TYPE] = function() { if (target === _this.input.element) { _this.containerOuter.removeFocusState(); _this.hideDropdown(true); if (hasHighlightedItems_1) { _this.unhighlightAll(); } } }, _b); blurActions[this.passedElement.element.type](); } else { this._isScrollingOnIe = false; this.input.element.focus(); } }; Choices3.prototype._onFormReset = function() { this._store.dispatch((0, misc_1.resetTo)(this._initialState)); }; Choices3.prototype._highlightChoice = function(el) { var _this = this; if (el === void 0) { el = null; } var choices = Array.from(this.dropdown.element.querySelectorAll("[data-choice-selectable]")); if (!choices.length) { return; } var passedEl = el; var highlightedChoices = Array.from(this.dropdown.element.querySelectorAll(".".concat(this.config.classNames.highlightedState))); highlightedChoices.forEach(function(choice) { choice.classList.remove(_this.config.classNames.highlightedState); choice.setAttribute("aria-selected", "false"); }); if (passedEl) { this._highlightPosition = choices.indexOf(passedEl); } else { if (choices.length > this._highlightPosition) { passedEl = choices[this._highlightPosition]; } else { passedEl = choices[choices.length - 1]; } if (!passedEl) { passedEl = choices[0]; } } passedEl.classList.add(this.config.classNames.highlightedState); passedEl.setAttribute("aria-selected", "true"); this.passedElement.triggerEvent(constants_1.EVENTS.highlightChoice, { el: passedEl }); if (this.dropdown.isActive) { this.input.setActiveDescendant(passedEl.id); this.containerOuter.setActiveDescendant(passedEl.id); } }; Choices3.prototype._addItem = function(_a) { var value = _a.value, _b = _a.label, label = _b === void 0 ? null : _b, _c = _a.choiceId, choiceId = _c === void 0 ? -1 : _c, _d = _a.groupId, groupId = _d === void 0 ? -1 : _d, _e = _a.customProperties, customProperties = _e === void 0 ? {} : _e, _f = _a.placeholder, placeholder = _f === void 0 ? false : _f, _g = _a.keyCode, keyCode = _g === void 0 ? -1 : _g; var passedValue = typeof value === "string" ? value.trim() : value; var items = this._store.items; var passedLabel = label || passedValue; var passedOptionId = choiceId || -1; var group = groupId >= 0 ? this._store.getGroupById(groupId) : null; var id = items ? items.length + 1 : 1; if (this.config.prependValue) { passedValue = this.config.prependValue + passedValue.toString(); } if (this.config.appendValue) { passedValue += this.config.appendValue.toString(); } this._store.dispatch((0, items_1.addItem)({ value: passedValue, label: passedLabel, id, choiceId: passedOptionId, groupId, customProperties, placeholder, keyCode })); if (this._isSelectOneElement) { this.removeActiveItems(id); } this.passedElement.triggerEvent(constants_1.EVENTS.addItem, { id, value: passedValue, label: passedLabel, customProperties, groupValue: group && group.value ? group.value : null, keyCode }); }; Choices3.prototype._removeItem = function(item2) { var id = item2.id, value = item2.value, label = item2.label, customProperties = item2.customProperties, choiceId = item2.choiceId, groupId = item2.groupId; var group = groupId && groupId >= 0 ? this._store.getGroupById(groupId) : null; if (!id || !choiceId) { return; } this._store.dispatch((0, items_1.removeItem)(id, choiceId)); this.passedElement.triggerEvent(constants_1.EVENTS.removeItem, { id, value, label, customProperties, groupValue: group && group.value ? group.value : null }); }; Choices3.prototype._addChoice = function(_a) { var value = _a.value, _b = _a.label, label = _b === void 0 ? null : _b, _c = _a.isSelected, isSelected = _c === void 0 ? false : _c, _d = _a.isDisabled, isDisabled = _d === void 0 ? false : _d, _e = _a.groupId, groupId = _e === void 0 ? -1 : _e, _f = _a.customProperties, customProperties = _f === void 0 ? {} : _f, _g = _a.placeholder, placeholder = _g === void 0 ? false : _g, _h = _a.keyCode, keyCode = _h === void 0 ? -1 : _h; if (typeof value === "undefined" || value === null) { return; } var choices = this._store.choices; var choiceLabel = label || value; var choiceId = choices ? choices.length + 1 : 1; var choiceElementId = "".concat(this._baseId, "-").concat(this._idNames.itemChoice, "-").concat(choiceId); this._store.dispatch((0, choices_1.addChoice)({ id: choiceId, groupId, elementId: choiceElementId, value, label: choiceLabel, disabled: isDisabled, customProperties, placeholder, keyCode })); if (isSelected) { this._addItem({ value, label: choiceLabel, choiceId, customProperties, placeholder, keyCode }); } }; Choices3.prototype._addGroup = function(_a) { var _this = this; var group = _a.group, id = _a.id, _b = _a.valueKey, valueKey = _b === void 0 ? "value" : _b, _c = _a.labelKey, labelKey = _c === void 0 ? "label" : _c; var groupChoices = (0, utils_1.isType)("Object", group) ? group.choices : Array.from(group.getElementsByTagName("OPTION")); var groupId = id || Math.floor(new Date().valueOf() * Math.random()); var isDisabled = group.disabled ? group.disabled : false; if (groupChoices) { this._store.dispatch((0, groups_1.addGroup)({ value: group.label, id: groupId, active: true, disabled: isDisabled })); var addGroupChoices = function(choice) { var isOptDisabled = choice.disabled || choice.parentNode && choice.parentNode.disabled; _this._addChoice({ value: choice[valueKey], label: (0, utils_1.isType)("Object", choice) ? choice[labelKey] : choice.innerHTML, isSelected: choice.selected, isDisabled: isOptDisabled, groupId, customProperties: choice.customProperties, placeholder: choice.placeholder }); }; groupChoices.forEach(addGroupChoices); } else { this._store.dispatch((0, groups_1.addGroup)({ value: group.label, id: group.id, active: false, disabled: group.disabled })); } }; Choices3.prototype._getTemplate = function(template) { var _a; var args = []; for (var _i = 1; _i < arguments.length; _i++) { args[_i - 1] = arguments[_i]; } return (_a = this._templates[template]).call.apply(_a, __spreadArray([this, this.config], args, false)); }; Choices3.prototype._createTemplates = function() { var callbackOnCreateTemplates = this.config.callbackOnCreateTemplates; var userTemplates = {}; if (callbackOnCreateTemplates && typeof callbackOnCreateTemplates === "function") { userTemplates = callbackOnCreateTemplates.call(this, utils_1.strToEl); } this._templates = (0, deepmerge_1.default)(templates_1.default, userTemplates); }; Choices3.prototype._createElements = function() { this.containerOuter = new components_1.Container({ element: this._getTemplate("containerOuter", this._direction, this._isSelectElement, this._isSelectOneElement, this.config.searchEnabled, this.passedElement.element.type, this.config.labelId), classNames: this.config.classNames, type: this.passedElement.element.type, position: this.config.position }); this.containerInner = new components_1.Container({ element: this._getTemplate("containerInner"), classNames: this.config.classNames, type: this.passedElement.element.type, position: this.config.position }); this.input = new components_1.Input({ element: this._getTemplate("input", this._placeholderValue), classNames: this.config.classNames, type: this.passedElement.element.type, preventPaste: !this.config.paste }); this.choiceList = new components_1.List({ element: this._getTemplate("choiceList", this._isSelectOneElement) }); this.itemList = new components_1.List({ element: this._getTemplate("itemList", this._isSelectOneElement) }); this.dropdown = new components_1.Dropdown({ element: this._getTemplate("dropdown"), classNames: this.config.classNames, type: this.passedElement.element.type }); }; Choices3.prototype._createStructure = function() { this.passedElement.conceal(); this.containerInner.wrap(this.passedElement.element); this.containerOuter.wrap(this.containerInner.element); if (this._isSelectOneElement) { this.input.placeholder = this.config.searchPlaceholderValue || ""; } else if (this._placeholderValue) { this.input.placeholder = this._placeholderValue; this.input.setWidth(); } this.containerOuter.element.appendChild(this.containerInner.element); this.containerOuter.element.appendChild(this.dropdown.element); this.containerInner.element.appendChild(this.itemList.element); if (!this._isTextElement) { this.dropdown.element.appendChild(this.choiceList.element); } if (!this._isSelectOneElement) { this.containerInner.element.appendChild(this.input.element); } else if (this.config.searchEnabled) { this.dropdown.element.insertBefore(this.input.element, this.dropdown.element.firstChild); } if (this._isSelectElement) { this._highlightPosition = 0; this._isSearching = false; this._startLoading(); if (this._presetGroups.length) { this._addPredefinedGroups(this._presetGroups); } else { this._addPredefinedChoices(this._presetChoices); } this._stopLoading(); } if (this._isTextElement) { this._addPredefinedItems(this._presetItems); } }; Choices3.prototype._addPredefinedGroups = function(groups) { var _this = this; var placeholderChoice = this.passedElement.placeholderOption; if (placeholderChoice && placeholderChoice.parentNode && placeholderChoice.parentNode.tagName === "SELECT") { this._addChoice({ value: placeholderChoice.value, label: placeholderChoice.innerHTML, isSelected: placeholderChoice.selected, isDisabled: placeholderChoice.disabled, placeholder: true }); } groups.forEach(function(group) { return _this._addGroup({ group, id: group.id || null }); }); }; Choices3.prototype._addPredefinedChoices = function(choices) { var _this = this; if (this.config.shouldSort) { choices.sort(this.config.sorter); } var hasSelectedChoice = choices.some(function(choice) { return choice.selected; }); var firstEnabledChoiceIndex = choices.findIndex(function(choice) { return choice.disabled === void 0 || !choice.disabled; }); choices.forEach(function(choice, index2) { var _a = choice.value, value = _a === void 0 ? "" : _a, label = choice.label, customProperties = choice.customProperties, placeholder = choice.placeholder; if (_this._isSelectElement) { if (choice.choices) { _this._addGroup({ group: choice, id: choice.id || null }); } else { var shouldPreselect = _this._isSelectOneElement && !hasSelectedChoice && index2 === firstEnabledChoiceIndex; var isSelected = shouldPreselect ? true : choice.selected; var isDisabled = choice.disabled; _this._addChoice({ value, label, isSelected: !!isSelected, isDisabled: !!isDisabled, placeholder: !!placeholder, customProperties }); } } else { _this._addChoice({ value, label, isSelected: !!choice.selected, isDisabled: !!choice.disabled, placeholder: !!choice.placeholder, customProperties }); } }); }; Choices3.prototype._addPredefinedItems = function(items) { var _this = this; items.forEach(function(item2) { if (typeof item2 === "object" && item2.value) { _this._addItem({ value: item2.value, label: item2.label, choiceId: item2.id, customProperties: item2.customProperties, placeholder: item2.placeholder }); } if (typeof item2 === "string") { _this._addItem({ value: item2 }); } }); }; Choices3.prototype._setChoiceOrItem = function(item2) { var _this = this; var itemType = (0, utils_1.getType)(item2).toLowerCase(); var handleType = { object: function() { if (!item2.value) { return; } if (!_this._isTextElement) { _this._addChoice({ value: item2.value, label: item2.label, isSelected: true, isDisabled: false, customProperties: item2.customProperties, placeholder: item2.placeholder }); } else { _this._addItem({ value: item2.value, label: item2.label, choiceId: item2.id, customProperties: item2.customProperties, placeholder: item2.placeholder }); } }, string: function() { if (!_this._isTextElement) { _this._addChoice({ value: item2, label: item2, isSelected: true, isDisabled: false }); } else { _this._addItem({ value: item2 }); } } }; handleType[itemType](); }; Choices3.prototype._findAndSelectChoiceByValue = function(value) { var _this = this; var choices = this._store.choices; var foundChoice = choices.find(function(choice) { return _this.config.valueComparer(choice.value, value); }); if (foundChoice && !foundChoice.selected) { this._addItem({ value: foundChoice.value, label: foundChoice.label, choiceId: foundChoice.id, groupId: foundChoice.groupId, customProperties: foundChoice.customProperties, placeholder: foundChoice.placeholder, keyCode: foundChoice.keyCode }); } }; Choices3.prototype._generatePlaceholderValue = function() { if (this._isSelectElement && this.passedElement.placeholderOption) { var placeholderOption = this.passedElement.placeholderOption; return placeholderOption ? placeholderOption.text : null; } var _a = this.config, placeholder = _a.placeholder, placeholderValue = _a.placeholderValue; var dataset = this.passedElement.element.dataset; if (placeholder) { if (placeholderValue) { return placeholderValue; } if (dataset.placeholder) { return dataset.placeholder; } } return null; }; return Choices3; }(); exports2["default"] = Choices2; }, 613: function(__unused_webpack_module, exports2, __webpack_require__2) { Object.defineProperty(exports2, "__esModule", { value: true }); var utils_1 = __webpack_require__2(799); var constants_1 = __webpack_require__2(883); var Container = function() { function Container2(_a) { var element = _a.element, type = _a.type, classNames = _a.classNames, position = _a.position; this.element = element; this.classNames = classNames; this.type = type; this.position = position; this.isOpen = false; this.isFlipped = false; this.isFocussed = false; this.isDisabled = false; this.isLoading = false; this._onFocus = this._onFocus.bind(this); this._onBlur = this._onBlur.bind(this); } Container2.prototype.addEventListeners = function() { this.element.addEventListener("focus", this._onFocus); this.element.addEventListener("blur", this._onBlur); }; Container2.prototype.removeEventListeners = function() { this.element.removeEventListener("focus", this._onFocus); this.element.removeEventListener("blur", this._onBlur); }; Container2.prototype.shouldFlip = function(dropdownPos) { if (typeof dropdownPos !== "number") { return false; } var shouldFlip = false; if (this.position === "auto") { shouldFlip = !window.matchMedia("(min-height: ".concat(dropdownPos + 1, "px)")).matches; } else if (this.position === "top") { shouldFlip = true; } return shouldFlip; }; Container2.prototype.setActiveDescendant = function(activeDescendantID) { this.element.setAttribute("aria-activedescendant", activeDescendantID); }; Container2.prototype.removeActiveDescendant = function() { this.element.removeAttribute("aria-activedescendant"); }; Container2.prototype.open = function(dropdownPos) { this.element.classList.add(this.classNames.openState); this.element.setAttribute("aria-expanded", "true"); this.isOpen = true; if (this.shouldFlip(dropdownPos)) { this.element.classList.add(this.classNames.flippedState); this.isFlipped = true; } }; Container2.prototype.close = function() { this.element.classList.remove(this.classNames.openState); this.element.setAttribute("aria-expanded", "false"); this.removeActiveDescendant(); this.isOpen = false; if (this.isFlipped) { this.element.classList.remove(this.classNames.flippedState); this.isFlipped = false; } }; Container2.prototype.focus = function() { if (!this.isFocussed) { this.element.focus(); } }; Container2.prototype.addFocusState = function() { this.element.classList.add(this.classNames.focusState); }; Container2.prototype.removeFocusState = function() { this.element.classList.remove(this.classNames.focusState); }; Container2.prototype.enable = function() { this.element.classList.remove(this.classNames.disabledState); this.element.removeAttribute("aria-disabled"); if (this.type === constants_1.SELECT_ONE_TYPE) { this.element.setAttribute("tabindex", "0"); } this.isDisabled = false; }; Container2.prototype.disable = function() { this.element.classList.add(this.classNames.disabledState); this.element.setAttribute("aria-disabled", "true"); if (this.type === constants_1.SELECT_ONE_TYPE) { this.element.setAttribute("tabindex", "-1"); } this.isDisabled = true; }; Container2.prototype.wrap = function(element) { (0, utils_1.wrap)(element, this.element); }; Container2.prototype.unwrap = function(element) { if (this.element.parentNode) { this.element.parentNode.insertBefore(element, this.element); this.element.parentNode.removeChild(this.element); } }; Container2.prototype.addLoadingState = function() { this.element.classList.add(this.classNames.loadingState); this.element.setAttribute("aria-busy", "true"); this.isLoading = true; }; Container2.prototype.removeLoadingState = function() { this.element.classList.remove(this.classNames.loadingState); this.element.removeAttribute("aria-busy"); this.isLoading = false; }; Container2.prototype._onFocus = function() { this.isFocussed = true; }; Container2.prototype._onBlur = function() { this.isFocussed = false; }; return Container2; }(); exports2["default"] = Container; }, 217: function(__unused_webpack_module, exports2) { Object.defineProperty(exports2, "__esModule", { value: true }); var Dropdown = function() { function Dropdown2(_a) { var element = _a.element, type = _a.type, classNames = _a.classNames; this.element = element; this.classNames = classNames; this.type = type; this.isActive = false; } Object.defineProperty(Dropdown2.prototype, "distanceFromTopWindow", { get: function() { return this.element.getBoundingClientRect().bottom; }, enumerable: false, configurable: true }); Dropdown2.prototype.getChild = function(selector) { return this.element.querySelector(selector); }; Dropdown2.prototype.show = function() { this.element.classList.add(this.classNames.activeState); this.element.setAttribute("aria-expanded", "true"); this.isActive = true; return this; }; Dropdown2.prototype.hide = function() { this.element.classList.remove(this.classNames.activeState); this.element.setAttribute("aria-expanded", "false"); this.isActive = false; return this; }; return Dropdown2; }(); exports2["default"] = Dropdown; }, 520: function(__unused_webpack_module, exports2, __webpack_require__2) { var __importDefault = this && this.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { default: mod }; }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.WrappedSelect = exports2.WrappedInput = exports2.List = exports2.Input = exports2.Container = exports2.Dropdown = void 0; var dropdown_1 = __importDefault(__webpack_require__2(217)); exports2.Dropdown = dropdown_1.default; var container_1 = __importDefault(__webpack_require__2(613)); exports2.Container = container_1.default; var input_1 = __importDefault(__webpack_require__2(11)); exports2.Input = input_1.default; var list_1 = __importDefault(__webpack_require__2(624)); exports2.List = list_1.default; var wrapped_input_1 = __importDefault(__webpack_require__2(541)); exports2.WrappedInput = wrapped_input_1.default; var wrapped_select_1 = __importDefault(__webpack_require__2(982)); exports2.WrappedSelect = wrapped_select_1.default; }, 11: function(__unused_webpack_module, exports2, __webpack_require__2) { Object.defineProperty(exports2, "__esModule", { value: true }); var utils_1 = __webpack_require__2(799); var constants_1 = __webpack_require__2(883); var Input = function() { function Input2(_a) { var element = _a.element, type = _a.type, classNames = _a.classNames, preventPaste = _a.preventPaste; this.element = element; this.type = type; this.classNames = classNames; this.preventPaste = preventPaste; this.isFocussed = this.element.isEqualNode(document.activeElement); this.isDisabled = element.disabled; this._onPaste = this._onPaste.bind(this); this._onInput = this._onInput.bind(this); this._onFocus = this._onFocus.bind(this); this._onBlur = this._onBlur.bind(this); } Object.defineProperty(Input2.prototype, "placeholder", { set: function(placeholder) { this.element.placeholder = placeholder; }, enumerable: false, configurable: true }); Object.defineProperty(Input2.prototype, "value", { get: function() { return (0, utils_1.sanitise)(this.element.value); }, set: function(value) { this.element.value = value; }, enumerable: false, configurable: true }); Object.defineProperty(Input2.prototype, "rawValue", { get: function() { return this.element.value; }, enumerable: false, configurable: true }); Input2.prototype.addEventListeners = function() { this.element.addEventListener("paste", this._onPaste); this.element.addEventListener("input", this._onInput, { passive: true }); this.element.addEventListener("focus", this._onFocus, { passive: true }); this.element.addEventListener("blur", this._onBlur, { passive: true }); }; Input2.prototype.removeEventListeners = function() { this.element.removeEventListener("input", this._onInput); this.element.removeEventListener("paste", this._onPaste); this.element.removeEventListener("focus", this._onFocus); this.element.removeEventListener("blur", this._onBlur); }; Input2.prototype.enable = function() { this.element.removeAttribute("disabled"); this.isDisabled = false; }; Input2.prototype.disable = function() { this.element.setAttribute("disabled", ""); this.isDisabled = true; }; Input2.prototype.focus = function() { if (!this.isFocussed) { this.element.focus(); } }; Input2.prototype.blur = function() { if (this.isFocussed) { this.element.blur(); } }; Input2.prototype.clear = function(setWidth) { if (setWidth === void 0) { setWidth = true; } if (this.element.value) { this.element.value = ""; } if (setWidth) { this.setWidth(); } return this; }; Input2.prototype.setWidth = function() { var _a = this.element, style = _a.style, value = _a.value, placeholder = _a.placeholder; style.minWidth = "".concat(placeholder.length + 1, "ch"); style.width = "".concat(value.length + 1, "ch"); }; Input2.prototype.setActiveDescendant = function(activeDescendantID) { this.element.setAttribute("aria-activedescendant", activeDescendantID); }; Input2.prototype.removeActiveDescendant = function() { this.element.removeAttribute("aria-activedescendant"); }; Input2.prototype._onInput = function() { if (this.type !== constants_1.SELECT_ONE_TYPE) { this.setWidth(); } }; Input2.prototype._onPaste = function(event) { if (this.preventPaste) { event.preventDefault(); } }; Input2.prototype._onFocus = function() { this.isFocussed = true; }; Input2.prototype._onBlur = function() { this.isFocussed = false; }; return Input2; }(); exports2["default"] = Input; }, 624: function(__unused_webpack_module, exports2, __webpack_require__2) { Object.defineProperty(exports2, "__esModule", { value: true }); var constants_1 = __webpack_require__2(883); var List = function() { function List2(_a) { var element = _a.element; this.element = element; this.scrollPos = this.element.scrollTop; this.height = this.element.offsetHeight; } List2.prototype.clear = function() { this.element.innerHTML = ""; }; List2.prototype.append = function(node) { this.element.appendChild(node); }; List2.prototype.getChild = function(selector) { return this.element.querySelector(selector); }; List2.prototype.hasChildren = function() { return this.element.hasChildNodes(); }; List2.prototype.scrollToTop = function() { this.element.scrollTop = 0; }; List2.prototype.scrollToChildElement = function(element, direction) { var _this = this; if (!element) { return; } var listHeight = this.element.offsetHeight; var listScrollPosition = this.element.scrollTop + listHeight; var elementHeight = element.offsetHeight; var elementPos = element.offsetTop + elementHeight; var destination = direction > 0 ? this.element.scrollTop + elementPos - listScrollPosition : element.offsetTop; requestAnimationFrame(function() { _this._animateScroll(destination, direction); }); }; List2.prototype._scrollDown = function(scrollPos, strength, destination) { var easing = (destination - scrollPos) / strength; var distance = easing > 1 ? easing : 1; this.element.scrollTop = scrollPos + distance; }; List2.prototype._scrollUp = function(scrollPos, strength, destination) { var easing = (scrollPos - destination) / strength; var distance = easing > 1 ? easing : 1; this.element.scrollTop = scrollPos - distance; }; List2.prototype._animateScroll = function(destination, direction) { var _this = this; var strength = constants_1.SCROLLING_SPEED; var choiceListScrollTop = this.element.scrollTop; var continueAnimation = false; if (direction > 0) { this._scrollDown(choiceListScrollTop, strength, destination); if (choiceListScrollTop < destination) { continueAnimation = true; } } else { this._scrollUp(choiceListScrollTop, strength, destination); if (choiceListScrollTop > destination) { continueAnimation = true; } } if (continueAnimation) { requestAnimationFrame(function() { _this._animateScroll(destination, direction); }); } }; return List2; }(); exports2["default"] = List; }, 730: function(__unused_webpack_module, exports2, __webpack_require__2) { Object.defineProperty(exports2, "__esModule", { value: true }); var utils_1 = __webpack_require__2(799); var WrappedElement = function() { function WrappedElement2(_a) { var element = _a.element, classNames = _a.classNames; this.element = element; this.classNames = classNames; if (!(element instanceof HTMLInputElement) && !(element instanceof HTMLSelectElement)) { throw new TypeError("Invalid element passed"); } this.isDisabled = false; } Object.defineProperty(WrappedElement2.prototype, "isActive", { get: function() { return this.element.dataset.choice === "active"; }, enumerable: false, configurable: true }); Object.defineProperty(WrappedElement2.prototype, "dir", { get: function() { return this.element.dir; }, enumerable: false, configurable: true }); Object.defineProperty(WrappedElement2.prototype, "value", { get: function() { return this.element.value; }, set: function(value) { this.element.value = value; }, enumerable: false, configurable: true }); WrappedElement2.prototype.conceal = function() { this.element.classList.add(this.classNames.input); this.element.hidden = true; this.element.tabIndex = -1; var origStyle = this.element.getAttribute("style"); if (origStyle) { this.element.setAttribute("data-choice-orig-style", origStyle); } this.element.setAttribute("data-choice", "active"); }; WrappedElement2.prototype.reveal = function() { this.element.classList.remove(this.classNames.input); this.element.hidden = false; this.element.removeAttribute("tabindex"); var origStyle = this.element.getAttribute("data-choice-orig-style"); if (origStyle) { this.element.removeAttribute("data-choice-orig-style"); this.element.setAttribute("style", origStyle); } else { this.element.removeAttribute("style"); } this.element.removeAttribute("data-choice"); this.element.value = this.element.value; }; WrappedElement2.prototype.enable = function() { this.element.removeAttribute("disabled"); this.element.disabled = false; this.isDisabled = false; }; WrappedElement2.prototype.disable = function() { this.element.setAttribute("disabled", ""); this.element.disabled = true; this.isDisabled = true; }; WrappedElement2.prototype.triggerEvent = function(eventType, data3) { (0, utils_1.dispatchEvent)(this.element, eventType, data3); }; return WrappedElement2; }(); exports2["default"] = WrappedElement; }, 541: function(__unused_webpack_module, exports2, __webpack_require__2) { var __extends = this && this.__extends || function() { var extendStatics = function(d, b) { extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) { d2.__proto__ = b2; } || function(d2, b2) { for (var p2 in b2) if (Object.prototype.hasOwnProperty.call(b2, p2)) d2[p2] = b2[p2]; }; return extendStatics(d, b); }; return function(d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; }(); var __importDefault = this && this.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { default: mod }; }; Object.defineProperty(exports2, "__esModule", { value: true }); var wrapped_element_1 = __importDefault(__webpack_require__2(730)); var WrappedInput = function(_super) { __extends(WrappedInput2, _super); function WrappedInput2(_a) { var element = _a.element, classNames = _a.classNames, delimiter = _a.delimiter; var _this = _super.call(this, { element, classNames }) || this; _this.delimiter = delimiter; return _this; } Object.defineProperty(WrappedInput2.prototype, "value", { get: function() { return this.element.value; }, set: function(value) { this.element.setAttribute("value", value); this.element.value = value; }, enumerable: false, configurable: true }); return WrappedInput2; }(wrapped_element_1.default); exports2["default"] = WrappedInput; }, 982: function(__unused_webpack_module, exports2, __webpack_require__2) { var __extends = this && this.__extends || function() { var extendStatics = function(d, b) { extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) { d2.__proto__ = b2; } || function(d2, b2) { for (var p2 in b2) if (Object.prototype.hasOwnProperty.call(b2, p2)) d2[p2] = b2[p2]; }; return extendStatics(d, b); }; return function(d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; }(); var __importDefault = this && this.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { default: mod }; }; Object.defineProperty(exports2, "__esModule", { value: true }); var wrapped_element_1 = __importDefault(__webpack_require__2(730)); var WrappedSelect = function(_super) { __extends(WrappedSelect2, _super); function WrappedSelect2(_a) { var element = _a.element, classNames = _a.classNames, template = _a.template; var _this = _super.call(this, { element, classNames }) || this; _this.template = template; return _this; } Object.defineProperty(WrappedSelect2.prototype, "placeholderOption", { get: function() { return this.element.querySelector('option[value=""]') || this.element.querySelector("option[placeholder]"); }, enumerable: false, configurable: true }); Object.defineProperty(WrappedSelect2.prototype, "optionGroups", { get: function() { return Array.from(this.element.getElementsByTagName("OPTGROUP")); }, enumerable: false, configurable: true }); Object.defineProperty(WrappedSelect2.prototype, "options", { get: function() { return Array.from(this.element.options); }, set: function(options2) { var _this = this; var fragment = document.createDocumentFragment(); var addOptionToFragment = function(data3) { var option3 = _this.template(data3); fragment.appendChild(option3); }; options2.forEach(function(optionData) { return addOptionToFragment(optionData); }); this.appendDocFragment(fragment); }, enumerable: false, configurable: true }); WrappedSelect2.prototype.appendDocFragment = function(fragment) { this.element.innerHTML = ""; this.element.appendChild(fragment); }; return WrappedSelect2; }(wrapped_element_1.default); exports2["default"] = WrappedSelect; }, 883: function(__unused_webpack_module, exports2) { Object.defineProperty(exports2, "__esModule", { value: true }); exports2.SCROLLING_SPEED = exports2.SELECT_MULTIPLE_TYPE = exports2.SELECT_ONE_TYPE = exports2.TEXT_TYPE = exports2.KEY_CODES = exports2.ACTION_TYPES = exports2.EVENTS = void 0; exports2.EVENTS = { showDropdown: "showDropdown", hideDropdown: "hideDropdown", change: "change", choice: "choice", search: "search", addItem: "addItem", removeItem: "removeItem", highlightItem: "highlightItem", highlightChoice: "highlightChoice", unhighlightItem: "unhighlightItem" }; exports2.ACTION_TYPES = { ADD_CHOICE: "ADD_CHOICE", FILTER_CHOICES: "FILTER_CHOICES", ACTIVATE_CHOICES: "ACTIVATE_CHOICES", CLEAR_CHOICES: "CLEAR_CHOICES", ADD_GROUP: "ADD_GROUP", ADD_ITEM: "ADD_ITEM", REMOVE_ITEM: "REMOVE_ITEM", HIGHLIGHT_ITEM: "HIGHLIGHT_ITEM", CLEAR_ALL: "CLEAR_ALL", RESET_TO: "RESET_TO", SET_IS_LOADING: "SET_IS_LOADING" }; exports2.KEY_CODES = { BACK_KEY: 46, DELETE_KEY: 8, ENTER_KEY: 13, A_KEY: 65, ESC_KEY: 27, UP_KEY: 38, DOWN_KEY: 40, PAGE_UP_KEY: 33, PAGE_DOWN_KEY: 34 }; exports2.TEXT_TYPE = "text"; exports2.SELECT_ONE_TYPE = "select-one"; exports2.SELECT_MULTIPLE_TYPE = "select-multiple"; exports2.SCROLLING_SPEED = 4; }, 789: function(__unused_webpack_module, exports2, __webpack_require__2) { Object.defineProperty(exports2, "__esModule", { value: true }); exports2.DEFAULT_CONFIG = exports2.DEFAULT_CLASSNAMES = void 0; var utils_1 = __webpack_require__2(799); exports2.DEFAULT_CLASSNAMES = { containerOuter: "choices", containerInner: "choices__inner", input: "choices__input", inputCloned: "choices__input--cloned", list: "choices__list", listItems: "choices__list--multiple", listSingle: "choices__list--single", listDropdown: "choices__list--dropdown", item: "choices__item", itemSelectable: "choices__item--selectable", itemDisabled: "choices__item--disabled", itemChoice: "choices__item--choice", placeholder: "choices__placeholder", group: "choices__group", groupHeading: "choices__heading", button: "choices__button", activeState: "is-active", focusState: "is-focused", openState: "is-open", disabledState: "is-disabled", highlightedState: "is-highlighted", selectedState: "is-selected", flippedState: "is-flipped", loadingState: "is-loading", noResults: "has-no-results", noChoices: "has-no-choices" }; exports2.DEFAULT_CONFIG = { items: [], choices: [], silent: false, renderChoiceLimit: -1, maxItemCount: -1, addItems: true, addItemFilter: null, removeItems: true, removeItemButton: false, editItems: false, allowHTML: true, duplicateItemsAllowed: true, delimiter: ",", paste: true, searchEnabled: true, searchChoices: true, searchFloor: 1, searchResultLimit: 4, searchFields: ["label", "value"], position: "auto", resetScrollPosition: true, shouldSort: true, shouldSortItems: false, sorter: utils_1.sortByAlpha, placeholder: true, placeholderValue: null, searchPlaceholderValue: null, prependValue: null, appendValue: null, renderSelectedChoices: "auto", loadingText: "Loading...", noResultsText: "No results found", noChoicesText: "No choices to choose from", itemSelectText: "Press to select", uniqueItemText: "Only unique values can be added", customAddItemText: "Only values matching specific conditions can be added", addItemText: function(value) { return 'Press Enter to add "'.concat((0, utils_1.sanitise)(value), '"'); }, maxItemText: function(maxItemCount) { return "Only ".concat(maxItemCount, " values can be added"); }, valueComparer: function(value1, value2) { return value1 === value2; }, fuseOptions: { includeScore: true }, labelId: "", callbackOnInit: null, callbackOnCreateTemplates: null, classNames: exports2.DEFAULT_CLASSNAMES }; }, 18: function(__unused_webpack_module, exports2) { Object.defineProperty(exports2, "__esModule", { value: true }); }, 978: function(__unused_webpack_module, exports2) { Object.defineProperty(exports2, "__esModule", { value: true }); }, 948: function(__unused_webpack_module, exports2) { Object.defineProperty(exports2, "__esModule", { value: true }); }, 359: function(__unused_webpack_module, exports2) { Object.defineProperty(exports2, "__esModule", { value: true }); }, 285: function(__unused_webpack_module, exports2) { Object.defineProperty(exports2, "__esModule", { value: true }); }, 533: function(__unused_webpack_module, exports2) { Object.defineProperty(exports2, "__esModule", { value: true }); }, 187: function(__unused_webpack_module, exports2, __webpack_require__2) { var __createBinding = this && this.__createBinding || (Object.create ? function(o2, m, k, k2) { if (k2 === void 0) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o2, k2, desc); } : function(o2, m, k, k2) { if (k2 === void 0) k2 = k; o2[k2] = m[k]; }); var __exportStar2 = this && this.__exportStar || function(m, exports3) { for (var p2 in m) if (p2 !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p2)) __createBinding(exports3, m, p2); }; Object.defineProperty(exports2, "__esModule", { value: true }); __exportStar2(__webpack_require__2(18), exports2); __exportStar2(__webpack_require__2(978), exports2); __exportStar2(__webpack_require__2(948), exports2); __exportStar2(__webpack_require__2(359), exports2); __exportStar2(__webpack_require__2(285), exports2); __exportStar2(__webpack_require__2(533), exports2); __exportStar2(__webpack_require__2(287), exports2); __exportStar2(__webpack_require__2(132), exports2); __exportStar2(__webpack_require__2(837), exports2); __exportStar2(__webpack_require__2(598), exports2); __exportStar2(__webpack_require__2(369), exports2); __exportStar2(__webpack_require__2(37), exports2); __exportStar2(__webpack_require__2(47), exports2); __exportStar2(__webpack_require__2(923), exports2); __exportStar2(__webpack_require__2(876), exports2); }, 287: function(__unused_webpack_module, exports2) { Object.defineProperty(exports2, "__esModule", { value: true }); }, 132: function(__unused_webpack_module, exports2) { Object.defineProperty(exports2, "__esModule", { value: true }); }, 837: function(__unused_webpack_module, exports2) { Object.defineProperty(exports2, "__esModule", { value: true }); }, 598: function(__unused_webpack_module, exports2) { Object.defineProperty(exports2, "__esModule", { value: true }); }, 37: function(__unused_webpack_module, exports2) { Object.defineProperty(exports2, "__esModule", { value: true }); }, 369: function(__unused_webpack_module, exports2) { Object.defineProperty(exports2, "__esModule", { value: true }); }, 47: function(__unused_webpack_module, exports2) { Object.defineProperty(exports2, "__esModule", { value: true }); }, 923: function(__unused_webpack_module, exports2) { Object.defineProperty(exports2, "__esModule", { value: true }); }, 876: function(__unused_webpack_module, exports2) { Object.defineProperty(exports2, "__esModule", { value: true }); }, 799: function(__unused_webpack_module, exports2) { Object.defineProperty(exports2, "__esModule", { value: true }); exports2.parseCustomProperties = exports2.diff = exports2.cloneObject = exports2.existsInArray = exports2.dispatchEvent = exports2.sortByScore = exports2.sortByAlpha = exports2.strToEl = exports2.sanitise = exports2.isScrolledIntoView = exports2.getAdjacentEl = exports2.wrap = exports2.isType = exports2.getType = exports2.generateId = exports2.generateChars = exports2.getRandomNumber = void 0; var getRandomNumber2 = function(min3, max3) { return Math.floor(Math.random() * (max3 - min3) + min3); }; exports2.getRandomNumber = getRandomNumber2; var generateChars = function(length) { return Array.from({ length }, function() { return (0, exports2.getRandomNumber)(0, 36).toString(36); }).join(""); }; exports2.generateChars = generateChars; var generateId = function(element, prefix) { var id = element.id || element.name && "".concat(element.name, "-").concat((0, exports2.generateChars)(2)) || (0, exports2.generateChars)(4); id = id.replace(/(:|\.|\[|\]|,)/g, ""); id = "".concat(prefix, "-").concat(id); return id; }; exports2.generateId = generateId; var getType2 = function(obj) { return Object.prototype.toString.call(obj).slice(8, -1); }; exports2.getType = getType2; var isType = function(type, obj) { return obj !== void 0 && obj !== null && (0, exports2.getType)(obj) === type; }; exports2.isType = isType; var wrap2 = function(element, wrapper3) { if (wrapper3 === void 0) { wrapper3 = document.createElement("div"); } if (element.parentNode) { if (element.nextSibling) { element.parentNode.insertBefore(wrapper3, element.nextSibling); } else { element.parentNode.appendChild(wrapper3); } } return wrapper3.appendChild(element); }; exports2.wrap = wrap2; var getAdjacentEl = function(startEl, selector, direction) { if (direction === void 0) { direction = 1; } var prop = "".concat(direction > 0 ? "next" : "previous", "ElementSibling"); var sibling = startEl[prop]; while (sibling) { if (sibling.matches(selector)) { return sibling; } sibling = sibling[prop]; } return sibling; }; exports2.getAdjacentEl = getAdjacentEl; var isScrolledIntoView = function(element, parent, direction) { if (direction === void 0) { direction = 1; } if (!element) { return false; } var isVisible; if (direction > 0) { isVisible = parent.scrollTop + parent.offsetHeight >= element.offsetTop + element.offsetHeight; } else { isVisible = element.offsetTop >= parent.scrollTop; } return isVisible; }; exports2.isScrolledIntoView = isScrolledIntoView; var sanitise = function(value) { if (typeof value !== "string") { return value; } return value.replace(/&/g, "&").replace(/>/g, ">").replace(/ -1) { return state2.map(function(obj) { var choice2 = obj; if (choice2.id === parseInt("".concat(addItemAction_1.choiceId), 10)) { choice2.selected = true; } return choice2; }); } return state2; } case "REMOVE_ITEM": { var removeItemAction_1 = action; if (removeItemAction_1.choiceId && removeItemAction_1.choiceId > -1) { return state2.map(function(obj) { var choice2 = obj; if (choice2.id === parseInt("".concat(removeItemAction_1.choiceId), 10)) { choice2.selected = false; } return choice2; }); } return state2; } case "FILTER_CHOICES": { var filterChoicesAction_1 = action; return state2.map(function(obj) { var choice2 = obj; choice2.active = filterChoicesAction_1.results.some(function(_a) { var item2 = _a.item, score = _a.score; if (item2.id === choice2.id) { choice2.score = score; return true; } return false; }); return choice2; }); } case "ACTIVATE_CHOICES": { var activateChoicesAction_1 = action; return state2.map(function(obj) { var choice2 = obj; choice2.active = activateChoicesAction_1.active; return choice2; }); } case "CLEAR_CHOICES": { return exports2.defaultState; } default: { return state2; } } } exports2["default"] = choices; }, 871: function(__unused_webpack_module, exports2) { var __spreadArray = this && this.__spreadArray || function(to, from, pack) { if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { if (ar || !(i in from)) { if (!ar) ar = Array.prototype.slice.call(from, 0, i); ar[i] = from[i]; } } return to.concat(ar || Array.prototype.slice.call(from)); }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.defaultState = void 0; exports2.defaultState = []; function groups(state2, action) { if (state2 === void 0) { state2 = exports2.defaultState; } if (action === void 0) { action = {}; } switch (action.type) { case "ADD_GROUP": { var addGroupAction = action; return __spreadArray(__spreadArray([], state2, true), [{ id: addGroupAction.id, value: addGroupAction.value, active: addGroupAction.active, disabled: addGroupAction.disabled }], false); } case "CLEAR_CHOICES": { return []; } default: { return state2; } } } exports2["default"] = groups; }, 655: function(__unused_webpack_module, exports2, __webpack_require__2) { var __importDefault = this && this.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { default: mod }; }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.defaultState = void 0; var redux_1 = __webpack_require__2(791); var items_1 = __importDefault(__webpack_require__2(52)); var groups_1 = __importDefault(__webpack_require__2(871)); var choices_1 = __importDefault(__webpack_require__2(273)); var loading_1 = __importDefault(__webpack_require__2(502)); var utils_1 = __webpack_require__2(799); exports2.defaultState = { groups: [], items: [], choices: [], loading: false }; var appReducer = (0, redux_1.combineReducers)({ items: items_1.default, groups: groups_1.default, choices: choices_1.default, loading: loading_1.default }); var rootReducer = function(passedState, action) { var state2 = passedState; if (action.type === "CLEAR_ALL") { state2 = exports2.defaultState; } else if (action.type === "RESET_TO") { return (0, utils_1.cloneObject)(action.state); } return appReducer(state2, action); }; exports2["default"] = rootReducer; }, 52: function(__unused_webpack_module, exports2) { var __spreadArray = this && this.__spreadArray || function(to, from, pack) { if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { if (ar || !(i in from)) { if (!ar) ar = Array.prototype.slice.call(from, 0, i); ar[i] = from[i]; } } return to.concat(ar || Array.prototype.slice.call(from)); }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.defaultState = void 0; exports2.defaultState = []; function items(state2, action) { if (state2 === void 0) { state2 = exports2.defaultState; } if (action === void 0) { action = {}; } switch (action.type) { case "ADD_ITEM": { var addItemAction = action; var newState = __spreadArray(__spreadArray([], state2, true), [{ id: addItemAction.id, choiceId: addItemAction.choiceId, groupId: addItemAction.groupId, value: addItemAction.value, label: addItemAction.label, active: true, highlighted: false, customProperties: addItemAction.customProperties, placeholder: addItemAction.placeholder || false, keyCode: null }], false); return newState.map(function(obj) { var item2 = obj; item2.highlighted = false; return item2; }); } case "REMOVE_ITEM": { return state2.map(function(obj) { var item2 = obj; if (item2.id === action.id) { item2.active = false; } return item2; }); } case "HIGHLIGHT_ITEM": { var highlightItemAction_1 = action; return state2.map(function(obj) { var item2 = obj; if (item2.id === highlightItemAction_1.id) { item2.highlighted = highlightItemAction_1.highlighted; } return item2; }); } default: { return state2; } } } exports2["default"] = items; }, 502: function(__unused_webpack_module, exports2) { Object.defineProperty(exports2, "__esModule", { value: true }); exports2.defaultState = void 0; exports2.defaultState = false; var general = function(state2, action) { if (state2 === void 0) { state2 = exports2.defaultState; } if (action === void 0) { action = {}; } switch (action.type) { case "SET_IS_LOADING": { return action.isLoading; } default: { return state2; } } }; exports2["default"] = general; }, 744: function(__unused_webpack_module, exports2, __webpack_require__2) { var __spreadArray = this && this.__spreadArray || function(to, from, pack) { if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { if (ar || !(i in from)) { if (!ar) ar = Array.prototype.slice.call(from, 0, i); ar[i] = from[i]; } } return to.concat(ar || Array.prototype.slice.call(from)); }; var __importDefault = this && this.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { default: mod }; }; Object.defineProperty(exports2, "__esModule", { value: true }); var redux_1 = __webpack_require__2(791); var index_1 = __importDefault(__webpack_require__2(655)); var Store = function() { function Store2() { this._store = (0, redux_1.createStore)(index_1.default, window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()); } Store2.prototype.subscribe = function(onChange2) { this._store.subscribe(onChange2); }; Store2.prototype.dispatch = function(action) { this._store.dispatch(action); }; Object.defineProperty(Store2.prototype, "state", { get: function() { return this._store.getState(); }, enumerable: false, configurable: true }); Object.defineProperty(Store2.prototype, "items", { get: function() { return this.state.items; }, enumerable: false, configurable: true }); Object.defineProperty(Store2.prototype, "activeItems", { get: function() { return this.items.filter(function(item2) { return item2.active === true; }); }, enumerable: false, configurable: true }); Object.defineProperty(Store2.prototype, "highlightedActiveItems", { get: function() { return this.items.filter(function(item2) { return item2.active && item2.highlighted; }); }, enumerable: false, configurable: true }); Object.defineProperty(Store2.prototype, "choices", { get: function() { return this.state.choices; }, enumerable: false, configurable: true }); Object.defineProperty(Store2.prototype, "activeChoices", { get: function() { return this.choices.filter(function(choice) { return choice.active === true; }); }, enumerable: false, configurable: true }); Object.defineProperty(Store2.prototype, "selectableChoices", { get: function() { return this.choices.filter(function(choice) { return choice.disabled !== true; }); }, enumerable: false, configurable: true }); Object.defineProperty(Store2.prototype, "searchableChoices", { get: function() { return this.selectableChoices.filter(function(choice) { return choice.placeholder !== true; }); }, enumerable: false, configurable: true }); Object.defineProperty(Store2.prototype, "placeholderChoice", { get: function() { return __spreadArray([], this.choices, true).reverse().find(function(choice) { return choice.placeholder === true; }); }, enumerable: false, configurable: true }); Object.defineProperty(Store2.prototype, "groups", { get: function() { return this.state.groups; }, enumerable: false, configurable: true }); Object.defineProperty(Store2.prototype, "activeGroups", { get: function() { var _a = this, groups = _a.groups, choices = _a.choices; return groups.filter(function(group) { var isActive = group.active === true && group.disabled === false; var hasActiveOptions = choices.some(function(choice) { return choice.active === true && choice.disabled === false; }); return isActive && hasActiveOptions; }, []); }, enumerable: false, configurable: true }); Store2.prototype.isLoading = function() { return this.state.loading; }; Store2.prototype.getChoiceById = function(id) { return this.activeChoices.find(function(choice) { return choice.id === parseInt(id, 10); }); }; Store2.prototype.getGroupById = function(id) { return this.groups.find(function(group) { return group.id === id; }); }; return Store2; }(); exports2["default"] = Store; }, 686: function(__unused_webpack_module, exports2) { Object.defineProperty(exports2, "__esModule", { value: true }); var templates = { containerOuter: function(_a, dir, isSelectElement, isSelectOneElement, searchEnabled, passedElementType, labelId) { var containerOuter = _a.classNames.containerOuter; var div = Object.assign(document.createElement("div"), { className: containerOuter }); div.dataset.type = passedElementType; if (dir) { div.dir = dir; } if (isSelectOneElement) { div.tabIndex = 0; } if (isSelectElement) { div.setAttribute("role", searchEnabled ? "combobox" : "listbox"); if (searchEnabled) { div.setAttribute("aria-autocomplete", "list"); } } div.setAttribute("aria-haspopup", "true"); div.setAttribute("aria-expanded", "false"); if (labelId) { div.setAttribute("aria-labelledby", labelId); } return div; }, containerInner: function(_a) { var containerInner = _a.classNames.containerInner; return Object.assign(document.createElement("div"), { className: containerInner }); }, itemList: function(_a, isSelectOneElement) { var _b = _a.classNames, list2 = _b.list, listSingle = _b.listSingle, listItems = _b.listItems; return Object.assign(document.createElement("div"), { className: "".concat(list2, " ").concat(isSelectOneElement ? listSingle : listItems) }); }, placeholder: function(_a, value) { var _b; var allowHTML = _a.allowHTML, placeholder = _a.classNames.placeholder; return Object.assign(document.createElement("div"), (_b = { className: placeholder }, _b[allowHTML ? "innerHTML" : "innerText"] = value, _b)); }, item: function(_a, _b, removeItemButton) { var _c, _d; var allowHTML = _a.allowHTML, _e = _a.classNames, item2 = _e.item, button = _e.button, highlightedState = _e.highlightedState, itemSelectable = _e.itemSelectable, placeholder = _e.placeholder; var id = _b.id, value = _b.value, label = _b.label, customProperties = _b.customProperties, active = _b.active, disabled = _b.disabled, highlighted = _b.highlighted, isPlaceholder = _b.placeholder; var div = Object.assign(document.createElement("div"), (_c = { className: item2 }, _c[allowHTML ? "innerHTML" : "innerText"] = label, _c)); Object.assign(div.dataset, { item: "", id, value, customProperties }); if (active) { div.setAttribute("aria-selected", "true"); } if (disabled) { div.setAttribute("aria-disabled", "true"); } if (isPlaceholder) { div.classList.add(placeholder); } div.classList.add(highlighted ? highlightedState : itemSelectable); if (removeItemButton) { if (disabled) { div.classList.remove(itemSelectable); } div.dataset.deletable = ""; var REMOVE_ITEM_TEXT = "Remove item"; var removeButton = Object.assign(document.createElement("button"), (_d = { type: "button", className: button }, _d[allowHTML ? "innerHTML" : "innerText"] = REMOVE_ITEM_TEXT, _d)); removeButton.setAttribute("aria-label", "".concat(REMOVE_ITEM_TEXT, ": '").concat(value, "'")); removeButton.dataset.button = ""; div.appendChild(removeButton); } return div; }, choiceList: function(_a, isSelectOneElement) { var list2 = _a.classNames.list; var div = Object.assign(document.createElement("div"), { className: list2 }); if (!isSelectOneElement) { div.setAttribute("aria-multiselectable", "true"); } div.setAttribute("role", "listbox"); return div; }, choiceGroup: function(_a, _b) { var _c; var allowHTML = _a.allowHTML, _d = _a.classNames, group = _d.group, groupHeading = _d.groupHeading, itemDisabled = _d.itemDisabled; var id = _b.id, value = _b.value, disabled = _b.disabled; var div = Object.assign(document.createElement("div"), { className: "".concat(group, " ").concat(disabled ? itemDisabled : "") }); div.setAttribute("role", "group"); Object.assign(div.dataset, { group: "", id, value }); if (disabled) { div.setAttribute("aria-disabled", "true"); } div.appendChild(Object.assign(document.createElement("div"), (_c = { className: groupHeading }, _c[allowHTML ? "innerHTML" : "innerText"] = value, _c))); return div; }, choice: function(_a, _b, selectText) { var _c; var allowHTML = _a.allowHTML, _d = _a.classNames, item2 = _d.item, itemChoice = _d.itemChoice, itemSelectable = _d.itemSelectable, selectedState = _d.selectedState, itemDisabled = _d.itemDisabled, placeholder = _d.placeholder; var id = _b.id, value = _b.value, label = _b.label, groupId = _b.groupId, elementId = _b.elementId, isDisabled = _b.disabled, isSelected = _b.selected, isPlaceholder = _b.placeholder; var div = Object.assign(document.createElement("div"), (_c = { id: elementId }, _c[allowHTML ? "innerHTML" : "innerText"] = label, _c.className = "".concat(item2, " ").concat(itemChoice), _c)); if (isSelected) { div.classList.add(selectedState); } if (isPlaceholder) { div.classList.add(placeholder); } div.setAttribute("role", groupId && groupId > 0 ? "treeitem" : "option"); Object.assign(div.dataset, { choice: "", id, value, selectText }); if (isDisabled) { div.classList.add(itemDisabled); div.dataset.choiceDisabled = ""; div.setAttribute("aria-disabled", "true"); } else { div.classList.add(itemSelectable); div.dataset.choiceSelectable = ""; } return div; }, input: function(_a, placeholderValue) { var _b = _a.classNames, input = _b.input, inputCloned = _b.inputCloned; var inp = Object.assign(document.createElement("input"), { type: "search", name: "search_terms", className: "".concat(input, " ").concat(inputCloned), autocomplete: "off", autocapitalize: "off", spellcheck: false }); inp.setAttribute("role", "textbox"); inp.setAttribute("aria-autocomplete", "list"); inp.setAttribute("aria-label", placeholderValue); return inp; }, dropdown: function(_a) { var _b = _a.classNames, list2 = _b.list, listDropdown = _b.listDropdown; var div = document.createElement("div"); div.classList.add(list2, listDropdown); div.setAttribute("aria-expanded", "false"); return div; }, notice: function(_a, innerText, type) { var _b; var allowHTML = _a.allowHTML, _c = _a.classNames, item2 = _c.item, itemChoice = _c.itemChoice, noResults = _c.noResults, noChoices = _c.noChoices; if (type === void 0) { type = ""; } var classes = [item2, itemChoice]; if (type === "no-choices") { classes.push(noChoices); } else if (type === "no-results") { classes.push(noResults); } return Object.assign(document.createElement("div"), (_b = {}, _b[allowHTML ? "innerHTML" : "innerText"] = innerText, _b.className = classes.join(" "), _b)); }, option: function(_a) { var label = _a.label, value = _a.value, customProperties = _a.customProperties, active = _a.active, disabled = _a.disabled; var opt = new Option(label, value, false, active); if (customProperties) { opt.dataset.customProperties = "".concat(customProperties); } opt.disabled = !!disabled; return opt; } }; exports2["default"] = templates; }, 996: function(module2) { var isMergeableObject = function isMergeableObject2(value) { return isNonNullObject(value) && !isSpecial(value); }; function isNonNullObject(value) { return !!value && typeof value === "object"; } function isSpecial(value) { var stringValue = Object.prototype.toString.call(value); return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value); } var canUseSymbol = typeof Symbol === "function" && Symbol.for; var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103; function isReactElement(value) { return value.$$typeof === REACT_ELEMENT_TYPE; } function emptyTarget(val) { return Array.isArray(val) ? [] : {}; } function cloneUnlessOtherwiseSpecified(value, options2) { return options2.clone !== false && options2.isMergeableObject(value) ? deepmerge(emptyTarget(value), value, options2) : value; } function defaultArrayMerge(target, source, options2) { return target.concat(source).map(function(element) { return cloneUnlessOtherwiseSpecified(element, options2); }); } function getMergeFunction(key, options2) { if (!options2.customMerge) { return deepmerge; } var customMerge = options2.customMerge(key); return typeof customMerge === "function" ? customMerge : deepmerge; } function getEnumerableOwnPropertySymbols(target) { return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) { return target.propertyIsEnumerable(symbol); }) : []; } function getKeys(target) { return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target)); } function propertyIsOnObject(object, property) { try { return property in object; } catch (_) { return false; } } function propertyIsUnsafe(target, key) { return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key)); } function mergeObject(target, source, options2) { var destination = {}; if (options2.isMergeableObject(target)) { getKeys(target).forEach(function(key) { destination[key] = cloneUnlessOtherwiseSpecified(target[key], options2); }); } getKeys(source).forEach(function(key) { if (propertyIsUnsafe(target, key)) { return; } if (propertyIsOnObject(target, key) && options2.isMergeableObject(source[key])) { destination[key] = getMergeFunction(key, options2)(target[key], source[key], options2); } else { destination[key] = cloneUnlessOtherwiseSpecified(source[key], options2); } }); return destination; } function deepmerge(target, source, options2) { options2 = options2 || {}; options2.arrayMerge = options2.arrayMerge || defaultArrayMerge; options2.isMergeableObject = options2.isMergeableObject || isMergeableObject; options2.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified; var sourceIsArray = Array.isArray(source); var targetIsArray = Array.isArray(target); var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray; if (!sourceAndTargetTypesMatch) { return cloneUnlessOtherwiseSpecified(source, options2); } else if (sourceIsArray) { return options2.arrayMerge(target, source, options2); } else { return mergeObject(target, source, options2); } } deepmerge.all = function deepmergeAll(array, options2) { if (!Array.isArray(array)) { throw new Error("first argument should be an array"); } return array.reduce(function(prev, next) { return deepmerge(prev, next, options2); }, {}); }; var deepmerge_1 = deepmerge; module2.exports = deepmerge_1; }, 221: function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) { __webpack_require__2.r(__webpack_exports__2); __webpack_require__2.d(__webpack_exports__2, { default: function() { return Fuse; } }); function isArray2(value) { return !Array.isArray ? getTag(value) === "[object Array]" : Array.isArray(value); } const INFINITY = 1 / 0; function baseToString(value) { if (typeof value == "string") { return value; } let result = value + ""; return result == "0" && 1 / value == -INFINITY ? "-0" : result; } function toString2(value) { return value == null ? "" : baseToString(value); } function isString3(value) { return typeof value === "string"; } function isNumber2(value) { return typeof value === "number"; } function isBoolean2(value) { return value === true || value === false || isObjectLike(value) && getTag(value) == "[object Boolean]"; } function isObject2(value) { return typeof value === "object"; } function isObjectLike(value) { return isObject2(value) && value !== null; } function isDefined4(value) { return value !== void 0 && value !== null; } function isBlank(value) { return !value.trim().length; } function getTag(value) { return value == null ? value === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(value); } const EXTENDED_SEARCH_UNAVAILABLE = "Extended search is not available"; const INCORRECT_INDEX_TYPE = "Incorrect 'index' type"; const LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY = (key) => `Invalid value for key ${key}`; const PATTERN_LENGTH_TOO_LARGE = (max3) => `Pattern length exceeds max of ${max3}.`; const MISSING_KEY_PROPERTY = (name2) => `Missing ${name2} property in key`; const INVALID_KEY_WEIGHT_VALUE = (key) => `Property 'weight' in key '${key}' must be a positive integer`; const hasOwn = Object.prototype.hasOwnProperty; class KeyStore { constructor(keys) { this._keys = []; this._keyMap = {}; let totalWeight = 0; keys.forEach((key) => { let obj = createKey(key); totalWeight += obj.weight; this._keys.push(obj); this._keyMap[obj.id] = obj; totalWeight += obj.weight; }); this._keys.forEach((key) => { key.weight /= totalWeight; }); } get(keyId) { return this._keyMap[keyId]; } keys() { return this._keys; } toJSON() { return JSON.stringify(this._keys); } } function createKey(key) { let path = null; let id = null; let src = null; let weight = 1; let getFn = null; if (isString3(key) || isArray2(key)) { src = key; path = createKeyPath(key); id = createKeyId(key); } else { if (!hasOwn.call(key, "name")) { throw new Error(MISSING_KEY_PROPERTY("name")); } const name2 = key.name; src = name2; if (hasOwn.call(key, "weight")) { weight = key.weight; if (weight <= 0) { throw new Error(INVALID_KEY_WEIGHT_VALUE(name2)); } } path = createKeyPath(name2); id = createKeyId(name2); getFn = key.getFn; } return {path, id, weight, src, getFn}; } function createKeyPath(key) { return isArray2(key) ? key : key.split("."); } function createKeyId(key) { return isArray2(key) ? key.join(".") : key; } function get(obj, path) { let list2 = []; let arr = false; const deepGet = (obj2, path2, index2) => { if (!isDefined4(obj2)) { return; } if (!path2[index2]) { list2.push(obj2); } else { let key = path2[index2]; const value = obj2[key]; if (!isDefined4(value)) { return; } if (index2 === path2.length - 1 && (isString3(value) || isNumber2(value) || isBoolean2(value))) { list2.push(toString2(value)); } else if (isArray2(value)) { arr = true; for (let i = 0, len = value.length; i < len; i += 1) { deepGet(value[i], path2, index2 + 1); } } else if (path2.length) { deepGet(value, path2, index2 + 1); } } }; deepGet(obj, isString3(path) ? path.split(".") : path, 0); return arr ? list2 : list2[0]; } const MatchOptions = { includeMatches: false, findAllMatches: false, minMatchCharLength: 1 }; const BasicOptions = { isCaseSensitive: false, includeScore: false, keys: [], shouldSort: true, sortFn: (a2, b) => a2.score === b.score ? a2.idx < b.idx ? -1 : 1 : a2.score < b.score ? -1 : 1 }; const FuzzyOptions = { location: 0, threshold: 0.6, distance: 100 }; const AdvancedOptions = { useExtendedSearch: false, getFn: get, ignoreLocation: false, ignoreFieldNorm: false, fieldNormWeight: 1 }; var Config = { ...BasicOptions, ...MatchOptions, ...FuzzyOptions, ...AdvancedOptions }; const SPACE = /[^ ]+/g; function norm(weight = 1, mantissa = 3) { const cache2 = new Map(); const m = Math.pow(10, mantissa); return { get(value) { const numTokens = value.match(SPACE).length; if (cache2.has(numTokens)) { return cache2.get(numTokens); } const norm2 = 1 / Math.pow(numTokens, 0.5 * weight); const n2 = parseFloat(Math.round(norm2 * m) / m); cache2.set(numTokens, n2); return n2; }, clear() { cache2.clear(); } }; } class FuseIndex { constructor({ getFn = Config.getFn, fieldNormWeight = Config.fieldNormWeight } = {}) { this.norm = norm(fieldNormWeight, 3); this.getFn = getFn; this.isCreated = false; this.setIndexRecords(); } setSources(docs = []) { this.docs = docs; } setIndexRecords(records = []) { this.records = records; } setKeys(keys = []) { this.keys = keys; this._keysMap = {}; keys.forEach((key, idx) => { this._keysMap[key.id] = idx; }); } create() { if (this.isCreated || !this.docs.length) { return; } this.isCreated = true; if (isString3(this.docs[0])) { this.docs.forEach((doc, docIndex) => { this._addString(doc, docIndex); }); } else { this.docs.forEach((doc, docIndex) => { this._addObject(doc, docIndex); }); } this.norm.clear(); } add(doc) { const idx = this.size(); if (isString3(doc)) { this._addString(doc, idx); } else { this._addObject(doc, idx); } } removeAt(idx) { this.records.splice(idx, 1); for (let i = idx, len = this.size(); i < len; i += 1) { this.records[i].i -= 1; } } getValueForItemAtKeyId(item2, keyId) { return item2[this._keysMap[keyId]]; } size() { return this.records.length; } _addString(doc, docIndex) { if (!isDefined4(doc) || isBlank(doc)) { return; } let record = { v: doc, i: docIndex, n: this.norm.get(doc) }; this.records.push(record); } _addObject(doc, docIndex) { let record = {i: docIndex, $: {}}; this.keys.forEach((key, keyIndex) => { let value = key.getFn ? key.getFn(doc) : this.getFn(doc, key.path); if (!isDefined4(value)) { return; } if (isArray2(value)) { let subRecords = []; const stack = [{nestedArrIndex: -1, value}]; while (stack.length) { const {nestedArrIndex, value: value2} = stack.pop(); if (!isDefined4(value2)) { continue; } if (isString3(value2) && !isBlank(value2)) { let subRecord = { v: value2, i: nestedArrIndex, n: this.norm.get(value2) }; subRecords.push(subRecord); } else if (isArray2(value2)) { value2.forEach((item2, k) => { stack.push({ nestedArrIndex: k, value: item2 }); }); } else ; } record.$[keyIndex] = subRecords; } else if (isString3(value) && !isBlank(value)) { let subRecord = { v: value, n: this.norm.get(value) }; record.$[keyIndex] = subRecord; } }); this.records.push(record); } toJSON() { return { keys: this.keys, records: this.records }; } } function createIndex(keys, docs, {getFn = Config.getFn, fieldNormWeight = Config.fieldNormWeight} = {}) { const myIndex = new FuseIndex({getFn, fieldNormWeight}); myIndex.setKeys(keys.map(createKey)); myIndex.setSources(docs); myIndex.create(); return myIndex; } function parseIndex(data3, {getFn = Config.getFn, fieldNormWeight = Config.fieldNormWeight} = {}) { const {keys, records} = data3; const myIndex = new FuseIndex({getFn, fieldNormWeight}); myIndex.setKeys(keys); myIndex.setIndexRecords(records); return myIndex; } function computeScore$1(pattern, { errors = 0, currentLocation = 0, expectedLocation = 0, distance = Config.distance, ignoreLocation = Config.ignoreLocation } = {}) { const accuracy = errors / pattern.length; if (ignoreLocation) { return accuracy; } const proximity = Math.abs(expectedLocation - currentLocation); if (!distance) { return proximity ? 1 : accuracy; } return accuracy + proximity / distance; } function convertMaskToIndices(matchmask = [], minMatchCharLength = Config.minMatchCharLength) { let indices = []; let start = -1; let end = -1; let i = 0; for (let len = matchmask.length; i < len; i += 1) { let match = matchmask[i]; if (match && start === -1) { start = i; } else if (!match && start !== -1) { end = i - 1; if (end - start + 1 >= minMatchCharLength) { indices.push([start, end]); } start = -1; } } if (matchmask[i - 1] && i - start >= minMatchCharLength) { indices.push([start, i - 1]); } return indices; } const MAX_BITS = 32; function search(text3, pattern, patternAlphabet, { location: location2 = Config.location, distance = Config.distance, threshold = Config.threshold, findAllMatches = Config.findAllMatches, minMatchCharLength = Config.minMatchCharLength, includeMatches = Config.includeMatches, ignoreLocation = Config.ignoreLocation } = {}) { if (pattern.length > MAX_BITS) { throw new Error(PATTERN_LENGTH_TOO_LARGE(MAX_BITS)); } const patternLen = pattern.length; const textLen = text3.length; const expectedLocation = Math.max(0, Math.min(location2, textLen)); let currentThreshold = threshold; let bestLocation = expectedLocation; const computeMatches = minMatchCharLength > 1 || includeMatches; const matchMask = computeMatches ? Array(textLen) : []; let index2; while ((index2 = text3.indexOf(pattern, bestLocation)) > -1) { let score = computeScore$1(pattern, { currentLocation: index2, expectedLocation, distance, ignoreLocation }); currentThreshold = Math.min(score, currentThreshold); bestLocation = index2 + patternLen; if (computeMatches) { let i = 0; while (i < patternLen) { matchMask[index2 + i] = 1; i += 1; } } } bestLocation = -1; let lastBitArr = []; let finalScore = 1; let binMax = patternLen + textLen; const mask = 1 << patternLen - 1; for (let i = 0; i < patternLen; i += 1) { let binMin = 0; let binMid = binMax; while (binMin < binMid) { const score2 = computeScore$1(pattern, { errors: i, currentLocation: expectedLocation + binMid, expectedLocation, distance, ignoreLocation }); if (score2 <= currentThreshold) { binMin = binMid; } else { binMax = binMid; } binMid = Math.floor((binMax - binMin) / 2 + binMin); } binMax = binMid; let start = Math.max(1, expectedLocation - binMid + 1); let finish = findAllMatches ? textLen : Math.min(expectedLocation + binMid, textLen) + patternLen; let bitArr = Array(finish + 2); bitArr[finish + 1] = (1 << i) - 1; for (let j = finish; j >= start; j -= 1) { let currentLocation = j - 1; let charMatch = patternAlphabet[text3.charAt(currentLocation)]; if (computeMatches) { matchMask[currentLocation] = +!!charMatch; } bitArr[j] = (bitArr[j + 1] << 1 | 1) & charMatch; if (i) { bitArr[j] |= (lastBitArr[j + 1] | lastBitArr[j]) << 1 | 1 | lastBitArr[j + 1]; } if (bitArr[j] & mask) { finalScore = computeScore$1(pattern, { errors: i, currentLocation, expectedLocation, distance, ignoreLocation }); if (finalScore <= currentThreshold) { currentThreshold = finalScore; bestLocation = currentLocation; if (bestLocation <= expectedLocation) { break; } start = Math.max(1, 2 * expectedLocation - bestLocation); } } } const score = computeScore$1(pattern, { errors: i + 1, currentLocation: expectedLocation, expectedLocation, distance, ignoreLocation }); if (score > currentThreshold) { break; } lastBitArr = bitArr; } const result = { isMatch: bestLocation >= 0, score: Math.max(1e-3, finalScore) }; if (computeMatches) { const indices = convertMaskToIndices(matchMask, minMatchCharLength); if (!indices.length) { result.isMatch = false; } else if (includeMatches) { result.indices = indices; } } return result; } function createPatternAlphabet(pattern) { let mask = {}; for (let i = 0, len = pattern.length; i < len; i += 1) { const char = pattern.charAt(i); mask[char] = (mask[char] || 0) | 1 << len - i - 1; } return mask; } class BitapSearch { constructor(pattern, { location: location2 = Config.location, threshold = Config.threshold, distance = Config.distance, includeMatches = Config.includeMatches, findAllMatches = Config.findAllMatches, minMatchCharLength = Config.minMatchCharLength, isCaseSensitive = Config.isCaseSensitive, ignoreLocation = Config.ignoreLocation } = {}) { this.options = { location: location2, threshold, distance, includeMatches, findAllMatches, minMatchCharLength, isCaseSensitive, ignoreLocation }; this.pattern = isCaseSensitive ? pattern : pattern.toLowerCase(); this.chunks = []; if (!this.pattern.length) { return; } const addChunk = (pattern2, startIndex) => { this.chunks.push({ pattern: pattern2, alphabet: createPatternAlphabet(pattern2), startIndex }); }; const len = this.pattern.length; if (len > MAX_BITS) { let i = 0; const remainder = len % MAX_BITS; const end = len - remainder; while (i < end) { addChunk(this.pattern.substr(i, MAX_BITS), i); i += MAX_BITS; } if (remainder) { const startIndex = len - MAX_BITS; addChunk(this.pattern.substr(startIndex), startIndex); } } else { addChunk(this.pattern, 0); } } searchIn(text3) { const {isCaseSensitive, includeMatches} = this.options; if (!isCaseSensitive) { text3 = text3.toLowerCase(); } if (this.pattern === text3) { let result2 = { isMatch: true, score: 0 }; if (includeMatches) { result2.indices = [[0, text3.length - 1]]; } return result2; } const { location: location2, distance, threshold, findAllMatches, minMatchCharLength, ignoreLocation } = this.options; let allIndices = []; let totalScore = 0; let hasMatches = false; this.chunks.forEach(({pattern, alphabet, startIndex}) => { const {isMatch, score, indices} = search(text3, pattern, alphabet, { location: location2 + startIndex, distance, threshold, findAllMatches, minMatchCharLength, includeMatches, ignoreLocation }); if (isMatch) { hasMatches = true; } totalScore += score; if (isMatch && indices) { allIndices = [...allIndices, ...indices]; } }); let result = { isMatch: hasMatches, score: hasMatches ? totalScore / this.chunks.length : 1 }; if (hasMatches && includeMatches) { result.indices = allIndices; } return result; } } class BaseMatch { constructor(pattern) { this.pattern = pattern; } static isMultiMatch(pattern) { return getMatch(pattern, this.multiRegex); } static isSingleMatch(pattern) { return getMatch(pattern, this.singleRegex); } search() { } } function getMatch(pattern, exp) { const matches2 = pattern.match(exp); return matches2 ? matches2[1] : null; } class ExactMatch extends BaseMatch { constructor(pattern) { super(pattern); } static get type() { return "exact"; } static get multiRegex() { return /^="(.*)"$/; } static get singleRegex() { return /^=(.*)$/; } search(text3) { const isMatch = text3 === this.pattern; return { isMatch, score: isMatch ? 0 : 1, indices: [0, this.pattern.length - 1] }; } } class InverseExactMatch extends BaseMatch { constructor(pattern) { super(pattern); } static get type() { return "inverse-exact"; } static get multiRegex() { return /^!"(.*)"$/; } static get singleRegex() { return /^!(.*)$/; } search(text3) { const index2 = text3.indexOf(this.pattern); const isMatch = index2 === -1; return { isMatch, score: isMatch ? 0 : 1, indices: [0, text3.length - 1] }; } } class PrefixExactMatch extends BaseMatch { constructor(pattern) { super(pattern); } static get type() { return "prefix-exact"; } static get multiRegex() { return /^\^"(.*)"$/; } static get singleRegex() { return /^\^(.*)$/; } search(text3) { const isMatch = text3.startsWith(this.pattern); return { isMatch, score: isMatch ? 0 : 1, indices: [0, this.pattern.length - 1] }; } } class InversePrefixExactMatch extends BaseMatch { constructor(pattern) { super(pattern); } static get type() { return "inverse-prefix-exact"; } static get multiRegex() { return /^!\^"(.*)"$/; } static get singleRegex() { return /^!\^(.*)$/; } search(text3) { const isMatch = !text3.startsWith(this.pattern); return { isMatch, score: isMatch ? 0 : 1, indices: [0, text3.length - 1] }; } } class SuffixExactMatch extends BaseMatch { constructor(pattern) { super(pattern); } static get type() { return "suffix-exact"; } static get multiRegex() { return /^"(.*)"\$$/; } static get singleRegex() { return /^(.*)\$$/; } search(text3) { const isMatch = text3.endsWith(this.pattern); return { isMatch, score: isMatch ? 0 : 1, indices: [text3.length - this.pattern.length, text3.length - 1] }; } } class InverseSuffixExactMatch extends BaseMatch { constructor(pattern) { super(pattern); } static get type() { return "inverse-suffix-exact"; } static get multiRegex() { return /^!"(.*)"\$$/; } static get singleRegex() { return /^!(.*)\$$/; } search(text3) { const isMatch = !text3.endsWith(this.pattern); return { isMatch, score: isMatch ? 0 : 1, indices: [0, text3.length - 1] }; } } class FuzzyMatch extends BaseMatch { constructor(pattern, { location: location2 = Config.location, threshold = Config.threshold, distance = Config.distance, includeMatches = Config.includeMatches, findAllMatches = Config.findAllMatches, minMatchCharLength = Config.minMatchCharLength, isCaseSensitive = Config.isCaseSensitive, ignoreLocation = Config.ignoreLocation } = {}) { super(pattern); this._bitapSearch = new BitapSearch(pattern, { location: location2, threshold, distance, includeMatches, findAllMatches, minMatchCharLength, isCaseSensitive, ignoreLocation }); } static get type() { return "fuzzy"; } static get multiRegex() { return /^"(.*)"$/; } static get singleRegex() { return /^(.*)$/; } search(text3) { return this._bitapSearch.searchIn(text3); } } class IncludeMatch extends BaseMatch { constructor(pattern) { super(pattern); } static get type() { return "include"; } static get multiRegex() { return /^'"(.*)"$/; } static get singleRegex() { return /^'(.*)$/; } search(text3) { let location2 = 0; let index2; const indices = []; const patternLen = this.pattern.length; while ((index2 = text3.indexOf(this.pattern, location2)) > -1) { location2 = index2 + patternLen; indices.push([index2, location2 - 1]); } const isMatch = !!indices.length; return { isMatch, score: isMatch ? 0 : 1, indices }; } } const searchers = [ ExactMatch, IncludeMatch, PrefixExactMatch, InversePrefixExactMatch, InverseSuffixExactMatch, SuffixExactMatch, InverseExactMatch, FuzzyMatch ]; const searchersLen = searchers.length; const SPACE_RE = / +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/; const OR_TOKEN = "|"; function parseQuery(pattern, options2 = {}) { return pattern.split(OR_TOKEN).map((item2) => { let query = item2.trim().split(SPACE_RE).filter((item3) => item3 && !!item3.trim()); let results = []; for (let i = 0, len = query.length; i < len; i += 1) { const queryItem = query[i]; let found = false; let idx = -1; while (!found && ++idx < searchersLen) { const searcher = searchers[idx]; let token = searcher.isMultiMatch(queryItem); if (token) { results.push(new searcher(token, options2)); found = true; } } if (found) { continue; } idx = -1; while (++idx < searchersLen) { const searcher = searchers[idx]; let token = searcher.isSingleMatch(queryItem); if (token) { results.push(new searcher(token, options2)); break; } } } return results; }); } const MultiMatchSet = new Set([FuzzyMatch.type, IncludeMatch.type]); class ExtendedSearch { constructor(pattern, { isCaseSensitive = Config.isCaseSensitive, includeMatches = Config.includeMatches, minMatchCharLength = Config.minMatchCharLength, ignoreLocation = Config.ignoreLocation, findAllMatches = Config.findAllMatches, location: location2 = Config.location, threshold = Config.threshold, distance = Config.distance } = {}) { this.query = null; this.options = { isCaseSensitive, includeMatches, minMatchCharLength, findAllMatches, ignoreLocation, location: location2, threshold, distance }; this.pattern = isCaseSensitive ? pattern : pattern.toLowerCase(); this.query = parseQuery(this.pattern, this.options); } static condition(_, options2) { return options2.useExtendedSearch; } searchIn(text3) { const query = this.query; if (!query) { return { isMatch: false, score: 1 }; } const {includeMatches, isCaseSensitive} = this.options; text3 = isCaseSensitive ? text3 : text3.toLowerCase(); let numMatches = 0; let allIndices = []; let totalScore = 0; for (let i = 0, qLen = query.length; i < qLen; i += 1) { const searchers2 = query[i]; allIndices.length = 0; numMatches = 0; for (let j = 0, pLen = searchers2.length; j < pLen; j += 1) { const searcher = searchers2[j]; const {isMatch, indices, score} = searcher.search(text3); if (isMatch) { numMatches += 1; totalScore += score; if (includeMatches) { const type = searcher.constructor.type; if (MultiMatchSet.has(type)) { allIndices = [...allIndices, ...indices]; } else { allIndices.push(indices); } } } else { totalScore = 0; numMatches = 0; allIndices.length = 0; break; } } if (numMatches) { let result = { isMatch: true, score: totalScore / numMatches }; if (includeMatches) { result.indices = allIndices; } return result; } } return { isMatch: false, score: 1 }; } } const registeredSearchers = []; function register(...args) { registeredSearchers.push(...args); } function createSearcher(pattern, options2) { for (let i = 0, len = registeredSearchers.length; i < len; i += 1) { let searcherClass = registeredSearchers[i]; if (searcherClass.condition(pattern, options2)) { return new searcherClass(pattern, options2); } } return new BitapSearch(pattern, options2); } const LogicalOperator = { AND: "$and", OR: "$or" }; const KeyType = { PATH: "$path", PATTERN: "$val" }; const isExpression = (query) => !!(query[LogicalOperator.AND] || query[LogicalOperator.OR]); const isPath = (query) => !!query[KeyType.PATH]; const isLeaf = (query) => !isArray2(query) && isObject2(query) && !isExpression(query); const convertToExplicit = (query) => ({ [LogicalOperator.AND]: Object.keys(query).map((key) => ({ [key]: query[key] })) }); function parse2(query, options2, {auto = true} = {}) { const next = (query2) => { let keys = Object.keys(query2); const isQueryPath = isPath(query2); if (!isQueryPath && keys.length > 1 && !isExpression(query2)) { return next(convertToExplicit(query2)); } if (isLeaf(query2)) { const key = isQueryPath ? query2[KeyType.PATH] : keys[0]; const pattern = isQueryPath ? query2[KeyType.PATTERN] : query2[key]; if (!isString3(pattern)) { throw new Error(LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY(key)); } const obj = { keyId: createKeyId(key), pattern }; if (auto) { obj.searcher = createSearcher(pattern, options2); } return obj; } let node = { children: [], operator: keys[0] }; keys.forEach((key) => { const value = query2[key]; if (isArray2(value)) { value.forEach((item2) => { node.children.push(next(item2)); }); } }); return node; }; if (!isExpression(query)) { query = convertToExplicit(query); } return next(query); } function computeScore(results, {ignoreFieldNorm = Config.ignoreFieldNorm}) { results.forEach((result) => { let totalScore = 1; result.matches.forEach(({key, norm: norm2, score}) => { const weight = key ? key.weight : null; totalScore *= Math.pow(score === 0 && weight ? Number.EPSILON : score, (weight || 1) * (ignoreFieldNorm ? 1 : norm2)); }); result.score = totalScore; }); } function transformMatches(result, data3) { const matches2 = result.matches; data3.matches = []; if (!isDefined4(matches2)) { return; } matches2.forEach((match) => { if (!isDefined4(match.indices) || !match.indices.length) { return; } const {indices, value} = match; let obj = { indices, value }; if (match.key) { obj.key = match.key.src; } if (match.idx > -1) { obj.refIndex = match.idx; } data3.matches.push(obj); }); } function transformScore(result, data3) { data3.score = result.score; } function format2(results, docs, { includeMatches = Config.includeMatches, includeScore = Config.includeScore } = {}) { const transformers = []; if (includeMatches) transformers.push(transformMatches); if (includeScore) transformers.push(transformScore); return results.map((result) => { const {idx} = result; const data3 = { item: docs[idx], refIndex: idx }; if (transformers.length) { transformers.forEach((transformer) => { transformer(result, data3); }); } return data3; }); } class Fuse { constructor(docs, options2 = {}, index2) { this.options = {...Config, ...options2}; if (this.options.useExtendedSearch && false) { } this._keyStore = new KeyStore(this.options.keys); this.setCollection(docs, index2); } setCollection(docs, index2) { this._docs = docs; if (index2 && !(index2 instanceof FuseIndex)) { throw new Error(INCORRECT_INDEX_TYPE); } this._myIndex = index2 || createIndex(this.options.keys, this._docs, { getFn: this.options.getFn, fieldNormWeight: this.options.fieldNormWeight }); } add(doc) { if (!isDefined4(doc)) { return; } this._docs.push(doc); this._myIndex.add(doc); } remove(predicate = () => false) { const results = []; for (let i = 0, len = this._docs.length; i < len; i += 1) { const doc = this._docs[i]; if (predicate(doc, i)) { this.removeAt(i); i -= 1; len -= 1; results.push(doc); } } return results; } removeAt(idx) { this._docs.splice(idx, 1); this._myIndex.removeAt(idx); } getIndex() { return this._myIndex; } search(query, {limit: limit2 = -1} = {}) { const { includeMatches, includeScore, shouldSort, sortFn, ignoreFieldNorm } = this.options; let results = isString3(query) ? isString3(this._docs[0]) ? this._searchStringList(query) : this._searchObjectList(query) : this._searchLogical(query); computeScore(results, {ignoreFieldNorm}); if (shouldSort) { results.sort(sortFn); } if (isNumber2(limit2) && limit2 > -1) { results = results.slice(0, limit2); } return format2(results, this._docs, { includeMatches, includeScore }); } _searchStringList(query) { const searcher = createSearcher(query, this.options); const {records} = this._myIndex; const results = []; records.forEach(({v: text3, i: idx, n: norm2}) => { if (!isDefined4(text3)) { return; } const {isMatch, score, indices} = searcher.searchIn(text3); if (isMatch) { results.push({ item: text3, idx, matches: [{score, value: text3, norm: norm2, indices}] }); } }); return results; } _searchLogical(query) { const expression = parse2(query, this.options); const evaluate = (node, item2, idx) => { if (!node.children) { const {keyId, searcher} = node; const matches2 = this._findMatches({ key: this._keyStore.get(keyId), value: this._myIndex.getValueForItemAtKeyId(item2, keyId), searcher }); if (matches2 && matches2.length) { return [ { idx, item: item2, matches: matches2 } ]; } return []; } const res2 = []; for (let i = 0, len = node.children.length; i < len; i += 1) { const child = node.children[i]; const result = evaluate(child, item2, idx); if (result.length) { res2.push(...result); } else if (node.operator === LogicalOperator.AND) { return []; } } return res2; }; const records = this._myIndex.records; const resultMap = {}; const results = []; records.forEach(({$: item2, i: idx}) => { if (isDefined4(item2)) { let expResults = evaluate(expression, item2, idx); if (expResults.length) { if (!resultMap[idx]) { resultMap[idx] = {idx, item: item2, matches: []}; results.push(resultMap[idx]); } expResults.forEach(({matches: matches2}) => { resultMap[idx].matches.push(...matches2); }); } } }); return results; } _searchObjectList(query) { const searcher = createSearcher(query, this.options); const {keys, records} = this._myIndex; const results = []; records.forEach(({$: item2, i: idx}) => { if (!isDefined4(item2)) { return; } let matches2 = []; keys.forEach((key, keyIndex) => { matches2.push(...this._findMatches({ key, value: item2[keyIndex], searcher })); }); if (matches2.length) { results.push({ idx, item: item2, matches: matches2 }); } }); return results; } _findMatches({key, value, searcher}) { if (!isDefined4(value)) { return []; } let matches2 = []; if (isArray2(value)) { value.forEach(({v: text3, i: idx, n: norm2}) => { if (!isDefined4(text3)) { return; } const {isMatch, score, indices} = searcher.searchIn(text3); if (isMatch) { matches2.push({ score, key, value: text3, idx, norm: norm2, indices }); } }); } else { const {v: text3, n: norm2} = value; const {isMatch, score, indices} = searcher.searchIn(text3); if (isMatch) { matches2.push({score, key, value: text3, norm: norm2, indices}); } } return matches2; } } Fuse.version = "6.6.2"; Fuse.createIndex = createIndex; Fuse.parseIndex = parseIndex; Fuse.config = Config; { Fuse.parseQuery = parse2; } { register(ExtendedSearch); } }, 791: function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) { __webpack_require__2.r(__webpack_exports__2); __webpack_require__2.d(__webpack_exports__2, { __DO_NOT_USE__ActionTypes: function() { return ActionTypes; }, applyMiddleware: function() { return applyMiddleware; }, bindActionCreators: function() { return bindActionCreators; }, combineReducers: function() { return combineReducers; }, compose: function() { return compose; }, createStore: function() { return createStore2; }, legacy_createStore: function() { return legacy_createStore; } }); ; function _typeof3(obj) { "@babel/helpers - typeof"; return _typeof3 = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(obj2) { return typeof obj2; } : function(obj2) { return obj2 && typeof Symbol == "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; }, _typeof3(obj); } ; function _toPrimitive(input, hint) { if (_typeof3(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== void 0) { var res2 = prim.call(input, hint || "default"); if (_typeof3(res2) !== "object") return res2; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } ; function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof3(key) === "symbol" ? key : String(key); } ; function _defineProperty2(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } ; function ownKeys2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function(sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread22(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; i % 2 ? ownKeys2(Object(source), true).forEach(function(key) { _defineProperty2(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys2(Object(source)).forEach(function(key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } ; function formatProdErrorMessage(code) { return "Minified Redux error #" + code + "; visit https://redux.js.org/Errors?code=" + code + " for the full message or use the non-minified dev environment for full errors. "; } var $$observable = function() { return typeof Symbol === "function" && Symbol.observable || "@@observable"; }(); var randomString2 = function randomString3() { return Math.random().toString(36).substring(7).split("").join("."); }; var ActionTypes = { INIT: "@@redux/INIT" + randomString2(), REPLACE: "@@redux/REPLACE" + randomString2(), PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() { return "@@redux/PROBE_UNKNOWN_ACTION" + randomString2(); } }; function isPlainObject(obj) { if (typeof obj !== "object" || obj === null) return false; var proto2 = obj; while (Object.getPrototypeOf(proto2) !== null) { proto2 = Object.getPrototypeOf(proto2); } return Object.getPrototypeOf(obj) === proto2; } function miniKindOf(val) { if (val === void 0) return "undefined"; if (val === null) return "null"; var type = typeof val; switch (type) { case "boolean": case "string": case "number": case "symbol": case "function": { return type; } } if (Array.isArray(val)) return "array"; if (isDate(val)) return "date"; if (isError(val)) return "error"; var constructorName = ctorName(val); switch (constructorName) { case "Symbol": case "Promise": case "WeakMap": case "WeakSet": case "Map": case "Set": return constructorName; } return type.slice(8, -1).toLowerCase().replace(/\s/g, ""); } function ctorName(val) { return typeof val.constructor === "function" ? val.constructor.name : null; } function isError(val) { return val instanceof Error || typeof val.message === "string" && val.constructor && typeof val.constructor.stackTraceLimit === "number"; } function isDate(val) { if (val instanceof Date) return true; return typeof val.toDateString === "function" && typeof val.getDate === "function" && typeof val.setDate === "function"; } function kindOf(val) { var typeOfVal = typeof val; if (false) { } return typeOfVal; } function createStore2(reducer, preloadedState, enhancer) { var _ref2; if (typeof preloadedState === "function" && typeof enhancer === "function" || typeof enhancer === "function" && typeof arguments[3] === "function") { throw new Error(true ? formatProdErrorMessage(0) : 0); } if (typeof preloadedState === "function" && typeof enhancer === "undefined") { enhancer = preloadedState; preloadedState = void 0; } if (typeof enhancer !== "undefined") { if (typeof enhancer !== "function") { throw new Error(true ? formatProdErrorMessage(1) : 0); } return enhancer(createStore2)(reducer, preloadedState); } if (typeof reducer !== "function") { throw new Error(true ? formatProdErrorMessage(2) : 0); } var currentReducer = reducer; var currentState = preloadedState; var currentListeners = []; var nextListeners = currentListeners; var isDispatching = false; function ensureCanMutateNextListeners() { if (nextListeners === currentListeners) { nextListeners = currentListeners.slice(); } } function getState() { if (isDispatching) { throw new Error(true ? formatProdErrorMessage(3) : 0); } return currentState; } function subscribe(listener) { if (typeof listener !== "function") { throw new Error(true ? formatProdErrorMessage(4) : 0); } if (isDispatching) { throw new Error(true ? formatProdErrorMessage(5) : 0); } var isSubscribed = true; ensureCanMutateNextListeners(); nextListeners.push(listener); return function unsubscribe() { if (!isSubscribed) { return; } if (isDispatching) { throw new Error(true ? formatProdErrorMessage(6) : 0); } isSubscribed = false; ensureCanMutateNextListeners(); var index2 = nextListeners.indexOf(listener); nextListeners.splice(index2, 1); currentListeners = null; }; } function dispatch(action) { if (!isPlainObject(action)) { throw new Error(true ? formatProdErrorMessage(7) : 0); } if (typeof action.type === "undefined") { throw new Error(true ? formatProdErrorMessage(8) : 0); } if (isDispatching) { throw new Error(true ? formatProdErrorMessage(9) : 0); } try { isDispatching = true; currentState = currentReducer(currentState, action); } finally { isDispatching = false; } var listeners2 = currentListeners = nextListeners; for (var i = 0; i < listeners2.length; i++) { var listener = listeners2[i]; listener(); } return action; } function replaceReducer(nextReducer) { if (typeof nextReducer !== "function") { throw new Error(true ? formatProdErrorMessage(10) : 0); } currentReducer = nextReducer; dispatch({ type: ActionTypes.REPLACE }); } function observable() { var _ref3; var outerSubscribe = subscribe; return _ref3 = { subscribe: function subscribe2(observer2) { if (typeof observer2 !== "object" || observer2 === null) { throw new Error(true ? formatProdErrorMessage(11) : 0); } function observeState() { if (observer2.next) { observer2.next(getState()); } } observeState(); var unsubscribe = outerSubscribe(observeState); return { unsubscribe }; } }, _ref3[$$observable] = function() { return this; }, _ref3; } dispatch({ type: ActionTypes.INIT }); return _ref2 = { dispatch, subscribe, getState, replaceReducer }, _ref2[$$observable] = observable, _ref2; } var legacy_createStore = createStore2; function warning(message) { if (typeof console !== "undefined" && typeof console.error === "function") { console.error(message); } try { throw new Error(message); } catch (e2) { } } function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) { var reducerKeys = Object.keys(reducers); var argumentName = action && action.type === ActionTypes.INIT ? "preloadedState argument passed to createStore" : "previous state received by the reducer"; if (reducerKeys.length === 0) { return "Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers."; } if (!isPlainObject(inputState)) { return "The " + argumentName + ' has unexpected type of "' + kindOf(inputState) + '". Expected argument to be an object with the following ' + ('keys: "' + reducerKeys.join('", "') + '"'); } var unexpectedKeys = Object.keys(inputState).filter(function(key) { return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]; }); unexpectedKeys.forEach(function(key) { unexpectedKeyCache[key] = true; }); if (action && action.type === ActionTypes.REPLACE) return; if (unexpectedKeys.length > 0) { return "Unexpected " + (unexpectedKeys.length > 1 ? "keys" : "key") + " " + ('"' + unexpectedKeys.join('", "') + '" found in ' + argumentName + ". ") + "Expected to find one of the known reducer keys instead: " + ('"' + reducerKeys.join('", "') + '". Unexpected keys will be ignored.'); } } function assertReducerShape(reducers) { Object.keys(reducers).forEach(function(key) { var reducer = reducers[key]; var initialState = reducer(void 0, { type: ActionTypes.INIT }); if (typeof initialState === "undefined") { throw new Error(true ? formatProdErrorMessage(12) : 0); } if (typeof reducer(void 0, { type: ActionTypes.PROBE_UNKNOWN_ACTION() }) === "undefined") { throw new Error(true ? formatProdErrorMessage(13) : 0); } }); } function combineReducers(reducers) { var reducerKeys = Object.keys(reducers); var finalReducers = {}; for (var i = 0; i < reducerKeys.length; i++) { var key = reducerKeys[i]; if (false) { } if (typeof reducers[key] === "function") { finalReducers[key] = reducers[key]; } } var finalReducerKeys = Object.keys(finalReducers); var unexpectedKeyCache; if (false) { } var shapeAssertionError; try { assertReducerShape(finalReducers); } catch (e2) { shapeAssertionError = e2; } return function combination(state2, action) { if (state2 === void 0) { state2 = {}; } if (shapeAssertionError) { throw shapeAssertionError; } if (false) { var warningMessage; } var hasChanged = false; var nextState = {}; for (var _i = 0; _i < finalReducerKeys.length; _i++) { var _key = finalReducerKeys[_i]; var reducer = finalReducers[_key]; var previousStateForKey = state2[_key]; var nextStateForKey = reducer(previousStateForKey, action); if (typeof nextStateForKey === "undefined") { var actionType = action && action.type; throw new Error(true ? formatProdErrorMessage(14) : 0); } nextState[_key] = nextStateForKey; hasChanged = hasChanged || nextStateForKey !== previousStateForKey; } hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state2).length; return hasChanged ? nextState : state2; }; } function bindActionCreator(actionCreator, dispatch) { return function() { return dispatch(actionCreator.apply(this, arguments)); }; } function bindActionCreators(actionCreators, dispatch) { if (typeof actionCreators === "function") { return bindActionCreator(actionCreators, dispatch); } if (typeof actionCreators !== "object" || actionCreators === null) { throw new Error(true ? formatProdErrorMessage(16) : 0); } var boundActionCreators = {}; for (var key in actionCreators) { var actionCreator = actionCreators[key]; if (typeof actionCreator === "function") { boundActionCreators[key] = bindActionCreator(actionCreator, dispatch); } } return boundActionCreators; } function compose() { for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) { funcs[_key] = arguments[_key]; } if (funcs.length === 0) { return function(arg) { return arg; }; } if (funcs.length === 1) { return funcs[0]; } return funcs.reduce(function(a2, b) { return function() { return a2(b.apply(void 0, arguments)); }; }); } function applyMiddleware() { for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) { middlewares[_key] = arguments[_key]; } return function(createStore3) { return function() { var store = createStore3.apply(void 0, arguments); var _dispatch = function dispatch() { throw new Error(true ? formatProdErrorMessage(15) : 0); }; var middlewareAPI = { getState: store.getState, dispatch: function dispatch() { return _dispatch.apply(void 0, arguments); } }; var chain2 = middlewares.map(function(middleware) { return middleware(middlewareAPI); }); _dispatch = compose.apply(void 0, chain2)(store.dispatch); return _objectSpread22(_objectSpread22({}, store), {}, { dispatch: _dispatch }); }; }; } function isCrushed() { } if (false) { } } }; var __webpack_module_cache__ = {}; function __webpack_require__(moduleId) { var cachedModule = __webpack_module_cache__[moduleId]; if (cachedModule !== void 0) { return cachedModule.exports; } var module2 = __webpack_module_cache__[moduleId] = { exports: {} }; __webpack_modules__[moduleId].call(module2.exports, module2, module2.exports, __webpack_require__); return module2.exports; } !function() { __webpack_require__.n = function(module2) { var getter = module2 && module2.__esModule ? function() { return module2["default"]; } : function() { return module2; }; __webpack_require__.d(getter, {a: getter}); return getter; }; }(); !function() { __webpack_require__.d = function(exports2, definition) { for (var key in definition) { if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports2, key)) { Object.defineProperty(exports2, key, {enumerable: true, get: definition[key]}); } } }; }(); !function() { __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }; }(); !function() { __webpack_require__.r = function(exports2) { if (typeof Symbol !== "undefined" && Symbol.toStringTag) { Object.defineProperty(exports2, Symbol.toStringTag, {value: "Module"}); } Object.defineProperty(exports2, "__esModule", {value: true}); }; }(); var __webpack_exports__ = {}; !function() { var _scripts_choices__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(373); var _scripts_choices__WEBPACK_IMPORTED_MODULE_0___default = /* @__PURE__ */ __webpack_require__.n(_scripts_choices__WEBPACK_IMPORTED_MODULE_0__); var _scripts_interfaces__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(187); var _scripts_interfaces__WEBPACK_IMPORTED_MODULE_1___default = /* @__PURE__ */ __webpack_require__.n(_scripts_interfaces__WEBPACK_IMPORTED_MODULE_1__); var _scripts_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(883); var _scripts_defaults__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(789); var _scripts_templates__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(686); __webpack_exports__["default"] = _scripts_choices__WEBPACK_IMPORTED_MODULE_0___default(); }(); __webpack_exports__ = __webpack_exports__["default"]; return __webpack_exports__; }(); }); }); // node_modules/vanilla-colorful/lib/utils/math.js var clamp = (number, min3 = 0, max3 = 1) => { return number > max3 ? max3 : number < min3 ? min3 : number; }; var round = (number, digits = 0, base = Math.pow(10, digits)) => { return Math.round(base * number) / base; }; // node_modules/vanilla-colorful/lib/utils/convert.js var angleUnits = { grad: 360 / 400, turn: 360, rad: 360 / (Math.PI * 2) }; var hexToHsva = (hex) => rgbaToHsva(hexToRgba(hex)); var hexToRgba = (hex) => { if (hex[0] === "#") hex = hex.substr(1); if (hex.length < 6) { return { r: parseInt(hex[0] + hex[0], 16), g: parseInt(hex[1] + hex[1], 16), b: parseInt(hex[2] + hex[2], 16), a: 1 }; } return { r: parseInt(hex.substr(0, 2), 16), g: parseInt(hex.substr(2, 2), 16), b: parseInt(hex.substr(4, 2), 16), a: 1 }; }; var parseHue = (value, unit = "deg") => { return Number(value) * (angleUnits[unit] || 1); }; var hslaStringToHsva = (hslString) => { const matcher = /hsla?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i; const match = matcher.exec(hslString); if (!match) return {h: 0, s: 0, v: 0, a: 1}; return hslaToHsva({ h: parseHue(match[1], match[2]), s: Number(match[3]), l: Number(match[4]), a: match[5] === void 0 ? 1 : Number(match[5]) / (match[6] ? 100 : 1) }); }; var hslStringToHsva = hslaStringToHsva; var hslaToHsva = ({h, s: s2, l, a: a2}) => { s2 *= (l < 50 ? l : 100 - l) / 100; return { h, s: s2 > 0 ? 2 * s2 / (l + s2) * 100 : 0, v: l + s2, a: a2 }; }; var hsvaToHex = (hsva) => rgbaToHex(hsvaToRgba(hsva)); var hsvaToHsla = ({h, s: s2, v, a: a2}) => { const hh = (200 - s2) * v / 100; return { h: round(h), s: round(hh > 0 && hh < 200 ? s2 * v / 100 / (hh <= 100 ? hh : 200 - hh) * 100 : 0), l: round(hh / 2), a: round(a2, 2) }; }; var hsvaToHslString = (hsva) => { const {h, s: s2, l} = hsvaToHsla(hsva); return `hsl(${h}, ${s2}%, ${l}%)`; }; var hsvaToHslaString = (hsva) => { const {h, s: s2, l, a: a2} = hsvaToHsla(hsva); return `hsla(${h}, ${s2}%, ${l}%, ${a2})`; }; var hsvaToRgba = ({h, s: s2, v, a: a2}) => { h = h / 360 * 6; s2 = s2 / 100; v = v / 100; const hh = Math.floor(h), b = v * (1 - s2), c2 = v * (1 - (h - hh) * s2), d = v * (1 - (1 - h + hh) * s2), module = hh % 6; return { r: round([v, c2, b, b, d, v][module] * 255), g: round([d, v, v, c2, b, b][module] * 255), b: round([b, b, d, v, v, c2][module] * 255), a: round(a2, 2) }; }; var hsvaToRgbString = (hsva) => { const {r: r2, g, b} = hsvaToRgba(hsva); return `rgb(${r2}, ${g}, ${b})`; }; var hsvaToRgbaString = (hsva) => { const {r: r2, g, b, a: a2} = hsvaToRgba(hsva); return `rgba(${r2}, ${g}, ${b}, ${a2})`; }; var rgbaStringToHsva = (rgbaString) => { const matcher = /rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i; const match = matcher.exec(rgbaString); if (!match) return {h: 0, s: 0, v: 0, a: 1}; return rgbaToHsva({ r: Number(match[1]) / (match[2] ? 100 / 255 : 1), g: Number(match[3]) / (match[4] ? 100 / 255 : 1), b: Number(match[5]) / (match[6] ? 100 / 255 : 1), a: match[7] === void 0 ? 1 : Number(match[7]) / (match[8] ? 100 : 1) }); }; var rgbStringToHsva = rgbaStringToHsva; var format = (number) => { const hex = number.toString(16); return hex.length < 2 ? "0" + hex : hex; }; var rgbaToHex = ({r: r2, g, b}) => { return "#" + format(r2) + format(g) + format(b); }; var rgbaToHsva = ({r: r2, g, b, a: a2}) => { const max3 = Math.max(r2, g, b); const delta = max3 - Math.min(r2, g, b); const hh = delta ? max3 === r2 ? (g - b) / delta : max3 === g ? 2 + (b - r2) / delta : 4 + (r2 - g) / delta : 0; return { h: round(60 * (hh < 0 ? hh + 6 : hh)), s: round(max3 ? delta / max3 * 100 : 0), v: round(max3 / 255 * 100), a: a2 }; }; // node_modules/vanilla-colorful/lib/utils/compare.js var equalColorObjects = (first, second) => { if (first === second) return true; for (const prop in first) { if (first[prop] !== second[prop]) return false; } return true; }; var equalColorString = (first, second) => { return first.replace(/\s/g, "") === second.replace(/\s/g, ""); }; var equalHex = (first, second) => { if (first.toLowerCase() === second.toLowerCase()) return true; return equalColorObjects(hexToRgba(first), hexToRgba(second)); }; // node_modules/vanilla-colorful/lib/utils/dom.js var cache = {}; var tpl = (html2) => { let template = cache[html2]; if (!template) { template = document.createElement("template"); template.innerHTML = html2; cache[html2] = template; } return template; }; var fire = (target, type, detail) => { target.dispatchEvent(new CustomEvent(type, { bubbles: true, detail })); }; // node_modules/vanilla-colorful/lib/components/slider.js var hasTouched = false; var isTouch = (e2) => "touches" in e2; var isValid = (event) => { if (hasTouched && !isTouch(event)) return false; if (!hasTouched) hasTouched = isTouch(event); return true; }; var pointerMove = (target, event) => { const pointer = isTouch(event) ? event.touches[0] : event; const rect = target.el.getBoundingClientRect(); fire(target.el, "move", target.getMove({ x: clamp((pointer.pageX - (rect.left + window.pageXOffset)) / rect.width), y: clamp((pointer.pageY - (rect.top + window.pageYOffset)) / rect.height) })); }; var keyMove = (target, event) => { const keyCode = event.keyCode; if (keyCode > 40 || target.xy && keyCode < 37 || keyCode < 33) return; event.preventDefault(); fire(target.el, "move", target.getMove({ x: keyCode === 39 ? 0.01 : keyCode === 37 ? -0.01 : keyCode === 34 ? 0.05 : keyCode === 33 ? -0.05 : keyCode === 35 ? 1 : keyCode === 36 ? -1 : 0, y: keyCode === 40 ? 0.01 : keyCode === 38 ? -0.01 : 0 }, true)); }; var Slider = class { constructor(root2, part, aria, xy) { const template = tpl(`
`); root2.appendChild(template.content.cloneNode(true)); const el = root2.querySelector(`[part=${part}]`); el.addEventListener("mousedown", this); el.addEventListener("touchstart", this); el.addEventListener("keydown", this); this.el = el; this.xy = xy; this.nodes = [el.firstChild, el]; } set dragging(state2) { const toggleEvent = state2 ? document.addEventListener : document.removeEventListener; toggleEvent(hasTouched ? "touchmove" : "mousemove", this); toggleEvent(hasTouched ? "touchend" : "mouseup", this); } handleEvent(event) { switch (event.type) { case "mousedown": case "touchstart": event.preventDefault(); if (!isValid(event) || !hasTouched && event.button != 0) return; this.el.focus(); pointerMove(this, event); this.dragging = true; break; case "mousemove": case "touchmove": event.preventDefault(); pointerMove(this, event); break; case "mouseup": case "touchend": this.dragging = false; break; case "keydown": keyMove(this, event); break; } } style(styles3) { styles3.forEach((style, i) => { for (const p2 in style) { this.nodes[i].style.setProperty(p2, style[p2]); } }); } }; // node_modules/vanilla-colorful/lib/components/hue.js var Hue = class extends Slider { constructor(root2) { super(root2, "hue", 'aria-label="Hue" aria-valuemin="0" aria-valuemax="360"', false); } update({h}) { this.h = h; this.style([ { left: `${h / 360 * 100}%`, color: hsvaToHslString({h, s: 100, v: 100, a: 1}) } ]); this.el.setAttribute("aria-valuenow", `${round(h)}`); } getMove(offset2, key) { return {h: key ? clamp(this.h + offset2.x * 360, 0, 360) : 360 * offset2.x}; } }; // node_modules/vanilla-colorful/lib/components/saturation.js var Saturation = class extends Slider { constructor(root2) { super(root2, "saturation", 'aria-label="Color"', true); } update(hsva) { this.hsva = hsva; this.style([ { top: `${100 - hsva.v}%`, left: `${hsva.s}%`, color: hsvaToHslString(hsva) }, { "background-color": hsvaToHslString({h: hsva.h, s: 100, v: 100, a: 1}) } ]); this.el.setAttribute("aria-valuetext", `Saturation ${round(hsva.s)}%, Brightness ${round(hsva.v)}%`); } getMove(offset2, key) { return { s: key ? clamp(this.hsva.s + offset2.x * 100, 0, 100) : offset2.x * 100, v: key ? clamp(this.hsva.v - offset2.y * 100, 0, 100) : Math.round(100 - offset2.y * 100) }; } }; // node_modules/vanilla-colorful/lib/styles/color-picker.js var color_picker_default = `:host{display:flex;flex-direction:column;position:relative;width:200px;height:200px;user-select:none;-webkit-user-select:none;cursor:default}:host([hidden]){display:none!important}[role=slider]{position:relative;touch-action:none;user-select:none;-webkit-user-select:none;outline:0}[role=slider]:last-child{border-radius:0 0 8px 8px}[part$=pointer]{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}[part$=pointer]::after{display:block;content:'';position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;background-color:currentColor}[role=slider]:focus [part$=pointer]{transform:translate(-50%,-50%) scale(1.1)}`; // node_modules/vanilla-colorful/lib/styles/hue.js var hue_default = `[part=hue]{flex:0 0 24px;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}[part=hue-pointer]{top:50%;z-index:2}`; // node_modules/vanilla-colorful/lib/styles/saturation.js var saturation_default = `[part=saturation]{flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,rgba(255,255,255,0));box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}[part=saturation-pointer]{z-index:3}`; // node_modules/vanilla-colorful/lib/components/color-picker.js var $isSame = Symbol("same"); var $color = Symbol("color"); var $hsva = Symbol("hsva"); var $change = Symbol("change"); var $update = Symbol("update"); var $parts = Symbol("parts"); var $css = Symbol("css"); var $sliders = Symbol("sliders"); var ColorPicker = class extends HTMLElement { static get observedAttributes() { return ["color"]; } get [$css]() { return [color_picker_default, hue_default, saturation_default]; } get [$sliders]() { return [Saturation, Hue]; } get color() { return this[$color]; } set color(newColor) { if (!this[$isSame](newColor)) { const newHsva = this.colorModel.toHsva(newColor); this[$update](newHsva); this[$change](newColor); } } constructor() { super(); const template = tpl(``); const root2 = this.attachShadow({mode: "open"}); root2.appendChild(template.content.cloneNode(true)); root2.addEventListener("move", this); this[$parts] = this[$sliders].map((slider) => new slider(root2)); } connectedCallback() { if (this.hasOwnProperty("color")) { const value = this.color; delete this["color"]; this.color = value; } else if (!this.color) { this.color = this.colorModel.defaultColor; } } attributeChangedCallback(_attr, _oldVal, newVal) { const color = this.colorModel.fromAttr(newVal); if (!this[$isSame](color)) { this.color = color; } } handleEvent(event) { const oldHsva = this[$hsva]; const newHsva = {...oldHsva, ...event.detail}; this[$update](newHsva); let newColor; if (!equalColorObjects(newHsva, oldHsva) && !this[$isSame](newColor = this.colorModel.fromHsva(newHsva))) { this[$change](newColor); } } [$isSame](color) { return this.color && this.colorModel.equal(color, this.color); } [$update](hsva) { this[$hsva] = hsva; this[$parts].forEach((part) => part.update(hsva)); } [$change](value) { this[$color] = value; fire(this, "color-changed", {value}); } }; // node_modules/vanilla-colorful/lib/entrypoints/hex.js var colorModel = { defaultColor: "#000", toHsva: hexToHsva, fromHsva: hsvaToHex, equal: equalHex, fromAttr: (color) => color }; var HexBase = class extends ColorPicker { get colorModel() { return colorModel; } }; // node_modules/vanilla-colorful/hex-color-picker.js var HexColorPicker = class extends HexBase { }; customElements.define("hex-color-picker", HexColorPicker); // node_modules/vanilla-colorful/lib/entrypoints/hsl-string.js var colorModel2 = { defaultColor: "hsl(0, 0%, 0%)", toHsva: hslStringToHsva, fromHsva: hsvaToHslString, equal: equalColorString, fromAttr: (color) => color }; var HslStringBase = class extends ColorPicker { get colorModel() { return colorModel2; } }; // node_modules/vanilla-colorful/hsl-string-color-picker.js var HslStringColorPicker = class extends HslStringBase { }; customElements.define("hsl-string-color-picker", HslStringColorPicker); // node_modules/vanilla-colorful/lib/entrypoints/rgb-string.js var colorModel3 = { defaultColor: "rgb(0, 0, 0)", toHsva: rgbStringToHsva, fromHsva: hsvaToRgbString, equal: equalColorString, fromAttr: (color) => color }; var RgbStringBase = class extends ColorPicker { get colorModel() { return colorModel3; } }; // node_modules/vanilla-colorful/rgb-string-color-picker.js var RgbStringColorPicker = class extends RgbStringBase { }; customElements.define("rgb-string-color-picker", RgbStringColorPicker); // node_modules/vanilla-colorful/lib/components/alpha.js var Alpha = class extends Slider { constructor(root2) { super(root2, "alpha", 'aria-label="Alpha" aria-valuemin="0" aria-valuemax="1"', false); } update(hsva) { this.hsva = hsva; const colorFrom = hsvaToHslaString({...hsva, a: 0}); const colorTo = hsvaToHslaString({...hsva, a: 1}); const value = hsva.a * 100; this.style([ { left: `${value}%`, color: hsvaToHslaString(hsva) }, { "--gradient": `linear-gradient(90deg, ${colorFrom}, ${colorTo}` } ]); const v = round(value); this.el.setAttribute("aria-valuenow", `${v}`); this.el.setAttribute("aria-valuetext", `${v}%`); } getMove(offset2, key) { return {a: key ? clamp(this.hsva.a + offset2.x) : offset2.x}; } }; // node_modules/vanilla-colorful/lib/styles/alpha.js var alpha_default = `[part=alpha]{flex:0 0 24px}[part=alpha]::after{display:block;content:'';position:absolute;top:0;left:0;right:0;bottom:0;border-radius:inherit;background-image:var(--gradient);box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}[part^=alpha]{background-color:#fff;background-image:url('data:image/svg+xml,')}[part=alpha-pointer]{top:50%}`; // node_modules/vanilla-colorful/lib/components/alpha-color-picker.js var AlphaColorPicker = class extends ColorPicker { get [$css]() { return [...super[$css], alpha_default]; } get [$sliders]() { return [...super[$sliders], Alpha]; } }; // node_modules/vanilla-colorful/lib/entrypoints/rgba-string.js var colorModel4 = { defaultColor: "rgba(0, 0, 0, 1)", toHsva: rgbaStringToHsva, fromHsva: hsvaToRgbaString, equal: equalColorString, fromAttr: (color) => color }; var RgbaStringBase = class extends AlphaColorPicker { get colorModel() { return colorModel4; } }; // node_modules/vanilla-colorful/rgba-string-color-picker.js var RgbaStringColorPicker = class extends RgbaStringBase { }; customElements.define("rgba-string-color-picker", RgbaStringColorPicker); // packages/forms/resources/js/components/color-picker.js var color_picker_default2 = (Alpine) => { Alpine.data("colorPickerFormComponent", ({isAutofocused, isDisabled, state: state2}) => { return { state: state2, init: function() { if (!(this.state === null || this.state === "")) { this.setState(this.state); } if (isAutofocused) { this.togglePanelVisibility(this.$refs.input); } this.$refs.input.addEventListener("change", (event) => { this.setState(event.target.value); }); this.$refs.panel.addEventListener("color-changed", (event) => { this.setState(event.detail.value); }); }, togglePanelVisibility: function() { if (isDisabled) { return; } this.$refs.panel.toggle(this.$refs.input); }, setState: function(value) { this.state = value; this.$refs.input.value = value; this.$refs.panel.color = value; }, isOpen: function() { return this.$refs.panel.style.display === "block"; } }; }); }; // node_modules/dayjs/esm/constant.js var SECONDS_A_MINUTE = 60; var SECONDS_A_HOUR = SECONDS_A_MINUTE * 60; var SECONDS_A_DAY = SECONDS_A_HOUR * 24; var SECONDS_A_WEEK = SECONDS_A_DAY * 7; var MILLISECONDS_A_SECOND = 1e3; var MILLISECONDS_A_MINUTE = SECONDS_A_MINUTE * MILLISECONDS_A_SECOND; var MILLISECONDS_A_HOUR = SECONDS_A_HOUR * MILLISECONDS_A_SECOND; var MILLISECONDS_A_DAY = SECONDS_A_DAY * MILLISECONDS_A_SECOND; var MILLISECONDS_A_WEEK = SECONDS_A_WEEK * MILLISECONDS_A_SECOND; var MS = "millisecond"; var S = "second"; var MIN = "minute"; var H = "hour"; var D = "day"; var W = "week"; var M = "month"; var Q = "quarter"; var Y = "year"; var DATE = "date"; var FORMAT_DEFAULT = "YYYY-MM-DDTHH:mm:ssZ"; var INVALID_DATE_STRING = "Invalid Date"; var REGEX_PARSE = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/; var REGEX_FORMAT = /\[([^\]]+)]|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; // node_modules/dayjs/esm/locale/en.js var en_default = { 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 ordinal(n2) { var s2 = ["th", "st", "nd", "rd"]; var v = n2 % 100; return "[" + n2 + (s2[(v - 20) % 10] || s2[v] || s2[0]) + "]"; } }; // node_modules/dayjs/esm/utils.js var padStart = function padStart2(string, length, pad) { var s2 = String(string); if (!s2 || s2.length >= length) return string; return "" + Array(length + 1 - s2.length).join(pad) + string; }; var padZoneStr = function padZoneStr2(instance) { var negMinutes = -instance.utcOffset(); var minutes = Math.abs(negMinutes); var hourOffset = Math.floor(minutes / 60); var minuteOffset = minutes % 60; return "" + (negMinutes <= 0 ? "+" : "-") + padStart(hourOffset, 2, "0") + ":" + padStart(minuteOffset, 2, "0"); }; var monthDiff = function monthDiff2(a2, b) { if (a2.date() < b.date()) return -monthDiff2(b, a2); var wholeMonthDiff = (b.year() - a2.year()) * 12 + (b.month() - a2.month()); var anchor = a2.clone().add(wholeMonthDiff, M); var c2 = b - anchor < 0; var anchor2 = a2.clone().add(wholeMonthDiff + (c2 ? -1 : 1), M); return +(-(wholeMonthDiff + (b - anchor) / (c2 ? anchor - anchor2 : anchor2 - anchor)) || 0); }; var absFloor = function absFloor2(n2) { return n2 < 0 ? Math.ceil(n2) || 0 : Math.floor(n2); }; var prettyUnit = function prettyUnit2(u) { var special = { M, y: Y, w: W, d: D, D: DATE, h: H, m: MIN, s: S, ms: MS, Q }; return special[u] || String(u || "").toLowerCase().replace(/s$/, ""); }; var isUndefined = function isUndefined2(s2) { return s2 === void 0; }; var utils_default = { s: padStart, z: padZoneStr, m: monthDiff, a: absFloor, p: prettyUnit, u: isUndefined }; // node_modules/dayjs/esm/index.js var L = "en"; var Ls = {}; Ls[L] = en_default; var isDayjs = function isDayjs2(d) { return d instanceof Dayjs; }; var parseLocale = function parseLocale2(preset, object, isLocal) { var l; if (!preset) return L; if (typeof preset === "string") { var presetLower = preset.toLowerCase(); if (Ls[presetLower]) { l = presetLower; } if (object) { Ls[presetLower] = object; l = presetLower; } var presetSplit = preset.split("-"); if (!l && presetSplit.length > 1) { return parseLocale2(presetSplit[0]); } } else { var name2 = preset.name; Ls[name2] = preset; l = name2; } if (!isLocal && l) L = l; return l || !isLocal && L; }; var dayjs = function dayjs2(date, c2) { if (isDayjs(date)) { return date.clone(); } var cfg = typeof c2 === "object" ? c2 : {}; cfg.date = date; cfg.args = arguments; return new Dayjs(cfg); }; var wrapper = function wrapper2(date, instance) { return dayjs(date, { locale: instance.$L, utc: instance.$u, x: instance.$x, $offset: instance.$offset }); }; var Utils = utils_default; Utils.l = parseLocale; Utils.i = isDayjs; Utils.w = wrapper; var parseDate = function parseDate2(cfg) { var date = cfg.date, utc2 = cfg.utc; if (date === null) return new Date(NaN); if (Utils.u(date)) return new Date(); if (date instanceof Date) return new Date(date); if (typeof date === "string" && !/Z$/i.test(date)) { var d = date.match(REGEX_PARSE); if (d) { var m = d[2] - 1 || 0; var ms = (d[7] || "0").substring(0, 3); if (utc2) { return new Date(Date.UTC(d[1], m, d[3] || 1, d[4] || 0, d[5] || 0, d[6] || 0, ms)); } return new Date(d[1], m, d[3] || 1, d[4] || 0, d[5] || 0, d[6] || 0, ms); } } return new Date(date); }; var Dayjs = /* @__PURE__ */ function() { function Dayjs2(cfg) { this.$L = parseLocale(cfg.locale, null, true); this.parse(cfg); } var _proto = Dayjs2.prototype; _proto.parse = function parse2(cfg) { this.$d = parseDate(cfg); this.$x = cfg.x || {}; this.init(); }; _proto.init = function init() { var $d = this.$d; this.$y = $d.getFullYear(); this.$M = $d.getMonth(); this.$D = $d.getDate(); this.$W = $d.getDay(); this.$H = $d.getHours(); this.$m = $d.getMinutes(); this.$s = $d.getSeconds(); this.$ms = $d.getMilliseconds(); }; _proto.$utils = function $utils() { return Utils; }; _proto.isValid = function isValid2() { return !(this.$d.toString() === INVALID_DATE_STRING); }; _proto.isSame = function isSame(that, units) { var other = dayjs(that); return this.startOf(units) <= other && other <= this.endOf(units); }; _proto.isAfter = function isAfter(that, units) { return dayjs(that) < this.startOf(units); }; _proto.isBefore = function isBefore(that, units) { return this.endOf(units) < dayjs(that); }; _proto.$g = function $g(input, get, set) { if (Utils.u(input)) return this[get]; return this.set(set, input); }; _proto.unix = function unix() { return Math.floor(this.valueOf() / 1e3); }; _proto.valueOf = function valueOf() { return this.$d.getTime(); }; _proto.startOf = function startOf(units, _startOf) { var _this = this; var isStartOf = !Utils.u(_startOf) ? _startOf : true; var unit = Utils.p(units); var instanceFactory = function instanceFactory2(d, m) { var ins = Utils.w(_this.$u ? Date.UTC(_this.$y, m, d) : new Date(_this.$y, m, d), _this); return isStartOf ? ins : ins.endOf(D); }; var instanceFactorySet = function instanceFactorySet2(method, slice) { var argumentStart = [0, 0, 0, 0]; var argumentEnd = [23, 59, 59, 999]; return Utils.w(_this.toDate()[method].apply(_this.toDate("s"), (isStartOf ? argumentStart : argumentEnd).slice(slice)), _this); }; var $W = this.$W, $M = this.$M, $D = this.$D; var utcPad = "set" + (this.$u ? "UTC" : ""); switch (unit) { case Y: return isStartOf ? instanceFactory(1, 0) : instanceFactory(31, 11); case M: return isStartOf ? instanceFactory(1, $M) : instanceFactory(0, $M + 1); case W: { var weekStart = this.$locale().weekStart || 0; var gap = ($W < weekStart ? $W + 7 : $W) - weekStart; return instanceFactory(isStartOf ? $D - gap : $D + (6 - gap), $M); } case D: case DATE: return instanceFactorySet(utcPad + "Hours", 0); case H: return instanceFactorySet(utcPad + "Minutes", 1); case MIN: return instanceFactorySet(utcPad + "Seconds", 2); case S: return instanceFactorySet(utcPad + "Milliseconds", 3); default: return this.clone(); } }; _proto.endOf = function endOf(arg) { return this.startOf(arg, false); }; _proto.$set = function $set(units, _int) { var _C$D$C$DATE$C$M$C$Y$C; var unit = Utils.p(units); var utcPad = "set" + (this.$u ? "UTC" : ""); var name2 = (_C$D$C$DATE$C$M$C$Y$C = {}, _C$D$C$DATE$C$M$C$Y$C[D] = utcPad + "Date", _C$D$C$DATE$C$M$C$Y$C[DATE] = utcPad + "Date", _C$D$C$DATE$C$M$C$Y$C[M] = utcPad + "Month", _C$D$C$DATE$C$M$C$Y$C[Y] = utcPad + "FullYear", _C$D$C$DATE$C$M$C$Y$C[H] = utcPad + "Hours", _C$D$C$DATE$C$M$C$Y$C[MIN] = utcPad + "Minutes", _C$D$C$DATE$C$M$C$Y$C[S] = utcPad + "Seconds", _C$D$C$DATE$C$M$C$Y$C[MS] = utcPad + "Milliseconds", _C$D$C$DATE$C$M$C$Y$C)[unit]; var arg = unit === D ? this.$D + (_int - this.$W) : _int; if (unit === M || unit === Y) { var date = this.clone().set(DATE, 1); date.$d[name2](arg); date.init(); this.$d = date.set(DATE, Math.min(this.$D, date.daysInMonth())).$d; } else if (name2) this.$d[name2](arg); this.init(); return this; }; _proto.set = function set(string, _int2) { return this.clone().$set(string, _int2); }; _proto.get = function get(unit) { return this[Utils.p(unit)](); }; _proto.add = function add(number, units) { var _this2 = this, _C$MIN$C$H$C$S$unit; number = Number(number); var unit = Utils.p(units); var instanceFactorySet = function instanceFactorySet2(n2) { var d = dayjs(_this2); return Utils.w(d.date(d.date() + Math.round(n2 * number)), _this2); }; if (unit === M) { return this.set(M, this.$M + number); } if (unit === Y) { return this.set(Y, this.$y + number); } if (unit === D) { return instanceFactorySet(1); } if (unit === W) { return instanceFactorySet(7); } var step = (_C$MIN$C$H$C$S$unit = {}, _C$MIN$C$H$C$S$unit[MIN] = MILLISECONDS_A_MINUTE, _C$MIN$C$H$C$S$unit[H] = MILLISECONDS_A_HOUR, _C$MIN$C$H$C$S$unit[S] = MILLISECONDS_A_SECOND, _C$MIN$C$H$C$S$unit)[unit] || 1; var nextTimeStamp = this.$d.getTime() + number * step; return Utils.w(nextTimeStamp, this); }; _proto.subtract = function subtract(number, string) { return this.add(number * -1, string); }; _proto.format = function format2(formatStr) { var _this3 = this; var locale = this.$locale(); if (!this.isValid()) return locale.invalidDate || INVALID_DATE_STRING; var str = formatStr || FORMAT_DEFAULT; var zoneStr = Utils.z(this); var $H = this.$H, $m = this.$m, $M = this.$M; var weekdays = locale.weekdays, months = locale.months, meridiem = locale.meridiem; var getShort = function getShort2(arr, index2, full, length) { return arr && (arr[index2] || arr(_this3, str)) || full[index2].slice(0, length); }; var get$H = function get$H2(num) { return Utils.s($H % 12 || 12, num, "0"); }; var meridiemFunc = meridiem || function(hour, minute, isLowercase) { var m = hour < 12 ? "AM" : "PM"; return isLowercase ? m.toLowerCase() : m; }; var matches2 = { YY: String(this.$y).slice(-2), YYYY: Utils.s(this.$y, 4, "0"), M: $M + 1, MM: Utils.s($M + 1, 2, "0"), MMM: getShort(locale.monthsShort, $M, months, 3), MMMM: getShort(months, $M), D: this.$D, DD: Utils.s(this.$D, 2, "0"), d: String(this.$W), dd: getShort(locale.weekdaysMin, this.$W, weekdays, 2), ddd: getShort(locale.weekdaysShort, this.$W, weekdays, 3), dddd: weekdays[this.$W], H: String($H), HH: Utils.s($H, 2, "0"), h: get$H(1), hh: get$H(2), a: meridiemFunc($H, $m, true), A: meridiemFunc($H, $m, false), m: String($m), mm: Utils.s($m, 2, "0"), s: String(this.$s), ss: Utils.s(this.$s, 2, "0"), SSS: Utils.s(this.$ms, 3, "0"), Z: zoneStr }; return str.replace(REGEX_FORMAT, function(match, $1) { return $1 || matches2[match] || zoneStr.replace(":", ""); }); }; _proto.utcOffset = function utcOffset() { return -Math.round(this.$d.getTimezoneOffset() / 15) * 15; }; _proto.diff = function diff(input, units, _float) { var _C$Y$C$M$C$Q$C$W$C$D$; var unit = Utils.p(units); var that = dayjs(input); var zoneDelta = (that.utcOffset() - this.utcOffset()) * MILLISECONDS_A_MINUTE; var diff2 = this - that; var result = Utils.m(this, that); result = (_C$Y$C$M$C$Q$C$W$C$D$ = {}, _C$Y$C$M$C$Q$C$W$C$D$[Y] = result / 12, _C$Y$C$M$C$Q$C$W$C$D$[M] = result, _C$Y$C$M$C$Q$C$W$C$D$[Q] = result / 3, _C$Y$C$M$C$Q$C$W$C$D$[W] = (diff2 - zoneDelta) / MILLISECONDS_A_WEEK, _C$Y$C$M$C$Q$C$W$C$D$[D] = (diff2 - zoneDelta) / MILLISECONDS_A_DAY, _C$Y$C$M$C$Q$C$W$C$D$[H] = diff2 / MILLISECONDS_A_HOUR, _C$Y$C$M$C$Q$C$W$C$D$[MIN] = diff2 / MILLISECONDS_A_MINUTE, _C$Y$C$M$C$Q$C$W$C$D$[S] = diff2 / MILLISECONDS_A_SECOND, _C$Y$C$M$C$Q$C$W$C$D$)[unit] || diff2; return _float ? result : Utils.a(result); }; _proto.daysInMonth = function daysInMonth() { return this.endOf(M).$D; }; _proto.$locale = function $locale() { return Ls[this.$L]; }; _proto.locale = function locale(preset, object) { if (!preset) return this.$L; var that = this.clone(); var nextLocaleName = parseLocale(preset, object, true); if (nextLocaleName) that.$L = nextLocaleName; return that; }; _proto.clone = function clone3() { return Utils.w(this.$d, this); }; _proto.toDate = function toDate() { return new Date(this.valueOf()); }; _proto.toJSON = function toJSON() { return this.isValid() ? this.toISOString() : null; }; _proto.toISOString = function toISOString() { return this.$d.toISOString(); }; _proto.toString = function toString2() { return this.$d.toUTCString(); }; return Dayjs2; }(); var proto = Dayjs.prototype; dayjs.prototype = proto; [["$ms", MS], ["$s", S], ["$m", MIN], ["$H", H], ["$W", D], ["$M", M], ["$y", Y], ["$D", DATE]].forEach(function(g) { proto[g[1]] = function(input) { return this.$g(input, g[0], g[1]); }; }); dayjs.extend = function(plugin9, option3) { if (!plugin9.$i) { plugin9(option3, Dayjs, dayjs); plugin9.$i = true; } return dayjs; }; dayjs.locale = parseLocale; dayjs.isDayjs = isDayjs; dayjs.unix = function(timestamp) { return dayjs(timestamp * 1e3); }; dayjs.en = Ls[L]; dayjs.Ls = Ls; dayjs.p = {}; var esm_default = dayjs; // packages/forms/resources/js/components/date-time-picker.js var import_customParseFormat = __toModule(require_customParseFormat()); var import_localeData = __toModule(require_localeData()); var import_timezone = __toModule(require_timezone()); var import_utc = __toModule(require_utc()); esm_default.extend(import_customParseFormat.default); esm_default.extend(import_localeData.default); esm_default.extend(import_timezone.default); esm_default.extend(import_utc.default); window.dayjs = esm_default; var date_time_picker_default = (Alpine) => { Alpine.data("dateTimePickerFormComponent", ({ displayFormat, firstDayOfWeek, isAutofocused, locale, shouldCloseOnDateSelection, state: state2 }) => { const timezone2 = esm_default.tz.guess(); return { daysInFocusedMonth: [], displayText: "", emptyDaysInFocusedMonth: [], focusedDate: null, focusedMonth: null, focusedYear: null, hour: null, isClearingState: false, minute: null, second: null, state: state2, dayLabels: [], months: [], init: function() { esm_default.locale(locales[locale] ?? locales["en"]); this.focusedDate = esm_default().tz(timezone2); let date = this.getSelectedDate() ?? esm_default().tz(timezone2).hour(0).minute(0).second(0); if (this.getMaxDate() !== null && date.isAfter(this.getMaxDate())) { date = null; } else if (this.getMinDate() !== null && date.isBefore(this.getMinDate())) { date = null; } this.hour = date?.hour() ?? 0; this.minute = date?.minute() ?? 0; this.second = date?.second() ?? 0; this.setDisplayText(); this.setMonths(); this.setDayLabels(); if (isAutofocused) { this.$nextTick(() => this.togglePanelVisibility(this.$refs.button)); } this.$watch("focusedMonth", () => { this.focusedMonth = +this.focusedMonth; if (this.focusedDate.month() === this.focusedMonth) { return; } this.focusedDate = this.focusedDate.month(this.focusedMonth); }); this.$watch("focusedYear", () => { if (this.focusedYear?.length > 4) { this.focusedYear = this.focusedYear.substring(0, 4); } if (!this.focusedYear || this.focusedYear?.length !== 4) { return; } let year = +this.focusedYear; if (!Number.isInteger(year)) { year = esm_default().tz(timezone2).year(); this.focusedYear = year; } if (this.focusedDate.year() === year) { return; } this.focusedDate = this.focusedDate.year(year); }); this.$watch("focusedDate", () => { let month = this.focusedDate.month(); let year = this.focusedDate.year(); if (this.focusedMonth !== month) { this.focusedMonth = month; } if (this.focusedYear !== year) { this.focusedYear = year; } this.setupDaysGrid(); }); this.$watch("hour", () => { let hour = +this.hour; if (!Number.isInteger(hour)) { this.hour = 0; } else if (hour > 23) { this.hour = 0; } else if (hour < 0) { this.hour = 23; } else { this.hour = hour; } if (this.isClearingState) { return; } let date2 = this.getSelectedDate() ?? this.focusedDate; this.setState(date2.hour(this.hour ?? 0)); }); this.$watch("minute", () => { let minute = +this.minute; if (!Number.isInteger(minute)) { this.minute = 0; } else if (minute > 59) { this.minute = 0; } else if (minute < 0) { this.minute = 59; } else { this.minute = minute; } if (this.isClearingState) { return; } let date2 = this.getSelectedDate() ?? this.focusedDate; this.setState(date2.minute(this.minute ?? 0)); }); this.$watch("second", () => { let second = +this.second; if (!Number.isInteger(second)) { this.second = 0; } else if (second > 59) { this.second = 0; } else if (second < 0) { this.second = 59; } else { this.second = second; } if (this.isClearingState) { return; } let date2 = this.getSelectedDate() ?? this.focusedDate; this.setState(date2.second(this.second ?? 0)); }); this.$watch("state", () => { if (this.state === void 0) { return; } let date2 = this.getSelectedDate(); if (date2 === null) { this.clearState(); return; } if (this.getMaxDate() !== null && date2?.isAfter(this.getMaxDate())) { date2 = null; } if (this.getMinDate() !== null && date2?.isBefore(this.getMinDate())) { date2 = null; } const newHour = date2?.hour() ?? 0; if (this.hour !== newHour) { this.hour = newHour; } const newMinute = date2?.minute() ?? 0; if (this.minute !== newMinute) { this.minute = newMinute; } const newSecond = date2?.second() ?? 0; if (this.second !== newSecond) { this.second = newSecond; } this.setDisplayText(); }); }, clearState: function() { this.isClearingState = true; this.setState(null); this.hour = 0; this.minute = 0; this.second = 0; this.$nextTick(() => this.isClearingState = false); }, dateIsDisabled: function(date) { if (this.$refs?.disabledDates && JSON.parse(this.$refs.disabledDates.value ?? []).some((disabledDate) => { disabledDate = esm_default(disabledDate); if (!disabledDate.isValid()) { return false; } return disabledDate.isSame(date, "day"); })) { return true; } if (this.getMaxDate() && date.isAfter(this.getMaxDate(), "day")) { return true; } if (this.getMinDate() && date.isBefore(this.getMinDate(), "day")) { return true; } return false; }, dayIsDisabled: function(day) { this.focusedDate ??= esm_default().tz(timezone2); return this.dateIsDisabled(this.focusedDate.date(day)); }, dayIsSelected: function(day) { let selectedDate = this.getSelectedDate(); if (selectedDate === null) { return false; } this.focusedDate ??= esm_default().tz(timezone2); return selectedDate.date() === day && selectedDate.month() === this.focusedDate.month() && selectedDate.year() === this.focusedDate.year(); }, dayIsToday: function(day) { let date = esm_default().tz(timezone2); this.focusedDate ??= date; return date.date() === day && date.month() === this.focusedDate.month() && date.year() === this.focusedDate.year(); }, focusPreviousDay: function() { this.focusedDate ??= esm_default().tz(timezone2); this.focusedDate = this.focusedDate.subtract(1, "day"); }, focusPreviousWeek: function() { this.focusedDate ??= esm_default().tz(timezone2); this.focusedDate = this.focusedDate.subtract(1, "week"); }, focusNextDay: function() { this.focusedDate ??= esm_default().tz(timezone2); this.focusedDate = this.focusedDate.add(1, "day"); }, focusNextWeek: function() { this.focusedDate ??= esm_default().tz(timezone2); this.focusedDate = this.focusedDate.add(1, "week"); }, getDayLabels: function() { const labels = esm_default.weekdaysShort(); if (firstDayOfWeek === 0) { return labels; } return [ ...labels.slice(firstDayOfWeek), ...labels.slice(0, firstDayOfWeek) ]; }, getMaxDate: function() { let date = esm_default(this.$refs.maxDate?.value); return date.isValid() ? date : null; }, getMinDate: function() { let date = esm_default(this.$refs.minDate?.value); return date.isValid() ? date : null; }, getSelectedDate: function() { if (this.state === void 0) { return null; } if (this.state === null) { return null; } let date = esm_default(this.state); if (!date.isValid()) { return null; } return date; }, togglePanelVisibility: function() { if (!this.isOpen()) { this.focusedDate = this.getSelectedDate() ?? this.getMinDate() ?? esm_default().tz(timezone2); this.setupDaysGrid(); } this.$refs.panel.toggle(this.$refs.button); }, selectDate: function(day = null) { if (day) { this.setFocusedDay(day); } this.focusedDate ??= esm_default().tz(timezone2); this.setState(this.focusedDate); if (shouldCloseOnDateSelection) { this.togglePanelVisibility(); } }, setDisplayText: function() { this.displayText = this.getSelectedDate() ? this.getSelectedDate().format(displayFormat) : ""; }, setMonths: function() { this.months = esm_default.months(); }, setDayLabels: function() { this.dayLabels = this.getDayLabels(); }, setupDaysGrid: function() { this.focusedDate ??= esm_default().tz(timezone2); this.emptyDaysInFocusedMonth = Array.from({ length: this.focusedDate.date(8 - firstDayOfWeek).day() }, (_, i) => i + 1); this.daysInFocusedMonth = Array.from({ length: this.focusedDate.daysInMonth() }, (_, i) => i + 1); }, setFocusedDay: function(day) { this.focusedDate = (this.focusedDate ?? esm_default().tz(timezone2)).date(day); }, setState: function(date) { if (date === null) { this.state = null; this.setDisplayText(); return; } if (this.dateIsDisabled(date)) { return; } this.state = date.hour(this.hour ?? 0).minute(this.minute ?? 0).second(this.second ?? 0).format("YYYY-MM-DD HH:mm:ss"); this.setDisplayText(); }, isOpen: function() { return this.$refs.panel?.style.display === "block"; } }; }); }; var locales = { ar: require_ar(), bs: require_bs(), ca: require_ca(), cs: require_cs(), cy: require_cy(), da: require_da(), de: require_de(), en: require_en(), es: require_es(), fa: require_fa(), fi: require_fi(), fr: require_fr(), hi: require_hi(), hu: require_hu(), hy: require_hy_am(), id: require_id(), it: require_it(), ja: require_ja(), ka: require_ka(), km: require_km(), ku: require_ku(), ms: require_ms(), my: require_my(), nl: require_nl(), pl: require_pl(), pt_BR: require_pt_br(), pt_PT: require_pt(), ro: require_ro(), ru: require_ru(), sv: require_sv(), tr: require_tr(), uk: require_uk(), vi: require_vi(), zh_CN: require_zh_cn(), zh_TW: require_zh_tw() }; // node_modules/filepond/dist/filepond.esm.js var filepond_esm_exports = {}; __export(filepond_esm_exports, { FileOrigin: () => FileOrigin$1, FileStatus: () => FileStatus, OptionTypes: () => OptionTypes, Status: () => Status$1, create: () => create$f, destroy: () => destroy, find: () => find, getOptions: () => getOptions$1, parse: () => parse, registerPlugin: () => registerPlugin, setOptions: () => setOptions$1, supported: () => supported }); /*! * FilePond 4.30.4 * Licensed under MIT, https://opensource.org/licenses/MIT/ * Please visit https://pqina.nl/filepond/ for details. */ var isNode = (value) => value instanceof HTMLElement; var createStore = (initialState, queries2 = [], actions2 = []) => { const state2 = { ...initialState }; const actionQueue = []; const dispatchQueue = []; const getState = () => ({...state2}); const processActionQueue = () => { const queue = [...actionQueue]; actionQueue.length = 0; return queue; }; const processDispatchQueue = () => { const queue = [...dispatchQueue]; dispatchQueue.length = 0; queue.forEach(({type, data: data3}) => { dispatch(type, data3); }); }; const dispatch = (type, data3, isBlocking) => { if (isBlocking && !document.hidden) { dispatchQueue.push({type, data: data3}); return; } if (actionHandlers[type]) { actionHandlers[type](data3); } actionQueue.push({ type, data: data3 }); }; const query = (str, ...args) => queryHandles[str] ? queryHandles[str](...args) : null; const api = { getState, processActionQueue, processDispatchQueue, dispatch, query }; let queryHandles = {}; queries2.forEach((query2) => { queryHandles = { ...query2(state2), ...queryHandles }; }); let actionHandlers = {}; actions2.forEach((action) => { actionHandlers = { ...action(dispatch, query, state2), ...actionHandlers }; }); return api; }; var defineProperty = (obj, property, definition) => { if (typeof definition === "function") { obj[property] = definition; return; } Object.defineProperty(obj, property, {...definition}); }; var forin = (obj, cb) => { for (const key in obj) { if (!obj.hasOwnProperty(key)) { continue; } cb(key, obj[key]); } }; var createObject = (definition) => { const obj = {}; forin(definition, (property) => { defineProperty(obj, property, definition[property]); }); return obj; }; var attr = (node, name2, value = null) => { if (value === null) { return node.getAttribute(name2) || node.hasAttribute(name2); } node.setAttribute(name2, value); }; var ns = "http://www.w3.org/2000/svg"; var svgElements = ["svg", "path"]; var isSVGElement = (tag) => svgElements.includes(tag); var createElement = (tag, className, attributes = {}) => { if (typeof className === "object") { attributes = className; className = null; } const element = isSVGElement(tag) ? document.createElementNS(ns, tag) : document.createElement(tag); if (className) { if (isSVGElement(tag)) { attr(element, "class", className); } else { element.className = className; } } forin(attributes, (name2, value) => { attr(element, name2, value); }); return element; }; var appendChild = (parent) => (child, index2) => { if (typeof index2 !== "undefined" && parent.children[index2]) { parent.insertBefore(child, parent.children[index2]); } else { parent.appendChild(child); } }; var appendChildView = (parent, childViews) => (view, index2) => { if (typeof index2 !== "undefined") { childViews.splice(index2, 0, view); } else { childViews.push(view); } return view; }; var removeChildView = (parent, childViews) => (view) => { childViews.splice(childViews.indexOf(view), 1); if (view.element.parentNode) { parent.removeChild(view.element); } return view; }; var IS_BROWSER = (() => typeof window !== "undefined" && typeof window.document !== "undefined")(); var isBrowser = () => IS_BROWSER; var testElement = isBrowser() ? createElement("svg") : {}; var getChildCount = "children" in testElement ? (el) => el.children.length : (el) => el.childNodes.length; var getViewRect = (elementRect, childViews, offset2, scale) => { const left = offset2[0] || elementRect.left; const top = offset2[1] || elementRect.top; const right = left + elementRect.width; const bottom = top + elementRect.height * (scale[1] || 1); const rect = { element: { ...elementRect }, inner: { left: elementRect.left, top: elementRect.top, right: elementRect.right, bottom: elementRect.bottom }, outer: { left, top, right, bottom } }; childViews.filter((childView) => !childView.isRectIgnored()).map((childView) => childView.rect).forEach((childViewRect) => { expandRect(rect.inner, {...childViewRect.inner}); expandRect(rect.outer, {...childViewRect.outer}); }); calculateRectSize(rect.inner); rect.outer.bottom += rect.element.marginBottom; rect.outer.right += rect.element.marginRight; calculateRectSize(rect.outer); return rect; }; var expandRect = (parent, child) => { child.top += parent.top; child.right += parent.left; child.bottom += parent.top; child.left += parent.left; if (child.bottom > parent.bottom) { parent.bottom = child.bottom; } if (child.right > parent.right) { parent.right = child.right; } }; var calculateRectSize = (rect) => { rect.width = rect.right - rect.left; rect.height = rect.bottom - rect.top; }; var isNumber = (value) => typeof value === "number"; var thereYet = (position, destination, velocity, errorMargin = 1e-3) => { return Math.abs(position - destination) < errorMargin && Math.abs(velocity) < errorMargin; }; var spring = ({stiffness = 0.5, damping = 0.75, mass = 10} = {}) => { let target = null; let position = null; let velocity = 0; let resting = false; const interpolate = (ts, skipToEndState) => { if (resting) return; if (!(isNumber(target) && isNumber(position))) { resting = true; velocity = 0; return; } const f = -(position - target) * stiffness; velocity += f / mass; position += velocity; velocity *= damping; if (thereYet(position, target, velocity) || skipToEndState) { position = target; velocity = 0; resting = true; api.onupdate(position); api.oncomplete(position); } else { api.onupdate(position); } }; const setTarget = (value) => { if (isNumber(value) && !isNumber(position)) { position = value; } if (target === null) { target = value; position = value; } target = value; if (position === target || typeof target === "undefined") { resting = true; velocity = 0; api.onupdate(position); api.oncomplete(position); return; } resting = false; }; const api = createObject({ interpolate, target: { set: setTarget, get: () => target }, resting: { get: () => resting }, onupdate: (value) => { }, oncomplete: (value) => { } }); return api; }; var easeInOutQuad = (t2) => t2 < 0.5 ? 2 * t2 * t2 : -1 + (4 - 2 * t2) * t2; var tween = ({duration = 500, easing = easeInOutQuad, delay = 0} = {}) => { let start = null; let t2; let p2; let resting = true; let reverse = false; let target = null; const interpolate = (ts, skipToEndState) => { if (resting || target === null) return; if (start === null) { start = ts; } if (ts - start < delay) return; t2 = ts - start - delay; if (t2 >= duration || skipToEndState) { t2 = 1; p2 = reverse ? 0 : 1; api.onupdate(p2 * target); api.oncomplete(p2 * target); resting = true; } else { p2 = t2 / duration; api.onupdate((t2 >= 0 ? easing(reverse ? 1 - p2 : p2) : 0) * target); } }; const api = createObject({ interpolate, target: { get: () => reverse ? 0 : target, set: (value) => { if (target === null) { target = value; api.onupdate(value); api.oncomplete(value); return; } if (value < target) { target = 1; reverse = true; } else { reverse = false; target = value; } resting = false; start = null; } }, resting: { get: () => resting }, onupdate: (value) => { }, oncomplete: (value) => { } }); return api; }; var animator = { spring, tween }; var createAnimator = (definition, category, property) => { const def = definition[category] && typeof definition[category][property] === "object" ? definition[category][property] : definition[category] || definition; const type = typeof def === "string" ? def : def.type; const props = typeof def === "object" ? {...def} : {}; return animator[type] ? animator[type](props) : null; }; var addGetSet = (keys, obj, props, overwrite = false) => { obj = Array.isArray(obj) ? obj : [obj]; obj.forEach((o2) => { keys.forEach((key) => { let name2 = key; let getter = () => props[key]; let setter = (value) => props[key] = value; if (typeof key === "object") { name2 = key.key; getter = key.getter || getter; setter = key.setter || setter; } if (o2[name2] && !overwrite) { return; } o2[name2] = { get: getter, set: setter }; }); }); }; var animations = ({mixinConfig, viewProps, viewInternalAPI, viewExternalAPI}) => { const initialProps = {...viewProps}; const animations2 = []; forin(mixinConfig, (property, animation) => { const animator2 = createAnimator(animation); if (!animator2) { return; } animator2.onupdate = (value) => { viewProps[property] = value; }; animator2.target = initialProps[property]; const prop = { key: property, setter: (value) => { if (animator2.target === value) { return; } animator2.target = value; }, getter: () => viewProps[property] }; addGetSet([prop], [viewInternalAPI, viewExternalAPI], viewProps, true); animations2.push(animator2); }); return { write: (ts) => { let skipToEndState = document.hidden; let resting = true; animations2.forEach((animation) => { if (!animation.resting) resting = false; animation.interpolate(ts, skipToEndState); }); return resting; }, destroy: () => { } }; }; var addEvent = (element) => (type, fn2) => { element.addEventListener(type, fn2); }; var removeEvent = (element) => (type, fn2) => { element.removeEventListener(type, fn2); }; var listeners = ({ mixinConfig, viewProps, viewInternalAPI, viewExternalAPI, viewState, view }) => { const events = []; const add = addEvent(view.element); const remove = removeEvent(view.element); viewExternalAPI.on = (type, fn2) => { events.push({ type, fn: fn2 }); add(type, fn2); }; viewExternalAPI.off = (type, fn2) => { events.splice(events.findIndex((event) => event.type === type && event.fn === fn2), 1); remove(type, fn2); }; return { write: () => { return true; }, destroy: () => { events.forEach((event) => { remove(event.type, event.fn); }); } }; }; var apis = ({mixinConfig, viewProps, viewExternalAPI}) => { addGetSet(mixinConfig, viewExternalAPI, viewProps); }; var isDefined = (value) => value != null; var defaults = { opacity: 1, scaleX: 1, scaleY: 1, translateX: 0, translateY: 0, rotateX: 0, rotateY: 0, rotateZ: 0, originX: 0, originY: 0 }; var styles = ({mixinConfig, viewProps, viewInternalAPI, viewExternalAPI, view}) => { const initialProps = {...viewProps}; const currentProps = {}; addGetSet(mixinConfig, [viewInternalAPI, viewExternalAPI], viewProps); const getOffset = () => [viewProps["translateX"] || 0, viewProps["translateY"] || 0]; const getScale = () => [viewProps["scaleX"] || 0, viewProps["scaleY"] || 0]; const getRect2 = () => view.rect ? getViewRect(view.rect, view.childViews, getOffset(), getScale()) : null; viewInternalAPI.rect = {get: getRect2}; viewExternalAPI.rect = {get: getRect2}; mixinConfig.forEach((key) => { viewProps[key] = typeof initialProps[key] === "undefined" ? defaults[key] : initialProps[key]; }); return { write: () => { if (!propsHaveChanged(currentProps, viewProps)) { return; } applyStyles(view.element, viewProps); Object.assign(currentProps, {...viewProps}); return true; }, destroy: () => { } }; }; var propsHaveChanged = (currentProps, newProps) => { if (Object.keys(currentProps).length !== Object.keys(newProps).length) { return true; } for (const prop in newProps) { if (newProps[prop] !== currentProps[prop]) { return true; } } return false; }; var applyStyles = (element, { opacity, perspective, translateX, translateY, scaleX, scaleY, rotateX, rotateY, rotateZ, originX, originY, width, height }) => { let transforms2 = ""; let styles3 = ""; if (isDefined(originX) || isDefined(originY)) { styles3 += `transform-origin: ${originX || 0}px ${originY || 0}px;`; } if (isDefined(perspective)) { transforms2 += `perspective(${perspective}px) `; } if (isDefined(translateX) || isDefined(translateY)) { transforms2 += `translate3d(${translateX || 0}px, ${translateY || 0}px, 0) `; } if (isDefined(scaleX) || isDefined(scaleY)) { transforms2 += `scale3d(${isDefined(scaleX) ? scaleX : 1}, ${isDefined(scaleY) ? scaleY : 1}, 1) `; } if (isDefined(rotateZ)) { transforms2 += `rotateZ(${rotateZ}rad) `; } if (isDefined(rotateX)) { transforms2 += `rotateX(${rotateX}rad) `; } if (isDefined(rotateY)) { transforms2 += `rotateY(${rotateY}rad) `; } if (transforms2.length) { styles3 += `transform:${transforms2};`; } if (isDefined(opacity)) { styles3 += `opacity:${opacity};`; if (opacity === 0) { styles3 += `visibility:hidden;`; } if (opacity < 1) { styles3 += `pointer-events:none;`; } } if (isDefined(height)) { styles3 += `height:${height}px;`; } if (isDefined(width)) { styles3 += `width:${width}px;`; } const elementCurrentStyle = element.elementCurrentStyle || ""; if (styles3.length !== elementCurrentStyle.length || styles3 !== elementCurrentStyle) { element.style.cssText = styles3; element.elementCurrentStyle = styles3; } }; var Mixins = { styles, listeners, animations, apis }; var updateRect = (rect = {}, element = {}, style = {}) => { if (!element.layoutCalculated) { rect.paddingTop = parseInt(style.paddingTop, 10) || 0; rect.marginTop = parseInt(style.marginTop, 10) || 0; rect.marginRight = parseInt(style.marginRight, 10) || 0; rect.marginBottom = parseInt(style.marginBottom, 10) || 0; rect.marginLeft = parseInt(style.marginLeft, 10) || 0; element.layoutCalculated = true; } rect.left = element.offsetLeft || 0; rect.top = element.offsetTop || 0; rect.width = element.offsetWidth || 0; rect.height = element.offsetHeight || 0; rect.right = rect.left + rect.width; rect.bottom = rect.top + rect.height; rect.scrollTop = element.scrollTop; rect.hidden = element.offsetParent === null; return rect; }; var createView = ({ tag = "div", name: name2 = null, attributes = {}, read = () => { }, write: write2 = () => { }, create: create3 = () => { }, destroy: destroy3 = () => { }, filterFrameActionsForChild = (child, actions2) => actions2, didCreateView = () => { }, didWriteView = () => { }, ignoreRect = false, ignoreRectUpdate = false, mixins = [] } = {}) => (store, props = {}) => { const element = createElement(tag, `filepond--${name2}`, attributes); const style = window.getComputedStyle(element, null); const rect = updateRect(); let frameRect = null; let isResting = false; const childViews = []; const activeMixins = []; const ref = {}; const state2 = {}; const writers = [ write2 ]; const readers = [ read ]; const destroyers = [ destroy3 ]; const getElement = () => element; const getChildViews = () => childViews.concat(); const getReference = () => ref; const createChildView = (store2) => (view, props2) => view(store2, props2); const getRect2 = () => { if (frameRect) { return frameRect; } frameRect = getViewRect(rect, childViews, [0, 0], [1, 1]); return frameRect; }; const getStyle = () => style; const _read = () => { frameRect = null; childViews.forEach((child) => child._read()); const shouldUpdate = !(ignoreRectUpdate && rect.width && rect.height); if (shouldUpdate) { updateRect(rect, element, style); } const api = {root: internalAPI, props, rect}; readers.forEach((reader) => reader(api)); }; const _write = (ts, frameActions, shouldOptimize) => { let resting = frameActions.length === 0; writers.forEach((writer) => { const writerResting = writer({ props, root: internalAPI, actions: frameActions, timestamp: ts, shouldOptimize }); if (writerResting === false) { resting = false; } }); activeMixins.forEach((mixin) => { const mixinResting = mixin.write(ts); if (mixinResting === false) { resting = false; } }); childViews.filter((child) => !!child.element.parentNode).forEach((child) => { const childResting = child._write(ts, filterFrameActionsForChild(child, frameActions), shouldOptimize); if (!childResting) { resting = false; } }); childViews.forEach((child, index2) => { if (child.element.parentNode) { return; } internalAPI.appendChild(child.element, index2); child._read(); child._write(ts, filterFrameActionsForChild(child, frameActions), shouldOptimize); resting = false; }); isResting = resting; didWriteView({ props, root: internalAPI, actions: frameActions, timestamp: ts }); return resting; }; const _destroy = () => { activeMixins.forEach((mixin) => mixin.destroy()); destroyers.forEach((destroyer) => { destroyer({root: internalAPI, props}); }); childViews.forEach((child) => child._destroy()); }; const sharedAPIDefinition = { element: { get: getElement }, style: { get: getStyle }, childViews: { get: getChildViews } }; const internalAPIDefinition = { ...sharedAPIDefinition, rect: { get: getRect2 }, ref: { get: getReference }, is: (needle) => name2 === needle, appendChild: appendChild(element), createChildView: createChildView(store), linkView: (view) => { childViews.push(view); return view; }, unlinkView: (view) => { childViews.splice(childViews.indexOf(view), 1); }, appendChildView: appendChildView(element, childViews), removeChildView: removeChildView(element, childViews), registerWriter: (writer) => writers.push(writer), registerReader: (reader) => readers.push(reader), registerDestroyer: (destroyer) => destroyers.push(destroyer), invalidateLayout: () => element.layoutCalculated = false, dispatch: store.dispatch, query: store.query }; const externalAPIDefinition = { element: { get: getElement }, childViews: { get: getChildViews }, rect: { get: getRect2 }, resting: { get: () => isResting }, isRectIgnored: () => ignoreRect, _read, _write, _destroy }; const mixinAPIDefinition = { ...sharedAPIDefinition, rect: { get: () => rect } }; Object.keys(mixins).sort((a2, b) => { if (a2 === "styles") { return 1; } else if (b === "styles") { return -1; } return 0; }).forEach((key) => { const mixinAPI = Mixins[key]({ mixinConfig: mixins[key], viewProps: props, viewState: state2, viewInternalAPI: internalAPIDefinition, viewExternalAPI: externalAPIDefinition, view: createObject(mixinAPIDefinition) }); if (mixinAPI) { activeMixins.push(mixinAPI); } }); const internalAPI = createObject(internalAPIDefinition); create3({ root: internalAPI, props }); const childCount = getChildCount(element); childViews.forEach((child, index2) => { internalAPI.appendChild(child.element, childCount + index2); }); didCreateView(internalAPI); return createObject(externalAPIDefinition); }; var createPainter = (read, write2, fps = 60) => { const name2 = "__framePainter"; if (window[name2]) { window[name2].readers.push(read); window[name2].writers.push(write2); return; } window[name2] = { readers: [read], writers: [write2] }; const painter = window[name2]; const interval = 1e3 / fps; let last = null; let id = null; let requestTick = null; let cancelTick = null; const setTimerType = () => { if (document.hidden) { requestTick = () => window.setTimeout(() => tick(performance.now()), interval); cancelTick = () => window.clearTimeout(id); } else { requestTick = () => window.requestAnimationFrame(tick); cancelTick = () => window.cancelAnimationFrame(id); } }; document.addEventListener("visibilitychange", () => { if (cancelTick) cancelTick(); setTimerType(); tick(performance.now()); }); const tick = (ts) => { id = requestTick(tick); if (!last) { last = ts; } const delta = ts - last; if (delta <= interval) { return; } last = ts - delta % interval; painter.readers.forEach((read2) => read2()); painter.writers.forEach((write3) => write3(ts)); }; setTimerType(); tick(performance.now()); return { pause: () => { cancelTick(id); } }; }; var createRoute = (routes, fn2) => ({root: root2, props, actions: actions2 = [], timestamp, shouldOptimize}) => { actions2.filter((action) => routes[action.type]).forEach((action) => routes[action.type]({root: root2, props, action: action.data, timestamp, shouldOptimize})); if (fn2) { fn2({root: root2, props, actions: actions2, timestamp, shouldOptimize}); } }; var insertBefore = (newNode, referenceNode) => referenceNode.parentNode.insertBefore(newNode, referenceNode); var insertAfter = (newNode, referenceNode) => { return referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling); }; var isArray = (value) => Array.isArray(value); var isEmpty = (value) => value == null; var trim = (str) => str.trim(); var toString = (value) => "" + value; var toArray = (value, splitter = ",") => { if (isEmpty(value)) { return []; } if (isArray(value)) { return value; } return toString(value).split(splitter).map(trim).filter((str) => str.length); }; var isBoolean = (value) => typeof value === "boolean"; var toBoolean = (value) => isBoolean(value) ? value : value === "true"; var isString = (value) => typeof value === "string"; var toNumber = (value) => isNumber(value) ? value : isString(value) ? toString(value).replace(/[a-z]+/gi, "") : 0; var toInt = (value) => parseInt(toNumber(value), 10); var toFloat = (value) => parseFloat(toNumber(value)); var isInt = (value) => isNumber(value) && isFinite(value) && Math.floor(value) === value; var toBytes = (value, base = 1e3) => { if (isInt(value)) { return value; } let naturalFileSize = toString(value).trim(); if (/MB$/i.test(naturalFileSize)) { naturalFileSize = naturalFileSize.replace(/MB$i/, "").trim(); return toInt(naturalFileSize) * base * base; } if (/KB/i.test(naturalFileSize)) { naturalFileSize = naturalFileSize.replace(/KB$i/, "").trim(); return toInt(naturalFileSize) * base; } return toInt(naturalFileSize); }; var isFunction = (value) => typeof value === "function"; var toFunctionReference = (string) => { let ref = self; let levels = string.split("."); let level = null; while (level = levels.shift()) { ref = ref[level]; if (!ref) { return null; } } return ref; }; var methods = { process: "POST", patch: "PATCH", revert: "DELETE", fetch: "GET", restore: "GET", load: "GET" }; var createServerAPI = (outline) => { const api = {}; api.url = isString(outline) ? outline : outline.url || ""; api.timeout = outline.timeout ? parseInt(outline.timeout, 10) : 0; api.headers = outline.headers ? outline.headers : {}; forin(methods, (key) => { api[key] = createAction(key, outline[key], methods[key], api.timeout, api.headers); }); api.process = outline.process || isString(outline) || outline.url ? api.process : null; api.remove = outline.remove || null; delete api.headers; return api; }; var createAction = (name2, outline, method, timeout, headers) => { if (outline === null) { return null; } if (typeof outline === "function") { return outline; } const action = { url: method === "GET" || method === "PATCH" ? `?${name2}=` : "", method, headers, withCredentials: false, timeout, onload: null, ondata: null, onerror: null }; if (isString(outline)) { action.url = outline; return action; } Object.assign(action, outline); if (isString(action.headers)) { const parts = action.headers.split(/:(.+)/); action.headers = { header: parts[0], value: parts[1] }; } action.withCredentials = toBoolean(action.withCredentials); return action; }; var toServerAPI = (value) => createServerAPI(value); var isNull = (value) => value === null; var isObject = (value) => typeof value === "object" && value !== null; var isAPI = (value) => { return isObject(value) && isString(value.url) && isObject(value.process) && isObject(value.revert) && isObject(value.restore) && isObject(value.fetch); }; var getType = (value) => { if (isArray(value)) { return "array"; } if (isNull(value)) { return "null"; } if (isInt(value)) { return "int"; } if (/^[0-9]+ ?(?:GB|MB|KB)$/gi.test(value)) { return "bytes"; } if (isAPI(value)) { return "api"; } return typeof value; }; var replaceSingleQuotes = (str) => str.replace(/{\s*'/g, '{"').replace(/'\s*}/g, '"}').replace(/'\s*:/g, '":').replace(/:\s*'/g, ':"').replace(/,\s*'/g, ',"').replace(/'\s*,/g, '",'); var conversionTable = { array: toArray, boolean: toBoolean, int: (value) => getType(value) === "bytes" ? toBytes(value) : toInt(value), number: toFloat, float: toFloat, bytes: toBytes, string: (value) => isFunction(value) ? value : toString(value), function: (value) => toFunctionReference(value), serverapi: toServerAPI, object: (value) => { try { return JSON.parse(replaceSingleQuotes(value)); } catch (e2) { return null; } } }; var convertTo = (value, type) => conversionTable[type](value); var getValueByType = (newValue, defaultValue, valueType) => { if (newValue === defaultValue) { return newValue; } let newValueType = getType(newValue); if (newValueType !== valueType) { const convertedValue = convertTo(newValue, valueType); newValueType = getType(convertedValue); if (convertedValue === null) { throw `Trying to assign value with incorrect type to "${option}", allowed type: "${valueType}"`; } else { newValue = convertedValue; } } return newValue; }; var createOption = (defaultValue, valueType) => { let currentValue = defaultValue; return { enumerable: true, get: () => currentValue, set: (newValue) => { currentValue = getValueByType(newValue, defaultValue, valueType); } }; }; var createOptions = (options2) => { const obj = {}; forin(options2, (prop) => { const optionDefinition = options2[prop]; obj[prop] = createOption(optionDefinition[0], optionDefinition[1]); }); return createObject(obj); }; var createInitialState = (options2) => ({ items: [], listUpdateTimeout: null, itemUpdateTimeout: null, processingQueue: [], options: createOptions(options2) }); var fromCamels = (string, separator = "-") => string.split(/(?=[A-Z])/).map((part) => part.toLowerCase()).join(separator); var createOptionAPI = (store, options2) => { const obj = {}; forin(options2, (key) => { obj[key] = { get: () => store.getState().options[key], set: (value) => { store.dispatch(`SET_${fromCamels(key, "_").toUpperCase()}`, { value }); } }; }); return obj; }; var createOptionActions = (options2) => (dispatch, query, state2) => { const obj = {}; forin(options2, (key) => { const name2 = fromCamels(key, "_").toUpperCase(); obj[`SET_${name2}`] = (action) => { try { state2.options[key] = action.value; } catch (e2) { } dispatch(`DID_SET_${name2}`, {value: state2.options[key]}); }; }); return obj; }; var createOptionQueries = (options2) => (state2) => { const obj = {}; forin(options2, (key) => { obj[`GET_${fromCamels(key, "_").toUpperCase()}`] = (action) => state2.options[key]; }); return obj; }; var InteractionMethod = { API: 1, DROP: 2, BROWSE: 3, PASTE: 4, NONE: 5 }; var getUniqueId = () => Math.random().toString(36).substring(2, 11); var arrayRemove = (arr, index2) => arr.splice(index2, 1); var run = (cb, sync) => { if (sync) { cb(); } else if (document.hidden) { Promise.resolve(1).then(cb); } else { setTimeout(cb, 0); } }; var on = () => { const listeners2 = []; const off2 = (event, cb) => { arrayRemove(listeners2, listeners2.findIndex((listener) => listener.event === event && (listener.cb === cb || !cb))); }; const fire2 = (event, args, sync) => { listeners2.filter((listener) => listener.event === event).map((listener) => listener.cb).forEach((cb) => run(() => cb(...args), sync)); }; return { fireSync: (event, ...args) => { fire2(event, args, true); }, fire: (event, ...args) => { fire2(event, args, false); }, on: (event, cb) => { listeners2.push({event, cb}); }, onOnce: (event, cb) => { listeners2.push({ event, cb: (...args) => { off2(event, cb); cb(...args); } }); }, off: off2 }; }; var copyObjectPropertiesToObject = (src, target, excluded) => { Object.getOwnPropertyNames(src).filter((property) => !excluded.includes(property)).forEach((key) => Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(src, key))); }; var PRIVATE = [ "fire", "process", "revert", "load", "on", "off", "onOnce", "retryLoad", "extend", "archive", "archived", "release", "released", "requestProcessing", "freeze" ]; var createItemAPI = (item2) => { const api = {}; copyObjectPropertiesToObject(item2, api, PRIVATE); return api; }; var removeReleasedItems = (items) => { items.forEach((item2, index2) => { if (item2.released) { arrayRemove(items, index2); } }); }; var ItemStatus = { INIT: 1, IDLE: 2, PROCESSING_QUEUED: 9, PROCESSING: 3, PROCESSING_COMPLETE: 5, PROCESSING_ERROR: 6, PROCESSING_REVERT_ERROR: 10, LOADING: 7, LOAD_ERROR: 8 }; var FileOrigin = { INPUT: 1, LIMBO: 2, LOCAL: 3 }; var getNonNumeric = (str) => /[^0-9]+/.exec(str); var getDecimalSeparator = () => getNonNumeric(1.1 .toLocaleString())[0]; var getThousandsSeparator = () => { const decimalSeparator = getDecimalSeparator(); const thousandsStringWithSeparator = 1e3 .toLocaleString(); const thousandsStringWithoutSeparator = 1e3 .toString(); if (thousandsStringWithSeparator !== thousandsStringWithoutSeparator) { return getNonNumeric(thousandsStringWithSeparator)[0]; } return decimalSeparator === "." ? "," : "."; }; var Type = { BOOLEAN: "boolean", INT: "int", NUMBER: "number", STRING: "string", ARRAY: "array", OBJECT: "object", FUNCTION: "function", ACTION: "action", SERVER_API: "serverapi", REGEX: "regex" }; var filters = []; var applyFilterChain = (key, value, utils) => new Promise((resolve, reject) => { const matchingFilters = filters.filter((f) => f.key === key).map((f) => f.cb); if (matchingFilters.length === 0) { resolve(value); return; } const initialFilter = matchingFilters.shift(); matchingFilters.reduce((current, next) => current.then((value2) => next(value2, utils)), initialFilter(value, utils)).then((value2) => resolve(value2)).catch((error2) => reject(error2)); }); var applyFilters = (key, value, utils) => filters.filter((f) => f.key === key).map((f) => f.cb(value, utils)); var addFilter = (key, cb) => filters.push({key, cb}); var extendDefaultOptions = (additionalOptions) => Object.assign(defaultOptions, additionalOptions); var getOptions = () => ({...defaultOptions}); var setOptions = (opts) => { forin(opts, (key, value) => { if (!defaultOptions[key]) { return; } defaultOptions[key][0] = getValueByType(value, defaultOptions[key][0], defaultOptions[key][1]); }); }; var defaultOptions = { id: [null, Type.STRING], name: ["filepond", Type.STRING], disabled: [false, Type.BOOLEAN], className: [null, Type.STRING], required: [false, Type.BOOLEAN], captureMethod: [null, Type.STRING], allowSyncAcceptAttribute: [true, Type.BOOLEAN], allowDrop: [true, Type.BOOLEAN], allowBrowse: [true, Type.BOOLEAN], allowPaste: [true, Type.BOOLEAN], allowMultiple: [false, Type.BOOLEAN], allowReplace: [true, Type.BOOLEAN], allowRevert: [true, Type.BOOLEAN], allowRemove: [true, Type.BOOLEAN], allowProcess: [true, Type.BOOLEAN], allowReorder: [false, Type.BOOLEAN], allowDirectoriesOnly: [false, Type.BOOLEAN], storeAsFile: [false, Type.BOOLEAN], forceRevert: [false, Type.BOOLEAN], maxFiles: [null, Type.INT], checkValidity: [false, Type.BOOLEAN], itemInsertLocationFreedom: [true, Type.BOOLEAN], itemInsertLocation: ["before", Type.STRING], itemInsertInterval: [75, Type.INT], dropOnPage: [false, Type.BOOLEAN], dropOnElement: [true, Type.BOOLEAN], dropValidation: [false, Type.BOOLEAN], ignoredFiles: [[".ds_store", "thumbs.db", "desktop.ini"], Type.ARRAY], instantUpload: [true, Type.BOOLEAN], maxParallelUploads: [2, Type.INT], allowMinimumUploadDuration: [true, Type.BOOLEAN], chunkUploads: [false, Type.BOOLEAN], chunkForce: [false, Type.BOOLEAN], chunkSize: [5e6, Type.INT], chunkRetryDelays: [[500, 1e3, 3e3], Type.ARRAY], server: [null, Type.SERVER_API], fileSizeBase: [1e3, Type.INT], labelFileSizeBytes: ["bytes", Type.STRING], labelFileSizeKilobytes: ["KB", Type.STRING], labelFileSizeMegabytes: ["MB", Type.STRING], labelFileSizeGigabytes: ["GB", Type.STRING], labelDecimalSeparator: [getDecimalSeparator(), Type.STRING], labelThousandsSeparator: [getThousandsSeparator(), Type.STRING], labelIdle: [ 'Drag & Drop your files or Browse', Type.STRING ], labelInvalidField: ["Field contains invalid files", Type.STRING], labelFileWaitingForSize: ["Waiting for size", Type.STRING], labelFileSizeNotAvailable: ["Size not available", Type.STRING], labelFileCountSingular: ["file in list", Type.STRING], labelFileCountPlural: ["files in list", Type.STRING], labelFileLoading: ["Loading", Type.STRING], labelFileAdded: ["Added", Type.STRING], labelFileLoadError: ["Error during load", Type.STRING], labelFileRemoved: ["Removed", Type.STRING], labelFileRemoveError: ["Error during remove", Type.STRING], labelFileProcessing: ["Uploading", Type.STRING], labelFileProcessingComplete: ["Upload complete", Type.STRING], labelFileProcessingAborted: ["Upload cancelled", Type.STRING], labelFileProcessingError: ["Error during upload", Type.STRING], labelFileProcessingRevertError: ["Error during revert", Type.STRING], labelTapToCancel: ["tap to cancel", Type.STRING], labelTapToRetry: ["tap to retry", Type.STRING], labelTapToUndo: ["tap to undo", Type.STRING], labelButtonRemoveItem: ["Remove", Type.STRING], labelButtonAbortItemLoad: ["Abort", Type.STRING], labelButtonRetryItemLoad: ["Retry", Type.STRING], labelButtonAbortItemProcessing: ["Cancel", Type.STRING], labelButtonUndoItemProcessing: ["Undo", Type.STRING], labelButtonRetryItemProcessing: ["Retry", Type.STRING], labelButtonProcessItem: ["Upload", Type.STRING], iconRemove: [ '', Type.STRING ], iconProcess: [ '', Type.STRING ], iconRetry: [ '', Type.STRING ], iconUndo: [ '', Type.STRING ], iconDone: [ '', Type.STRING ], oninit: [null, Type.FUNCTION], onwarning: [null, Type.FUNCTION], onerror: [null, Type.FUNCTION], onactivatefile: [null, Type.FUNCTION], oninitfile: [null, Type.FUNCTION], onaddfilestart: [null, Type.FUNCTION], onaddfileprogress: [null, Type.FUNCTION], onaddfile: [null, Type.FUNCTION], onprocessfilestart: [null, Type.FUNCTION], onprocessfileprogress: [null, Type.FUNCTION], onprocessfileabort: [null, Type.FUNCTION], onprocessfilerevert: [null, Type.FUNCTION], onprocessfile: [null, Type.FUNCTION], onprocessfiles: [null, Type.FUNCTION], onremovefile: [null, Type.FUNCTION], onpreparefile: [null, Type.FUNCTION], onupdatefiles: [null, Type.FUNCTION], onreorderfiles: [null, Type.FUNCTION], beforeDropFile: [null, Type.FUNCTION], beforeAddFile: [null, Type.FUNCTION], beforeRemoveFile: [null, Type.FUNCTION], beforePrepareFile: [null, Type.FUNCTION], stylePanelLayout: [null, Type.STRING], stylePanelAspectRatio: [null, Type.STRING], styleItemPanelAspectRatio: [null, Type.STRING], styleButtonRemoveItemPosition: ["left", Type.STRING], styleButtonProcessItemPosition: ["right", Type.STRING], styleLoadIndicatorPosition: ["right", Type.STRING], styleProgressIndicatorPosition: ["right", Type.STRING], styleButtonRemoveItemAlign: [false, Type.BOOLEAN], files: [[], Type.ARRAY], credits: [["https://pqina.nl/", "Powered by PQINA"], Type.ARRAY] }; var getItemByQuery = (items, query) => { if (isEmpty(query)) { return items[0] || null; } if (isInt(query)) { return items[query] || null; } if (typeof query === "object") { query = query.id; } return items.find((item2) => item2.id === query) || null; }; var getNumericAspectRatioFromString = (aspectRatio) => { if (isEmpty(aspectRatio)) { return aspectRatio; } if (/:/.test(aspectRatio)) { const parts = aspectRatio.split(":"); return parts[1] / parts[0]; } return parseFloat(aspectRatio); }; var getActiveItems = (items) => items.filter((item2) => !item2.archived); var Status = { EMPTY: 0, IDLE: 1, ERROR: 2, BUSY: 3, READY: 4 }; var res = null; var canUpdateFileInput = () => { if (res === null) { try { const dataTransfer = new DataTransfer(); dataTransfer.items.add(new File(["hello world"], "This_Works.txt")); const el = document.createElement("input"); el.setAttribute("type", "file"); el.files = dataTransfer.files; res = el.files.length === 1; } catch (err) { res = false; } } return res; }; var ITEM_ERROR = [ ItemStatus.LOAD_ERROR, ItemStatus.PROCESSING_ERROR, ItemStatus.PROCESSING_REVERT_ERROR ]; var ITEM_BUSY = [ ItemStatus.LOADING, ItemStatus.PROCESSING, ItemStatus.PROCESSING_QUEUED, ItemStatus.INIT ]; var ITEM_READY = [ItemStatus.PROCESSING_COMPLETE]; var isItemInErrorState = (item2) => ITEM_ERROR.includes(item2.status); var isItemInBusyState = (item2) => ITEM_BUSY.includes(item2.status); var isItemInReadyState = (item2) => ITEM_READY.includes(item2.status); var isAsync = (state2) => isObject(state2.options.server) && (isObject(state2.options.server.process) || isFunction(state2.options.server.process)); var queries = (state2) => ({ GET_STATUS: () => { const items = getActiveItems(state2.items); const {EMPTY, ERROR, BUSY, IDLE, READY} = Status; if (items.length === 0) return EMPTY; if (items.some(isItemInErrorState)) return ERROR; if (items.some(isItemInBusyState)) return BUSY; if (items.some(isItemInReadyState)) return READY; return IDLE; }, GET_ITEM: (query) => getItemByQuery(state2.items, query), GET_ACTIVE_ITEM: (query) => getItemByQuery(getActiveItems(state2.items), query), GET_ACTIVE_ITEMS: () => getActiveItems(state2.items), GET_ITEMS: () => state2.items, GET_ITEM_NAME: (query) => { const item2 = getItemByQuery(state2.items, query); return item2 ? item2.filename : null; }, GET_ITEM_SIZE: (query) => { const item2 = getItemByQuery(state2.items, query); return item2 ? item2.fileSize : null; }, GET_STYLES: () => Object.keys(state2.options).filter((key) => /^style/.test(key)).map((option3) => ({ name: option3, value: state2.options[option3] })), GET_PANEL_ASPECT_RATIO: () => { const isShapeCircle = /circle/.test(state2.options.stylePanelLayout); const aspectRatio = isShapeCircle ? 1 : getNumericAspectRatioFromString(state2.options.stylePanelAspectRatio); return aspectRatio; }, GET_ITEM_PANEL_ASPECT_RATIO: () => state2.options.styleItemPanelAspectRatio, GET_ITEMS_BY_STATUS: (status) => getActiveItems(state2.items).filter((item2) => item2.status === status), GET_TOTAL_ITEMS: () => getActiveItems(state2.items).length, SHOULD_UPDATE_FILE_INPUT: () => state2.options.storeAsFile && canUpdateFileInput() && !isAsync(state2), IS_ASYNC: () => isAsync(state2), GET_FILE_SIZE_LABELS: (query) => ({ labelBytes: query("GET_LABEL_FILE_SIZE_BYTES") || void 0, labelKilobytes: query("GET_LABEL_FILE_SIZE_KILOBYTES") || void 0, labelMegabytes: query("GET_LABEL_FILE_SIZE_MEGABYTES") || void 0, labelGigabytes: query("GET_LABEL_FILE_SIZE_GIGABYTES") || void 0 }) }); var hasRoomForItem = (state2) => { const count = getActiveItems(state2.items).length; if (!state2.options.allowMultiple) { return count === 0; } const maxFileCount = state2.options.maxFiles; if (maxFileCount === null) { return true; } if (count < maxFileCount) { return true; } return false; }; var limit = (value, min3, max3) => Math.max(Math.min(max3, value), min3); var arrayInsert = (arr, index2, item2) => arr.splice(index2, 0, item2); var insertItem = (items, item2, index2) => { if (isEmpty(item2)) { return null; } if (typeof index2 === "undefined") { items.push(item2); return item2; } index2 = limit(index2, 0, items.length); arrayInsert(items, index2, item2); return item2; }; var isBase64DataURI = (str) => /^\s*data:([a-z]+\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s]*)\s*$/i.test(str); var getFilenameFromURL = (url) => url.split("/").pop().split("?").shift(); var getExtensionFromFilename = (name2) => name2.split(".").pop(); var guesstimateExtension = (type) => { if (typeof type !== "string") { return ""; } const subtype = type.split("/").pop(); if (/svg/.test(subtype)) { return "svg"; } if (/zip|compressed/.test(subtype)) { return "zip"; } if (/plain/.test(subtype)) { return "txt"; } if (/msword/.test(subtype)) { return "doc"; } if (/[a-z]+/.test(subtype)) { if (subtype === "jpeg") { return "jpg"; } return subtype; } return ""; }; var leftPad = (value, padding = "") => (padding + value).slice(-padding.length); var getDateString = (date = new Date()) => `${date.getFullYear()}-${leftPad(date.getMonth() + 1, "00")}-${leftPad(date.getDate(), "00")}_${leftPad(date.getHours(), "00")}-${leftPad(date.getMinutes(), "00")}-${leftPad(date.getSeconds(), "00")}`; var getFileFromBlob = (blob2, filename, type = null, extension = null) => { const file2 = typeof type === "string" ? blob2.slice(0, blob2.size, type) : blob2.slice(0, blob2.size, blob2.type); file2.lastModifiedDate = new Date(); if (blob2._relativePath) file2._relativePath = blob2._relativePath; if (!isString(filename)) { filename = getDateString(); } if (filename && extension === null && getExtensionFromFilename(filename)) { file2.name = filename; } else { extension = extension || guesstimateExtension(file2.type); file2.name = filename + (extension ? "." + extension : ""); } return file2; }; var getBlobBuilder = () => { return window.BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder; }; var createBlob = (arrayBuffer, mimeType) => { const BB = getBlobBuilder(); if (BB) { const bb = new BB(); bb.append(arrayBuffer); return bb.getBlob(mimeType); } return new Blob([arrayBuffer], { type: mimeType }); }; var getBlobFromByteStringWithMimeType = (byteString, mimeType) => { const ab = new ArrayBuffer(byteString.length); const ia = new Uint8Array(ab); for (let i = 0; i < byteString.length; i++) { ia[i] = byteString.charCodeAt(i); } return createBlob(ab, mimeType); }; var getMimeTypeFromBase64DataURI = (dataURI) => { return (/^data:(.+);/.exec(dataURI) || [])[1] || null; }; var getBase64DataFromBase64DataURI = (dataURI) => { const data3 = dataURI.split(",")[1]; return data3.replace(/\s/g, ""); }; var getByteStringFromBase64DataURI = (dataURI) => { return atob(getBase64DataFromBase64DataURI(dataURI)); }; var getBlobFromBase64DataURI = (dataURI) => { const mimeType = getMimeTypeFromBase64DataURI(dataURI); const byteString = getByteStringFromBase64DataURI(dataURI); return getBlobFromByteStringWithMimeType(byteString, mimeType); }; var getFileFromBase64DataURI = (dataURI, filename, extension) => { return getFileFromBlob(getBlobFromBase64DataURI(dataURI), filename, null, extension); }; var getFileNameFromHeader = (header) => { if (!/^content-disposition:/i.test(header)) return null; const matches2 = header.split(/filename=|filename\*=.+''/).splice(1).map((name2) => name2.trim().replace(/^["']|[;"']{0,2}$/g, "")).filter((name2) => name2.length); return matches2.length ? decodeURI(matches2[matches2.length - 1]) : null; }; var getFileSizeFromHeader = (header) => { if (/content-length:/i.test(header)) { const size2 = header.match(/[0-9]+/)[0]; return size2 ? parseInt(size2, 10) : null; } return null; }; var getTranfserIdFromHeader = (header) => { if (/x-content-transfer-id:/i.test(header)) { const id = (header.split(":")[1] || "").trim(); return id || null; } return null; }; var getFileInfoFromHeaders = (headers) => { const info = { source: null, name: null, size: null }; const rows = headers.split("\n"); for (let header of rows) { const name2 = getFileNameFromHeader(header); if (name2) { info.name = name2; continue; } const size2 = getFileSizeFromHeader(header); if (size2) { info.size = size2; continue; } const source = getTranfserIdFromHeader(header); if (source) { info.source = source; continue; } } return info; }; var createFileLoader = (fetchFn) => { const state2 = { source: null, complete: false, progress: 0, size: null, timestamp: null, duration: 0, request: null }; const getProgress = () => state2.progress; const abort = () => { if (state2.request && state2.request.abort) { state2.request.abort(); } }; const load = () => { const source = state2.source; api.fire("init", source); if (source instanceof File) { api.fire("load", source); } else if (source instanceof Blob) { api.fire("load", getFileFromBlob(source, source.name)); } else if (isBase64DataURI(source)) { api.fire("load", getFileFromBase64DataURI(source)); } else { loadURL(source); } }; const loadURL = (url) => { if (!fetchFn) { api.fire("error", { type: "error", body: "Can't load URL", code: 400 }); return; } state2.timestamp = Date.now(); state2.request = fetchFn(url, (response) => { state2.duration = Date.now() - state2.timestamp; state2.complete = true; if (response instanceof Blob) { response = getFileFromBlob(response, response.name || getFilenameFromURL(url)); } api.fire("load", response instanceof Blob ? response : response ? response.body : null); }, (error2) => { api.fire("error", typeof error2 === "string" ? { type: "error", code: 0, body: error2 } : error2); }, (computable, current, total) => { if (total) { state2.size = total; } state2.duration = Date.now() - state2.timestamp; if (!computable) { state2.progress = null; return; } state2.progress = current / total; api.fire("progress", state2.progress); }, () => { api.fire("abort"); }, (response) => { const fileinfo = getFileInfoFromHeaders(typeof response === "string" ? response : response.headers); api.fire("meta", { size: state2.size || fileinfo.size, filename: fileinfo.name, source: fileinfo.source }); }); }; const api = { ...on(), setSource: (source) => state2.source = source, getProgress, abort, load }; return api; }; var isGet = (method) => /GET|HEAD/.test(method); var sendRequest = (data3, url, options2) => { const api = { onheaders: () => { }, onprogress: () => { }, onload: () => { }, ontimeout: () => { }, onerror: () => { }, onabort: () => { }, abort: () => { aborted = true; xhr.abort(); } }; let aborted = false; let headersReceived = false; options2 = { method: "POST", headers: {}, withCredentials: false, ...options2 }; url = encodeURI(url); if (isGet(options2.method) && data3) { url = `${url}${encodeURIComponent(typeof data3 === "string" ? data3 : JSON.stringify(data3))}`; } const xhr = new XMLHttpRequest(); const process = isGet(options2.method) ? xhr : xhr.upload; process.onprogress = (e2) => { if (aborted) { return; } api.onprogress(e2.lengthComputable, e2.loaded, e2.total); }; xhr.onreadystatechange = () => { if (xhr.readyState < 2) { return; } if (xhr.readyState === 4 && xhr.status === 0) { return; } if (headersReceived) { return; } headersReceived = true; api.onheaders(xhr); }; xhr.onload = () => { if (xhr.status >= 200 && xhr.status < 300) { api.onload(xhr); } else { api.onerror(xhr); } }; xhr.onerror = () => api.onerror(xhr); xhr.onabort = () => { aborted = true; api.onabort(); }; xhr.ontimeout = () => api.ontimeout(xhr); xhr.open(options2.method, url, true); if (isInt(options2.timeout)) { xhr.timeout = options2.timeout; } Object.keys(options2.headers).forEach((key) => { const value = unescape(encodeURIComponent(options2.headers[key])); xhr.setRequestHeader(key, value); }); if (options2.responseType) { xhr.responseType = options2.responseType; } if (options2.withCredentials) { xhr.withCredentials = true; } xhr.send(data3); return api; }; var createResponse = (type, code, body, headers) => ({ type, code, body, headers }); var createTimeoutResponse = (cb) => (xhr) => { cb(createResponse("error", 0, "Timeout", xhr.getAllResponseHeaders())); }; var hasQS = (str) => /\?/.test(str); var buildURL = (...parts) => { let url = ""; parts.forEach((part) => { url += hasQS(url) && hasQS(part) ? part.replace(/\?/, "&") : part; }); return url; }; var createFetchFunction = (apiUrl = "", action) => { if (typeof action === "function") { return action; } if (!action || !isString(action.url)) { return null; } const onload = action.onload || ((res2) => res2); const onerror = action.onerror || ((res2) => null); return (url, load, error2, progress, abort, headers) => { const request = sendRequest(url, buildURL(apiUrl, action.url), { ...action, responseType: "blob" }); request.onload = (xhr) => { const headers2 = xhr.getAllResponseHeaders(); const filename = getFileInfoFromHeaders(headers2).name || getFilenameFromURL(url); load(createResponse("load", xhr.status, action.method === "HEAD" ? null : getFileFromBlob(onload(xhr.response), filename), headers2)); }; request.onerror = (xhr) => { error2(createResponse("error", xhr.status, onerror(xhr.response) || xhr.statusText, xhr.getAllResponseHeaders())); }; request.onheaders = (xhr) => { headers(createResponse("headers", xhr.status, null, xhr.getAllResponseHeaders())); }; request.ontimeout = createTimeoutResponse(error2); request.onprogress = progress; request.onabort = abort; return request; }; }; var ChunkStatus = { QUEUED: 0, COMPLETE: 1, PROCESSING: 2, ERROR: 3, WAITING: 4 }; var processFileChunked = (apiUrl, action, name2, file2, metadata, load, error2, progress, abort, transfer, options2) => { const chunks = []; const {chunkTransferId, chunkServer, chunkSize, chunkRetryDelays} = options2; const state2 = { serverId: chunkTransferId, aborted: false }; const ondata = action.ondata || ((fd) => fd); const onload = action.onload || ((xhr, method) => method === "HEAD" ? xhr.getResponseHeader("Upload-Offset") : xhr.response); const onerror = action.onerror || ((res2) => null); const requestTransferId = (cb) => { const formData = new FormData(); if (isObject(metadata)) formData.append(name2, JSON.stringify(metadata)); const headers = typeof action.headers === "function" ? action.headers(file2, metadata) : { ...action.headers, "Upload-Length": file2.size }; const requestParams = { ...action, headers }; const request = sendRequest(ondata(formData), buildURL(apiUrl, action.url), requestParams); request.onload = (xhr) => cb(onload(xhr, requestParams.method)); request.onerror = (xhr) => error2(createResponse("error", xhr.status, onerror(xhr.response) || xhr.statusText, xhr.getAllResponseHeaders())); request.ontimeout = createTimeoutResponse(error2); }; const requestTransferOffset = (cb) => { const requestUrl = buildURL(apiUrl, chunkServer.url, state2.serverId); const headers = typeof action.headers === "function" ? action.headers(state2.serverId) : { ...action.headers }; const requestParams = { headers, method: "HEAD" }; const request = sendRequest(null, requestUrl, requestParams); request.onload = (xhr) => cb(onload(xhr, requestParams.method)); request.onerror = (xhr) => error2(createResponse("error", xhr.status, onerror(xhr.response) || xhr.statusText, xhr.getAllResponseHeaders())); request.ontimeout = createTimeoutResponse(error2); }; const lastChunkIndex = Math.floor(file2.size / chunkSize); for (let i = 0; i <= lastChunkIndex; i++) { const offset2 = i * chunkSize; const data3 = file2.slice(offset2, offset2 + chunkSize, "application/offset+octet-stream"); chunks[i] = { index: i, size: data3.size, offset: offset2, data: data3, file: file2, progress: 0, retries: [...chunkRetryDelays], status: ChunkStatus.QUEUED, error: null, request: null, timeout: null }; } const completeProcessingChunks = () => load(state2.serverId); const canProcessChunk = (chunk) => chunk.status === ChunkStatus.QUEUED || chunk.status === ChunkStatus.ERROR; const processChunk = (chunk) => { if (state2.aborted) return; chunk = chunk || chunks.find(canProcessChunk); if (!chunk) { if (chunks.every((chunk2) => chunk2.status === ChunkStatus.COMPLETE)) { completeProcessingChunks(); } return; } chunk.status = ChunkStatus.PROCESSING; chunk.progress = null; const ondata2 = chunkServer.ondata || ((fd) => fd); const onerror2 = chunkServer.onerror || ((res2) => null); const requestUrl = buildURL(apiUrl, chunkServer.url, state2.serverId); const headers = typeof chunkServer.headers === "function" ? chunkServer.headers(chunk) : { ...chunkServer.headers, "Content-Type": "application/offset+octet-stream", "Upload-Offset": chunk.offset, "Upload-Length": file2.size, "Upload-Name": file2.name }; const request = chunk.request = sendRequest(ondata2(chunk.data), requestUrl, { ...chunkServer, headers }); request.onload = () => { chunk.status = ChunkStatus.COMPLETE; chunk.request = null; processChunks(); }; request.onprogress = (lengthComputable, loaded, total) => { chunk.progress = lengthComputable ? loaded : null; updateTotalProgress(); }; request.onerror = (xhr) => { chunk.status = ChunkStatus.ERROR; chunk.request = null; chunk.error = onerror2(xhr.response) || xhr.statusText; if (!retryProcessChunk(chunk)) { error2(createResponse("error", xhr.status, onerror2(xhr.response) || xhr.statusText, xhr.getAllResponseHeaders())); } }; request.ontimeout = (xhr) => { chunk.status = ChunkStatus.ERROR; chunk.request = null; if (!retryProcessChunk(chunk)) { createTimeoutResponse(error2)(xhr); } }; request.onabort = () => { chunk.status = ChunkStatus.QUEUED; chunk.request = null; abort(); }; }; const retryProcessChunk = (chunk) => { if (chunk.retries.length === 0) return false; chunk.status = ChunkStatus.WAITING; clearTimeout(chunk.timeout); chunk.timeout = setTimeout(() => { processChunk(chunk); }, chunk.retries.shift()); return true; }; const updateTotalProgress = () => { const totalBytesTransfered = chunks.reduce((p2, chunk) => { if (p2 === null || chunk.progress === null) return null; return p2 + chunk.progress; }, 0); if (totalBytesTransfered === null) return progress(false, 0, 0); const totalSize = chunks.reduce((total, chunk) => total + chunk.size, 0); progress(true, totalBytesTransfered, totalSize); }; const processChunks = () => { const totalProcessing = chunks.filter((chunk) => chunk.status === ChunkStatus.PROCESSING).length; if (totalProcessing >= 1) return; processChunk(); }; const abortChunks = () => { chunks.forEach((chunk) => { clearTimeout(chunk.timeout); if (chunk.request) { chunk.request.abort(); } }); }; if (!state2.serverId) { requestTransferId((serverId) => { if (state2.aborted) return; transfer(serverId); state2.serverId = serverId; processChunks(); }); } else { requestTransferOffset((offset2) => { if (state2.aborted) return; chunks.filter((chunk) => chunk.offset < offset2).forEach((chunk) => { chunk.status = ChunkStatus.COMPLETE; chunk.progress = chunk.size; }); processChunks(); }); } return { abort: () => { state2.aborted = true; abortChunks(); } }; }; var createFileProcessorFunction = (apiUrl, action, name2, options2) => (file2, metadata, load, error2, progress, abort, transfer) => { if (!file2) return; const canChunkUpload = options2.chunkUploads; const shouldChunkUpload = canChunkUpload && file2.size > options2.chunkSize; const willChunkUpload = canChunkUpload && (shouldChunkUpload || options2.chunkForce); if (file2 instanceof Blob && willChunkUpload) return processFileChunked(apiUrl, action, name2, file2, metadata, load, error2, progress, abort, transfer, options2); const ondata = action.ondata || ((fd) => fd); const onload = action.onload || ((res2) => res2); const onerror = action.onerror || ((res2) => null); const headers = typeof action.headers === "function" ? action.headers(file2, metadata) || {} : { ...action.headers }; const requestParams = { ...action, headers }; var formData = new FormData(); if (isObject(metadata)) { formData.append(name2, JSON.stringify(metadata)); } (file2 instanceof Blob ? [{name: null, file: file2}] : file2).forEach((item2) => { formData.append(name2, item2.file, item2.name === null ? item2.file.name : `${item2.name}${item2.file.name}`); }); const request = sendRequest(ondata(formData), buildURL(apiUrl, action.url), requestParams); request.onload = (xhr) => { load(createResponse("load", xhr.status, onload(xhr.response), xhr.getAllResponseHeaders())); }; request.onerror = (xhr) => { error2(createResponse("error", xhr.status, onerror(xhr.response) || xhr.statusText, xhr.getAllResponseHeaders())); }; request.ontimeout = createTimeoutResponse(error2); request.onprogress = progress; request.onabort = abort; return request; }; var createProcessorFunction = (apiUrl = "", action, name2, options2) => { if (typeof action === "function") return (...params) => action(name2, ...params, options2); if (!action || !isString(action.url)) return null; return createFileProcessorFunction(apiUrl, action, name2, options2); }; var createRevertFunction = (apiUrl = "", action) => { if (typeof action === "function") { return action; } if (!action || !isString(action.url)) { return (uniqueFileId, load) => load(); } const onload = action.onload || ((res2) => res2); const onerror = action.onerror || ((res2) => null); return (uniqueFileId, load, error2) => { const request = sendRequest(uniqueFileId, apiUrl + action.url, action); request.onload = (xhr) => { load(createResponse("load", xhr.status, onload(xhr.response), xhr.getAllResponseHeaders())); }; request.onerror = (xhr) => { error2(createResponse("error", xhr.status, onerror(xhr.response) || xhr.statusText, xhr.getAllResponseHeaders())); }; request.ontimeout = createTimeoutResponse(error2); return request; }; }; var getRandomNumber = (min3 = 0, max3 = 1) => min3 + Math.random() * (max3 - min3); var createPerceivedPerformanceUpdater = (cb, duration = 1e3, offset2 = 0, tickMin = 25, tickMax = 250) => { let timeout = null; const start = Date.now(); const tick = () => { let runtime = Date.now() - start; let delay = getRandomNumber(tickMin, tickMax); if (runtime + delay > duration) { delay = runtime + delay - duration; } let progress = runtime / duration; if (progress >= 1 || document.hidden) { cb(1); return; } cb(progress); timeout = setTimeout(tick, delay); }; if (duration > 0) tick(); return { clear: () => { clearTimeout(timeout); } }; }; var createFileProcessor = (processFn, options2) => { const state2 = { complete: false, perceivedProgress: 0, perceivedPerformanceUpdater: null, progress: null, timestamp: null, perceivedDuration: 0, duration: 0, request: null, response: null }; const {allowMinimumUploadDuration} = options2; const process = (file2, metadata) => { const progressFn = () => { if (state2.duration === 0 || state2.progress === null) return; api.fire("progress", api.getProgress()); }; const completeFn = () => { state2.complete = true; api.fire("load-perceived", state2.response.body); }; api.fire("start"); state2.timestamp = Date.now(); state2.perceivedPerformanceUpdater = createPerceivedPerformanceUpdater((progress) => { state2.perceivedProgress = progress; state2.perceivedDuration = Date.now() - state2.timestamp; progressFn(); if (state2.response && state2.perceivedProgress === 1 && !state2.complete) { completeFn(); } }, allowMinimumUploadDuration ? getRandomNumber(750, 1500) : 0); state2.request = processFn(file2, metadata, (response) => { state2.response = isObject(response) ? response : { type: "load", code: 200, body: `${response}`, headers: {} }; state2.duration = Date.now() - state2.timestamp; state2.progress = 1; api.fire("load", state2.response.body); if (!allowMinimumUploadDuration || allowMinimumUploadDuration && state2.perceivedProgress === 1) { completeFn(); } }, (error2) => { state2.perceivedPerformanceUpdater.clear(); api.fire("error", isObject(error2) ? error2 : { type: "error", code: 0, body: `${error2}` }); }, (computable, current, total) => { state2.duration = Date.now() - state2.timestamp; state2.progress = computable ? current / total : null; progressFn(); }, () => { state2.perceivedPerformanceUpdater.clear(); api.fire("abort", state2.response ? state2.response.body : null); }, (transferId) => { api.fire("transfer", transferId); }); }; const abort = () => { if (!state2.request) return; state2.perceivedPerformanceUpdater.clear(); if (state2.request.abort) state2.request.abort(); state2.complete = true; }; const reset = () => { abort(); state2.complete = false; state2.perceivedProgress = 0; state2.progress = 0; state2.timestamp = null; state2.perceivedDuration = 0; state2.duration = 0; state2.request = null; state2.response = null; }; const getProgress = allowMinimumUploadDuration ? () => state2.progress ? Math.min(state2.progress, state2.perceivedProgress) : null : () => state2.progress || null; const getDuration = allowMinimumUploadDuration ? () => Math.min(state2.duration, state2.perceivedDuration) : () => state2.duration; const api = { ...on(), process, abort, getProgress, getDuration, reset }; return api; }; var getFilenameWithoutExtension = (name2) => name2.substring(0, name2.lastIndexOf(".")) || name2; var createFileStub = (source) => { let data3 = [source.name, source.size, source.type]; if (source instanceof Blob || isBase64DataURI(source)) { data3[0] = source.name || getDateString(); } else if (isBase64DataURI(source)) { data3[1] = source.length; data3[2] = getMimeTypeFromBase64DataURI(source); } else if (isString(source)) { data3[0] = getFilenameFromURL(source); data3[1] = 0; data3[2] = "application/octet-stream"; } return { name: data3[0], size: data3[1], type: data3[2] }; }; var isFile = (value) => !!(value instanceof File || value instanceof Blob && value.name); var deepCloneObject = (src) => { if (!isObject(src)) return src; const target = isArray(src) ? [] : {}; for (const key in src) { if (!src.hasOwnProperty(key)) continue; const v = src[key]; target[key] = v && isObject(v) ? deepCloneObject(v) : v; } return target; }; var createItem = (origin = null, serverFileReference = null, file2 = null) => { const id = getUniqueId(); const state2 = { archived: false, frozen: false, released: false, source: null, file: file2, serverFileReference, transferId: null, processingAborted: false, status: serverFileReference ? ItemStatus.PROCESSING_COMPLETE : ItemStatus.INIT, activeLoader: null, activeProcessor: null }; let abortProcessingRequestComplete = null; const metadata = {}; const setStatus = (status) => state2.status = status; const fire2 = (event, ...params) => { if (state2.released || state2.frozen) return; api.fire(event, ...params); }; const getFileExtension = () => getExtensionFromFilename(state2.file.name); const getFileType = () => state2.file.type; const getFileSize = () => state2.file.size; const getFile2 = () => state2.file; const load = (source, loader, onload) => { state2.source = source; api.fireSync("init"); if (state2.file) { api.fireSync("load-skip"); return; } state2.file = createFileStub(source); loader.on("init", () => { fire2("load-init"); }); loader.on("meta", (meta) => { state2.file.size = meta.size; state2.file.filename = meta.filename; if (meta.source) { origin = FileOrigin.LIMBO; state2.serverFileReference = meta.source; state2.status = ItemStatus.PROCESSING_COMPLETE; } fire2("load-meta"); }); loader.on("progress", (progress) => { setStatus(ItemStatus.LOADING); fire2("load-progress", progress); }); loader.on("error", (error2) => { setStatus(ItemStatus.LOAD_ERROR); fire2("load-request-error", error2); }); loader.on("abort", () => { setStatus(ItemStatus.INIT); fire2("load-abort"); }); loader.on("load", (file3) => { state2.activeLoader = null; const success = (result) => { state2.file = isFile(result) ? result : state2.file; if (origin === FileOrigin.LIMBO && state2.serverFileReference) { setStatus(ItemStatus.PROCESSING_COMPLETE); } else { setStatus(ItemStatus.IDLE); } fire2("load"); }; const error2 = (result) => { state2.file = file3; fire2("load-meta"); setStatus(ItemStatus.LOAD_ERROR); fire2("load-file-error", result); }; if (state2.serverFileReference) { success(file3); return; } onload(file3, success, error2); }); loader.setSource(source); state2.activeLoader = loader; loader.load(); }; const retryLoad = () => { if (!state2.activeLoader) { return; } state2.activeLoader.load(); }; const abortLoad = () => { if (state2.activeLoader) { state2.activeLoader.abort(); return; } setStatus(ItemStatus.INIT); fire2("load-abort"); }; const process = (processor, onprocess) => { if (state2.processingAborted) { state2.processingAborted = false; return; } setStatus(ItemStatus.PROCESSING); abortProcessingRequestComplete = null; if (!(state2.file instanceof Blob)) { api.on("load", () => { process(processor, onprocess); }); return; } processor.on("load", (serverFileReference2) => { state2.transferId = null; state2.serverFileReference = serverFileReference2; }); processor.on("transfer", (transferId) => { state2.transferId = transferId; }); processor.on("load-perceived", (serverFileReference2) => { state2.activeProcessor = null; state2.transferId = null; state2.serverFileReference = serverFileReference2; setStatus(ItemStatus.PROCESSING_COMPLETE); fire2("process-complete", serverFileReference2); }); processor.on("start", () => { fire2("process-start"); }); processor.on("error", (error3) => { state2.activeProcessor = null; setStatus(ItemStatus.PROCESSING_ERROR); fire2("process-error", error3); }); processor.on("abort", (serverFileReference2) => { state2.activeProcessor = null; state2.serverFileReference = serverFileReference2; setStatus(ItemStatus.IDLE); fire2("process-abort"); if (abortProcessingRequestComplete) { abortProcessingRequestComplete(); } }); processor.on("progress", (progress) => { fire2("process-progress", progress); }); const success = (file3) => { if (state2.archived) return; processor.process(file3, {...metadata}); }; const error2 = console.error; onprocess(state2.file, success, error2); state2.activeProcessor = processor; }; const requestProcessing = () => { state2.processingAborted = false; setStatus(ItemStatus.PROCESSING_QUEUED); }; const abortProcessing = () => new Promise((resolve) => { if (!state2.activeProcessor) { state2.processingAborted = true; setStatus(ItemStatus.IDLE); fire2("process-abort"); resolve(); return; } abortProcessingRequestComplete = () => { resolve(); }; state2.activeProcessor.abort(); }); const revert = (revertFileUpload, forceRevert) => new Promise((resolve, reject) => { const serverTransferId = state2.serverFileReference !== null ? state2.serverFileReference : state2.transferId; if (serverTransferId === null) { resolve(); return; } revertFileUpload(serverTransferId, () => { state2.serverFileReference = null; state2.transferId = null; resolve(); }, (error2) => { if (!forceRevert) { resolve(); return; } setStatus(ItemStatus.PROCESSING_REVERT_ERROR); fire2("process-revert-error"); reject(error2); }); setStatus(ItemStatus.IDLE); fire2("process-revert"); }); const setMetadata = (key, value, silent) => { const keys = key.split("."); const root2 = keys[0]; const last = keys.pop(); let data3 = metadata; keys.forEach((key2) => data3 = data3[key2]); if (JSON.stringify(data3[last]) === JSON.stringify(value)) return; data3[last] = value; fire2("metadata-update", { key: root2, value: metadata[root2], silent }); }; const getMetadata = (key) => deepCloneObject(key ? metadata[key] : metadata); const api = { id: {get: () => id}, origin: {get: () => origin, set: (value) => origin = value}, serverId: {get: () => state2.serverFileReference}, transferId: {get: () => state2.transferId}, status: {get: () => state2.status}, filename: {get: () => state2.file.name}, filenameWithoutExtension: {get: () => getFilenameWithoutExtension(state2.file.name)}, fileExtension: {get: getFileExtension}, fileType: {get: getFileType}, fileSize: {get: getFileSize}, file: {get: getFile2}, relativePath: {get: () => state2.file._relativePath}, source: {get: () => state2.source}, getMetadata, setMetadata: (key, value, silent) => { if (isObject(key)) { const data3 = key; Object.keys(data3).forEach((key2) => { setMetadata(key2, data3[key2], value); }); return key; } setMetadata(key, value, silent); return value; }, extend: (name2, handler) => itemAPI[name2] = handler, abortLoad, retryLoad, requestProcessing, abortProcessing, load, process, revert, ...on(), freeze: () => state2.frozen = true, release: () => state2.released = true, released: {get: () => state2.released}, archive: () => state2.archived = true, archived: {get: () => state2.archived} }; const itemAPI = createObject(api); return itemAPI; }; var getItemIndexByQuery = (items, query) => { if (isEmpty(query)) { return 0; } if (!isString(query)) { return -1; } return items.findIndex((item2) => item2.id === query); }; var getItemById = (items, itemId) => { const index2 = getItemIndexByQuery(items, itemId); if (index2 < 0) { return; } return items[index2] || null; }; var fetchBlob = (url, load, error2, progress, abort, headers) => { const request = sendRequest(null, url, { method: "GET", responseType: "blob" }); request.onload = (xhr) => { const headers2 = xhr.getAllResponseHeaders(); const filename = getFileInfoFromHeaders(headers2).name || getFilenameFromURL(url); load(createResponse("load", xhr.status, getFileFromBlob(xhr.response, filename), headers2)); }; request.onerror = (xhr) => { error2(createResponse("error", xhr.status, xhr.statusText, xhr.getAllResponseHeaders())); }; request.onheaders = (xhr) => { headers(createResponse("headers", xhr.status, null, xhr.getAllResponseHeaders())); }; request.ontimeout = createTimeoutResponse(error2); request.onprogress = progress; request.onabort = abort; return request; }; var getDomainFromURL = (url) => { if (url.indexOf("//") === 0) { url = location.protocol + url; } return url.toLowerCase().replace("blob:", "").replace(/([a-z])?:\/\//, "$1").split("/")[0]; }; var isExternalURL = (url) => (url.indexOf(":") > -1 || url.indexOf("//") > -1) && getDomainFromURL(location.href) !== getDomainFromURL(url); var dynamicLabel = (label) => (...params) => isFunction(label) ? label(...params) : label; var isMockItem = (item2) => !isFile(item2.file); var listUpdated = (dispatch, state2) => { clearTimeout(state2.listUpdateTimeout); state2.listUpdateTimeout = setTimeout(() => { dispatch("DID_UPDATE_ITEMS", {items: getActiveItems(state2.items)}); }, 0); }; var optionalPromise = (fn2, ...params) => new Promise((resolve) => { if (!fn2) { return resolve(true); } const result = fn2(...params); if (result == null) { return resolve(true); } if (typeof result === "boolean") { return resolve(result); } if (typeof result.then === "function") { result.then(resolve); } }); var sortItems = (state2, compare) => { state2.items.sort((a2, b) => compare(createItemAPI(a2), createItemAPI(b))); }; var getItemByQueryFromState = (state2, itemHandler) => ({ query, success = () => { }, failure = () => { }, ...options2 } = {}) => { const item2 = getItemByQuery(state2.items, query); if (!item2) { failure({ error: createResponse("error", 0, "Item not found"), file: null }); return; } itemHandler(item2, success, failure, options2 || {}); }; var actions = (dispatch, query, state2) => ({ ABORT_ALL: () => { getActiveItems(state2.items).forEach((item2) => { item2.freeze(); item2.abortLoad(); item2.abortProcessing(); }); }, DID_SET_FILES: ({value = []}) => { const files = value.map((file2) => ({ source: file2.source ? file2.source : file2, options: file2.options })); let activeItems = getActiveItems(state2.items); activeItems.forEach((item2) => { if (!files.find((file2) => file2.source === item2.source || file2.source === item2.file)) { dispatch("REMOVE_ITEM", {query: item2, remove: false}); } }); activeItems = getActiveItems(state2.items); files.forEach((file2, index2) => { if (activeItems.find((item2) => item2.source === file2.source || item2.file === file2.source)) return; dispatch("ADD_ITEM", { ...file2, interactionMethod: InteractionMethod.NONE, index: index2 }); }); }, DID_UPDATE_ITEM_METADATA: ({id, action, change}) => { if (change.silent) return; clearTimeout(state2.itemUpdateTimeout); state2.itemUpdateTimeout = setTimeout(() => { const item2 = getItemById(state2.items, id); if (!query("IS_ASYNC")) { applyFilterChain("SHOULD_PREPARE_OUTPUT", false, { item: item2, query, action, change }).then((shouldPrepareOutput) => { const beforePrepareFile = query("GET_BEFORE_PREPARE_FILE"); if (beforePrepareFile) shouldPrepareOutput = beforePrepareFile(item2, shouldPrepareOutput); if (!shouldPrepareOutput) return; dispatch("REQUEST_PREPARE_OUTPUT", { query: id, item: item2, success: (file2) => { dispatch("DID_PREPARE_OUTPUT", {id, file: file2}); } }, true); }); return; } if (item2.origin === FileOrigin.LOCAL) { dispatch("DID_LOAD_ITEM", { id: item2.id, error: null, serverFileReference: item2.source }); } const upload = () => { setTimeout(() => { dispatch("REQUEST_ITEM_PROCESSING", {query: id}); }, 32); }; const revert = (doUpload) => { item2.revert(createRevertFunction(state2.options.server.url, state2.options.server.revert), query("GET_FORCE_REVERT")).then(doUpload ? upload : () => { }).catch(() => { }); }; const abort = (doUpload) => { item2.abortProcessing().then(doUpload ? upload : () => { }); }; if (item2.status === ItemStatus.PROCESSING_COMPLETE) { return revert(state2.options.instantUpload); } if (item2.status === ItemStatus.PROCESSING) { return abort(state2.options.instantUpload); } if (state2.options.instantUpload) { upload(); } }, 0); }, MOVE_ITEM: ({query: query2, index: index2}) => { const item2 = getItemByQuery(state2.items, query2); if (!item2) return; const currentIndex = state2.items.indexOf(item2); index2 = limit(index2, 0, state2.items.length - 1); if (currentIndex === index2) return; state2.items.splice(index2, 0, state2.items.splice(currentIndex, 1)[0]); }, SORT: ({compare}) => { sortItems(state2, compare); dispatch("DID_SORT_ITEMS", { items: query("GET_ACTIVE_ITEMS") }); }, ADD_ITEMS: ({items, index: index2, interactionMethod, success = () => { }, failure = () => { }}) => { let currentIndex = index2; if (index2 === -1 || typeof index2 === "undefined") { const insertLocation = query("GET_ITEM_INSERT_LOCATION"); const totalItems = query("GET_TOTAL_ITEMS"); currentIndex = insertLocation === "before" ? 0 : totalItems; } const ignoredFiles = query("GET_IGNORED_FILES"); const isValidFile = (source) => isFile(source) ? !ignoredFiles.includes(source.name.toLowerCase()) : !isEmpty(source); const validItems = items.filter(isValidFile); const promises = validItems.map((source) => new Promise((resolve, reject) => { dispatch("ADD_ITEM", { interactionMethod, source: source.source || source, success: resolve, failure: reject, index: currentIndex++, options: source.options || {} }); })); Promise.all(promises).then(success).catch(failure); }, ADD_ITEM: ({ source, index: index2 = -1, interactionMethod, success = () => { }, failure = () => { }, options: options2 = {} }) => { if (isEmpty(source)) { failure({ error: createResponse("error", 0, "No source"), file: null }); return; } if (isFile(source) && state2.options.ignoredFiles.includes(source.name.toLowerCase())) { return; } if (!hasRoomForItem(state2)) { if (state2.options.allowMultiple || !state2.options.allowMultiple && !state2.options.allowReplace) { const error2 = createResponse("warning", 0, "Max files"); dispatch("DID_THROW_MAX_FILES", { source, error: error2 }); failure({error: error2, file: null}); return; } const item3 = getActiveItems(state2.items)[0]; if (item3.status === ItemStatus.PROCESSING_COMPLETE || item3.status === ItemStatus.PROCESSING_REVERT_ERROR) { const forceRevert = query("GET_FORCE_REVERT"); item3.revert(createRevertFunction(state2.options.server.url, state2.options.server.revert), forceRevert).then(() => { if (!forceRevert) return; dispatch("ADD_ITEM", { source, index: index2, interactionMethod, success, failure, options: options2 }); }).catch(() => { }); if (forceRevert) return; } dispatch("REMOVE_ITEM", {query: item3.id}); } const origin = options2.type === "local" ? FileOrigin.LOCAL : options2.type === "limbo" ? FileOrigin.LIMBO : FileOrigin.INPUT; const item2 = createItem(origin, origin === FileOrigin.INPUT ? null : source, options2.file); Object.keys(options2.metadata || {}).forEach((key) => { item2.setMetadata(key, options2.metadata[key]); }); applyFilters("DID_CREATE_ITEM", item2, {query, dispatch}); const itemInsertLocation = query("GET_ITEM_INSERT_LOCATION"); if (!state2.options.itemInsertLocationFreedom) { index2 = itemInsertLocation === "before" ? -1 : state2.items.length; } insertItem(state2.items, item2, index2); if (isFunction(itemInsertLocation) && source) { sortItems(state2, itemInsertLocation); } const id = item2.id; item2.on("init", () => { dispatch("DID_INIT_ITEM", {id}); }); item2.on("load-init", () => { dispatch("DID_START_ITEM_LOAD", {id}); }); item2.on("load-meta", () => { dispatch("DID_UPDATE_ITEM_META", {id}); }); item2.on("load-progress", (progress) => { dispatch("DID_UPDATE_ITEM_LOAD_PROGRESS", {id, progress}); }); item2.on("load-request-error", (error2) => { const mainStatus = dynamicLabel(state2.options.labelFileLoadError)(error2); if (error2.code >= 400 && error2.code < 500) { dispatch("DID_THROW_ITEM_INVALID", { id, error: error2, status: { main: mainStatus, sub: `${error2.code} (${error2.body})` } }); failure({error: error2, file: createItemAPI(item2)}); return; } dispatch("DID_THROW_ITEM_LOAD_ERROR", { id, error: error2, status: { main: mainStatus, sub: state2.options.labelTapToRetry } }); }); item2.on("load-file-error", (error2) => { dispatch("DID_THROW_ITEM_INVALID", { id, error: error2.status, status: error2.status }); failure({error: error2.status, file: createItemAPI(item2)}); }); item2.on("load-abort", () => { dispatch("REMOVE_ITEM", {query: id}); }); item2.on("load-skip", () => { dispatch("COMPLETE_LOAD_ITEM", { query: id, item: item2, data: { source, success } }); }); item2.on("load", () => { const handleAdd = (shouldAdd) => { if (!shouldAdd) { dispatch("REMOVE_ITEM", { query: id }); return; } item2.on("metadata-update", (change) => { dispatch("DID_UPDATE_ITEM_METADATA", {id, change}); }); applyFilterChain("SHOULD_PREPARE_OUTPUT", false, {item: item2, query}).then((shouldPrepareOutput) => { const beforePrepareFile = query("GET_BEFORE_PREPARE_FILE"); if (beforePrepareFile) shouldPrepareOutput = beforePrepareFile(item2, shouldPrepareOutput); const loadComplete = () => { dispatch("COMPLETE_LOAD_ITEM", { query: id, item: item2, data: { source, success } }); listUpdated(dispatch, state2); }; if (shouldPrepareOutput) { dispatch("REQUEST_PREPARE_OUTPUT", { query: id, item: item2, success: (file2) => { dispatch("DID_PREPARE_OUTPUT", {id, file: file2}); loadComplete(); } }, true); return; } loadComplete(); }); }; applyFilterChain("DID_LOAD_ITEM", item2, {query, dispatch}).then(() => { optionalPromise(query("GET_BEFORE_ADD_FILE"), createItemAPI(item2)).then(handleAdd); }).catch((e2) => { if (!e2 || !e2.error || !e2.status) return handleAdd(false); dispatch("DID_THROW_ITEM_INVALID", { id, error: e2.error, status: e2.status }); }); }); item2.on("process-start", () => { dispatch("DID_START_ITEM_PROCESSING", {id}); }); item2.on("process-progress", (progress) => { dispatch("DID_UPDATE_ITEM_PROCESS_PROGRESS", {id, progress}); }); item2.on("process-error", (error2) => { dispatch("DID_THROW_ITEM_PROCESSING_ERROR", { id, error: error2, status: { main: dynamicLabel(state2.options.labelFileProcessingError)(error2), sub: state2.options.labelTapToRetry } }); }); item2.on("process-revert-error", (error2) => { dispatch("DID_THROW_ITEM_PROCESSING_REVERT_ERROR", { id, error: error2, status: { main: dynamicLabel(state2.options.labelFileProcessingRevertError)(error2), sub: state2.options.labelTapToRetry } }); }); item2.on("process-complete", (serverFileReference) => { dispatch("DID_COMPLETE_ITEM_PROCESSING", { id, error: null, serverFileReference }); dispatch("DID_DEFINE_VALUE", {id, value: serverFileReference}); }); item2.on("process-abort", () => { dispatch("DID_ABORT_ITEM_PROCESSING", {id}); }); item2.on("process-revert", () => { dispatch("DID_REVERT_ITEM_PROCESSING", {id}); dispatch("DID_DEFINE_VALUE", {id, value: null}); }); dispatch("DID_ADD_ITEM", {id, index: index2, interactionMethod}); listUpdated(dispatch, state2); const {url, load, restore, fetch: fetch2} = state2.options.server || {}; item2.load(source, createFileLoader(origin === FileOrigin.INPUT ? isString(source) && isExternalURL(source) ? fetch2 ? createFetchFunction(url, fetch2) : fetchBlob : fetchBlob : origin === FileOrigin.LIMBO ? createFetchFunction(url, restore) : createFetchFunction(url, load)), (file2, success2, error2) => { applyFilterChain("LOAD_FILE", file2, {query}).then(success2).catch(error2); }); }, REQUEST_PREPARE_OUTPUT: ({item: item2, success, failure = () => { }}) => { const err = { error: createResponse("error", 0, "Item not found"), file: null }; if (item2.archived) return failure(err); applyFilterChain("PREPARE_OUTPUT", item2.file, {query, item: item2}).then((result) => { applyFilterChain("COMPLETE_PREPARE_OUTPUT", result, {query, item: item2}).then((result2) => { if (item2.archived) return failure(err); success(result2); }); }); }, COMPLETE_LOAD_ITEM: ({item: item2, data: data3}) => { const {success, source} = data3; const itemInsertLocation = query("GET_ITEM_INSERT_LOCATION"); if (isFunction(itemInsertLocation) && source) { sortItems(state2, itemInsertLocation); } dispatch("DID_LOAD_ITEM", { id: item2.id, error: null, serverFileReference: item2.origin === FileOrigin.INPUT ? null : source }); success(createItemAPI(item2)); if (item2.origin === FileOrigin.LOCAL) { dispatch("DID_LOAD_LOCAL_ITEM", {id: item2.id}); return; } if (item2.origin === FileOrigin.LIMBO) { dispatch("DID_COMPLETE_ITEM_PROCESSING", { id: item2.id, error: null, serverFileReference: source }); dispatch("DID_DEFINE_VALUE", { id: item2.id, value: item2.serverId || source }); return; } if (query("IS_ASYNC") && state2.options.instantUpload) { dispatch("REQUEST_ITEM_PROCESSING", {query: item2.id}); } }, RETRY_ITEM_LOAD: getItemByQueryFromState(state2, (item2) => { item2.retryLoad(); }), REQUEST_ITEM_PREPARE: getItemByQueryFromState(state2, (item2, success, failure) => { dispatch("REQUEST_PREPARE_OUTPUT", { query: item2.id, item: item2, success: (file2) => { dispatch("DID_PREPARE_OUTPUT", {id: item2.id, file: file2}); success({ file: item2, output: file2 }); }, failure }, true); }), REQUEST_ITEM_PROCESSING: getItemByQueryFromState(state2, (item2, success, failure) => { const itemCanBeQueuedForProcessing = item2.status === ItemStatus.IDLE || item2.status === ItemStatus.PROCESSING_ERROR; if (!itemCanBeQueuedForProcessing) { const processNow = () => dispatch("REQUEST_ITEM_PROCESSING", {query: item2, success, failure}); const process = () => document.hidden ? processNow() : setTimeout(processNow, 32); if (item2.status === ItemStatus.PROCESSING_COMPLETE || item2.status === ItemStatus.PROCESSING_REVERT_ERROR) { item2.revert(createRevertFunction(state2.options.server.url, state2.options.server.revert), query("GET_FORCE_REVERT")).then(process).catch(() => { }); } else if (item2.status === ItemStatus.PROCESSING) { item2.abortProcessing().then(process); } return; } if (item2.status === ItemStatus.PROCESSING_QUEUED) return; item2.requestProcessing(); dispatch("DID_REQUEST_ITEM_PROCESSING", {id: item2.id}); dispatch("PROCESS_ITEM", {query: item2, success, failure}, true); }), PROCESS_ITEM: getItemByQueryFromState(state2, (item2, success, failure) => { const maxParallelUploads = query("GET_MAX_PARALLEL_UPLOADS"); const totalCurrentUploads = query("GET_ITEMS_BY_STATUS", ItemStatus.PROCESSING).length; if (totalCurrentUploads === maxParallelUploads) { state2.processingQueue.push({ id: item2.id, success, failure }); return; } if (item2.status === ItemStatus.PROCESSING) return; const processNext = () => { const queueEntry = state2.processingQueue.shift(); if (!queueEntry) return; const {id, success: success2, failure: failure2} = queueEntry; const itemReference = getItemByQuery(state2.items, id); if (!itemReference || itemReference.archived) { processNext(); return; } dispatch("PROCESS_ITEM", {query: id, success: success2, failure: failure2}, true); }; item2.onOnce("process-complete", () => { success(createItemAPI(item2)); processNext(); const server = state2.options.server; const instantUpload = state2.options.instantUpload; if (instantUpload && item2.origin === FileOrigin.LOCAL && isFunction(server.remove)) { const noop = () => { }; item2.origin = FileOrigin.LIMBO; state2.options.server.remove(item2.source, noop, noop); } const allItemsProcessed = query("GET_ITEMS_BY_STATUS", ItemStatus.PROCESSING_COMPLETE).length === state2.items.length; if (allItemsProcessed) { dispatch("DID_COMPLETE_ITEM_PROCESSING_ALL"); } }); item2.onOnce("process-error", (error2) => { failure({error: error2, file: createItemAPI(item2)}); processNext(); }); const options2 = state2.options; item2.process(createFileProcessor(createProcessorFunction(options2.server.url, options2.server.process, options2.name, { chunkTransferId: item2.transferId, chunkServer: options2.server.patch, chunkUploads: options2.chunkUploads, chunkForce: options2.chunkForce, chunkSize: options2.chunkSize, chunkRetryDelays: options2.chunkRetryDelays }), { allowMinimumUploadDuration: query("GET_ALLOW_MINIMUM_UPLOAD_DURATION") }), (file2, success2, error2) => { applyFilterChain("PREPARE_OUTPUT", file2, {query, item: item2}).then((file3) => { dispatch("DID_PREPARE_OUTPUT", {id: item2.id, file: file3}); success2(file3); }).catch(error2); }); }), RETRY_ITEM_PROCESSING: getItemByQueryFromState(state2, (item2) => { dispatch("REQUEST_ITEM_PROCESSING", {query: item2}); }), REQUEST_REMOVE_ITEM: getItemByQueryFromState(state2, (item2) => { optionalPromise(query("GET_BEFORE_REMOVE_FILE"), createItemAPI(item2)).then((shouldRemove) => { if (!shouldRemove) { return; } dispatch("REMOVE_ITEM", {query: item2}); }); }), RELEASE_ITEM: getItemByQueryFromState(state2, (item2) => { item2.release(); }), REMOVE_ITEM: getItemByQueryFromState(state2, (item2, success, failure, options2) => { const removeFromView = () => { const id = item2.id; getItemById(state2.items, id).archive(); dispatch("DID_REMOVE_ITEM", {error: null, id, item: item2}); listUpdated(dispatch, state2); success(createItemAPI(item2)); }; const server = state2.options.server; if (item2.origin === FileOrigin.LOCAL && server && isFunction(server.remove) && options2.remove !== false) { dispatch("DID_START_ITEM_REMOVE", {id: item2.id}); server.remove(item2.source, () => removeFromView(), (status) => { dispatch("DID_THROW_ITEM_REMOVE_ERROR", { id: item2.id, error: createResponse("error", 0, status, null), status: { main: dynamicLabel(state2.options.labelFileRemoveError)(status), sub: state2.options.labelTapToRetry } }); }); } else { if (options2.revert && item2.origin !== FileOrigin.LOCAL && item2.serverId !== null || state2.options.chunkUploads && item2.file.size > state2.options.chunkSize || state2.options.chunkUploads && state2.options.chunkForce) { item2.revert(createRevertFunction(state2.options.server.url, state2.options.server.revert), query("GET_FORCE_REVERT")); } removeFromView(); } }), ABORT_ITEM_LOAD: getItemByQueryFromState(state2, (item2) => { item2.abortLoad(); }), ABORT_ITEM_PROCESSING: getItemByQueryFromState(state2, (item2) => { if (item2.serverId) { dispatch("REVERT_ITEM_PROCESSING", {id: item2.id}); return; } item2.abortProcessing().then(() => { const shouldRemove = state2.options.instantUpload; if (shouldRemove) { dispatch("REMOVE_ITEM", {query: item2.id}); } }); }), REQUEST_REVERT_ITEM_PROCESSING: getItemByQueryFromState(state2, (item2) => { if (!state2.options.instantUpload) { dispatch("REVERT_ITEM_PROCESSING", {query: item2}); return; } const handleRevert2 = (shouldRevert) => { if (!shouldRevert) return; dispatch("REVERT_ITEM_PROCESSING", {query: item2}); }; const fn2 = query("GET_BEFORE_REMOVE_FILE"); if (!fn2) { return handleRevert2(true); } const requestRemoveResult = fn2(createItemAPI(item2)); if (requestRemoveResult == null) { return handleRevert2(true); } if (typeof requestRemoveResult === "boolean") { return handleRevert2(requestRemoveResult); } if (typeof requestRemoveResult.then === "function") { requestRemoveResult.then(handleRevert2); } }), REVERT_ITEM_PROCESSING: getItemByQueryFromState(state2, (item2) => { item2.revert(createRevertFunction(state2.options.server.url, state2.options.server.revert), query("GET_FORCE_REVERT")).then(() => { const shouldRemove = state2.options.instantUpload || isMockItem(item2); if (shouldRemove) { dispatch("REMOVE_ITEM", {query: item2.id}); } }).catch(() => { }); }), SET_OPTIONS: ({options: options2}) => { const optionKeys = Object.keys(options2); const prioritizedOptionKeys = PrioritizedOptions.filter((key) => optionKeys.includes(key)); const orderedOptionKeys = [ ...prioritizedOptionKeys, ...Object.keys(options2).filter((key) => !prioritizedOptionKeys.includes(key)) ]; orderedOptionKeys.forEach((key) => { dispatch(`SET_${fromCamels(key, "_").toUpperCase()}`, { value: options2[key] }); }); } }); var PrioritizedOptions = [ "server" ]; var formatFilename = (name2) => name2; var createElement$1 = (tagName) => { return document.createElement(tagName); }; var text = (node, value) => { let textNode = node.childNodes[0]; if (!textNode) { textNode = document.createTextNode(value); node.appendChild(textNode); } else if (value !== textNode.nodeValue) { textNode.nodeValue = value; } }; var polarToCartesian = (centerX, centerY, radius, angleInDegrees) => { const angleInRadians = (angleInDegrees % 360 - 90) * Math.PI / 180; return { x: centerX + radius * Math.cos(angleInRadians), y: centerY + radius * Math.sin(angleInRadians) }; }; var describeArc = (x, y, radius, startAngle, endAngle, arcSweep) => { const start = polarToCartesian(x, y, radius, endAngle); const end = polarToCartesian(x, y, radius, startAngle); return ["M", start.x, start.y, "A", radius, radius, 0, arcSweep, 0, end.x, end.y].join(" "); }; var percentageArc = (x, y, radius, from, to) => { let arcSweep = 1; if (to > from && to - from <= 0.5) { arcSweep = 0; } if (from > to && from - to >= 0.5) { arcSweep = 0; } return describeArc(x, y, radius, Math.min(0.9999, from) * 360, Math.min(0.9999, to) * 360, arcSweep); }; var create = ({root: root2, props}) => { props.spin = false; props.progress = 0; props.opacity = 0; const svg4 = createElement("svg"); root2.ref.path = createElement("path", { "stroke-width": 2, "stroke-linecap": "round" }); svg4.appendChild(root2.ref.path); root2.ref.svg = svg4; root2.appendChild(svg4); }; var write = ({root: root2, props}) => { if (props.opacity === 0) { return; } if (props.align) { root2.element.dataset.align = props.align; } const ringStrokeWidth = parseInt(attr(root2.ref.path, "stroke-width"), 10); const size2 = root2.rect.element.width * 0.5; let ringFrom = 0; let ringTo = 0; if (props.spin) { ringFrom = 0; ringTo = 0.5; } else { ringFrom = 0; ringTo = props.progress; } const coordinates = percentageArc(size2, size2, size2 - ringStrokeWidth, ringFrom, ringTo); attr(root2.ref.path, "d", coordinates); attr(root2.ref.path, "stroke-opacity", props.spin || props.progress > 0 ? 1 : 0); }; var progressIndicator = createView({ tag: "div", name: "progress-indicator", ignoreRectUpdate: true, ignoreRect: true, create, write, mixins: { apis: ["progress", "spin", "align"], styles: ["opacity"], animations: { opacity: {type: "tween", duration: 500}, progress: { type: "spring", stiffness: 0.95, damping: 0.65, mass: 10 } } } }); var create$1 = ({root: root2, props}) => { root2.element.innerHTML = (props.icon || "") + `${props.label}`; props.isDisabled = false; }; var write$1 = ({root: root2, props}) => { const {isDisabled} = props; const shouldDisable = root2.query("GET_DISABLED") || props.opacity === 0; if (shouldDisable && !isDisabled) { props.isDisabled = true; attr(root2.element, "disabled", "disabled"); } else if (!shouldDisable && isDisabled) { props.isDisabled = false; root2.element.removeAttribute("disabled"); } }; var fileActionButton = createView({ tag: "button", attributes: { type: "button" }, ignoreRect: true, ignoreRectUpdate: true, name: "file-action-button", mixins: { apis: ["label"], styles: ["translateX", "translateY", "scaleX", "scaleY", "opacity"], animations: { scaleX: "spring", scaleY: "spring", translateX: "spring", translateY: "spring", opacity: {type: "tween", duration: 250} }, listeners: true }, create: create$1, write: write$1 }); var toNaturalFileSize = (bytes, decimalSeparator = ".", base = 1e3, options2 = {}) => { const { labelBytes = "bytes", labelKilobytes = "KB", labelMegabytes = "MB", labelGigabytes = "GB" } = options2; bytes = Math.round(Math.abs(bytes)); const KB = base; const MB = base * base; const GB = base * base * base; if (bytes < KB) { return `${bytes} ${labelBytes}`; } if (bytes < MB) { return `${Math.floor(bytes / KB)} ${labelKilobytes}`; } if (bytes < GB) { return `${removeDecimalsWhenZero(bytes / MB, 1, decimalSeparator)} ${labelMegabytes}`; } return `${removeDecimalsWhenZero(bytes / GB, 2, decimalSeparator)} ${labelGigabytes}`; }; var removeDecimalsWhenZero = (value, decimalCount, separator) => { return value.toFixed(decimalCount).split(".").filter((part) => part !== "0").join(separator); }; var create$2 = ({root: root2, props}) => { const fileName = createElement$1("span"); fileName.className = "filepond--file-info-main"; attr(fileName, "aria-hidden", "true"); root2.appendChild(fileName); root2.ref.fileName = fileName; const fileSize = createElement$1("span"); fileSize.className = "filepond--file-info-sub"; root2.appendChild(fileSize); root2.ref.fileSize = fileSize; text(fileSize, root2.query("GET_LABEL_FILE_WAITING_FOR_SIZE")); text(fileName, formatFilename(root2.query("GET_ITEM_NAME", props.id))); }; var updateFile = ({root: root2, props}) => { text(root2.ref.fileSize, toNaturalFileSize(root2.query("GET_ITEM_SIZE", props.id), ".", root2.query("GET_FILE_SIZE_BASE"), root2.query("GET_FILE_SIZE_LABELS", root2.query))); text(root2.ref.fileName, formatFilename(root2.query("GET_ITEM_NAME", props.id))); }; var updateFileSizeOnError = ({root: root2, props}) => { if (isInt(root2.query("GET_ITEM_SIZE", props.id))) { updateFile({root: root2, props}); return; } text(root2.ref.fileSize, root2.query("GET_LABEL_FILE_SIZE_NOT_AVAILABLE")); }; var fileInfo = createView({ name: "file-info", ignoreRect: true, ignoreRectUpdate: true, write: createRoute({ DID_LOAD_ITEM: updateFile, DID_UPDATE_ITEM_META: updateFile, DID_THROW_ITEM_LOAD_ERROR: updateFileSizeOnError, DID_THROW_ITEM_INVALID: updateFileSizeOnError }), didCreateView: (root2) => { applyFilters("CREATE_VIEW", {...root2, view: root2}); }, create: create$2, mixins: { styles: ["translateX", "translateY"], animations: { translateX: "spring", translateY: "spring" } } }); var toPercentage = (value) => Math.round(value * 100); var create$3 = ({root: root2}) => { const main = createElement$1("span"); main.className = "filepond--file-status-main"; root2.appendChild(main); root2.ref.main = main; const sub = createElement$1("span"); sub.className = "filepond--file-status-sub"; root2.appendChild(sub); root2.ref.sub = sub; didSetItemLoadProgress({root: root2, action: {progress: null}}); }; var didSetItemLoadProgress = ({root: root2, action}) => { const title = action.progress === null ? root2.query("GET_LABEL_FILE_LOADING") : `${root2.query("GET_LABEL_FILE_LOADING")} ${toPercentage(action.progress)}%`; text(root2.ref.main, title); text(root2.ref.sub, root2.query("GET_LABEL_TAP_TO_CANCEL")); }; var didSetItemProcessProgress = ({root: root2, action}) => { const title = action.progress === null ? root2.query("GET_LABEL_FILE_PROCESSING") : `${root2.query("GET_LABEL_FILE_PROCESSING")} ${toPercentage(action.progress)}%`; text(root2.ref.main, title); text(root2.ref.sub, root2.query("GET_LABEL_TAP_TO_CANCEL")); }; var didRequestItemProcessing = ({root: root2}) => { text(root2.ref.main, root2.query("GET_LABEL_FILE_PROCESSING")); text(root2.ref.sub, root2.query("GET_LABEL_TAP_TO_CANCEL")); }; var didAbortItemProcessing = ({root: root2}) => { text(root2.ref.main, root2.query("GET_LABEL_FILE_PROCESSING_ABORTED")); text(root2.ref.sub, root2.query("GET_LABEL_TAP_TO_RETRY")); }; var didCompleteItemProcessing = ({root: root2}) => { text(root2.ref.main, root2.query("GET_LABEL_FILE_PROCESSING_COMPLETE")); text(root2.ref.sub, root2.query("GET_LABEL_TAP_TO_UNDO")); }; var clear = ({root: root2}) => { text(root2.ref.main, ""); text(root2.ref.sub, ""); }; var error = ({root: root2, action}) => { text(root2.ref.main, action.status.main); text(root2.ref.sub, action.status.sub); }; var fileStatus = createView({ name: "file-status", ignoreRect: true, ignoreRectUpdate: true, write: createRoute({ DID_LOAD_ITEM: clear, DID_REVERT_ITEM_PROCESSING: clear, DID_REQUEST_ITEM_PROCESSING: didRequestItemProcessing, DID_ABORT_ITEM_PROCESSING: didAbortItemProcessing, DID_COMPLETE_ITEM_PROCESSING: didCompleteItemProcessing, DID_UPDATE_ITEM_PROCESS_PROGRESS: didSetItemProcessProgress, DID_UPDATE_ITEM_LOAD_PROGRESS: didSetItemLoadProgress, DID_THROW_ITEM_LOAD_ERROR: error, DID_THROW_ITEM_INVALID: error, DID_THROW_ITEM_PROCESSING_ERROR: error, DID_THROW_ITEM_PROCESSING_REVERT_ERROR: error, DID_THROW_ITEM_REMOVE_ERROR: error }), didCreateView: (root2) => { applyFilters("CREATE_VIEW", {...root2, view: root2}); }, create: create$3, mixins: { styles: ["translateX", "translateY", "opacity"], animations: { opacity: {type: "tween", duration: 250}, translateX: "spring", translateY: "spring" } } }); var Buttons = { AbortItemLoad: { label: "GET_LABEL_BUTTON_ABORT_ITEM_LOAD", action: "ABORT_ITEM_LOAD", className: "filepond--action-abort-item-load", align: "LOAD_INDICATOR_POSITION" }, RetryItemLoad: { label: "GET_LABEL_BUTTON_RETRY_ITEM_LOAD", action: "RETRY_ITEM_LOAD", icon: "GET_ICON_RETRY", className: "filepond--action-retry-item-load", align: "BUTTON_PROCESS_ITEM_POSITION" }, RemoveItem: { label: "GET_LABEL_BUTTON_REMOVE_ITEM", action: "REQUEST_REMOVE_ITEM", icon: "GET_ICON_REMOVE", className: "filepond--action-remove-item", align: "BUTTON_REMOVE_ITEM_POSITION" }, ProcessItem: { label: "GET_LABEL_BUTTON_PROCESS_ITEM", action: "REQUEST_ITEM_PROCESSING", icon: "GET_ICON_PROCESS", className: "filepond--action-process-item", align: "BUTTON_PROCESS_ITEM_POSITION" }, AbortItemProcessing: { label: "GET_LABEL_BUTTON_ABORT_ITEM_PROCESSING", action: "ABORT_ITEM_PROCESSING", className: "filepond--action-abort-item-processing", align: "BUTTON_PROCESS_ITEM_POSITION" }, RetryItemProcessing: { label: "GET_LABEL_BUTTON_RETRY_ITEM_PROCESSING", action: "RETRY_ITEM_PROCESSING", icon: "GET_ICON_RETRY", className: "filepond--action-retry-item-processing", align: "BUTTON_PROCESS_ITEM_POSITION" }, RevertItemProcessing: { label: "GET_LABEL_BUTTON_UNDO_ITEM_PROCESSING", action: "REQUEST_REVERT_ITEM_PROCESSING", icon: "GET_ICON_UNDO", className: "filepond--action-revert-item-processing", align: "BUTTON_PROCESS_ITEM_POSITION" } }; var ButtonKeys = []; forin(Buttons, (key) => { ButtonKeys.push(key); }); var calculateFileInfoOffset = (root2) => { if (getRemoveIndicatorAligment(root2) === "right") return 0; const buttonRect = root2.ref.buttonRemoveItem.rect.element; return buttonRect.hidden ? null : buttonRect.width + buttonRect.left; }; var calculateButtonWidth = (root2) => { const buttonRect = root2.ref.buttonAbortItemLoad.rect.element; return buttonRect.width; }; var calculateFileVerticalCenterOffset = (root2) => Math.floor(root2.ref.buttonRemoveItem.rect.element.height / 4); var calculateFileHorizontalCenterOffset = (root2) => Math.floor(root2.ref.buttonRemoveItem.rect.element.left / 2); var getLoadIndicatorAlignment = (root2) => root2.query("GET_STYLE_LOAD_INDICATOR_POSITION"); var getProcessIndicatorAlignment = (root2) => root2.query("GET_STYLE_PROGRESS_INDICATOR_POSITION"); var getRemoveIndicatorAligment = (root2) => root2.query("GET_STYLE_BUTTON_REMOVE_ITEM_POSITION"); var DefaultStyle = { buttonAbortItemLoad: {opacity: 0}, buttonRetryItemLoad: {opacity: 0}, buttonRemoveItem: {opacity: 0}, buttonProcessItem: {opacity: 0}, buttonAbortItemProcessing: {opacity: 0}, buttonRetryItemProcessing: {opacity: 0}, buttonRevertItemProcessing: {opacity: 0}, loadProgressIndicator: {opacity: 0, align: getLoadIndicatorAlignment}, processProgressIndicator: {opacity: 0, align: getProcessIndicatorAlignment}, processingCompleteIndicator: {opacity: 0, scaleX: 0.75, scaleY: 0.75}, info: {translateX: 0, translateY: 0, opacity: 0}, status: {translateX: 0, translateY: 0, opacity: 0} }; var IdleStyle = { buttonRemoveItem: {opacity: 1}, buttonProcessItem: {opacity: 1}, info: {translateX: calculateFileInfoOffset}, status: {translateX: calculateFileInfoOffset} }; var ProcessingStyle = { buttonAbortItemProcessing: {opacity: 1}, processProgressIndicator: {opacity: 1}, status: {opacity: 1} }; var StyleMap = { DID_THROW_ITEM_INVALID: { buttonRemoveItem: {opacity: 1}, info: {translateX: calculateFileInfoOffset}, status: {translateX: calculateFileInfoOffset, opacity: 1} }, DID_START_ITEM_LOAD: { buttonAbortItemLoad: {opacity: 1}, loadProgressIndicator: {opacity: 1}, status: {opacity: 1} }, DID_THROW_ITEM_LOAD_ERROR: { buttonRetryItemLoad: {opacity: 1}, buttonRemoveItem: {opacity: 1}, info: {translateX: calculateFileInfoOffset}, status: {opacity: 1} }, DID_START_ITEM_REMOVE: { processProgressIndicator: {opacity: 1, align: getRemoveIndicatorAligment}, info: {translateX: calculateFileInfoOffset}, status: {opacity: 0} }, DID_THROW_ITEM_REMOVE_ERROR: { processProgressIndicator: {opacity: 0, align: getRemoveIndicatorAligment}, buttonRemoveItem: {opacity: 1}, info: {translateX: calculateFileInfoOffset}, status: {opacity: 1, translateX: calculateFileInfoOffset} }, DID_LOAD_ITEM: IdleStyle, DID_LOAD_LOCAL_ITEM: { buttonRemoveItem: {opacity: 1}, info: {translateX: calculateFileInfoOffset}, status: {translateX: calculateFileInfoOffset} }, DID_START_ITEM_PROCESSING: ProcessingStyle, DID_REQUEST_ITEM_PROCESSING: ProcessingStyle, DID_UPDATE_ITEM_PROCESS_PROGRESS: ProcessingStyle, DID_COMPLETE_ITEM_PROCESSING: { buttonRevertItemProcessing: {opacity: 1}, info: {opacity: 1}, status: {opacity: 1} }, DID_THROW_ITEM_PROCESSING_ERROR: { buttonRemoveItem: {opacity: 1}, buttonRetryItemProcessing: {opacity: 1}, status: {opacity: 1}, info: {translateX: calculateFileInfoOffset} }, DID_THROW_ITEM_PROCESSING_REVERT_ERROR: { buttonRevertItemProcessing: {opacity: 1}, status: {opacity: 1}, info: {opacity: 1} }, DID_ABORT_ITEM_PROCESSING: { buttonRemoveItem: {opacity: 1}, buttonProcessItem: {opacity: 1}, info: {translateX: calculateFileInfoOffset}, status: {opacity: 1} }, DID_REVERT_ITEM_PROCESSING: IdleStyle }; var processingCompleteIndicatorView = createView({ create: ({root: root2}) => { root2.element.innerHTML = root2.query("GET_ICON_DONE"); }, name: "processing-complete-indicator", ignoreRect: true, mixins: { styles: ["scaleX", "scaleY", "opacity"], animations: { scaleX: "spring", scaleY: "spring", opacity: {type: "tween", duration: 250} } } }); var create$4 = ({root: root2, props}) => { const LocalButtons = Object.keys(Buttons).reduce((prev, curr) => { prev[curr] = {...Buttons[curr]}; return prev; }, {}); const {id} = props; const allowRevert = root2.query("GET_ALLOW_REVERT"); const allowRemove = root2.query("GET_ALLOW_REMOVE"); const allowProcess = root2.query("GET_ALLOW_PROCESS"); const instantUpload = root2.query("GET_INSTANT_UPLOAD"); const isAsync2 = root2.query("IS_ASYNC"); const alignRemoveItemButton = root2.query("GET_STYLE_BUTTON_REMOVE_ITEM_ALIGN"); let buttonFilter; if (isAsync2) { if (allowProcess && !allowRevert) { buttonFilter = (key) => !/RevertItemProcessing/.test(key); } else if (!allowProcess && allowRevert) { buttonFilter = (key) => !/ProcessItem|RetryItemProcessing|AbortItemProcessing/.test(key); } else if (!allowProcess && !allowRevert) { buttonFilter = (key) => !/Process/.test(key); } } else { buttonFilter = (key) => !/Process/.test(key); } const enabledButtons = buttonFilter ? ButtonKeys.filter(buttonFilter) : ButtonKeys.concat(); if (instantUpload && allowRevert) { LocalButtons["RevertItemProcessing"].label = "GET_LABEL_BUTTON_REMOVE_ITEM"; LocalButtons["RevertItemProcessing"].icon = "GET_ICON_REMOVE"; } if (isAsync2 && !allowRevert) { const map2 = StyleMap["DID_COMPLETE_ITEM_PROCESSING"]; map2.info.translateX = calculateFileHorizontalCenterOffset; map2.info.translateY = calculateFileVerticalCenterOffset; map2.status.translateY = calculateFileVerticalCenterOffset; map2.processingCompleteIndicator = {opacity: 1, scaleX: 1, scaleY: 1}; } if (isAsync2 && !allowProcess) { [ "DID_START_ITEM_PROCESSING", "DID_REQUEST_ITEM_PROCESSING", "DID_UPDATE_ITEM_PROCESS_PROGRESS", "DID_THROW_ITEM_PROCESSING_ERROR" ].forEach((key) => { StyleMap[key].status.translateY = calculateFileVerticalCenterOffset; }); StyleMap["DID_THROW_ITEM_PROCESSING_ERROR"].status.translateX = calculateButtonWidth; } if (alignRemoveItemButton && allowRevert) { LocalButtons["RevertItemProcessing"].align = "BUTTON_REMOVE_ITEM_POSITION"; const map2 = StyleMap["DID_COMPLETE_ITEM_PROCESSING"]; map2.info.translateX = calculateFileInfoOffset; map2.status.translateY = calculateFileVerticalCenterOffset; map2.processingCompleteIndicator = {opacity: 1, scaleX: 1, scaleY: 1}; } if (!allowRemove) { LocalButtons["RemoveItem"].disabled = true; } forin(LocalButtons, (key, definition) => { const buttonView = root2.createChildView(fileActionButton, { label: root2.query(definition.label), icon: root2.query(definition.icon), opacity: 0 }); if (enabledButtons.includes(key)) { root2.appendChildView(buttonView); } if (definition.disabled) { buttonView.element.setAttribute("disabled", "disabled"); buttonView.element.setAttribute("hidden", "hidden"); } buttonView.element.dataset.align = root2.query(`GET_STYLE_${definition.align}`); buttonView.element.classList.add(definition.className); buttonView.on("click", (e2) => { e2.stopPropagation(); if (definition.disabled) return; root2.dispatch(definition.action, {query: id}); }); root2.ref[`button${key}`] = buttonView; }); root2.ref.processingCompleteIndicator = root2.appendChildView(root2.createChildView(processingCompleteIndicatorView)); root2.ref.processingCompleteIndicator.element.dataset.align = root2.query(`GET_STYLE_BUTTON_PROCESS_ITEM_POSITION`); root2.ref.info = root2.appendChildView(root2.createChildView(fileInfo, {id})); root2.ref.status = root2.appendChildView(root2.createChildView(fileStatus, {id})); const loadIndicatorView = root2.appendChildView(root2.createChildView(progressIndicator, { opacity: 0, align: root2.query(`GET_STYLE_LOAD_INDICATOR_POSITION`) })); loadIndicatorView.element.classList.add("filepond--load-indicator"); root2.ref.loadProgressIndicator = loadIndicatorView; const progressIndicatorView = root2.appendChildView(root2.createChildView(progressIndicator, { opacity: 0, align: root2.query(`GET_STYLE_PROGRESS_INDICATOR_POSITION`) })); progressIndicatorView.element.classList.add("filepond--process-indicator"); root2.ref.processProgressIndicator = progressIndicatorView; root2.ref.activeStyles = []; }; var write$2 = ({root: root2, actions: actions2, props}) => { route({root: root2, actions: actions2, props}); let action = actions2.concat().filter((action2) => /^DID_/.test(action2.type)).reverse().find((action2) => StyleMap[action2.type]); if (action) { root2.ref.activeStyles = []; const stylesToApply = StyleMap[action.type]; forin(DefaultStyle, (name2, defaultStyles) => { const control = root2.ref[name2]; forin(defaultStyles, (key, defaultValue) => { const value = stylesToApply[name2] && typeof stylesToApply[name2][key] !== "undefined" ? stylesToApply[name2][key] : defaultValue; root2.ref.activeStyles.push({control, key, value}); }); }); } root2.ref.activeStyles.forEach(({control, key, value}) => { control[key] = typeof value === "function" ? value(root2) : value; }); }; var route = createRoute({ DID_SET_LABEL_BUTTON_ABORT_ITEM_PROCESSING: ({root: root2, action}) => { root2.ref.buttonAbortItemProcessing.label = action.value; }, DID_SET_LABEL_BUTTON_ABORT_ITEM_LOAD: ({root: root2, action}) => { root2.ref.buttonAbortItemLoad.label = action.value; }, DID_SET_LABEL_BUTTON_ABORT_ITEM_REMOVAL: ({root: root2, action}) => { root2.ref.buttonAbortItemRemoval.label = action.value; }, DID_REQUEST_ITEM_PROCESSING: ({root: root2}) => { root2.ref.processProgressIndicator.spin = true; root2.ref.processProgressIndicator.progress = 0; }, DID_START_ITEM_LOAD: ({root: root2}) => { root2.ref.loadProgressIndicator.spin = true; root2.ref.loadProgressIndicator.progress = 0; }, DID_START_ITEM_REMOVE: ({root: root2}) => { root2.ref.processProgressIndicator.spin = true; root2.ref.processProgressIndicator.progress = 0; }, DID_UPDATE_ITEM_LOAD_PROGRESS: ({root: root2, action}) => { root2.ref.loadProgressIndicator.spin = false; root2.ref.loadProgressIndicator.progress = action.progress; }, DID_UPDATE_ITEM_PROCESS_PROGRESS: ({root: root2, action}) => { root2.ref.processProgressIndicator.spin = false; root2.ref.processProgressIndicator.progress = action.progress; } }); var file = createView({ create: create$4, write: write$2, didCreateView: (root2) => { applyFilters("CREATE_VIEW", {...root2, view: root2}); }, name: "file" }); var create$5 = ({root: root2, props}) => { root2.ref.fileName = createElement$1("legend"); root2.appendChild(root2.ref.fileName); root2.ref.file = root2.appendChildView(root2.createChildView(file, {id: props.id})); root2.ref.data = false; }; var didLoadItem = ({root: root2, props}) => { text(root2.ref.fileName, formatFilename(root2.query("GET_ITEM_NAME", props.id))); }; var fileWrapper = createView({ create: create$5, ignoreRect: true, write: createRoute({ DID_LOAD_ITEM: didLoadItem }), didCreateView: (root2) => { applyFilters("CREATE_VIEW", {...root2, view: root2}); }, tag: "fieldset", name: "file-wrapper" }); var PANEL_SPRING_PROPS = {type: "spring", damping: 0.6, mass: 7}; var create$6 = ({root: root2, props}) => { [ { name: "top" }, { name: "center", props: { translateY: null, scaleY: null }, mixins: { animations: { scaleY: PANEL_SPRING_PROPS }, styles: ["translateY", "scaleY"] } }, { name: "bottom", props: { translateY: null }, mixins: { animations: { translateY: PANEL_SPRING_PROPS }, styles: ["translateY"] } } ].forEach((section) => { createSection(root2, section, props.name); }); root2.element.classList.add(`filepond--${props.name}`); root2.ref.scalable = null; }; var createSection = (root2, section, className) => { const viewConstructor = createView({ name: `panel-${section.name} filepond--${className}`, mixins: section.mixins, ignoreRectUpdate: true }); const view = root2.createChildView(viewConstructor, section.props); root2.ref[section.name] = root2.appendChildView(view); }; var write$3 = ({root: root2, props}) => { if (root2.ref.scalable === null || props.scalable !== root2.ref.scalable) { root2.ref.scalable = isBoolean(props.scalable) ? props.scalable : true; root2.element.dataset.scalable = root2.ref.scalable; } if (!props.height) return; const topRect = root2.ref.top.rect.element; const bottomRect = root2.ref.bottom.rect.element; const height = Math.max(topRect.height + bottomRect.height, props.height); root2.ref.center.translateY = topRect.height; root2.ref.center.scaleY = (height - topRect.height - bottomRect.height) / 100; root2.ref.bottom.translateY = height - bottomRect.height; }; var panel = createView({ name: "panel", read: ({root: root2, props}) => props.heightCurrent = root2.ref.bottom.translateY, write: write$3, create: create$6, ignoreRect: true, mixins: { apis: ["height", "heightCurrent", "scalable"] } }); var createDragHelper = (items) => { const itemIds = items.map((item2) => item2.id); let prevIndex = void 0; return { setIndex: (index2) => { prevIndex = index2; }, getIndex: () => prevIndex, getItemIndex: (item2) => itemIds.indexOf(item2.id) }; }; var ITEM_TRANSLATE_SPRING = { type: "spring", stiffness: 0.75, damping: 0.45, mass: 10 }; var ITEM_SCALE_SPRING = "spring"; var StateMap = { DID_START_ITEM_LOAD: "busy", DID_UPDATE_ITEM_LOAD_PROGRESS: "loading", DID_THROW_ITEM_INVALID: "load-invalid", DID_THROW_ITEM_LOAD_ERROR: "load-error", DID_LOAD_ITEM: "idle", DID_THROW_ITEM_REMOVE_ERROR: "remove-error", DID_START_ITEM_REMOVE: "busy", DID_START_ITEM_PROCESSING: "busy processing", DID_REQUEST_ITEM_PROCESSING: "busy processing", DID_UPDATE_ITEM_PROCESS_PROGRESS: "processing", DID_COMPLETE_ITEM_PROCESSING: "processing-complete", DID_THROW_ITEM_PROCESSING_ERROR: "processing-error", DID_THROW_ITEM_PROCESSING_REVERT_ERROR: "processing-revert-error", DID_ABORT_ITEM_PROCESSING: "cancelled", DID_REVERT_ITEM_PROCESSING: "idle" }; var create$7 = ({root: root2, props}) => { root2.ref.handleClick = (e2) => root2.dispatch("DID_ACTIVATE_ITEM", {id: props.id}); root2.element.id = `filepond--item-${props.id}`; root2.element.addEventListener("click", root2.ref.handleClick); root2.ref.container = root2.appendChildView(root2.createChildView(fileWrapper, {id: props.id})); root2.ref.panel = root2.appendChildView(root2.createChildView(panel, {name: "item-panel"})); root2.ref.panel.height = null; props.markedForRemoval = false; if (!root2.query("GET_ALLOW_REORDER")) return; root2.element.dataset.dragState = "idle"; const grab = (e2) => { if (!e2.isPrimary) return; let removedActivateListener = false; const origin = { x: e2.pageX, y: e2.pageY }; props.dragOrigin = { x: root2.translateX, y: root2.translateY }; props.dragCenter = { x: e2.offsetX, y: e2.offsetY }; const dragState = createDragHelper(root2.query("GET_ACTIVE_ITEMS")); root2.dispatch("DID_GRAB_ITEM", {id: props.id, dragState}); const drag = (e3) => { if (!e3.isPrimary) return; e3.stopPropagation(); e3.preventDefault(); props.dragOffset = { x: e3.pageX - origin.x, y: e3.pageY - origin.y }; const dist = props.dragOffset.x * props.dragOffset.x + props.dragOffset.y * props.dragOffset.y; if (dist > 16 && !removedActivateListener) { removedActivateListener = true; root2.element.removeEventListener("click", root2.ref.handleClick); } root2.dispatch("DID_DRAG_ITEM", {id: props.id, dragState}); }; const drop4 = (e3) => { if (!e3.isPrimary) return; document.removeEventListener("pointermove", drag); document.removeEventListener("pointerup", drop4); props.dragOffset = { x: e3.pageX - origin.x, y: e3.pageY - origin.y }; root2.dispatch("DID_DROP_ITEM", {id: props.id, dragState}); if (removedActivateListener) { setTimeout(() => root2.element.addEventListener("click", root2.ref.handleClick), 0); } }; document.addEventListener("pointermove", drag); document.addEventListener("pointerup", drop4); }; root2.element.addEventListener("pointerdown", grab); }; var route$1 = createRoute({ DID_UPDATE_PANEL_HEIGHT: ({root: root2, action}) => { root2.height = action.height; } }); var write$4 = createRoute({ DID_GRAB_ITEM: ({root: root2, props}) => { props.dragOrigin = { x: root2.translateX, y: root2.translateY }; }, DID_DRAG_ITEM: ({root: root2}) => { root2.element.dataset.dragState = "drag"; }, DID_DROP_ITEM: ({root: root2, props}) => { props.dragOffset = null; props.dragOrigin = null; root2.element.dataset.dragState = "drop"; } }, ({root: root2, actions: actions2, props, shouldOptimize}) => { if (root2.element.dataset.dragState === "drop") { if (root2.scaleX <= 1) { root2.element.dataset.dragState = "idle"; } } let action = actions2.concat().filter((action2) => /^DID_/.test(action2.type)).reverse().find((action2) => StateMap[action2.type]); if (action && action.type !== props.currentState) { props.currentState = action.type; root2.element.dataset.filepondItemState = StateMap[props.currentState] || ""; } const aspectRatio = root2.query("GET_ITEM_PANEL_ASPECT_RATIO") || root2.query("GET_PANEL_ASPECT_RATIO"); if (!aspectRatio) { route$1({root: root2, actions: actions2, props}); if (!root2.height && root2.ref.container.rect.element.height > 0) { root2.height = root2.ref.container.rect.element.height; } } else if (!shouldOptimize) { root2.height = root2.rect.element.width * aspectRatio; } if (shouldOptimize) { root2.ref.panel.height = null; } root2.ref.panel.height = root2.height; }); var item = createView({ create: create$7, write: write$4, destroy: ({root: root2, props}) => { root2.element.removeEventListener("click", root2.ref.handleClick); root2.dispatch("RELEASE_ITEM", {query: props.id}); }, tag: "li", name: "item", mixins: { apis: [ "id", "interactionMethod", "markedForRemoval", "spawnDate", "dragCenter", "dragOrigin", "dragOffset" ], styles: ["translateX", "translateY", "scaleX", "scaleY", "opacity", "height"], animations: { scaleX: ITEM_SCALE_SPRING, scaleY: ITEM_SCALE_SPRING, translateX: ITEM_TRANSLATE_SPRING, translateY: ITEM_TRANSLATE_SPRING, opacity: {type: "tween", duration: 150} } } }); var getItemsPerRow = (horizontalSpace, itemWidth) => { return Math.max(1, Math.floor((horizontalSpace + 1) / itemWidth)); }; var getItemIndexByPosition = (view, children, positionInView) => { if (!positionInView) return; const horizontalSpace = view.rect.element.width; const l = children.length; let last = null; if (l === 0 || positionInView.top < children[0].rect.element.top) return -1; const item2 = children[0]; const itemRect = item2.rect.element; const itemHorizontalMargin = itemRect.marginLeft + itemRect.marginRight; const itemWidth = itemRect.width + itemHorizontalMargin; const itemsPerRow = getItemsPerRow(horizontalSpace, itemWidth); if (itemsPerRow === 1) { for (let index2 = 0; index2 < l; index2++) { const child = children[index2]; const childMid = child.rect.outer.top + child.rect.element.height * 0.5; if (positionInView.top < childMid) { return index2; } } return l; } const itemVerticalMargin = itemRect.marginTop + itemRect.marginBottom; const itemHeight = itemRect.height + itemVerticalMargin; for (let index2 = 0; index2 < l; index2++) { const indexX = index2 % itemsPerRow; const indexY = Math.floor(index2 / itemsPerRow); const offsetX = indexX * itemWidth; const offsetY = indexY * itemHeight; const itemTop = offsetY - itemRect.marginTop; const itemRight = offsetX + itemWidth; const itemBottom = offsetY + itemHeight + itemRect.marginBottom; if (positionInView.top < itemBottom && positionInView.top > itemTop) { if (positionInView.left < itemRight) { return index2; } else if (index2 !== l - 1) { last = index2; } else { last = null; } } } if (last !== null) { return last; } return l; }; var dropAreaDimensions = { height: 0, width: 0, get getHeight() { return this.height; }, set setHeight(val) { if (this.height === 0 || val === 0) this.height = val; }, get getWidth() { return this.width; }, set setWidth(val) { if (this.width === 0 || val === 0) this.width = val; }, setDimensions: function(height, width) { if (this.height === 0 || height === 0) this.height = height; if (this.width === 0 || width === 0) this.width = width; } }; var create$8 = ({root: root2}) => { attr(root2.element, "role", "list"); root2.ref.lastItemSpanwDate = Date.now(); }; var addItemView = ({root: root2, action}) => { const {id, index: index2, interactionMethod} = action; root2.ref.addIndex = index2; const now = Date.now(); let spawnDate = now; let opacity = 1; if (interactionMethod !== InteractionMethod.NONE) { opacity = 0; const cooldown = root2.query("GET_ITEM_INSERT_INTERVAL"); const dist = now - root2.ref.lastItemSpanwDate; spawnDate = dist < cooldown ? now + (cooldown - dist) : now; } root2.ref.lastItemSpanwDate = spawnDate; root2.appendChildView(root2.createChildView(item, { spawnDate, id, opacity, interactionMethod }), index2); }; var moveItem = (item2, x, y, vx = 0, vy = 1) => { if (item2.dragOffset) { item2.translateX = null; item2.translateY = null; item2.translateX = item2.dragOrigin.x + item2.dragOffset.x; item2.translateY = item2.dragOrigin.y + item2.dragOffset.y; item2.scaleX = 1.025; item2.scaleY = 1.025; } else { item2.translateX = x; item2.translateY = y; if (Date.now() > item2.spawnDate) { if (item2.opacity === 0) { introItemView(item2, x, y, vx, vy); } item2.scaleX = 1; item2.scaleY = 1; item2.opacity = 1; } } }; var introItemView = (item2, x, y, vx, vy) => { if (item2.interactionMethod === InteractionMethod.NONE) { item2.translateX = null; item2.translateX = x; item2.translateY = null; item2.translateY = y; } else if (item2.interactionMethod === InteractionMethod.DROP) { item2.translateX = null; item2.translateX = x - vx * 20; item2.translateY = null; item2.translateY = y - vy * 10; item2.scaleX = 0.8; item2.scaleY = 0.8; } else if (item2.interactionMethod === InteractionMethod.BROWSE) { item2.translateY = null; item2.translateY = y - 30; } else if (item2.interactionMethod === InteractionMethod.API) { item2.translateX = null; item2.translateX = x - 30; item2.translateY = null; } }; var removeItemView = ({root: root2, action}) => { const {id} = action; const view = root2.childViews.find((child) => child.id === id); if (!view) { return; } view.scaleX = 0.9; view.scaleY = 0.9; view.opacity = 0; view.markedForRemoval = true; }; var getItemHeight = (child) => child.rect.element.height + child.rect.element.marginBottom * 0.5 + child.rect.element.marginTop * 0.5; var getItemWidth = (child) => child.rect.element.width + child.rect.element.marginLeft * 0.5 + child.rect.element.marginRight * 0.5; var dragItem = ({root: root2, action}) => { const {id, dragState} = action; const item2 = root2.query("GET_ITEM", {id}); const view = root2.childViews.find((child) => child.id === id); const numItems = root2.childViews.length; const oldIndex2 = dragState.getItemIndex(item2); if (!view) return; const dragPosition = { x: view.dragOrigin.x + view.dragOffset.x + view.dragCenter.x, y: view.dragOrigin.y + view.dragOffset.y + view.dragCenter.y }; const dragHeight = getItemHeight(view); const dragWidth = getItemWidth(view); let cols = Math.floor(root2.rect.outer.width / dragWidth); if (cols > numItems) cols = numItems; const rows = Math.floor(numItems / cols + 1); dropAreaDimensions.setHeight = dragHeight * rows; dropAreaDimensions.setWidth = dragWidth * cols; var location2 = { y: Math.floor(dragPosition.y / dragHeight), x: Math.floor(dragPosition.x / dragWidth), getGridIndex: function getGridIndex() { if (dragPosition.y > dropAreaDimensions.getHeight || dragPosition.y < 0 || dragPosition.x > dropAreaDimensions.getWidth || dragPosition.x < 0) return oldIndex2; return this.y * cols + this.x; }, getColIndex: function getColIndex() { const items = root2.query("GET_ACTIVE_ITEMS"); const visibleChildren = root2.childViews.filter((child) => child.rect.element.height); const children = items.map((item3) => visibleChildren.find((childView) => childView.id === item3.id)); const currentIndex2 = children.findIndex((child) => child === view); const dragHeight2 = getItemHeight(view); const l = children.length; let idx = l; let childHeight = 0; let childBottom = 0; let childTop = 0; for (let i = 0; i < l; i++) { childHeight = getItemHeight(children[i]); childTop = childBottom; childBottom = childTop + childHeight; if (dragPosition.y < childBottom) { if (currentIndex2 > i) { if (dragPosition.y < childTop + dragHeight2) { idx = i; break; } continue; } idx = i; break; } } return idx; } }; const index2 = cols > 1 ? location2.getGridIndex() : location2.getColIndex(); root2.dispatch("MOVE_ITEM", {query: view, index: index2}); const currentIndex = dragState.getIndex(); if (currentIndex === void 0 || currentIndex !== index2) { dragState.setIndex(index2); if (currentIndex === void 0) return; root2.dispatch("DID_REORDER_ITEMS", { items: root2.query("GET_ACTIVE_ITEMS"), origin: oldIndex2, target: index2 }); } }; var route$2 = createRoute({ DID_ADD_ITEM: addItemView, DID_REMOVE_ITEM: removeItemView, DID_DRAG_ITEM: dragItem }); var write$5 = ({root: root2, props, actions: actions2, shouldOptimize}) => { route$2({root: root2, props, actions: actions2}); const {dragCoordinates} = props; const horizontalSpace = root2.rect.element.width; const visibleChildren = root2.childViews.filter((child) => child.rect.element.height); const children = root2.query("GET_ACTIVE_ITEMS").map((item2) => visibleChildren.find((child) => child.id === item2.id)).filter((item2) => item2); const dragIndex = dragCoordinates ? getItemIndexByPosition(root2, children, dragCoordinates) : null; const addIndex = root2.ref.addIndex || null; root2.ref.addIndex = null; let dragIndexOffset = 0; let removeIndexOffset = 0; let addIndexOffset = 0; if (children.length === 0) return; const childRect = children[0].rect.element; const itemVerticalMargin = childRect.marginTop + childRect.marginBottom; const itemHorizontalMargin = childRect.marginLeft + childRect.marginRight; const itemWidth = childRect.width + itemHorizontalMargin; const itemHeight = childRect.height + itemVerticalMargin; const itemsPerRow = getItemsPerRow(horizontalSpace, itemWidth); if (itemsPerRow === 1) { let offsetY = 0; let dragOffset = 0; children.forEach((child, index2) => { if (dragIndex) { let dist = index2 - dragIndex; if (dist === -2) { dragOffset = -itemVerticalMargin * 0.25; } else if (dist === -1) { dragOffset = -itemVerticalMargin * 0.75; } else if (dist === 0) { dragOffset = itemVerticalMargin * 0.75; } else if (dist === 1) { dragOffset = itemVerticalMargin * 0.25; } else { dragOffset = 0; } } if (shouldOptimize) { child.translateX = null; child.translateY = null; } if (!child.markedForRemoval) { moveItem(child, 0, offsetY + dragOffset); } let itemHeight2 = child.rect.element.height + itemVerticalMargin; let visualHeight = itemHeight2 * (child.markedForRemoval ? child.opacity : 1); offsetY += visualHeight; }); } else { let prevX = 0; let prevY = 0; children.forEach((child, index2) => { if (index2 === dragIndex) { dragIndexOffset = 1; } if (index2 === addIndex) { addIndexOffset += 1; } if (child.markedForRemoval && child.opacity < 0.5) { removeIndexOffset -= 1; } const visualIndex = index2 + addIndexOffset + dragIndexOffset + removeIndexOffset; const indexX = visualIndex % itemsPerRow; const indexY = Math.floor(visualIndex / itemsPerRow); const offsetX = indexX * itemWidth; const offsetY = indexY * itemHeight; const vectorX = Math.sign(offsetX - prevX); const vectorY = Math.sign(offsetY - prevY); prevX = offsetX; prevY = offsetY; if (child.markedForRemoval) return; if (shouldOptimize) { child.translateX = null; child.translateY = null; } moveItem(child, offsetX, offsetY, vectorX, vectorY); }); } }; var filterSetItemActions = (child, actions2) => actions2.filter((action) => { if (action.data && action.data.id) { return child.id === action.data.id; } return true; }); var list = createView({ create: create$8, write: write$5, tag: "ul", name: "list", didWriteView: ({root: root2}) => { root2.childViews.filter((view) => view.markedForRemoval && view.opacity === 0 && view.resting).forEach((view) => { view._destroy(); root2.removeChildView(view); }); }, filterFrameActionsForChild: filterSetItemActions, mixins: { apis: ["dragCoordinates"] } }); var create$9 = ({root: root2, props}) => { root2.ref.list = root2.appendChildView(root2.createChildView(list)); props.dragCoordinates = null; props.overflowing = false; }; var storeDragCoordinates = ({root: root2, props, action}) => { if (!root2.query("GET_ITEM_INSERT_LOCATION_FREEDOM")) return; props.dragCoordinates = { left: action.position.scopeLeft - root2.ref.list.rect.element.left, top: action.position.scopeTop - (root2.rect.outer.top + root2.rect.element.marginTop + root2.rect.element.scrollTop) }; }; var clearDragCoordinates = ({props}) => { props.dragCoordinates = null; }; var route$3 = createRoute({ DID_DRAG: storeDragCoordinates, DID_END_DRAG: clearDragCoordinates }); var write$6 = ({root: root2, props, actions: actions2}) => { route$3({root: root2, props, actions: actions2}); root2.ref.list.dragCoordinates = props.dragCoordinates; if (props.overflowing && !props.overflow) { props.overflowing = false; root2.element.dataset.state = ""; root2.height = null; } if (props.overflow) { const newHeight = Math.round(props.overflow); if (newHeight !== root2.height) { props.overflowing = true; root2.element.dataset.state = "overflow"; root2.height = newHeight; } } }; var listScroller = createView({ create: create$9, write: write$6, name: "list-scroller", mixins: { apis: ["overflow", "dragCoordinates"], styles: ["height", "translateY"], animations: { translateY: "spring" } } }); var attrToggle = (element, name2, state2, enabledValue = "") => { if (state2) { attr(element, name2, enabledValue); } else { element.removeAttribute(name2); } }; var resetFileInput = (input) => { if (!input || input.value === "") { return; } try { input.value = ""; } catch (err) { } if (input.value) { const form = createElement$1("form"); const parentNode = input.parentNode; const ref = input.nextSibling; form.appendChild(input); form.reset(); if (ref) { parentNode.insertBefore(input, ref); } else { parentNode.appendChild(input); } } }; var create$a = ({root: root2, props}) => { root2.element.id = `filepond--browser-${props.id}`; attr(root2.element, "name", root2.query("GET_NAME")); attr(root2.element, "aria-controls", `filepond--assistant-${props.id}`); attr(root2.element, "aria-labelledby", `filepond--drop-label-${props.id}`); setAcceptedFileTypes({root: root2, action: {value: root2.query("GET_ACCEPTED_FILE_TYPES")}}); toggleAllowMultiple({root: root2, action: {value: root2.query("GET_ALLOW_MULTIPLE")}}); toggleDirectoryFilter({root: root2, action: {value: root2.query("GET_ALLOW_DIRECTORIES_ONLY")}}); toggleDisabled({root: root2}); toggleRequired({root: root2, action: {value: root2.query("GET_REQUIRED")}}); setCaptureMethod({root: root2, action: {value: root2.query("GET_CAPTURE_METHOD")}}); root2.ref.handleChange = (e2) => { if (!root2.element.value) { return; } const files = Array.from(root2.element.files).map((file2) => { file2._relativePath = file2.webkitRelativePath; return file2; }); setTimeout(() => { props.onload(files); resetFileInput(root2.element); }, 250); }; root2.element.addEventListener("change", root2.ref.handleChange); }; var setAcceptedFileTypes = ({root: root2, action}) => { if (!root2.query("GET_ALLOW_SYNC_ACCEPT_ATTRIBUTE")) return; attrToggle(root2.element, "accept", !!action.value, action.value ? action.value.join(",") : ""); }; var toggleAllowMultiple = ({root: root2, action}) => { attrToggle(root2.element, "multiple", action.value); }; var toggleDirectoryFilter = ({root: root2, action}) => { attrToggle(root2.element, "webkitdirectory", action.value); }; var toggleDisabled = ({root: root2}) => { const isDisabled = root2.query("GET_DISABLED"); const doesAllowBrowse = root2.query("GET_ALLOW_BROWSE"); const disableField = isDisabled || !doesAllowBrowse; attrToggle(root2.element, "disabled", disableField); }; var toggleRequired = ({root: root2, action}) => { if (!action.value) { attrToggle(root2.element, "required", false); } else if (root2.query("GET_TOTAL_ITEMS") === 0) { attrToggle(root2.element, "required", true); } }; var setCaptureMethod = ({root: root2, action}) => { attrToggle(root2.element, "capture", !!action.value, action.value === true ? "" : action.value); }; var updateRequiredStatus = ({root: root2}) => { const {element} = root2; if (root2.query("GET_TOTAL_ITEMS") > 0) { attrToggle(element, "required", false); attrToggle(element, "name", false); } else { attrToggle(element, "name", true, root2.query("GET_NAME")); const shouldCheckValidity = root2.query("GET_CHECK_VALIDITY"); if (shouldCheckValidity) { element.setCustomValidity(""); } if (root2.query("GET_REQUIRED")) { attrToggle(element, "required", true); } } }; var updateFieldValidityStatus = ({root: root2}) => { const shouldCheckValidity = root2.query("GET_CHECK_VALIDITY"); if (!shouldCheckValidity) return; root2.element.setCustomValidity(root2.query("GET_LABEL_INVALID_FIELD")); }; var browser = createView({ tag: "input", name: "browser", ignoreRect: true, ignoreRectUpdate: true, attributes: { type: "file" }, create: create$a, destroy: ({root: root2}) => { root2.element.removeEventListener("change", root2.ref.handleChange); }, write: createRoute({ DID_LOAD_ITEM: updateRequiredStatus, DID_REMOVE_ITEM: updateRequiredStatus, DID_THROW_ITEM_INVALID: updateFieldValidityStatus, DID_SET_DISABLED: toggleDisabled, DID_SET_ALLOW_BROWSE: toggleDisabled, DID_SET_ALLOW_DIRECTORIES_ONLY: toggleDirectoryFilter, DID_SET_ALLOW_MULTIPLE: toggleAllowMultiple, DID_SET_ACCEPTED_FILE_TYPES: setAcceptedFileTypes, DID_SET_CAPTURE_METHOD: setCaptureMethod, DID_SET_REQUIRED: toggleRequired }) }); var Key = { ENTER: 13, SPACE: 32 }; var create$b = ({root: root2, props}) => { const label = createElement$1("label"); attr(label, "for", `filepond--browser-${props.id}`); attr(label, "id", `filepond--drop-label-${props.id}`); attr(label, "aria-hidden", "true"); root2.ref.handleKeyDown = (e2) => { const isActivationKey = e2.keyCode === Key.ENTER || e2.keyCode === Key.SPACE; if (!isActivationKey) return; e2.preventDefault(); root2.ref.label.click(); }; root2.ref.handleClick = (e2) => { const isLabelClick = e2.target === label || label.contains(e2.target); if (isLabelClick) return; root2.ref.label.click(); }; label.addEventListener("keydown", root2.ref.handleKeyDown); root2.element.addEventListener("click", root2.ref.handleClick); updateLabelValue(label, props.caption); root2.appendChild(label); root2.ref.label = label; }; var updateLabelValue = (label, value) => { label.innerHTML = value; const clickable = label.querySelector(".filepond--label-action"); if (clickable) { attr(clickable, "tabindex", "0"); } return value; }; var dropLabel = createView({ name: "drop-label", ignoreRect: true, create: create$b, destroy: ({root: root2}) => { root2.ref.label.addEventListener("keydown", root2.ref.handleKeyDown); root2.element.removeEventListener("click", root2.ref.handleClick); }, write: createRoute({ DID_SET_LABEL_IDLE: ({root: root2, action}) => { updateLabelValue(root2.ref.label, action.value); } }), mixins: { styles: ["opacity", "translateX", "translateY"], animations: { opacity: {type: "tween", duration: 150}, translateX: "spring", translateY: "spring" } } }); var blob = createView({ name: "drip-blob", ignoreRect: true, mixins: { styles: ["translateX", "translateY", "scaleX", "scaleY", "opacity"], animations: { scaleX: "spring", scaleY: "spring", translateX: "spring", translateY: "spring", opacity: {type: "tween", duration: 250} } } }); var addBlob = ({root: root2}) => { const centerX = root2.rect.element.width * 0.5; const centerY = root2.rect.element.height * 0.5; root2.ref.blob = root2.appendChildView(root2.createChildView(blob, { opacity: 0, scaleX: 2.5, scaleY: 2.5, translateX: centerX, translateY: centerY })); }; var moveBlob = ({root: root2, action}) => { if (!root2.ref.blob) { addBlob({root: root2}); return; } root2.ref.blob.translateX = action.position.scopeLeft; root2.ref.blob.translateY = action.position.scopeTop; root2.ref.blob.scaleX = 1; root2.ref.blob.scaleY = 1; root2.ref.blob.opacity = 1; }; var hideBlob = ({root: root2}) => { if (!root2.ref.blob) { return; } root2.ref.blob.opacity = 0; }; var explodeBlob = ({root: root2}) => { if (!root2.ref.blob) { return; } root2.ref.blob.scaleX = 2.5; root2.ref.blob.scaleY = 2.5; root2.ref.blob.opacity = 0; }; var write$7 = ({root: root2, props, actions: actions2}) => { route$4({root: root2, props, actions: actions2}); const {blob: blob2} = root2.ref; if (actions2.length === 0 && blob2 && blob2.opacity === 0) { root2.removeChildView(blob2); root2.ref.blob = null; } }; var route$4 = createRoute({ DID_DRAG: moveBlob, DID_DROP: explodeBlob, DID_END_DRAG: hideBlob }); var drip = createView({ ignoreRect: true, ignoreRectUpdate: true, name: "drip", write: write$7 }); var setInputFiles = (element, files) => { try { const dataTransfer = new DataTransfer(); files.forEach((file2) => { if (file2 instanceof File) { dataTransfer.items.add(file2); } else { dataTransfer.items.add(new File([file2], file2.name, { type: file2.type })); } }); element.files = dataTransfer.files; } catch (err) { return false; } return true; }; var create$c = ({root: root2}) => root2.ref.fields = {}; var getField = (root2, id) => root2.ref.fields[id]; var syncFieldPositionsWithItems = (root2) => { root2.query("GET_ACTIVE_ITEMS").forEach((item2) => { if (!root2.ref.fields[item2.id]) return; root2.element.appendChild(root2.ref.fields[item2.id]); }); }; var didReorderItems = ({root: root2}) => syncFieldPositionsWithItems(root2); var didAddItem = ({root: root2, action}) => { const fileItem = root2.query("GET_ITEM", action.id); const isLocalFile = fileItem.origin === FileOrigin.LOCAL; const shouldUseFileInput = !isLocalFile && root2.query("SHOULD_UPDATE_FILE_INPUT"); const dataContainer = createElement$1("input"); dataContainer.type = shouldUseFileInput ? "file" : "hidden"; dataContainer.name = root2.query("GET_NAME"); dataContainer.disabled = root2.query("GET_DISABLED"); root2.ref.fields[action.id] = dataContainer; syncFieldPositionsWithItems(root2); }; var didLoadItem$1 = ({root: root2, action}) => { const field = getField(root2, action.id); if (!field) return; if (action.serverFileReference !== null) field.value = action.serverFileReference; if (!root2.query("SHOULD_UPDATE_FILE_INPUT")) return; const fileItem = root2.query("GET_ITEM", action.id); setInputFiles(field, [fileItem.file]); }; var didPrepareOutput = ({root: root2, action}) => { if (!root2.query("SHOULD_UPDATE_FILE_INPUT")) return; setTimeout(() => { const field = getField(root2, action.id); if (!field) return; setInputFiles(field, [action.file]); }, 0); }; var didSetDisabled = ({root: root2}) => { root2.element.disabled = root2.query("GET_DISABLED"); }; var didRemoveItem = ({root: root2, action}) => { const field = getField(root2, action.id); if (!field) return; if (field.parentNode) field.parentNode.removeChild(field); delete root2.ref.fields[action.id]; }; var didDefineValue = ({root: root2, action}) => { const field = getField(root2, action.id); if (!field) return; if (action.value === null) { field.removeAttribute("value"); } else { field.value = action.value; } syncFieldPositionsWithItems(root2); }; var write$8 = createRoute({ DID_SET_DISABLED: didSetDisabled, DID_ADD_ITEM: didAddItem, DID_LOAD_ITEM: didLoadItem$1, DID_REMOVE_ITEM: didRemoveItem, DID_DEFINE_VALUE: didDefineValue, DID_PREPARE_OUTPUT: didPrepareOutput, DID_REORDER_ITEMS: didReorderItems, DID_SORT_ITEMS: didReorderItems }); var data2 = createView({ tag: "fieldset", name: "data", create: create$c, write: write$8, ignoreRect: true }); var getRootNode = (element) => "getRootNode" in element ? element.getRootNode() : document; var images = ["jpg", "jpeg", "png", "gif", "bmp", "webp", "svg", "tiff"]; var text$1 = ["css", "csv", "html", "txt"]; var map = { zip: "zip|compressed", epub: "application/epub+zip" }; var guesstimateMimeType = (extension = "") => { extension = extension.toLowerCase(); if (images.includes(extension)) { return "image/" + (extension === "jpg" ? "jpeg" : extension === "svg" ? "svg+xml" : extension); } if (text$1.includes(extension)) { return "text/" + extension; } return map[extension] || ""; }; var requestDataTransferItems = (dataTransfer) => new Promise((resolve, reject) => { const links = getLinks(dataTransfer); if (links.length && !hasFiles(dataTransfer)) { return resolve(links); } getFiles(dataTransfer).then(resolve); }); var hasFiles = (dataTransfer) => { if (dataTransfer.files) return dataTransfer.files.length > 0; return false; }; var getFiles = (dataTransfer) => new Promise((resolve, reject) => { const promisedFiles = (dataTransfer.items ? Array.from(dataTransfer.items) : []).filter((item2) => isFileSystemItem(item2)).map((item2) => getFilesFromItem(item2)); if (!promisedFiles.length) { resolve(dataTransfer.files ? Array.from(dataTransfer.files) : []); return; } Promise.all(promisedFiles).then((returnedFileGroups) => { const files = []; returnedFileGroups.forEach((group) => { files.push.apply(files, group); }); resolve(files.filter((file2) => file2).map((file2) => { if (!file2._relativePath) file2._relativePath = file2.webkitRelativePath; return file2; })); }).catch(console.error); }); var isFileSystemItem = (item2) => { if (isEntry(item2)) { const entry = getAsEntry(item2); if (entry) { return entry.isFile || entry.isDirectory; } } return item2.kind === "file"; }; var getFilesFromItem = (item2) => new Promise((resolve, reject) => { if (isDirectoryEntry(item2)) { getFilesInDirectory(getAsEntry(item2)).then(resolve).catch(reject); return; } resolve([item2.getAsFile()]); }); var getFilesInDirectory = (entry) => new Promise((resolve, reject) => { const files = []; let dirCounter = 0; let fileCounter = 0; const resolveIfDone = () => { if (fileCounter === 0 && dirCounter === 0) { resolve(files); } }; const readEntries = (dirEntry) => { dirCounter++; const directoryReader = dirEntry.createReader(); const readBatch = () => { directoryReader.readEntries((entries) => { if (entries.length === 0) { dirCounter--; resolveIfDone(); return; } entries.forEach((entry2) => { if (entry2.isDirectory) { readEntries(entry2); } else { fileCounter++; entry2.file((file2) => { const correctedFile = correctMissingFileType(file2); if (entry2.fullPath) correctedFile._relativePath = entry2.fullPath; files.push(correctedFile); fileCounter--; resolveIfDone(); }); } }); readBatch(); }, reject); }; readBatch(); }; readEntries(entry); }); var correctMissingFileType = (file2) => { if (file2.type.length) return file2; const date = file2.lastModifiedDate; const name2 = file2.name; const type = guesstimateMimeType(getExtensionFromFilename(file2.name)); if (!type.length) return file2; file2 = file2.slice(0, file2.size, type); file2.name = name2; file2.lastModifiedDate = date; return file2; }; var isDirectoryEntry = (item2) => isEntry(item2) && (getAsEntry(item2) || {}).isDirectory; var isEntry = (item2) => "webkitGetAsEntry" in item2; var getAsEntry = (item2) => item2.webkitGetAsEntry(); var getLinks = (dataTransfer) => { let links = []; try { links = getLinksFromTransferMetaData(dataTransfer); if (links.length) { return links; } links = getLinksFromTransferURLData(dataTransfer); } catch (e2) { } return links; }; var getLinksFromTransferURLData = (dataTransfer) => { let data3 = dataTransfer.getData("url"); if (typeof data3 === "string" && data3.length) { return [data3]; } return []; }; var getLinksFromTransferMetaData = (dataTransfer) => { let data3 = dataTransfer.getData("text/html"); if (typeof data3 === "string" && data3.length) { const matches2 = data3.match(/src\s*=\s*"(.+?)"/); if (matches2) { return [matches2[1]]; } } return []; }; var dragNDropObservers = []; var eventPosition = (e2) => ({ pageLeft: e2.pageX, pageTop: e2.pageY, scopeLeft: e2.offsetX || e2.layerX, scopeTop: e2.offsetY || e2.layerY }); var createDragNDropClient = (element, scopeToObserve, filterElement) => { const observer2 = getDragNDropObserver(scopeToObserve); const client = { element, filterElement, state: null, ondrop: () => { }, onenter: () => { }, ondrag: () => { }, onexit: () => { }, onload: () => { }, allowdrop: () => { } }; client.destroy = observer2.addListener(client); return client; }; var getDragNDropObserver = (element) => { const observer2 = dragNDropObservers.find((item2) => item2.element === element); if (observer2) { return observer2; } const newObserver = createDragNDropObserver(element); dragNDropObservers.push(newObserver); return newObserver; }; var createDragNDropObserver = (element) => { const clients = []; const routes = { dragenter, dragover, dragleave, drop }; const handlers = {}; forin(routes, (event, createHandler) => { handlers[event] = createHandler(element, clients); element.addEventListener(event, handlers[event], false); }); const observer2 = { element, addListener: (client) => { clients.push(client); return () => { clients.splice(clients.indexOf(client), 1); if (clients.length === 0) { dragNDropObservers.splice(dragNDropObservers.indexOf(observer2), 1); forin(routes, (event) => { element.removeEventListener(event, handlers[event], false); }); } }; } }; return observer2; }; var elementFromPoint = (root2, point) => { if (!("elementFromPoint" in root2)) { root2 = document; } return root2.elementFromPoint(point.x, point.y); }; var isEventTarget = (e2, target) => { const root2 = getRootNode(target); const elementAtPosition = elementFromPoint(root2, { x: e2.pageX - window.pageXOffset, y: e2.pageY - window.pageYOffset }); return elementAtPosition === target || target.contains(elementAtPosition); }; var initialTarget = null; var setDropEffect = (dataTransfer, effect) => { try { dataTransfer.dropEffect = effect; } catch (e2) { } }; var dragenter = (root2, clients) => (e2) => { e2.preventDefault(); initialTarget = e2.target; clients.forEach((client) => { const {element, onenter} = client; if (isEventTarget(e2, element)) { client.state = "enter"; onenter(eventPosition(e2)); } }); }; var dragover = (root2, clients) => (e2) => { e2.preventDefault(); const dataTransfer = e2.dataTransfer; requestDataTransferItems(dataTransfer).then((items) => { let overDropTarget = false; clients.some((client) => { const {filterElement, element, onenter, onexit, ondrag, allowdrop} = client; setDropEffect(dataTransfer, "copy"); const allowsTransfer = allowdrop(items); if (!allowsTransfer) { setDropEffect(dataTransfer, "none"); return; } if (isEventTarget(e2, element)) { overDropTarget = true; if (client.state === null) { client.state = "enter"; onenter(eventPosition(e2)); return; } client.state = "over"; if (filterElement && !allowsTransfer) { setDropEffect(dataTransfer, "none"); return; } ondrag(eventPosition(e2)); } else { if (filterElement && !overDropTarget) { setDropEffect(dataTransfer, "none"); } if (client.state) { client.state = null; onexit(eventPosition(e2)); } } }); }); }; var drop = (root2, clients) => (e2) => { e2.preventDefault(); const dataTransfer = e2.dataTransfer; requestDataTransferItems(dataTransfer).then((items) => { clients.forEach((client) => { const {filterElement, element, ondrop, onexit, allowdrop} = client; client.state = null; if (filterElement && !isEventTarget(e2, element)) return; if (!allowdrop(items)) return onexit(eventPosition(e2)); ondrop(eventPosition(e2), items); }); }); }; var dragleave = (root2, clients) => (e2) => { if (initialTarget !== e2.target) { return; } clients.forEach((client) => { const {onexit} = client; client.state = null; onexit(eventPosition(e2)); }); }; var createHopper = (scope, validateItems, options2) => { scope.classList.add("filepond--hopper"); const {catchesDropsOnPage, requiresDropOnElement, filterItems = (items) => items} = options2; const client = createDragNDropClient(scope, catchesDropsOnPage ? document.documentElement : scope, requiresDropOnElement); let lastState = ""; let currentState = ""; client.allowdrop = (items) => { return validateItems(filterItems(items)); }; client.ondrop = (position, items) => { const filteredItems = filterItems(items); if (!validateItems(filteredItems)) { api.ondragend(position); return; } currentState = "drag-drop"; api.onload(filteredItems, position); }; client.ondrag = (position) => { api.ondrag(position); }; client.onenter = (position) => { currentState = "drag-over"; api.ondragstart(position); }; client.onexit = (position) => { currentState = "drag-exit"; api.ondragend(position); }; const api = { updateHopperState: () => { if (lastState !== currentState) { scope.dataset.hopperState = currentState; lastState = currentState; } }, onload: () => { }, ondragstart: () => { }, ondrag: () => { }, ondragend: () => { }, destroy: () => { client.destroy(); } }; return api; }; var listening = false; var listeners$1 = []; var handlePaste = (e2) => { const activeEl = document.activeElement; if (activeEl && /textarea|input/i.test(activeEl.nodeName)) { let inScope = false; let element = activeEl; while (element !== document.body) { if (element.classList.contains("filepond--root")) { inScope = true; break; } element = element.parentNode; } if (!inScope) return; } requestDataTransferItems(e2.clipboardData).then((files) => { if (!files.length) { return; } listeners$1.forEach((listener) => listener(files)); }); }; var listen = (cb) => { if (listeners$1.includes(cb)) { return; } listeners$1.push(cb); if (listening) { return; } listening = true; document.addEventListener("paste", handlePaste); }; var unlisten = (listener) => { arrayRemove(listeners$1, listeners$1.indexOf(listener)); if (listeners$1.length === 0) { document.removeEventListener("paste", handlePaste); listening = false; } }; var createPaster = () => { const cb = (files) => { api.onload(files); }; const api = { destroy: () => { unlisten(cb); }, onload: () => { } }; listen(cb); return api; }; var create$d = ({root: root2, props}) => { root2.element.id = `filepond--assistant-${props.id}`; attr(root2.element, "role", "status"); attr(root2.element, "aria-live", "polite"); attr(root2.element, "aria-relevant", "additions"); }; var addFilesNotificationTimeout = null; var notificationClearTimeout = null; var filenames = []; var assist = (root2, message) => { root2.element.textContent = message; }; var clear$1 = (root2) => { root2.element.textContent = ""; }; var listModified = (root2, filename, label) => { const total = root2.query("GET_TOTAL_ITEMS"); assist(root2, `${label} ${filename}, ${total} ${total === 1 ? root2.query("GET_LABEL_FILE_COUNT_SINGULAR") : root2.query("GET_LABEL_FILE_COUNT_PLURAL")}`); clearTimeout(notificationClearTimeout); notificationClearTimeout = setTimeout(() => { clear$1(root2); }, 1500); }; var isUsingFilePond = (root2) => root2.element.parentNode.contains(document.activeElement); var itemAdded = ({root: root2, action}) => { if (!isUsingFilePond(root2)) { return; } root2.element.textContent = ""; const item2 = root2.query("GET_ITEM", action.id); filenames.push(item2.filename); clearTimeout(addFilesNotificationTimeout); addFilesNotificationTimeout = setTimeout(() => { listModified(root2, filenames.join(", "), root2.query("GET_LABEL_FILE_ADDED")); filenames.length = 0; }, 750); }; var itemRemoved = ({root: root2, action}) => { if (!isUsingFilePond(root2)) { return; } const item2 = action.item; listModified(root2, item2.filename, root2.query("GET_LABEL_FILE_REMOVED")); }; var itemProcessed = ({root: root2, action}) => { const item2 = root2.query("GET_ITEM", action.id); const filename = item2.filename; const label = root2.query("GET_LABEL_FILE_PROCESSING_COMPLETE"); assist(root2, `${filename} ${label}`); }; var itemProcessedUndo = ({root: root2, action}) => { const item2 = root2.query("GET_ITEM", action.id); const filename = item2.filename; const label = root2.query("GET_LABEL_FILE_PROCESSING_ABORTED"); assist(root2, `${filename} ${label}`); }; var itemError = ({root: root2, action}) => { const item2 = root2.query("GET_ITEM", action.id); const filename = item2.filename; assist(root2, `${action.status.main} ${filename} ${action.status.sub}`); }; var assistant = createView({ create: create$d, ignoreRect: true, ignoreRectUpdate: true, write: createRoute({ DID_LOAD_ITEM: itemAdded, DID_REMOVE_ITEM: itemRemoved, DID_COMPLETE_ITEM_PROCESSING: itemProcessed, DID_ABORT_ITEM_PROCESSING: itemProcessedUndo, DID_REVERT_ITEM_PROCESSING: itemProcessedUndo, DID_THROW_ITEM_REMOVE_ERROR: itemError, DID_THROW_ITEM_LOAD_ERROR: itemError, DID_THROW_ITEM_INVALID: itemError, DID_THROW_ITEM_PROCESSING_ERROR: itemError }), tag: "span", name: "assistant" }); var toCamels = (string, separator = "-") => string.replace(new RegExp(`${separator}.`, "g"), (sub) => sub.charAt(1).toUpperCase()); var debounce = (func, interval = 16, immidiateOnly = true) => { let last = Date.now(); let timeout = null; return (...args) => { clearTimeout(timeout); const dist = Date.now() - last; const fn2 = () => { last = Date.now(); func(...args); }; if (dist < interval) { if (!immidiateOnly) { timeout = setTimeout(fn2, interval - dist); } } else { fn2(); } }; }; var MAX_FILES_LIMIT = 1e6; var prevent = (e2) => e2.preventDefault(); var create$e = ({root: root2, props}) => { const id = root2.query("GET_ID"); if (id) { root2.element.id = id; } const className = root2.query("GET_CLASS_NAME"); if (className) { className.split(" ").filter((name2) => name2.length).forEach((name2) => { root2.element.classList.add(name2); }); } root2.ref.label = root2.appendChildView(root2.createChildView(dropLabel, { ...props, translateY: null, caption: root2.query("GET_LABEL_IDLE") })); root2.ref.list = root2.appendChildView(root2.createChildView(listScroller, {translateY: null})); root2.ref.panel = root2.appendChildView(root2.createChildView(panel, {name: "panel-root"})); root2.ref.assistant = root2.appendChildView(root2.createChildView(assistant, {...props})); root2.ref.data = root2.appendChildView(root2.createChildView(data2, {...props})); root2.ref.measure = createElement$1("div"); root2.ref.measure.style.height = "100%"; root2.element.appendChild(root2.ref.measure); root2.ref.bounds = null; root2.query("GET_STYLES").filter((style) => !isEmpty(style.value)).map(({name: name2, value}) => { root2.element.dataset[name2] = value; }); root2.ref.widthPrevious = null; root2.ref.widthUpdated = debounce(() => { root2.ref.updateHistory = []; root2.dispatch("DID_RESIZE_ROOT"); }, 250); root2.ref.previousAspectRatio = null; root2.ref.updateHistory = []; const canHover = window.matchMedia("(pointer: fine) and (hover: hover)").matches; const hasPointerEvents = "PointerEvent" in window; if (root2.query("GET_ALLOW_REORDER") && hasPointerEvents && !canHover) { root2.element.addEventListener("touchmove", prevent, {passive: false}); root2.element.addEventListener("gesturestart", prevent); } const credits = root2.query("GET_CREDITS"); const hasCredits = credits.length === 2; if (hasCredits) { const frag = document.createElement("a"); frag.className = "filepond--credits"; frag.setAttribute("aria-hidden", "true"); frag.href = credits[0]; frag.tabindex = -1; frag.target = "_blank"; frag.rel = "noopener noreferrer"; frag.textContent = credits[1]; root2.element.appendChild(frag); root2.ref.credits = frag; } }; var write$9 = ({root: root2, props, actions: actions2}) => { route$5({root: root2, props, actions: actions2}); actions2.filter((action) => /^DID_SET_STYLE_/.test(action.type)).filter((action) => !isEmpty(action.data.value)).map(({type, data: data3}) => { const name2 = toCamels(type.substring(8).toLowerCase(), "_"); root2.element.dataset[name2] = data3.value; root2.invalidateLayout(); }); if (root2.rect.element.hidden) return; if (root2.rect.element.width !== root2.ref.widthPrevious) { root2.ref.widthPrevious = root2.rect.element.width; root2.ref.widthUpdated(); } let bounds = root2.ref.bounds; if (!bounds) { bounds = root2.ref.bounds = calculateRootBoundingBoxHeight(root2); root2.element.removeChild(root2.ref.measure); root2.ref.measure = null; } const {hopper, label, list: list2, panel: panel2} = root2.ref; if (hopper) { hopper.updateHopperState(); } const aspectRatio = root2.query("GET_PANEL_ASPECT_RATIO"); const isMultiItem = root2.query("GET_ALLOW_MULTIPLE"); const totalItems = root2.query("GET_TOTAL_ITEMS"); const maxItems = isMultiItem ? root2.query("GET_MAX_FILES") || MAX_FILES_LIMIT : 1; const atMaxCapacity = totalItems === maxItems; const addAction = actions2.find((action) => action.type === "DID_ADD_ITEM"); if (atMaxCapacity && addAction) { const interactionMethod = addAction.data.interactionMethod; label.opacity = 0; if (isMultiItem) { label.translateY = -40; } else { if (interactionMethod === InteractionMethod.API) { label.translateX = 40; } else if (interactionMethod === InteractionMethod.BROWSE) { label.translateY = 40; } else { label.translateY = 30; } } } else if (!atMaxCapacity) { label.opacity = 1; label.translateX = 0; label.translateY = 0; } const listItemMargin = calculateListItemMargin(root2); const listHeight = calculateListHeight(root2); const labelHeight = label.rect.element.height; const currentLabelHeight = !isMultiItem || atMaxCapacity ? 0 : labelHeight; const listMarginTop = atMaxCapacity ? list2.rect.element.marginTop : 0; const listMarginBottom = totalItems === 0 ? 0 : list2.rect.element.marginBottom; const visualHeight = currentLabelHeight + listMarginTop + listHeight.visual + listMarginBottom; const boundsHeight = currentLabelHeight + listMarginTop + listHeight.bounds + listMarginBottom; list2.translateY = Math.max(0, currentLabelHeight - list2.rect.element.marginTop) - listItemMargin.top; if (aspectRatio) { const width = root2.rect.element.width; const height = width * aspectRatio; if (aspectRatio !== root2.ref.previousAspectRatio) { root2.ref.previousAspectRatio = aspectRatio; root2.ref.updateHistory = []; } const history = root2.ref.updateHistory; history.push(width); const MAX_BOUNCES = 2; if (history.length > MAX_BOUNCES * 2) { const l = history.length; const bottom = l - 10; let bounces = 0; for (let i = l; i >= bottom; i--) { if (history[i] === history[i - 2]) { bounces++; } if (bounces >= MAX_BOUNCES) { return; } } } panel2.scalable = false; panel2.height = height; const listAvailableHeight = height - currentLabelHeight - (listMarginBottom - listItemMargin.bottom) - (atMaxCapacity ? listMarginTop : 0); if (listHeight.visual > listAvailableHeight) { list2.overflow = listAvailableHeight; } else { list2.overflow = null; } root2.height = height; } else if (bounds.fixedHeight) { panel2.scalable = false; const listAvailableHeight = bounds.fixedHeight - currentLabelHeight - (listMarginBottom - listItemMargin.bottom) - (atMaxCapacity ? listMarginTop : 0); if (listHeight.visual > listAvailableHeight) { list2.overflow = listAvailableHeight; } else { list2.overflow = null; } } else if (bounds.cappedHeight) { const isCappedHeight = visualHeight >= bounds.cappedHeight; const panelHeight = Math.min(bounds.cappedHeight, visualHeight); panel2.scalable = true; panel2.height = isCappedHeight ? panelHeight : panelHeight - listItemMargin.top - listItemMargin.bottom; const listAvailableHeight = panelHeight - currentLabelHeight - (listMarginBottom - listItemMargin.bottom) - (atMaxCapacity ? listMarginTop : 0); if (visualHeight > bounds.cappedHeight && listHeight.visual > listAvailableHeight) { list2.overflow = listAvailableHeight; } else { list2.overflow = null; } root2.height = Math.min(bounds.cappedHeight, boundsHeight - listItemMargin.top - listItemMargin.bottom); } else { const itemMargin = totalItems > 0 ? listItemMargin.top + listItemMargin.bottom : 0; panel2.scalable = true; panel2.height = Math.max(labelHeight, visualHeight - itemMargin); root2.height = Math.max(labelHeight, boundsHeight - itemMargin); } if (root2.ref.credits && panel2.heightCurrent) root2.ref.credits.style.transform = `translateY(${panel2.heightCurrent}px)`; }; var calculateListItemMargin = (root2) => { const item2 = root2.ref.list.childViews[0].childViews[0]; return item2 ? { top: item2.rect.element.marginTop, bottom: item2.rect.element.marginBottom } : { top: 0, bottom: 0 }; }; var calculateListHeight = (root2) => { let visual = 0; let bounds = 0; const scrollList = root2.ref.list; const itemList = scrollList.childViews[0]; const visibleChildren = itemList.childViews.filter((child) => child.rect.element.height); const children = root2.query("GET_ACTIVE_ITEMS").map((item2) => visibleChildren.find((child) => child.id === item2.id)).filter((item2) => item2); if (children.length === 0) return {visual, bounds}; const horizontalSpace = itemList.rect.element.width; const dragIndex = getItemIndexByPosition(itemList, children, scrollList.dragCoordinates); const childRect = children[0].rect.element; const itemVerticalMargin = childRect.marginTop + childRect.marginBottom; const itemHorizontalMargin = childRect.marginLeft + childRect.marginRight; const itemWidth = childRect.width + itemHorizontalMargin; const itemHeight = childRect.height + itemVerticalMargin; const newItem = typeof dragIndex !== "undefined" && dragIndex >= 0 ? 1 : 0; const removedItem = children.find((child) => child.markedForRemoval && child.opacity < 0.45) ? -1 : 0; const verticalItemCount = children.length + newItem + removedItem; const itemsPerRow = getItemsPerRow(horizontalSpace, itemWidth); if (itemsPerRow === 1) { children.forEach((item2) => { const height = item2.rect.element.height + itemVerticalMargin; bounds += height; visual += height * item2.opacity; }); } else { bounds = Math.ceil(verticalItemCount / itemsPerRow) * itemHeight; visual = bounds; } return {visual, bounds}; }; var calculateRootBoundingBoxHeight = (root2) => { const height = root2.ref.measureHeight || null; const cappedHeight = parseInt(root2.style.maxHeight, 10) || null; const fixedHeight = height === 0 ? null : height; return { cappedHeight, fixedHeight }; }; var exceedsMaxFiles = (root2, items) => { const allowReplace = root2.query("GET_ALLOW_REPLACE"); const allowMultiple = root2.query("GET_ALLOW_MULTIPLE"); const totalItems = root2.query("GET_TOTAL_ITEMS"); let maxItems = root2.query("GET_MAX_FILES"); const totalBrowseItems = items.length; if (!allowMultiple && totalBrowseItems > 1) { root2.dispatch("DID_THROW_MAX_FILES", { source: items, error: createResponse("warning", 0, "Max files") }); return true; } maxItems = allowMultiple ? maxItems : 1; if (!allowMultiple && allowReplace) { return false; } const hasMaxItems = isInt(maxItems); if (hasMaxItems && totalItems + totalBrowseItems > maxItems) { root2.dispatch("DID_THROW_MAX_FILES", { source: items, error: createResponse("warning", 0, "Max files") }); return true; } return false; }; var getDragIndex = (list2, children, position) => { const itemList = list2.childViews[0]; return getItemIndexByPosition(itemList, children, { left: position.scopeLeft - itemList.rect.element.left, top: position.scopeTop - (list2.rect.outer.top + list2.rect.element.marginTop + list2.rect.element.scrollTop) }); }; var toggleDrop = (root2) => { const isAllowed = root2.query("GET_ALLOW_DROP"); const isDisabled = root2.query("GET_DISABLED"); const enabled = isAllowed && !isDisabled; if (enabled && !root2.ref.hopper) { const hopper = createHopper(root2.element, (items) => { const beforeDropFile = root2.query("GET_BEFORE_DROP_FILE") || (() => true); const dropValidation = root2.query("GET_DROP_VALIDATION"); return dropValidation ? items.every((item2) => applyFilters("ALLOW_HOPPER_ITEM", item2, { query: root2.query }).every((result) => result === true) && beforeDropFile(item2)) : true; }, { filterItems: (items) => { const ignoredFiles = root2.query("GET_IGNORED_FILES"); return items.filter((item2) => { if (isFile(item2)) { return !ignoredFiles.includes(item2.name.toLowerCase()); } return true; }); }, catchesDropsOnPage: root2.query("GET_DROP_ON_PAGE"), requiresDropOnElement: root2.query("GET_DROP_ON_ELEMENT") }); hopper.onload = (items, position) => { const list2 = root2.ref.list.childViews[0]; const visibleChildren = list2.childViews.filter((child) => child.rect.element.height); const children = root2.query("GET_ACTIVE_ITEMS").map((item2) => visibleChildren.find((child) => child.id === item2.id)).filter((item2) => item2); applyFilterChain("ADD_ITEMS", items, {dispatch: root2.dispatch}).then((queue) => { if (exceedsMaxFiles(root2, queue)) return false; root2.dispatch("ADD_ITEMS", { items: queue, index: getDragIndex(root2.ref.list, children, position), interactionMethod: InteractionMethod.DROP }); }); root2.dispatch("DID_DROP", {position}); root2.dispatch("DID_END_DRAG", {position}); }; hopper.ondragstart = (position) => { root2.dispatch("DID_START_DRAG", {position}); }; hopper.ondrag = debounce((position) => { root2.dispatch("DID_DRAG", {position}); }); hopper.ondragend = (position) => { root2.dispatch("DID_END_DRAG", {position}); }; root2.ref.hopper = hopper; root2.ref.drip = root2.appendChildView(root2.createChildView(drip)); } else if (!enabled && root2.ref.hopper) { root2.ref.hopper.destroy(); root2.ref.hopper = null; root2.removeChildView(root2.ref.drip); } }; var toggleBrowse = (root2, props) => { const isAllowed = root2.query("GET_ALLOW_BROWSE"); const isDisabled = root2.query("GET_DISABLED"); const enabled = isAllowed && !isDisabled; if (enabled && !root2.ref.browser) { root2.ref.browser = root2.appendChildView(root2.createChildView(browser, { ...props, onload: (items) => { applyFilterChain("ADD_ITEMS", items, { dispatch: root2.dispatch }).then((queue) => { if (exceedsMaxFiles(root2, queue)) return false; root2.dispatch("ADD_ITEMS", { items: queue, index: -1, interactionMethod: InteractionMethod.BROWSE }); }); } }), 0); } else if (!enabled && root2.ref.browser) { root2.removeChildView(root2.ref.browser); root2.ref.browser = null; } }; var togglePaste = (root2) => { const isAllowed = root2.query("GET_ALLOW_PASTE"); const isDisabled = root2.query("GET_DISABLED"); const enabled = isAllowed && !isDisabled; if (enabled && !root2.ref.paster) { root2.ref.paster = createPaster(); root2.ref.paster.onload = (items) => { applyFilterChain("ADD_ITEMS", items, {dispatch: root2.dispatch}).then((queue) => { if (exceedsMaxFiles(root2, queue)) return false; root2.dispatch("ADD_ITEMS", { items: queue, index: -1, interactionMethod: InteractionMethod.PASTE }); }); }; } else if (!enabled && root2.ref.paster) { root2.ref.paster.destroy(); root2.ref.paster = null; } }; var route$5 = createRoute({ DID_SET_ALLOW_BROWSE: ({root: root2, props}) => { toggleBrowse(root2, props); }, DID_SET_ALLOW_DROP: ({root: root2}) => { toggleDrop(root2); }, DID_SET_ALLOW_PASTE: ({root: root2}) => { togglePaste(root2); }, DID_SET_DISABLED: ({root: root2, props}) => { toggleDrop(root2); togglePaste(root2); toggleBrowse(root2, props); const isDisabled = root2.query("GET_DISABLED"); if (isDisabled) { root2.element.dataset.disabled = "disabled"; } else { root2.element.removeAttribute("data-disabled"); } } }); var root = createView({ name: "root", read: ({root: root2}) => { if (root2.ref.measure) { root2.ref.measureHeight = root2.ref.measure.offsetHeight; } }, create: create$e, write: write$9, destroy: ({root: root2}) => { if (root2.ref.paster) { root2.ref.paster.destroy(); } if (root2.ref.hopper) { root2.ref.hopper.destroy(); } root2.element.removeEventListener("touchmove", prevent); root2.element.removeEventListener("gesturestart", prevent); }, mixins: { styles: ["height"] } }); var createApp = (initialOptions = {}) => { let originalElement = null; const defaultOptions2 = getOptions(); const store = createStore(createInitialState(defaultOptions2), [queries, createOptionQueries(defaultOptions2)], [actions, createOptionActions(defaultOptions2)]); store.dispatch("SET_OPTIONS", {options: initialOptions}); const visibilityHandler = () => { if (document.hidden) return; store.dispatch("KICK"); }; document.addEventListener("visibilitychange", visibilityHandler); let resizeDoneTimer = null; let isResizing = false; let isResizingHorizontally = false; let initialWindowWidth = null; let currentWindowWidth = null; const resizeHandler = () => { if (!isResizing) { isResizing = true; } clearTimeout(resizeDoneTimer); resizeDoneTimer = setTimeout(() => { isResizing = false; initialWindowWidth = null; currentWindowWidth = null; if (isResizingHorizontally) { isResizingHorizontally = false; store.dispatch("DID_STOP_RESIZE"); } }, 500); }; window.addEventListener("resize", resizeHandler); const view = root(store, {id: getUniqueId()}); let isResting = false; let isHidden = false; const readWriteApi = { _read: () => { if (isResizing) { currentWindowWidth = window.innerWidth; if (!initialWindowWidth) { initialWindowWidth = currentWindowWidth; } if (!isResizingHorizontally && currentWindowWidth !== initialWindowWidth) { store.dispatch("DID_START_RESIZE"); isResizingHorizontally = true; } } if (isHidden && isResting) { isResting = view.element.offsetParent === null; } if (isResting) return; view._read(); isHidden = view.rect.element.hidden; }, _write: (ts) => { const actions2 = store.processActionQueue().filter((action) => !/^SET_/.test(action.type)); if (isResting && !actions2.length) return; routeActionsToEvents(actions2); isResting = view._write(ts, actions2, isResizingHorizontally); removeReleasedItems(store.query("GET_ITEMS")); if (isResting) { store.processDispatchQueue(); } } }; const createEvent = (name2) => (data3) => { const event = { type: name2 }; if (!data3) { return event; } if (data3.hasOwnProperty("error")) { event.error = data3.error ? {...data3.error} : null; } if (data3.status) { event.status = {...data3.status}; } if (data3.file) { event.output = data3.file; } if (data3.source) { event.file = data3.source; } else if (data3.item || data3.id) { const item2 = data3.item ? data3.item : store.query("GET_ITEM", data3.id); event.file = item2 ? createItemAPI(item2) : null; } if (data3.items) { event.items = data3.items.map(createItemAPI); } if (/progress/.test(name2)) { event.progress = data3.progress; } if (data3.hasOwnProperty("origin") && data3.hasOwnProperty("target")) { event.origin = data3.origin; event.target = data3.target; } return event; }; const eventRoutes = { DID_DESTROY: createEvent("destroy"), DID_INIT: createEvent("init"), DID_THROW_MAX_FILES: createEvent("warning"), DID_INIT_ITEM: createEvent("initfile"), DID_START_ITEM_LOAD: createEvent("addfilestart"), DID_UPDATE_ITEM_LOAD_PROGRESS: createEvent("addfileprogress"), DID_LOAD_ITEM: createEvent("addfile"), DID_THROW_ITEM_INVALID: [createEvent("error"), createEvent("addfile")], DID_THROW_ITEM_LOAD_ERROR: [createEvent("error"), createEvent("addfile")], DID_THROW_ITEM_REMOVE_ERROR: [createEvent("error"), createEvent("removefile")], DID_PREPARE_OUTPUT: createEvent("preparefile"), DID_START_ITEM_PROCESSING: createEvent("processfilestart"), DID_UPDATE_ITEM_PROCESS_PROGRESS: createEvent("processfileprogress"), DID_ABORT_ITEM_PROCESSING: createEvent("processfileabort"), DID_COMPLETE_ITEM_PROCESSING: createEvent("processfile"), DID_COMPLETE_ITEM_PROCESSING_ALL: createEvent("processfiles"), DID_REVERT_ITEM_PROCESSING: createEvent("processfilerevert"), DID_THROW_ITEM_PROCESSING_ERROR: [createEvent("error"), createEvent("processfile")], DID_REMOVE_ITEM: createEvent("removefile"), DID_UPDATE_ITEMS: createEvent("updatefiles"), DID_ACTIVATE_ITEM: createEvent("activatefile"), DID_REORDER_ITEMS: createEvent("reorderfiles") }; const exposeEvent = (event) => { const detail = {pond: exports, ...event}; delete detail.type; view.element.dispatchEvent(new CustomEvent(`FilePond:${event.type}`, { detail, bubbles: true, cancelable: true, composed: true })); const params = []; if (event.hasOwnProperty("error")) { params.push(event.error); } if (event.hasOwnProperty("file")) { params.push(event.file); } const filtered = ["type", "error", "file"]; Object.keys(event).filter((key) => !filtered.includes(key)).forEach((key) => params.push(event[key])); exports.fire(event.type, ...params); const handler = store.query(`GET_ON${event.type.toUpperCase()}`); if (handler) { handler(...params); } }; const routeActionsToEvents = (actions2) => { if (!actions2.length) return; actions2.filter((action) => eventRoutes[action.type]).forEach((action) => { const routes = eventRoutes[action.type]; (Array.isArray(routes) ? routes : [routes]).forEach((route2) => { if (action.type === "DID_INIT_ITEM") { exposeEvent(route2(action.data)); } else { setTimeout(() => { exposeEvent(route2(action.data)); }, 0); } }); }); }; const setOptions3 = (options2) => store.dispatch("SET_OPTIONS", {options: options2}); const getFile2 = (query) => store.query("GET_ACTIVE_ITEM", query); const prepareFile = (query) => new Promise((resolve, reject) => { store.dispatch("REQUEST_ITEM_PREPARE", { query, success: (item2) => { resolve(item2); }, failure: (error2) => { reject(error2); } }); }); const addFile = (source, options2 = {}) => new Promise((resolve, reject) => { addFiles([{source, options: options2}], {index: options2.index}).then((items) => resolve(items && items[0])).catch(reject); }); const isFilePondFile = (obj) => obj.file && obj.id; const removeFile = (query, options2) => { if (typeof query === "object" && !isFilePondFile(query) && !options2) { options2 = query; query = void 0; } store.dispatch("REMOVE_ITEM", {...options2, query}); return store.query("GET_ACTIVE_ITEM", query) === null; }; const addFiles = (...args) => new Promise((resolve, reject) => { const sources = []; const options2 = {}; if (isArray(args[0])) { sources.push.apply(sources, args[0]); Object.assign(options2, args[1] || {}); } else { const lastArgument = args[args.length - 1]; if (typeof lastArgument === "object" && !(lastArgument instanceof Blob)) { Object.assign(options2, args.pop()); } sources.push(...args); } store.dispatch("ADD_ITEMS", { items: sources, index: options2.index, interactionMethod: InteractionMethod.API, success: resolve, failure: reject }); }); const getFiles2 = () => store.query("GET_ACTIVE_ITEMS"); const processFile = (query) => new Promise((resolve, reject) => { store.dispatch("REQUEST_ITEM_PROCESSING", { query, success: (item2) => { resolve(item2); }, failure: (error2) => { reject(error2); } }); }); const prepareFiles = (...args) => { const queries2 = Array.isArray(args[0]) ? args[0] : args; const items = queries2.length ? queries2 : getFiles2(); return Promise.all(items.map(prepareFile)); }; const processFiles = (...args) => { const queries2 = Array.isArray(args[0]) ? args[0] : args; if (!queries2.length) { const files = getFiles2().filter((item2) => !(item2.status === ItemStatus.IDLE && item2.origin === FileOrigin.LOCAL) && item2.status !== ItemStatus.PROCESSING && item2.status !== ItemStatus.PROCESSING_COMPLETE && item2.status !== ItemStatus.PROCESSING_REVERT_ERROR); return Promise.all(files.map(processFile)); } return Promise.all(queries2.map(processFile)); }; const removeFiles = (...args) => { const queries2 = Array.isArray(args[0]) ? args[0] : args; let options2; if (typeof queries2[queries2.length - 1] === "object") { options2 = queries2.pop(); } else if (Array.isArray(args[0])) { options2 = args[1]; } const files = getFiles2(); if (!queries2.length) return Promise.all(files.map((file2) => removeFile(file2, options2))); const mappedQueries = queries2.map((query) => isNumber(query) ? files[query] ? files[query].id : null : query).filter((query) => query); return mappedQueries.map((q) => removeFile(q, options2)); }; const exports = { ...on(), ...readWriteApi, ...createOptionAPI(store, defaultOptions2), setOptions: setOptions3, addFile, addFiles, getFile: getFile2, processFile, prepareFile, removeFile, moveFile: (query, index2) => store.dispatch("MOVE_ITEM", {query, index: index2}), getFiles: getFiles2, processFiles, removeFiles, prepareFiles, sort: (compare) => store.dispatch("SORT", {compare}), browse: () => { var input = view.element.querySelector("input[type=file]"); if (input) { input.click(); } }, destroy: () => { exports.fire("destroy", view.element); store.dispatch("ABORT_ALL"); view._destroy(); window.removeEventListener("resize", resizeHandler); document.removeEventListener("visibilitychange", visibilityHandler); store.dispatch("DID_DESTROY"); }, insertBefore: (element) => insertBefore(view.element, element), insertAfter: (element) => insertAfter(view.element, element), appendTo: (element) => element.appendChild(view.element), replaceElement: (element) => { insertBefore(view.element, element); element.parentNode.removeChild(element); originalElement = element; }, restoreElement: () => { if (!originalElement) { return; } insertAfter(originalElement, view.element); view.element.parentNode.removeChild(view.element); originalElement = null; }, isAttachedTo: (element) => view.element === element || originalElement === element, element: { get: () => view.element }, status: { get: () => store.query("GET_STATUS") } }; store.dispatch("DID_INIT"); return createObject(exports); }; var createAppObject = (customOptions = {}) => { const defaultOptions2 = {}; forin(getOptions(), (key, value) => { defaultOptions2[key] = value[0]; }); const app = createApp({ ...defaultOptions2, ...customOptions }); return app; }; var lowerCaseFirstLetter = (string) => string.charAt(0).toLowerCase() + string.slice(1); var attributeNameToPropertyName = (attributeName) => toCamels(attributeName.replace(/^data-/, "")); var mapObject = (object, propertyMap) => { forin(propertyMap, (selector, mapping) => { forin(object, (property, value) => { const selectorRegExp = new RegExp(selector); const matches2 = selectorRegExp.test(property); if (!matches2) { return; } delete object[property]; if (mapping === false) { return; } if (isString(mapping)) { object[mapping] = value; return; } const group = mapping.group; if (isObject(mapping) && !object[group]) { object[group] = {}; } object[group][lowerCaseFirstLetter(property.replace(selectorRegExp, ""))] = value; }); if (mapping.mapping) { mapObject(object[mapping.group], mapping.mapping); } }); }; var getAttributesAsObject = (node, attributeMapping = {}) => { const attributes = []; forin(node.attributes, (index2) => { attributes.push(node.attributes[index2]); }); const output = attributes.filter((attribute) => attribute.name).reduce((obj, attribute) => { const value = attr(node, attribute.name); obj[attributeNameToPropertyName(attribute.name)] = value === attribute.name ? true : value; return obj; }, {}); mapObject(output, attributeMapping); return output; }; var createAppAtElement = (element, options2 = {}) => { const attributeMapping = { "^class$": "className", "^multiple$": "allowMultiple", "^capture$": "captureMethod", "^webkitdirectory$": "allowDirectoriesOnly", "^server": { group: "server", mapping: { "^process": { group: "process" }, "^revert": { group: "revert" }, "^fetch": { group: "fetch" }, "^restore": { group: "restore" }, "^load": { group: "load" } } }, "^type$": false, "^files$": false }; applyFilters("SET_ATTRIBUTE_TO_OPTION_MAP", attributeMapping); const mergedOptions = { ...options2 }; const attributeOptions = getAttributesAsObject(element.nodeName === "FIELDSET" ? element.querySelector("input[type=file]") : element, attributeMapping); Object.keys(attributeOptions).forEach((key) => { if (isObject(attributeOptions[key])) { if (!isObject(mergedOptions[key])) { mergedOptions[key] = {}; } Object.assign(mergedOptions[key], attributeOptions[key]); } else { mergedOptions[key] = attributeOptions[key]; } }); mergedOptions.files = (options2.files || []).concat(Array.from(element.querySelectorAll("input:not([type=file])")).map((input) => ({ source: input.value, options: { type: input.dataset.type } }))); const app = createAppObject(mergedOptions); if (element.files) { Array.from(element.files).forEach((file2) => { app.addFile(file2); }); } app.replaceElement(element); return app; }; var createApp$1 = (...args) => isNode(args[0]) ? createAppAtElement(...args) : createAppObject(...args); var PRIVATE_METHODS = ["fire", "_read", "_write"]; var createAppAPI = (app) => { const api = {}; copyObjectPropertiesToObject(app, api, PRIVATE_METHODS); return api; }; var replaceInString = (string, replacements) => string.replace(/(?:{([a-zA-Z]+)})/g, (match, group) => replacements[group]); var createWorker = (fn2) => { const workerBlob = new Blob(["(", fn2.toString(), ")()"], { type: "application/javascript" }); const workerURL = URL.createObjectURL(workerBlob); const worker = new Worker(workerURL); return { transfer: (message, cb) => { }, post: (message, cb, transferList) => { const id = getUniqueId(); worker.onmessage = (e2) => { if (e2.data.id === id) { cb(e2.data.message); } }; worker.postMessage({ id, message }, transferList); }, terminate: () => { worker.terminate(); URL.revokeObjectURL(workerURL); } }; }; var loadImage = (url) => new Promise((resolve, reject) => { const img = new Image(); img.onload = () => { resolve(img); }; img.onerror = (e2) => { reject(e2); }; img.src = url; }); var renameFile = (file2, name2) => { const renamedFile = file2.slice(0, file2.size, file2.type); renamedFile.lastModifiedDate = file2.lastModifiedDate; renamedFile.name = name2; return renamedFile; }; var copyFile = (file2) => renameFile(file2, file2.name); var registeredPlugins = []; var createAppPlugin = (plugin9) => { if (registeredPlugins.includes(plugin9)) { return; } registeredPlugins.push(plugin9); const pluginOutline = plugin9({ addFilter, utils: { Type, forin, isString, isFile, toNaturalFileSize, replaceInString, getExtensionFromFilename, getFilenameWithoutExtension, guesstimateMimeType, getFileFromBlob, getFilenameFromURL, createRoute, createWorker, createView, createItemAPI, loadImage, copyFile, renameFile, createBlob, applyFilterChain, text, getNumericAspectRatioFromString }, views: { fileActionButton } }); extendDefaultOptions(pluginOutline.options); }; var isOperaMini = () => Object.prototype.toString.call(window.operamini) === "[object OperaMini]"; var hasPromises = () => "Promise" in window; var hasBlobSlice = () => "slice" in Blob.prototype; var hasCreateObjectURL = () => "URL" in window && "createObjectURL" in window.URL; var hasVisibility = () => "visibilityState" in document; var hasTiming = () => "performance" in window; var hasCSSSupports = () => "supports" in (window.CSS || {}); var isIE11 = () => /MSIE|Trident/.test(window.navigator.userAgent); var supported = (() => { const isSupported = isBrowser() && !isOperaMini() && hasVisibility() && hasPromises() && hasBlobSlice() && hasCreateObjectURL() && hasTiming() && (hasCSSSupports() || isIE11()); return () => isSupported; })(); var state = { apps: [] }; var name = "filepond"; var fn = () => { }; var Status$1 = {}; var FileStatus = {}; var FileOrigin$1 = {}; var OptionTypes = {}; var create$f = fn; var destroy = fn; var parse = fn; var find = fn; var registerPlugin = fn; var getOptions$1 = fn; var setOptions$1 = fn; if (supported()) { createPainter(() => { state.apps.forEach((app) => app._read()); }, (ts) => { state.apps.forEach((app) => app._write(ts)); }); const dispatch = () => { document.dispatchEvent(new CustomEvent("FilePond:loaded", { detail: { supported, create: create$f, destroy, parse, find, registerPlugin, setOptions: setOptions$1 } })); document.removeEventListener("DOMContentLoaded", dispatch); }; if (document.readyState !== "loading") { setTimeout(() => dispatch(), 0); } else { document.addEventListener("DOMContentLoaded", dispatch); } const updateOptionTypes = () => forin(getOptions(), (key, value) => { OptionTypes[key] = value[1]; }); Status$1 = {...Status}; FileOrigin$1 = {...FileOrigin}; FileStatus = {...ItemStatus}; OptionTypes = {}; updateOptionTypes(); create$f = (...args) => { const app = createApp$1(...args); app.on("destroy", destroy); state.apps.push(app); return createAppAPI(app); }; destroy = (hook) => { const indexToRemove = state.apps.findIndex((app) => app.isAttachedTo(hook)); if (indexToRemove >= 0) { const app = state.apps.splice(indexToRemove, 1)[0]; app.restoreElement(); return true; } return false; }; parse = (context) => { const matchedHooks = Array.from(context.querySelectorAll(`.${name}`)); const newHooks = matchedHooks.filter((newHook) => !state.apps.find((app) => app.isAttachedTo(newHook))); return newHooks.map((hook) => create$f(hook)); }; find = (hook) => { const app = state.apps.find((app2) => app2.isAttachedTo(hook)); if (!app) { return null; } return createAppAPI(app); }; registerPlugin = (...plugins2) => { plugins2.forEach(createAppPlugin); updateOptionTypes(); }; getOptions$1 = () => { const opts = {}; forin(getOptions(), (key, value) => { opts[key] = value[0]; }); return opts; }; setOptions$1 = (opts) => { if (isObject(opts)) { state.apps.forEach((app) => { app.setOptions(opts); }); setOptions(opts); } return getOptions$1(); }; } // node_modules/filepond-plugin-file-validate-size/dist/filepond-plugin-file-validate-size.esm.js /*! * FilePondPluginFileValidateSize 2.2.8 * Licensed under MIT, https://opensource.org/licenses/MIT/ * Please visit https://pqina.nl/filepond/ for details. */ var plugin = ({addFilter: addFilter2, utils}) => { const {Type: Type2, replaceInString: replaceInString2, toNaturalFileSize: toNaturalFileSize2} = utils; addFilter2("ALLOW_HOPPER_ITEM", (file2, {query}) => { if (!query("GET_ALLOW_FILE_SIZE_VALIDATION")) { return true; } const sizeMax = query("GET_MAX_FILE_SIZE"); if (sizeMax !== null && file2.size > sizeMax) { return false; } const sizeMin = query("GET_MIN_FILE_SIZE"); if (sizeMin !== null && file2.size < sizeMin) { return false; } return true; }); addFilter2("LOAD_FILE", (file2, {query}) => new Promise((resolve, reject) => { if (!query("GET_ALLOW_FILE_SIZE_VALIDATION")) { return resolve(file2); } const fileFilter = query("GET_FILE_VALIDATE_SIZE_FILTER"); if (fileFilter && !fileFilter(file2)) { return resolve(file2); } const sizeMax = query("GET_MAX_FILE_SIZE"); if (sizeMax !== null && file2.size > sizeMax) { reject({ status: { main: query("GET_LABEL_MAX_FILE_SIZE_EXCEEDED"), sub: replaceInString2(query("GET_LABEL_MAX_FILE_SIZE"), { filesize: toNaturalFileSize2(sizeMax, ".", query("GET_FILE_SIZE_BASE"), query("GET_FILE_SIZE_LABELS", query)) }) } }); return; } const sizeMin = query("GET_MIN_FILE_SIZE"); if (sizeMin !== null && file2.size < sizeMin) { reject({ status: { main: query("GET_LABEL_MIN_FILE_SIZE_EXCEEDED"), sub: replaceInString2(query("GET_LABEL_MIN_FILE_SIZE"), { filesize: toNaturalFileSize2(sizeMin, ".", query("GET_FILE_SIZE_BASE"), query("GET_FILE_SIZE_LABELS", query)) }) } }); return; } const totalSizeMax = query("GET_MAX_TOTAL_FILE_SIZE"); if (totalSizeMax !== null) { const currentTotalSize = query("GET_ACTIVE_ITEMS").reduce((total, item2) => { return total + item2.fileSize; }, 0); if (currentTotalSize > totalSizeMax) { reject({ status: { main: query("GET_LABEL_MAX_TOTAL_FILE_SIZE_EXCEEDED"), sub: replaceInString2(query("GET_LABEL_MAX_TOTAL_FILE_SIZE"), { filesize: toNaturalFileSize2(totalSizeMax, ".", query("GET_FILE_SIZE_BASE"), query("GET_FILE_SIZE_LABELS", query)) }) } }); return; } } resolve(file2); })); return { options: { allowFileSizeValidation: [true, Type2.BOOLEAN], maxFileSize: [null, Type2.INT], minFileSize: [null, Type2.INT], maxTotalFileSize: [null, Type2.INT], fileValidateSizeFilter: [null, Type2.FUNCTION], labelMinFileSizeExceeded: ["File is too small", Type2.STRING], labelMinFileSize: ["Minimum file size is {filesize}", Type2.STRING], labelMaxFileSizeExceeded: ["File is too large", Type2.STRING], labelMaxFileSize: ["Maximum file size is {filesize}", Type2.STRING], labelMaxTotalFileSizeExceeded: ["Maximum total size exceeded", Type2.STRING], labelMaxTotalFileSize: ["Maximum total file size is {filesize}", Type2.STRING] } }; }; var isBrowser2 = typeof window !== "undefined" && typeof window.document !== "undefined"; if (isBrowser2) { document.dispatchEvent(new CustomEvent("FilePond:pluginloaded", {detail: plugin})); } var filepond_plugin_file_validate_size_esm_default = plugin; // node_modules/filepond-plugin-file-validate-type/dist/filepond-plugin-file-validate-type.esm.js /*! * FilePondPluginFileValidateType 1.2.8 * Licensed under MIT, https://opensource.org/licenses/MIT/ * Please visit https://pqina.nl/filepond/ for details. */ var plugin2 = ({addFilter: addFilter2, utils}) => { const { Type: Type2, isString: isString3, replaceInString: replaceInString2, guesstimateMimeType: guesstimateMimeType2, getExtensionFromFilename: getExtensionFromFilename2, getFilenameFromURL: getFilenameFromURL2 } = utils; const mimeTypeMatchesWildCard = (mimeType, wildcard) => { const mimeTypeGroup = (/^[^/]+/.exec(mimeType) || []).pop(); const wildcardGroup = wildcard.slice(0, -2); return mimeTypeGroup === wildcardGroup; }; const isValidMimeType = (acceptedTypes, userInputType) => acceptedTypes.some((acceptedType) => { if (/\*$/.test(acceptedType)) { return mimeTypeMatchesWildCard(userInputType, acceptedType); } return acceptedType === userInputType; }); const getItemType = (item2) => { let type = ""; if (isString3(item2)) { const filename = getFilenameFromURL2(item2); const extension = getExtensionFromFilename2(filename); if (extension) { type = guesstimateMimeType2(extension); } } else { type = item2.type; } return type; }; const validateFile = (item2, acceptedFileTypes, typeDetector) => { if (acceptedFileTypes.length === 0) { return true; } const type = getItemType(item2); if (!typeDetector) { return isValidMimeType(acceptedFileTypes, type); } return new Promise((resolve, reject) => { typeDetector(item2, type).then((detectedType) => { if (isValidMimeType(acceptedFileTypes, detectedType)) { resolve(); } else { reject(); } }).catch(reject); }); }; const applyMimeTypeMap = (map2) => (acceptedFileType) => map2[acceptedFileType] === null ? false : map2[acceptedFileType] || acceptedFileType; addFilter2("SET_ATTRIBUTE_TO_OPTION_MAP", (map2) => Object.assign(map2, { accept: "acceptedFileTypes" })); addFilter2("ALLOW_HOPPER_ITEM", (file2, {query}) => { if (!query("GET_ALLOW_FILE_TYPE_VALIDATION")) { return true; } return validateFile(file2, query("GET_ACCEPTED_FILE_TYPES")); }); addFilter2("LOAD_FILE", (file2, {query}) => new Promise((resolve, reject) => { if (!query("GET_ALLOW_FILE_TYPE_VALIDATION")) { resolve(file2); return; } const acceptedFileTypes = query("GET_ACCEPTED_FILE_TYPES"); const typeDetector = query("GET_FILE_VALIDATE_TYPE_DETECT_TYPE"); const validationResult = validateFile(file2, acceptedFileTypes, typeDetector); const handleRejection = () => { const acceptedFileTypesMapped = acceptedFileTypes.map(applyMimeTypeMap(query("GET_FILE_VALIDATE_TYPE_LABEL_EXPECTED_TYPES_MAP"))).filter((label) => label !== false); const acceptedFileTypesMapped_unique = acceptedFileTypesMapped.filter(function(item2, index2) { return acceptedFileTypesMapped.indexOf(item2) === index2; }); reject({ status: { main: query("GET_LABEL_FILE_TYPE_NOT_ALLOWED"), sub: replaceInString2(query("GET_FILE_VALIDATE_TYPE_LABEL_EXPECTED_TYPES"), { allTypes: acceptedFileTypesMapped_unique.join(", "), allButLastType: acceptedFileTypesMapped_unique.slice(0, -1).join(", "), lastType: acceptedFileTypesMapped_unique[acceptedFileTypesMapped.length - 1] }) } }); }; if (typeof validationResult === "boolean") { if (!validationResult) { return handleRejection(); } return resolve(file2); } validationResult.then(() => { resolve(file2); }).catch(handleRejection); })); return { options: { allowFileTypeValidation: [true, Type2.BOOLEAN], acceptedFileTypes: [[], Type2.ARRAY], labelFileTypeNotAllowed: ["File is of invalid type", Type2.STRING], fileValidateTypeLabelExpectedTypes: [ "Expects {allButLastType} or {lastType}", Type2.STRING ], fileValidateTypeLabelExpectedTypesMap: [{}, Type2.OBJECT], fileValidateTypeDetectType: [null, Type2.FUNCTION] } }; }; var isBrowser3 = typeof window !== "undefined" && typeof window.document !== "undefined"; if (isBrowser3) { document.dispatchEvent(new CustomEvent("FilePond:pluginloaded", {detail: plugin2})); } var filepond_plugin_file_validate_type_esm_default = plugin2; // node_modules/filepond-plugin-image-crop/dist/filepond-plugin-image-crop.esm.js /*! * FilePondPluginImageCrop 2.0.6 * Licensed under MIT, https://opensource.org/licenses/MIT/ * Please visit https://pqina.nl/filepond/ for details. */ var isImage = (file2) => /^image/.test(file2.type); var plugin3 = ({addFilter: addFilter2, utils}) => { const {Type: Type2, isFile: isFile2, getNumericAspectRatioFromString: getNumericAspectRatioFromString2} = utils; const allowCrop = (item2, query) => !(!isImage(item2.file) || !query("GET_ALLOW_IMAGE_CROP")); const isObject2 = (value) => typeof value === "object"; const isNumber2 = (value) => typeof value === "number"; const updateCrop = (item2, obj) => item2.setMetadata("crop", Object.assign({}, item2.getMetadata("crop"), obj)); addFilter2("DID_CREATE_ITEM", (item2, {query}) => { item2.extend("setImageCrop", (crop) => { if (!allowCrop(item2, query) || !isObject2(center)) return; item2.setMetadata("crop", crop); return crop; }); item2.extend("setImageCropCenter", (center2) => { if (!allowCrop(item2, query) || !isObject2(center2)) return; return updateCrop(item2, {center: center2}); }); item2.extend("setImageCropZoom", (zoom) => { if (!allowCrop(item2, query) || !isNumber2(zoom)) return; return updateCrop(item2, {zoom: Math.max(1, zoom)}); }); item2.extend("setImageCropRotation", (rotation) => { if (!allowCrop(item2, query) || !isNumber2(rotation)) return; return updateCrop(item2, {rotation}); }); item2.extend("setImageCropFlip", (flip2) => { if (!allowCrop(item2, query) || !isObject2(flip2)) return; return updateCrop(item2, {flip: flip2}); }); item2.extend("setImageCropAspectRatio", (newAspectRatio) => { if (!allowCrop(item2, query) || typeof newAspectRatio === "undefined") return; const currentCrop = item2.getMetadata("crop"); const aspectRatio = getNumericAspectRatioFromString2(newAspectRatio); const newCrop = { center: { x: 0.5, y: 0.5 }, flip: currentCrop ? Object.assign({}, currentCrop.flip) : { horizontal: false, vertical: false }, rotation: 0, zoom: 1, aspectRatio }; item2.setMetadata("crop", newCrop); return newCrop; }); }); addFilter2("DID_LOAD_ITEM", (item2, {query}) => new Promise((resolve, reject) => { const file2 = item2.file; if (!isFile2(file2) || !isImage(file2) || !query("GET_ALLOW_IMAGE_CROP")) { return resolve(item2); } const crop = item2.getMetadata("crop"); if (crop) { return resolve(item2); } const humanAspectRatio = query("GET_IMAGE_CROP_ASPECT_RATIO"); item2.setMetadata("crop", { center: { x: 0.5, y: 0.5 }, flip: { horizontal: false, vertical: false }, rotation: 0, zoom: 1, aspectRatio: humanAspectRatio ? getNumericAspectRatioFromString2(humanAspectRatio) : null }); resolve(item2); })); return { options: { allowImageCrop: [true, Type2.BOOLEAN], imageCropAspectRatio: [null, Type2.STRING] } }; }; var isBrowser4 = typeof window !== "undefined" && typeof window.document !== "undefined"; if (isBrowser4) { document.dispatchEvent(new CustomEvent("FilePond:pluginloaded", {detail: plugin3})); } var filepond_plugin_image_crop_esm_default = plugin3; // node_modules/filepond-plugin-image-exif-orientation/dist/filepond-plugin-image-exif-orientation.esm.js /*! * FilePondPluginImageExifOrientation 1.0.11 * Licensed under MIT, https://opensource.org/licenses/MIT/ * Please visit https://pqina.nl/filepond/ for details. */ var isJPEG = (file2) => /^image\/jpeg/.test(file2.type); var Marker = { JPEG: 65496, APP1: 65505, EXIF: 1165519206, TIFF: 18761, Orientation: 274, Unknown: 65280 }; var getUint16 = (view, offset2, little = false) => view.getUint16(offset2, little); var getUint32 = (view, offset2, little = false) => view.getUint32(offset2, little); var getImageOrientation = (file2) => new Promise((resolve, reject) => { const reader = new FileReader(); reader.onload = function(e2) { const view = new DataView(e2.target.result); if (getUint16(view, 0) !== Marker.JPEG) { resolve(-1); return; } const length = view.byteLength; let offset2 = 2; while (offset2 < length) { const marker = getUint16(view, offset2); offset2 += 2; if (marker === Marker.APP1) { if (getUint32(view, offset2 += 2) !== Marker.EXIF) { break; } const little = getUint16(view, offset2 += 6) === Marker.TIFF; offset2 += getUint32(view, offset2 + 4, little); const tags = getUint16(view, offset2, little); offset2 += 2; for (let i = 0; i < tags; i++) { if (getUint16(view, offset2 + i * 12, little) === Marker.Orientation) { resolve(getUint16(view, offset2 + i * 12 + 8, little)); return; } } } else if ((marker & Marker.Unknown) !== Marker.Unknown) { break; } else { offset2 += getUint16(view, offset2); } } resolve(-1); }; reader.readAsArrayBuffer(file2.slice(0, 64 * 1024)); }); var IS_BROWSER2 = (() => typeof window !== "undefined" && typeof window.document !== "undefined")(); var isBrowser5 = () => IS_BROWSER2; var testSrc = "data:image/jpg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4QA6RXhpZgAATU0AKgAAAAgAAwESAAMAAAABAAYAAAEoAAMAAAABAAIAAAITAAMAAAABAAEAAAAAAAD/2wBDAP//////////////////////////////////////////////////////////////////////////////////////wAALCAABAAIBASIA/8QAJgABAAAAAAAAAAAAAAAAAAAAAxABAAAAAAAAAAAAAAAAAAAAAP/aAAgBAQAAPwBH/9k="; var shouldCorrect = void 0; var testImage = isBrowser5() ? new Image() : {}; testImage.onload = () => shouldCorrect = testImage.naturalWidth > testImage.naturalHeight; testImage.src = testSrc; var shouldCorrectImageExifOrientation = () => shouldCorrect; var plugin4 = ({addFilter: addFilter2, utils}) => { const {Type: Type2, isFile: isFile2} = utils; addFilter2("DID_LOAD_ITEM", (item2, {query}) => new Promise((resolve, reject) => { const file2 = item2.file; if (!isFile2(file2) || !isJPEG(file2) || !query("GET_ALLOW_IMAGE_EXIF_ORIENTATION") || !shouldCorrectImageExifOrientation()) { return resolve(item2); } getImageOrientation(file2).then((orientation) => { item2.setMetadata("exif", {orientation}); resolve(item2); }); })); return { options: { allowImageExifOrientation: [true, Type2.BOOLEAN] } }; }; var isBrowser$1 = typeof window !== "undefined" && typeof window.document !== "undefined"; if (isBrowser$1) { document.dispatchEvent(new CustomEvent("FilePond:pluginloaded", {detail: plugin4})); } var filepond_plugin_image_exif_orientation_esm_default = plugin4; // node_modules/filepond-plugin-image-preview/dist/filepond-plugin-image-preview.esm.js /*! * FilePondPluginImagePreview 4.6.11 * Licensed under MIT, https://opensource.org/licenses/MIT/ * Please visit https://pqina.nl/filepond/ for details. */ var isPreviewableImage = (file2) => /^image/.test(file2.type); var vectorMultiply = (v, amount) => createVector(v.x * amount, v.y * amount); var vectorAdd = (a2, b) => createVector(a2.x + b.x, a2.y + b.y); var vectorNormalize = (v) => { const l = Math.sqrt(v.x * v.x + v.y * v.y); if (l === 0) { return { x: 0, y: 0 }; } return createVector(v.x / l, v.y / l); }; var vectorRotate = (v, radians, origin) => { const cos = Math.cos(radians); const sin = Math.sin(radians); const t2 = createVector(v.x - origin.x, v.y - origin.y); return createVector(origin.x + cos * t2.x - sin * t2.y, origin.y + sin * t2.x + cos * t2.y); }; var createVector = (x = 0, y = 0) => ({x, y}); var getMarkupValue = (value, size2, scalar = 1, axis) => { if (typeof value === "string") { return parseFloat(value) * scalar; } if (typeof value === "number") { return value * (axis ? size2[axis] : Math.min(size2.width, size2.height)); } return; }; var getMarkupStyles = (markup, size2, scale) => { const lineStyle = markup.borderStyle || markup.lineStyle || "solid"; const fill = markup.backgroundColor || markup.fontColor || "transparent"; const stroke = markup.borderColor || markup.lineColor || "transparent"; const strokeWidth = getMarkupValue(markup.borderWidth || markup.lineWidth, size2, scale); const lineCap = markup.lineCap || "round"; const lineJoin = markup.lineJoin || "round"; const dashes = typeof lineStyle === "string" ? "" : lineStyle.map((v) => getMarkupValue(v, size2, scale)).join(","); const opacity = markup.opacity || 1; return { "stroke-linecap": lineCap, "stroke-linejoin": lineJoin, "stroke-width": strokeWidth || 0, "stroke-dasharray": dashes, stroke, fill, opacity }; }; var isDefined2 = (value) => value != null; var getMarkupRect = (rect, size2, scalar = 1) => { let left = getMarkupValue(rect.x, size2, scalar, "width") || getMarkupValue(rect.left, size2, scalar, "width"); let top = getMarkupValue(rect.y, size2, scalar, "height") || getMarkupValue(rect.top, size2, scalar, "height"); let width = getMarkupValue(rect.width, size2, scalar, "width"); let height = getMarkupValue(rect.height, size2, scalar, "height"); let right = getMarkupValue(rect.right, size2, scalar, "width"); let bottom = getMarkupValue(rect.bottom, size2, scalar, "height"); if (!isDefined2(top)) { if (isDefined2(height) && isDefined2(bottom)) { top = size2.height - height - bottom; } else { top = bottom; } } if (!isDefined2(left)) { if (isDefined2(width) && isDefined2(right)) { left = size2.width - width - right; } else { left = right; } } if (!isDefined2(width)) { if (isDefined2(left) && isDefined2(right)) { width = size2.width - left - right; } else { width = 0; } } if (!isDefined2(height)) { if (isDefined2(top) && isDefined2(bottom)) { height = size2.height - top - bottom; } else { height = 0; } } return { x: left || 0, y: top || 0, width: width || 0, height: height || 0 }; }; var pointsToPathShape = (points) => points.map((point, index2) => `${index2 === 0 ? "M" : "L"} ${point.x} ${point.y}`).join(" "); var setAttributes = (element, attr2) => Object.keys(attr2).forEach((key) => element.setAttribute(key, attr2[key])); var ns2 = "http://www.w3.org/2000/svg"; var svg = (tag, attr2) => { const element = document.createElementNS(ns2, tag); if (attr2) { setAttributes(element, attr2); } return element; }; var updateRect2 = (element) => setAttributes(element, { ...element.rect, ...element.styles }); var updateEllipse = (element) => { const cx = element.rect.x + element.rect.width * 0.5; const cy = element.rect.y + element.rect.height * 0.5; const rx = element.rect.width * 0.5; const ry = element.rect.height * 0.5; return setAttributes(element, { cx, cy, rx, ry, ...element.styles }); }; var IMAGE_FIT_STYLE = { contain: "xMidYMid meet", cover: "xMidYMid slice" }; var updateImage = (element, markup) => { setAttributes(element, { ...element.rect, ...element.styles, preserveAspectRatio: IMAGE_FIT_STYLE[markup.fit] || "none" }); }; var TEXT_ANCHOR = { left: "start", center: "middle", right: "end" }; var updateText = (element, markup, size2, scale) => { const fontSize = getMarkupValue(markup.fontSize, size2, scale); const fontFamily = markup.fontFamily || "sans-serif"; const fontWeight = markup.fontWeight || "normal"; const textAlign = TEXT_ANCHOR[markup.textAlign] || "start"; setAttributes(element, { ...element.rect, ...element.styles, "stroke-width": 0, "font-weight": fontWeight, "font-size": fontSize, "font-family": fontFamily, "text-anchor": textAlign }); if (element.text !== markup.text) { element.text = markup.text; element.textContent = markup.text.length ? markup.text : " "; } }; var updateLine = (element, markup, size2, scale) => { setAttributes(element, { ...element.rect, ...element.styles, fill: "none" }); const line = element.childNodes[0]; const begin = element.childNodes[1]; const end = element.childNodes[2]; const origin = element.rect; const target = { x: element.rect.x + element.rect.width, y: element.rect.y + element.rect.height }; setAttributes(line, { x1: origin.x, y1: origin.y, x2: target.x, y2: target.y }); if (!markup.lineDecoration) return; begin.style.display = "none"; end.style.display = "none"; const v = vectorNormalize({ x: target.x - origin.x, y: target.y - origin.y }); const l = getMarkupValue(0.05, size2, scale); if (markup.lineDecoration.indexOf("arrow-begin") !== -1) { const arrowBeginRotationPoint = vectorMultiply(v, l); const arrowBeginCenter = vectorAdd(origin, arrowBeginRotationPoint); const arrowBeginA = vectorRotate(origin, 2, arrowBeginCenter); const arrowBeginB = vectorRotate(origin, -2, arrowBeginCenter); setAttributes(begin, { style: "display:block;", d: `M${arrowBeginA.x},${arrowBeginA.y} L${origin.x},${origin.y} L${arrowBeginB.x},${arrowBeginB.y}` }); } if (markup.lineDecoration.indexOf("arrow-end") !== -1) { const arrowEndRotationPoint = vectorMultiply(v, -l); const arrowEndCenter = vectorAdd(target, arrowEndRotationPoint); const arrowEndA = vectorRotate(target, 2, arrowEndCenter); const arrowEndB = vectorRotate(target, -2, arrowEndCenter); setAttributes(end, { style: "display:block;", d: `M${arrowEndA.x},${arrowEndA.y} L${target.x},${target.y} L${arrowEndB.x},${arrowEndB.y}` }); } }; var updatePath = (element, markup, size2, scale) => { setAttributes(element, { ...element.styles, fill: "none", d: pointsToPathShape(markup.points.map((point) => ({ x: getMarkupValue(point.x, size2, scale, "width"), y: getMarkupValue(point.y, size2, scale, "height") }))) }); }; var createShape = (node) => (markup) => svg(node, {id: markup.id}); var createImage = (markup) => { const shape = svg("image", { id: markup.id, "stroke-linecap": "round", "stroke-linejoin": "round", opacity: "0" }); shape.onload = () => { shape.setAttribute("opacity", markup.opacity || 1); }; shape.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:href", markup.src); return shape; }; var createLine = (markup) => { const shape = svg("g", { id: markup.id, "stroke-linecap": "round", "stroke-linejoin": "round" }); const line = svg("line"); shape.appendChild(line); const begin = svg("path"); shape.appendChild(begin); const end = svg("path"); shape.appendChild(end); return shape; }; var CREATE_TYPE_ROUTES = { image: createImage, rect: createShape("rect"), ellipse: createShape("ellipse"), text: createShape("text"), path: createShape("path"), line: createLine }; var UPDATE_TYPE_ROUTES = { rect: updateRect2, ellipse: updateEllipse, image: updateImage, text: updateText, path: updatePath, line: updateLine }; var createMarkupByType = (type, markup) => CREATE_TYPE_ROUTES[type](markup); var updateMarkupByType = (element, type, markup, size2, scale) => { if (type !== "path") { element.rect = getMarkupRect(markup, size2, scale); } element.styles = getMarkupStyles(markup, size2, scale); UPDATE_TYPE_ROUTES[type](element, markup, size2, scale); }; var MARKUP_RECT = [ "x", "y", "left", "top", "right", "bottom", "width", "height" ]; var toOptionalFraction = (value) => typeof value === "string" && /%/.test(value) ? parseFloat(value) / 100 : value; var prepareMarkup = (markup) => { const [type, props] = markup; const rect = props.points ? {} : MARKUP_RECT.reduce((prev, curr) => { prev[curr] = toOptionalFraction(props[curr]); return prev; }, {}); return [ type, { zIndex: 0, ...props, ...rect } ]; }; var sortMarkupByZIndex = (a2, b) => { if (a2[1].zIndex > b[1].zIndex) { return 1; } if (a2[1].zIndex < b[1].zIndex) { return -1; } return 0; }; var createMarkupView = (_) => _.utils.createView({ name: "image-preview-markup", tag: "svg", ignoreRect: true, mixins: { apis: ["width", "height", "crop", "markup", "resize", "dirty"] }, write: ({root: root2, props}) => { if (!props.dirty) return; const {crop, resize, markup} = props; const viewWidth = props.width; const viewHeight = props.height; let cropWidth = crop.width; let cropHeight = crop.height; if (resize) { const {size: size3} = resize; let outputWidth = size3 && size3.width; let outputHeight = size3 && size3.height; const outputFit = resize.mode; const outputUpscale = resize.upscale; if (outputWidth && !outputHeight) outputHeight = outputWidth; if (outputHeight && !outputWidth) outputWidth = outputHeight; const shouldUpscale = cropWidth < outputWidth && cropHeight < outputHeight; if (!shouldUpscale || shouldUpscale && outputUpscale) { let scalarWidth = outputWidth / cropWidth; let scalarHeight = outputHeight / cropHeight; if (outputFit === "force") { cropWidth = outputWidth; cropHeight = outputHeight; } else { let scalar; if (outputFit === "cover") { scalar = Math.max(scalarWidth, scalarHeight); } else if (outputFit === "contain") { scalar = Math.min(scalarWidth, scalarHeight); } cropWidth = cropWidth * scalar; cropHeight = cropHeight * scalar; } } } const size2 = { width: viewWidth, height: viewHeight }; root2.element.setAttribute("width", size2.width); root2.element.setAttribute("height", size2.height); const scale = Math.min(viewWidth / cropWidth, viewHeight / cropHeight); root2.element.innerHTML = ""; const markupFilter = root2.query("GET_IMAGE_PREVIEW_MARKUP_FILTER"); markup.filter(markupFilter).map(prepareMarkup).sort(sortMarkupByZIndex).forEach((markup2) => { const [type, settings] = markup2; const element = createMarkupByType(type, settings); updateMarkupByType(element, type, settings, size2, scale); root2.element.appendChild(element); }); } }); var createVector$1 = (x, y) => ({x, y}); var vectorDot = (a2, b) => a2.x * b.x + a2.y * b.y; var vectorSubtract = (a2, b) => createVector$1(a2.x - b.x, a2.y - b.y); var vectorDistanceSquared = (a2, b) => vectorDot(vectorSubtract(a2, b), vectorSubtract(a2, b)); var vectorDistance = (a2, b) => Math.sqrt(vectorDistanceSquared(a2, b)); var getOffsetPointOnEdge = (length, rotation) => { const a2 = length; const A = 1.5707963267948966; const B = rotation; const C3 = 1.5707963267948966 - rotation; const sinA = Math.sin(A); const sinB = Math.sin(B); const sinC = Math.sin(C3); const cosC = Math.cos(C3); const ratio = a2 / sinA; const b = ratio * sinB; const c2 = ratio * sinC; return createVector$1(cosC * b, cosC * c2); }; var getRotatedRectSize = (rect, rotation) => { const w = rect.width; const h = rect.height; const hor = getOffsetPointOnEdge(w, rotation); const ver = getOffsetPointOnEdge(h, rotation); const tl = createVector$1(rect.x + Math.abs(hor.x), rect.y - Math.abs(hor.y)); const tr = createVector$1(rect.x + rect.width + Math.abs(ver.y), rect.y + Math.abs(ver.x)); const bl = createVector$1(rect.x - Math.abs(ver.y), rect.y + rect.height - Math.abs(ver.x)); return { width: vectorDistance(tl, tr), height: vectorDistance(tl, bl) }; }; var calculateCanvasSize = (image, canvasAspectRatio, zoom = 1) => { const imageAspectRatio = image.height / image.width; let canvasWidth = 1; let canvasHeight = canvasAspectRatio; let imgWidth = 1; let imgHeight = imageAspectRatio; if (imgHeight > canvasHeight) { imgHeight = canvasHeight; imgWidth = imgHeight / imageAspectRatio; } const scalar = Math.max(canvasWidth / imgWidth, canvasHeight / imgHeight); const width = image.width / (zoom * scalar * imgWidth); const height = width * canvasAspectRatio; return { width, height }; }; var getImageRectZoomFactor = (imageRect, cropRect, rotation, center2) => { const cx = center2.x > 0.5 ? 1 - center2.x : center2.x; const cy = center2.y > 0.5 ? 1 - center2.y : center2.y; const imageWidth = cx * 2 * imageRect.width; const imageHeight = cy * 2 * imageRect.height; const rotatedCropSize = getRotatedRectSize(cropRect, rotation); return Math.max(rotatedCropSize.width / imageWidth, rotatedCropSize.height / imageHeight); }; var getCenteredCropRect = (container, aspectRatio) => { let width = container.width; let height = width * aspectRatio; if (height > container.height) { height = container.height; width = height / aspectRatio; } const x = (container.width - width) * 0.5; const y = (container.height - height) * 0.5; return { x, y, width, height }; }; var getCurrentCropSize = (imageSize, crop = {}) => { let {zoom, rotation, center: center2, aspectRatio} = crop; if (!aspectRatio) aspectRatio = imageSize.height / imageSize.width; const canvasSize = calculateCanvasSize(imageSize, aspectRatio, zoom); const canvasCenter = { x: canvasSize.width * 0.5, y: canvasSize.height * 0.5 }; const stage = { x: 0, y: 0, width: canvasSize.width, height: canvasSize.height, center: canvasCenter }; const shouldLimit = typeof crop.scaleToFit === "undefined" || crop.scaleToFit; const stageZoomFactor = getImageRectZoomFactor(imageSize, getCenteredCropRect(stage, aspectRatio), rotation, shouldLimit ? center2 : {x: 0.5, y: 0.5}); const scale = zoom * stageZoomFactor; return { widthFloat: canvasSize.width / scale, heightFloat: canvasSize.height / scale, width: Math.round(canvasSize.width / scale), height: Math.round(canvasSize.height / scale) }; }; var IMAGE_SCALE_SPRING_PROPS = { type: "spring", stiffness: 0.5, damping: 0.45, mass: 10 }; var createBitmapView = (_) => _.utils.createView({ name: "image-bitmap", ignoreRect: true, mixins: {styles: ["scaleX", "scaleY"]}, create: ({root: root2, props}) => { root2.appendChild(props.image); } }); var createImageCanvasWrapper = (_) => _.utils.createView({ name: "image-canvas-wrapper", tag: "div", ignoreRect: true, mixins: { apis: ["crop", "width", "height"], styles: [ "originX", "originY", "translateX", "translateY", "scaleX", "scaleY", "rotateZ" ], animations: { originX: IMAGE_SCALE_SPRING_PROPS, originY: IMAGE_SCALE_SPRING_PROPS, scaleX: IMAGE_SCALE_SPRING_PROPS, scaleY: IMAGE_SCALE_SPRING_PROPS, translateX: IMAGE_SCALE_SPRING_PROPS, translateY: IMAGE_SCALE_SPRING_PROPS, rotateZ: IMAGE_SCALE_SPRING_PROPS } }, create: ({root: root2, props}) => { props.width = props.image.width; props.height = props.image.height; root2.ref.bitmap = root2.appendChildView(root2.createChildView(createBitmapView(_), {image: props.image})); }, write: ({root: root2, props}) => { const {flip: flip2} = props.crop; const {bitmap} = root2.ref; bitmap.scaleX = flip2.horizontal ? -1 : 1; bitmap.scaleY = flip2.vertical ? -1 : 1; } }); var createClipView = (_) => _.utils.createView({ name: "image-clip", tag: "div", ignoreRect: true, mixins: { apis: [ "crop", "markup", "resize", "width", "height", "dirty", "background" ], styles: ["width", "height", "opacity"], animations: { opacity: {type: "tween", duration: 250} } }, didWriteView: function({root: root2, props}) { if (!props.background) return; root2.element.style.backgroundColor = props.background; }, create: ({root: root2, props}) => { root2.ref.image = root2.appendChildView(root2.createChildView(createImageCanvasWrapper(_), Object.assign({}, props))); root2.ref.createMarkup = () => { if (root2.ref.markup) return; root2.ref.markup = root2.appendChildView(root2.createChildView(createMarkupView(_), Object.assign({}, props))); }; root2.ref.destroyMarkup = () => { if (!root2.ref.markup) return; root2.removeChildView(root2.ref.markup); root2.ref.markup = null; }; const transparencyIndicator = root2.query("GET_IMAGE_PREVIEW_TRANSPARENCY_INDICATOR"); if (transparencyIndicator === null) return; if (transparencyIndicator === "grid") { root2.element.dataset.transparencyIndicator = transparencyIndicator; } else { root2.element.dataset.transparencyIndicator = "color"; } }, write: ({root: root2, props, shouldOptimize}) => { const {crop, markup, resize, dirty, width, height} = props; root2.ref.image.crop = crop; const stage = { x: 0, y: 0, width, height, center: { x: width * 0.5, y: height * 0.5 } }; const image = { width: root2.ref.image.width, height: root2.ref.image.height }; const origin = { x: crop.center.x * image.width, y: crop.center.y * image.height }; const translation = { x: stage.center.x - image.width * crop.center.x, y: stage.center.y - image.height * crop.center.y }; const rotation = Math.PI * 2 + crop.rotation % (Math.PI * 2); const cropAspectRatio = crop.aspectRatio || image.height / image.width; const shouldLimit = typeof crop.scaleToFit === "undefined" || crop.scaleToFit; const stageZoomFactor = getImageRectZoomFactor(image, getCenteredCropRect(stage, cropAspectRatio), rotation, shouldLimit ? crop.center : {x: 0.5, y: 0.5}); const scale = crop.zoom * stageZoomFactor; if (markup && markup.length) { root2.ref.createMarkup(); root2.ref.markup.width = width; root2.ref.markup.height = height; root2.ref.markup.resize = resize; root2.ref.markup.dirty = dirty; root2.ref.markup.markup = markup; root2.ref.markup.crop = getCurrentCropSize(image, crop); } else if (root2.ref.markup) { root2.ref.destroyMarkup(); } const imageView = root2.ref.image; if (shouldOptimize) { imageView.originX = null; imageView.originY = null; imageView.translateX = null; imageView.translateY = null; imageView.rotateZ = null; imageView.scaleX = null; imageView.scaleY = null; return; } imageView.originX = origin.x; imageView.originY = origin.y; imageView.translateX = translation.x; imageView.translateY = translation.y; imageView.rotateZ = rotation; imageView.scaleX = scale; imageView.scaleY = scale; } }); var createImageView = (_) => _.utils.createView({ name: "image-preview", tag: "div", ignoreRect: true, mixins: { apis: ["image", "crop", "markup", "resize", "dirty", "background"], styles: ["translateY", "scaleX", "scaleY", "opacity"], animations: { scaleX: IMAGE_SCALE_SPRING_PROPS, scaleY: IMAGE_SCALE_SPRING_PROPS, translateY: IMAGE_SCALE_SPRING_PROPS, opacity: {type: "tween", duration: 400} } }, create: ({root: root2, props}) => { root2.ref.clip = root2.appendChildView(root2.createChildView(createClipView(_), { id: props.id, image: props.image, crop: props.crop, markup: props.markup, resize: props.resize, dirty: props.dirty, background: props.background })); }, write: ({root: root2, props, shouldOptimize}) => { const {clip} = root2.ref; const {image, crop, markup, resize, dirty} = props; clip.crop = crop; clip.markup = markup; clip.resize = resize; clip.dirty = dirty; clip.opacity = shouldOptimize ? 0 : 1; if (shouldOptimize || root2.rect.element.hidden) return; const imageAspectRatio = image.height / image.width; let aspectRatio = crop.aspectRatio || imageAspectRatio; const containerWidth = root2.rect.inner.width; const containerHeight = root2.rect.inner.height; let fixedPreviewHeight = root2.query("GET_IMAGE_PREVIEW_HEIGHT"); const minPreviewHeight = root2.query("GET_IMAGE_PREVIEW_MIN_HEIGHT"); const maxPreviewHeight = root2.query("GET_IMAGE_PREVIEW_MAX_HEIGHT"); const panelAspectRatio = root2.query("GET_PANEL_ASPECT_RATIO"); const allowMultiple = root2.query("GET_ALLOW_MULTIPLE"); if (panelAspectRatio && !allowMultiple) { fixedPreviewHeight = containerWidth * panelAspectRatio; aspectRatio = panelAspectRatio; } let clipHeight = fixedPreviewHeight !== null ? fixedPreviewHeight : Math.max(minPreviewHeight, Math.min(containerWidth * aspectRatio, maxPreviewHeight)); let clipWidth = clipHeight / aspectRatio; if (clipWidth > containerWidth) { clipWidth = containerWidth; clipHeight = clipWidth * aspectRatio; } if (clipHeight > containerHeight) { clipHeight = containerHeight; clipWidth = containerHeight / aspectRatio; } clip.width = clipWidth; clip.height = clipHeight; } }); var SVG_MASK = ` `; var SVGMaskUniqueId = 0; var createImageOverlayView = (fpAPI) => fpAPI.utils.createView({ name: "image-preview-overlay", tag: "div", ignoreRect: true, create: ({root: root2, props}) => { let mask = SVG_MASK; if (document.querySelector("base")) { const url = new URL(window.location.href.replace(window.location.hash, "")).href; mask = mask.replace(/url\(\#/g, "url(" + url + "#"); } SVGMaskUniqueId++; root2.element.classList.add(`filepond--image-preview-overlay-${props.status}`); root2.element.innerHTML = mask.replace(/__UID__/g, SVGMaskUniqueId); }, mixins: { styles: ["opacity"], animations: { opacity: {type: "spring", mass: 25} } } }); var BitmapWorker = function() { self.onmessage = (e2) => { createImageBitmap(e2.data.message.file).then((bitmap) => { self.postMessage({id: e2.data.id, message: bitmap}, [bitmap]); }); }; }; var ColorMatrixWorker = function() { self.onmessage = (e2) => { const imageData = e2.data.message.imageData; const matrix2 = e2.data.message.colorMatrix; const data3 = imageData.data; const l = data3.length; const m11 = matrix2[0]; const m12 = matrix2[1]; const m13 = matrix2[2]; const m14 = matrix2[3]; const m15 = matrix2[4]; const m21 = matrix2[5]; const m22 = matrix2[6]; const m23 = matrix2[7]; const m24 = matrix2[8]; const m25 = matrix2[9]; const m31 = matrix2[10]; const m32 = matrix2[11]; const m33 = matrix2[12]; const m34 = matrix2[13]; const m35 = matrix2[14]; const m41 = matrix2[15]; const m42 = matrix2[16]; const m43 = matrix2[17]; const m44 = matrix2[18]; const m45 = matrix2[19]; let index2 = 0, r2 = 0, g = 0, b = 0, a2 = 0; for (; index2 < l; index2 += 4) { r2 = data3[index2] / 255; g = data3[index2 + 1] / 255; b = data3[index2 + 2] / 255; a2 = data3[index2 + 3] / 255; data3[index2] = Math.max(0, Math.min((r2 * m11 + g * m12 + b * m13 + a2 * m14 + m15) * 255, 255)); data3[index2 + 1] = Math.max(0, Math.min((r2 * m21 + g * m22 + b * m23 + a2 * m24 + m25) * 255, 255)); data3[index2 + 2] = Math.max(0, Math.min((r2 * m31 + g * m32 + b * m33 + a2 * m34 + m35) * 255, 255)); data3[index2 + 3] = Math.max(0, Math.min((r2 * m41 + g * m42 + b * m43 + a2 * m44 + m45) * 255, 255)); } self.postMessage({id: e2.data.id, message: imageData}, [ imageData.data.buffer ]); }; }; var getImageSize = (url, cb) => { let image = new Image(); image.onload = () => { const width = image.naturalWidth; const height = image.naturalHeight; image = null; cb(width, height); }; image.src = url; }; var transforms = { 1: () => [1, 0, 0, 1, 0, 0], 2: (width) => [-1, 0, 0, 1, width, 0], 3: (width, height) => [-1, 0, 0, -1, width, height], 4: (width, height) => [1, 0, 0, -1, 0, height], 5: () => [0, 1, 1, 0, 0, 0], 6: (width, height) => [0, 1, -1, 0, height, 0], 7: (width, height) => [0, -1, -1, 0, height, width], 8: (width) => [0, -1, 1, 0, 0, width] }; var fixImageOrientation = (ctx, width, height, orientation) => { if (orientation === -1) { return; } ctx.transform.apply(ctx, transforms[orientation](width, height)); }; var createPreviewImage = (data3, width, height, orientation) => { width = Math.round(width); height = Math.round(height); const canvas = document.createElement("canvas"); canvas.width = width; canvas.height = height; const ctx = canvas.getContext("2d"); if (orientation >= 5 && orientation <= 8) { [width, height] = [height, width]; } fixImageOrientation(ctx, width, height, orientation); ctx.drawImage(data3, 0, 0, width, height); return canvas; }; var isBitmap = (file2) => /^image/.test(file2.type) && !/svg/.test(file2.type); var MAX_WIDTH = 10; var MAX_HEIGHT = 10; var calculateAverageColor = (image) => { const scalar = Math.min(MAX_WIDTH / image.width, MAX_HEIGHT / image.height); const canvas = document.createElement("canvas"); const ctx = canvas.getContext("2d"); const width = canvas.width = Math.ceil(image.width * scalar); const height = canvas.height = Math.ceil(image.height * scalar); ctx.drawImage(image, 0, 0, width, height); let data3 = null; try { data3 = ctx.getImageData(0, 0, width, height).data; } catch (e2) { return null; } const l = data3.length; let r2 = 0; let g = 0; let b = 0; let i = 0; for (; i < l; i += 4) { r2 += data3[i] * data3[i]; g += data3[i + 1] * data3[i + 1]; b += data3[i + 2] * data3[i + 2]; } r2 = averageColor(r2, l); g = averageColor(g, l); b = averageColor(b, l); return {r: r2, g, b}; }; var averageColor = (c2, l) => Math.floor(Math.sqrt(c2 / (l / 4))); var cloneCanvas = (origin, target) => { target = target || document.createElement("canvas"); target.width = origin.width; target.height = origin.height; const ctx = target.getContext("2d"); ctx.drawImage(origin, 0, 0); return target; }; var cloneImageData = (imageData) => { let id; try { id = new ImageData(imageData.width, imageData.height); } catch (e2) { const canvas = document.createElement("canvas"); const ctx = canvas.getContext("2d"); id = ctx.createImageData(imageData.width, imageData.height); } id.data.set(new Uint8ClampedArray(imageData.data)); return id; }; var loadImage2 = (url) => new Promise((resolve, reject) => { const img = new Image(); img.crossOrigin = "Anonymous"; img.onload = () => { resolve(img); }; img.onerror = (e2) => { reject(e2); }; img.src = url; }); var createImageWrapperView = (_) => { const OverlayView = createImageOverlayView(_); const ImageView = createImageView(_); const {createWorker: createWorker3} = _.utils; const applyFilter = (root2, filter, target) => new Promise((resolve) => { if (!root2.ref.imageData) { root2.ref.imageData = target.getContext("2d").getImageData(0, 0, target.width, target.height); } const imageData = cloneImageData(root2.ref.imageData); if (!filter || filter.length !== 20) { target.getContext("2d").putImageData(imageData, 0, 0); return resolve(); } const worker = createWorker3(ColorMatrixWorker); worker.post({ imageData, colorMatrix: filter }, (response) => { target.getContext("2d").putImageData(response, 0, 0); worker.terminate(); resolve(); }, [imageData.data.buffer]); }); const removeImageView = (root2, imageView) => { root2.removeChildView(imageView); imageView.image.width = 1; imageView.image.height = 1; imageView._destroy(); }; const shiftImage = ({root: root2}) => { const imageView = root2.ref.images.shift(); imageView.opacity = 0; imageView.translateY = -15; root2.ref.imageViewBin.push(imageView); return imageView; }; const pushImage = ({root: root2, props, image}) => { const id = props.id; const item2 = root2.query("GET_ITEM", {id}); if (!item2) return; const crop = item2.getMetadata("crop") || { center: { x: 0.5, y: 0.5 }, flip: { horizontal: false, vertical: false }, zoom: 1, rotation: 0, aspectRatio: null }; const background = root2.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR"); let markup; let resize; let dirty = false; if (root2.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")) { markup = item2.getMetadata("markup") || []; resize = item2.getMetadata("resize"); dirty = true; } const imageView = root2.appendChildView(root2.createChildView(ImageView, { id, image, crop, resize, markup, dirty, background, opacity: 0, scaleX: 1.15, scaleY: 1.15, translateY: 15 }), root2.childViews.length); root2.ref.images.push(imageView); imageView.opacity = 1; imageView.scaleX = 1; imageView.scaleY = 1; imageView.translateY = 0; setTimeout(() => { root2.dispatch("DID_IMAGE_PREVIEW_SHOW", {id}); }, 250); }; const updateImage3 = ({root: root2, props}) => { const item2 = root2.query("GET_ITEM", {id: props.id}); if (!item2) return; const imageView = root2.ref.images[root2.ref.images.length - 1]; imageView.crop = item2.getMetadata("crop"); imageView.background = root2.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR"); if (root2.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")) { imageView.dirty = true; imageView.resize = item2.getMetadata("resize"); imageView.markup = item2.getMetadata("markup"); } }; const didUpdateItemMetadata = ({root: root2, props, action}) => { if (!/crop|filter|markup|resize/.test(action.change.key)) return; if (!root2.ref.images.length) return; const item2 = root2.query("GET_ITEM", {id: props.id}); if (!item2) return; if (/filter/.test(action.change.key)) { const imageView = root2.ref.images[root2.ref.images.length - 1]; applyFilter(root2, action.change.value, imageView.image); return; } if (/crop|markup|resize/.test(action.change.key)) { const crop = item2.getMetadata("crop"); const image = root2.ref.images[root2.ref.images.length - 1]; if (crop && crop.aspectRatio && image.crop && image.crop.aspectRatio && Math.abs(crop.aspectRatio - image.crop.aspectRatio) > 1e-5) { const imageView = shiftImage({root: root2}); pushImage({root: root2, props, image: cloneCanvas(imageView.image)}); } else { updateImage3({root: root2, props}); } } }; const canCreateImageBitmap = (file2) => { const userAgent2 = window.navigator.userAgent; const isFirefox = userAgent2.match(/Firefox\/([0-9]+)\./); const firefoxVersion = isFirefox ? parseInt(isFirefox[1]) : null; if (firefoxVersion <= 58) return false; return "createImageBitmap" in window && isBitmap(file2); }; const didCreatePreviewContainer = ({root: root2, props}) => { const {id} = props; const item2 = root2.query("GET_ITEM", id); if (!item2) return; const fileURL = URL.createObjectURL(item2.file); getImageSize(fileURL, (width, height) => { root2.dispatch("DID_IMAGE_PREVIEW_CALCULATE_SIZE", { id, width, height }); }); }; const drawPreview = ({root: root2, props}) => { const {id} = props; const item2 = root2.query("GET_ITEM", id); if (!item2) return; const fileURL = URL.createObjectURL(item2.file); const loadPreviewFallback = () => { loadImage2(fileURL).then(previewImageLoaded); }; const previewImageLoaded = (imageData) => { URL.revokeObjectURL(fileURL); const exif = item2.getMetadata("exif") || {}; const orientation = exif.orientation || -1; let {width, height} = imageData; if (!width || !height) return; if (orientation >= 5 && orientation <= 8) { [width, height] = [height, width]; } const pixelDensityFactor = Math.max(1, window.devicePixelRatio * 0.75); const zoomFactor = root2.query("GET_IMAGE_PREVIEW_ZOOM_FACTOR"); const scaleFactor = zoomFactor * pixelDensityFactor; const previewImageRatio = height / width; const previewContainerWidth = root2.rect.element.width; const previewContainerHeight = root2.rect.element.height; let imageWidth = previewContainerWidth; let imageHeight = imageWidth * previewImageRatio; if (previewImageRatio > 1) { imageWidth = Math.min(width, previewContainerWidth * scaleFactor); imageHeight = imageWidth * previewImageRatio; } else { imageHeight = Math.min(height, previewContainerHeight * scaleFactor); imageWidth = imageHeight / previewImageRatio; } const previewImage = createPreviewImage(imageData, imageWidth, imageHeight, orientation); const done = () => { const averageColor2 = root2.query("GET_IMAGE_PREVIEW_CALCULATE_AVERAGE_IMAGE_COLOR") ? calculateAverageColor(data) : null; item2.setMetadata("color", averageColor2, true); if ("close" in imageData) { imageData.close(); } root2.ref.overlayShadow.opacity = 1; pushImage({root: root2, props, image: previewImage}); }; const filter = item2.getMetadata("filter"); if (filter) { applyFilter(root2, filter, previewImage).then(done); } else { done(); } }; if (canCreateImageBitmap(item2.file)) { const worker = createWorker3(BitmapWorker); worker.post({ file: item2.file }, (imageBitmap) => { worker.terminate(); if (!imageBitmap) { loadPreviewFallback(); return; } previewImageLoaded(imageBitmap); }); } else { loadPreviewFallback(); } }; const didDrawPreview = ({root: root2}) => { const image = root2.ref.images[root2.ref.images.length - 1]; image.translateY = 0; image.scaleX = 1; image.scaleY = 1; image.opacity = 1; }; const restoreOverlay = ({root: root2}) => { root2.ref.overlayShadow.opacity = 1; root2.ref.overlayError.opacity = 0; root2.ref.overlaySuccess.opacity = 0; }; const didThrowError = ({root: root2}) => { root2.ref.overlayShadow.opacity = 0.25; root2.ref.overlayError.opacity = 1; }; const didCompleteProcessing = ({root: root2}) => { root2.ref.overlayShadow.opacity = 0.25; root2.ref.overlaySuccess.opacity = 1; }; const create3 = ({root: root2}) => { root2.ref.images = []; root2.ref.imageData = null; root2.ref.imageViewBin = []; root2.ref.overlayShadow = root2.appendChildView(root2.createChildView(OverlayView, { opacity: 0, status: "idle" })); root2.ref.overlaySuccess = root2.appendChildView(root2.createChildView(OverlayView, { opacity: 0, status: "success" })); root2.ref.overlayError = root2.appendChildView(root2.createChildView(OverlayView, { opacity: 0, status: "failure" })); }; return _.utils.createView({ name: "image-preview-wrapper", create: create3, styles: ["height"], apis: ["height"], destroy: ({root: root2}) => { root2.ref.images.forEach((imageView) => { imageView.image.width = 1; imageView.image.height = 1; }); }, didWriteView: ({root: root2}) => { root2.ref.images.forEach((imageView) => { imageView.dirty = false; }); }, write: _.utils.createRoute({ DID_IMAGE_PREVIEW_DRAW: didDrawPreview, DID_IMAGE_PREVIEW_CONTAINER_CREATE: didCreatePreviewContainer, DID_FINISH_CALCULATE_PREVIEWSIZE: drawPreview, DID_UPDATE_ITEM_METADATA: didUpdateItemMetadata, DID_THROW_ITEM_LOAD_ERROR: didThrowError, DID_THROW_ITEM_PROCESSING_ERROR: didThrowError, DID_THROW_ITEM_INVALID: didThrowError, DID_COMPLETE_ITEM_PROCESSING: didCompleteProcessing, DID_START_ITEM_PROCESSING: restoreOverlay, DID_REVERT_ITEM_PROCESSING: restoreOverlay }, ({root: root2}) => { const viewsToRemove = root2.ref.imageViewBin.filter((imageView) => imageView.opacity === 0); root2.ref.imageViewBin = root2.ref.imageViewBin.filter((imageView) => imageView.opacity > 0); viewsToRemove.forEach((imageView) => removeImageView(root2, imageView)); viewsToRemove.length = 0; }) }); }; var plugin5 = (fpAPI) => { const {addFilter: addFilter2, utils} = fpAPI; const {Type: Type2, createRoute: createRoute2, isFile: isFile2} = utils; const imagePreviewView = createImageWrapperView(fpAPI); addFilter2("CREATE_VIEW", (viewAPI) => { const {is: is2, view, query} = viewAPI; if (!is2("file") || !query("GET_ALLOW_IMAGE_PREVIEW")) return; const didLoadItem2 = ({root: root2, props}) => { const {id} = props; const item2 = query("GET_ITEM", id); if (!item2 || !isFile2(item2.file) || item2.archived) return; const file2 = item2.file; if (!isPreviewableImage(file2)) return; if (!query("GET_IMAGE_PREVIEW_FILTER_ITEM")(item2)) return; const supportsCreateImageBitmap = "createImageBitmap" in (window || {}); const maxPreviewFileSize = query("GET_IMAGE_PREVIEW_MAX_FILE_SIZE"); if (!supportsCreateImageBitmap && (maxPreviewFileSize && file2.size > maxPreviewFileSize)) return; root2.ref.imagePreview = view.appendChildView(view.createChildView(imagePreviewView, {id})); const fixedPreviewHeight = root2.query("GET_IMAGE_PREVIEW_HEIGHT"); if (fixedPreviewHeight) { root2.dispatch("DID_UPDATE_PANEL_HEIGHT", { id: item2.id, height: fixedPreviewHeight }); } const queue = !supportsCreateImageBitmap && file2.size > query("GET_IMAGE_PREVIEW_MAX_INSTANT_PREVIEW_FILE_SIZE"); root2.dispatch("DID_IMAGE_PREVIEW_CONTAINER_CREATE", {id}, queue); }; const rescaleItem = (root2, props) => { if (!root2.ref.imagePreview) return; let {id} = props; const item2 = root2.query("GET_ITEM", {id}); if (!item2) return; const panelAspectRatio = root2.query("GET_PANEL_ASPECT_RATIO"); const itemPanelAspectRatio = root2.query("GET_ITEM_PANEL_ASPECT_RATIO"); const fixedHeight = root2.query("GET_IMAGE_PREVIEW_HEIGHT"); if (panelAspectRatio || itemPanelAspectRatio || fixedHeight) return; let {imageWidth, imageHeight} = root2.ref; if (!imageWidth || !imageHeight) return; const minPreviewHeight = root2.query("GET_IMAGE_PREVIEW_MIN_HEIGHT"); const maxPreviewHeight = root2.query("GET_IMAGE_PREVIEW_MAX_HEIGHT"); const exif = item2.getMetadata("exif") || {}; const orientation = exif.orientation || -1; if (orientation >= 5 && orientation <= 8) [imageWidth, imageHeight] = [imageHeight, imageWidth]; if (!isBitmap(item2.file) || root2.query("GET_IMAGE_PREVIEW_UPSCALE")) { const scalar = 2048 / imageWidth; imageWidth *= scalar; imageHeight *= scalar; } const imageAspectRatio = imageHeight / imageWidth; const previewAspectRatio = (item2.getMetadata("crop") || {}).aspectRatio || imageAspectRatio; let previewHeightMax = Math.max(minPreviewHeight, Math.min(imageHeight, maxPreviewHeight)); const itemWidth = root2.rect.element.width; const previewHeight = Math.min(itemWidth * previewAspectRatio, previewHeightMax); root2.dispatch("DID_UPDATE_PANEL_HEIGHT", { id: item2.id, height: previewHeight }); }; const didResizeView = ({root: root2}) => { root2.ref.shouldRescale = true; }; const didUpdateItemMetadata = ({root: root2, action}) => { if (action.change.key !== "crop") return; root2.ref.shouldRescale = true; }; const didCalculatePreviewSize = ({root: root2, action}) => { root2.ref.imageWidth = action.width; root2.ref.imageHeight = action.height; root2.ref.shouldRescale = true; root2.ref.shouldDrawPreview = true; root2.dispatch("KICK"); }; view.registerWriter(createRoute2({ DID_RESIZE_ROOT: didResizeView, DID_STOP_RESIZE: didResizeView, DID_LOAD_ITEM: didLoadItem2, DID_IMAGE_PREVIEW_CALCULATE_SIZE: didCalculatePreviewSize, DID_UPDATE_ITEM_METADATA: didUpdateItemMetadata }, ({root: root2, props}) => { if (!root2.ref.imagePreview) return; if (root2.rect.element.hidden) return; if (root2.ref.shouldRescale) { rescaleItem(root2, props); root2.ref.shouldRescale = false; } if (root2.ref.shouldDrawPreview) { requestAnimationFrame(() => { requestAnimationFrame(() => { root2.dispatch("DID_FINISH_CALCULATE_PREVIEWSIZE", { id: props.id }); }); }); root2.ref.shouldDrawPreview = false; } })); }); return { options: { allowImagePreview: [true, Type2.BOOLEAN], imagePreviewFilterItem: [() => true, Type2.FUNCTION], imagePreviewHeight: [null, Type2.INT], imagePreviewMinHeight: [44, Type2.INT], imagePreviewMaxHeight: [256, Type2.INT], imagePreviewMaxFileSize: [null, Type2.INT], imagePreviewZoomFactor: [2, Type2.INT], imagePreviewUpscale: [false, Type2.BOOLEAN], imagePreviewMaxInstantPreviewFileSize: [1e6, Type2.INT], imagePreviewTransparencyIndicator: [null, Type2.STRING], imagePreviewCalculateAverageImageColor: [false, Type2.BOOLEAN], imagePreviewMarkupShow: [true, Type2.BOOLEAN], imagePreviewMarkupFilter: [() => true, Type2.FUNCTION] } }; }; var isBrowser6 = typeof window !== "undefined" && typeof window.document !== "undefined"; if (isBrowser6) { document.dispatchEvent(new CustomEvent("FilePond:pluginloaded", {detail: plugin5})); } var filepond_plugin_image_preview_esm_default = plugin5; // node_modules/filepond-plugin-image-resize/dist/filepond-plugin-image-resize.esm.js /*! * FilePondPluginImageResize 2.0.10 * Licensed under MIT, https://opensource.org/licenses/MIT/ * Please visit https://pqina.nl/filepond/ for details. */ var isImage2 = (file2) => /^image/.test(file2.type); var getImageSize2 = (url, cb) => { let image = new Image(); image.onload = () => { const width = image.naturalWidth; const height = image.naturalHeight; image = null; cb({width, height}); }; image.onerror = () => cb(null); image.src = url; }; var plugin6 = ({addFilter: addFilter2, utils}) => { const {Type: Type2} = utils; addFilter2("DID_LOAD_ITEM", (item2, {query}) => new Promise((resolve, reject) => { const file2 = item2.file; if (!isImage2(file2) || !query("GET_ALLOW_IMAGE_RESIZE")) { return resolve(item2); } const mode = query("GET_IMAGE_RESIZE_MODE"); const width = query("GET_IMAGE_RESIZE_TARGET_WIDTH"); const height = query("GET_IMAGE_RESIZE_TARGET_HEIGHT"); const upscale = query("GET_IMAGE_RESIZE_UPSCALE"); if (width === null && height === null) return resolve(item2); const targetWidth = width === null ? height : width; const targetHeight = height === null ? targetWidth : height; const fileURL = URL.createObjectURL(file2); getImageSize2(fileURL, (size2) => { URL.revokeObjectURL(fileURL); if (!size2) return resolve(item2); let {width: imageWidth, height: imageHeight} = size2; const orientation = (item2.getMetadata("exif") || {}).orientation || -1; if (orientation >= 5 && orientation <= 8) { [imageWidth, imageHeight] = [imageHeight, imageWidth]; } if (imageWidth === targetWidth && imageHeight === targetHeight) return resolve(item2); if (!upscale) { if (mode === "cover") { if (imageWidth <= targetWidth || imageHeight <= targetHeight) return resolve(item2); } else if (imageWidth <= targetWidth && imageHeight <= targetWidth) { return resolve(item2); } } item2.setMetadata("resize", { mode, upscale, size: { width: targetWidth, height: targetHeight } }); resolve(item2); }); })); return { options: { allowImageResize: [true, Type2.BOOLEAN], imageResizeMode: ["cover", Type2.STRING], imageResizeUpscale: [true, Type2.BOOLEAN], imageResizeTargetWidth: [null, Type2.INT], imageResizeTargetHeight: [null, Type2.INT] } }; }; var isBrowser7 = typeof window !== "undefined" && typeof window.document !== "undefined"; if (isBrowser7) { document.dispatchEvent(new CustomEvent("FilePond:pluginloaded", {detail: plugin6})); } var filepond_plugin_image_resize_esm_default = plugin6; // node_modules/filepond-plugin-image-transform/dist/filepond-plugin-image-transform.esm.js /*! * FilePondPluginImageTransform 3.8.7 * Licensed under MIT, https://opensource.org/licenses/MIT/ * Please visit https://pqina.nl/filepond/ for details. */ var isImage3 = (file2) => /^image/.test(file2.type); var getFilenameWithoutExtension2 = (name2) => name2.substr(0, name2.lastIndexOf(".")) || name2; var ExtensionMap = { jpeg: "jpg", "svg+xml": "svg" }; var renameFileToMatchMimeType = (filename, mimeType) => { const name2 = getFilenameWithoutExtension2(filename); const type = mimeType.split("/")[1]; const extension = ExtensionMap[type] || type; return `${name2}.${extension}`; }; var getValidOutputMimeType = (type) => /jpeg|png|svg\+xml/.test(type) ? type : "image/jpeg"; var isImage$1 = (file2) => /^image/.test(file2.type); var MATRICES = { 1: () => [1, 0, 0, 1, 0, 0], 2: (width) => [-1, 0, 0, 1, width, 0], 3: (width, height) => [-1, 0, 0, -1, width, height], 4: (width, height) => [1, 0, 0, -1, 0, height], 5: () => [0, 1, 1, 0, 0, 0], 6: (width, height) => [0, 1, -1, 0, height, 0], 7: (width, height) => [0, -1, -1, 0, height, width], 8: (width) => [0, -1, 1, 0, 0, width] }; var getImageOrientationMatrix = (width, height, orientation) => { if (orientation === -1) { orientation = 1; } return MATRICES[orientation](width, height); }; var createVector2 = (x, y) => ({x, y}); var vectorDot2 = (a2, b) => a2.x * b.x + a2.y * b.y; var vectorSubtract2 = (a2, b) => createVector2(a2.x - b.x, a2.y - b.y); var vectorDistanceSquared2 = (a2, b) => vectorDot2(vectorSubtract2(a2, b), vectorSubtract2(a2, b)); var vectorDistance2 = (a2, b) => Math.sqrt(vectorDistanceSquared2(a2, b)); var getOffsetPointOnEdge2 = (length, rotation) => { const a2 = length; const A = 1.5707963267948966; const B = rotation; const C3 = 1.5707963267948966 - rotation; const sinA = Math.sin(A); const sinB = Math.sin(B); const sinC = Math.sin(C3); const cosC = Math.cos(C3); const ratio = a2 / sinA; const b = ratio * sinB; const c2 = ratio * sinC; return createVector2(cosC * b, cosC * c2); }; var getRotatedRectSize2 = (rect, rotation) => { const w = rect.width; const h = rect.height; const hor = getOffsetPointOnEdge2(w, rotation); const ver = getOffsetPointOnEdge2(h, rotation); const tl = createVector2(rect.x + Math.abs(hor.x), rect.y - Math.abs(hor.y)); const tr = createVector2(rect.x + rect.width + Math.abs(ver.y), rect.y + Math.abs(ver.x)); const bl = createVector2(rect.x - Math.abs(ver.y), rect.y + rect.height - Math.abs(ver.x)); return { width: vectorDistance2(tl, tr), height: vectorDistance2(tl, bl) }; }; var getImageRectZoomFactor2 = (imageRect, cropRect, rotation = 0, center2 = {x: 0.5, y: 0.5}) => { const cx = center2.x > 0.5 ? 1 - center2.x : center2.x; const cy = center2.y > 0.5 ? 1 - center2.y : center2.y; const imageWidth = cx * 2 * imageRect.width; const imageHeight = cy * 2 * imageRect.height; const rotatedCropSize = getRotatedRectSize2(cropRect, rotation); return Math.max(rotatedCropSize.width / imageWidth, rotatedCropSize.height / imageHeight); }; var getCenteredCropRect2 = (container, aspectRatio) => { let width = container.width; let height = width * aspectRatio; if (height > container.height) { height = container.height; width = height / aspectRatio; } const x = (container.width - width) * 0.5; const y = (container.height - height) * 0.5; return { x, y, width, height }; }; var calculateCanvasSize2 = (image, canvasAspectRatio, zoom = 1) => { const imageAspectRatio = image.height / image.width; let canvasWidth = 1; let canvasHeight = canvasAspectRatio; let imgWidth = 1; let imgHeight = imageAspectRatio; if (imgHeight > canvasHeight) { imgHeight = canvasHeight; imgWidth = imgHeight / imageAspectRatio; } const scalar = Math.max(canvasWidth / imgWidth, canvasHeight / imgHeight); const width = image.width / (zoom * scalar * imgWidth); const height = width * canvasAspectRatio; return { width, height }; }; var canvasRelease = (canvas) => { canvas.width = 1; canvas.height = 1; const ctx = canvas.getContext("2d"); ctx.clearRect(0, 0, 1, 1); }; var isFlipped = (flip2) => flip2 && (flip2.horizontal || flip2.vertical); var getBitmap = (image, orientation, flip2) => { if (orientation <= 1 && !isFlipped(flip2)) { image.width = image.naturalWidth; image.height = image.naturalHeight; return image; } const canvas = document.createElement("canvas"); const width = image.naturalWidth; const height = image.naturalHeight; const swapped = orientation >= 5 && orientation <= 8; if (swapped) { canvas.width = height; canvas.height = width; } else { canvas.width = width; canvas.height = height; } const ctx = canvas.getContext("2d"); if (orientation) { ctx.transform.apply(ctx, getImageOrientationMatrix(width, height, orientation)); } if (isFlipped(flip2)) { const matrix2 = [1, 0, 0, 1, 0, 0]; if (!swapped && flip2.horizontal || swapped & flip2.vertical) { matrix2[0] = -1; matrix2[4] = width; } if (!swapped && flip2.vertical || swapped && flip2.horizontal) { matrix2[3] = -1; matrix2[5] = height; } ctx.transform(...matrix2); } ctx.drawImage(image, 0, 0, width, height); return canvas; }; var imageToImageData = (imageElement, orientation, crop = {}, options2 = {}) => { const {canvasMemoryLimit, background = null} = options2; const zoom = crop.zoom || 1; const bitmap = getBitmap(imageElement, orientation, crop.flip); const imageSize = { width: bitmap.width, height: bitmap.height }; const aspectRatio = crop.aspectRatio || imageSize.height / imageSize.width; let canvasSize = calculateCanvasSize2(imageSize, aspectRatio, zoom); if (canvasMemoryLimit) { const requiredMemory = canvasSize.width * canvasSize.height; if (requiredMemory > canvasMemoryLimit) { const scalar = Math.sqrt(canvasMemoryLimit) / Math.sqrt(requiredMemory); imageSize.width = Math.floor(imageSize.width * scalar); imageSize.height = Math.floor(imageSize.height * scalar); canvasSize = calculateCanvasSize2(imageSize, aspectRatio, zoom); } } const canvas = document.createElement("canvas"); const canvasCenter = { x: canvasSize.width * 0.5, y: canvasSize.height * 0.5 }; const stage = { x: 0, y: 0, width: canvasSize.width, height: canvasSize.height, center: canvasCenter }; const shouldLimit = typeof crop.scaleToFit === "undefined" || crop.scaleToFit; const scale = zoom * getImageRectZoomFactor2(imageSize, getCenteredCropRect2(stage, aspectRatio), crop.rotation, shouldLimit ? crop.center : {x: 0.5, y: 0.5}); canvas.width = Math.round(canvasSize.width / scale); canvas.height = Math.round(canvasSize.height / scale); canvasCenter.x /= scale; canvasCenter.y /= scale; const imageOffset = { x: canvasCenter.x - imageSize.width * (crop.center ? crop.center.x : 0.5), y: canvasCenter.y - imageSize.height * (crop.center ? crop.center.y : 0.5) }; const ctx = canvas.getContext("2d"); if (background) { ctx.fillStyle = background; ctx.fillRect(0, 0, canvas.width, canvas.height); } ctx.translate(canvasCenter.x, canvasCenter.y); ctx.rotate(crop.rotation || 0); ctx.drawImage(bitmap, imageOffset.x - canvasCenter.x, imageOffset.y - canvasCenter.y, imageSize.width, imageSize.height); const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height); canvasRelease(canvas); return imageData; }; var IS_BROWSER3 = (() => typeof window !== "undefined" && typeof window.document !== "undefined")(); if (IS_BROWSER3) { if (!HTMLCanvasElement.prototype.toBlob) { Object.defineProperty(HTMLCanvasElement.prototype, "toBlob", { value: function(callback, type, quality) { var dataURL = this.toDataURL(type, quality).split(",")[1]; setTimeout(function() { var binStr = atob(dataURL); var len = binStr.length; var arr = new Uint8Array(len); for (var i = 0; i < len; i++) { arr[i] = binStr.charCodeAt(i); } callback(new Blob([arr], {type: type || "image/png"})); }); } }); } } var canvasToBlob = (canvas, options2, beforeCreateBlob = null) => new Promise((resolve) => { const promisedImage = beforeCreateBlob ? beforeCreateBlob(canvas) : canvas; Promise.resolve(promisedImage).then((canvas2) => { canvas2.toBlob(resolve, options2.type, options2.quality); }); }); var vectorMultiply2 = (v, amount) => createVector$12(v.x * amount, v.y * amount); var vectorAdd2 = (a2, b) => createVector$12(a2.x + b.x, a2.y + b.y); var vectorNormalize2 = (v) => { const l = Math.sqrt(v.x * v.x + v.y * v.y); if (l === 0) { return { x: 0, y: 0 }; } return createVector$12(v.x / l, v.y / l); }; var vectorRotate2 = (v, radians, origin) => { const cos = Math.cos(radians); const sin = Math.sin(radians); const t2 = createVector$12(v.x - origin.x, v.y - origin.y); return createVector$12(origin.x + cos * t2.x - sin * t2.y, origin.y + sin * t2.x + cos * t2.y); }; var createVector$12 = (x = 0, y = 0) => ({x, y}); var getMarkupValue2 = (value, size2, scalar = 1, axis) => { if (typeof value === "string") { return parseFloat(value) * scalar; } if (typeof value === "number") { return value * (axis ? size2[axis] : Math.min(size2.width, size2.height)); } return; }; var getMarkupStyles2 = (markup, size2, scale) => { const lineStyle = markup.borderStyle || markup.lineStyle || "solid"; const fill = markup.backgroundColor || markup.fontColor || "transparent"; const stroke = markup.borderColor || markup.lineColor || "transparent"; const strokeWidth = getMarkupValue2(markup.borderWidth || markup.lineWidth, size2, scale); const lineCap = markup.lineCap || "round"; const lineJoin = markup.lineJoin || "round"; const dashes = typeof lineStyle === "string" ? "" : lineStyle.map((v) => getMarkupValue2(v, size2, scale)).join(","); const opacity = markup.opacity || 1; return { "stroke-linecap": lineCap, "stroke-linejoin": lineJoin, "stroke-width": strokeWidth || 0, "stroke-dasharray": dashes, stroke, fill, opacity }; }; var isDefined3 = (value) => value != null; var getMarkupRect2 = (rect, size2, scalar = 1) => { let left = getMarkupValue2(rect.x, size2, scalar, "width") || getMarkupValue2(rect.left, size2, scalar, "width"); let top = getMarkupValue2(rect.y, size2, scalar, "height") || getMarkupValue2(rect.top, size2, scalar, "height"); let width = getMarkupValue2(rect.width, size2, scalar, "width"); let height = getMarkupValue2(rect.height, size2, scalar, "height"); let right = getMarkupValue2(rect.right, size2, scalar, "width"); let bottom = getMarkupValue2(rect.bottom, size2, scalar, "height"); if (!isDefined3(top)) { if (isDefined3(height) && isDefined3(bottom)) { top = size2.height - height - bottom; } else { top = bottom; } } if (!isDefined3(left)) { if (isDefined3(width) && isDefined3(right)) { left = size2.width - width - right; } else { left = right; } } if (!isDefined3(width)) { if (isDefined3(left) && isDefined3(right)) { width = size2.width - left - right; } else { width = 0; } } if (!isDefined3(height)) { if (isDefined3(top) && isDefined3(bottom)) { height = size2.height - top - bottom; } else { height = 0; } } return { x: left || 0, y: top || 0, width: width || 0, height: height || 0 }; }; var pointsToPathShape2 = (points) => points.map((point, index2) => `${index2 === 0 ? "M" : "L"} ${point.x} ${point.y}`).join(" "); var setAttributes2 = (element, attr2) => Object.keys(attr2).forEach((key) => element.setAttribute(key, attr2[key])); var ns3 = "http://www.w3.org/2000/svg"; var svg2 = (tag, attr2) => { const element = document.createElementNS(ns3, tag); if (attr2) { setAttributes2(element, attr2); } return element; }; var updateRect3 = (element) => setAttributes2(element, { ...element.rect, ...element.styles }); var updateEllipse2 = (element) => { const cx = element.rect.x + element.rect.width * 0.5; const cy = element.rect.y + element.rect.height * 0.5; const rx = element.rect.width * 0.5; const ry = element.rect.height * 0.5; return setAttributes2(element, { cx, cy, rx, ry, ...element.styles }); }; var IMAGE_FIT_STYLE2 = { contain: "xMidYMid meet", cover: "xMidYMid slice" }; var updateImage2 = (element, markup) => { setAttributes2(element, { ...element.rect, ...element.styles, preserveAspectRatio: IMAGE_FIT_STYLE2[markup.fit] || "none" }); }; var TEXT_ANCHOR2 = { left: "start", center: "middle", right: "end" }; var updateText2 = (element, markup, size2, scale) => { const fontSize = getMarkupValue2(markup.fontSize, size2, scale); const fontFamily = markup.fontFamily || "sans-serif"; const fontWeight = markup.fontWeight || "normal"; const textAlign = TEXT_ANCHOR2[markup.textAlign] || "start"; setAttributes2(element, { ...element.rect, ...element.styles, "stroke-width": 0, "font-weight": fontWeight, "font-size": fontSize, "font-family": fontFamily, "text-anchor": textAlign }); if (element.text !== markup.text) { element.text = markup.text; element.textContent = markup.text.length ? markup.text : " "; } }; var updateLine2 = (element, markup, size2, scale) => { setAttributes2(element, { ...element.rect, ...element.styles, fill: "none" }); const line = element.childNodes[0]; const begin = element.childNodes[1]; const end = element.childNodes[2]; const origin = element.rect; const target = { x: element.rect.x + element.rect.width, y: element.rect.y + element.rect.height }; setAttributes2(line, { x1: origin.x, y1: origin.y, x2: target.x, y2: target.y }); if (!markup.lineDecoration) return; begin.style.display = "none"; end.style.display = "none"; const v = vectorNormalize2({ x: target.x - origin.x, y: target.y - origin.y }); const l = getMarkupValue2(0.05, size2, scale); if (markup.lineDecoration.indexOf("arrow-begin") !== -1) { const arrowBeginRotationPoint = vectorMultiply2(v, l); const arrowBeginCenter = vectorAdd2(origin, arrowBeginRotationPoint); const arrowBeginA = vectorRotate2(origin, 2, arrowBeginCenter); const arrowBeginB = vectorRotate2(origin, -2, arrowBeginCenter); setAttributes2(begin, { style: "display:block;", d: `M${arrowBeginA.x},${arrowBeginA.y} L${origin.x},${origin.y} L${arrowBeginB.x},${arrowBeginB.y}` }); } if (markup.lineDecoration.indexOf("arrow-end") !== -1) { const arrowEndRotationPoint = vectorMultiply2(v, -l); const arrowEndCenter = vectorAdd2(target, arrowEndRotationPoint); const arrowEndA = vectorRotate2(target, 2, arrowEndCenter); const arrowEndB = vectorRotate2(target, -2, arrowEndCenter); setAttributes2(end, { style: "display:block;", d: `M${arrowEndA.x},${arrowEndA.y} L${target.x},${target.y} L${arrowEndB.x},${arrowEndB.y}` }); } }; var updatePath2 = (element, markup, size2, scale) => { setAttributes2(element, { ...element.styles, fill: "none", d: pointsToPathShape2(markup.points.map((point) => ({ x: getMarkupValue2(point.x, size2, scale, "width"), y: getMarkupValue2(point.y, size2, scale, "height") }))) }); }; var createShape2 = (node) => (markup) => svg2(node, {id: markup.id}); var createImage2 = (markup) => { const shape = svg2("image", { id: markup.id, "stroke-linecap": "round", "stroke-linejoin": "round", opacity: "0" }); shape.onload = () => { shape.setAttribute("opacity", markup.opacity || 1); }; shape.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:href", markup.src); return shape; }; var createLine2 = (markup) => { const shape = svg2("g", { id: markup.id, "stroke-linecap": "round", "stroke-linejoin": "round" }); const line = svg2("line"); shape.appendChild(line); const begin = svg2("path"); shape.appendChild(begin); const end = svg2("path"); shape.appendChild(end); return shape; }; var CREATE_TYPE_ROUTES2 = { image: createImage2, rect: createShape2("rect"), ellipse: createShape2("ellipse"), text: createShape2("text"), path: createShape2("path"), line: createLine2 }; var UPDATE_TYPE_ROUTES2 = { rect: updateRect3, ellipse: updateEllipse2, image: updateImage2, text: updateText2, path: updatePath2, line: updateLine2 }; var createMarkupByType2 = (type, markup) => CREATE_TYPE_ROUTES2[type](markup); var updateMarkupByType2 = (element, type, markup, size2, scale) => { if (type !== "path") { element.rect = getMarkupRect2(markup, size2, scale); } element.styles = getMarkupStyles2(markup, size2, scale); UPDATE_TYPE_ROUTES2[type](element, markup, size2, scale); }; var sortMarkupByZIndex2 = (a2, b) => { if (a2[1].zIndex > b[1].zIndex) { return 1; } if (a2[1].zIndex < b[1].zIndex) { return -1; } return 0; }; var cropSVG = (blob2, crop = {}, markup, options2) => new Promise((resolve) => { const {background = null} = options2; const fr = new FileReader(); fr.onloadend = () => { const text3 = fr.result; const original = document.createElement("div"); original.style.cssText = `position:absolute;pointer-events:none;width:0;height:0;visibility:hidden;`; original.innerHTML = text3; const originalNode = original.querySelector("svg"); document.body.appendChild(original); const bBox = originalNode.getBBox(); original.parentNode.removeChild(original); const titleNode = original.querySelector("title"); const viewBoxAttribute = originalNode.getAttribute("viewBox") || ""; const widthAttribute = originalNode.getAttribute("width") || ""; const heightAttribute = originalNode.getAttribute("height") || ""; let width = parseFloat(widthAttribute) || null; let height = parseFloat(heightAttribute) || null; const widthUnits = (widthAttribute.match(/[a-z]+/) || [])[0] || ""; const heightUnits = (heightAttribute.match(/[a-z]+/) || [])[0] || ""; const viewBoxList = viewBoxAttribute.split(" ").map(parseFloat); const viewBox = viewBoxList.length ? { x: viewBoxList[0], y: viewBoxList[1], width: viewBoxList[2], height: viewBoxList[3] } : bBox; let imageWidth = width != null ? width : viewBox.width; let imageHeight = height != null ? height : viewBox.height; originalNode.style.overflow = "visible"; originalNode.setAttribute("width", imageWidth); originalNode.setAttribute("height", imageHeight); let markupSVG = ""; if (markup && markup.length) { const size2 = { width: imageWidth, height: imageHeight }; markupSVG = markup.sort(sortMarkupByZIndex2).reduce((prev, shape) => { const el = createMarkupByType2(shape[0], shape[1]); updateMarkupByType2(el, shape[0], shape[1], size2); el.removeAttribute("id"); if (el.getAttribute("opacity") === 1) { el.removeAttribute("opacity"); } return prev + "\n" + el.outerHTML + "\n"; }, ""); markupSVG = ` ${markupSVG.replace(/ /g, " ")} `; } const aspectRatio = crop.aspectRatio || imageHeight / imageWidth; const canvasWidth = imageWidth; const canvasHeight = canvasWidth * aspectRatio; const shouldLimit = typeof crop.scaleToFit === "undefined" || crop.scaleToFit; const cropCenterX = crop.center ? crop.center.x : 0.5; const cropCenterY = crop.center ? crop.center.y : 0.5; const canvasZoomFactor = getImageRectZoomFactor2({ width: imageWidth, height: imageHeight }, getCenteredCropRect2({ width: canvasWidth, height: canvasHeight }, aspectRatio), crop.rotation, shouldLimit ? {x: cropCenterX, y: cropCenterY} : { x: 0.5, y: 0.5 }); const scale = crop.zoom * canvasZoomFactor; const rotation = crop.rotation * (180 / Math.PI); const canvasCenter = { x: canvasWidth * 0.5, y: canvasHeight * 0.5 }; const imageOffset = { x: canvasCenter.x - imageWidth * cropCenterX, y: canvasCenter.y - imageHeight * cropCenterY }; const cropTransforms = [ `rotate(${rotation} ${canvasCenter.x} ${canvasCenter.y})`, `translate(${canvasCenter.x} ${canvasCenter.y})`, `scale(${scale})`, `translate(${-canvasCenter.x} ${-canvasCenter.y})`, `translate(${imageOffset.x} ${imageOffset.y})` ]; const cropFlipHorizontal = crop.flip && crop.flip.horizontal; const cropFlipVertical = crop.flip && crop.flip.vertical; const flipTransforms = [ `scale(${cropFlipHorizontal ? -1 : 1} ${cropFlipVertical ? -1 : 1})`, `translate(${cropFlipHorizontal ? -imageWidth : 0} ${cropFlipVertical ? -imageHeight : 0})` ]; const transformed = ` ${titleNode ? titleNode.textContent : ""} ${originalNode.outerHTML}${markupSVG} `; resolve(transformed); }; fr.readAsText(blob2); }); var objectToImageData = (obj) => { let imageData; try { imageData = new ImageData(obj.width, obj.height); } catch (e2) { const canvas = document.createElement("canvas"); imageData = canvas.getContext("2d").createImageData(obj.width, obj.height); } imageData.data.set(obj.data); return imageData; }; var TransformWorker = () => { const TRANSFORMS = {resize, filter}; const applyTransforms = (transforms2, imageData) => { transforms2.forEach((transform2) => { imageData = TRANSFORMS[transform2.type](imageData, transform2.data); }); return imageData; }; const transform = (data3, cb) => { let transforms2 = data3.transforms; let filterTransform = null; transforms2.forEach((transform2) => { if (transform2.type === "filter") { filterTransform = transform2; } }); if (filterTransform) { let resizeTransform = null; transforms2.forEach((transform2) => { if (transform2.type === "resize") { resizeTransform = transform2; } }); if (resizeTransform) { resizeTransform.data.matrix = filterTransform.data; transforms2 = transforms2.filter((transform2) => transform2.type !== "filter"); } } cb(applyTransforms(transforms2, data3.imageData)); }; self.onmessage = (e2) => { transform(e2.data.message, (response) => { self.postMessage({id: e2.data.id, message: response}, [response.data.buffer]); }); }; const br = 1; const bg = 1; const bb = 1; function applyFilterMatrix(index2, data3, m) { const ir = data3[index2] / 255; const ig = data3[index2 + 1] / 255; const ib = data3[index2 + 2] / 255; const ia = data3[index2 + 3] / 255; const mr = ir * m[0] + ig * m[1] + ib * m[2] + ia * m[3] + m[4]; const mg = ir * m[5] + ig * m[6] + ib * m[7] + ia * m[8] + m[9]; const mb = ir * m[10] + ig * m[11] + ib * m[12] + ia * m[13] + m[14]; const ma = ir * m[15] + ig * m[16] + ib * m[17] + ia * m[18] + m[19]; const or = Math.max(0, mr * ma) + br * (1 - ma); const og = Math.max(0, mg * ma) + bg * (1 - ma); const ob = Math.max(0, mb * ma) + bb * (1 - ma); data3[index2] = Math.max(0, Math.min(1, or)) * 255; data3[index2 + 1] = Math.max(0, Math.min(1, og)) * 255; data3[index2 + 2] = Math.max(0, Math.min(1, ob)) * 255; } const identityMatrix = self.JSON.stringify([ 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0 ]); function isIdentityMatrix(filter2) { return self.JSON.stringify(filter2 || []) === identityMatrix; } function filter(imageData, matrix2) { if (!matrix2 || isIdentityMatrix(matrix2)) return imageData; const data3 = imageData.data; const l = data3.length; const m11 = matrix2[0]; const m12 = matrix2[1]; const m13 = matrix2[2]; const m14 = matrix2[3]; const m15 = matrix2[4]; const m21 = matrix2[5]; const m22 = matrix2[6]; const m23 = matrix2[7]; const m24 = matrix2[8]; const m25 = matrix2[9]; const m31 = matrix2[10]; const m32 = matrix2[11]; const m33 = matrix2[12]; const m34 = matrix2[13]; const m35 = matrix2[14]; const m41 = matrix2[15]; const m42 = matrix2[16]; const m43 = matrix2[17]; const m44 = matrix2[18]; const m45 = matrix2[19]; let index2 = 0, r2 = 0, g = 0, b = 0, a2 = 0, mr = 0, mg = 0, mb = 0, ma = 0, or = 0, og = 0, ob = 0; for (; index2 < l; index2 += 4) { r2 = data3[index2] / 255; g = data3[index2 + 1] / 255; b = data3[index2 + 2] / 255; a2 = data3[index2 + 3] / 255; mr = r2 * m11 + g * m12 + b * m13 + a2 * m14 + m15; mg = r2 * m21 + g * m22 + b * m23 + a2 * m24 + m25; mb = r2 * m31 + g * m32 + b * m33 + a2 * m34 + m35; ma = r2 * m41 + g * m42 + b * m43 + a2 * m44 + m45; or = Math.max(0, mr * ma) + br * (1 - ma); og = Math.max(0, mg * ma) + bg * (1 - ma); ob = Math.max(0, mb * ma) + bb * (1 - ma); data3[index2] = Math.max(0, Math.min(1, or)) * 255; data3[index2 + 1] = Math.max(0, Math.min(1, og)) * 255; data3[index2 + 2] = Math.max(0, Math.min(1, ob)) * 255; } return imageData; } function resize(imageData, data3) { let {mode = "contain", upscale = false, width, height, matrix: matrix2} = data3; matrix2 = !matrix2 || isIdentityMatrix(matrix2) ? null : matrix2; if (!width && !height) { return filter(imageData, matrix2); } if (width === null) { width = height; } else if (height === null) { height = width; } if (mode !== "force") { let scalarWidth = width / imageData.width; let scalarHeight = height / imageData.height; let scalar = 1; if (mode === "cover") { scalar = Math.max(scalarWidth, scalarHeight); } else if (mode === "contain") { scalar = Math.min(scalarWidth, scalarHeight); } if (scalar > 1 && upscale === false) { return filter(imageData, matrix2); } width = imageData.width * scalar; height = imageData.height * scalar; } const originWidth = imageData.width; const originHeight = imageData.height; const targetWidth = Math.round(width); const targetHeight = Math.round(height); const inputData = imageData.data; const outputData = new Uint8ClampedArray(targetWidth * targetHeight * 4); const ratioWidth = originWidth / targetWidth; const ratioHeight = originHeight / targetHeight; const ratioWidthHalf = Math.ceil(ratioWidth * 0.5); const ratioHeightHalf = Math.ceil(ratioHeight * 0.5); for (let j = 0; j < targetHeight; j++) { for (let i = 0; i < targetWidth; i++) { let x2 = (i + j * targetWidth) * 4; let weight = 0; let weights = 0; let weightsAlpha = 0; let r2 = 0; let g = 0; let b = 0; let a2 = 0; let centerY = (j + 0.5) * ratioHeight; for (let yy = Math.floor(j * ratioHeight); yy < (j + 1) * ratioHeight; yy++) { let dy = Math.abs(centerY - (yy + 0.5)) / ratioHeightHalf; let centerX = (i + 0.5) * ratioWidth; let w0 = dy * dy; for (let xx = Math.floor(i * ratioWidth); xx < (i + 1) * ratioWidth; xx++) { let dx = Math.abs(centerX - (xx + 0.5)) / ratioWidthHalf; let w = Math.sqrt(w0 + dx * dx); if (w >= -1 && w <= 1) { weight = 2 * w * w * w - 3 * w * w + 1; if (weight > 0) { dx = 4 * (xx + yy * originWidth); let ref = inputData[dx + 3]; a2 += weight * ref; weightsAlpha += weight; if (ref < 255) { weight = weight * ref / 250; } r2 += weight * inputData[dx]; g += weight * inputData[dx + 1]; b += weight * inputData[dx + 2]; weights += weight; } } } } outputData[x2] = r2 / weights; outputData[x2 + 1] = g / weights; outputData[x2 + 2] = b / weights; outputData[x2 + 3] = a2 / weightsAlpha; matrix2 && applyFilterMatrix(x2, outputData, matrix2); } } return { data: outputData, width: targetWidth, height: targetHeight }; } }; var correctOrientation = (view, offset2) => { if (view.getUint32(offset2 + 4, false) !== 1165519206) return; offset2 += 4; const intelByteAligned = view.getUint16(offset2 += 6, false) === 18761; offset2 += view.getUint32(offset2 + 4, intelByteAligned); const tags = view.getUint16(offset2, intelByteAligned); offset2 += 2; for (let i = 0; i < tags; i++) { if (view.getUint16(offset2 + i * 12, intelByteAligned) === 274) { view.setUint16(offset2 + i * 12 + 8, 1, intelByteAligned); return true; } } return false; }; var readData = (data3) => { const view = new DataView(data3); if (view.getUint16(0) !== 65496) return null; let offset2 = 2; let marker; let markerLength; let orientationCorrected = false; while (offset2 < view.byteLength) { marker = view.getUint16(offset2, false); markerLength = view.getUint16(offset2 + 2, false) + 2; const isData = marker >= 65504 && marker <= 65519 || marker === 65534; if (!isData) { break; } if (!orientationCorrected) { orientationCorrected = correctOrientation(view, offset2, markerLength); } if (offset2 + markerLength > view.byteLength) { break; } offset2 += markerLength; } return data3.slice(0, offset2); }; var getImageHead = (file2) => new Promise((resolve) => { const reader = new FileReader(); reader.onload = () => resolve(readData(reader.result) || null); reader.readAsArrayBuffer(file2.slice(0, 256 * 1024)); }); var getBlobBuilder2 = () => { return window.BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder; }; var createBlob2 = (arrayBuffer, mimeType) => { const BB = getBlobBuilder2(); if (BB) { const bb = new BB(); bb.append(arrayBuffer); return bb.getBlob(mimeType); } return new Blob([arrayBuffer], { type: mimeType }); }; var getUniqueId2 = () => Math.random().toString(36).substr(2, 9); var createWorker2 = (fn2) => { const workerBlob = new Blob(["(", fn2.toString(), ")()"], {type: "application/javascript"}); const workerURL = URL.createObjectURL(workerBlob); const worker = new Worker(workerURL); const trips = []; return { transfer: () => { }, post: (message, cb, transferList) => { const id = getUniqueId2(); trips[id] = cb; worker.onmessage = (e2) => { const cb2 = trips[e2.data.id]; if (!cb2) return; cb2(e2.data.message); delete trips[e2.data.id]; }; worker.postMessage({ id, message }, transferList); }, terminate: () => { worker.terminate(); URL.revokeObjectURL(workerURL); } }; }; var loadImage3 = (url) => new Promise((resolve, reject) => { const img = new Image(); img.onload = () => { resolve(img); }; img.onerror = (e2) => { reject(e2); }; img.src = url; }); var chain = (funcs) => funcs.reduce((promise, func) => promise.then((result) => func().then(Array.prototype.concat.bind(result))), Promise.resolve([])); var canvasApplyMarkup = (canvas, markup) => new Promise((resolve) => { const size2 = { width: canvas.width, height: canvas.height }; const ctx = canvas.getContext("2d"); const drawers = markup.sort(sortMarkupByZIndex2).map((item2) => () => new Promise((resolve2) => { const result = TYPE_DRAW_ROUTES[item2[0]](ctx, size2, item2[1], resolve2); if (result) resolve2(); })); chain(drawers).then(() => resolve(canvas)); }); var applyMarkupStyles = (ctx, styles3) => { ctx.beginPath(); ctx.lineCap = styles3["stroke-linecap"]; ctx.lineJoin = styles3["stroke-linejoin"]; ctx.lineWidth = styles3["stroke-width"]; if (styles3["stroke-dasharray"].length) { ctx.setLineDash(styles3["stroke-dasharray"].split(",")); } ctx.fillStyle = styles3["fill"]; ctx.strokeStyle = styles3["stroke"]; ctx.globalAlpha = styles3.opacity || 1; }; var drawMarkupStyles = (ctx) => { ctx.fill(); ctx.stroke(); ctx.globalAlpha = 1; }; var drawRect = (ctx, size2, markup) => { const rect = getMarkupRect2(markup, size2); const styles3 = getMarkupStyles2(markup, size2); applyMarkupStyles(ctx, styles3); ctx.rect(rect.x, rect.y, rect.width, rect.height); drawMarkupStyles(ctx, styles3); return true; }; var drawEllipse = (ctx, size2, markup) => { const rect = getMarkupRect2(markup, size2); const styles3 = getMarkupStyles2(markup, size2); applyMarkupStyles(ctx, styles3); const x = rect.x, y = rect.y, w = rect.width, h = rect.height, kappa = 0.5522848, ox = w / 2 * kappa, oy = h / 2 * kappa, xe = x + w, ye = y + h, xm = x + w / 2, ym = y + h / 2; ctx.moveTo(x, ym); ctx.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y); ctx.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym); ctx.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye); ctx.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym); drawMarkupStyles(ctx, styles3); return true; }; var drawImage = (ctx, size2, markup, done) => { const rect = getMarkupRect2(markup, size2); const styles3 = getMarkupStyles2(markup, size2); applyMarkupStyles(ctx, styles3); const image = new Image(); const isCrossOriginImage = new URL(markup.src, window.location.href).origin !== window.location.origin; if (isCrossOriginImage) image.crossOrigin = ""; image.onload = () => { if (markup.fit === "cover") { const ar = rect.width / rect.height; const width = ar > 1 ? image.width : image.height * ar; const height = ar > 1 ? image.width / ar : image.height; const x = image.width * 0.5 - width * 0.5; const y = image.height * 0.5 - height * 0.5; ctx.drawImage(image, x, y, width, height, rect.x, rect.y, rect.width, rect.height); } else if (markup.fit === "contain") { const scalar = Math.min(rect.width / image.width, rect.height / image.height); const width = scalar * image.width; const height = scalar * image.height; const x = rect.x + rect.width * 0.5 - width * 0.5; const y = rect.y + rect.height * 0.5 - height * 0.5; ctx.drawImage(image, 0, 0, image.width, image.height, x, y, width, height); } else { ctx.drawImage(image, 0, 0, image.width, image.height, rect.x, rect.y, rect.width, rect.height); } drawMarkupStyles(ctx, styles3); done(); }; image.src = markup.src; }; var drawText = (ctx, size2, markup) => { const rect = getMarkupRect2(markup, size2); const styles3 = getMarkupStyles2(markup, size2); applyMarkupStyles(ctx, styles3); const fontSize = getMarkupValue2(markup.fontSize, size2); const fontFamily = markup.fontFamily || "sans-serif"; const fontWeight = markup.fontWeight || "normal"; const textAlign = markup.textAlign || "left"; ctx.font = `${fontWeight} ${fontSize}px ${fontFamily}`; ctx.textAlign = textAlign; ctx.fillText(markup.text, rect.x, rect.y); drawMarkupStyles(ctx, styles3); return true; }; var drawPath = (ctx, size2, markup) => { const styles3 = getMarkupStyles2(markup, size2); applyMarkupStyles(ctx, styles3); ctx.beginPath(); const points = markup.points.map((point) => ({ x: getMarkupValue2(point.x, size2, 1, "width"), y: getMarkupValue2(point.y, size2, 1, "height") })); ctx.moveTo(points[0].x, points[0].y); const l = points.length; for (let i = 1; i < l; i++) { ctx.lineTo(points[i].x, points[i].y); } drawMarkupStyles(ctx, styles3); return true; }; var drawLine = (ctx, size2, markup) => { const rect = getMarkupRect2(markup, size2); const styles3 = getMarkupStyles2(markup, size2); applyMarkupStyles(ctx, styles3); ctx.beginPath(); const origin = { x: rect.x, y: rect.y }; const target = { x: rect.x + rect.width, y: rect.y + rect.height }; ctx.moveTo(origin.x, origin.y); ctx.lineTo(target.x, target.y); const v = vectorNormalize2({ x: target.x - origin.x, y: target.y - origin.y }); const l = 0.04 * Math.min(size2.width, size2.height); if (markup.lineDecoration.indexOf("arrow-begin") !== -1) { const arrowBeginRotationPoint = vectorMultiply2(v, l); const arrowBeginCenter = vectorAdd2(origin, arrowBeginRotationPoint); const arrowBeginA = vectorRotate2(origin, 2, arrowBeginCenter); const arrowBeginB = vectorRotate2(origin, -2, arrowBeginCenter); ctx.moveTo(arrowBeginA.x, arrowBeginA.y); ctx.lineTo(origin.x, origin.y); ctx.lineTo(arrowBeginB.x, arrowBeginB.y); } if (markup.lineDecoration.indexOf("arrow-end") !== -1) { const arrowEndRotationPoint = vectorMultiply2(v, -l); const arrowEndCenter = vectorAdd2(target, arrowEndRotationPoint); const arrowEndA = vectorRotate2(target, 2, arrowEndCenter); const arrowEndB = vectorRotate2(target, -2, arrowEndCenter); ctx.moveTo(arrowEndA.x, arrowEndA.y); ctx.lineTo(target.x, target.y); ctx.lineTo(arrowEndB.x, arrowEndB.y); } drawMarkupStyles(ctx, styles3); return true; }; var TYPE_DRAW_ROUTES = { rect: drawRect, ellipse: drawEllipse, image: drawImage, text: drawText, line: drawLine, path: drawPath }; var imageDataToCanvas = (imageData) => { const image = document.createElement("canvas"); image.width = imageData.width; image.height = imageData.height; const ctx = image.getContext("2d"); ctx.putImageData(imageData, 0, 0); return image; }; var transformImage = (file2, instructions, options2 = {}) => new Promise((resolve, reject) => { if (!file2 || !isImage$1(file2)) return reject({status: "not an image file", file: file2}); const {stripImageHead, beforeCreateBlob, afterCreateBlob, canvasMemoryLimit} = options2; const {crop, size: size2, filter, markup, output} = instructions; const orientation = instructions.image && instructions.image.orientation ? Math.max(1, Math.min(8, instructions.image.orientation)) : null; const qualityAsPercentage = output && output.quality; const quality = qualityAsPercentage === null ? null : qualityAsPercentage / 100; const type = output && output.type || null; const background = output && output.background || null; const transforms2 = []; if (size2 && (typeof size2.width === "number" || typeof size2.height === "number")) { transforms2.push({type: "resize", data: size2}); } if (filter && filter.length === 20) { transforms2.push({type: "filter", data: filter}); } const resolveWithBlob = (blob2) => { const promisedBlob = afterCreateBlob ? afterCreateBlob(blob2) : blob2; Promise.resolve(promisedBlob).then(resolve); }; const toBlob = (imageData, options3) => { const canvas = imageDataToCanvas(imageData); const promisedCanvas = markup.length ? canvasApplyMarkup(canvas, markup) : canvas; Promise.resolve(promisedCanvas).then((canvas2) => { canvasToBlob(canvas2, options3, beforeCreateBlob).then((blob2) => { canvasRelease(canvas2); if (stripImageHead) return resolveWithBlob(blob2); getImageHead(file2).then((imageHead) => { if (imageHead !== null) { blob2 = new Blob([imageHead, blob2.slice(20)], {type: blob2.type}); } resolveWithBlob(blob2); }); }).catch(reject); }); }; if (/svg/.test(file2.type) && type === null) { return cropSVG(file2, crop, markup, {background}).then((text3) => { resolve(createBlob2(text3, "image/svg+xml")); }); } const url = URL.createObjectURL(file2); loadImage3(url).then((image) => { URL.revokeObjectURL(url); const imageData = imageToImageData(image, orientation, crop, { canvasMemoryLimit, background }); const outputFormat = { quality, type: type || file2.type }; if (!transforms2.length) { return toBlob(imageData, outputFormat); } const worker = createWorker2(TransformWorker); worker.post({ transforms: transforms2, imageData }, (response) => { toBlob(objectToImageData(response), outputFormat); worker.terminate(); }, [imageData.data.buffer]); }).catch(reject); }); var MARKUP_RECT2 = ["x", "y", "left", "top", "right", "bottom", "width", "height"]; var toOptionalFraction2 = (value) => typeof value === "string" && /%/.test(value) ? parseFloat(value) / 100 : value; var prepareMarkup2 = (markup) => { const [type, props] = markup; const rect = props.points ? {} : MARKUP_RECT2.reduce((prev, curr) => { prev[curr] = toOptionalFraction2(props[curr]); return prev; }, {}); return [ type, { zIndex: 0, ...props, ...rect } ]; }; var getImageSize3 = (file2) => new Promise((resolve, reject) => { const imageElement = new Image(); imageElement.src = URL.createObjectURL(file2); const measure = () => { const width = imageElement.naturalWidth; const height = imageElement.naturalHeight; const hasSize = width && height; if (!hasSize) return; URL.revokeObjectURL(imageElement.src); clearInterval(intervalId); resolve({width, height}); }; imageElement.onerror = (err) => { URL.revokeObjectURL(imageElement.src); clearInterval(intervalId); reject(err); }; const intervalId = setInterval(measure, 1); measure(); }); if (typeof window !== "undefined" && typeof window.document !== "undefined") { if (!HTMLCanvasElement.prototype.toBlob) { Object.defineProperty(HTMLCanvasElement.prototype, "toBlob", { value: function(cb, type, quality) { const canvas = this; setTimeout(() => { const dataURL = canvas.toDataURL(type, quality).split(",")[1]; const binStr = atob(dataURL); let index2 = binStr.length; const data3 = new Uint8Array(index2); while (index2--) { data3[index2] = binStr.charCodeAt(index2); } cb(new Blob([data3], {type: type || "image/png"})); }); } }); } } var isBrowser8 = typeof window !== "undefined" && typeof window.document !== "undefined"; var isIOS = isBrowser8 && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream; var plugin7 = ({addFilter: addFilter2, utils}) => { const {Type: Type2, forin: forin2, getFileFromBlob: getFileFromBlob2, isFile: isFile2} = utils; const TRANSFORM_LIST = ["crop", "resize", "filter", "markup", "output"]; const createVariantCreator = (updateMetadata) => (transform, file2, metadata) => transform(file2, updateMetadata ? updateMetadata(metadata) : metadata); const isDefaultCrop = (crop) => crop.aspectRatio === null && crop.rotation === 0 && crop.zoom === 1 && crop.center && crop.center.x === 0.5 && crop.center.y === 0.5 && crop.flip && crop.flip.horizontal === false && crop.flip.vertical === false; addFilter2("SHOULD_PREPARE_OUTPUT", (shouldPrepareOutput, {query}) => new Promise((resolve) => { resolve(!query("IS_ASYNC")); })); const shouldTransformFile = (query, file2, item2) => new Promise((resolve) => { if (!query("GET_ALLOW_IMAGE_TRANSFORM") || item2.archived || !isFile2(file2) || !isImage3(file2)) { return resolve(false); } getImageSize3(file2).then(() => { const fn2 = query("GET_IMAGE_TRANSFORM_IMAGE_FILTER"); if (fn2) { const filterResult = fn2(file2); if (filterResult == null) { return handleRevert(true); } if (typeof filterResult === "boolean") { return resolve(filterResult); } if (typeof filterResult.then === "function") { return filterResult.then(resolve); } } resolve(true); }).catch((err) => { resolve(false); }); }); addFilter2("DID_CREATE_ITEM", (item2, {query, dispatch}) => { if (!query("GET_ALLOW_IMAGE_TRANSFORM")) return; item2.extend("requestPrepare", () => new Promise((resolve, reject) => { dispatch("REQUEST_PREPARE_OUTPUT", { query: item2.id, item: item2, success: resolve, failure: reject }, true); })); }); addFilter2("PREPARE_OUTPUT", (file2, {query, item: item2}) => new Promise((resolve) => { shouldTransformFile(query, file2, item2).then((shouldTransform) => { if (!shouldTransform) return resolve(file2); const variants = []; if (query("GET_IMAGE_TRANSFORM_VARIANTS_INCLUDE_ORIGINAL")) { variants.push(() => new Promise((resolve2) => { resolve2({ name: query("GET_IMAGE_TRANSFORM_VARIANTS_ORIGINAL_NAME"), file: file2 }); })); } if (query("GET_IMAGE_TRANSFORM_VARIANTS_INCLUDE_DEFAULT")) { variants.push((transform2, file3, metadata) => new Promise((resolve2) => { transform2(file3, metadata).then((file4) => resolve2({ name: query("GET_IMAGE_TRANSFORM_VARIANTS_DEFAULT_NAME"), file: file4 })); })); } const variantsDefinition = query("GET_IMAGE_TRANSFORM_VARIANTS") || {}; forin2(variantsDefinition, (key, fn2) => { const createVariant = createVariantCreator(fn2); variants.push((transform2, file3, metadata) => new Promise((resolve2) => { createVariant(transform2, file3, metadata).then((file4) => resolve2({name: key, file: file4})); })); }); const qualityAsPercentage = query("GET_IMAGE_TRANSFORM_OUTPUT_QUALITY"); const qualityMode = query("GET_IMAGE_TRANSFORM_OUTPUT_QUALITY_MODE"); const quality = qualityAsPercentage === null ? null : qualityAsPercentage / 100; const type = query("GET_IMAGE_TRANSFORM_OUTPUT_MIME_TYPE"); const clientTransforms = query("GET_IMAGE_TRANSFORM_CLIENT_TRANSFORMS") || TRANSFORM_LIST; item2.setMetadata("output", { type, quality, client: clientTransforms }, true); const transform = (file3, metadata) => new Promise((resolve2, reject) => { const filteredMetadata = {...metadata}; Object.keys(filteredMetadata).filter((instruction) => instruction !== "exif").forEach((instruction) => { if (clientTransforms.indexOf(instruction) === -1) { delete filteredMetadata[instruction]; } }); const {resize, exif, output, crop, filter, markup} = filteredMetadata; const instructions = { image: { orientation: exif ? exif.orientation : null }, output: output && (output.type || typeof output.quality === "number" || output.background) ? { type: output.type, quality: typeof output.quality === "number" ? output.quality * 100 : null, background: output.background || query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR") || null } : void 0, size: resize && (resize.size.width || resize.size.height) ? { mode: resize.mode, upscale: resize.upscale, ...resize.size } : void 0, crop: crop && !isDefaultCrop(crop) ? { ...crop } : void 0, markup: markup && markup.length ? markup.map(prepareMarkup2) : [], filter }; if (instructions.output) { const willChangeType = output.type ? output.type !== file3.type : false; const canChangeQuality = /\/jpe?g$/.test(file3.type); const willChangeQuality = output.quality !== null ? canChangeQuality && qualityMode === "always" : false; const willModifyImageData = !!(instructions.size || instructions.crop || instructions.filter || willChangeType || willChangeQuality); if (!willModifyImageData) return resolve2(file3); } const options2 = { beforeCreateBlob: query("GET_IMAGE_TRANSFORM_BEFORE_CREATE_BLOB"), afterCreateBlob: query("GET_IMAGE_TRANSFORM_AFTER_CREATE_BLOB"), canvasMemoryLimit: query("GET_IMAGE_TRANSFORM_CANVAS_MEMORY_LIMIT"), stripImageHead: query("GET_IMAGE_TRANSFORM_OUTPUT_STRIP_IMAGE_HEAD") }; transformImage(file3, instructions, options2).then((blob2) => { const out = getFileFromBlob2(blob2, renameFileToMatchMimeType(file3.name, getValidOutputMimeType(blob2.type))); resolve2(out); }).catch(reject); }); const variantPromises = variants.map((create3) => create3(transform, file2, item2.getMetadata())); Promise.all(variantPromises).then((files) => { resolve(files.length === 1 && files[0].name === null ? files[0].file : files); }); }); })); return { options: { allowImageTransform: [true, Type2.BOOLEAN], imageTransformImageFilter: [null, Type2.FUNCTION], imageTransformOutputMimeType: [null, Type2.STRING], imageTransformOutputQuality: [null, Type2.INT], imageTransformOutputStripImageHead: [true, Type2.BOOLEAN], imageTransformClientTransforms: [null, Type2.ARRAY], imageTransformOutputQualityMode: ["always", Type2.STRING], imageTransformVariants: [null, Type2.OBJECT], imageTransformVariantsIncludeDefault: [true, Type2.BOOLEAN], imageTransformVariantsDefaultName: [null, Type2.STRING], imageTransformVariantsIncludeOriginal: [false, Type2.BOOLEAN], imageTransformVariantsOriginalName: ["original_", Type2.STRING], imageTransformBeforeCreateBlob: [null, Type2.FUNCTION], imageTransformAfterCreateBlob: [null, Type2.FUNCTION], imageTransformCanvasMemoryLimit: [isBrowser8 && isIOS ? 4096 * 4096 : null, Type2.INT], imageTransformCanvasBackgroundColor: [null, Type2.STRING] } }; }; if (isBrowser8) { document.dispatchEvent(new CustomEvent("FilePond:pluginloaded", {detail: plugin7})); } var filepond_plugin_image_transform_esm_default = plugin7; // node_modules/filepond-plugin-media-preview/dist/filepond-plugin-media-preview.esm.js /*! * FilePondPluginMediaPreview 1.0.11 * Licensed under MIT, https://opensource.org/licenses/MIT/ * Please visit undefined for details. */ var isPreviewableVideo = (file2) => /^video/.test(file2.type); var isPreviewableAudio = (file2) => /^audio/.test(file2.type); var AudioPlayer = class { constructor(mediaEl, audioElems) { this.mediaEl = mediaEl; this.audioElems = audioElems; this.onplayhead = false; this.duration = 0; this.timelineWidth = this.audioElems.timeline.offsetWidth - this.audioElems.playhead.offsetWidth; this.moveplayheadFn = this.moveplayhead.bind(this); this.registerListeners(); } registerListeners() { this.mediaEl.addEventListener("timeupdate", this.timeUpdate.bind(this), false); this.mediaEl.addEventListener("canplaythrough", () => this.duration = this.mediaEl.duration, false); this.audioElems.timeline.addEventListener("click", this.timelineClicked.bind(this), false); this.audioElems.button.addEventListener("click", this.play.bind(this)); this.audioElems.playhead.addEventListener("mousedown", this.mouseDown.bind(this), false); window.addEventListener("mouseup", this.mouseUp.bind(this), false); } play() { if (this.mediaEl.paused) { this.mediaEl.play(); } else { this.mediaEl.pause(); } this.audioElems.button.classList.toggle("play"); this.audioElems.button.classList.toggle("pause"); } timeUpdate() { let playPercent = this.mediaEl.currentTime / this.duration * 100; this.audioElems.playhead.style.marginLeft = playPercent + "%"; if (this.mediaEl.currentTime === this.duration) { this.audioElems.button.classList.toggle("play"); this.audioElems.button.classList.toggle("pause"); } } moveplayhead(event) { let newMargLeft = event.clientX - this.getPosition(this.audioElems.timeline); if (newMargLeft >= 0 && newMargLeft <= this.timelineWidth) { this.audioElems.playhead.style.marginLeft = newMargLeft + "px"; } if (newMargLeft < 0) { this.audioElems.playhead.style.marginLeft = "0px"; } if (newMargLeft > this.timelineWidth) { this.audioElems.playhead.style.marginLeft = this.timelineWidth - 4 + "px"; } } timelineClicked(event) { this.moveplayhead(event); this.mediaEl.currentTime = this.duration * this.clickPercent(event); } mouseDown() { this.onplayhead = true; window.addEventListener("mousemove", this.moveplayheadFn, true); this.mediaEl.removeEventListener("timeupdate", this.timeUpdate.bind(this), false); } mouseUp(event) { window.removeEventListener("mousemove", this.moveplayheadFn, true); if (this.onplayhead == true) { this.moveplayhead(event); this.mediaEl.currentTime = this.duration * this.clickPercent(event); this.mediaEl.addEventListener("timeupdate", this.timeUpdate.bind(this), false); } this.onplayhead = false; } clickPercent(event) { return (event.clientX - this.getPosition(this.audioElems.timeline)) / this.timelineWidth; } getPosition(el) { return el.getBoundingClientRect().left; } }; var createMediaView = (_) => _.utils.createView({ name: "media-preview", tag: "div", ignoreRect: true, create: ({root: root2, props}) => { const {id} = props; const item2 = root2.query("GET_ITEM", {id: props.id}); let tagName = isPreviewableAudio(item2.file) ? "audio" : "video"; root2.ref.media = document.createElement(tagName); root2.ref.media.setAttribute("controls", true); root2.element.appendChild(root2.ref.media); if (isPreviewableAudio(item2.file)) { let docfrag = document.createDocumentFragment(); root2.ref.audio = []; root2.ref.audio.container = document.createElement("div"), root2.ref.audio.button = document.createElement("span"), root2.ref.audio.timeline = document.createElement("div"), root2.ref.audio.playhead = document.createElement("div"); root2.ref.audio.container.className = "audioplayer"; root2.ref.audio.button.className = "playpausebtn play"; root2.ref.audio.timeline.className = "timeline"; root2.ref.audio.playhead.className = "playhead"; root2.ref.audio.timeline.appendChild(root2.ref.audio.playhead); root2.ref.audio.container.appendChild(root2.ref.audio.button); root2.ref.audio.container.appendChild(root2.ref.audio.timeline); docfrag.appendChild(root2.ref.audio.container); root2.element.appendChild(docfrag); } }, write: _.utils.createRoute({ DID_MEDIA_PREVIEW_LOAD: ({root: root2, props}) => { const {id} = props; const item2 = root2.query("GET_ITEM", {id: props.id}); if (!item2) return; let URL2 = window.URL || window.webkitURL; let blob2 = new Blob([item2.file], {type: item2.file.type}); root2.ref.media.type = item2.file.type; root2.ref.media.src = item2.file.mock && item2.file.url || URL2.createObjectURL(blob2); if (isPreviewableAudio(item2.file)) { new AudioPlayer(root2.ref.media, root2.ref.audio); } root2.ref.media.addEventListener("loadeddata", () => { let height = 75; if (isPreviewableVideo(item2.file)) { let containerWidth = root2.ref.media.offsetWidth; let factor = root2.ref.media.videoWidth / containerWidth; height = root2.ref.media.videoHeight / factor; } root2.dispatch("DID_UPDATE_PANEL_HEIGHT", { id: props.id, height }); }, false); } }) }); var createMediaWrapperView = (_) => { const didCreatePreviewContainer = ({root: root2, props}) => { const {id} = props; const item2 = root2.query("GET_ITEM", id); if (!item2) return; root2.dispatch("DID_MEDIA_PREVIEW_LOAD", { id }); }; const create3 = ({root: root2, props}) => { const media = createMediaView(_); root2.ref.media = root2.appendChildView(root2.createChildView(media, { id: props.id })); }; return _.utils.createView({ name: "media-preview-wrapper", create: create3, write: _.utils.createRoute({ DID_MEDIA_PREVIEW_CONTAINER_CREATE: didCreatePreviewContainer }) }); }; var plugin8 = (fpAPI) => { const {addFilter: addFilter2, utils} = fpAPI; const {Type: Type2, createRoute: createRoute2} = utils; const mediaWrapperView = createMediaWrapperView(fpAPI); addFilter2("CREATE_VIEW", (viewAPI) => { const {is: is2, view, query} = viewAPI; if (!is2("file")) { return; } const didLoadItem2 = ({root: root2, props}) => { const {id} = props; const item2 = query("GET_ITEM", id); const allowVideoPreview = query("GET_ALLOW_VIDEO_PREVIEW"); const allowAudioPreview = query("GET_ALLOW_AUDIO_PREVIEW"); if (!item2 || item2.archived || (!isPreviewableVideo(item2.file) || !allowVideoPreview) && (!isPreviewableAudio(item2.file) || !allowAudioPreview)) { return; } root2.ref.mediaPreview = view.appendChildView(view.createChildView(mediaWrapperView, {id})); root2.dispatch("DID_MEDIA_PREVIEW_CONTAINER_CREATE", {id}); }; view.registerWriter(createRoute2({ DID_LOAD_ITEM: didLoadItem2 }, ({root: root2, props}) => { const {id} = props; const item2 = query("GET_ITEM", id); const allowVideoPreview = root2.query("GET_ALLOW_VIDEO_PREVIEW"); const allowAudioPreview = root2.query("GET_ALLOW_AUDIO_PREVIEW"); if (!item2 || (!isPreviewableVideo(item2.file) || !allowVideoPreview) && (!isPreviewableAudio(item2.file) || !allowAudioPreview) || root2.rect.element.hidden) return; })); }); return { options: { allowVideoPreview: [true, Type2.BOOLEAN], allowAudioPreview: [true, Type2.BOOLEAN] } }; }; var isBrowser9 = typeof window !== "undefined" && typeof window.document !== "undefined"; if (isBrowser9) { document.dispatchEvent(new CustomEvent("FilePond:pluginloaded", {detail: plugin8})); } // node_modules/filepond/locale/ar-ar.js var ar_ar_default = { labelIdle: '\u0627\u0633\u062D\u0628 \u0648 \u0627\u062F\u0631\u062C \u0645\u0644\u0641\u0627\u062A\u0643 \u0623\u0648 \u062A\u0635\u0641\u062D ', labelInvalidField: "\u0627\u0644\u062D\u0642\u0644 \u064A\u062D\u062A\u0648\u064A \u0639\u0644\u0649 \u0645\u0644\u0641\u0627\u062A \u063A\u064A\u0631 \u0635\u0627\u0644\u062D\u0629", labelFileWaitingForSize: "\u0628\u0627\u0646\u062A\u0638\u0627\u0631 \u0627\u0644\u062D\u062C\u0645", labelFileSizeNotAvailable: "\u0627\u0644\u062D\u062C\u0645 \u063A\u064A\u0631 \u0645\u062A\u0627\u062D", labelFileLoading: "\u0628\u0627\u0644\u0625\u0646\u062A\u0638\u0627\u0631", labelFileLoadError: "\u062D\u062F\u062B \u062E\u0637\u0623 \u0623\u062B\u0646\u0627\u0621 \u0627\u0644\u062A\u062D\u0645\u064A\u0644", labelFileProcessing: "\u064A\u062A\u0645 \u0627\u0644\u0631\u0641\u0639", labelFileProcessingComplete: "\u062A\u0645 \u0627\u0644\u0631\u0641\u0639", labelFileProcessingAborted: "\u062A\u0645 \u0625\u0644\u063A\u0627\u0621 \u0627\u0644\u0631\u0641\u0639", labelFileProcessingError: "\u062D\u062F\u062B \u062E\u0637\u0623 \u0623\u062B\u0646\u0627\u0621 \u0627\u0644\u0631\u0641\u0639", labelFileProcessingRevertError: "\u062D\u062F\u062B \u062E\u0637\u0623 \u0623\u062B\u0646\u0627\u0621 \u0627\u0644\u062A\u0631\u0627\u062C\u0639", labelFileRemoveError: "\u062D\u062F\u062B \u062E\u0637\u0623 \u0623\u062B\u0646\u0627\u0621 \u0627\u0644\u062D\u0630\u0641", labelTapToCancel: "\u0627\u0646\u0642\u0631 \u0644\u0644\u0625\u0644\u063A\u0627\u0621", labelTapToRetry: "\u0627\u0646\u0642\u0631 \u0644\u0625\u0639\u0627\u062F\u0629 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629", labelTapToUndo: "\u0627\u0646\u0642\u0631 \u0644\u0644\u062A\u0631\u0627\u062C\u0639", labelButtonRemoveItem: "\u0645\u0633\u062D", labelButtonAbortItemLoad: "\u0625\u0644\u063A\u0627\u0621", labelButtonRetryItemLoad: "\u0625\u0639\u0627\u062F\u0629", labelButtonAbortItemProcessing: "\u0625\u0644\u063A\u0627\u0621", labelButtonUndoItemProcessing: "\u062A\u0631\u0627\u062C\u0639", labelButtonRetryItemProcessing: "\u0625\u0639\u0627\u062F\u0629", labelButtonProcessItem: "\u0631\u0641\u0639", labelMaxFileSizeExceeded: "\u0627\u0644\u0645\u0644\u0641 \u0643\u0628\u064A\u0631 \u062C\u062F\u0627", labelMaxFileSize: "\u062D\u062C\u0645 \u0627\u0644\u0645\u0644\u0641 \u0627\u0644\u0623\u0642\u0635\u0649: {filesize}", labelMaxTotalFileSizeExceeded: "\u062A\u0645 \u062A\u062C\u0627\u0648\u0632 \u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 \u0644\u0644\u062D\u062C\u0645 \u0627\u0644\u0625\u062C\u0645\u0627\u0644\u064A", labelMaxTotalFileSize: "\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 \u0644\u062D\u062C\u0645 \u0627\u0644\u0645\u0644\u0641: {filesize}", labelFileTypeNotAllowed: "\u0645\u0644\u0641 \u0645\u0646 \u0646\u0648\u0639 \u063A\u064A\u0631 \u0635\u0627\u0644\u062D", fileValidateTypeLabelExpectedTypes: "\u062A\u062A\u0648\u0642\u0639 {allButLastType} \u0645\u0646 {lastType}", imageValidateSizeLabelFormatError: "\u0646\u0648\u0639 \u0627\u0644\u0635\u0648\u0631\u0629 \u063A\u064A\u0631 \u0645\u062F\u0639\u0648\u0645", imageValidateSizeLabelImageSizeTooSmall: "\u0627\u0644\u0635\u0648\u0631\u0629 \u0635\u063A\u064A\u0631 \u062C\u062F\u0627", imageValidateSizeLabelImageSizeTooBig: "\u0627\u0644\u0635\u0648\u0631\u0629 \u0643\u0628\u064A\u0631\u0629 \u062C\u062F\u0627", imageValidateSizeLabelExpectedMinSize: "\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u062F\u0646\u0649 \u0644\u0644\u0623\u0628\u0639\u0627\u062F \u0647\u0648: {minWidth} \xD7 {minHeight}", imageValidateSizeLabelExpectedMaxSize: "\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 \u0644\u0644\u0623\u0628\u0639\u0627\u062F \u0647\u0648: {maxWidth} \xD7 {maxHeight}", imageValidateSizeLabelImageResolutionTooLow: "\u0627\u0644\u062F\u0642\u0629 \u0636\u0639\u064A\u0641\u0629 \u062C\u062F\u0627", imageValidateSizeLabelImageResolutionTooHigh: "\u0627\u0644\u062F\u0642\u0629 \u0645\u0631\u062A\u0641\u0639\u0629 \u062C\u062F\u0627", imageValidateSizeLabelExpectedMinResolution: "\u0623\u0642\u0644 \u062F\u0642\u0629: {minResolution}", imageValidateSizeLabelExpectedMaxResolution: "\u0623\u0642\u0635\u0649 \u062F\u0642\u0629: {maxResolution}" }; // node_modules/filepond/locale/cs-cz.js var cs_cz_default = { labelIdle: 'P\u0159et\xE1hn\u011Bte soubor sem (drag&drop) nebo Vyhledat ', labelInvalidField: "Pole obsahuje chybn\xE9 soubory", labelFileWaitingForSize: "Zji\u0161\u0165uje se velikost", labelFileSizeNotAvailable: "Velikost nen\xED zn\xE1m\xE1", labelFileLoading: "P\u0159en\xE1\u0161\xED se", labelFileLoadError: "Chyba p\u0159i p\u0159enosu", labelFileProcessing: "Prob\xEDh\xE1 upload", labelFileProcessingComplete: "Upload dokon\u010Den", labelFileProcessingAborted: "Upload stornov\xE1n", labelFileProcessingError: "Chyba p\u0159i uploadu", labelFileProcessingRevertError: "Chyba p\u0159i obnov\u011B", labelFileRemoveError: "Chyba p\u0159i odstran\u011Bn\xED", labelTapToCancel: "klepn\u011Bte pro storno", labelTapToRetry: "klepn\u011Bte pro opakov\xE1n\xED", labelTapToUndo: "klepn\u011Bte pro vr\xE1cen\xED", labelButtonRemoveItem: "Odstranit", labelButtonAbortItemLoad: "Storno", labelButtonRetryItemLoad: "Opakovat", labelButtonAbortItemProcessing: "Zp\u011Bt", labelButtonUndoItemProcessing: "Vr\xE1tit", labelButtonRetryItemProcessing: "Opakovat", labelButtonProcessItem: "Upload", labelMaxFileSizeExceeded: "Soubor je p\u0159\xEDli\u0161 velk\xFD", labelMaxFileSize: "Nejv\u011Bt\u0161\xED velikost souboru je {filesize}", labelMaxTotalFileSizeExceeded: "P\u0159ekro\u010Dena maxim\xE1ln\xED celkov\xE1 velikost souboru", labelMaxTotalFileSize: "Maxim\xE1ln\xED celkov\xE1 velikost souboru je {filesize}", labelFileTypeNotAllowed: "Soubor je nespr\xE1vn\xE9ho typu", fileValidateTypeLabelExpectedTypes: "O\u010Dek\xE1v\xE1 se {allButLastType} nebo {lastType}", imageValidateSizeLabelFormatError: "Obr\xE1zek tohoto typu nen\xED podporov\xE1n", imageValidateSizeLabelImageSizeTooSmall: "Obr\xE1zek je p\u0159\xEDli\u0161 mal\xFD", imageValidateSizeLabelImageSizeTooBig: "Obr\xE1zek je p\u0159\xEDli\u0161 velk\xFD", imageValidateSizeLabelExpectedMinSize: "Minim\xE1ln\xED rozm\u011Br je {minWidth} \xD7 {minHeight}", imageValidateSizeLabelExpectedMaxSize: "Maxim\xE1ln\xED rozm\u011Br je {maxWidth} \xD7 {maxHeight}", imageValidateSizeLabelImageResolutionTooLow: "Rozli\u0161en\xED je p\u0159\xEDli\u0161 mal\xE9", imageValidateSizeLabelImageResolutionTooHigh: "Rozli\u0161en\xED je p\u0159\xEDli\u0161 velk\xE9", imageValidateSizeLabelExpectedMinResolution: "Minim\xE1ln\xED rozli\u0161en\xED je {minResolution}", imageValidateSizeLabelExpectedMaxResolution: "Maxim\xE1ln\xED rozli\u0161en\xED je {maxResolution}" }; // node_modules/filepond/locale/da-dk.js var da_dk_default = { labelIdle: 'Tr\xE6k & slip filer eller Gennemse ', labelInvalidField: "Felt indeholder ugyldige filer", labelFileWaitingForSize: "Venter p\xE5 st\xF8rrelse", labelFileSizeNotAvailable: "St\xF8rrelse ikke tilg\xE6ngelig", labelFileLoading: "Loader", labelFileLoadError: "Load fejlede", labelFileProcessing: "Uploader", labelFileProcessingComplete: "Upload f\xE6rdig", labelFileProcessingAborted: "Upload annulleret", labelFileProcessingError: "Upload fejlede", labelFileProcessingRevertError: "Fortryd fejlede", labelFileRemoveError: "Fjern fejlede", labelTapToCancel: "tryk for at annullere", labelTapToRetry: "tryk for at pr\xF8ve igen", labelTapToUndo: "tryk for at fortryde", labelButtonRemoveItem: "Fjern", labelButtonAbortItemLoad: "Annuller", labelButtonRetryItemLoad: "Fors\xF8g igen", labelButtonAbortItemProcessing: "Annuller", labelButtonUndoItemProcessing: "Fortryd", labelButtonRetryItemProcessing: "Pr\xF8v igen", labelButtonProcessItem: "Upload", labelMaxFileSizeExceeded: "Filen er for stor", labelMaxFileSize: "Maksimal filst\xF8rrelse er {filesize}", labelMaxTotalFileSizeExceeded: "Maksimal totalst\xF8rrelse overskredet", labelMaxTotalFileSize: "Maksimal total filst\xF8rrelse er {filesize}", labelFileTypeNotAllowed: "Ugyldig filtype", fileValidateTypeLabelExpectedTypes: "Forventer {allButLastType} eller {lastType}", imageValidateSizeLabelFormatError: "Ugyldigt format", imageValidateSizeLabelImageSizeTooSmall: "Billedet er for lille", imageValidateSizeLabelImageSizeTooBig: "Billedet er for stort", imageValidateSizeLabelExpectedMinSize: "Minimum st\xF8rrelse er {minBredde} \xD7 {minH\xF8jde}", imageValidateSizeLabelExpectedMaxSize: "Maksimal st\xF8rrelse er {maxWidth} \xD7 {maxHeight}", imageValidateSizeLabelImageResolutionTooLow: "For lav opl\xF8sning", imageValidateSizeLabelImageResolutionTooHigh: "For h\xF8j opl\xF8sning", imageValidateSizeLabelExpectedMinResolution: "Minimum opl\xF8sning er {minResolution}", imageValidateSizeLabelExpectedMaxResolution: "Maksimal opl\xF8sning er {maxResolution}" }; // node_modules/filepond/locale/de-de.js var de_de_default = { labelIdle: 'Dateien ablegen oder ausw\xE4hlen ', labelInvalidField: "Feld beinhaltet ung\xFCltige Dateien", labelFileWaitingForSize: "Dateigr\xF6\xDFe berechnen", labelFileSizeNotAvailable: "Dateigr\xF6\xDFe nicht verf\xFCgbar", labelFileLoading: "Laden", labelFileLoadError: "Fehler beim Laden", labelFileProcessing: "Upload l\xE4uft", labelFileProcessingComplete: "Upload abgeschlossen", labelFileProcessingAborted: "Upload abgebrochen", labelFileProcessingError: "Fehler beim Upload", labelFileProcessingRevertError: "Fehler beim Wiederherstellen", labelFileRemoveError: "Fehler beim L\xF6schen", labelTapToCancel: "abbrechen", labelTapToRetry: "erneut versuchen", labelTapToUndo: "r\xFCckg\xE4ngig", labelButtonRemoveItem: "Entfernen", labelButtonAbortItemLoad: "Verwerfen", labelButtonRetryItemLoad: "Erneut versuchen", labelButtonAbortItemProcessing: "Abbrechen", labelButtonUndoItemProcessing: "R\xFCckg\xE4ngig", labelButtonRetryItemProcessing: "Erneut versuchen", labelButtonProcessItem: "Upload", labelMaxFileSizeExceeded: "Datei ist zu gro\xDF", labelMaxFileSize: "Maximale Dateigr\xF6\xDFe: {filesize}", labelMaxTotalFileSizeExceeded: "Maximale gesamte Dateigr\xF6\xDFe \xFCberschritten", labelMaxTotalFileSize: "Maximale gesamte Dateigr\xF6\xDFe: {filesize}", labelFileTypeNotAllowed: "Dateityp ung\xFCltig", fileValidateTypeLabelExpectedTypes: "Erwartet {allButLastType} oder {lastType}", imageValidateSizeLabelFormatError: "Bildtyp nicht unterst\xFCtzt", imageValidateSizeLabelImageSizeTooSmall: "Bild ist zu klein", imageValidateSizeLabelImageSizeTooBig: "Bild ist zu gro\xDF", imageValidateSizeLabelExpectedMinSize: "Mindestgr\xF6\xDFe: {minWidth} \xD7 {minHeight}", imageValidateSizeLabelExpectedMaxSize: "Maximale Gr\xF6\xDFe: {maxWidth} \xD7 {maxHeight}", imageValidateSizeLabelImageResolutionTooLow: "Aufl\xF6sung ist zu niedrig", imageValidateSizeLabelImageResolutionTooHigh: "Aufl\xF6sung ist zu hoch", imageValidateSizeLabelExpectedMinResolution: "Mindestaufl\xF6sung: {minResolution}", imageValidateSizeLabelExpectedMaxResolution: "Maximale Aufl\xF6sung: {maxResolution}" }; // node_modules/filepond/locale/en-en.js var en_en_default = { labelIdle: 'Drag & Drop your files or Browse ', labelInvalidField: "Field contains invalid files", labelFileWaitingForSize: "Waiting for size", labelFileSizeNotAvailable: "Size not available", labelFileLoading: "Loading", labelFileLoadError: "Error during load", labelFileProcessing: "Uploading", labelFileProcessingComplete: "Upload complete", labelFileProcessingAborted: "Upload cancelled", labelFileProcessingError: "Error during upload", labelFileProcessingRevertError: "Error during revert", labelFileRemoveError: "Error during remove", labelTapToCancel: "tap to cancel", labelTapToRetry: "tap to retry", labelTapToUndo: "tap to undo", labelButtonRemoveItem: "Remove", labelButtonAbortItemLoad: "Abort", labelButtonRetryItemLoad: "Retry", labelButtonAbortItemProcessing: "Cancel", labelButtonUndoItemProcessing: "Undo", labelButtonRetryItemProcessing: "Retry", labelButtonProcessItem: "Upload", labelMaxFileSizeExceeded: "File is too large", labelMaxFileSize: "Maximum file size is {filesize}", labelMaxTotalFileSizeExceeded: "Maximum total size exceeded", labelMaxTotalFileSize: "Maximum total file size is {filesize}", labelFileTypeNotAllowed: "File of invalid type", fileValidateTypeLabelExpectedTypes: "Expects {allButLastType} or {lastType}", imageValidateSizeLabelFormatError: "Image type not supported", imageValidateSizeLabelImageSizeTooSmall: "Image is too small", imageValidateSizeLabelImageSizeTooBig: "Image is too big", imageValidateSizeLabelExpectedMinSize: "Minimum size is {minWidth} \xD7 {minHeight}", imageValidateSizeLabelExpectedMaxSize: "Maximum size is {maxWidth} \xD7 {maxHeight}", imageValidateSizeLabelImageResolutionTooLow: "Resolution is too low", imageValidateSizeLabelImageResolutionTooHigh: "Resolution is too high", imageValidateSizeLabelExpectedMinResolution: "Minimum resolution is {minResolution}", imageValidateSizeLabelExpectedMaxResolution: "Maximum resolution is {maxResolution}" }; // node_modules/filepond/locale/es-es.js var es_es_default = { labelIdle: 'Arrastra y suelta tus archivos o Examinar ', labelInvalidField: "El campo contiene archivos inv\xE1lidos", labelFileWaitingForSize: "Esperando tama\xF1o", labelFileSizeNotAvailable: "Tama\xF1o no disponible", labelFileLoading: "Cargando", labelFileLoadError: "Error durante la carga", labelFileProcessing: "Cargando", labelFileProcessingComplete: "Carga completa", labelFileProcessingAborted: "Carga cancelada", labelFileProcessingError: "Error durante la carga", labelFileProcessingRevertError: "Error durante la reversi\xF3n", labelFileRemoveError: "Error durante la eliminaci\xF3n", labelTapToCancel: "toca para cancelar", labelTapToRetry: "tocar para volver a intentar", labelTapToUndo: "tocar para deshacer", labelButtonRemoveItem: "Eliminar", labelButtonAbortItemLoad: "Abortar", labelButtonRetryItemLoad: "Reintentar", labelButtonAbortItemProcessing: "Cancelar", labelButtonUndoItemProcessing: "Deshacer", labelButtonRetryItemProcessing: "Reintentar", labelButtonProcessItem: "Cargar", labelMaxFileSizeExceeded: "El archivo es demasiado grande", labelMaxFileSize: "El tama\xF1o m\xE1ximo del archivo es {filesize}", labelMaxTotalFileSizeExceeded: "Tama\xF1o total m\xE1ximo excedido", labelMaxTotalFileSize: "El tama\xF1o total m\xE1ximo del archivo es {filesize}", labelFileTypeNotAllowed: "Archivo de tipo no v\xE1lido", fileValidateTypeLabelExpectedTypes: "Espera {allButLastType} o {lastType}", imageValidateSizeLabelFormatError: "Tipo de imagen no compatible", imageValidateSizeLabelImageSizeTooSmall: "La imagen es demasiado peque\xF1a", imageValidateSizeLabelImageSizeTooBig: "La imagen es demasiado grande", imageValidateSizeLabelExpectedMinSize: "El tama\xF1o m\xEDnimo es {minWidth} \xD7 {minHeight}", imageValidateSizeLabelExpectedMaxSize: "El tama\xF1o m\xE1ximo es {maxWidth} \xD7 {maxHeight}", imageValidateSizeLabelImageResolutionTooLow: "La resoluci\xF3n es demasiado baja", imageValidateSizeLabelImageResolutionTooHigh: "La resoluci\xF3n es demasiado alta", imageValidateSizeLabelExpectedMinResolution: "La resoluci\xF3n m\xEDnima es {minResolution}", imageValidateSizeLabelExpectedMaxResolution: "La resoluci\xF3n m\xE1xima es {maxResolution}" }; // node_modules/filepond/locale/fa_ir.js var fa_ir_default = { labelIdle: '\u0641\u0627\u06CC\u0644 \u0631\u0627 \u0627\u06CC\u0646\u062C\u0627 \u0628\u06A9\u0634\u06CC\u062F \u0648 \u0631\u0647\u0627 \u06A9\u0646\u06CC\u062F\u060C \u06CC\u0627 \u062C\u0633\u062A\u062C\u0648 \u06A9\u0646\u06CC\u062F ', labelInvalidField: "\u0641\u06CC\u0644\u062F \u062F\u0627\u0631\u0627\u06CC \u0641\u0627\u06CC\u0644 \u0647\u0627\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u0627\u0633\u062A", labelFileWaitingForSize: "Waiting for size", labelFileSizeNotAvailable: "\u062D\u062C\u0645 \u0641\u0627\u06CC\u0644 \u0645\u062C\u0627\u0632 \u0646\u06CC\u0633\u062A", labelFileLoading: "\u062F\u0631\u062D\u0627\u0644 \u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC", labelFileLoadError: "\u062E\u0637\u0627 \u062F\u0631 \u0632\u0645\u0627\u0646 \u0627\u062C\u0631\u0627", labelFileProcessing: "\u062F\u0631\u062D\u0627\u0644 \u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC", labelFileProcessingComplete: "\u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC \u06A9\u0627\u0645\u0644 \u0634\u062F", labelFileProcessingAborted: "\u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC \u0644\u063A\u0648 \u0634\u062F", labelFileProcessingError: "\u062E\u0637\u0627 \u062F\u0631 \u0632\u0645\u0627\u0646 \u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC", labelFileProcessingRevertError: "\u062E\u0637\u0627 \u062F\u0631 \u0632\u0645\u0627\u0646 \u062D\u0630\u0641", labelFileRemoveError: "\u062E\u0637\u0627 \u062F\u0631 \u0632\u0645\u0627\u0646 \u062D\u0630\u0641", labelTapToCancel: "\u0628\u0631\u0627\u06CC \u0644\u063A\u0648 \u0636\u0631\u0628\u0647 \u0628\u0632\u0646\u06CC\u062F", labelTapToRetry: "\u0628\u0631\u0627\u06CC \u062A\u06A9\u0631\u0627\u0631 \u06A9\u0644\u06CC\u06A9 \u06A9\u0646\u06CC\u062F", labelTapToUndo: "\u0628\u0631\u0627\u06CC \u0628\u0631\u06AF\u0634\u062A \u06A9\u0644\u06CC\u06A9 \u06A9\u0646\u06CC\u062F", labelButtonRemoveItem: "\u062D\u0630\u0641", labelButtonAbortItemLoad: "\u0644\u063A\u0648", labelButtonRetryItemLoad: "\u062A\u06A9\u0631\u0627\u0631", labelButtonAbortItemProcessing: "\u0644\u063A\u0648", labelButtonUndoItemProcessing: "\u0628\u0631\u06AF\u0634\u062A", labelButtonRetryItemProcessing: "\u062A\u06A9\u0631\u0627\u0631", labelButtonProcessItem: "\u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC", labelMaxFileSizeExceeded: "\u0641\u0627\u06CC\u0644 \u0628\u0633\u06CC\u0627\u0631 \u062D\u062C\u06CC\u0645 \u0627\u0633\u062A", labelMaxFileSize: "\u062D\u062F\u0627\u06A9\u062B\u0631 \u0645\u062C\u0627\u0632 \u0641\u0627\u06CC\u0644 {filesize} \u0627\u0633\u062A", labelMaxTotalFileSizeExceeded: "\u0627\u0632 \u062D\u062F\u0627\u06A9\u062B\u0631 \u062D\u062C\u0645 \u0641\u0627\u06CC\u0644 \u0628\u06CC\u0634\u062A\u0631 \u0634\u062F", labelMaxTotalFileSize: "\u062D\u062F\u0627\u06A9\u062B\u0631 \u062D\u062C\u0645 \u0641\u0627\u06CC\u0644 {filesize} \u0627\u0633\u062A", labelFileTypeNotAllowed: "\u0646\u0648\u0639 \u0641\u0627\u06CC\u0644 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u0627\u0633\u062A", fileValidateTypeLabelExpectedTypes: "\u062F\u0631 \u0627\u0646\u062A\u0638\u0627\u0631 {allButLastType} \u06CC\u0627 {lastType}", imageValidateSizeLabelFormatError: "\u0641\u0631\u0645\u062A \u062A\u0635\u0648\u06CC\u0631 \u067E\u0634\u062A\u06CC\u0628\u0627\u0646\u06CC \u0646\u0645\u06CC \u0634\u0648\u062F", imageValidateSizeLabelImageSizeTooSmall: "\u062A\u0635\u0648\u06CC\u0631 \u0628\u0633\u06CC\u0627\u0631 \u06A9\u0648\u0686\u06A9 \u0627\u0633\u062A", imageValidateSizeLabelImageSizeTooBig: "\u062A\u0635\u0648\u06CC\u0631 \u0628\u0633\u06CC\u0627\u0631 \u0628\u0632\u0631\u06AF \u0627\u0633\u062A", imageValidateSizeLabelExpectedMinSize: "\u062D\u062F\u0627\u0642\u0644 \u0627\u0646\u062F\u0627\u0632\u0647 {minWidth} \xD7 {minHeight} \u0627\u0633\u062A", imageValidateSizeLabelExpectedMaxSize: "\u062D\u062F\u0627\u06A9\u062B\u0631 \u0627\u0646\u062F\u0627\u0632\u0647 {maxWidth} \xD7 {maxHeight} \u0627\u0633\u062A", imageValidateSizeLabelImageResolutionTooLow: "\u0648\u0636\u0648\u062D \u062A\u0635\u0648\u06CC\u0631 \u0628\u0633\u06CC\u0627\u0631 \u06A9\u0645 \u0627\u0633\u062A", imageValidateSizeLabelImageResolutionTooHigh: "\u0648\u0636\u0648\u0639 \u062A\u0635\u0648\u06CC\u0631 \u0628\u0633\u06CC\u0627\u0631 \u0632\u06CC\u0627\u062F \u0627\u0633\u062A", imageValidateSizeLabelExpectedMinResolution: "\u062D\u062F\u0627\u0642\u0644 \u0648\u0636\u0648\u062D \u062A\u0635\u0648\u06CC\u0631 {minResolution} \u0627\u0633\u062A", imageValidateSizeLabelExpectedMaxResolution: "\u062D\u062F\u0627\u06A9\u062B\u0631 \u0648\u0636\u0648\u062D \u062A\u0635\u0648\u06CC\u0631 {maxResolution} \u0627\u0633\u062A" }; // node_modules/filepond/locale/fi-fi.js var fi_fi_default = { labelIdle: 'Ved\xE4 ja pudota tiedostoja tai Selaa ', labelInvalidField: "Kent\xE4ss\xE4 on virheellisi\xE4 tiedostoja", labelFileWaitingForSize: "Odotetaan kokoa", labelFileSizeNotAvailable: "Kokoa ei saatavilla", labelFileLoading: "Ladataan", labelFileLoadError: "Virhe latauksessa", labelFileProcessing: "L\xE4hetet\xE4\xE4n", labelFileProcessingComplete: "L\xE4hetys valmis", labelFileProcessingAborted: "L\xE4hetys peruttu", labelFileProcessingError: "Virhe l\xE4hetyksess\xE4", labelFileProcessingRevertError: "Virhe palautuksessa", labelFileRemoveError: "Virhe poistamisessa", labelTapToCancel: "peruuta napauttamalla", labelTapToRetry: "yrit\xE4 uudelleen napauttamalla", labelTapToUndo: "kumoa napauttamalla", labelButtonRemoveItem: "Poista", labelButtonAbortItemLoad: "Keskeyt\xE4", labelButtonRetryItemLoad: "Yrit\xE4 uudelleen", labelButtonAbortItemProcessing: "Peruuta", labelButtonUndoItemProcessing: "Kumoa", labelButtonRetryItemProcessing: "Yrit\xE4 uudelleen", labelButtonProcessItem: "L\xE4het\xE4", labelMaxFileSizeExceeded: "Tiedoston koko on liian suuri", labelMaxFileSize: "Tiedoston maksimikoko on {filesize}", labelMaxTotalFileSizeExceeded: "Tiedostojen yhdistetty maksimikoko ylitetty", labelMaxTotalFileSize: "Tiedostojen yhdistetty maksimikoko on {filesize}", labelFileTypeNotAllowed: "Tiedostotyyppi\xE4 ei sallita", fileValidateTypeLabelExpectedTypes: "Sallitaan {allButLastType} tai {lastType}", imageValidateSizeLabelFormatError: "Kuvatyyppi\xE4 ei tueta", imageValidateSizeLabelImageSizeTooSmall: "Kuva on liian pieni", imageValidateSizeLabelImageSizeTooBig: "Kuva on liian suuri", imageValidateSizeLabelExpectedMinSize: "Minimikoko on {minWidth} \xD7 {minHeight}", imageValidateSizeLabelExpectedMaxSize: "Maksimikoko on {maxWidth} \xD7 {maxHeight}", imageValidateSizeLabelImageResolutionTooLow: "Resoluutio on liian pieni", imageValidateSizeLabelImageResolutionTooHigh: "Resoluutio on liian suuri", imageValidateSizeLabelExpectedMinResolution: "Minimiresoluutio on {minResolution}", imageValidateSizeLabelExpectedMaxResolution: "Maksimiresoluutio on {maxResolution}" }; // node_modules/filepond/locale/fr-fr.js var fr_fr_default = { labelIdle: 'Faites glisser vos fichiers ou Parcourir ', labelInvalidField: "Le champ contient des fichiers invalides", labelFileWaitingForSize: "En attente de taille", labelFileSizeNotAvailable: "Taille non disponible", labelFileLoading: "Chargement", labelFileLoadError: "Erreur durant le chargement", labelFileProcessing: "Traitement", labelFileProcessingComplete: "Traitement effectu\xE9", labelFileProcessingAborted: "Traitement interrompu", labelFileProcessingError: "Erreur durant le traitement", labelFileProcessingRevertError: "Erreur durant la restauration", labelFileRemoveError: "Erreur durant la suppression", labelTapToCancel: "appuyer pour annuler", labelTapToRetry: "appuyer pour r\xE9essayer", labelTapToUndo: "appuyer pour revenir en arri\xE8re", labelButtonRemoveItem: "Retirer", labelButtonAbortItemLoad: "Annuler", labelButtonRetryItemLoad: "Recommencer", labelButtonAbortItemProcessing: "Annuler", labelButtonUndoItemProcessing: "Revenir en arri\xE8re", labelButtonRetryItemProcessing: "Recommencer", labelButtonProcessItem: "Transf\xE9rer", labelMaxFileSizeExceeded: "Le fichier est trop volumineux", labelMaxFileSize: "La taille maximale de fichier est {filesize}", labelMaxTotalFileSizeExceeded: "Taille totale maximale d\xE9pass\xE9e", labelMaxTotalFileSize: "La taille totale maximale des fichiers est {filesize}", labelFileTypeNotAllowed: "Fichier non valide", fileValidateTypeLabelExpectedTypes: "Attendu {allButLastType} ou {lastType}", imageValidateSizeLabelFormatError: "Type d'image non pris en charge", imageValidateSizeLabelImageSizeTooSmall: "L'image est trop petite", imageValidateSizeLabelImageSizeTooBig: "L'image est trop grande", imageValidateSizeLabelExpectedMinSize: "La taille minimale est {minWidth} \xD7 {minHeight}", imageValidateSizeLabelExpectedMaxSize: "La taille maximale est {maxWidth} \xD7 {maxHeight}", imageValidateSizeLabelImageResolutionTooLow: "La r\xE9solution est trop faible", imageValidateSizeLabelImageResolutionTooHigh: "La r\xE9solution est trop \xE9lev\xE9e", imageValidateSizeLabelExpectedMinResolution: "La r\xE9solution minimale est {minResolution}", imageValidateSizeLabelExpectedMaxResolution: "La r\xE9solution maximale est {maxResolution}" }; // node_modules/filepond/locale/hu-hu.js var hu_hu_default = { labelIdle: 'Mozgasd ide a f\xE1jlt a felt\xF6lt\xE9shez, vagy tall\xF3z\xE1s ', labelInvalidField: "A mez\u0151 \xE9rv\xE9nytelen f\xE1jlokat tartalmaz", labelFileWaitingForSize: "F\xE1ljm\xE9ret kisz\xE1mol\xE1sa", labelFileSizeNotAvailable: "A f\xE1jlm\xE9ret nem el\xE9rhet\u0151", labelFileLoading: "T\xF6lt\xE9s", labelFileLoadError: "Hiba a bet\xF6lt\xE9s sor\xE1n", labelFileProcessing: "Felt\xF6lt\xE9s", labelFileProcessingComplete: "Sikeres felt\xF6lt\xE9s", labelFileProcessingAborted: "A felt\xF6lt\xE9s megszak\xEDtva", labelFileProcessingError: "Hiba t\xF6rt\xE9nt a felt\xF6lt\xE9s sor\xE1n", labelFileProcessingRevertError: "Hiba a vissza\xE1ll\xEDt\xE1s sor\xE1n", labelFileRemoveError: "Hiba t\xF6rt\xE9nt az elt\xE1vol\xEDt\xE1s sor\xE1n", labelTapToCancel: "koppints a t\xF6rl\xE9shez", labelTapToRetry: "koppints az \xFAjrakezd\xE9shez", labelTapToUndo: "koppints a visszavon\xE1shoz", labelButtonRemoveItem: "Elt\xE1vol\xEDt\xE1s", labelButtonAbortItemLoad: "Megszak\xEDt\xE1s", labelButtonRetryItemLoad: "\xDAjrapr\xF3b\xE1lkoz\xE1s", labelButtonAbortItemProcessing: "Megszak\xEDt\xE1s", labelButtonUndoItemProcessing: "Visszavon\xE1s", labelButtonRetryItemProcessing: "\xDAjrapr\xF3b\xE1lkoz\xE1s", labelButtonProcessItem: "Felt\xF6lt\xE9s", labelMaxFileSizeExceeded: "A f\xE1jl t\xFAll\xE9pte a maxim\xE1lis m\xE9retet", labelMaxFileSize: "Maxim\xE1lis f\xE1jlm\xE9ret: {filesize}", labelMaxTotalFileSizeExceeded: "T\xFAll\xE9pte a maxim\xE1lis teljes m\xE9retet", labelMaxTotalFileSize: "A maxim\xE1is teljes f\xE1jlm\xE9ret: {filesize}", labelFileTypeNotAllowed: "\xC9rv\xE9nytelen t\xEDpus\xFA f\xE1jl", fileValidateTypeLabelExpectedTypes: "Enged\xE9lyezett t\xEDpusok {allButLastType} vagy {lastType}", imageValidateSizeLabelFormatError: "A k\xE9pt\xEDpus nem t\xE1mogatott", imageValidateSizeLabelImageSizeTooSmall: "A k\xE9p t\xFAl kicsi", imageValidateSizeLabelImageSizeTooBig: "A k\xE9p t\xFAl nagy", imageValidateSizeLabelExpectedMinSize: "Minimum m\xE9ret: {minWidth} \xD7 {minHeight}", imageValidateSizeLabelExpectedMaxSize: "Maximum m\xE9ret: {maxWidth} \xD7 {maxHeight}", imageValidateSizeLabelImageResolutionTooLow: "A felbont\xE1s t\xFAl alacsony", imageValidateSizeLabelImageResolutionTooHigh: "A felbont\xE1s t\xFAl magas", imageValidateSizeLabelExpectedMinResolution: "Minim\xE1is felbont\xE1s: {minResolution}", imageValidateSizeLabelExpectedMaxResolution: "Maxim\xE1lis felbont\xE1s: {maxResolution}" }; // node_modules/filepond/locale/id-id.js var id_id_default = { labelIdle: 'Seret dan Jatuhkan file Anda atau Jelajahi', labelInvalidField: "Field berisi file tidak valid", labelFileWaitingForSize: "Menunggu ukuran", labelFileSizeNotAvailable: "Ukuran tidak tersedia", labelFileLoading: "Memuat", labelFileLoadError: "Kesalahan saat memuat", labelFileProcessing: "Mengunggah", labelFileProcessingComplete: "Unggahan selesai", labelFileProcessingAborted: "Unggahan dibatalkan", labelFileProcessingError: "Kesalahan saat mengunggah", labelFileProcessingRevertError: "Kesalahan saat pengembalian", labelFileRemoveError: "Kesalahan saat menghapus", labelTapToCancel: "ketuk untuk membatalkan", labelTapToRetry: "ketuk untuk mencoba lagi", labelTapToUndo: "ketuk untuk mengurungkan", labelButtonRemoveItem: "Hapus", labelButtonAbortItemLoad: "Batal", labelButtonRetryItemLoad: "Coba Kembali", labelButtonAbortItemProcessing: "Batal", labelButtonUndoItemProcessing: "Batal", labelButtonRetryItemProcessing: "Coba Kembali", labelButtonProcessItem: "Unggah", labelMaxFileSizeExceeded: "File terlalu besar", labelMaxFileSize: "Ukuran file maksimum adalah {filesize}", labelMaxTotalFileSizeExceeded: "Jumlah file maksimum terlampaui", labelMaxTotalFileSize: "Jumlah file maksimum adalah {filesize}", labelFileTypeNotAllowed: "Jenis file tidak valid", fileValidateTypeLabelExpectedTypes: "Mengharapkan {allButLastType} atau {lastType}", imageValidateSizeLabelFormatError: "Jenis gambar tidak didukung", imageValidateSizeLabelImageSizeTooSmall: "Gambar terlalu kecil", imageValidateSizeLabelImageSizeTooBig: "Gambar terlalu besar", imageValidateSizeLabelExpectedMinSize: "Ukuran minimum adalah {minWidth} \xD7 {minHeight}", imageValidateSizeLabelExpectedMaxSize: "Ukuran maksimum adalah {minWidth} \xD7 {minHeight}", imageValidateSizeLabelImageResolutionTooLow: "Resolusi terlalu rendah", imageValidateSizeLabelImageResolutionTooHigh: "Resolusi terlalu tinggi", imageValidateSizeLabelExpectedMinResolution: "Resolusi minimum adalah {minResolution}", imageValidateSizeLabelExpectedMaxResolution: "Resolusi maksimum adalah {maxResolution}" }; // node_modules/filepond/locale/it-it.js var it_it_default = { labelIdle: 'Trascina e rilascia i tuoi file oppure Carica ', labelInvalidField: "Il campo contiene dei file non validi", labelFileWaitingForSize: "Aspettando le dimensioni", labelFileSizeNotAvailable: "Dimensioni non disponibili", labelFileLoading: "Caricamento", labelFileLoadError: "Errore durante il caricamento", labelFileProcessing: "Caricamento", labelFileProcessingComplete: "Caricamento completato", labelFileProcessingAborted: "Caricamento cancellato", labelFileProcessingError: "Errore durante il caricamento", labelFileProcessingRevertError: "Errore durante il ripristino", labelFileRemoveError: "Errore durante l'eliminazione", labelTapToCancel: "tocca per cancellare", labelTapToRetry: "tocca per riprovare", labelTapToUndo: "tocca per ripristinare", labelButtonRemoveItem: "Elimina", labelButtonAbortItemLoad: "Cancella", labelButtonRetryItemLoad: "Ritenta", labelButtonAbortItemProcessing: "Camcella", labelButtonUndoItemProcessing: "Indietro", labelButtonRetryItemProcessing: "Ritenta", labelButtonProcessItem: "Carica", labelMaxFileSizeExceeded: "Il peso del file \xE8 eccessivo", labelMaxFileSize: "Il peso massimo del file \xE8 {filesize}", labelMaxTotalFileSizeExceeded: "Dimensione totale massima superata", labelMaxTotalFileSize: "La dimensione massima totale del file \xE8 {filesize}", labelFileTypeNotAllowed: "File non supportato", fileValidateTypeLabelExpectedTypes: "Aspetta {allButLastType} o {lastType}", imageValidateSizeLabelFormatError: "Tipo di immagine non compatibile", imageValidateSizeLabelImageSizeTooSmall: "L'immagine \xE8 troppo piccola", imageValidateSizeLabelImageSizeTooBig: "L'immagine \xE8 troppo grande", imageValidateSizeLabelExpectedMinSize: "La dimensione minima \xE8 {minWidth} \xD7 {minHeight}", imageValidateSizeLabelExpectedMaxSize: "La dimensione massima \xE8 {maxWidth} \xD7 {maxHeight}", imageValidateSizeLabelImageResolutionTooLow: "La risoluzione \xE8 troppo bassa", imageValidateSizeLabelImageResolutionTooHigh: "La risoluzione \xE8 troppo alta", imageValidateSizeLabelExpectedMinResolution: "La risoluzione minima \xE8 {minResolution}", imageValidateSizeLabelExpectedMaxResolution: "La risoluzione massima \xE8 {maxResolution}" }; // node_modules/filepond/locale/nl-nl.js var nl_nl_default = { labelIdle: 'Drag & Drop je bestanden of Bladeren ', labelInvalidField: "Veld bevat ongeldige bestanden", labelFileWaitingForSize: "Wachten op grootte", labelFileSizeNotAvailable: "Grootte niet beschikbaar", labelFileLoading: "Laden", labelFileLoadError: "Fout tijdens laden", labelFileProcessing: "Uploaden", labelFileProcessingComplete: "Upload afgerond", labelFileProcessingAborted: "Upload geannuleerd", labelFileProcessingError: "Fout tijdens upload", labelFileProcessingRevertError: "Fout bij herstellen", labelFileRemoveError: "Fout bij verwijderen", labelTapToCancel: "tik om te annuleren", labelTapToRetry: "tik om opnieuw te proberen", labelTapToUndo: "tik om ongedaan te maken", labelButtonRemoveItem: "Verwijderen", labelButtonAbortItemLoad: "Afbreken", labelButtonRetryItemLoad: "Opnieuw proberen", labelButtonAbortItemProcessing: "Annuleren", labelButtonUndoItemProcessing: "Ongedaan maken", labelButtonRetryItemProcessing: "Opnieuw proberen", labelButtonProcessItem: "Upload", labelMaxFileSizeExceeded: "Bestand is te groot", labelMaxFileSize: "Maximale bestandsgrootte is {filesize}", labelMaxTotalFileSizeExceeded: "Maximale totale grootte overschreden", labelMaxTotalFileSize: "Maximale totale bestandsgrootte is {filesize}", labelFileTypeNotAllowed: "Ongeldig bestandstype", fileValidateTypeLabelExpectedTypes: "Verwacht {allButLastType} of {lastType}", imageValidateSizeLabelFormatError: "Afbeeldingstype niet ondersteund", imageValidateSizeLabelImageSizeTooSmall: "Afbeelding is te klein", imageValidateSizeLabelImageSizeTooBig: "Afbeelding is te groot", imageValidateSizeLabelExpectedMinSize: "Minimale afmeting is {minWidth} \xD7 {minHeight}", imageValidateSizeLabelExpectedMaxSize: "Maximale afmeting is {maxWidth} \xD7 {maxHeight}", imageValidateSizeLabelImageResolutionTooLow: "Resolutie is te laag", imageValidateSizeLabelImageResolutionTooHigh: "Resolution is too high", imageValidateSizeLabelExpectedMinResolution: "Minimale resolutie is {minResolution}", imageValidateSizeLabelExpectedMaxResolution: "Maximale resolutie is {maxResolution}" }; // node_modules/filepond/locale/pl-pl.js var pl_pl_default = { labelIdle: 'Przeci\u0105gnij i upu\u015B\u0107 lub wybierz pliki', labelInvalidField: "Nieprawid\u0142owe pliki", labelFileWaitingForSize: "Pobieranie rozmiaru", labelFileSizeNotAvailable: "Nieznany rozmiar", labelFileLoading: "Wczytywanie", labelFileLoadError: "B\u0142\u0105d wczytywania", labelFileProcessing: "Przesy\u0142anie", labelFileProcessingComplete: "Przes\u0142ano", labelFileProcessingAborted: "Przerwano", labelFileProcessingError: "Przesy\u0142anie nie powiod\u0142o si\u0119", labelFileProcessingRevertError: "Co\u015B posz\u0142o nie tak", labelFileRemoveError: "Nieudane usuni\u0119cie", labelTapToCancel: "Anuluj", labelTapToRetry: "Pon\xF3w", labelTapToUndo: "Cofnij", labelButtonRemoveItem: "Usu\u0144", labelButtonAbortItemLoad: "Przerwij", labelButtonRetryItemLoad: "Pon\xF3w", labelButtonAbortItemProcessing: "Anuluj", labelButtonUndoItemProcessing: "Cofnij", labelButtonRetryItemProcessing: "Pon\xF3w", labelButtonProcessItem: "Prze\u015Blij", labelMaxFileSizeExceeded: "Plik jest zbyt du\u017Cy", labelMaxFileSize: "Dopuszczalna wielko\u015B\u0107 pliku to {filesize}", labelMaxTotalFileSizeExceeded: "Przekroczono \u0142\u0105czny rozmiar plik\xF3w", labelMaxTotalFileSize: "\u0141\u0105czny rozmiar plik\xF3w nie mo\u017Ce przekroczy\u0107 {filesize}", labelFileTypeNotAllowed: "Niedozwolony rodzaj pliku", fileValidateTypeLabelExpectedTypes: "Oczekiwano {allButLastType} lub {lastType}", imageValidateSizeLabelFormatError: "Nieobs\u0142ugiwany format obrazu", imageValidateSizeLabelImageSizeTooSmall: "Obraz jest zbyt ma\u0142y", imageValidateSizeLabelImageSizeTooBig: "Obraz jest zbyt du\u017Cy", imageValidateSizeLabelExpectedMinSize: "Minimalne wymiary obrazu to {minWidth}\xD7{minHeight}", imageValidateSizeLabelExpectedMaxSize: "Maksymalna wymiary obrazu to {maxWidth}\xD7{maxHeight}", imageValidateSizeLabelImageResolutionTooLow: "Rozdzielczo\u015B\u0107 jest zbyt niska", imageValidateSizeLabelImageResolutionTooHigh: "Rozdzielczo\u015B\u0107 jest zbyt wysoka", imageValidateSizeLabelExpectedMinResolution: "Minimalna rozdzielczo\u015B\u0107 to {minResolution}", imageValidateSizeLabelExpectedMaxResolution: "Maksymalna rozdzielczo\u015B\u0107 to {maxResolution}" }; // node_modules/filepond/locale/pt-br.js var pt_br_default = { labelIdle: 'Arraste e solte os arquivos ou Clique aqui ', labelInvalidField: "Arquivos inv\xE1lidos", labelFileWaitingForSize: "Calculando o tamanho do arquivo", labelFileSizeNotAvailable: "Tamanho do arquivo indispon\xEDvel", labelFileLoading: "Carregando", labelFileLoadError: "Erro durante o carregamento", labelFileProcessing: "Enviando", labelFileProcessingComplete: "Envio finalizado", labelFileProcessingAborted: "Envio cancelado", labelFileProcessingError: "Erro durante o envio", labelFileProcessingRevertError: "Erro ao reverter o envio", labelFileRemoveError: "Erro ao remover o arquivo", labelTapToCancel: "clique para cancelar", labelTapToRetry: "clique para reenviar", labelTapToUndo: "clique para desfazer", labelButtonRemoveItem: "Remover", labelButtonAbortItemLoad: "Abortar", labelButtonRetryItemLoad: "Reenviar", labelButtonAbortItemProcessing: "Cancelar", labelButtonUndoItemProcessing: "Desfazer", labelButtonRetryItemProcessing: "Reenviar", labelButtonProcessItem: "Enviar", labelMaxFileSizeExceeded: "Arquivo \xE9 muito grande", labelMaxFileSize: "O tamanho m\xE1ximo permitido: {filesize}", labelMaxTotalFileSizeExceeded: "Tamanho total dos arquivos excedido", labelMaxTotalFileSize: "Tamanho total permitido: {filesize}", labelFileTypeNotAllowed: "Tipo de arquivo inv\xE1lido", fileValidateTypeLabelExpectedTypes: "Tipos de arquivo suportados s\xE3o {allButLastType} ou {lastType}", imageValidateSizeLabelFormatError: "Tipo de imagem inv\xE1lida", imageValidateSizeLabelImageSizeTooSmall: "Imagem muito pequena", imageValidateSizeLabelImageSizeTooBig: "Imagem muito grande", imageValidateSizeLabelExpectedMinSize: "Tamanho m\xEDnimo permitida: {minWidth} \xD7 {minHeight}", imageValidateSizeLabelExpectedMaxSize: "Tamanho m\xE1ximo permitido: {maxWidth} \xD7 {maxHeight}", imageValidateSizeLabelImageResolutionTooLow: "Resolu\xE7\xE3o muito baixa", imageValidateSizeLabelImageResolutionTooHigh: "Resolu\xE7\xE3o muito alta", imageValidateSizeLabelExpectedMinResolution: "Resolu\xE7\xE3o m\xEDnima permitida: {minResolution}", imageValidateSizeLabelExpectedMaxResolution: "Resolu\xE7\xE3o m\xE1xima permitida: {maxResolution}" }; // node_modules/filepond/locale/ro-ro.js var ro_ro_default = { labelIdle: 'Trage \u0219i plaseaz\u0103 fi\u0219iere sau Caut\u0103-le ', labelInvalidField: "C\xE2mpul con\u021Bine fi\u0219iere care nu sunt valide", labelFileWaitingForSize: "\xCEn a\u0219teptarea dimensiunii", labelFileSizeNotAvailable: "Dimensiunea nu este diponibil\u0103", labelFileLoading: "Se \xEEncarc\u0103", labelFileLoadError: "Eroare la \xEEnc\u0103rcare", labelFileProcessing: "Se \xEEncarc\u0103", labelFileProcessingComplete: "\xCEnc\u0103rcare finalizat\u0103", labelFileProcessingAborted: "\xCEnc\u0103rcare anulat\u0103", labelFileProcessingError: "Eroare la \xEEnc\u0103rcare", labelFileProcessingRevertError: "Eroare la anulare", labelFileRemoveError: "Eroare la \u015Ftergere", labelTapToCancel: "apas\u0103 pentru a anula", labelTapToRetry: "apas\u0103 pentru a re\xEEncerca", labelTapToUndo: "apas\u0103 pentru a anula", labelButtonRemoveItem: "\u015Eterge", labelButtonAbortItemLoad: "Anuleaz\u0103", labelButtonRetryItemLoad: "Re\xEEncearc\u0103", labelButtonAbortItemProcessing: "Anuleaz\u0103", labelButtonUndoItemProcessing: "Anuleaz\u0103", labelButtonRetryItemProcessing: "Re\xEEncearc\u0103", labelButtonProcessItem: "\xCEncarc\u0103", labelMaxFileSizeExceeded: "Fi\u0219ierul este prea mare", labelMaxFileSize: "Dimensiunea maxim\u0103 a unui fi\u0219ier este de {filesize}", labelMaxTotalFileSizeExceeded: "Dimensiunea total\u0103 maxim\u0103 a fost dep\u0103\u0219it\u0103", labelMaxTotalFileSize: "Dimensiunea total\u0103 maxim\u0103 a fi\u0219ierelor este de {filesize}", labelFileTypeNotAllowed: "Tipul fi\u0219ierului nu este valid", fileValidateTypeLabelExpectedTypes: "Se a\u0219teapt\u0103 {allButLastType} sau {lastType}", imageValidateSizeLabelFormatError: "Formatul imaginii nu este acceptat", imageValidateSizeLabelImageSizeTooSmall: "Imaginea este prea mic\u0103", imageValidateSizeLabelImageSizeTooBig: "Imaginea este prea mare", imageValidateSizeLabelExpectedMinSize: "M\u0103rimea minim\u0103 este de {maxWidth} x {maxHeight}", imageValidateSizeLabelExpectedMaxSize: "M\u0103rimea maxim\u0103 este de {maxWidth} x {maxHeight}", imageValidateSizeLabelImageResolutionTooLow: "Rezolu\u021Bia este prea mic\u0103", imageValidateSizeLabelImageResolutionTooHigh: "Rezolu\u021Bia este prea mare", imageValidateSizeLabelExpectedMinResolution: "Rezolu\u021Bia minim\u0103 este de {minResolution}", imageValidateSizeLabelExpectedMaxResolution: "Rezolu\u021Bia maxim\u0103 este de {maxResolution}" }; // node_modules/filepond/locale/ru-ru.js var ru_ru_default = { labelIdle: '\u041F\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u0435 \u0444\u0430\u0439\u043B\u044B \u0438\u043B\u0438 \u0432\u044B\u0431\u0435\u0440\u0438\u0442\u0435 ', labelInvalidField: "\u041F\u043E\u043B\u0435 \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u0442 \u043D\u0435\u0434\u043E\u043F\u0443\u0441\u0442\u0438\u043C\u044B\u0435 \u0444\u0430\u0439\u043B\u044B", labelFileWaitingForSize: "\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u0440\u0430\u0437\u043C\u0435\u0440", labelFileSizeNotAvailable: "\u0420\u0430\u0437\u043C\u0435\u0440 \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F", labelFileLoading: "\u041E\u0436\u0438\u0434\u0430\u043D\u0438\u0435", labelFileLoadError: "\u041E\u0448\u0438\u0431\u043A\u0430 \u043F\u0440\u0438 \u043E\u0436\u0438\u0434\u0430\u043D\u0438\u0438", labelFileProcessing: "\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430", labelFileProcessingComplete: "\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u0430", labelFileProcessingAborted: "\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430 \u043E\u0442\u043C\u0435\u043D\u0435\u043D\u0430", labelFileProcessingError: "\u041E\u0448\u0438\u0431\u043A\u0430 \u043F\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0435", labelFileProcessingRevertError: "\u041E\u0448\u0438\u0431\u043A\u0430 \u043F\u0440\u0438 \u0432\u043E\u0437\u0432\u0440\u0430\u0442\u0435", labelFileRemoveError: "\u041E\u0448\u0438\u0431\u043A\u0430 \u043F\u0440\u0438 \u0443\u0434\u0430\u043B\u0435\u043D\u0438\u0438", labelTapToCancel: "\u043D\u0430\u0436\u043C\u0438\u0442\u0435 \u0434\u043B\u044F \u043E\u0442\u043C\u0435\u043D\u044B", labelTapToRetry: "\u043D\u0430\u0436\u043C\u0438\u0442\u0435, \u0447\u0442\u043E\u0431\u044B \u043F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C \u043F\u043E\u043F\u044B\u0442\u043A\u0443", labelTapToUndo: "\u043D\u0430\u0436\u043C\u0438\u0442\u0435 \u0434\u043B\u044F \u043E\u0442\u043C\u0435\u043D\u044B \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u0433\u043E \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F", labelButtonRemoveItem: "\u0423\u0434\u0430\u043B\u0438\u0442\u044C", labelButtonAbortItemLoad: "\u041F\u0440\u0435\u043A\u0440\u0430\u0449\u0435\u043D\u043E", labelButtonRetryItemLoad: "\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0435 \u043F\u043E\u043F\u044B\u0442\u043A\u0443", labelButtonAbortItemProcessing: "\u041E\u0442\u043C\u0435\u043D\u0430", labelButtonUndoItemProcessing: "\u041E\u0442\u043C\u0435\u043D\u0430 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u0433\u043E \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F", labelButtonRetryItemProcessing: "\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0435 \u043F\u043E\u043F\u044B\u0442\u043A\u0443", labelButtonProcessItem: "\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430", labelMaxFileSizeExceeded: "\u0424\u0430\u0439\u043B \u0441\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0439", labelMaxFileSize: "\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u044B\u0439 \u0440\u0430\u0437\u043C\u0435\u0440 \u0444\u0430\u0439\u043B\u0430: {filesize}", labelMaxTotalFileSizeExceeded: "\u041F\u0440\u0435\u0432\u044B\u0448\u0435\u043D \u043C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u044B\u0439 \u0440\u0430\u0437\u043C\u0435\u0440", labelMaxTotalFileSize: "\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u044B\u0439 \u0440\u0430\u0437\u043C\u0435\u0440 \u0444\u0430\u0439\u043B\u0430: {filesize}", labelFileTypeNotAllowed: "\u0424\u0430\u0439\u043B \u043D\u0435\u0432\u0435\u0440\u043D\u043E\u0433\u043E \u0442\u0438\u043F\u0430", fileValidateTypeLabelExpectedTypes: "\u041E\u0436\u0438\u0434\u0430\u0435\u0442\u0441\u044F {allButLastType} \u0438\u043B\u0438 {lastType}", imageValidateSizeLabelFormatError: "\u0422\u0438\u043F \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F", imageValidateSizeLabelImageSizeTooSmall: "\u0418\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u0441\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435", imageValidateSizeLabelImageSizeTooBig: "\u0418\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u0441\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435", imageValidateSizeLabelExpectedMinSize: "\u041C\u0438\u043D\u0438\u043C\u0430\u043B\u044C\u043D\u044B\u0439 \u0440\u0430\u0437\u043C\u0435\u0440: {minWidth} \xD7 {minHeight}", imageValidateSizeLabelExpectedMaxSize: "\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u044B\u0439 \u0440\u0430\u0437\u043C\u0435\u0440: {maxWidth} \xD7 {maxHeight}", imageValidateSizeLabelImageResolutionTooLow: "\u0420\u0430\u0437\u0440\u0435\u0448\u0435\u043D\u0438\u0435 \u0441\u043B\u0438\u0448\u043A\u043E\u043C \u043D\u0438\u0437\u043A\u043E\u0435", imageValidateSizeLabelImageResolutionTooHigh: "\u0420\u0430\u0437\u0440\u0435\u0448\u0435\u043D\u0438\u0435 \u0441\u043B\u0438\u0448\u043A\u043E\u043C \u0432\u044B\u0441\u043E\u043A\u043E\u0435", imageValidateSizeLabelExpectedMinResolution: "\u041C\u0438\u043D\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043D\u0438\u0435: {minResolution}", imageValidateSizeLabelExpectedMaxResolution: "\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043D\u0438\u0435: {maxResolution}" }; // node_modules/filepond/locale/sv_se.js var sv_se_default = { labelIdle: 'Drag och sl\xE4pp dina filer eller Bl\xE4ddra ', labelInvalidField: "F\xE4ltet inneh\xE5ller felaktiga filer", labelFileWaitingForSize: "V\xE4ntar p\xE5 storlek", labelFileSizeNotAvailable: "Storleken finns inte tillg\xE4nglig", labelFileLoading: "Laddar", labelFileLoadError: "Fel under laddning", labelFileProcessing: "Laddar upp", labelFileProcessingComplete: "Uppladdning klar", labelFileProcessingAborted: "Uppladdning avbruten", labelFileProcessingError: "Fel under uppladdning", labelFileProcessingRevertError: "Fel under \xE5terst\xE4llning", labelFileRemoveError: "Fel under borttagning", labelTapToCancel: "tryck f\xF6r att avbryta", labelTapToRetry: "tryck f\xF6r att f\xF6rs\xF6ka igen", labelTapToUndo: "tryck f\xF6r att \xE5ngra", labelButtonRemoveItem: "Tabort", labelButtonAbortItemLoad: "Avbryt", labelButtonRetryItemLoad: "F\xF6rs\xF6k igen", labelButtonAbortItemProcessing: "Avbryt", labelButtonUndoItemProcessing: "\xC5ngra", labelButtonRetryItemProcessing: "F\xF6rs\xF6k igen", labelButtonProcessItem: "Ladda upp", labelMaxFileSizeExceeded: "Filen \xE4r f\xF6r stor", labelMaxFileSize: "St\xF6rsta till\xE5tna filstorlek \xE4r {filesize}", labelMaxTotalFileSizeExceeded: "Maximal uppladdningsstorlek uppn\xE5d", labelMaxTotalFileSize: "Maximal uppladdningsstorlek \xE4r {filesize}", labelFileTypeNotAllowed: "Felaktig filtyp", fileValidateTypeLabelExpectedTypes: "Godk\xE4nda filtyper {allButLastType} eller {lastType}", imageValidateSizeLabelFormatError: "Bildtypen saknar st\xF6d", imageValidateSizeLabelImageSizeTooSmall: "Bilden \xE4r f\xF6r liten", imageValidateSizeLabelImageSizeTooBig: "Bilden \xE4r f\xF6r stor", imageValidateSizeLabelExpectedMinSize: "Minimal storlek \xE4r {minWidth} \xD7 {minHeight}", imageValidateSizeLabelExpectedMaxSize: "Maximal storlek \xE4r {maxWidth} \xD7 {maxHeight}", imageValidateSizeLabelImageResolutionTooLow: "Uppl\xF6sningen \xE4r f\xF6r l\xE5g", imageValidateSizeLabelImageResolutionTooHigh: "Uppl\xF6sningen \xE4r f\xF6r h\xF6g", imageValidateSizeLabelExpectedMinResolution: "Minsta till\xE5tna uppl\xF6sning \xE4r {minResolution}", imageValidateSizeLabelExpectedMaxResolution: "H\xF6gsta till\xE5tna uppl\xF6sning \xE4r {maxResolution}" }; // node_modules/filepond/locale/tr-tr.js var tr_tr_default = { labelIdle: 'Dosyan\u0131z\u0131 S\xFCr\xFCkleyin & B\u0131rak\u0131n ya da Se\xE7in ', labelInvalidField: "Alan ge\xE7ersiz dosyalar i\xE7eriyor", labelFileWaitingForSize: "Boyut hesaplan\u0131yor", labelFileSizeNotAvailable: "Boyut mevcut de\u011Fil", labelFileLoading: "Y\xFCkleniyor", labelFileLoadError: "Y\xFCkleme s\u0131ras\u0131nda hata olu\u015Ftu", labelFileProcessing: "Y\xFCkleniyor", labelFileProcessingComplete: "Y\xFCkleme tamamland\u0131", labelFileProcessingAborted: "Y\xFCkleme iptal edildi", labelFileProcessingError: "Y\xFCklerken hata olu\u015Ftu", labelFileProcessingRevertError: "Geri \xE7ekerken hata olu\u015Ftu", labelFileRemoveError: "Kald\u0131r\u0131rken hata olu\u015Ftu", labelTapToCancel: "\u0130ptal etmek i\xE7in t\u0131klay\u0131n", labelTapToRetry: "Tekrar denemek i\xE7in t\u0131klay\u0131n", labelTapToUndo: "Geri almak i\xE7in t\u0131klay\u0131n", labelButtonRemoveItem: "Kald\u0131r", labelButtonAbortItemLoad: "\u0130ptal Et", labelButtonRetryItemLoad: "Tekrar dene", labelButtonAbortItemProcessing: "\u0130ptal et", labelButtonUndoItemProcessing: "Geri Al", labelButtonRetryItemProcessing: "Tekrar dene", labelButtonProcessItem: "Y\xFCkle", labelMaxFileSizeExceeded: "Dosya \xE7ok b\xFCy\xFCk", labelMaxFileSize: "En fazla dosya boyutu: {filesize}", labelMaxTotalFileSizeExceeded: "Maximum boyut a\u015F\u0131ld\u0131", labelMaxTotalFileSize: "Maximum dosya boyutu :{filesize}", labelFileTypeNotAllowed: "Ge\xE7ersiz dosya tipi", fileValidateTypeLabelExpectedTypes: "\u015Eu {allButLastType} ya da \u015Fu dosya olmas\u0131 gerekir: {lastType}", imageValidateSizeLabelFormatError: "Resim tipi desteklenmiyor", imageValidateSizeLabelImageSizeTooSmall: "Resim \xE7ok k\xFC\xE7\xFCk", imageValidateSizeLabelImageSizeTooBig: "Resim \xE7ok b\xFCy\xFCk", imageValidateSizeLabelExpectedMinSize: "Minimum boyut {minWidth} \xD7 {minHeight}", imageValidateSizeLabelExpectedMaxSize: "Maximum boyut {maxWidth} \xD7 {maxHeight}", imageValidateSizeLabelImageResolutionTooLow: "\xC7\xF6z\xFCn\xFCrl\xFCk \xE7ok d\xFC\u015F\xFCk", imageValidateSizeLabelImageResolutionTooHigh: "\xC7\xF6z\xFCn\xFCrl\xFCk \xE7ok y\xFCksek", imageValidateSizeLabelExpectedMinResolution: "Minimum \xE7\xF6z\xFCn\xFCrl\xFCk {minResolution}", imageValidateSizeLabelExpectedMaxResolution: "Maximum \xE7\xF6z\xFCn\xFCrl\xFCk {maxResolution}" }; // node_modules/filepond/locale/uk-ua.js var uk_ua_default = { labelIdle: '\u041F\u0435\u0440\u0435\u0442\u044F\u0433\u043D\u0456\u0442\u044C \u0444\u0430\u0439\u043B\u0438 \u0430\u0431\u043E \u0432\u0438\u0431\u0435\u0440\u0456\u0442\u044C ', labelInvalidField: "\u041F\u043E\u043B\u0435 \u043C\u0456\u0441\u0442\u0438\u0442\u044C \u043D\u0435\u0434\u043E\u043F\u0443\u0441\u0442\u0438\u043C\u0456 \u0444\u0430\u0439\u043B\u0438", labelFileWaitingForSize: "\u0412\u043A\u0430\u0436\u0456\u0442\u044C \u0440\u043E\u0437\u043C\u0456\u0440", labelFileSizeNotAvailable: "\u0420\u043E\u0437\u043C\u0456\u0440 \u043D\u0435 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0438\u0439", labelFileLoading: "\u041E\u0447\u0456\u043A\u0443\u0432\u0430\u043D\u043D\u044F", labelFileLoadError: "\u041F\u043E\u043C\u0438\u043B\u043A\u0430 \u043F\u0440\u0438 \u043E\u0447\u0456\u043A\u0443\u0432\u0430\u043D\u043D\u0456", labelFileProcessing: "\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u044F", labelFileProcessingComplete: "\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u044F \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043E", labelFileProcessingAborted: "\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u044F \u0441\u043A\u0430\u0441\u043E\u0432\u0430\u043D\u043E", labelFileProcessingError: "\u041F\u043E\u043C\u0438\u043B\u043A\u0430 \u043F\u0440\u0438 \u0437\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u0456", labelFileProcessingRevertError: "\u041F\u043E\u043C\u0438\u043B\u043A\u0430 \u043F\u0440\u0438 \u0432\u0456\u0434\u043D\u043E\u0432\u043B\u0435\u043D\u043D\u0456", labelFileRemoveError: "\u041F\u043E\u043C\u0438\u043B\u043A\u0430 \u043F\u0440\u0438 \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043D\u0456", labelTapToCancel: "\u0412\u0456\u0434\u043C\u0456\u043D\u0438\u0442\u0438", labelTapToRetry: "\u041D\u0430\u0442\u0438\u0441\u043D\u0456\u0442\u044C, \u0449\u043E\u0431 \u043F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0438 \u0441\u043F\u0440\u043E\u0431\u0443", labelTapToUndo: "\u041D\u0430\u0442\u0438\u0441\u043D\u0456\u0442\u044C, \u0449\u043E\u0431 \u0432\u0456\u0434\u043C\u0456\u043D\u0438\u0442\u0438 \u043E\u0441\u0442\u0430\u043D\u043D\u044E \u0434\u0456\u044E", labelButtonRemoveItem: "\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438", labelButtonAbortItemLoad: "\u0412\u0456\u0434\u043C\u0456\u043D\u0438\u0442\u0438", labelButtonRetryItemLoad: "\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0438 \u0441\u043F\u0440\u043E\u0431\u0443", labelButtonAbortItemProcessing: "\u0412\u0456\u0434\u043C\u0456\u043D\u0438\u0442\u0438", labelButtonUndoItemProcessing: "\u0412\u0456\u0434\u043C\u0456\u043D\u0438\u0442\u0438 \u043E\u0441\u0442\u0430\u043D\u043D\u044E \u0434\u0456\u044E", labelButtonRetryItemProcessing: "\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0438 \u0441\u043F\u0440\u043E\u0431\u0443", labelButtonProcessItem: "\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u044F", labelMaxFileSizeExceeded: "\u0424\u0430\u0439\u043B \u0437\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0438\u0439", labelMaxFileSize: "\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0438\u0439 \u0440\u043E\u0437\u043C\u0456\u0440 \u0444\u0430\u0439\u043B\u0443: {filesize}", labelMaxTotalFileSizeExceeded: "\u041F\u0435\u0440\u0435\u0432\u0438\u0449\u0435\u043D\u043E \u043C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0438\u0439 \u0437\u0430\u0433\u0430\u043B\u044C\u043D\u0438\u0439 \u0440\u043E\u0437\u043C\u0456\u0440", labelMaxTotalFileSize: "\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0438\u0439 \u0437\u0430\u0433\u0430\u043B\u044C\u043D\u0438\u0439 \u0440\u043E\u0437\u043C\u0456\u0440: {filesize}", labelFileTypeNotAllowed: "\u0424\u043E\u0440\u043C\u0430\u0442 \u0444\u0430\u0439\u043B\u0443 \u043D\u0435 \u043F\u0456\u0434\u0442\u0440\u0438\u043C\u0443\u0454\u0442\u044C\u0441\u044F", fileValidateTypeLabelExpectedTypes: "\u041E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F {allButLastType} \u0430\u0431\u043E {lastType}", imageValidateSizeLabelFormatError: "\u0424\u043E\u0440\u043C\u0430\u0442 \u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F \u043D\u0435 \u043F\u0456\u0434\u0442\u0440\u0438\u043C\u0443\u0454\u0442\u044C\u0441\u044F", imageValidateSizeLabelImageSizeTooSmall: "\u0417\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F \u0437\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u0435", imageValidateSizeLabelImageSizeTooBig: "\u0417\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F \u0437\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435", imageValidateSizeLabelExpectedMinSize: "\u041C\u0456\u043D\u0456\u043C\u0430\u043B\u044C\u043D\u0438\u0439 \u0440\u043E\u0437\u043C\u0456\u0440: {minWidth} \xD7 {minHeight}", imageValidateSizeLabelExpectedMaxSize: "\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0438\u0439 \u0440\u043E\u0437\u043C\u0456\u0440: {maxWidth} \xD7 {maxHeight}", imageValidateSizeLabelImageResolutionTooLow: "\u0420\u043E\u0437\u043C\u0456\u0440\u0438 \u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F \u0437\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u0456", imageValidateSizeLabelImageResolutionTooHigh: "\u0420\u043E\u0437\u043C\u0456\u0440\u0438 \u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F \u0437\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0456", imageValidateSizeLabelExpectedMinResolution: "\u041C\u0456\u043D\u0456\u043C\u0430\u043B\u044C\u043D\u0456 \u0440\u043E\u0437\u043C\u0456\u0440\u0438: {minResolution}", imageValidateSizeLabelExpectedMaxResolution: "\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0456 \u0440\u043E\u0437\u043C\u0456\u0440\u0438: {maxResolution}" }; // node_modules/filepond/locale/vi-vi.js var vi_vi_default = { labelIdle: 'K\xE9o th\u1EA3 t\u1EC7p c\u1EE7a b\u1EA1n ho\u1EB7c T\xECm ki\u1EBFm ', labelInvalidField: "Tr\u01B0\u1EDDng ch\u1EE9a c\xE1c t\u1EC7p kh\xF4ng h\u1EE3p l\u1EC7", labelFileWaitingForSize: "\u0110ang ch\u1EDD k\xEDch th\u01B0\u1EDBc", labelFileSizeNotAvailable: "K\xEDch th\u01B0\u1EDBc kh\xF4ng c\xF3 s\u1EB5n", labelFileLoading: "\u0110ang t\u1EA3i", labelFileLoadError: "L\u1ED7i khi t\u1EA3i", labelFileProcessing: "\u0110ang t\u1EA3i l\xEAn", labelFileProcessingComplete: "T\u1EA3i l\xEAn th\xE0nh c\xF4ng", labelFileProcessingAborted: "\u0110\xE3 hu\u1EF7 t\u1EA3i l\xEAn", labelFileProcessingError: "L\u1ED7i khi t\u1EA3i l\xEAn", labelFileProcessingRevertError: "L\u1ED7i khi ho\xE0n nguy\xEAn", labelFileRemoveError: "L\u1ED7i khi x\xF3a", labelTapToCancel: "nh\u1EA5n \u0111\u1EC3 h\u1EE7y", labelTapToRetry: "nh\u1EA5n \u0111\u1EC3 th\u1EED l\u1EA1i", labelTapToUndo: "nh\u1EA5n \u0111\u1EC3 ho\xE0n t\xE1c", labelButtonRemoveItem: "Xo\xE1", labelButtonAbortItemLoad: "Hu\u1EF7 b\u1ECF", labelButtonRetryItemLoad: "Th\u1EED l\u1EA1i", labelButtonAbortItemProcessing: "H\u1EE7y b\u1ECF", labelButtonUndoItemProcessing: "Ho\xE0n t\xE1c", labelButtonRetryItemProcessing: "Th\u1EED l\u1EA1i", labelButtonProcessItem: "T\u1EA3i l\xEAn", labelMaxFileSizeExceeded: "T\u1EADp tin qu\xE1 l\u1EDBn", labelMaxFileSize: "K\xEDch th\u01B0\u1EDBc t\u1EC7p t\u1ED1i \u0111a l\xE0 {filesize}", labelMaxTotalFileSizeExceeded: "\u0110\xE3 v\u01B0\u1EE3t qu\xE1 t\u1ED5ng k\xEDch th\u01B0\u1EDBc t\u1ED1i \u0111a", labelMaxTotalFileSize: "T\u1ED5ng k\xEDch th\u01B0\u1EDBc t\u1EC7p t\u1ED1i \u0111a l\xE0 {filesize}", labelFileTypeNotAllowed: "T\u1EC7p thu\u1ED9c lo\u1EA1i kh\xF4ng h\u1EE3p l\u1EC7", fileValidateTypeLabelExpectedTypes: "Ki\u1EC3u t\u1EC7p h\u1EE3p l\u1EC7 l\xE0 {allButLastType} ho\u1EB7c {lastType}", imageValidateSizeLabelFormatError: "Lo\u1EA1i h\xECnh \u1EA3nh kh\xF4ng \u0111\u01B0\u1EE3c h\u1ED7 tr\u1EE3", imageValidateSizeLabelImageSizeTooSmall: "H\xECnh \u1EA3nh qu\xE1 nh\u1ECF", imageValidateSizeLabelImageSizeTooBig: "H\xECnh \u1EA3nh qu\xE1 l\u1EDBn", imageValidateSizeLabelExpectedMinSize: "K\xEDch th\u01B0\u1EDBc t\u1ED1i thi\u1EC3u l\xE0 {minWidth} \xD7 {minHeight}", imageValidateSizeLabelExpectedMaxSize: "K\xEDch th\u01B0\u1EDBc t\u1ED1i \u0111a l\xE0 {maxWidth} \xD7 {maxHeight}", imageValidateSizeLabelImageResolutionTooLow: "\u0110\u1ED9 ph\xE2n gi\u1EA3i qu\xE1 th\u1EA5p", imageValidateSizeLabelImageResolutionTooHigh: "\u0110\u1ED9 ph\xE2n gi\u1EA3i qu\xE1 cao", imageValidateSizeLabelExpectedMinResolution: "\u0110\u1ED9 ph\xE2n gi\u1EA3i t\u1ED1i thi\u1EC3u l\xE0 {minResolution}", imageValidateSizeLabelExpectedMaxResolution: "\u0110\u1ED9 ph\xE2n gi\u1EA3i t\u1ED1i \u0111a l\xE0 {maxResolution}" }; // node_modules/filepond/locale/zh-cn.js var zh_cn_default = { labelIdle: '\u62D6\u653E\u6587\u4EF6\uFF0C\u6216\u8005 \u6D4F\u89C8 ', labelInvalidField: "\u5B57\u6BB5\u5305\u542B\u65E0\u6548\u6587\u4EF6", labelFileWaitingForSize: "\u8BA1\u7B97\u6587\u4EF6\u5927\u5C0F", labelFileSizeNotAvailable: "\u6587\u4EF6\u5927\u5C0F\u4E0D\u53EF\u7528", labelFileLoading: "\u52A0\u8F7D", labelFileLoadError: "\u52A0\u8F7D\u9519\u8BEF", labelFileProcessing: "\u4E0A\u4F20", labelFileProcessingComplete: "\u5DF2\u4E0A\u4F20", labelFileProcessingAborted: "\u4E0A\u4F20\u5DF2\u53D6\u6D88", labelFileProcessingError: "\u4E0A\u4F20\u51FA\u9519", labelFileProcessingRevertError: "\u8FD8\u539F\u51FA\u9519", labelFileRemoveError: "\u5220\u9664\u51FA\u9519", labelTapToCancel: "\u70B9\u51FB\u53D6\u6D88", labelTapToRetry: "\u70B9\u51FB\u91CD\u8BD5", labelTapToUndo: "\u70B9\u51FB\u64A4\u6D88", labelButtonRemoveItem: "\u5220\u9664", labelButtonAbortItemLoad: "\u4E2D\u6B62", labelButtonRetryItemLoad: "\u91CD\u8BD5", labelButtonAbortItemProcessing: "\u53D6\u6D88", labelButtonUndoItemProcessing: "\u64A4\u6D88", labelButtonRetryItemProcessing: "\u91CD\u8BD5", labelButtonProcessItem: "\u4E0A\u4F20", labelMaxFileSizeExceeded: "\u6587\u4EF6\u592A\u5927", labelMaxFileSize: "\u6700\u5927\u503C: {filesize}", labelMaxTotalFileSizeExceeded: "\u8D85\u8FC7\u6700\u5927\u6587\u4EF6\u5927\u5C0F", labelMaxTotalFileSize: "\u6700\u5927\u6587\u4EF6\u5927\u5C0F\uFF1A{filesize}", labelFileTypeNotAllowed: "\u6587\u4EF6\u7C7B\u578B\u65E0\u6548", fileValidateTypeLabelExpectedTypes: "\u5E94\u4E3A {allButLastType} \u6216 {lastType}", imageValidateSizeLabelFormatError: "\u4E0D\u652F\u6301\u56FE\u50CF\u7C7B\u578B", imageValidateSizeLabelImageSizeTooSmall: "\u56FE\u50CF\u592A\u5C0F", imageValidateSizeLabelImageSizeTooBig: "\u56FE\u50CF\u592A\u5927", imageValidateSizeLabelExpectedMinSize: "\u6700\u5C0F\u503C: {minWidth} \xD7 {minHeight}", imageValidateSizeLabelExpectedMaxSize: "\u6700\u5927\u503C: {maxWidth} \xD7 {maxHeight}", imageValidateSizeLabelImageResolutionTooLow: "\u5206\u8FA8\u7387\u592A\u4F4E", imageValidateSizeLabelImageResolutionTooHigh: "\u5206\u8FA8\u7387\u592A\u9AD8", imageValidateSizeLabelExpectedMinResolution: "\u6700\u5C0F\u5206\u8FA8\u7387\uFF1A{minResolution}", imageValidateSizeLabelExpectedMaxResolution: "\u6700\u5927\u5206\u8FA8\u7387\uFF1A{maxResolution}" }; // node_modules/filepond/locale/zh-tw.js var zh_tw_default = { labelIdle: '\u62D6\u653E\u6A94\u6848\uFF0C\u6216\u8005 \u700F\u89BD ', labelInvalidField: "\u4E0D\u652F\u63F4\u6B64\u6A94\u6848", labelFileWaitingForSize: "\u6B63\u5728\u8A08\u7B97\u6A94\u6848\u5927\u5C0F", labelFileSizeNotAvailable: "\u6A94\u6848\u5927\u5C0F\u4E0D\u7B26", labelFileLoading: "\u8B80\u53D6\u4E2D", labelFileLoadError: "\u8B80\u53D6\u932F\u8AA4", labelFileProcessing: "\u4E0A\u50B3", labelFileProcessingComplete: "\u5DF2\u4E0A\u50B3", labelFileProcessingAborted: "\u4E0A\u50B3\u5DF2\u53D6\u6D88", labelFileProcessingError: "\u4E0A\u50B3\u767C\u751F\u932F\u8AA4", labelFileProcessingRevertError: "\u9084\u539F\u932F\u8AA4", labelFileRemoveError: "\u522A\u9664\u932F\u8AA4", labelTapToCancel: "\u9EDE\u64CA\u53D6\u6D88", labelTapToRetry: "\u9EDE\u64CA\u91CD\u8A66", labelTapToUndo: "\u9EDE\u64CA\u9084\u539F", labelButtonRemoveItem: "\u522A\u9664", labelButtonAbortItemLoad: "\u505C\u6B62", labelButtonRetryItemLoad: "\u91CD\u8A66", labelButtonAbortItemProcessing: "\u53D6\u6D88", labelButtonUndoItemProcessing: "\u53D6\u6D88", labelButtonRetryItemProcessing: "\u91CD\u8A66", labelButtonProcessItem: "\u4E0A\u50B3", labelMaxFileSizeExceeded: "\u6A94\u6848\u904E\u5927", labelMaxFileSize: "\u6700\u5927\u503C\uFF1A{filesize}", labelMaxTotalFileSizeExceeded: "\u8D85\u904E\u6700\u5927\u53EF\u4E0A\u50B3\u5927\u5C0F", labelMaxTotalFileSize: "\u6700\u5927\u53EF\u4E0A\u50B3\u5927\u5C0F\uFF1A{filesize}", labelFileTypeNotAllowed: "\u4E0D\u652F\u63F4\u6B64\u985E\u578B\u6A94\u6848", fileValidateTypeLabelExpectedTypes: "\u61C9\u70BA {allButLastType} \u6216 {lastType}", imageValidateSizeLabelFormatError: "\u4E0D\u652F\u6301\u6B64\u985E\u5716\u7247\u985E\u578B", imageValidateSizeLabelImageSizeTooSmall: "\u5716\u7247\u904E\u5C0F", imageValidateSizeLabelImageSizeTooBig: "\u5716\u7247\u904E\u5927", imageValidateSizeLabelExpectedMinSize: "\u6700\u5C0F\u5C3A\u5BF8\uFF1A{minWidth} \xD7 {minHeight}", imageValidateSizeLabelExpectedMaxSize: "\u6700\u5927\u5C3A\u5BF8\uFF1A{maxWidth} \xD7 {maxHeight}", imageValidateSizeLabelImageResolutionTooLow: "\u89E3\u6790\u5EA6\u904E\u4F4E", imageValidateSizeLabelImageResolutionTooHigh: "\u89E3\u6790\u5EA6\u904E\u9AD8", imageValidateSizeLabelExpectedMinResolution: "\u6700\u4F4E\u89E3\u6790\u5EA6\uFF1A{minResolution}", imageValidateSizeLabelExpectedMaxResolution: "\u6700\u9AD8\u89E3\u6790\u5EA6\uFF1A{maxResolution}" }; // packages/forms/resources/js/components/file-upload.js registerPlugin(filepond_plugin_file_validate_size_esm_default); registerPlugin(filepond_plugin_file_validate_type_esm_default); registerPlugin(filepond_plugin_image_crop_esm_default); registerPlugin(filepond_plugin_image_exif_orientation_esm_default); registerPlugin(filepond_plugin_image_preview_esm_default); registerPlugin(filepond_plugin_image_resize_esm_default); registerPlugin(filepond_plugin_image_transform_esm_default); registerPlugin(plugin8); window.FilePond = filepond_esm_exports; var file_upload_default = (Alpine) => { Alpine.data("fileUploadFormComponent", ({ acceptedFileTypes, canDownload, canOpen, canPreview, canReorder, deleteUploadedFileUsing, getUploadedFileUrlsUsing, imageCropAspectRatio, imagePreviewHeight, imageResizeMode, imageResizeTargetHeight, imageResizeTargetWidth, imageResizeUpscale, isAvatar, loadingIndicatorPosition, locale, panelAspectRatio, panelLayout, placeholder, maxSize, minSize, removeUploadedFileButtonPosition, removeUploadedFileUsing, reorderUploadedFilesUsing, shouldAppendFiles, shouldOrientImageFromExif, shouldTransformImage, state: state2, uploadButtonPosition, uploadProgressIndicatorPosition, uploadUsing }) => { return { fileKeyIndex: {}, pond: null, shouldUpdateState: true, state: state2, lastState: null, uploadedFileUrlIndex: {}, init: async function() { setOptions$1(locales2[locale] ?? locales2["en"]); this.pond = create$f(this.$refs.input, { acceptedFileTypes, allowPaste: false, allowReorder: canReorder, allowImageExifOrientation: shouldOrientImageFromExif, allowImagePreview: canPreview, allowVideoPreview: canPreview, allowAudioPreview: canPreview, allowImageTransform: shouldTransformImage, credits: false, files: await this.getFiles(), imageCropAspectRatio, imagePreviewHeight, imageResizeTargetHeight, imageResizeTargetWidth, imageResizeMode, imageResizeUpscale, itemInsertLocation: shouldAppendFiles ? "after" : "before", ...placeholder && {labelIdle: placeholder}, maxFileSize: maxSize, minFileSize: minSize, styleButtonProcessItemPosition: uploadButtonPosition, styleButtonRemoveItemPosition: removeUploadedFileButtonPosition, styleLoadIndicatorPosition: loadingIndicatorPosition, stylePanelAspectRatio: panelAspectRatio, stylePanelLayout: panelLayout, styleProgressIndicatorPosition: uploadProgressIndicatorPosition, server: { load: async (source, load) => { let response = await fetch(source, { cache: "no-store" }); let blob2 = await response.blob(); load(blob2); }, process: (fieldName, file2, metadata, load, error2, progress) => { this.shouldUpdateState = false; let fileKey = ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, (c2) => (c2 ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c2 / 4).toString(16)); uploadUsing(fileKey, file2, (fileKey2) => { this.shouldUpdateState = true; load(fileKey2); }, error2, progress); }, remove: async (source, load) => { let fileKey = this.uploadedFileUrlIndex[source] ?? null; if (!fileKey) { return; } await deleteUploadedFileUsing(fileKey); load(); }, revert: async (uniqueFileId, load) => { await removeUploadedFileUsing(uniqueFileId); load(); } } }); this.$watch("state", async () => { if (!this.shouldUpdateState) { return; } if (this.state !== null && Object.values(this.state).filter((file2) => file2.startsWith("livewire-file:")).length) { this.lastState = null; return; } if (JSON.stringify(this.state) === this.lastState) { return; } this.lastState = JSON.stringify(this.state); this.pond.files = await this.getFiles(); }); this.pond.on("reorderfiles", async (files) => { const orderedFileKeys = files.map((file2) => file2.source instanceof File ? file2.serverId : this.uploadedFileUrlIndex[file2.source] ?? null).filter((fileKey) => fileKey); await reorderUploadedFilesUsing(shouldAppendFiles ? orderedFileKeys : orderedFileKeys.reverse()); }); this.pond.on("initfile", async (fileItem) => { if (!canDownload) { return; } if (isAvatar) { return; } this.insertDownloadLink(fileItem); }); this.pond.on("initfile", async (fileItem) => { if (!canOpen) { return; } if (isAvatar) { return; } this.insertOpenLink(fileItem); }); this.pond.on("addfilestart", async (file2) => { if (file2.status !== FileStatus.PROCESSING_QUEUED) { return; } this.dispatchFormEvent("file-upload-started"); }); const handleFileProcessing = async () => { if (this.pond.getFiles().filter((file2) => file2.status === FileStatus.PROCESSING || file2.status === FileStatus.PROCESSING_QUEUED).length) { return; } this.dispatchFormEvent("file-upload-finished"); }; this.pond.on("processfile", handleFileProcessing); this.pond.on("processfileabort", handleFileProcessing); this.pond.on("processfilerevert", handleFileProcessing); }, dispatchFormEvent: function(name2) { this.$el.closest("form")?.dispatchEvent(new CustomEvent(name2, { composed: true, cancelable: true })); }, getUploadedFileUrls: async function() { const uploadedFileUrls = await getUploadedFileUrlsUsing(); this.fileKeyIndex = uploadedFileUrls ?? {}; this.uploadedFileUrlIndex = Object.entries(this.fileKeyIndex).filter((value) => value).reduce((obj, [key, value]) => { obj[value] = key; return obj; }, {}); }, getFiles: async function() { await this.getUploadedFileUrls(); let files = []; for (const uploadedFileUrl of Object.values(this.fileKeyIndex)) { if (!uploadedFileUrl) { continue; } files.push({ source: uploadedFileUrl, options: { type: "local" } }); } return shouldAppendFiles ? files : files.reverse(); }, insertDownloadLink: function(file2) { if (file2.origin !== FileOrigin$1.LOCAL) { return; } const anchor = this.getDownloadLink(file2); if (!anchor) { return; } document.getElementById(`filepond--item-${file2.id}`).querySelector(".filepond--file-info-main").prepend(anchor); }, insertOpenLink: function(file2) { if (file2.origin !== FileOrigin$1.LOCAL) { return; } const anchor = this.getOpenLink(file2); if (!anchor) { return; } document.getElementById(`filepond--item-${file2.id}`).querySelector(".filepond--file-info-main").prepend(anchor); }, getDownloadLink: function(file2) { let fileSource = file2.source; if (!fileSource) { return; } const anchor = document.createElement("a"); anchor.className = "filepond--download-icon"; anchor.href = fileSource; anchor.download = file2.file.name; return anchor; }, getOpenLink: function(file2) { let fileSource = file2.source; if (!fileSource) { return; } const anchor = document.createElement("a"); anchor.className = "filepond--open-icon"; anchor.href = fileSource; anchor.target = "_blank"; return anchor; } }; }); }; var locales2 = { ar: ar_ar_default, cs: cs_cz_default, da: da_dk_default, de: de_de_default, en: en_en_default, es: es_es_default, fa: fa_ir_default, fi: fi_fi_default, fr: fr_fr_default, hu: hu_hu_default, id: id_id_default, it: it_it_default, nl: nl_nl_default, pl: pl_pl_default, pt_BR: pt_br_default, pt_PT: pt_br_default, ro: ro_ro_default, ru: ru_ru_default, sv: sv_se_default, tr: tr_tr_default, uk: uk_ua_default, vi: vi_vi_default, zh_CN: zh_cn_default, zh_TW: zh_tw_default }; // packages/forms/resources/js/components/key-value.js var key_value_default = (Alpine) => { Alpine.data("keyValueFormComponent", ({state: state2}) => ({ state: state2, rows: [], shouldUpdateRows: true, init: function() { this.updateRows(); if (this.rows.length <= 0) { this.addRow(); } this.shouldUpdateRows = true; this.$watch("state", () => { if (!this.shouldUpdateRows) { this.shouldUpdateRows = true; return; } this.updateRows(); }); }, addRow: function() { this.rows.push({key: "", value: ""}); this.updateState(); }, deleteRow: function(index2) { this.rows.splice(index2, 1); if (this.rows.length <= 0) { this.addRow(); } this.updateState(); this.shouldUpdateRows = true; }, reorderRows: function(event) { const rows = Alpine.raw(this.rows); const reorderedRow = rows.splice(event.oldIndex, 1)[0]; rows.splice(event.newIndex, 0, reorderedRow); this.rows = rows; this.updateState(); }, updateRows: function() { let rows = []; for (let [key, value] of Object.entries(this.state ?? {})) { rows.push({ key, value }); } this.rows = rows; }, updateState: function() { let state3 = {}; this.rows.forEach((row) => { if (row.key === "" || row.key === null) { return; } state3[row.key] = row.value; }); this.shouldUpdateRows = false; this.state = state3; } })); }; // node_modules/@github/file-attachment-element/dist/index.js var Attachment = class { constructor(file2, directory) { this.file = file2; this.directory = directory; this.state = "pending"; this.id = null; this.href = null; this.name = null; this.percent = 0; } static traverse(transfer, directory) { return transferredFiles(transfer, directory); } static from(files) { const result = []; for (const file2 of files) { if (file2 instanceof File) { result.push(new Attachment(file2)); } else if (file2 instanceof Attachment) { result.push(file2); } else { throw new Error("Unexpected type"); } } return result; } get fullPath() { return this.directory ? `${this.directory}/${this.file.name}` : this.file.name; } isImage() { return ["image/gif", "image/png", "image/jpg", "image/jpeg"].indexOf(this.file.type) > -1; } saving(percent) { if (this.state !== "pending" && this.state !== "saving") { throw new Error(`Unexpected transition from ${this.state} to saving`); } this.state = "saving"; this.percent = percent; } saved(attributes) { var _a, _b, _c; if (this.state !== "pending" && this.state !== "saving") { throw new Error(`Unexpected transition from ${this.state} to saved`); } this.state = "saved"; this.id = (_a = attributes === null || attributes === void 0 ? void 0 : attributes.id) !== null && _a !== void 0 ? _a : null; this.href = (_b = attributes === null || attributes === void 0 ? void 0 : attributes.href) !== null && _b !== void 0 ? _b : null; this.name = (_c = attributes === null || attributes === void 0 ? void 0 : attributes.name) !== null && _c !== void 0 ? _c : null; } isPending() { return this.state === "pending"; } isSaving() { return this.state === "saving"; } isSaved() { return this.state === "saved"; } }; function transferredFiles(transfer, directory) { if (directory && isDirectory(transfer)) { return traverse("", roots(transfer)); } return Promise.resolve(visible(Array.from(transfer.files || [])).map((f) => new Attachment(f))); } function hidden(file2) { return file2.name.startsWith("."); } function visible(files) { return Array.from(files).filter((file2) => !hidden(file2)); } function getFile(entry) { return new Promise(function(resolve, reject) { entry.file(resolve, reject); }); } function getEntries(entry) { return new Promise(function(resolve, reject) { const result = []; const reader = entry.createReader(); const read = () => { reader.readEntries((entries) => { if (entries.length > 0) { result.push(...entries); read(); } else { resolve(result); } }, reject); }; read(); }); } async function traverse(path, entries) { const results = []; for (const entry of visible(entries)) { if (entry.isDirectory) { results.push(...await traverse(entry.fullPath, await getEntries(entry))); } else { const file2 = await getFile(entry); results.push(new Attachment(file2, path)); } } return results; } function isDirectory(transfer) { return transfer.items && Array.from(transfer.items).some((item2) => { const entry = item2.webkitGetAsEntry && item2.webkitGetAsEntry(); return entry && entry.isDirectory; }); } function roots(transfer) { return Array.from(transfer.items).map((item2) => item2.webkitGetAsEntry()).filter((entry) => entry != null); } var FileAttachmentElement = class extends HTMLElement { connectedCallback() { this.addEventListener("dragenter", onDragenter); this.addEventListener("dragover", onDragenter); this.addEventListener("dragleave", onDragleave); this.addEventListener("drop", onDrop); this.addEventListener("paste", onPaste); this.addEventListener("change", onChange); } disconnectedCallback() { this.removeEventListener("dragenter", onDragenter); this.removeEventListener("dragover", onDragenter); this.removeEventListener("dragleave", onDragleave); this.removeEventListener("drop", onDrop); this.removeEventListener("paste", onPaste); this.removeEventListener("change", onChange); } get directory() { return this.hasAttribute("directory"); } set directory(value) { if (value) { this.setAttribute("directory", ""); } else { this.removeAttribute("directory"); } } async attach(transferred) { const attachments = transferred instanceof DataTransfer ? await Attachment.traverse(transferred, this.directory) : Attachment.from(transferred); const accepted = this.dispatchEvent(new CustomEvent("file-attachment-accept", { bubbles: true, cancelable: true, detail: {attachments} })); if (accepted && attachments.length) { this.dispatchEvent(new CustomEvent("file-attachment-accepted", { bubbles: true, detail: {attachments} })); } } }; function hasFile(transfer) { return Array.from(transfer.types).indexOf("Files") >= 0; } var dragging = null; function onDragenter(event) { const target = event.currentTarget; if (dragging) { clearTimeout(dragging); } dragging = window.setTimeout(() => target.removeAttribute("hover"), 200); const transfer = event.dataTransfer; if (!transfer || !hasFile(transfer)) return; transfer.dropEffect = "copy"; target.setAttribute("hover", ""); event.stopPropagation(); event.preventDefault(); } function onDragleave(event) { if (event.dataTransfer) { event.dataTransfer.dropEffect = "none"; } const target = event.currentTarget; target.removeAttribute("hover"); event.stopPropagation(); event.preventDefault(); } function onDrop(event) { const container = event.currentTarget; if (!(container instanceof FileAttachmentElement)) return; container.removeAttribute("hover"); const transfer = event.dataTransfer; if (!transfer || !hasFile(transfer)) return; container.attach(transfer); event.stopPropagation(); event.preventDefault(); } var images2 = /^image\/(gif|png|jpeg)$/; function pastedFile(items) { for (const item2 of items) { if (images2.test(item2.type)) { return item2.getAsFile(); } } return null; } function onPaste(event) { if (!event.clipboardData) return; if (!event.clipboardData.items) return; const container = event.currentTarget; if (!(container instanceof FileAttachmentElement)) return; const file2 = pastedFile(event.clipboardData.items); if (!file2) return; const files = [file2]; container.attach(files); event.preventDefault(); } function onChange(event) { const container = event.currentTarget; if (!(container instanceof FileAttachmentElement)) return; const input = event.target; if (!(input instanceof HTMLInputElement)) return; const id = container.getAttribute("input"); if (id && input.id !== id) return; const files = input.files; if (!files || files.length === 0) return; container.attach(files); input.value = ""; } if (!window.customElements.get("file-attachment")) { window.FileAttachmentElement = FileAttachmentElement; window.customElements.define("file-attachment", FileAttachmentElement); } // node_modules/@github/markdown-toolbar-element/dist/index.js var buttonSelectors = [ "[data-md-button]", "md-header", "md-bold", "md-italic", "md-quote", "md-code", "md-link", "md-image", "md-unordered-list", "md-ordered-list", "md-task-list", "md-mention", "md-ref", "md-strikethrough" ]; function getButtons(toolbar) { const els = []; for (const button of toolbar.querySelectorAll(buttonSelectors.join(", "))) { if (button.hidden || button.offsetWidth <= 0 && button.offsetHeight <= 0) continue; if (button.closest("markdown-toolbar") === toolbar) els.push(button); } return els; } function keydown(fn2) { return function(event) { if (event.key === " " || event.key === "Enter") { event.preventDefault(); fn2(event); } }; } var styles2 = new WeakMap(); var MarkdownButtonElement = class extends HTMLElement { constructor() { super(); const apply2 = () => { const style = styles2.get(this); if (!style) return; applyStyle(this, style); }; this.addEventListener("keydown", keydown(apply2)); this.addEventListener("click", apply2); } connectedCallback() { if (!this.hasAttribute("role")) { this.setAttribute("role", "button"); } } click() { const style = styles2.get(this); if (!style) return; applyStyle(this, style); } }; var MarkdownHeaderButtonElement = class extends MarkdownButtonElement { constructor() { super(); const level = parseInt(this.getAttribute("level") || "3", 10); if (level < 1 || level > 6) { return; } const prefix = `${"#".repeat(level)} `; styles2.set(this, { prefix }); } }; if (!window.customElements.get("md-header")) { window.MarkdownHeaderButtonElement = MarkdownHeaderButtonElement; window.customElements.define("md-header", MarkdownHeaderButtonElement); } var MarkdownBoldButtonElement = class extends MarkdownButtonElement { constructor() { super(); styles2.set(this, {prefix: "**", suffix: "**", trimFirst: true}); } connectedCallback() { super.connectedCallback(); this.setAttribute("hotkey", "b"); } }; if (!window.customElements.get("md-bold")) { window.MarkdownBoldButtonElement = MarkdownBoldButtonElement; window.customElements.define("md-bold", MarkdownBoldButtonElement); } var MarkdownItalicButtonElement = class extends MarkdownButtonElement { constructor() { super(); styles2.set(this, {prefix: "_", suffix: "_", trimFirst: true}); } connectedCallback() { super.connectedCallback(); this.setAttribute("hotkey", "i"); } }; if (!window.customElements.get("md-italic")) { window.MarkdownItalicButtonElement = MarkdownItalicButtonElement; window.customElements.define("md-italic", MarkdownItalicButtonElement); } var MarkdownQuoteButtonElement = class extends MarkdownButtonElement { constructor() { super(); styles2.set(this, {prefix: "> ", multiline: true, surroundWithNewlines: true}); } connectedCallback() { super.connectedCallback(); this.setAttribute("hotkey", "."); this.setAttribute("hotkey-requires-shift", "true"); } }; if (!window.customElements.get("md-quote")) { window.MarkdownQuoteButtonElement = MarkdownQuoteButtonElement; window.customElements.define("md-quote", MarkdownQuoteButtonElement); } var MarkdownCodeButtonElement = class extends MarkdownButtonElement { constructor() { super(); styles2.set(this, {prefix: "`", suffix: "`", blockPrefix: "```", blockSuffix: "```"}); } connectedCallback() { super.connectedCallback(); this.setAttribute("hotkey", "e"); } }; if (!window.customElements.get("md-code")) { window.MarkdownCodeButtonElement = MarkdownCodeButtonElement; window.customElements.define("md-code", MarkdownCodeButtonElement); } var MarkdownLinkButtonElement = class extends MarkdownButtonElement { constructor() { super(); styles2.set(this, {prefix: "[", suffix: "](url)", replaceNext: "url", scanFor: "https?://"}); } connectedCallback() { super.connectedCallback(); this.setAttribute("hotkey", "k"); } }; if (!window.customElements.get("md-link")) { window.MarkdownLinkButtonElement = MarkdownLinkButtonElement; window.customElements.define("md-link", MarkdownLinkButtonElement); } var MarkdownImageButtonElement = class extends MarkdownButtonElement { constructor() { super(); styles2.set(this, {prefix: "![", suffix: "](url)", replaceNext: "url", scanFor: "https?://"}); } }; if (!window.customElements.get("md-image")) { window.MarkdownImageButtonElement = MarkdownImageButtonElement; window.customElements.define("md-image", MarkdownImageButtonElement); } var MarkdownUnorderedListButtonElement = class extends MarkdownButtonElement { constructor() { super(); styles2.set(this, {prefix: "- ", multiline: true, surroundWithNewlines: true}); } connectedCallback() { super.connectedCallback(); this.setAttribute("hotkey", "8"); this.setAttribute("hotkey-requires-shift", "true"); } }; if (!window.customElements.get("md-unordered-list")) { window.MarkdownUnorderedListButtonElement = MarkdownUnorderedListButtonElement; window.customElements.define("md-unordered-list", MarkdownUnorderedListButtonElement); } var MarkdownOrderedListButtonElement = class extends MarkdownButtonElement { constructor() { super(); styles2.set(this, {prefix: "1. ", multiline: true, orderedList: true}); } connectedCallback() { super.connectedCallback(); this.setAttribute("hotkey", "7"); this.setAttribute("hotkey-requires-shift", "true"); } }; if (!window.customElements.get("md-ordered-list")) { window.MarkdownOrderedListButtonElement = MarkdownOrderedListButtonElement; window.customElements.define("md-ordered-list", MarkdownOrderedListButtonElement); } var MarkdownTaskListButtonElement = class extends MarkdownButtonElement { constructor() { super(); styles2.set(this, {prefix: "- [ ] ", multiline: true, surroundWithNewlines: true}); } connectedCallback() { super.connectedCallback(); this.setAttribute("hotkey", "L"); } }; if (!window.customElements.get("md-task-list")) { window.MarkdownTaskListButtonElement = MarkdownTaskListButtonElement; window.customElements.define("md-task-list", MarkdownTaskListButtonElement); } var MarkdownMentionButtonElement = class extends MarkdownButtonElement { constructor() { super(); styles2.set(this, {prefix: "@", prefixSpace: true}); } }; if (!window.customElements.get("md-mention")) { window.MarkdownMentionButtonElement = MarkdownMentionButtonElement; window.customElements.define("md-mention", MarkdownMentionButtonElement); } var MarkdownRefButtonElement = class extends MarkdownButtonElement { constructor() { super(); styles2.set(this, {prefix: "#", prefixSpace: true}); } }; if (!window.customElements.get("md-ref")) { window.MarkdownRefButtonElement = MarkdownRefButtonElement; window.customElements.define("md-ref", MarkdownRefButtonElement); } var MarkdownStrikethroughButtonElement = class extends MarkdownButtonElement { constructor() { super(); styles2.set(this, {prefix: "~~", suffix: "~~", trimFirst: true}); } }; if (!window.customElements.get("md-strikethrough")) { window.MarkdownStrikethroughButtonElement = MarkdownStrikethroughButtonElement; window.customElements.define("md-strikethrough", MarkdownStrikethroughButtonElement); } var modifierKey = navigator.userAgent.match(/Macintosh/) ? "Meta" : "Control"; var MarkdownToolbarElement = class extends HTMLElement { constructor() { super(); } connectedCallback() { if (!this.hasAttribute("role")) { this.setAttribute("role", "toolbar"); } this.addEventListener("keydown", focusKeydown); const fn2 = shortcut.bind(null, this); if (this.field) { this.field.addEventListener("keydown", fn2); shortcutListeners.set(this, fn2); } this.setAttribute("tabindex", "0"); this.addEventListener("focus", onToolbarFocus, {once: true}); } disconnectedCallback() { const fn2 = shortcutListeners.get(this); if (fn2 && this.field) { this.field.removeEventListener("keydown", fn2); shortcutListeners.delete(this); } this.removeEventListener("keydown", focusKeydown); } get field() { const id = this.getAttribute("for"); if (!id) return null; const root2 = "getRootNode" in this ? this.getRootNode() : document; let field; if (root2 instanceof Document || root2 instanceof ShadowRoot) { field = root2.getElementById(id); } return field instanceof HTMLTextAreaElement ? field : null; } }; function onToolbarFocus({target}) { if (!(target instanceof Element)) return; target.removeAttribute("tabindex"); let tabindex = "0"; for (const button of getButtons(target)) { button.setAttribute("tabindex", tabindex); if (tabindex === "0") { button.focus(); tabindex = "-1"; } } } function focusKeydown(event) { const key = event.key; if (key !== "ArrowRight" && key !== "ArrowLeft" && key !== "Home" && key !== "End") return; const toolbar = event.currentTarget; if (!(toolbar instanceof HTMLElement)) return; const buttons = getButtons(toolbar); const index2 = buttons.indexOf(event.target); const length = buttons.length; if (index2 === -1) return; let n2 = 0; if (key === "ArrowLeft") n2 = index2 - 1; if (key === "ArrowRight") n2 = index2 + 1; if (key === "End") n2 = length - 1; if (n2 < 0) n2 = length - 1; if (n2 > length - 1) n2 = 0; for (let i = 0; i < length; i += 1) { buttons[i].setAttribute("tabindex", i === n2 ? "0" : "-1"); } event.preventDefault(); buttons[n2].focus(); } var shortcutListeners = new WeakMap(); function elementHotkeyRequiresShift(element) { return element.hasAttribute("hotkey-requires-shift") && element.getAttribute("hotkey-requires-shift") !== "false"; } function findHotkey(toolbar, key, shiftPressed) { for (const el of toolbar.querySelectorAll("[hotkey]")) { if (el.getAttribute("hotkey") === key && (!elementHotkeyRequiresShift(el) || shiftPressed)) { return el; } } return null; } function shortcut(toolbar, event) { if (event.metaKey && modifierKey === "Meta" || event.ctrlKey && modifierKey === "Control") { const key = event.shiftKey ? event.key.toUpperCase() : event.key; const button = findHotkey(toolbar, key, event.shiftKey); if (button) { button.click(); event.preventDefault(); } } } if (!window.customElements.get("markdown-toolbar")) { window.MarkdownToolbarElement = MarkdownToolbarElement; window.customElements.define("markdown-toolbar", MarkdownToolbarElement); } function isMultipleLines(string) { return string.trim().split("\n").length > 1; } function repeat(string, n2) { return Array(n2 + 1).join(string); } function wordSelectionStart(text3, i) { let index2 = i; while (text3[index2] && text3[index2 - 1] != null && !text3[index2 - 1].match(/\s/)) { index2--; } return index2; } function wordSelectionEnd(text3, i, multiline) { let index2 = i; const breakpoint = multiline ? /\n/ : /\s/; while (text3[index2] && !text3[index2].match(breakpoint)) { index2++; } return index2; } var canInsertText = null; function insertText(textarea, {text: text3, selectionStart, selectionEnd}) { const originalSelectionStart = textarea.selectionStart; const before = textarea.value.slice(0, originalSelectionStart); const after = textarea.value.slice(textarea.selectionEnd); if (canInsertText === null || canInsertText === true) { textarea.contentEditable = "true"; try { canInsertText = document.execCommand("insertText", false, text3); } catch (error2) { canInsertText = false; } textarea.contentEditable = "false"; } if (canInsertText && !textarea.value.slice(0, textarea.selectionStart).endsWith(text3)) { canInsertText = false; } if (!canInsertText) { try { document.execCommand("ms-beginUndoUnit"); } catch (e2) { } textarea.value = before + text3 + after; try { document.execCommand("ms-endUndoUnit"); } catch (e2) { } textarea.dispatchEvent(new CustomEvent("input", {bubbles: true, cancelable: true})); } if (selectionStart != null && selectionEnd != null) { textarea.setSelectionRange(selectionStart, selectionEnd); } else { textarea.setSelectionRange(originalSelectionStart, textarea.selectionEnd); } } function styleSelectedText(textarea, styleArgs) { const text3 = textarea.value.slice(textarea.selectionStart, textarea.selectionEnd); let result; if (styleArgs.orderedList) { result = orderedList(textarea); } else if (styleArgs.multiline && isMultipleLines(text3)) { result = multilineStyle(textarea, styleArgs); } else { result = blockStyle(textarea, styleArgs); } insertText(textarea, result); } function expandSelectedText(textarea, prefixToUse, suffixToUse, multiline = false) { if (textarea.selectionStart === textarea.selectionEnd) { textarea.selectionStart = wordSelectionStart(textarea.value, textarea.selectionStart); textarea.selectionEnd = wordSelectionEnd(textarea.value, textarea.selectionEnd, multiline); } else { const expandedSelectionStart = textarea.selectionStart - prefixToUse.length; const expandedSelectionEnd = textarea.selectionEnd + suffixToUse.length; const beginsWithPrefix = textarea.value.slice(expandedSelectionStart, textarea.selectionStart) === prefixToUse; const endsWithSuffix = textarea.value.slice(textarea.selectionEnd, expandedSelectionEnd) === suffixToUse; if (beginsWithPrefix && endsWithSuffix) { textarea.selectionStart = expandedSelectionStart; textarea.selectionEnd = expandedSelectionEnd; } } return textarea.value.slice(textarea.selectionStart, textarea.selectionEnd); } function newlinesToSurroundSelectedText(textarea) { const beforeSelection = textarea.value.slice(0, textarea.selectionStart); const afterSelection = textarea.value.slice(textarea.selectionEnd); const breaksBefore = beforeSelection.match(/\n*$/); const breaksAfter = afterSelection.match(/^\n*/); const newlinesBeforeSelection = breaksBefore ? breaksBefore[0].length : 0; const newlinesAfterSelection = breaksAfter ? breaksAfter[0].length : 0; let newlinesToAppend; let newlinesToPrepend; if (beforeSelection.match(/\S/) && newlinesBeforeSelection < 2) { newlinesToAppend = repeat("\n", 2 - newlinesBeforeSelection); } if (afterSelection.match(/\S/) && newlinesAfterSelection < 2) { newlinesToPrepend = repeat("\n", 2 - newlinesAfterSelection); } if (newlinesToAppend == null) { newlinesToAppend = ""; } if (newlinesToPrepend == null) { newlinesToPrepend = ""; } return {newlinesToAppend, newlinesToPrepend}; } function blockStyle(textarea, arg) { let newlinesToAppend; let newlinesToPrepend; const {prefix, suffix, blockPrefix, blockSuffix, replaceNext, prefixSpace, scanFor, surroundWithNewlines} = arg; const originalSelectionStart = textarea.selectionStart; const originalSelectionEnd = textarea.selectionEnd; let selectedText = textarea.value.slice(textarea.selectionStart, textarea.selectionEnd); let prefixToUse = isMultipleLines(selectedText) && blockPrefix.length > 0 ? `${blockPrefix} ` : prefix; let suffixToUse = isMultipleLines(selectedText) && blockSuffix.length > 0 ? ` ${blockSuffix}` : suffix; if (prefixSpace) { const beforeSelection = textarea.value[textarea.selectionStart - 1]; if (textarea.selectionStart !== 0 && beforeSelection != null && !beforeSelection.match(/\s/)) { prefixToUse = ` ${prefixToUse}`; } } selectedText = expandSelectedText(textarea, prefixToUse, suffixToUse, arg.multiline); let selectionStart = textarea.selectionStart; let selectionEnd = textarea.selectionEnd; const hasReplaceNext = replaceNext.length > 0 && suffixToUse.indexOf(replaceNext) > -1 && selectedText.length > 0; if (surroundWithNewlines) { const ref = newlinesToSurroundSelectedText(textarea); newlinesToAppend = ref.newlinesToAppend; newlinesToPrepend = ref.newlinesToPrepend; prefixToUse = newlinesToAppend + prefix; suffixToUse += newlinesToPrepend; } if (selectedText.startsWith(prefixToUse) && selectedText.endsWith(suffixToUse)) { const replacementText = selectedText.slice(prefixToUse.length, selectedText.length - suffixToUse.length); if (originalSelectionStart === originalSelectionEnd) { let position = originalSelectionStart - prefixToUse.length; position = Math.max(position, selectionStart); position = Math.min(position, selectionStart + replacementText.length); selectionStart = selectionEnd = position; } else { selectionEnd = selectionStart + replacementText.length; } return {text: replacementText, selectionStart, selectionEnd}; } else if (!hasReplaceNext) { let replacementText = prefixToUse + selectedText + suffixToUse; selectionStart = originalSelectionStart + prefixToUse.length; selectionEnd = originalSelectionEnd + prefixToUse.length; const whitespaceEdges = selectedText.match(/^\s*|\s*$/g); if (arg.trimFirst && whitespaceEdges) { const leadingWhitespace = whitespaceEdges[0] || ""; const trailingWhitespace = whitespaceEdges[1] || ""; replacementText = leadingWhitespace + prefixToUse + selectedText.trim() + suffixToUse + trailingWhitespace; selectionStart += leadingWhitespace.length; selectionEnd -= trailingWhitespace.length; } return {text: replacementText, selectionStart, selectionEnd}; } else if (scanFor.length > 0 && selectedText.match(scanFor)) { suffixToUse = suffixToUse.replace(replaceNext, selectedText); const replacementText = prefixToUse + suffixToUse; selectionStart = selectionEnd = selectionStart + prefixToUse.length; return {text: replacementText, selectionStart, selectionEnd}; } else { const replacementText = prefixToUse + selectedText + suffixToUse; selectionStart = selectionStart + prefixToUse.length + selectedText.length + suffixToUse.indexOf(replaceNext); selectionEnd = selectionStart + replaceNext.length; return {text: replacementText, selectionStart, selectionEnd}; } } function multilineStyle(textarea, arg) { const {prefix, suffix, surroundWithNewlines} = arg; let text3 = textarea.value.slice(textarea.selectionStart, textarea.selectionEnd); let selectionStart = textarea.selectionStart; let selectionEnd = textarea.selectionEnd; const lines = text3.split("\n"); const undoStyle = lines.every((line) => line.startsWith(prefix) && line.endsWith(suffix)); if (undoStyle) { text3 = lines.map((line) => line.slice(prefix.length, line.length - suffix.length)).join("\n"); selectionEnd = selectionStart + text3.length; } else { text3 = lines.map((line) => prefix + line + suffix).join("\n"); if (surroundWithNewlines) { const {newlinesToAppend, newlinesToPrepend} = newlinesToSurroundSelectedText(textarea); selectionStart += newlinesToAppend.length; selectionEnd = selectionStart + text3.length; text3 = newlinesToAppend + text3 + newlinesToPrepend; } } return {text: text3, selectionStart, selectionEnd}; } function orderedList(textarea) { const orderedListRegex = /^\d+\.\s+/; const noInitialSelection = textarea.selectionStart === textarea.selectionEnd; let selectionEnd; let selectionStart; let text3 = textarea.value.slice(textarea.selectionStart, textarea.selectionEnd); let textToUnstyle = text3; let lines = text3.split("\n"); let startOfLine, endOfLine; if (noInitialSelection) { const linesBefore = textarea.value.slice(0, textarea.selectionStart).split(/\n/); startOfLine = textarea.selectionStart - linesBefore[linesBefore.length - 1].length; endOfLine = wordSelectionEnd(textarea.value, textarea.selectionStart, true); textToUnstyle = textarea.value.slice(startOfLine, endOfLine); } const linesToUnstyle = textToUnstyle.split("\n"); const undoStyling = linesToUnstyle.every((line) => orderedListRegex.test(line)); if (undoStyling) { lines = linesToUnstyle.map((line) => line.replace(orderedListRegex, "")); text3 = lines.join("\n"); if (noInitialSelection && startOfLine && endOfLine) { const lengthDiff = linesToUnstyle[0].length - lines[0].length; selectionStart = selectionEnd = textarea.selectionStart - lengthDiff; textarea.selectionStart = startOfLine; textarea.selectionEnd = endOfLine; } } else { lines = numberedLines(lines); text3 = lines.join("\n"); const {newlinesToAppend, newlinesToPrepend} = newlinesToSurroundSelectedText(textarea); selectionStart = textarea.selectionStart + newlinesToAppend.length; selectionEnd = selectionStart + text3.length; if (noInitialSelection) selectionStart = selectionEnd; text3 = newlinesToAppend + text3 + newlinesToPrepend; } return {text: text3, selectionStart, selectionEnd}; } function numberedLines(lines) { let i; let len; let index2; const results = []; for (index2 = i = 0, len = lines.length; i < len; index2 = ++i) { const line = lines[index2]; results.push(`${index2 + 1}. ${line}`); } return results; } function applyStyle(button, stylesToApply) { const toolbar = button.closest("markdown-toolbar"); if (!(toolbar instanceof MarkdownToolbarElement)) return; const defaults4 = { prefix: "", suffix: "", blockPrefix: "", blockSuffix: "", multiline: false, replaceNext: "", prefixSpace: false, scanFor: "", surroundWithNewlines: false, orderedList: false, trimFirst: false }; const style = Object.assign(Object.assign({}, defaults4), stylesToApply); const field = toolbar.field; if (field) { field.focus(); styleSelectedText(field, style); } } // node_modules/dompurify/dist/purify.es.js /*! @license DOMPurify 2.4.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.4.5/LICENSE */ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(obj2) { return typeof obj2; } : function(obj2) { return obj2 && typeof Symbol == "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; }, _typeof(obj); } function _setPrototypeOf(o2, p2) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o3, p3) { o3.__proto__ = p3; return o3; }; return _setPrototypeOf(o2, p2); } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { })); return true; } catch (e2) { return false; } } function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct2(Parent2, args2, Class2) { var a2 = [null]; a2.push.apply(a2, args2); var Constructor = Function.bind.apply(Parent2, a2); var instance = new Constructor(); if (Class2) _setPrototypeOf(instance, Class2.prototype); return instance; }; } return _construct.apply(null, arguments); } function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _unsupportedIterableToArray(o2, minLen) { if (!o2) return; if (typeof o2 === "string") return _arrayLikeToArray(o2, minLen); var n2 = Object.prototype.toString.call(o2).slice(8, -1); if (n2 === "Object" && o2.constructor) n2 = o2.constructor.name; if (n2 === "Map" || n2 === "Set") return Array.from(o2); if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2)) return _arrayLikeToArray(o2, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var hasOwnProperty = Object.hasOwnProperty; var setPrototypeOf = Object.setPrototypeOf; var isFrozen = Object.isFrozen; var getPrototypeOf = Object.getPrototypeOf; var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; var freeze = Object.freeze; var seal = Object.seal; var create2 = Object.create; var _ref = typeof Reflect !== "undefined" && Reflect; var apply = _ref.apply; var construct = _ref.construct; if (!apply) { apply = function apply2(fun, thisValue, args) { return fun.apply(thisValue, args); }; } if (!freeze) { freeze = function freeze2(x) { return x; }; } if (!seal) { seal = function seal2(x) { return x; }; } if (!construct) { construct = function construct2(Func, args) { return _construct(Func, _toConsumableArray(args)); }; } var arrayForEach = unapply(Array.prototype.forEach); var arrayPop = unapply(Array.prototype.pop); var arrayPush = unapply(Array.prototype.push); var stringToLowerCase = unapply(String.prototype.toLowerCase); var stringToString = unapply(String.prototype.toString); var stringMatch = unapply(String.prototype.match); var stringReplace = unapply(String.prototype.replace); var stringIndexOf = unapply(String.prototype.indexOf); var stringTrim = unapply(String.prototype.trim); var regExpTest = unapply(RegExp.prototype.test); var typeErrorCreate = unconstruct(TypeError); function unapply(func) { return function(thisArg) { for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } return apply(func, thisArg, args); }; } function unconstruct(func) { return function() { for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } return construct(func, args); }; } function addToSet(set, array, transformCaseFunc) { transformCaseFunc = transformCaseFunc ? transformCaseFunc : stringToLowerCase; if (setPrototypeOf) { setPrototypeOf(set, null); } var l = array.length; while (l--) { var element = array[l]; if (typeof element === "string") { var lcElement = transformCaseFunc(element); if (lcElement !== element) { if (!isFrozen(array)) { array[l] = lcElement; } element = lcElement; } } set[element] = true; } return set; } function clone(object) { var newObject = create2(null); var property; for (property in object) { if (apply(hasOwnProperty, object, [property]) === true) { newObject[property] = object[property]; } } return newObject; } function lookupGetter(object, prop) { while (object !== null) { var desc = getOwnPropertyDescriptor(object, prop); if (desc) { if (desc.get) { return unapply(desc.get); } if (typeof desc.value === "function") { return unapply(desc.value); } } object = getPrototypeOf(object); } function fallbackValue(element) { console.warn("fallback value for", element); return null; } return fallbackValue; } var html$1 = freeze(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "section", "select", "shadow", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]); var svg$1 = freeze(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]); var svgFilters = freeze(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]); var svgDisallowed = freeze(["animate", "color-profile", "cursor", "discard", "fedropshadow", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]); var mathMl$1 = freeze(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover"]); var mathMlDisallowed = freeze(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]); var text2 = freeze(["#text"]); var html = freeze(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "xmlns", "slot"]); var svg3 = freeze(["accent-height", "accumulate", "additive", "alignment-baseline", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]); var mathMl = freeze(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]); var xml = freeze(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]); var MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm); var ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm); var TMPLIT_EXPR = seal(/\${[\w\W]*}/gm); var DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]/); var ARIA_ATTR = seal(/^aria-[\-\w]+$/); var IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i); var IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i); var ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g); var DOCTYPE_NAME = seal(/^html$/i); var getGlobal = function getGlobal2() { return typeof window === "undefined" ? null : window; }; var _createTrustedTypesPolicy = function _createTrustedTypesPolicy2(trustedTypes, document2) { if (_typeof(trustedTypes) !== "object" || typeof trustedTypes.createPolicy !== "function") { return null; } var suffix = null; var ATTR_NAME = "data-tt-policy-suffix"; if (document2.currentScript && document2.currentScript.hasAttribute(ATTR_NAME)) { suffix = document2.currentScript.getAttribute(ATTR_NAME); } var policyName = "dompurify" + (suffix ? "#" + suffix : ""); try { return trustedTypes.createPolicy(policyName, { createHTML: function createHTML(html2) { return html2; }, createScriptURL: function createScriptURL(scriptUrl) { return scriptUrl; } }); } catch (_) { console.warn("TrustedTypes policy " + policyName + " could not be created."); return null; } }; function createDOMPurify() { var window2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal(); var DOMPurify = function DOMPurify2(root2) { return createDOMPurify(root2); }; DOMPurify.version = "2.4.5"; DOMPurify.removed = []; if (!window2 || !window2.document || window2.document.nodeType !== 9) { DOMPurify.isSupported = false; return DOMPurify; } var originalDocument = window2.document; var document2 = window2.document; var DocumentFragment = window2.DocumentFragment, HTMLTemplateElement2 = window2.HTMLTemplateElement, Node2 = window2.Node, Element2 = window2.Element, NodeFilter2 = window2.NodeFilter, _window$NamedNodeMap = window2.NamedNodeMap, NamedNodeMap = _window$NamedNodeMap === void 0 ? window2.NamedNodeMap || window2.MozNamedAttrMap : _window$NamedNodeMap, HTMLFormElement = window2.HTMLFormElement, DOMParser2 = window2.DOMParser, trustedTypes = window2.trustedTypes; var ElementPrototype = Element2.prototype; var cloneNode = lookupGetter(ElementPrototype, "cloneNode"); var getNextSibling = lookupGetter(ElementPrototype, "nextSibling"); var getChildNodes = lookupGetter(ElementPrototype, "childNodes"); var getParentNode2 = lookupGetter(ElementPrototype, "parentNode"); if (typeof HTMLTemplateElement2 === "function") { var template = document2.createElement("template"); if (template.content && template.content.ownerDocument) { document2 = template.content.ownerDocument; } } var trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, originalDocument); var emptyHTML = trustedTypesPolicy ? trustedTypesPolicy.createHTML("") : ""; var _document = document2, implementation = _document.implementation, createNodeIterator = _document.createNodeIterator, createDocumentFragment = _document.createDocumentFragment, getElementsByTagName = _document.getElementsByTagName; var importNode = originalDocument.importNode; var documentMode = {}; try { documentMode = clone(document2).documentMode ? document2.documentMode : {}; } catch (_) { } var hooks = {}; DOMPurify.isSupported = typeof getParentNode2 === "function" && implementation && typeof implementation.createHTMLDocument !== "undefined" && documentMode !== 9; var MUSTACHE_EXPR$1 = MUSTACHE_EXPR, ERB_EXPR$1 = ERB_EXPR, TMPLIT_EXPR$1 = TMPLIT_EXPR, DATA_ATTR$1 = DATA_ATTR, ARIA_ATTR$1 = ARIA_ATTR, IS_SCRIPT_OR_DATA$1 = IS_SCRIPT_OR_DATA, ATTR_WHITESPACE$1 = ATTR_WHITESPACE; var IS_ALLOWED_URI$1 = IS_ALLOWED_URI; var ALLOWED_TAGS = null; var DEFAULT_ALLOWED_TAGS = addToSet({}, [].concat(_toConsumableArray(html$1), _toConsumableArray(svg$1), _toConsumableArray(svgFilters), _toConsumableArray(mathMl$1), _toConsumableArray(text2))); var ALLOWED_ATTR = null; var DEFAULT_ALLOWED_ATTR = addToSet({}, [].concat(_toConsumableArray(html), _toConsumableArray(svg3), _toConsumableArray(mathMl), _toConsumableArray(xml))); var CUSTOM_ELEMENT_HANDLING = Object.seal(Object.create(null, { tagNameCheck: { writable: true, configurable: false, enumerable: true, value: null }, attributeNameCheck: { writable: true, configurable: false, enumerable: true, value: null }, allowCustomizedBuiltInElements: { writable: true, configurable: false, enumerable: true, value: false } })); var FORBID_TAGS = null; var FORBID_ATTR = null; var ALLOW_ARIA_ATTR = true; var ALLOW_DATA_ATTR = true; var ALLOW_UNKNOWN_PROTOCOLS = false; var ALLOW_SELF_CLOSE_IN_ATTR = true; var SAFE_FOR_TEMPLATES = false; var WHOLE_DOCUMENT = false; var SET_CONFIG = false; var FORCE_BODY = false; var RETURN_DOM = false; var RETURN_DOM_FRAGMENT = false; var RETURN_TRUSTED_TYPE = false; var SANITIZE_DOM = true; var SANITIZE_NAMED_PROPS = false; var SANITIZE_NAMED_PROPS_PREFIX = "user-content-"; var KEEP_CONTENT = true; var IN_PLACE = false; var USE_PROFILES = {}; var FORBID_CONTENTS = null; var DEFAULT_FORBID_CONTENTS = addToSet({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]); var DATA_URI_TAGS = null; var DEFAULT_DATA_URI_TAGS = addToSet({}, ["audio", "video", "img", "source", "image", "track"]); var URI_SAFE_ATTRIBUTES = null; var DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]); var MATHML_NAMESPACE = "http://www.w3.org/1998/Math/MathML"; var SVG_NAMESPACE = "http://www.w3.org/2000/svg"; var HTML_NAMESPACE = "http://www.w3.org/1999/xhtml"; var NAMESPACE = HTML_NAMESPACE; var IS_EMPTY_INPUT = false; var ALLOWED_NAMESPACES = null; var DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString); var PARSER_MEDIA_TYPE; var SUPPORTED_PARSER_MEDIA_TYPES = ["application/xhtml+xml", "text/html"]; var DEFAULT_PARSER_MEDIA_TYPE = "text/html"; var transformCaseFunc; var CONFIG = null; var formElement = document2.createElement("form"); var isRegexOrFunction = function isRegexOrFunction2(testValue) { return testValue instanceof RegExp || testValue instanceof Function; }; var _parseConfig = function _parseConfig2(cfg) { if (CONFIG && CONFIG === cfg) { return; } if (!cfg || _typeof(cfg) !== "object") { cfg = {}; } cfg = clone(cfg); PARSER_MEDIA_TYPE = SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? PARSER_MEDIA_TYPE = DEFAULT_PARSER_MEDIA_TYPE : PARSER_MEDIA_TYPE = cfg.PARSER_MEDIA_TYPE; transformCaseFunc = PARSER_MEDIA_TYPE === "application/xhtml+xml" ? stringToString : stringToLowerCase; ALLOWED_TAGS = "ALLOWED_TAGS" in cfg ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS; ALLOWED_ATTR = "ALLOWED_ATTR" in cfg ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR; ALLOWED_NAMESPACES = "ALLOWED_NAMESPACES" in cfg ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES; URI_SAFE_ATTRIBUTES = "ADD_URI_SAFE_ATTR" in cfg ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR, transformCaseFunc) : DEFAULT_URI_SAFE_ATTRIBUTES; DATA_URI_TAGS = "ADD_DATA_URI_TAGS" in cfg ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS, transformCaseFunc) : DEFAULT_DATA_URI_TAGS; FORBID_CONTENTS = "FORBID_CONTENTS" in cfg ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS; FORBID_TAGS = "FORBID_TAGS" in cfg ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {}; FORBID_ATTR = "FORBID_ATTR" in cfg ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {}; USE_PROFILES = "USE_PROFILES" in cfg ? cfg.USE_PROFILES : false; ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; RETURN_DOM = cfg.RETURN_DOM || false; RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; FORCE_BODY = cfg.FORCE_BODY || false; SANITIZE_DOM = cfg.SANITIZE_DOM !== false; SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; KEEP_CONTENT = cfg.KEEP_CONTENT !== false; IN_PLACE = cfg.IN_PLACE || false; IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI$1; NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE; CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {}; if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) { CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck; } if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) { CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck; } if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === "boolean") { CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements; } if (SAFE_FOR_TEMPLATES) { ALLOW_DATA_ATTR = false; } if (RETURN_DOM_FRAGMENT) { RETURN_DOM = true; } if (USE_PROFILES) { ALLOWED_TAGS = addToSet({}, _toConsumableArray(text2)); ALLOWED_ATTR = []; if (USE_PROFILES.html === true) { addToSet(ALLOWED_TAGS, html$1); addToSet(ALLOWED_ATTR, html); } if (USE_PROFILES.svg === true) { addToSet(ALLOWED_TAGS, svg$1); addToSet(ALLOWED_ATTR, svg3); addToSet(ALLOWED_ATTR, xml); } if (USE_PROFILES.svgFilters === true) { addToSet(ALLOWED_TAGS, svgFilters); addToSet(ALLOWED_ATTR, svg3); addToSet(ALLOWED_ATTR, xml); } if (USE_PROFILES.mathMl === true) { addToSet(ALLOWED_TAGS, mathMl$1); addToSet(ALLOWED_ATTR, mathMl); addToSet(ALLOWED_ATTR, xml); } } if (cfg.ADD_TAGS) { if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) { ALLOWED_TAGS = clone(ALLOWED_TAGS); } addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc); } if (cfg.ADD_ATTR) { if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) { ALLOWED_ATTR = clone(ALLOWED_ATTR); } addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc); } if (cfg.ADD_URI_SAFE_ATTR) { addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc); } if (cfg.FORBID_CONTENTS) { if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) { FORBID_CONTENTS = clone(FORBID_CONTENTS); } addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc); } if (KEEP_CONTENT) { ALLOWED_TAGS["#text"] = true; } if (WHOLE_DOCUMENT) { addToSet(ALLOWED_TAGS, ["html", "head", "body"]); } if (ALLOWED_TAGS.table) { addToSet(ALLOWED_TAGS, ["tbody"]); delete FORBID_TAGS.tbody; } if (freeze) { freeze(cfg); } CONFIG = cfg; }; var MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ["mi", "mo", "mn", "ms", "mtext"]); var HTML_INTEGRATION_POINTS = addToSet({}, ["foreignobject", "desc", "title", "annotation-xml"]); var COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ["title", "style", "font", "a", "script"]); var ALL_SVG_TAGS = addToSet({}, svg$1); addToSet(ALL_SVG_TAGS, svgFilters); addToSet(ALL_SVG_TAGS, svgDisallowed); var ALL_MATHML_TAGS = addToSet({}, mathMl$1); addToSet(ALL_MATHML_TAGS, mathMlDisallowed); var _checkValidNamespace = function _checkValidNamespace2(element) { var parent = getParentNode2(element); if (!parent || !parent.tagName) { parent = { namespaceURI: NAMESPACE, tagName: "template" }; } var tagName = stringToLowerCase(element.tagName); var parentTagName = stringToLowerCase(parent.tagName); if (!ALLOWED_NAMESPACES[element.namespaceURI]) { return false; } if (element.namespaceURI === SVG_NAMESPACE) { if (parent.namespaceURI === HTML_NAMESPACE) { return tagName === "svg"; } if (parent.namespaceURI === MATHML_NAMESPACE) { return tagName === "svg" && (parentTagName === "annotation-xml" || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]); } return Boolean(ALL_SVG_TAGS[tagName]); } if (element.namespaceURI === MATHML_NAMESPACE) { if (parent.namespaceURI === HTML_NAMESPACE) { return tagName === "math"; } if (parent.namespaceURI === SVG_NAMESPACE) { return tagName === "math" && HTML_INTEGRATION_POINTS[parentTagName]; } return Boolean(ALL_MATHML_TAGS[tagName]); } if (element.namespaceURI === HTML_NAMESPACE) { if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) { return false; } if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) { return false; } return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]); } if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && ALLOWED_NAMESPACES[element.namespaceURI]) { return true; } return false; }; var _forceRemove = function _forceRemove2(node) { arrayPush(DOMPurify.removed, { element: node }); try { node.parentNode.removeChild(node); } catch (_) { try { node.outerHTML = emptyHTML; } catch (_2) { node.remove(); } } }; var _removeAttribute = function _removeAttribute2(name2, node) { try { arrayPush(DOMPurify.removed, { attribute: node.getAttributeNode(name2), from: node }); } catch (_) { arrayPush(DOMPurify.removed, { attribute: null, from: node }); } node.removeAttribute(name2); if (name2 === "is" && !ALLOWED_ATTR[name2]) { if (RETURN_DOM || RETURN_DOM_FRAGMENT) { try { _forceRemove(node); } catch (_) { } } else { try { node.setAttribute(name2, ""); } catch (_) { } } } }; var _initDocument = function _initDocument2(dirty) { var doc; var leadingWhitespace; if (FORCE_BODY) { dirty = "" + dirty; } else { var matches2 = stringMatch(dirty, /^[\r\n\t ]+/); leadingWhitespace = matches2 && matches2[0]; } if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && NAMESPACE === HTML_NAMESPACE) { dirty = '' + dirty + ""; } var dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty; if (NAMESPACE === HTML_NAMESPACE) { try { doc = new DOMParser2().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE); } catch (_) { } } if (!doc || !doc.documentElement) { doc = implementation.createDocument(NAMESPACE, "template", null); try { doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload; } catch (_) { } } var body = doc.body || doc.documentElement; if (dirty && leadingWhitespace) { body.insertBefore(document2.createTextNode(leadingWhitespace), body.childNodes[0] || null); } if (NAMESPACE === HTML_NAMESPACE) { return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? "html" : "body")[0]; } return WHOLE_DOCUMENT ? doc.documentElement : body; }; var _createIterator = function _createIterator2(root2) { return createNodeIterator.call(root2.ownerDocument || root2, root2, NodeFilter2.SHOW_ELEMENT | NodeFilter2.SHOW_COMMENT | NodeFilter2.SHOW_TEXT, null, false); }; var _isClobbered = function _isClobbered2(elm) { return elm instanceof HTMLFormElement && (typeof elm.nodeName !== "string" || typeof elm.textContent !== "string" || typeof elm.removeChild !== "function" || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== "function" || typeof elm.setAttribute !== "function" || typeof elm.namespaceURI !== "string" || typeof elm.insertBefore !== "function" || typeof elm.hasChildNodes !== "function"); }; var _isNode = function _isNode2(object) { return _typeof(Node2) === "object" ? object instanceof Node2 : object && _typeof(object) === "object" && typeof object.nodeType === "number" && typeof object.nodeName === "string"; }; var _executeHook = function _executeHook2(entryPoint, currentNode, data3) { if (!hooks[entryPoint]) { return; } arrayForEach(hooks[entryPoint], function(hook) { hook.call(DOMPurify, currentNode, data3, CONFIG); }); }; var _sanitizeElements = function _sanitizeElements2(currentNode) { var content; _executeHook("beforeSanitizeElements", currentNode, null); if (_isClobbered(currentNode)) { _forceRemove(currentNode); return true; } if (regExpTest(/[\u0080-\uFFFF]/, currentNode.nodeName)) { _forceRemove(currentNode); return true; } var tagName = transformCaseFunc(currentNode.nodeName); _executeHook("uponSanitizeElement", currentNode, { tagName, allowedTags: ALLOWED_TAGS }); if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && (!_isNode(currentNode.content) || !_isNode(currentNode.content.firstElementChild)) && regExpTest(/<[/\w]/g, currentNode.innerHTML) && regExpTest(/<[/\w]/g, currentNode.textContent)) { _forceRemove(currentNode); return true; } if (tagName === "select" && regExpTest(/