@startinblox/components-ds4go 2.0.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/index.js +1143 -795
- package/package.json +1 -1
- package/src/components/solid-fact-bundle-creation.ts +399 -0
- package/src/components/solid-fact-bundle.ts +27 -5
- package/src/context.json +15 -1
- package/src/styles/_helpers/flex.scss +7 -5
- package/src/styles/modal/ds4go-fact-bundle-modal.scss +4 -2
package/dist/index.js
CHANGED
|
@@ -1,190 +1,190 @@
|
|
|
1
|
-
const
|
|
2
|
-
let
|
|
3
|
-
constructor(
|
|
4
|
-
if (this._$cssResult$ = !0,
|
|
5
|
-
this.cssText =
|
|
1
|
+
const K = globalThis, pe = K.ShadowRoot && (K.ShadyCSS === void 0 || K.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, me = /* @__PURE__ */ Symbol(), we = /* @__PURE__ */ new WeakMap();
|
|
2
|
+
let He = class {
|
|
3
|
+
constructor(e, s, r) {
|
|
4
|
+
if (this._$cssResult$ = !0, r !== me) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
5
|
+
this.cssText = e, this.t = s;
|
|
6
6
|
}
|
|
7
7
|
get styleSheet() {
|
|
8
|
-
let
|
|
8
|
+
let e = this.o;
|
|
9
9
|
const s = this.t;
|
|
10
|
-
if (
|
|
11
|
-
const
|
|
12
|
-
|
|
10
|
+
if (pe && e === void 0) {
|
|
11
|
+
const r = s !== void 0 && s.length === 1;
|
|
12
|
+
r && (e = we.get(s)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), r && we.set(s, e));
|
|
13
13
|
}
|
|
14
|
-
return
|
|
14
|
+
return e;
|
|
15
15
|
}
|
|
16
16
|
toString() {
|
|
17
17
|
return this.cssText;
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
const
|
|
21
|
-
const s =
|
|
20
|
+
const ge = (t) => new He(typeof t == "string" ? t : t + "", void 0, me), ee = (t, ...e) => {
|
|
21
|
+
const s = t.length === 1 ? t[0] : e.reduce((r, i, o) => r + ((n) => {
|
|
22
22
|
if (n._$cssResult$ === !0) return n.cssText;
|
|
23
23
|
if (typeof n == "number") return n;
|
|
24
24
|
throw Error("Value passed to 'css' function must be a 'css' function result: " + n + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
25
|
-
})(
|
|
26
|
-
return new
|
|
27
|
-
},
|
|
28
|
-
if (
|
|
29
|
-
else for (const s of
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
},
|
|
25
|
+
})(i) + t[o + 1], t[0]);
|
|
26
|
+
return new He(s, t, me);
|
|
27
|
+
}, tt = (t, e) => {
|
|
28
|
+
if (pe) t.adoptedStyleSheets = e.map((s) => s instanceof CSSStyleSheet ? s : s.styleSheet);
|
|
29
|
+
else for (const s of e) {
|
|
30
|
+
const r = document.createElement("style"), i = K.litNonce;
|
|
31
|
+
i !== void 0 && r.setAttribute("nonce", i), r.textContent = s.cssText, t.appendChild(r);
|
|
32
|
+
}
|
|
33
|
+
}, xe = pe ? (t) => t : (t) => t instanceof CSSStyleSheet ? ((e) => {
|
|
34
34
|
let s = "";
|
|
35
|
-
for (const
|
|
36
|
-
return
|
|
37
|
-
})(
|
|
38
|
-
const { is:
|
|
39
|
-
switch (
|
|
35
|
+
for (const r of e.cssRules) s += r.cssText;
|
|
36
|
+
return ge(s);
|
|
37
|
+
})(t) : t;
|
|
38
|
+
const { is: st, defineProperty: it, getOwnPropertyDescriptor: rt, getOwnPropertyNames: ot, getOwnPropertySymbols: nt, getPrototypeOf: at } = Object, te = globalThis, Ae = te.trustedTypes, lt = Ae ? Ae.emptyScript : "", ct = te.reactiveElementPolyfillSupport, L = (t, e) => t, G = { toAttribute(t, e) {
|
|
39
|
+
switch (e) {
|
|
40
40
|
case Boolean:
|
|
41
|
-
|
|
41
|
+
t = t ? lt : null;
|
|
42
42
|
break;
|
|
43
43
|
case Object:
|
|
44
44
|
case Array:
|
|
45
|
-
|
|
45
|
+
t = t == null ? t : JSON.stringify(t);
|
|
46
46
|
}
|
|
47
|
-
return
|
|
48
|
-
}, fromAttribute(
|
|
49
|
-
let s =
|
|
50
|
-
switch (
|
|
47
|
+
return t;
|
|
48
|
+
}, fromAttribute(t, e) {
|
|
49
|
+
let s = t;
|
|
50
|
+
switch (e) {
|
|
51
51
|
case Boolean:
|
|
52
|
-
s =
|
|
52
|
+
s = t !== null;
|
|
53
53
|
break;
|
|
54
54
|
case Number:
|
|
55
|
-
s =
|
|
55
|
+
s = t === null ? null : Number(t);
|
|
56
56
|
break;
|
|
57
57
|
case Object:
|
|
58
58
|
case Array:
|
|
59
59
|
try {
|
|
60
|
-
s = JSON.parse(
|
|
60
|
+
s = JSON.parse(t);
|
|
61
61
|
} catch {
|
|
62
62
|
s = null;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
return s;
|
|
66
|
-
} },
|
|
67
|
-
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"),
|
|
68
|
-
let
|
|
69
|
-
static addInitializer(
|
|
70
|
-
this._$Ei(), (this.l ??= []).push(
|
|
66
|
+
} }, se = (t, e) => !st(t, e), Se = { attribute: !0, type: String, converter: G, reflect: !1, useDefault: !1, hasChanged: se };
|
|
67
|
+
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), te.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
68
|
+
let R = class extends HTMLElement {
|
|
69
|
+
static addInitializer(e) {
|
|
70
|
+
this._$Ei(), (this.l ??= []).push(e);
|
|
71
71
|
}
|
|
72
72
|
static get observedAttributes() {
|
|
73
73
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
74
74
|
}
|
|
75
|
-
static createProperty(
|
|
76
|
-
if (s.state && (s.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(
|
|
77
|
-
const
|
|
78
|
-
|
|
75
|
+
static createProperty(e, s = Se) {
|
|
76
|
+
if (s.state && (s.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(e) && ((s = Object.create(s)).wrapped = !0), this.elementProperties.set(e, s), !s.noAccessor) {
|
|
77
|
+
const r = /* @__PURE__ */ Symbol(), i = this.getPropertyDescriptor(e, r, s);
|
|
78
|
+
i !== void 0 && it(this.prototype, e, i);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
static getPropertyDescriptor(
|
|
82
|
-
const { get:
|
|
81
|
+
static getPropertyDescriptor(e, s, r) {
|
|
82
|
+
const { get: i, set: o } = rt(this.prototype, e) ?? { get() {
|
|
83
83
|
return this[s];
|
|
84
84
|
}, set(n) {
|
|
85
85
|
this[s] = n;
|
|
86
86
|
} };
|
|
87
|
-
return { get:
|
|
88
|
-
const a =
|
|
89
|
-
o?.call(this, n), this.requestUpdate(
|
|
87
|
+
return { get: i, set(n) {
|
|
88
|
+
const a = i?.call(this);
|
|
89
|
+
o?.call(this, n), this.requestUpdate(e, a, r);
|
|
90
90
|
}, configurable: !0, enumerable: !0 };
|
|
91
91
|
}
|
|
92
|
-
static getPropertyOptions(
|
|
93
|
-
return this.elementProperties.get(
|
|
92
|
+
static getPropertyOptions(e) {
|
|
93
|
+
return this.elementProperties.get(e) ?? Se;
|
|
94
94
|
}
|
|
95
95
|
static _$Ei() {
|
|
96
|
-
if (this.hasOwnProperty(
|
|
97
|
-
const
|
|
98
|
-
|
|
96
|
+
if (this.hasOwnProperty(L("elementProperties"))) return;
|
|
97
|
+
const e = at(this);
|
|
98
|
+
e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
|
|
99
99
|
}
|
|
100
100
|
static finalize() {
|
|
101
|
-
if (this.hasOwnProperty(
|
|
102
|
-
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(
|
|
103
|
-
const s = this.properties,
|
|
104
|
-
for (const
|
|
101
|
+
if (this.hasOwnProperty(L("finalized"))) return;
|
|
102
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(L("properties"))) {
|
|
103
|
+
const s = this.properties, r = [...ot(s), ...nt(s)];
|
|
104
|
+
for (const i of r) this.createProperty(i, s[i]);
|
|
105
105
|
}
|
|
106
|
-
const
|
|
107
|
-
if (
|
|
108
|
-
const s = litPropertyMetadata.get(
|
|
109
|
-
if (s !== void 0) for (const [
|
|
106
|
+
const e = this[Symbol.metadata];
|
|
107
|
+
if (e !== null) {
|
|
108
|
+
const s = litPropertyMetadata.get(e);
|
|
109
|
+
if (s !== void 0) for (const [r, i] of s) this.elementProperties.set(r, i);
|
|
110
110
|
}
|
|
111
111
|
this._$Eh = /* @__PURE__ */ new Map();
|
|
112
|
-
for (const [s,
|
|
113
|
-
const
|
|
114
|
-
|
|
112
|
+
for (const [s, r] of this.elementProperties) {
|
|
113
|
+
const i = this._$Eu(s, r);
|
|
114
|
+
i !== void 0 && this._$Eh.set(i, s);
|
|
115
115
|
}
|
|
116
116
|
this.elementStyles = this.finalizeStyles(this.styles);
|
|
117
117
|
}
|
|
118
|
-
static finalizeStyles(
|
|
118
|
+
static finalizeStyles(e) {
|
|
119
119
|
const s = [];
|
|
120
|
-
if (Array.isArray(
|
|
121
|
-
const
|
|
122
|
-
for (const
|
|
123
|
-
} else
|
|
120
|
+
if (Array.isArray(e)) {
|
|
121
|
+
const r = new Set(e.flat(1 / 0).reverse());
|
|
122
|
+
for (const i of r) s.unshift(xe(i));
|
|
123
|
+
} else e !== void 0 && s.push(xe(e));
|
|
124
124
|
return s;
|
|
125
125
|
}
|
|
126
|
-
static _$Eu(
|
|
127
|
-
const
|
|
128
|
-
return
|
|
126
|
+
static _$Eu(e, s) {
|
|
127
|
+
const r = s.attribute;
|
|
128
|
+
return r === !1 ? void 0 : typeof r == "string" ? r : typeof e == "string" ? e.toLowerCase() : void 0;
|
|
129
129
|
}
|
|
130
130
|
constructor() {
|
|
131
131
|
super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
|
|
132
132
|
}
|
|
133
133
|
_$Ev() {
|
|
134
|
-
this._$ES = new Promise((
|
|
134
|
+
this._$ES = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((e) => e(this));
|
|
135
135
|
}
|
|
136
|
-
addController(
|
|
137
|
-
(this._$EO ??= /* @__PURE__ */ new Set()).add(
|
|
136
|
+
addController(e) {
|
|
137
|
+
(this._$EO ??= /* @__PURE__ */ new Set()).add(e), this.renderRoot !== void 0 && this.isConnected && e.hostConnected?.();
|
|
138
138
|
}
|
|
139
|
-
removeController(
|
|
140
|
-
this._$EO?.delete(
|
|
139
|
+
removeController(e) {
|
|
140
|
+
this._$EO?.delete(e);
|
|
141
141
|
}
|
|
142
142
|
_$E_() {
|
|
143
|
-
const
|
|
144
|
-
for (const
|
|
145
|
-
|
|
143
|
+
const e = /* @__PURE__ */ new Map(), s = this.constructor.elementProperties;
|
|
144
|
+
for (const r of s.keys()) this.hasOwnProperty(r) && (e.set(r, this[r]), delete this[r]);
|
|
145
|
+
e.size > 0 && (this._$Ep = e);
|
|
146
146
|
}
|
|
147
147
|
createRenderRoot() {
|
|
148
|
-
const
|
|
149
|
-
return
|
|
148
|
+
const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
149
|
+
return tt(e, this.constructor.elementStyles), e;
|
|
150
150
|
}
|
|
151
151
|
connectedCallback() {
|
|
152
|
-
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach((
|
|
152
|
+
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach((e) => e.hostConnected?.());
|
|
153
153
|
}
|
|
154
|
-
enableUpdating(
|
|
154
|
+
enableUpdating(e) {
|
|
155
155
|
}
|
|
156
156
|
disconnectedCallback() {
|
|
157
|
-
this._$EO?.forEach((
|
|
157
|
+
this._$EO?.forEach((e) => e.hostDisconnected?.());
|
|
158
158
|
}
|
|
159
|
-
attributeChangedCallback(
|
|
160
|
-
this._$AK(
|
|
159
|
+
attributeChangedCallback(e, s, r) {
|
|
160
|
+
this._$AK(e, r);
|
|
161
161
|
}
|
|
162
|
-
_$ET(
|
|
163
|
-
const
|
|
164
|
-
if (
|
|
165
|
-
const o = (
|
|
166
|
-
this._$Em =
|
|
162
|
+
_$ET(e, s) {
|
|
163
|
+
const r = this.constructor.elementProperties.get(e), i = this.constructor._$Eu(e, r);
|
|
164
|
+
if (i !== void 0 && r.reflect === !0) {
|
|
165
|
+
const o = (r.converter?.toAttribute !== void 0 ? r.converter : G).toAttribute(s, r.type);
|
|
166
|
+
this._$Em = e, o == null ? this.removeAttribute(i) : this.setAttribute(i, o), this._$Em = null;
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
|
-
_$AK(
|
|
170
|
-
const
|
|
171
|
-
if (
|
|
172
|
-
const o =
|
|
173
|
-
this._$Em =
|
|
169
|
+
_$AK(e, s) {
|
|
170
|
+
const r = this.constructor, i = r._$Eh.get(e);
|
|
171
|
+
if (i !== void 0 && this._$Em !== i) {
|
|
172
|
+
const o = r.getPropertyOptions(i), n = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute !== void 0 ? o.converter : G;
|
|
173
|
+
this._$Em = i;
|
|
174
174
|
const a = n.fromAttribute(s, o.type);
|
|
175
|
-
this[
|
|
175
|
+
this[i] = a ?? this._$Ej?.get(i) ?? a, this._$Em = null;
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
|
-
requestUpdate(
|
|
179
|
-
if (
|
|
178
|
+
requestUpdate(e, s, r, i = !1, o) {
|
|
179
|
+
if (e !== void 0) {
|
|
180
180
|
const n = this.constructor;
|
|
181
|
-
if (
|
|
182
|
-
this.C(
|
|
181
|
+
if (i === !1 && (o = this[e]), r ??= n.getPropertyOptions(e), !((r.hasChanged ?? se)(o, s) || r.useDefault && r.reflect && o === this._$Ej?.get(e) && !this.hasAttribute(n._$Eu(e, r)))) return;
|
|
182
|
+
this.C(e, s, r);
|
|
183
183
|
}
|
|
184
184
|
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
185
185
|
}
|
|
186
|
-
C(
|
|
187
|
-
|
|
186
|
+
C(e, s, { useDefault: r, reflect: i, wrapped: o }, n) {
|
|
187
|
+
r && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(e) && (this._$Ej.set(e, n ?? s ?? this[e]), o !== !0 || n !== void 0) || (this._$AL.has(e) || (this.hasUpdated || r || (s = void 0), this._$AL.set(e, s)), i === !0 && this._$Em !== e && (this._$Eq ??= /* @__PURE__ */ new Set()).add(e));
|
|
188
188
|
}
|
|
189
189
|
async _$EP() {
|
|
190
190
|
this.isUpdatePending = !0;
|
|
@@ -193,8 +193,8 @@ let S = class extends HTMLElement {
|
|
|
193
193
|
} catch (s) {
|
|
194
194
|
Promise.reject(s);
|
|
195
195
|
}
|
|
196
|
-
const
|
|
197
|
-
return
|
|
196
|
+
const e = this.scheduleUpdate();
|
|
197
|
+
return e != null && await e, !this.isUpdatePending;
|
|
198
198
|
}
|
|
199
199
|
scheduleUpdate() {
|
|
200
200
|
return this.performUpdate();
|
|
@@ -203,28 +203,28 @@ let S = class extends HTMLElement {
|
|
|
203
203
|
if (!this.isUpdatePending) return;
|
|
204
204
|
if (!this.hasUpdated) {
|
|
205
205
|
if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
|
|
206
|
-
for (const [
|
|
206
|
+
for (const [i, o] of this._$Ep) this[i] = o;
|
|
207
207
|
this._$Ep = void 0;
|
|
208
208
|
}
|
|
209
|
-
const
|
|
210
|
-
if (
|
|
211
|
-
const { wrapped: n } = o, a = this[
|
|
212
|
-
n !== !0 || this._$AL.has(
|
|
209
|
+
const r = this.constructor.elementProperties;
|
|
210
|
+
if (r.size > 0) for (const [i, o] of r) {
|
|
211
|
+
const { wrapped: n } = o, a = this[i];
|
|
212
|
+
n !== !0 || this._$AL.has(i) || a === void 0 || this.C(i, void 0, o, a);
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
|
-
let
|
|
215
|
+
let e = !1;
|
|
216
216
|
const s = this._$AL;
|
|
217
217
|
try {
|
|
218
|
-
|
|
219
|
-
} catch (
|
|
220
|
-
throw
|
|
218
|
+
e = this.shouldUpdate(s), e ? (this.willUpdate(s), this._$EO?.forEach((r) => r.hostUpdate?.()), this.update(s)) : this._$EM();
|
|
219
|
+
} catch (r) {
|
|
220
|
+
throw e = !1, this._$EM(), r;
|
|
221
221
|
}
|
|
222
|
-
|
|
222
|
+
e && this._$AE(s);
|
|
223
223
|
}
|
|
224
|
-
willUpdate(
|
|
224
|
+
willUpdate(e) {
|
|
225
225
|
}
|
|
226
|
-
_$AE(
|
|
227
|
-
this._$EO?.forEach((s) => s.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(
|
|
226
|
+
_$AE(e) {
|
|
227
|
+
this._$EO?.forEach((s) => s.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(e)), this.updated(e);
|
|
228
228
|
}
|
|
229
229
|
_$EM() {
|
|
230
230
|
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
|
|
@@ -235,83 +235,83 @@ let S = class extends HTMLElement {
|
|
|
235
235
|
getUpdateComplete() {
|
|
236
236
|
return this._$ES;
|
|
237
237
|
}
|
|
238
|
-
shouldUpdate(
|
|
238
|
+
shouldUpdate(e) {
|
|
239
239
|
return !0;
|
|
240
240
|
}
|
|
241
|
-
update(
|
|
241
|
+
update(e) {
|
|
242
242
|
this._$Eq &&= this._$Eq.forEach((s) => this._$ET(s, this[s])), this._$EM();
|
|
243
243
|
}
|
|
244
|
-
updated(
|
|
244
|
+
updated(e) {
|
|
245
245
|
}
|
|
246
|
-
firstUpdated(
|
|
246
|
+
firstUpdated(e) {
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
|
-
|
|
250
|
-
const
|
|
251
|
-
\f\r]`,
|
|
252
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
|
253
|
-
function
|
|
254
|
-
if (!
|
|
255
|
-
return
|
|
249
|
+
R.elementStyles = [], R.shadowRootOptions = { mode: "open" }, R[L("elementProperties")] = /* @__PURE__ */ new Map(), R[L("finalized")] = /* @__PURE__ */ new Map(), ct?.({ ReactiveElement: R }), (te.reactiveElementVersions ??= []).push("2.1.2");
|
|
250
|
+
const ye = globalThis, Ce = (t) => t, Z = ye.trustedTypes, Ee = Z ? Z.createPolicy("lit-html", { createHTML: (t) => t }) : void 0, qe = "$lit$", w = `lit$${Math.random().toFixed(9).slice(2)}$`, ze = "?" + w, dt = `<${ze}>`, P = document, F = () => P.createComment(""), B = (t) => t === null || typeof t != "object" && typeof t != "function", ve = Array.isArray, ht = (t) => ve(t) || typeof t?.[Symbol.iterator] == "function", oe = `[
|
|
251
|
+
\f\r]`, M = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Pe = /-->/g, je = />/g, S = RegExp(`>|${oe}(?:([^\\s"'>=/]+)(${oe}*=${oe}*(?:[^
|
|
252
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), Re = /'/g, Oe = /"/g, Ie = /^(?:script|style|textarea|title)$/i, ut = (t) => (e, ...s) => ({ _$litType$: t, strings: e, values: s }), p = ut(1), k = /* @__PURE__ */ Symbol.for("lit-noChange"), c = /* @__PURE__ */ Symbol.for("lit-nothing"), Te = /* @__PURE__ */ new WeakMap(), E = P.createTreeWalker(P, 129);
|
|
253
|
+
function Ve(t, e) {
|
|
254
|
+
if (!ve(t) || !t.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
255
|
+
return Ee !== void 0 ? Ee.createHTML(e) : e;
|
|
256
256
|
}
|
|
257
|
-
const
|
|
258
|
-
const s =
|
|
259
|
-
let
|
|
257
|
+
const ft = (t, e) => {
|
|
258
|
+
const s = t.length - 1, r = [];
|
|
259
|
+
let i, o = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", n = M;
|
|
260
260
|
for (let a = 0; a < s; a++) {
|
|
261
|
-
const l =
|
|
262
|
-
let
|
|
263
|
-
for (;
|
|
264
|
-
const
|
|
265
|
-
o += n ===
|
|
261
|
+
const l = t[a];
|
|
262
|
+
let d, f, h = -1, $ = 0;
|
|
263
|
+
for (; $ < l.length && (n.lastIndex = $, f = n.exec(l), f !== null); ) $ = n.lastIndex, n === M ? f[1] === "!--" ? n = Pe : f[1] !== void 0 ? n = je : f[2] !== void 0 ? (Ie.test(f[2]) && (i = RegExp("</" + f[2], "g")), n = S) : f[3] !== void 0 && (n = S) : n === S ? f[0] === ">" ? (n = i ?? M, h = -1) : f[1] === void 0 ? h = -2 : (h = n.lastIndex - f[2].length, d = f[1], n = f[3] === void 0 ? S : f[3] === '"' ? Oe : Re) : n === Oe || n === Re ? n = S : n === Pe || n === je ? n = M : (n = S, i = void 0);
|
|
264
|
+
const _ = n === S && t[a + 1].startsWith("/>") ? " " : "";
|
|
265
|
+
o += n === M ? l + dt : h >= 0 ? (r.push(d), l.slice(0, h) + qe + l.slice(h) + w + _) : l + w + (h === -2 ? a : _);
|
|
266
266
|
}
|
|
267
|
-
return [
|
|
267
|
+
return [Ve(t, o + (t[s] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), r];
|
|
268
268
|
};
|
|
269
|
-
class
|
|
270
|
-
constructor({ strings:
|
|
271
|
-
let
|
|
269
|
+
class H {
|
|
270
|
+
constructor({ strings: e, _$litType$: s }, r) {
|
|
271
|
+
let i;
|
|
272
272
|
this.parts = [];
|
|
273
273
|
let o = 0, n = 0;
|
|
274
|
-
const a =
|
|
275
|
-
if (this.el =
|
|
274
|
+
const a = e.length - 1, l = this.parts, [d, f] = ft(e, s);
|
|
275
|
+
if (this.el = H.createElement(d, r), E.currentNode = this.el.content, s === 2 || s === 3) {
|
|
276
276
|
const h = this.el.content.firstChild;
|
|
277
277
|
h.replaceWith(...h.childNodes);
|
|
278
278
|
}
|
|
279
|
-
for (; (
|
|
280
|
-
if (
|
|
281
|
-
if (
|
|
282
|
-
const
|
|
283
|
-
l.push({ type: 1, index: o, name:
|
|
284
|
-
} else h.startsWith(
|
|
285
|
-
if (
|
|
286
|
-
const h =
|
|
287
|
-
if (
|
|
288
|
-
|
|
289
|
-
for (let
|
|
290
|
-
|
|
279
|
+
for (; (i = E.nextNode()) !== null && l.length < a; ) {
|
|
280
|
+
if (i.nodeType === 1) {
|
|
281
|
+
if (i.hasAttributes()) for (const h of i.getAttributeNames()) if (h.endsWith(qe)) {
|
|
282
|
+
const $ = f[n++], _ = i.getAttribute(h).split(w), V = /([.?@])?(.*)/.exec($);
|
|
283
|
+
l.push({ type: 1, index: o, name: V[2], strings: _, ctor: V[1] === "." ? mt : V[1] === "?" ? gt : V[1] === "@" ? yt : ie }), i.removeAttribute(h);
|
|
284
|
+
} else h.startsWith(w) && (l.push({ type: 6, index: o }), i.removeAttribute(h));
|
|
285
|
+
if (Ie.test(i.tagName)) {
|
|
286
|
+
const h = i.textContent.split(w), $ = h.length - 1;
|
|
287
|
+
if ($ > 0) {
|
|
288
|
+
i.textContent = Z ? Z.emptyScript : "";
|
|
289
|
+
for (let _ = 0; _ < $; _++) i.append(h[_], F()), E.nextNode(), l.push({ type: 2, index: ++o });
|
|
290
|
+
i.append(h[$], F());
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
|
-
} else if (
|
|
293
|
+
} else if (i.nodeType === 8) if (i.data === ze) l.push({ type: 2, index: o });
|
|
294
294
|
else {
|
|
295
295
|
let h = -1;
|
|
296
|
-
for (; (h =
|
|
296
|
+
for (; (h = i.data.indexOf(w, h + 1)) !== -1; ) l.push({ type: 7, index: o }), h += w.length - 1;
|
|
297
297
|
}
|
|
298
298
|
o++;
|
|
299
299
|
}
|
|
300
300
|
}
|
|
301
|
-
static createElement(
|
|
302
|
-
const
|
|
303
|
-
return
|
|
301
|
+
static createElement(e, s) {
|
|
302
|
+
const r = P.createElement("template");
|
|
303
|
+
return r.innerHTML = e, r;
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
|
-
function
|
|
307
|
-
if (
|
|
308
|
-
let
|
|
309
|
-
const o =
|
|
310
|
-
return
|
|
306
|
+
function D(t, e, s = t, r) {
|
|
307
|
+
if (e === k) return e;
|
|
308
|
+
let i = r !== void 0 ? s._$Co?.[r] : s._$Cl;
|
|
309
|
+
const o = B(e) ? void 0 : e._$litDirective$;
|
|
310
|
+
return i?.constructor !== o && (i?._$AO?.(!1), o === void 0 ? i = void 0 : (i = new o(t), i._$AT(t, s, r)), r !== void 0 ? (s._$Co ??= [])[r] = i : s._$Cl = i), i !== void 0 && (e = D(t, i._$AS(t, e.values), i, r)), e;
|
|
311
311
|
}
|
|
312
|
-
class
|
|
313
|
-
constructor(
|
|
314
|
-
this._$AV = [], this._$AN = void 0, this._$AD =
|
|
312
|
+
class pt {
|
|
313
|
+
constructor(e, s) {
|
|
314
|
+
this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = s;
|
|
315
315
|
}
|
|
316
316
|
get parentNode() {
|
|
317
317
|
return this._$AM.parentNode;
|
|
@@ -319,35 +319,35 @@ class ce {
|
|
|
319
319
|
get _$AU() {
|
|
320
320
|
return this._$AM._$AU;
|
|
321
321
|
}
|
|
322
|
-
u(
|
|
323
|
-
const { el: { content: s }, parts:
|
|
324
|
-
|
|
325
|
-
let o =
|
|
322
|
+
u(e) {
|
|
323
|
+
const { el: { content: s }, parts: r } = this._$AD, i = (e?.creationScope ?? P).importNode(s, !0);
|
|
324
|
+
E.currentNode = i;
|
|
325
|
+
let o = E.nextNode(), n = 0, a = 0, l = r[0];
|
|
326
326
|
for (; l !== void 0; ) {
|
|
327
327
|
if (n === l.index) {
|
|
328
|
-
let
|
|
329
|
-
l.type === 2 ?
|
|
328
|
+
let d;
|
|
329
|
+
l.type === 2 ? d = new z(o, o.nextSibling, this, e) : l.type === 1 ? d = new l.ctor(o, l.name, l.strings, this, e) : l.type === 6 && (d = new vt(o, this, e)), this._$AV.push(d), l = r[++a];
|
|
330
330
|
}
|
|
331
|
-
n !== l?.index && (o =
|
|
331
|
+
n !== l?.index && (o = E.nextNode(), n++);
|
|
332
332
|
}
|
|
333
|
-
return
|
|
333
|
+
return E.currentNode = P, i;
|
|
334
334
|
}
|
|
335
|
-
p(
|
|
335
|
+
p(e) {
|
|
336
336
|
let s = 0;
|
|
337
|
-
for (const
|
|
337
|
+
for (const r of this._$AV) r !== void 0 && (r.strings !== void 0 ? (r._$AI(e, r, s), s += r.strings.length - 2) : r._$AI(e[s])), s++;
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
|
-
class
|
|
340
|
+
class z {
|
|
341
341
|
get _$AU() {
|
|
342
342
|
return this._$AM?._$AU ?? this._$Cv;
|
|
343
343
|
}
|
|
344
|
-
constructor(
|
|
345
|
-
this.type = 2, this._$AH = c, this._$AN = void 0, this._$AA =
|
|
344
|
+
constructor(e, s, r, i) {
|
|
345
|
+
this.type = 2, this._$AH = c, this._$AN = void 0, this._$AA = e, this._$AB = s, this._$AM = r, this.options = i, this._$Cv = i?.isConnected ?? !0;
|
|
346
346
|
}
|
|
347
347
|
get parentNode() {
|
|
348
|
-
let
|
|
348
|
+
let e = this._$AA.parentNode;
|
|
349
349
|
const s = this._$AM;
|
|
350
|
-
return s !== void 0 &&
|
|
350
|
+
return s !== void 0 && e?.nodeType === 11 && (e = s.parentNode), e;
|
|
351
351
|
}
|
|
352
352
|
get startNode() {
|
|
353
353
|
return this._$AA;
|
|
@@ -355,135 +355,135 @@ class H {
|
|
|
355
355
|
get endNode() {
|
|
356
356
|
return this._$AB;
|
|
357
357
|
}
|
|
358
|
-
_$AI(
|
|
359
|
-
|
|
358
|
+
_$AI(e, s = this) {
|
|
359
|
+
e = D(this, e, s), B(e) ? e === c || e == null || e === "" ? (this._$AH !== c && this._$AR(), this._$AH = c) : e !== this._$AH && e !== k && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : ht(e) ? this.k(e) : this._(e);
|
|
360
360
|
}
|
|
361
|
-
O(
|
|
362
|
-
return this._$AA.parentNode.insertBefore(
|
|
361
|
+
O(e) {
|
|
362
|
+
return this._$AA.parentNode.insertBefore(e, this._$AB);
|
|
363
363
|
}
|
|
364
|
-
T(
|
|
365
|
-
this._$AH !==
|
|
364
|
+
T(e) {
|
|
365
|
+
this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
|
|
366
366
|
}
|
|
367
|
-
_(
|
|
368
|
-
this._$AH !== c &&
|
|
367
|
+
_(e) {
|
|
368
|
+
this._$AH !== c && B(this._$AH) ? this._$AA.nextSibling.data = e : this.T(P.createTextNode(e)), this._$AH = e;
|
|
369
369
|
}
|
|
370
|
-
$(
|
|
371
|
-
const { values: s, _$litType$:
|
|
372
|
-
if (this._$AH?._$AD ===
|
|
370
|
+
$(e) {
|
|
371
|
+
const { values: s, _$litType$: r } = e, i = typeof r == "number" ? this._$AC(e) : (r.el === void 0 && (r.el = H.createElement(Ve(r.h, r.h[0]), this.options)), r);
|
|
372
|
+
if (this._$AH?._$AD === i) this._$AH.p(s);
|
|
373
373
|
else {
|
|
374
|
-
const o = new
|
|
374
|
+
const o = new pt(i, this), n = o.u(this.options);
|
|
375
375
|
o.p(s), this.T(n), this._$AH = o;
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
|
-
_$AC(
|
|
379
|
-
let s =
|
|
380
|
-
return s === void 0 &&
|
|
378
|
+
_$AC(e) {
|
|
379
|
+
let s = Te.get(e.strings);
|
|
380
|
+
return s === void 0 && Te.set(e.strings, s = new H(e)), s;
|
|
381
381
|
}
|
|
382
|
-
k(
|
|
383
|
-
|
|
382
|
+
k(e) {
|
|
383
|
+
ve(this._$AH) || (this._$AH = [], this._$AR());
|
|
384
384
|
const s = this._$AH;
|
|
385
|
-
let
|
|
386
|
-
for (const o of
|
|
387
|
-
|
|
388
|
-
}
|
|
389
|
-
_$AR(
|
|
390
|
-
for (this._$AP?.(!1, !0, s);
|
|
391
|
-
const
|
|
392
|
-
|
|
385
|
+
let r, i = 0;
|
|
386
|
+
for (const o of e) i === s.length ? s.push(r = new z(this.O(F()), this.O(F()), this, this.options)) : r = s[i], r._$AI(o), i++;
|
|
387
|
+
i < s.length && (this._$AR(r && r._$AB.nextSibling, i), s.length = i);
|
|
388
|
+
}
|
|
389
|
+
_$AR(e = this._$AA.nextSibling, s) {
|
|
390
|
+
for (this._$AP?.(!1, !0, s); e !== this._$AB; ) {
|
|
391
|
+
const r = Ce(e).nextSibling;
|
|
392
|
+
Ce(e).remove(), e = r;
|
|
393
393
|
}
|
|
394
394
|
}
|
|
395
|
-
setConnected(
|
|
396
|
-
this._$AM === void 0 && (this._$Cv =
|
|
395
|
+
setConnected(e) {
|
|
396
|
+
this._$AM === void 0 && (this._$Cv = e, this._$AP?.(e));
|
|
397
397
|
}
|
|
398
398
|
}
|
|
399
|
-
class
|
|
399
|
+
class ie {
|
|
400
400
|
get tagName() {
|
|
401
401
|
return this.element.tagName;
|
|
402
402
|
}
|
|
403
403
|
get _$AU() {
|
|
404
404
|
return this._$AM._$AU;
|
|
405
405
|
}
|
|
406
|
-
constructor(
|
|
407
|
-
this.type = 1, this._$AH = c, this._$AN = void 0, this.element =
|
|
406
|
+
constructor(e, s, r, i, o) {
|
|
407
|
+
this.type = 1, this._$AH = c, this._$AN = void 0, this.element = e, this.name = s, this._$AM = i, this.options = o, r.length > 2 || r[0] !== "" || r[1] !== "" ? (this._$AH = Array(r.length - 1).fill(new String()), this.strings = r) : this._$AH = c;
|
|
408
408
|
}
|
|
409
|
-
_$AI(
|
|
409
|
+
_$AI(e, s = this, r, i) {
|
|
410
410
|
const o = this.strings;
|
|
411
411
|
let n = !1;
|
|
412
|
-
if (o === void 0)
|
|
412
|
+
if (o === void 0) e = D(this, e, s, 0), n = !B(e) || e !== this._$AH && e !== k, n && (this._$AH = e);
|
|
413
413
|
else {
|
|
414
|
-
const a =
|
|
415
|
-
let l,
|
|
416
|
-
for (
|
|
414
|
+
const a = e;
|
|
415
|
+
let l, d;
|
|
416
|
+
for (e = o[0], l = 0; l < o.length - 1; l++) d = D(this, a[r + l], s, l), d === k && (d = this._$AH[l]), n ||= !B(d) || d !== this._$AH[l], d === c ? e = c : e !== c && (e += (d ?? "") + o[l + 1]), this._$AH[l] = d;
|
|
417
417
|
}
|
|
418
|
-
n && !
|
|
418
|
+
n && !i && this.j(e);
|
|
419
419
|
}
|
|
420
|
-
j(
|
|
421
|
-
|
|
420
|
+
j(e) {
|
|
421
|
+
e === c ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
|
|
422
422
|
}
|
|
423
423
|
}
|
|
424
|
-
class
|
|
424
|
+
class mt extends ie {
|
|
425
425
|
constructor() {
|
|
426
426
|
super(...arguments), this.type = 3;
|
|
427
427
|
}
|
|
428
|
-
j(
|
|
429
|
-
this.element[this.name] =
|
|
428
|
+
j(e) {
|
|
429
|
+
this.element[this.name] = e === c ? void 0 : e;
|
|
430
430
|
}
|
|
431
431
|
}
|
|
432
|
-
class
|
|
432
|
+
class gt extends ie {
|
|
433
433
|
constructor() {
|
|
434
434
|
super(...arguments), this.type = 4;
|
|
435
435
|
}
|
|
436
|
-
j(
|
|
437
|
-
this.element.toggleAttribute(this.name, !!
|
|
436
|
+
j(e) {
|
|
437
|
+
this.element.toggleAttribute(this.name, !!e && e !== c);
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
|
-
class
|
|
441
|
-
constructor(
|
|
442
|
-
super(
|
|
440
|
+
class yt extends ie {
|
|
441
|
+
constructor(e, s, r, i, o) {
|
|
442
|
+
super(e, s, r, i, o), this.type = 5;
|
|
443
443
|
}
|
|
444
|
-
_$AI(
|
|
445
|
-
if ((
|
|
446
|
-
const
|
|
447
|
-
|
|
444
|
+
_$AI(e, s = this) {
|
|
445
|
+
if ((e = D(this, e, s, 0) ?? c) === k) return;
|
|
446
|
+
const r = this._$AH, i = e === c && r !== c || e.capture !== r.capture || e.once !== r.once || e.passive !== r.passive, o = e !== c && (r === c || i);
|
|
447
|
+
i && this.element.removeEventListener(this.name, this, r), o && this.element.addEventListener(this.name, this, e), this._$AH = e;
|
|
448
448
|
}
|
|
449
|
-
handleEvent(
|
|
450
|
-
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element,
|
|
449
|
+
handleEvent(e) {
|
|
450
|
+
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, e) : this._$AH.handleEvent(e);
|
|
451
451
|
}
|
|
452
452
|
}
|
|
453
|
-
class
|
|
454
|
-
constructor(
|
|
455
|
-
this.element =
|
|
453
|
+
class vt {
|
|
454
|
+
constructor(e, s, r) {
|
|
455
|
+
this.element = e, this.type = 6, this._$AN = void 0, this._$AM = s, this.options = r;
|
|
456
456
|
}
|
|
457
457
|
get _$AU() {
|
|
458
458
|
return this._$AM._$AU;
|
|
459
459
|
}
|
|
460
|
-
_$AI(
|
|
461
|
-
|
|
460
|
+
_$AI(e) {
|
|
461
|
+
D(this, e);
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
|
-
const
|
|
465
|
-
|
|
466
|
-
const
|
|
467
|
-
const
|
|
468
|
-
let
|
|
469
|
-
if (
|
|
464
|
+
const $t = ye.litHtmlPolyfillSupport;
|
|
465
|
+
$t?.(H, z), (ye.litHtmlVersions ??= []).push("3.3.2");
|
|
466
|
+
const bt = (t, e, s) => {
|
|
467
|
+
const r = s?.renderBefore ?? e;
|
|
468
|
+
let i = r._$litPart$;
|
|
469
|
+
if (i === void 0) {
|
|
470
470
|
const o = s?.renderBefore ?? null;
|
|
471
|
-
|
|
471
|
+
r._$litPart$ = i = new z(e.insertBefore(F(), o), o, void 0, s ?? {});
|
|
472
472
|
}
|
|
473
|
-
return
|
|
473
|
+
return i._$AI(t), i;
|
|
474
474
|
};
|
|
475
|
-
const
|
|
476
|
-
let
|
|
475
|
+
const $e = globalThis;
|
|
476
|
+
let T = class extends R {
|
|
477
477
|
constructor() {
|
|
478
478
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
479
479
|
}
|
|
480
480
|
createRenderRoot() {
|
|
481
|
-
const
|
|
482
|
-
return this.renderOptions.renderBefore ??=
|
|
481
|
+
const e = super.createRenderRoot();
|
|
482
|
+
return this.renderOptions.renderBefore ??= e.firstChild, e;
|
|
483
483
|
}
|
|
484
|
-
update(
|
|
484
|
+
update(e) {
|
|
485
485
|
const s = this.render();
|
|
486
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(
|
|
486
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = bt(s, this.renderRoot, this.renderOptions);
|
|
487
487
|
}
|
|
488
488
|
connectedCallback() {
|
|
489
489
|
super.connectedCallback(), this._$Do?.setConnected(!0);
|
|
@@ -492,423 +492,423 @@ let P = class extends S {
|
|
|
492
492
|
super.disconnectedCallback(), this._$Do?.setConnected(!1);
|
|
493
493
|
}
|
|
494
494
|
render() {
|
|
495
|
-
return
|
|
495
|
+
return k;
|
|
496
496
|
}
|
|
497
497
|
};
|
|
498
|
-
|
|
499
|
-
const
|
|
500
|
-
|
|
501
|
-
(
|
|
502
|
-
class
|
|
498
|
+
T._$litElement$ = !0, T.finalized = !0, $e.litElementHydrateSupport?.({ LitElement: T });
|
|
499
|
+
const _t = $e.litElementPolyfillSupport;
|
|
500
|
+
_t?.({ LitElement: T });
|
|
501
|
+
($e.litElementVersions ??= []).push("4.2.2");
|
|
502
|
+
class wt extends T {
|
|
503
503
|
constructor() {
|
|
504
504
|
super(...arguments), this.object = {
|
|
505
505
|
"@id": ""
|
|
506
|
-
}, this.isType = (
|
|
507
|
-
const
|
|
508
|
-
return Array.isArray(
|
|
506
|
+
}, this.isType = (e, s = this.object) => {
|
|
507
|
+
const r = s["@type"];
|
|
508
|
+
return Array.isArray(r) ? r.includes(e) : typeof r == "string" ? r === e : !1;
|
|
509
509
|
};
|
|
510
510
|
}
|
|
511
511
|
}
|
|
512
|
-
const
|
|
512
|
+
const re = (t) => (e, s) => {
|
|
513
513
|
s !== void 0 ? s.addInitializer(() => {
|
|
514
|
-
customElements.define(
|
|
515
|
-
}) : customElements.define(
|
|
514
|
+
customElements.define(t, e);
|
|
515
|
+
}) : customElements.define(t, e);
|
|
516
516
|
};
|
|
517
|
-
const
|
|
518
|
-
const { kind:
|
|
519
|
-
let o = globalThis.litPropertyMetadata.get(
|
|
520
|
-
if (o === void 0 && globalThis.litPropertyMetadata.set(
|
|
517
|
+
const xt = { attribute: !0, type: String, converter: G, reflect: !1, hasChanged: se }, At = (t = xt, e, s) => {
|
|
518
|
+
const { kind: r, metadata: i } = s;
|
|
519
|
+
let o = globalThis.litPropertyMetadata.get(i);
|
|
520
|
+
if (o === void 0 && globalThis.litPropertyMetadata.set(i, o = /* @__PURE__ */ new Map()), r === "setter" && ((t = Object.create(t)).wrapped = !0), o.set(s.name, t), r === "accessor") {
|
|
521
521
|
const { name: n } = s;
|
|
522
522
|
return { set(a) {
|
|
523
|
-
const l =
|
|
524
|
-
|
|
523
|
+
const l = e.get.call(this);
|
|
524
|
+
e.set.call(this, a), this.requestUpdate(n, l, t, !0, a);
|
|
525
525
|
}, init(a) {
|
|
526
|
-
return a !== void 0 && this.C(n, void 0,
|
|
526
|
+
return a !== void 0 && this.C(n, void 0, t, a), a;
|
|
527
527
|
} };
|
|
528
528
|
}
|
|
529
|
-
if (
|
|
529
|
+
if (r === "setter") {
|
|
530
530
|
const { name: n } = s;
|
|
531
531
|
return function(a) {
|
|
532
532
|
const l = this[n];
|
|
533
|
-
|
|
533
|
+
e.call(this, a), this.requestUpdate(n, l, t, !0, a);
|
|
534
534
|
};
|
|
535
535
|
}
|
|
536
|
-
throw Error("Unsupported decorator location: " +
|
|
536
|
+
throw Error("Unsupported decorator location: " + r);
|
|
537
537
|
};
|
|
538
|
-
function
|
|
539
|
-
return (
|
|
540
|
-
const n =
|
|
541
|
-
return
|
|
542
|
-
})(
|
|
538
|
+
function m(t) {
|
|
539
|
+
return (e, s) => typeof s == "object" ? At(t, e, s) : ((r, i, o) => {
|
|
540
|
+
const n = i.hasOwnProperty(o);
|
|
541
|
+
return i.constructor.createProperty(o, r), n ? Object.getOwnPropertyDescriptor(i, o) : void 0;
|
|
542
|
+
})(t, e, s);
|
|
543
543
|
}
|
|
544
|
-
function
|
|
545
|
-
return
|
|
544
|
+
function g(t) {
|
|
545
|
+
return m({ ...t, state: !0, attribute: !1 });
|
|
546
546
|
}
|
|
547
|
-
var
|
|
548
|
-
for (var
|
|
549
|
-
(n =
|
|
550
|
-
return
|
|
547
|
+
var St = Object.defineProperty, Ct = (t, e, s, r) => {
|
|
548
|
+
for (var i = void 0, o = t.length - 1, n; o >= 0; o--)
|
|
549
|
+
(n = t[o]) && (i = n(e, s, i) || i);
|
|
550
|
+
return i && St(e, s, i), i;
|
|
551
551
|
};
|
|
552
|
-
class
|
|
552
|
+
class be extends T {
|
|
553
553
|
constructor() {
|
|
554
|
-
super(...arguments), this.objects = [], this.hasType = (
|
|
554
|
+
super(...arguments), this.objects = [], this.hasType = (e, s = this.objects) => new Set(s.flatMap((i) => i["@type"])).has(e);
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
],
|
|
560
|
-
var
|
|
561
|
-
for (var
|
|
562
|
-
(n =
|
|
563
|
-
return
|
|
557
|
+
Ct([
|
|
558
|
+
m({ attribute: !1 })
|
|
559
|
+
], be.prototype, "objects");
|
|
560
|
+
var Et = Object.defineProperty, x = (t, e, s, r) => {
|
|
561
|
+
for (var i = void 0, o = t.length - 1, n; o >= 0; o--)
|
|
562
|
+
(n = t[o]) && (i = n(e, s, i) || i);
|
|
563
|
+
return i && Et(e, s, i), i;
|
|
564
564
|
};
|
|
565
|
-
class
|
|
565
|
+
class v extends be {
|
|
566
566
|
constructor({
|
|
567
|
-
defaultRoute:
|
|
567
|
+
defaultRoute: e = !1,
|
|
568
568
|
setupSubscriptions: s = !0,
|
|
569
|
-
ignoreRouter:
|
|
569
|
+
ignoreRouter: r = !1
|
|
570
570
|
} = {}) {
|
|
571
571
|
super(), this.cherryPickedProperties = [], this.currentRoute = "";
|
|
572
|
-
const
|
|
573
|
-
document.readyState === "complete" && this._attach(
|
|
572
|
+
const i = () => {
|
|
573
|
+
document.readyState === "complete" && this._attach(e, s, r).then(
|
|
574
574
|
(o) => {
|
|
575
575
|
o && this.requestUpdate();
|
|
576
576
|
}
|
|
577
577
|
);
|
|
578
578
|
};
|
|
579
|
-
document.readyState === "complete" ?
|
|
579
|
+
document.readyState === "complete" ? i() : document.addEventListener("readystatechange", i);
|
|
580
580
|
}
|
|
581
|
-
async _attach(
|
|
582
|
-
return !this.orbit && window.orbit && (this.orbit = window.orbit, s) ? (
|
|
581
|
+
async _attach(e, s, r) {
|
|
582
|
+
return !this.orbit && window.orbit && (this.orbit = window.orbit, s) ? (jt({
|
|
583
583
|
component: this,
|
|
584
|
-
defaultRoute:
|
|
585
|
-
ignoreRouter:
|
|
586
|
-
}), this.route && (this.component = this.orbit.getComponentFromRoute(this.route), this.component && this.orbit.components.map((
|
|
584
|
+
defaultRoute: e,
|
|
585
|
+
ignoreRouter: r
|
|
586
|
+
}), this.route && (this.component = this.orbit.getComponentFromRoute(this.route), this.component && this.orbit.components.map((i) => (i.uniq === this.component.uniq && (i.instance = this), i))), await this._afterAttach(), Promise.resolve(!0)) : Promise.resolve(!1);
|
|
587
587
|
}
|
|
588
588
|
async _afterAttach() {
|
|
589
589
|
return Promise.resolve();
|
|
590
590
|
}
|
|
591
|
-
_navigate(
|
|
591
|
+
_navigate(e) {
|
|
592
592
|
window.sibRouter.previousRoute = this.currentRoute, window.sibRouter.previousResource = window.sibRouter.currentResource;
|
|
593
|
-
const s =
|
|
594
|
-
let
|
|
595
|
-
const
|
|
593
|
+
const s = e.target?.closest("[navigation-target]");
|
|
594
|
+
let r = s.getAttribute("navigation-target");
|
|
595
|
+
const i = s.getAttribute("navigation-subrouter"), o = s.getAttribute("navigation-resource"), n = s.getAttribute("navigation-rdf-type");
|
|
596
596
|
if (n) {
|
|
597
597
|
const a = window.orbit?.components?.filter(
|
|
598
598
|
(l) => l?.routeAttributes?.["rdf-type"] === n
|
|
599
599
|
);
|
|
600
|
-
a && (
|
|
600
|
+
a && (r = a[0]?.uniq);
|
|
601
601
|
}
|
|
602
|
-
|
|
603
|
-
(window.orbit ? window.orbit.getRoute(
|
|
602
|
+
r && O(
|
|
603
|
+
(window.orbit ? window.orbit.getRoute(r, !0) : r) + (i ? `-${i}` : ""),
|
|
604
604
|
o
|
|
605
|
-
),
|
|
605
|
+
), e.preventDefault();
|
|
606
606
|
}
|
|
607
|
-
_normalizeLdpContains(
|
|
608
|
-
return !Array.isArray(
|
|
607
|
+
_normalizeLdpContains(e) {
|
|
608
|
+
return !Array.isArray(e) && e !== null ? [e] : e;
|
|
609
609
|
}
|
|
610
|
-
async _expandContainer(
|
|
611
|
-
const
|
|
612
|
-
for (const o of
|
|
610
|
+
async _expandContainer(e, s = !0, r = this.cherryPickedProperties) {
|
|
611
|
+
const i = [];
|
|
612
|
+
for (const o of e) {
|
|
613
613
|
const n = await this._getProxyValue(
|
|
614
614
|
await o,
|
|
615
615
|
s,
|
|
616
|
-
|
|
616
|
+
r
|
|
617
617
|
);
|
|
618
|
-
n &&
|
|
618
|
+
n && i.push(n);
|
|
619
619
|
}
|
|
620
|
-
return
|
|
620
|
+
return i;
|
|
621
621
|
}
|
|
622
|
-
async _getProperties(
|
|
623
|
-
const
|
|
624
|
-
"@id":
|
|
625
|
-
"@type":
|
|
626
|
-
"@context":
|
|
627
|
-
_originalResource:
|
|
622
|
+
async _getProperties(e, s = !0, r = this.cherryPickedProperties) {
|
|
623
|
+
const i = await e.properties, o = {
|
|
624
|
+
"@id": e["@id"],
|
|
625
|
+
"@type": e["@type"],
|
|
626
|
+
"@context": e.serverContext,
|
|
627
|
+
_originalResource: e
|
|
628
628
|
};
|
|
629
|
-
for (const n of
|
|
630
|
-
|
|
629
|
+
for (const n of r)
|
|
630
|
+
i?.includes(n.key) && (o[n.value] = await e.get(n.key), n.expand && (o[n.value] = await this._getProxyValue(
|
|
631
631
|
o[n.value],
|
|
632
632
|
s,
|
|
633
|
-
|
|
633
|
+
r
|
|
634
634
|
)), n.cast && (o[n.value] = await n.cast(o[n.value])));
|
|
635
635
|
return await this._responseAdaptator(o);
|
|
636
636
|
}
|
|
637
|
-
async _hasCherryPickedProperties(
|
|
638
|
-
const s = await
|
|
639
|
-
for (const
|
|
640
|
-
if (s?.includes(
|
|
637
|
+
async _hasCherryPickedProperties(e) {
|
|
638
|
+
const s = await e.properties;
|
|
639
|
+
for (const r of this.cherryPickedProperties)
|
|
640
|
+
if (s?.includes(r.key))
|
|
641
641
|
return !0;
|
|
642
642
|
return !1;
|
|
643
643
|
}
|
|
644
|
-
async _getProxyValue(
|
|
644
|
+
async _getProxyValue(e, s = !0, r = this.cherryPickedProperties) {
|
|
645
645
|
try {
|
|
646
|
-
if (
|
|
647
|
-
let
|
|
648
|
-
if (typeof
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
))), typeof
|
|
652
|
-
if (typeof
|
|
653
|
-
if (
|
|
654
|
-
if (await this._hasCherryPickedProperties(
|
|
646
|
+
if (e) {
|
|
647
|
+
let i = e;
|
|
648
|
+
if (typeof e == "string" && (i = await window.sibStore.getData(e, Me)), typeof e != "string" && e.isFullResource && (e.isFullResource?.() || (i = await window.sibStore.getData(
|
|
649
|
+
e["@id"],
|
|
650
|
+
Me
|
|
651
|
+
))), typeof e != "string" && !e.isFullResource && (i.properties = Object.keys(i), i.get = (o) => i[o]), !i) return { _originalResource: i };
|
|
652
|
+
if (typeof i == "object" && i !== null) {
|
|
653
|
+
if (i.isContainer?.() && i["ldp:contains"]) {
|
|
654
|
+
if (await this._hasCherryPickedProperties(i))
|
|
655
655
|
return await this._getProperties(
|
|
656
|
-
|
|
656
|
+
i,
|
|
657
657
|
s,
|
|
658
|
-
|
|
658
|
+
r
|
|
659
659
|
);
|
|
660
660
|
const o = this._normalizeLdpContains(
|
|
661
|
-
await
|
|
661
|
+
await i["ldp:contains"]
|
|
662
662
|
);
|
|
663
663
|
return await this._expandContainer(
|
|
664
664
|
o,
|
|
665
665
|
s,
|
|
666
|
-
|
|
666
|
+
r
|
|
667
667
|
);
|
|
668
668
|
}
|
|
669
|
-
return await this._getProperties(
|
|
669
|
+
return await this._getProperties(i, s, r);
|
|
670
670
|
}
|
|
671
671
|
}
|
|
672
672
|
return;
|
|
673
673
|
} catch {
|
|
674
674
|
}
|
|
675
675
|
}
|
|
676
|
-
async _responseAdaptator(
|
|
677
|
-
return Promise.resolve(
|
|
676
|
+
async _responseAdaptator(e) {
|
|
677
|
+
return Promise.resolve(e);
|
|
678
678
|
}
|
|
679
679
|
gatekeeper() {
|
|
680
680
|
if (!this.orbit || !this.noRouter && this.route && this.currentRoute && !this.route.startsWith(this.currentRoute) || !this.dataSrc)
|
|
681
681
|
return c;
|
|
682
682
|
}
|
|
683
683
|
}
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
],
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
],
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
],
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
],
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
],
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
],
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
],
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
],
|
|
708
|
-
function
|
|
684
|
+
x([
|
|
685
|
+
m({ attribute: "default-data-src", reflect: !0 })
|
|
686
|
+
], v.prototype, "defaultDataSrc");
|
|
687
|
+
x([
|
|
688
|
+
m({ attribute: "data-src", reflect: !0 })
|
|
689
|
+
], v.prototype, "dataSrc");
|
|
690
|
+
x([
|
|
691
|
+
m({ attribute: "nested-field" })
|
|
692
|
+
], v.prototype, "nestedField");
|
|
693
|
+
x([
|
|
694
|
+
m({ attribute: "uniq" })
|
|
695
|
+
], v.prototype, "uniq");
|
|
696
|
+
x([
|
|
697
|
+
m({ attribute: "route" })
|
|
698
|
+
], v.prototype, "route");
|
|
699
|
+
x([
|
|
700
|
+
m({ attribute: !1 })
|
|
701
|
+
], v.prototype, "cherryPickedProperties");
|
|
702
|
+
x([
|
|
703
|
+
g()
|
|
704
|
+
], v.prototype, "orbit");
|
|
705
|
+
x([
|
|
706
|
+
g()
|
|
707
|
+
], v.prototype, "currentRoute");
|
|
708
|
+
function Pt() {
|
|
709
709
|
return Math.random().toString(16).slice(2);
|
|
710
710
|
}
|
|
711
|
-
const
|
|
712
|
-
component:
|
|
713
|
-
defaultRoute:
|
|
711
|
+
const jt = ({
|
|
712
|
+
component: t,
|
|
713
|
+
defaultRoute: e = !1,
|
|
714
714
|
ignoreRouter: s = !1
|
|
715
715
|
}) => {
|
|
716
|
-
if (
|
|
717
|
-
|
|
718
|
-
let
|
|
719
|
-
for (;
|
|
720
|
-
|
|
721
|
-
`[data-view="${
|
|
716
|
+
if (t.uniq || (t.uniq = Pt(), e && !t.route && !s && (t.route = e)), t._subscriptions = /* @__PURE__ */ new Set(), !s) {
|
|
717
|
+
t.route || (t.route = t.uniq, window.orbit && (t.route = window.orbit.getRoute(t.uniq))), t.noRouter = !0;
|
|
718
|
+
let r = document.querySelector("solid-router");
|
|
719
|
+
for (; r; )
|
|
720
|
+
t.noRouter = !1, t.currentRoute = r.currentRouteName, t.currentResource = window.sibRouter.currentResource, r = document.querySelector(
|
|
721
|
+
`[data-view="${r.currentRouteName}"] solid-router`
|
|
722
722
|
);
|
|
723
|
-
|
|
724
|
-
let
|
|
725
|
-
for (;
|
|
726
|
-
|
|
727
|
-
`[data-view="${
|
|
723
|
+
t.navigationListener = () => {
|
|
724
|
+
let i = document.querySelector("solid-router");
|
|
725
|
+
for (; i; )
|
|
726
|
+
t.noRouter = !1, t.currentRoute = i.currentRouteName, t.currentResource = window.sibRouter.currentResource, i = document.querySelector(
|
|
727
|
+
`[data-view="${i.currentRouteName}"] solid-router`
|
|
728
728
|
);
|
|
729
|
-
|
|
730
|
-
},
|
|
731
|
-
}
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
for (const
|
|
735
|
-
document.addEventListener(
|
|
736
|
-
},
|
|
737
|
-
for (const
|
|
738
|
-
document.removeEventListener(
|
|
739
|
-
},
|
|
729
|
+
t.requestUpdate();
|
|
730
|
+
}, t._subscriptions.add(["navigate", t.navigationListener]);
|
|
731
|
+
}
|
|
732
|
+
t._subscribe = () => {
|
|
733
|
+
t._unsubscribe();
|
|
734
|
+
for (const r of t._subscriptions)
|
|
735
|
+
document.addEventListener(r[0], r[1]);
|
|
736
|
+
}, t._unsubscribe = () => {
|
|
737
|
+
for (const r of t._subscriptions)
|
|
738
|
+
document.removeEventListener(r[0], r[1]);
|
|
739
|
+
}, t._subscribe();
|
|
740
740
|
};
|
|
741
|
-
function
|
|
742
|
-
return !Number.isNaN(new Date(
|
|
741
|
+
function ke(t) {
|
|
742
|
+
return !Number.isNaN(new Date(t).getTime());
|
|
743
743
|
}
|
|
744
|
-
const
|
|
745
|
-
if (
|
|
744
|
+
const le = (t, e, s) => {
|
|
745
|
+
if (t == null)
|
|
746
746
|
return !1;
|
|
747
|
-
const
|
|
748
|
-
let
|
|
749
|
-
for (const o of
|
|
750
|
-
if (
|
|
751
|
-
|
|
747
|
+
const r = e.split(".");
|
|
748
|
+
let i = t;
|
|
749
|
+
for (const o of r)
|
|
750
|
+
if (i && typeof i == "object" && o in i)
|
|
751
|
+
i = i[o];
|
|
752
752
|
else
|
|
753
753
|
return !1;
|
|
754
|
-
if (
|
|
755
|
-
if (new Date(
|
|
754
|
+
if (ke(i)) {
|
|
755
|
+
if (new Date(i) > s)
|
|
756
756
|
return !0;
|
|
757
757
|
} else
|
|
758
758
|
return !1;
|
|
759
|
-
return Array.isArray(
|
|
760
|
-
(o) =>
|
|
761
|
-
) : typeof
|
|
762
|
-
},
|
|
763
|
-
if (!
|
|
764
|
-
return
|
|
765
|
-
const
|
|
766
|
-
return Number.isNaN(
|
|
767
|
-
(
|
|
759
|
+
return Array.isArray(t) ? t.some(
|
|
760
|
+
(o) => le(o, e, s)
|
|
761
|
+
) : typeof t == "object" ? Object.entries(t).some(([o, n]) => o === e && ke(n) ? !1 : le(n, e, s)) : !1;
|
|
762
|
+
}, Rt = (t, e, s) => {
|
|
763
|
+
if (!e || !s || typeof s != "string")
|
|
764
|
+
return t;
|
|
765
|
+
const r = new Date(s);
|
|
766
|
+
return Number.isNaN(r.getTime()) ? (console.warn(`Invalid threshold date provided: ${s}`), t) : t.filter(
|
|
767
|
+
(i) => le(i, e, r)
|
|
768
768
|
);
|
|
769
|
-
},
|
|
770
|
-
let
|
|
771
|
-
const o =
|
|
769
|
+
}, Ot = (t, e, s) => !e || !s ? t : t.filter((r) => {
|
|
770
|
+
let i = r;
|
|
771
|
+
const o = e.split(".");
|
|
772
772
|
for (const a of o)
|
|
773
|
-
if (
|
|
774
|
-
|
|
773
|
+
if (i && typeof i == "object" && a in i)
|
|
774
|
+
i = i[a];
|
|
775
775
|
else
|
|
776
776
|
return !1;
|
|
777
|
-
const n =
|
|
777
|
+
const n = i;
|
|
778
778
|
return n ? typeof n == "object" && !Array.isArray(n) && n !== null && "@id" in n && n["@id"] === s ? !0 : Array.isArray(n) ? n.some(
|
|
779
779
|
(a) => typeof a == "object" && a !== null && "@id" in a && a["@id"] === s
|
|
780
780
|
) : !1 : !1;
|
|
781
781
|
});
|
|
782
|
-
function
|
|
783
|
-
return typeof
|
|
782
|
+
function Tt(t) {
|
|
783
|
+
return typeof t != "string" && typeof t != "number" && !(t instanceof Date) ? !1 : !Number.isNaN(new Date(t).getTime());
|
|
784
784
|
}
|
|
785
|
-
const
|
|
786
|
-
if (
|
|
785
|
+
const ce = (t, e, s, r) => {
|
|
786
|
+
if (t == null)
|
|
787
787
|
return !1;
|
|
788
|
-
const
|
|
789
|
-
let o =
|
|
790
|
-
for (const n of
|
|
788
|
+
const i = e.split(".");
|
|
789
|
+
let o = t;
|
|
790
|
+
for (const n of i)
|
|
791
791
|
if (o && typeof o == "object" && n in o)
|
|
792
792
|
o = o[n];
|
|
793
793
|
else
|
|
794
794
|
return !1;
|
|
795
795
|
if (typeof o == "number") {
|
|
796
|
-
if (typeof s == "number" && typeof
|
|
796
|
+
if (typeof s == "number" && typeof r == "number" && s <= o && o <= r)
|
|
797
797
|
return !0;
|
|
798
|
-
} else if (
|
|
798
|
+
} else if (Tt(o)) {
|
|
799
799
|
const n = new Date(o);
|
|
800
|
-
if (s instanceof Date &&
|
|
800
|
+
if (s instanceof Date && r instanceof Date && s <= n && n <= r)
|
|
801
801
|
return !0;
|
|
802
802
|
} else
|
|
803
803
|
return !1;
|
|
804
|
-
return Array.isArray(
|
|
805
|
-
(n) =>
|
|
806
|
-
) : typeof
|
|
807
|
-
([n, a]) =>
|
|
804
|
+
return Array.isArray(t) ? t.some(
|
|
805
|
+
(n) => ce(n, e, s, r)
|
|
806
|
+
) : typeof t == "object" ? Object.entries(t).some(
|
|
807
|
+
([n, a]) => ce(a, e, s, r)
|
|
808
808
|
) : !1;
|
|
809
|
-
},
|
|
810
|
-
if (!
|
|
811
|
-
return
|
|
812
|
-
const [
|
|
813
|
-
return Number.isNaN(
|
|
814
|
-
(o) =>
|
|
809
|
+
}, kt = (t, e, s) => {
|
|
810
|
+
if (!e || !s || typeof s != "string")
|
|
811
|
+
return t;
|
|
812
|
+
const [r, i] = s.split("/").map(Number);
|
|
813
|
+
return Number.isNaN(r) || Number.isNaN(i) ? t : r > i ? (console.warn(`Start number is after end number in interval: ${s}`), t) : t.filter(
|
|
814
|
+
(o) => ce(o, e, r, i)
|
|
815
815
|
);
|
|
816
|
-
},
|
|
817
|
-
if (
|
|
816
|
+
}, de = (t, e, s) => {
|
|
817
|
+
if (t == null)
|
|
818
818
|
return 0;
|
|
819
|
-
if (typeof
|
|
820
|
-
const
|
|
819
|
+
if (typeof t != "object") {
|
|
820
|
+
const i = String(t).toLowerCase(), o = e.replace(
|
|
821
821
|
/[.*+?^${}()|[\]\\]/g,
|
|
822
822
|
"\\$&"
|
|
823
823
|
), n = new RegExp(`\\b${o}\\b`);
|
|
824
824
|
let a = 0;
|
|
825
|
-
return n.test(
|
|
826
|
-
}
|
|
827
|
-
if (Array.isArray(
|
|
828
|
-
let
|
|
829
|
-
for (const o of
|
|
830
|
-
if (
|
|
831
|
-
|
|
832
|
-
|
|
825
|
+
return n.test(i) ? a = 2 : i.includes(e) && (a = 1), a;
|
|
826
|
+
}
|
|
827
|
+
if (Array.isArray(t)) {
|
|
828
|
+
let i = 0;
|
|
829
|
+
for (const o of t)
|
|
830
|
+
if (i = Math.max(
|
|
831
|
+
i,
|
|
832
|
+
de(
|
|
833
833
|
o,
|
|
834
|
-
|
|
834
|
+
e
|
|
835
835
|
)
|
|
836
|
-
),
|
|
837
|
-
return
|
|
836
|
+
), i === 2) break;
|
|
837
|
+
return i;
|
|
838
838
|
}
|
|
839
|
-
let
|
|
840
|
-
for (const
|
|
841
|
-
if (
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
839
|
+
let r = 0;
|
|
840
|
+
for (const i of Object.values(t))
|
|
841
|
+
if (r = Math.max(
|
|
842
|
+
r,
|
|
843
|
+
de(
|
|
844
|
+
i,
|
|
845
|
+
e
|
|
846
846
|
)
|
|
847
|
-
),
|
|
848
|
-
return
|
|
849
|
-
},
|
|
850
|
-
if (!
|
|
851
|
-
return
|
|
852
|
-
const
|
|
847
|
+
), r === 2) break;
|
|
848
|
+
return r;
|
|
849
|
+
}, Dt = (t, e, s) => {
|
|
850
|
+
if (!e || !s || s.trim() === "")
|
|
851
|
+
return t;
|
|
852
|
+
const r = s.toLowerCase(), o = t.map((n) => {
|
|
853
853
|
let a = n;
|
|
854
|
-
const l =
|
|
855
|
-
for (const
|
|
856
|
-
if (a && typeof a == "object" &&
|
|
857
|
-
a = a[
|
|
854
|
+
const l = e.split(".");
|
|
855
|
+
for (const f of l)
|
|
856
|
+
if (a && typeof a == "object" && f in a)
|
|
857
|
+
a = a[f];
|
|
858
858
|
else {
|
|
859
859
|
a = null;
|
|
860
860
|
break;
|
|
861
861
|
}
|
|
862
|
-
let
|
|
863
|
-
return a && (
|
|
862
|
+
let d = 0;
|
|
863
|
+
return a && (d = de(a, r)), { obj: n, score: d };
|
|
864
864
|
}).filter((n) => n.score > 0);
|
|
865
865
|
return o.sort((n, a) => a.score - n.score), o.map((n) => n.obj);
|
|
866
|
-
},
|
|
867
|
-
const
|
|
868
|
-
return
|
|
869
|
-
}) :
|
|
870
|
-
if (
|
|
866
|
+
}, Mt = (t, e) => e ? t.filter((s) => {
|
|
867
|
+
const r = s["@type"];
|
|
868
|
+
return r ? typeof r == "string" ? r === e : Array.isArray(r) ? r.some((i) => i === e) : !1 : !1;
|
|
869
|
+
}) : t, he = (t, e, s) => {
|
|
870
|
+
if (t == null)
|
|
871
871
|
return 0;
|
|
872
|
-
if (typeof
|
|
873
|
-
const
|
|
872
|
+
if (typeof t != "object") {
|
|
873
|
+
const i = String(t).toLowerCase(), o = e.replace(
|
|
874
874
|
/[.*+?^${}()|[\]\\]/g,
|
|
875
875
|
"\\$&"
|
|
876
876
|
), n = new RegExp(`\\b${o}\\b`);
|
|
877
877
|
let a = 0;
|
|
878
|
-
return n.test(
|
|
879
|
-
}
|
|
880
|
-
if (Array.isArray(
|
|
881
|
-
let
|
|
882
|
-
for (const o of
|
|
883
|
-
if (
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
),
|
|
887
|
-
return
|
|
878
|
+
return n.test(i) ? s === "name" || s === "title" ? a = 4 : a = 3 : i.includes(e) && (s === "name" || s === "title" ? a = 2 : a = 1), a;
|
|
879
|
+
}
|
|
880
|
+
if (Array.isArray(t)) {
|
|
881
|
+
let i = 0;
|
|
882
|
+
for (const o of t)
|
|
883
|
+
if (i = Math.max(
|
|
884
|
+
i,
|
|
885
|
+
he(o, e)
|
|
886
|
+
), i === 4) break;
|
|
887
|
+
return i;
|
|
888
888
|
}
|
|
889
|
-
let
|
|
890
|
-
for (const [
|
|
891
|
-
if (
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
),
|
|
895
|
-
return
|
|
896
|
-
},
|
|
897
|
-
if (!
|
|
898
|
-
return
|
|
899
|
-
const s =
|
|
889
|
+
let r = 0;
|
|
890
|
+
for (const [i, o] of Object.entries(t))
|
|
891
|
+
if (r = Math.max(
|
|
892
|
+
r,
|
|
893
|
+
he(o, e, i)
|
|
894
|
+
), r === 4) break;
|
|
895
|
+
return r;
|
|
896
|
+
}, We = (t, e) => {
|
|
897
|
+
if (!e || e.trim() === "")
|
|
898
|
+
return t;
|
|
899
|
+
const s = e.toLowerCase(), i = t.map((o) => ({
|
|
900
900
|
obj: o,
|
|
901
|
-
score:
|
|
901
|
+
score: he(o, s)
|
|
902
902
|
})).filter((o) => o.score > 0);
|
|
903
|
-
return
|
|
904
|
-
},
|
|
905
|
-
let s =
|
|
906
|
-
for (let
|
|
907
|
-
s = s[
|
|
903
|
+
return i.sort((o, n) => n.score - o.score), i.map((o) => o.obj);
|
|
904
|
+
}, De = (t, e) => {
|
|
905
|
+
let s = t;
|
|
906
|
+
for (let r = 0; r < e.length && (s && e[r] in s); r++)
|
|
907
|
+
s = s[e[r]];
|
|
908
908
|
return s;
|
|
909
|
-
},
|
|
910
|
-
let o =
|
|
911
|
-
Array.isArray(
|
|
909
|
+
}, N = (t, e, s = "asc") => t.sort((r, i) => {
|
|
910
|
+
let o = r, n = i;
|
|
911
|
+
Array.isArray(e) ? (o = De(r, e), n = De(i, e)) : (o = r[e], n = i[e]);
|
|
912
912
|
let a = 0;
|
|
913
913
|
if (typeof o == "number" && typeof n == "number")
|
|
914
914
|
a = o - n;
|
|
@@ -917,170 +917,179 @@ const rt = (e, t, s, i) => {
|
|
|
917
917
|
else if (o instanceof Date && n instanceof Date)
|
|
918
918
|
a = o.getTime() - n.getTime();
|
|
919
919
|
else
|
|
920
|
-
throw new TypeError(`Unsupported data type for key "${
|
|
920
|
+
throw new TypeError(`Unsupported data type for key "${e}"`);
|
|
921
921
|
return s === "asc" ? a : -a;
|
|
922
|
-
}),
|
|
922
|
+
}), U = (t, e = {
|
|
923
923
|
day: "2-digit",
|
|
924
924
|
month: "2-digit",
|
|
925
925
|
year: "2-digit"
|
|
926
926
|
}) => {
|
|
927
|
-
if (!
|
|
928
|
-
const
|
|
929
|
-
return typeof
|
|
930
|
-
},
|
|
927
|
+
if (!t) return "";
|
|
928
|
+
const r = (typeof t == "string" ? new Date(t) : t).toLocaleString(void 0, e);
|
|
929
|
+
return typeof t == "string" && r === "Invalid Date" ? t : r;
|
|
930
|
+
}, O = (t, e = !1) => {
|
|
931
931
|
window.dispatchEvent(
|
|
932
932
|
new CustomEvent("requestNavigation", {
|
|
933
933
|
detail: {
|
|
934
|
-
route:
|
|
935
|
-
resource: typeof
|
|
934
|
+
route: t,
|
|
935
|
+
resource: typeof e == "string" ? { "@id": e } : e
|
|
936
936
|
}
|
|
937
937
|
})
|
|
938
938
|
);
|
|
939
|
-
},
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
939
|
+
}, Lt = "https://cdn.startinblox.com/owl/ds4go.jsonld#", Nt = { "@id": "ds4go:link", "@type": "@id" }, Ut = { "@id": "ds4go:enclosure", "@type": "@id" }, Ft = { "@id": "ds4go:url", "@type": "@id" }, Me = {
|
|
940
|
+
ds4go: Lt,
|
|
941
|
+
link: Nt,
|
|
942
|
+
enclosure: Ut,
|
|
943
|
+
url: Ft
|
|
944
|
+
};
|
|
945
|
+
const ue = "lit-localize-status";
|
|
946
|
+
const Bt = (t, ...e) => ({
|
|
947
|
+
strTag: !0,
|
|
948
|
+
strings: t,
|
|
949
|
+
values: e
|
|
950
|
+
}), J = Bt, Ht = (t) => typeof t != "string" && "strTag" in t, Ke = (t, e, s) => {
|
|
951
|
+
let r = t[0];
|
|
952
|
+
for (let i = 1; i < t.length; i++)
|
|
953
|
+
r += e[s ? s[i - 1] : i - 1], r += t[i];
|
|
954
|
+
return r;
|
|
946
955
|
};
|
|
947
|
-
const
|
|
948
|
-
let
|
|
949
|
-
function
|
|
950
|
-
if (
|
|
956
|
+
const Ge = ((t) => Ht(t) ? Ke(t.strings, t.values) : t);
|
|
957
|
+
let u = Ge, Le = !1;
|
|
958
|
+
function qt(t) {
|
|
959
|
+
if (Le)
|
|
951
960
|
throw new Error("lit-localize can only be configured once");
|
|
952
|
-
|
|
961
|
+
u = t, Le = !0;
|
|
953
962
|
}
|
|
954
|
-
class
|
|
955
|
-
constructor(
|
|
963
|
+
class zt {
|
|
964
|
+
constructor(e) {
|
|
956
965
|
this.__litLocalizeEventHandler = (s) => {
|
|
957
966
|
s.detail.status === "ready" && this.host.requestUpdate();
|
|
958
|
-
}, this.host =
|
|
967
|
+
}, this.host = e;
|
|
959
968
|
}
|
|
960
969
|
hostConnected() {
|
|
961
|
-
window.addEventListener(
|
|
970
|
+
window.addEventListener(ue, this.__litLocalizeEventHandler);
|
|
962
971
|
}
|
|
963
972
|
hostDisconnected() {
|
|
964
|
-
window.removeEventListener(
|
|
973
|
+
window.removeEventListener(ue, this.__litLocalizeEventHandler);
|
|
965
974
|
}
|
|
966
975
|
}
|
|
967
|
-
const
|
|
968
|
-
const
|
|
969
|
-
class
|
|
976
|
+
const It = (t) => t.addController(new zt(t)), Vt = It;
|
|
977
|
+
const Wt = () => (t, e) => (t.addInitializer(Vt), t);
|
|
978
|
+
class Ze {
|
|
970
979
|
constructor() {
|
|
971
|
-
this.settled = !1, this.promise = new Promise((
|
|
972
|
-
this._resolve =
|
|
980
|
+
this.settled = !1, this.promise = new Promise((e, s) => {
|
|
981
|
+
this._resolve = e, this._reject = s;
|
|
973
982
|
});
|
|
974
983
|
}
|
|
975
|
-
resolve(
|
|
976
|
-
this.settled = !0, this._resolve(
|
|
984
|
+
resolve(e) {
|
|
985
|
+
this.settled = !0, this._resolve(e);
|
|
977
986
|
}
|
|
978
|
-
reject(
|
|
979
|
-
this.settled = !0, this._reject(
|
|
987
|
+
reject(e) {
|
|
988
|
+
this.settled = !0, this._reject(e);
|
|
980
989
|
}
|
|
981
990
|
}
|
|
982
|
-
const
|
|
983
|
-
for (let
|
|
984
|
-
|
|
985
|
-
function
|
|
986
|
-
let
|
|
987
|
-
for (let
|
|
988
|
-
s ^=
|
|
989
|
-
return
|
|
991
|
+
const b = [];
|
|
992
|
+
for (let t = 0; t < 256; t++)
|
|
993
|
+
b[t] = (t >> 4 & 15).toString(16) + (t & 15).toString(16);
|
|
994
|
+
function Kt(t) {
|
|
995
|
+
let e = 0, s = 8997, r = 0, i = 33826, o = 0, n = 40164, a = 0, l = 52210;
|
|
996
|
+
for (let d = 0; d < t.length; d++)
|
|
997
|
+
s ^= t.charCodeAt(d), e = s * 435, r = i * 435, o = n * 435, a = l * 435, o += s << 8, a += i << 8, r += e >>> 16, s = e & 65535, o += r >>> 16, i = r & 65535, l = a + (o >>> 16) & 65535, n = o & 65535;
|
|
998
|
+
return b[l >> 8] + b[l & 255] + b[n >> 8] + b[n & 255] + b[i >> 8] + b[i & 255] + b[s >> 8] + b[s & 255];
|
|
990
999
|
}
|
|
991
|
-
const
|
|
992
|
-
function
|
|
993
|
-
return (
|
|
1000
|
+
const Gt = "", Zt = "h", Jt = "s";
|
|
1001
|
+
function Xt(t, e) {
|
|
1002
|
+
return (e ? Zt : Jt) + Kt(typeof t == "string" ? t : t.join(Gt));
|
|
994
1003
|
}
|
|
995
|
-
const
|
|
996
|
-
function
|
|
997
|
-
if (
|
|
998
|
-
const
|
|
999
|
-
if (
|
|
1000
|
-
if (typeof
|
|
1001
|
-
return
|
|
1002
|
-
if ("strTag" in
|
|
1003
|
-
return
|
|
1004
|
-
|
|
1004
|
+
const Ne = /* @__PURE__ */ new WeakMap(), Ue = /* @__PURE__ */ new Map();
|
|
1005
|
+
function Qt(t, e, s) {
|
|
1006
|
+
if (t) {
|
|
1007
|
+
const r = s?.id ?? Yt(e), i = t[r];
|
|
1008
|
+
if (i) {
|
|
1009
|
+
if (typeof i == "string")
|
|
1010
|
+
return i;
|
|
1011
|
+
if ("strTag" in i)
|
|
1012
|
+
return Ke(
|
|
1013
|
+
i.strings,
|
|
1005
1014
|
// Cast `template` because its type wasn't automatically narrowed (but
|
|
1006
1015
|
// we know it must be the same type as `localized`).
|
|
1007
|
-
|
|
1008
|
-
|
|
1016
|
+
e.values,
|
|
1017
|
+
i.values
|
|
1009
1018
|
);
|
|
1010
1019
|
{
|
|
1011
|
-
let o =
|
|
1012
|
-
return o === void 0 && (o =
|
|
1013
|
-
...
|
|
1014
|
-
values: o.map((n) =>
|
|
1020
|
+
let o = Ne.get(i);
|
|
1021
|
+
return o === void 0 && (o = i.values, Ne.set(i, o)), {
|
|
1022
|
+
...i,
|
|
1023
|
+
values: o.map((n) => e.values[n])
|
|
1015
1024
|
};
|
|
1016
1025
|
}
|
|
1017
1026
|
}
|
|
1018
1027
|
}
|
|
1019
|
-
return
|
|
1028
|
+
return Ge(e);
|
|
1020
1029
|
}
|
|
1021
|
-
function
|
|
1022
|
-
const
|
|
1023
|
-
let s =
|
|
1024
|
-
return s === void 0 && (s =
|
|
1030
|
+
function Yt(t) {
|
|
1031
|
+
const e = typeof t == "string" ? t : t.strings;
|
|
1032
|
+
let s = Ue.get(e);
|
|
1033
|
+
return s === void 0 && (s = Xt(e, typeof t != "string" && !("strTag" in t)), Ue.set(e, s)), s;
|
|
1025
1034
|
}
|
|
1026
|
-
function
|
|
1027
|
-
window.dispatchEvent(new CustomEvent(
|
|
1035
|
+
function ne(t) {
|
|
1036
|
+
window.dispatchEvent(new CustomEvent(ue, { detail: t }));
|
|
1028
1037
|
}
|
|
1029
|
-
let
|
|
1030
|
-
|
|
1031
|
-
let
|
|
1032
|
-
const
|
|
1033
|
-
if (
|
|
1034
|
-
return
|
|
1035
|
-
if (!
|
|
1038
|
+
let X = "", ae, Je, Q, fe, Xe, C = new Ze();
|
|
1039
|
+
C.resolve();
|
|
1040
|
+
let W = 0;
|
|
1041
|
+
const es = (t) => (qt(((e, s) => Qt(Xe, e, s))), X = Je = t.sourceLocale, Q = new Set(t.targetLocales), Q.add(t.sourceLocale), fe = t.loadLocale, { getLocale: ts, setLocale: ss }), ts = () => X, ss = (t) => {
|
|
1042
|
+
if (t === (ae ?? X))
|
|
1043
|
+
return C.promise;
|
|
1044
|
+
if (!Q || !fe)
|
|
1036
1045
|
throw new Error("Internal error");
|
|
1037
|
-
if (!
|
|
1046
|
+
if (!Q.has(t))
|
|
1038
1047
|
throw new Error("Invalid locale code");
|
|
1039
|
-
|
|
1040
|
-
const
|
|
1041
|
-
return
|
|
1048
|
+
W++;
|
|
1049
|
+
const e = W;
|
|
1050
|
+
return ae = t, C.settled && (C = new Ze()), ne({ status: "loading", loadingLocale: t }), (t === Je ? (
|
|
1042
1051
|
// We could switch to the source locale synchronously, but we prefer to
|
|
1043
1052
|
// queue it on a microtask so that switching locales is consistently
|
|
1044
1053
|
// asynchronous.
|
|
1045
1054
|
Promise.resolve({ templates: void 0 })
|
|
1046
|
-
) :
|
|
1047
|
-
|
|
1048
|
-
}, (
|
|
1049
|
-
|
|
1055
|
+
) : fe(t)).then((r) => {
|
|
1056
|
+
W === e && (X = t, ae = void 0, Xe = r.templates, ne({ status: "ready", readyLocale: t }), C.resolve());
|
|
1057
|
+
}, (r) => {
|
|
1058
|
+
W === e && (ne({
|
|
1050
1059
|
status: "error",
|
|
1051
|
-
errorLocale:
|
|
1052
|
-
errorMessage:
|
|
1053
|
-
}),
|
|
1054
|
-
}),
|
|
1060
|
+
errorLocale: t,
|
|
1061
|
+
errorMessage: r.toString()
|
|
1062
|
+
}), C.reject(r));
|
|
1063
|
+
}), C.promise;
|
|
1055
1064
|
};
|
|
1056
|
-
var
|
|
1057
|
-
for (var
|
|
1058
|
-
(n =
|
|
1059
|
-
return
|
|
1065
|
+
var is = Object.defineProperty, rs = Object.getOwnPropertyDescriptor, _e = (t, e, s, r) => {
|
|
1066
|
+
for (var i = r > 1 ? void 0 : r ? rs(e, s) : e, o = t.length - 1, n; o >= 0; o--)
|
|
1067
|
+
(n = t[o]) && (i = (r ? n(e, s, i) : n(i)) || i);
|
|
1068
|
+
return r && i && is(e, s, i), i;
|
|
1060
1069
|
};
|
|
1061
|
-
let
|
|
1070
|
+
let q = class extends be {
|
|
1062
1071
|
constructor() {
|
|
1063
1072
|
super(...arguments), this.search = [], this._displayObjects = [];
|
|
1064
1073
|
}
|
|
1065
|
-
filter(
|
|
1066
|
-
if (!
|
|
1067
|
-
return
|
|
1074
|
+
filter(t, e = []) {
|
|
1075
|
+
if (!e || e.length === 0 || !t || t.length === 0)
|
|
1076
|
+
return t;
|
|
1068
1077
|
const s = /* @__PURE__ */ new Map();
|
|
1069
|
-
for (const
|
|
1070
|
-
const o =
|
|
1071
|
-
n.push(
|
|
1078
|
+
for (const i of e) {
|
|
1079
|
+
const o = i.name, n = s.get(o) || [];
|
|
1080
|
+
n.push(i), s.set(o, n);
|
|
1072
1081
|
}
|
|
1073
|
-
let
|
|
1074
|
-
for (const
|
|
1075
|
-
if (
|
|
1082
|
+
let r = [...t];
|
|
1083
|
+
for (const i of s.values()) {
|
|
1084
|
+
if (r.length === 0)
|
|
1076
1085
|
break;
|
|
1077
1086
|
const o = [];
|
|
1078
|
-
for (const n of
|
|
1087
|
+
for (const n of i)
|
|
1079
1088
|
switch (n.type) {
|
|
1080
1089
|
case "interval":
|
|
1081
1090
|
o.push(
|
|
1082
|
-
|
|
1083
|
-
|
|
1091
|
+
kt(
|
|
1092
|
+
r,
|
|
1084
1093
|
n.name,
|
|
1085
1094
|
n.value
|
|
1086
1095
|
)
|
|
@@ -1088,8 +1097,8 @@ let N = class extends gt {
|
|
|
1088
1097
|
break;
|
|
1089
1098
|
case "dateAfter":
|
|
1090
1099
|
o.push(
|
|
1091
|
-
|
|
1092
|
-
|
|
1100
|
+
Rt(
|
|
1101
|
+
r,
|
|
1093
1102
|
n.name,
|
|
1094
1103
|
n.value
|
|
1095
1104
|
)
|
|
@@ -1097,8 +1106,8 @@ let N = class extends gt {
|
|
|
1097
1106
|
break;
|
|
1098
1107
|
case "matchId":
|
|
1099
1108
|
o.push(
|
|
1100
|
-
|
|
1101
|
-
|
|
1109
|
+
Ot(
|
|
1110
|
+
r,
|
|
1102
1111
|
n.name,
|
|
1103
1112
|
n.value
|
|
1104
1113
|
)
|
|
@@ -1106,13 +1115,13 @@ let N = class extends gt {
|
|
|
1106
1115
|
break;
|
|
1107
1116
|
case "matchType":
|
|
1108
1117
|
o.push(
|
|
1109
|
-
|
|
1118
|
+
Mt(r, n.value)
|
|
1110
1119
|
);
|
|
1111
1120
|
break;
|
|
1112
1121
|
case "exact":
|
|
1113
1122
|
o.push(
|
|
1114
|
-
|
|
1115
|
-
|
|
1123
|
+
Dt(
|
|
1124
|
+
r,
|
|
1116
1125
|
n.name,
|
|
1117
1126
|
n.value
|
|
1118
1127
|
)
|
|
@@ -1120,46 +1129,46 @@ let N = class extends gt {
|
|
|
1120
1129
|
break;
|
|
1121
1130
|
default:
|
|
1122
1131
|
o.push(
|
|
1123
|
-
|
|
1132
|
+
We(r, n.value)
|
|
1124
1133
|
);
|
|
1125
1134
|
}
|
|
1126
|
-
|
|
1135
|
+
r = [...o.flat()];
|
|
1127
1136
|
}
|
|
1128
|
-
return
|
|
1137
|
+
return r;
|
|
1129
1138
|
}
|
|
1130
|
-
_handleClickEvent(
|
|
1131
|
-
this.dispatchEvent(new CustomEvent("clicked", { detail:
|
|
1139
|
+
_handleClickEvent(t) {
|
|
1140
|
+
this.dispatchEvent(new CustomEvent("clicked", { detail: t }));
|
|
1132
1141
|
}
|
|
1133
|
-
willUpdate(
|
|
1134
|
-
(
|
|
1142
|
+
willUpdate(t) {
|
|
1143
|
+
(t.has("objects") || t.has("search")) && (this.objects ? this._displayObjects = this.filter(this.objects, this.search) : this._displayObjects = [], this.dispatchEvent(
|
|
1135
1144
|
new CustomEvent("result-count", {
|
|
1136
1145
|
detail: this._displayObjects.length
|
|
1137
1146
|
})
|
|
1138
1147
|
));
|
|
1139
1148
|
}
|
|
1140
1149
|
render() {
|
|
1141
|
-
return !this._displayObjects || this._displayObjects.length === 0 ? c :
|
|
1142
|
-
${this._displayObjects.map((
|
|
1143
|
-
const
|
|
1150
|
+
return !this._displayObjects || this._displayObjects.length === 0 ? c : p`<div class="card-grid card-grid-vertical">
|
|
1151
|
+
${this._displayObjects.map((t) => {
|
|
1152
|
+
const e = [
|
|
1144
1153
|
{
|
|
1145
|
-
name: `${
|
|
1154
|
+
name: `${t.facts.length} ${t.facts.length > 1 ? u("facts") : u("fact")}`,
|
|
1146
1155
|
type: "information"
|
|
1147
1156
|
}
|
|
1148
1157
|
];
|
|
1149
|
-
return
|
|
1158
|
+
return p`<tems-card-catalog
|
|
1150
1159
|
.object=${c}
|
|
1151
1160
|
type=${"bill-image"}
|
|
1152
|
-
.tags=${
|
|
1153
|
-
.header=${
|
|
1154
|
-
.content=${
|
|
1155
|
-
date=${
|
|
1156
|
-
@click=${() => this._handleClickEvent(
|
|
1161
|
+
.tags=${e}
|
|
1162
|
+
.header=${t.name || c}
|
|
1163
|
+
.content=${t.description || c}
|
|
1164
|
+
date=${t.updated_at || c}
|
|
1165
|
+
@click=${() => this._handleClickEvent(t)}
|
|
1157
1166
|
></tems-card-catalog>`;
|
|
1158
1167
|
})}
|
|
1159
1168
|
</div>`;
|
|
1160
1169
|
}
|
|
1161
1170
|
};
|
|
1162
|
-
|
|
1171
|
+
q.styles = ee`
|
|
1163
1172
|
.card-grid {
|
|
1164
1173
|
display: flex;
|
|
1165
1174
|
flex-direction: row;
|
|
@@ -1177,22 +1186,22 @@ N.styles = ut`
|
|
|
1177
1186
|
cursor: pointer;
|
|
1178
1187
|
}
|
|
1179
1188
|
`;
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
],
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
],
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
],
|
|
1189
|
-
const
|
|
1190
|
-
var
|
|
1191
|
-
for (var
|
|
1192
|
-
(n =
|
|
1193
|
-
return
|
|
1189
|
+
_e([
|
|
1190
|
+
g()
|
|
1191
|
+
], q.prototype, "search", 2);
|
|
1192
|
+
_e([
|
|
1193
|
+
g()
|
|
1194
|
+
], q.prototype, "_displayObjects", 2);
|
|
1195
|
+
q = _e([
|
|
1196
|
+
re("ds4go-fact-bundle-holder")
|
|
1197
|
+
], q);
|
|
1198
|
+
const os = ".flex{display:flex}.flex.flex-row{flex-direction:row}.flex.flex-column{flex-direction:column}.flex.wrap{flex-wrap:wrap}.flex.flex-1{flex:1}.flex .half,.flex.half{flex-basis:50%}.flex.justify-content-center{justify-content:center}.flex.justify-content-space-between{justify-content:space-between}.flex.align-items-center{align-items:center}.flex.align-items-flex-start{align-items:flex-start}.flex .align-items-flex-end{align-items:flex-end}.full-width{width:100%}.modal{background-color:var(--color-surface-primary);border:var(--border-width-sm) solid var(--color-border-primary);border-radius:var(--border-radius-lg);color:var(--color-text-body);display:flex;flex-direction:column;font-family:var(--font-family-body);font-size:var(--typography-size-body-md);font-style:normal;font-weight:var(--font-weight-regular);gap:var(--scale-600);height:90vh;letter-spacing:var(--font-letter-spacing-default);line-height:var(--line-height-body-md);padding:var(--scale-600) var(--scale-900);width:90vw}.modal .topbar{display:flex;flex-direction:row;gap:var(--scale-400);width:100%}.modal .topbar tems-button:nth-child(2){margin-left:auto}.modal .modal-content-wrapper{display:flex;flex:1;flex-direction:column;overflow:hidden}.modal .modal-content-wrapper .modal-box{display:flex;flex:1;overflow-x:hidden;overflow-y:scroll}.modal .modal-content-wrapper .modal-content{display:flex;flex-direction:column;gap:var(--scale-400);height:fit-content;width:100%}.modal .modal-content-wrapper tems-division{width:fit-content}.modal .modal-content-wrapper tems-division div{display:block;height:auto;overflow:hidden;text-overflow:ellipsis}.modal .modal-content-wrapper .card-grid{display:flex;flex-direction:row;flex-wrap:wrap;gap:20px}.modal .modal-content-wrapper .card-grid-vertical{justify-content:stretch}.modal .modal-content-wrapper .card-grid-vertical tems-card-catalog{height:auto;width:354px}@media screen and (min-width:1100px){div.modal{height:fit-content;max-height:80vw;max-width:80vw;width:fit-content}}";
|
|
1199
|
+
var ns = Object.defineProperty, as = Object.getOwnPropertyDescriptor, Qe = (t, e, s, r) => {
|
|
1200
|
+
for (var i = r > 1 ? void 0 : r ? as(e, s) : e, o = t.length - 1, n; o >= 0; o--)
|
|
1201
|
+
(n = t[o]) && (i = (r ? n(e, s, i) : n(i)) || i);
|
|
1202
|
+
return r && i && ns(e, s, i), i;
|
|
1194
1203
|
};
|
|
1195
|
-
let
|
|
1204
|
+
let Y = class extends wt {
|
|
1196
1205
|
constructor() {
|
|
1197
1206
|
super(...arguments), this.object = { "@id": "" };
|
|
1198
1207
|
}
|
|
@@ -1200,12 +1209,12 @@ let K = class extends ye {
|
|
|
1200
1209
|
this.dispatchEvent(new CustomEvent("close"));
|
|
1201
1210
|
}
|
|
1202
1211
|
render() {
|
|
1203
|
-
return
|
|
1212
|
+
return p`<div class="modal">
|
|
1204
1213
|
<div class="topbar">
|
|
1205
1214
|
<tems-button
|
|
1206
1215
|
@click=${this._closeModal}
|
|
1207
1216
|
type="outline-gray"
|
|
1208
|
-
.iconLeft=${
|
|
1217
|
+
.iconLeft=${p`<icon-material-symbols-close-rounded></icon-material-symbols-close-rounded>`}
|
|
1209
1218
|
></tems-button>
|
|
1210
1219
|
</div>
|
|
1211
1220
|
<div class="modal-content-wrapper">
|
|
@@ -1218,37 +1227,37 @@ let K = class extends ye {
|
|
|
1218
1227
|
><div>${String(this.object.description)}</div></tems-division
|
|
1219
1228
|
>
|
|
1220
1229
|
<tems-division type="h4"
|
|
1221
|
-
><div>${
|
|
1230
|
+
><div>${u("All facts in this bundle")}</div></tems-division
|
|
1222
1231
|
>
|
|
1223
1232
|
<div class="card-grid card-grid-vertical">
|
|
1224
|
-
${this.object.facts.map((
|
|
1225
|
-
const
|
|
1233
|
+
${this.object.facts.map((t) => {
|
|
1234
|
+
const e = t.categories.map((s) => ({
|
|
1226
1235
|
name: s.name,
|
|
1227
1236
|
type: "information"
|
|
1228
1237
|
}));
|
|
1229
|
-
if (
|
|
1230
|
-
const s =
|
|
1231
|
-
|
|
1232
|
-
name: `+${s} ${
|
|
1238
|
+
if (e.length > 3) {
|
|
1239
|
+
const s = e.length - 3;
|
|
1240
|
+
e.splice(3, s), e.push({
|
|
1241
|
+
name: `+${s} ${u("more")}`,
|
|
1233
1242
|
type: "information"
|
|
1234
1243
|
});
|
|
1235
1244
|
}
|
|
1236
|
-
return
|
|
1245
|
+
return p`<tems-card-catalog
|
|
1237
1246
|
.object=${c}
|
|
1238
|
-
.tags=${
|
|
1239
|
-
.header=${
|
|
1240
|
-
.content=${
|
|
1241
|
-
date=${
|
|
1247
|
+
.tags=${e}
|
|
1248
|
+
.header=${t.name || c}
|
|
1249
|
+
.content=${t.description || c}
|
|
1250
|
+
date=${t.updated_at || c}
|
|
1242
1251
|
></tems-card-catalog>`;
|
|
1243
1252
|
})}
|
|
1244
1253
|
</div>
|
|
1245
1254
|
<tems-division type="body-sm"
|
|
1246
1255
|
><div>
|
|
1247
1256
|
<div>
|
|
1248
|
-
${
|
|
1257
|
+
${u("Bundle created on")} ${String(this.object.created_at)}
|
|
1249
1258
|
</div>
|
|
1250
1259
|
<div>
|
|
1251
|
-
${
|
|
1260
|
+
${u("Bundle updated on")} ${String(this.object.updated_at)}
|
|
1252
1261
|
</div>
|
|
1253
1262
|
</div></tems-division
|
|
1254
1263
|
>
|
|
@@ -1258,27 +1267,27 @@ let K = class extends ye {
|
|
|
1258
1267
|
</div>`;
|
|
1259
1268
|
}
|
|
1260
1269
|
};
|
|
1261
|
-
|
|
1262
|
-
${
|
|
1270
|
+
Y.styles = ee`
|
|
1271
|
+
${ge(os)}
|
|
1263
1272
|
`;
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
],
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
],
|
|
1271
|
-
const
|
|
1272
|
-
class
|
|
1273
|
+
Qe([
|
|
1274
|
+
m({ attribute: !1, type: Object })
|
|
1275
|
+
], Y.prototype, "object", 2);
|
|
1276
|
+
Y = Qe([
|
|
1277
|
+
re("ds4go-fact-bundle-modal"),
|
|
1278
|
+
Wt()
|
|
1279
|
+
], Y);
|
|
1280
|
+
const ls = /* @__PURE__ */ Symbol();
|
|
1281
|
+
class Ye {
|
|
1273
1282
|
get taskComplete() {
|
|
1274
|
-
return this.t || (this.i === 1 ? this.t = new Promise(((
|
|
1275
|
-
this.o =
|
|
1283
|
+
return this.t || (this.i === 1 ? this.t = new Promise(((e, s) => {
|
|
1284
|
+
this.o = e, this.h = s;
|
|
1276
1285
|
})) : this.i === 3 ? this.t = Promise.reject(this.l) : this.t = Promise.resolve(this.u)), this.t;
|
|
1277
1286
|
}
|
|
1278
|
-
constructor(
|
|
1279
|
-
this.p = 0, this.i = 0, (this._ =
|
|
1280
|
-
const
|
|
1281
|
-
this.v =
|
|
1287
|
+
constructor(e, s, r) {
|
|
1288
|
+
this.p = 0, this.i = 0, (this._ = e).addController(this);
|
|
1289
|
+
const i = typeof s == "object" ? s : { task: s, args: r };
|
|
1290
|
+
this.v = i.task, this.j = i.args, this.m = i.argsEqual ?? cs, this.k = i.onComplete, this.A = i.onError, this.autoRun = i.autoRun ?? !0, "initialValue" in i && (this.u = i.initialValue, this.i = 2, this.O = this.T?.());
|
|
1282
1291
|
}
|
|
1283
1292
|
hostUpdate() {
|
|
1284
1293
|
this.autoRun === !0 && this.S();
|
|
@@ -1288,27 +1297,27 @@ class ts {
|
|
|
1288
1297
|
}
|
|
1289
1298
|
T() {
|
|
1290
1299
|
if (this.j === void 0) return;
|
|
1291
|
-
const
|
|
1292
|
-
if (!Array.isArray(
|
|
1293
|
-
return
|
|
1300
|
+
const e = this.j();
|
|
1301
|
+
if (!Array.isArray(e)) throw Error("The args function must return an array");
|
|
1302
|
+
return e;
|
|
1294
1303
|
}
|
|
1295
1304
|
async S() {
|
|
1296
|
-
const
|
|
1297
|
-
this.O =
|
|
1305
|
+
const e = this.T(), s = this.O;
|
|
1306
|
+
this.O = e, e === s || e === void 0 || s !== void 0 && this.m(s, e) || await this.run(e);
|
|
1298
1307
|
}
|
|
1299
|
-
async run(
|
|
1300
|
-
let s,
|
|
1301
|
-
|
|
1302
|
-
const
|
|
1308
|
+
async run(e) {
|
|
1309
|
+
let s, r;
|
|
1310
|
+
e ??= this.T(), this.O = e, this.i === 1 ? this.q?.abort() : (this.t = void 0, this.o = void 0, this.h = void 0), this.i = 1, this.autoRun === "afterUpdate" ? queueMicrotask((() => this._.requestUpdate())) : this._.requestUpdate();
|
|
1311
|
+
const i = ++this.p;
|
|
1303
1312
|
this.q = new AbortController();
|
|
1304
1313
|
let o = !1;
|
|
1305
1314
|
try {
|
|
1306
|
-
s = await this.v(
|
|
1315
|
+
s = await this.v(e, { signal: this.q.signal });
|
|
1307
1316
|
} catch (n) {
|
|
1308
|
-
o = !0,
|
|
1317
|
+
o = !0, r = n;
|
|
1309
1318
|
}
|
|
1310
|
-
if (this.p ===
|
|
1311
|
-
if (s ===
|
|
1319
|
+
if (this.p === i) {
|
|
1320
|
+
if (s === ls) this.i = 0;
|
|
1312
1321
|
else {
|
|
1313
1322
|
if (o === !1) {
|
|
1314
1323
|
try {
|
|
@@ -1318,18 +1327,18 @@ class ts {
|
|
|
1318
1327
|
this.i = 2, this.o?.(s);
|
|
1319
1328
|
} else {
|
|
1320
1329
|
try {
|
|
1321
|
-
this.A?.(
|
|
1330
|
+
this.A?.(r);
|
|
1322
1331
|
} catch {
|
|
1323
1332
|
}
|
|
1324
|
-
this.i = 3, this.h?.(
|
|
1333
|
+
this.i = 3, this.h?.(r);
|
|
1325
1334
|
}
|
|
1326
|
-
this.u = s, this.l =
|
|
1335
|
+
this.u = s, this.l = r;
|
|
1327
1336
|
}
|
|
1328
1337
|
this._.requestUpdate();
|
|
1329
1338
|
}
|
|
1330
1339
|
}
|
|
1331
|
-
abort(
|
|
1332
|
-
this.i === 1 && this.q?.abort(
|
|
1340
|
+
abort(e) {
|
|
1341
|
+
this.i === 1 && this.q?.abort(e);
|
|
1333
1342
|
}
|
|
1334
1343
|
get value() {
|
|
1335
1344
|
return this.u;
|
|
@@ -1340,46 +1349,367 @@ class ts {
|
|
|
1340
1349
|
get status() {
|
|
1341
1350
|
return this.i;
|
|
1342
1351
|
}
|
|
1343
|
-
render(
|
|
1352
|
+
render(e) {
|
|
1344
1353
|
switch (this.i) {
|
|
1345
1354
|
case 0:
|
|
1346
|
-
return
|
|
1355
|
+
return e.initial?.();
|
|
1347
1356
|
case 1:
|
|
1348
|
-
return
|
|
1357
|
+
return e.pending?.();
|
|
1349
1358
|
case 2:
|
|
1350
|
-
return
|
|
1359
|
+
return e.complete?.(this.value);
|
|
1351
1360
|
case 3:
|
|
1352
|
-
return
|
|
1361
|
+
return e.error?.(this.error);
|
|
1353
1362
|
default:
|
|
1354
1363
|
throw Error("Unexpected status: " + this.i);
|
|
1355
1364
|
}
|
|
1356
1365
|
}
|
|
1357
1366
|
}
|
|
1358
|
-
const
|
|
1359
|
-
var
|
|
1360
|
-
for (var
|
|
1361
|
-
(n =
|
|
1362
|
-
return
|
|
1367
|
+
const cs = (t, e) => t === e || t.length === e.length && t.every(((s, r) => !se(s, e[r]))), ds = ".flex{display:flex}.flex.flex-row{flex-direction:row}.flex.flex-column{flex-direction:column}.flex.wrap{flex-wrap:wrap}.flex.flex-1{flex:1}.flex .half,.flex.half{flex-basis:50%}.flex.justify-content-center{justify-content:center}.flex.justify-content-space-between{justify-content:space-between}.flex.align-items-center{align-items:center}.flex.align-items-flex-start{align-items:flex-start}.flex .align-items-flex-end{align-items:flex-end}.full-width{width:100%}";
|
|
1368
|
+
var hs = Object.defineProperty, us = Object.getOwnPropertyDescriptor, A = (t, e, s, r) => {
|
|
1369
|
+
for (var i = r > 1 ? void 0 : r ? us(e, s) : e, o = t.length - 1, n; o >= 0; o--)
|
|
1370
|
+
(n = t[o]) && (i = (r ? n(e, s, i) : n(i)) || i);
|
|
1371
|
+
return r && i && hs(e, s, i), i;
|
|
1363
1372
|
};
|
|
1364
|
-
let
|
|
1373
|
+
let y = class extends v {
|
|
1374
|
+
constructor() {
|
|
1375
|
+
super(...arguments), this.header = "DS4GO Fact Bundling Creation", this.selectedFacts = [], this.bundleName = "", this.bundleDescription = "", this.filterFactText = "", this.spliceLength = 0, this.cherryPickedProperties = [
|
|
1376
|
+
{ key: "created_at", value: "created_at", cast: U },
|
|
1377
|
+
{ key: "updated_at", value: "updated_at", cast: U },
|
|
1378
|
+
{ key: "name", value: "name" },
|
|
1379
|
+
{ key: "description", value: "description" },
|
|
1380
|
+
{ key: "author", value: "author" },
|
|
1381
|
+
{
|
|
1382
|
+
key: "categories",
|
|
1383
|
+
value: "categories",
|
|
1384
|
+
expand: !0,
|
|
1385
|
+
cast: (e) => N(e, "name")
|
|
1386
|
+
}
|
|
1387
|
+
], this._getResource = new Ye(this, {
|
|
1388
|
+
task: async ([e, s, r]) => {
|
|
1389
|
+
if (!(!e || !this.orbit || !this.noRouter && this.route && this.currentRoute && !this.route.startsWith(this.currentRoute))) {
|
|
1390
|
+
if (!this.hasCachedDatas || this.oldDataSrc !== e) {
|
|
1391
|
+
if (!e) return;
|
|
1392
|
+
this.facts = await this._getProxyValue(e), this.hasCachedDatas = !0;
|
|
1393
|
+
}
|
|
1394
|
+
return this.oldDataSrc !== e && (this.oldDataSrc = e), Array.isArray(this.facts) || (this.facts = []), s ? N(
|
|
1395
|
+
We(
|
|
1396
|
+
this.facts.filter(
|
|
1397
|
+
(i) => !r.includes(i)
|
|
1398
|
+
),
|
|
1399
|
+
s
|
|
1400
|
+
),
|
|
1401
|
+
"name",
|
|
1402
|
+
"asc"
|
|
1403
|
+
) : (r.length === 0 && (this.spliceLength = Math.floor((window.innerWidth - 800) / 354) * Math.floor((window.innerHeight - 255) / 500)), N(
|
|
1404
|
+
this.facts.filter(
|
|
1405
|
+
(i) => !this.selectedFacts.includes(i)
|
|
1406
|
+
),
|
|
1407
|
+
"name",
|
|
1408
|
+
"asc"
|
|
1409
|
+
));
|
|
1410
|
+
}
|
|
1411
|
+
},
|
|
1412
|
+
args: () => [
|
|
1413
|
+
this.factsSrc,
|
|
1414
|
+
this.filterFactText,
|
|
1415
|
+
this.selectedFacts,
|
|
1416
|
+
this.caching,
|
|
1417
|
+
this.currentRoute
|
|
1418
|
+
]
|
|
1419
|
+
});
|
|
1420
|
+
}
|
|
1421
|
+
_showMoreResults() {
|
|
1422
|
+
this.spliceLength += Math.floor((window.innerWidth - 800) / 354);
|
|
1423
|
+
}
|
|
1424
|
+
_showAllResults() {
|
|
1425
|
+
this.spliceLength = this.facts.length;
|
|
1426
|
+
}
|
|
1427
|
+
async _createFactBundle() {
|
|
1428
|
+
if (!this.bundleName || !(this.selectedFacts.length > 0))
|
|
1429
|
+
return;
|
|
1430
|
+
const e = {
|
|
1431
|
+
"@context": [
|
|
1432
|
+
"https://cdn.startinblox.com/owl/context.jsonld",
|
|
1433
|
+
"https://cdn.startinblox.com/owl/ds4go.jsonld"
|
|
1434
|
+
],
|
|
1435
|
+
"@type": ["ldp:Container", "ds4go:FactBundle"],
|
|
1436
|
+
name: this.bundleName,
|
|
1437
|
+
description: this.bundleDescription,
|
|
1438
|
+
facts: this.selectedFacts.map((r) => r.id)
|
|
1439
|
+
}, s = await window.sibStore.post(
|
|
1440
|
+
e,
|
|
1441
|
+
this.dataSrc
|
|
1442
|
+
);
|
|
1443
|
+
document.dispatchEvent(
|
|
1444
|
+
new CustomEvent("save", {
|
|
1445
|
+
detail: { resource: { "@id": s } },
|
|
1446
|
+
bubbles: !0
|
|
1447
|
+
})
|
|
1448
|
+
), document.dispatchEvent(
|
|
1449
|
+
new CustomEvent("save", {
|
|
1450
|
+
detail: { resource: { "@id": this.dataSrc } },
|
|
1451
|
+
bubbles: !0
|
|
1452
|
+
})
|
|
1453
|
+
);
|
|
1454
|
+
}
|
|
1455
|
+
_updateBundleName(e) {
|
|
1456
|
+
this.bundleName = e.detail.value;
|
|
1457
|
+
}
|
|
1458
|
+
_updateBundleDescription(e) {
|
|
1459
|
+
this.bundleDescription = e.detail.value;
|
|
1460
|
+
}
|
|
1461
|
+
_toggleFactSelection(e) {
|
|
1462
|
+
this.selectedFacts.includes(e) ? this.selectedFacts = this.selectedFacts.filter((s) => s !== e) : this.selectedFacts = [...this.selectedFacts, e];
|
|
1463
|
+
}
|
|
1464
|
+
_searchFacts(e) {
|
|
1465
|
+
this.filterFactText = e.detail;
|
|
1466
|
+
}
|
|
1467
|
+
render() {
|
|
1468
|
+
return this.gatekeeper() || this._getResource.render({
|
|
1469
|
+
pending: () => p`<solid-loader></solid-loader>`,
|
|
1470
|
+
error: (e) => (console.warn("[solid-fact-bundle-creation] Task error:", e), c),
|
|
1471
|
+
complete: (e) => {
|
|
1472
|
+
if (!e) return c;
|
|
1473
|
+
const s = e.slice(0, this.spliceLength), r = this.selectedFacts.length, i = !!this.bundleName && r > 0;
|
|
1474
|
+
return p`<tems-viewport>
|
|
1475
|
+
<tems-header slot="header" heading=${this.header}>
|
|
1476
|
+
<div slot="cta">
|
|
1477
|
+
<tems-button
|
|
1478
|
+
type="primary"
|
|
1479
|
+
disabled=${!i || c}
|
|
1480
|
+
label=${u("Create bundle")}
|
|
1481
|
+
@click=${this._createFactBundle}
|
|
1482
|
+
></tems-button>
|
|
1483
|
+
</div>
|
|
1484
|
+
</tems-header>
|
|
1485
|
+
<div slot="content">
|
|
1486
|
+
<section class="flex flex-1">
|
|
1487
|
+
<div>
|
|
1488
|
+
<div>
|
|
1489
|
+
<tems-input
|
|
1490
|
+
type="text"
|
|
1491
|
+
label=${u("Bundle name")}
|
|
1492
|
+
placeholder=${u("Bundle name")}
|
|
1493
|
+
required=""
|
|
1494
|
+
.value=${this.bundleName}
|
|
1495
|
+
@change=${this._updateBundleName}
|
|
1496
|
+
></tems-input>
|
|
1497
|
+
</div>
|
|
1498
|
+
<div>
|
|
1499
|
+
<tems-textarea
|
|
1500
|
+
rows="4"
|
|
1501
|
+
label=${u("Bundle description")}
|
|
1502
|
+
placeholder=${u("Bundle description")}
|
|
1503
|
+
.value=${this.bundleDescription}
|
|
1504
|
+
@change=${this._updateBundleDescription}
|
|
1505
|
+
></tems-textarea>
|
|
1506
|
+
</div>
|
|
1507
|
+
${r > 0 ? p`<tems-division type="h4">
|
|
1508
|
+
<div>
|
|
1509
|
+
${u(
|
|
1510
|
+
J`${r} selected fact${r > 1 ? "s" : ""}`
|
|
1511
|
+
)}
|
|
1512
|
+
</div></tems-division
|
|
1513
|
+
>
|
|
1514
|
+
<div class="card-grid card-grid-vertical">
|
|
1515
|
+
${this.selectedFacts.map((o) => {
|
|
1516
|
+
const n = o.categories.map((a) => ({
|
|
1517
|
+
name: a.name,
|
|
1518
|
+
type: "information"
|
|
1519
|
+
}));
|
|
1520
|
+
if (n.length > 3) {
|
|
1521
|
+
const a = n.length - 3;
|
|
1522
|
+
n.splice(3, a), n.push({
|
|
1523
|
+
name: `+${a} ${u("more")}`,
|
|
1524
|
+
type: "information"
|
|
1525
|
+
});
|
|
1526
|
+
}
|
|
1527
|
+
return p`<tems-card-catalog
|
|
1528
|
+
.object=${c}
|
|
1529
|
+
.header=${o.name || c}
|
|
1530
|
+
date=${o.updated_at || c}
|
|
1531
|
+
@click=${this._toggleFactSelection.bind(
|
|
1532
|
+
this,
|
|
1533
|
+
o
|
|
1534
|
+
)}
|
|
1535
|
+
selected=${!0}
|
|
1536
|
+
></tems-card-catalog>`;
|
|
1537
|
+
})}
|
|
1538
|
+
</div>` : c}
|
|
1539
|
+
</div>
|
|
1540
|
+
${s.length > 0 || this.filterFactText ? p`<div>
|
|
1541
|
+
<div>
|
|
1542
|
+
<tems-search-bar
|
|
1543
|
+
.displayFilters=${!1}
|
|
1544
|
+
.displaySavedSearch=${!1}
|
|
1545
|
+
.displayViews=${!1}
|
|
1546
|
+
.dropdownCardElement=${!1}
|
|
1547
|
+
.dropdownListElement=${!1}
|
|
1548
|
+
.dropdownTableElement=${!1}
|
|
1549
|
+
.dropdownMapElement=${!1}
|
|
1550
|
+
.displayActiveTags=${!1}
|
|
1551
|
+
.value=${this.filterFactText}
|
|
1552
|
+
@search=${this._searchFacts}
|
|
1553
|
+
></tems-search-bar>
|
|
1554
|
+
</div>
|
|
1555
|
+
${s.length > 0 ? p` <div class="card-grid card-grid-vertical">
|
|
1556
|
+
${s.map((o) => {
|
|
1557
|
+
const n = o.categories.map(
|
|
1558
|
+
(a) => ({
|
|
1559
|
+
name: a.name,
|
|
1560
|
+
type: "information"
|
|
1561
|
+
})
|
|
1562
|
+
);
|
|
1563
|
+
if (n.length > 3) {
|
|
1564
|
+
const a = n.length - 3;
|
|
1565
|
+
n.splice(3, a), n.push({
|
|
1566
|
+
name: `+${a} ${u("more")}`,
|
|
1567
|
+
type: "information"
|
|
1568
|
+
});
|
|
1569
|
+
}
|
|
1570
|
+
return p`<tems-card-catalog
|
|
1571
|
+
.object=${c}
|
|
1572
|
+
.tags=${n}
|
|
1573
|
+
.header=${o.name || c}
|
|
1574
|
+
.content=${o.description || c}
|
|
1575
|
+
date=${o.updated_at || c}
|
|
1576
|
+
@click=${this._toggleFactSelection.bind(
|
|
1577
|
+
this,
|
|
1578
|
+
o
|
|
1579
|
+
)}
|
|
1580
|
+
></tems-card-catalog>`;
|
|
1581
|
+
})}
|
|
1582
|
+
</div>
|
|
1583
|
+
${s.length < e.length ? p`<div
|
|
1584
|
+
class="flex flex-row justify-content-space-between align-items-flex-end"
|
|
1585
|
+
>
|
|
1586
|
+
<div>
|
|
1587
|
+
${u(
|
|
1588
|
+
J`Displaying ${s.length} of ${e.length} result${e.length > 1 ? "s" : ""}`
|
|
1589
|
+
)}
|
|
1590
|
+
</div>
|
|
1591
|
+
<div class="flex flex-row gap-400">
|
|
1592
|
+
<tems-button
|
|
1593
|
+
@click=${this._showMoreResults}
|
|
1594
|
+
type="primary"
|
|
1595
|
+
size="sm"
|
|
1596
|
+
label=${u("Show more results")}
|
|
1597
|
+
></tems-button>
|
|
1598
|
+
<tems-button
|
|
1599
|
+
@click=${this._showAllResults}
|
|
1600
|
+
type="primary"
|
|
1601
|
+
size="sm"
|
|
1602
|
+
label=${u("Show all results")}
|
|
1603
|
+
></tems-button>
|
|
1604
|
+
</div>
|
|
1605
|
+
</div>` : c}` : p`${u("No results found")} ${this.filterFactText ? `for "${this.filterFactText}".` : ""}`}
|
|
1606
|
+
</div>` : c}
|
|
1607
|
+
</section>
|
|
1608
|
+
</div>
|
|
1609
|
+
</tems-viewport>`;
|
|
1610
|
+
}
|
|
1611
|
+
});
|
|
1612
|
+
}
|
|
1613
|
+
};
|
|
1614
|
+
y.styles = [
|
|
1615
|
+
ge(ds),
|
|
1616
|
+
ee`
|
|
1617
|
+
[slot="content"] {
|
|
1618
|
+
height: 100%;
|
|
1619
|
+
}
|
|
1620
|
+
section {
|
|
1621
|
+
gap: var(--scale-400);
|
|
1622
|
+
padding: var(--scale-900) 0;
|
|
1623
|
+
height: calc(100% - var(--scale-900) * 2);
|
|
1624
|
+
}
|
|
1625
|
+
section > div {
|
|
1626
|
+
height: 100%;
|
|
1627
|
+
display: flex;
|
|
1628
|
+
flex-direction: column;
|
|
1629
|
+
gap: var(--scale-400);
|
|
1630
|
+
flex: 1;
|
|
1631
|
+
}
|
|
1632
|
+
section > div:first-child {
|
|
1633
|
+
max-width: 400px;
|
|
1634
|
+
}
|
|
1635
|
+
.card-grid {
|
|
1636
|
+
flex: 1;
|
|
1637
|
+
overflow-y: scroll;
|
|
1638
|
+
display: flex;
|
|
1639
|
+
flex-direction: row;
|
|
1640
|
+
flex-wrap: wrap;
|
|
1641
|
+
gap: 20px;
|
|
1642
|
+
align-content: flex-start;
|
|
1643
|
+
}
|
|
1644
|
+
.card-grid-vertical {
|
|
1645
|
+
justify-content: stretch;
|
|
1646
|
+
}
|
|
1647
|
+
.card-grid-vertical tems-card-catalog {
|
|
1648
|
+
width: 354px;
|
|
1649
|
+
height: fit-content;
|
|
1650
|
+
}
|
|
1651
|
+
tems-card-catalog {
|
|
1652
|
+
cursor: pointer;
|
|
1653
|
+
}
|
|
1654
|
+
tems-card-catalog[selected] {
|
|
1655
|
+
--color-border-primary: var(--color-surface-action-solid);
|
|
1656
|
+
}
|
|
1657
|
+
tems-search-bar {
|
|
1658
|
+
--scale-900: 0;
|
|
1659
|
+
}
|
|
1660
|
+
.gap-400 {
|
|
1661
|
+
gap: var(--scale-400);
|
|
1662
|
+
}
|
|
1663
|
+
`
|
|
1664
|
+
];
|
|
1665
|
+
A([
|
|
1666
|
+
m({ attribute: "header", type: String })
|
|
1667
|
+
], y.prototype, "header", 2);
|
|
1668
|
+
A([
|
|
1669
|
+
m({ attribute: "facts-src", reflect: !0 })
|
|
1670
|
+
], y.prototype, "factsSrc", 2);
|
|
1671
|
+
A([
|
|
1672
|
+
g()
|
|
1673
|
+
], y.prototype, "selectedFacts", 2);
|
|
1674
|
+
A([
|
|
1675
|
+
g()
|
|
1676
|
+
], y.prototype, "bundleName", 2);
|
|
1677
|
+
A([
|
|
1678
|
+
g()
|
|
1679
|
+
], y.prototype, "bundleDescription", 2);
|
|
1680
|
+
A([
|
|
1681
|
+
g()
|
|
1682
|
+
], y.prototype, "filterFactText", 2);
|
|
1683
|
+
A([
|
|
1684
|
+
g()
|
|
1685
|
+
], y.prototype, "spliceLength", 2);
|
|
1686
|
+
y = A([
|
|
1687
|
+
re("solid-fact-bundle-creation")
|
|
1688
|
+
], y);
|
|
1689
|
+
var fs = Object.defineProperty, ps = Object.getOwnPropertyDescriptor, I = (t, e, s, r) => {
|
|
1690
|
+
for (var i = r > 1 ? void 0 : r ? ps(e, s) : e, o = t.length - 1, n; o >= 0; o--)
|
|
1691
|
+
(n = t[o]) && (i = (r ? n(e, s, i) : n(i)) || i);
|
|
1692
|
+
return r && i && fs(e, s, i), i;
|
|
1693
|
+
};
|
|
1694
|
+
let j = class extends v {
|
|
1365
1695
|
constructor() {
|
|
1366
1696
|
super(...arguments), this.header = "DS4GO Fact Bundling", this.search = [], this.resultCount = this.objects?.length || 0, this.cherryPickedProperties = [
|
|
1367
|
-
{ key: "created_at", value: "created_at", cast:
|
|
1368
|
-
{ key: "updated_at", value: "updated_at", cast:
|
|
1697
|
+
{ key: "created_at", value: "created_at", cast: U },
|
|
1698
|
+
{ key: "updated_at", value: "updated_at", cast: U },
|
|
1369
1699
|
{ key: "name", value: "name" },
|
|
1370
1700
|
{ key: "description", value: "description" }
|
|
1371
|
-
], this._getResource = new
|
|
1372
|
-
task: async ([
|
|
1373
|
-
if (!(!
|
|
1701
|
+
], this._getResource = new Ye(this, {
|
|
1702
|
+
task: async ([t, e]) => {
|
|
1703
|
+
if (!(!t && !e || !this.orbit || !this.noRouter && this.route && this.currentRoute && !this.route.startsWith(this.currentRoute))) {
|
|
1374
1704
|
if (this.menuComponent.ready || await new Promise((s) => {
|
|
1375
1705
|
this.menuComponent.addEventListener("user-ready", () => {
|
|
1376
1706
|
s(!0);
|
|
1377
1707
|
});
|
|
1378
|
-
}), this.displayFiltering = !this.component.parameters.disableFiltering, !this.hasCachedDatas || this.oldDataSrc !==
|
|
1379
|
-
if (!
|
|
1380
|
-
this.objects = await this._getProxyValue(
|
|
1708
|
+
}), this.displayFiltering = !this.component.parameters.disableFiltering, !this.hasCachedDatas || this.oldDataSrc !== t) {
|
|
1709
|
+
if (!t) return;
|
|
1710
|
+
this.objects = await this._getProxyValue(t), this.hasCachedDatas = !0;
|
|
1381
1711
|
}
|
|
1382
|
-
return this.oldDataSrc !==
|
|
1712
|
+
return this.oldDataSrc !== t && (this.oldDataSrc = t), Array.isArray(this.objects) || (this.objects = []), this.object = this.objects.find((s) => s["@id"] === e), N(this.objects, "name", "asc");
|
|
1383
1713
|
}
|
|
1384
1714
|
},
|
|
1385
1715
|
args: () => [
|
|
@@ -1390,18 +1720,18 @@ let R = class extends m {
|
|
|
1390
1720
|
]
|
|
1391
1721
|
});
|
|
1392
1722
|
}
|
|
1393
|
-
async _responseAdaptator(
|
|
1394
|
-
return
|
|
1395
|
-
(await
|
|
1396
|
-
(
|
|
1397
|
-
{ key: "updated_at", value: "updated_at", cast:
|
|
1723
|
+
async _responseAdaptator(t) {
|
|
1724
|
+
return t?._originalResource?.hasType("ds4go:FactBundle") && (t.facts = await Promise.all(
|
|
1725
|
+
(await t._originalResource["ldp:contains"]).map(
|
|
1726
|
+
(e) => this._getProxyValue(e["@id"], !1, [
|
|
1727
|
+
{ key: "updated_at", value: "updated_at", cast: U },
|
|
1398
1728
|
{ key: "name", value: "name" },
|
|
1399
1729
|
{ key: "description", value: "description" },
|
|
1400
1730
|
{
|
|
1401
1731
|
key: "categories",
|
|
1402
1732
|
value: "categories",
|
|
1403
1733
|
expand: !0,
|
|
1404
|
-
cast: (s) =>
|
|
1734
|
+
cast: (s) => N(s, "name")
|
|
1405
1735
|
},
|
|
1406
1736
|
{ key: "author", value: "author" },
|
|
1407
1737
|
{ key: "link", value: "link" },
|
|
@@ -1416,49 +1746,56 @@ let R = class extends m {
|
|
|
1416
1746
|
// { key: "review", value: "review" },
|
|
1417
1747
|
])
|
|
1418
1748
|
)
|
|
1419
|
-
)
|
|
1749
|
+
)), Promise.resolve(t);
|
|
1420
1750
|
}
|
|
1421
1751
|
async _afterAttach() {
|
|
1422
1752
|
return this.menuComponent = document.querySelector(
|
|
1423
1753
|
`[uniq="${this.orbit?.getComponent("menu")?.uniq}"]`
|
|
1754
|
+
), this.bundleCreationComponent = this.orbit?.getComponent(
|
|
1755
|
+
"fact-bundle-creation"
|
|
1424
1756
|
), Promise.resolve();
|
|
1425
1757
|
}
|
|
1426
|
-
_search(
|
|
1427
|
-
|
|
1758
|
+
_search(t) {
|
|
1759
|
+
t.preventDefault(), this.search = t.detail, this.filterCount = this.search.filter((e) => e.name !== "search").length;
|
|
1428
1760
|
}
|
|
1429
|
-
_openModal(
|
|
1430
|
-
if (
|
|
1761
|
+
_openModal(t) {
|
|
1762
|
+
if (t.preventDefault(), this.route)
|
|
1431
1763
|
if ("use-id" in (this.component.routeAttributes || {}))
|
|
1432
|
-
|
|
1764
|
+
O(this.route, t.detail["@id"]);
|
|
1433
1765
|
else {
|
|
1434
|
-
const
|
|
1435
|
-
if (
|
|
1766
|
+
const e = t.detail["@type"]?.at(-1) ?? t.detail["@type"];
|
|
1767
|
+
if (e) {
|
|
1436
1768
|
const s = window.orbit?.components?.filter(
|
|
1437
|
-
(
|
|
1769
|
+
(r) => r?.routeAttributes?.["rdf-type"] === e
|
|
1438
1770
|
);
|
|
1439
|
-
s?.[0]?.route &&
|
|
1771
|
+
s?.[0]?.route && O(s[0]?.route, t.detail["@id"]);
|
|
1440
1772
|
}
|
|
1441
1773
|
}
|
|
1442
1774
|
}
|
|
1443
|
-
_closeModal(
|
|
1444
|
-
|
|
1775
|
+
_closeModal(t) {
|
|
1776
|
+
t.preventDefault(), this.route && O(this.route, this.defaultDataSrc);
|
|
1445
1777
|
}
|
|
1446
|
-
_closeModalFromBackground(
|
|
1447
|
-
|
|
1778
|
+
_closeModalFromBackground(t) {
|
|
1779
|
+
t.preventDefault(), this.route && t.target?.classList.contains("modal") && O(this.route, this.defaultDataSrc);
|
|
1448
1780
|
}
|
|
1449
|
-
_resultCountUpdate(
|
|
1450
|
-
this.resultCount =
|
|
1781
|
+
_resultCountUpdate(t) {
|
|
1782
|
+
this.resultCount = t.detail ?? 0;
|
|
1783
|
+
}
|
|
1784
|
+
_goToBundleCreation(t) {
|
|
1785
|
+
t.preventDefault(), this.bundleCreationComponent?.route && O(this.bundleCreationComponent.route);
|
|
1451
1786
|
}
|
|
1452
1787
|
render() {
|
|
1453
1788
|
return this.gatekeeper() || this._getResource.render({
|
|
1454
|
-
pending: () =>
|
|
1455
|
-
error: (
|
|
1456
|
-
complete: (
|
|
1789
|
+
pending: () => p`<solid-loader></solid-loader>`,
|
|
1790
|
+
error: (t) => (console.warn("[solid-fact-bundle] Task error:", t), c),
|
|
1791
|
+
complete: (t) => p`<tems-viewport>
|
|
1457
1792
|
<tems-header slot="header" heading=${this.header}>
|
|
1458
1793
|
<div slot="cta">
|
|
1459
1794
|
<tems-button
|
|
1460
1795
|
type="primary"
|
|
1461
|
-
|
|
1796
|
+
disabled=${!this.bundleCreationComponent?.route || c}
|
|
1797
|
+
label=${u("Create a bundle")}
|
|
1798
|
+
@click=${this._goToBundleCreation}
|
|
1462
1799
|
></tems-button>
|
|
1463
1800
|
</div>
|
|
1464
1801
|
</tems-header>
|
|
@@ -1467,17 +1804,17 @@ let R = class extends m {
|
|
|
1467
1804
|
.displayFiltering=${this.displayFiltering}
|
|
1468
1805
|
@search=${this._search}
|
|
1469
1806
|
.search=${this.search}
|
|
1470
|
-
.objects=${
|
|
1807
|
+
.objects=${t}
|
|
1471
1808
|
.resultCount=${this.resultCount}
|
|
1472
1809
|
.filterCount=${this.filterCount}
|
|
1473
1810
|
></tems-catalog-filter-holder>
|
|
1474
1811
|
<ds4go-fact-bundle-holder
|
|
1475
|
-
.objects=${
|
|
1812
|
+
.objects=${t}
|
|
1476
1813
|
.search=${this.search}
|
|
1477
1814
|
@clicked=${this._openModal}
|
|
1478
1815
|
@result-count=${this._resultCountUpdate}
|
|
1479
1816
|
></ds4go-fact-bundle-holder>
|
|
1480
|
-
${this.object ?
|
|
1817
|
+
${this.object ? p`<div
|
|
1481
1818
|
class="modal"
|
|
1482
1819
|
@click=${this._closeModalFromBackground}
|
|
1483
1820
|
>
|
|
@@ -1491,7 +1828,7 @@ let R = class extends m {
|
|
|
1491
1828
|
});
|
|
1492
1829
|
}
|
|
1493
1830
|
};
|
|
1494
|
-
|
|
1831
|
+
j.styles = ee`
|
|
1495
1832
|
.modal {
|
|
1496
1833
|
position: fixed;
|
|
1497
1834
|
top: 0;
|
|
@@ -1505,40 +1842,51 @@ R.styles = ut`
|
|
|
1505
1842
|
align-items: center;
|
|
1506
1843
|
}
|
|
1507
1844
|
`;
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
],
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
],
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
],
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
],
|
|
1520
|
-
|
|
1845
|
+
I([
|
|
1846
|
+
m({ attribute: "header", type: String })
|
|
1847
|
+
], j.prototype, "header", 2);
|
|
1848
|
+
I([
|
|
1849
|
+
g()
|
|
1850
|
+
], j.prototype, "search", 2);
|
|
1851
|
+
I([
|
|
1852
|
+
g()
|
|
1853
|
+
], j.prototype, "resultCount", 2);
|
|
1854
|
+
I([
|
|
1855
|
+
g()
|
|
1856
|
+
], j.prototype, "bundleCreationComponent", 2);
|
|
1857
|
+
j = I([
|
|
1858
|
+
re("solid-fact-bundle")
|
|
1859
|
+
], j);
|
|
1860
|
+
const ms = {
|
|
1861
|
+
seb1a452f2df70baf: "Create bundle",
|
|
1862
|
+
sed5b6ae54e00125c: "Bundle name",
|
|
1863
|
+
s11099da36cbc3173: "Bundle description",
|
|
1864
|
+
sac1b0231875ff056: J`${0} selected fact${1}`,
|
|
1865
|
+
s0d1be7a2c400c080: "more",
|
|
1866
|
+
s8272d3578b7c78d5: J`Displaying ${0} of ${1} result${2}`,
|
|
1867
|
+
sa40e7f4f2a43e2f7: "Show more results",
|
|
1868
|
+
sacf246e0fa11730d: "Show all results",
|
|
1869
|
+
s9094c0cde8fb5058: "No results found",
|
|
1521
1870
|
sf5509a9f253b9836: "Create a bundle",
|
|
1522
1871
|
sefa717c1620c4ae4: "facts",
|
|
1523
1872
|
sef234a791696afff: "fact",
|
|
1524
1873
|
s4979bd417e7c8052: "All facts in this bundle",
|
|
1525
|
-
s0d1be7a2c400c080: "more",
|
|
1526
1874
|
s57a40de45f324b96: "Bundle created on",
|
|
1527
1875
|
sd3682395cf86f913: "Bundle updated on"
|
|
1528
|
-
},
|
|
1876
|
+
}, gs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1529
1877
|
__proto__: null,
|
|
1530
|
-
templates:
|
|
1531
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1878
|
+
templates: ms
|
|
1879
|
+
}, Symbol.toStringTag, { value: "Module" })), ys = "en", et = [
|
|
1532
1880
|
"en"
|
|
1533
|
-
],
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1881
|
+
], vs = /* @__PURE__ */ Object.assign({ "../../generated/locales/en.ts": gs }), $s = new Map(
|
|
1882
|
+
et.map((t) => [
|
|
1883
|
+
t,
|
|
1884
|
+
vs[`../../generated/locales/${t}.ts`]
|
|
1537
1885
|
])
|
|
1538
|
-
), { getLocale:
|
|
1539
|
-
sourceLocale:
|
|
1540
|
-
targetLocales:
|
|
1541
|
-
loadLocale: async (
|
|
1886
|
+
), { getLocale: Fe, setLocale: Be } = es({
|
|
1887
|
+
sourceLocale: ys,
|
|
1888
|
+
targetLocales: et,
|
|
1889
|
+
loadLocale: async (t) => $s.get(t)
|
|
1542
1890
|
});
|
|
1543
|
-
window.getLocale = window.getLocale ? window.getLocale.push(
|
|
1544
|
-
window.setLocale = window.setLocale ? window.setLocale.push(
|
|
1891
|
+
window.getLocale = window.getLocale ? window.getLocale.push(Fe) : [Fe];
|
|
1892
|
+
window.setLocale = window.setLocale ? window.setLocale.push(Be) : [Be];
|