@expofp/floorplan
Version:
Interactive floor plan library for expos and events
2,698 lines • 1.77 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.20.0" };
var t = new e.Error().stack;
t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "cb1962ac-3c55-4d8e-9112-8501513aad1e", e._sentryDebugIdIdentifier = "sentry-dbid-cb1962ac-3c55-4d8e-9112-8501513aad1e");
} catch {}
})();
import { r as e, t } from "./rolldown-runtime-7-Wh3Cc7.js";
import { A as n, B as r, F as i, G as a, H as o, I as s, J as c, L as l, Rt as u, U as d, V as f, W as p, Z as m, _ as h, a as g, c as _, ct as v, d as y, f as b, ft as x, h as S, k as C, l as w, lt as T, m as E, n as D, p as O, pt as k, q as A, rt as ee, s as j, st as te, t as ne, tt as re, v as M, y as ie, z as ae } from "./i18n-B6dEf7vu.js";
import { s as oe } from "./efp-debug-init-CHsd9_cw.js";
import { t as se } from "./react-lDheuaid.js";
import { t as ce } from "./jsx-runtime-BRhWrtmW.js";
import { n as le, r as N, t as ue } from "./loadImage-DidrxJwE.js";
import { t as de } from "./is-webview-CPRfPICf.js";
import { t as fe } from "./classnames-DuZoMrrx.js";
import { t as pe } from "./Button-Dam5jkfA.js";
//#region ../../node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js
var me = /* @__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;
}));
//#endregion
//#region src/data/fp-payloads.ts
function he() {
let e = u().fpSvgJsRef;
if (!e) throw Error("No drawing in the config (fpSvgJsRef is not set)");
return te(e);
}
function ge(e) {
let t = u().fpSvgLayerJsRefs[e];
if (t && v(t)) return te(t);
let n = he();
if (e === "" || e === n.__fpDefaultLayer) return n;
}
function _e(e = "") {
var t;
return (t = ge(e)) == null ? void 0 : t.__fp;
}
function ve(e = "") {
var t;
return (t = ge(e)) == null ? void 0 : t.__fpPaths;
}
function ye() {
var e;
let t = u().wfDataJsRef;
return !t || !v(t) || (e = te(t).__wfData) == null ? null : e;
}
//#endregion
//#region src/tools/settings.ts
var be = /* @__PURE__ */ e(me(), 1), P, xe = 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;
}
}, Se = new class extends xe {
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"
} };
}
}();
Se.EXPO.startsWith("sxsw2024") ? (Se.colors.booths.selected = "#FF6400", Se.colors.booths.seectedLight = "#808080") : Se.EXPO === "whxdubai2026" ? (Se.colors.booths.selected = "#2B66FE", Se.maxZoom = 450) : Se.EXPO === "whxlabs2026" ? Se.colors.booths.selected = "#2B66FE" : (Se.EXPO === "wineparis2026" || Se.EXPO === "rdemo2025") && (Se.maxZoom = 450);
var Ce = window.__settings, F = (P = he().__fpSettings) == null ? {} : P;
Se = (0, be.default)(Se, Ce == null ? F : Ce), Se = (0, be.default)(Se, F);
var I = Se, L = {};
function we(e) {
return `${I.EXPO}-${e}`;
}
function Te(e) {
return e;
}
function Ee(e) {
return e === "bookmarked" ? {
exhibitors: [],
events: [],
speakers: [],
booths: []
} : {
exhibitors: [],
events: []
};
}
function De(e, t) {
if (typeof t != "object" || !t) return N.log(`Invalid ${e} data in localStorage - using defaults`), Ee(e);
if (Array.isArray(t)) {
let n = e === "bookmarked" ? {
exhibitors: t,
events: [],
speakers: [],
booths: []
} : {
exhibitors: t,
events: []
};
return N.log(`Migrated ${e} data from array to object format`), ke(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) && (N.log(`Migrated ${e} data (added speakers or booths field)`), ke(e, r)), r;
}
return e === "visited" ? t : (N.log(`Unsupported ${e} data format - using defaults`), Ee(e));
}
function Oe(e) {
if (L[e]) return L[e];
let t = Ee(e);
if (!w) return N.warn(`localStorage unavailable — using default for ${e}`), L[e] = t, t;
let n = we(e), r = Te(e), i = null;
try {
var a;
i = (a = localStorage.getItem(n)) == null ? localStorage.getItem(r) : a;
} catch (t) {
N.warn(`localStorage access error for ${e}`, t);
}
if (!i) return L[e] = t, t;
try {
let t = De(e, JSON.parse(i));
return L[e] = t, t;
} catch (n) {
return N.error(`Error parsing ${e} data`, n), L[e] = t, t;
}
}
function ke(e, t) {
if (!w) return;
let n = we(e);
try {
localStorage.setItem(n, JSON.stringify(t)), L[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), N.log(`save${e[0].toUpperCase() + e.slice(1)}ToLocalStorage`, r);
} catch (t) {
N.error(`Failed to save ${e} data`, t);
}
}
//#endregion
//#region src/store/init/init-bookmarks.ts
function Ae(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 = Oe("bookmarked");
s.push(...e.exhibitors), c.push(...e.events), l.push(...e.speakers), u.push(...e.booths);
}
ke("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 ../geometry/src/lib/angles.ts
function je(e) {
return e * Math.PI / 180;
}
function Me(e) {
return e * 180 / Math.PI;
}
function Ne(e, t) {
return {
x: Math.cos(t) * e,
y: Math.sin(t) * e
};
}
function Pe(e) {
let t = 2 * Math.PI, n = e % t;
return n <= -Math.PI ? n += t : n > Math.PI && (n -= t), n;
}
//#endregion
//#region ../geometry/src/lib/point.ts
var Fe = class e {
constructor(e = 0, t = 0, n = 0) {
this.isPoint = !0, this.x = void 0, this.y = void 0, this.z = void 0, this.x = e, this.y = t, this.z = n;
}
get width() {
return this.x;
}
get height() {
return this.y;
}
set(e, t, n = this.z) {
return this.x = e, this.y = t, this.z = n, this;
}
copy(e) {
var t;
return this.set(e.x, e.y, (t = e.z) == null ? 0 : t);
}
clone(t) {
return (t == null ? new e() : t).set(this.x, this.y, this.z);
}
equals(e) {
var t;
return this.x === e.x && this.y === e.y && this.z === ((t = e.z) == null ? 0 : t);
}
distanceTo(e) {
return Ie(this, e);
}
lerp(e, t, n) {
return Le(this, e, t, n);
}
rotate(e, t, n) {
return Be(this, e, t, n);
}
shift(e, t, n) {
return Ve(this, e, t, n);
}
angleBetween(e, t) {
return He(this, e, t);
}
add(e, t) {
return Re(this, e, t);
}
multiply(e, t) {
return ze(this, e, t);
}
};
function Ie(e, t) {
let n = e.x - t.x, r = e.y - t.y;
return Math.sqrt(n * n + r * r);
}
function Le(e, t, n, r) {
var i, a;
let o = (i = e.z) == null ? 0 : i, s = (a = t.z) == null ? 0 : a;
return (r == null ? new Fe() : r).set(e.x + (t.x - e.x) * n, e.y + (t.y - e.y) * n, o + (s - o) * n);
}
function Re(e, t, n) {
var r, i;
let a = typeof t == "number", o = a ? t : t.x, s = a ? t : t.y, c = a || (r = t.z) == null ? 0 : r;
return (n == null ? new Fe() : n).set(e.x + o, e.y + s, ((i = e.z) == null ? 0 : i) + c);
}
function ze(e, t, n) {
var r, i;
let a = typeof t == "number", o = a ? t : t.x, s = a ? t : t.y, c = a || (r = t.z) == null ? 1 : r;
return (n == null ? new Fe() : n).set(e.x * o, e.y * s, ((i = e.z) == null ? 0 : i) * c);
}
function Be(e, t, n, r) {
var i;
let a = Math.cos(t), o = Math.sin(t), s = e.x - n.x, c = e.y - n.y;
return (r == null ? new Fe() : r).set(n.x + s * a - c * o, n.y + s * o + c * a, (i = e.z) == null ? 0 : i);
}
function Ve(e, t, n, r) {
return Re(e, Ne(t, n), r);
}
function He(e, t, n) {
let r = Math.atan2(t.y - e.y, t.x - e.x);
return Math.atan2(n.y - e.y, n.x - e.x) - r;
}
//#endregion
//#region ../geometry/src/lib/mesh.ts
var Ue = class e {
constructor(e = [], t = []) {
this.isMesh = !0, this._vertices = [], this._indices = [], this._bounds = new ft(), this.set(e, t);
}
get vertices() {
return this._vertices;
}
get indices() {
return this._indices;
}
get bounds() {
return this._bounds;
}
set(e, t) {
return this._vertices = e.map((e) => {
var t;
return new Fe(e.x, e.y, (t = e.z) == null ? 0 : t);
}), this._indices = t, this._bounds = We(this), this;
}
static merge(...e) {
return Ge(e);
}
translate(t, n) {
return R(this, t, n == null ? new e() : n);
}
scale(t, n = this._bounds.center, r) {
return Ke(this, t, n, r == null ? new e() : r);
}
rotate(t, n = this._bounds.center, r) {
return qe(this, t, n, r == null ? new e() : r);
}
};
function We(e) {
if (e.vertices.length === 0) return new ft();
let t = Infinity, n = Infinity, r = -Infinity, i = -Infinity;
for (let a of e.vertices) t = Math.min(t, a.x), n = Math.min(n, a.y), r = Math.max(r, a.x), i = Math.max(i, a.y);
return ft.fromMinMax({
x: t,
y: n
}, {
x: r,
y: i
});
}
function Ge(e, t) {
let n = [], r = [], i = 0;
for (let t of e) {
for (let e of t.vertices) n.push(e);
for (let [e, n, a] of t.indices) r.push([
e + i,
n + i,
a + i
]);
i += t.vertices.length;
}
return (t == null ? new Ue() : t).set(n, r);
}
function R(e, t, n) {
var r;
let i = (r = t.z) == null ? 0 : r, a = e.vertices.map((e) => {
var n;
return {
x: e.x + t.x,
y: e.y + t.y,
z: ((n = e.z) == null ? 0 : n) + i
};
});
return (n == null ? new Ue() : n).set(a, e.indices);
}
function Ke(e, t, n = We(e).center, r) {
let i = typeof t == "number" ? t : t.x, a = typeof t == "number" ? t : t.y, o = e.vertices.map((e) => {
var t;
return {
x: n.x + (e.x - n.x) * i,
y: n.y + (e.y - n.y) * a,
z: (t = e.z) == null ? 0 : t
};
});
return (r == null ? new Ue() : r).set(o, e.indices);
}
function qe(e, t, n = We(e).center, r) {
let i = Math.cos(t), a = Math.sin(t), o = e.vertices.map((e) => {
var t;
let r = e.x - n.x, o = e.y - n.y;
return {
x: n.x + r * i - o * a,
y: n.y + r * a + o * i,
z: (t = e.z) == null ? 0 : t
};
});
return (r == null ? new Ue() : r).set(o, e.indices);
}
//#endregion
//#region ../geometry/src/lib/polygon.ts
var Je = class e {
constructor(e = [], t = [], n = 0) {
this.isPolygon = !0, this._vertices = [], this._indices = [], this._elevation = void 0, this._bounds = new ft(), this._elevation = n, this.set(e, t);
}
static fromConvexRing(t, n = 0) {
if (t.length < 3) return new e([], [], n);
let r = [];
for (let e = 1; e <= t.length - 2; e++) r.push([
0,
e,
e + 1
]);
return new e(t, r, n);
}
static merge(...t) {
var n, r;
return Ge(t, new e([], [], (n = (r = t[0]) == null ? void 0 : r.elevation) == null ? 0 : n));
}
get vertices() {
return this._vertices;
}
get indices() {
return this._indices;
}
get elevation() {
return this._elevation;
}
get bounds() {
return this._bounds;
}
get area() {
return Ye(this);
}
containsPoint(e, t) {
return Xe(this, e, t);
}
translate(t, n) {
return R(this, t, n == null ? new e([], [], this._elevation) : n);
}
scale(t, n = this._bounds.center, r) {
return Ke(this, t, n, r == null ? new e([], [], this._elevation) : r);
}
rotate(t, n = this._bounds.center, r) {
return qe(this, t, n, r == null ? new e([], [], this._elevation) : r);
}
set(e, t, n = this._elevation) {
return this._vertices = e.map((e) => ({
x: e.x,
y: e.y
})), this._indices = t, this._elevation = n, this._bounds = We(this), this;
}
};
function Ye(e) {
let t = 0;
for (let [n, r, i] of e.indices) {
let a = e.vertices[n], o = e.vertices[r], s = e.vertices[i];
t += Math.abs((o.x - a.x) * (s.y - a.y) - (s.x - a.x) * (o.y - a.y)) / 2;
}
return t;
}
function Xe(e, t, n) {
var r;
let i = (r = n == null ? void 0 : n.areaTolerance) == null ? .01 : r;
for (let [n, r, a] of e.indices) {
let o = e.vertices[n], s = e.vertices[r], c = e.vertices[a], l = Math.abs((s.x - o.x) * (c.y - o.y) - (c.x - o.x) * (s.y - o.y)) / 2;
if (l === 0) continue;
let u = i * l, d = (t.x - s.x) * (o.y - s.y) - (o.x - s.x) * (t.y - s.y), f = (t.x - c.x) * (s.y - c.y) - (s.x - c.x) * (t.y - c.y), p = (t.x - o.x) * (c.y - o.y) - (c.x - o.x) * (t.y - o.y);
if (!((d < -u || f < -u || p < -u) && (d > u || f > u || p > u))) return !0;
}
return !1;
}
//#endregion
//#region ../geometry/src/lib/rect.ts
var Ze = (e) => {
var t;
return (t = e.rotation) == null ? 0 : t;
}, Qe = (e) => {
var t;
return (t = e.elevation) == null ? 0 : t;
}, $e = class e {
constructor(e, t, n = 0, r = 0) {
this.isRect = !0, this._center = new Fe(), this._size = new Fe(), this._rotation = 0, this._elevation = 0, this.set(e.x, e.y, t.x, t.y, n, r);
}
static fromMinMax(t, n, r = 0, i = 0) {
return new e({
x: (t.x + n.x) / 2,
y: (t.y + n.y) / 2
}, {
x: Math.abs(n.x - t.x),
y: Math.abs(n.y - t.y)
}, r, i);
}
get center() {
return this._center;
}
get size() {
return this._size;
}
get rotation() {
return this._rotation;
}
get elevation() {
return this._elevation;
}
corners() {
return et(this);
}
get bounds() {
return tt(this);
}
toPolygon() {
return nt(this);
}
containsPoint(e) {
return rt(this, e);
}
translate(e, t) {
return it(this, e, t);
}
rotate(e, t) {
return at(this, e, t);
}
scale(e, t = this._center, n) {
return ot(this, e, t, n);
}
intersectLine(e) {
return ut(e, this);
}
clone(t) {
return (t == null ? new e(this._center, this._size) : t).set(this._center.x, this._center.y, this._size.x, this._size.y, this._rotation, this._elevation);
}
set(e, t, n, r, i, a) {
return this._center.set(e, t), this._size.set(n, r), this._rotation = i, this._elevation = a, this;
}
};
function et(e) {
let t = e.size.x / 2, n = e.size.y / 2, r = Ze(e), i = Math.cos(r), a = Math.sin(r), o = e.center.x, s = e.center.y, c = (e, t) => new Fe(o + e * i - t * a, s + e * a + t * i);
return [
c(-t, -n),
c(t, -n),
c(t, n),
c(-t, n)
];
}
function tt(e) {
return ft.fromUnion(...et(e).map((e) => ft.fromMinMax(e, e)));
}
function nt(e) {
return Je.fromConvexRing(et(e), Qe(e));
}
function rt(e, t) {
let n = -Ze(e), r = Math.cos(n), i = Math.sin(n), a = t.x - e.center.x, o = t.y - e.center.y, s = a * r - o * i, c = a * i + o * r;
return Math.abs(s) <= e.size.x / 2 && Math.abs(c) <= e.size.y / 2;
}
function it(e, t, n) {
let r = e.center.x + t.x, i = e.center.y + t.y;
return n ? n.set(r, i, e.size.x, e.size.y, Ze(e), Qe(e)) : new $e({
x: r,
y: i
}, e.size, Ze(e), Qe(e));
}
function at(e, t, n) {
return n ? n.set(e.center.x, e.center.y, e.size.x, e.size.y, Ze(e) + t, Qe(e)) : new $e(e.center, e.size, Ze(e) + t, Qe(e));
}
function ot(e, t, n = e.center, r) {
let i = typeof t == "number" ? t : t.x, a = typeof t == "number" ? t : t.y, o = n.x + (e.center.x - n.x) * i, s = n.y + (e.center.y - n.y) * a, c = e.size.x * i, l = e.size.y * a;
return r ? r.set(o, s, c, l, Ze(e), Qe(e)) : new $e({
x: o,
y: s
}, {
x: c,
y: l
}, Ze(e), Qe(e));
}
//#endregion
//#region ../geometry/src/lib/intersections.ts
var st = .001;
function ct(e, t, n = st) {
var r, i;
if (e.elevation != null && t.elevation != null && Math.abs(e.elevation - t.elevation) > n) return null;
let { x: a, y: o } = e.p0, { x: s, y: c } = e.p1, { x: l, y: u } = t.p0, { x: d, y: f } = t.p1, p = (a - s) * (u - f) - (o - c) * (l - d);
if (p === 0) return null;
let m = ((a - l) * (u - f) - (o - u) * (l - d)) / p, h = ((a - l) * (o - c) - (o - u) * (a - s)) / p, g = Le(e.p0, e.p1, m);
return g.z = (r = (i = e.elevation) == null ? t.elevation : i) == null ? 0 : r, {
point: g,
onLine1: m >= 0 && m <= 1,
onLine2: h >= 0 && h <= 1
};
}
function lt(e, t, n) {
let r = ct(e, t, n);
return r != null && r.onLine1 && r.onLine2 ? r.point : null;
}
function ut(e, t, n = st) {
var r, i;
if (e.elevation != null && t.elevation != null && Math.abs(e.elevation - t.elevation) > n) return [];
let a = (r = (i = e.elevation) == null ? t.elevation : i) == null ? 0 : r, o = et(t), s = [];
for (let t = 0; t < 4; t++) {
let r = lt(e, {
p0: o[t],
p1: o[(t + 1) % 4]
}, n);
r && (r.z = a, s.push(r));
}
return s;
}
//#endregion
//#region ../geometry/src/lib/box.ts
function* dt(e) {
for (let t of e) yield t.min, yield t.max;
}
var ft = class e {
constructor(e = 0, t = 0, n = 0, r = 0) {
this.isBox = !0, this._min = new Fe(), this._max = new Fe(), this._center = new Fe(), this._size = new Fe(), this.set(e, t, e + n, t + r);
}
get min() {
return this._min;
}
get max() {
return this._max;
}
get center() {
return this._center;
}
get size() {
return this._size;
}
get area() {
return pt(this);
}
isEmpty() {
return mt(this);
}
static fromMinMax(t, n) {
return new e(t.x, t.y, n.x - t.x, n.y - t.y);
}
static fromCenter(t, n) {
return new e(t.x - n.x / 2, t.y - n.y / 2, n.x, n.y);
}
static fromUnion(...t) {
return e.fromPoints(dt(t));
}
static fromPoints(t) {
let n = Infinity, r = Infinity, i = -Infinity, a = -Infinity;
for (let e of t) e.x < n && (n = e.x), e.y < r && (r = e.y), e.x > i && (i = e.x), e.y > a && (a = e.y);
return n === Infinity ? new e() : e.fromMinMax({
x: n,
y: r
}, {
x: i,
y: a
});
}
static fromSvg(t) {
return new e(t.x.baseVal.value, t.y.baseVal.value, t.width.baseVal.value, t.height.baseVal.value);
}
intersects(e) {
return ht(this, e);
}
contains(e) {
return gt(this, e);
}
containsPoint(e) {
return _t(this, e);
}
equals(e) {
return vt(this, e);
}
intersection(e, t) {
return yt(this, e, t);
}
translate(e, t) {
return bt(this, e, t);
}
expand(e, t) {
return xt(this, e, t);
}
scale(e, t = this._center, n) {
return St(this, e, t, n);
}
intersectLine(e) {
return ut(e, this);
}
clone(t) {
return (t == null ? new e() : t).set(this._min.x, this._min.y, this._max.x, this._max.y);
}
set(e, t, n, r) {
let i = Math.min(e, n), a = Math.min(t, r), o = Math.max(e, n), s = Math.max(t, r);
return this._min.set(i, a), this._max.set(o, s), this._center.set((i + o) / 2, (a + s) / 2), this._size.set(o - i, s - a), this;
}
};
function pt(e) {
return (e.max.x - e.min.x) * (e.max.y - e.min.y);
}
function mt(e) {
return e.min.x === e.max.x && e.min.y === e.max.y;
}
function ht(e, t) {
return e.min.x <= t.max.x && e.max.x >= t.min.x && e.min.y <= t.max.y && e.max.y >= t.min.y;
}
function gt(e, t) {
return t.min.x >= e.min.x && t.max.x <= e.max.x && t.min.y >= e.min.y && t.max.y <= e.max.y;
}
function _t(e, t) {
return t.x >= e.min.x && t.x <= e.max.x && t.y >= e.min.y && t.y <= e.max.y;
}
function vt(e, t) {
return e.min.x === t.min.x && e.min.y === t.min.y && e.max.x === t.max.x && e.max.y === t.max.y;
}
function yt(e, t, n) {
let r = Math.max(e.min.x, t.min.x), i = Math.max(e.min.y, t.min.y), a = Math.min(e.max.x, t.max.x), o = Math.min(e.max.y, t.max.y);
return a < r || o < i ? null : (n == null ? new ft() : n).set(r, i, a, o);
}
function bt(e, t, n) {
let r = typeof t == "number" ? t : t.x, i = typeof t == "number" ? t : t.y;
return (n == null ? new ft() : n).set(e.min.x + r, e.min.y + i, e.max.x + r, e.max.y + i);
}
function xt(e, t, n) {
let r = typeof t == "number", i = r ? t : t.x, a = r ? t : t.y, o = e.min.x - i, s = e.max.x + i, c = e.min.y - a, l = e.max.y + a;
return s < o && (o = s = (o + s) / 2), l < c && (c = l = (c + l) / 2), (n == null ? new ft() : n).set(o, c, s, l);
}
function St(e, t, n = {
x: (e.min.x + e.max.x) / 2,
y: (e.min.y + e.max.y) / 2
}, r) {
let i = typeof t == "number" ? t : t.x, a = typeof t == "number" ? t : t.y;
return (r == null ? new ft() : r).set(n.x + (e.min.x - n.x) * i, n.y + (e.min.y - n.y) * a, n.x + (e.max.x - n.x) * i, n.y + (e.max.y - n.y) * a);
}
//#endregion
//#region ../geometry/src/lib/geo.ts
var Ct = 6371e3;
function wt(e, t) {
let n = je(e.lat), r = je(t.lat), i = je(t.lat - e.lat), a = je(t.lng - e.lng), o = Math.sin(i / 2) * Math.sin(i / 2) + Math.cos(n) * Math.cos(r) * Math.sin(a / 2) * Math.sin(a / 2);
return Ct * (2 * Math.atan2(Math.sqrt(o), Math.sqrt(1 - o)));
}
function Tt(e, t) {
let n = je(e.lat), r = je(t.lat), i = je(t.lng - e.lng), a = Math.sin(i) * Math.cos(r), o = Math.cos(n) * Math.sin(r) - Math.sin(n) * Math.cos(r) * Math.cos(i);
return (Me(Math.atan2(a, o)) + 360) % 360;
}
function Et(e, t, n) {
let r = t / Ct, i = je(n), a = je(e.lat), o = je(e.lng), s = Math.asin(Math.sin(a) * Math.cos(r) + Math.cos(a) * Math.sin(r) * Math.cos(i)), c = o + Math.atan2(Math.sin(i) * Math.sin(r) * Math.cos(a), Math.cos(r) - Math.sin(a) * Math.sin(s));
return {
lat: Me(s),
lng: Me(Pe(c))
};
}
function Dt(e, t, n) {
let r = n.local.x - t.local.x, i = n.local.y - t.local.y, a = Math.sqrt(r * r + i * i), o = e.x - t.local.x, s = e.y - t.local.y, c = Math.sqrt(o * o + s * s), l = Me(Math.atan2(i, r)), u = Me(Math.atan2(s, o)) - l, d = (a === 0 ? 0 : c / a) * wt(t.geo, n.geo), f = Tt(t.geo, n.geo);
return Et(t.geo, d, f + u);
}
function Ot(e, t, n) {
let r = wt(t.geo, n.geo), i = Tt(t.geo, n.geo), a = wt(t.geo, e), o = Tt(t.geo, e) - i, s = r === 0 ? 0 : a / r, c = n.local.x - t.local.x, l = n.local.y - t.local.y, u = Math.sqrt(c * c + l * l), d = Math.atan2(l, c), f = Ne(u * s, d + je(o));
return {
x: t.local.x + f.x,
y: t.local.y + f.y
};
}
//#endregion
//#region ../geometry/src/lib/line.ts
function kt(e) {
return Ie(e.p0, e.p1);
}
function At(e, t) {
return Le(e.p0, e.p1, .5, t);
}
function jt(e, t) {
return Math.atan2(t.y - e.y, t.x - e.x);
}
function Mt(e, t, n) {
var r;
let i = e.p0.x, a = e.p0.y, o = e.p1.x, s = e.p1.y, c = t.x, l = t.y, u = o - i, d = s - a, f = u * u + d * d, p;
f === 0 ? p = 0 : (p = ((c - i) * u + (l - a) * d) / f, p = p < 0 ? 0 : p > 1 ? 1 : p);
let m = (n == null ? new Fe() : n).set(i + u * p, a + d * p, (r = e.elevation) == null ? 0 : r), h = Ie({
x: c,
y: l
}, m);
return {
projected: m,
t: p,
distance: h
};
}
//#endregion
//#region ../geometry/src/index.ts
function Nt(e) {
return "isBox" in e;
}
function Pt(e) {
return "isRect" in e;
}
function Ft(e) {
return "isPolygon" in e;
}
//#endregion
//#region ../../node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js
var It = /* @__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
]
};
})), Lt = /* @__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");
};
})), Rt = /* @__PURE__ */ t(((e, t) => {
var n = Lt(), 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));
};
};
})), zt = /* @__PURE__ */ t(((e, t) => {
var n = It(), r = Rt(), 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;
}
})), Bt = /* @__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
]
};
})), Vt = /* @__PURE__ */ t(((e, t) => {
var n = Bt(), 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 /