@digipair/skill-web-inputs 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.esm.js ADDED
@@ -0,0 +1,3941 @@
1
+ function __decorate(decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ }
7
+ function __metadata(metadataKey, metadataValue) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
9
+ }
10
+ typeof SuppressedError === "function" ? SuppressedError : function _SuppressedError(error, suppressed, message) {
11
+ var e = new Error(message);
12
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
13
+ };
14
+
15
+ /**
16
+ * @license
17
+ * Copyright 2019 Google LLC
18
+ * SPDX-License-Identifier: BSD-3-Clause
19
+ */ function _class_call_check$3(instance, Constructor) {
20
+ if (!(instance instanceof Constructor)) {
21
+ throw new TypeError("Cannot call a class as a function");
22
+ }
23
+ }
24
+ function _defineProperties$3(target, props) {
25
+ for(var i = 0; i < props.length; i++){
26
+ var descriptor = props[i];
27
+ descriptor.enumerable = descriptor.enumerable || false;
28
+ descriptor.configurable = true;
29
+ if ("value" in descriptor) descriptor.writable = true;
30
+ Object.defineProperty(target, descriptor.key, descriptor);
31
+ }
32
+ }
33
+ function _create_class$3(Constructor, protoProps, staticProps) {
34
+ if (protoProps) _defineProperties$3(Constructor.prototype, protoProps);
35
+ if (staticProps) _defineProperties$3(Constructor, staticProps);
36
+ return Constructor;
37
+ }
38
+ function _instanceof$3(left, right) {
39
+ if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
40
+ return !!right[Symbol.hasInstance](left);
41
+ } else {
42
+ return left instanceof right;
43
+ }
44
+ }
45
+ var t$2 = globalThis, e$2 = t$2.ShadowRoot && (void 0 === t$2.ShadyCSS || t$2.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, s$2 = Symbol(), o$3 = new WeakMap;
46
+ var n$3 = /*#__PURE__*/ function() {
47
+ function n(t, e, o) {
48
+ _class_call_check$3(this, n);
49
+ if (this._$cssResult$ = !0, o !== s$2) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
50
+ this.cssText = t, this.t = e;
51
+ }
52
+ _create_class$3(n, [
53
+ {
54
+ key: "styleSheet",
55
+ get: function get() {
56
+ var t = this.o;
57
+ var s = this.t;
58
+ if (e$2 && void 0 === t) {
59
+ var e1 = void 0 !== s && 1 === s.length;
60
+ e1 && (t = o$3.get(s)), void 0 === t && ((this.o = t = new CSSStyleSheet).replaceSync(this.cssText), e1 && o$3.set(s, t));
61
+ }
62
+ return t;
63
+ }
64
+ },
65
+ {
66
+ key: "toString",
67
+ value: function toString() {
68
+ return this.cssText;
69
+ }
70
+ }
71
+ ]);
72
+ return n;
73
+ }();
74
+ var r$5 = function(t) {
75
+ return new n$3("string" == typeof t ? t : t + "", void 0, s$2);
76
+ }, i$2 = function(t) {
77
+ for(var _len = arguments.length, e = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
78
+ e[_key - 1] = arguments[_key];
79
+ }
80
+ var o = 1 === t.length ? t[0] : e.reduce(function(e, s, o) {
81
+ return e + function(t) {
82
+ if (!0 === t._$cssResult$) return t.cssText;
83
+ if ("number" == typeof t) return t;
84
+ throw Error("Value passed to 'css' function must be a 'css' function result: " + t + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
85
+ }(s) + t[o + 1];
86
+ }, t[0]);
87
+ return new n$3(o, t, s$2);
88
+ }, S$1 = function(s, o) {
89
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
90
+ if (e$2) s.adoptedStyleSheets = o.map(function(t) {
91
+ return _instanceof$3(t, CSSStyleSheet) ? t : t.styleSheet;
92
+ });
93
+ else try {
94
+ for(var _iterator = o[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
95
+ var e1 = _step.value;
96
+ var _$o = document.createElement("style"), n = t$2.litNonce;
97
+ void 0 !== n && _$o.setAttribute("nonce", n), _$o.textContent = e1.cssText, s.appendChild(_$o);
98
+ }
99
+ } catch (err) {
100
+ _didIteratorError = true;
101
+ _iteratorError = err;
102
+ } finally{
103
+ try {
104
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
105
+ _iterator.return();
106
+ }
107
+ } finally{
108
+ if (_didIteratorError) {
109
+ throw _iteratorError;
110
+ }
111
+ }
112
+ }
113
+ }, c$2 = e$2 ? function(t) {
114
+ return t;
115
+ } : function(t) {
116
+ return _instanceof$3(t, CSSStyleSheet) ? function(t) {
117
+ var e = "";
118
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
119
+ try {
120
+ for(var _iterator = t.cssRules[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
121
+ var s = _step.value;
122
+ e += s.cssText;
123
+ }
124
+ } catch (err) {
125
+ _didIteratorError = true;
126
+ _iteratorError = err;
127
+ } finally{
128
+ try {
129
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
130
+ _iterator.return();
131
+ }
132
+ } finally{
133
+ if (_didIteratorError) {
134
+ throw _iteratorError;
135
+ }
136
+ }
137
+ }
138
+ return r$5(e);
139
+ }(t) : t;
140
+ };
141
+
142
+ function _array_like_to_array$a(arr, len) {
143
+ if (len == null || len > arr.length) len = arr.length;
144
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
145
+ return arr2;
146
+ }
147
+ function _array_with_holes$3(arr) {
148
+ if (Array.isArray(arr)) return arr;
149
+ }
150
+ function _array_without_holes$9(arr) {
151
+ if (Array.isArray(arr)) return _array_like_to_array$a(arr);
152
+ }
153
+ function _assert_this_initialized$2(self) {
154
+ if (self === void 0) {
155
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
156
+ }
157
+ return self;
158
+ }
159
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
160
+ try {
161
+ var info = gen[key](arg);
162
+ var value = info.value;
163
+ } catch (error) {
164
+ reject(error);
165
+ return;
166
+ }
167
+ if (info.done) {
168
+ resolve(value);
169
+ } else {
170
+ Promise.resolve(value).then(_next, _throw);
171
+ }
172
+ }
173
+ function _async_to_generator(fn) {
174
+ return function() {
175
+ var self = this, args = arguments;
176
+ return new Promise(function(resolve, reject) {
177
+ var gen = fn.apply(self, args);
178
+ function _next(value) {
179
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
180
+ }
181
+ function _throw(err) {
182
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
183
+ }
184
+ _next(undefined);
185
+ });
186
+ };
187
+ }
188
+ function _class_call_check$2(instance, Constructor) {
189
+ if (!(instance instanceof Constructor)) {
190
+ throw new TypeError("Cannot call a class as a function");
191
+ }
192
+ }
193
+ function _construct(Parent, args, Class) {
194
+ if (_is_native_reflect_construct$2()) {
195
+ _construct = Reflect.construct;
196
+ } else {
197
+ _construct = function construct(Parent, args, Class) {
198
+ var a = [
199
+ null
200
+ ];
201
+ a.push.apply(a, args);
202
+ var Constructor = Function.bind.apply(Parent, a);
203
+ var instance = new Constructor();
204
+ if (Class) _set_prototype_of$2(instance, Class.prototype);
205
+ return instance;
206
+ };
207
+ }
208
+ return _construct.apply(null, arguments);
209
+ }
210
+ function _defineProperties$2(target, props) {
211
+ for(var i = 0; i < props.length; i++){
212
+ var descriptor = props[i];
213
+ descriptor.enumerable = descriptor.enumerable || false;
214
+ descriptor.configurable = true;
215
+ if ("value" in descriptor) descriptor.writable = true;
216
+ Object.defineProperty(target, descriptor.key, descriptor);
217
+ }
218
+ }
219
+ function _create_class$2(Constructor, protoProps, staticProps) {
220
+ if (protoProps) _defineProperties$2(Constructor.prototype, protoProps);
221
+ if (staticProps) _defineProperties$2(Constructor, staticProps);
222
+ return Constructor;
223
+ }
224
+ function _get_prototype_of$2(o) {
225
+ _get_prototype_of$2 = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
226
+ return o.__proto__ || Object.getPrototypeOf(o);
227
+ };
228
+ return _get_prototype_of$2(o);
229
+ }
230
+ function _inherits$2(subClass, superClass) {
231
+ if (typeof superClass !== "function" && superClass !== null) {
232
+ throw new TypeError("Super expression must either be null or a function");
233
+ }
234
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
235
+ constructor: {
236
+ value: subClass,
237
+ writable: true,
238
+ configurable: true
239
+ }
240
+ });
241
+ if (superClass) _set_prototype_of$2(subClass, superClass);
242
+ }
243
+ function _is_native_function(fn) {
244
+ return Function.toString.call(fn).indexOf("[native code]") !== -1;
245
+ }
246
+ function _iterable_to_array$9(iter) {
247
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
248
+ }
249
+ function _iterable_to_array_limit$2(arr, i) {
250
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
251
+ if (_i == null) return;
252
+ var _arr = [];
253
+ var _n = true;
254
+ var _d = false;
255
+ var _s, _e;
256
+ try {
257
+ for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
258
+ _arr.push(_s.value);
259
+ if (i && _arr.length === i) break;
260
+ }
261
+ } catch (err) {
262
+ _d = true;
263
+ _e = err;
264
+ } finally{
265
+ try {
266
+ if (!_n && _i["return"] != null) _i["return"]();
267
+ } finally{
268
+ if (_d) throw _e;
269
+ }
270
+ }
271
+ return _arr;
272
+ }
273
+ function _non_iterable_rest$3() {
274
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
275
+ }
276
+ function _non_iterable_spread$9() {
277
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
278
+ }
279
+ function _possible_constructor_return$2(self, call) {
280
+ if (call && (_type_of$3(call) === "object" || typeof call === "function")) {
281
+ return call;
282
+ }
283
+ return _assert_this_initialized$2(self);
284
+ }
285
+ function _set_prototype_of$2(o, p) {
286
+ _set_prototype_of$2 = Object.setPrototypeOf || function setPrototypeOf(o, p) {
287
+ o.__proto__ = p;
288
+ return o;
289
+ };
290
+ return _set_prototype_of$2(o, p);
291
+ }
292
+ function _sliced_to_array$2(arr, i) {
293
+ return _array_with_holes$3(arr) || _iterable_to_array_limit$2(arr, i) || _unsupported_iterable_to_array$a(arr, i) || _non_iterable_rest$3();
294
+ }
295
+ function _to_consumable_array$9(arr) {
296
+ return _array_without_holes$9(arr) || _iterable_to_array$9(arr) || _unsupported_iterable_to_array$a(arr) || _non_iterable_spread$9();
297
+ }
298
+ function _type_of$3(obj) {
299
+ "@swc/helpers - typeof";
300
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
301
+ }
302
+ function _unsupported_iterable_to_array$a(o, minLen) {
303
+ if (!o) return;
304
+ if (typeof o === "string") return _array_like_to_array$a(o, minLen);
305
+ var n = Object.prototype.toString.call(o).slice(8, -1);
306
+ if (n === "Object" && o.constructor) n = o.constructor.name;
307
+ if (n === "Map" || n === "Set") return Array.from(n);
308
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$a(o, minLen);
309
+ }
310
+ function _wrap_native_super(Class) {
311
+ var _cache = typeof Map === "function" ? new Map() : undefined;
312
+ _wrap_native_super = function wrapNativeSuper(Class) {
313
+ if (Class === null || !_is_native_function(Class)) return Class;
314
+ if (typeof Class !== "function") {
315
+ throw new TypeError("Super expression must either be null or a function");
316
+ }
317
+ if (typeof _cache !== "undefined") {
318
+ if (_cache.has(Class)) return _cache.get(Class);
319
+ _cache.set(Class, Wrapper);
320
+ }
321
+ function Wrapper() {
322
+ return _construct(Class, arguments, _get_prototype_of$2(this).constructor);
323
+ }
324
+ Wrapper.prototype = Object.create(Class.prototype, {
325
+ constructor: {
326
+ value: Wrapper,
327
+ enumerable: false,
328
+ writable: true,
329
+ configurable: true
330
+ }
331
+ });
332
+ return _set_prototype_of$2(Wrapper, Class);
333
+ };
334
+ return _wrap_native_super(Class);
335
+ }
336
+ function _is_native_reflect_construct$2() {
337
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
338
+ if (Reflect.construct.sham) return false;
339
+ if (typeof Proxy === "function") return true;
340
+ try {
341
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
342
+ return true;
343
+ } catch (e) {
344
+ return false;
345
+ }
346
+ }
347
+ function _create_super$2(Derived) {
348
+ var hasNativeReflectConstruct = _is_native_reflect_construct$2();
349
+ return function _createSuperInternal() {
350
+ var Super = _get_prototype_of$2(Derived), result;
351
+ if (hasNativeReflectConstruct) {
352
+ var NewTarget = _get_prototype_of$2(this).constructor;
353
+ result = Reflect.construct(Super, arguments, NewTarget);
354
+ } else {
355
+ result = Super.apply(this, arguments);
356
+ }
357
+ return _possible_constructor_return$2(this, result);
358
+ };
359
+ }
360
+ function _ts_generator$1(thisArg, body) {
361
+ var f, y, t, g, _ = {
362
+ label: 0,
363
+ sent: function() {
364
+ if (t[0] & 1) throw t[1];
365
+ return t[1];
366
+ },
367
+ trys: [],
368
+ ops: []
369
+ };
370
+ return g = {
371
+ next: verb(0),
372
+ "throw": verb(1),
373
+ "return": verb(2)
374
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
375
+ return this;
376
+ }), g;
377
+ function verb(n) {
378
+ return function(v) {
379
+ return step([
380
+ n,
381
+ v
382
+ ]);
383
+ };
384
+ }
385
+ function step(op) {
386
+ if (f) throw new TypeError("Generator is already executing.");
387
+ while(_)try {
388
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
389
+ if (y = 0, t) op = [
390
+ op[0] & 2,
391
+ t.value
392
+ ];
393
+ switch(op[0]){
394
+ case 0:
395
+ case 1:
396
+ t = op;
397
+ break;
398
+ case 4:
399
+ _.label++;
400
+ return {
401
+ value: op[1],
402
+ done: false
403
+ };
404
+ case 5:
405
+ _.label++;
406
+ y = op[1];
407
+ op = [
408
+ 0
409
+ ];
410
+ continue;
411
+ case 7:
412
+ op = _.ops.pop();
413
+ _.trys.pop();
414
+ continue;
415
+ default:
416
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
417
+ _ = 0;
418
+ continue;
419
+ }
420
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
421
+ _.label = op[1];
422
+ break;
423
+ }
424
+ if (op[0] === 6 && _.label < t[1]) {
425
+ _.label = t[1];
426
+ t = op;
427
+ break;
428
+ }
429
+ if (t && _.label < t[2]) {
430
+ _.label = t[2];
431
+ _.ops.push(op);
432
+ break;
433
+ }
434
+ if (t[2]) _.ops.pop();
435
+ _.trys.pop();
436
+ continue;
437
+ }
438
+ op = body.call(thisArg, _);
439
+ } catch (e) {
440
+ op = [
441
+ 6,
442
+ e
443
+ ];
444
+ y = 0;
445
+ } finally{
446
+ f = t = 0;
447
+ }
448
+ if (op[0] & 5) throw op[1];
449
+ return {
450
+ value: op[0] ? op[1] : void 0,
451
+ done: true
452
+ };
453
+ }
454
+ }
455
+ var _Symbol, _a, _a1;
456
+ /**
457
+ * @license
458
+ * Copyright 2017 Google LLC
459
+ * SPDX-License-Identifier: BSD-3-Clause
460
+ */ var i$1 = Object.is, e$1 = Object.defineProperty, r$4 = Object.getOwnPropertyDescriptor, h$1 = Object.getOwnPropertyNames, o$2 = Object.getOwnPropertySymbols, n$2 = Object.getPrototypeOf, a$1 = globalThis, c$1 = a$1.trustedTypes, l$1 = c$1 ? c$1.emptyScript : "", p$1 = a$1.reactiveElementPolyfillSupport, d$1 = function(t, s) {
461
+ return t;
462
+ }, u$1 = {
463
+ toAttribute: function toAttribute(t, s) {
464
+ switch(s){
465
+ case Boolean:
466
+ t = t ? l$1 : null;
467
+ break;
468
+ case Object:
469
+ case Array:
470
+ t = null == t ? t : JSON.stringify(t);
471
+ }
472
+ return t;
473
+ },
474
+ fromAttribute: function fromAttribute(t, s) {
475
+ var i = t;
476
+ switch(s){
477
+ case Boolean:
478
+ i = null !== t;
479
+ break;
480
+ case Number:
481
+ i = null === t ? null : Number(t);
482
+ break;
483
+ case Object:
484
+ case Array:
485
+ try {
486
+ i = JSON.parse(t);
487
+ } catch (t) {
488
+ i = null;
489
+ }
490
+ }
491
+ return i;
492
+ }
493
+ }, f$1 = function(t, s) {
494
+ return !i$1(t, s);
495
+ }, y$1 = {
496
+ attribute: !0,
497
+ type: String,
498
+ converter: u$1,
499
+ reflect: !1,
500
+ hasChanged: f$1
501
+ };
502
+ var _metadata, _litPropertyMetadata;
503
+ (_metadata = (_Symbol = Symbol).metadata) !== null && _metadata !== void 0 ? _metadata : _Symbol.metadata = Symbol("metadata"), (_litPropertyMetadata = (_a = a$1).litPropertyMetadata) !== null && _litPropertyMetadata !== void 0 ? _litPropertyMetadata : _a.litPropertyMetadata = new WeakMap;
504
+ var b = /*#__PURE__*/ function(HTMLElement1) {
505
+ _inherits$2(b, HTMLElement1);
506
+ var _super = _create_super$2(b);
507
+ function b() {
508
+ _class_call_check$2(this, b);
509
+ var _this;
510
+ _this = _super.call(this), _this._$Ep = void 0, _this.isUpdatePending = !1, _this.hasUpdated = !1, _this._$Em = null, _this._$Ev();
511
+ return _possible_constructor_return$2(_this);
512
+ }
513
+ _create_class$2(b, [
514
+ {
515
+ key: "_$Ev",
516
+ value: function _$Ev() {
517
+ var _this = this;
518
+ var _this_constructor_l;
519
+ this._$ES = new Promise(function(t) {
520
+ return _this.enableUpdating = t;
521
+ }), this._$AL = new Map, this._$E_(), this.requestUpdate(), (_this_constructor_l = this.constructor.l) === null || _this_constructor_l === void 0 ? void 0 : _this_constructor_l.forEach(function(t) {
522
+ return t(_this);
523
+ });
524
+ }
525
+ },
526
+ {
527
+ key: "addController",
528
+ value: function addController(t) {
529
+ var _t_hostConnected;
530
+ var _this__$EO;
531
+ ((_this__$EO = this._$EO) !== null && _this__$EO !== void 0 ? _this__$EO : this._$EO = new Set).add(t), void 0 !== this.renderRoot && this.isConnected && ((_t_hostConnected = t.hostConnected) === null || _t_hostConnected === void 0 ? void 0 : _t_hostConnected.call(t));
532
+ }
533
+ },
534
+ {
535
+ key: "removeController",
536
+ value: function removeController(t) {
537
+ var _this__$EO;
538
+ (_this__$EO = this._$EO) === null || _this__$EO === void 0 ? void 0 : _this__$EO.delete(t);
539
+ }
540
+ },
541
+ {
542
+ key: "_$E_",
543
+ value: function _$E_() {
544
+ var t = new Map, s = this.constructor.elementProperties;
545
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
546
+ try {
547
+ for(var _iterator = s.keys()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
548
+ var i = _step.value;
549
+ this.hasOwnProperty(i) && (t.set(i, this[i]), delete this[i]);
550
+ }
551
+ } catch (err) {
552
+ _didIteratorError = true;
553
+ _iteratorError = err;
554
+ } finally{
555
+ try {
556
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
557
+ _iterator.return();
558
+ }
559
+ } finally{
560
+ if (_didIteratorError) {
561
+ throw _iteratorError;
562
+ }
563
+ }
564
+ }
565
+ t.size > 0 && (this._$Ep = t);
566
+ }
567
+ },
568
+ {
569
+ key: "createRenderRoot",
570
+ value: function createRenderRoot() {
571
+ var _this_shadowRoot;
572
+ var t = (_this_shadowRoot = this.shadowRoot) !== null && _this_shadowRoot !== void 0 ? _this_shadowRoot : this.attachShadow(this.constructor.shadowRootOptions);
573
+ return S$1(t, this.constructor.elementStyles), t;
574
+ }
575
+ },
576
+ {
577
+ key: "connectedCallback",
578
+ value: function connectedCallback() {
579
+ var _this__$EO;
580
+ var _this_renderRoot;
581
+ (_this_renderRoot = this.renderRoot) !== null && _this_renderRoot !== void 0 ? _this_renderRoot : this.renderRoot = this.createRenderRoot(), this.enableUpdating(!0), (_this__$EO = this._$EO) === null || _this__$EO === void 0 ? void 0 : _this__$EO.forEach(function(t) {
582
+ var _t_hostConnected;
583
+ return (_t_hostConnected = t.hostConnected) === null || _t_hostConnected === void 0 ? void 0 : _t_hostConnected.call(t);
584
+ });
585
+ }
586
+ },
587
+ {
588
+ key: "enableUpdating",
589
+ value: function enableUpdating(t) {}
590
+ },
591
+ {
592
+ key: "disconnectedCallback",
593
+ value: function disconnectedCallback() {
594
+ var _this__$EO;
595
+ (_this__$EO = this._$EO) === null || _this__$EO === void 0 ? void 0 : _this__$EO.forEach(function(t) {
596
+ var _t_hostDisconnected;
597
+ return (_t_hostDisconnected = t.hostDisconnected) === null || _t_hostDisconnected === void 0 ? void 0 : _t_hostDisconnected.call(t);
598
+ });
599
+ }
600
+ },
601
+ {
602
+ key: "attributeChangedCallback",
603
+ value: function attributeChangedCallback(t, s, i) {
604
+ this._$AK(t, i);
605
+ }
606
+ },
607
+ {
608
+ key: "_$EC",
609
+ value: function _$EC(t, s) {
610
+ var i = this.constructor.elementProperties.get(t), e = this.constructor._$Eu(t, i);
611
+ if (void 0 !== e && !0 === i.reflect) {
612
+ var _i_converter;
613
+ var r = (void 0 !== ((_i_converter = i.converter) === null || _i_converter === void 0 ? void 0 : _i_converter.toAttribute) ? i.converter : u$1).toAttribute(s, i.type);
614
+ this._$Em = t, null == r ? this.removeAttribute(e) : this.setAttribute(e, r), this._$Em = null;
615
+ }
616
+ }
617
+ },
618
+ {
619
+ key: "_$AK",
620
+ value: function _$AK(t, s) {
621
+ var i = this.constructor, e = i._$Eh.get(t);
622
+ if (void 0 !== e && this._$Em !== e) {
623
+ var _t_converter;
624
+ var _$t = i.getPropertyOptions(e), r = "function" == typeof _$t.converter ? {
625
+ fromAttribute: _$t.converter
626
+ } : void 0 !== ((_t_converter = _$t.converter) === null || _t_converter === void 0 ? void 0 : _t_converter.fromAttribute) ? _$t.converter : u$1;
627
+ this._$Em = e, this[e] = r.fromAttribute(s, _$t.type), this._$Em = null;
628
+ }
629
+ }
630
+ },
631
+ {
632
+ key: "requestUpdate",
633
+ value: function requestUpdate(t, s, i) {
634
+ if (void 0 !== t) {
635
+ var _i_hasChanged;
636
+ if (i !== null && i !== void 0 ? i : i = this.constructor.getPropertyOptions(t), !((_i_hasChanged = i.hasChanged) !== null && _i_hasChanged !== void 0 ? _i_hasChanged : f$1)(this[t], s)) return;
637
+ this.P(t, s, i);
638
+ }
639
+ !1 === this.isUpdatePending && (this._$ES = this._$ET());
640
+ }
641
+ },
642
+ {
643
+ key: "P",
644
+ value: function P(t, s, i) {
645
+ var _this__$Ej;
646
+ this._$AL.has(t) || this._$AL.set(t, s), !0 === i.reflect && this._$Em !== t && ((_this__$Ej = this._$Ej) !== null && _this__$Ej !== void 0 ? _this__$Ej : this._$Ej = new Set).add(t);
647
+ }
648
+ },
649
+ {
650
+ key: "_$ET",
651
+ value: function _$ET() {
652
+ var _this = this;
653
+ return _async_to_generator(function() {
654
+ var t, _$t, _tmp;
655
+ return _ts_generator$1(this, function(_state) {
656
+ switch(_state.label){
657
+ case 0:
658
+ _this.isUpdatePending = !0;
659
+ _state.label = 1;
660
+ case 1:
661
+ _state.trys.push([
662
+ 1,
663
+ 3,
664
+ ,
665
+ 4
666
+ ]);
667
+ return [
668
+ 4,
669
+ _this._$ES
670
+ ];
671
+ case 2:
672
+ _state.sent();
673
+ return [
674
+ 3,
675
+ 4
676
+ ];
677
+ case 3:
678
+ t = _state.sent();
679
+ Promise.reject(t);
680
+ return [
681
+ 3,
682
+ 4
683
+ ];
684
+ case 4:
685
+ _$t = _this.scheduleUpdate();
686
+ _tmp = null != _$t;
687
+ if (!_tmp) return [
688
+ 3,
689
+ 6
690
+ ];
691
+ return [
692
+ 4,
693
+ _$t
694
+ ];
695
+ case 5:
696
+ _tmp = _state.sent();
697
+ _state.label = 6;
698
+ case 6:
699
+ return [
700
+ 2,
701
+ (!_this.isUpdatePending)
702
+ ];
703
+ }
704
+ });
705
+ })();
706
+ }
707
+ },
708
+ {
709
+ key: "scheduleUpdate",
710
+ value: function scheduleUpdate() {
711
+ return this.performUpdate();
712
+ }
713
+ },
714
+ {
715
+ key: "performUpdate",
716
+ value: function performUpdate() {
717
+ if (!this.isUpdatePending) return;
718
+ if (!this.hasUpdated) {
719
+ var _this_renderRoot;
720
+ if ((_this_renderRoot = this.renderRoot) !== null && _this_renderRoot !== void 0 ? _this_renderRoot : this.renderRoot = this.createRenderRoot(), this._$Ep) {
721
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
722
+ try {
723
+ for(var _iterator = this._$Ep[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
724
+ var _step_value = _sliced_to_array$2(_step.value, 2), t = _step_value[0], _$s = _step_value[1];
725
+ this[t] = _$s;
726
+ }
727
+ } catch (err) {
728
+ _didIteratorError = true;
729
+ _iteratorError = err;
730
+ } finally{
731
+ try {
732
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
733
+ _iterator.return();
734
+ }
735
+ } finally{
736
+ if (_didIteratorError) {
737
+ throw _iteratorError;
738
+ }
739
+ }
740
+ }
741
+ this._$Ep = void 0;
742
+ }
743
+ var t1 = this.constructor.elementProperties;
744
+ var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
745
+ if (t1.size > 0) try {
746
+ for(var _iterator1 = t1[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
747
+ var _step_value1 = _sliced_to_array$2(_step1.value, 2), _$s1 = _step_value1[0], i = _step_value1[1];
748
+ !0 !== i.wrapped || this._$AL.has(_$s1) || void 0 === this[_$s1] || this.P(_$s1, this[_$s1], i);
749
+ }
750
+ } catch (err) {
751
+ _didIteratorError1 = true;
752
+ _iteratorError1 = err;
753
+ } finally{
754
+ try {
755
+ if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
756
+ _iterator1.return();
757
+ }
758
+ } finally{
759
+ if (_didIteratorError1) {
760
+ throw _iteratorError1;
761
+ }
762
+ }
763
+ }
764
+ }
765
+ var t2 = !1;
766
+ var _$s2 = this._$AL;
767
+ try {
768
+ var _this__$EO;
769
+ t2 = this.shouldUpdate(_$s2), t2 ? (this.willUpdate(_$s2), (_this__$EO = this._$EO) === null || _this__$EO === void 0 ? void 0 : _this__$EO.forEach(function(t) {
770
+ var _t_hostUpdate;
771
+ return (_t_hostUpdate = t.hostUpdate) === null || _t_hostUpdate === void 0 ? void 0 : _t_hostUpdate.call(t);
772
+ }), this.update(_$s2)) : this._$EU();
773
+ } catch (s) {
774
+ throw t2 = !1, this._$EU(), s;
775
+ }
776
+ t2 && this._$AE(_$s2);
777
+ }
778
+ },
779
+ {
780
+ key: "willUpdate",
781
+ value: function willUpdate(t) {}
782
+ },
783
+ {
784
+ key: "_$AE",
785
+ value: function _$AE(t) {
786
+ var _this__$EO;
787
+ (_this__$EO = this._$EO) === null || _this__$EO === void 0 ? void 0 : _this__$EO.forEach(function(t) {
788
+ var _t_hostUpdated;
789
+ return (_t_hostUpdated = t.hostUpdated) === null || _t_hostUpdated === void 0 ? void 0 : _t_hostUpdated.call(t);
790
+ }), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
791
+ }
792
+ },
793
+ {
794
+ key: "_$EU",
795
+ value: function _$EU() {
796
+ this._$AL = new Map, this.isUpdatePending = !1;
797
+ }
798
+ },
799
+ {
800
+ key: "updateComplete",
801
+ get: function get() {
802
+ return this.getUpdateComplete();
803
+ }
804
+ },
805
+ {
806
+ key: "getUpdateComplete",
807
+ value: function getUpdateComplete() {
808
+ return this._$ES;
809
+ }
810
+ },
811
+ {
812
+ key: "shouldUpdate",
813
+ value: function shouldUpdate(t) {
814
+ return !0;
815
+ }
816
+ },
817
+ {
818
+ key: "update",
819
+ value: function update(t) {
820
+ var _this = this;
821
+ this._$Ej && (this._$Ej = this._$Ej.forEach(function(t) {
822
+ return _this._$EC(t, _this[t]);
823
+ })), this._$EU();
824
+ }
825
+ },
826
+ {
827
+ key: "updated",
828
+ value: function updated(t) {}
829
+ },
830
+ {
831
+ key: "firstUpdated",
832
+ value: function firstUpdated(t) {}
833
+ }
834
+ ], [
835
+ {
836
+ key: "addInitializer",
837
+ value: function addInitializer(t) {
838
+ var _this_l;
839
+ this._$Ei(), ((_this_l = this.l) !== null && _this_l !== void 0 ? _this_l : this.l = []).push(t);
840
+ }
841
+ },
842
+ {
843
+ key: "observedAttributes",
844
+ get: function get() {
845
+ return this.finalize(), this._$Eh && _to_consumable_array$9(this._$Eh.keys());
846
+ }
847
+ },
848
+ {
849
+ key: "createProperty",
850
+ value: function createProperty(t) {
851
+ var s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : y$1;
852
+ if (s.state && (s.attribute = !1), this._$Ei(), this.elementProperties.set(t, s), !s.noAccessor) {
853
+ var i = Symbol(), r = this.getPropertyDescriptor(t, i, s);
854
+ void 0 !== r && e$1(this.prototype, t, r);
855
+ }
856
+ }
857
+ },
858
+ {
859
+ key: "getPropertyDescriptor",
860
+ value: function getPropertyDescriptor(t, s, i) {
861
+ var _r;
862
+ var _ref = (_r = r$4(this.prototype, t)) !== null && _r !== void 0 ? _r : {
863
+ get: function get() {
864
+ return this[s];
865
+ },
866
+ set: function set(t) {
867
+ this[s] = t;
868
+ }
869
+ }, e = _ref.get, h = _ref.set;
870
+ return {
871
+ get: function get() {
872
+ return e === null || e === void 0 ? void 0 : e.call(this);
873
+ },
874
+ set: function set(s) {
875
+ var r = e === null || e === void 0 ? void 0 : e.call(this);
876
+ h.call(this, s), this.requestUpdate(t, r, i);
877
+ },
878
+ configurable: !0,
879
+ enumerable: !0
880
+ };
881
+ }
882
+ },
883
+ {
884
+ key: "getPropertyOptions",
885
+ value: function getPropertyOptions(t) {
886
+ var _this_elementProperties_get;
887
+ return (_this_elementProperties_get = this.elementProperties.get(t)) !== null && _this_elementProperties_get !== void 0 ? _this_elementProperties_get : y$1;
888
+ }
889
+ },
890
+ {
891
+ key: "_$Ei",
892
+ value: function _$Ei() {
893
+ if (this.hasOwnProperty(d$1("elementProperties"))) return;
894
+ var t = n$2(this);
895
+ t.finalize(), void 0 !== t.l && (this.l = _to_consumable_array$9(t.l)), this.elementProperties = new Map(t.elementProperties);
896
+ }
897
+ },
898
+ {
899
+ key: "finalize",
900
+ value: function finalize() {
901
+ if (this.hasOwnProperty(d$1("finalized"))) return;
902
+ if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(d$1("properties"))) {
903
+ var t = this.properties, s = _to_consumable_array$9(h$1(t)).concat(_to_consumable_array$9(o$2(t)));
904
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
905
+ try {
906
+ for(var _iterator = s[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
907
+ var i = _step.value;
908
+ this.createProperty(i, t[i]);
909
+ }
910
+ } catch (err) {
911
+ _didIteratorError = true;
912
+ _iteratorError = err;
913
+ } finally{
914
+ try {
915
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
916
+ _iterator.return();
917
+ }
918
+ } finally{
919
+ if (_didIteratorError) {
920
+ throw _iteratorError;
921
+ }
922
+ }
923
+ }
924
+ }
925
+ var t1 = this[Symbol.metadata];
926
+ if (null !== t1) {
927
+ var s1 = litPropertyMetadata.get(t1);
928
+ var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
929
+ if (void 0 !== s1) try {
930
+ for(var _iterator1 = s1[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
931
+ var _step_value = _sliced_to_array$2(_step1.value, 2), t2 = _step_value[0], i1 = _step_value[1];
932
+ this.elementProperties.set(t2, i1);
933
+ }
934
+ } catch (err) {
935
+ _didIteratorError1 = true;
936
+ _iteratorError1 = err;
937
+ } finally{
938
+ try {
939
+ if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
940
+ _iterator1.return();
941
+ }
942
+ } finally{
943
+ if (_didIteratorError1) {
944
+ throw _iteratorError1;
945
+ }
946
+ }
947
+ }
948
+ }
949
+ this._$Eh = new Map;
950
+ var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = undefined;
951
+ try {
952
+ for(var _iterator2 = this.elementProperties[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true){
953
+ var _step_value1 = _sliced_to_array$2(_step2.value, 2), t3 = _step_value1[0], s2 = _step_value1[1];
954
+ var i2 = this._$Eu(t3, s2);
955
+ void 0 !== i2 && this._$Eh.set(i2, t3);
956
+ }
957
+ } catch (err) {
958
+ _didIteratorError2 = true;
959
+ _iteratorError2 = err;
960
+ } finally{
961
+ try {
962
+ if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
963
+ _iterator2.return();
964
+ }
965
+ } finally{
966
+ if (_didIteratorError2) {
967
+ throw _iteratorError2;
968
+ }
969
+ }
970
+ }
971
+ this.elementStyles = this.finalizeStyles(this.styles);
972
+ }
973
+ },
974
+ {
975
+ key: "finalizeStyles",
976
+ value: function finalizeStyles(s) {
977
+ var i = [];
978
+ if (Array.isArray(s)) {
979
+ var e = new Set(s.flat(1 / 0).reverse());
980
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
981
+ try {
982
+ for(var _iterator = e[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
983
+ var _$s = _step.value;
984
+ i.unshift(c$2(_$s));
985
+ }
986
+ } catch (err) {
987
+ _didIteratorError = true;
988
+ _iteratorError = err;
989
+ } finally{
990
+ try {
991
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
992
+ _iterator.return();
993
+ }
994
+ } finally{
995
+ if (_didIteratorError) {
996
+ throw _iteratorError;
997
+ }
998
+ }
999
+ }
1000
+ } else void 0 !== s && i.push(c$2(s));
1001
+ return i;
1002
+ }
1003
+ },
1004
+ {
1005
+ key: "_$Eu",
1006
+ value: function _$Eu(t, s) {
1007
+ var i = s.attribute;
1008
+ return !1 === i ? void 0 : "string" == typeof i ? i : "string" == typeof t ? t.toLowerCase() : void 0;
1009
+ }
1010
+ }
1011
+ ]);
1012
+ return b;
1013
+ }(_wrap_native_super(HTMLElement));
1014
+ var _reactiveElementVersions;
1015
+ b.elementStyles = [], b.shadowRootOptions = {
1016
+ mode: "open"
1017
+ }, b[d$1("elementProperties")] = new Map, b[d$1("finalized")] = new Map, p$1 === null || p$1 === void 0 ? void 0 : p$1({
1018
+ ReactiveElement: b
1019
+ }), ((_reactiveElementVersions = (_a1 = a$1).reactiveElementVersions) !== null && _reactiveElementVersions !== void 0 ? _reactiveElementVersions : _a1.reactiveElementVersions = []).push("2.0.4");
1020
+
1021
+ /**
1022
+ * @license
1023
+ * Copyright 2017 Google LLC
1024
+ * SPDX-License-Identifier: BSD-3-Clause
1025
+ */ function _array_like_to_array$9(arr, len) {
1026
+ if (len == null || len > arr.length) len = arr.length;
1027
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
1028
+ return arr2;
1029
+ }
1030
+ function _array_with_holes$2(arr) {
1031
+ if (Array.isArray(arr)) return arr;
1032
+ }
1033
+ function _array_without_holes$8(arr) {
1034
+ if (Array.isArray(arr)) return _array_like_to_array$9(arr);
1035
+ }
1036
+ function _assert_this_initialized$1(self) {
1037
+ if (self === void 0) {
1038
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1039
+ }
1040
+ return self;
1041
+ }
1042
+ function _class_call_check$1(instance, Constructor) {
1043
+ if (!(instance instanceof Constructor)) {
1044
+ throw new TypeError("Cannot call a class as a function");
1045
+ }
1046
+ }
1047
+ function _defineProperties$1(target, props) {
1048
+ for(var i = 0; i < props.length; i++){
1049
+ var descriptor = props[i];
1050
+ descriptor.enumerable = descriptor.enumerable || false;
1051
+ descriptor.configurable = true;
1052
+ if ("value" in descriptor) descriptor.writable = true;
1053
+ Object.defineProperty(target, descriptor.key, descriptor);
1054
+ }
1055
+ }
1056
+ function _create_class$1(Constructor, protoProps, staticProps) {
1057
+ if (protoProps) _defineProperties$1(Constructor.prototype, protoProps);
1058
+ if (staticProps) _defineProperties$1(Constructor, staticProps);
1059
+ return Constructor;
1060
+ }
1061
+ function _get_prototype_of$1(o) {
1062
+ _get_prototype_of$1 = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
1063
+ return o.__proto__ || Object.getPrototypeOf(o);
1064
+ };
1065
+ return _get_prototype_of$1(o);
1066
+ }
1067
+ function _inherits$1(subClass, superClass) {
1068
+ if (typeof superClass !== "function" && superClass !== null) {
1069
+ throw new TypeError("Super expression must either be null or a function");
1070
+ }
1071
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
1072
+ constructor: {
1073
+ value: subClass,
1074
+ writable: true,
1075
+ configurable: true
1076
+ }
1077
+ });
1078
+ if (superClass) _set_prototype_of$1(subClass, superClass);
1079
+ }
1080
+ function _iterable_to_array$8(iter) {
1081
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
1082
+ }
1083
+ function _iterable_to_array_limit$1(arr, i) {
1084
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
1085
+ if (_i == null) return;
1086
+ var _arr = [];
1087
+ var _n = true;
1088
+ var _d = false;
1089
+ var _s, _e;
1090
+ try {
1091
+ for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
1092
+ _arr.push(_s.value);
1093
+ if (i && _arr.length === i) break;
1094
+ }
1095
+ } catch (err) {
1096
+ _d = true;
1097
+ _e = err;
1098
+ } finally{
1099
+ try {
1100
+ if (!_n && _i["return"] != null) _i["return"]();
1101
+ } finally{
1102
+ if (_d) throw _e;
1103
+ }
1104
+ }
1105
+ return _arr;
1106
+ }
1107
+ function _non_iterable_rest$2() {
1108
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1109
+ }
1110
+ function _non_iterable_spread$8() {
1111
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1112
+ }
1113
+ function _possible_constructor_return$1(self, call) {
1114
+ if (call && (_type_of$2(call) === "object" || typeof call === "function")) {
1115
+ return call;
1116
+ }
1117
+ return _assert_this_initialized$1(self);
1118
+ }
1119
+ function _set_prototype_of$1(o, p) {
1120
+ _set_prototype_of$1 = Object.setPrototypeOf || function setPrototypeOf(o, p) {
1121
+ o.__proto__ = p;
1122
+ return o;
1123
+ };
1124
+ return _set_prototype_of$1(o, p);
1125
+ }
1126
+ function _sliced_to_array$1(arr, i) {
1127
+ return _array_with_holes$2(arr) || _iterable_to_array_limit$1(arr, i) || _unsupported_iterable_to_array$9(arr, i) || _non_iterable_rest$2();
1128
+ }
1129
+ function _to_consumable_array$8(arr) {
1130
+ return _array_without_holes$8(arr) || _iterable_to_array$8(arr) || _unsupported_iterable_to_array$9(arr) || _non_iterable_spread$8();
1131
+ }
1132
+ function _type_of$2(obj) {
1133
+ "@swc/helpers - typeof";
1134
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
1135
+ }
1136
+ function _unsupported_iterable_to_array$9(o, minLen) {
1137
+ if (!o) return;
1138
+ if (typeof o === "string") return _array_like_to_array$9(o, minLen);
1139
+ var n = Object.prototype.toString.call(o).slice(8, -1);
1140
+ if (n === "Object" && o.constructor) n = o.constructor.name;
1141
+ if (n === "Map" || n === "Set") return Array.from(n);
1142
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$9(o, minLen);
1143
+ }
1144
+ function _is_native_reflect_construct$1() {
1145
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
1146
+ if (Reflect.construct.sham) return false;
1147
+ if (typeof Proxy === "function") return true;
1148
+ try {
1149
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1150
+ return true;
1151
+ } catch (e) {
1152
+ return false;
1153
+ }
1154
+ }
1155
+ function _create_super$1(Derived) {
1156
+ var hasNativeReflectConstruct = _is_native_reflect_construct$1();
1157
+ return function _createSuperInternal() {
1158
+ var Super = _get_prototype_of$1(Derived), result;
1159
+ if (hasNativeReflectConstruct) {
1160
+ var NewTarget = _get_prototype_of$1(this).constructor;
1161
+ result = Reflect.construct(Super, arguments, NewTarget);
1162
+ } else {
1163
+ result = Super.apply(this, arguments);
1164
+ }
1165
+ return _possible_constructor_return$1(this, result);
1166
+ };
1167
+ }
1168
+ var _t;
1169
+ var t$1 = globalThis, i = t$1.trustedTypes, s$1 = i ? i.createPolicy("lit-html", {
1170
+ createHTML: function(t) {
1171
+ return t;
1172
+ }
1173
+ }) : void 0, e = "$lit$", h = "lit$".concat((Math.random() + "").slice(9), "$"), o$1 = "?" + h, n$1 = "<".concat(o$1, ">"), r$3 = document, l = function() {
1174
+ return r$3.createComment("");
1175
+ }, c = function(t) {
1176
+ return null === t || "object" != typeof t && "function" != typeof t;
1177
+ }, a = Array.isArray, u = function(t) {
1178
+ return a(t) || "function" == typeof (t === null || t === void 0 ? void 0 : t[Symbol.iterator]);
1179
+ }, d = "[ \n\f\r]", f = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, v = /-->/g, _ = />/g, m = RegExp(">|".concat(d, "(?:([^\\s\"'>=/]+)(").concat(d, "*=").concat(d, "*(?:[^ \n\f\r\"'`<>=]|(\"|')|))|$)"), "g"), p = /'/g, g = /"/g, $ = /^(?:script|style|textarea|title)$/i, y = function(t) {
1180
+ return function(i) {
1181
+ for(var _len = arguments.length, s = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
1182
+ s[_key - 1] = arguments[_key];
1183
+ }
1184
+ return {
1185
+ _$litType$: t,
1186
+ strings: i,
1187
+ values: s
1188
+ };
1189
+ };
1190
+ }, x = y(1), w = Symbol.for("lit-noChange"), T = Symbol.for("lit-nothing"), A = new WeakMap, E = r$3.createTreeWalker(r$3, 129);
1191
+ function C(t, i) {
1192
+ if (!Array.isArray(t) || !t.hasOwnProperty("raw")) throw Error("invalid template strings array");
1193
+ return void 0 !== s$1 ? s$1.createHTML(i) : i;
1194
+ }
1195
+ var P = function(t, i) {
1196
+ var s = t.length - 1, o = [];
1197
+ var r, l = 2 === i ? "<svg>" : "", c = f;
1198
+ for(var _$i = 0; _$i < s; _$i++){
1199
+ var s1 = t[_$i];
1200
+ var a = void 0, u = void 0, d = -1, y = 0;
1201
+ for(; y < s1.length && (c.lastIndex = y, u = c.exec(s1), null !== u);)y = c.lastIndex, c === f ? "!--" === u[1] ? c = v : void 0 !== u[1] ? c = _ : void 0 !== u[2] ? ($.test(u[2]) && (r = RegExp("</" + u[2], "g")), c = m) : void 0 !== u[3] && (c = m) : c === m ? ">" === u[0] ? (c = r !== null && r !== void 0 ? r : f, d = -1) : void 0 === u[1] ? d = -2 : (d = c.lastIndex - u[2].length, a = u[1], c = void 0 === u[3] ? m : '"' === u[3] ? g : p) : c === g || c === p ? c = m : c === v || c === _ ? c = f : (c = m, r = void 0);
1202
+ var x = c === m && t[_$i + 1].startsWith("/>") ? " " : "";
1203
+ l += c === f ? s1 + n$1 : d >= 0 ? (o.push(a), s1.slice(0, d) + e + s1.slice(d) + h + x) : s1 + h + (-2 === d ? _$i : x);
1204
+ }
1205
+ return [
1206
+ C(t, l + (t[s] || "<?>") + (2 === i ? "</svg>" : "")),
1207
+ o
1208
+ ];
1209
+ };
1210
+ var V = /*#__PURE__*/ function() {
1211
+ function V(param, n) {
1212
+ var t = param.strings, s = param._$litType$;
1213
+ _class_call_check$1(this, V);
1214
+ var r;
1215
+ this.parts = [];
1216
+ var c = 0, a = 0;
1217
+ var u = t.length - 1, d = this.parts, _P = _sliced_to_array$1(P(t, s), 2), f = _P[0], v = _P[1];
1218
+ if (this.el = V.createElement(f, n), E.currentNode = this.el.content, 2 === s) {
1219
+ var _t;
1220
+ var t1 = this.el.content.firstChild;
1221
+ (_t = t1).replaceWith.apply(_t, _to_consumable_array$8(t1.childNodes));
1222
+ }
1223
+ for(; null !== (r = E.nextNode()) && d.length < u;){
1224
+ if (1 === r.nodeType) {
1225
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
1226
+ if (r.hasAttributes()) try {
1227
+ for(var _iterator = r.getAttributeNames()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
1228
+ var t2 = _step.value;
1229
+ if (t2.endsWith(e)) {
1230
+ var i1 = v[a++], s1 = r.getAttribute(t2).split(h), e1 = /([.?@])?(.*)/.exec(i1);
1231
+ d.push({
1232
+ type: 1,
1233
+ index: c,
1234
+ name: e1[2],
1235
+ strings: s1,
1236
+ ctor: "." === e1[1] ? k : "?" === e1[1] ? H : "@" === e1[1] ? I : R
1237
+ }), r.removeAttribute(t2);
1238
+ } else t2.startsWith(h) && (d.push({
1239
+ type: 6,
1240
+ index: c
1241
+ }), r.removeAttribute(t2));
1242
+ }
1243
+ } catch (err) {
1244
+ _didIteratorError = true;
1245
+ _iteratorError = err;
1246
+ } finally{
1247
+ try {
1248
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
1249
+ _iterator.return();
1250
+ }
1251
+ } finally{
1252
+ if (_didIteratorError) {
1253
+ throw _iteratorError;
1254
+ }
1255
+ }
1256
+ }
1257
+ if ($.test(r.tagName)) {
1258
+ var t3 = r.textContent.split(h), s2 = t3.length - 1;
1259
+ if (s2 > 0) {
1260
+ r.textContent = i ? i.emptyScript : "";
1261
+ for(var i2 = 0; i2 < s2; i2++)r.append(t3[i2], l()), E.nextNode(), d.push({
1262
+ type: 2,
1263
+ index: ++c
1264
+ });
1265
+ r.append(t3[s2], l());
1266
+ }
1267
+ }
1268
+ } else if (8 === r.nodeType) if (r.data === o$1) d.push({
1269
+ type: 2,
1270
+ index: c
1271
+ });
1272
+ else {
1273
+ var t4 = -1;
1274
+ for(; -1 !== (t4 = r.data.indexOf(h, t4 + 1));)d.push({
1275
+ type: 7,
1276
+ index: c
1277
+ }), t4 += h.length - 1;
1278
+ }
1279
+ c++;
1280
+ }
1281
+ }
1282
+ _create_class$1(V, null, [
1283
+ {
1284
+ key: "createElement",
1285
+ value: function createElement(t, i) {
1286
+ var s = r$3.createElement("template");
1287
+ return s.innerHTML = t, s;
1288
+ }
1289
+ }
1290
+ ]);
1291
+ return V;
1292
+ }();
1293
+ function N(t, i) {
1294
+ var s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : t, e = arguments.length > 3 ? arguments[3] : void 0;
1295
+ var _s__$Co, _h__$AO;
1296
+ var _s;
1297
+ if (i === w) return i;
1298
+ var h = void 0 !== e ? (_s__$Co = s._$Co) === null || _s__$Co === void 0 ? void 0 : _s__$Co[e] : s._$Cl;
1299
+ var o = c(i) ? void 0 : i._$litDirective$;
1300
+ var __$Co;
1301
+ return (h === null || h === void 0 ? void 0 : h.constructor) !== o && (h === null || h === void 0 ? void 0 : (_h__$AO = h._$AO) === null || _h__$AO === void 0 ? void 0 : _h__$AO.call(h, !1), void 0 === o ? h = void 0 : (h = new o(t), h._$AT(t, s, e)), void 0 !== e ? ((__$Co = (_s = s)._$Co) !== null && __$Co !== void 0 ? __$Co : _s._$Co = [])[e] = h : s._$Cl = h), void 0 !== h && (i = N(t, h._$AS(t, i.values), h, e)), i;
1302
+ }
1303
+ var S = /*#__PURE__*/ function() {
1304
+ function S(t, i) {
1305
+ _class_call_check$1(this, S);
1306
+ this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = i;
1307
+ }
1308
+ _create_class$1(S, [
1309
+ {
1310
+ key: "parentNode",
1311
+ get: function get() {
1312
+ return this._$AM.parentNode;
1313
+ }
1314
+ },
1315
+ {
1316
+ key: "_$AU",
1317
+ get: function get() {
1318
+ return this._$AM._$AU;
1319
+ }
1320
+ },
1321
+ {
1322
+ key: "u",
1323
+ value: function u(t) {
1324
+ var _t_creationScope;
1325
+ var _this__$AD = this._$AD, _this__$AD_el = _this__$AD.el, i = _this__$AD_el.content, s = _this__$AD.parts, e = ((_t_creationScope = t === null || t === void 0 ? void 0 : t.creationScope) !== null && _t_creationScope !== void 0 ? _t_creationScope : r$3).importNode(i, !0);
1326
+ E.currentNode = e;
1327
+ var h = E.nextNode(), o = 0, n = 0, l = s[0];
1328
+ for(; void 0 !== l;){
1329
+ if (o === l.index) {
1330
+ var i1 = void 0;
1331
+ 2 === l.type ? i1 = new M(h, h.nextSibling, this, t) : 1 === l.type ? i1 = new l.ctor(h, l.name, l.strings, this, t) : 6 === l.type && (i1 = new L(h, this, t)), this._$AV.push(i1), l = s[++n];
1332
+ }
1333
+ o !== (l === null || l === void 0 ? void 0 : l.index) && (h = E.nextNode(), o++);
1334
+ }
1335
+ return E.currentNode = r$3, e;
1336
+ }
1337
+ },
1338
+ {
1339
+ key: "p",
1340
+ value: function p(t) {
1341
+ var i = 0;
1342
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
1343
+ try {
1344
+ for(var _iterator = this._$AV[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
1345
+ var s = _step.value;
1346
+ void 0 !== s && (void 0 !== s.strings ? (s._$AI(t, s, i), i += s.strings.length - 2) : s._$AI(t[i])), i++;
1347
+ }
1348
+ } catch (err) {
1349
+ _didIteratorError = true;
1350
+ _iteratorError = err;
1351
+ } finally{
1352
+ try {
1353
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
1354
+ _iterator.return();
1355
+ }
1356
+ } finally{
1357
+ if (_didIteratorError) {
1358
+ throw _iteratorError;
1359
+ }
1360
+ }
1361
+ }
1362
+ }
1363
+ }
1364
+ ]);
1365
+ return S;
1366
+ }();
1367
+ var M = /*#__PURE__*/ function() {
1368
+ function M(t, i, s, e) {
1369
+ _class_call_check$1(this, M);
1370
+ var _e_isConnected;
1371
+ this.type = 2, this._$AH = T, this._$AN = void 0, this._$AA = t, this._$AB = i, this._$AM = s, this.options = e, this._$Cv = (_e_isConnected = e === null || e === void 0 ? void 0 : e.isConnected) !== null && _e_isConnected !== void 0 ? _e_isConnected : !0;
1372
+ }
1373
+ _create_class$1(M, [
1374
+ {
1375
+ key: "_$AU",
1376
+ get: function get() {
1377
+ var _this__$AM;
1378
+ var _this__$AM__$AU;
1379
+ return (_this__$AM__$AU = (_this__$AM = this._$AM) === null || _this__$AM === void 0 ? void 0 : _this__$AM._$AU) !== null && _this__$AM__$AU !== void 0 ? _this__$AM__$AU : this._$Cv;
1380
+ }
1381
+ },
1382
+ {
1383
+ key: "parentNode",
1384
+ get: function get() {
1385
+ var t = this._$AA.parentNode;
1386
+ var i = this._$AM;
1387
+ return void 0 !== i && 11 === (t === null || t === void 0 ? void 0 : t.nodeType) && (t = i.parentNode), t;
1388
+ }
1389
+ },
1390
+ {
1391
+ key: "startNode",
1392
+ get: function get() {
1393
+ return this._$AA;
1394
+ }
1395
+ },
1396
+ {
1397
+ key: "endNode",
1398
+ get: function get() {
1399
+ return this._$AB;
1400
+ }
1401
+ },
1402
+ {
1403
+ key: "_$AI",
1404
+ value: function _$AI(t) {
1405
+ var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this;
1406
+ t = N(this, t, i), c(t) ? t === T || null == t || "" === t ? (this._$AH !== T && this._$AR(), this._$AH = T) : t !== this._$AH && t !== w && this._(t) : void 0 !== t._$litType$ ? this.$(t) : void 0 !== t.nodeType ? this.T(t) : u(t) ? this.k(t) : this._(t);
1407
+ }
1408
+ },
1409
+ {
1410
+ key: "S",
1411
+ value: function S(t) {
1412
+ return this._$AA.parentNode.insertBefore(t, this._$AB);
1413
+ }
1414
+ },
1415
+ {
1416
+ key: "T",
1417
+ value: function T(t) {
1418
+ this._$AH !== t && (this._$AR(), this._$AH = this.S(t));
1419
+ }
1420
+ },
1421
+ {
1422
+ key: "_",
1423
+ value: function _(t) {
1424
+ this._$AH !== T && c(this._$AH) ? this._$AA.nextSibling.data = t : this.T(r$3.createTextNode(t)), this._$AH = t;
1425
+ }
1426
+ },
1427
+ {
1428
+ key: "$",
1429
+ value: function $(t) {
1430
+ var _this__$AH;
1431
+ var i = t.values, s = t._$litType$, e = "number" == typeof s ? this._$AC(t) : (void 0 === s.el && (s.el = V.createElement(C(s.h, s.h[0]), this.options)), s);
1432
+ if (((_this__$AH = this._$AH) === null || _this__$AH === void 0 ? void 0 : _this__$AH._$AD) === e) this._$AH.p(i);
1433
+ else {
1434
+ var _$t = new S(e, this), s1 = _$t.u(this.options);
1435
+ _$t.p(i), this.T(s1), this._$AH = _$t;
1436
+ }
1437
+ }
1438
+ },
1439
+ {
1440
+ key: "_$AC",
1441
+ value: function _$AC(t) {
1442
+ var i = A.get(t.strings);
1443
+ return void 0 === i && A.set(t.strings, i = new V(t)), i;
1444
+ }
1445
+ },
1446
+ {
1447
+ key: "k",
1448
+ value: function k(t) {
1449
+ a(this._$AH) || (this._$AH = [], this._$AR());
1450
+ var i = this._$AH;
1451
+ var s, e = 0;
1452
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
1453
+ try {
1454
+ for(var _iterator = t[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
1455
+ var h = _step.value;
1456
+ e === i.length ? i.push(s = new M(this.S(l()), this.S(l()), this, this.options)) : s = i[e], s._$AI(h), e++;
1457
+ }
1458
+ } catch (err) {
1459
+ _didIteratorError = true;
1460
+ _iteratorError = err;
1461
+ } finally{
1462
+ try {
1463
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
1464
+ _iterator.return();
1465
+ }
1466
+ } finally{
1467
+ if (_didIteratorError) {
1468
+ throw _iteratorError;
1469
+ }
1470
+ }
1471
+ }
1472
+ e < i.length && (this._$AR(s && s._$AB.nextSibling, e), i.length = e);
1473
+ }
1474
+ },
1475
+ {
1476
+ key: "_$AR",
1477
+ value: function _$AR() {
1478
+ var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this._$AA.nextSibling, i = arguments.length > 1 ? arguments[1] : void 0;
1479
+ var _this__$AP, _this;
1480
+ for((_this__$AP = (_this = this)._$AP) === null || _this__$AP === void 0 ? void 0 : _this__$AP.call(_this, !1, !0, i); t && t !== this._$AB;){
1481
+ var i1 = t.nextSibling;
1482
+ t.remove(), t = i1;
1483
+ }
1484
+ }
1485
+ },
1486
+ {
1487
+ key: "setConnected",
1488
+ value: function setConnected(t) {
1489
+ var _this__$AP, _this;
1490
+ void 0 === this._$AM && (this._$Cv = t, (_this__$AP = (_this = this)._$AP) === null || _this__$AP === void 0 ? void 0 : _this__$AP.call(_this, t));
1491
+ }
1492
+ }
1493
+ ]);
1494
+ return M;
1495
+ }();
1496
+ var R = /*#__PURE__*/ function() {
1497
+ function R(t, i, s, e, h) {
1498
+ _class_call_check$1(this, R);
1499
+ this.type = 1, this._$AH = T, this._$AN = void 0, this.element = t, this.name = i, this._$AM = e, this.options = h, s.length > 2 || "" !== s[0] || "" !== s[1] ? (this._$AH = Array(s.length - 1).fill(new String), this.strings = s) : this._$AH = T;
1500
+ }
1501
+ _create_class$1(R, [
1502
+ {
1503
+ key: "tagName",
1504
+ get: function get() {
1505
+ return this.element.tagName;
1506
+ }
1507
+ },
1508
+ {
1509
+ key: "_$AU",
1510
+ get: function get() {
1511
+ return this._$AM._$AU;
1512
+ }
1513
+ },
1514
+ {
1515
+ key: "_$AI",
1516
+ value: function _$AI(t) {
1517
+ var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this, s = arguments.length > 2 ? arguments[2] : void 0, e = arguments.length > 3 ? arguments[3] : void 0;
1518
+ var h = this.strings;
1519
+ var o = !1;
1520
+ if (void 0 === h) t = N(this, t, i, 0), o = !c(t) || t !== this._$AH && t !== w, o && (this._$AH = t);
1521
+ else {
1522
+ var e1 = t;
1523
+ var n, r;
1524
+ for(t = h[0], n = 0; n < h.length - 1; n++)r = N(this, e1[s + n], i, n), r === w && (r = this._$AH[n]), o || (o = !c(r) || r !== this._$AH[n]), r === T ? t = T : t !== T && (t += (r !== null && r !== void 0 ? r : "") + h[n + 1]), this._$AH[n] = r;
1525
+ }
1526
+ o && !e && this.j(t);
1527
+ }
1528
+ },
1529
+ {
1530
+ key: "j",
1531
+ value: function j(t) {
1532
+ t === T ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t !== null && t !== void 0 ? t : "");
1533
+ }
1534
+ }
1535
+ ]);
1536
+ return R;
1537
+ }();
1538
+ var k = /*#__PURE__*/ function(R) {
1539
+ _inherits$1(k, R);
1540
+ var _super = _create_super$1(k);
1541
+ function k() {
1542
+ _class_call_check$1(this, k);
1543
+ var _this;
1544
+ _this = _super.call.apply(_super, [
1545
+ this
1546
+ ].concat(Array.prototype.slice.call(arguments))), _this.type = 3;
1547
+ return _possible_constructor_return$1(_this);
1548
+ }
1549
+ _create_class$1(k, [
1550
+ {
1551
+ key: "j",
1552
+ value: function j(t) {
1553
+ this.element[this.name] = t === T ? void 0 : t;
1554
+ }
1555
+ }
1556
+ ]);
1557
+ return k;
1558
+ }(R);
1559
+ var H = /*#__PURE__*/ function(R) {
1560
+ _inherits$1(H, R);
1561
+ var _super = _create_super$1(H);
1562
+ function H() {
1563
+ _class_call_check$1(this, H);
1564
+ var _this;
1565
+ _this = _super.call.apply(_super, [
1566
+ this
1567
+ ].concat(Array.prototype.slice.call(arguments))), _this.type = 4;
1568
+ return _possible_constructor_return$1(_this);
1569
+ }
1570
+ _create_class$1(H, [
1571
+ {
1572
+ key: "j",
1573
+ value: function j(t) {
1574
+ this.element.toggleAttribute(this.name, !!t && t !== T);
1575
+ }
1576
+ }
1577
+ ]);
1578
+ return H;
1579
+ }(R);
1580
+ var I = /*#__PURE__*/ function(R) {
1581
+ _inherits$1(I, R);
1582
+ var _super = _create_super$1(I);
1583
+ function I(t, i, s, e, h) {
1584
+ _class_call_check$1(this, I);
1585
+ var _this;
1586
+ _this = _super.call(this, t, i, s, e, h), _this.type = 5;
1587
+ return _possible_constructor_return$1(_this);
1588
+ }
1589
+ _create_class$1(I, [
1590
+ {
1591
+ key: "_$AI",
1592
+ value: function _$AI(t) {
1593
+ var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this;
1594
+ var _N;
1595
+ if ((t = (_N = N(this, t, i, 0)) !== null && _N !== void 0 ? _N : T) === w) return;
1596
+ var s = this._$AH, e = t === T && s !== T || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, h = t !== T && (s === T || e);
1597
+ e && this.element.removeEventListener(this.name, this, s), h && this.element.addEventListener(this.name, this, t), this._$AH = t;
1598
+ }
1599
+ },
1600
+ {
1601
+ key: "handleEvent",
1602
+ value: function handleEvent(t) {
1603
+ var _this_options;
1604
+ var _this_options_host;
1605
+ "function" == typeof this._$AH ? this._$AH.call((_this_options_host = (_this_options = this.options) === null || _this_options === void 0 ? void 0 : _this_options.host) !== null && _this_options_host !== void 0 ? _this_options_host : this.element, t) : this._$AH.handleEvent(t);
1606
+ }
1607
+ }
1608
+ ]);
1609
+ return I;
1610
+ }(R);
1611
+ var L = /*#__PURE__*/ function() {
1612
+ function L(t, i, s) {
1613
+ _class_call_check$1(this, L);
1614
+ this.element = t, this.type = 6, this._$AN = void 0, this._$AM = i, this.options = s;
1615
+ }
1616
+ _create_class$1(L, [
1617
+ {
1618
+ key: "_$AU",
1619
+ get: function get() {
1620
+ return this._$AM._$AU;
1621
+ }
1622
+ },
1623
+ {
1624
+ key: "_$AI",
1625
+ value: function _$AI(t) {
1626
+ N(this, t);
1627
+ }
1628
+ }
1629
+ ]);
1630
+ return L;
1631
+ }();
1632
+ var Z = t$1.litHtmlPolyfillSupport;
1633
+ var _litHtmlVersions;
1634
+ Z === null || Z === void 0 ? void 0 : Z(V, M), ((_litHtmlVersions = (_t = t$1).litHtmlVersions) !== null && _litHtmlVersions !== void 0 ? _litHtmlVersions : _t.litHtmlVersions = []).push("3.1.2");
1635
+ var j = function(t, i, s) {
1636
+ var _s_renderBefore;
1637
+ var e = (_s_renderBefore = s === null || s === void 0 ? void 0 : s.renderBefore) !== null && _s_renderBefore !== void 0 ? _s_renderBefore : i;
1638
+ var h = e._$litPart$;
1639
+ if (void 0 === h) {
1640
+ var _s_renderBefore1;
1641
+ var _$t = (_s_renderBefore1 = s === null || s === void 0 ? void 0 : s.renderBefore) !== null && _s_renderBefore1 !== void 0 ? _s_renderBefore1 : null;
1642
+ e._$litPart$ = h = new M(i.insertBefore(l(), _$t), _$t, void 0, s !== null && s !== void 0 ? s : {});
1643
+ }
1644
+ return h._$AI(t), h;
1645
+ };
1646
+
1647
+ function _assert_this_initialized(self) {
1648
+ if (self === void 0) {
1649
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1650
+ }
1651
+ return self;
1652
+ }
1653
+ function _class_call_check(instance, Constructor) {
1654
+ if (!(instance instanceof Constructor)) {
1655
+ throw new TypeError("Cannot call a class as a function");
1656
+ }
1657
+ }
1658
+ function _defineProperties(target, props) {
1659
+ for(var i = 0; i < props.length; i++){
1660
+ var descriptor = props[i];
1661
+ descriptor.enumerable = descriptor.enumerable || false;
1662
+ descriptor.configurable = true;
1663
+ if ("value" in descriptor) descriptor.writable = true;
1664
+ Object.defineProperty(target, descriptor.key, descriptor);
1665
+ }
1666
+ }
1667
+ function _create_class(Constructor, protoProps, staticProps) {
1668
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
1669
+ if (staticProps) _defineProperties(Constructor, staticProps);
1670
+ return Constructor;
1671
+ }
1672
+ function _get(target, property, receiver) {
1673
+ if (typeof Reflect !== "undefined" && Reflect.get) {
1674
+ _get = Reflect.get;
1675
+ } else {
1676
+ _get = function get(target, property, receiver) {
1677
+ var base = _super_prop_base(target, property);
1678
+ if (!base) return;
1679
+ var desc = Object.getOwnPropertyDescriptor(base, property);
1680
+ if (desc.get) {
1681
+ return desc.get.call(receiver || target);
1682
+ }
1683
+ return desc.value;
1684
+ };
1685
+ }
1686
+ return _get(target, property, receiver || target);
1687
+ }
1688
+ function _get_prototype_of(o) {
1689
+ _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
1690
+ return o.__proto__ || Object.getPrototypeOf(o);
1691
+ };
1692
+ return _get_prototype_of(o);
1693
+ }
1694
+ function _inherits(subClass, superClass) {
1695
+ if (typeof superClass !== "function" && superClass !== null) {
1696
+ throw new TypeError("Super expression must either be null or a function");
1697
+ }
1698
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
1699
+ constructor: {
1700
+ value: subClass,
1701
+ writable: true,
1702
+ configurable: true
1703
+ }
1704
+ });
1705
+ if (superClass) _set_prototype_of(subClass, superClass);
1706
+ }
1707
+ function _possible_constructor_return(self, call) {
1708
+ if (call && (_type_of$1(call) === "object" || typeof call === "function")) {
1709
+ return call;
1710
+ }
1711
+ return _assert_this_initialized(self);
1712
+ }
1713
+ function _set_prototype_of(o, p) {
1714
+ _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
1715
+ o.__proto__ = p;
1716
+ return o;
1717
+ };
1718
+ return _set_prototype_of(o, p);
1719
+ }
1720
+ function _super_prop_base(object, property) {
1721
+ while(!Object.prototype.hasOwnProperty.call(object, property)){
1722
+ object = _get_prototype_of(object);
1723
+ if (object === null) break;
1724
+ }
1725
+ return object;
1726
+ }
1727
+ function _type_of$1(obj) {
1728
+ "@swc/helpers - typeof";
1729
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
1730
+ }
1731
+ function _is_native_reflect_construct() {
1732
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
1733
+ if (Reflect.construct.sham) return false;
1734
+ if (typeof Proxy === "function") return true;
1735
+ try {
1736
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1737
+ return true;
1738
+ } catch (e) {
1739
+ return false;
1740
+ }
1741
+ }
1742
+ function _create_super(Derived) {
1743
+ var hasNativeReflectConstruct = _is_native_reflect_construct();
1744
+ return function _createSuperInternal() {
1745
+ var Super = _get_prototype_of(Derived), result;
1746
+ if (hasNativeReflectConstruct) {
1747
+ var NewTarget = _get_prototype_of(this).constructor;
1748
+ result = Reflect.construct(Super, arguments, NewTarget);
1749
+ } else {
1750
+ result = Super.apply(this, arguments);
1751
+ }
1752
+ return _possible_constructor_return(this, result);
1753
+ };
1754
+ }
1755
+ var _globalThis_litElementHydrateSupport, _globalThis;
1756
+ var _globalThis1;
1757
+ /**
1758
+ * @license
1759
+ * Copyright 2017 Google LLC
1760
+ * SPDX-License-Identifier: BSD-3-Clause
1761
+ */ var s = /*#__PURE__*/ function(t) {
1762
+ _inherits(s, t);
1763
+ var _super = _create_super(s);
1764
+ function s() {
1765
+ _class_call_check(this, s);
1766
+ var _this;
1767
+ _this = _super.call.apply(_super, [
1768
+ this
1769
+ ].concat(Array.prototype.slice.call(arguments))), _this.renderOptions = {
1770
+ host: _assert_this_initialized(_this)
1771
+ }, _this._$Do = void 0;
1772
+ return _possible_constructor_return(_this);
1773
+ }
1774
+ _create_class(s, [
1775
+ {
1776
+ key: "createRenderRoot",
1777
+ value: function createRenderRoot() {
1778
+ var _this_renderOptions;
1779
+ var _$t = _get(_get_prototype_of(s.prototype), "createRenderRoot", this).call(this);
1780
+ var _renderBefore;
1781
+ return (_renderBefore = (_this_renderOptions = this.renderOptions).renderBefore) !== null && _renderBefore !== void 0 ? _renderBefore : _this_renderOptions.renderBefore = _$t.firstChild, _$t;
1782
+ }
1783
+ },
1784
+ {
1785
+ key: "update",
1786
+ value: function update(t) {
1787
+ var i = this.render();
1788
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), _get(_get_prototype_of(s.prototype), "update", this).call(this, t), this._$Do = j(i, this.renderRoot, this.renderOptions);
1789
+ }
1790
+ },
1791
+ {
1792
+ key: "connectedCallback",
1793
+ value: function connectedCallback() {
1794
+ var _this__$Do;
1795
+ _get(_get_prototype_of(s.prototype), "connectedCallback", this).call(this), (_this__$Do = this._$Do) === null || _this__$Do === void 0 ? void 0 : _this__$Do.setConnected(!0);
1796
+ }
1797
+ },
1798
+ {
1799
+ key: "disconnectedCallback",
1800
+ value: function disconnectedCallback() {
1801
+ var _this__$Do;
1802
+ _get(_get_prototype_of(s.prototype), "disconnectedCallback", this).call(this), (_this__$Do = this._$Do) === null || _this__$Do === void 0 ? void 0 : _this__$Do.setConnected(!1);
1803
+ }
1804
+ },
1805
+ {
1806
+ key: "render",
1807
+ value: function render() {
1808
+ return w;
1809
+ }
1810
+ }
1811
+ ]);
1812
+ return s;
1813
+ }(b);
1814
+ s._$litElement$ = !0, s["finalized"] = !0, (_globalThis_litElementHydrateSupport = (_globalThis = globalThis).litElementHydrateSupport) === null || _globalThis_litElementHydrateSupport === void 0 ? void 0 : _globalThis_litElementHydrateSupport.call(_globalThis, {
1815
+ LitElement: s
1816
+ });
1817
+ var r$2 = globalThis.litElementPolyfillSupport;
1818
+ r$2 === null || r$2 === void 0 ? void 0 : r$2({
1819
+ LitElement: s
1820
+ });
1821
+ var _litElementVersions;
1822
+ ((_litElementVersions = (_globalThis1 = globalThis).litElementVersions) !== null && _litElementVersions !== void 0 ? _litElementVersions : _globalThis1.litElementVersions = []).push("4.0.4");
1823
+
1824
+ /**
1825
+ * @license
1826
+ * Copyright 2017 Google LLC
1827
+ * SPDX-License-Identifier: BSD-3-Clause
1828
+ */ var t = function(t) {
1829
+ return function(e, o) {
1830
+ void 0 !== o ? o.addInitializer(function() {
1831
+ customElements.define(t, e);
1832
+ }) : customElements.define(t, e);
1833
+ };
1834
+ };
1835
+
1836
+ function _define_property$2(obj, key, value) {
1837
+ if (key in obj) {
1838
+ Object.defineProperty(obj, key, {
1839
+ value: value,
1840
+ enumerable: true,
1841
+ configurable: true,
1842
+ writable: true
1843
+ });
1844
+ } else {
1845
+ obj[key] = value;
1846
+ }
1847
+ return obj;
1848
+ }
1849
+ function _object_spread$1(target) {
1850
+ for(var i = 1; i < arguments.length; i++){
1851
+ var source = arguments[i] != null ? arguments[i] : {};
1852
+ var ownKeys = Object.keys(source);
1853
+ if (typeof Object.getOwnPropertySymbols === "function") {
1854
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
1855
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
1856
+ }));
1857
+ }
1858
+ ownKeys.forEach(function(key) {
1859
+ _define_property$2(target, key, source[key]);
1860
+ });
1861
+ }
1862
+ return target;
1863
+ }
1864
+ function ownKeys$1(object, enumerableOnly) {
1865
+ var keys = Object.keys(object);
1866
+ if (Object.getOwnPropertySymbols) {
1867
+ var symbols = Object.getOwnPropertySymbols(object);
1868
+ if (enumerableOnly) {
1869
+ symbols = symbols.filter(function(sym) {
1870
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
1871
+ });
1872
+ }
1873
+ keys.push.apply(keys, symbols);
1874
+ }
1875
+ return keys;
1876
+ }
1877
+ function _object_spread_props$1(target, source) {
1878
+ source = source != null ? source : {};
1879
+ if (Object.getOwnPropertyDescriptors) {
1880
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
1881
+ } else {
1882
+ ownKeys$1(Object(source)).forEach(function(key) {
1883
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
1884
+ });
1885
+ }
1886
+ return target;
1887
+ }
1888
+ /**
1889
+ * @license
1890
+ * Copyright 2017 Google LLC
1891
+ * SPDX-License-Identifier: BSD-3-Clause
1892
+ */ var o = {
1893
+ attribute: !0,
1894
+ type: String,
1895
+ converter: u$1,
1896
+ reflect: !1,
1897
+ hasChanged: f$1
1898
+ }, r$1 = function() {
1899
+ var _$t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : o, _$e = arguments.length > 1 ? arguments[1] : void 0, r = arguments.length > 2 ? arguments[2] : void 0;
1900
+ var n = r.kind, i = r.metadata;
1901
+ var s = globalThis.litPropertyMetadata.get(i);
1902
+ if (void 0 === s && globalThis.litPropertyMetadata.set(i, s = new Map), s.set(r.name, _$t), "accessor" === n) {
1903
+ var o1 = r.name;
1904
+ return {
1905
+ set: function set(r) {
1906
+ var n = _$e.get.call(this);
1907
+ _$e.set.call(this, r), this.requestUpdate(o1, n, _$t);
1908
+ },
1909
+ init: function init(e) {
1910
+ return void 0 !== e && this.P(o1, void 0, _$t), e;
1911
+ }
1912
+ };
1913
+ }
1914
+ if ("setter" === n) {
1915
+ var o2 = r.name;
1916
+ return function r(r) {
1917
+ var n = this[o2];
1918
+ _$e.call(this, r), this.requestUpdate(o2, n, _$t);
1919
+ };
1920
+ }
1921
+ throw Error("Unsupported decorator location: " + n);
1922
+ };
1923
+ function n(t) {
1924
+ return function(e, o) {
1925
+ return "object" == typeof o ? r$1(t, e, o) : function(t, e, o) {
1926
+ var r = e.hasOwnProperty(o);
1927
+ return e.constructor.createProperty(o, r ? _object_spread_props$1(_object_spread$1({}, t), {
1928
+ wrapped: !0
1929
+ }) : t), r ? Object.getOwnPropertyDescriptor(e, o) : void 0;
1930
+ }(t, e, o);
1931
+ };
1932
+ }
1933
+
1934
+ function _define_property$1(obj, key, value) {
1935
+ if (key in obj) {
1936
+ Object.defineProperty(obj, key, {
1937
+ value: value,
1938
+ enumerable: true,
1939
+ configurable: true,
1940
+ writable: true
1941
+ });
1942
+ } else {
1943
+ obj[key] = value;
1944
+ }
1945
+ return obj;
1946
+ }
1947
+ function _object_spread(target) {
1948
+ for(var i = 1; i < arguments.length; i++){
1949
+ var source = arguments[i] != null ? arguments[i] : {};
1950
+ var ownKeys = Object.keys(source);
1951
+ if (typeof Object.getOwnPropertySymbols === "function") {
1952
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
1953
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
1954
+ }));
1955
+ }
1956
+ ownKeys.forEach(function(key) {
1957
+ _define_property$1(target, key, source[key]);
1958
+ });
1959
+ }
1960
+ return target;
1961
+ }
1962
+ function ownKeys(object, enumerableOnly) {
1963
+ var keys = Object.keys(object);
1964
+ if (Object.getOwnPropertySymbols) {
1965
+ var symbols = Object.getOwnPropertySymbols(object);
1966
+ if (enumerableOnly) {
1967
+ symbols = symbols.filter(function(sym) {
1968
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
1969
+ });
1970
+ }
1971
+ keys.push.apply(keys, symbols);
1972
+ }
1973
+ return keys;
1974
+ }
1975
+ function _object_spread_props(target, source) {
1976
+ source = source != null ? source : {};
1977
+ if (Object.getOwnPropertyDescriptors) {
1978
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
1979
+ } else {
1980
+ ownKeys(Object(source)).forEach(function(key) {
1981
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
1982
+ });
1983
+ }
1984
+ return target;
1985
+ }
1986
+ /**
1987
+ * @license
1988
+ * Copyright 2017 Google LLC
1989
+ * SPDX-License-Identifier: BSD-3-Clause
1990
+ */ function r(r) {
1991
+ return n(_object_spread_props(_object_spread({}, r), {
1992
+ state: !0,
1993
+ attribute: !1
1994
+ }));
1995
+ }
1996
+
1997
+ class InputFileElement extends s {
1998
+ get content() {
1999
+ return this._content;
2000
+ }
2001
+ get value() {
2002
+ return this._value;
2003
+ }
2004
+ loadFile() {
2005
+ const input = document.createElement('input');
2006
+ input.type = 'file';
2007
+ input.multiple = this.multiple;
2008
+ input.accept = this.accept;
2009
+ input.onchange = (event)=>{
2010
+ const files = event.target.files;
2011
+ const file = files[0];
2012
+ const reader = new FileReader();
2013
+ reader.readAsDataURL(file);
2014
+ reader.onload = ()=>{
2015
+ this._value = reader.result;
2016
+ this._content = `> ${file.name}`;
2017
+ this.state = 'loaded';
2018
+ this.dispatchEvent(new CustomEvent('change', {
2019
+ detail: {
2020
+ value: this.value
2021
+ }
2022
+ }));
2023
+ };
2024
+ };
2025
+ input.click();
2026
+ }
2027
+ render() {
2028
+ return x`
2029
+ <section
2030
+ class="download ${this.state}"
2031
+ @click=${()=>[
2032
+ 'unloaded',
2033
+ 'loaded'
2034
+ ].indexOf(this.state) >= 0 ? this.loadFile() : void 0}
2035
+ >
2036
+ ${this.state === 'loaded' ? x` <ui5-icon name="attachment"></ui5-icon>
2037
+ <p>${this.label}<br />${this._content}</p>` : x` <ui5-icon name="add-document"></ui5-icon>
2038
+ <p>${this.label}</p>`}
2039
+ </section>
2040
+ `;
2041
+ }
2042
+ constructor(...args){
2043
+ super(...args);
2044
+ this.label = 'Upload';
2045
+ this.accept = '*';
2046
+ this.multiple = false;
2047
+ this.required = true;
2048
+ this.state = 'unloaded';
2049
+ this._content = 'no file selected';
2050
+ this._value = '';
2051
+ }
2052
+ }
2053
+ InputFileElement.styles = i$2`
2054
+ .download {
2055
+ padding: 10px 15px;
2056
+ margin-bottom: 10px;
2057
+ line-height: 1.4;
2058
+ border-color: rgb(220, 248, 198);
2059
+ border: 1px solid rgb(112, 183, 253);
2060
+ color: rgb(112, 183, 253);
2061
+ align-self: flex-start;
2062
+ margin-right: auto;
2063
+ text-align: center;
2064
+ }
2065
+
2066
+ .download.unloaded ui5-icon {
2067
+ color: rgb(112, 183, 253);
2068
+ }
2069
+
2070
+ .download.loaded {
2071
+ border: 1px solid rgb(213 213 213);
2072
+ color: rgb(0, 0, 0);
2073
+ }
2074
+
2075
+ .download p {
2076
+ text-align: center;
2077
+ font-size: 12px;
2078
+ margin: 0;
2079
+ }
2080
+
2081
+ .download.unloaded {
2082
+ cursor: pointer;
2083
+ }
2084
+
2085
+ .download.loaded ui5-icon {
2086
+ float: left;
2087
+ }
2088
+ `;
2089
+ __decorate([
2090
+ n()
2091
+ ], InputFileElement.prototype, "label", void 0);
2092
+ __decorate([
2093
+ n()
2094
+ ], InputFileElement.prototype, "accept", void 0);
2095
+ __decorate([
2096
+ n()
2097
+ ], InputFileElement.prototype, "multiple", void 0);
2098
+ __decorate([
2099
+ n()
2100
+ ], InputFileElement.prototype, "required", void 0);
2101
+ __decorate([
2102
+ r()
2103
+ ], InputFileElement.prototype, "state", void 0);
2104
+ __decorate([
2105
+ r()
2106
+ ], InputFileElement.prototype, "_content", void 0);
2107
+ InputFileElement = __decorate([
2108
+ t('digipair-input-file')
2109
+ ], InputFileElement);
2110
+
2111
+ class InputJsonElement extends s {
2112
+ get content() {
2113
+ return this._content;
2114
+ }
2115
+ get value() {
2116
+ return this._value;
2117
+ }
2118
+ loadFile() {
2119
+ const input = document.createElement('input');
2120
+ input.type = 'file';
2121
+ input.multiple = this.multiple;
2122
+ input.accept = this.accept;
2123
+ input.onchange = (event)=>{
2124
+ const files = event.target.files;
2125
+ const file = files[0];
2126
+ const reader = new FileReader();
2127
+ reader.readAsText(file);
2128
+ reader.onload = ()=>{
2129
+ this._value = JSON.parse(reader.result);
2130
+ this._content = `> ${file.name}`;
2131
+ this.state = 'loaded';
2132
+ this.dispatchEvent(new CustomEvent('change', {
2133
+ detail: {
2134
+ value: this.value
2135
+ }
2136
+ }));
2137
+ };
2138
+ };
2139
+ input.click();
2140
+ }
2141
+ render() {
2142
+ return x`
2143
+ <section
2144
+ class="download ${this.state}"
2145
+ @click=${()=>[
2146
+ 'unloaded',
2147
+ 'loaded'
2148
+ ].indexOf(this.state) >= 0 ? this.loadFile() : void 0}
2149
+ >
2150
+ ${this.state === 'loaded' ? x` <ui5-icon name="attachment"></ui5-icon>
2151
+ <p>${this.label}<br />${this._content}</p>` : x` <ui5-icon name="add-document"></ui5-icon>
2152
+ <p>${this.label}</p>`}
2153
+ </section>
2154
+ `;
2155
+ }
2156
+ constructor(...args){
2157
+ super(...args);
2158
+ this.label = 'Upload';
2159
+ this.accept = '.json';
2160
+ this.multiple = false;
2161
+ this.required = true;
2162
+ this.state = 'unloaded';
2163
+ this._content = 'no file selected';
2164
+ this._value = '';
2165
+ }
2166
+ }
2167
+ InputJsonElement.styles = i$2`
2168
+ .download {
2169
+ padding: 10px 15px;
2170
+ margin-bottom: 10px;
2171
+ line-height: 1.4;
2172
+ border-color: rgb(220, 248, 198);
2173
+ border: 1px solid rgb(112, 183, 253);
2174
+ color: rgb(112, 183, 253);
2175
+ align-self: flex-start;
2176
+ margin-right: auto;
2177
+ text-align: center;
2178
+ }
2179
+
2180
+ .download.unloaded ui5-icon {
2181
+ color: rgb(112, 183, 253);
2182
+ }
2183
+
2184
+ .download.loaded {
2185
+ border: 1px solid rgb(213 213 213);
2186
+ color: rgb(0, 0, 0);
2187
+ }
2188
+
2189
+ .download p {
2190
+ text-align: center;
2191
+ font-size: 12px;
2192
+ margin: 0;
2193
+ }
2194
+
2195
+ .download.unloaded {
2196
+ cursor: pointer;
2197
+ }
2198
+
2199
+ .download.loaded ui5-icon {
2200
+ float: left;
2201
+ }
2202
+ `;
2203
+ __decorate([
2204
+ n()
2205
+ ], InputJsonElement.prototype, "label", void 0);
2206
+ __decorate([
2207
+ n()
2208
+ ], InputJsonElement.prototype, "accept", void 0);
2209
+ __decorate([
2210
+ n()
2211
+ ], InputJsonElement.prototype, "multiple", void 0);
2212
+ __decorate([
2213
+ n()
2214
+ ], InputJsonElement.prototype, "required", void 0);
2215
+ __decorate([
2216
+ r()
2217
+ ], InputJsonElement.prototype, "state", void 0);
2218
+ __decorate([
2219
+ r()
2220
+ ], InputJsonElement.prototype, "_content", void 0);
2221
+ InputJsonElement = __decorate([
2222
+ t('digipair-input-json')
2223
+ ], InputJsonElement);
2224
+
2225
+ class InputTextElement extends s {
2226
+ get content() {
2227
+ return this._content;
2228
+ }
2229
+ get value() {
2230
+ return this._value;
2231
+ }
2232
+ loadFile() {
2233
+ const input = document.createElement('input');
2234
+ input.type = 'file';
2235
+ input.multiple = this.multiple;
2236
+ input.accept = this.accept;
2237
+ input.onchange = (event)=>{
2238
+ const files = event.target.files;
2239
+ const file = files[0];
2240
+ const reader = new FileReader();
2241
+ reader.readAsText(file);
2242
+ reader.onload = ()=>{
2243
+ this._value = reader.result;
2244
+ this._content = `> ${file.name}`;
2245
+ this.state = 'loaded';
2246
+ this.dispatchEvent(new CustomEvent('change', {
2247
+ detail: {
2248
+ value: this.value
2249
+ }
2250
+ }));
2251
+ };
2252
+ };
2253
+ input.click();
2254
+ }
2255
+ render() {
2256
+ return x`
2257
+ <section
2258
+ class="download ${this.state}"
2259
+ @click=${()=>[
2260
+ 'unloaded',
2261
+ 'loaded'
2262
+ ].indexOf(this.state) >= 0 ? this.loadFile() : void 0}
2263
+ >
2264
+ ${this.state === 'loaded' ? x` <ui5-icon name="attachment"></ui5-icon>
2265
+ <p>${this.label}<br />${this._content}</p>` : x` <ui5-icon name="add-document"></ui5-icon>
2266
+ <p>${this.label}</p>`}
2267
+ </section>
2268
+ `;
2269
+ }
2270
+ constructor(...args){
2271
+ super(...args);
2272
+ this.label = 'Upload';
2273
+ this.accept = '.txt';
2274
+ this.multiple = false;
2275
+ this.required = true;
2276
+ this.state = 'unloaded';
2277
+ this._content = 'no file selected';
2278
+ this._value = '';
2279
+ }
2280
+ }
2281
+ InputTextElement.styles = i$2`
2282
+ .download {
2283
+ padding: 10px 15px;
2284
+ margin-bottom: 10px;
2285
+ line-height: 1.4;
2286
+ border-color: rgb(220, 248, 198);
2287
+ border: 1px solid rgb(112, 183, 253);
2288
+ color: rgb(112, 183, 253);
2289
+ align-self: flex-start;
2290
+ margin-right: auto;
2291
+ text-align: center;
2292
+ }
2293
+
2294
+ .download.unloaded ui5-icon {
2295
+ color: rgb(112, 183, 253);
2296
+ }
2297
+
2298
+ .download.loaded {
2299
+ border: 1px solid rgb(213 213 213);
2300
+ color: rgb(0, 0, 0);
2301
+ }
2302
+
2303
+ .download p {
2304
+ text-align: center;
2305
+ font-size: 12px;
2306
+ margin: 0;
2307
+ }
2308
+
2309
+ .download.unloaded {
2310
+ cursor: pointer;
2311
+ }
2312
+
2313
+ .download.loaded ui5-icon {
2314
+ float: left;
2315
+ }
2316
+ `;
2317
+ __decorate([
2318
+ n()
2319
+ ], InputTextElement.prototype, "label", void 0);
2320
+ __decorate([
2321
+ n()
2322
+ ], InputTextElement.prototype, "accept", void 0);
2323
+ __decorate([
2324
+ n()
2325
+ ], InputTextElement.prototype, "multiple", void 0);
2326
+ __decorate([
2327
+ n()
2328
+ ], InputTextElement.prototype, "required", void 0);
2329
+ __decorate([
2330
+ r()
2331
+ ], InputTextElement.prototype, "state", void 0);
2332
+ __decorate([
2333
+ r()
2334
+ ], InputTextElement.prototype, "_content", void 0);
2335
+ InputTextElement = __decorate([
2336
+ t('digipair-input-text')
2337
+ ], InputTextElement);
2338
+
2339
+ class DomAttributeElement extends s {
2340
+ get value() {
2341
+ return this._value;
2342
+ }
2343
+ connectedCallback() {
2344
+ super.connectedCallback();
2345
+ this.initialize();
2346
+ }
2347
+ async initialize() {
2348
+ const element = document.querySelector(this.selector);
2349
+ var _element_this_attribute;
2350
+ const value = (_element_this_attribute = element[this.attribute]) != null ? _element_this_attribute : element.getAttribute(this.attribute);
2351
+ if (!(value instanceof Promise)) {
2352
+ this._value = value;
2353
+ return;
2354
+ }
2355
+ try {
2356
+ this._value = await value;
2357
+ this.dispatchEvent(new CustomEvent('change', {
2358
+ detail: {
2359
+ value: this.value
2360
+ }
2361
+ }));
2362
+ } catch (error) {
2363
+ this._value = value;
2364
+ }
2365
+ }
2366
+ render() {
2367
+ return x``;
2368
+ }
2369
+ constructor(...args){
2370
+ super(...args);
2371
+ this.selector = '';
2372
+ this.attribute = '';
2373
+ this.required = true;
2374
+ }
2375
+ }
2376
+ __decorate([
2377
+ n()
2378
+ ], DomAttributeElement.prototype, "selector", void 0);
2379
+ __decorate([
2380
+ n()
2381
+ ], DomAttributeElement.prototype, "attribute", void 0);
2382
+ __decorate([
2383
+ n()
2384
+ ], DomAttributeElement.prototype, "required", void 0);
2385
+ DomAttributeElement = __decorate([
2386
+ t('digipair-input-dom-attribute')
2387
+ ], DomAttributeElement);
2388
+
2389
+ /**
2390
+ * Guard function that checks if provided `input` is an Element.
2391
+ */ function _instanceof$2(left, right) {
2392
+ if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
2393
+ return !!right[Symbol.hasInstance](left);
2394
+ } else {
2395
+ return left instanceof right;
2396
+ }
2397
+ }
2398
+ function isElement(input) {
2399
+ return input && _instanceof$2(input, Element);
2400
+ }
2401
+
2402
+ var OPERATOR = {
2403
+ NONE: "",
2404
+ DESCENDANT: " ",
2405
+ CHILD: " > "
2406
+ };
2407
+ var CSS_SELECTOR_TYPE = {
2408
+ id: "id",
2409
+ class: "class",
2410
+ tag: "tag",
2411
+ attribute: "attribute",
2412
+ nthchild: "nthchild",
2413
+ nthoftype: "nthoftype"
2414
+ };
2415
+
2416
+ /**
2417
+ * Checks whether value is one of the enum's values.
2418
+ */ function isEnumValue(haystack, needle) {
2419
+ return Object.values(haystack).includes(needle);
2420
+ }
2421
+
2422
+ function _array_like_to_array$8(arr, len) {
2423
+ if (len == null || len > arr.length) len = arr.length;
2424
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
2425
+ return arr2;
2426
+ }
2427
+ function _array_without_holes$7(arr) {
2428
+ if (Array.isArray(arr)) return _array_like_to_array$8(arr);
2429
+ }
2430
+ function _iterable_to_array$7(iter) {
2431
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
2432
+ }
2433
+ function _non_iterable_spread$7() {
2434
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2435
+ }
2436
+ function _to_consumable_array$7(arr) {
2437
+ return _array_without_holes$7(arr) || _iterable_to_array$7(arr) || _unsupported_iterable_to_array$8(arr) || _non_iterable_spread$7();
2438
+ }
2439
+ function _unsupported_iterable_to_array$8(o, minLen) {
2440
+ if (!o) return;
2441
+ if (typeof o === "string") return _array_like_to_array$8(o, minLen);
2442
+ var n = Object.prototype.toString.call(o).slice(8, -1);
2443
+ if (n === "Object" && o.constructor) n = o.constructor.name;
2444
+ if (n === "Map" || n === "Set") return Array.from(n);
2445
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$8(o, minLen);
2446
+ }
2447
+ var libraryName = "CssSelectorGenerator";
2448
+ /**
2449
+ * Convenient wrapper for `console.warn` using consistent formatting.
2450
+ */ function showWarning() {
2451
+ var id = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "unknown problem";
2452
+ for(var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
2453
+ args[_key - 1] = arguments[_key];
2454
+ }
2455
+ var // eslint-disable-next-line no-console
2456
+ _console;
2457
+ (_console = console).warn.apply(_console, [
2458
+ "".concat(libraryName, ": ").concat(id)
2459
+ ].concat(_to_consumable_array$7(args)));
2460
+ }
2461
+
2462
+ function _instanceof$1(left, right) {
2463
+ if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
2464
+ return !!right[Symbol.hasInstance](left);
2465
+ } else {
2466
+ return left instanceof right;
2467
+ }
2468
+ }
2469
+ function _type_of(obj) {
2470
+ "@swc/helpers - typeof";
2471
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
2472
+ }
2473
+ var DEFAULT_OPTIONS = {
2474
+ selectors: [
2475
+ CSS_SELECTOR_TYPE.id,
2476
+ CSS_SELECTOR_TYPE.class,
2477
+ CSS_SELECTOR_TYPE.tag,
2478
+ CSS_SELECTOR_TYPE.attribute
2479
+ ],
2480
+ // if set to true, always include tag name
2481
+ includeTag: false,
2482
+ whitelist: [],
2483
+ blacklist: [],
2484
+ combineWithinSelector: true,
2485
+ combineBetweenSelectors: true,
2486
+ root: null,
2487
+ maxCombinations: Number.POSITIVE_INFINITY,
2488
+ maxCandidates: Number.POSITIVE_INFINITY
2489
+ };
2490
+ /**
2491
+ * Makes sure returned value is a list containing only valid selector types.
2492
+ * @param input
2493
+ */ function sanitizeSelectorTypes(input) {
2494
+ if (!Array.isArray(input)) {
2495
+ return [];
2496
+ }
2497
+ return input.filter(function(item) {
2498
+ return isEnumValue(CSS_SELECTOR_TYPE, item);
2499
+ });
2500
+ }
2501
+ /**
2502
+ * Checks whether provided value is of type RegExp.
2503
+ */ function isRegExp(input) {
2504
+ return _instanceof$1(input, RegExp);
2505
+ }
2506
+ /**
2507
+ * Checks whether provided value is usable in whitelist or blacklist.
2508
+ * @param input
2509
+ */ function isCssSelectorMatch(input) {
2510
+ return [
2511
+ "string",
2512
+ "function"
2513
+ ].includes(typeof input === "undefined" ? "undefined" : _type_of(input)) || isRegExp(input);
2514
+ }
2515
+ /**
2516
+ * Converts input to a list of valid values for whitelist or blacklist.
2517
+ */ function sanitizeCssSelectorMatchList(input) {
2518
+ if (!Array.isArray(input)) {
2519
+ return [];
2520
+ }
2521
+ return input.filter(isCssSelectorMatch);
2522
+ }
2523
+ /**
2524
+ * Checks whether provided value is valid Node.
2525
+ */ function isNode(input) {
2526
+ return _instanceof$1(input, Node);
2527
+ }
2528
+ /**
2529
+ * Checks whether provided value is valid ParentNode.
2530
+ */ function isParentNode(input) {
2531
+ var validParentNodeTypes = [
2532
+ Node.DOCUMENT_NODE,
2533
+ Node.DOCUMENT_FRAGMENT_NODE,
2534
+ Node.ELEMENT_NODE
2535
+ ];
2536
+ return isNode(input) && validParentNodeTypes.includes(input.nodeType);
2537
+ }
2538
+ /**
2539
+ * Makes sure that the root node in options is valid.
2540
+ */ function sanitizeRoot(input, element) {
2541
+ if (isParentNode(input)) {
2542
+ if (!input.contains(element)) {
2543
+ // eslint-disable-next-line max-len
2544
+ showWarning("element root mismatch", "Provided root does not contain the element. This will most likely result in producing a fallback selector using element's real root node. If you plan to use the selector using provided root (e.g. `root.querySelector`), it will nto work as intended.");
2545
+ }
2546
+ return input;
2547
+ }
2548
+ var rootNode = element.getRootNode({
2549
+ composed: false
2550
+ });
2551
+ if (isParentNode(rootNode)) {
2552
+ if (rootNode !== document) {
2553
+ // eslint-disable-next-line max-len
2554
+ showWarning("shadow root inferred", "You did not provide a root and the element is a child of Shadow DOM. This will produce a selector using ShadowRoot as a root. If you plan to use the selector using document as a root (e.g. `document.querySelector`), it will not work as intended.");
2555
+ }
2556
+ return rootNode;
2557
+ }
2558
+ return element.ownerDocument.querySelector(":root");
2559
+ }
2560
+ /**
2561
+ * Makes sure that the output is a number, usable as `maxResults` option in
2562
+ * powerset generator.
2563
+ */ function sanitizeMaxNumber(input) {
2564
+ return typeof input === "number" ? input : Number.POSITIVE_INFINITY;
2565
+ }
2566
+ /**
2567
+ * Makes sure the options object contains all required keys.
2568
+ */ function sanitizeOptions(element) {
2569
+ var custom_options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
2570
+ var options = Object.assign(Object.assign({}, DEFAULT_OPTIONS), custom_options);
2571
+ return {
2572
+ selectors: sanitizeSelectorTypes(options.selectors),
2573
+ whitelist: sanitizeCssSelectorMatchList(options.whitelist),
2574
+ blacklist: sanitizeCssSelectorMatchList(options.blacklist),
2575
+ root: sanitizeRoot(options.root, element),
2576
+ combineWithinSelector: !!options.combineWithinSelector,
2577
+ combineBetweenSelectors: !!options.combineBetweenSelectors,
2578
+ includeTag: !!options.includeTag,
2579
+ maxCombinations: sanitizeMaxNumber(options.maxCombinations),
2580
+ maxCandidates: sanitizeMaxNumber(options.maxCandidates)
2581
+ };
2582
+ }
2583
+
2584
+ function _array_like_to_array$7(arr, len) {
2585
+ if (len == null || len > arr.length) len = arr.length;
2586
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
2587
+ return arr2;
2588
+ }
2589
+ function _array_with_holes$1(arr) {
2590
+ if (Array.isArray(arr)) return arr;
2591
+ }
2592
+ function _array_without_holes$6(arr) {
2593
+ if (Array.isArray(arr)) return _array_like_to_array$7(arr);
2594
+ }
2595
+ function _iterable_to_array$6(iter) {
2596
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
2597
+ }
2598
+ function _non_iterable_rest$1() {
2599
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2600
+ }
2601
+ function _non_iterable_spread$6() {
2602
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2603
+ }
2604
+ function _to_array(arr) {
2605
+ return _array_with_holes$1(arr) || _iterable_to_array$6(arr) || _unsupported_iterable_to_array$7(arr) || _non_iterable_rest$1();
2606
+ }
2607
+ function _to_consumable_array$6(arr) {
2608
+ return _array_without_holes$6(arr) || _iterable_to_array$6(arr) || _unsupported_iterable_to_array$7(arr) || _non_iterable_spread$6();
2609
+ }
2610
+ function _unsupported_iterable_to_array$7(o, minLen) {
2611
+ if (!o) return;
2612
+ if (typeof o === "string") return _array_like_to_array$7(o, minLen);
2613
+ var n = Object.prototype.toString.call(o).slice(8, -1);
2614
+ if (n === "Object" && o.constructor) n = o.constructor.name;
2615
+ if (n === "Map" || n === "Set") return Array.from(n);
2616
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$7(o, minLen);
2617
+ }
2618
+ /**
2619
+ * Creates array containing only items included in all input arrays.
2620
+ */ function getIntersection() {
2621
+ var items = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
2622
+ var _items = _to_array(items), tmp = _items[0], firstItem = tmp === void 0 ? [] : tmp, otherItems = _items.slice(1);
2623
+ if (otherItems.length === 0) {
2624
+ return firstItem;
2625
+ }
2626
+ return otherItems.reduce(function(accumulator, currentValue) {
2627
+ return accumulator.filter(function(item) {
2628
+ return currentValue.includes(item);
2629
+ });
2630
+ }, firstItem);
2631
+ }
2632
+ /**
2633
+ * Converts array of arrays into a flat array.
2634
+ */ function flattenArray(input) {
2635
+ var _instance;
2636
+ return (_instance = []).concat.apply(_instance, _to_consumable_array$6(input));
2637
+ }
2638
+ /**
2639
+ * Convert string that can contain wildcards (asterisks) to RegExp source.
2640
+ */ function wildcardToRegExp(input) {
2641
+ return input// convert all special characters used by RegExp, except an asterisk
2642
+ .replace(/[|\\{}()[\]^$+?.]/g, "\\$&")// convert asterisk to pattern that matches anything
2643
+ .replace(/\*/g, ".+");
2644
+ }
2645
+ /**
2646
+ * Creates function that will test list of provided matchers against input.
2647
+ * Used for white/blacklist functionality.
2648
+ */ function createPatternMatcher(list) {
2649
+ var matchFunctions = list.map(function(item) {
2650
+ if (isRegExp(item)) {
2651
+ return function(input) {
2652
+ return item.test(input);
2653
+ };
2654
+ }
2655
+ if (typeof item === "function") {
2656
+ return function(input) {
2657
+ var result = item(input);
2658
+ if (typeof result !== "boolean") {
2659
+ // eslint-disable-next-line max-len
2660
+ showWarning("pattern matcher function invalid", "Provided pattern matching function does not return boolean. It's result will be ignored.", item);
2661
+ return false;
2662
+ }
2663
+ return result;
2664
+ };
2665
+ }
2666
+ if (typeof item === "string") {
2667
+ var re = new RegExp("^" + wildcardToRegExp(item) + "$");
2668
+ return function(input) {
2669
+ return re.test(input);
2670
+ };
2671
+ }
2672
+ // eslint-disable-next-line max-len
2673
+ showWarning("pattern matcher invalid", "Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.", item);
2674
+ return function() {
2675
+ return false;
2676
+ };
2677
+ });
2678
+ return function(input) {
2679
+ return matchFunctions.some(function(matchFunction) {
2680
+ return matchFunction(input);
2681
+ });
2682
+ };
2683
+ }
2684
+
2685
+ /**
2686
+ * Check whether element is matched uniquely by selector.
2687
+ */ function testSelector(elements, selector, root) {
2688
+ var result = Array.from(sanitizeRoot(root, elements[0]).querySelectorAll(selector));
2689
+ return result.length === elements.length && elements.every(function(element) {
2690
+ return result.includes(element);
2691
+ });
2692
+ }
2693
+ /**
2694
+ * Find all parents of a single element.
2695
+ */ function getElementParents(element, root) {
2696
+ root = root !== null && root !== void 0 ? root : getRootNode(element);
2697
+ var result = [];
2698
+ var parent = element;
2699
+ while(isElement(parent) && parent !== root){
2700
+ result.push(parent);
2701
+ parent = parent.parentElement;
2702
+ }
2703
+ return result;
2704
+ }
2705
+ /**
2706
+ * Find all common parents of elements.
2707
+ */ function getParents(elements, root) {
2708
+ return getIntersection(elements.map(function(element) {
2709
+ return getElementParents(element, root);
2710
+ }));
2711
+ }
2712
+ /**
2713
+ * Returns root node for given element. This needs to be used because of document-less environments, e.g. jsdom.
2714
+ */ function getRootNode(element) {
2715
+ return element.ownerDocument.querySelector(":root");
2716
+ }
2717
+
2718
+ var SELECTOR_SEPARATOR = ", ";
2719
+ // RegExp that will match invalid patterns that can be used in ID attribute.
2720
+ var INVALID_ID_RE = new RegExp([
2721
+ "^$",
2722
+ "\\s"
2723
+ ].join("|"));
2724
+ // RegExp that will match invalid patterns that can be used in class attribute.
2725
+ var INVALID_CLASS_RE = new RegExp([
2726
+ "^$"
2727
+ ].join("|"));
2728
+ // Order in which a combined selector is constructed.
2729
+ var SELECTOR_PATTERN = [
2730
+ CSS_SELECTOR_TYPE.nthoftype,
2731
+ CSS_SELECTOR_TYPE.tag,
2732
+ CSS_SELECTOR_TYPE.id,
2733
+ CSS_SELECTOR_TYPE.class,
2734
+ CSS_SELECTOR_TYPE.attribute,
2735
+ CSS_SELECTOR_TYPE.nthchild
2736
+ ];
2737
+
2738
+ function _array_like_to_array$6(arr, len) {
2739
+ if (len == null || len > arr.length) len = arr.length;
2740
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
2741
+ return arr2;
2742
+ }
2743
+ function _array_without_holes$5(arr) {
2744
+ if (Array.isArray(arr)) return _array_like_to_array$6(arr);
2745
+ }
2746
+ function _iterable_to_array$5(iter) {
2747
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
2748
+ }
2749
+ function _non_iterable_spread$5() {
2750
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2751
+ }
2752
+ function _to_consumable_array$5(arr) {
2753
+ return _array_without_holes$5(arr) || _iterable_to_array$5(arr) || _unsupported_iterable_to_array$6(arr) || _non_iterable_spread$5();
2754
+ }
2755
+ function _unsupported_iterable_to_array$6(o, minLen) {
2756
+ if (!o) return;
2757
+ if (typeof o === "string") return _array_like_to_array$6(o, minLen);
2758
+ var n = Object.prototype.toString.call(o).slice(8, -1);
2759
+ if (n === "Object" && o.constructor) n = o.constructor.name;
2760
+ if (n === "Map" || n === "Set") return Array.from(n);
2761
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$6(o, minLen);
2762
+ }
2763
+ // List of attributes to be ignored. These are handled by different selector types.
2764
+ var attributeBlacklistMatch = createPatternMatcher([
2765
+ "class",
2766
+ "id",
2767
+ // Angular attributes
2768
+ "ng-*"
2769
+ ]);
2770
+ /**
2771
+ * Prevents errors when attribute name contains a colon (e.g. "xlink:href").
2772
+ */ function sanitizeAttributeName(name) {
2773
+ return name.replace(/:/g, "\\:");
2774
+ }
2775
+ /**
2776
+ * Get simplified attribute selector for an element.
2777
+ */ function attributeNodeToSimplifiedSelector(param) {
2778
+ var name = param.name;
2779
+ return "[".concat(name, "]");
2780
+ }
2781
+ /**
2782
+ * Get attribute selector for an element.
2783
+ */ function attributeNodeToSelector(param) {
2784
+ var name = param.name, value = param.value;
2785
+ return "[".concat(name, "='").concat(value, "']");
2786
+ }
2787
+ /**
2788
+ * Checks whether attribute should be used as a selector.
2789
+ */ function isValidAttributeNode(param, element) {
2790
+ var nodeName = param.nodeName;
2791
+ // form input value should not be used as a selector
2792
+ var tagName = element.tagName.toLowerCase();
2793
+ if ([
2794
+ "input",
2795
+ "option"
2796
+ ].includes(tagName) && nodeName === "value") {
2797
+ return false;
2798
+ }
2799
+ return !attributeBlacklistMatch(nodeName);
2800
+ }
2801
+ /**
2802
+ * Sanitize all attribute data. We want to do it once, before we start to generate simplified/full selectors from the same data.
2803
+ */ function sanitizeAttributeData(param) {
2804
+ var nodeName = param.nodeName, nodeValue = param.nodeValue;
2805
+ return {
2806
+ name: sanitizeAttributeName(nodeName),
2807
+ value: sanitizeSelectorItem(nodeValue)
2808
+ };
2809
+ }
2810
+ /**
2811
+ * Get attribute selectors for an element.
2812
+ */ function getElementAttributeSelectors(element) {
2813
+ var validAttributes = Array.from(element.attributes).filter(function(attributeNode) {
2814
+ return isValidAttributeNode(attributeNode, element);
2815
+ }).map(sanitizeAttributeData);
2816
+ return _to_consumable_array$5(validAttributes.map(attributeNodeToSimplifiedSelector)).concat(_to_consumable_array$5(validAttributes.map(attributeNodeToSelector)));
2817
+ }
2818
+ /**
2819
+ * Get attribute selectors matching all elements.
2820
+ */ function getAttributeSelectors(elements) {
2821
+ var elementSelectors = elements.map(getElementAttributeSelectors);
2822
+ return getIntersection(elementSelectors);
2823
+ }
2824
+
2825
+ /**
2826
+ * Get class selectors for an element.
2827
+ */ function getElementClassSelectors(element) {
2828
+ return (element.getAttribute("class") || "").trim().split(/\s+/).filter(function(item) {
2829
+ return !INVALID_CLASS_RE.test(item);
2830
+ }).map(function(item) {
2831
+ return ".".concat(sanitizeSelectorItem(item));
2832
+ });
2833
+ }
2834
+ /**
2835
+ * Get class selectors matching all elements.
2836
+ */ function getClassSelectors(elements) {
2837
+ var elementSelectors = elements.map(getElementClassSelectors);
2838
+ return getIntersection(elementSelectors);
2839
+ }
2840
+
2841
+ /**
2842
+ * Get ID selector for an element.
2843
+ * */ function getElementIdSelectors(element) {
2844
+ var id = element.getAttribute("id") || "";
2845
+ var selector = "#".concat(sanitizeSelectorItem(id));
2846
+ var rootNode = element.getRootNode({
2847
+ composed: false
2848
+ });
2849
+ return !INVALID_ID_RE.test(id) && testSelector([
2850
+ element
2851
+ ], selector, rootNode) ? [
2852
+ selector
2853
+ ] : [];
2854
+ }
2855
+ /**
2856
+ * Get ID selector for an element.
2857
+ */ function getIdSelector(elements) {
2858
+ return elements.length === 0 || elements.length > 1 ? [] : getElementIdSelectors(elements[0]);
2859
+ }
2860
+
2861
+ /**
2862
+ * Get nth-child selector for an element.
2863
+ */ function getElementNthChildSelector(element) {
2864
+ var parent = element.parentNode;
2865
+ if (parent) {
2866
+ var siblings = Array.from(parent.childNodes).filter(isElement);
2867
+ var elementIndex = siblings.indexOf(element);
2868
+ if (elementIndex > -1) {
2869
+ return [
2870
+ ":nth-child(".concat(elementIndex + 1, ")")
2871
+ ];
2872
+ }
2873
+ }
2874
+ return [];
2875
+ }
2876
+ /**
2877
+ * Get nth-child selector matching all elements.
2878
+ */ function getNthChildSelector(elements) {
2879
+ return getIntersection(elements.map(getElementNthChildSelector));
2880
+ }
2881
+
2882
+ function _array_like_to_array$5(arr, len) {
2883
+ if (len == null || len > arr.length) len = arr.length;
2884
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
2885
+ return arr2;
2886
+ }
2887
+ function _array_without_holes$4(arr) {
2888
+ if (Array.isArray(arr)) return _array_like_to_array$5(arr);
2889
+ }
2890
+ function _iterable_to_array$4(iter) {
2891
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
2892
+ }
2893
+ function _non_iterable_spread$4() {
2894
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2895
+ }
2896
+ function _to_consumable_array$4(arr) {
2897
+ return _array_without_holes$4(arr) || _iterable_to_array$4(arr) || _unsupported_iterable_to_array$5(arr) || _non_iterable_spread$4();
2898
+ }
2899
+ function _unsupported_iterable_to_array$5(o, minLen) {
2900
+ if (!o) return;
2901
+ if (typeof o === "string") return _array_like_to_array$5(o, minLen);
2902
+ var n = Object.prototype.toString.call(o).slice(8, -1);
2903
+ if (n === "Object" && o.constructor) n = o.constructor.name;
2904
+ if (n === "Map" || n === "Set") return Array.from(n);
2905
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$5(o, minLen);
2906
+ }
2907
+ /**
2908
+ * Get tag selector for an element.
2909
+ */ function getElementTagSelectors(element) {
2910
+ return [
2911
+ sanitizeSelectorItem(element.tagName.toLowerCase())
2912
+ ];
2913
+ }
2914
+ /**
2915
+ * Get tag selector for list of elements.
2916
+ */ function getTagSelector(elements) {
2917
+ var selectors = _to_consumable_array$4(new Set(flattenArray(elements.map(getElementTagSelectors))));
2918
+ return selectors.length === 0 || selectors.length > 1 ? [] : [
2919
+ selectors[0]
2920
+ ];
2921
+ }
2922
+
2923
+ /**
2924
+ * Get nth-of-type selector for an element.
2925
+ */ function getElementNthOfTypeSelector(element) {
2926
+ var tag = getTagSelector([
2927
+ element
2928
+ ])[0];
2929
+ var parentElement = element.parentElement;
2930
+ if (parentElement) {
2931
+ var siblings = Array.from(parentElement.children).filter(function(element) {
2932
+ return element.tagName.toLowerCase() === tag;
2933
+ });
2934
+ var elementIndex = siblings.indexOf(element);
2935
+ if (elementIndex > -1) {
2936
+ return [
2937
+ "".concat(tag, ":nth-of-type(").concat(elementIndex + 1, ")")
2938
+ ];
2939
+ }
2940
+ }
2941
+ return [];
2942
+ }
2943
+ /**
2944
+ * Get Nth-of-type selector matching all elements.
2945
+ */ function getNthOfTypeSelector(elements) {
2946
+ return getIntersection(elements.map(getElementNthOfTypeSelector));
2947
+ }
2948
+
2949
+ function _array_like_to_array$4(arr, len) {
2950
+ if (len == null || len > arr.length) len = arr.length;
2951
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
2952
+ return arr2;
2953
+ }
2954
+ function _array_without_holes$3(arr) {
2955
+ if (Array.isArray(arr)) return _array_like_to_array$4(arr);
2956
+ }
2957
+ function _iterable_to_array$3(iter) {
2958
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
2959
+ }
2960
+ function _non_iterable_spread$3() {
2961
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2962
+ }
2963
+ function _to_consumable_array$3(arr) {
2964
+ return _array_without_holes$3(arr) || _iterable_to_array$3(arr) || _unsupported_iterable_to_array$4(arr) || _non_iterable_spread$3();
2965
+ }
2966
+ function _unsupported_iterable_to_array$4(o, minLen) {
2967
+ if (!o) return;
2968
+ if (typeof o === "string") return _array_like_to_array$4(o, minLen);
2969
+ var n = Object.prototype.toString.call(o).slice(8, -1);
2970
+ if (n === "Object" && o.constructor) n = o.constructor.name;
2971
+ if (n === "Map" || n === "Set") return Array.from(n);
2972
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$4(o, minLen);
2973
+ }
2974
+ function _ts_generator(thisArg, body) {
2975
+ var f, y, t, g, _ = {
2976
+ label: 0,
2977
+ sent: function() {
2978
+ if (t[0] & 1) throw t[1];
2979
+ return t[1];
2980
+ },
2981
+ trys: [],
2982
+ ops: []
2983
+ };
2984
+ return g = {
2985
+ next: verb(0),
2986
+ "throw": verb(1),
2987
+ "return": verb(2)
2988
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
2989
+ return this;
2990
+ }), g;
2991
+ function verb(n) {
2992
+ return function(v) {
2993
+ return step([
2994
+ n,
2995
+ v
2996
+ ]);
2997
+ };
2998
+ }
2999
+ function step(op) {
3000
+ if (f) throw new TypeError("Generator is already executing.");
3001
+ while(_)try {
3002
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
3003
+ if (y = 0, t) op = [
3004
+ op[0] & 2,
3005
+ t.value
3006
+ ];
3007
+ switch(op[0]){
3008
+ case 0:
3009
+ case 1:
3010
+ t = op;
3011
+ break;
3012
+ case 4:
3013
+ _.label++;
3014
+ return {
3015
+ value: op[1],
3016
+ done: false
3017
+ };
3018
+ case 5:
3019
+ _.label++;
3020
+ y = op[1];
3021
+ op = [
3022
+ 0
3023
+ ];
3024
+ continue;
3025
+ case 7:
3026
+ op = _.ops.pop();
3027
+ _.trys.pop();
3028
+ continue;
3029
+ default:
3030
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
3031
+ _ = 0;
3032
+ continue;
3033
+ }
3034
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
3035
+ _.label = op[1];
3036
+ break;
3037
+ }
3038
+ if (op[0] === 6 && _.label < t[1]) {
3039
+ _.label = t[1];
3040
+ t = op;
3041
+ break;
3042
+ }
3043
+ if (t && _.label < t[2]) {
3044
+ _.label = t[2];
3045
+ _.ops.push(op);
3046
+ break;
3047
+ }
3048
+ if (t[2]) _.ops.pop();
3049
+ _.trys.pop();
3050
+ continue;
3051
+ }
3052
+ op = body.call(thisArg, _);
3053
+ } catch (e) {
3054
+ op = [
3055
+ 6,
3056
+ e
3057
+ ];
3058
+ y = 0;
3059
+ } finally{
3060
+ f = t = 0;
3061
+ }
3062
+ if (op[0] & 5) throw op[1];
3063
+ return {
3064
+ value: op[0] ? op[1] : void 0,
3065
+ done: true
3066
+ };
3067
+ }
3068
+ }
3069
+ function powerSetGenerator() {
3070
+ var input, _ref, _ref_maxResults, maxResults, resultCounter, offsets, result;
3071
+ var _arguments = arguments;
3072
+ return _ts_generator(this, function(_state) {
3073
+ switch(_state.label){
3074
+ case 0:
3075
+ input = _arguments.length > 0 && _arguments[0] !== void 0 ? _arguments[0] : [], _ref = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : {}, _ref_maxResults = _ref.maxResults, maxResults = _ref_maxResults === void 0 ? Number.POSITIVE_INFINITY : _ref_maxResults;
3076
+ resultCounter = 0;
3077
+ offsets = generateOffsets(1);
3078
+ _state.label = 1;
3079
+ case 1:
3080
+ if (!(offsets.length <= input.length && resultCounter < maxResults)) return [
3081
+ 3,
3082
+ 3
3083
+ ];
3084
+ resultCounter += 1;
3085
+ result = offsets.map(function(offset) {
3086
+ return input[offset];
3087
+ });
3088
+ return [
3089
+ 4,
3090
+ result
3091
+ ];
3092
+ case 2:
3093
+ _state.sent();
3094
+ offsets = bumpOffsets(offsets, input.length - 1);
3095
+ return [
3096
+ 3,
3097
+ 1
3098
+ ];
3099
+ case 3:
3100
+ return [
3101
+ 2
3102
+ ];
3103
+ }
3104
+ });
3105
+ }
3106
+ /**
3107
+ * Generates power set of input items.
3108
+ */ function getPowerSet() {
3109
+ var input = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], _ref = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, _ref_maxResults = _ref.maxResults, maxResults = _ref_maxResults === void 0 ? Number.POSITIVE_INFINITY : _ref_maxResults;
3110
+ return Array.from(powerSetGenerator(input, {
3111
+ maxResults: maxResults
3112
+ }));
3113
+ }
3114
+ /**
3115
+ * Helper function used by `getPowerSet`. Updates internal pointers.
3116
+ */ function bumpOffsets() {
3117
+ var offsets = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], maxValue = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
3118
+ var size = offsets.length;
3119
+ if (size === 0) {
3120
+ return [];
3121
+ }
3122
+ var result = _to_consumable_array$3(offsets);
3123
+ result[size - 1] += 1;
3124
+ for(var index = size - 1; index >= 0; index--){
3125
+ if (result[index] > maxValue) {
3126
+ if (index === 0) {
3127
+ return generateOffsets(size + 1);
3128
+ } else {
3129
+ result[index - 1]++;
3130
+ result[index] = result[index - 1] + 1;
3131
+ }
3132
+ }
3133
+ }
3134
+ if (result[size - 1] > maxValue) {
3135
+ return generateOffsets(size + 1);
3136
+ }
3137
+ return result;
3138
+ }
3139
+ /**
3140
+ * Generates array of size N, filled with numbers sequence starting from 0.
3141
+ */ function generateOffsets() {
3142
+ var size = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1;
3143
+ return Array.from(Array(size).keys());
3144
+ }
3145
+
3146
+ /**
3147
+ * Generates cartesian product out of input object.
3148
+ */ function _array_like_to_array$3(arr, len) {
3149
+ if (len == null || len > arr.length) len = arr.length;
3150
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
3151
+ return arr2;
3152
+ }
3153
+ function _array_with_holes(arr) {
3154
+ if (Array.isArray(arr)) return arr;
3155
+ }
3156
+ function _define_property(obj, key, value) {
3157
+ if (key in obj) {
3158
+ Object.defineProperty(obj, key, {
3159
+ value: value,
3160
+ enumerable: true,
3161
+ configurable: true,
3162
+ writable: true
3163
+ });
3164
+ } else {
3165
+ obj[key] = value;
3166
+ }
3167
+ return obj;
3168
+ }
3169
+ function _iterable_to_array_limit(arr, i) {
3170
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
3171
+ if (_i == null) return;
3172
+ var _arr = [];
3173
+ var _n = true;
3174
+ var _d = false;
3175
+ var _s, _e;
3176
+ try {
3177
+ for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
3178
+ _arr.push(_s.value);
3179
+ if (i && _arr.length === i) break;
3180
+ }
3181
+ } catch (err) {
3182
+ _d = true;
3183
+ _e = err;
3184
+ } finally{
3185
+ try {
3186
+ if (!_n && _i["return"] != null) _i["return"]();
3187
+ } finally{
3188
+ if (_d) throw _e;
3189
+ }
3190
+ }
3191
+ return _arr;
3192
+ }
3193
+ function _non_iterable_rest() {
3194
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
3195
+ }
3196
+ function _sliced_to_array(arr, i) {
3197
+ return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array$3(arr, i) || _non_iterable_rest();
3198
+ }
3199
+ function _unsupported_iterable_to_array$3(o, minLen) {
3200
+ if (!o) return;
3201
+ if (typeof o === "string") return _array_like_to_array$3(o, minLen);
3202
+ var n = Object.prototype.toString.call(o).slice(8, -1);
3203
+ if (n === "Object" && o.constructor) n = o.constructor.name;
3204
+ if (n === "Map" || n === "Set") return Array.from(n);
3205
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$3(o, minLen);
3206
+ }
3207
+ function getCartesianProduct() {
3208
+ var input = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
3209
+ var result = [];
3210
+ Object.entries(input).forEach(function(param) {
3211
+ var _param = _sliced_to_array(param, 2), key = _param[0], values = _param[1];
3212
+ result = values.flatMap(function(value) {
3213
+ if (result.length === 0) {
3214
+ return [
3215
+ _define_property({}, key, value)
3216
+ ];
3217
+ } else {
3218
+ return result.map(function(memo) {
3219
+ return Object.assign(Object.assign({}, memo), _define_property({}, key, value));
3220
+ });
3221
+ }
3222
+ });
3223
+ });
3224
+ return result;
3225
+ }
3226
+
3227
+ function _array_like_to_array$2(arr, len) {
3228
+ if (len == null || len > arr.length) len = arr.length;
3229
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
3230
+ return arr2;
3231
+ }
3232
+ function _array_without_holes$2(arr) {
3233
+ if (Array.isArray(arr)) return _array_like_to_array$2(arr);
3234
+ }
3235
+ function _instanceof(left, right) {
3236
+ if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
3237
+ return !!right[Symbol.hasInstance](left);
3238
+ } else {
3239
+ return left instanceof right;
3240
+ }
3241
+ }
3242
+ function _iterable_to_array$2(iter) {
3243
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
3244
+ }
3245
+ function _non_iterable_spread$2() {
3246
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
3247
+ }
3248
+ function _to_consumable_array$2(arr) {
3249
+ return _array_without_holes$2(arr) || _iterable_to_array$2(arr) || _unsupported_iterable_to_array$2(arr) || _non_iterable_spread$2();
3250
+ }
3251
+ function _unsupported_iterable_to_array$2(o, minLen) {
3252
+ if (!o) return;
3253
+ if (typeof o === "string") return _array_like_to_array$2(o, minLen);
3254
+ var n = Object.prototype.toString.call(o).slice(8, -1);
3255
+ if (n === "Object" && o.constructor) n = o.constructor.name;
3256
+ if (n === "Map" || n === "Set") return Array.from(n);
3257
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$2(o, minLen);
3258
+ }
3259
+ var ESCAPED_COLON = ":".charCodeAt(0).toString(16).toUpperCase();
3260
+ // Square brackets need to be escaped, but eslint has a problem with that.
3261
+ /* eslint-disable-next-line no-useless-escape */ var SPECIAL_CHARACTERS_RE = /[ !"#$%&'()\[\]{|}<>*+,./;=?@^`~\\]/;
3262
+ /**
3263
+ * Escapes special characters used by CSS selector items.
3264
+ */ function sanitizeSelectorItem() {
3265
+ var input = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
3266
+ var _a, _b;
3267
+ return (_b = (_a = CSS === null || CSS === void 0 ? void 0 : CSS.escape) === null || _a === void 0 ? void 0 : _a.call(CSS, input)) !== null && _b !== void 0 ? _b : legacySanitizeSelectorItem(input);
3268
+ }
3269
+ /**
3270
+ * Legacy version of escaping utility, originally used for IE11-. Should
3271
+ * probably be replaced by a polyfill:
3272
+ * https://github.com/mathiasbynens/CSS.escape
3273
+ */ function legacySanitizeSelectorItem() {
3274
+ var input = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
3275
+ return input.split("").map(function(character) {
3276
+ if (character === ":") {
3277
+ return "\\".concat(ESCAPED_COLON, " ");
3278
+ }
3279
+ if (SPECIAL_CHARACTERS_RE.test(character)) {
3280
+ return "\\".concat(character);
3281
+ }
3282
+ return escape(character).replace(/%/g, "\\");
3283
+ }).join("");
3284
+ }
3285
+ var SELECTOR_TYPE_GETTERS = {
3286
+ tag: getTagSelector,
3287
+ id: getIdSelector,
3288
+ class: getClassSelectors,
3289
+ attribute: getAttributeSelectors,
3290
+ nthchild: getNthChildSelector,
3291
+ nthoftype: getNthOfTypeSelector
3292
+ };
3293
+ var ELEMENT_SELECTOR_TYPE_GETTERS = {
3294
+ tag: getElementTagSelectors,
3295
+ id: getElementIdSelectors,
3296
+ class: getElementClassSelectors,
3297
+ attribute: getElementAttributeSelectors,
3298
+ nthchild: getElementNthChildSelector,
3299
+ nthoftype: getElementNthOfTypeSelector
3300
+ };
3301
+ /**
3302
+ * Creates selector of given type for single element.
3303
+ */ function getElementSelectorsByType(element, selectorType) {
3304
+ return ELEMENT_SELECTOR_TYPE_GETTERS[selectorType](element);
3305
+ }
3306
+ /**
3307
+ * Returns list of selectors of given type for the element.
3308
+ */ function getSelectorsByType(elements, selector_type) {
3309
+ var _a;
3310
+ var getter = (_a = SELECTOR_TYPE_GETTERS[selector_type]) !== null && _a !== void 0 ? _a : function() {
3311
+ return [];
3312
+ };
3313
+ return getter(elements);
3314
+ }
3315
+ /**
3316
+ * Remove blacklisted selectors from list.
3317
+ */ function filterSelectors() {
3318
+ var list = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], matchBlacklist = arguments.length > 1 ? arguments[1] : void 0, matchWhitelist = arguments.length > 2 ? arguments[2] : void 0;
3319
+ return list.filter(function(item) {
3320
+ return matchWhitelist(item) || !matchBlacklist(item);
3321
+ });
3322
+ }
3323
+ /**
3324
+ * Prioritise whitelisted selectors in list.
3325
+ */ function orderSelectors() {
3326
+ var list = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], matchWhitelist = arguments.length > 1 ? arguments[1] : void 0;
3327
+ return list.sort(function(a, b) {
3328
+ var a_is_whitelisted = matchWhitelist(a);
3329
+ var b_is_whitelisted = matchWhitelist(b);
3330
+ if (a_is_whitelisted && !b_is_whitelisted) {
3331
+ return -1;
3332
+ }
3333
+ if (!a_is_whitelisted && b_is_whitelisted) {
3334
+ return 1;
3335
+ }
3336
+ return 0;
3337
+ });
3338
+ }
3339
+ /**
3340
+ * Returns list of unique selectors applicable to given element.
3341
+ */ function getAllSelectors(elements, root, options) {
3342
+ var selectors_list = getSelectorsList(elements, options);
3343
+ var type_combinations = getTypeCombinations(selectors_list, options);
3344
+ var all_selectors = flattenArray(type_combinations);
3345
+ return _to_consumable_array$2(new Set(all_selectors));
3346
+ }
3347
+ /**
3348
+ * Creates object containing all selector types and their potential values.
3349
+ */ function getSelectorsList(elements, options) {
3350
+ var blacklist = options.blacklist, whitelist = options.whitelist, combineWithinSelector = options.combineWithinSelector, maxCombinations = options.maxCombinations;
3351
+ var matchBlacklist = createPatternMatcher(blacklist);
3352
+ var matchWhitelist = createPatternMatcher(whitelist);
3353
+ var reducer = function(data, selector_type) {
3354
+ var selectors_by_type = getSelectorsByType(elements, selector_type);
3355
+ var filtered_selectors = filterSelectors(selectors_by_type, matchBlacklist, matchWhitelist);
3356
+ var found_selectors = orderSelectors(filtered_selectors, matchWhitelist);
3357
+ data[selector_type] = combineWithinSelector ? getPowerSet(found_selectors, {
3358
+ maxResults: maxCombinations
3359
+ }) : found_selectors.map(function(item) {
3360
+ return [
3361
+ item
3362
+ ];
3363
+ });
3364
+ return data;
3365
+ };
3366
+ return getSelectorsToGet(options).reduce(reducer, {});
3367
+ }
3368
+ /**
3369
+ * Creates list of selector types that we will need to generate the selector.
3370
+ */ function getSelectorsToGet(options) {
3371
+ var selectors = options.selectors, includeTag = options.includeTag;
3372
+ var selectors_to_get = [].concat(selectors);
3373
+ if (includeTag && !selectors_to_get.includes("tag")) {
3374
+ selectors_to_get.push("tag");
3375
+ }
3376
+ return selectors_to_get;
3377
+ }
3378
+ /**
3379
+ * Adds "tag" to a list, if it does not contain it. Used to modify selectors
3380
+ * list when includeTag option is enabled to make sure all results contain the
3381
+ * TAG part.
3382
+ */ function addTagTypeIfNeeded(list) {
3383
+ return list.includes(CSS_SELECTOR_TYPE.tag) || list.includes(CSS_SELECTOR_TYPE.nthoftype) ? _to_consumable_array$2(list) : _to_consumable_array$2(list).concat([
3384
+ CSS_SELECTOR_TYPE.tag
3385
+ ]);
3386
+ }
3387
+ /**
3388
+ * Generates list of possible selector type combinations.
3389
+ */ function combineSelectorTypes(options) {
3390
+ var selectors = options.selectors, combineBetweenSelectors = options.combineBetweenSelectors, includeTag = options.includeTag, maxCandidates = options.maxCandidates;
3391
+ var combinations = combineBetweenSelectors ? getPowerSet(selectors, {
3392
+ maxResults: maxCandidates
3393
+ }) : selectors.map(function(item) {
3394
+ return [
3395
+ item
3396
+ ];
3397
+ });
3398
+ return includeTag ? combinations.map(addTagTypeIfNeeded) : combinations;
3399
+ }
3400
+ /**
3401
+ * Generates list of combined CSS selectors.
3402
+ */ function getTypeCombinations(selectors_list, options) {
3403
+ return combineSelectorTypes(options).map(function(item) {
3404
+ return constructSelectors(item, selectors_list);
3405
+ }).filter(function(item) {
3406
+ return item.length > 0;
3407
+ });
3408
+ }
3409
+ /**
3410
+ * Generates all variations of possible selectors from provided data.
3411
+ */ function constructSelectors(selector_types, selectors_by_type) {
3412
+ var data = {};
3413
+ selector_types.forEach(function(selector_type) {
3414
+ var selector_variants = selectors_by_type[selector_type];
3415
+ if (selector_variants.length > 0) {
3416
+ data[selector_type] = selector_variants;
3417
+ }
3418
+ });
3419
+ var combinations = getCartesianProduct(data);
3420
+ return combinations.map(constructSelector);
3421
+ }
3422
+ /**
3423
+ * Creates selector for given selector type. Combines several parts if needed.
3424
+ */ function constructSelectorType(selector_type, selectors_data) {
3425
+ return selectors_data[selector_type] ? selectors_data[selector_type].join("") : "";
3426
+ }
3427
+ /**
3428
+ * Converts selector data object to a selector.
3429
+ */ function constructSelector() {
3430
+ var selectorData = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
3431
+ var pattern = _to_consumable_array$2(SELECTOR_PATTERN);
3432
+ // selector "nthoftype" already contains "tag"
3433
+ if (selectorData[CSS_SELECTOR_TYPE.tag] && selectorData[CSS_SELECTOR_TYPE.nthoftype]) {
3434
+ pattern.splice(pattern.indexOf(CSS_SELECTOR_TYPE.tag), 1);
3435
+ }
3436
+ return pattern.map(function(type) {
3437
+ return constructSelectorType(type, selectorData);
3438
+ }).join("");
3439
+ }
3440
+ /**
3441
+ * Generates combinations of child and descendant selectors within root
3442
+ * selector.
3443
+ */ function generateCandidateCombinations(selectors, rootSelector) {
3444
+ return _to_consumable_array$2(selectors.map(function(selector) {
3445
+ return rootSelector + OPERATOR.DESCENDANT + selector;
3446
+ })).concat(_to_consumable_array$2(selectors.map(function(selector) {
3447
+ return rootSelector + OPERATOR.CHILD + selector;
3448
+ })));
3449
+ }
3450
+ /**
3451
+ * Generates a list of selector candidates that can potentially match target
3452
+ * element.
3453
+ */ function generateCandidates(selectors, rootSelector) {
3454
+ return rootSelector === "" ? selectors : generateCandidateCombinations(selectors, rootSelector);
3455
+ }
3456
+ /**
3457
+ * Tries to find an unique CSS selector for element within given parent.
3458
+ */ function getSelectorWithinRoot(elements, root) {
3459
+ var rootSelector = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "", options = arguments.length > 3 ? arguments[3] : void 0;
3460
+ var elementSelectors = getAllSelectors(elements, options.root, options);
3461
+ var selectorCandidates = generateCandidates(elementSelectors, rootSelector);
3462
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
3463
+ try {
3464
+ for(var _iterator = selectorCandidates[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
3465
+ var candidateSelector = _step.value;
3466
+ if (testSelector(elements, candidateSelector, options.root)) {
3467
+ return candidateSelector;
3468
+ }
3469
+ }
3470
+ } catch (err) {
3471
+ _didIteratorError = true;
3472
+ _iteratorError = err;
3473
+ } finally{
3474
+ try {
3475
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
3476
+ _iterator.return();
3477
+ }
3478
+ } finally{
3479
+ if (_didIteratorError) {
3480
+ throw _iteratorError;
3481
+ }
3482
+ }
3483
+ }
3484
+ return null;
3485
+ }
3486
+ /**
3487
+ * Climbs through parents of the element and tries to find the one that is
3488
+ * identifiable by unique CSS selector.
3489
+ */ function getClosestIdentifiableParent(elements, root) {
3490
+ var rootSelector = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "", options = arguments.length > 3 ? arguments[3] : void 0;
3491
+ if (elements.length === 0) {
3492
+ return null;
3493
+ }
3494
+ var candidatesList = [
3495
+ elements.length > 1 ? elements : []
3496
+ ].concat(_to_consumable_array$2(getParents(elements, root).map(function(element) {
3497
+ return [
3498
+ element
3499
+ ];
3500
+ })));
3501
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
3502
+ try {
3503
+ for(var _iterator = candidatesList[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
3504
+ var currentElements = _step.value;
3505
+ var result = getSelectorWithinRoot(currentElements, root, rootSelector, options);
3506
+ if (result) {
3507
+ return {
3508
+ foundElements: currentElements,
3509
+ selector: result
3510
+ };
3511
+ }
3512
+ }
3513
+ } catch (err) {
3514
+ _didIteratorError = true;
3515
+ _iteratorError = err;
3516
+ } finally{
3517
+ try {
3518
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
3519
+ _iterator.return();
3520
+ }
3521
+ } finally{
3522
+ if (_didIteratorError) {
3523
+ throw _iteratorError;
3524
+ }
3525
+ }
3526
+ }
3527
+ return null;
3528
+ }
3529
+ /**
3530
+ * Converts input into list of elements, removing duplicates and non-elements.
3531
+ */ function sanitizeSelectorNeedle(needle) {
3532
+ if (_instanceof(needle, NodeList) || _instanceof(needle, HTMLCollection)) {
3533
+ needle = Array.from(needle);
3534
+ }
3535
+ var elements = (Array.isArray(needle) ? needle : [
3536
+ needle
3537
+ ]).filter(isElement);
3538
+ return _to_consumable_array$2(new Set(elements));
3539
+ }
3540
+
3541
+ function _array_like_to_array$1(arr, len) {
3542
+ if (len == null || len > arr.length) len = arr.length;
3543
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
3544
+ return arr2;
3545
+ }
3546
+ function _array_without_holes$1(arr) {
3547
+ if (Array.isArray(arr)) return _array_like_to_array$1(arr);
3548
+ }
3549
+ function _iterable_to_array$1(iter) {
3550
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
3551
+ }
3552
+ function _non_iterable_spread$1() {
3553
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
3554
+ }
3555
+ function _to_consumable_array$1(arr) {
3556
+ return _array_without_holes$1(arr) || _iterable_to_array$1(arr) || _unsupported_iterable_to_array$1(arr) || _non_iterable_spread$1();
3557
+ }
3558
+ function _unsupported_iterable_to_array$1(o, minLen) {
3559
+ if (!o) return;
3560
+ if (typeof o === "string") return _array_like_to_array$1(o, minLen);
3561
+ var n = Object.prototype.toString.call(o).slice(8, -1);
3562
+ if (n === "Object" && o.constructor) n = o.constructor.name;
3563
+ if (n === "Map" || n === "Set") return Array.from(n);
3564
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$1(o, minLen);
3565
+ }
3566
+ /**
3567
+ * Creates data describing a specific selector.
3568
+ */ function createElementSelectorData(selector) {
3569
+ return {
3570
+ value: selector,
3571
+ include: false
3572
+ };
3573
+ }
3574
+ /**
3575
+ * Creates data describing an element within CssSelector chain.
3576
+ */ function createElementData(element, selectorTypes) {
3577
+ var operator = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : OPERATOR.NONE;
3578
+ var selectors = {};
3579
+ selectorTypes.forEach(function(selectorType) {
3580
+ Reflect.set(selectors, selectorType, getElementSelectorsByType(element, selectorType).map(createElementSelectorData));
3581
+ });
3582
+ return {
3583
+ element: element,
3584
+ operator: operator,
3585
+ selectors: selectors
3586
+ };
3587
+ }
3588
+ /**
3589
+ * Constructs selector from element data.
3590
+ */ function constructElementSelector(param) {
3591
+ var selectors = param.selectors, operator = param.operator;
3592
+ var pattern = _to_consumable_array$1(SELECTOR_PATTERN);
3593
+ // `nthoftype` already contains tag
3594
+ if (selectors[CSS_SELECTOR_TYPE.tag] && selectors[CSS_SELECTOR_TYPE.nthoftype]) {
3595
+ pattern = pattern.filter(function(item) {
3596
+ return item !== CSS_SELECTOR_TYPE.tag;
3597
+ });
3598
+ }
3599
+ var selector = "";
3600
+ pattern.forEach(function(selectorType) {
3601
+ var selectorsOfType = selectors[selectorType] || [];
3602
+ selectorsOfType.forEach(function(param) {
3603
+ var value = param.value, include = param.include;
3604
+ if (include) {
3605
+ selector += value;
3606
+ }
3607
+ });
3608
+ });
3609
+ return operator + selector;
3610
+ }
3611
+
3612
+ function _array_like_to_array(arr, len) {
3613
+ if (len == null || len > arr.length) len = arr.length;
3614
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
3615
+ return arr2;
3616
+ }
3617
+ function _array_without_holes(arr) {
3618
+ if (Array.isArray(arr)) return _array_like_to_array(arr);
3619
+ }
3620
+ function _iterable_to_array(iter) {
3621
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
3622
+ }
3623
+ function _non_iterable_spread() {
3624
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
3625
+ }
3626
+ function _to_consumable_array(arr) {
3627
+ return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
3628
+ }
3629
+ function _unsupported_iterable_to_array(o, minLen) {
3630
+ if (!o) return;
3631
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
3632
+ var n = Object.prototype.toString.call(o).slice(8, -1);
3633
+ if (n === "Object" && o.constructor) n = o.constructor.name;
3634
+ if (n === "Map" || n === "Set") return Array.from(n);
3635
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
3636
+ }
3637
+ /**
3638
+ * Creates fallback selector for single element.
3639
+ */ function getElementFallbackSelector(element) {
3640
+ var parentElements = getElementParents(element).reverse();
3641
+ var elementsData = parentElements.map(function(element) {
3642
+ var elementData = createElementData(element, [
3643
+ CSS_SELECTOR_TYPE.nthchild
3644
+ ], OPERATOR.CHILD);
3645
+ elementData.selectors.nthchild.forEach(function(selectorData) {
3646
+ selectorData.include = true;
3647
+ });
3648
+ return elementData;
3649
+ });
3650
+ return [
3651
+ ":root"
3652
+ ].concat(_to_consumable_array(elementsData.map(constructElementSelector))).join("");
3653
+ }
3654
+ /**
3655
+ * Creates chain of :nth-child selectors from root to the elements.
3656
+ */ function getFallbackSelector(elements) {
3657
+ return elements.map(getElementFallbackSelector).join(SELECTOR_SEPARATOR);
3658
+ }
3659
+
3660
+ /**
3661
+ * Generates unique CSS selector for an element.
3662
+ */ function getCssSelector$1(needle) {
3663
+ var custom_options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
3664
+ var elements = sanitizeSelectorNeedle(needle);
3665
+ var options = sanitizeOptions(elements[0], custom_options);
3666
+ var partialSelector = "";
3667
+ var currentRoot = options.root;
3668
+ /**
3669
+ * Utility function to make subsequent calls shorter.
3670
+ */ function updateIdentifiableParent() {
3671
+ return getClosestIdentifiableParent(elements, currentRoot, partialSelector, options);
3672
+ }
3673
+ var closestIdentifiableParent = updateIdentifiableParent();
3674
+ while(closestIdentifiableParent){
3675
+ var foundElements = closestIdentifiableParent.foundElements, selector = closestIdentifiableParent.selector;
3676
+ if (testSelector(elements, selector, options.root)) {
3677
+ return selector;
3678
+ }
3679
+ currentRoot = foundElements[0];
3680
+ partialSelector = selector;
3681
+ closestIdentifiableParent = updateIdentifiableParent();
3682
+ }
3683
+ // if failed to find single selector matching all elements, try to find
3684
+ // selector for each standalone element and join them together
3685
+ if (elements.length > 1) {
3686
+ return elements.map(function(element) {
3687
+ return getCssSelector$1(element, options);
3688
+ }).join(SELECTOR_SEPARATOR);
3689
+ }
3690
+ return getFallbackSelector(elements);
3691
+ }
3692
+
3693
+ function unescapeCSS(cssEscapedString) {
3694
+ return cssEscapedString.replace(/\\([0-9A-Fa-f]{1,6})\s?/g, (_match, charCode)=>String.fromCharCode(parseInt(charCode, 16))).replace(/\\/g, '');
3695
+ }
3696
+ function getCssSelector(element, options = {}) {
3697
+ const selector = getCssSelector$1(element, options);
3698
+ return unescapeCSS(selector);
3699
+ }
3700
+
3701
+ class ElementElement extends s {
3702
+ get content() {
3703
+ return this._content;
3704
+ }
3705
+ get value() {
3706
+ return this._value;
3707
+ }
3708
+ loadElement() {
3709
+ const digipairEl = document.querySelector('digipair-chatbot');
3710
+ this.state = 'selecting';
3711
+ digipairEl.closeResult();
3712
+ const unsetCurrentElement = ()=>{
3713
+ document.querySelectorAll('.digipair-input-element-selecting').forEach((el)=>el.classList.remove('digipair-input-element-selecting'));
3714
+ };
3715
+ const keydown = (event)=>{
3716
+ if (event.key === 'Escape' || event.keyCode === 27) {
3717
+ document.removeEventListener('keydown', keydown);
3718
+ document.removeEventListener('click', click);
3719
+ document.removeEventListener('mouseout', mouseout);
3720
+ unsetCurrentElement();
3721
+ this.state = this._value ? 'loaded' : 'unloaded';
3722
+ digipairEl.openResult();
3723
+ }
3724
+ };
3725
+ const click = (event)=>{
3726
+ if (event.target.closest('digipair-chatbot')) {
3727
+ return;
3728
+ }
3729
+ document.removeEventListener('keydown', keydown);
3730
+ document.removeEventListener('click', click);
3731
+ document.removeEventListener('mouseout', mouseout);
3732
+ const selector = document.querySelector('.digipair-input-element-selecting');
3733
+ if (!selector) {
3734
+ this.state = this._value ? 'loaded' : 'unloaded';
3735
+ digipairEl.openResult();
3736
+ return;
3737
+ }
3738
+ this._value = getCssSelector(selector, {
3739
+ blacklist: [
3740
+ '.digipair-input-element-selecting'
3741
+ ]
3742
+ });
3743
+ this._content = `> $(${this._value})`;
3744
+ this.state = 'loaded';
3745
+ unsetCurrentElement();
3746
+ this.dispatchEvent(new CustomEvent('change', {
3747
+ detail: {
3748
+ value: this.value
3749
+ }
3750
+ }));
3751
+ setTimeout(()=>{
3752
+ digipairEl.openResult();
3753
+ }, 1);
3754
+ };
3755
+ const mouseout = (event)=>{
3756
+ var _event_target_closest;
3757
+ if (event.target.closest('digipair-chatbot')) {
3758
+ return;
3759
+ }
3760
+ unsetCurrentElement();
3761
+ (_event_target_closest = event.target.closest(this.filter)) == null ? void 0 : _event_target_closest.classList.add('digipair-input-element-selecting');
3762
+ this.requestUpdate();
3763
+ };
3764
+ document.addEventListener('keydown', keydown);
3765
+ document.addEventListener('click', click);
3766
+ document.addEventListener('mouseout', mouseout);
3767
+ }
3768
+ addSelectingStyle() {
3769
+ if (document.querySelector('#digipair-input-element-style')) {
3770
+ return;
3771
+ }
3772
+ const style = document.createElement('style');
3773
+ style.setAttribute('id', 'digipair-input-element-style');
3774
+ style.innerHTML = `
3775
+ .digipair-input-element-selecting {
3776
+ border: 1px dashed rgb(153, 153, 153) !important;
3777
+ }
3778
+ `;
3779
+ document.body.append(style);
3780
+ }
3781
+ connectedCallback() {
3782
+ super.connectedCallback();
3783
+ this.addSelectingStyle();
3784
+ if (this.selector) {
3785
+ this._value = this.selector;
3786
+ this._content = `> $(${this.selector})`;
3787
+ this.state = 'loaded';
3788
+ }
3789
+ }
3790
+ render() {
3791
+ return x`
3792
+ <section
3793
+ class="digipair-input ${this.state}"
3794
+ @click=${()=>[
3795
+ 'unloaded',
3796
+ 'loaded'
3797
+ ].indexOf(this.state) >= 0 ? this.loadElement() : void 0}
3798
+ >
3799
+ ${this.state === 'loaded' ? x` <ui5-icon name="attachment"></ui5-icon> <p>${this.label}<br />${this._content}</p> ` : this.state === 'selecting' ? x` <ui5-icon name="locate-me"></ui5-icon> <p>${this.label}${document.querySelector('.digipair-input-element-selecting') ? x`<br />$(${getCssSelector(document.querySelector('.digipair-input-element-selecting'), {
3800
+ blacklist: [
3801
+ '.digipair-input-element-selecting'
3802
+ ]
3803
+ })})` : T}</p>` : x` <ui5-icon name="add-document"></ui5-icon> <p>${this.label}</p>`}
3804
+ </section>
3805
+ `;
3806
+ }
3807
+ constructor(...args){
3808
+ super(...args);
3809
+ this.label = 'Element';
3810
+ this.selector = '';
3811
+ this.filter = '*';
3812
+ this.required = true;
3813
+ this.state = 'unloaded';
3814
+ this._content = 'aucun element selectionne';
3815
+ this._value = '';
3816
+ }
3817
+ }
3818
+ ElementElement.styles = i$2`
3819
+ .digipair-input {
3820
+ padding: 10px 15px;
3821
+ margin-bottom: 10px;
3822
+ line-height: 1.4;
3823
+ border-color: rgb(220, 248, 198);
3824
+ border: 1px solid rgb(153, 153, 153);
3825
+ color: rgb(153, 153, 153);
3826
+ align-self: flex-start;
3827
+ margin-right: auto;
3828
+ text-align: center;
3829
+ }
3830
+
3831
+ .digipair-input.unloaded ui5-icon {
3832
+ color: rgb(153, 153, 153);
3833
+ }
3834
+
3835
+ .digipair-input.loaded {
3836
+ border: 1px solid rgb(213 213 213);
3837
+ color: rgb(0, 0, 0);
3838
+ }
3839
+
3840
+ .digipair-input p {
3841
+ text-align: center;
3842
+ font-size: 12px;
3843
+ margin: 0;
3844
+ }
3845
+
3846
+ .digipair-input.unloaded {
3847
+ cursor: pointer;
3848
+ }
3849
+
3850
+ .digipair-input.loaded ui5-icon {
3851
+ float: left;
3852
+ }
3853
+ `;
3854
+ __decorate([
3855
+ n()
3856
+ ], ElementElement.prototype, "label", void 0);
3857
+ __decorate([
3858
+ n()
3859
+ ], ElementElement.prototype, "selector", void 0);
3860
+ __decorate([
3861
+ n()
3862
+ ], ElementElement.prototype, "filter", void 0);
3863
+ __decorate([
3864
+ n()
3865
+ ], ElementElement.prototype, "required", void 0);
3866
+ __decorate([
3867
+ r()
3868
+ ], ElementElement.prototype, "state", void 0);
3869
+ __decorate([
3870
+ r()
3871
+ ], ElementElement.prototype, "_content", void 0);
3872
+ ElementElement = __decorate([
3873
+ t('digipair-input-element')
3874
+ ], ElementElement);
3875
+
3876
+ class FetchElement extends s {
3877
+ get value() {
3878
+ return this._value;
3879
+ }
3880
+ connectedCallback() {
3881
+ super.connectedCallback();
3882
+ this.initialize();
3883
+ }
3884
+ async initialize() {
3885
+ const response = await fetch(this.url);
3886
+ if (this.type === 'text') {
3887
+ this._value = await response.text();
3888
+ } else if (this.type === 'json') {
3889
+ this._value = await response.json();
3890
+ }
3891
+ this.dispatchEvent(new CustomEvent('change', {
3892
+ detail: {
3893
+ value: this.value
3894
+ }
3895
+ }));
3896
+ }
3897
+ render() {
3898
+ return x``;
3899
+ }
3900
+ constructor(...args){
3901
+ super(...args);
3902
+ this.type = 'json';
3903
+ this.required = true;
3904
+ }
3905
+ }
3906
+ __decorate([
3907
+ n(),
3908
+ __metadata("design:type", String)
3909
+ ], FetchElement.prototype, "url", void 0);
3910
+ __decorate([
3911
+ n(),
3912
+ __metadata("design:type", String)
3913
+ ], FetchElement.prototype, "type", void 0);
3914
+ __decorate([
3915
+ n()
3916
+ ], FetchElement.prototype, "required", void 0);
3917
+ FetchElement = __decorate([
3918
+ t('digipair-input-fetch')
3919
+ ], FetchElement);
3920
+
3921
+ class HiddenElement extends s {
3922
+ render() {
3923
+ return x``;
3924
+ }
3925
+ constructor(...args){
3926
+ super(...args);
3927
+ this.value = '';
3928
+ this.required = true;
3929
+ }
3930
+ }
3931
+ __decorate([
3932
+ n()
3933
+ ], HiddenElement.prototype, "value", void 0);
3934
+ __decorate([
3935
+ n()
3936
+ ], HiddenElement.prototype, "required", void 0);
3937
+ HiddenElement = __decorate([
3938
+ t('digipair-input-hidden')
3939
+ ], HiddenElement);
3940
+
3941
+ export { DomAttributeElement, ElementElement, FetchElement, HiddenElement, InputFileElement, InputJsonElement, InputTextElement };