@eox/drawtools 0.6.1 → 0.8.1

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,32 +1,32 @@
1
- var bt = Object.defineProperty;
2
- var wt = (i, t, e) => t in i ? bt(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
- var g = (i, t, e) => (wt(i, typeof t != "symbol" ? t + "" : t, e), e), Q = (i, t, e) => {
1
+ var _t = Object.defineProperty;
2
+ var xt = (i, t, e) => t in i ? _t(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
+ var $ = (i, t, e) => (xt(i, typeof t != "symbol" ? t + "" : t, e), e), Q = (i, t, e) => {
4
4
  if (!t.has(i))
5
5
  throw TypeError("Cannot " + e);
6
6
  };
7
- var m = (i, t, e) => (Q(i, t, "read from private field"), e ? e.call(i) : t.get(i)), H = (i, t, e) => {
7
+ var y = (i, t, e) => (Q(i, t, "read from private field"), e ? e.call(i) : t.get(i)), S = (i, t, e) => {
8
8
  if (t.has(i))
9
9
  throw TypeError("Cannot add the same private member more than once");
10
10
  t instanceof WeakSet ? t.add(i) : t.set(i, e);
11
- }, M = (i, t, e, s) => (Q(i, t, "write to private field"), s ? s.call(i, e) : t.set(i, e), e);
11
+ }, E = (i, t, e, r) => (Q(i, t, "write to private field"), r ? r.call(i, e) : t.set(i, e), e);
12
12
  /**
13
13
  * @license
14
14
  * Copyright 2019 Google LLC
15
15
  * SPDX-License-Identifier: BSD-3-Clause
16
16
  */
17
- const R = globalThis, J = R.ShadowRoot && (R.ShadyCSS === void 0 || R.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, dt = Symbol(), X = /* @__PURE__ */ new WeakMap();
17
+ const D = globalThis, K = D.ShadowRoot && (D.ShadyCSS === void 0 || D.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, pt = Symbol(), X = /* @__PURE__ */ new WeakMap();
18
18
  let At = class {
19
- constructor(t, e, s) {
20
- if (this._$cssResult$ = !0, s !== dt)
19
+ constructor(t, e, r) {
20
+ if (this._$cssResult$ = !0, r !== pt)
21
21
  throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
22
22
  this.cssText = t, this.t = e;
23
23
  }
24
24
  get styleSheet() {
25
25
  let t = this.o;
26
26
  const e = this.t;
27
- if (J && t === void 0) {
28
- const s = e !== void 0 && e.length === 1;
29
- s && (t = X.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && X.set(e, t));
27
+ if (K && t === void 0) {
28
+ const r = e !== void 0 && e.length === 1;
29
+ r && (t = X.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), r && X.set(e, t));
30
30
  }
31
31
  return t;
32
32
  }
@@ -34,29 +34,29 @@ let At = class {
34
34
  return this.cssText;
35
35
  }
36
36
  };
37
- const vt = (i) => new At(typeof i == "string" ? i : i + "", void 0, dt), xt = (i, t) => {
38
- if (J)
37
+ const St = (i) => new At(typeof i == "string" ? i : i + "", void 0, pt), Et = (i, t) => {
38
+ if (K)
39
39
  i.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
40
40
  else
41
41
  for (const e of t) {
42
- const s = document.createElement("style"), r = R.litNonce;
43
- r !== void 0 && s.setAttribute("nonce", r), s.textContent = e.cssText, i.appendChild(s);
42
+ const r = document.createElement("style"), s = D.litNonce;
43
+ s !== void 0 && r.setAttribute("nonce", s), r.textContent = e.cssText, i.appendChild(r);
44
44
  }
45
- }, Y = J ? (i) => i : (i) => i instanceof CSSStyleSheet ? ((t) => {
45
+ }, Y = K ? (i) => i : (i) => i instanceof CSSStyleSheet ? ((t) => {
46
46
  let e = "";
47
- for (const s of t.cssRules)
48
- e += s.cssText;
49
- return vt(e);
47
+ for (const r of t.cssRules)
48
+ e += r.cssText;
49
+ return St(e);
50
50
  })(i) : i;
51
51
  /**
52
52
  * @license
53
53
  * Copyright 2017 Google LLC
54
54
  * SPDX-License-Identifier: BSD-3-Clause
55
55
  */
56
- const { is: St, defineProperty: Ct, getOwnPropertyDescriptor: Et, getOwnPropertyNames: Ht, getOwnPropertySymbols: Mt, getPrototypeOf: kt } = Object, f = globalThis, tt = f.trustedTypes, Ft = tt ? tt.emptyScript : "", j = f.reactiveElementPolyfillSupport, F = (i, t) => i, G = { toAttribute(i, t) {
56
+ const { is: Ct, defineProperty: Ft, getOwnPropertyDescriptor: Ht, getOwnPropertyNames: kt, getOwnPropertySymbols: Mt, getPrototypeOf: Ut } = Object, b = globalThis, tt = b.trustedTypes, Pt = tt ? tt.emptyScript : "", q = b.reactiveElementPolyfillSupport, M = (i, t) => i, Z = { toAttribute(i, t) {
57
57
  switch (t) {
58
58
  case Boolean:
59
- i = i ? Ft : null;
59
+ i = i ? Pt : null;
60
60
  break;
61
61
  case Object:
62
62
  case Array:
@@ -81,9 +81,9 @@ const { is: St, defineProperty: Ct, getOwnPropertyDescriptor: Et, getOwnProperty
81
81
  }
82
82
  }
83
83
  return e;
84
- } }, ct = (i, t) => !St(i, t), et = { attribute: !0, type: String, converter: G, reflect: !1, hasChanged: ct };
85
- Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), f.litPropertyMetadata ?? (f.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
86
- class v extends HTMLElement {
84
+ } }, ut = (i, t) => !Ct(i, t), et = { attribute: !0, type: String, converter: Z, reflect: !1, hasChanged: ut };
85
+ Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), b.litPropertyMetadata ?? (b.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
86
+ class C extends HTMLElement {
87
87
  static addInitializer(t) {
88
88
  this._$Ei(), (this.l ?? (this.l = [])).push(t);
89
89
  }
@@ -92,143 +92,143 @@ class v extends HTMLElement {
92
92
  }
93
93
  static createProperty(t, e = et) {
94
94
  if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
95
- const s = Symbol(), r = this.getPropertyDescriptor(t, s, e);
96
- r !== void 0 && Ct(this.prototype, t, r);
95
+ const r = Symbol(), s = this.getPropertyDescriptor(t, r, e);
96
+ s !== void 0 && Ft(this.prototype, t, s);
97
97
  }
98
98
  }
99
- static getPropertyDescriptor(t, e, s) {
100
- const { get: r, set: n } = Et(this.prototype, t) ?? { get() {
99
+ static getPropertyDescriptor(t, e, r) {
100
+ const { get: s, set: n } = Ht(this.prototype, t) ?? { get() {
101
101
  return this[e];
102
102
  }, set(o) {
103
103
  this[e] = o;
104
104
  } };
105
105
  return { get() {
106
- return r == null ? void 0 : r.call(this);
106
+ return s == null ? void 0 : s.call(this);
107
107
  }, set(o) {
108
- const l = r == null ? void 0 : r.call(this);
109
- n.call(this, o), this.requestUpdate(t, l, s);
108
+ const l = s == null ? void 0 : s.call(this);
109
+ n.call(this, o), this.requestUpdate(t, l, r);
110
110
  }, configurable: !0, enumerable: !0 };
111
111
  }
112
112
  static getPropertyOptions(t) {
113
113
  return this.elementProperties.get(t) ?? et;
114
114
  }
115
115
  static _$Ei() {
116
- if (this.hasOwnProperty(F("elementProperties")))
116
+ if (this.hasOwnProperty(M("elementProperties")))
117
117
  return;
118
- const t = kt(this);
118
+ const t = Ut(this);
119
119
  t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
120
120
  }
121
121
  static finalize() {
122
- if (this.hasOwnProperty(F("finalized")))
122
+ if (this.hasOwnProperty(M("finalized")))
123
123
  return;
124
- if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(F("properties"))) {
125
- const e = this.properties, s = [...Ht(e), ...Mt(e)];
126
- for (const r of s)
127
- this.createProperty(r, e[r]);
124
+ if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(M("properties"))) {
125
+ const e = this.properties, r = [...kt(e), ...Mt(e)];
126
+ for (const s of r)
127
+ this.createProperty(s, e[s]);
128
128
  }
129
129
  const t = this[Symbol.metadata];
130
130
  if (t !== null) {
131
131
  const e = litPropertyMetadata.get(t);
132
132
  if (e !== void 0)
133
- for (const [s, r] of e)
134
- this.elementProperties.set(s, r);
133
+ for (const [r, s] of e)
134
+ this.elementProperties.set(r, s);
135
135
  }
136
136
  this._$Eh = /* @__PURE__ */ new Map();
137
- for (const [e, s] of this.elementProperties) {
138
- const r = this._$Eu(e, s);
139
- r !== void 0 && this._$Eh.set(r, e);
137
+ for (const [e, r] of this.elementProperties) {
138
+ const s = this._$Eu(e, r);
139
+ s !== void 0 && this._$Eh.set(s, e);
140
140
  }
141
141
  this.elementStyles = this.finalizeStyles(this.styles);
142
142
  }
143
143
  static finalizeStyles(t) {
144
144
  const e = [];
145
145
  if (Array.isArray(t)) {
146
- const s = new Set(t.flat(1 / 0).reverse());
147
- for (const r of s)
148
- e.unshift(Y(r));
146
+ const r = new Set(t.flat(1 / 0).reverse());
147
+ for (const s of r)
148
+ e.unshift(Y(s));
149
149
  } else
150
150
  t !== void 0 && e.push(Y(t));
151
151
  return e;
152
152
  }
153
153
  static _$Eu(t, e) {
154
- const s = e.attribute;
155
- return s === !1 ? void 0 : typeof s == "string" ? s : typeof t == "string" ? t.toLowerCase() : void 0;
154
+ const r = e.attribute;
155
+ return r === !1 ? void 0 : typeof r == "string" ? r : typeof t == "string" ? t.toLowerCase() : void 0;
156
156
  }
157
157
  constructor() {
158
158
  super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
159
159
  }
160
160
  _$Ev() {
161
161
  var t;
162
- this._$Eg = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), (t = this.constructor.l) == null || t.forEach((e) => e(this));
162
+ this._$ES = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), (t = this.constructor.l) == null || t.forEach((e) => e(this));
163
163
  }
164
164
  addController(t) {
165
165
  var e;
166
- (this._$ES ?? (this._$ES = [])).push(t), this.renderRoot !== void 0 && this.isConnected && ((e = t.hostConnected) == null || e.call(t));
166
+ (this._$EO ?? (this._$EO = /* @__PURE__ */ new Set())).add(t), this.renderRoot !== void 0 && this.isConnected && ((e = t.hostConnected) == null || e.call(t));
167
167
  }
168
168
  removeController(t) {
169
169
  var e;
170
- (e = this._$ES) == null || e.splice(this._$ES.indexOf(t) >>> 0, 1);
170
+ (e = this._$EO) == null || e.delete(t);
171
171
  }
172
172
  _$E_() {
173
173
  const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
174
- for (const s of e.keys())
175
- this.hasOwnProperty(s) && (t.set(s, this[s]), delete this[s]);
174
+ for (const r of e.keys())
175
+ this.hasOwnProperty(r) && (t.set(r, this[r]), delete this[r]);
176
176
  t.size > 0 && (this._$Ep = t);
177
177
  }
178
178
  createRenderRoot() {
179
179
  const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
180
- return xt(t, this.constructor.elementStyles), t;
180
+ return Et(t, this.constructor.elementStyles), t;
181
181
  }
182
182
  connectedCallback() {
183
183
  var t;
184
- this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$ES) == null || t.forEach((e) => {
185
- var s;
186
- return (s = e.hostConnected) == null ? void 0 : s.call(e);
184
+ this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$EO) == null || t.forEach((e) => {
185
+ var r;
186
+ return (r = e.hostConnected) == null ? void 0 : r.call(e);
187
187
  });
188
188
  }
189
189
  enableUpdating(t) {
190
190
  }
191
191
  disconnectedCallback() {
192
192
  var t;
193
- (t = this._$ES) == null || t.forEach((e) => {
194
- var s;
195
- return (s = e.hostDisconnected) == null ? void 0 : s.call(e);
193
+ (t = this._$EO) == null || t.forEach((e) => {
194
+ var r;
195
+ return (r = e.hostDisconnected) == null ? void 0 : r.call(e);
196
196
  });
197
197
  }
198
- attributeChangedCallback(t, e, s) {
199
- this._$AK(t, s);
198
+ attributeChangedCallback(t, e, r) {
199
+ this._$AK(t, r);
200
200
  }
201
- _$EO(t, e) {
201
+ _$EC(t, e) {
202
202
  var n;
203
- const s = this.constructor.elementProperties.get(t), r = this.constructor._$Eu(t, s);
204
- if (r !== void 0 && s.reflect === !0) {
205
- const o = (((n = s.converter) == null ? void 0 : n.toAttribute) !== void 0 ? s.converter : G).toAttribute(e, s.type);
206
- this._$Em = t, o == null ? this.removeAttribute(r) : this.setAttribute(r, o), this._$Em = null;
203
+ const r = this.constructor.elementProperties.get(t), s = this.constructor._$Eu(t, r);
204
+ if (s !== void 0 && r.reflect === !0) {
205
+ const o = (((n = r.converter) == null ? void 0 : n.toAttribute) !== void 0 ? r.converter : Z).toAttribute(e, r.type);
206
+ this._$Em = t, o == null ? this.removeAttribute(s) : this.setAttribute(s, o), this._$Em = null;
207
207
  }
208
208
  }
209
209
  _$AK(t, e) {
210
210
  var n;
211
- const s = this.constructor, r = s._$Eh.get(t);
212
- if (r !== void 0 && this._$Em !== r) {
213
- const o = s.getPropertyOptions(r), l = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((n = o.converter) == null ? void 0 : n.fromAttribute) !== void 0 ? o.converter : G;
214
- this._$Em = r, this[r] = l.fromAttribute(e, o.type), this._$Em = null;
211
+ const r = this.constructor, s = r._$Eh.get(t);
212
+ if (s !== void 0 && this._$Em !== s) {
213
+ const o = r.getPropertyOptions(s), l = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((n = o.converter) == null ? void 0 : n.fromAttribute) !== void 0 ? o.converter : Z;
214
+ this._$Em = s, this[s] = l.fromAttribute(e, o.type), this._$Em = null;
215
215
  }
216
216
  }
217
- requestUpdate(t, e, s, r = !1, n) {
217
+ requestUpdate(t, e, r) {
218
218
  if (t !== void 0) {
219
- if (s ?? (s = this.constructor.getPropertyOptions(t)), !(s.hasChanged ?? ct)(r ? n : this[t], e))
219
+ if (r ?? (r = this.constructor.getPropertyOptions(t)), !(r.hasChanged ?? ut)(this[t], e))
220
220
  return;
221
- this.C(t, e, s);
221
+ this.P(t, e, r);
222
222
  }
223
- this.isUpdatePending === !1 && (this._$Eg = this._$EP());
223
+ this.isUpdatePending === !1 && (this._$ES = this._$ET());
224
224
  }
225
- C(t, e, s) {
226
- this._$AL.has(t) || this._$AL.set(t, e), s.reflect === !0 && this._$Em !== t && (this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Set())).add(t);
225
+ P(t, e, r) {
226
+ this._$AL.has(t) || this._$AL.set(t, e), r.reflect === !0 && this._$Em !== t && (this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Set())).add(t);
227
227
  }
228
- async _$EP() {
228
+ async _$ET() {
229
229
  this.isUpdatePending = !0;
230
230
  try {
231
- await this._$Eg;
231
+ await this._$ES;
232
232
  } catch (e) {
233
233
  Promise.reject(e);
234
234
  }
@@ -239,29 +239,29 @@ class v extends HTMLElement {
239
239
  return this.performUpdate();
240
240
  }
241
241
  performUpdate() {
242
- var s;
242
+ var r;
243
243
  if (!this.isUpdatePending)
244
244
  return;
245
245
  if (!this.hasUpdated) {
246
- if (this._$Ep) {
246
+ if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
247
247
  for (const [n, o] of this._$Ep)
248
248
  this[n] = o;
249
249
  this._$Ep = void 0;
250
250
  }
251
- const r = this.constructor.elementProperties;
252
- if (r.size > 0)
253
- for (const [n, o] of r)
254
- o.wrapped !== !0 || this._$AL.has(n) || this[n] === void 0 || this.C(n, this[n], o);
251
+ const s = this.constructor.elementProperties;
252
+ if (s.size > 0)
253
+ for (const [n, o] of s)
254
+ o.wrapped !== !0 || this._$AL.has(n) || this[n] === void 0 || this.P(n, this[n], o);
255
255
  }
256
256
  let t = !1;
257
257
  const e = this._$AL;
258
258
  try {
259
- t = this.shouldUpdate(e), t ? (this.willUpdate(e), (s = this._$ES) == null || s.forEach((r) => {
259
+ t = this.shouldUpdate(e), t ? (this.willUpdate(e), (r = this._$EO) == null || r.forEach((s) => {
260
260
  var n;
261
- return (n = r.hostUpdate) == null ? void 0 : n.call(r);
262
- }), this.update(e)) : this._$ET();
263
- } catch (r) {
264
- throw t = !1, this._$ET(), r;
261
+ return (n = s.hostUpdate) == null ? void 0 : n.call(s);
262
+ }), this.update(e)) : this._$EU();
263
+ } catch (s) {
264
+ throw t = !1, this._$EU(), s;
265
265
  }
266
266
  t && this._$AE(e);
267
267
  }
@@ -269,109 +269,109 @@ class v extends HTMLElement {
269
269
  }
270
270
  _$AE(t) {
271
271
  var e;
272
- (e = this._$ES) == null || e.forEach((s) => {
273
- var r;
274
- return (r = s.hostUpdated) == null ? void 0 : r.call(s);
272
+ (e = this._$EO) == null || e.forEach((r) => {
273
+ var s;
274
+ return (s = r.hostUpdated) == null ? void 0 : s.call(r);
275
275
  }), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
276
276
  }
277
- _$ET() {
277
+ _$EU() {
278
278
  this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
279
279
  }
280
280
  get updateComplete() {
281
281
  return this.getUpdateComplete();
282
282
  }
283
283
  getUpdateComplete() {
284
- return this._$Eg;
284
+ return this._$ES;
285
285
  }
286
286
  shouldUpdate(t) {
287
287
  return !0;
288
288
  }
289
289
  update(t) {
290
- this._$Ej && (this._$Ej = this._$Ej.forEach((e) => this._$EO(e, this[e]))), this._$ET();
290
+ this._$Ej && (this._$Ej = this._$Ej.forEach((e) => this._$EC(e, this[e]))), this._$EU();
291
291
  }
292
292
  updated(t) {
293
293
  }
294
294
  firstUpdated(t) {
295
295
  }
296
296
  }
297
- v.elementStyles = [], v.shadowRootOptions = { mode: "open" }, v[F("elementProperties")] = /* @__PURE__ */ new Map(), v[F("finalized")] = /* @__PURE__ */ new Map(), j == null || j({ ReactiveElement: v }), (f.reactiveElementVersions ?? (f.reactiveElementVersions = [])).push("2.0.1");
297
+ C.elementStyles = [], C.shadowRootOptions = { mode: "open" }, C[M("elementProperties")] = /* @__PURE__ */ new Map(), C[M("finalized")] = /* @__PURE__ */ new Map(), q == null || q({ ReactiveElement: C }), (b.reactiveElementVersions ?? (b.reactiveElementVersions = [])).push("2.0.4");
298
298
  /**
299
299
  * @license
300
300
  * Copyright 2017 Google LLC
301
301
  * SPDX-License-Identifier: BSD-3-Clause
302
302
  */
303
- const U = globalThis, z = U.trustedTypes, st = z ? z.createPolicy("lit-html", { createHTML: (i) => i }) : void 0, ut = "$lit$", y = `lit$${(Math.random() + "").slice(9)}$`, pt = "?" + y, Ut = `<${pt}>`, A = document, P = () => A.createComment(""), I = (i) => i === null || typeof i != "object" && typeof i != "function", $t = Array.isArray, Pt = (i) => $t(i) || typeof (i == null ? void 0 : i[Symbol.iterator]) == "function", T = `[
304
- \f\r]`, k = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, it = /-->/g, rt = />/g, _ = RegExp(`>|${T}(?:([^\\s"'>=/]+)(${T}*=${T}*(?:[^
305
- \f\r"'\`<>=]|("|')|))|$)`, "g"), nt = /'/g, ot = /"/g, yt = /^(?:script|style|textarea|title)$/i, It = (i) => (t, ...e) => ({ _$litType$: i, strings: t, values: e }), O = It(1), C = Symbol.for("lit-noChange"), c = Symbol.for("lit-nothing"), at = /* @__PURE__ */ new WeakMap(), b = A.createTreeWalker(A, 129);
306
- function ft(i, t) {
303
+ const U = globalThis, j = U.trustedTypes, it = j ? j.createPolicy("lit-html", { createHTML: (i) => i }) : void 0, yt = "$lit$", f = `lit$${(Math.random() + "").slice(9)}$`, gt = "?" + f, Ot = `<${gt}>`, A = document, P = () => A.createComment(""), O = (i) => i === null || typeof i != "object" && typeof i != "function", ft = Array.isArray, Nt = (i) => ft(i) || typeof (i == null ? void 0 : i[Symbol.iterator]) == "function", T = `[
304
+ \f\r]`, k = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, rt = /-->/g, st = />/g, v = RegExp(`>|${T}(?:([^\\s"'>=/]+)(${T}*=${T}*(?:[^
305
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), nt = /'/g, ot = /"/g, mt = /^(?:script|style|textarea|title)$/i, It = (i) => (t, ...e) => ({ _$litType$: i, strings: t, values: e }), _ = It(1), F = Symbol.for("lit-noChange"), d = Symbol.for("lit-nothing"), at = /* @__PURE__ */ new WeakMap(), w = A.createTreeWalker(A, 129);
306
+ function bt(i, t) {
307
307
  if (!Array.isArray(i) || !i.hasOwnProperty("raw"))
308
308
  throw Error("invalid template strings array");
309
- return st !== void 0 ? st.createHTML(t) : t;
309
+ return it !== void 0 ? it.createHTML(t) : t;
310
310
  }
311
- const Ot = (i, t) => {
312
- const e = i.length - 1, s = [];
313
- let r, n = t === 2 ? "<svg>" : "", o = k;
311
+ const Bt = (i, t) => {
312
+ const e = i.length - 1, r = [];
313
+ let s, n = t === 2 ? "<svg>" : "", o = k;
314
314
  for (let l = 0; l < e; l++) {
315
315
  const a = i[l];
316
- let d, u, h = -1, p = 0;
317
- for (; p < a.length && (o.lastIndex = p, u = o.exec(a), u !== null); )
318
- p = o.lastIndex, o === k ? u[1] === "!--" ? o = it : u[1] !== void 0 ? o = rt : u[2] !== void 0 ? (yt.test(u[2]) && (r = RegExp("</" + u[2], "g")), o = _) : u[3] !== void 0 && (o = _) : o === _ ? u[0] === ">" ? (o = r ?? k, h = -1) : u[1] === void 0 ? h = -2 : (h = o.lastIndex - u[2].length, d = u[1], o = u[3] === void 0 ? _ : u[3] === '"' ? ot : nt) : o === ot || o === nt ? o = _ : o === it || o === rt ? o = k : (o = _, r = void 0);
319
- const $ = o === _ && i[l + 1].startsWith("/>") ? " " : "";
320
- n += o === k ? a + Ut : h >= 0 ? (s.push(d), a.slice(0, h) + ut + a.slice(h) + y + $) : a + y + (h === -2 ? l : $);
316
+ let h, p, c = -1, u = 0;
317
+ for (; u < a.length && (o.lastIndex = u, p = o.exec(a), p !== null); )
318
+ u = o.lastIndex, o === k ? p[1] === "!--" ? o = rt : p[1] !== void 0 ? o = st : p[2] !== void 0 ? (mt.test(p[2]) && (s = RegExp("</" + p[2], "g")), o = v) : p[3] !== void 0 && (o = v) : o === v ? p[0] === ">" ? (o = s ?? k, c = -1) : p[1] === void 0 ? c = -2 : (c = o.lastIndex - p[2].length, h = p[1], o = p[3] === void 0 ? v : p[3] === '"' ? ot : nt) : o === ot || o === nt ? o = v : o === rt || o === st ? o = k : (o = v, s = void 0);
319
+ const g = o === v && i[l + 1].startsWith("/>") ? " " : "";
320
+ n += o === k ? a + Ot : c >= 0 ? (r.push(h), a.slice(0, c) + yt + a.slice(c) + f + g) : a + f + (c === -2 ? l : g);
321
321
  }
322
- return [ft(i, n + (i[e] || "<?>") + (t === 2 ? "</svg>" : "")), s];
322
+ return [bt(i, n + (i[e] || "<?>") + (t === 2 ? "</svg>" : "")), r];
323
323
  };
324
- class L {
325
- constructor({ strings: t, _$litType$: e }, s) {
326
- let r;
324
+ class N {
325
+ constructor({ strings: t, _$litType$: e }, r) {
326
+ let s;
327
327
  this.parts = [];
328
328
  let n = 0, o = 0;
329
- const l = t.length - 1, a = this.parts, [d, u] = Ot(t, e);
330
- if (this.el = L.createElement(d, s), b.currentNode = this.el.content, e === 2) {
331
- const h = this.el.content.firstChild;
332
- h.replaceWith(...h.childNodes);
329
+ const l = t.length - 1, a = this.parts, [h, p] = Bt(t, e);
330
+ if (this.el = N.createElement(h, r), w.currentNode = this.el.content, e === 2) {
331
+ const c = this.el.content.firstChild;
332
+ c.replaceWith(...c.childNodes);
333
333
  }
334
- for (; (r = b.nextNode()) !== null && a.length < l; ) {
335
- if (r.nodeType === 1) {
336
- if (r.hasAttributes())
337
- for (const h of r.getAttributeNames())
338
- if (h.endsWith(ut)) {
339
- const p = u[o++], $ = r.getAttribute(h).split(y), D = /([.?@])?(.*)/.exec(p);
340
- a.push({ type: 1, index: n, name: D[2], strings: $, ctor: D[1] === "." ? Nt : D[1] === "?" ? Bt : D[1] === "@" ? Vt : q }), r.removeAttribute(h);
334
+ for (; (s = w.nextNode()) !== null && a.length < l; ) {
335
+ if (s.nodeType === 1) {
336
+ if (s.hasAttributes())
337
+ for (const c of s.getAttributeNames())
338
+ if (c.endsWith(yt)) {
339
+ const u = p[o++], g = s.getAttribute(c).split(f), z = /([.?@])?(.*)/.exec(u);
340
+ a.push({ type: 1, index: n, name: z[2], strings: g, ctor: z[1] === "." ? Rt : z[1] === "?" ? Vt : z[1] === "@" ? zt : J }), s.removeAttribute(c);
341
341
  } else
342
- h.startsWith(y) && (a.push({ type: 6, index: n }), r.removeAttribute(h));
343
- if (yt.test(r.tagName)) {
344
- const h = r.textContent.split(y), p = h.length - 1;
345
- if (p > 0) {
346
- r.textContent = z ? z.emptyScript : "";
347
- for (let $ = 0; $ < p; $++)
348
- r.append(h[$], P()), b.nextNode(), a.push({ type: 2, index: ++n });
349
- r.append(h[p], P());
342
+ c.startsWith(f) && (a.push({ type: 6, index: n }), s.removeAttribute(c));
343
+ if (mt.test(s.tagName)) {
344
+ const c = s.textContent.split(f), u = c.length - 1;
345
+ if (u > 0) {
346
+ s.textContent = j ? j.emptyScript : "";
347
+ for (let g = 0; g < u; g++)
348
+ s.append(c[g], P()), w.nextNode(), a.push({ type: 2, index: ++n });
349
+ s.append(c[u], P());
350
350
  }
351
351
  }
352
- } else if (r.nodeType === 8)
353
- if (r.data === pt)
352
+ } else if (s.nodeType === 8)
353
+ if (s.data === gt)
354
354
  a.push({ type: 2, index: n });
355
355
  else {
356
- let h = -1;
357
- for (; (h = r.data.indexOf(y, h + 1)) !== -1; )
358
- a.push({ type: 7, index: n }), h += y.length - 1;
356
+ let c = -1;
357
+ for (; (c = s.data.indexOf(f, c + 1)) !== -1; )
358
+ a.push({ type: 7, index: n }), c += f.length - 1;
359
359
  }
360
360
  n++;
361
361
  }
362
362
  }
363
363
  static createElement(t, e) {
364
- const s = A.createElement("template");
365
- return s.innerHTML = t, s;
364
+ const r = A.createElement("template");
365
+ return r.innerHTML = t, r;
366
366
  }
367
367
  }
368
- function E(i, t, e = i, s) {
368
+ function H(i, t, e = i, r) {
369
369
  var o, l;
370
- if (t === C)
370
+ if (t === F)
371
371
  return t;
372
- let r = s !== void 0 ? (o = e._$Co) == null ? void 0 : o[s] : e._$Cl;
373
- const n = I(t) ? void 0 : t._$litDirective$;
374
- return (r == null ? void 0 : r.constructor) !== n && ((l = r == null ? void 0 : r._$AO) == null || l.call(r, !1), n === void 0 ? r = void 0 : (r = new n(i), r._$AT(i, e, s)), s !== void 0 ? (e._$Co ?? (e._$Co = []))[s] = r : e._$Cl = r), r !== void 0 && (t = E(i, r._$AS(i, t.values), r, s)), t;
372
+ let s = r !== void 0 ? (o = e._$Co) == null ? void 0 : o[r] : e._$Cl;
373
+ const n = O(t) ? void 0 : t._$litDirective$;
374
+ 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 = H(i, s._$AS(i, t.values), s, r)), t;
375
375
  }
376
376
  class Lt {
377
377
  constructor(t, e) {
@@ -384,22 +384,22 @@ class Lt {
384
384
  return this._$AM._$AU;
385
385
  }
386
386
  u(t) {
387
- const { el: { content: e }, parts: s } = this._$AD, r = ((t == null ? void 0 : t.creationScope) ?? A).importNode(e, !0);
388
- b.currentNode = r;
389
- let n = b.nextNode(), o = 0, l = 0, a = s[0];
387
+ const { el: { content: e }, parts: r } = this._$AD, s = ((t == null ? void 0 : t.creationScope) ?? A).importNode(e, !0);
388
+ w.currentNode = s;
389
+ let n = w.nextNode(), o = 0, l = 0, a = r[0];
390
390
  for (; a !== void 0; ) {
391
391
  if (o === a.index) {
392
- let d;
393
- a.type === 2 ? d = new V(n, n.nextSibling, this, t) : a.type === 1 ? d = new a.ctor(n, a.name, a.strings, this, t) : a.type === 6 && (d = new Dt(n, this, t)), this._$AV.push(d), a = s[++l];
392
+ let h;
393
+ a.type === 2 ? h = new V(n, n.nextSibling, this, t) : a.type === 1 ? h = new a.ctor(n, a.name, a.strings, this, t) : a.type === 6 && (h = new Dt(n, this, t)), this._$AV.push(h), a = r[++l];
394
394
  }
395
- o !== (a == null ? void 0 : a.index) && (n = b.nextNode(), o++);
395
+ o !== (a == null ? void 0 : a.index) && (n = w.nextNode(), o++);
396
396
  }
397
- return b.currentNode = A, r;
397
+ return w.currentNode = A, s;
398
398
  }
399
399
  p(t) {
400
400
  let e = 0;
401
- for (const s of this._$AV)
402
- s !== void 0 && (s.strings !== void 0 ? (s._$AI(t, s, e), e += s.strings.length - 2) : s._$AI(t[e])), e++;
401
+ for (const r of this._$AV)
402
+ r !== void 0 && (r.strings !== void 0 ? (r._$AI(t, r, e), e += r.strings.length - 2) : r._$AI(t[e])), e++;
403
403
  }
404
404
  }
405
405
  class V {
@@ -407,8 +407,8 @@ class V {
407
407
  var t;
408
408
  return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
409
409
  }
410
- constructor(t, e, s, r) {
411
- this.type = 2, this._$AH = c, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = r, this._$Cv = (r == null ? void 0 : r.isConnected) ?? !0;
410
+ constructor(t, e, r, s) {
411
+ 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;
412
412
  }
413
413
  get parentNode() {
414
414
  let t = this._$AA.parentNode;
@@ -422,44 +422,44 @@ class V {
422
422
  return this._$AB;
423
423
  }
424
424
  _$AI(t, e = this) {
425
- t = E(this, t, e), I(t) ? t === c || t == null || t === "" ? (this._$AH !== c && this._$AR(), this._$AH = c) : t !== this._$AH && t !== C && this._(t) : t._$litType$ !== void 0 ? this.g(t) : t.nodeType !== void 0 ? this.$(t) : Pt(t) ? this.T(t) : this._(t);
425
+ t = H(this, t, e), O(t) ? t === d || t == null || t === "" ? (this._$AH !== d && this._$AR(), this._$AH = d) : t !== this._$AH && t !== F && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Nt(t) ? this.k(t) : this._(t);
426
426
  }
427
- k(t) {
427
+ S(t) {
428
428
  return this._$AA.parentNode.insertBefore(t, this._$AB);
429
429
  }
430
- $(t) {
431
- this._$AH !== t && (this._$AR(), this._$AH = this.k(t));
430
+ T(t) {
431
+ this._$AH !== t && (this._$AR(), this._$AH = this.S(t));
432
432
  }
433
433
  _(t) {
434
- this._$AH !== c && I(this._$AH) ? this._$AA.nextSibling.data = t : this.$(A.createTextNode(t)), this._$AH = t;
434
+ this._$AH !== d && O(this._$AH) ? this._$AA.nextSibling.data = t : this.T(A.createTextNode(t)), this._$AH = t;
435
435
  }
436
- g(t) {
436
+ $(t) {
437
437
  var n;
438
- const { values: e, _$litType$: s } = t, r = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = L.createElement(ft(s.h, s.h[0]), this.options)), s);
439
- if (((n = this._$AH) == null ? void 0 : n._$AD) === r)
438
+ const { values: e, _$litType$: r } = t, s = typeof r == "number" ? this._$AC(t) : (r.el === void 0 && (r.el = N.createElement(bt(r.h, r.h[0]), this.options)), r);
439
+ if (((n = this._$AH) == null ? void 0 : n._$AD) === s)
440
440
  this._$AH.p(e);
441
441
  else {
442
- const o = new Lt(r, this), l = o.u(this.options);
443
- o.p(e), this.$(l), this._$AH = o;
442
+ const o = new Lt(s, this), l = o.u(this.options);
443
+ o.p(e), this.T(l), this._$AH = o;
444
444
  }
445
445
  }
446
446
  _$AC(t) {
447
447
  let e = at.get(t.strings);
448
- return e === void 0 && at.set(t.strings, e = new L(t)), e;
448
+ return e === void 0 && at.set(t.strings, e = new N(t)), e;
449
449
  }
450
- T(t) {
451
- $t(this._$AH) || (this._$AH = [], this._$AR());
450
+ k(t) {
451
+ ft(this._$AH) || (this._$AH = [], this._$AR());
452
452
  const e = this._$AH;
453
- let s, r = 0;
453
+ let r, s = 0;
454
454
  for (const n of t)
455
- r === e.length ? e.push(s = new V(this.k(P()), this.k(P()), this, this.options)) : s = e[r], s._$AI(n), r++;
456
- r < e.length && (this._$AR(s && s._$AB.nextSibling, r), e.length = r);
455
+ s === e.length ? e.push(r = new V(this.S(P()), this.S(P()), this, this.options)) : r = e[s], r._$AI(n), s++;
456
+ s < e.length && (this._$AR(r && r._$AB.nextSibling, s), e.length = s);
457
457
  }
458
458
  _$AR(t = this._$AA.nextSibling, e) {
459
- var s;
460
- for ((s = this._$AP) == null ? void 0 : s.call(this, !1, !0, e); t && t !== this._$AB; ) {
461
- const r = t.nextSibling;
462
- t.remove(), t = r;
459
+ var r;
460
+ for ((r = this._$AP) == null ? void 0 : r.call(this, !1, !0, e); t && t !== this._$AB; ) {
461
+ const s = t.nextSibling;
462
+ t.remove(), t = s;
463
463
  }
464
464
  }
465
465
  setConnected(t) {
@@ -467,58 +467,58 @@ class V {
467
467
  this._$AM === void 0 && (this._$Cv = t, (e = this._$AP) == null || e.call(this, t));
468
468
  }
469
469
  }
470
- class q {
470
+ class J {
471
471
  get tagName() {
472
472
  return this.element.tagName;
473
473
  }
474
474
  get _$AU() {
475
475
  return this._$AM._$AU;
476
476
  }
477
- constructor(t, e, s, r, n) {
478
- this.type = 1, this._$AH = c, this._$AN = void 0, this.element = t, this.name = e, this._$AM = r, this.options = n, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = c;
477
+ constructor(t, e, r, s, n) {
478
+ 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;
479
479
  }
480
- _$AI(t, e = this, s, r) {
480
+ _$AI(t, e = this, r, s) {
481
481
  const n = this.strings;
482
482
  let o = !1;
483
483
  if (n === void 0)
484
- t = E(this, t, e, 0), o = !I(t) || t !== this._$AH && t !== C, o && (this._$AH = t);
484
+ t = H(this, t, e, 0), o = !O(t) || t !== this._$AH && t !== F, o && (this._$AH = t);
485
485
  else {
486
486
  const l = t;
487
- let a, d;
487
+ let a, h;
488
488
  for (t = n[0], a = 0; a < n.length - 1; a++)
489
- d = E(this, l[s + a], e, a), d === C && (d = this._$AH[a]), o || (o = !I(d) || d !== this._$AH[a]), d === c ? t = c : t !== c && (t += (d ?? "") + n[a + 1]), this._$AH[a] = d;
489
+ h = H(this, l[r + a], e, a), h === F && (h = this._$AH[a]), o || (o = !O(h) || h !== this._$AH[a]), h === d ? t = d : t !== d && (t += (h ?? "") + n[a + 1]), this._$AH[a] = h;
490
490
  }
491
- o && !r && this.O(t);
491
+ o && !s && this.j(t);
492
492
  }
493
- O(t) {
494
- t === c ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
493
+ j(t) {
494
+ t === d ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
495
495
  }
496
496
  }
497
- class Nt extends q {
497
+ class Rt extends J {
498
498
  constructor() {
499
499
  super(...arguments), this.type = 3;
500
500
  }
501
- O(t) {
502
- this.element[this.name] = t === c ? void 0 : t;
501
+ j(t) {
502
+ this.element[this.name] = t === d ? void 0 : t;
503
503
  }
504
504
  }
505
- class Bt extends q {
505
+ class Vt extends J {
506
506
  constructor() {
507
507
  super(...arguments), this.type = 4;
508
508
  }
509
- O(t) {
510
- this.element.toggleAttribute(this.name, !!t && t !== c);
509
+ j(t) {
510
+ this.element.toggleAttribute(this.name, !!t && t !== d);
511
511
  }
512
512
  }
513
- class Vt extends q {
514
- constructor(t, e, s, r, n) {
515
- super(t, e, s, r, n), this.type = 5;
513
+ class zt extends J {
514
+ constructor(t, e, r, s, n) {
515
+ super(t, e, r, s, n), this.type = 5;
516
516
  }
517
517
  _$AI(t, e = this) {
518
- if ((t = E(this, t, e, 0) ?? c) === C)
518
+ if ((t = H(this, t, e, 0) ?? d) === F)
519
519
  return;
520
- const s = this._$AH, r = t === c && s !== c || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, n = t !== c && (s === c || r);
521
- r && this.element.removeEventListener(this.name, this, s), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
520
+ 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);
521
+ s && this.element.removeEventListener(this.name, this, r), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
522
522
  }
523
523
  handleEvent(t) {
524
524
  var e;
@@ -526,33 +526,33 @@ class Vt extends q {
526
526
  }
527
527
  }
528
528
  class Dt {
529
- constructor(t, e, s) {
530
- this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
529
+ constructor(t, e, r) {
530
+ this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = r;
531
531
  }
532
532
  get _$AU() {
533
533
  return this._$AM._$AU;
534
534
  }
535
535
  _$AI(t) {
536
- E(this, t);
536
+ H(this, t);
537
537
  }
538
538
  }
539
- const W = U.litHtmlPolyfillSupport;
540
- W == null || W(L, V), (U.litHtmlVersions ?? (U.litHtmlVersions = [])).push("3.1.0");
541
- const Rt = (i, t, e) => {
542
- const s = (e == null ? void 0 : e.renderBefore) ?? t;
543
- let r = s._$litPart$;
544
- if (r === void 0) {
539
+ const G = U.litHtmlPolyfillSupport;
540
+ G == null || G(N, V), (U.litHtmlVersions ?? (U.litHtmlVersions = [])).push("3.1.2");
541
+ const jt = (i, t, e) => {
542
+ const r = (e == null ? void 0 : e.renderBefore) ?? t;
543
+ let s = r._$litPart$;
544
+ if (s === void 0) {
545
545
  const n = (e == null ? void 0 : e.renderBefore) ?? null;
546
- s._$litPart$ = r = new V(t.insertBefore(P(), n), n, void 0, e ?? {});
546
+ r._$litPart$ = s = new V(t.insertBefore(P(), n), n, void 0, e ?? {});
547
547
  }
548
- return r._$AI(i), r;
548
+ return s._$AI(i), s;
549
549
  };
550
550
  /**
551
551
  * @license
552
552
  * Copyright 2017 Google LLC
553
553
  * SPDX-License-Identifier: BSD-3-Clause
554
554
  */
555
- class w extends v {
555
+ class x extends C {
556
556
  constructor() {
557
557
  super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
558
558
  }
@@ -563,7 +563,7 @@ class w extends v {
563
563
  }
564
564
  update(t) {
565
565
  const e = this.render();
566
- this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Rt(e, this.renderRoot, this.renderOptions);
566
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = jt(e, this.renderRoot, this.renderOptions);
567
567
  }
568
568
  connectedCallback() {
569
569
  var t;
@@ -574,28 +574,28 @@ class w extends v {
574
574
  super.disconnectedCallback(), (t = this._$Do) == null || t.setConnected(!1);
575
575
  }
576
576
  render() {
577
- return C;
577
+ return F;
578
578
  }
579
579
  }
580
- var ht;
581
- w._$litElement$ = !0, w.finalized = !0, (ht = globalThis.litElementHydrateSupport) == null || ht.call(globalThis, { LitElement: w });
582
- const Z = globalThis.litElementPolyfillSupport;
583
- Z == null || Z({ LitElement: w });
584
- (globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.0.1");
580
+ var dt;
581
+ x._$litElement$ = !0, x.finalized = !0, (dt = globalThis.litElementHydrateSupport) == null || dt.call(globalThis, { LitElement: x });
582
+ const W = globalThis.litElementPolyfillSupport;
583
+ W == null || W({ LitElement: x });
584
+ (globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.0.4");
585
585
  /**
586
586
  * @license
587
587
  * Copyright 2017 Google LLC
588
588
  * SPDX-License-Identifier: BSD-3-Clause
589
589
  */
590
- const zt = (i) => (...t) => ({ _$litDirective$: i, values: t });
590
+ const Jt = (i) => (...t) => ({ _$litDirective$: i, values: t });
591
591
  let qt = class {
592
592
  constructor(t) {
593
593
  }
594
594
  get _$AU() {
595
595
  return this._$AM._$AU;
596
596
  }
597
- _$AT(t, e, s) {
598
- this._$Ct = t, this._$AM = e, this._$Ci = s;
597
+ _$AT(t, e, r) {
598
+ this._$Ct = t, this._$AM = e, this._$Ci = r;
599
599
  }
600
600
  _$AS(t, e) {
601
601
  return this.update(t, e);
@@ -609,191 +609,23 @@ let qt = class {
609
609
  * Copyright 2020 Google LLC
610
610
  * SPDX-License-Identifier: BSD-3-Clause
611
611
  */
612
- const jt = {}, Tt = (i, t = jt) => i._$AH = t;
612
+ const Tt = {}, Gt = (i, t = Tt) => i._$AH = t;
613
613
  /**
614
614
  * @license
615
615
  * Copyright 2021 Google LLC
616
616
  * SPDX-License-Identifier: BSD-3-Clause
617
617
  */
618
- const Wt = zt(class extends qt {
618
+ const Wt = Jt(class extends qt {
619
619
  constructor() {
620
- super(...arguments), this.key = c;
620
+ super(...arguments), this.key = d;
621
621
  }
622
622
  render(i, t) {
623
623
  return this.key = i, t;
624
624
  }
625
625
  update(i, [t, e]) {
626
- return t !== this.key && (Tt(i), this.key = t), e;
627
- }
628
- }), Zt = `
629
- button {
630
- /* TODO: why does this only work here and not from :root? */
631
- --primary-color: #004170;
632
- --primary-color-hover: #004170CC;
633
- --error-color: #FF5252;
634
-
635
- display: inline-flex;
636
- position: relative;
637
- align-items: center;
638
- color: #fff;
639
- border-width: 0;
640
- outline: none;
641
- border-radius: 4px;
642
- padding: 16px;
643
- height: 36px;
644
- cursor: pointer;
645
- font-family: inherit;
646
- font-size: 0.875rem;
647
- text-transform: uppercase;
648
- letter-spacing: 1.25px;
649
- font-weight: 500;
650
- 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);
651
- transition-property: box-shadow, transform, opacity, background;
652
- transition-duration: 0.28s;
653
- transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
654
- }
655
-
656
- button:hover:not([disabled]):not(.icon) {
657
- 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);
658
- background: var(--primary-color-hover);
659
- }
660
-
661
- button, button:active {
662
- background: var(--primary-color);
663
- }
664
-
665
- button[disabled] {
666
- opacity: 0.5;
667
- }
668
-
669
- button.outline {
670
- background: transparent;
671
- box-shadow: none;
672
- color: var(--primary-color);
673
- outline: 1px solid var(--primary-color);
674
- }
675
-
676
- button.outline:hover {
677
- background: transparent;
678
- }
679
-
680
- button.icon {
681
- background: transparent;
682
- border: none;
683
- box-shadow: none;
684
- padding: 0;
685
- border-radius: 50%;
686
- width: 24px;
687
- height: 24px;
688
- text-indent: -9999px;
689
- }
690
-
691
- button.icon-text {
692
- text-indent: 26px;
693
- }
694
-
695
- button.icon:before, button.icon-text:before {
696
- position: absolute;
697
- text-indent: 0;
698
- line-height: initial;
699
- }
700
-
701
- button.icon:before {
702
- width: 24px;
703
- height: 24px;
704
- margin-right: 0;
705
- }
706
-
707
- button.icon-text:before {
708
- width: 18px;
709
- height: 18px;
710
- }
711
-
712
- button.small {
713
- height: 28px;
714
- padding: 12.4px;
715
- font-size: .75rem;
716
- }
717
- `, K = `
718
- * {
719
- font-family: Roboto, sans-serif;
720
- }
721
-
722
- ${Zt}
723
-
724
- button.discard:before {
725
- 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")
726
- }
727
-
728
- button.polygon:before {
729
- 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");
730
- }
731
- ul {
732
- padding: 0;
733
- }
734
- ul ul {
735
- padding-left: 48px;
736
- }
737
- li:hover {
738
- background: #f0f5f9;
739
- }
740
- li.selected {
741
- background: #f0f5f9;
742
- }
743
- li {
744
- list-style: none;
745
- padding: 4px;
746
- }
747
- li {
748
- border-bottom: 1px solid #0041703a;
749
- }
750
- li:first-child {
751
- border-top: 1px solid #0041703a;
752
- }
753
- li.sortable-chosen {
754
- background: #eeea;
755
- }
756
- li.sortable-drag {
757
- opacity: 0;
758
- }
759
- li.sortable-ghost {
760
- }
761
- button.small.icon, button.small.icon::before {
762
- height: 16px;
763
- width: 16px;
764
- padding: 0px;
765
- }
766
- button.discard.icon {
767
- opacity: .7;
768
- }
769
- button.discard.icon:hover {
770
- opacity: 1;
771
- }
772
- eox-drawtools-list {
773
- width: 100%;
774
- }
775
- .list {
776
- width: 100%;
777
- align-items: center;
778
- justify-content: space-between;
779
- display: flex;
780
- align-items: center;
781
- cursor: pointer;
782
- font-size: small;
783
- gap: 10px;
784
-
785
- }
786
- label {
787
- gap: 10px;
788
- }
789
- label, span {
790
- display: flex;
791
- align-items: center;
792
- cursor: pointer;
793
- font-size: small;
794
- flex-grow: 1;
626
+ return t !== this.key && (Gt(i), this.key = t), e;
795
627
  }
796
- `, Gt = (i) => {
628
+ }), Zt = (i) => {
797
629
  i.hoverInteraction = i.eoxMap.selectInteractions.selectHover, i.clickInteraction = i.eoxMap.selectInteractions.selectClick;
798
630
  const t = () => {
799
631
  i.requestUpdate();
@@ -805,45 +637,48 @@ button.small {
805
637
  "change",
806
638
  t
807
639
  );
808
- }, Jt = (i, t, e) => {
640
+ }, Kt = (i, t, e) => {
809
641
  if (i.clickId === t)
810
642
  return;
811
- const s = e ? [] : [t];
812
- i.hoverInteraction.highlightById(s);
813
- }, Kt = (i, t) => {
643
+ const r = e ? [] : [t];
644
+ i.hoverInteraction.highlightById(r);
645
+ }, Qt = (i, t) => {
814
646
  i.stopPropagation();
815
- const e = Number(i.target.getAttribute("index")), s = t.drawnFeatures[e];
816
- t.drawLayer.getSource().removeFeature(s), t.drawnFeatures.splice(e, 1), t.requestUpdate();
817
- }, lt = { duration: 750 }, Qt = (i, t) => {
818
- const e = i.get("id"), { clickId: s, drawLayer: r, olMap: n, clickInteraction: o } = t, l = s === e, a = i.getGeometry();
647
+ const e = Number(i.target.getAttribute("index")), r = t.drawnFeatures[e];
648
+ t.drawLayer.getSource().removeFeature(r), t.drawnFeatures.splice(e, 1), t.requestUpdate();
649
+ }, lt = { duration: 750 }, ct = {
650
+ type: "FeatureCollection",
651
+ features: []
652
+ }, Xt = (i, t) => {
653
+ const e = i.get("id"), { clickId: r, drawLayer: s, olMap: n, clickInteraction: o } = t, l = r === e, a = i.getGeometry();
819
654
  if (l) {
820
- const d = r.getSource().getExtent();
821
- n.getView().fit(d, lt), o.highlightById([]);
655
+ const h = s.getSource().getExtent();
656
+ n.getView().fit(h, lt), o.highlightById([]);
822
657
  } else {
823
- const d = a.getExtent();
824
- o.highlightById([e]), n.getView().fit(d, lt);
658
+ const h = a.getExtent();
659
+ o.highlightById([e]), n.getView().fit(h, lt);
825
660
  }
826
661
  t.requestUpdate();
827
- };
828
- class gt extends w {
662
+ }, Yt = "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;}";
663
+ class $t extends x {
829
664
  constructor() {
830
665
  super();
831
666
  /**
832
667
  * @type import("../../../map/src/select").EOxSelectInteraction
833
668
  */
834
- g(this, "hoverInteraction");
669
+ $(this, "hoverInteraction");
835
670
  /**
836
671
  * @type import("../../../map/src/select").EOxSelectInteraction
837
672
  */
838
- g(this, "clickInteraction");
673
+ $(this, "clickInteraction");
839
674
  /**
840
675
  * @type string | number
841
676
  */
842
- g(this, "hoverId");
677
+ $(this, "hoverId");
843
678
  /**
844
679
  * @type string | number
845
680
  */
846
- g(this, "clickId");
681
+ $(this, "clickId");
847
682
  this.eoxMap = null, this.olMap = null, this.draw = null, this.drawLayer = null, this.drawnFeatures = [], this.modify = null, this.unstyled = !1;
848
683
  }
849
684
  /**
@@ -852,7 +687,7 @@ class gt extends w {
852
687
  * @param {Event & { target: HTMLButtonElement }} evt - Event object containing button target.
853
688
  */
854
689
  _handleDelete(e) {
855
- Kt(e, this);
690
+ Qt(e, this), this.dispatchEvent(new CustomEvent("changed", { bubbles: !0 }));
856
691
  }
857
692
  /**
858
693
  * Handles the selection and deselection of a feature from the list.
@@ -860,47 +695,53 @@ class gt extends w {
860
695
  * @param {import("ol").Feature} feature - The selected feature.
861
696
  */
862
697
  _handleFeatureSelectAndDeselect(e) {
863
- Qt(e, this);
698
+ Xt(e, this);
864
699
  }
865
700
  /**
866
701
  *
867
702
  * @param {Number} featureId - The ID of the feature to hover.
868
703
  * @param {Boolean} mouseOut - Flag indicating mouse out event.
869
704
  */
870
- _handleHoverFeature(e, s = !1) {
871
- Jt(this, e, s);
705
+ _handleHoverFeature(e, r = !1) {
706
+ Kt(this, e, r);
872
707
  }
873
708
  /**
874
709
  * Initiates initial settings and event triggers upon the component's first update.
875
710
  */
876
711
  firstUpdated() {
877
- Gt(this);
712
+ Zt(this);
713
+ }
714
+ /**
715
+ * Overrides createRenderRoot to handle shadow DOM.
716
+ */
717
+ createRenderRoot() {
718
+ return this;
878
719
  }
879
720
  render() {
880
- var e, s;
881
- return this.hoverId = (e = this.hoverInteraction) == null ? void 0 : e.selectedFids[0], this.clickId = (s = this.clickInteraction) == null ? void 0 : s.selectedFids[0], O`
721
+ var e, r;
722
+ return this.hoverId = (e = this.hoverInteraction) == null ? void 0 : e.selectedFids[0], this.clickId = (r = this.clickInteraction) == null ? void 0 : r.selectedFids[0], _`
882
723
  <style>
883
- ${!this.unstyled && K}
724
+ ${!this.unstyled && Yt}
884
725
  </style>
885
- <ul>
886
- ${this.drawnFeatures.map((r, n) => {
887
- const o = n + 1, l = r.get("id"), a = this.hoverId === l, d = this.clickId === l;
726
+ <ul class="list-wrap">
727
+ ${this.drawnFeatures.map((s, n) => {
728
+ const o = n + 1, l = s.get("id"), a = this.hoverId === l, h = this.clickId === l;
888
729
  return Wt(
889
730
  o,
890
- O`
731
+ _`
891
732
  <li
892
- class="${a || d ? "selected" : c}"
733
+ class="${a || h ? "selected" : d}"
893
734
  @mouseover=${() => this._handleHoverFeature(l)}
894
735
  @mouseout=${() => this._handleHoverFeature(l, !0)}
895
736
  >
896
737
  <div
897
738
  class="list"
898
- @click="${() => this._handleFeatureSelectAndDeselect(r)}"
739
+ @click="${() => this._handleFeatureSelectAndDeselect(s)}"
899
740
  >
900
741
  <span class="title">Feature #${o}</span>
901
742
  <button
902
743
  index=${n}
903
- class="icon small discard"
744
+ class="icon smallest discard"
904
745
  @click="${this._handleDelete}"
905
746
  >
906
747
  x
@@ -914,7 +755,7 @@ class gt extends w {
914
755
  `;
915
756
  }
916
757
  }
917
- g(gt, "properties", {
758
+ $($t, "properties", {
918
759
  eoxMap: { attribute: !1, state: !0 },
919
760
  olMap: { attribute: !1, state: !0 },
920
761
  draw: { attribute: !1, state: !0 },
@@ -923,97 +764,212 @@ g(gt, "properties", {
923
764
  modify: { attribute: !1, state: !0 },
924
765
  unstyled: { type: Boolean }
925
766
  });
926
- customElements.define("eox-drawtools-list", gt);
927
- const Xt = (i) => {
928
- const { multipleFeatures: t, drawnFeatures: e, currentlyDrawing: s } = i, r = !t && (e == null ? void 0 : e.length) > 0 || s, n = !(e != null && e.length) && !s;
929
- return { drawDisabled: r, discardDisabled: n };
930
- };
931
- var N, B;
932
- class mt extends w {
767
+ customElements.define("eox-drawtools-list", $t);
768
+ const te = (i) => {
769
+ const { multipleFeatures: t, drawnFeatures: e, currentlyDrawing: r } = i, s = !t && (e == null ? void 0 : e.length) > 0 || r, n = !(e != null && e.length) && !r;
770
+ return { drawDisabled: s, discardDisabled: n };
771
+ }, ee = '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;}', ie = '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;}';
772
+ function re(i) {
773
+ navigator.clipboard.writeText(i).then(
774
+ function() {
775
+ },
776
+ function(t) {
777
+ console.error("Could not copy text: ", t);
778
+ }
779
+ );
780
+ }
781
+ /**
782
+ * @license
783
+ * Copyright 2021 Google LLC
784
+ * SPDX-License-Identifier: BSD-3-Clause
785
+ */
786
+ function ht(i, t, e) {
787
+ return i ? t(i) : e == null ? void 0 : e(i);
788
+ }
789
+ var I, B;
790
+ class vt extends x {
933
791
  constructor() {
934
792
  super();
935
793
  /**
936
794
  * @type boolean | import("lit").nothing
937
795
  */
938
- H(this, N, !0);
796
+ S(this, I, !0);
939
797
  /**
940
798
  * @type boolean | import("lit").nothing
941
799
  */
942
- H(this, B, !0);
943
- this.multipleFeatures = !1, this.drawnFeatures = [], this.currentlyDrawing = !1, this.drawFunc = null, this.unstyled = !1;
800
+ S(this, B, !0);
801
+ this.multipleFeatures = !1, this.drawnFeatures = [], this.importFeatures = !1, this.showEditor = !1, this.currentlyDrawing = !1, this.drawFunc = null, this.geoJSON = "", this.unstyled = !1;
944
802
  }
945
803
  /**
946
804
  * Updates button states based on conditions
947
805
  */
948
806
  updateButtonStates() {
949
- const { drawDisabled: e, discardDisabled: s } = Xt(this);
950
- M(this, N, e), M(this, B, s);
807
+ const { drawDisabled: e, discardDisabled: r } = te(this);
808
+ E(this, I, e), E(this, B, r);
809
+ }
810
+ /**
811
+ * Overrides createRenderRoot to handle shadow DOM
812
+ */
813
+ createRenderRoot() {
814
+ return this;
951
815
  }
952
816
  render() {
953
817
  this.updateButtonStates();
954
818
  const e = this.currentlyDrawing ? "drawing" : "draw";
955
- return O`
819
+ return _`
956
820
  <style>
957
- ${!this.unstyled && K}
821
+ ${!this.unstyled && ee}
822
+ ${!this.unstyled && ie}
958
823
  </style>
959
- <div>
824
+ <div class="wrap-btn">
960
825
  <slot></slot>
826
+ <div>
827
+ <!-- Draw Button -->
828
+ <button
829
+ data-cy="drawBtn"
830
+ class="polygon icon"
831
+ ?disabled="${y(this, I) || d}"
832
+ @click="${() => this.drawFunc.start()}"
833
+ >
834
+ ${e}
835
+ </button>
836
+
837
+ <!-- Discard Button -->
838
+ <button
839
+ data-cy="discardBtn"
840
+ class="discard icon"
841
+ ?disabled="${y(this, B) || d}"
842
+ @click="${() => this.drawFunc.discard()}"
843
+ >
844
+ discard
845
+ </button>
846
+ </div>
961
847
 
962
- <!-- Draw Button -->
963
- <button
964
- data-cy="drawBtn"
965
- class="polygon icon"
966
- ?disabled="${m(this, N) || c}"
967
- @click="${() => this.drawFunc.start()}"
968
- >
969
- ${e}
970
- </button>
848
+ <!-- Import Button -->
849
+ ${ht(
850
+ this.importFeatures,
851
+ () => _`
852
+ <!-- Import Input Field : Hidden -->
853
+ <input
854
+ type="file"
855
+ id="import-file"
856
+ style="display: none;"
857
+ @change=${this.drawFunc.import}
858
+ />
971
859
 
972
- <!-- Discard Button -->
973
- <button
974
- data-cy="discardBtn"
975
- class="discard icon"
976
- ?disabled="${m(this, B) || c}"
977
- @click="${() => this.drawFunc.discard()}"
978
- >
979
- discard
980
- </button>
860
+ <!-- Main Import Button -->
861
+ <button
862
+ data-cy="importBtn"
863
+ class="import icon"
864
+ @click=${() => this.querySelector("#import-file").click()}
865
+ >
866
+ import
867
+ </button>
868
+ `
869
+ )}
981
870
  </div>
871
+
872
+ <!-- Geo JSON Wrapper -->
873
+ ${ht(
874
+ this.showEditor,
875
+ () => _`
876
+ <div class="json-wrapper">
877
+ <!-- Geo JSON Editor -->
878
+ <textarea
879
+ @drop=${this.drawFunc.import}
880
+ @input=${this.drawFunc.editor}
881
+ .value=${this.geoJSON}
882
+ ></textarea>
883
+
884
+ <!-- Geo JSON Copy Button -->
885
+ <button
886
+ data-cy="copyBtn"
887
+ class="icon-copy"
888
+ @click=${() => re(this.geoJSON)}
889
+ >
890
+ ${this.unstyled ? "copy" : d}
891
+ </button>
892
+ </div>
893
+ `
894
+ )}
982
895
  `;
983
896
  }
984
897
  }
985
- N = new WeakMap(), B = new WeakMap(), // Define properties with default values and types
986
- g(mt, "properties", {
898
+ I = new WeakMap(), B = new WeakMap(), // Define properties with default values and types
899
+ $(vt, "properties", {
987
900
  multipleFeatures: { attribute: !1, type: Boolean },
988
901
  drawnFeatures: { attribute: !1, state: !0, type: Array },
989
902
  currentlyDrawing: { attribute: !1, state: !0, type: Boolean },
990
903
  drawFunc: { attribute: !1, type: Object },
904
+ importFeatures: { attribute: "import-features", type: Boolean },
905
+ showEditor: { attribute: "show-editor", type: Boolean },
906
+ geoJSON: { attribute: "geo-json", type: String },
991
907
  unstyled: { type: Boolean }
992
908
  });
993
- customElements.define("eox-drawtools-controller", mt);
994
- const Yt = `
995
- :host {
996
- display: block;
997
- }
998
- `, _t = (i) => {
909
+ customElements.define("eox-drawtools-controller", vt);
910
+ const se = `
911
+ button.discard:before {
912
+ 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")
913
+ }
914
+ button.polygon:before {
915
+ 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");
916
+ }
917
+ button.import:before {
918
+ content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ctitle%3Eupload%3C/title%3E%3Cpath fill='%23004170' d='M9,16V10H5L12,3L19,10H15V16H9M5,20V18H19V20H5Z' /%3E%3C/svg%3E");
919
+ }
920
+ .wrap-btn {
921
+ display: flex;
922
+ justify-content: space-between;
923
+ }
924
+ eox-drawtools-list {
925
+ width: 100%;
926
+ }
927
+ .json-wrapper {
928
+ margin: 0.4rem 0rem;
929
+ padding: 0.75rem;
930
+ background: var(--secondary-color-hover);
931
+ position: relative;
932
+ }
933
+ .json-wrapper textarea {
934
+ height: 200px;
935
+ }
936
+ .icon-copy {
937
+ position: absolute;
938
+ bottom: 26px;
939
+ right: 26px;
940
+ border-radius: 4px;
941
+ height: 26px;
942
+ padding: 4px 6px;
943
+ }
944
+ .icon-copy:before {
945
+ width: 14px;
946
+ min-width: 14px;
947
+ height: 14px;
948
+ display: flex margin-right: 6px;
949
+ color: white;
950
+ content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ctitle%3Econtent-copy%3C/title%3E%3Cpath d='M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z' fill='white' /%3E%3C/svg%3E")
951
+ }
952
+ `, ne = (i) => {
999
953
  (() => {
1000
- i.emitDrawnFeatures(), i.draw.setActive(!1), i.currentlyDrawing = !1;
954
+ i.emitDrawnFeatures(), i.multipleFeatures || (i.draw.setActive(!1), i.currentlyDrawing = !1);
1001
955
  })(), i.requestUpdate();
1002
- }, te = (i) => {
956
+ }, oe = (i) => {
1003
957
  const t = () => {
1004
- i.initDrawLayer(), i.draw.setActive(!0);
958
+ i.drawLayer.set("isDrawingEnabled", !0), i.draw.setActive(!0);
1005
959
  }, e = () => {
1006
960
  i.currentlyDrawing = !0, i.requestUpdate();
1007
961
  };
1008
962
  t(), e();
1009
- }, ee = (i) => {
1010
- var r, n;
1011
- const e = document.querySelector(i.for), s = e.map;
1012
- return i.drawLayer = e.addOrUpdateLayer({
963
+ }, ae = (i, t) => {
964
+ var n;
965
+ const r = document.querySelector(i.for), s = r.map;
966
+ return i.drawLayer = r.addOrUpdateLayer({
1013
967
  type: "Vector",
1014
968
  properties: {
1015
969
  id: "drawLayer",
1016
- layerControlHide: !0
970
+ layerControlHide: !0,
971
+ isDrawingEnabled: !1,
972
+ multipleFeatures: t
1017
973
  },
1018
974
  source: {
1019
975
  type: "Vector"
@@ -1057,34 +1013,66 @@ const Yt = `
1057
1013
  ]
1058
1014
  }), i.draw = /** @type {import("ol/interaction").Draw} */
1059
1015
  /** @type {unknown} */
1060
- e.interactions.drawInteraction, i.modify = /** @type {import("ol/interaction").Modify} */
1016
+ r.interactions.drawInteraction, i.modify = /** @type {import("ol/interaction").Modify} */
1061
1017
  /** @type {unknown} */
1062
- e.interactions.drawInteractionmodify, (r = i.draw) == null || r.on("drawend", () => _t(i)), (n = i.modify) == null || n.on("modifyend", () => i.emitDrawnFeatures()), { EoxMap: e, OlMap: s };
1063
- }, se = (i, t, e) => {
1064
- const s = () => {
1065
- i.drawnFeatures = [], i.draw.setActive(!1), i.drawLayer.getSource().clear(), t.removeInteraction("drawInteraction"), e.removeLayer(i.drawLayer);
1066
- }, r = () => {
1018
+ r.interactions.drawInteractionmodify, (n = i.modify) == null || n.on("modifyend", () => i.onModifyEnd()), r.addEventListener("addfeatures", () => ne(i)), { EoxMap: r, OlMap: s };
1019
+ }, le = (i) => {
1020
+ const t = () => {
1021
+ i.drawnFeatures = [], i.draw.setActive(!1), i.drawLayer.getSource().clear(), i.geoJSON = null;
1022
+ }, e = () => {
1067
1023
  i.emitDrawnFeatures(), i.currentlyDrawing = !1, i.requestUpdate();
1068
1024
  };
1069
- s(), r();
1070
- }, ie = (i, t) => {
1025
+ t(), e();
1026
+ }, ce = (i, t) => {
1071
1027
  setTimeout(() => {
1072
- i.drawnFeatures = i.drawLayer.getSource().getFeatures(), i.requestUpdate(), t();
1028
+ i.drawnFeatures = i.drawLayer.getSource().getFeatures(), i.updateGeoJSON(), i.requestUpdate(), t();
1073
1029
  }, 0);
1074
- };
1075
- var x, S;
1076
- class re extends w {
1030
+ }, he = ':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);}';
1031
+ function de(i, t) {
1032
+ function e(n) {
1033
+ n.preventDefault(), n.stopPropagation();
1034
+ }
1035
+ function r(n) {
1036
+ n.srcElement.style.opacity = "0.4";
1037
+ }
1038
+ function s(n) {
1039
+ n.srcElement.style.opacity = "1";
1040
+ }
1041
+ ["dragenter", "dragover", "dragleave", "drop"].forEach((n) => {
1042
+ t.addEventListener(n, e, !1), ["dragenter", "dragover"].includes(n) ? t.addEventListener(n, r, !1) : t.addEventListener(n, s, !1);
1043
+ }), t.addEventListener("drop", (n) => wt(n, i), !1);
1044
+ }
1045
+ function pe(i) {
1046
+ i.preventDefault(), i.stopPropagation();
1047
+ }
1048
+ function wt(i, t) {
1049
+ pe(i);
1050
+ const e = i.dataTransfer ? i.dataTransfer.files : i.target.files;
1051
+ Array.from(e).forEach((r) => ue(r, t));
1052
+ }
1053
+ function ue(i, t) {
1054
+ const e = new FileReader();
1055
+ e.readAsText(i), e.onloadend = function() {
1056
+ typeof e.result == "string" && t.handleFeatureChange(e.result);
1057
+ };
1058
+ }
1059
+ var m, L, R;
1060
+ class ye extends x {
1077
1061
  constructor() {
1078
1062
  super();
1079
1063
  /**
1080
1064
  * @type import("../../map/main").EOxMap
1081
1065
  */
1082
- H(this, x, void 0);
1066
+ S(this, m, void 0);
1083
1067
  /**
1084
1068
  * @type import("ol").Map
1085
1069
  */
1086
- H(this, S, void 0);
1087
- this.allowModify = !1, this.for = "eox-map", this.currentlyDrawing = !1, this.draw = null, this.drawLayer = null, this.drawnFeatures = [], this.modify = null, this.multipleFeatures = !1, this.showList = !1, this.type = "Polygon", this.unstyled = !1;
1070
+ S(this, L, void 0);
1071
+ /**
1072
+ * @type string
1073
+ */
1074
+ S(this, R, void 0);
1075
+ this.allowModify = !1, this.for = "eox-map", this.currentlyDrawing = !1, this.draw = null, this.drawLayer = null, this.drawnFeatures = [], this.modify = null, this.multipleFeatures = !1, this.importFeatures = !1, this.showEditor = !1, this.showList = !1, this.type = "Polygon", this.unstyled = !1, this.noShadow = !1;
1088
1076
  }
1089
1077
  // Define properties with defaults and types
1090
1078
  static get properties() {
@@ -1097,36 +1085,43 @@ class re extends w {
1097
1085
  drawnFeatures: { attribute: !1, state: !0, type: Array },
1098
1086
  modify: { attribute: !1, state: !0 },
1099
1087
  multipleFeatures: { attribute: "multiple-features", type: Boolean },
1088
+ importFeatures: { attribute: "import-features", type: Boolean },
1089
+ showEditor: { attribute: "show-editor", type: Boolean },
1100
1090
  showList: { attribute: "show-list", type: Boolean },
1091
+ noShadow: { type: Boolean },
1101
1092
  type: { type: String },
1102
1093
  unstyled: { type: Boolean }
1103
1094
  };
1104
1095
  }
1105
- /**
1106
- * Initializes the drawing layer before starting to draw on the map.
1107
- */
1108
- initDrawLayer() {
1109
- const { EoxMap: e, OlMap: s } = ee(this);
1110
- M(this, x, e), M(this, S, s);
1111
- }
1112
1096
  /**
1113
1097
  * @onClick Event handler triggered to start drawing on the map.
1114
1098
  */
1115
1099
  handleStartDrawing() {
1116
- te(this);
1100
+ oe(this);
1117
1101
  }
1118
1102
  /**
1119
1103
  * @onClick Event handler triggered to discard/stop drawing
1120
1104
  * on the map and delete the drawn shapes.
1121
1105
  */
1122
1106
  handleDiscardDrawing() {
1123
- se(this, m(this, x), m(this, S));
1107
+ le(this);
1108
+ }
1109
+ /**
1110
+ * @param {string} text - The string representation of the features to be parsed.
1111
+ * @param {boolean} replaceFeatures - A boolean flag indicating whether to replace the existing features.
1112
+ */
1113
+ handleFeatureChange(e, r = !1) {
1114
+ y(this, m).parseTextToFeature(
1115
+ e || JSON.stringify(ct),
1116
+ this.drawLayer,
1117
+ r
1118
+ );
1124
1119
  }
1125
1120
  /**
1126
- * @event onDrawEnd triggered when the drawing of a shape is completed.
1121
+ * @param {DragEvent | Event} evt - The event object from the file input interaction.
1127
1122
  */
1128
- onDrawEnd() {
1129
- _t(this);
1123
+ handleFilesChange(e) {
1124
+ wt(e, this);
1130
1125
  }
1131
1126
  /**
1132
1127
  * @event onModifyEnd triggered when the modification of a shape is completed.
@@ -1134,53 +1129,86 @@ class re extends w {
1134
1129
  onModifyEnd() {
1135
1130
  this.emitDrawnFeatures();
1136
1131
  }
1132
+ /**
1133
+ * Update #geoJSON with stringify feature.
1134
+ */
1135
+ updateGeoJSON() {
1136
+ E(this, R, JSON.stringify(
1137
+ y(this, m).parseFeature(this.drawnFeatures) || ct,
1138
+ void 0,
1139
+ 2
1140
+ ));
1141
+ }
1137
1142
  /**
1138
1143
  * Triggers different events when the drawing of a shape is completed.
1139
1144
  */
1140
1145
  emitDrawnFeatures() {
1141
- ie(this, () => {
1146
+ ce(this, () => {
1142
1147
  this.dispatchEvent(
1143
1148
  new CustomEvent("drawupdate", { detail: this.drawnFeatures })
1144
1149
  );
1145
1150
  });
1146
1151
  }
1152
+ /**
1153
+ * Overrides createRenderRoot to handle shadow DOM creation based on the noShadow property.
1154
+ */
1155
+ createRenderRoot() {
1156
+ return this.noShadow ? this : super.createRenderRoot();
1157
+ }
1158
+ /**
1159
+ * initializes the EOxMap and OlMap instances
1160
+ * And stores them in the private properties #eoxMap and #olMap, respectively.
1161
+ * It then calls requestUpdate to trigger a re-render.
1162
+ */
1163
+ firstUpdated() {
1164
+ const { EoxMap: e, OlMap: r } = ae(this, this.multipleFeatures);
1165
+ E(this, m, e), E(this, L, r), this.importFeatures && de(this, y(this, m)), this.updateGeoJSON(), this.requestUpdate();
1166
+ }
1147
1167
  // Render method for UI display
1148
1168
  render() {
1149
1169
  var e;
1150
- return O`
1170
+ return _`
1151
1171
  <style>
1152
- ${Yt}
1153
- ${!this.unstyled && K}
1172
+ :host { display: block; }
1173
+ ${!this.unstyled && he}
1174
+ ${!this.unstyled && se}
1154
1175
  </style>
1155
1176
 
1156
1177
  <!-- Controller Component -->
1157
1178
  <eox-drawtools-controller
1158
1179
  .drawFunc=${{
1159
1180
  start: () => this.handleStartDrawing(),
1160
- discard: () => this.handleDiscardDrawing()
1181
+ discard: () => this.handleDiscardDrawing(),
1182
+ editor: (r) => this.handleFeatureChange(r.target.value, !0),
1183
+ import: (r) => this.handleFilesChange(r)
1161
1184
  }}
1162
1185
  .unstyled=${this.unstyled}
1163
1186
  .drawnFeatures=${this.drawnFeatures}
1164
1187
  .currentlyDrawing=${this.currentlyDrawing}
1165
1188
  .multipleFeatures=${this.multipleFeatures}
1189
+ .importFeatures=${this.importFeatures}
1190
+ .showEditor=${this.showEditor}
1191
+ .geoJSON=${y(this, R)}
1166
1192
  ></eox-drawtools-controller>
1167
1193
 
1168
1194
  <!-- List Component -->
1169
- ${this.showList && ((e = this.drawnFeatures) != null && e.length) ? O`<eox-drawtools-list
1170
- .eoxMap=${m(this, x)}
1171
- .olMap=${m(this, S)}
1195
+ ${this.showList && ((e = this.drawnFeatures) != null && e.length) ? _`<eox-drawtools-list
1196
+ .eoxMap=${y(this, m)}
1197
+ .olMap=${y(this, L)}
1172
1198
  .draw=${this.draw}
1173
1199
  .drawLayer=${this.drawLayer}
1174
1200
  .drawnFeatures=${this.drawnFeatures}
1175
1201
  .modify=${this.modify}
1176
1202
  .unstyled=${this.unstyled}
1177
- @changed=${() => this.requestUpdate()}
1178
- ></eox-drawtools-list>` : c}
1203
+ @changed=${() => {
1204
+ this.updateGeoJSON(), this.requestUpdate();
1205
+ }}
1206
+ ></eox-drawtools-list>` : d}
1179
1207
  `;
1180
1208
  }
1181
1209
  }
1182
- x = new WeakMap(), S = new WeakMap();
1183
- customElements.define("eox-drawtools", re);
1210
+ m = new WeakMap(), L = new WeakMap(), R = new WeakMap();
1211
+ customElements.define("eox-drawtools", ye);
1184
1212
  export {
1185
- re as EOxDrawTools
1213
+ ye as EOxDrawTools
1186
1214
  };