@eox/drawtools 0.10.1-dev.1729494244.0 → 0.11.1-dev.1730197611.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,19 +1,19 @@
1
- var Ht = Object.defineProperty;
2
- var et = (i) => {
1
+ var Et = Object.defineProperty;
2
+ var tt = (i) => {
3
3
  throw TypeError(i);
4
4
  };
5
- var kt = (i, t, e) => t in i ? Ht(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
6
- var b = (i, t, e) => kt(i, typeof t != "symbol" ? t + "" : t, e), it = (i, t, e) => t.has(i) || et("Cannot " + e);
7
- var y = (i, t, e) => (it(i, t, "read from private field"), e ? e.call(i) : t.get(i)), $ = (i, t, e) => t.has(i) ? et("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(i) : t.set(i, e), g = (i, t, e, r) => (it(i, t, "write to private field"), r ? r.call(i, e) : t.set(i, e), e);
5
+ var Ht = (i, t, e) => t in i ? Et(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
6
+ var b = (i, t, e) => Ht(i, typeof t != "symbol" ? t + "" : t, e), et = (i, t, e) => t.has(i) || tt("Cannot " + e);
7
+ var y = (i, t, e) => (et(i, t, "read from private field"), e ? e.call(i) : t.get(i)), $ = (i, t, e) => t.has(i) ? tt("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(i) : t.set(i, e), g = (i, t, e, r) => (et(i, t, "write to private field"), r ? r.call(i, e) : t.set(i, e), e);
8
8
  /**
9
9
  * @license
10
10
  * Copyright 2019 Google LLC
11
11
  * SPDX-License-Identifier: BSD-3-Clause
12
12
  */
13
- const J = globalThis, Y = J.ShadowRoot && (J.ShadyCSS === void 0 || J.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, bt = Symbol(), rt = /* @__PURE__ */ new WeakMap();
14
- let Mt = class {
13
+ const J = globalThis, Y = J.ShadowRoot && (J.ShadyCSS === void 0 || J.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, vt = Symbol(), it = /* @__PURE__ */ new WeakMap();
14
+ let kt = class {
15
15
  constructor(t, e, r) {
16
- if (this._$cssResult$ = !0, r !== bt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
16
+ if (this._$cssResult$ = !0, r !== vt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
17
17
  this.cssText = t, this.t = e;
18
18
  }
19
19
  get styleSheet() {
@@ -21,7 +21,7 @@ let Mt = class {
21
21
  const e = this.t;
22
22
  if (Y && t === void 0) {
23
23
  const r = e !== void 0 && e.length === 1;
24
- r && (t = rt.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), r && rt.set(e, t));
24
+ r && (t = it.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), r && it.set(e, t));
25
25
  }
26
26
  return t;
27
27
  }
@@ -29,26 +29,26 @@ let Mt = class {
29
29
  return this.cssText;
30
30
  }
31
31
  };
32
- const Ft = (i) => new Mt(typeof i == "string" ? i : i + "", void 0, bt), It = (i, t) => {
32
+ const Mt = (i) => new kt(typeof i == "string" ? i : i + "", void 0, vt), Ft = (i, t) => {
33
33
  if (Y) i.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
34
34
  else for (const e of t) {
35
35
  const r = document.createElement("style"), s = J.litNonce;
36
36
  s !== void 0 && r.setAttribute("nonce", s), r.textContent = e.cssText, i.appendChild(r);
37
37
  }
38
- }, st = Y ? (i) => i : (i) => i instanceof CSSStyleSheet ? ((t) => {
38
+ }, rt = Y ? (i) => i : (i) => i instanceof CSSStyleSheet ? ((t) => {
39
39
  let e = "";
40
40
  for (const r of t.cssRules) e += r.cssText;
41
- return Ft(e);
41
+ return Mt(e);
42
42
  })(i) : i;
43
43
  /**
44
44
  * @license
45
45
  * Copyright 2017 Google LLC
46
46
  * SPDX-License-Identifier: BSD-3-Clause
47
47
  */
48
- const { is: Lt, defineProperty: Ut, getOwnPropertyDescriptor: Ot, getOwnPropertyNames: Pt, getOwnPropertySymbols: Vt, getPrototypeOf: Nt } = Object, v = globalThis, nt = v.trustedTypes, Bt = nt ? nt.emptyScript : "", G = v.reactiveElementPolyfillSupport, L = (i, t) => i, Q = { toAttribute(i, t) {
48
+ const { is: It, defineProperty: Lt, getOwnPropertyDescriptor: Ut, getOwnPropertyNames: Ot, getOwnPropertySymbols: Pt, getPrototypeOf: Nt } = Object, v = globalThis, st = v.trustedTypes, Vt = st ? st.emptyScript : "", G = v.reactiveElementPolyfillSupport, L = (i, t) => i, Q = { toAttribute(i, t) {
49
49
  switch (t) {
50
50
  case Boolean:
51
- i = i ? Bt : null;
51
+ i = i ? Vt : null;
52
52
  break;
53
53
  case Object:
54
54
  case Array:
@@ -73,7 +73,7 @@ const { is: Lt, defineProperty: Ut, getOwnPropertyDescriptor: Ot, getOwnProperty
73
73
  }
74
74
  }
75
75
  return e;
76
- } }, $t = (i, t) => !Lt(i, t), ot = { attribute: !0, type: String, converter: Q, reflect: !1, hasChanged: $t };
76
+ } }, bt = (i, t) => !It(i, t), nt = { attribute: !0, type: String, converter: Q, reflect: !1, hasChanged: bt };
77
77
  Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), v.litPropertyMetadata ?? (v.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
78
78
  class C extends HTMLElement {
79
79
  static addInitializer(t) {
@@ -82,14 +82,14 @@ class C extends HTMLElement {
82
82
  static get observedAttributes() {
83
83
  return this.finalize(), this._$Eh && [...this._$Eh.keys()];
84
84
  }
85
- static createProperty(t, e = ot) {
85
+ static createProperty(t, e = nt) {
86
86
  if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
87
87
  const r = Symbol(), s = this.getPropertyDescriptor(t, r, e);
88
- s !== void 0 && Ut(this.prototype, t, s);
88
+ s !== void 0 && Lt(this.prototype, t, s);
89
89
  }
90
90
  }
91
91
  static getPropertyDescriptor(t, e, r) {
92
- const { get: s, set: n } = Ot(this.prototype, t) ?? { get() {
92
+ const { get: s, set: n } = Ut(this.prototype, t) ?? { get() {
93
93
  return this[e];
94
94
  }, set(o) {
95
95
  this[e] = o;
@@ -102,7 +102,7 @@ class C extends HTMLElement {
102
102
  }, configurable: !0, enumerable: !0 };
103
103
  }
104
104
  static getPropertyOptions(t) {
105
- return this.elementProperties.get(t) ?? ot;
105
+ return this.elementProperties.get(t) ?? nt;
106
106
  }
107
107
  static _$Ei() {
108
108
  if (this.hasOwnProperty(L("elementProperties"))) return;
@@ -112,7 +112,7 @@ class C extends HTMLElement {
112
112
  static finalize() {
113
113
  if (this.hasOwnProperty(L("finalized"))) return;
114
114
  if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(L("properties"))) {
115
- const e = this.properties, r = [...Pt(e), ...Vt(e)];
115
+ const e = this.properties, r = [...Ot(e), ...Pt(e)];
116
116
  for (const s of r) this.createProperty(s, e[s]);
117
117
  }
118
118
  const t = this[Symbol.metadata];
@@ -131,8 +131,8 @@ class C extends HTMLElement {
131
131
  const e = [];
132
132
  if (Array.isArray(t)) {
133
133
  const r = new Set(t.flat(1 / 0).reverse());
134
- for (const s of r) e.unshift(st(s));
135
- } else t !== void 0 && e.push(st(t));
134
+ for (const s of r) e.unshift(rt(s));
135
+ } else t !== void 0 && e.push(rt(t));
136
136
  return e;
137
137
  }
138
138
  static _$Eu(t, e) {
@@ -161,7 +161,7 @@ class C extends HTMLElement {
161
161
  }
162
162
  createRenderRoot() {
163
163
  const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
164
- return It(t, this.constructor.elementStyles), t;
164
+ return Ft(t, this.constructor.elementStyles), t;
165
165
  }
166
166
  connectedCallback() {
167
167
  var t;
@@ -200,7 +200,7 @@ class C extends HTMLElement {
200
200
  }
201
201
  requestUpdate(t, e, r) {
202
202
  if (t !== void 0) {
203
- if (r ?? (r = this.constructor.getPropertyOptions(t)), !(r.hasChanged ?? $t)(this[t], e)) return;
203
+ if (r ?? (r = this.constructor.getPropertyOptions(t)), !(r.hasChanged ?? bt)(this[t], e)) return;
204
204
  this.P(t, e, r);
205
205
  }
206
206
  this.isUpdatePending === !1 && (this._$ES = this._$ET());
@@ -279,42 +279,42 @@ C.elementStyles = [], C.shadowRootOptions = { mode: "open" }, C[L("elementProper
279
279
  * Copyright 2017 Google LLC
280
280
  * SPDX-License-Identifier: BSD-3-Clause
281
281
  */
282
- const U = globalThis, q = U.trustedTypes, at = q ? q.createPolicy("lit-html", { createHTML: (i) => i }) : void 0, wt = "$lit$", m = `lit$${Math.random().toFixed(9).slice(2)}$`, _t = "?" + m, Rt = `<${_t}>`, S = document, O = () => S.createComment(""), P = (i) => i === null || typeof i != "object" && typeof i != "function", T = Array.isArray, zt = (i) => T(i) || typeof (i == null ? void 0 : i[Symbol.iterator]) == "function", W = `[
283
- \f\r]`, I = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, lt = /-->/g, ct = />/g, w = RegExp(`>|${W}(?:([^\\s"'>=/]+)(${W}*=${W}*(?:[^
284
- \f\r"'\`<>=]|("|')|))|$)`, "g"), ht = /'/g, dt = /"/g, xt = /^(?:script|style|textarea|title)$/i, jt = (i) => (t, ...e) => ({ _$litType$: i, strings: t, values: e }), x = jt(1), M = Symbol.for("lit-noChange"), d = Symbol.for("lit-nothing"), pt = /* @__PURE__ */ new WeakMap(), _ = S.createTreeWalker(S, 129);
285
- function At(i, t) {
282
+ const U = globalThis, q = U.trustedTypes, ot = q ? q.createPolicy("lit-html", { createHTML: (i) => i }) : void 0, $t = "$lit$", m = `lit$${Math.random().toFixed(9).slice(2)}$`, wt = "?" + m, Bt = `<${wt}>`, S = document, O = () => S.createComment(""), P = (i) => i === null || typeof i != "object" && typeof i != "function", T = Array.isArray, Rt = (i) => T(i) || typeof (i == null ? void 0 : i[Symbol.iterator]) == "function", W = `[
283
+ \f\r]`, I = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, at = /-->/g, lt = />/g, w = RegExp(`>|${W}(?:([^\\s"'>=/]+)(${W}*=${W}*(?:[^
284
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), ct = /'/g, dt = /"/g, _t = /^(?:script|style|textarea|title)$/i, zt = (i) => (t, ...e) => ({ _$litType$: i, strings: t, values: e }), x = zt(1), M = Symbol.for("lit-noChange"), h = Symbol.for("lit-nothing"), ht = /* @__PURE__ */ new WeakMap(), _ = S.createTreeWalker(S, 129);
285
+ function xt(i, t) {
286
286
  if (!T(i) || !i.hasOwnProperty("raw")) throw Error("invalid template strings array");
287
- return at !== void 0 ? at.createHTML(t) : t;
287
+ return ot !== void 0 ? ot.createHTML(t) : t;
288
288
  }
289
- const Jt = (i, t) => {
289
+ const jt = (i, t) => {
290
290
  const e = i.length - 1, r = [];
291
291
  let s, n = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o = I;
292
292
  for (let l = 0; l < e; l++) {
293
293
  const a = i[l];
294
- let h, p, c = -1, u = 0;
295
- for (; u < a.length && (o.lastIndex = u, p = o.exec(a), p !== null); ) u = o.lastIndex, o === I ? p[1] === "!--" ? o = lt : p[1] !== void 0 ? o = ct : p[2] !== void 0 ? (xt.test(p[2]) && (s = RegExp("</" + p[2], "g")), o = w) : p[3] !== void 0 && (o = w) : o === w ? p[0] === ">" ? (o = s ?? I, c = -1) : p[1] === void 0 ? c = -2 : (c = o.lastIndex - p[2].length, h = p[1], o = p[3] === void 0 ? w : p[3] === '"' ? dt : ht) : o === dt || o === ht ? o = w : o === lt || o === ct ? o = I : (o = w, s = void 0);
294
+ let d, p, c = -1, u = 0;
295
+ for (; u < a.length && (o.lastIndex = u, p = o.exec(a), p !== null); ) u = o.lastIndex, o === I ? p[1] === "!--" ? o = at : p[1] !== void 0 ? o = lt : p[2] !== void 0 ? (_t.test(p[2]) && (s = RegExp("</" + p[2], "g")), o = w) : p[3] !== void 0 && (o = w) : o === w ? p[0] === ">" ? (o = s ?? I, c = -1) : p[1] === void 0 ? c = -2 : (c = o.lastIndex - p[2].length, d = p[1], o = p[3] === void 0 ? w : p[3] === '"' ? dt : ct) : o === dt || o === ct ? o = w : o === at || o === lt ? o = I : (o = w, s = void 0);
296
296
  const f = o === w && i[l + 1].startsWith("/>") ? " " : "";
297
- n += o === I ? a + Rt : c >= 0 ? (r.push(h), a.slice(0, c) + wt + a.slice(c) + m + f) : a + m + (c === -2 ? l : f);
297
+ n += o === I ? a + Bt : c >= 0 ? (r.push(d), a.slice(0, c) + $t + a.slice(c) + m + f) : a + m + (c === -2 ? l : f);
298
298
  }
299
- return [At(i, n + (i[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), r];
299
+ return [xt(i, n + (i[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), r];
300
300
  };
301
- class V {
301
+ class N {
302
302
  constructor({ strings: t, _$litType$: e }, r) {
303
303
  let s;
304
304
  this.parts = [];
305
305
  let n = 0, o = 0;
306
- const l = t.length - 1, a = this.parts, [h, p] = Jt(t, e);
307
- if (this.el = V.createElement(h, r), _.currentNode = this.el.content, e === 2 || e === 3) {
306
+ const l = t.length - 1, a = this.parts, [d, p] = jt(t, e);
307
+ if (this.el = N.createElement(d, r), _.currentNode = this.el.content, e === 2 || e === 3) {
308
308
  const c = this.el.content.firstChild;
309
309
  c.replaceWith(...c.childNodes);
310
310
  }
311
311
  for (; (s = _.nextNode()) !== null && a.length < l; ) {
312
312
  if (s.nodeType === 1) {
313
- if (s.hasAttributes()) for (const c of s.getAttributeNames()) if (c.endsWith(wt)) {
313
+ if (s.hasAttributes()) for (const c of s.getAttributeNames()) if (c.endsWith($t)) {
314
314
  const u = p[o++], f = s.getAttribute(c).split(m), j = /([.?@])?(.*)/.exec(u);
315
- a.push({ type: 1, index: n, name: j[2], strings: f, ctor: j[1] === "." ? Dt : j[1] === "?" ? Gt : j[1] === "@" ? Wt : D }), s.removeAttribute(c);
315
+ a.push({ type: 1, index: n, name: j[2], strings: f, ctor: j[1] === "." ? qt : j[1] === "?" ? Dt : j[1] === "@" ? Gt : D }), s.removeAttribute(c);
316
316
  } else c.startsWith(m) && (a.push({ type: 6, index: n }), s.removeAttribute(c));
317
- if (xt.test(s.tagName)) {
317
+ if (_t.test(s.tagName)) {
318
318
  const c = s.textContent.split(m), u = c.length - 1;
319
319
  if (u > 0) {
320
320
  s.textContent = q ? q.emptyScript : "";
@@ -322,7 +322,7 @@ class V {
322
322
  s.append(c[u], O());
323
323
  }
324
324
  }
325
- } else if (s.nodeType === 8) if (s.data === _t) a.push({ type: 2, index: n });
325
+ } else if (s.nodeType === 8) if (s.data === wt) a.push({ type: 2, index: n });
326
326
  else {
327
327
  let c = -1;
328
328
  for (; (c = s.data.indexOf(m, c + 1)) !== -1; ) a.push({ type: 7, index: n }), c += m.length - 1;
@@ -342,7 +342,7 @@ function F(i, t, e = i, r) {
342
342
  const n = P(t) ? void 0 : t._$litDirective$;
343
343
  return (s == null ? void 0 : s.constructor) !== n && ((l = s == null ? void 0 : s._$AO) == null || l.call(s, !1), n === void 0 ? s = void 0 : (s = new n(i), s._$AT(i, e, r)), r !== void 0 ? (e._$Co ?? (e._$Co = []))[r] = s : e._$Cl = s), s !== void 0 && (t = F(i, s._$AS(i, t.values), s, r)), t;
344
344
  }
345
- class qt {
345
+ class Jt {
346
346
  constructor(t, e) {
347
347
  this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
348
348
  }
@@ -358,8 +358,8 @@ class qt {
358
358
  let n = _.nextNode(), o = 0, l = 0, a = r[0];
359
359
  for (; a !== void 0; ) {
360
360
  if (o === a.index) {
361
- let h;
362
- a.type === 2 ? h = new z(n, n.nextSibling, this, t) : a.type === 1 ? h = new a.ctor(n, a.name, a.strings, this, t) : a.type === 6 && (h = new Zt(n, this, t)), this._$AV.push(h), a = r[++l];
361
+ let d;
362
+ a.type === 2 ? d = new z(n, n.nextSibling, this, t) : a.type === 1 ? d = new a.ctor(n, a.name, a.strings, this, t) : a.type === 6 && (d = new Wt(n, this, t)), this._$AV.push(d), a = r[++l];
363
363
  }
364
364
  o !== (a == null ? void 0 : a.index) && (n = _.nextNode(), o++);
365
365
  }
@@ -376,7 +376,7 @@ class z {
376
376
  return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
377
377
  }
378
378
  constructor(t, e, r, s) {
379
- this.type = 2, this._$AH = d, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = r, this.options = s, this._$Cv = (s == null ? void 0 : s.isConnected) ?? !0;
379
+ this.type = 2, this._$AH = h, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = r, this.options = s, this._$Cv = (s == null ? void 0 : s.isConnected) ?? !0;
380
380
  }
381
381
  get parentNode() {
382
382
  let t = this._$AA.parentNode;
@@ -390,7 +390,7 @@ class z {
390
390
  return this._$AB;
391
391
  }
392
392
  _$AI(t, e = this) {
393
- t = F(this, t, e), P(t) ? t === d || t == null || t === "" ? (this._$AH !== d && this._$AR(), this._$AH = d) : t !== this._$AH && t !== M && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : zt(t) ? this.k(t) : this._(t);
393
+ t = F(this, t, e), P(t) ? t === h || t == null || t === "" ? (this._$AH !== h && this._$AR(), this._$AH = h) : t !== this._$AH && t !== M && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Rt(t) ? this.k(t) : this._(t);
394
394
  }
395
395
  O(t) {
396
396
  return this._$AA.parentNode.insertBefore(t, this._$AB);
@@ -399,20 +399,20 @@ class z {
399
399
  this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
400
400
  }
401
401
  _(t) {
402
- this._$AH !== d && P(this._$AH) ? this._$AA.nextSibling.data = t : this.T(S.createTextNode(t)), this._$AH = t;
402
+ this._$AH !== h && P(this._$AH) ? this._$AA.nextSibling.data = t : this.T(S.createTextNode(t)), this._$AH = t;
403
403
  }
404
404
  $(t) {
405
405
  var n;
406
- const { values: e, _$litType$: r } = t, s = typeof r == "number" ? this._$AC(t) : (r.el === void 0 && (r.el = V.createElement(At(r.h, r.h[0]), this.options)), r);
406
+ const { values: e, _$litType$: r } = t, s = typeof r == "number" ? this._$AC(t) : (r.el === void 0 && (r.el = N.createElement(xt(r.h, r.h[0]), this.options)), r);
407
407
  if (((n = this._$AH) == null ? void 0 : n._$AD) === s) this._$AH.p(e);
408
408
  else {
409
- const o = new qt(s, this), l = o.u(this.options);
409
+ const o = new Jt(s, this), l = o.u(this.options);
410
410
  o.p(e), this.T(l), this._$AH = o;
411
411
  }
412
412
  }
413
413
  _$AC(t) {
414
- let e = pt.get(t.strings);
415
- return e === void 0 && pt.set(t.strings, e = new V(t)), e;
414
+ let e = ht.get(t.strings);
415
+ return e === void 0 && ht.set(t.strings, e = new N(t)), e;
416
416
  }
417
417
  k(t) {
418
418
  T(this._$AH) || (this._$AH = [], this._$AR());
@@ -441,7 +441,7 @@ class D {
441
441
  return this._$AM._$AU;
442
442
  }
443
443
  constructor(t, e, r, s, n) {
444
- this.type = 1, this._$AH = d, this._$AN = void 0, this.element = t, this.name = e, this._$AM = s, this.options = n, r.length > 2 || r[0] !== "" || r[1] !== "" ? (this._$AH = Array(r.length - 1).fill(new String()), this.strings = r) : this._$AH = d;
444
+ this.type = 1, this._$AH = h, this._$AN = void 0, this.element = t, this.name = e, this._$AM = s, this.options = n, r.length > 2 || r[0] !== "" || r[1] !== "" ? (this._$AH = Array(r.length - 1).fill(new String()), this.strings = r) : this._$AH = h;
445
445
  }
446
446
  _$AI(t, e = this, r, s) {
447
447
  const n = this.strings;
@@ -449,38 +449,38 @@ class D {
449
449
  if (n === void 0) t = F(this, t, e, 0), o = !P(t) || t !== this._$AH && t !== M, o && (this._$AH = t);
450
450
  else {
451
451
  const l = t;
452
- let a, h;
453
- for (t = n[0], a = 0; a < n.length - 1; a++) h = F(this, l[r + a], e, a), h === M && (h = this._$AH[a]), o || (o = !P(h) || h !== this._$AH[a]), h === d ? t = d : t !== d && (t += (h ?? "") + n[a + 1]), this._$AH[a] = h;
452
+ let a, d;
453
+ for (t = n[0], a = 0; a < n.length - 1; a++) d = F(this, l[r + a], e, a), d === M && (d = this._$AH[a]), o || (o = !P(d) || d !== this._$AH[a]), d === h ? t = h : t !== h && (t += (d ?? "") + n[a + 1]), this._$AH[a] = d;
454
454
  }
455
455
  o && !s && this.j(t);
456
456
  }
457
457
  j(t) {
458
- t === d ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
458
+ t === h ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
459
459
  }
460
460
  }
461
- class Dt extends D {
461
+ class qt extends D {
462
462
  constructor() {
463
463
  super(...arguments), this.type = 3;
464
464
  }
465
465
  j(t) {
466
- this.element[this.name] = t === d ? void 0 : t;
466
+ this.element[this.name] = t === h ? void 0 : t;
467
467
  }
468
468
  }
469
- class Gt extends D {
469
+ class Dt extends D {
470
470
  constructor() {
471
471
  super(...arguments), this.type = 4;
472
472
  }
473
473
  j(t) {
474
- this.element.toggleAttribute(this.name, !!t && t !== d);
474
+ this.element.toggleAttribute(this.name, !!t && t !== h);
475
475
  }
476
476
  }
477
- class Wt extends D {
477
+ class Gt extends D {
478
478
  constructor(t, e, r, s, n) {
479
479
  super(t, e, r, s, n), this.type = 5;
480
480
  }
481
481
  _$AI(t, e = this) {
482
- if ((t = F(this, t, e, 0) ?? d) === M) return;
483
- const r = this._$AH, s = t === d && r !== d || t.capture !== r.capture || t.once !== r.once || t.passive !== r.passive, n = t !== d && (r === d || s);
482
+ if ((t = F(this, t, e, 0) ?? h) === M) return;
483
+ const r = this._$AH, s = t === h && r !== h || t.capture !== r.capture || t.once !== r.once || t.passive !== r.passive, n = t !== h && (r === h || s);
484
484
  s && this.element.removeEventListener(this.name, this, r), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
485
485
  }
486
486
  handleEvent(t) {
@@ -488,7 +488,7 @@ class Wt extends D {
488
488
  typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t);
489
489
  }
490
490
  }
491
- class Zt {
491
+ class Wt {
492
492
  constructor(t, e, r) {
493
493
  this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = r;
494
494
  }
@@ -500,8 +500,8 @@ class Zt {
500
500
  }
501
501
  }
502
502
  const Z = U.litHtmlPolyfillSupport;
503
- Z == null || Z(V, z), (U.litHtmlVersions ?? (U.litHtmlVersions = [])).push("3.2.1");
504
- const Kt = (i, t, e) => {
503
+ Z == null || Z(N, z), (U.litHtmlVersions ?? (U.litHtmlVersions = [])).push("3.2.1");
504
+ const Zt = (i, t, e) => {
505
505
  const r = (e == null ? void 0 : e.renderBefore) ?? t;
506
506
  let s = r._$litPart$;
507
507
  if (s === void 0) {
@@ -526,7 +526,7 @@ class A extends C {
526
526
  }
527
527
  update(t) {
528
528
  const e = this.render();
529
- this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Kt(e, this.renderRoot, this.renderOptions);
529
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Zt(e, this.renderRoot, this.renderOptions);
530
530
  }
531
531
  connectedCallback() {
532
532
  var t;
@@ -540,8 +540,8 @@ class A extends C {
540
540
  return M;
541
541
  }
542
542
  }
543
- var vt;
544
- A._$litElement$ = !0, A.finalized = !0, (vt = globalThis.litElementHydrateSupport) == null || vt.call(globalThis, { LitElement: A });
543
+ var mt;
544
+ A._$litElement$ = !0, A.finalized = !0, (mt = globalThis.litElementHydrateSupport) == null || mt.call(globalThis, { LitElement: A });
545
545
  const K = globalThis.litElementPolyfillSupport;
546
546
  K == null || K({ LitElement: A });
547
547
  (globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.1.1");
@@ -550,8 +550,8 @@ K == null || K({ LitElement: A });
550
550
  * Copyright 2017 Google LLC
551
551
  * SPDX-License-Identifier: BSD-3-Clause
552
552
  */
553
- const Qt = (i) => (...t) => ({ _$litDirective$: i, values: t });
554
- let Xt = class {
553
+ const Kt = (i) => (...t) => ({ _$litDirective$: i, values: t });
554
+ let Qt = class {
555
555
  constructor(t) {
556
556
  }
557
557
  get _$AU() {
@@ -572,23 +572,23 @@ let Xt = class {
572
572
  * Copyright 2020 Google LLC
573
573
  * SPDX-License-Identifier: BSD-3-Clause
574
574
  */
575
- const Yt = {}, Tt = (i, t = Yt) => i._$AH = t;
575
+ const Xt = {}, Yt = (i, t = Xt) => i._$AH = t;
576
576
  /**
577
577
  * @license
578
578
  * Copyright 2021 Google LLC
579
579
  * SPDX-License-Identifier: BSD-3-Clause
580
580
  */
581
- const te = Qt(class extends Xt {
581
+ const Tt = Kt(class extends Qt {
582
582
  constructor() {
583
- super(...arguments), this.key = d;
583
+ super(...arguments), this.key = h;
584
584
  }
585
585
  render(i, t) {
586
586
  return this.key = i, t;
587
587
  }
588
588
  update(i, [t, e]) {
589
- return t !== this.key && (Tt(i), this.key = t), e;
589
+ return t !== this.key && (Yt(i), this.key = t), e;
590
590
  }
591
- }), ee = (i) => {
591
+ }), te = (i) => {
592
592
  i.hoverInteraction = i.eoxMap.selectInteractions.selectHover, i.clickInteraction = i.eoxMap.selectInteractions.selectClick;
593
593
  const t = () => {
594
594
  i.requestUpdate();
@@ -600,29 +600,29 @@ const te = Qt(class extends Xt {
600
600
  "change",
601
601
  t
602
602
  );
603
- }, ie = (i, t, e) => {
603
+ }, ee = (i, t, e) => {
604
604
  if (i.clickId === t) return;
605
605
  const r = e ? [] : [t];
606
606
  i.hoverInteraction.highlightById(r);
607
- }, re = (i, t) => {
607
+ }, ie = (i, t) => {
608
608
  i.stopPropagation();
609
609
  const e = Number(i.target.getAttribute("index")), r = t.drawnFeatures[e];
610
610
  t.drawLayer.getSource().removeFeature(r), t.drawnFeatures.splice(e, 1), t.requestUpdate();
611
- }, ut = { duration: 750 }, yt = {
611
+ }, pt = { duration: 750 }, ut = {
612
612
  type: "FeatureCollection",
613
613
  features: []
614
- }, se = (i, t) => {
614
+ }, re = (i, t) => {
615
615
  const e = i.getId(), { clickId: r, drawLayer: s, olMap: n, clickInteraction: o } = t, l = r === e, a = i.getGeometry();
616
616
  if (l) {
617
- const h = s.getSource().getExtent();
618
- n.getView().fit(h, ut), o.highlightById([]);
617
+ const d = s.getSource().getExtent();
618
+ n.getView().fit(d, pt), o.highlightById([]);
619
619
  } else {
620
- const h = a.getExtent();
621
- o.highlightById([e]), n.getView().fit(h, ut);
620
+ const d = a.getExtent();
621
+ o.highlightById([e]), n.getView().fit(d, pt);
622
622
  }
623
623
  t.requestUpdate();
624
- }, ne = "ul.list-wrap { padding: 0;}ul.list-wrap li:hover,ul.list-wrap li.selected { background: var(--secondary-bg-color-hover);}ul.list-wrap li { list-style: none; padding: 4px;}ul.list-wrap li { border-bottom: 1.2px solid var(--secondary-color);}ul.list-wrap li:first-child { border-top: 1.2px solid var(--secondary-color);}ul.list-wrap li .list { width: 100%; align-items: center; justify-content: space-between; display: flex; align-items: center; cursor: pointer; font-size: small; gap: 10px;}ul.list-wrap li .list span { display: flex; align-items: center; cursor: pointer; font-size: small; flex-grow: 1;}";
625
- class St extends A {
624
+ }, se = "ul.list-wrap { padding: 0;}ul.list-wrap li:hover,ul.list-wrap li.selected { background: var(--secondary-bg-color-hover);}ul.list-wrap li { list-style: none; padding: 4px;}ul.list-wrap li { border-bottom: 1.2px solid var(--secondary-color);}ul.list-wrap li:first-child { border-top: 1.2px solid var(--secondary-color);}ul.list-wrap li .list { width: 100%; align-items: center; justify-content: space-between; display: flex; align-items: center; cursor: pointer; font-size: small; gap: 10px;}ul.list-wrap li .list span { display: flex; align-items: center; cursor: pointer; font-size: small; flex-grow: 1;}";
625
+ class At extends A {
626
626
  constructor() {
627
627
  super();
628
628
  /**
@@ -649,7 +649,7 @@ class St extends A {
649
649
  * @param {Event & { target: HTMLButtonElement }} evt - Event object containing button target.
650
650
  */
651
651
  _handleDelete(e) {
652
- re(e, this), this.dispatchEvent(new CustomEvent("changed", { bubbles: !0 }));
652
+ ie(e, this), this.dispatchEvent(new CustomEvent("changed", { bubbles: !0 }));
653
653
  }
654
654
  /**
655
655
  * Handles the selection and deselection of a feature from the list.
@@ -657,7 +657,7 @@ class St extends A {
657
657
  * @param {import("ol").Feature} feature - The selected feature.
658
658
  */
659
659
  _handleFeatureSelectAndDeselect(e) {
660
- se(e, this);
660
+ re(e, this);
661
661
  }
662
662
  /**
663
663
  *
@@ -665,13 +665,13 @@ class St extends A {
665
665
  * @param {Boolean} mouseOut - Flag indicating mouse out event.
666
666
  */
667
667
  _handleHoverFeature(e, r = !1) {
668
- ie(this, e, r);
668
+ ee(this, e, r);
669
669
  }
670
670
  /**
671
671
  * Initiates initial settings and event triggers upon the component's first update.
672
672
  */
673
673
  firstUpdated() {
674
- ee(this);
674
+ te(this);
675
675
  }
676
676
  /**
677
677
  * Overrides createRenderRoot to handle shadow DOM.
@@ -683,16 +683,16 @@ class St extends A {
683
683
  var e, r;
684
684
  return this.hoverId = (e = this.hoverInteraction) == null ? void 0 : e.selectedFids[0], this.clickId = (r = this.clickInteraction) == null ? void 0 : r.selectedFids[0], x`
685
685
  <style>
686
- ${!this.unstyled && ne}
686
+ ${!this.unstyled && se}
687
687
  </style>
688
688
  <ul class="list-wrap">
689
689
  ${this.drawnFeatures.map((s, n) => {
690
- const o = n + 1, l = s.getId(), a = this.hoverId === l, h = this.clickId === l;
691
- return te(
690
+ const o = n + 1, l = s.getId(), a = this.hoverId === l, d = this.clickId === l;
691
+ return Tt(
692
692
  o,
693
693
  x`
694
694
  <li
695
- class="${a || h ? "selected" : d}"
695
+ class="${a || d ? "selected" : h}"
696
696
  @mouseover=${() => this._handleHoverFeature(l)}
697
697
  @mouseout=${() => this._handleHoverFeature(l, !0)}
698
698
  >
@@ -717,7 +717,7 @@ class St extends A {
717
717
  `;
718
718
  }
719
719
  }
720
- b(St, "properties", {
720
+ b(At, "properties", {
721
721
  eoxMap: { attribute: !1, state: !0 },
722
722
  olMap: { attribute: !1, state: !0 },
723
723
  draw: { attribute: !1, state: !0 },
@@ -726,12 +726,12 @@ b(St, "properties", {
726
726
  modify: { attribute: !1, state: !0 },
727
727
  unstyled: { type: Boolean }
728
728
  });
729
- customElements.define("eox-drawtools-list", St);
730
- const oe = (i) => {
729
+ customElements.define("eox-drawtools-list", At);
730
+ const ne = (i) => {
731
731
  const { multipleFeatures: t, drawnFeatures: e, currentlyDrawing: r } = i, s = !t && (e == null ? void 0 : e.length) > 0 || r, n = !(e != null && e.length) && !r;
732
732
  return { drawDisabled: s, discardDisabled: n };
733
- }, ae = 'button,.button { display: inline-flex; position: relative; align-items: center; color: #fff; border-width: 0; outline: none; border-radius: 4px; padding: 16px; height: 36px; cursor: pointer; font-family: inherit; font-size: 0.875rem; text-transform: uppercase; letter-spacing: 1.25px; font-weight: 500; box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12); transition-property: box-shadow, transform, opacity, background; transition-duration: 0.28s; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);}button:hover:not([disabled]):not(.icon):not(.json-editor-btntype-*),.button:hover:not([disabled]):not(.icon) { box-shadow: 0px 2px 4px -1px rgba(0, 0, 0, 0.2), 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, 0.12); background: var(--primary-btn-color-hover);}button,button:active,.button,.button:active { background: var(--primary-color);}button[disabled],.button[disabled] { opacity: 0.5; cursor: not-allowed;}button.block,.button.block { display: block;}button.outline,.button.outline { background: transparent; box-shadow: none; color: var(--primary-color); outline: 1px solid var(--primary-color);}button.outline:hover,.button.outline:hover { background: transparent;}button.icon,.button.icon,button[class*="json-editor-btntype-"] { background: transparent; border: none; box-shadow: none; padding: 0; border-radius: 50%; width: 24px; height: 24px; text-indent: -9999px;}button.icon-text,.button.icon-text { text-indent: 26px;}button.icon-text.block,.button.icon-text.block { text-indent: 20px;}button.icon:before,button.icon-text:before,.button.icon:before,.button.icon-text:before { position: absolute; text-indent: 0; line-height: initial;}button.icon-text.block:before,.button.icon-text.block:before { text-indent: -54px;}button.icon:before,.button.icon:before,button[class*="json-editor-btntype-"]::before { width: 24px; height: 24px; margin-right: 0;}button.icon-text:before,.button.icon-text:before { width: 18px; height: 18px;}button.small,.button.small { height: 28px; padding: 12.4px; font-size: 0.75rem;}button.smallest.icon,button.smallest.icon::before { height: 16px; width: 16px; padding: 0;}', le = 'textarea { height: 90px; resize: none; border-radius: 4px; box-sizing: border-box !important; width: 100%; padding: 5px 7px; border: 1px solid var(--secondary-color); font-size: smaller; background: var(--background-color);}input[type="text"],input[type="url"],input[type="email"],input[type="password"],input[type="text"],input[type="number"],input[type="search"],input[type="tel"],select { box-sizing: border-box; width: 100%; margin-top: 0.5rem; margin-bottom: 0.5rem; padding: 5px 7px; border-radius: 4px; border: 1px solid #0004;}';
734
- function ce(i) {
733
+ }, oe = 'button,.button { display: inline-flex; position: relative; align-items: center; color: #fff; border-width: 0; outline: none; border-radius: 4px; padding: 16px; height: 36px; cursor: pointer; font-family: inherit; font-size: 0.875rem; text-transform: uppercase; letter-spacing: 1.25px; font-weight: 500; box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12); transition-property: box-shadow, transform, opacity, background; transition-duration: 0.28s; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);}button:hover:not([disabled]):not(.icon):not(.json-editor-btntype-*),.button:hover:not([disabled]):not(.icon) { box-shadow: 0px 2px 4px -1px rgba(0, 0, 0, 0.2), 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, 0.12); background: var(--primary-btn-color-hover);}button,button:active,.button,.button:active { background: var(--primary-color);}button[disabled],.button[disabled] { opacity: 0.5; cursor: not-allowed;}button.block,.button.block { display: block;}button.outline,.button.outline { background: transparent; box-shadow: none; color: var(--primary-color); outline: 1px solid var(--primary-color);}button.outline:hover,.button.outline:hover { background: transparent;}button.icon,.button.icon,button[class*="json-editor-btntype-"] { background: transparent; border: none; box-shadow: none; padding: 0; border-radius: 50%; width: 24px; height: 24px; text-indent: -9999px;}button.icon-text,.button.icon-text { text-indent: 26px;}button.icon-text.block,.button.icon-text.block { text-indent: 20px;}button.icon:before,button.icon-text:before,.button.icon:before,.button.icon-text:before { position: absolute; text-indent: 0; line-height: initial;}button.icon-text.block:before,.button.icon-text.block:before { text-indent: -54px;}button.icon:before,.button.icon:before,button[class*="json-editor-btntype-"]::before { width: 24px; height: 24px; margin-right: 0;}button.icon-text:before,.button.icon-text:before { width: 18px; height: 18px;}button.small,.button.small { height: 28px; padding: 12.4px; font-size: 0.75rem;}button.smallest.icon,button.smallest.icon::before { height: 16px; width: 16px; padding: 0;}', ae = 'textarea { height: 90px; resize: none; border-radius: 4px; box-sizing: border-box !important; width: 100%; padding: 5px 7px; border: 1px solid var(--secondary-color); font-size: smaller; background: var(--background-color);}input[type="text"],input[type="url"],input[type="email"],input[type="password"],input[type="text"],input[type="number"],input[type="search"],input[type="tel"],select { box-sizing: border-box; width: 100%; margin-top: 0.5rem; margin-bottom: 0.5rem; padding: 5px 7px; border-radius: 4px; border: 1px solid #0004;}';
734
+ function le(i) {
735
735
  navigator.clipboard.writeText(i).then(
736
736
  function() {
737
737
  },
@@ -745,17 +745,17 @@ function ce(i) {
745
745
  * Copyright 2021 Google LLC
746
746
  * SPDX-License-Identifier: BSD-3-Clause
747
747
  */
748
- function ft(i, t, e) {
748
+ function yt(i, t, e) {
749
749
  return i ? t(i) : e == null ? void 0 : e(i);
750
750
  }
751
- var N, B;
752
- class Ct extends A {
751
+ var V, B;
752
+ class St extends A {
753
753
  constructor() {
754
754
  super();
755
755
  /**
756
756
  * @type boolean | import("lit").nothing
757
757
  */
758
- $(this, N, !0);
758
+ $(this, V, !0);
759
759
  /**
760
760
  * @type boolean | import("lit").nothing
761
761
  */
@@ -766,8 +766,8 @@ class Ct extends A {
766
766
  * Updates button states based on conditions
767
767
  */
768
768
  updateButtonStates() {
769
- const { drawDisabled: e, discardDisabled: r } = oe(this);
770
- g(this, N, e), g(this, B, r);
769
+ const { drawDisabled: e, discardDisabled: r } = ne(this);
770
+ g(this, V, e), g(this, B, r);
771
771
  }
772
772
  /**
773
773
  * Overrides createRenderRoot to handle shadow DOM
@@ -780,8 +780,8 @@ class Ct extends A {
780
780
  const e = this.currentlyDrawing ? "drawing" : "draw";
781
781
  return x`
782
782
  <style>
783
+ ${!this.unstyled && oe}
783
784
  ${!this.unstyled && ae}
784
- ${!this.unstyled && le}
785
785
  </style>
786
786
  <div class="wrap-btn">
787
787
  <slot></slot>
@@ -790,7 +790,7 @@ class Ct extends A {
790
790
  <button
791
791
  data-cy="drawBtn"
792
792
  class="${this.select ? "pointer" : "polygon"} icon"
793
- ?disabled="${y(this, N) || d}"
793
+ ?disabled="${y(this, V) || h}"
794
794
  @click="${() => this.drawFunc.start()}"
795
795
  >
796
796
  ${e}
@@ -800,7 +800,7 @@ class Ct extends A {
800
800
  <button
801
801
  data-cy="discardBtn"
802
802
  class="discard icon"
803
- ?disabled="${y(this, B) || d}"
803
+ ?disabled="${y(this, B) || h}"
804
804
  @click="${() => this.drawFunc.discard()}"
805
805
  >
806
806
  discard
@@ -808,7 +808,7 @@ class Ct extends A {
808
808
  </div>
809
809
 
810
810
  <!-- Import Button -->
811
- ${ft(
811
+ ${yt(
812
812
  this.importFeatures,
813
813
  () => x`
814
814
  <!-- Import Input Field : Hidden -->
@@ -832,7 +832,7 @@ class Ct extends A {
832
832
  </div>
833
833
 
834
834
  <!-- Geo JSON Wrapper -->
835
- ${ft(
835
+ ${yt(
836
836
  this.showEditor,
837
837
  () => x`
838
838
  <div class="json-wrapper">
@@ -847,9 +847,9 @@ class Ct extends A {
847
847
  <button
848
848
  data-cy="copyBtn"
849
849
  class="icon-copy"
850
- @click=${() => ce(this.geoJSON)}
850
+ @click=${() => le(this.geoJSON)}
851
851
  >
852
- ${this.unstyled ? "copy" : d}
852
+ ${this.unstyled ? "copy" : h}
853
853
  </button>
854
854
  </div>
855
855
  `
@@ -857,8 +857,8 @@ class Ct extends A {
857
857
  `;
858
858
  }
859
859
  }
860
- N = new WeakMap(), B = new WeakMap(), // Define properties with default values and types
861
- b(Ct, "properties", {
860
+ V = new WeakMap(), B = new WeakMap(), // Define properties with default values and types
861
+ b(St, "properties", {
862
862
  multipleFeatures: { attribute: !1, type: Boolean },
863
863
  drawnFeatures: { attribute: !1, state: !0, type: Array },
864
864
  currentlyDrawing: { attribute: !1, state: !0, type: Boolean },
@@ -869,8 +869,8 @@ b(Ct, "properties", {
869
869
  geoJSON: { attribute: "geo-json", type: String },
870
870
  unstyled: { type: Boolean }
871
871
  });
872
- customElements.define("eox-drawtools-controller", Ct);
873
- const he = `
872
+ customElements.define("eox-drawtools-controller", St);
873
+ const ce = `
874
874
  button.discard:before {
875
875
  content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23FF5252' viewBox='0 0 24 24'%3E%3Ctitle%3Etrash-can-outline%3C/title%3E%3Cpath d='M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z' /%3E%3C/svg%3E")
876
876
  }
@@ -919,31 +919,20 @@ const he = `
919
919
  (() => {
920
920
  i.emitDrawnFeatures(), i.multipleFeatures || (i.draw.setActive(!1), i.selectionEvents.removeSelectionEvent(), i.currentlyDrawing = !1);
921
921
  })(), i.requestUpdate();
922
- }, pe = (i) => {
922
+ }, he = (i) => {
923
923
  const t = () => {
924
924
  i.drawLayer.set("isDrawingEnabled", !0), i.draw.setActive(!0), i.selectionEvents.addSelectionEvent();
925
925
  }, e = () => {
926
926
  i.currentlyDrawing = !0, i.requestUpdate();
927
927
  };
928
928
  t(), e();
929
- }, ue = (i) => {
929
+ }, pe = (i) => {
930
930
  let t;
931
931
  return typeof i == "string" ? t = /** @type {HTMLElement} */
932
932
  document.querySelector(i) : t = i, t;
933
- }, tt = (i, t) => {
934
- for (const e of i) {
935
- if (e.type === "Group") {
936
- const r = tt(e.layers, t);
937
- if (!r)
938
- continue;
939
- return r;
940
- }
941
- if (e.properties.id === t)
942
- return e;
943
- }
944
- }, gt = (i, t) => {
933
+ }, ft = (i, t) => {
945
934
  var n;
946
- const r = ue(i.for), s = r.map;
935
+ const r = pe(i.for), s = r.map;
947
936
  return i.drawLayer = r.addOrUpdateLayer({
948
937
  type: "Vector",
949
938
  properties: {
@@ -1000,20 +989,18 @@ const he = `
1000
989
  r.interactions.drawInteraction, i.modify = /** @type {import("ol/interaction").Modify} */
1001
990
  /** @type {unknown} */
1002
991
  r.interactions.drawInteractionmodify, X(i, r, i.layerId), (n = i.modify) == null || n.on("modifyend", () => i.onModifyEnd()), r.addEventListener("addfeatures", () => de(i)), { EoxMap: r, OlMap: s };
1003
- }, ye = (i) => {
992
+ }, ue = (i) => {
1004
993
  const t = () => {
1005
- i.drawnFeatures = [], setTimeout(() => {
1006
- i.draw.setActive(!1), i.selectionEvents.removeSelectionEvent();
1007
- }, 200), i.drawLayer.getSource().clear(), i.geoJSON = null;
994
+ i.drawnFeatures = [], i.draw.setActive(!1), i.selectionEvents.removeSelectionEvent(), i.drawLayer.getSource().clear(), i.geoJSON = null;
1008
995
  }, e = () => {
1009
996
  i.emitDrawnFeatures(), i.currentlyDrawing = !1, i.requestUpdate();
1010
997
  };
1011
998
  t(), e();
1012
- }, fe = (i, t) => {
999
+ }, ye = (i, t) => {
1013
1000
  setTimeout(() => {
1014
1001
  i.drawnFeatures = i.drawLayer.getSource().getFeatures(), i.updateGeoJSON(), i.requestUpdate(), t();
1015
1002
  }, 0);
1016
- }, ge = (i) => {
1003
+ }, fe = (i) => {
1017
1004
  const t = (s) => {
1018
1005
  (s == null ? void 0 : s.detail.id) !== "SelectLayerClickInteraction" || !s.detail.feature || (i.drawLayer.getSource().addFeature(s.detail.feature), i.eoxMap.dispatchEvent(
1019
1006
  new CustomEvent("addfeatures", { detail: s.detail })
@@ -1029,7 +1016,12 @@ const he = `
1029
1016
  }, X = (i, t, e) => {
1030
1017
  if (!e || !t)
1031
1018
  return;
1032
- const r = tt(t.layers, e) || null;
1019
+ const r = JSON.parse(
1020
+ JSON.stringify(
1021
+ /** @type {import("../../../../map/src/main").EoxLayer} */
1022
+ t.getLayerById(e).get("_jsonDefinition")
1023
+ )
1024
+ ) || null;
1033
1025
  if (!r) {
1034
1026
  console.error(`Layer with id ${e} not found`);
1035
1027
  return;
@@ -1065,30 +1057,25 @@ const he = `
1065
1057
  };
1066
1058
  r.interactions = [s, n], t.addOrUpdateLayer(r);
1067
1059
  const o = i.draw;
1068
- i.draw = t.selectInteractions.SelectLayerClickInteraction, setTimeout(() => {
1069
- o.setActive(!1), t.selectInteractions.SelectLayerClickInteraction.setActive(!1), t.selectInteractions.SelectLayerHoverInteraction.setActive(!1);
1070
- }, 200);
1071
- }, me = (i, t, e, r) => {
1060
+ i.draw = t.selectInteractions.SelectLayerClickInteraction, o.setActive(!1), t.selectInteractions.SelectLayerClickInteraction.setActive(!1), t.selectInteractions.SelectLayerHoverInteraction.setActive(!1);
1061
+ }, ge = (i, t, e, r) => {
1072
1062
  if (t) {
1073
1063
  if (e) {
1074
- r && e !== r && mt(i, t, r), X(i, t, e);
1064
+ r && e !== r && gt(i, t), X(i, t, e);
1075
1065
  return;
1076
1066
  }
1077
1067
  if (!e && r) {
1078
- mt(i, t, r);
1068
+ gt(i, t);
1079
1069
  return;
1080
1070
  }
1081
1071
  }
1082
1072
  };
1083
- function mt(i, t, e) {
1084
- if (!t)
1085
- return;
1086
- const r = tt(t.layers, e) || null;
1087
- i.draw = /** @type {import("ol/interaction").Draw} */
1088
- t.interactions.drawInteraction, r && (delete r.interactions, t.addOrUpdateLayer(r));
1073
+ function gt(i, t) {
1074
+ t && (i.discardDrawing(), i.selectionEvents.removeSelectionEvent(), i.draw = /** @type {import("ol/interaction").Draw} */
1075
+ t.interactions.drawInteraction, t.selectInteractions.SelectLayerClickInteraction.remove(), t.selectInteractions.SelectLayerHoverInteraction.remove());
1089
1076
  }
1090
- const ve = ':root,:host { --spacing: 1rem; --block-spacing-vertical: calc(var(--spacing) * 2); --block-spacing-horizontal: var(--spacing); --background-color: var(--eox-background-color, white); --color: var(--eox-color, #2c3d49); --h-color: var(--eox-h-color, var(--color)); --hover-transparency: var(--eox-hover-transparency, 20%); --bg-hover-transparency: var(--eox-bg-hover-transparency, 40%); --btn-hover-transparency: var(--eox-btn-hover-transparency, 80%); --primary-color: var(--eox-primary-color, #004170); --primary-color-hover: color-mix( in srgb, var(--primary-color) var(--hover-transparency), transparent ); --primary-bg-color-hover: color-mix( in srgb, var(--primary-color) var(--bg-hover-transparency), transparent ); --primary-btn-color-hover: color-mix( in srgb, var(--primary-color) var(--btn-hover-transparency), transparent ); --secondary-color: var(--eox-secondary-color, #c6d4df); --secondary-color-hover: color-mix( in srgb, var(--secondary-color) var(--hover-transparency), transparent ); --secondary-bg-color-hover: color-mix( in srgb, var(--secondary-color) var(--bg-hover-transparency), transparent ); --secondary-btn-color-hover: color-mix( in srgb, var(--secondary-color) var(--btn-hover-transparency), transparent ); --success: var(--eox-success, #26cc0f); --warning: var(--eox-warning, #f18e32); --error: var(--eox-error, #ff5252); --header-font-family: var(--eox-header-font-family, "Roboto", sans-serif); --body-font-family: var(--eox-body-font-family, "Roboto", sans-serif);}* { font-size: normal; font-family: var(--body-font-family); color: var(--eox-color);}h1,h2,h3,h4,h5,h6 { font-family: var(--header-font-family);}span,p,div,main,label { font-family: var(--body-font-family);}@media (min-width: 576px) { .container { max-width: 510px; padding-right: 0; padding-left: 0; --block-spacing-vertical: calc(var(--spacing) * 2.5); }}@media (min-width: 768px) { .container { max-width: 700px; --block-spacing-vertical: calc(var(--spacing) * 3); }}@media (min-width: 992px) { .container { max-width: 920px; --block-spacing-vertical: calc(var(--spacing) * 3.5); }}@media (min-width: 1200px) { .container { max-width: 1130px; --block-spacing-vertical: calc(var(--spacing) * 4); }}.container { width: 100%; margin-right: auto; margin-left: auto; display: block; padding: var(--block-spacing-vertical) var(--block-spacing-horizontal);}h1,h2,h3 { line-height: 120%; margin-top: 0.8rem; margin-bottom: 0.8rem;}p { --font-size: 1rem; font-weight: 400; line-height: 170%; margin-top: 0.8rem; margin-bottom: 1.6rem; font-size: var(--font-size);}body { padding: 0; margin: 0;}.sb-show-main.sb-main-padded { padding: 0;}h1,h2,h3,h4,h5,h6 { --font-weight: 700;}h1 { --font-size: 3rem; --typography-spacing-vertical: 0.5rem;}h2 { --font-size: 2rem; --typography-spacing-vertical: 0.5rem;}h3 { --font-size: 1.75rem; --typography-spacing-vertical: 0.5rem;}h4 { --font-size: 1.5rem; --typography-spacing-vertical: 0.5rem;}h5 { --font-size: 1.25rem; --typography-spacing-vertical: 0.5rem;}h1,h2,h3,h4,h5,h6 { margin-top: 0; margin-bottom: var(--typography-spacing-vertical); color: var(--h-color); font-weight: var(--font-weight); font-size: var(--font-size); font-family: var(--header-font-family);}';
1091
- function be(i, t) {
1077
+ const me = ':root,:host { --spacing: 1rem; --block-spacing-vertical: calc(var(--spacing) * 2); --block-spacing-horizontal: var(--spacing); --background-color: var(--eox-background-color, white); --color: var(--eox-color, #2c3d49); --h-color: var(--eox-h-color, var(--color)); --hover-transparency: var(--eox-hover-transparency, 20%); --bg-hover-transparency: var(--eox-bg-hover-transparency, 40%); --btn-hover-transparency: var(--eox-btn-hover-transparency, 80%); --primary-color: var(--eox-primary-color, #004170); --primary-color-hover: color-mix( in srgb, var(--primary-color) var(--hover-transparency), transparent ); --primary-bg-color-hover: color-mix( in srgb, var(--primary-color) var(--bg-hover-transparency), transparent ); --primary-btn-color-hover: color-mix( in srgb, var(--primary-color) var(--btn-hover-transparency), transparent ); --secondary-color: var(--eox-secondary-color, #c6d4df); --secondary-color-hover: color-mix( in srgb, var(--secondary-color) var(--hover-transparency), transparent ); --secondary-bg-color-hover: color-mix( in srgb, var(--secondary-color) var(--bg-hover-transparency), transparent ); --secondary-btn-color-hover: color-mix( in srgb, var(--secondary-color) var(--btn-hover-transparency), transparent ); --success: var(--eox-success, #26cc0f); --warning: var(--eox-warning, #f18e32); --error: var(--eox-error, #ff5252); --header-font-family: var(--eox-header-font-family, "Roboto", sans-serif); --body-font-family: var(--eox-body-font-family, "Roboto", sans-serif);}* { font-size: normal; font-family: var(--body-font-family); color: var(--eox-color);}h1,h2,h3,h4,h5,h6 { font-family: var(--header-font-family);}span,p,div,main,label { font-family: var(--body-font-family);}@media (min-width: 576px) { .container { max-width: 510px; padding-right: 0; padding-left: 0; --block-spacing-vertical: calc(var(--spacing) * 2.5); }}@media (min-width: 768px) { .container { max-width: 700px; --block-spacing-vertical: calc(var(--spacing) * 3); }}@media (min-width: 992px) { .container { max-width: 920px; --block-spacing-vertical: calc(var(--spacing) * 3.5); }}@media (min-width: 1200px) { .container { max-width: 1130px; --block-spacing-vertical: calc(var(--spacing) * 4); }}.container { width: 100%; margin-right: auto; margin-left: auto; display: block; padding: var(--block-spacing-vertical) var(--block-spacing-horizontal);}h1,h2,h3 { line-height: 120%; margin-top: 0.8rem; margin-bottom: 0.8rem;}p { --font-size: 1rem; font-weight: 400; line-height: 170%; margin-top: 0.8rem; margin-bottom: 1.6rem; font-size: var(--font-size);}body { padding: 0; margin: 0;}.sb-show-main.sb-main-padded { padding: 0;}h1,h2,h3,h4,h5,h6 { --font-weight: 700;}h1 { --font-size: 3rem; --typography-spacing-vertical: 0.5rem;}h2 { --font-size: 2rem; --typography-spacing-vertical: 0.5rem;}h3 { --font-size: 1.75rem; --typography-spacing-vertical: 0.5rem;}h4 { --font-size: 1.5rem; --typography-spacing-vertical: 0.5rem;}h5 { --font-size: 1.25rem; --typography-spacing-vertical: 0.5rem;}h1,h2,h3,h4,h5,h6 { margin-top: 0; margin-bottom: var(--typography-spacing-vertical); color: var(--h-color); font-weight: var(--font-weight); font-size: var(--font-size); font-family: var(--header-font-family);}';
1078
+ function ve(i, t) {
1092
1079
  function e(n) {
1093
1080
  n.preventDefault(), n.stopPropagation();
1094
1081
  }
@@ -1100,24 +1087,24 @@ function be(i, t) {
1100
1087
  }
1101
1088
  ["dragenter", "dragover", "dragleave", "drop"].forEach((n) => {
1102
1089
  t.addEventListener(n, e, !1), ["dragenter", "dragover"].includes(n) ? t.addEventListener(n, r, !1) : t.addEventListener(n, s, !1);
1103
- }), t.addEventListener("drop", (n) => Et(n, i), !1);
1090
+ }), t.addEventListener("drop", (n) => Ct(n, i), !1);
1104
1091
  }
1105
- function $e(i) {
1092
+ function be(i) {
1106
1093
  i.preventDefault(), i.stopPropagation();
1107
1094
  }
1108
- function Et(i, t) {
1109
- $e(i);
1095
+ function Ct(i, t) {
1096
+ be(i);
1110
1097
  const e = i.dataTransfer ? i.dataTransfer.files : i.target.files;
1111
- Array.from(e).forEach((r) => we(r, t));
1098
+ Array.from(e).forEach((r) => $e(r, t));
1112
1099
  }
1113
- function we(i, t) {
1100
+ function $e(i, t) {
1114
1101
  const e = new FileReader();
1115
1102
  e.readAsText(i), e.onloadend = function() {
1116
1103
  typeof e.result == "string" && t.handleFeatureChange(e.result);
1117
1104
  };
1118
1105
  }
1119
1106
  var E, H, R, k;
1120
- class _e extends A {
1107
+ class we extends A {
1121
1108
  constructor() {
1122
1109
  super();
1123
1110
  /**
@@ -1164,7 +1151,7 @@ class _e extends A {
1164
1151
  * @type {string}
1165
1152
  */
1166
1153
  set layerId(e) {
1167
- me(this, this.eoxMap, e, y(this, k)), g(this, k, e);
1154
+ ge(this, this.eoxMap, e, y(this, k)), g(this, k, e);
1168
1155
  }
1169
1156
  get layerId() {
1170
1157
  return y(this, k);
@@ -1173,14 +1160,14 @@ class _e extends A {
1173
1160
  * @onClick Event handler triggered to start drawing on the map.
1174
1161
  */
1175
1162
  startDrawing() {
1176
- pe(this);
1163
+ he(this);
1177
1164
  }
1178
1165
  /**
1179
1166
  * @onClick Event handler triggered to discard/stop drawing
1180
1167
  * on the map and delete the drawn shapes.
1181
1168
  */
1182
1169
  discardDrawing() {
1183
- ye(this);
1170
+ ue(this);
1184
1171
  }
1185
1172
  /**
1186
1173
  * @param {string} text - The string representation of the features to be parsed.
@@ -1188,7 +1175,7 @@ class _e extends A {
1188
1175
  */
1189
1176
  handleFeatureChange(e, r = !1) {
1190
1177
  this.eoxMap.parseTextToFeature(
1191
- e || JSON.stringify(yt),
1178
+ e || JSON.stringify(ut),
1192
1179
  this.drawLayer,
1193
1180
  this.eoxMap,
1194
1181
  r
@@ -1198,7 +1185,7 @@ class _e extends A {
1198
1185
  * @param {DragEvent | Event} evt - The event object from the file input interaction.
1199
1186
  */
1200
1187
  handleFilesChange(e) {
1201
- Et(e, this);
1188
+ Ct(e, this);
1202
1189
  }
1203
1190
  /**
1204
1191
  * @event onModifyEnd triggered when the modification of a shape is completed.
@@ -1211,7 +1198,7 @@ class _e extends A {
1211
1198
  */
1212
1199
  updateGeoJSON() {
1213
1200
  g(this, R, JSON.stringify(
1214
- this.eoxMap.parseFeature(this.drawnFeatures) || yt,
1201
+ this.eoxMap.parseFeature(this.drawnFeatures) || ut,
1215
1202
  void 0,
1216
1203
  2
1217
1204
  ));
@@ -1220,7 +1207,7 @@ class _e extends A {
1220
1207
  * Triggers different events when the drawing of a shape is completed.
1221
1208
  */
1222
1209
  emitDrawnFeatures() {
1223
- fe(this, () => {
1210
+ ye(this, () => {
1224
1211
  this.dispatchEvent(
1225
1212
  new CustomEvent("drawupdate", { detail: this.drawnFeatures })
1226
1213
  );
@@ -1238,12 +1225,12 @@ class _e extends A {
1238
1225
  * It then calls requestUpdate to trigger a re-render.
1239
1226
  */
1240
1227
  firstUpdated() {
1241
- const { EoxMap: e, OlMap: r } = gt(this, this.multipleFeatures);
1242
- this.eoxMap = e, g(this, H, r), this.selectionEvents = ge(this), this.importFeatures && be(this, this.eoxMap), this.updateGeoJSON(), this.requestUpdate();
1228
+ const { EoxMap: e, OlMap: r } = ft(this, this.multipleFeatures);
1229
+ this.eoxMap = e, g(this, H, r), this.selectionEvents = fe(this), this.importFeatures && ve(this, this.eoxMap), this.updateGeoJSON(), this.requestUpdate();
1243
1230
  }
1244
1231
  updated(e) {
1245
1232
  if (e.has("for")) {
1246
- const { EoxMap: r, OlMap: s } = gt(this, this.multipleFeatures);
1233
+ const { EoxMap: r, OlMap: s } = ft(this, this.multipleFeatures);
1247
1234
  this.eoxMap = r, g(this, H, s);
1248
1235
  }
1249
1236
  }
@@ -1260,8 +1247,8 @@ class _e extends A {
1260
1247
  return x`
1261
1248
  <style>
1262
1249
  :host { display: block; }
1263
- ${!this.unstyled && ve}
1264
- ${!this.unstyled && he}
1250
+ ${!this.unstyled && me}
1251
+ ${!this.unstyled && ce}
1265
1252
  </style>
1266
1253
 
1267
1254
  <!-- Controller Component -->
@@ -1294,12 +1281,12 @@ class _e extends A {
1294
1281
  @changed=${() => {
1295
1282
  this.updateGeoJSON(), this.requestUpdate();
1296
1283
  }}
1297
- ></eox-drawtools-list>` : d}
1284
+ ></eox-drawtools-list>` : h}
1298
1285
  `;
1299
1286
  }
1300
1287
  }
1301
1288
  E = new WeakMap(), H = new WeakMap(), R = new WeakMap(), k = new WeakMap();
1302
- customElements.define("eox-drawtools", _e);
1289
+ customElements.define("eox-drawtools", we);
1303
1290
  export {
1304
- _e as EOxDrawTools
1291
+ we as EOxDrawTools
1305
1292
  };