@design.estate/dees-element
Version:
A library for creating custom elements extending the lit element class with additional functionalities.
1,306 lines (1,298 loc) • 1.4 MB
JavaScript
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __require = /* @__PURE__ */ ((x2) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x2, {
get: (a3, b4) => (typeof require !== "undefined" ? require : a3)[b4]
}) : x2)(function(x2) {
if (typeof require !== "undefined") return require.apply(this, arguments);
throw Error('Dynamic require of "' + x2 + '" is not supported');
});
var __commonJS = (cb, mod) => function __require2() {
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __export = (target, all3) => {
for (var name in all3)
__defProp(target, name, { get: all3[name], enumerable: true });
};
var __copyProps = (to, from2, except, desc) => {
if (from2 && typeof from2 === "object" || typeof from2 === "function") {
for (let key2 of __getOwnPropNames(from2))
if (!__hasOwnProp.call(to, key2) && key2 !== except)
__defProp(to, key2, { get: () => from2[key2], enumerable: !(desc = __getOwnPropDesc(from2, key2)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __decorateClass = (decorators, target, key2, kind) => {
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key2) : target;
for (var i8 = decorators.length - 1, decorator; i8 >= 0; i8--)
if (decorator = decorators[i8])
result = (kind ? decorator(target, key2, result) : decorator(result)) || result;
if (kind && result) __defProp(target, key2, result);
return result;
};
// node_modules/.pnpm/@push.rocks+isounique@1.0.5/node_modules/@push.rocks/isounique/dist_ts/index.js
var require_dist_ts = __commonJS({
"node_modules/.pnpm/@push.rocks+isounique@1.0.5/node_modules/@push.rocks/isounique/dist_ts/index.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.uni = void 0;
var uni3 = (prefix = "uni") => {
return `${prefix}_${`xxxxxxxxxxxxxxxxxxxxxxxx`.replace(/[xy]/g, (c7) => {
const r10 = Math.random() * 16 | 0;
const v4 = c7 === "x" ? r10 : r10 & 3 | 8;
return v4.toString(16);
})}`;
};
exports.uni = uni3;
}
});
// node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/dayjs.min.js
var require_dayjs_min = __commonJS({
"node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/dayjs.min.js"(exports, module) {
!function(t7, e9) {
"object" == typeof exports && "undefined" != typeof module ? module.exports = e9() : "function" == typeof define && define.amd ? define(e9) : (t7 = "undefined" != typeof globalThis ? globalThis : t7 || self).dayjs = e9();
}(exports, function() {
"use strict";
var t7 = 1e3, e9 = 6e4, n8 = 36e5, r10 = "millisecond", i8 = "second", s7 = "minute", u3 = "hour", a3 = "day", o9 = "week", c7 = "month", f6 = "quarter", h7 = "year", d4 = "date", l4 = "Invalid Date", $2 = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y4 = /\[([^\]]+)]|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(t8) {
var e10 = ["th", "st", "nd", "rd"], n9 = t8 % 100;
return "[" + t8 + (e10[(n9 - 20) % 10] || e10[n9] || e10[0]) + "]";
} }, m4 = function(t8, e10, n9) {
var r11 = String(t8);
return !r11 || r11.length >= e10 ? t8 : "" + Array(e10 + 1 - r11.length).join(n9) + t8;
}, v4 = { s: m4, z: function(t8) {
var e10 = -t8.utcOffset(), n9 = Math.abs(e10), r11 = Math.floor(n9 / 60), i9 = n9 % 60;
return (e10 <= 0 ? "+" : "-") + m4(r11, 2, "0") + ":" + m4(i9, 2, "0");
}, m: function t8(e10, n9) {
if (e10.date() < n9.date()) return -t8(n9, e10);
var r11 = 12 * (n9.year() - e10.year()) + (n9.month() - e10.month()), i9 = e10.clone().add(r11, c7), s8 = n9 - i9 < 0, u4 = e10.clone().add(r11 + (s8 ? -1 : 1), c7);
return +(-(r11 + (n9 - i9) / (s8 ? i9 - u4 : u4 - i9)) || 0);
}, a: function(t8) {
return t8 < 0 ? Math.ceil(t8) || 0 : Math.floor(t8);
}, p: function(t8) {
return { M: c7, y: h7, w: o9, d: a3, D: d4, h: u3, m: s7, s: i8, ms: r10, Q: f6 }[t8] || String(t8 || "").toLowerCase().replace(/s$/, "");
}, u: function(t8) {
return void 0 === t8;
} }, g3 = "en", D2 = {};
D2[g3] = M2;
var p5 = "$isDayjsObject", S4 = function(t8) {
return t8 instanceof _3 || !(!t8 || !t8[p5]);
}, w2 = function t8(e10, n9, r11) {
var i9;
if (!e10) return g3;
if ("string" == typeof e10) {
var s8 = e10.toLowerCase();
D2[s8] && (i9 = s8), n9 && (D2[s8] = n9, i9 = s8);
var u4 = e10.split("-");
if (!i9 && u4.length > 1) return t8(u4[0]);
} else {
var a4 = e10.name;
D2[a4] = e10, i9 = a4;
}
return !r11 && i9 && (g3 = i9), i9 || !r11 && g3;
}, O2 = function(t8, e10) {
if (S4(t8)) return t8.clone();
var n9 = "object" == typeof e10 ? e10 : {};
return n9.date = t8, n9.args = arguments, new _3(n9);
}, b4 = v4;
b4.l = w2, b4.i = S4, b4.w = function(t8, e10) {
return O2(t8, { locale: e10.$L, utc: e10.$u, x: e10.$x, $offset: e10.$offset });
};
var _3 = function() {
function M3(t8) {
this.$L = w2(t8.locale, null, true), this.parse(t8), this.$x = this.$x || t8.x || {}, this[p5] = true;
}
var m5 = M3.prototype;
return m5.parse = function(t8) {
this.$d = function(t9) {
var e10 = t9.date, n9 = t9.utc;
if (null === e10) return /* @__PURE__ */ new Date(NaN);
if (b4.u(e10)) return /* @__PURE__ */ new Date();
if (e10 instanceof Date) return new Date(e10);
if ("string" == typeof e10 && !/Z$/i.test(e10)) {
var r11 = e10.match($2);
if (r11) {
var i9 = r11[2] - 1 || 0, s8 = (r11[7] || "0").substring(0, 3);
return n9 ? new Date(Date.UTC(r11[1], i9, r11[3] || 1, r11[4] || 0, r11[5] || 0, r11[6] || 0, s8)) : new Date(r11[1], i9, r11[3] || 1, r11[4] || 0, r11[5] || 0, r11[6] || 0, s8);
}
}
return new Date(e10);
}(t8), this.init();
}, m5.init = function() {
var t8 = this.$d;
this.$y = t8.getFullYear(), this.$M = t8.getMonth(), this.$D = t8.getDate(), this.$W = t8.getDay(), this.$H = t8.getHours(), this.$m = t8.getMinutes(), this.$s = t8.getSeconds(), this.$ms = t8.getMilliseconds();
}, m5.$utils = function() {
return b4;
}, m5.isValid = function() {
return !(this.$d.toString() === l4);
}, m5.isSame = function(t8, e10) {
var n9 = O2(t8);
return this.startOf(e10) <= n9 && n9 <= this.endOf(e10);
}, m5.isAfter = function(t8, e10) {
return O2(t8) < this.startOf(e10);
}, m5.isBefore = function(t8, e10) {
return this.endOf(e10) < O2(t8);
}, m5.$g = function(t8, e10, n9) {
return b4.u(t8) ? this[e10] : this.set(n9, t8);
}, m5.unix = function() {
return Math.floor(this.valueOf() / 1e3);
}, m5.valueOf = function() {
return this.$d.getTime();
}, m5.startOf = function(t8, e10) {
var n9 = this, r11 = !!b4.u(e10) || e10, f7 = b4.p(t8), l5 = function(t9, e11) {
var i9 = b4.w(n9.$u ? Date.UTC(n9.$y, e11, t9) : new Date(n9.$y, e11, t9), n9);
return r11 ? i9 : i9.endOf(a3);
}, $3 = function(t9, e11) {
return b4.w(n9.toDate()[t9].apply(n9.toDate("s"), (r11 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e11)), n9);
}, y5 = this.$W, M4 = this.$M, m6 = this.$D, v5 = "set" + (this.$u ? "UTC" : "");
switch (f7) {
case h7:
return r11 ? l5(1, 0) : l5(31, 11);
case c7:
return r11 ? l5(1, M4) : l5(0, M4 + 1);
case o9:
var g4 = this.$locale().weekStart || 0, D3 = (y5 < g4 ? y5 + 7 : y5) - g4;
return l5(r11 ? m6 - D3 : m6 + (6 - D3), M4);
case a3:
case d4:
return $3(v5 + "Hours", 0);
case u3:
return $3(v5 + "Minutes", 1);
case s7:
return $3(v5 + "Seconds", 2);
case i8:
return $3(v5 + "Milliseconds", 3);
default:
return this.clone();
}
}, m5.endOf = function(t8) {
return this.startOf(t8, false);
}, m5.$set = function(t8, e10) {
var n9, o10 = b4.p(t8), f7 = "set" + (this.$u ? "UTC" : ""), l5 = (n9 = {}, n9[a3] = f7 + "Date", n9[d4] = f7 + "Date", n9[c7] = f7 + "Month", n9[h7] = f7 + "FullYear", n9[u3] = f7 + "Hours", n9[s7] = f7 + "Minutes", n9[i8] = f7 + "Seconds", n9[r10] = f7 + "Milliseconds", n9)[o10], $3 = o10 === a3 ? this.$D + (e10 - this.$W) : e10;
if (o10 === c7 || o10 === h7) {
var y5 = this.clone().set(d4, 1);
y5.$d[l5]($3), y5.init(), this.$d = y5.set(d4, Math.min(this.$D, y5.daysInMonth())).$d;
} else l5 && this.$d[l5]($3);
return this.init(), this;
}, m5.set = function(t8, e10) {
return this.clone().$set(t8, e10);
}, m5.get = function(t8) {
return this[b4.p(t8)]();
}, m5.add = function(r11, f7) {
var d5, l5 = this;
r11 = Number(r11);
var $3 = b4.p(f7), y5 = function(t8) {
var e10 = O2(l5);
return b4.w(e10.date(e10.date() + Math.round(t8 * r11)), l5);
};
if ($3 === c7) return this.set(c7, this.$M + r11);
if ($3 === h7) return this.set(h7, this.$y + r11);
if ($3 === a3) return y5(1);
if ($3 === o9) return y5(7);
var M4 = (d5 = {}, d5[s7] = e9, d5[u3] = n8, d5[i8] = t7, d5)[$3] || 1, m6 = this.$d.getTime() + r11 * M4;
return b4.w(m6, this);
}, m5.subtract = function(t8, e10) {
return this.add(-1 * t8, e10);
}, m5.format = function(t8) {
var e10 = this, n9 = this.$locale();
if (!this.isValid()) return n9.invalidDate || l4;
var r11 = t8 || "YYYY-MM-DDTHH:mm:ssZ", i9 = b4.z(this), s8 = this.$H, u4 = this.$m, a4 = this.$M, o10 = n9.weekdays, c8 = n9.months, f7 = n9.meridiem, h8 = function(t9, n10, i10, s9) {
return t9 && (t9[n10] || t9(e10, r11)) || i10[n10].slice(0, s9);
}, d5 = function(t9) {
return b4.s(s8 % 12 || 12, t9, "0");
}, $3 = f7 || function(t9, e11, n10) {
var r12 = t9 < 12 ? "AM" : "PM";
return n10 ? r12.toLowerCase() : r12;
};
return r11.replace(y4, function(t9, r12) {
return r12 || function(t10) {
switch (t10) {
case "YY":
return String(e10.$y).slice(-2);
case "YYYY":
return b4.s(e10.$y, 4, "0");
case "M":
return a4 + 1;
case "MM":
return b4.s(a4 + 1, 2, "0");
case "MMM":
return h8(n9.monthsShort, a4, c8, 3);
case "MMMM":
return h8(c8, a4);
case "D":
return e10.$D;
case "DD":
return b4.s(e10.$D, 2, "0");
case "d":
return String(e10.$W);
case "dd":
return h8(n9.weekdaysMin, e10.$W, o10, 2);
case "ddd":
return h8(n9.weekdaysShort, e10.$W, o10, 3);
case "dddd":
return o10[e10.$W];
case "H":
return String(s8);
case "HH":
return b4.s(s8, 2, "0");
case "h":
return d5(1);
case "hh":
return d5(2);
case "a":
return $3(s8, u4, true);
case "A":
return $3(s8, u4, false);
case "m":
return String(u4);
case "mm":
return b4.s(u4, 2, "0");
case "s":
return String(e10.$s);
case "ss":
return b4.s(e10.$s, 2, "0");
case "SSS":
return b4.s(e10.$ms, 3, "0");
case "Z":
return i9;
}
return null;
}(t9) || i9.replace(":", "");
});
}, m5.utcOffset = function() {
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
}, m5.diff = function(r11, d5, l5) {
var $3, y5 = this, M4 = b4.p(d5), m6 = O2(r11), v5 = (m6.utcOffset() - this.utcOffset()) * e9, g4 = this - m6, D3 = function() {
return b4.m(y5, m6);
};
switch (M4) {
case h7:
$3 = D3() / 12;
break;
case c7:
$3 = D3();
break;
case f6:
$3 = D3() / 3;
break;
case o9:
$3 = (g4 - v5) / 6048e5;
break;
case a3:
$3 = (g4 - v5) / 864e5;
break;
case u3:
$3 = g4 / n8;
break;
case s7:
$3 = g4 / e9;
break;
case i8:
$3 = g4 / t7;
break;
default:
$3 = g4;
}
return l5 ? $3 : b4.a($3);
}, m5.daysInMonth = function() {
return this.endOf(c7).$D;
}, m5.$locale = function() {
return D2[this.$L];
}, m5.locale = function(t8, e10) {
if (!t8) return this.$L;
var n9 = this.clone(), r11 = w2(t8, e10, true);
return r11 && (n9.$L = r11), n9;
}, m5.clone = function() {
return b4.w(this.$d, this);
}, m5.toDate = function() {
return new Date(this.valueOf());
}, m5.toJSON = function() {
return this.isValid() ? this.toISOString() : null;
}, m5.toISOString = function() {
return this.$d.toISOString();
}, m5.toString = function() {
return this.$d.toUTCString();
}, M3;
}(), k2 = _3.prototype;
return O2.prototype = k2, [["$ms", r10], ["$s", i8], ["$m", s7], ["$H", u3], ["$W", a3], ["$M", c7], ["$y", h7], ["$D", d4]].forEach(function(t8) {
k2[t8[1]] = function(e10) {
return this.$g(e10, t8[0], t8[1]);
};
}), O2.extend = function(t8, e10) {
return t8.$i || (t8(e10, _3, O2), t8.$i = true), O2;
}, O2.locale = w2, O2.isDayjs = S4, O2.unix = function(t8) {
return O2(1e3 * t8);
}, O2.en = D2[g3], O2.Ls = D2, O2.p = {}, O2;
});
}
});
// node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/plugin/isToday.js
var require_isToday = __commonJS({
"node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/plugin/isToday.js"(exports, module) {
!function(e9, o9) {
"object" == typeof exports && "undefined" != typeof module ? module.exports = o9() : "function" == typeof define && define.amd ? define(o9) : (e9 = "undefined" != typeof globalThis ? globalThis : e9 || self).dayjs_plugin_isToday = o9();
}(exports, function() {
"use strict";
return function(e9, o9, t7) {
o9.prototype.isToday = function() {
var e10 = "YYYY-MM-DD", o10 = t7();
return this.format(e10) === o10.format(e10);
};
};
});
}
});
// node_modules/.pnpm/symbol-tree@3.2.4/node_modules/symbol-tree/lib/SymbolTreeNode.js
var require_SymbolTreeNode = __commonJS({
"node_modules/.pnpm/symbol-tree@3.2.4/node_modules/symbol-tree/lib/SymbolTreeNode.js"(exports, module) {
"use strict";
module.exports = class SymbolTreeNode {
constructor() {
this.parent = null;
this.previousSibling = null;
this.nextSibling = null;
this.firstChild = null;
this.lastChild = null;
this.childrenVersion = 0;
this.childIndexCachedUpTo = null;
this.cachedIndex = -1;
this.cachedIndexVersion = NaN;
}
get isAttached() {
return Boolean(this.parent || this.previousSibling || this.nextSibling);
}
get hasChildren() {
return Boolean(this.firstChild);
}
childrenChanged() {
this.childrenVersion = this.childrenVersion + 1 & 4294967295;
this.childIndexCachedUpTo = null;
}
getCachedIndex(parentNode) {
if (this.cachedIndexVersion !== parentNode.childrenVersion) {
this.cachedIndexVersion = NaN;
return -1;
}
return this.cachedIndex;
}
setCachedIndex(parentNode, index2) {
this.cachedIndexVersion = parentNode.childrenVersion;
this.cachedIndex = index2;
}
};
}
});
// node_modules/.pnpm/symbol-tree@3.2.4/node_modules/symbol-tree/lib/TreePosition.js
var require_TreePosition = __commonJS({
"node_modules/.pnpm/symbol-tree@3.2.4/node_modules/symbol-tree/lib/TreePosition.js"(exports, module) {
"use strict";
module.exports = Object.freeze({
// same as DOM DOCUMENT_POSITION_
DISCONNECTED: 1,
PRECEDING: 2,
FOLLOWING: 4,
CONTAINS: 8,
CONTAINED_BY: 16
});
}
});
// node_modules/.pnpm/symbol-tree@3.2.4/node_modules/symbol-tree/lib/TreeIterator.js
var require_TreeIterator = __commonJS({
"node_modules/.pnpm/symbol-tree@3.2.4/node_modules/symbol-tree/lib/TreeIterator.js"(exports, module) {
"use strict";
var TREE = Symbol();
var ROOT = Symbol();
var NEXT = Symbol();
var ITERATE_FUNC = Symbol();
var TreeIterator = class {
constructor(tree, root6, firstResult, iterateFunction) {
this[TREE] = tree;
this[ROOT] = root6;
this[NEXT] = firstResult;
this[ITERATE_FUNC] = iterateFunction;
}
next() {
const tree = this[TREE];
const iterateFunc = this[ITERATE_FUNC];
const root6 = this[ROOT];
if (!this[NEXT]) {
return {
done: true,
value: root6
};
}
const value2 = this[NEXT];
if (iterateFunc === 1) {
this[NEXT] = tree._node(value2).previousSibling;
} else if (iterateFunc === 2) {
this[NEXT] = tree._node(value2).nextSibling;
} else if (iterateFunc === 3) {
this[NEXT] = tree._node(value2).parent;
} else if (iterateFunc === 4) {
this[NEXT] = tree.preceding(value2, { root: root6 });
} else {
this[NEXT] = tree.following(value2, { root: root6 });
}
return {
done: false,
value: value2
};
}
};
Object.defineProperty(TreeIterator.prototype, Symbol.iterator, {
value: function() {
return this;
},
writable: false
});
TreeIterator.PREV = 1;
TreeIterator.NEXT = 2;
TreeIterator.PARENT = 3;
TreeIterator.PRECEDING = 4;
TreeIterator.FOLLOWING = 5;
Object.freeze(TreeIterator);
Object.freeze(TreeIterator.prototype);
module.exports = TreeIterator;
}
});
// node_modules/.pnpm/symbol-tree@3.2.4/node_modules/symbol-tree/lib/SymbolTree.js
var require_SymbolTree = __commonJS({
"node_modules/.pnpm/symbol-tree@3.2.4/node_modules/symbol-tree/lib/SymbolTree.js"(exports, module) {
"use strict";
var SymbolTreeNode = require_SymbolTreeNode();
var TreePosition = require_TreePosition();
var TreeIterator = require_TreeIterator();
function returnTrue() {
return true;
}
function reverseArrayIndex(array, reverseIndex) {
return array[array.length - 1 - reverseIndex];
}
var SymbolTree = class {
/**
* @constructor
* @alias module:symbol-tree
* @param {string} [description='SymbolTree data'] Description used for the Symbol
*/
constructor(description) {
this.symbol = Symbol(description || "SymbolTree data");
}
/**
* You can use this function to (optionally) initialize an object right after its creation,
* to take advantage of V8's fast properties. Also useful if you would like to
* freeze your object.
*
* `O(1)`
*
* @method
* @alias module:symbol-tree#initialize
* @param {Object} object
* @return {Object} object
*/
initialize(object) {
this._node(object);
return object;
}
_node(object) {
if (!object) {
return null;
}
const node2 = object[this.symbol];
if (node2) {
return node2;
}
return object[this.symbol] = new SymbolTreeNode();
}
/**
* Returns `true` if the object has any children. Otherwise it returns `false`.
*
* * `O(1)`
*
* @method hasChildren
* @memberOf module:symbol-tree#
* @param {Object} object
* @return {Boolean}
*/
hasChildren(object) {
return this._node(object).hasChildren;
}
/**
* Returns the first child of the given object.
*
* * `O(1)`
*
* @method firstChild
* @memberOf module:symbol-tree#
* @param {Object} object
* @return {Object}
*/
firstChild(object) {
return this._node(object).firstChild;
}
/**
* Returns the last child of the given object.
*
* * `O(1)`
*
* @method lastChild
* @memberOf module:symbol-tree#
* @param {Object} object
* @return {Object}
*/
lastChild(object) {
return this._node(object).lastChild;
}
/**
* Returns the previous sibling of the given object.
*
* * `O(1)`
*
* @method previousSibling
* @memberOf module:symbol-tree#
* @param {Object} object
* @return {Object}
*/
previousSibling(object) {
return this._node(object).previousSibling;
}
/**
* Returns the next sibling of the given object.
*
* * `O(1)`
*
* @method nextSibling
* @memberOf module:symbol-tree#
* @param {Object} object
* @return {Object}
*/
nextSibling(object) {
return this._node(object).nextSibling;
}
/**
* Return the parent of the given object.
*
* * `O(1)`
*
* @method parent
* @memberOf module:symbol-tree#
* @param {Object} object
* @return {Object}
*/
parent(object) {
return this._node(object).parent;
}
/**
* Find the inclusive descendant that is last in tree order of the given object.
*
* * `O(n)` (worst case) where `n` is the depth of the subtree of `object`
*
* @method lastInclusiveDescendant
* @memberOf module:symbol-tree#
* @param {Object} object
* @return {Object}
*/
lastInclusiveDescendant(object) {
let lastChild;
let current = object;
while (lastChild = this._node(current).lastChild) {
current = lastChild;
}
return current;
}
/**
* Find the preceding object (A) of the given object (B).
* An object A is preceding an object B if A and B are in the same tree
* and A comes before B in tree order.
*
* * `O(n)` (worst case)
* * `O(1)` (amortized when walking the entire tree)
*
* @method preceding
* @memberOf module:symbol-tree#
* @param {Object} object
* @param {Object} [options]
* @param {Object} [options.root] If set, `root` must be an inclusive ancestor
* of the return value (or else null is returned). This check _assumes_
* that `root` is also an inclusive ancestor of the given `object`
* @return {?Object}
*/
preceding(object, options) {
const treeRoot = options && options.root;
if (object === treeRoot) {
return null;
}
const previousSibling = this._node(object).previousSibling;
if (previousSibling) {
return this.lastInclusiveDescendant(previousSibling);
}
return this._node(object).parent;
}
/**
* Find the following object (A) of the given object (B).
* An object A is following an object B if A and B are in the same tree
* and A comes after B in tree order.
*
* * `O(n)` (worst case) where `n` is the amount of objects in the entire tree
* * `O(1)` (amortized when walking the entire tree)
*
* @method following
* @memberOf module:symbol-tree#
* @param {!Object} object
* @param {Object} [options]
* @param {Object} [options.root] If set, `root` must be an inclusive ancestor
* of the return value (or else null is returned). This check _assumes_
* that `root` is also an inclusive ancestor of the given `object`
* @param {Boolean} [options.skipChildren=false] If set, ignore the children of `object`
* @return {?Object}
*/
following(object, options) {
const treeRoot = options && options.root;
const skipChildren = options && options.skipChildren;
const firstChild = !skipChildren && this._node(object).firstChild;
if (firstChild) {
return firstChild;
}
let current = object;
do {
if (current === treeRoot) {
return null;
}
const nextSibling = this._node(current).nextSibling;
if (nextSibling) {
return nextSibling;
}
current = this._node(current).parent;
} while (current);
return null;
}
/**
* Append all children of the given object to an array.
*
* * `O(n)` where `n` is the amount of children of the given `parent`
*
* @method childrenToArray
* @memberOf module:symbol-tree#
* @param {Object} parent
* @param {Object} [options]
* @param {Object[]} [options.array=[]]
* @param {Function} [options.filter] Function to test each object before it is added to the array.
* Invoked with arguments (object). Should return `true` if an object
* is to be included.
* @param {*} [options.thisArg] Value to use as `this` when executing `filter`.
* @return {Object[]}
*/
childrenToArray(parent, options) {
const array = options && options.array || [];
const filter2 = options && options.filter || returnTrue;
const thisArg = options && options.thisArg || void 0;
const parentNode = this._node(parent);
let object = parentNode.firstChild;
let index2 = 0;
while (object) {
const node2 = this._node(object);
node2.setCachedIndex(parentNode, index2);
if (filter2.call(thisArg, object)) {
array.push(object);
}
object = node2.nextSibling;
++index2;
}
return array;
}
/**
* Append all inclusive ancestors of the given object to an array.
*
* * `O(n)` where `n` is the amount of ancestors of the given `object`
*
* @method ancestorsToArray
* @memberOf module:symbol-tree#
* @param {Object} object
* @param {Object} [options]
* @param {Object[]} [options.array=[]]
* @param {Function} [options.filter] Function to test each object before it is added to the array.
* Invoked with arguments (object). Should return `true` if an object
* is to be included.
* @param {*} [options.thisArg] Value to use as `this` when executing `filter`.
* @return {Object[]}
*/
ancestorsToArray(object, options) {
const array = options && options.array || [];
const filter2 = options && options.filter || returnTrue;
const thisArg = options && options.thisArg || void 0;
let ancestor = object;
while (ancestor) {
if (filter2.call(thisArg, ancestor)) {
array.push(ancestor);
}
ancestor = this._node(ancestor).parent;
}
return array;
}
/**
* Append all descendants of the given object to an array (in tree order).
*
* * `O(n)` where `n` is the amount of objects in the sub-tree of the given `object`
*
* @method treeToArray
* @memberOf module:symbol-tree#
* @param {Object} root
* @param {Object} [options]
* @param {Object[]} [options.array=[]]
* @param {Function} [options.filter] Function to test each object before it is added to the array.
* Invoked with arguments (object). Should return `true` if an object
* is to be included.
* @param {*} [options.thisArg] Value to use as `this` when executing `filter`.
* @return {Object[]}
*/
treeToArray(root6, options) {
const array = options && options.array || [];
const filter2 = options && options.filter || returnTrue;
const thisArg = options && options.thisArg || void 0;
let object = root6;
while (object) {
if (filter2.call(thisArg, object)) {
array.push(object);
}
object = this.following(object, { root: root6 });
}
return array;
}
/**
* Iterate over all children of the given object
*
* * `O(1)` for a single iteration
*
* @method childrenIterator
* @memberOf module:symbol-tree#
* @param {Object} parent
* @param {Object} [options]
* @param {Boolean} [options.reverse=false]
* @return {Object} An iterable iterator (ES6)
*/
childrenIterator(parent, options) {
const reverse = options && options.reverse;
const parentNode = this._node(parent);
return new TreeIterator(
this,
parent,
reverse ? parentNode.lastChild : parentNode.firstChild,
reverse ? TreeIterator.PREV : TreeIterator.NEXT
);
}
/**
* Iterate over all the previous siblings of the given object. (in reverse tree order)
*
* * `O(1)` for a single iteration
*
* @method previousSiblingsIterator
* @memberOf module:symbol-tree#
* @param {Object} object
* @return {Object} An iterable iterator (ES6)
*/
previousSiblingsIterator(object) {
return new TreeIterator(
this,
object,
this._node(object).previousSibling,
TreeIterator.PREV
);
}
/**
* Iterate over all the next siblings of the given object. (in tree order)
*
* * `O(1)` for a single iteration
*
* @method nextSiblingsIterator
* @memberOf module:symbol-tree#
* @param {Object} object
* @return {Object} An iterable iterator (ES6)
*/
nextSiblingsIterator(object) {
return new TreeIterator(
this,
object,
this._node(object).nextSibling,
TreeIterator.NEXT
);
}
/**
* Iterate over all inclusive ancestors of the given object
*
* * `O(1)` for a single iteration
*
* @method ancestorsIterator
* @memberOf module:symbol-tree#
* @param {Object} object
* @return {Object} An iterable iterator (ES6)
*/
ancestorsIterator(object) {
return new TreeIterator(
this,
object,
object,
TreeIterator.PARENT
);
}
/**
* Iterate over all descendants of the given object (in tree order).
*
* Where `n` is the amount of objects in the sub-tree of the given `root`:
*
* * `O(n)` (worst case for a single iteration)
* * `O(n)` (amortized, when completing the iterator)
*
* @method treeIterator
* @memberOf module:symbol-tree#
* @param {Object} root
* @param {Object} options
* @param {Boolean} [options.reverse=false]
* @return {Object} An iterable iterator (ES6)
*/
treeIterator(root6, options) {
const reverse = options && options.reverse;
return new TreeIterator(
this,
root6,
reverse ? this.lastInclusiveDescendant(root6) : root6,
reverse ? TreeIterator.PRECEDING : TreeIterator.FOLLOWING
);
}
/**
* Find the index of the given object (the number of preceding siblings).
*
* * `O(n)` where `n` is the amount of preceding siblings
* * `O(1)` (amortized, if the tree is not modified)
*
* @method index
* @memberOf module:symbol-tree#
* @param {Object} child
* @return {Number} The number of preceding siblings, or -1 if the object has no parent
*/
index(child) {
const childNode = this._node(child);
const parentNode = this._node(childNode.parent);
if (!parentNode) {
return -1;
}
let currentIndex = childNode.getCachedIndex(parentNode);
if (currentIndex >= 0) {
return currentIndex;
}
currentIndex = 0;
let object = parentNode.firstChild;
if (parentNode.childIndexCachedUpTo) {
const cachedUpToNode = this._node(parentNode.childIndexCachedUpTo);
object = cachedUpToNode.nextSibling;
currentIndex = cachedUpToNode.getCachedIndex(parentNode) + 1;
}
while (object) {
const node2 = this._node(object);
node2.setCachedIndex(parentNode, currentIndex);
if (object === child) {
break;
}
++currentIndex;
object = node2.nextSibling;
}
parentNode.childIndexCachedUpTo = child;
return currentIndex;
}
/**
* Calculate the number of children.
*
* * `O(n)` where `n` is the amount of children
* * `O(1)` (amortized, if the tree is not modified)
*
* @method childrenCount
* @memberOf module:symbol-tree#
* @param {Object} parent
* @return {Number}
*/
childrenCount(parent) {
const parentNode = this._node(parent);
if (!parentNode.lastChild) {
return 0;
}
return this.index(parentNode.lastChild) + 1;
}
/**
* Compare the position of an object relative to another object. A bit set is returned:
*
* <ul>
* <li>DISCONNECTED : 1</li>
* <li>PRECEDING : 2</li>
* <li>FOLLOWING : 4</li>
* <li>CONTAINS : 8</li>
* <li>CONTAINED_BY : 16</li>
* </ul>
*
* The semantics are the same as compareDocumentPosition in DOM, with the exception that
* DISCONNECTED never occurs with any other bit.
*
* where `n` and `m` are the amount of ancestors of `left` and `right`;
* where `o` is the amount of children of the lowest common ancestor of `left` and `right`:
*
* * `O(n + m + o)` (worst case)
* * `O(n + m)` (amortized, if the tree is not modified)
*
* @method compareTreePosition
* @memberOf module:symbol-tree#
* @param {Object} left
* @param {Object} right
* @return {Number}
*/
compareTreePosition(left, right) {
if (left === right) {
return 0;
}
const leftAncestors = [];
{
let leftAncestor = left;
while (leftAncestor) {
if (leftAncestor === right) {
return TreePosition.CONTAINS | TreePosition.PRECEDING;
}
leftAncestors.push(leftAncestor);
leftAncestor = this.parent(leftAncestor);
}
}
const rightAncestors = [];
{
let rightAncestor = right;
while (rightAncestor) {
if (rightAncestor === left) {
return TreePosition.CONTAINED_BY | TreePosition.FOLLOWING;
}
rightAncestors.push(rightAncestor);
rightAncestor = this.parent(rightAncestor);
}
}
const root6 = reverseArrayIndex(leftAncestors, 0);
if (!root6 || root6 !== reverseArrayIndex(rightAncestors, 0)) {
return TreePosition.DISCONNECTED;
}
let commonAncestorIndex = 0;
const ancestorsMinLength = Math.min(leftAncestors.length, rightAncestors.length);
for (let i8 = 0; i8 < ancestorsMinLength; ++i8) {
const leftAncestor = reverseArrayIndex(leftAncestors, i8);
const rightAncestor = reverseArrayIndex(rightAncestors, i8);
if (leftAncestor !== rightAncestor) {
break;
}
commonAncestorIndex = i8;
}
const leftIndex = this.index(reverseArrayIndex(leftAncestors, commonAncestorIndex + 1));
const rightIndex = this.index(reverseArrayIndex(rightAncestors, commonAncestorIndex + 1));
return rightIndex < leftIndex ? TreePosition.PRECEDING : TreePosition.FOLLOWING;
}
/**
* Remove the object from this tree.
* Has no effect if already removed.
*
* * `O(1)`
*
* @method remove
* @memberOf module:symbol-tree#
* @param {Object} removeObject
* @return {Object} removeObject
*/
remove(removeObject) {
const removeNode = this._node(removeObject);
const parentNode = this._node(removeNode.parent);
const prevNode = this._node(removeNode.previousSibling);
const nextNode = this._node(removeNode.nextSibling);
if (parentNode) {
if (parentNode.firstChild === removeObject) {
parentNode.firstChild = removeNode.nextSibling;
}
if (parentNode.lastChild === removeObject) {
parentNode.lastChild = removeNode.previousSibling;
}
}
if (prevNode) {
prevNode.nextSibling = removeNode.nextSibling;
}
if (nextNode) {
nextNode.previousSibling = removeNode.previousSibling;
}
removeNode.parent = null;
removeNode.previousSibling = null;
removeNode.nextSibling = null;
removeNode.cachedIndex = -1;
removeNode.cachedIndexVersion = NaN;
if (parentNode) {
parentNode.childrenChanged();
}
return removeObject;
}
/**
* Insert the given object before the reference object.
* `newObject` is now the previous sibling of `referenceObject`.
*
* * `O(1)`
*
* @method insertBefore
* @memberOf module:symbol-tree#
* @param {Object} referenceObject
* @param {Object} newObject
* @throws {Error} If the newObject is already present in this SymbolTree
* @return {Object} newObject
*/
insertBefore(referenceObject, newObject) {
const referenceNode = this._node(referenceObject);
const prevNode = this._node(referenceNode.previousSibling);
const newNode = this._node(newObject);
const parentNode = this._node(referenceNode.parent);
if (newNode.isAttached) {
throw Error("Given object is already present in this SymbolTree, remove it first");
}
newNode.parent = referenceNode.parent;
newNode.previousSibling = referenceNode.previousSibling;
newNode.nextSibling = referenceObject;
referenceNode.previousSibling = newObject;
if (prevNode) {
prevNode.nextSibling = newObject;
}
if (parentNode && parentNode.firstChild === referenceObject) {
parentNode.firstChild = newObject;
}
if (parentNode) {
parentNode.childrenChanged();
}
return newObject;
}
/**
* Insert the given object after the reference object.
* `newObject` is now the next sibling of `referenceObject`.
*
* * `O(1)`
*
* @method insertAfter
* @memberOf module:symbol-tree#
* @param {Object} referenceObject
* @param {Object} newObject
* @throws {Error} If the newObject is already present in this SymbolTree
* @return {Object} newObject
*/
insertAfter(referenceObject, newObject) {
const referenceNode = this._node(referenceObject);
const nextNode = this._node(referenceNode.nextSibling);
const newNode = this._node(newObject);
const parentNode = this._node(referenceNode.parent);
if (newNode.isAttached) {
throw Error("Given object is already present in this SymbolTree, remove it first");
}
newNode.parent = referenceNode.parent;
newNode.previousSibling = referenceObject;
newNode.nextSibling = referenceNode.nextSibling;
referenceNode.nextSibling = newObject;
if (nextNode) {
nextNode.previousSibling = newObject;
}
if (parentNode && parentNode.lastChild === referenceObject) {
parentNode.lastChild = newObject;
}
if (parentNode) {
parentNode.childrenChanged();
}
return newObject;
}
/**
* Insert the given object as the first child of the given reference object.
* `newObject` is now the first child of `referenceObject`.
*
* * `O(1)`
*
* @method prependChild
* @memberOf module:symbol-tree#
* @param {Object} referenceObject
* @param {Object} newObject
* @throws {Error} If the newObject is already present in this SymbolTree
* @return {Object} newObject
*/
prependChild(referenceObject, newObject) {
const referenceNode = this._node(referenceObject);
const newNode = this._node(newObject);
if (newNode.isAttached) {
throw Error("Given object is already present in this SymbolTree, remove it first");
}
if (referenceNode.hasChildren) {
this.insertBefore(referenceNode.firstChild, newObject);
} else {
newNode.parent = referenceObject;
referenceNode.firstChild = newObject;
referenceNode.lastChild = newObject;
referenceNode.childrenChanged();
}
return newObject;
}
/**
* Insert the given object as the last child of the given reference object.
* `newObject` is now the last child of `referenceObject`.
*
* * `O(1)`
*
* @method appendChild
* @memberOf module:symbol-tree#
* @param {Object} referenceObject
* @param {Object} newObject
* @throws {Error} If the newObject is already present in this SymbolTree
* @return {Object} newObject
*/
appendChild(referenceObject, newObject) {
const referenceNode = this._node(referenceObject);
const newNode = this._node(newObject);
if (newNode.isAttached) {
throw Error("Given object is already present in this SymbolTree, remove it first");
}
if (referenceNode.hasChildren) {
this.insertAfter(referenceNode.lastChild, newObject);
} else {
newNode.parent = referenceObject;
referenceNode.firstChild = newObject;
referenceNode.lastChild = newObject;
referenceNode.childrenChanged();
}
return newObject;
}
};
module.exports = SymbolTree;
SymbolTree.TreePosition = TreePosition;
}
});
// node_modules/.pnpm/punycode@1.4.1/node_modules/punycode/punycode.js
var require_punycode = __commonJS({
"node_modules/.pnpm/punycode@1.4.1/node_modules/punycode/punycode.js"(exports, module) {
(function(root6) {
var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
var freeModule = typeof module == "object" && module && !module.nodeType && module;
var freeGlobal = typeof global == "object" && global;
if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal) {
root6 = freeGlobal;
}
var punycode, maxInt = 2147483647, base = 36, tMin = 1, tMax = 26, skew = 38, damp2 = 700, initialBias = 72, initialN = 128, delimiter = "-", regexPunycode = /^xn--/, regexNonASCII = /[^\x20-\x7E]/, regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, errors = {
"overflow": "Overflow: input needs wider integers to process",
"not-basic": "Illegal input >= 0x80 (not a basic code point)",
"invalid-input": "Invalid input"
}, baseMinusTMin = base - tMin, floor = Math.floor, stringFromCharCode = String.fromCharCode, key2;
function error(type5) {
throw new RangeError(errors[type5]);
}
function map8(array, fn) {
var length = array.length;
var result = [];
while (length--) {
result[length] = fn(array[length]);
}
return result;
}
function mapDomain(string3, fn) {
var parts = string3.split("@");
var result = "";
if (parts.length > 1) {
result = parts[0] + "@";
string3 = parts[1];
}
string3 = string3.replace(regexSeparators, ".");
var labels = string3.split(".");
var encoded = map8(labels, fn).join(".");
return result + encoded;
}
function ucs2decode(string3) {
var output = [], counter = 0, length = string3.length, value2, extra;
while (counter < length) {
value2 = string3.charCodeAt(counter++);
if (value2 >= 55296 && value2 <= 56319 && counter < length) {
extra = string3.charCodeAt(counter++);
if ((extra & 64512) == 56320) {
output.push(((value2 & 1023) << 10) + (extra & 1023) + 65536);
} else {
output.push(value2);
counter--;
}
} else {
output.push(value2);
}
}
return output;
}
function ucs2encode(array) {
return map8(array, function(value2) {
var output = "";
if (value2 > 65535) {
value2 -= 65536;
output += stringFromCharCode(value2 >>> 10 & 1023 | 55296);
value2 = 56320 | value2 & 1023;
}
output += stringFromCharCode(value2);
return output;
}).join("");
}
function basicToDigit(codePoint) {
if (codePoint - 48 < 10) {
return codePoint - 22;
}
if (codePoint - 65 < 26) {
return codePoint - 65;
}
if (codePoint - 97 < 26) {
return codePoint - 97;
}
return base;
}
function digitToBasic(digit, flag) {
return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
}
function adapt(delta, numPoints, firstTime) {
var k2 = 0;
delta = firstTime ? floor(delta / damp2) : delta >> 1;
delta += floor(delta / numPoints);
for (; delta > baseMinusTMin * tMax >> 1; k2 += base) {
delta = floor(delta / baseMinusTMin);
}
return floor(k2 + (baseMinusTMin + 1) * delta / (delta + skew));
}
function decode3(input) {
var output = [], inputLength = input.length, out, i8 = 0, n8 = initialN, bias = initialBias, basic, j2, index2, oldi, w2, k2, digit, t7, baseMinusT;
basic = input.lastIndexOf(delimiter);
if (basic < 0) {
basic = 0;
}
for (j2 = 0; j2 < basic; ++j2) {
if (input.charCodeAt(j2) >= 128) {
error("not-basic");
}
output.push(input.charCodeAt(j2));
}
for (index2 = basic > 0 ? basic + 1 : 0; index2 < inputLength; ) {
for (oldi = i8, w2 = 1, k2 = base; ; k2 += base) {
if (index2 >= inputLength) {
error("invalid-input");
}
digit = basicToDigit(input.charCodeAt(index2++));
if (digit >= base || digit > floor((maxInt - i8) / w2)) {
error("overflow");
}
i8 += digit * w2;
t7 = k2 <= bias ? tMin : k2 >= bias + tMax ? tMax : k2 - bias;
if (digit < t7) {
break;
}
baseMinusT = base - t7;
if (w2 > floor(maxInt / baseMinusT)) {
error("overflow");
}
w2 *= baseMinusT;
}
out = output.length + 1;
bias = adapt(i8