@startinblox/components-ds4go 1.0.0

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