@eox/drawtools 0.4.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eox-drawtools.js +599 -321
- package/dist/eox-drawtools.umd.cjs +146 -29
- package/package.json +3 -3
- package/test/_mockMap.js +5 -2
package/dist/eox-drawtools.js
CHANGED
|
@@ -1,30 +1,32 @@
|
|
|
1
|
-
var
|
|
1
|
+
var gt = Object.defineProperty;
|
|
2
|
+
var ft = (r, t, e) => t in r ? gt(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
|
|
3
|
+
var A = (r, t, e) => (ft(r, typeof t != "symbol" ? t + "" : t, e), e), J = (r, t, e) => {
|
|
2
4
|
if (!t.has(r))
|
|
3
5
|
throw TypeError("Cannot " + e);
|
|
4
6
|
};
|
|
5
|
-
var
|
|
7
|
+
var $ = (r, t, e) => (J(r, t, "read from private field"), e ? e.call(r) : t.get(r)), V = (r, t, e) => {
|
|
6
8
|
if (t.has(r))
|
|
7
9
|
throw TypeError("Cannot add the same private member more than once");
|
|
8
10
|
t instanceof WeakSet ? t.add(r) : t.set(r, e);
|
|
9
|
-
}, R = (r, t, e,
|
|
11
|
+
}, R = (r, t, e, s) => (J(r, t, "write to private field"), s ? s.call(r, e) : t.set(r, e), e);
|
|
10
12
|
/**
|
|
11
13
|
* @license
|
|
12
14
|
* Copyright 2019 Google LLC
|
|
13
15
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
14
16
|
*/
|
|
15
|
-
const
|
|
16
|
-
let
|
|
17
|
-
constructor(t, e,
|
|
18
|
-
if (this._$cssResult$ = !0,
|
|
17
|
+
const T = globalThis, Z = T.ShadowRoot && (T.ShadyCSS === void 0 || T.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, at = Symbol(), K = /* @__PURE__ */ new WeakMap();
|
|
18
|
+
let _t = class {
|
|
19
|
+
constructor(t, e, s) {
|
|
20
|
+
if (this._$cssResult$ = !0, s !== at)
|
|
19
21
|
throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
20
22
|
this.cssText = t, this.t = e;
|
|
21
23
|
}
|
|
22
24
|
get styleSheet() {
|
|
23
25
|
let t = this.o;
|
|
24
26
|
const e = this.t;
|
|
25
|
-
if (
|
|
26
|
-
const
|
|
27
|
-
|
|
27
|
+
if (Z && t === void 0) {
|
|
28
|
+
const s = e !== void 0 && e.length === 1;
|
|
29
|
+
s && (t = K.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && K.set(e, t));
|
|
28
30
|
}
|
|
29
31
|
return t;
|
|
30
32
|
}
|
|
@@ -32,27 +34,29 @@ let vt = class {
|
|
|
32
34
|
return this.cssText;
|
|
33
35
|
}
|
|
34
36
|
};
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
const mt = (r) => new _t(typeof r == "string" ? r : r + "", void 0, at), wt = (r, t) => {
|
|
38
|
+
if (Z)
|
|
39
|
+
r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
|
|
40
|
+
else
|
|
41
|
+
for (const e of t) {
|
|
42
|
+
const s = document.createElement("style"), i = T.litNonce;
|
|
43
|
+
i !== void 0 && s.setAttribute("nonce", i), s.textContent = e.cssText, r.appendChild(s);
|
|
44
|
+
}
|
|
45
|
+
}, G = Z ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
|
|
41
46
|
let e = "";
|
|
42
|
-
for (const
|
|
43
|
-
e +=
|
|
44
|
-
return
|
|
47
|
+
for (const s of t.cssRules)
|
|
48
|
+
e += s.cssText;
|
|
49
|
+
return mt(e);
|
|
45
50
|
})(r) : r;
|
|
46
51
|
/**
|
|
47
52
|
* @license
|
|
48
53
|
* Copyright 2017 Google LLC
|
|
49
54
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
50
55
|
*/
|
|
51
|
-
|
|
52
|
-
const T = window, G = T.trustedTypes, _t = G ? G.emptyScript : "", Y = T.reactiveElementPolyfillSupport, q = { toAttribute(r, t) {
|
|
56
|
+
const { is: bt, defineProperty: At, getOwnPropertyDescriptor: vt, getOwnPropertyNames: xt, getOwnPropertySymbols: Et, getPrototypeOf: St } = Object, _ = globalThis, Q = _.trustedTypes, Ct = Q ? Q.emptyScript : "", B = _.reactiveElementPolyfillSupport, H = (r, t) => r, W = { toAttribute(r, t) {
|
|
53
57
|
switch (t) {
|
|
54
58
|
case Boolean:
|
|
55
|
-
r = r ?
|
|
59
|
+
r = r ? Ct : null;
|
|
56
60
|
break;
|
|
57
61
|
case Object:
|
|
58
62
|
case Array:
|
|
@@ -77,131 +81,154 @@ const T = window, G = T.trustedTypes, _t = G ? G.emptyScript : "", Y = T.reactiv
|
|
|
77
81
|
}
|
|
78
82
|
}
|
|
79
83
|
return e;
|
|
80
|
-
} }, ht = (r, t) =>
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
super(), this._$Ei = /* @__PURE__ */ new Map(), this.isUpdatePending = !1, this.hasUpdated = !1, this._$El = null, this.u();
|
|
84
|
-
}
|
|
84
|
+
} }, ht = (r, t) => !bt(r, t), X = { attribute: !0, type: String, converter: W, reflect: !1, hasChanged: ht };
|
|
85
|
+
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), _.litPropertyMetadata ?? (_.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
86
|
+
class v extends HTMLElement {
|
|
85
87
|
static addInitializer(t) {
|
|
86
|
-
|
|
87
|
-
this.finalize(), ((e = this.h) !== null && e !== void 0 ? e : this.h = []).push(t);
|
|
88
|
+
this._$Ei(), (this.l ?? (this.l = [])).push(t);
|
|
88
89
|
}
|
|
89
90
|
static get observedAttributes() {
|
|
90
|
-
this.finalize();
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
s
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
static createProperty(t, e = I) {
|
|
98
|
-
if (e.state && (e.attribute = !1), this.finalize(), this.elementProperties.set(t, e), !e.noAccessor && !this.prototype.hasOwnProperty(t)) {
|
|
99
|
-
const i = typeof t == "symbol" ? Symbol() : "__" + t, s = this.getPropertyDescriptor(t, i, e);
|
|
100
|
-
s !== void 0 && Object.defineProperty(this.prototype, t, s);
|
|
91
|
+
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
92
|
+
}
|
|
93
|
+
static createProperty(t, e = X) {
|
|
94
|
+
if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
|
|
95
|
+
const s = Symbol(), i = this.getPropertyDescriptor(t, s, e);
|
|
96
|
+
i !== void 0 && At(this.prototype, t, i);
|
|
101
97
|
}
|
|
102
98
|
}
|
|
103
|
-
static getPropertyDescriptor(t, e,
|
|
104
|
-
|
|
99
|
+
static getPropertyDescriptor(t, e, s) {
|
|
100
|
+
const { get: i, set: n } = vt(this.prototype, t) ?? { get() {
|
|
105
101
|
return this[e];
|
|
106
|
-
}, set(
|
|
107
|
-
|
|
108
|
-
|
|
102
|
+
}, set(o) {
|
|
103
|
+
this[e] = o;
|
|
104
|
+
} };
|
|
105
|
+
return { get() {
|
|
106
|
+
return i == null ? void 0 : i.call(this);
|
|
107
|
+
}, set(o) {
|
|
108
|
+
const c = i == null ? void 0 : i.call(this);
|
|
109
|
+
n.call(this, o), this.requestUpdate(t, c, s);
|
|
109
110
|
}, configurable: !0, enumerable: !0 };
|
|
110
111
|
}
|
|
111
112
|
static getPropertyOptions(t) {
|
|
112
|
-
return this.elementProperties.get(t)
|
|
113
|
+
return this.elementProperties.get(t) ?? X;
|
|
114
|
+
}
|
|
115
|
+
static _$Ei() {
|
|
116
|
+
if (this.hasOwnProperty(H("elementProperties")))
|
|
117
|
+
return;
|
|
118
|
+
const t = St(this);
|
|
119
|
+
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
|
113
120
|
}
|
|
114
121
|
static finalize() {
|
|
115
|
-
if (this.hasOwnProperty(
|
|
116
|
-
return
|
|
117
|
-
this
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
122
|
+
if (this.hasOwnProperty(H("finalized")))
|
|
123
|
+
return;
|
|
124
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(H("properties"))) {
|
|
125
|
+
const e = this.properties, s = [...xt(e), ...Et(e)];
|
|
126
|
+
for (const i of s)
|
|
127
|
+
this.createProperty(i, e[i]);
|
|
128
|
+
}
|
|
129
|
+
const t = this[Symbol.metadata];
|
|
130
|
+
if (t !== null) {
|
|
131
|
+
const e = litPropertyMetadata.get(t);
|
|
132
|
+
if (e !== void 0)
|
|
133
|
+
for (const [s, i] of e)
|
|
134
|
+
this.elementProperties.set(s, i);
|
|
135
|
+
}
|
|
136
|
+
this._$Eh = /* @__PURE__ */ new Map();
|
|
137
|
+
for (const [e, s] of this.elementProperties) {
|
|
138
|
+
const i = this._$Eu(e, s);
|
|
139
|
+
i !== void 0 && this._$Eh.set(i, e);
|
|
123
140
|
}
|
|
124
|
-
|
|
141
|
+
this.elementStyles = this.finalizeStyles(this.styles);
|
|
125
142
|
}
|
|
126
143
|
static finalizeStyles(t) {
|
|
127
144
|
const e = [];
|
|
128
145
|
if (Array.isArray(t)) {
|
|
129
|
-
const
|
|
130
|
-
for (const
|
|
131
|
-
e.unshift(
|
|
146
|
+
const s = new Set(t.flat(1 / 0).reverse());
|
|
147
|
+
for (const i of s)
|
|
148
|
+
e.unshift(G(i));
|
|
132
149
|
} else
|
|
133
|
-
t !== void 0 && e.push(
|
|
150
|
+
t !== void 0 && e.push(G(t));
|
|
134
151
|
return e;
|
|
135
152
|
}
|
|
136
|
-
static _$
|
|
137
|
-
const
|
|
138
|
-
return
|
|
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;
|
|
139
156
|
}
|
|
140
|
-
|
|
157
|
+
constructor() {
|
|
158
|
+
super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
|
|
159
|
+
}
|
|
160
|
+
_$Ev() {
|
|
141
161
|
var t;
|
|
142
|
-
this._$
|
|
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));
|
|
143
163
|
}
|
|
144
164
|
addController(t) {
|
|
145
|
-
var e
|
|
146
|
-
(
|
|
165
|
+
var e;
|
|
166
|
+
(this._$ES ?? (this._$ES = [])).push(t), this.renderRoot !== void 0 && this.isConnected && ((e = t.hostConnected) == null || e.call(t));
|
|
147
167
|
}
|
|
148
168
|
removeController(t) {
|
|
149
169
|
var e;
|
|
150
|
-
(e = this._$ES)
|
|
170
|
+
(e = this._$ES) == null || e.splice(this._$ES.indexOf(t) >>> 0, 1);
|
|
151
171
|
}
|
|
152
|
-
_$
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
172
|
+
_$E_() {
|
|
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]);
|
|
176
|
+
t.size > 0 && (this._$Ep = t);
|
|
156
177
|
}
|
|
157
178
|
createRenderRoot() {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
return yt(e, this.constructor.elementStyles), e;
|
|
179
|
+
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
180
|
+
return wt(t, this.constructor.elementStyles), t;
|
|
161
181
|
}
|
|
162
182
|
connectedCallback() {
|
|
163
183
|
var t;
|
|
164
|
-
this.renderRoot
|
|
165
|
-
var
|
|
166
|
-
return (
|
|
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);
|
|
167
187
|
});
|
|
168
188
|
}
|
|
169
189
|
enableUpdating(t) {
|
|
170
190
|
}
|
|
171
191
|
disconnectedCallback() {
|
|
172
192
|
var t;
|
|
173
|
-
(t = this._$ES)
|
|
174
|
-
var
|
|
175
|
-
return (
|
|
193
|
+
(t = this._$ES) == null || t.forEach((e) => {
|
|
194
|
+
var s;
|
|
195
|
+
return (s = e.hostDisconnected) == null ? void 0 : s.call(e);
|
|
176
196
|
});
|
|
177
197
|
}
|
|
178
|
-
attributeChangedCallback(t, e,
|
|
179
|
-
this._$AK(t,
|
|
198
|
+
attributeChangedCallback(t, e, s) {
|
|
199
|
+
this._$AK(t, s);
|
|
180
200
|
}
|
|
181
|
-
_$EO(t, e
|
|
182
|
-
var
|
|
183
|
-
const
|
|
184
|
-
if (
|
|
185
|
-
const o = (((
|
|
186
|
-
this._$
|
|
201
|
+
_$EO(t, e) {
|
|
202
|
+
var n;
|
|
203
|
+
const s = this.constructor.elementProperties.get(t), i = this.constructor._$Eu(t, s);
|
|
204
|
+
if (i !== void 0 && s.reflect === !0) {
|
|
205
|
+
const o = (((n = s.converter) == null ? void 0 : n.toAttribute) !== void 0 ? s.converter : W).toAttribute(e, s.type);
|
|
206
|
+
this._$Em = t, o == null ? this.removeAttribute(i) : this.setAttribute(i, o), this._$Em = null;
|
|
187
207
|
}
|
|
188
208
|
}
|
|
189
209
|
_$AK(t, e) {
|
|
190
|
-
var
|
|
191
|
-
const s = this.constructor,
|
|
192
|
-
if (
|
|
193
|
-
const o = s.getPropertyOptions(
|
|
194
|
-
this._$
|
|
210
|
+
var n;
|
|
211
|
+
const s = this.constructor, i = s._$Eh.get(t);
|
|
212
|
+
if (i !== void 0 && this._$Em !== i) {
|
|
213
|
+
const o = s.getPropertyOptions(i), c = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((n = o.converter) == null ? void 0 : n.fromAttribute) !== void 0 ? o.converter : W;
|
|
214
|
+
this._$Em = i, this[i] = c.fromAttribute(e, o.type), this._$Em = null;
|
|
195
215
|
}
|
|
196
216
|
}
|
|
197
|
-
requestUpdate(t, e, i) {
|
|
198
|
-
|
|
199
|
-
|
|
217
|
+
requestUpdate(t, e, s, i = !1, n) {
|
|
218
|
+
if (t !== void 0) {
|
|
219
|
+
if (s ?? (s = this.constructor.getPropertyOptions(t)), !(s.hasChanged ?? ht)(i ? n : this[t], e))
|
|
220
|
+
return;
|
|
221
|
+
this.C(t, e, s);
|
|
222
|
+
}
|
|
223
|
+
this.isUpdatePending === !1 && (this._$Eg = this._$EP());
|
|
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);
|
|
200
227
|
}
|
|
201
|
-
async _$
|
|
228
|
+
async _$EP() {
|
|
202
229
|
this.isUpdatePending = !0;
|
|
203
230
|
try {
|
|
204
|
-
await this._$
|
|
231
|
+
await this._$Eg;
|
|
205
232
|
} catch (e) {
|
|
206
233
|
Promise.reject(e);
|
|
207
234
|
}
|
|
@@ -212,139 +239,141 @@ let A = class extends HTMLElement {
|
|
|
212
239
|
return this.performUpdate();
|
|
213
240
|
}
|
|
214
241
|
performUpdate() {
|
|
215
|
-
var
|
|
242
|
+
var s;
|
|
216
243
|
if (!this.isUpdatePending)
|
|
217
244
|
return;
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
245
|
+
if (!this.hasUpdated) {
|
|
246
|
+
if (this._$Ep) {
|
|
247
|
+
for (const [n, o] of this._$Ep)
|
|
248
|
+
this[n] = o;
|
|
249
|
+
this._$Ep = void 0;
|
|
250
|
+
}
|
|
251
|
+
const i = this.constructor.elementProperties;
|
|
252
|
+
if (i.size > 0)
|
|
253
|
+
for (const [n, o] of i)
|
|
254
|
+
o.wrapped !== !0 || this._$AL.has(n) || this[n] === void 0 || this.C(n, this[n], o);
|
|
255
|
+
}
|
|
256
|
+
let t = !1;
|
|
257
|
+
const e = this._$AL;
|
|
221
258
|
try {
|
|
222
|
-
|
|
259
|
+
t = this.shouldUpdate(e), t ? (this.willUpdate(e), (s = this._$ES) == null || s.forEach((i) => {
|
|
223
260
|
var n;
|
|
224
|
-
return (n =
|
|
225
|
-
}), this.update(
|
|
226
|
-
} catch (
|
|
227
|
-
throw
|
|
261
|
+
return (n = i.hostUpdate) == null ? void 0 : n.call(i);
|
|
262
|
+
}), this.update(e)) : this._$ET();
|
|
263
|
+
} catch (i) {
|
|
264
|
+
throw t = !1, this._$ET(), i;
|
|
228
265
|
}
|
|
229
|
-
|
|
266
|
+
t && this._$AE(e);
|
|
230
267
|
}
|
|
231
268
|
willUpdate(t) {
|
|
232
269
|
}
|
|
233
270
|
_$AE(t) {
|
|
234
271
|
var e;
|
|
235
|
-
(e = this._$ES)
|
|
236
|
-
var
|
|
237
|
-
return (
|
|
272
|
+
(e = this._$ES) == null || e.forEach((s) => {
|
|
273
|
+
var i;
|
|
274
|
+
return (i = s.hostUpdated) == null ? void 0 : i.call(s);
|
|
238
275
|
}), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
|
|
239
276
|
}
|
|
240
|
-
_$
|
|
277
|
+
_$ET() {
|
|
241
278
|
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
|
|
242
279
|
}
|
|
243
280
|
get updateComplete() {
|
|
244
281
|
return this.getUpdateComplete();
|
|
245
282
|
}
|
|
246
283
|
getUpdateComplete() {
|
|
247
|
-
return this._$
|
|
284
|
+
return this._$Eg;
|
|
248
285
|
}
|
|
249
286
|
shouldUpdate(t) {
|
|
250
287
|
return !0;
|
|
251
288
|
}
|
|
252
289
|
update(t) {
|
|
253
|
-
this._$
|
|
290
|
+
this._$Ej && (this._$Ej = this._$Ej.forEach((e) => this._$EO(e, this[e]))), this._$ET();
|
|
254
291
|
}
|
|
255
292
|
updated(t) {
|
|
256
293
|
}
|
|
257
294
|
firstUpdated(t) {
|
|
258
295
|
}
|
|
259
|
-
}
|
|
260
|
-
|
|
296
|
+
}
|
|
297
|
+
v.elementStyles = [], v.shadowRootOptions = { mode: "open" }, v[H("elementProperties")] = /* @__PURE__ */ new Map(), v[H("finalized")] = /* @__PURE__ */ new Map(), B == null || B({ ReactiveElement: v }), (_.reactiveElementVersions ?? (_.reactiveElementVersions = [])).push("2.0.1");
|
|
261
298
|
/**
|
|
262
299
|
* @license
|
|
263
300
|
* Copyright 2017 Google LLC
|
|
264
301
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
265
302
|
*/
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
\f\r]
|
|
269
|
-
|
|
270
|
-
function pt(r, t) {
|
|
303
|
+
const I = globalThis, O = I.trustedTypes, Y = O ? O.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, lt = "$lit$", f = `lit$${(Math.random() + "").slice(9)}$`, ct = "?" + f, kt = `<${ct}>`, b = document, M = () => b.createComment(""), U = (r) => r === null || typeof r != "object" && typeof r != "function", dt = Array.isArray, Ht = (r) => dt(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", z = `[
|
|
304
|
+
\f\r]`, k = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, tt = /-->/g, et = />/g, m = RegExp(`>|${z}(?:([^\\s"'>=/]+)(${z}*=${z}*(?:[^
|
|
305
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), st = /'/g, it = /"/g, pt = /^(?:script|style|textarea|title)$/i, It = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), F = It(1), S = Symbol.for("lit-noChange"), l = Symbol.for("lit-nothing"), rt = /* @__PURE__ */ new WeakMap(), w = b.createTreeWalker(b, 129);
|
|
306
|
+
function ut(r, t) {
|
|
271
307
|
if (!Array.isArray(r) || !r.hasOwnProperty("raw"))
|
|
272
308
|
throw Error("invalid template strings array");
|
|
273
|
-
return
|
|
309
|
+
return Y !== void 0 ? Y.createHTML(t) : t;
|
|
274
310
|
}
|
|
275
|
-
const
|
|
276
|
-
const e = r.length - 1,
|
|
277
|
-
let
|
|
278
|
-
for (let
|
|
279
|
-
const
|
|
280
|
-
let
|
|
281
|
-
for (;
|
|
282
|
-
|
|
283
|
-
const
|
|
284
|
-
n += o ===
|
|
285
|
-
}
|
|
286
|
-
return [
|
|
311
|
+
const Mt = (r, t) => {
|
|
312
|
+
const e = r.length - 1, s = [];
|
|
313
|
+
let i, n = t === 2 ? "<svg>" : "", o = k;
|
|
314
|
+
for (let c = 0; c < e; c++) {
|
|
315
|
+
const a = r[c];
|
|
316
|
+
let d, p, h = -1, y = 0;
|
|
317
|
+
for (; y < a.length && (o.lastIndex = y, p = o.exec(a), p !== null); )
|
|
318
|
+
y = o.lastIndex, o === k ? p[1] === "!--" ? o = tt : p[1] !== void 0 ? o = et : p[2] !== void 0 ? (pt.test(p[2]) && (i = RegExp("</" + p[2], "g")), o = m) : p[3] !== void 0 && (o = m) : o === m ? p[0] === ">" ? (o = i ?? k, h = -1) : p[1] === void 0 ? h = -2 : (h = o.lastIndex - p[2].length, d = p[1], o = p[3] === void 0 ? m : p[3] === '"' ? it : st) : o === it || o === st ? o = m : o === tt || o === et ? o = k : (o = m, i = void 0);
|
|
319
|
+
const g = o === m && r[c + 1].startsWith("/>") ? " " : "";
|
|
320
|
+
n += o === k ? a + kt : h >= 0 ? (s.push(d), a.slice(0, h) + lt + a.slice(h) + f + g) : a + f + (h === -2 ? c : g);
|
|
321
|
+
}
|
|
322
|
+
return [ut(r, n + (r[e] || "<?>") + (t === 2 ? "</svg>" : "")), s];
|
|
287
323
|
};
|
|
288
|
-
class
|
|
289
|
-
constructor({ strings: t, _$litType$: e },
|
|
290
|
-
let
|
|
324
|
+
class P {
|
|
325
|
+
constructor({ strings: t, _$litType$: e }, s) {
|
|
326
|
+
let i;
|
|
291
327
|
this.parts = [];
|
|
292
328
|
let n = 0, o = 0;
|
|
293
|
-
const
|
|
294
|
-
if (this.el =
|
|
295
|
-
const
|
|
296
|
-
|
|
329
|
+
const c = t.length - 1, a = this.parts, [d, p] = Mt(t, e);
|
|
330
|
+
if (this.el = P.createElement(d, s), w.currentNode = this.el.content, e === 2) {
|
|
331
|
+
const h = this.el.content.firstChild;
|
|
332
|
+
h.replaceWith(...h.childNodes);
|
|
297
333
|
}
|
|
298
|
-
for (; (
|
|
299
|
-
if (
|
|
300
|
-
if (
|
|
301
|
-
const
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
if (ut.test(s.tagName)) {
|
|
315
|
-
const c = s.textContent.split(y), p = c.length - 1;
|
|
316
|
-
if (p > 0) {
|
|
317
|
-
s.textContent = b ? b.emptyScript : "";
|
|
318
|
-
for (let $ = 0; $ < p; $++)
|
|
319
|
-
s.append(c[$], C()), f.nextNode(), l.push({ type: 2, index: ++n });
|
|
320
|
-
s.append(c[p], C());
|
|
334
|
+
for (; (i = w.nextNode()) !== null && a.length < c; ) {
|
|
335
|
+
if (i.nodeType === 1) {
|
|
336
|
+
if (i.hasAttributes())
|
|
337
|
+
for (const h of i.getAttributeNames())
|
|
338
|
+
if (h.endsWith(lt)) {
|
|
339
|
+
const y = p[o++], g = i.getAttribute(h).split(f), L = /([.?@])?(.*)/.exec(y);
|
|
340
|
+
a.push({ type: 1, index: n, name: L[2], strings: g, ctor: L[1] === "." ? Pt : L[1] === "?" ? Dt : L[1] === "@" ? Lt : N }), i.removeAttribute(h);
|
|
341
|
+
} else
|
|
342
|
+
h.startsWith(f) && (a.push({ type: 6, index: n }), i.removeAttribute(h));
|
|
343
|
+
if (pt.test(i.tagName)) {
|
|
344
|
+
const h = i.textContent.split(f), y = h.length - 1;
|
|
345
|
+
if (y > 0) {
|
|
346
|
+
i.textContent = O ? O.emptyScript : "";
|
|
347
|
+
for (let g = 0; g < y; g++)
|
|
348
|
+
i.append(h[g], M()), w.nextNode(), a.push({ type: 2, index: ++n });
|
|
349
|
+
i.append(h[y], M());
|
|
321
350
|
}
|
|
322
351
|
}
|
|
323
|
-
} else if (
|
|
324
|
-
if (
|
|
325
|
-
|
|
352
|
+
} else if (i.nodeType === 8)
|
|
353
|
+
if (i.data === ct)
|
|
354
|
+
a.push({ type: 2, index: n });
|
|
326
355
|
else {
|
|
327
|
-
let
|
|
328
|
-
for (; (
|
|
329
|
-
|
|
356
|
+
let h = -1;
|
|
357
|
+
for (; (h = i.data.indexOf(f, h + 1)) !== -1; )
|
|
358
|
+
a.push({ type: 7, index: n }), h += f.length - 1;
|
|
330
359
|
}
|
|
331
360
|
n++;
|
|
332
361
|
}
|
|
333
362
|
}
|
|
334
363
|
static createElement(t, e) {
|
|
335
|
-
const
|
|
336
|
-
return
|
|
364
|
+
const s = b.createElement("template");
|
|
365
|
+
return s.innerHTML = t, s;
|
|
337
366
|
}
|
|
338
367
|
}
|
|
339
|
-
function
|
|
340
|
-
var
|
|
341
|
-
if (t ===
|
|
368
|
+
function C(r, t, e = r, s) {
|
|
369
|
+
var o, c;
|
|
370
|
+
if (t === S)
|
|
342
371
|
return t;
|
|
343
|
-
let
|
|
344
|
-
const
|
|
345
|
-
return (
|
|
372
|
+
let i = s !== void 0 ? (o = e._$Co) == null ? void 0 : o[s] : e._$Cl;
|
|
373
|
+
const n = U(t) ? void 0 : t._$litDirective$;
|
|
374
|
+
return (i == null ? void 0 : i.constructor) !== n && ((c = i == null ? void 0 : i._$AO) == null || c.call(i, !1), n === void 0 ? i = void 0 : (i = new n(r), i._$AT(r, e, s)), s !== void 0 ? (e._$Co ?? (e._$Co = []))[s] = i : e._$Cl = i), i !== void 0 && (t = C(r, i._$AS(r, t.values), i, s)), t;
|
|
346
375
|
}
|
|
347
|
-
class
|
|
376
|
+
class Ut {
|
|
348
377
|
constructor(t, e) {
|
|
349
378
|
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
|
|
350
379
|
}
|
|
@@ -355,33 +384,31 @@ class xt {
|
|
|
355
384
|
return this._$AM._$AU;
|
|
356
385
|
}
|
|
357
386
|
u(t) {
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
let o = f.nextNode(), h = 0, l = 0, a = s[0];
|
|
387
|
+
const { el: { content: e }, parts: s } = this._$AD, i = ((t == null ? void 0 : t.creationScope) ?? b).importNode(e, !0);
|
|
388
|
+
w.currentNode = i;
|
|
389
|
+
let n = w.nextNode(), o = 0, c = 0, a = s[0];
|
|
362
390
|
for (; a !== void 0; ) {
|
|
363
|
-
if (
|
|
391
|
+
if (o === a.index) {
|
|
364
392
|
let d;
|
|
365
|
-
a.type === 2 ? d = new
|
|
393
|
+
a.type === 2 ? d = new D(n, n.nextSibling, this, t) : a.type === 1 ? d = new a.ctor(n, a.name, a.strings, this, t) : a.type === 6 && (d = new Tt(n, this, t)), this._$AV.push(d), a = s[++c];
|
|
366
394
|
}
|
|
367
|
-
|
|
395
|
+
o !== (a == null ? void 0 : a.index) && (n = w.nextNode(), o++);
|
|
368
396
|
}
|
|
369
|
-
return
|
|
397
|
+
return w.currentNode = b, i;
|
|
370
398
|
}
|
|
371
|
-
|
|
399
|
+
p(t) {
|
|
372
400
|
let e = 0;
|
|
373
|
-
for (const
|
|
374
|
-
|
|
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++;
|
|
375
403
|
}
|
|
376
404
|
}
|
|
377
|
-
class
|
|
378
|
-
constructor(t, e, i, s) {
|
|
379
|
-
var 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;
|
|
381
|
-
}
|
|
405
|
+
class D {
|
|
382
406
|
get _$AU() {
|
|
383
|
-
var t
|
|
384
|
-
return (
|
|
407
|
+
var t;
|
|
408
|
+
return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
|
|
409
|
+
}
|
|
410
|
+
constructor(t, e, s, i) {
|
|
411
|
+
this.type = 2, this._$AH = l, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = i, this._$Cv = (i == null ? void 0 : i.isConnected) ?? !0;
|
|
385
412
|
}
|
|
386
413
|
get parentNode() {
|
|
387
414
|
let t = this._$AA.parentNode;
|
|
@@ -395,7 +422,7 @@ class k {
|
|
|
395
422
|
return this._$AB;
|
|
396
423
|
}
|
|
397
424
|
_$AI(t, e = this) {
|
|
398
|
-
t =
|
|
425
|
+
t = C(this, t, e), U(t) ? t === l || t == null || t === "" ? (this._$AH !== l && this._$AR(), this._$AH = l) : t !== this._$AH && t !== S && this._(t) : t._$litType$ !== void 0 ? this.g(t) : t.nodeType !== void 0 ? this.$(t) : Ht(t) ? this.T(t) : this._(t);
|
|
399
426
|
}
|
|
400
427
|
k(t) {
|
|
401
428
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -404,165 +431,201 @@ class k {
|
|
|
404
431
|
this._$AH !== t && (this._$AR(), this._$AH = this.k(t));
|
|
405
432
|
}
|
|
406
433
|
_(t) {
|
|
407
|
-
this._$AH !==
|
|
434
|
+
this._$AH !== l && U(this._$AH) ? this._$AA.nextSibling.data = t : this.$(b.createTextNode(t)), this._$AH = t;
|
|
408
435
|
}
|
|
409
436
|
g(t) {
|
|
410
|
-
var
|
|
411
|
-
const { values:
|
|
412
|
-
if (((
|
|
413
|
-
this._$AH.
|
|
437
|
+
var n;
|
|
438
|
+
const { values: e, _$litType$: s } = t, i = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = P.createElement(ut(s.h, s.h[0]), this.options)), s);
|
|
439
|
+
if (((n = this._$AH) == null ? void 0 : n._$AD) === i)
|
|
440
|
+
this._$AH.p(e);
|
|
414
441
|
else {
|
|
415
|
-
const o = new
|
|
416
|
-
o.
|
|
442
|
+
const o = new Ut(i, this), c = o.u(this.options);
|
|
443
|
+
o.p(e), this.$(c), this._$AH = o;
|
|
417
444
|
}
|
|
418
445
|
}
|
|
419
446
|
_$AC(t) {
|
|
420
|
-
let e =
|
|
421
|
-
return e === void 0 &&
|
|
447
|
+
let e = rt.get(t.strings);
|
|
448
|
+
return e === void 0 && rt.set(t.strings, e = new P(t)), e;
|
|
422
449
|
}
|
|
423
450
|
T(t) {
|
|
424
|
-
|
|
451
|
+
dt(this._$AH) || (this._$AH = [], this._$AR());
|
|
425
452
|
const e = this._$AH;
|
|
426
|
-
let
|
|
453
|
+
let s, i = 0;
|
|
427
454
|
for (const n of t)
|
|
428
|
-
|
|
429
|
-
|
|
455
|
+
i === e.length ? e.push(s = new D(this.k(M()), this.k(M()), this, this.options)) : s = e[i], s._$AI(n), i++;
|
|
456
|
+
i < e.length && (this._$AR(s && s._$AB.nextSibling, i), e.length = i);
|
|
430
457
|
}
|
|
431
458
|
_$AR(t = this._$AA.nextSibling, e) {
|
|
432
|
-
var
|
|
433
|
-
for ((
|
|
434
|
-
const
|
|
435
|
-
t.remove(), t =
|
|
459
|
+
var s;
|
|
460
|
+
for ((s = this._$AP) == null ? void 0 : s.call(this, !1, !0, e); t && t !== this._$AB; ) {
|
|
461
|
+
const i = t.nextSibling;
|
|
462
|
+
t.remove(), t = i;
|
|
436
463
|
}
|
|
437
464
|
}
|
|
438
465
|
setConnected(t) {
|
|
439
466
|
var e;
|
|
440
|
-
this._$AM === void 0 && (this._$
|
|
467
|
+
this._$AM === void 0 && (this._$Cv = t, (e = this._$AP) == null || e.call(this, t));
|
|
441
468
|
}
|
|
442
469
|
}
|
|
443
470
|
class N {
|
|
444
|
-
constructor(t, e, i, s, n) {
|
|
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;
|
|
446
|
-
}
|
|
447
471
|
get tagName() {
|
|
448
472
|
return this.element.tagName;
|
|
449
473
|
}
|
|
450
474
|
get _$AU() {
|
|
451
475
|
return this._$AM._$AU;
|
|
452
476
|
}
|
|
453
|
-
|
|
477
|
+
constructor(t, e, s, i, n) {
|
|
478
|
+
this.type = 1, this._$AH = l, this._$AN = void 0, this.element = t, this.name = e, this._$AM = i, this.options = n, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = l;
|
|
479
|
+
}
|
|
480
|
+
_$AI(t, e = this, s, i) {
|
|
454
481
|
const n = this.strings;
|
|
455
482
|
let o = !1;
|
|
456
483
|
if (n === void 0)
|
|
457
|
-
t =
|
|
484
|
+
t = C(this, t, e, 0), o = !U(t) || t !== this._$AH && t !== S, o && (this._$AH = t);
|
|
458
485
|
else {
|
|
459
|
-
const
|
|
460
|
-
let
|
|
461
|
-
for (t = n[0],
|
|
462
|
-
|
|
486
|
+
const c = t;
|
|
487
|
+
let a, d;
|
|
488
|
+
for (t = n[0], a = 0; a < n.length - 1; a++)
|
|
489
|
+
d = C(this, c[s + a], e, a), d === S && (d = this._$AH[a]), o || (o = !U(d) || d !== this._$AH[a]), d === l ? t = l : t !== l && (t += (d ?? "") + n[a + 1]), this._$AH[a] = d;
|
|
463
490
|
}
|
|
464
|
-
o && !
|
|
491
|
+
o && !i && this.O(t);
|
|
465
492
|
}
|
|
466
|
-
|
|
467
|
-
t ===
|
|
493
|
+
O(t) {
|
|
494
|
+
t === l ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
468
495
|
}
|
|
469
496
|
}
|
|
470
|
-
class
|
|
497
|
+
class Pt extends N {
|
|
471
498
|
constructor() {
|
|
472
499
|
super(...arguments), this.type = 3;
|
|
473
500
|
}
|
|
474
|
-
|
|
475
|
-
this.element[this.name] = t ===
|
|
501
|
+
O(t) {
|
|
502
|
+
this.element[this.name] = t === l ? void 0 : t;
|
|
476
503
|
}
|
|
477
504
|
}
|
|
478
|
-
|
|
479
|
-
class Ct extends N {
|
|
505
|
+
class Dt extends N {
|
|
480
506
|
constructor() {
|
|
481
507
|
super(...arguments), this.type = 4;
|
|
482
508
|
}
|
|
483
|
-
|
|
484
|
-
|
|
509
|
+
O(t) {
|
|
510
|
+
this.element.toggleAttribute(this.name, !!t && t !== l);
|
|
485
511
|
}
|
|
486
512
|
}
|
|
487
|
-
class
|
|
488
|
-
constructor(t, e,
|
|
489
|
-
super(t, e,
|
|
513
|
+
class Lt extends N {
|
|
514
|
+
constructor(t, e, s, i, n) {
|
|
515
|
+
super(t, e, s, i, n), this.type = 5;
|
|
490
516
|
}
|
|
491
517
|
_$AI(t, e = this) {
|
|
492
|
-
|
|
493
|
-
if ((t = (i = x(this, t, e, 0)) !== null && i !== void 0 ? i : u) === w)
|
|
518
|
+
if ((t = C(this, t, e, 0) ?? l) === S)
|
|
494
519
|
return;
|
|
495
|
-
const s = this._$AH,
|
|
496
|
-
|
|
520
|
+
const s = this._$AH, i = t === l && s !== l || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, n = t !== l && (s === l || i);
|
|
521
|
+
i && this.element.removeEventListener(this.name, this, s), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
497
522
|
}
|
|
498
523
|
handleEvent(t) {
|
|
499
|
-
var e
|
|
500
|
-
typeof this._$AH == "function" ? this._$AH.call((
|
|
524
|
+
var e;
|
|
525
|
+
typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t);
|
|
501
526
|
}
|
|
502
527
|
}
|
|
503
|
-
class
|
|
504
|
-
constructor(t, e,
|
|
505
|
-
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options =
|
|
528
|
+
class Tt {
|
|
529
|
+
constructor(t, e, s) {
|
|
530
|
+
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
|
|
506
531
|
}
|
|
507
532
|
get _$AU() {
|
|
508
533
|
return this._$AM._$AU;
|
|
509
534
|
}
|
|
510
535
|
_$AI(t) {
|
|
511
|
-
|
|
536
|
+
C(this, t);
|
|
512
537
|
}
|
|
513
538
|
}
|
|
514
|
-
const
|
|
515
|
-
|
|
516
|
-
const
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
return o._$AI(r), o;
|
|
539
|
+
const q = I.litHtmlPolyfillSupport;
|
|
540
|
+
q == null || q(P, D), (I.litHtmlVersions ?? (I.litHtmlVersions = [])).push("3.0.2");
|
|
541
|
+
const Ot = (r, t, e) => {
|
|
542
|
+
const s = (e == null ? void 0 : e.renderBefore) ?? t;
|
|
543
|
+
let i = s._$litPart$;
|
|
544
|
+
if (i === void 0) {
|
|
545
|
+
const n = (e == null ? void 0 : e.renderBefore) ?? null;
|
|
546
|
+
s._$litPart$ = i = new D(t.insertBefore(M(), n), n, void 0, e ?? {});
|
|
547
|
+
}
|
|
548
|
+
return i._$AI(r), i;
|
|
525
549
|
};
|
|
526
550
|
/**
|
|
527
551
|
* @license
|
|
528
552
|
* Copyright 2017 Google LLC
|
|
529
553
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
530
554
|
*/
|
|
531
|
-
|
|
532
|
-
class S extends A {
|
|
555
|
+
class x extends v {
|
|
533
556
|
constructor() {
|
|
534
557
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
535
558
|
}
|
|
536
559
|
createRenderRoot() {
|
|
537
|
-
var
|
|
538
|
-
const
|
|
539
|
-
return (
|
|
560
|
+
var e;
|
|
561
|
+
const t = super.createRenderRoot();
|
|
562
|
+
return (e = this.renderOptions).renderBefore ?? (e.renderBefore = t.firstChild), t;
|
|
540
563
|
}
|
|
541
564
|
update(t) {
|
|
542
565
|
const e = this.render();
|
|
543
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do =
|
|
566
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Ot(e, this.renderRoot, this.renderOptions);
|
|
544
567
|
}
|
|
545
568
|
connectedCallback() {
|
|
546
569
|
var t;
|
|
547
|
-
super.connectedCallback(), (t = this._$Do)
|
|
570
|
+
super.connectedCallback(), (t = this._$Do) == null || t.setConnected(!0);
|
|
548
571
|
}
|
|
549
572
|
disconnectedCallback() {
|
|
550
573
|
var t;
|
|
551
|
-
super.disconnectedCallback(), (t = this._$Do)
|
|
574
|
+
super.disconnectedCallback(), (t = this._$Do) == null || t.setConnected(!1);
|
|
552
575
|
}
|
|
553
576
|
render() {
|
|
554
|
-
return
|
|
577
|
+
return S;
|
|
555
578
|
}
|
|
556
579
|
}
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
580
|
+
var ot;
|
|
581
|
+
x._$litElement$ = !0, x.finalized = !0, (ot = globalThis.litElementHydrateSupport) == null || ot.call(globalThis, { LitElement: x });
|
|
582
|
+
const j = globalThis.litElementPolyfillSupport;
|
|
583
|
+
j == null || j({ LitElement: x });
|
|
584
|
+
(globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.0.1");
|
|
585
|
+
/**
|
|
586
|
+
* @license
|
|
587
|
+
* Copyright 2017 Google LLC
|
|
588
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
589
|
+
*/
|
|
590
|
+
const Ft = (r) => (...t) => ({ _$litDirective$: r, values: t });
|
|
591
|
+
let Nt = class {
|
|
592
|
+
constructor(t) {
|
|
593
|
+
}
|
|
594
|
+
get _$AU() {
|
|
595
|
+
return this._$AM._$AU;
|
|
596
|
+
}
|
|
597
|
+
_$AT(t, e, s) {
|
|
598
|
+
this._$Ct = t, this._$AM = e, this._$Ci = s;
|
|
599
|
+
}
|
|
600
|
+
_$AS(t, e) {
|
|
601
|
+
return this.update(t, e);
|
|
602
|
+
}
|
|
603
|
+
update(t, e) {
|
|
604
|
+
return this.render(...e);
|
|
605
|
+
}
|
|
606
|
+
};
|
|
607
|
+
/**
|
|
608
|
+
* @license
|
|
609
|
+
* Copyright 2020 Google LLC
|
|
610
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
611
|
+
*/
|
|
612
|
+
const Vt = {}, Rt = (r, t = Vt) => r._$AH = t;
|
|
613
|
+
/**
|
|
614
|
+
* @license
|
|
615
|
+
* Copyright 2021 Google LLC
|
|
616
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
617
|
+
*/
|
|
618
|
+
const Bt = Ft(class extends Nt {
|
|
619
|
+
constructor() {
|
|
620
|
+
super(...arguments), this.key = l;
|
|
621
|
+
}
|
|
622
|
+
render(r, t) {
|
|
623
|
+
return this.key = r, t;
|
|
624
|
+
}
|
|
625
|
+
update(r, [t, e]) {
|
|
626
|
+
return t !== this.key && (Rt(r), this.key = t), e;
|
|
627
|
+
}
|
|
628
|
+
}), zt = `
|
|
566
629
|
button {
|
|
567
630
|
/* TODO: why does this only work here and not from :root? */
|
|
568
631
|
--primary-color: #004170;
|
|
@@ -590,7 +653,7 @@ button {
|
|
|
590
653
|
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
591
654
|
}
|
|
592
655
|
|
|
593
|
-
button:hover:not([disabled]) {
|
|
656
|
+
button:hover:not([disabled]):not(.icon) {
|
|
594
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);
|
|
595
658
|
background: var(--primary-color-hover);
|
|
596
659
|
}
|
|
@@ -621,6 +684,7 @@ button.icon {
|
|
|
621
684
|
padding: 0;
|
|
622
685
|
border-radius: 50%;
|
|
623
686
|
width: 24px;
|
|
687
|
+
height: 24px;
|
|
624
688
|
text-indent: -9999px;
|
|
625
689
|
}
|
|
626
690
|
|
|
@@ -650,34 +714,235 @@ button.small {
|
|
|
650
714
|
padding: 12.4px;
|
|
651
715
|
font-size: .75rem;
|
|
652
716
|
}
|
|
653
|
-
`,
|
|
654
|
-
* {
|
|
655
|
-
|
|
656
|
-
}
|
|
717
|
+
`, $t = `
|
|
718
|
+
* {
|
|
719
|
+
font-family: Roboto, sans-serif;
|
|
720
|
+
}
|
|
657
721
|
|
|
658
|
-
${
|
|
722
|
+
${zt}
|
|
659
723
|
|
|
660
|
-
button.discard {
|
|
661
|
-
|
|
662
|
-
}
|
|
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;
|
|
663
784
|
|
|
664
|
-
|
|
665
|
-
|
|
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;
|
|
795
|
+
}
|
|
796
|
+
`, nt = (r, t, e = !1) => ({
|
|
797
|
+
id: r,
|
|
798
|
+
condition: t,
|
|
799
|
+
panIn: e,
|
|
800
|
+
layer: {
|
|
801
|
+
type: "Vector",
|
|
802
|
+
properties: {
|
|
803
|
+
id: "selectLayer"
|
|
804
|
+
},
|
|
805
|
+
source: {
|
|
806
|
+
type: "Vector"
|
|
807
|
+
},
|
|
808
|
+
style: {
|
|
809
|
+
"fill-color": "rgba(51, 153, 204,0.5)",
|
|
810
|
+
"stroke-color": "#3399CC",
|
|
811
|
+
"stroke-width": 2.5
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
});
|
|
815
|
+
class yt extends x {
|
|
816
|
+
constructor() {
|
|
817
|
+
super();
|
|
818
|
+
/**
|
|
819
|
+
* @type import("../../../map/src/select").EOxSelectInteraction
|
|
820
|
+
*/
|
|
821
|
+
A(this, "hoverInteraction");
|
|
822
|
+
/**
|
|
823
|
+
* @type import("../../../map/src/select").EOxSelectInteraction
|
|
824
|
+
*/
|
|
825
|
+
A(this, "clickInteraction");
|
|
826
|
+
/**
|
|
827
|
+
* @type string | number
|
|
828
|
+
*/
|
|
829
|
+
A(this, "hoverId");
|
|
830
|
+
/**
|
|
831
|
+
* @type string | number
|
|
832
|
+
*/
|
|
833
|
+
A(this, "clickId");
|
|
834
|
+
this.eoxMap = null, this.olMap = null, this.draw = null, this.layer = "draw", this.drawLayer = null, this.drawnFeatures = [], this.modify = null, this.unstyled = !1;
|
|
835
|
+
}
|
|
836
|
+
/**
|
|
837
|
+
* Delete individual feature @param {any} evt
|
|
838
|
+
*/
|
|
839
|
+
_handleDelete(e) {
|
|
840
|
+
e.stopPropagation();
|
|
841
|
+
const s = e.target.getAttribute("index"), i = this.drawnFeatures[s];
|
|
842
|
+
this.drawLayer.getSource().removeFeature(i), this.drawnFeatures.splice(s, 1), this.requestUpdate();
|
|
843
|
+
}
|
|
844
|
+
/**
|
|
845
|
+
* Select and Deselect feature from the list
|
|
846
|
+
*
|
|
847
|
+
* @param {import("ol").Feature} feature
|
|
848
|
+
*/
|
|
849
|
+
_handleFeatureSelectAndDeselect(e) {
|
|
850
|
+
const s = e.get("id");
|
|
851
|
+
if (this.clickId === s) {
|
|
852
|
+
const i = this.drawLayer.getSource().getExtent();
|
|
853
|
+
this.olMap.getView().fit(i, { duration: 750 }), this.clickInteraction.highlightById([]);
|
|
854
|
+
} else
|
|
855
|
+
this.clickInteraction.highlightById([s]), this.olMap.getView().fit(e.getGeometry().getExtent(), { duration: 750 });
|
|
856
|
+
this.requestUpdate();
|
|
857
|
+
}
|
|
858
|
+
firstUpdated() {
|
|
859
|
+
var i, n;
|
|
860
|
+
const e = (i = this.eoxMap) == null ? void 0 : i.selectInteractions["draw-hover"], s = (n = this.eoxMap) == null ? void 0 : n.selectInteractions["draw-click"];
|
|
861
|
+
e || (this.hoverInteraction = this.eoxMap.addSelect(
|
|
862
|
+
this.layer,
|
|
863
|
+
nt("draw-hover", "pointermove")
|
|
864
|
+
)), s || (this.clickInteraction = this.eoxMap.addSelect(
|
|
865
|
+
this.layer,
|
|
866
|
+
nt("draw-click", "click", !0)
|
|
867
|
+
)), this.hoverInteraction.selectStyleLayer.on(
|
|
868
|
+
"change",
|
|
869
|
+
() => this.requestUpdate()
|
|
870
|
+
), this.clickInteraction.selectStyleLayer.on(
|
|
871
|
+
"change",
|
|
872
|
+
() => this.requestUpdate()
|
|
873
|
+
);
|
|
874
|
+
}
|
|
875
|
+
render() {
|
|
876
|
+
var e, s;
|
|
877
|
+
return this.hoverInteraction = this.eoxMap.selectInteractions["draw-hover"], this.clickInteraction = this.eoxMap.selectInteractions["draw-click"], this.hoverId = (e = this.hoverInteraction) == null ? void 0 : e.selectedFids[0], this.clickId = (s = this.clickInteraction) == null ? void 0 : s.selectedFids[0], F`
|
|
878
|
+
<style>
|
|
879
|
+
${!this.unstyled && $t}
|
|
880
|
+
</style>
|
|
881
|
+
<ul>
|
|
882
|
+
${this.drawnFeatures.map((i, n) => {
|
|
883
|
+
const o = i.get("id"), c = this.hoverId === o || this.clickId === o;
|
|
884
|
+
return Bt(
|
|
885
|
+
n + 1,
|
|
886
|
+
F`
|
|
887
|
+
<li
|
|
888
|
+
class="${c ? "selected" : l}"
|
|
889
|
+
@mouseover=${() => {
|
|
890
|
+
this.clickId !== o && this.hoverInteraction.highlightById([o]);
|
|
891
|
+
}}
|
|
892
|
+
@mouseout=${() => {
|
|
893
|
+
this.clickId !== o && this.hoverInteraction.highlightById([]);
|
|
894
|
+
}}
|
|
895
|
+
>
|
|
896
|
+
<div
|
|
897
|
+
class="list"
|
|
898
|
+
@click="${() => this._handleFeatureSelectAndDeselect(i)}"
|
|
899
|
+
>
|
|
900
|
+
<span class="title">Feature #${n + 1}</span>
|
|
901
|
+
<button
|
|
902
|
+
index=${n}
|
|
903
|
+
class="icon small discard"
|
|
904
|
+
@click="${this._handleDelete}"
|
|
905
|
+
>
|
|
906
|
+
${this.unstyled ? "x" : l}
|
|
907
|
+
</button>
|
|
908
|
+
</div>
|
|
909
|
+
</li>
|
|
910
|
+
`
|
|
911
|
+
);
|
|
912
|
+
})}
|
|
913
|
+
</ul>
|
|
914
|
+
`;
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
A(yt, "properties", {
|
|
918
|
+
eoxMap: { attribute: !1, state: !0 },
|
|
919
|
+
olMap: { attribute: !1, state: !0 },
|
|
920
|
+
draw: { attribute: !1, state: !0 },
|
|
921
|
+
layer: { type: String },
|
|
922
|
+
drawLayer: { attribute: !1, state: !0 },
|
|
923
|
+
drawnFeatures: { attribute: !1, state: !0, type: Array },
|
|
924
|
+
modify: { attribute: !1, state: !0 },
|
|
925
|
+
unstyled: { type: Boolean }
|
|
926
|
+
});
|
|
927
|
+
customElements.define("eox-drawtools-list", yt);
|
|
928
|
+
const qt = `
|
|
929
|
+
:host {
|
|
930
|
+
display: block;
|
|
666
931
|
}
|
|
667
932
|
`;
|
|
668
|
-
var
|
|
669
|
-
class
|
|
933
|
+
var u, E;
|
|
934
|
+
class jt extends x {
|
|
670
935
|
constructor() {
|
|
671
936
|
super();
|
|
672
937
|
/**
|
|
673
938
|
* @type import("../../map/main").EOxMap
|
|
674
939
|
*/
|
|
675
|
-
|
|
940
|
+
V(this, u, void 0);
|
|
676
941
|
/**
|
|
677
942
|
* @type import("ol").Map
|
|
678
943
|
*/
|
|
679
|
-
|
|
680
|
-
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;
|
|
944
|
+
V(this, E, void 0);
|
|
945
|
+
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.showList = !1, this.unstyled = !1;
|
|
681
946
|
}
|
|
682
947
|
static get properties() {
|
|
683
948
|
return {
|
|
@@ -689,90 +954,103 @@ class Tt extends S {
|
|
|
689
954
|
layer: { type: String },
|
|
690
955
|
modify: { attribute: !1, state: !0 },
|
|
691
956
|
multipleFeatures: { attribute: "multiple-features", type: Boolean },
|
|
957
|
+
showList: { attribute: "show-list", type: Boolean },
|
|
692
958
|
unstyled: { type: Boolean }
|
|
693
959
|
};
|
|
694
960
|
}
|
|
695
961
|
startDrawing() {
|
|
696
|
-
var e,
|
|
697
|
-
|
|
962
|
+
var e, s;
|
|
963
|
+
$(this, u).addDraw(this.layer, {
|
|
698
964
|
id: "drawInteraction",
|
|
699
965
|
type: "Polygon",
|
|
700
966
|
stopClick: !0
|
|
701
967
|
}), this.draw = /** @type {import("ol/interaction").Draw} */
|
|
702
968
|
/** @type {unknown} */
|
|
703
|
-
|
|
969
|
+
$(this, u).interactions.drawInteraction, this.modify = /** @type {import("ol/interaction").Modify} */
|
|
704
970
|
/** @type {unknown} */
|
|
705
|
-
|
|
971
|
+
$(this, u).interactions.drawInteractionmodify, (e = this.draw) == null || e.on("drawend", (i) => this.onDrawEnd(i)), (s = this.modify) == null || s.on("modifyend", (i) => this.onModifyEnd(i)), this.currentlyDrawing = !0, this.requestUpdate();
|
|
706
972
|
}
|
|
707
973
|
discardDrawing() {
|
|
708
|
-
this.drawnFeatures = [],
|
|
974
|
+
this.drawnFeatures = [], $(this, u).removeInteraction("drawInteraction"), this.drawLayer.getSource().clear(), this.emitDrawnFeatures(), this.currentlyDrawing = !1, this.requestUpdate();
|
|
709
975
|
}
|
|
710
976
|
/**
|
|
711
977
|
*
|
|
712
978
|
* @param {import("ol/interaction/Draw").DrawEvent} evt
|
|
713
979
|
*/
|
|
714
|
-
onDrawEnd(
|
|
715
|
-
|
|
980
|
+
onDrawEnd() {
|
|
981
|
+
this.emitDrawnFeatures(), $(this, u).removeInteraction("drawInteraction"), this.currentlyDrawing = !1, this.requestUpdate();
|
|
716
982
|
}
|
|
717
983
|
/**
|
|
718
984
|
*
|
|
719
985
|
* @param {import("ol/interaction/Modify").ModifyEvent} evt
|
|
720
986
|
*/
|
|
721
|
-
onModifyEnd(
|
|
722
|
-
|
|
987
|
+
onModifyEnd() {
|
|
988
|
+
this.emitDrawnFeatures();
|
|
723
989
|
}
|
|
724
990
|
emitDrawnFeatures() {
|
|
725
991
|
setTimeout(() => {
|
|
726
|
-
this.drawnFeatures = this.drawLayer.getSource().getFeatures(), this.requestUpdate()
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
992
|
+
this.drawnFeatures = this.drawLayer.getSource().getFeatures(), this.requestUpdate(), this.dispatchEvent(
|
|
993
|
+
new CustomEvent("drawupdate", {
|
|
994
|
+
detail: this.drawnFeatures
|
|
995
|
+
})
|
|
996
|
+
);
|
|
731
997
|
}, 0);
|
|
732
998
|
}
|
|
733
999
|
render() {
|
|
734
|
-
var i,
|
|
1000
|
+
var s, i, n;
|
|
735
1001
|
const e = document.querySelector(this.for);
|
|
736
1002
|
return R(
|
|
737
1003
|
this,
|
|
738
|
-
|
|
1004
|
+
u,
|
|
739
1005
|
/** @type {import("@eox/map/main").EOxMap} */
|
|
740
1006
|
e
|
|
741
1007
|
), R(
|
|
742
1008
|
this,
|
|
743
|
-
|
|
1009
|
+
E,
|
|
744
1010
|
/** @type {import("ol").Map} */
|
|
745
|
-
|
|
1011
|
+
$(this, u).map
|
|
746
1012
|
), this.drawLayer = /** @type {import("ol/layer").Vector<import("ol/source").Vector>} */
|
|
747
|
-
|
|
1013
|
+
$(this, E).getLayers().getArray().find((o) => o.get("id") === this.layer), this.requestUpdate(), F`
|
|
748
1014
|
<style>
|
|
749
|
-
${
|
|
750
|
-
${!this.unstyled &&
|
|
1015
|
+
${qt}
|
|
1016
|
+
${!this.unstyled && $t}
|
|
751
1017
|
</style>
|
|
752
1018
|
<div>
|
|
753
1019
|
<slot></slot>
|
|
754
1020
|
<button
|
|
755
1021
|
data-cy="drawBtn"
|
|
756
|
-
class="icon
|
|
757
|
-
disabled="${!this.multipleFeatures && ((
|
|
1022
|
+
class="polygon icon"
|
|
1023
|
+
disabled="${!this.multipleFeatures && ((s = this.drawnFeatures) == null ? void 0 : s.length) > 0 || this.currentlyDrawing || l}"
|
|
758
1024
|
@click="${() => this.startDrawing()}"
|
|
759
1025
|
>
|
|
760
1026
|
${this.currentlyDrawing ? "drawing" : "draw"}
|
|
761
1027
|
</button>
|
|
762
1028
|
<button
|
|
763
1029
|
data-cy="discardBtn"
|
|
764
|
-
class="discard"
|
|
765
|
-
disabled="${!((
|
|
1030
|
+
class="discard icon"
|
|
1031
|
+
disabled="${!((i = this.drawnFeatures) != null && i.length) && !this.currentlyDrawing || l}"
|
|
766
1032
|
@click="${() => this.discardDrawing()}"
|
|
767
1033
|
>
|
|
768
1034
|
discard
|
|
769
1035
|
</button>
|
|
770
1036
|
</div>
|
|
1037
|
+
${this.showList && ((n = this.drawnFeatures) != null && n.length) ? F`<eox-drawtools-list
|
|
1038
|
+
.eoxMap=${$(this, u)}
|
|
1039
|
+
.olMap=${$(this, E)}
|
|
1040
|
+
.draw=${this.draw}
|
|
1041
|
+
.layer=${this.layer}
|
|
1042
|
+
.drawLayer=${this.drawLayer}
|
|
1043
|
+
.drawnFeatures=${this.drawnFeatures}
|
|
1044
|
+
.modify=${this.modify}
|
|
1045
|
+
.unstyled=${this.unstyled}
|
|
1046
|
+
@changed=${() => this.requestUpdate()}
|
|
1047
|
+
>
|
|
1048
|
+
</eox-drawtools-list>` : l}
|
|
771
1049
|
`;
|
|
772
1050
|
}
|
|
773
1051
|
}
|
|
774
|
-
|
|
775
|
-
customElements.define("eox-drawtools",
|
|
1052
|
+
u = new WeakMap(), E = new WeakMap();
|
|
1053
|
+
customElements.define("eox-drawtools", jt);
|
|
776
1054
|
export {
|
|
777
|
-
|
|
1055
|
+
jt as EOxDrawTools
|
|
778
1056
|
};
|