@eox/drawtools 0.4.0 → 0.4.2

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.
package/README.md CHANGED
@@ -25,3 +25,7 @@ npm version <new version>
25
25
  npm run build
26
26
  npm publish (requires OTP)
27
27
  ```
28
+
29
+ ## Changelog
30
+
31
+ Created automatically [here](./CHANGELOG.md)
@@ -1,10 +1,19 @@
1
+ var K = (r, t, e) => {
2
+ if (!t.has(r))
3
+ throw TypeError("Cannot " + e);
4
+ };
5
+ var g = (r, t, e) => (K(r, t, "read from private field"), e ? e.call(r) : t.get(r)), V = (r, t, e) => {
6
+ if (t.has(r))
7
+ throw TypeError("Cannot add the same private member more than once");
8
+ t instanceof WeakSet ? t.add(r) : t.set(r, e);
9
+ }, L = (r, t, e, i) => (K(r, t, "write to private field"), i ? i.call(r, e) : t.set(r, e), e);
1
10
  /**
2
11
  * @license
3
12
  * Copyright 2019 Google LLC
4
13
  * SPDX-License-Identifier: BSD-3-Clause
5
14
  */
6
- const T = window, J = T.ShadowRoot && (T.ShadyCSS === void 0 || T.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, at = Symbol(), Q = /* @__PURE__ */ new WeakMap();
7
- let ut = class {
15
+ const O = window, J = O.ShadowRoot && (O.ShadyCSS === void 0 || O.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, at = Symbol(), Q = /* @__PURE__ */ new WeakMap();
16
+ let vt = class {
8
17
  constructor(t, e, i) {
9
18
  if (this._$cssResult$ = !0, i !== at)
10
19
  throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
@@ -23,27 +32,27 @@ let ut = class {
23
32
  return this.cssText;
24
33
  }
25
34
  };
26
- const _t = (r) => new ut(typeof r == "string" ? r : r + "", void 0, at), $t = (r, t) => {
35
+ const gt = (r) => new vt(typeof r == "string" ? r : r + "", void 0, at), yt = (r, t) => {
27
36
  J ? r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet) : t.forEach((e) => {
28
- const i = document.createElement("style"), s = T.litNonce;
37
+ const i = document.createElement("style"), s = O.litNonce;
29
38
  s !== void 0 && i.setAttribute("nonce", s), i.textContent = e.cssText, r.appendChild(i);
30
39
  });
31
40
  }, X = J ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
32
41
  let e = "";
33
42
  for (const i of t.cssRules)
34
43
  e += i.cssText;
35
- return _t(e);
44
+ return gt(e);
36
45
  })(r) : r;
37
46
  /**
38
47
  * @license
39
48
  * Copyright 2017 Google LLC
40
49
  * SPDX-License-Identifier: BSD-3-Clause
41
50
  */
42
- var I;
43
- const D = window, G = D.trustedTypes, vt = G ? G.emptyScript : "", Y = D.reactiveElementPolyfillSupport, W = { toAttribute(r, t) {
51
+ var R;
52
+ const k = window, G = k.trustedTypes, _t = G ? G.emptyScript : "", Y = k.reactiveElementPolyfillSupport, q = { toAttribute(r, t) {
44
53
  switch (t) {
45
54
  case Boolean:
46
- r = r ? vt : null;
55
+ r = r ? _t : null;
47
56
  break;
48
57
  case Object:
49
58
  case Array:
@@ -68,7 +77,7 @@ const D = window, G = D.trustedTypes, vt = G ? G.emptyScript : "", Y = D.reactiv
68
77
  }
69
78
  }
70
79
  return e;
71
- } }, ht = (r, t) => t !== r && (t == t || r == r), B = { attribute: !0, type: String, converter: W, reflect: !1, hasChanged: ht }, K = "finalized";
80
+ } }, ht = (r, t) => t !== r && (t == t || r == r), B = { attribute: !0, type: String, converter: q, reflect: !1, hasChanged: ht }, W = "finalized";
72
81
  let A = class extends HTMLElement {
73
82
  constructor() {
74
83
  super(), this._$Ei = /* @__PURE__ */ new Map(), this.isUpdatePending = !1, this.hasUpdated = !1, this._$El = null, this.u();
@@ -103,9 +112,9 @@ let A = class extends HTMLElement {
103
112
  return this.elementProperties.get(t) || B;
104
113
  }
105
114
  static finalize() {
106
- if (this.hasOwnProperty(K))
115
+ if (this.hasOwnProperty(W))
107
116
  return !1;
108
- this[K] = !0;
117
+ this[W] = !0;
109
118
  const t = Object.getPrototypeOf(this);
110
119
  if (t.finalize(), t.h !== void 0 && (this.h = [...t.h]), this.elementProperties = new Map(t.elementProperties), this._$Ev = /* @__PURE__ */ new Map(), this.hasOwnProperty("properties")) {
111
120
  const e = this.properties, i = [...Object.getOwnPropertyNames(e), ...Object.getOwnPropertySymbols(e)];
@@ -148,7 +157,7 @@ let A = class extends HTMLElement {
148
157
  createRenderRoot() {
149
158
  var t;
150
159
  const e = (t = this.shadowRoot) !== null && t !== void 0 ? t : this.attachShadow(this.constructor.shadowRootOptions);
151
- return $t(e, this.constructor.elementStyles), e;
160
+ return yt(e, this.constructor.elementStyles), e;
152
161
  }
153
162
  connectedCallback() {
154
163
  var t;
@@ -173,7 +182,7 @@ let A = class extends HTMLElement {
173
182
  var s;
174
183
  const n = this.constructor._$Ep(t, i);
175
184
  if (n !== void 0 && i.reflect === !0) {
176
- const o = (((s = i.converter) === null || s === void 0 ? void 0 : s.toAttribute) !== void 0 ? i.converter : W).toAttribute(e, i.type);
185
+ const o = (((s = i.converter) === null || s === void 0 ? void 0 : s.toAttribute) !== void 0 ? i.converter : q).toAttribute(e, i.type);
177
186
  this._$El = t, o == null ? this.removeAttribute(n) : this.setAttribute(n, o), this._$El = null;
178
187
  }
179
188
  }
@@ -181,8 +190,8 @@ let A = class extends HTMLElement {
181
190
  var i;
182
191
  const s = this.constructor, n = s._$Ev.get(t);
183
192
  if (n !== void 0 && this._$El !== n) {
184
- const o = s.getPropertyOptions(n), d = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((i = o.converter) === null || i === void 0 ? void 0 : i.fromAttribute) !== void 0 ? o.converter : W;
185
- this._$El = n, this[n] = d.fromAttribute(e, o.type), this._$El = null;
193
+ const o = s.getPropertyOptions(n), h = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((i = o.converter) === null || i === void 0 ? void 0 : i.fromAttribute) !== void 0 ? o.converter : q;
194
+ this._$El = n, this[n] = h.fromAttribute(e, o.type), this._$El = null;
186
195
  }
187
196
  }
188
197
  requestUpdate(t, e, i) {
@@ -248,73 +257,76 @@ let A = class extends HTMLElement {
248
257
  firstUpdated(t) {
249
258
  }
250
259
  };
251
- A[K] = !0, A.elementProperties = /* @__PURE__ */ new Map(), A.elementStyles = [], A.shadowRootOptions = { mode: "open" }, Y == null || Y({ ReactiveElement: A }), ((I = D.reactiveElementVersions) !== null && I !== void 0 ? I : D.reactiveElementVersions = []).push("1.6.2");
260
+ A[W] = !0, A.elementProperties = /* @__PURE__ */ new Map(), A.elementStyles = [], A.shadowRootOptions = { mode: "open" }, Y == null || Y({ ReactiveElement: A }), ((R = k.reactiveElementVersions) !== null && R !== void 0 ? R : k.reactiveElementVersions = []).push("1.6.2");
252
261
  /**
253
262
  * @license
254
263
  * Copyright 2017 Google LLC
255
264
  * SPDX-License-Identifier: BSD-3-Clause
256
265
  */
257
- var z;
258
- const L = window, b = L.trustedTypes, tt = b ? b.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, Z = "$lit$", y = `lit$${(Math.random() + "").slice(9)}$`, dt = "?" + y, yt = `<${dt}>`, m = document, P = () => m.createComment(""), H = (r) => r === null || typeof r != "object" && typeof r != "function", ct = Array.isArray, ft = (r) => ct(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", V = `[
259
- \f\r]`, S = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, et = /-->/g, it = />/g, f = RegExp(`>|${V}(?:([^\\s"'>=/]+)(${V}*=${V}*(?:[^
260
- \f\r"'\`<>=]|("|')|))|$)`, "g"), st = /'/g, rt = /"/g, pt = /^(?:script|style|textarea|title)$/i, gt = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), mt = gt(1), w = Symbol.for("lit-noChange"), p = Symbol.for("lit-nothing"), ot = /* @__PURE__ */ new WeakMap(), g = m.createTreeWalker(m, 129, null, !1), At = (r, t) => {
261
- const e = r.length - 1, i = [];
262
- let s, n = t === 2 ? "<svg>" : "", o = S;
263
- for (let l = 0; l < e; l++) {
264
- const a = r[l];
265
- let v, h, c = -1, _ = 0;
266
- for (; _ < a.length && (o.lastIndex = _, h = o.exec(a), h !== null); )
267
- _ = o.lastIndex, o === S ? h[1] === "!--" ? o = et : h[1] !== void 0 ? o = it : h[2] !== void 0 ? (pt.test(h[2]) && (s = RegExp("</" + h[2], "g")), o = f) : h[3] !== void 0 && (o = f) : o === f ? h[0] === ">" ? (o = s ?? S, c = -1) : h[1] === void 0 ? c = -2 : (c = o.lastIndex - h[2].length, v = h[1], o = h[3] === void 0 ? f : h[3] === '"' ? rt : st) : o === rt || o === st ? o = f : o === et || o === it ? o = S : (o = f, s = void 0);
268
- const k = o === f && r[l + 1].startsWith("/>") ? " " : "";
269
- n += o === S ? a + yt : c >= 0 ? (i.push(v), a.slice(0, c) + Z + a.slice(c) + y + k) : a + y + (c === -2 ? (i.push(void 0), l) : k);
270
- }
271
- const d = n + (r[e] || "<?>") + (t === 2 ? "</svg>" : "");
266
+ var I;
267
+ const T = window, b = T.trustedTypes, tt = b ? b.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, Z = "$lit$", y = `lit$${(Math.random() + "").slice(9)}$`, dt = "?" + y, ft = `<${dt}>`, m = document, C = () => m.createComment(""), H = (r) => r === null || typeof r != "object" && typeof r != "function", ct = Array.isArray, mt = (r) => ct(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", F = `[
268
+ \f\r]`, E = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, et = /-->/g, it = />/g, _ = RegExp(`>|${F}(?:([^\\s"'>=/]+)(${F}*=${F}*(?:[^
269
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), st = /'/g, rt = /"/g, ut = /^(?:script|style|textarea|title)$/i, At = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), bt = At(1), w = Symbol.for("lit-noChange"), u = Symbol.for("lit-nothing"), nt = /* @__PURE__ */ new WeakMap(), f = m.createTreeWalker(m, 129, null, !1);
270
+ function pt(r, t) {
272
271
  if (!Array.isArray(r) || !r.hasOwnProperty("raw"))
273
272
  throw Error("invalid template strings array");
274
- return [tt !== void 0 ? tt.createHTML(d) : d, i];
273
+ return tt !== void 0 ? tt.createHTML(t) : t;
274
+ }
275
+ const wt = (r, t) => {
276
+ const e = r.length - 1, i = [];
277
+ let s, n = t === 2 ? "<svg>" : "", o = E;
278
+ for (let h = 0; h < e; h++) {
279
+ const l = r[h];
280
+ let a, d, c = -1, p = 0;
281
+ for (; p < l.length && (o.lastIndex = p, d = o.exec(l), d !== null); )
282
+ p = o.lastIndex, o === E ? d[1] === "!--" ? o = et : d[1] !== void 0 ? o = it : d[2] !== void 0 ? (ut.test(d[2]) && (s = RegExp("</" + d[2], "g")), o = _) : d[3] !== void 0 && (o = _) : o === _ ? d[0] === ">" ? (o = s ?? E, c = -1) : d[1] === void 0 ? c = -2 : (c = o.lastIndex - d[2].length, a = d[1], o = d[3] === void 0 ? _ : d[3] === '"' ? rt : st) : o === rt || o === st ? o = _ : o === et || o === it ? o = E : (o = _, s = void 0);
283
+ const $ = o === _ && r[h + 1].startsWith("/>") ? " " : "";
284
+ n += o === E ? l + ft : c >= 0 ? (i.push(a), l.slice(0, c) + Z + l.slice(c) + y + $) : l + y + (c === -2 ? (i.push(void 0), h) : $);
285
+ }
286
+ return [pt(r, n + (r[e] || "<?>") + (t === 2 ? "</svg>" : "")), i];
275
287
  };
276
288
  class U {
277
289
  constructor({ strings: t, _$litType$: e }, i) {
278
290
  let s;
279
291
  this.parts = [];
280
292
  let n = 0, o = 0;
281
- const d = t.length - 1, l = this.parts, [a, v] = At(t, e);
282
- if (this.el = U.createElement(a, i), g.currentNode = this.el.content, e === 2) {
283
- const h = this.el.content, c = h.firstChild;
284
- c.remove(), h.append(...c.childNodes);
293
+ const h = t.length - 1, l = this.parts, [a, d] = wt(t, e);
294
+ if (this.el = U.createElement(a, i), f.currentNode = this.el.content, e === 2) {
295
+ const c = this.el.content, p = c.firstChild;
296
+ p.remove(), c.append(...p.childNodes);
285
297
  }
286
- for (; (s = g.nextNode()) !== null && l.length < d; ) {
298
+ for (; (s = f.nextNode()) !== null && l.length < h; ) {
287
299
  if (s.nodeType === 1) {
288
300
  if (s.hasAttributes()) {
289
- const h = [];
290
- for (const c of s.getAttributeNames())
291
- if (c.endsWith(Z) || c.startsWith(y)) {
292
- const _ = v[o++];
293
- if (h.push(c), _ !== void 0) {
294
- const k = s.getAttribute(_.toLowerCase() + Z).split(y), N = /([.?@])?(.*)/.exec(_);
295
- l.push({ type: 1, index: n, name: N[2], strings: k, ctor: N[1] === "." ? wt : N[1] === "?" ? xt : N[1] === "@" ? St : R });
301
+ const c = [];
302
+ for (const p of s.getAttributeNames())
303
+ if (p.endsWith(Z) || p.startsWith(y)) {
304
+ const $ = d[o++];
305
+ if (c.push(p), $ !== void 0) {
306
+ const $t = s.getAttribute($.toLowerCase() + Z).split(y), D = /([.?@])?(.*)/.exec($);
307
+ l.push({ type: 1, index: n, name: D[2], strings: $t, ctor: D[1] === "." ? Et : D[1] === "?" ? Ct : D[1] === "@" ? Ht : N });
296
308
  } else
297
309
  l.push({ type: 6, index: n });
298
310
  }
299
- for (const c of h)
300
- s.removeAttribute(c);
311
+ for (const p of c)
312
+ s.removeAttribute(p);
301
313
  }
302
- if (pt.test(s.tagName)) {
303
- const h = s.textContent.split(y), c = h.length - 1;
304
- if (c > 0) {
314
+ if (ut.test(s.tagName)) {
315
+ const c = s.textContent.split(y), p = c.length - 1;
316
+ if (p > 0) {
305
317
  s.textContent = b ? b.emptyScript : "";
306
- for (let _ = 0; _ < c; _++)
307
- s.append(h[_], P()), g.nextNode(), l.push({ type: 2, index: ++n });
308
- s.append(h[c], P());
318
+ for (let $ = 0; $ < p; $++)
319
+ s.append(c[$], C()), f.nextNode(), l.push({ type: 2, index: ++n });
320
+ s.append(c[p], C());
309
321
  }
310
322
  }
311
323
  } else if (s.nodeType === 8)
312
324
  if (s.data === dt)
313
325
  l.push({ type: 2, index: n });
314
326
  else {
315
- let h = -1;
316
- for (; (h = s.data.indexOf(y, h + 1)) !== -1; )
317
- l.push({ type: 7, index: n }), h += y.length - 1;
327
+ let c = -1;
328
+ for (; (c = s.data.indexOf(y, c + 1)) !== -1; )
329
+ l.push({ type: 7, index: n }), c += y.length - 1;
318
330
  }
319
331
  n++;
320
332
  }
@@ -324,15 +336,15 @@ class U {
324
336
  return i.innerHTML = t, i;
325
337
  }
326
338
  }
327
- function E(r, t, e = r, i) {
328
- var s, n, o, d;
339
+ function x(r, t, e = r, i) {
340
+ var s, n, o, h;
329
341
  if (t === w)
330
342
  return t;
331
343
  let l = i !== void 0 ? (s = e._$Co) === null || s === void 0 ? void 0 : s[i] : e._$Cl;
332
344
  const a = H(t) ? void 0 : t._$litDirective$;
333
- return (l == null ? void 0 : l.constructor) !== a && ((n = l == null ? void 0 : l._$AO) === null || n === void 0 || n.call(l, !1), a === void 0 ? l = void 0 : (l = new a(r), l._$AT(r, e, i)), i !== void 0 ? ((o = (d = e)._$Co) !== null && o !== void 0 ? o : d._$Co = [])[i] = l : e._$Cl = l), l !== void 0 && (t = E(r, l._$AS(r, t.values), l, i)), t;
345
+ return (l == null ? void 0 : l.constructor) !== a && ((n = l == null ? void 0 : l._$AO) === null || n === void 0 || n.call(l, !1), a === void 0 ? l = void 0 : (l = new a(r), l._$AT(r, e, i)), i !== void 0 ? ((o = (h = e)._$Co) !== null && o !== void 0 ? o : h._$Co = [])[i] = l : e._$Cl = l), l !== void 0 && (t = x(r, l._$AS(r, t.values), l, i)), t;
334
346
  }
335
- class bt {
347
+ class xt {
336
348
  constructor(t, e) {
337
349
  this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
338
350
  }
@@ -345,16 +357,16 @@ class bt {
345
357
  u(t) {
346
358
  var e;
347
359
  const { el: { content: i }, parts: s } = this._$AD, n = ((e = t == null ? void 0 : t.creationScope) !== null && e !== void 0 ? e : m).importNode(i, !0);
348
- g.currentNode = n;
349
- let o = g.nextNode(), d = 0, l = 0, a = s[0];
360
+ f.currentNode = n;
361
+ let o = f.nextNode(), h = 0, l = 0, a = s[0];
350
362
  for (; a !== void 0; ) {
351
- if (d === a.index) {
352
- let v;
353
- a.type === 2 ? v = new M(o, o.nextSibling, this, t) : a.type === 1 ? v = new a.ctor(o, a.name, a.strings, this, t) : a.type === 6 && (v = new Ct(o, this, t)), this._$AV.push(v), a = s[++l];
363
+ if (h === a.index) {
364
+ let d;
365
+ a.type === 2 ? d = new M(o, o.nextSibling, this, t) : a.type === 1 ? d = new a.ctor(o, a.name, a.strings, this, t) : a.type === 6 && (d = new Ut(o, this, t)), this._$AV.push(d), a = s[++l];
354
366
  }
355
- d !== (a == null ? void 0 : a.index) && (o = g.nextNode(), d++);
367
+ h !== (a == null ? void 0 : a.index) && (o = f.nextNode(), h++);
356
368
  }
357
- return g.currentNode = m, n;
369
+ return f.currentNode = m, n;
358
370
  }
359
371
  v(t) {
360
372
  let e = 0;
@@ -365,7 +377,7 @@ class bt {
365
377
  class M {
366
378
  constructor(t, e, i, s) {
367
379
  var n;
368
- this.type = 2, this._$AH = p, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = i, this.options = s, this._$Cp = (n = s == null ? void 0 : s.isConnected) === null || n === void 0 || n;
380
+ this.type = 2, this._$AH = u, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = i, this.options = s, this._$Cp = (n = s == null ? void 0 : s.isConnected) === null || n === void 0 || n;
369
381
  }
370
382
  get _$AU() {
371
383
  var t, e;
@@ -383,7 +395,7 @@ class M {
383
395
  return this._$AB;
384
396
  }
385
397
  _$AI(t, e = this) {
386
- t = E(this, t, e), H(t) ? t === p || t == null || t === "" ? (this._$AH !== p && this._$AR(), this._$AH = p) : t !== this._$AH && t !== w && this._(t) : t._$litType$ !== void 0 ? this.g(t) : t.nodeType !== void 0 ? this.$(t) : ft(t) ? this.T(t) : this._(t);
398
+ t = x(this, t, e), H(t) ? t === u || t == null || t === "" ? (this._$AH !== u && this._$AR(), this._$AH = u) : t !== this._$AH && t !== w && this._(t) : t._$litType$ !== void 0 ? this.g(t) : t.nodeType !== void 0 ? this.$(t) : mt(t) ? this.T(t) : this._(t);
387
399
  }
388
400
  k(t) {
389
401
  return this._$AA.parentNode.insertBefore(t, this._$AB);
@@ -392,28 +404,28 @@ class M {
392
404
  this._$AH !== t && (this._$AR(), this._$AH = this.k(t));
393
405
  }
394
406
  _(t) {
395
- this._$AH !== p && H(this._$AH) ? this._$AA.nextSibling.data = t : this.$(m.createTextNode(t)), this._$AH = t;
407
+ this._$AH !== u && H(this._$AH) ? this._$AA.nextSibling.data = t : this.$(m.createTextNode(t)), this._$AH = t;
396
408
  }
397
409
  g(t) {
398
410
  var e;
399
- const { values: i, _$litType$: s } = t, n = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = U.createElement(s.h, this.options)), s);
411
+ const { values: i, _$litType$: s } = t, n = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = U.createElement(pt(s.h, s.h[0]), this.options)), s);
400
412
  if (((e = this._$AH) === null || e === void 0 ? void 0 : e._$AD) === n)
401
413
  this._$AH.v(i);
402
414
  else {
403
- const o = new bt(n, this), d = o.u(this.options);
404
- o.v(i), this.$(d), this._$AH = o;
415
+ const o = new xt(n, this), h = o.u(this.options);
416
+ o.v(i), this.$(h), this._$AH = o;
405
417
  }
406
418
  }
407
419
  _$AC(t) {
408
- let e = ot.get(t.strings);
409
- return e === void 0 && ot.set(t.strings, e = new U(t)), e;
420
+ let e = nt.get(t.strings);
421
+ return e === void 0 && nt.set(t.strings, e = new U(t)), e;
410
422
  }
411
423
  T(t) {
412
424
  ct(this._$AH) || (this._$AH = [], this._$AR());
413
425
  const e = this._$AH;
414
426
  let i, s = 0;
415
427
  for (const n of t)
416
- s === e.length ? e.push(i = new M(this.k(P()), this.k(P()), this, this.options)) : i = e[s], i._$AI(n), s++;
428
+ s === e.length ? e.push(i = new M(this.k(C()), this.k(C()), this, this.options)) : i = e[s], i._$AI(n), s++;
417
429
  s < e.length && (this._$AR(i && i._$AB.nextSibling, s), e.length = s);
418
430
  }
419
431
  _$AR(t = this._$AA.nextSibling, e) {
@@ -428,9 +440,9 @@ class M {
428
440
  this._$AM === void 0 && (this._$Cp = t, (e = this._$AP) === null || e === void 0 || e.call(this, t));
429
441
  }
430
442
  }
431
- class R {
443
+ class N {
432
444
  constructor(t, e, i, s, n) {
433
- this.type = 1, this._$AH = p, this._$AN = void 0, this.element = t, this.name = e, this._$AM = s, this.options = n, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = p;
445
+ this.type = 1, this._$AH = u, this._$AN = void 0, this.element = t, this.name = e, this._$AM = s, this.options = n, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = u;
434
446
  }
435
447
  get tagName() {
436
448
  return this.element.tagName;
@@ -442,45 +454,45 @@ class R {
442
454
  const n = this.strings;
443
455
  let o = !1;
444
456
  if (n === void 0)
445
- t = E(this, t, e, 0), o = !H(t) || t !== this._$AH && t !== w, o && (this._$AH = t);
457
+ t = x(this, t, e, 0), o = !H(t) || t !== this._$AH && t !== w, o && (this._$AH = t);
446
458
  else {
447
- const d = t;
459
+ const h = t;
448
460
  let l, a;
449
461
  for (t = n[0], l = 0; l < n.length - 1; l++)
450
- a = E(this, d[i + l], e, l), a === w && (a = this._$AH[l]), o || (o = !H(a) || a !== this._$AH[l]), a === p ? t = p : t !== p && (t += (a ?? "") + n[l + 1]), this._$AH[l] = a;
462
+ a = x(this, h[i + l], e, l), a === w && (a = this._$AH[l]), o || (o = !H(a) || a !== this._$AH[l]), a === u ? t = u : t !== u && (t += (a ?? "") + n[l + 1]), this._$AH[l] = a;
451
463
  }
452
464
  o && !s && this.j(t);
453
465
  }
454
466
  j(t) {
455
- t === p ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
467
+ t === u ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
456
468
  }
457
469
  }
458
- class wt extends R {
470
+ class Et extends N {
459
471
  constructor() {
460
472
  super(...arguments), this.type = 3;
461
473
  }
462
474
  j(t) {
463
- this.element[this.name] = t === p ? void 0 : t;
475
+ this.element[this.name] = t === u ? void 0 : t;
464
476
  }
465
477
  }
466
- const Et = b ? b.emptyScript : "";
467
- class xt extends R {
478
+ const St = b ? b.emptyScript : "";
479
+ class Ct extends N {
468
480
  constructor() {
469
481
  super(...arguments), this.type = 4;
470
482
  }
471
483
  j(t) {
472
- t && t !== p ? this.element.setAttribute(this.name, Et) : this.element.removeAttribute(this.name);
484
+ t && t !== u ? this.element.setAttribute(this.name, St) : this.element.removeAttribute(this.name);
473
485
  }
474
486
  }
475
- class St extends R {
487
+ class Ht extends N {
476
488
  constructor(t, e, i, s, n) {
477
489
  super(t, e, i, s, n), this.type = 5;
478
490
  }
479
491
  _$AI(t, e = this) {
480
492
  var i;
481
- if ((t = (i = E(this, t, e, 0)) !== null && i !== void 0 ? i : p) === w)
493
+ if ((t = (i = x(this, t, e, 0)) !== null && i !== void 0 ? i : u) === w)
482
494
  return;
483
- const s = this._$AH, n = t === p && s !== p || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, o = t !== p && (s === p || n);
495
+ const s = this._$AH, n = t === u && s !== u || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, o = t !== u && (s === u || n);
484
496
  n && this.element.removeEventListener(this.name, this, s), o && this.element.addEventListener(this.name, this, t), this._$AH = t;
485
497
  }
486
498
  handleEvent(t) {
@@ -488,7 +500,7 @@ class St extends R {
488
500
  typeof this._$AH == "function" ? this._$AH.call((i = (e = this.options) === null || e === void 0 ? void 0 : e.host) !== null && i !== void 0 ? i : this.element, t) : this._$AH.handleEvent(t);
489
501
  }
490
502
  }
491
- class Ct {
503
+ class Ut {
492
504
  constructor(t, e, i) {
493
505
  this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = i;
494
506
  }
@@ -496,18 +508,18 @@ class Ct {
496
508
  return this._$AM._$AU;
497
509
  }
498
510
  _$AI(t) {
499
- E(this, t);
511
+ x(this, t);
500
512
  }
501
513
  }
502
- const nt = L.litHtmlPolyfillSupport;
503
- nt == null || nt(U, M), ((z = L.litHtmlVersions) !== null && z !== void 0 ? z : L.litHtmlVersions = []).push("2.7.4");
514
+ const ot = T.litHtmlPolyfillSupport;
515
+ ot == null || ot(U, M), ((I = T.litHtmlVersions) !== null && I !== void 0 ? I : T.litHtmlVersions = []).push("2.8.0");
504
516
  const Pt = (r, t, e) => {
505
517
  var i, s;
506
518
  const n = (i = e == null ? void 0 : e.renderBefore) !== null && i !== void 0 ? i : t;
507
519
  let o = n._$litPart$;
508
520
  if (o === void 0) {
509
- const d = (s = e == null ? void 0 : e.renderBefore) !== null && s !== void 0 ? s : null;
510
- n._$litPart$ = o = new M(t.insertBefore(P(), d), d, void 0, e ?? {});
521
+ const h = (s = e == null ? void 0 : e.renderBefore) !== null && s !== void 0 ? s : null;
522
+ n._$litPart$ = o = new M(t.insertBefore(C(), h), h, void 0, e ?? {});
511
523
  }
512
524
  return o._$AI(r), o;
513
525
  };
@@ -516,8 +528,8 @@ const Pt = (r, t, e) => {
516
528
  * Copyright 2017 Google LLC
517
529
  * SPDX-License-Identifier: BSD-3-Clause
518
530
  */
519
- var j, F;
520
- class C extends A {
531
+ var z, j;
532
+ class S extends A {
521
533
  constructor() {
522
534
  super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
523
535
  }
@@ -542,58 +554,15 @@ class C extends A {
542
554
  return w;
543
555
  }
544
556
  }
545
- C.finalized = !0, C._$litElement$ = !0, (j = globalThis.litElementHydrateSupport) === null || j === void 0 || j.call(globalThis, { LitElement: C });
557
+ S.finalized = !0, S._$litElement$ = !0, (z = globalThis.litElementHydrateSupport) === null || z === void 0 || z.call(globalThis, { LitElement: S });
546
558
  const lt = globalThis.litElementPolyfillSupport;
547
- lt == null || lt({ LitElement: C });
548
- ((F = globalThis.litElementVersions) !== null && F !== void 0 ? F : globalThis.litElementVersions = []).push("3.3.2");
549
- /**
550
- * @license
551
- * Copyright 2017 Google LLC
552
- * SPDX-License-Identifier: BSD-3-Clause
553
- */
554
- const Ht = (r) => (t) => typeof t == "function" ? ((e, i) => (customElements.define(e, i), i))(r, t) : ((e, i) => {
555
- const { kind: s, elements: n } = i;
556
- return { kind: s, elements: n, finisher(o) {
557
- customElements.define(e, o);
558
- } };
559
- })(r, t);
560
- /**
561
- * @license
562
- * Copyright 2017 Google LLC
563
- * SPDX-License-Identifier: BSD-3-Clause
564
- */
565
- const Ut = (r, t) => t.kind === "method" && t.descriptor && !("value" in t.descriptor) ? { ...t, finisher(e) {
566
- e.createProperty(t.key, r);
567
- } } : { kind: "field", key: Symbol(), placement: "own", descriptor: {}, originalKey: t.key, initializer() {
568
- typeof t.initializer == "function" && (this[t.key] = t.initializer.call(this));
569
- }, finisher(e) {
570
- e.createProperty(t.key, r);
571
- } }, Mt = (r, t, e) => {
572
- t.constructor.createProperty(e, r);
573
- };
574
- function O(r) {
575
- return (t, e) => e !== void 0 ? Mt(r, t, e) : Ut(r, t);
576
- }
577
- /**
578
- * @license
579
- * Copyright 2017 Google LLC
580
- * SPDX-License-Identifier: BSD-3-Clause
581
- */
582
- function x(r) {
583
- return O({ ...r, state: !0 });
584
- }
585
- /**
586
- * @license
587
- * Copyright 2021 Google LLC
588
- * SPDX-License-Identifier: BSD-3-Clause
589
- */
590
- var q;
591
- ((q = window.HTMLSlotElement) === null || q === void 0 ? void 0 : q.prototype.assignedElements) != null;
592
- const Ot = `
559
+ lt == null || lt({ LitElement: S });
560
+ ((j = globalThis.litElementVersions) !== null && j !== void 0 ? j : globalThis.litElementVersions = []).push("3.3.2");
561
+ const Mt = `
593
562
  :host {
594
563
  display: block;
595
564
  }
596
- `, kt = `
565
+ `, Dt = `
597
566
  button {
598
567
  /* TODO: why does this only work here and not from :root? */
599
568
  --primary-color: #004170;
@@ -601,6 +570,7 @@ button {
601
570
  --error-color: #FF5252;
602
571
 
603
572
  display: inline-flex;
573
+ position: relative;
604
574
  align-items: center;
605
575
  color: #fff;
606
576
  border-width: 0;
@@ -620,7 +590,7 @@ button {
620
590
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
621
591
  }
622
592
 
623
- button:hover {
593
+ button:hover:not([disabled]):not(.icon) {
624
594
  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);
625
595
  background: var(--primary-color-hover);
626
596
  }
@@ -629,6 +599,10 @@ button, button:active {
629
599
  background: var(--primary-color);
630
600
  }
631
601
 
602
+ button[disabled] {
603
+ opacity: 0.5;
604
+ }
605
+
632
606
  button.outline {
633
607
  background: transparent;
634
608
  box-shadow: none;
@@ -647,6 +621,8 @@ button.icon {
647
621
  padding: 0;
648
622
  border-radius: 50%;
649
623
  width: 24px;
624
+ height: 24px;
625
+ text-indent: -9999px;
650
626
  }
651
627
 
652
628
  button.icon-text {
@@ -669,116 +645,135 @@ button.icon-text:before {
669
645
  width: 18px;
670
646
  height: 18px;
671
647
  }
672
- `, Nt = `
648
+
649
+ button.small {
650
+ height: 28px;
651
+ padding: 12.4px;
652
+ font-size: .75rem;
653
+ }
654
+ `, Ot = `
673
655
  * {
674
656
  font-family: Roboto, sans-serif;
675
657
  }
676
658
 
677
- ${kt}
659
+ ${Dt}
678
660
 
679
- button.discard {
680
- background: var(--error-color);
661
+ button.discard:before {
662
+ 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")
681
663
  }
682
664
 
683
665
  button.polygon:before {
684
- content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 24 24'%3E%3Ctitle%3Eshape-polygon-plus%3C/title%3E%3Cpath d='M17,15.7V13H19V17L10,21L3,14L7,5H11V7H8.3L5.4,13.6L10.4,18.6L17,15.7M22,5V7H19V10H17V7H14V5H17V2H19V5H22Z' /%3E%3C/svg%3E");
666
+ content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23004170' viewBox='0 0 24 24'%3E%3Ctitle%3Eshape-polygon-plus%3C/title%3E%3Cpath d='M17,15.7V13H19V17L10,21L3,14L7,5H11V7H8.3L5.4,13.6L10.4,18.6L17,15.7M22,5V7H19V10H17V7H14V5H17V2H19V5H22Z' /%3E%3C/svg%3E");
685
667
  }
686
668
  `;
687
- var Tt = Object.defineProperty, Dt = Object.getOwnPropertyDescriptor, $ = (r, t, e, i) => {
688
- for (var s = i > 1 ? void 0 : i ? Dt(t, e) : t, n = r.length - 1, o; n >= 0; n--)
689
- (o = r[n]) && (s = (i ? o(t, e, s) : o(s)) || s);
690
- return i && s && Tt(t, e, s), s;
691
- };
692
- let u = class extends C {
669
+ var v, P;
670
+ class kt extends S {
693
671
  constructor() {
694
- super(...arguments), this._drawnFeatures = [];
695
- }
696
- _startDrawing() {
697
- this._eoxMap.addDraw(this._layerId, {
672
+ super();
673
+ /**
674
+ * @type import("../../map/main").EOxMap
675
+ */
676
+ V(this, v, void 0);
677
+ /**
678
+ * @type import("ol").Map
679
+ */
680
+ V(this, P, void 0);
681
+ this.for = "eox-map", this.currentlyDrawing = !1, this.draw = null, this.drawLayer = null, this.drawnFeatures = [], this.layer = "draw", this.modify = null, this.multipleFeatures = !1, this.unstyled = !1;
682
+ }
683
+ static get properties() {
684
+ return {
685
+ for: { type: String },
686
+ currentlyDrawing: { attribute: !1, state: !0, type: Boolean },
687
+ draw: { attribute: !1, state: !0 },
688
+ drawLayer: { attribute: !1, state: !0 },
689
+ drawnFeatures: { attribute: !1, state: !0, type: Array },
690
+ layer: { type: String },
691
+ modify: { attribute: !1, state: !0 },
692
+ multipleFeatures: { attribute: "multiple-features", type: Boolean },
693
+ unstyled: { type: Boolean }
694
+ };
695
+ }
696
+ startDrawing() {
697
+ var e, i;
698
+ g(this, v).addDraw(this.layer, {
698
699
  id: "drawInteraction",
699
- type: "Polygon"
700
- }), this._draw = this._eoxMap.interactions.drawInteraction, this._modify = this._eoxMap.interactions.drawInteraction_modify, this._draw.on("drawend", (r) => this._onDrawEnd(r)), this._modify.on("modifyend", (r) => this._onModifyEnd(r)), this._currentlyDrawing = !0, this.requestUpdate();
701
- }
702
- _discardDrawing() {
703
- this._drawnFeatures = [], this._eoxMap.removeInteraction("drawInteraction"), this._drawLayer.getSource().clear(), this._currentlyDrawing = !1, this.requestUpdate();
704
- }
705
- _onDrawEnd(r) {
706
- console.log(r), this._emitDrawnFeatures(), this._eoxMap.removeInteraction("drawInteraction"), this._currentlyDrawing = !1, this.requestUpdate();
707
- }
708
- _onModifyEnd(r) {
709
- console.log(r), this._emitDrawnFeatures();
710
- }
711
- _emitDrawnFeatures() {
700
+ type: "Polygon",
701
+ stopClick: !0
702
+ }), this.draw = /** @type {import("ol/interaction").Draw} */
703
+ /** @type {unknown} */
704
+ g(this, v).interactions.drawInteraction, this.modify = /** @type {import("ol/interaction").Modify} */
705
+ /** @type {unknown} */
706
+ g(this, v).interactions.drawInteractionmodify, (e = this.draw) == null || e.on("drawend", (s) => this.onDrawEnd(s)), (i = this.modify) == null || i.on("modifyend", (s) => this.onModifyEnd(s)), this.currentlyDrawing = !0, this.requestUpdate();
707
+ }
708
+ discardDrawing() {
709
+ this.drawnFeatures = [], g(this, v).removeInteraction("drawInteraction"), this.drawLayer.getSource().clear(), this.emitDrawnFeatures(), this.currentlyDrawing = !1, this.requestUpdate();
710
+ }
711
+ /**
712
+ *
713
+ * @param {import("ol/interaction/Draw").DrawEvent} evt
714
+ */
715
+ onDrawEnd() {
716
+ this.emitDrawnFeatures(), g(this, v).removeInteraction("drawInteraction"), this.currentlyDrawing = !1, this.requestUpdate();
717
+ }
718
+ /**
719
+ *
720
+ * @param {import("ol/interaction/Modify").ModifyEvent} evt
721
+ */
722
+ onModifyEnd() {
723
+ this.emitDrawnFeatures();
724
+ }
725
+ emitDrawnFeatures() {
712
726
  setTimeout(() => {
713
- this._drawnFeatures = this._drawLayer.getSource().getFeatures(), this.requestUpdate();
714
- const r = new CustomEvent("drawupdate", {
715
- detail: this._drawnFeatures
716
- });
717
- this.dispatchEvent(r);
727
+ this.drawnFeatures = this.drawLayer.getSource().getFeatures(), this.requestUpdate(), this.dispatchEvent(
728
+ new CustomEvent("drawupdate", {
729
+ detail: this.drawnFeatures
730
+ })
731
+ );
718
732
  }, 0);
719
733
  }
720
734
  render() {
721
- const r = document.querySelector(this.for);
722
- return this._eoxMap = r, this._olMap = r.map, this._layerId = this.layer, this._drawLayer = this._olMap.getLayers().getArray().find((t) => t.get("id") === this._layerId), this.requestUpdate(), mt`
735
+ var i, s;
736
+ const e = document.querySelector(this.for);
737
+ return L(
738
+ this,
739
+ v,
740
+ /** @type {import("@eox/map/main").EOxMap} */
741
+ e
742
+ ), L(
743
+ this,
744
+ P,
745
+ /** @type {import("ol").Map} */
746
+ g(this, v).map
747
+ ), this.drawLayer = /** @type {import("ol/layer").Vector<import("ol/source").Vector>} */
748
+ g(this, P).getLayers().getArray().find((n) => n.get("id") === this.layer), this.requestUpdate(), bt`
723
749
  <style>
724
- ${Ot}
725
- ${!this.unstyled && Nt}
750
+ ${Mt}
751
+ ${!this.unstyled && Ot}
726
752
  </style>
727
753
  <div>
728
754
  <slot></slot>
729
755
  <button
730
756
  data-cy="drawBtn"
731
- class="icon-text polygon"
732
- disabled="${!this.multipleFeatures && this._drawnFeatures.length || this._currentlyDrawing || p}"
733
- @click="${() => this._startDrawing()}"
757
+ class="polygon icon"
758
+ disabled="${!this.multipleFeatures && ((i = this.drawnFeatures) == null ? void 0 : i.length) > 0 || this.currentlyDrawing || u}"
759
+ @click="${() => this.startDrawing()}"
734
760
  >
735
- ${this._currentlyDrawing ? "drawing" : "draw"}
761
+ ${this.currentlyDrawing ? "drawing" : "draw"}
736
762
  </button>
737
763
  <button
738
764
  data-cy="discardBtn"
739
- class="discard"
740
- disabled="${!this._drawnFeatures.length && !this._currentlyDrawing || p}"
741
- @click="${() => this._discardDrawing()}"
765
+ class="discard icon"
766
+ disabled="${!((s = this.drawnFeatures) != null && s.length) && !this.currentlyDrawing || u}"
767
+ @click="${() => this.discardDrawing()}"
742
768
  >
743
769
  discard
744
770
  </button>
745
771
  </div>
746
772
  `;
747
773
  }
748
- };
749
- $([
750
- x()
751
- ], u.prototype, "_layerId", 2);
752
- $([
753
- x()
754
- ], u.prototype, "_eoxMap", 2);
755
- $([
756
- x()
757
- ], u.prototype, "_olMap", 2);
758
- $([
759
- x()
760
- ], u.prototype, "_drawLayer", 2);
761
- $([
762
- x()
763
- ], u.prototype, "_drawnFeatures", 2);
764
- $([
765
- x()
766
- ], u.prototype, "_currentlyDrawing", 2);
767
- $([
768
- O({ type: Boolean })
769
- ], u.prototype, "multipleFeatures", 2);
770
- $([
771
- O()
772
- ], u.prototype, "for", 2);
773
- $([
774
- O()
775
- ], u.prototype, "layer", 2);
776
- $([
777
- O({ type: Boolean })
778
- ], u.prototype, "unstyled", 2);
779
- u = $([
780
- Ht("eox-drawtools")
781
- ], u);
774
+ }
775
+ v = new WeakMap(), P = new WeakMap();
776
+ customElements.define("eox-drawtools", kt);
782
777
  export {
783
- u as EOxDrawTools
778
+ kt as EOxDrawTools
784
779
  };
@@ -1,42 +1,26 @@
1
- (function(p,y){typeof exports=="object"&&typeof module<"u"?y(exports):typeof define=="function"&&define.amd?define(["exports"],y):(p=typeof globalThis<"u"?globalThis:p||self,y(p["eox-drawtools"]={}))})(this,function(p){"use strict";/**
1
+ var vt=(p,d,f)=>{if(!d.has(p))throw TypeError("Cannot "+f)};var m=(p,d,f)=>(vt(p,d,"read from private field"),f?f.call(p):d.get(p)),K=(p,d,f)=>{if(d.has(p))throw TypeError("Cannot add the same private member more than once");d instanceof WeakSet?d.add(p):d.set(p,f)},Q=(p,d,f,H)=>(vt(p,d,"write to private field"),H?H.call(p,f):d.set(p,f),f);(function(p,d){typeof exports=="object"&&typeof module<"u"?d(exports):typeof define=="function"&&define.amd?define(["exports"],d):(p=typeof globalThis<"u"?globalThis:p||self,d(p["eox-drawtools"]={}))})(this,function(p){var g,k;"use strict";/**
2
2
  * @license
3
3
  * Copyright 2019 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
- */const y=window,I=y.ShadowRoot&&(y.ShadyCSS===void 0||y.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Q=Symbol(),X=new WeakMap;let pt=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==Q)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(I&&t===void 0){const i=e!==void 0&&e.length===1;i&&(t=X.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&X.set(e,t))}return t}toString(){return this.cssText}};const _t=o=>new pt(typeof o=="string"?o:o+"",void 0,Q),$t=(o,t)=>{I?o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet):t.forEach(e=>{const i=document.createElement("style"),s=y.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=e.cssText,o.appendChild(i)})},G=I?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return _t(e)})(o):o;/**
5
+ */const d=window,f=d.ShadowRoot&&(d.ShadyCSS===void 0||d.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,H=Symbol(),X=new WeakMap;let ft=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==H)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(f&&t===void 0){const i=e!==void 0&&e.length===1;i&&(t=X.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&X.set(e,t))}return t}toString(){return this.cssText}};const gt=r=>new ft(typeof r=="string"?r:r+"",void 0,H),yt=(r,t)=>{f?r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet):t.forEach(e=>{const i=document.createElement("style"),s=d.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=e.cssText,r.appendChild(i)})},G=f?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return gt(e)})(r):r;/**
6
6
  * @license
7
7
  * Copyright 2017 Google LLC
8
8
  * SPDX-License-Identifier: BSD-3-Clause
9
- */var j;const M=window,Y=M.trustedTypes,vt=Y?Y.emptyScript:"",tt=M.reactiveElementPolyfillSupport,B={toAttribute(o,t){switch(t){case Boolean:o=o?vt:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},et=(o,t)=>t!==o&&(t==t||o==o),z={attribute:!0,type:String,converter:B,reflect:!1,hasChanged:et},V="finalized";let w=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(t){var e;this.finalize(),((e=this.h)!==null&&e!==void 0?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach((e,i)=>{const s=this._$Ep(i,e);s!==void 0&&(this._$Ev.set(s,i),t.push(s))}),t}static createProperty(t,e=z){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i=typeof t=="symbol"?Symbol():"__"+t,s=this.getPropertyDescriptor(t,i,e);s!==void 0&&Object.defineProperty(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(s){const n=this[t];this[e]=s,this.requestUpdate(t,n,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||z}static finalize(){if(this.hasOwnProperty(V))return!1;this[V]=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),t.h!==void 0&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const e=this.properties,i=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(const s of i)this.createProperty(s,e[s])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const s of i)e.unshift(G(s))}else t!==void 0&&e.push(G(t));return e}static _$Ep(t,e){const i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(t=this.constructor.h)===null||t===void 0||t.forEach(e=>e(this))}addController(t){var e,i;((e=this._$ES)!==null&&e!==void 0?e:this._$ES=[]).push(t),this.renderRoot!==void 0&&this.isConnected&&((i=t.hostConnected)===null||i===void 0||i.call(t))}removeController(t){var e;(e=this._$ES)===null||e===void 0||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])})}createRenderRoot(){var t;const e=(t=this.shadowRoot)!==null&&t!==void 0?t:this.attachShadow(this.constructor.shadowRootOptions);return $t(e,this.constructor.elementStyles),e}connectedCallback(){var t;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$ES)===null||t===void 0||t.forEach(e=>{var i;return(i=e.hostConnected)===null||i===void 0?void 0:i.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$ES)===null||t===void 0||t.forEach(e=>{var i;return(i=e.hostDisconnected)===null||i===void 0?void 0:i.call(e)})}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EO(t,e,i=z){var s;const n=this.constructor._$Ep(t,i);if(n!==void 0&&i.reflect===!0){const r=(((s=i.converter)===null||s===void 0?void 0:s.toAttribute)!==void 0?i.converter:B).toAttribute(e,i.type);this._$El=t,r==null?this.removeAttribute(n):this.setAttribute(n,r),this._$El=null}}_$AK(t,e){var i;const s=this.constructor,n=s._$Ev.get(t);if(n!==void 0&&this._$El!==n){const r=s.getPropertyOptions(n),c=typeof r.converter=="function"?{fromAttribute:r.converter}:((i=r.converter)===null||i===void 0?void 0:i.fromAttribute)!==void 0?r.converter:B;this._$El=n,this[n]=c.fromAttribute(e,r.type),this._$El=null}}requestUpdate(t,e,i){let s=!0;t!==void 0&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||et)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),i.reflect===!0&&this._$El!==t&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(t,i))):s=!1),!this.isUpdatePending&&s&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((s,n)=>this[n]=s),this._$Ei=void 0);let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),(t=this._$ES)===null||t===void 0||t.forEach(s=>{var n;return(n=s.hostUpdate)===null||n===void 0?void 0:n.call(s)}),this.update(i)):this._$Ek()}catch(s){throw e=!1,this._$Ek(),s}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;(e=this._$ES)===null||e===void 0||e.forEach(i=>{var s;return(s=i.hostUpdated)===null||s===void 0?void 0:s.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){this._$EC!==void 0&&(this._$EC.forEach((e,i)=>this._$EO(i,this[i],e)),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}};w[V]=!0,w.elementProperties=new Map,w.elementStyles=[],w.shadowRootOptions={mode:"open"},tt==null||tt({ReactiveElement:w}),((j=M.reactiveElementVersions)!==null&&j!==void 0?j:M.reactiveElementVersions=[]).push("1.6.2");/**
9
+ */var B;const N=window,Y=N.trustedTypes,_t=Y?Y.emptyScript:"",tt=N.reactiveElementPolyfillSupport,I={toAttribute(r,t){switch(t){case Boolean:r=r?_t:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},et=(r,t)=>t!==r&&(t==t||r==r),F={attribute:!0,type:String,converter:I,reflect:!1,hasChanged:et},j="finalized";let x=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(t){var e;this.finalize(),((e=this.h)!==null&&e!==void 0?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach((e,i)=>{const s=this._$Ep(i,e);s!==void 0&&(this._$Ev.set(s,i),t.push(s))}),t}static createProperty(t,e=F){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i=typeof t=="symbol"?Symbol():"__"+t,s=this.getPropertyDescriptor(t,i,e);s!==void 0&&Object.defineProperty(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(s){const n=this[t];this[e]=s,this.requestUpdate(t,n,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||F}static finalize(){if(this.hasOwnProperty(j))return!1;this[j]=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),t.h!==void 0&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const e=this.properties,i=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(const s of i)this.createProperty(s,e[s])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const s of i)e.unshift(G(s))}else t!==void 0&&e.push(G(t));return e}static _$Ep(t,e){const i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(t=this.constructor.h)===null||t===void 0||t.forEach(e=>e(this))}addController(t){var e,i;((e=this._$ES)!==null&&e!==void 0?e:this._$ES=[]).push(t),this.renderRoot!==void 0&&this.isConnected&&((i=t.hostConnected)===null||i===void 0||i.call(t))}removeController(t){var e;(e=this._$ES)===null||e===void 0||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])})}createRenderRoot(){var t;const e=(t=this.shadowRoot)!==null&&t!==void 0?t:this.attachShadow(this.constructor.shadowRootOptions);return yt(e,this.constructor.elementStyles),e}connectedCallback(){var t;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$ES)===null||t===void 0||t.forEach(e=>{var i;return(i=e.hostConnected)===null||i===void 0?void 0:i.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$ES)===null||t===void 0||t.forEach(e=>{var i;return(i=e.hostDisconnected)===null||i===void 0?void 0:i.call(e)})}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EO(t,e,i=F){var s;const n=this.constructor._$Ep(t,i);if(n!==void 0&&i.reflect===!0){const o=(((s=i.converter)===null||s===void 0?void 0:s.toAttribute)!==void 0?i.converter:I).toAttribute(e,i.type);this._$El=t,o==null?this.removeAttribute(n):this.setAttribute(n,o),this._$El=null}}_$AK(t,e){var i;const s=this.constructor,n=s._$Ev.get(t);if(n!==void 0&&this._$El!==n){const o=s.getPropertyOptions(n),h=typeof o.converter=="function"?{fromAttribute:o.converter}:((i=o.converter)===null||i===void 0?void 0:i.fromAttribute)!==void 0?o.converter:I;this._$El=n,this[n]=h.fromAttribute(e,o.type),this._$El=null}}requestUpdate(t,e,i){let s=!0;t!==void 0&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||et)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),i.reflect===!0&&this._$El!==t&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(t,i))):s=!1),!this.isUpdatePending&&s&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((s,n)=>this[n]=s),this._$Ei=void 0);let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),(t=this._$ES)===null||t===void 0||t.forEach(s=>{var n;return(n=s.hostUpdate)===null||n===void 0?void 0:n.call(s)}),this.update(i)):this._$Ek()}catch(s){throw e=!1,this._$Ek(),s}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;(e=this._$ES)===null||e===void 0||e.forEach(i=>{var s;return(s=i.hostUpdated)===null||s===void 0?void 0:s.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){this._$EC!==void 0&&(this._$EC.forEach((e,i)=>this._$EO(i,this[i],e)),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}};x[j]=!0,x.elementProperties=new Map,x.elementStyles=[],x.shadowRootOptions={mode:"open"},tt==null||tt({ReactiveElement:x}),((B=N.reactiveElementVersions)!==null&&B!==void 0?B:N.reactiveElementVersions=[]).push("1.6.2");/**
10
10
  * @license
11
11
  * Copyright 2017 Google LLC
12
12
  * SPDX-License-Identifier: BSD-3-Clause
13
- */var F;const k=window,b=k.trustedTypes,it=b?b.createPolicy("lit-html",{createHTML:o=>o}):void 0,q="$lit$",f=`lit$${(Math.random()+"").slice(9)}$`,st="?"+f,yt=`<${st}>`,g=document,C=()=>g.createComment(""),O=o=>o===null||typeof o!="object"&&typeof o!="function",ot=Array.isArray,ft=o=>ot(o)||typeof(o==null?void 0:o[Symbol.iterator])=="function",W=`[
14
- \f\r]`,T=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,rt=/-->/g,nt=/>/g,m=RegExp(`>|${W}(?:([^\\s"'>=/]+)(${W}*=${W}*(?:[^
15
- \f\r"'\`<>=]|("|')|))|$)`,"g"),lt=/'/g,at=/"/g,ht=/^(?:script|style|textarea|title)$/i,gt=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),mt=gt(1),E=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),dt=new WeakMap,A=g.createTreeWalker(g,129,null,!1),At=(o,t)=>{const e=o.length-1,i=[];let s,n=t===2?"<svg>":"",r=T;for(let l=0;l<e;l++){const a=o[l];let v,h,u=-1,$=0;for(;$<a.length&&(r.lastIndex=$,h=r.exec(a),h!==null);)$=r.lastIndex,r===T?h[1]==="!--"?r=rt:h[1]!==void 0?r=nt:h[2]!==void 0?(ht.test(h[2])&&(s=RegExp("</"+h[2],"g")),r=m):h[3]!==void 0&&(r=m):r===m?h[0]===">"?(r=s??T,u=-1):h[1]===void 0?u=-2:(u=r.lastIndex-h[2].length,v=h[1],r=h[3]===void 0?m:h[3]==='"'?at:lt):r===at||r===lt?r=m:r===rt||r===nt?r=T:(r=m,s=void 0);const L=r===m&&o[l+1].startsWith("/>")?" ":"";n+=r===T?a+yt:u>=0?(i.push(v),a.slice(0,u)+q+a.slice(u)+f+L):a+f+(u===-2?(i.push(void 0),l):L)}const c=n+(o[e]||"<?>")+(t===2?"</svg>":"");if(!Array.isArray(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return[it!==void 0?it.createHTML(c):c,i]};class P{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let n=0,r=0;const c=t.length-1,l=this.parts,[a,v]=At(t,e);if(this.el=P.createElement(a,i),A.currentNode=this.el.content,e===2){const h=this.el.content,u=h.firstChild;u.remove(),h.append(...u.childNodes)}for(;(s=A.nextNode())!==null&&l.length<c;){if(s.nodeType===1){if(s.hasAttributes()){const h=[];for(const u of s.getAttributeNames())if(u.endsWith(q)||u.startsWith(f)){const $=v[r++];if(h.push(u),$!==void 0){const L=s.getAttribute($.toLowerCase()+q).split(f),R=/([.?@])?(.*)/.exec($);l.push({type:1,index:n,name:R[2],strings:L,ctor:R[1]==="."?bt:R[1]==="?"?xt:R[1]==="@"?St:N})}else l.push({type:6,index:n})}for(const u of h)s.removeAttribute(u)}if(ht.test(s.tagName)){const h=s.textContent.split(f),u=h.length-1;if(u>0){s.textContent=b?b.emptyScript:"";for(let $=0;$<u;$++)s.append(h[$],C()),A.nextNode(),l.push({type:2,index:++n});s.append(h[u],C())}}}else if(s.nodeType===8)if(s.data===st)l.push({type:2,index:n});else{let h=-1;for(;(h=s.data.indexOf(f,h+1))!==-1;)l.push({type:7,index:n}),h+=f.length-1}n++}}static createElement(t,e){const i=g.createElement("template");return i.innerHTML=t,i}}function x(o,t,e=o,i){var s,n,r,c;if(t===E)return t;let l=i!==void 0?(s=e._$Co)===null||s===void 0?void 0:s[i]:e._$Cl;const a=O(t)?void 0:t._$litDirective$;return(l==null?void 0:l.constructor)!==a&&((n=l==null?void 0:l._$AO)===null||n===void 0||n.call(l,!1),a===void 0?l=void 0:(l=new a(o),l._$AT(o,e,i)),i!==void 0?((r=(c=e)._$Co)!==null&&r!==void 0?r:c._$Co=[])[i]=l:e._$Cl=l),l!==void 0&&(t=x(o,l._$AS(o,t.values),l,i)),t}class wt{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var e;const{el:{content:i},parts:s}=this._$AD,n=((e=t==null?void 0:t.creationScope)!==null&&e!==void 0?e:g).importNode(i,!0);A.currentNode=n;let r=A.nextNode(),c=0,l=0,a=s[0];for(;a!==void 0;){if(c===a.index){let v;a.type===2?v=new D(r,r.nextSibling,this,t):a.type===1?v=new a.ctor(r,a.name,a.strings,this,t):a.type===6&&(v=new Ct(r,this,t)),this._$AV.push(v),a=s[++l]}c!==(a==null?void 0:a.index)&&(r=A.nextNode(),c++)}return A.currentNode=g,n}v(t){let e=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class D{constructor(t,e,i,s){var n;this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cp=(n=s==null?void 0:s.isConnected)===null||n===void 0||n}get _$AU(){var t,e;return(e=(t=this._$AM)===null||t===void 0?void 0:t._$AU)!==null&&e!==void 0?e:this._$Cp}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=x(this,t,e),O(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==E&&this._(t):t._$litType$!==void 0?this.g(t):t.nodeType!==void 0?this.$(t):ft(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==d&&O(this._$AH)?this._$AA.nextSibling.data=t:this.$(g.createTextNode(t)),this._$AH=t}g(t){var e;const{values:i,_$litType$:s}=t,n=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=P.createElement(s.h,this.options)),s);if(((e=this._$AH)===null||e===void 0?void 0:e._$AD)===n)this._$AH.v(i);else{const r=new wt(n,this),c=r.u(this.options);r.v(i),this.$(c),this._$AH=r}}_$AC(t){let e=dt.get(t.strings);return e===void 0&&dt.set(t.strings,e=new P(t)),e}T(t){ot(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const n of t)s===e.length?e.push(i=new D(this.k(C()),this.k(C()),this,this.options)):i=e[s],i._$AI(n),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var i;for((i=this._$AP)===null||i===void 0||i.call(this,!1,!0,e);t&&t!==this._$AB;){const s=t.nextSibling;t.remove(),t=s}}setConnected(t){var e;this._$AM===void 0&&(this._$Cp=t,(e=this._$AP)===null||e===void 0||e.call(this,t))}}class N{constructor(t,e,i,s,n){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=n,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=d}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,s){const n=this.strings;let r=!1;if(n===void 0)t=x(this,t,e,0),r=!O(t)||t!==this._$AH&&t!==E,r&&(this._$AH=t);else{const c=t;let l,a;for(t=n[0],l=0;l<n.length-1;l++)a=x(this,c[i+l],e,l),a===E&&(a=this._$AH[l]),r||(r=!O(a)||a!==this._$AH[l]),a===d?t=d:t!==d&&(t+=(a??"")+n[l+1]),this._$AH[l]=a}r&&!s&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class bt extends N{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}}const Et=b?b.emptyScript:"";class xt extends N{constructor(){super(...arguments),this.type=4}j(t){t&&t!==d?this.element.setAttribute(this.name,Et):this.element.removeAttribute(this.name)}}class St extends N{constructor(t,e,i,s,n){super(t,e,i,s,n),this.type=5}_$AI(t,e=this){var i;if((t=(i=x(this,t,e,0))!==null&&i!==void 0?i:d)===E)return;const s=this._$AH,n=t===d&&s!==d||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,r=t!==d&&(s===d||n);n&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;typeof this._$AH=="function"?this._$AH.call((i=(e=this.options)===null||e===void 0?void 0:e.host)!==null&&i!==void 0?i:this.element,t):this._$AH.handleEvent(t)}}class Ct{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){x(this,t)}}const ct=k.litHtmlPolyfillSupport;ct==null||ct(P,D),((F=k.litHtmlVersions)!==null&&F!==void 0?F:k.litHtmlVersions=[]).push("2.7.4");const Ot=(o,t,e)=>{var i,s;const n=(i=e==null?void 0:e.renderBefore)!==null&&i!==void 0?i:t;let r=n._$litPart$;if(r===void 0){const c=(s=e==null?void 0:e.renderBefore)!==null&&s!==void 0?s:null;n._$litPart$=r=new D(t.insertBefore(C(),c),c,void 0,e??{})}return r._$AI(o),r};/**
13
+ */var z;const V=window,E=V.trustedTypes,it=E?E.createPolicy("lit-html",{createHTML:r=>r}):void 0,q="$lit$",_=`lit$${(Math.random()+"").slice(9)}$`,st="?"+_,mt=`<${st}>`,A=document,U=()=>A.createComment(""),P=r=>r===null||typeof r!="object"&&typeof r!="function",rt=Array.isArray,At=r=>rt(r)||typeof(r==null?void 0:r[Symbol.iterator])=="function",W=`[
14
+ \f\r]`,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,nt=/-->/g,ot=/>/g,b=RegExp(`>|${W}(?:([^\\s"'>=/]+)(${W}*=${W}*(?:[^
15
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),lt=/'/g,at=/"/g,ht=/^(?:script|style|textarea|title)$/i,bt=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),wt=bt(1),S=Symbol.for("lit-noChange"),$=Symbol.for("lit-nothing"),dt=new WeakMap,w=A.createTreeWalker(A,129,null,!1);function ct(r,t){if(!Array.isArray(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return it!==void 0?it.createHTML(t):t}const xt=(r,t)=>{const e=r.length-1,i=[];let s,n=t===2?"<svg>":"",o=M;for(let h=0;h<e;h++){const l=r[h];let a,c,u=-1,v=0;for(;v<l.length&&(o.lastIndex=v,c=o.exec(l),c!==null);)v=o.lastIndex,o===M?c[1]==="!--"?o=nt:c[1]!==void 0?o=ot:c[2]!==void 0?(ht.test(c[2])&&(s=RegExp("</"+c[2],"g")),o=b):c[3]!==void 0&&(o=b):o===b?c[0]===">"?(o=s??M,u=-1):c[1]===void 0?u=-2:(u=o.lastIndex-c[2].length,a=c[1],o=c[3]===void 0?b:c[3]==='"'?at:lt):o===at||o===lt?o=b:o===nt||o===ot?o=M:(o=b,s=void 0);const y=o===b&&r[h+1].startsWith("/>")?" ":"";n+=o===M?l+mt:u>=0?(i.push(a),l.slice(0,u)+q+l.slice(u)+_+y):l+_+(u===-2?(i.push(void 0),h):y)}return[ct(r,n+(r[e]||"<?>")+(t===2?"</svg>":"")),i]};class T{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let n=0,o=0;const h=t.length-1,l=this.parts,[a,c]=xt(t,e);if(this.el=T.createElement(a,i),w.currentNode=this.el.content,e===2){const u=this.el.content,v=u.firstChild;v.remove(),u.append(...v.childNodes)}for(;(s=w.nextNode())!==null&&l.length<h;){if(s.nodeType===1){if(s.hasAttributes()){const u=[];for(const v of s.getAttributeNames())if(v.endsWith(q)||v.startsWith(_)){const y=c[o++];if(u.push(v),y!==void 0){const Dt=s.getAttribute(y.toLowerCase()+q).split(_),R=/([.?@])?(.*)/.exec(y);l.push({type:1,index:n,name:R[2],strings:Dt,ctor:R[1]==="."?St:R[1]==="?"?Ht:R[1]==="@"?Ut:L})}else l.push({type:6,index:n})}for(const v of u)s.removeAttribute(v)}if(ht.test(s.tagName)){const u=s.textContent.split(_),v=u.length-1;if(v>0){s.textContent=E?E.emptyScript:"";for(let y=0;y<v;y++)s.append(u[y],U()),w.nextNode(),l.push({type:2,index:++n});s.append(u[v],U())}}}else if(s.nodeType===8)if(s.data===st)l.push({type:2,index:n});else{let u=-1;for(;(u=s.data.indexOf(_,u+1))!==-1;)l.push({type:7,index:n}),u+=_.length-1}n++}}static createElement(t,e){const i=A.createElement("template");return i.innerHTML=t,i}}function C(r,t,e=r,i){var s,n,o,h;if(t===S)return t;let l=i!==void 0?(s=e._$Co)===null||s===void 0?void 0:s[i]:e._$Cl;const a=P(t)?void 0:t._$litDirective$;return(l==null?void 0:l.constructor)!==a&&((n=l==null?void 0:l._$AO)===null||n===void 0||n.call(l,!1),a===void 0?l=void 0:(l=new a(r),l._$AT(r,e,i)),i!==void 0?((o=(h=e)._$Co)!==null&&o!==void 0?o:h._$Co=[])[i]=l:e._$Cl=l),l!==void 0&&(t=C(r,l._$AS(r,t.values),l,i)),t}class Et{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var e;const{el:{content:i},parts:s}=this._$AD,n=((e=t==null?void 0:t.creationScope)!==null&&e!==void 0?e:A).importNode(i,!0);w.currentNode=n;let o=w.nextNode(),h=0,l=0,a=s[0];for(;a!==void 0;){if(h===a.index){let c;a.type===2?c=new O(o,o.nextSibling,this,t):a.type===1?c=new a.ctor(o,a.name,a.strings,this,t):a.type===6&&(c=new Pt(o,this,t)),this._$AV.push(c),a=s[++l]}h!==(a==null?void 0:a.index)&&(o=w.nextNode(),h++)}return w.currentNode=A,n}v(t){let e=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class O{constructor(t,e,i,s){var n;this.type=2,this._$AH=$,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cp=(n=s==null?void 0:s.isConnected)===null||n===void 0||n}get _$AU(){var t,e;return(e=(t=this._$AM)===null||t===void 0?void 0:t._$AU)!==null&&e!==void 0?e:this._$Cp}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=C(this,t,e),P(t)?t===$||t==null||t===""?(this._$AH!==$&&this._$AR(),this._$AH=$):t!==this._$AH&&t!==S&&this._(t):t._$litType$!==void 0?this.g(t):t.nodeType!==void 0?this.$(t):At(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==$&&P(this._$AH)?this._$AA.nextSibling.data=t:this.$(A.createTextNode(t)),this._$AH=t}g(t){var e;const{values:i,_$litType$:s}=t,n=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=T.createElement(ct(s.h,s.h[0]),this.options)),s);if(((e=this._$AH)===null||e===void 0?void 0:e._$AD)===n)this._$AH.v(i);else{const o=new Et(n,this),h=o.u(this.options);o.v(i),this.$(h),this._$AH=o}}_$AC(t){let e=dt.get(t.strings);return e===void 0&&dt.set(t.strings,e=new T(t)),e}T(t){rt(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const n of t)s===e.length?e.push(i=new O(this.k(U()),this.k(U()),this,this.options)):i=e[s],i._$AI(n),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var i;for((i=this._$AP)===null||i===void 0||i.call(this,!1,!0,e);t&&t!==this._$AB;){const s=t.nextSibling;t.remove(),t=s}}setConnected(t){var e;this._$AM===void 0&&(this._$Cp=t,(e=this._$AP)===null||e===void 0||e.call(this,t))}}class L{constructor(t,e,i,s,n){this.type=1,this._$AH=$,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=n,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=$}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,s){const n=this.strings;let o=!1;if(n===void 0)t=C(this,t,e,0),o=!P(t)||t!==this._$AH&&t!==S,o&&(this._$AH=t);else{const h=t;let l,a;for(t=n[0],l=0;l<n.length-1;l++)a=C(this,h[i+l],e,l),a===S&&(a=this._$AH[l]),o||(o=!P(a)||a!==this._$AH[l]),a===$?t=$:t!==$&&(t+=(a??"")+n[l+1]),this._$AH[l]=a}o&&!s&&this.j(t)}j(t){t===$?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class St extends L{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===$?void 0:t}}const Ct=E?E.emptyScript:"";class Ht extends L{constructor(){super(...arguments),this.type=4}j(t){t&&t!==$?this.element.setAttribute(this.name,Ct):this.element.removeAttribute(this.name)}}class Ut extends L{constructor(t,e,i,s,n){super(t,e,i,s,n),this.type=5}_$AI(t,e=this){var i;if((t=(i=C(this,t,e,0))!==null&&i!==void 0?i:$)===S)return;const s=this._$AH,n=t===$&&s!==$||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,o=t!==$&&(s===$||n);n&&this.element.removeEventListener(this.name,this,s),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;typeof this._$AH=="function"?this._$AH.call((i=(e=this.options)===null||e===void 0?void 0:e.host)!==null&&i!==void 0?i:this.element,t):this._$AH.handleEvent(t)}}class Pt{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){C(this,t)}}const ut=V.litHtmlPolyfillSupport;ut==null||ut(T,O),((z=V.litHtmlVersions)!==null&&z!==void 0?z:V.litHtmlVersions=[]).push("2.8.0");const Mt=(r,t,e)=>{var i,s;const n=(i=e==null?void 0:e.renderBefore)!==null&&i!==void 0?i:t;let o=n._$litPart$;if(o===void 0){const h=(s=e==null?void 0:e.renderBefore)!==null&&s!==void 0?s:null;n._$litPart$=o=new O(t.insertBefore(U(),h),h,void 0,e??{})}return o._$AI(r),o};/**
16
16
  * @license
17
17
  * Copyright 2017 Google LLC
18
18
  * SPDX-License-Identifier: BSD-3-Clause
19
- */var K,Z;class H extends w{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return(t=(e=this.renderOptions).renderBefore)!==null&&t!==void 0||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Ot(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)===null||t===void 0||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)===null||t===void 0||t.setConnected(!1)}render(){return E}}H.finalized=!0,H._$litElement$=!0,(K=globalThis.litElementHydrateSupport)===null||K===void 0||K.call(globalThis,{LitElement:H});const ut=globalThis.litElementPolyfillSupport;ut==null||ut({LitElement:H}),((Z=globalThis.litElementVersions)!==null&&Z!==void 0?Z:globalThis.litElementVersions=[]).push("3.3.2");/**
20
- * @license
21
- * Copyright 2017 Google LLC
22
- * SPDX-License-Identifier: BSD-3-Clause
23
- */const Tt=o=>t=>typeof t=="function"?((e,i)=>(customElements.define(e,i),i))(o,t):((e,i)=>{const{kind:s,elements:n}=i;return{kind:s,elements:n,finisher(r){customElements.define(e,r)}}})(o,t);/**
24
- * @license
25
- * Copyright 2017 Google LLC
26
- * SPDX-License-Identifier: BSD-3-Clause
27
- */const Pt=(o,t)=>t.kind==="method"&&t.descriptor&&!("value"in t.descriptor)?{...t,finisher(e){e.createProperty(t.key,o)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:t.key,initializer(){typeof t.initializer=="function"&&(this[t.key]=t.initializer.call(this))},finisher(e){e.createProperty(t.key,o)}},Dt=(o,t,e)=>{t.constructor.createProperty(e,o)};function U(o){return(t,e)=>e!==void 0?Dt(o,t,e):Pt(o,t)}/**
28
- * @license
29
- * Copyright 2017 Google LLC
30
- * SPDX-License-Identifier: BSD-3-Clause
31
- */function S(o){return U({...o,state:!0})}/**
32
- * @license
33
- * Copyright 2021 Google LLC
34
- * SPDX-License-Identifier: BSD-3-Clause
35
- */var J;((J=window.HTMLSlotElement)===null||J===void 0?void 0:J.prototype.assignedElements)!=null;const Ht=`
19
+ */var Z,J;class D extends x{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return(t=(e=this.renderOptions).renderBefore)!==null&&t!==void 0||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Mt(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)===null||t===void 0||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)===null||t===void 0||t.setConnected(!1)}render(){return S}}D.finalized=!0,D._$litElement$=!0,(Z=globalThis.litElementHydrateSupport)===null||Z===void 0||Z.call(globalThis,{LitElement:D});const pt=globalThis.litElementPolyfillSupport;pt==null||pt({LitElement:D}),((J=globalThis.litElementVersions)!==null&&J!==void 0?J:globalThis.litElementVersions=[]).push("3.3.2");const Tt=`
36
20
  :host {
37
21
  display: block;
38
22
  }
39
- `,Ut=`
23
+ `,Ot=`
40
24
  * {
41
25
  font-family: Roboto, sans-serif;
42
26
  }
@@ -49,6 +33,7 @@ button {
49
33
  --error-color: #FF5252;
50
34
 
51
35
  display: inline-flex;
36
+ position: relative;
52
37
  align-items: center;
53
38
  color: #fff;
54
39
  border-width: 0;
@@ -68,7 +53,7 @@ button {
68
53
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
69
54
  }
70
55
 
71
- button:hover {
56
+ button:hover:not([disabled]):not(.icon) {
72
57
  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);
73
58
  background: var(--primary-color-hover);
74
59
  }
@@ -77,6 +62,10 @@ button, button:active {
77
62
  background: var(--primary-color);
78
63
  }
79
64
 
65
+ button[disabled] {
66
+ opacity: 0.5;
67
+ }
68
+
80
69
  button.outline {
81
70
  background: transparent;
82
71
  box-shadow: none;
@@ -95,6 +84,8 @@ button.icon {
95
84
  padding: 0;
96
85
  border-radius: 50%;
97
86
  width: 24px;
87
+ height: 24px;
88
+ text-indent: -9999px;
98
89
  }
99
90
 
100
91
  button.icon-text {
@@ -118,36 +109,42 @@ button.icon-text:before {
118
109
  height: 18px;
119
110
  }
120
111
 
112
+ button.small {
113
+ height: 28px;
114
+ padding: 12.4px;
115
+ font-size: .75rem;
116
+ }
117
+
121
118
 
122
- button.discard {
123
- background: var(--error-color);
119
+ button.discard:before {
120
+ 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")
124
121
  }
125
122
 
126
123
  button.polygon:before {
127
- content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 24 24'%3E%3Ctitle%3Eshape-polygon-plus%3C/title%3E%3Cpath d='M17,15.7V13H19V17L10,21L3,14L7,5H11V7H8.3L5.4,13.6L10.4,18.6L17,15.7M22,5V7H19V10H17V7H14V5H17V2H19V5H22Z' /%3E%3C/svg%3E");
124
+ content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23004170' viewBox='0 0 24 24'%3E%3Ctitle%3Eshape-polygon-plus%3C/title%3E%3Cpath d='M17,15.7V13H19V17L10,21L3,14L7,5H11V7H8.3L5.4,13.6L10.4,18.6L17,15.7M22,5V7H19V10H17V7H14V5H17V2H19V5H22Z' /%3E%3C/svg%3E");
128
125
  }
129
- `;var Mt=Object.defineProperty,kt=Object.getOwnPropertyDescriptor,_=(o,t,e,i)=>{for(var s=i>1?void 0:i?kt(t,e):t,n=o.length-1,r;n>=0;n--)(r=o[n])&&(s=(i?r(t,e,s):r(s))||s);return i&&s&&Mt(t,e,s),s};p.EOxDrawTools=class extends H{constructor(){super(...arguments),this._drawnFeatures=[]}_startDrawing(){this._eoxMap.addDraw(this._layerId,{id:"drawInteraction",type:"Polygon"}),this._draw=this._eoxMap.interactions.drawInteraction,this._modify=this._eoxMap.interactions.drawInteraction_modify,this._draw.on("drawend",t=>this._onDrawEnd(t)),this._modify.on("modifyend",t=>this._onModifyEnd(t)),this._currentlyDrawing=!0,this.requestUpdate()}_discardDrawing(){this._drawnFeatures=[],this._eoxMap.removeInteraction("drawInteraction"),this._drawLayer.getSource().clear(),this._currentlyDrawing=!1,this.requestUpdate()}_onDrawEnd(t){console.log(t),this._emitDrawnFeatures(),this._eoxMap.removeInteraction("drawInteraction"),this._currentlyDrawing=!1,this.requestUpdate()}_onModifyEnd(t){console.log(t),this._emitDrawnFeatures()}_emitDrawnFeatures(){setTimeout(()=>{this._drawnFeatures=this._drawLayer.getSource().getFeatures(),this.requestUpdate();const t=new CustomEvent("drawupdate",{detail:this._drawnFeatures});this.dispatchEvent(t)},0)}render(){const t=document.querySelector(this.for);return this._eoxMap=t,this._olMap=t.map,this._layerId=this.layer,this._drawLayer=this._olMap.getLayers().getArray().find(e=>e.get("id")===this._layerId),this.requestUpdate(),mt`
126
+ `;class $t extends D{constructor(){super();K(this,g,void 0);K(this,k,void 0);this.for="eox-map",this.currentlyDrawing=!1,this.draw=null,this.drawLayer=null,this.drawnFeatures=[],this.layer="draw",this.modify=null,this.multipleFeatures=!1,this.unstyled=!1}static get properties(){return{for:{type:String},currentlyDrawing:{attribute:!1,state:!0,type:Boolean},draw:{attribute:!1,state:!0},drawLayer:{attribute:!1,state:!0},drawnFeatures:{attribute:!1,state:!0,type:Array},layer:{type:String},modify:{attribute:!1,state:!0},multipleFeatures:{attribute:"multiple-features",type:Boolean},unstyled:{type:Boolean}}}startDrawing(){var e,i;m(this,g).addDraw(this.layer,{id:"drawInteraction",type:"Polygon",stopClick:!0}),this.draw=m(this,g).interactions.drawInteraction,this.modify=m(this,g).interactions.drawInteractionmodify,(e=this.draw)==null||e.on("drawend",s=>this.onDrawEnd(s)),(i=this.modify)==null||i.on("modifyend",s=>this.onModifyEnd(s)),this.currentlyDrawing=!0,this.requestUpdate()}discardDrawing(){this.drawnFeatures=[],m(this,g).removeInteraction("drawInteraction"),this.drawLayer.getSource().clear(),this.emitDrawnFeatures(),this.currentlyDrawing=!1,this.requestUpdate()}onDrawEnd(){this.emitDrawnFeatures(),m(this,g).removeInteraction("drawInteraction"),this.currentlyDrawing=!1,this.requestUpdate()}onModifyEnd(){this.emitDrawnFeatures()}emitDrawnFeatures(){setTimeout(()=>{this.drawnFeatures=this.drawLayer.getSource().getFeatures(),this.requestUpdate(),this.dispatchEvent(new CustomEvent("drawupdate",{detail:this.drawnFeatures}))},0)}render(){var i,s;const e=document.querySelector(this.for);return Q(this,g,e),Q(this,k,m(this,g).map),this.drawLayer=m(this,k).getLayers().getArray().find(n=>n.get("id")===this.layer),this.requestUpdate(),wt`
130
127
  <style>
131
- ${Ht}
132
- ${!this.unstyled&&Ut}
128
+ ${Tt}
129
+ ${!this.unstyled&&Ot}
133
130
  </style>
134
131
  <div>
135
132
  <slot></slot>
136
133
  <button
137
134
  data-cy="drawBtn"
138
- class="icon-text polygon"
139
- disabled="${!this.multipleFeatures&&this._drawnFeatures.length||this._currentlyDrawing||d}"
140
- @click="${()=>this._startDrawing()}"
135
+ class="polygon icon"
136
+ disabled="${!this.multipleFeatures&&((i=this.drawnFeatures)==null?void 0:i.length)>0||this.currentlyDrawing||$}"
137
+ @click="${()=>this.startDrawing()}"
141
138
  >
142
- ${this._currentlyDrawing?"drawing":"draw"}
139
+ ${this.currentlyDrawing?"drawing":"draw"}
143
140
  </button>
144
141
  <button
145
142
  data-cy="discardBtn"
146
- class="discard"
147
- disabled="${!this._drawnFeatures.length&&!this._currentlyDrawing||d}"
148
- @click="${()=>this._discardDrawing()}"
143
+ class="discard icon"
144
+ disabled="${!((s=this.drawnFeatures)!=null&&s.length)&&!this.currentlyDrawing||$}"
145
+ @click="${()=>this.discardDrawing()}"
149
146
  >
150
147
  discard
151
148
  </button>
152
149
  </div>
153
- `}},_([S()],p.EOxDrawTools.prototype,"_layerId",2),_([S()],p.EOxDrawTools.prototype,"_eoxMap",2),_([S()],p.EOxDrawTools.prototype,"_olMap",2),_([S()],p.EOxDrawTools.prototype,"_drawLayer",2),_([S()],p.EOxDrawTools.prototype,"_drawnFeatures",2),_([S()],p.EOxDrawTools.prototype,"_currentlyDrawing",2),_([U({type:Boolean})],p.EOxDrawTools.prototype,"multipleFeatures",2),_([U()],p.EOxDrawTools.prototype,"for",2),_([U()],p.EOxDrawTools.prototype,"layer",2),_([U({type:Boolean})],p.EOxDrawTools.prototype,"unstyled",2),p.EOxDrawTools=_([Tt("eox-drawtools")],p.EOxDrawTools),Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})});
150
+ `}}g=new WeakMap,k=new WeakMap,customElements.define("eox-drawtools",$t),p.EOxDrawTools=$t,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@eox/drawtools",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "type": "module",
5
5
  "devDependencies": {
6
6
  "@eox/eslint-config": "^1.0.0",
7
- "@typescript-eslint/eslint-plugin": "^5.50.0",
7
+ "@typescript-eslint/eslint-plugin": "^6.8.0",
8
8
  "@typescript-eslint/parser": "^5.50.0",
9
9
  "eslint-plugin-typescript": "^0.14.0",
10
- "ol": "^7.3.0",
11
- "typescript": "^4.9.3",
10
+ "ol": "^8.1.0",
11
+ "typescript": "^5.2.2",
12
12
  "vite": "^4.0.0"
13
13
  },
14
14
  "engines": {
@@ -21,12 +21,12 @@
21
21
  ],
22
22
  "main": "./dist/eox-drawtools.js",
23
23
  "scripts": {
24
- "start": "vite",
25
- "build": "tsc && vite build",
26
- "watch": "tsc && vite build --watch",
24
+ "build": "vite build",
25
+ "watch": "vite build --watch",
27
26
  "format": "prettier --write .",
28
27
  "lint": "eslint --ext .js,.ts .",
29
- "lint:fix": "eslint --ext .js,.ts . --fix"
28
+ "lint:fix": "eslint --ext .js,.ts . --fix",
29
+ "typecheck": "tsc"
30
30
  },
31
31
  "dependencies": {
32
32
  "lit": "^2.7.4"
@@ -2,14 +2,17 @@ export class MockMap extends HTMLElement {
2
2
  constructor() {
3
3
  super();
4
4
  }
5
+ features = [{}];
5
6
  map = {
6
7
  getLayers: () => ({
7
8
  getArray: () => [
8
9
  {
9
10
  get: () => "draw",
10
11
  getSource: () => ({
11
- clear: () => ({}),
12
- getFeatures: () => [{}],
12
+ clear: () => {
13
+ this.features = [];
14
+ },
15
+ getFeatures: () => this.features,
13
16
  }),
14
17
  },
15
18
  ],
@@ -18,7 +21,7 @@ export class MockMap extends HTMLElement {
18
21
  addDraw() {}
19
22
  interactions = {
20
23
  drawInteraction: {
21
- on: (event: string, fun: Function) => fun(event),
24
+ on: (event, fun) => fun(event),
22
25
  },
23
26
  drawInteraction_modify: {
24
27
  on() {},
@@ -24,7 +24,7 @@ describe("Drawtools", () => {
24
24
  cy.get("[data-cy='drawBtn']").contains("drawing");
25
25
  });
26
26
  cy.get("eox-drawtools").and(($el) => {
27
- expect((<EOxDrawTools>$el[0])._drawnFeatures).to.have.length(1);
27
+ expect($el[0].drawnFeatures).to.have.length(1);
28
28
  });
29
29
  });
30
30
 
@@ -38,7 +38,7 @@ describe("Drawtools", () => {
38
38
  cy.get("[data-cy='drawBtn']").should("not.contain", "drawing");
39
39
  });
40
40
  cy.get("eox-drawtools").should(($el) => {
41
- expect((<EOxDrawTools>$el[0])._drawnFeatures).to.have.length(0);
41
+ expect($el[0].drawnFeatures).to.have.length(0);
42
42
  });
43
43
  });
44
44
  });