@expofp/floorplan
Version:
Interactive floor plan library for expos and events
2,657 lines • 1.76 MB
JavaScript
function __vite_inject_css__(css, id, forceLightDom){ if (typeof document==='undefined') return; var shadow=!forceLightDom&&typeof window!=='undefined'&&window.__efpShadowDOMStyleParent; var parent=shadow||document.head; var s=document.createElement('style'); s.setAttribute('data-chunk-style', id); s.appendChild(document.createTextNode(css)); parent.appendChild(s);}
(function() {
try {
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {};
e.SENTRY_RELEASE = { id: "3.7.8" };
var t = new e.Error().stack;
t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "3c2bae46-39ce-41a8-89f3-c32b891d2e50", e._sentryDebugIdIdentifier = "sentry-dbid-3c2bae46-39ce-41a8-89f3-c32b891d2e50");
} catch {}
})();
import { r as e, t } from "./rolldown-runtime-YBAZwyzS.js";
import { t as n } from "./react-Di3Pmpio.js";
import { i as r } from "./reset-all-settings-CB7mF2PC.js";
import { t as i } from "./jsx-runtime-C8yjdFgZ.js";
import { _ as a, a as o, d as s, f as c, g as l, h as u, i as d, l as f, m as p, n as m, o as h, p as g, r as _, t as v, u as y, v as b } from "./loadImage-CAq2UZsg.js";
import { t as x } from "./browser-CIXTbsxm.js";
import { $ as S, A as C, H as w, I as T, J as E, K as D, L as O, O as ee, R as k, S as te, U as ne, V as re, W as ie, X as ae, Y as oe, Z as se, _ as ce, a as le, at as ue, c as de, ct as A, d as fe, g as j, it as pe, j as me, m as he, n as ge, nt as _e, o as ve, p as M, r as ye, rt as be, s as N, t as P, u as F, v as xe, z as Se } from "./i18n-BEer1tI4.js";
import { t as I } from "./classnames-BRCgwycl.js";
import { n as Ce, t as we } from "./Button-C4gPbjAY.js";
//#endregion
//#region src/tools/settings.ts
var Te = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
var n = function(e) {
return r(e) && !i(e);
};
function r(e) {
return !!e && typeof e == "object";
}
function i(e) {
var t = Object.prototype.toString.call(e);
return t === "[object RegExp]" || t === "[object Date]" || o(e);
}
var a = typeof Symbol == "function" && Symbol.for ? Symbol.for("react.element") : 60103;
function o(e) {
return e.$$typeof === a;
}
function s(e) {
return Array.isArray(e) ? [] : {};
}
function c(e, t) {
return t.clone !== !1 && t.isMergeableObject(e) ? g(s(e), e, t) : e;
}
function l(e, t, n) {
return e.concat(t).map(function(e) {
return c(e, n);
});
}
function u(e, t) {
if (!t.customMerge) return g;
var n = t.customMerge(e);
return typeof n == "function" ? n : g;
}
function d(e) {
return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(e).filter(function(t) {
return Object.propertyIsEnumerable.call(e, t);
}) : [];
}
function f(e) {
return Object.keys(e).concat(d(e));
}
function p(e, t) {
try {
return t in e;
} catch {
return !1;
}
}
function m(e, t) {
return p(e, t) && !(Object.hasOwnProperty.call(e, t) && Object.propertyIsEnumerable.call(e, t));
}
function h(e, t, n) {
var r = {};
return n.isMergeableObject(e) && f(e).forEach(function(t) {
r[t] = c(e[t], n);
}), f(t).forEach(function(i) {
m(e, i) || (p(e, i) && n.isMergeableObject(t[i]) ? r[i] = u(i, n)(e[i], t[i], n) : r[i] = c(t[i], n));
}), r;
}
function g(e, t, r) {
r = r || {}, r.arrayMerge = r.arrayMerge || l, r.isMergeableObject = r.isMergeableObject || n, r.cloneUnlessOtherwiseSpecified = c;
var i = Array.isArray(t);
return i === Array.isArray(e) ? i ? r.arrayMerge(e, t, r) : h(e, t, r) : c(t, r);
}
g.all = function(e, t) {
if (!Array.isArray(e)) throw Error("first argument should be an array");
return e.reduce(function(e, n) {
return g(e, n, t);
}, {});
}, t.exports = g;
})))(), 1), Ee = class {
constructor() {
this.boothLabelColor = "#fff", this.boothBorderColor = "#fff", this.backgroundColor = "#ebebeb", this.boothBorderWidth = void 0, this.heatmapColors = [
"#FDE7C7",
"#FDDBAE",
"#FDC48D",
"#FCB37C",
"#FCA26D",
"#F67B5B",
"#EB483E",
"#E03143",
"#6C0022"
], this.maxZoom = void 0;
}
}, De = new class extends Ee {
constructor(...e) {
super(...e), this.EXPO = window.__efpEvent, this.borderless = !1, this.wayfinding = !1, this.colors = { booths: {
default: "#41b6e7",
defaultHold: "#48484A",
defaultSold: "#41b6e7",
seectedLight: null,
selected: "#fb3e59",
selectedBorder: null,
wayfinding: {
selected: "#0088D6",
selectedBorder: null
},
empty: "#aaaaaa"
} };
}
}();
De.EXPO.startsWith("sxsw2024") ? (De.colors.booths.selected = "#FF6400", De.colors.booths.seectedLight = "#808080") : De.EXPO === "whxdubai2026" ? (De.colors.booths.selected = "#2B66FE", De.maxZoom = 450) : De.EXPO === "whxlabs2026" ? De.colors.booths.selected = "#2B66FE" : (De.EXPO === "wineparis2026" || De.EXPO === "rdemo2025") && (De.maxZoom = 450), De = (0, Te.default)(De, window.__settings || window.__fpSettings || {}), De = (0, Te.default)(De, window.__fpSettings || {});
var Oe = De, ke = {};
function Ae(e) {
return `${Oe.EXPO}-${e}`;
}
function je(e) {
return e;
}
function Me(e) {
return e === "bookmarked" ? {
exhibitors: [],
events: [],
speakers: [],
booths: []
} : {
exhibitors: [],
events: []
};
}
function Ne(e, t) {
if (typeof t != "object" || !t) return A.log(`Invalid ${e} data in localStorage - using defaults`), Me(e);
if (Array.isArray(t)) {
let n = e === "bookmarked" ? {
exhibitors: t,
events: [],
speakers: [],
booths: []
} : {
exhibitors: t,
events: []
};
return A.log(`Migrated ${e} data from array to object format`), Fe(e, n), n;
}
if (e === "bookmarked") {
let n = t, r = { ...n };
return "speakers" in r || (r.speakers = []), "booths" in r || (r.booths = []), (!n.speakers || !n.booths) && (A.log(`Migrated ${e} data (added speakers or booths field)`), Fe(e, r)), r;
}
return e === "visited" ? t : (A.log(`Unsupported ${e} data format - using defaults`), Me(e));
}
function Pe(e) {
if (ke[e]) return ke[e];
let t = Me(e);
if (!de) return A.warn(`localStorage unavailable — using default for ${e}`), ke[e] = t, t;
let n = Ae(e), r = je(e), i = null;
try {
var a;
i = (a = localStorage.getItem(n)) == null ? localStorage.getItem(r) : a;
} catch (t) {
A.warn(`localStorage access error for ${e}`, t);
}
if (!i) return ke[e] = t, t;
try {
let t = Ne(e, JSON.parse(i));
return ke[e] = t, t;
} catch (n) {
return A.error(`Error parsing ${e} data`, n), ke[e] = t, t;
}
}
function Fe(e, t) {
if (!de) return;
let n = Ae(e);
try {
localStorage.setItem(n, JSON.stringify(t)), ke[e] = t;
let r = {
exhibitors: t.exhibitors.length,
events: t.events.length
};
t.speakers && (r.speakers = t.speakers.length), t.booths && (r.booths = t.booths.length), A.log(`save${e[0].toUpperCase() + e.slice(1)}ToLocalStorage`, r);
} catch (t) {
A.error(`Failed to save ${e} data`, t);
}
}
//#endregion
//#region src/store/init/init-bookmarks.ts
function Ie(e) {
let t = new URL(window.location.href), n = t.searchParams.get("b"), r = t.searchParams.get("ba"), i = n || r;
if (!i) return;
let a = i.split("|").map((e) => Number.parseInt(e, 10)).filter((e) => Number.isFinite(e) && e > 0), o = new Set(e.eventStore.eventItems.map((e) => e.id)), s = a.filter((t) => e.exhibitorStore.exhibitorById.has(t)), c = a.filter((e) => o.has(e)), l = a.filter((t) => e.speakerStore.speakersMap.has(t)), u = a.filter((t) => {
let n = e.boothStore.boothById.get(t);
return n && n.exhibitors.length === 0;
});
if (r) {
let e = Pe("bookmarked");
s.push(...e.exhibitors), c.push(...e.events), l.push(...e.speakers), u.push(...e.booths);
}
Fe("bookmarked", {
exhibitors: s,
events: c,
speakers: l,
booths: u
}), e.exhibitorStore.replaceBookmarked(s), e.eventStore.replaceBookmarked(c), e.speakerStore.replaceBookmarked(l), e.boothStore.replaceBookmarked(u);
}
//#endregion
//#region ../../node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js
var Le = /* @__PURE__ */ t(((e, t) => {
t.exports = {
aliceblue: [
240,
248,
255
],
antiquewhite: [
250,
235,
215
],
aqua: [
0,
255,
255
],
aquamarine: [
127,
255,
212
],
azure: [
240,
255,
255
],
beige: [
245,
245,
220
],
bisque: [
255,
228,
196
],
black: [
0,
0,
0
],
blanchedalmond: [
255,
235,
205
],
blue: [
0,
0,
255
],
blueviolet: [
138,
43,
226
],
brown: [
165,
42,
42
],
burlywood: [
222,
184,
135
],
cadetblue: [
95,
158,
160
],
chartreuse: [
127,
255,
0
],
chocolate: [
210,
105,
30
],
coral: [
255,
127,
80
],
cornflowerblue: [
100,
149,
237
],
cornsilk: [
255,
248,
220
],
crimson: [
220,
20,
60
],
cyan: [
0,
255,
255
],
darkblue: [
0,
0,
139
],
darkcyan: [
0,
139,
139
],
darkgoldenrod: [
184,
134,
11
],
darkgray: [
169,
169,
169
],
darkgreen: [
0,
100,
0
],
darkgrey: [
169,
169,
169
],
darkkhaki: [
189,
183,
107
],
darkmagenta: [
139,
0,
139
],
darkolivegreen: [
85,
107,
47
],
darkorange: [
255,
140,
0
],
darkorchid: [
153,
50,
204
],
darkred: [
139,
0,
0
],
darksalmon: [
233,
150,
122
],
darkseagreen: [
143,
188,
143
],
darkslateblue: [
72,
61,
139
],
darkslategray: [
47,
79,
79
],
darkslategrey: [
47,
79,
79
],
darkturquoise: [
0,
206,
209
],
darkviolet: [
148,
0,
211
],
deeppink: [
255,
20,
147
],
deepskyblue: [
0,
191,
255
],
dimgray: [
105,
105,
105
],
dimgrey: [
105,
105,
105
],
dodgerblue: [
30,
144,
255
],
firebrick: [
178,
34,
34
],
floralwhite: [
255,
250,
240
],
forestgreen: [
34,
139,
34
],
fuchsia: [
255,
0,
255
],
gainsboro: [
220,
220,
220
],
ghostwhite: [
248,
248,
255
],
gold: [
255,
215,
0
],
goldenrod: [
218,
165,
32
],
gray: [
128,
128,
128
],
green: [
0,
128,
0
],
greenyellow: [
173,
255,
47
],
grey: [
128,
128,
128
],
honeydew: [
240,
255,
240
],
hotpink: [
255,
105,
180
],
indianred: [
205,
92,
92
],
indigo: [
75,
0,
130
],
ivory: [
255,
255,
240
],
khaki: [
240,
230,
140
],
lavender: [
230,
230,
250
],
lavenderblush: [
255,
240,
245
],
lawngreen: [
124,
252,
0
],
lemonchiffon: [
255,
250,
205
],
lightblue: [
173,
216,
230
],
lightcoral: [
240,
128,
128
],
lightcyan: [
224,
255,
255
],
lightgoldenrodyellow: [
250,
250,
210
],
lightgray: [
211,
211,
211
],
lightgreen: [
144,
238,
144
],
lightgrey: [
211,
211,
211
],
lightpink: [
255,
182,
193
],
lightsalmon: [
255,
160,
122
],
lightseagreen: [
32,
178,
170
],
lightskyblue: [
135,
206,
250
],
lightslategray: [
119,
136,
153
],
lightslategrey: [
119,
136,
153
],
lightsteelblue: [
176,
196,
222
],
lightyellow: [
255,
255,
224
],
lime: [
0,
255,
0
],
limegreen: [
50,
205,
50
],
linen: [
250,
240,
230
],
magenta: [
255,
0,
255
],
maroon: [
128,
0,
0
],
mediumaquamarine: [
102,
205,
170
],
mediumblue: [
0,
0,
205
],
mediumorchid: [
186,
85,
211
],
mediumpurple: [
147,
112,
219
],
mediumseagreen: [
60,
179,
113
],
mediumslateblue: [
123,
104,
238
],
mediumspringgreen: [
0,
250,
154
],
mediumturquoise: [
72,
209,
204
],
mediumvioletred: [
199,
21,
133
],
midnightblue: [
25,
25,
112
],
mintcream: [
245,
255,
250
],
mistyrose: [
255,
228,
225
],
moccasin: [
255,
228,
181
],
navajowhite: [
255,
222,
173
],
navy: [
0,
0,
128
],
oldlace: [
253,
245,
230
],
olive: [
128,
128,
0
],
olivedrab: [
107,
142,
35
],
orange: [
255,
165,
0
],
orangered: [
255,
69,
0
],
orchid: [
218,
112,
214
],
palegoldenrod: [
238,
232,
170
],
palegreen: [
152,
251,
152
],
paleturquoise: [
175,
238,
238
],
palevioletred: [
219,
112,
147
],
papayawhip: [
255,
239,
213
],
peachpuff: [
255,
218,
185
],
peru: [
205,
133,
63
],
pink: [
255,
192,
203
],
plum: [
221,
160,
221
],
powderblue: [
176,
224,
230
],
purple: [
128,
0,
128
],
rebeccapurple: [
102,
51,
153
],
red: [
255,
0,
0
],
rosybrown: [
188,
143,
143
],
royalblue: [
65,
105,
225
],
saddlebrown: [
139,
69,
19
],
salmon: [
250,
128,
114
],
sandybrown: [
244,
164,
96
],
seagreen: [
46,
139,
87
],
seashell: [
255,
245,
238
],
sienna: [
160,
82,
45
],
silver: [
192,
192,
192
],
skyblue: [
135,
206,
235
],
slateblue: [
106,
90,
205
],
slategray: [
112,
128,
144
],
slategrey: [
112,
128,
144
],
snow: [
255,
250,
250
],
springgreen: [
0,
255,
127
],
steelblue: [
70,
130,
180
],
tan: [
210,
180,
140
],
teal: [
0,
128,
128
],
thistle: [
216,
191,
216
],
tomato: [
255,
99,
71
],
turquoise: [
64,
224,
208
],
violet: [
238,
130,
238
],
wheat: [
245,
222,
179
],
white: [
255,
255,
255
],
whitesmoke: [
245,
245,
245
],
yellow: [
255,
255,
0
],
yellowgreen: [
154,
205,
50
]
};
})), Re = /* @__PURE__ */ t(((e, t) => {
t.exports = function(e) {
return !e || typeof e == "string" ? !1 : e instanceof Array || Array.isArray(e) || e.length >= 0 && (e.splice instanceof Function || Object.getOwnPropertyDescriptor(e, e.length - 1) && e.constructor.name !== "String");
};
})), ze = /* @__PURE__ */ t(((e, t) => {
var n = Re(), r = Array.prototype.concat, i = Array.prototype.slice, a = t.exports = function(e) {
for (var t = [], a = 0, o = e.length; a < o; a++) {
var s = e[a];
n(s) ? t = r.call(t, i.call(s)) : t.push(s);
}
return t;
};
a.wrap = function(e) {
return function() {
return e(a(arguments));
};
};
})), Be = /* @__PURE__ */ t(((e, t) => {
var n = Le(), r = ze(), i = Object.hasOwnProperty, a = Object.create(null);
for (var o in n) i.call(n, o) && (a[n[o]] = o);
var s = t.exports = {
to: {},
get: {}
};
s.get = function(e) {
var t = e.substring(0, 3).toLowerCase(), n, r;
switch (t) {
case "hsl":
n = s.get.hsl(e), r = "hsl";
break;
case "hwb":
n = s.get.hwb(e), r = "hwb";
break;
default:
n = s.get.rgb(e), r = "rgb";
break;
}
return n ? {
model: r,
value: n
} : null;
}, s.get.rgb = function(e) {
if (!e) return null;
var t = /^#([a-f0-9]{3,4})$/i, r = /^#([a-f0-9]{6})([a-f0-9]{2})?$/i, a = /^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/, o = /^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/, s = /^(\w+)$/, l = [
0,
0,
0,
1
], u, d, f;
if (u = e.match(r)) {
for (f = u[2], u = u[1], d = 0; d < 3; d++) {
var p = d * 2;
l[d] = parseInt(u.slice(p, p + 2), 16);
}
f && (l[3] = parseInt(f, 16) / 255);
} else if (u = e.match(t)) {
for (u = u[1], f = u[3], d = 0; d < 3; d++) l[d] = parseInt(u[d] + u[d], 16);
f && (l[3] = parseInt(f + f, 16) / 255);
} else if (u = e.match(a)) {
for (d = 0; d < 3; d++) l[d] = parseInt(u[d + 1], 0);
u[4] && (u[5] ? l[3] = parseFloat(u[4]) * .01 : l[3] = parseFloat(u[4]));
} else if (u = e.match(o)) {
for (d = 0; d < 3; d++) l[d] = Math.round(parseFloat(u[d + 1]) * 2.55);
u[4] && (u[5] ? l[3] = parseFloat(u[4]) * .01 : l[3] = parseFloat(u[4]));
} else if (u = e.match(s)) return u[1] === "transparent" ? [
0,
0,
0,
0
] : i.call(n, u[1]) ? (l = n[u[1]], l[3] = 1, l) : null;
else return null;
for (d = 0; d < 3; d++) l[d] = c(l[d], 0, 255);
return l[3] = c(l[3], 0, 1), l;
}, s.get.hsl = function(e) {
if (!e) return null;
var t = e.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);
if (t) {
var n = parseFloat(t[4]);
return [
(parseFloat(t[1]) % 360 + 360) % 360,
c(parseFloat(t[2]), 0, 100),
c(parseFloat(t[3]), 0, 100),
c(isNaN(n) ? 1 : n, 0, 1)
];
}
return null;
}, s.get.hwb = function(e) {
if (!e) return null;
var t = e.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);
if (t) {
var n = parseFloat(t[4]);
return [
(parseFloat(t[1]) % 360 + 360) % 360,
c(parseFloat(t[2]), 0, 100),
c(parseFloat(t[3]), 0, 100),
c(isNaN(n) ? 1 : n, 0, 1)
];
}
return null;
}, s.to.hex = function() {
var e = r(arguments);
return "#" + l(e[0]) + l(e[1]) + l(e[2]) + (e[3] < 1 ? l(Math.round(e[3] * 255)) : "");
}, s.to.rgb = function() {
var e = r(arguments);
return e.length < 4 || e[3] === 1 ? "rgb(" + Math.round(e[0]) + ", " + Math.round(e[1]) + ", " + Math.round(e[2]) + ")" : "rgba(" + Math.round(e[0]) + ", " + Math.round(e[1]) + ", " + Math.round(e[2]) + ", " + e[3] + ")";
}, s.to.rgb.percent = function() {
var e = r(arguments), t = Math.round(e[0] / 255 * 100), n = Math.round(e[1] / 255 * 100), i = Math.round(e[2] / 255 * 100);
return e.length < 4 || e[3] === 1 ? "rgb(" + t + "%, " + n + "%, " + i + "%)" : "rgba(" + t + "%, " + n + "%, " + i + "%, " + e[3] + ")";
}, s.to.hsl = function() {
var e = r(arguments);
return e.length < 4 || e[3] === 1 ? "hsl(" + e[0] + ", " + e[1] + "%, " + e[2] + "%)" : "hsla(" + e[0] + ", " + e[1] + "%, " + e[2] + "%, " + e[3] + ")";
}, s.to.hwb = function() {
var e = r(arguments), t = "";
return e.length >= 4 && e[3] !== 1 && (t = ", " + e[3]), "hwb(" + e[0] + ", " + e[1] + "%, " + e[2] + "%" + t + ")";
}, s.to.keyword = function(e) {
return a[e.slice(0, 3)];
};
function c(e, t, n) {
return Math.min(Math.max(t, e), n);
}
function l(e) {
var t = Math.round(e).toString(16).toUpperCase();
return t.length < 2 ? "0" + t : t;
}
})), Ve = /* @__PURE__ */ t(((e, t) => {
t.exports = {
aliceblue: [
240,
248,
255
],
antiquewhite: [
250,
235,
215
],
aqua: [
0,
255,
255
],
aquamarine: [
127,
255,
212
],
azure: [
240,
255,
255
],
beige: [
245,
245,
220
],
bisque: [
255,
228,
196
],
black: [
0,
0,
0
],
blanchedalmond: [
255,
235,
205
],
blue: [
0,
0,
255
],
blueviolet: [
138,
43,
226
],
brown: [
165,
42,
42
],
burlywood: [
222,
184,
135
],
cadetblue: [
95,
158,
160
],
chartreuse: [
127,
255,
0
],
chocolate: [
210,
105,
30
],
coral: [
255,
127,
80
],
cornflowerblue: [
100,
149,
237
],
cornsilk: [
255,
248,
220
],
crimson: [
220,
20,
60
],
cyan: [
0,
255,
255
],
darkblue: [
0,
0,
139
],
darkcyan: [
0,
139,
139
],
darkgoldenrod: [
184,
134,
11
],
darkgray: [
169,
169,
169
],
darkgreen: [
0,
100,
0
],
darkgrey: [
169,
169,
169
],
darkkhaki: [
189,
183,
107
],
darkmagenta: [
139,
0,
139
],
darkolivegreen: [
85,
107,
47
],
darkorange: [
255,
140,
0
],
darkorchid: [
153,
50,
204
],
darkred: [
139,
0,
0
],
darksalmon: [
233,
150,
122
],
darkseagreen: [
143,
188,
143
],
darkslateblue: [
72,
61,
139
],
darkslategray: [
47,
79,
79
],
darkslategrey: [
47,
79,
79
],
darkturquoise: [
0,
206,
209
],
darkviolet: [
148,
0,
211
],
deeppink: [
255,
20,
147
],
deepskyblue: [
0,
191,
255
],
dimgray: [
105,
105,
105
],
dimgrey: [
105,
105,
105
],
dodgerblue: [
30,
144,
255
],
firebrick: [
178,
34,
34
],
floralwhite: [
255,
250,
240
],
forestgreen: [
34,
139,
34
],
fuchsia: [
255,
0,
255
],
gainsboro: [
220,
220,
220
],
ghostwhite: [
248,
248,
255
],
gold: [
255,
215,
0
],
goldenrod: [
218,
165,
32
],
gray: [
128,
128,
128
],
green: [
0,
128,
0
],
greenyellow: [
173,
255,
47
],
grey: [
128,
128,
128
],
honeydew: [
240,
255,
240
],
hotpink: [
255,
105,
180
],
indianred: [
205,
92,
92
],
indigo: [
75,
0,
130
],
ivory: [
255,
255,
240
],
khaki: [
240,
230,
140
],
lavender: [
230,
230,
250
],
lavenderblush: [
255,
240,
245
],
lawngreen: [
124,
252,
0
],
lemonchiffon: [
255,
250,
205
],
lightblue: [
173,
216,
230
],
lightcoral: [
240,
128,
128
],
lightcyan: [
224,
255,
255
],
lightgoldenrodyellow: [
250,
250,
210
],
lightgray: [
211,
211,
211
],
lightgreen: [
144,
238,
144
],
lightgrey: [
211,
211,
211
],
lightpink: [
255,
182,
193
],
lightsalmon: [
255,
160,
122
],
lightseagreen: [
32,
178,
170
],
lightskyblue: [
135,
206,
250
],
lightslategray: [
119,
136,
153
],
lightslategrey: [
119,
136,
153
],
lightsteelblue: [
176,
196,
222
],
lightyellow: [
255,
255,
224
],
lime: [
0,
255,
0
],
limegreen: [
50,
205,
50
],
linen: [
250,
240,
230
],
magenta: [
255,
0,
255
],
maroon: [
128,
0,
0
],
mediumaquamarine: [
102,
205,
170
],
mediumblue: [
0,
0,
205
],
mediumorchid: [
186,
85,
211
],
mediumpurple: [
147,
112,
219
],
mediumseagreen: [
60,
179,
113
],
mediumslateblue: [
123,
104,
238
],
mediumspringgreen: [
0,
250,
154
],
mediumturquoise: [
72,
209,
204
],
mediumvioletred: [
199,
21,
133
],
midnightblue: [
25,
25,
112
],
mintcream: [
245,
255,
250
],
mistyrose: [
255,
228,
225
],
moccasin: [
255,
228,
181
],
navajowhite: [
255,
222,
173
],
navy: [
0,
0,
128
],
oldlace: [
253,
245,
230
],
olive: [
128,
128,
0
],
olivedrab: [
107,
142,
35
],
orange: [
255,
165,
0
],
orangered: [
255,
69,
0
],
orchid: [
218,
112,
214
],
palegoldenrod: [
238,
232,
170
],
palegreen: [
152,
251,
152
],
paleturquoise: [
175,
238,
238
],
palevioletred: [
219,
112,
147
],
papayawhip: [
255,
239,
213
],
peachpuff: [
255,
218,
185
],
peru: [
205,
133,
63
],
pink: [
255,
192,
203
],
plum: [
221,
160,
221
],
powderblue: [
176,
224,
230
],
purple: [
128,
0,
128
],
rebeccapurple: [
102,
51,
153
],
red: [
255,
0,
0
],
rosybrown: [
188,
143,
143
],
royalblue: [
65,
105,
225
],
saddlebrown: [
139,
69,
19
],
salmon: [
250,
128,
114
],
sandybrown: [
244,
164,
96
],
seagreen: [
46,
139,
87
],
seashell: [
255,
245,
238
],
sienna: [
160,
82,
45
],
silver: [
192,
192,
192
],
skyblue: [
135,
206,
235
],
slateblue: [
106,
90,
205
],
slategray: [
112,
128,
144
],
slategrey: [
112,
128,
144
],
snow: [
255,
250,
250
],
springgreen: [
0,
255,
127
],
steelblue: [
70,
130,
180
],
tan: [
210,
180,
140
],
teal: [
0,
128,
128
],
thistle: [
216,
191,
216
],
tomato: [
255,
99,
71
],
turquoise: [
64,
224,
208
],
violet: [
238,
130,
238
],
wheat: [
245,
222,
179
],
white: [
255,
255,
255
],
whitesmoke: [
245,
245,
245
],
yellow: [
255,
255,
0
],
yellowgreen: [
154,
205,
50
]
};
})), He = /* @__PURE__ */ t(((e, t) => {
var n = Ve(), r = {};
for (var i in n) n.hasOwnProperty(i) && (r[n[i]] = i);
var a = t.exports = {
rgb: {
channels: 3,
labels: "rgb"
},
hsl: {
channels: 3,
labels: "hsl"
},
hsv: {
channels: 3,
labels: "hsv"
},
hwb: {
channels: 3,
labels: "hwb"
},
cmyk: {
channels: 4,
labels: "cmyk"
},
xyz: {
channels: 3,
labels: "xyz"
},
lab: {
channels: 3,
labels: "lab"
},
lch: {
channels: 3,
labels: "lch"
},
hex: {
channels: 1,
labels: ["hex"]
},
keyword: {
channels: 1,
labels: ["keyword"]
},
ansi16: {
channels: 1,
labels: ["ansi16"]
},
ansi256: {
channels: 1,
labels: ["ansi256"]
},
hcg: {
channels: 3,
labels: [
"h",
"c",
"g"
]
},
apple: {
channels: 3,
labels: [
"r16",
"g16",
"b16"
]
},
gray: {
channels: 1,
labels: ["gray"]
}
};
for (var o in a) if (a.hasOwnProperty(o)) {
if (!("channels" in a[o])) throw Error("missing channels property: " + o);
if (!("labels" in a[o])) throw Error("missing channel labels property: " + o);
if (a[o].labels.length !== a[o].channels) throw Error("channel and label counts mismatch: " + o);
var s = a[o].channels, c = a[o].labels;
delete a[o].channels, delete a[o].labels, Object.defineProperty(a[o], "channels", { value: s }), Object.defineProperty(a[o], "labels", { value: c });
}
a.rgb.hsl = function(e) {
var t = e[0] / 255, n = e[1] / 255, r = e[2] / 255, i = Math.min(t, n, r), a = Math.max(t, n, r), o = a - i, s, c, l;
return a === i ? s = 0 : t === a ? s = (n - r) / o : n === a ? s = 2 + (r - t) / o : r === a && (s = 4 + (t - n) / o), s = Math.min(s * 60, 360), s < 0 && (s += 360), l = (i + a) / 2, c = a === i ? 0 : l <= .5 ? o / (a + i) : o / (2 - a - i), [
s,
c * 100,
l * 100
];
}, a.rgb.hsv = function(e) {
var t, n, r, i, a, o = e[0] / 255, s = e[1] / 255, c = e[2] / 255, l = Math.max(o, s, c), u = l - Math.min(o, s, c), d = function(e) {
return (l - e) / 6 / u + 1 / 2;
};
return u === 0 ? i = a = 0 : (a = u / l, t = d(o), n = d(s), r = d(c), o === l ? i = r - n : s === l ? i = 1 / 3 + t - r : c === l && (i = 2 / 3 + n - t), i < 0 ? i += 1 : i > 1 && --i), [
i * 360,
a * 100,
l * 100
];
}, a.rgb.hwb = function(e) {
var t = e[0], n = e[1], r = e[2], i = a.rgb.hsl(e)[0], o = 1 / 255 * Math.min(t, Math.min(n, r));
return r = 1 - 1 / 255 * Math.max(t, Math.max(n, r)), [
i,
o * 100,
r * 100
];
}, a.rgb.cmyk = function(e) {
var t = e[0] / 255, n = e[1] / 255, r = e[2] / 255, i, a, o, s = Math.min(1 - t, 1 - n, 1 - r);
return i = (1 - t - s) / (1 - s) || 0, a = (1 - n - s) / (1 - s) || 0, o = (1 - r - s) / (1 - s) || 0, [
i * 100,
a * 100,
o * 100,
s * 100
];
};
function l(e, t) {
return (e[0] - t[0]) ** 2 + (e[1] - t[1]) ** 2 + (e[2] - t[2]) ** 2;
}
a.rgb.keyword = function(e) {
var t = r[e];
if (t) return t;
var i = Infinity, a;
for (var o in n) if (n.hasOwnProperty(o)) {
var s = n[o], c = l(e, s);
c < i && (i = c, a = o);
}
return a;
}, a.keyword.rgb = function(e) {
return n[e];
}, a.rgb.xyz = function(e) {
var t = e[0] / 255, n = e[1] / 255, r = e[2] / 255;
t = t > .04045 ? ((t + .055) / 1.055) ** 2.4 : t / 12.92, n = n > .04045 ? ((n + .055) / 1.055) ** 2.4 : n / 12.92, r = r > .04045 ? ((r + .055) / 1.055) ** 2.4 : r / 12.92;
var i = t * .4124 + n * .3576 + r * .1805, a = t * .2126 + n * .7152 + r * .0722, o = t * .0193 + n * .1192 + r * .9505;
return [
i * 100,
a * 100,
o * 100
];
}, a.rgb.lab = function(e) {
var t = a.rgb.xyz(e), n = t[0], r = t[1], i = t[2], o, s, c;
return n /= 95.047, r /= 100, i /= 108.883, n = n > .008856 ? n ** (1 / 3) : 7.787 * n + 16 / 116, r = r > .008856 ? r ** (1 / 3) : 7.787 * r + 16 / 116, i = i > .008856 ? i ** (1 / 3) : 7.787 * i + 16 / 116, o = 116 * r - 16, s = 500 * (n - r), c = 200 * (r - i), [
o,
s,
c
];
}, a.hsl.rgb = function(e) {
var t = e[0] / 360, n = e[1] / 100, r = e[2] / 100, i, a, o, s, c;
if (n === 0) return c = r * 255, [
c,
c,
c
];
a = r < .5 ? r * (1 + n) : r + n - r * n, i = 2 * r - a, s = [
0,
0,
0
];
for (var l = 0; l < 3; l++) o = t + 1 / 3 * -(l - 1), o < 0 && o++, o > 1 && o--, c = 6 * o < 1 ? i + (a - i) * 6 * o : 2 * o < 1 ? a : 3 * o < 2 ? i + (a - i) * (2 / 3 - o) * 6 : i, s[l] = c * 255;
return s;
}, a.hsl.hsv = function(e) {
var t = e[0], n = e[1] / 100, r = e[2] / 100, i = n, a = Math.max(r, .01), o, s;
return r *= 2, n *= r <= 1 ? r : 2 - r, i *= a <= 1 ? a : 2 - a, s = (r + n) / 2, o = r === 0 ? 2 * i / (a + i) : 2 * n / (r + n), [
t,
o * 100,
s * 100
];
}, a.hsv.rgb = function(e) {
var t = e[0] / 60, n = e[1] / 100, r = e[2] / 100, i = Math.floor(t) % 6, a = t - Math.floor(t), o = 255 * r * (1 - n), s = 255 * r * (1 - n * a), c = 255 * r * (1 - n * (1 - a));
switch (r *= 255, i) {
case 0: return [
r,
c,
o
];
case 1: return [
s,
r,
o
];
case 2: return [
o,
r,
c
];
case 3: return [
o,
s,
r
];
case 4: return [
c,
o,
r
];
case 5: return [
r,
o,
s
];
}
}, a.hsv.hsl = function(e) {
var t = e[0], n = e[1] / 100, r = e[2] / 100, i = Math.max(r, .01), a, o, s = (2 - n) * r;
return a = (2 - n) * i, o = n * i, o /= a <= 1 ? a : 2 - a, o = o || 0, s /= 2, [
t,
o * 100,
s * 100
];
}, a.hwb.rgb = function(e) {
var t = e[0] / 360, n = e[1] / 100, r = e[2] / 100, i = n + r, a, o, s, c;
i > 1 && (n /= i, r /= i), a = Math.floor(6 * t), o = 1 - r, s = 6 * t - a, a & 1 && (s = 1 - s), c = n + s * (o - n);
var l, u, d;
switch (a) {
default:
case 6:
case 0:
l = o, u = c, d = n;
break;
case 1:
l = c, u = o, d = n;
break;
case 2:
l = n, u = o, d = c;
break;
case 3:
l = n, u = c, d = o;
break;
case 4:
l = c, u = n, d = o;
break;
case 5:
l = o, u = n, d = c;
break;
}
return [
l * 255,
u * 255,
d * 255
];
}, a.cmyk.rgb = function(e) {
var t = e[0] / 100, n = e[1] / 100, r = e[2] / 100, i = e[3] / 100, a = 1 - Math.min(1, t * (1 - i) + i), o = 1 - Math.min(1, n * (1 - i) + i), s = 1 - Math.min(1, r * (1 - i) + i);
return [
a * 255,
o * 255,
s * 255
];
}, a.xyz.rgb = function(e) {
var t = e[0] / 100, n = e[1] / 100, r = e[2] / 100, i = t * 3.2406 + n * -1.5372 + r * -.4986, a = t * -.9689 + n * 1.8758 + r * .0415, o = t * .0557 + n * -.204 + r * 1.057;
return i = i > .0031308 ? 1.055 * i ** (1 / 2.4) - .055 : i * 12.92, a = a > .0031308 ? 1.055 * a ** (1 / 2.4) - .055 : a * 12.92, o = o > .0031308 ? 1.055 * o ** (1 / 2.4) - .055 : o * 12.92, i = Math.min(Math.max(0, i), 1), a = Math.min(Math.max(0, a), 1), o = Math.min(Math.max(0, o), 1), [
i * 255,
a * 255,
o * 255
];
}, a.xyz.lab = function(e) {
var t = e[0], n = e[1], r = e[2], i, a, o;
return t /= 95.047, n /= 100, r /= 108.883, t = t > .008856 ? t ** (1 / 3) : 7.787 * t + 16 / 116, n = n > .008856 ? n ** (1 / 3) : 7.787 * n + 16 / 116, r = r > .008856 ? r ** (1 / 3) : 7.787 * r + 16 / 116, i = 116 * n - 16, a = 500 * (t - n), o = 200 * (n - r), [
i,
a,
o
];
}, a.lab.xyz = function(e) {
var t = e[0], n = e[1], r = e[2], i, a = (t + 16) / 116, o;
i = n / 500 + a, o = a - r / 200;
var s = a ** 3, c = i ** 3, l = o ** 3;
return a = s > .008856 ? s : (a - 16 / 116) / 7.787, i = c > .008856 ? c : (i - 16 / 116) / 7.787, o = l > .008856 ? l : (o - 16 / 116) / 7.787, i *= 95.047, a *= 100, o *= 108.883, [
i,
a,
o
];
}, a.lab.lch = function(e) {
var t = e[0], n = e[1], r = e[2], i = Math.atan2(r, n) * 360 / 2 / Math.PI, a;
return i < 0 && (i += 360), a = Math.sqrt(n * n + r * r), [
t,
a,
i
];
}, a.lch.lab = function(e) {
var t = e[0], n = e[1], r = e[2], i, a, o = r / 360 * 2 * Math.PI;
return i = n * Math.cos(o), a = n * Math.sin(o), [
t,
i,
a
];
}, a.rgb.ansi16 = function(e) {
var t = e[0], n = e[1], r = e[2], i = 1 in arguments ? arguments[1] : a.rgb.hsv(e)[2];
if (i = Math.round(i / 50), i === 0) return 30;
var o = 30 + (Math.round(r / 255) << 2 | Math.round(n / 255) << 1 | Math.round(t / 255));
return i === 2 && (o += 60), o;
}, a.hsv.ansi16 = function(e) {
return a.rgb.ansi16(a.hsv.rgb(e), e[2]);
}, a.rgb.ansi256 = function(e) {
var t = e[0], n = e[1], r = e[2];
return t === n && n === r ? t < 8 ? 16 : t > 248 ? 231 : Math.round((t - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(t / 255 * 5) + 6 * Math.round(n / 255 * 5) + Math.round(r / 255 * 5);
}, a.ansi16.rgb = function(e) {
var t = e % 10;
if (t === 0 || t === 7) return e > 50 && (t += 3.5), t = t / 10.5 * 255, [
t,
t,
t
];
var n = (~~(e > 50) + 1) * .5;
return [
(t & 1) * n * 255,
(t >> 1 & 1) * n * 255,
(t >> 2 & 1) * n * 255
];
}, a.ansi256.rgb = function(e) {
if (e >= 232) {
var t = (e - 232) * 10 + 8;
return [
t,
t,
t
];
}
e -= 16;
var n;
return [
Math.floor(e / 36) / 5 * 255,
Math.floor((n = e % 36) / 6) / 5 * 255,
n % 6 / 5 * 255
];
}, a.rgb.hex = function(e) {
var t = (((Math.round(e[0]) & 255) << 16) + ((Math.round(e[1]) & 255) << 8) + (Math.round(e[2]) & 255)).toString(16).toUpperCase();
return "000000".substring(t.length) + t;
}, a.hex.rgb = function(e) {
var t = e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
if (!t) return [
0,
0,
0
];
var n = t[0];
t[0].length === 3 && (n = n.split("").map(function(e) {
return e + e;
}).join(""));
var r = parseInt(n, 16);
return [
r >> 16 & 255,
r >> 8 & 255,
r & 255
];
}, a.rgb.hcg = function(e) {
var t = e[0] / 255, n = e[1] / 255, r = e[2] / 255, i = Math.max(Math.max(t, n), r), a = Math.min(Math.min(t, n), r), o = i - a, s = o < 1 ? a / (1 - o) : 0, c = o <= 0 ? 0 : i === t ? (n - r) / o % 6 : i === n ? 2 + (r - t) / o : 4 + (t - n) / o + 4;
return c /= 6, c %= 1, [
c * 360,
o * 100,
s * 100
];
}, a.hsl.hcg = function(e) {
var t = e[1] / 100, n = e[2] / 100, r = 1, i = 0;
return r = n < .5 ? 2 * t * n : 2 * t * (1 - n), r < 1 && (i = (n - .5 * r) / (1 - r)), [
e[0],
r * 100,
i * 100
];
}, a.hsv.hcg = function(e) {
var t = e[1] / 100, n = e[2] / 100, r = t * n, i = 0;
return r < 1 && (i = (n - r) / (1 - r)), [
e[0],
r * 100,
i * 100
];
}, a.hcg.rgb = function(e) {
var t = e[0] / 360, n = e[1] / 100, r = e[2] / 100;
if (n === 0) return [
r * 255,
r * 255,
r * 255
];
var i = [
0,
0,
0
], a = t % 1 * 6, o = a % 1, s = 1 - o, c = 0;
switch (Math.floor(a)) {
case 0:
i[0] = 1, i[1] = o, i[2] = 0;
break;
case 1:
i[0] = s, i[1] = 1, i[2] = 0;
break;
case 2:
i[0] = 0, i[1] = 1, i[2] = o;
break;
case 3:
i[0] = 0, i[1] = s, i[2] = 1;
break;
case 4:
i[0] = o, i[1] = 0, i[2] = 1;
break;
default: i[0] = 1, i[1] = 0, i[2] = s;
}
return c = (1 - n) * r, [
(n * i[0] + c) * 255,
(n * i[1] + c) * 255,
(n * i[2] + c) * 255
];
}, a.hcg.hsv = function(e) {
var t = e[1] / 100, n = t + e[2] / 100 * (1 - t), r = 0;
return n > 0 && (r = t / n), [
e[0],
r * 100,
n * 100
];
}, a.hcg.hsl = function(e) {
var t = e[1] / 100, n = e[2] / 100 * (1 - t) + .5 * t, r = 0;
return n > 0 && n < .5 ? r = t / (2 * n) : n >= .5 && n < 1 && (r = t / (2 * (1 - n))), [
e[0],
r * 100,
n * 100
];
}, a.hcg.hwb = function(e) {
var t = e[1] / 100, n = t + e[2] / 100 * (1 - t);
return [
e[0],
(n - t) * 100,
(1 - n) * 100
];
}, a.hwb.hcg = function(e) {
var t = e[1] / 100, n = 1 - e[2] / 100, r = n - t, i = 0;
return r < 1 && (i = (n - r) / (1 - r)), [
e[0],
r * 100,
i * 100
];
}, a.apple.rgb = function(e) {
return [
e[0] / 65535 * 255,
e[1] / 65535 * 255,
e[2] / 65535 * 255
];
}, a.rgb.apple = function(e) {
return [
e[0] / 255 * 65535,
e[1] / 255 * 65535,
e[2] / 255 * 65535
];
}, a.gray.rgb = function(e) {
return [
e[0] / 100 * 255,
e[0] / 100 * 255,
e[0] / 100 * 255
];
}, a.gray.hsl = a.gray.hsv = function(e) {
return [
0,
0,
e[0]
];
}, a.gray.hwb = function(e) {
return [
0,
100,
e[0]
];
}, a.gray.cmyk = function(e) {
return [
0,
0,
0,
e[0]
];
}, a.gray.lab = function(e) {
return [
e[0],
0,
0
];
}, a.gray.hex = function(e) {
var t = Math.round(e[0] / 100 * 255) & 255, n = ((t << 16) + (t << 8) + t).toString(16).toUpperCase();
return "000000".substring(n.length) + n;
}, a.rgb.gray = function(e) {
return [(e[0] + e[1] + e[2]) / 3 / 255 * 100];
};
})), Ue = /* @__PURE__ */ t(((e, t) => {
var n = He();
function r() {
for (var e = {}, t = Object.keys(n), r = t.length, i = 0; i < r; i++) e[t[i]] = {
distance: -1,
parent: null
};
return e;
}
function i(e) {
var t = r(), i = [e];
for (t[e].distance = 0; i.length;) for (var a = i.pop(), o = Object.keys(n[a]), s = o.length, c = 0; c < s; c++) {
var l = o[c], u = t[l];
u.distance === -1 && (u.distance = t[a].distance + 1, u.parent = a, i.unshift(l));
}
return t;
}
function a(e, t) {
return function(n) {
return t(e(n));
};
}
function o(e, t) {
for (var r = [t[e].parent, e], i = n[t[e].parent][e], o = t[e].parent; t[o].parent;) r.unshift(t[o].parent), i = a(n[t[o].parent][o], i), o = t[o].parent;
return i.conversion = r, i;
}
t.exports = function(e) {
for (var t = i(e), n = {}, r = Object.keys(t), a = r.length, s = 0; s < a; s++) {
var c = r[s];
t[c].parent !== null && (n[c] = o(c, t));
}
return n;
};
})), We = /* @__PURE__ */ t(((e, t) => {
var n = He(), r = Ue(), i = {}, a = Object.keys(n);
function o(e) {
var t = function(t) {
return t == null ? t : (arguments.length > 1 && (t = Array.prototype.slice.call(arguments)), e(t));
};
return "conversion" in e && (t.conversion = e.conversion), t;
}
function s(e) {
var t = function(t) {
if (t == null) return t;
arguments.length > 1 && (t = Array.prototype.slice.call(arguments));
var n = e(t);
if (typeof n == "object") for (var r = n.length, i = 0; i < r; i++) n[i] = Math.round(n[i]);
return n;
};
return "conversion" in e && (t.conversion = e.conversion), t;
}
a.forEach(function(e) {
i[e] = {}, Object.defineProperty(i[e], "channels", { value: n[e].channels }), Object.defineProperty(i[e], "labels", { value: n[e].labels });
var t = r(e);
Object.keys(t).forEach(function(n) {
var r = t[n];
i[e][n] = s(r), i[e][n].raw = o(r);
});
}), t.exports = i;
})), Ge = /* @__PURE__ */ t(((e, t) => {
var n = Be(), r = We(), i = [].slice, a = [
"keyword",
"gray",
"hex"
], o = {};
Object.keys(r).forEach(function(e) {
o[i.call(r[e].labels).sort().join("")] = e;
});
var s = {};
function c(e, t) {
if (!(this instanceof c)) return new c(e, t);
if (t && t in a && (t = null), t && !(t in r)) throw Error("Unknown model: " + t);
var l, u;
if (e == null) this.model = "rgb", this.color = [
0,
0,
0
], this.valpha = 1;
else if (e instanceof c) this.model = e.model, this.color = e.color.slice(), this.valpha = e.valpha;
else if (typeof e == "string") {
var d = n.get(e);
if (d === null) throw Error("Unable to parse color from string: " + e);
this.model = d.model, u = r[this.model].channels, this.color = d.value.slice(0, u), this.valpha = typeof d.value[u] == "number" ? d.value[u] : 1;
} else if (e.length) {
this.model = t || "rgb", u = r[this.model].channels;
var f = i.call(e, 0, u);
this.color = m(f, u), this.valpha = typeof e[u] == "number" ? e[u] : 1;
} else if (typeof e == "number") e &= 16777215, this.model = "rgb", this.color = [
e >> 16 & 255,
e >> 8 & 255,
e & 255
], this.valpha = 1;
else {
this.valpha = 1;
var p = Object.keys(e);
"alpha" in e && (p.splice(p.indexOf("alpha"), 1), this.valpha = typeof e.alpha == "number" ? e.alpha : 0);
var h = p.sort().join("");
if (!(h in o)) throw Error("Unable to parse color from object: " + JSON.stringify(e));
this.model = o[h];
var g = r[this.model].labels, _ = [];
for (l = 0; l < g.length; l++) _.push(e[g[l]]);
this.color = m(_);
}
if (s[this.model]) for (u = r[this.model].channels, l = 0; l < u; l++) {
var v = s[this.model][l];
v && (this.color[l] = v(this.color[l]));
}
this.valpha = Math.max(0, Math.min(1, this.valpha)), Object.freeze && Object.freeze(this);
}
c.prototype = {
toString: function() {
return this.string();
},
toJSON: function() {
return this[this.model]();
},
string: function(e) {
var t = this.model in n.to ? this : this.rgb();
t = t.round(typeof e == "number" ? e : 1);
var r = t.valpha === 1 ? t.color : t.color.concat(this.valpha);
return n.to[t.model](r);
},
percentString: function(e) {
var t = this.rgb().round(typeof e == "number" ? e : 1), r = t.valpha === 1 ? t.color : t.color.concat(this.valpha);
return n.to.rgb.percent(r);
},
array: function() {
return this.valpha === 1 ? this.color.slice() : this.color.concat(this.valpha);
},
object: function() {
for (var e = {}, t = r[this.model].channels, n = r[this.model].labels, i = 0; i < t; i++) e[n[i]] = this.color[i];
return this.valpha !== 1 && (e.alpha = this.valpha), e;
},
unitArray: function() {
var e = this.rgb().color;
return e[0] /= 255, e[1] /= 255, e[2] /= 255, this.valpha !== 1 && e.push(this.valpha), e;
},
unitObject: function() {
var e = this.rgb().object();
return e.r /= 255, e.g /= 255, e.b /= 255, this.valpha !== 1 && (e.alpha = this.valpha), e;
},
round: function(e) {
return e = Math.max(e || 0, 0), new c(this.color.map(u(e)).concat(this.valpha), this.model);
},
alpha: function(e) {
return arguments.length ? new c(this.color.concat(Math.max(0, Math.min(1, e))), this.model) : this.valpha;
},
red: d("rgb", 0, f(255)),
green: d("rgb", 1, f(255)),
blue: d("rgb", 2, f(255)),
hue: d([
"hsl",
"hsv",
"hsl",
"hwb",
"hcg"
], 0, function(e) {
return (e % 360 + 360) % 360;
}),
saturationl: d("hsl", 1, f(100)),
lightness: d("hsl", 2, f(100)),
saturationv: d("hsv", 1, f(100)),
value: d("hsv", 2, f(100)),
chroma: d("hcg", 1, f(100)),
gray: d("hcg", 2, f(100)),
white: d("hwb", 1, f(100)),
wblack: d("hwb", 2, f(100)),
cyan: d("cmyk", 0, f(100)),
magenta: d("cmyk", 1, f(100)),
yellow: d("cmyk", 2, f(100)),
black: d("cmyk", 3, f(100)),
x: d("xyz", 0, f(100)),
y: d("xyz", 1, f(100)),
z: d("xyz", 2, f(100)),
l: d("lab", 0, f(100)),
a: d("lab", 1),
b: d("lab", 2),
keyword: function(e) {
return arguments.length ? new c(e) : r[this.model].keyword(this.color);
},
hex: function(e) {
return arguments.length ? new c(e) : n.to.hex(this.rgb().round().color);
},
rgbNumber: function() {
var e = this.rgb().color;
return (e[0] & 255) << 16 | (e[1] & 255) << 8 | e[2] & 255;
},
luminosity: function() {
for (var e = this.rgb().color, t = [], n = 0; n < e.length; n++) {
var r = e[n] / 255;
t[n] = r <= .03928 ? r / 12.92 : ((r + .055) / 1.055) ** 2.4;
}
return .2126 * t[0] + .7152 * t[1] + .0722 * t[2];
},
contrast: function(e) {
var t = this.luminosity(), n = e.luminosity();
return t > n ? (t + .05) / (n + .05) : (n + .05) / (t + .05);
},
level: function(e) {
var t = this.contrast(e);
return t >= 7.1 ? "AAA" : t >= 4.5 ? "AA" : "";
},
isDark: function() {
var e = this.rgb().color;
return (e[0] * 299 + e[1] * 587 + e[2] * 114) / 1e3 < 128;
},
isLight: function() {
return !this.isDark();
},
negate: function() {
for (var e = this.rgb(), t = 0; t < 3; t++) e.color[t] = 255 - e.color[t];
return e;
},
lighten: function(e) {
var t = this.hsl();
return t.color[2] += t.color[2] * e, t;
},
darken: function(e) {
var t = this.hsl();
return t.color[2] -= t.color[2] * e, t;
},
saturate: function(e) {
var t = this.hsl();
return t.color[1] += t.color[1] * e, t;
},
desaturate: function(e) {
var t = this.hsl();
return t.color[1] -= t.color[1] * e, t;
},
whiten: function(e) {
var t = this.hwb();
return t.color[1] += t.color[1] * e, t;
},
blacken: function(e) {
var t = this.hwb();
return t.color[2] += t.color[2] * e, t;
},
grayscale: function() {
var e = this.rgb().color, t = e[0] * .3 + e[1] * .59 + e[2] * .11;
return c.rgb(t, t, t);
},
fade: function(e) {
return this.alpha(this.valpha - this.valpha * e);
},
opaquer: function(e) {
return this.alpha(this.valpha + this.valpha * e);
},
rotate: function(e) {
var t = this.hsl(), n = t.color[0];
return n = (n + e) % 360, n = n < 0 ? 360 + n : n, t.color[0] = n, t;
},
mix: function(e, t) {
if (!e || !e.rgb) throw Error("Argument to \"mix\" was not a Color instance, but rather an instance of " + typeof e);
var n = e.rgb(), r = this.rgb(), i = t === void 0 ? .5 : t, a = 2 * i - 1, o = n.alpha() - r.alpha(), s = ((a * o === -1 ? a : (a + o) / (1 + a * o)) + 1) / 2, l = 1 - s;
return c.rgb(s * n.red() + l * r.red(), s * n.green() + l * r.green(), s * n.blue() + l * r.blue(), n.alpha() * i + r.alpha() * (1 - i));
}
}, Object.keys(r).forEach(function(e) {
if (a.indexOf(e) === -1) {
var t = r[e].channels;
c.prototype[e] = function() {
if (this.model === e) return new c(this);
if (arguments.length) return new c(arguments, e);
var n = typeof arguments[t] == "number" ? t : this.valpha;
return new c(p(r[this.model][e].raw(this.color)).concat(n), e);
}, c[e] = function(n) {
return typeof n == "number" && (n = m(i.call(arguments), t)), new c(n, e);
};
}
});
function l(e, t) {
return Number(e.toFixed(t));
}
function u(e) {
return function(t) {
return l(t, e);
};
}
function d(e, t, n) {
return e = Array.isArray(e) ? e : [e], e.forEach(function(e) {
(s[e] || (s[e] = []))[t] = n;
}), e = e[0], function(r) {
var i;
return arguments.length ? (n && (r = n(r)), i = this[e](), i.color[t] = r, i) : (i = this[e]().color[t], n && (i = n(i)), i);
};
}
function f(e) {
return function(t) {
return Math.max(0, Math.min(e, t));
};
}
function p(e) {
return Array.isArray(e) ? e : [e];
}
function m(e, t) {
for (var n = 0; n < t; n++) typeof e[n] != "number" && (e[n] = 0);
return e;
}
t.exports = c;
})), Ke = {
svg: "http://www.w3.org/2000/svg",
xhtml: "http://www.w3.org/1999/xhtml",
xlink: "http://www.w3.org/1999/xlink",
xml: "http://www.w3.org/XML/1998/namespace",
xmlns: "http://www.w3.org/2000/xmlns/"
};
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/namespace.js
function qe(e) {
var t = e += "", n = t.indexOf(":");
return n >= 0 && (t = e.slice(0, n)) !== "xmlns" && (e = e.slice(n + 1)), Ke.hasOwnProperty(t) ? {
space: Ke[t],
local: e
} : e;
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/creator.js
function Je(e) {
return function() {
var t = this.ownerDocument, n = this.namespaceURI;
return n === "http://www.w3.org/1999/xhtml" && t.documentElement.namespaceURI === "http://www.w3.org/1999/xhtml" ? t.createElement(e) : t.createElementNS(n, e);
};
}
function Ye(e) {
return function() {
return this.ownerDocument.createElementNS(e.space, e.local);
};
}
function Xe(e) {
var t = qe(e);
return (t.local ? Ye : Je)(t);
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selector.js
function Ze() {}
function Qe(e) {
return e == null ? Ze : function() {
return this.querySelector(e);
};
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/select.js
function $e(e) {
typeof e != "function" && (e = Qe(e));
for (var t = this._groups, n = t.length, r = Array(n), i = 0; i < n; ++i) for (var a = t[i], o = a.length, s = r[i] = Array(o), c, l, u = 0; u < o; ++u) (c = a[u]) && (l = e.call(c, c.__data__, u, a)) && ("__data__" in c && (l.__data__ = c.__data__), s[u] = l);
return new Hn(r, this._parents);
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/array.js
function et(e) {
return e == null ? [] : Array.isArray(e) ? e : Array.from(e);
}
//#endregion
//#region ../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selectorAll.js
function tt() {
return [];
}
function nt(e) {
return e == null ? tt : function() {
return this.querySelectorAll(e);
};
}
//#endregion
//#regi