@startinblox/boilerplate 3.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 (54) hide show
  1. package/.gitlab-ci.yml +57 -0
  2. package/.storybook/main.ts +15 -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 +85 -0
  7. package/biome.json +39 -0
  8. package/cypress/component/solid-boilerplate.cy.ts +9 -0
  9. package/cypress/cypress.d.ts +1 -0
  10. package/cypress/support/component-index.html +12 -0
  11. package/cypress/support/component.ts +17 -0
  12. package/cypress.config.ts +11 -0
  13. package/dist/boilerplate.css +1 -0
  14. package/dist/index.js +1213 -0
  15. package/lit-localize.json +15 -0
  16. package/locales/en.xlf +13 -0
  17. package/package.json +92 -0
  18. package/postcss.config.js +8 -0
  19. package/src/component.d.ts +161 -0
  20. package/src/components/solid-boilerplate.ts +79 -0
  21. package/src/components/ui/sample-object.ts +37 -0
  22. package/src/components/ui/sample-objects.ts +40 -0
  23. package/src/context.json +1 -0
  24. package/src/helpers/components/componentObjectHandler.ts +100 -0
  25. package/src/helpers/components/componentObjectsHandler.ts +44 -0
  26. package/src/helpers/components/orbitComponent.ts +241 -0
  27. package/src/helpers/components/setupCacheInvalidation.ts +37 -0
  28. package/src/helpers/components/setupCacheOnResourceReady.ts +32 -0
  29. package/src/helpers/components/setupComponentSubscriptions.ts +73 -0
  30. package/src/helpers/components/setupOnSaveReset.ts +20 -0
  31. package/src/helpers/datas/dataBuilder.ts +43 -0
  32. package/src/helpers/datas/filterGenerator.ts +29 -0
  33. package/src/helpers/datas/filterObjectByDateAfter.ts +80 -0
  34. package/src/helpers/datas/filterObjectById.ts +54 -0
  35. package/src/helpers/datas/filterObjectByInterval.ts +133 -0
  36. package/src/helpers/datas/filterObjectByNamedValue.ts +103 -0
  37. package/src/helpers/datas/filterObjectByType.ts +30 -0
  38. package/src/helpers/datas/filterObjectByValue.ts +81 -0
  39. package/src/helpers/datas/sort.ts +40 -0
  40. package/src/helpers/i18n/configureLocalization.ts +17 -0
  41. package/src/helpers/index.ts +41 -0
  42. package/src/helpers/ui/formatDate.ts +18 -0
  43. package/src/helpers/ui/lipsum.ts +12 -0
  44. package/src/helpers/utils/requestNavigation.ts +12 -0
  45. package/src/helpers/utils/uniq.ts +6 -0
  46. package/src/index.ts +7 -0
  47. package/src/initializer.ts +11 -0
  48. package/src/mocks/orbit.mock.ts +33 -0
  49. package/src/mocks/user.mock.ts +67 -0
  50. package/src/styles/component-sample.scss +4 -0
  51. package/src/styles/index.scss +16 -0
  52. package/stories/sample-objects.stories.ts +47 -0
  53. package/tsconfig.json +36 -0
  54. package/vite.config.ts +44 -0
package/dist/index.js ADDED
@@ -0,0 +1,1213 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2019 Google LLC
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */
6
+ const H = globalThis, Y = H.ShadowRoot && (H.ShadyCSS === void 0 || H.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, tt = Symbol(), lt = /* @__PURE__ */ new WeakMap();
7
+ let Ct = class {
8
+ constructor(t, e, r) {
9
+ if (this._$cssResult$ = !0, r !== tt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
10
+ this.cssText = t, this.t = e;
11
+ }
12
+ get styleSheet() {
13
+ let t = this.o;
14
+ const e = this.t;
15
+ if (Y && t === void 0) {
16
+ const r = e !== void 0 && e.length === 1;
17
+ r && (t = lt.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), r && lt.set(e, t));
18
+ }
19
+ return t;
20
+ }
21
+ toString() {
22
+ return this.cssText;
23
+ }
24
+ };
25
+ const et = (s) => new Ct(typeof s == "string" ? s : s + "", void 0, tt), st = (s, ...t) => {
26
+ const e = s.length === 1 ? s[0] : t.reduce((r, i, o) => r + ((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
+ })(i) + s[o + 1], s[0]);
31
+ return new Ct(e, s, tt);
32
+ }, Wt = (s, t) => {
33
+ if (Y) s.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
34
+ else for (const e of t) {
35
+ const r = document.createElement("style"), i = H.litNonce;
36
+ i !== void 0 && r.setAttribute("nonce", i), r.textContent = e.cssText, s.appendChild(r);
37
+ }
38
+ }, ct = Y ? (s) => s : (s) => s instanceof CSSStyleSheet ? ((t) => {
39
+ let e = "";
40
+ for (const r of t.cssRules) e += r.cssText;
41
+ return et(e);
42
+ })(s) : s;
43
+ /**
44
+ * @license
45
+ * Copyright 2017 Google LLC
46
+ * SPDX-License-Identifier: BSD-3-Clause
47
+ */
48
+ const { is: Bt, defineProperty: Ft, getOwnPropertyDescriptor: Kt, getOwnPropertyNames: Xt, getOwnPropertySymbols: Jt, getPrototypeOf: Zt } = Object, W = globalThis, ut = W.trustedTypes, Gt = ut ? ut.emptyScript : "", Qt = W.reactiveElementPolyfillSupport, T = (s, t) => s, D = { toAttribute(s, t) {
49
+ switch (t) {
50
+ case Boolean:
51
+ s = s ? Gt : null;
52
+ break;
53
+ case Object:
54
+ case Array:
55
+ s = s == null ? s : JSON.stringify(s);
56
+ }
57
+ return s;
58
+ }, fromAttribute(s, t) {
59
+ let e = s;
60
+ switch (t) {
61
+ case Boolean:
62
+ e = s !== null;
63
+ break;
64
+ case Number:
65
+ e = s === null ? null : Number(s);
66
+ break;
67
+ case Object:
68
+ case Array:
69
+ try {
70
+ e = JSON.parse(s);
71
+ } catch {
72
+ e = null;
73
+ }
74
+ }
75
+ return e;
76
+ } }, B = (s, t) => !Bt(s, t), dt = { attribute: !0, type: String, converter: D, reflect: !1, useDefault: !1, hasChanged: B };
77
+ Symbol.metadata ??= Symbol("metadata"), W.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
78
+ let E = 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, e = dt) {
86
+ if (e.state && (e.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((e = Object.create(e)).wrapped = !0), this.elementProperties.set(t, e), !e.noAccessor) {
87
+ const r = Symbol(), i = this.getPropertyDescriptor(t, r, e);
88
+ i !== void 0 && Ft(this.prototype, t, i);
89
+ }
90
+ }
91
+ static getPropertyDescriptor(t, e, r) {
92
+ const { get: i, set: o } = Kt(this.prototype, t) ?? { get() {
93
+ return this[e];
94
+ }, set(n) {
95
+ this[e] = n;
96
+ } };
97
+ return { get: i, set(n) {
98
+ const h = i?.call(this);
99
+ o?.call(this, n), this.requestUpdate(t, h, r);
100
+ }, configurable: !0, enumerable: !0 };
101
+ }
102
+ static getPropertyOptions(t) {
103
+ return this.elementProperties.get(t) ?? dt;
104
+ }
105
+ static _$Ei() {
106
+ if (this.hasOwnProperty(T("elementProperties"))) return;
107
+ const t = Zt(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(T("finalized"))) return;
112
+ if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(T("properties"))) {
113
+ const e = this.properties, r = [...Xt(e), ...Jt(e)];
114
+ for (const i of r) this.createProperty(i, e[i]);
115
+ }
116
+ const t = this[Symbol.metadata];
117
+ if (t !== null) {
118
+ const e = litPropertyMetadata.get(t);
119
+ if (e !== void 0) for (const [r, i] of e) this.elementProperties.set(r, i);
120
+ }
121
+ this._$Eh = /* @__PURE__ */ new Map();
122
+ for (const [e, r] of this.elementProperties) {
123
+ const i = this._$Eu(e, r);
124
+ i !== void 0 && this._$Eh.set(i, e);
125
+ }
126
+ this.elementStyles = this.finalizeStyles(this.styles);
127
+ }
128
+ static finalizeStyles(t) {
129
+ const e = [];
130
+ if (Array.isArray(t)) {
131
+ const r = new Set(t.flat(1 / 0).reverse());
132
+ for (const i of r) e.unshift(ct(i));
133
+ } else t !== void 0 && e.push(ct(t));
134
+ return e;
135
+ }
136
+ static _$Eu(t, e) {
137
+ const r = e.attribute;
138
+ return r === !1 ? void 0 : typeof r == "string" ? r : 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(), e = this.constructor.elementProperties;
154
+ for (const r of e.keys()) this.hasOwnProperty(r) && (t.set(r, this[r]), delete this[r]);
155
+ t.size > 0 && (this._$Ep = t);
156
+ }
157
+ createRenderRoot() {
158
+ const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
159
+ return Wt(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, e, r) {
170
+ this._$AK(t, r);
171
+ }
172
+ _$ET(t, e) {
173
+ const r = this.constructor.elementProperties.get(t), i = this.constructor._$Eu(t, r);
174
+ if (i !== void 0 && r.reflect === !0) {
175
+ const o = (r.converter?.toAttribute !== void 0 ? r.converter : D).toAttribute(e, r.type);
176
+ this._$Em = t, o == null ? this.removeAttribute(i) : this.setAttribute(i, o), this._$Em = null;
177
+ }
178
+ }
179
+ _$AK(t, e) {
180
+ const r = this.constructor, i = r._$Eh.get(t);
181
+ if (i !== void 0 && this._$Em !== i) {
182
+ const o = r.getPropertyOptions(i), n = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute !== void 0 ? o.converter : D;
183
+ this._$Em = i, this[i] = n.fromAttribute(e, o.type) ?? this._$Ej?.get(i) ?? null, this._$Em = null;
184
+ }
185
+ }
186
+ requestUpdate(t, e, r) {
187
+ if (t !== void 0) {
188
+ const i = this.constructor, o = this[t];
189
+ if (r ??= i.getPropertyOptions(t), !((r.hasChanged ?? B)(o, e) || r.useDefault && r.reflect && o === this._$Ej?.get(t) && !this.hasAttribute(i._$Eu(t, r)))) return;
190
+ this.C(t, e, r);
191
+ }
192
+ this.isUpdatePending === !1 && (this._$ES = this._$EP());
193
+ }
194
+ C(t, e, { useDefault: r, reflect: i, wrapped: o }, n) {
195
+ r && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, n ?? e ?? this[t]), o !== !0 || n !== void 0) || (this._$AL.has(t) || (this.hasUpdated || r || (e = void 0), this._$AL.set(t, e)), i === !0 && this._$Em !== t && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t));
196
+ }
197
+ async _$EP() {
198
+ this.isUpdatePending = !0;
199
+ try {
200
+ await this._$ES;
201
+ } catch (e) {
202
+ Promise.reject(e);
203
+ }
204
+ const t = this.scheduleUpdate();
205
+ return t != null && await t, !this.isUpdatePending;
206
+ }
207
+ scheduleUpdate() {
208
+ return this.performUpdate();
209
+ }
210
+ performUpdate() {
211
+ if (!this.isUpdatePending) return;
212
+ if (!this.hasUpdated) {
213
+ if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
214
+ for (const [i, o] of this._$Ep) this[i] = o;
215
+ this._$Ep = void 0;
216
+ }
217
+ const r = this.constructor.elementProperties;
218
+ if (r.size > 0) for (const [i, o] of r) {
219
+ const { wrapped: n } = o, h = this[i];
220
+ n !== !0 || this._$AL.has(i) || h === void 0 || this.C(i, void 0, o, h);
221
+ }
222
+ }
223
+ let t = !1;
224
+ const e = this._$AL;
225
+ try {
226
+ t = this.shouldUpdate(e), t ? (this.willUpdate(e), this._$EO?.forEach((r) => r.hostUpdate?.()), this.update(e)) : this._$EM();
227
+ } catch (r) {
228
+ throw t = !1, this._$EM(), r;
229
+ }
230
+ t && this._$AE(e);
231
+ }
232
+ willUpdate(t) {
233
+ }
234
+ _$AE(t) {
235
+ this._$EO?.forEach((e) => e.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
236
+ }
237
+ _$EM() {
238
+ this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
239
+ }
240
+ get updateComplete() {
241
+ return this.getUpdateComplete();
242
+ }
243
+ getUpdateComplete() {
244
+ return this._$ES;
245
+ }
246
+ shouldUpdate(t) {
247
+ return !0;
248
+ }
249
+ update(t) {
250
+ this._$Eq &&= this._$Eq.forEach((e) => this._$ET(e, this[e])), this._$EM();
251
+ }
252
+ updated(t) {
253
+ }
254
+ firstUpdated(t) {
255
+ }
256
+ };
257
+ E.elementStyles = [], E.shadowRootOptions = { mode: "open" }, E[T("elementProperties")] = /* @__PURE__ */ new Map(), E[T("finalized")] = /* @__PURE__ */ new Map(), Qt?.({ ReactiveElement: E }), (W.reactiveElementVersions ??= []).push("2.1.0");
258
+ /**
259
+ * @license
260
+ * Copyright 2017 Google LLC
261
+ * SPDX-License-Identifier: BSD-3-Clause
262
+ */
263
+ const it = globalThis, q = it.trustedTypes, pt = q ? q.createPolicy("lit-html", { createHTML: (s) => s }) : void 0, Rt = "$lit$", y = `lit$${Math.random().toFixed(9).slice(2)}$`, Tt = "?" + y, Yt = `<${Tt}>`, w = document, x = () => w.createComment(""), O = (s) => s === null || typeof s != "object" && typeof s != "function", rt = Array.isArray, te = (s) => rt(s) || typeof s?.[Symbol.iterator] == "function", K = `[
264
+ \f\r]`, R = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ft = /-->/g, _t = />/g, b = RegExp(`>|${K}(?:([^\\s"'>=/]+)(${K}*=${K}*(?:[^
265
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), $t = /'/g, gt = /"/g, xt = /^(?:script|style|textarea|title)$/i, ee = (s) => (t, ...e) => ({ _$litType$: s, strings: t, values: e }), j = ee(1), P = Symbol.for("lit-noChange"), c = Symbol.for("lit-nothing"), yt = /* @__PURE__ */ new WeakMap(), A = w.createTreeWalker(w, 129);
266
+ function Ot(s, t) {
267
+ if (!rt(s) || !s.hasOwnProperty("raw")) throw Error("invalid template strings array");
268
+ return pt !== void 0 ? pt.createHTML(t) : t;
269
+ }
270
+ const se = (s, t) => {
271
+ const e = s.length - 1, r = [];
272
+ let i, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", n = R;
273
+ for (let h = 0; h < e; h++) {
274
+ const a = s[h];
275
+ let l, d, u = -1, f = 0;
276
+ for (; f < a.length && (n.lastIndex = f, d = n.exec(a), d !== null); ) f = n.lastIndex, n === R ? d[1] === "!--" ? n = ft : d[1] !== void 0 ? n = _t : d[2] !== void 0 ? (xt.test(d[2]) && (i = RegExp("</" + d[2], "g")), n = b) : d[3] !== void 0 && (n = b) : n === b ? d[0] === ">" ? (n = i ?? R, u = -1) : d[1] === void 0 ? u = -2 : (u = n.lastIndex - d[2].length, l = d[1], n = d[3] === void 0 ? b : d[3] === '"' ? gt : $t) : n === gt || n === $t ? n = b : n === ft || n === _t ? n = R : (n = b, i = void 0);
277
+ const g = n === b && s[h + 1].startsWith("/>") ? " " : "";
278
+ o += n === R ? a + Yt : u >= 0 ? (r.push(l), a.slice(0, u) + Rt + a.slice(u) + y + g) : a + y + (u === -2 ? h : g);
279
+ }
280
+ return [Ot(s, o + (s[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), r];
281
+ };
282
+ class L {
283
+ constructor({ strings: t, _$litType$: e }, r) {
284
+ let i;
285
+ this.parts = [];
286
+ let o = 0, n = 0;
287
+ const h = t.length - 1, a = this.parts, [l, d] = se(t, e);
288
+ if (this.el = L.createElement(l, r), A.currentNode = this.el.content, e === 2 || e === 3) {
289
+ const u = this.el.content.firstChild;
290
+ u.replaceWith(...u.childNodes);
291
+ }
292
+ for (; (i = A.nextNode()) !== null && a.length < h; ) {
293
+ if (i.nodeType === 1) {
294
+ if (i.hasAttributes()) for (const u of i.getAttributeNames()) if (u.endsWith(Rt)) {
295
+ const f = d[n++], g = i.getAttribute(u).split(y), M = /([.?@])?(.*)/.exec(f);
296
+ a.push({ type: 1, index: o, name: M[2], strings: g, ctor: M[1] === "." ? re : M[1] === "?" ? oe : M[1] === "@" ? ne : F }), i.removeAttribute(u);
297
+ } else u.startsWith(y) && (a.push({ type: 6, index: o }), i.removeAttribute(u));
298
+ if (xt.test(i.tagName)) {
299
+ const u = i.textContent.split(y), f = u.length - 1;
300
+ if (f > 0) {
301
+ i.textContent = q ? q.emptyScript : "";
302
+ for (let g = 0; g < f; g++) i.append(u[g], x()), A.nextNode(), a.push({ type: 2, index: ++o });
303
+ i.append(u[f], x());
304
+ }
305
+ }
306
+ } else if (i.nodeType === 8) if (i.data === Tt) a.push({ type: 2, index: o });
307
+ else {
308
+ let u = -1;
309
+ for (; (u = i.data.indexOf(y, u + 1)) !== -1; ) a.push({ type: 7, index: o }), u += y.length - 1;
310
+ }
311
+ o++;
312
+ }
313
+ }
314
+ static createElement(t, e) {
315
+ const r = w.createElement("template");
316
+ return r.innerHTML = t, r;
317
+ }
318
+ }
319
+ function C(s, t, e = s, r) {
320
+ if (t === P) return t;
321
+ let i = r !== void 0 ? e._$Co?.[r] : e._$Cl;
322
+ const o = O(t) ? void 0 : t._$litDirective$;
323
+ return i?.constructor !== o && (i?._$AO?.(!1), o === void 0 ? i = void 0 : (i = new o(s), i._$AT(s, e, r)), r !== void 0 ? (e._$Co ??= [])[r] = i : e._$Cl = i), i !== void 0 && (t = C(s, i._$AS(s, t.values), i, r)), t;
324
+ }
325
+ class ie {
326
+ constructor(t, e) {
327
+ this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
328
+ }
329
+ get parentNode() {
330
+ return this._$AM.parentNode;
331
+ }
332
+ get _$AU() {
333
+ return this._$AM._$AU;
334
+ }
335
+ u(t) {
336
+ const { el: { content: e }, parts: r } = this._$AD, i = (t?.creationScope ?? w).importNode(e, !0);
337
+ A.currentNode = i;
338
+ let o = A.nextNode(), n = 0, h = 0, a = r[0];
339
+ for (; a !== void 0; ) {
340
+ if (n === a.index) {
341
+ let l;
342
+ a.type === 2 ? l = new U(o, o.nextSibling, this, t) : a.type === 1 ? l = new a.ctor(o, a.name, a.strings, this, t) : a.type === 6 && (l = new ae(o, this, t)), this._$AV.push(l), a = r[++h];
343
+ }
344
+ n !== a?.index && (o = A.nextNode(), n++);
345
+ }
346
+ return A.currentNode = w, i;
347
+ }
348
+ p(t) {
349
+ let e = 0;
350
+ for (const r of this._$AV) r !== void 0 && (r.strings !== void 0 ? (r._$AI(t, r, e), e += r.strings.length - 2) : r._$AI(t[e])), e++;
351
+ }
352
+ }
353
+ class U {
354
+ get _$AU() {
355
+ return this._$AM?._$AU ?? this._$Cv;
356
+ }
357
+ constructor(t, e, r, i) {
358
+ this.type = 2, this._$AH = c, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = r, this.options = i, this._$Cv = i?.isConnected ?? !0;
359
+ }
360
+ get parentNode() {
361
+ let t = this._$AA.parentNode;
362
+ const e = this._$AM;
363
+ return e !== void 0 && t?.nodeType === 11 && (t = e.parentNode), t;
364
+ }
365
+ get startNode() {
366
+ return this._$AA;
367
+ }
368
+ get endNode() {
369
+ return this._$AB;
370
+ }
371
+ _$AI(t, e = this) {
372
+ t = C(this, t, e), O(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) : te(t) ? this.k(t) : this._(t);
373
+ }
374
+ O(t) {
375
+ return this._$AA.parentNode.insertBefore(t, this._$AB);
376
+ }
377
+ T(t) {
378
+ this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
379
+ }
380
+ _(t) {
381
+ this._$AH !== c && O(this._$AH) ? this._$AA.nextSibling.data = t : this.T(w.createTextNode(t)), this._$AH = t;
382
+ }
383
+ $(t) {
384
+ const { values: e, _$litType$: r } = t, i = typeof r == "number" ? this._$AC(t) : (r.el === void 0 && (r.el = L.createElement(Ot(r.h, r.h[0]), this.options)), r);
385
+ if (this._$AH?._$AD === i) this._$AH.p(e);
386
+ else {
387
+ const o = new ie(i, this), n = o.u(this.options);
388
+ o.p(e), this.T(n), this._$AH = o;
389
+ }
390
+ }
391
+ _$AC(t) {
392
+ let e = yt.get(t.strings);
393
+ return e === void 0 && yt.set(t.strings, e = new L(t)), e;
394
+ }
395
+ k(t) {
396
+ rt(this._$AH) || (this._$AH = [], this._$AR());
397
+ const e = this._$AH;
398
+ let r, i = 0;
399
+ for (const o of t) i === e.length ? e.push(r = new U(this.O(x()), this.O(x()), this, this.options)) : r = e[i], r._$AI(o), i++;
400
+ i < e.length && (this._$AR(r && r._$AB.nextSibling, i), e.length = i);
401
+ }
402
+ _$AR(t = this._$AA.nextSibling, e) {
403
+ for (this._$AP?.(!1, !0, e); t && t !== this._$AB; ) {
404
+ const r = t.nextSibling;
405
+ t.remove(), t = r;
406
+ }
407
+ }
408
+ setConnected(t) {
409
+ this._$AM === void 0 && (this._$Cv = t, this._$AP?.(t));
410
+ }
411
+ }
412
+ class F {
413
+ get tagName() {
414
+ return this.element.tagName;
415
+ }
416
+ get _$AU() {
417
+ return this._$AM._$AU;
418
+ }
419
+ constructor(t, e, r, i, o) {
420
+ this.type = 1, this._$AH = c, this._$AN = void 0, this.element = t, this.name = e, 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;
421
+ }
422
+ _$AI(t, e = this, r, i) {
423
+ const o = this.strings;
424
+ let n = !1;
425
+ if (o === void 0) t = C(this, t, e, 0), n = !O(t) || t !== this._$AH && t !== P, n && (this._$AH = t);
426
+ else {
427
+ const h = t;
428
+ let a, l;
429
+ for (t = o[0], a = 0; a < o.length - 1; a++) l = C(this, h[r + a], e, a), l === P && (l = this._$AH[a]), n ||= !O(l) || l !== this._$AH[a], l === c ? t = c : t !== c && (t += (l ?? "") + o[a + 1]), this._$AH[a] = l;
430
+ }
431
+ n && !i && this.j(t);
432
+ }
433
+ j(t) {
434
+ t === c ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
435
+ }
436
+ }
437
+ class re extends F {
438
+ constructor() {
439
+ super(...arguments), this.type = 3;
440
+ }
441
+ j(t) {
442
+ this.element[this.name] = t === c ? void 0 : t;
443
+ }
444
+ }
445
+ class oe extends F {
446
+ constructor() {
447
+ super(...arguments), this.type = 4;
448
+ }
449
+ j(t) {
450
+ this.element.toggleAttribute(this.name, !!t && t !== c);
451
+ }
452
+ }
453
+ class ne extends F {
454
+ constructor(t, e, r, i, o) {
455
+ super(t, e, r, i, o), this.type = 5;
456
+ }
457
+ _$AI(t, e = this) {
458
+ if ((t = C(this, t, e, 0) ?? c) === P) return;
459
+ const r = this._$AH, i = t === c && r !== c || t.capture !== r.capture || t.once !== r.once || t.passive !== r.passive, o = t !== c && (r === c || i);
460
+ i && this.element.removeEventListener(this.name, this, r), o && this.element.addEventListener(this.name, this, t), this._$AH = t;
461
+ }
462
+ handleEvent(t) {
463
+ typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
464
+ }
465
+ }
466
+ class ae {
467
+ constructor(t, e, r) {
468
+ this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = r;
469
+ }
470
+ get _$AU() {
471
+ return this._$AM._$AU;
472
+ }
473
+ _$AI(t) {
474
+ C(this, t);
475
+ }
476
+ }
477
+ const he = it.litHtmlPolyfillSupport;
478
+ he?.(L, U), (it.litHtmlVersions ??= []).push("3.3.0");
479
+ const le = (s, t, e) => {
480
+ const r = e?.renderBefore ?? t;
481
+ let i = r._$litPart$;
482
+ if (i === void 0) {
483
+ const o = e?.renderBefore ?? null;
484
+ r._$litPart$ = i = new U(t.insertBefore(x(), o), o, void 0, e ?? {});
485
+ }
486
+ return i._$AI(s), i;
487
+ };
488
+ /**
489
+ * @license
490
+ * Copyright 2017 Google LLC
491
+ * SPDX-License-Identifier: BSD-3-Clause
492
+ */
493
+ const ot = globalThis;
494
+ let S = class extends E {
495
+ constructor() {
496
+ super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
497
+ }
498
+ createRenderRoot() {
499
+ const t = super.createRenderRoot();
500
+ return this.renderOptions.renderBefore ??= t.firstChild, t;
501
+ }
502
+ update(t) {
503
+ const e = this.render();
504
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = le(e, this.renderRoot, this.renderOptions);
505
+ }
506
+ connectedCallback() {
507
+ super.connectedCallback(), this._$Do?.setConnected(!0);
508
+ }
509
+ disconnectedCallback() {
510
+ super.disconnectedCallback(), this._$Do?.setConnected(!1);
511
+ }
512
+ render() {
513
+ return P;
514
+ }
515
+ };
516
+ S._$litElement$ = !0, S.finalized = !0, ot.litElementHydrateSupport?.({ LitElement: S });
517
+ const ce = ot.litElementPolyfillSupport;
518
+ ce?.({ LitElement: S });
519
+ (ot.litElementVersions ??= []).push("4.2.0");
520
+ /**
521
+ * @license
522
+ * Copyright 2017 Google LLC
523
+ * SPDX-License-Identifier: BSD-3-Clause
524
+ */
525
+ const nt = (s) => (t, e) => {
526
+ e !== void 0 ? e.addInitializer(() => {
527
+ customElements.define(s, t);
528
+ }) : customElements.define(s, t);
529
+ };
530
+ /**
531
+ * @license
532
+ * Copyright 2017 Google LLC
533
+ * SPDX-License-Identifier: BSD-3-Clause
534
+ */
535
+ const ue = { attribute: !0, type: String, converter: D, reflect: !1, hasChanged: B }, de = (s = ue, t, e) => {
536
+ const { kind: r, metadata: i } = e;
537
+ let o = globalThis.litPropertyMetadata.get(i);
538
+ if (o === void 0 && globalThis.litPropertyMetadata.set(i, o = /* @__PURE__ */ new Map()), r === "setter" && ((s = Object.create(s)).wrapped = !0), o.set(e.name, s), r === "accessor") {
539
+ const { name: n } = e;
540
+ return { set(h) {
541
+ const a = t.get.call(this);
542
+ t.set.call(this, h), this.requestUpdate(n, a, s);
543
+ }, init(h) {
544
+ return h !== void 0 && this.C(n, void 0, s, h), h;
545
+ } };
546
+ }
547
+ if (r === "setter") {
548
+ const { name: n } = e;
549
+ return function(h) {
550
+ const a = this[n];
551
+ t.call(this, h), this.requestUpdate(n, a, s);
552
+ };
553
+ }
554
+ throw Error("Unsupported decorator location: " + r);
555
+ };
556
+ function p(s) {
557
+ return (t, e) => typeof e == "object" ? de(s, t, e) : ((r, i, o) => {
558
+ const n = i.hasOwnProperty(o);
559
+ return i.constructor.createProperty(o, r), n ? Object.getOwnPropertyDescriptor(i, o) : void 0;
560
+ })(s, t, e);
561
+ }
562
+ /**
563
+ * @license
564
+ * Copyright 2017 Google LLC
565
+ * SPDX-License-Identifier: BSD-3-Clause
566
+ */
567
+ function jt(s) {
568
+ return p({ ...s, state: !0, attribute: !1 });
569
+ }
570
+ /**
571
+ * @license
572
+ * Copyright 2017 Google LLC
573
+ * SPDX-License-Identifier: BSD-3-Clause
574
+ */
575
+ const pe = Symbol();
576
+ class fe {
577
+ get taskComplete() {
578
+ return this.t || (this.i === 1 ? this.t = new Promise((t, e) => {
579
+ this.o = t, this.h = e;
580
+ }) : this.i === 3 ? this.t = Promise.reject(this.l) : this.t = Promise.resolve(this.u)), this.t;
581
+ }
582
+ constructor(t, e, r) {
583
+ this.p = 0, this.i = 0, (this._ = t).addController(this);
584
+ const i = typeof e == "object" ? e : { task: e, args: r };
585
+ this.v = i.task, this.j = i.args, this.m = i.argsEqual ?? _e, 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?.());
586
+ }
587
+ hostUpdate() {
588
+ this.autoRun === !0 && this.S();
589
+ }
590
+ hostUpdated() {
591
+ this.autoRun === "afterUpdate" && this.S();
592
+ }
593
+ T() {
594
+ if (this.j === void 0) return;
595
+ const t = this.j();
596
+ if (!Array.isArray(t)) throw Error("The args function must return an array");
597
+ return t;
598
+ }
599
+ async S() {
600
+ const t = this.T(), e = this.O;
601
+ this.O = t, t === e || t === void 0 || e !== void 0 && this.m(e, t) || await this.run(t);
602
+ }
603
+ async run(t) {
604
+ let e, r;
605
+ 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();
606
+ const i = ++this.p;
607
+ this.q = new AbortController();
608
+ let o = !1;
609
+ try {
610
+ e = await this.v(t, { signal: this.q.signal });
611
+ } catch (n) {
612
+ o = !0, r = n;
613
+ }
614
+ if (this.p === i) {
615
+ if (e === pe) this.i = 0;
616
+ else {
617
+ if (o === !1) {
618
+ try {
619
+ this.k?.(e);
620
+ } catch {
621
+ }
622
+ this.i = 2, this.o?.(e);
623
+ } else {
624
+ try {
625
+ this.A?.(r);
626
+ } catch {
627
+ }
628
+ this.i = 3, this.h?.(r);
629
+ }
630
+ this.u = e, this.l = r;
631
+ }
632
+ this._.requestUpdate();
633
+ }
634
+ }
635
+ abort(t) {
636
+ this.i === 1 && this.q?.abort(t);
637
+ }
638
+ get value() {
639
+ return this.u;
640
+ }
641
+ get error() {
642
+ return this.l;
643
+ }
644
+ get status() {
645
+ return this.i;
646
+ }
647
+ render(t) {
648
+ switch (this.i) {
649
+ case 0:
650
+ return t.initial?.();
651
+ case 1:
652
+ return t.pending?.();
653
+ case 2:
654
+ return t.complete?.(this.value);
655
+ case 3:
656
+ return t.error?.(this.error);
657
+ default:
658
+ throw Error("Unexpected status: " + this.i);
659
+ }
660
+ }
661
+ }
662
+ const _e = (s, t) => s === t || s.length === t.length && s.every((e, r) => !B(e, t[r]));
663
+ !window.orbit && !"/".includes("cypress") && await new Promise((s) => {
664
+ document.addEventListener("orbit-ready", () => {
665
+ s(!0);
666
+ });
667
+ });
668
+ const Lt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
669
+ __proto__: null
670
+ }, Symbol.toStringTag, { value: "Module" }));
671
+ var $e = Object.defineProperty, ge = (s, t, e, r) => {
672
+ for (var i = void 0, o = s.length - 1, n; o >= 0; o--)
673
+ (n = s[o]) && (i = n(t, e, i) || i);
674
+ return i && $e(t, e, i), i;
675
+ };
676
+ const ye = Object.values(Lt);
677
+ class at extends S {
678
+ constructor() {
679
+ super(...arguments), this.objects = [], this.hasType = (t, e = this.objects) => new Set(e.flatMap((i) => i["@type"])).has(t);
680
+ }
681
+ renderTemplateWhenWith(t, e, r = this.objects) {
682
+ const i = (n, h) => Array.isArray(n) ? n.some((a) => h(a)) : h(n);
683
+ return t.filter(
684
+ (n) => i(n, (h) => ye.includes(h))
685
+ ).every(
686
+ (n) => i(n, (h) => this.hasType(h, r))
687
+ ) ? e.call(this) : c;
688
+ }
689
+ }
690
+ ge([
691
+ p({ attribute: !1 })
692
+ ], at.prototype, "objects");
693
+ var ve = Object.defineProperty, v = (s, t, e, r) => {
694
+ for (var i = void 0, o = s.length - 1, n; o >= 0; o--)
695
+ (n = s[o]) && (i = n(t, e, i) || i);
696
+ return i && ve(t, e, i), i;
697
+ };
698
+ class $ extends at {
699
+ constructor({
700
+ defaultRoute: t = !1,
701
+ setupSubscriptions: e = !0,
702
+ ignoreRouter: r = !1
703
+ } = {}) {
704
+ super(), this.cherryPickedProperties = [], this.currentRoute = "";
705
+ const i = () => {
706
+ this._attach(t, e, r).then(
707
+ (o) => {
708
+ o && this.requestUpdate();
709
+ }
710
+ );
711
+ };
712
+ document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", i) : i();
713
+ }
714
+ async _attach(t, e, r) {
715
+ return !this.orbit && window.orbit && (this.orbit = window.orbit, e) ? (Ae({
716
+ component: this,
717
+ defaultRoute: t,
718
+ ignoreRouter: r
719
+ }), 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);
720
+ }
721
+ async _afterAttach() {
722
+ return Promise.resolve();
723
+ }
724
+ _navigate(t) {
725
+ window.sibRouter.previousRoute = this.currentRoute, window.sibRouter.previousResource = window.sibRouter.currentResource;
726
+ const e = t.target?.closest("[navigation-target]");
727
+ let r = e.getAttribute("navigation-target");
728
+ const i = e.getAttribute("navigation-subrouter"), o = e.getAttribute("navigation-resource"), n = e.getAttribute("navigation-rdf-type");
729
+ if (n) {
730
+ const h = window.orbit?.components?.filter(
731
+ (a) => a?.routeAttributes?.["rdf-type"] === n
732
+ );
733
+ h && (r = h[0]?.uniq);
734
+ }
735
+ r && Se(
736
+ (window.orbit ? window.orbit.getRoute(r, !0) : r) + (i ? `-${i}` : ""),
737
+ o
738
+ ), t.preventDefault();
739
+ }
740
+ _normalizeLdpContains(t) {
741
+ return !Array.isArray(t) && t !== null ? [t] : t;
742
+ }
743
+ async _expandContainer(t, e = !0) {
744
+ const r = [];
745
+ for (const i of t) {
746
+ const o = await this._getProxyValue(i, e);
747
+ o && r.push(o);
748
+ }
749
+ return r;
750
+ }
751
+ async _getProperties(t, e = !0, r = this.cherryPickedProperties) {
752
+ const i = await t.properties, o = {
753
+ "@id": t["@id"],
754
+ "@type": t["@type"],
755
+ "@context": t.serverContext,
756
+ _originalResource: t
757
+ };
758
+ for (const n of r)
759
+ i?.includes(n.key) && (o[n.value] = await t.get(n.key), n.expand && (o[n.value] = await this._getProxyValue(
760
+ o[n.value],
761
+ e,
762
+ r
763
+ )), n.cast && (o[n.value] = n.cast(o[n.value])));
764
+ return await this._responseAdaptator(o);
765
+ }
766
+ async _getProxyValue(t, e = !0, r = this.cherryPickedProperties) {
767
+ try {
768
+ if (t) {
769
+ let i = t;
770
+ if (typeof t == "string" && (i = await window.sibStore.getData(t, mt)), typeof t != "string" && t.isFullResource && (t.isFullResource?.() || (i = await window.sibStore.getData(
771
+ t["@id"],
772
+ mt
773
+ ))), typeof t != "string" && !t.isFullResource && (i.properties = Object.keys(i), i.get = (o) => i[o]), !i) return { _originalResource: i };
774
+ if (typeof i == "object" && i !== null) {
775
+ if (i["ldp:contains"]) {
776
+ const o = this._normalizeLdpContains(i["ldp:contains"]);
777
+ return await this._expandContainer(o, e);
778
+ }
779
+ return await this._getProperties(i, e, r);
780
+ }
781
+ }
782
+ return;
783
+ } catch {
784
+ }
785
+ }
786
+ async _responseAdaptator(t) {
787
+ return Promise.resolve(t);
788
+ }
789
+ gatekeeper() {
790
+ if (!this.orbit || !this.noRouter && this.route && this.currentRoute && !this.route.startsWith(this.currentRoute) || !this.dataSrc)
791
+ return c;
792
+ }
793
+ }
794
+ v([
795
+ p({ attribute: "default-data-src", reflect: !0 })
796
+ ], $.prototype, "defaultDataSrc");
797
+ v([
798
+ p({ attribute: "data-src", reflect: !0 })
799
+ ], $.prototype, "dataSrc");
800
+ v([
801
+ p({ attribute: "nested-field" })
802
+ ], $.prototype, "nestedField");
803
+ v([
804
+ p({ attribute: "uniq" })
805
+ ], $.prototype, "uniq");
806
+ v([
807
+ p({ attribute: "route" })
808
+ ], $.prototype, "route");
809
+ v([
810
+ p({ attribute: !1 })
811
+ ], $.prototype, "cherryPickedProperties");
812
+ v([
813
+ jt()
814
+ ], $.prototype, "orbit");
815
+ v([
816
+ jt()
817
+ ], $.prototype, "currentRoute");
818
+ const be = (s, { keywords: t = [], attributes: e = ["dataSrc"] } = {}) => {
819
+ t && e && (s.caching === void 0 && (s.caching = 0), s.hasCachedDatas === void 0 && (s.hasCachedDatas = !1), s.cacheListener = (r) => {
820
+ const i = r.detail.id || r.detail.resource["@id"];
821
+ if (t.some((o) => i?.includes(o))) {
822
+ for (const o of e)
823
+ s[o] && i !== s[o] && window.sibStore.clearCache(s[o]);
824
+ s.caching++, s.hasCachedDatas = !1, s.requestUpdate();
825
+ }
826
+ }, s._subscriptions.add(["save", s.cacheListener]), s._subscribe());
827
+ };
828
+ function me() {
829
+ return Math.random().toString(16).slice(2);
830
+ }
831
+ const Ae = ({
832
+ component: s,
833
+ defaultRoute: t = !1,
834
+ ignoreRouter: e = !1
835
+ }) => {
836
+ if (s.uniq || (s.uniq = me(), t && !s.route && !e && (s.route = t)), s._subscriptions = /* @__PURE__ */ new Set(), !e) {
837
+ s.route || (s.route = s.uniq, window.orbit && (s.route = window.orbit.getRoute(s.uniq))), s.noRouter = !0;
838
+ let r = document.querySelector("solid-router");
839
+ for (; r; )
840
+ s.noRouter = !1, s.currentRoute = r.currentRouteName, s.currentResource = window.sibRouter.currentResource, r = document.querySelector(
841
+ `[data-view="${r.currentRouteName}"] solid-router`
842
+ );
843
+ s.navigationListener = () => {
844
+ let i = document.querySelector("solid-router");
845
+ for (; i; )
846
+ s.noRouter = !1, s.currentRoute = i.currentRouteName, s.currentResource = window.sibRouter.currentResource, i = document.querySelector(
847
+ `[data-view="${i.currentRouteName}"] solid-router`
848
+ );
849
+ s.requestUpdate();
850
+ }, s._subscriptions.add(["navigate", s.navigationListener]);
851
+ }
852
+ s._subscribe = () => {
853
+ s._unsubscribe();
854
+ for (const r of s._subscriptions)
855
+ document.addEventListener(r[0], r[1]);
856
+ }, s._unsubscribe = () => {
857
+ for (const r of s._subscriptions)
858
+ document.removeEventListener(r[0], r[1]);
859
+ }, s._subscribe();
860
+ }, vt = Object.values(Lt);
861
+ class we extends S {
862
+ constructor() {
863
+ super(...arguments), this.object = {
864
+ "@id": ""
865
+ }, this.isType = (t, e = this.object) => {
866
+ const r = e["@type"];
867
+ return Array.isArray(r) ? r.includes(t) : typeof r == "string" ? r === t : !1;
868
+ };
869
+ }
870
+ getNestedProperty(t, e = this.object) {
871
+ return t.split(".").reduce((r, i) => {
872
+ if (r === void 0)
873
+ return;
874
+ const o = i.match(/(.*)\[(.*)\]/);
875
+ if (o) {
876
+ const n = o[1], h = o[2], a = r[n];
877
+ if (!Array.isArray(a))
878
+ return;
879
+ if (h === "")
880
+ return a.length > 0 ? a : void 0;
881
+ const l = Number.parseInt(h, 10);
882
+ return Number.isNaN(l) || l < 0 || l >= a.length ? void 0 : r[n][l];
883
+ }
884
+ return r && r[i] !== "undefined" ? r[i] : void 0;
885
+ }, e);
886
+ }
887
+ renderTemplateWhenWith(t, e, r = this.object) {
888
+ const i = (h, a) => Array.isArray(h) ? h.some((l) => a(l)) : a(h), o = t.filter(
889
+ (h) => i(h, (a) => vt.includes(a))
890
+ );
891
+ return t.filter(
892
+ (h) => i(h, (a) => !vt.includes(a))
893
+ ).every(
894
+ (h) => i(h, (a) => this.getNestedProperty(a, r))
895
+ ) && o.every(
896
+ (h) => i(h, (a) => this.isType(a, r))
897
+ ) ? e.call(this) : c;
898
+ }
899
+ }
900
+ const bt = (s, t) => {
901
+ let e = s;
902
+ for (let r = 0; r < t.length && (e && t[r] in e); r++)
903
+ e = e[t[r]];
904
+ return e;
905
+ }, Ee = (s, t, e = "asc") => s.sort((r, i) => {
906
+ let o = r, n = i;
907
+ Array.isArray(t) ? (o = bt(r, t), n = bt(i, t)) : (o = r[t], n = i[t]);
908
+ let h = 0;
909
+ if (typeof o == "number" && typeof n == "number")
910
+ h = o - n;
911
+ else if (typeof o == "string" && typeof n == "string")
912
+ h = o.localeCompare(n);
913
+ else if (o instanceof Date && n instanceof Date)
914
+ h = o.getTime() - n.getTime();
915
+ else
916
+ throw new TypeError(`Unsupported data type for key "${t}"`);
917
+ return e === "asc" ? h : -h;
918
+ }), Se = (s, t = !1) => {
919
+ window.dispatchEvent(
920
+ new CustomEvent("requestNavigation", {
921
+ detail: {
922
+ route: s,
923
+ resource: typeof t == "string" ? { "@id": t } : t
924
+ }
925
+ })
926
+ );
927
+ }, mt = {};
928
+ var Pe = Object.getOwnPropertyDescriptor, Ce = (s, t, e, r) => {
929
+ for (var i = r > 1 ? void 0 : r ? Pe(t, e) : t, o = s.length - 1, n; o >= 0; o--)
930
+ (n = s[o]) && (i = n(i) || i);
931
+ return i;
932
+ };
933
+ let Z = class extends $ {
934
+ constructor() {
935
+ super(...arguments), this.cherryPickedProperties = [
936
+ { key: "name", value: "name" }
937
+ ], this._getResource = new fe(this, {
938
+ task: async ([s]) => {
939
+ if (!(!s || !this.orbit || !this.noRouter && this.route && this.currentRoute && !this.route.startsWith(this.currentRoute))) {
940
+ if (!this.hasCachedDatas || this.oldDataSrc !== s) {
941
+ if (!s) return;
942
+ this.datas = await this._getProxyValue(s), this.hasCachedDatas = !0;
943
+ }
944
+ return this.oldDataSrc !== s && (this.oldDataSrc = s), Ee(this.datas, "name", "asc");
945
+ }
946
+ },
947
+ args: () => [this.dataSrc, this.caching, this.currentRoute]
948
+ });
949
+ }
950
+ async _afterAttach() {
951
+ return be(this, {
952
+ keywords: ["some-keyword", "for-invalidating", "cache"]
953
+ }), Promise.resolve();
954
+ }
955
+ render() {
956
+ return this.gatekeeper() || this._getResource.render({
957
+ pending: () => j`<solid-loader></solid-loader>`,
958
+ complete: (s) => s ? j`<div>
959
+ <sample-objects .objects=${s}></sample-objects>
960
+ </div>` : c
961
+ });
962
+ }
963
+ };
964
+ Z.styles = st`
965
+ div {
966
+ background-color: red;
967
+ position: absolute;
968
+ top: 0;
969
+ left: 0;
970
+ right: 0;
971
+ bottom: 0;
972
+ }
973
+ `;
974
+ Z = Ce([
975
+ nt("solid-boilerplate")
976
+ ], Z);
977
+ /**
978
+ * @license
979
+ * Copyright 2021 Google LLC
980
+ * SPDX-License-Identifier: BSD-3-Clause
981
+ */
982
+ const G = "lit-localize-status";
983
+ /**
984
+ * @license
985
+ * Copyright 2021 Google LLC
986
+ * SPDX-License-Identifier: BSD-3-Clause
987
+ */
988
+ const Re = (s, ...t) => ({
989
+ strTag: !0,
990
+ strings: s,
991
+ values: t
992
+ }), Te = Re, xe = (s) => typeof s != "string" && "strTag" in s, Ut = (s, t, e) => {
993
+ let r = s[0];
994
+ for (let i = 1; i < s.length; i++)
995
+ r += t[e ? e[i - 1] : i - 1], r += s[i];
996
+ return r;
997
+ };
998
+ /**
999
+ * @license
1000
+ * Copyright 2021 Google LLC
1001
+ * SPDX-License-Identifier: BSD-3-Clause
1002
+ */
1003
+ const Mt = (s) => xe(s) ? Ut(s.strings, s.values) : s;
1004
+ let ht = Mt, At = !1;
1005
+ function Oe(s) {
1006
+ if (At)
1007
+ throw new Error("lit-localize can only be configured once");
1008
+ ht = s, At = !0;
1009
+ }
1010
+ /**
1011
+ * @license
1012
+ * Copyright 2021 Google LLC
1013
+ * SPDX-License-Identifier: BSD-3-Clause
1014
+ */
1015
+ class je {
1016
+ constructor(t) {
1017
+ this.__litLocalizeEventHandler = (e) => {
1018
+ e.detail.status === "ready" && this.host.requestUpdate();
1019
+ }, this.host = t;
1020
+ }
1021
+ hostConnected() {
1022
+ window.addEventListener(G, this.__litLocalizeEventHandler);
1023
+ }
1024
+ hostDisconnected() {
1025
+ window.removeEventListener(G, this.__litLocalizeEventHandler);
1026
+ }
1027
+ }
1028
+ const Le = (s) => s.addController(new je(s)), Ue = Le;
1029
+ /**
1030
+ * @license
1031
+ * Copyright 2021 Google LLC
1032
+ * SPDX-License-Identifier: BSD-3-Clause
1033
+ */
1034
+ const Nt = () => (s, t) => (s.addInitializer(Ue), s);
1035
+ /**
1036
+ * @license
1037
+ * Copyright 2020 Google LLC
1038
+ * SPDX-License-Identifier: BSD-3-Clause
1039
+ */
1040
+ class Ht {
1041
+ constructor() {
1042
+ this.settled = !1, this.promise = new Promise((t, e) => {
1043
+ this._resolve = t, this._reject = e;
1044
+ });
1045
+ }
1046
+ resolve(t) {
1047
+ this.settled = !0, this._resolve(t);
1048
+ }
1049
+ reject(t) {
1050
+ this.settled = !0, this._reject(t);
1051
+ }
1052
+ }
1053
+ /**
1054
+ * @license
1055
+ * Copyright 2014 Travis Webb
1056
+ * SPDX-License-Identifier: MIT
1057
+ */
1058
+ const _ = [];
1059
+ for (let s = 0; s < 256; s++)
1060
+ _[s] = (s >> 4 & 15).toString(16) + (s & 15).toString(16);
1061
+ function Me(s) {
1062
+ let t = 0, e = 8997, r = 0, i = 33826, o = 0, n = 40164, h = 0, a = 52210;
1063
+ for (let l = 0; l < s.length; l++)
1064
+ e ^= s.charCodeAt(l), t = e * 435, r = i * 435, o = n * 435, h = a * 435, o += e << 8, h += i << 8, r += t >>> 16, e = t & 65535, o += r >>> 16, i = r & 65535, a = h + (o >>> 16) & 65535, n = o & 65535;
1065
+ return _[a >> 8] + _[a & 255] + _[n >> 8] + _[n & 255] + _[i >> 8] + _[i & 255] + _[e >> 8] + _[e & 255];
1066
+ }
1067
+ /**
1068
+ * @license
1069
+ * Copyright 2020 Google LLC
1070
+ * SPDX-License-Identifier: BSD-3-Clause
1071
+ */
1072
+ const Ne = "", He = "h", De = "s";
1073
+ function qe(s, t) {
1074
+ return (t ? He : De) + Me(typeof s == "string" ? s : s.join(Ne));
1075
+ }
1076
+ /**
1077
+ * @license
1078
+ * Copyright 2021 Google LLC
1079
+ * SPDX-License-Identifier: BSD-3-Clause
1080
+ */
1081
+ const wt = /* @__PURE__ */ new WeakMap(), Et = /* @__PURE__ */ new Map();
1082
+ function Ie(s, t, e) {
1083
+ if (s) {
1084
+ const r = e?.id ?? ke(t), i = s[r];
1085
+ if (i) {
1086
+ if (typeof i == "string")
1087
+ return i;
1088
+ if ("strTag" in i)
1089
+ return Ut(
1090
+ i.strings,
1091
+ // Cast `template` because its type wasn't automatically narrowed (but
1092
+ // we know it must be the same type as `localized`).
1093
+ t.values,
1094
+ i.values
1095
+ );
1096
+ {
1097
+ let o = wt.get(i);
1098
+ return o === void 0 && (o = i.values, wt.set(i, o)), {
1099
+ ...i,
1100
+ values: o.map((n) => t.values[n])
1101
+ };
1102
+ }
1103
+ }
1104
+ }
1105
+ return Mt(t);
1106
+ }
1107
+ function ke(s) {
1108
+ const t = typeof s == "string" ? s : s.strings;
1109
+ let e = Et.get(t);
1110
+ return e === void 0 && (e = qe(t, typeof s != "string" && !("strTag" in s)), Et.set(t, e)), e;
1111
+ }
1112
+ /**
1113
+ * @license
1114
+ * Copyright 2021 Google LLC
1115
+ * SPDX-License-Identifier: BSD-3-Clause
1116
+ */
1117
+ function X(s) {
1118
+ window.dispatchEvent(new CustomEvent(G, { detail: s }));
1119
+ }
1120
+ let I = "", J, Dt, k, Q, qt, m = new Ht();
1121
+ m.resolve();
1122
+ let N = 0;
1123
+ const ze = (s) => (Oe((t, e) => Ie(qt, t, e)), I = Dt = s.sourceLocale, k = new Set(s.targetLocales), k.add(s.sourceLocale), Q = s.loadLocale, { getLocale: Ve, setLocale: We }), Ve = () => I, We = (s) => {
1124
+ if (s === (J ?? I))
1125
+ return m.promise;
1126
+ if (!k || !Q)
1127
+ throw new Error("Internal error");
1128
+ if (!k.has(s))
1129
+ throw new Error("Invalid locale code");
1130
+ N++;
1131
+ const t = N;
1132
+ return J = s, m.settled && (m = new Ht()), X({ status: "loading", loadingLocale: s }), (s === Dt ? (
1133
+ // We could switch to the source locale synchronously, but we prefer to
1134
+ // queue it on a microtask so that switching locales is consistently
1135
+ // asynchronous.
1136
+ Promise.resolve({ templates: void 0 })
1137
+ ) : Q(s)).then((r) => {
1138
+ N === t && (I = s, J = void 0, qt = r.templates, X({ status: "ready", readyLocale: s }), m.resolve());
1139
+ }, (r) => {
1140
+ N === t && (X({
1141
+ status: "error",
1142
+ errorLocale: s,
1143
+ errorMessage: r.toString()
1144
+ }), m.reject(r));
1145
+ }), m.promise;
1146
+ }, It = ":host{background-color:pink;user-select:none}";
1147
+ var Be = Object.defineProperty, Fe = Object.getOwnPropertyDescriptor, kt = (s, t, e, r) => {
1148
+ for (var i = r > 1 ? void 0 : r ? Fe(t, e) : t, o = s.length - 1, n; o >= 0; o--)
1149
+ (n = s[o]) && (i = (r ? n(t, e, i) : n(i)) || i);
1150
+ return r && i && Be(t, e, i), i;
1151
+ };
1152
+ let z = class extends we {
1153
+ constructor() {
1154
+ super(...arguments), this.object = { "@id": "" };
1155
+ }
1156
+ render() {
1157
+ return this.isType("some:Type") ? c : j`<li>
1158
+ ${ht(Te`Sample object named: ${this.object.name}`)}
1159
+ </li>`;
1160
+ }
1161
+ };
1162
+ z.styles = st`
1163
+ ${et(It)}
1164
+ `;
1165
+ kt([
1166
+ p({ attribute: !1, type: Object })
1167
+ ], z.prototype, "object", 2);
1168
+ z = kt([
1169
+ nt("sample-object"),
1170
+ Nt()
1171
+ ], z);
1172
+ var Ke = Object.defineProperty, Xe = Object.getOwnPropertyDescriptor, zt = (s, t, e, r) => {
1173
+ for (var i = r > 1 ? void 0 : r ? Xe(t, e) : t, o = s.length - 1, n; o >= 0; o--)
1174
+ (n = s[o]) && (i = (r ? n(t, e, i) : n(i)) || i);
1175
+ return r && i && Ke(t, e, i), i;
1176
+ };
1177
+ let V = class extends at {
1178
+ constructor() {
1179
+ super(...arguments), this.objects = [];
1180
+ }
1181
+ render() {
1182
+ return this.hasType("some:Type") ? c : j`${ht("Here are all of our objects:")}<br />
1183
+ <ul>
1184
+ ${this.objects.map(
1185
+ (s) => j`<sample-object .object=${s}></sample-object>`
1186
+ )}
1187
+ </ul>`;
1188
+ }
1189
+ };
1190
+ V.styles = st`
1191
+ ${et(It)}
1192
+ `;
1193
+ zt([
1194
+ p({ attribute: !1, type: Object })
1195
+ ], V.prototype, "objects", 2);
1196
+ V = zt([
1197
+ nt("sample-objects"),
1198
+ Nt()
1199
+ ], V);
1200
+ const Je = "en", Vt = [
1201
+ "en"
1202
+ ], Ze = /* @__PURE__ */ Object.assign({}), Ge = new Map(
1203
+ Vt.map((s) => [
1204
+ s,
1205
+ Ze[`../generated/locales/${s}.ts`]
1206
+ ])
1207
+ ), { getLocale: St, setLocale: Pt } = ze({
1208
+ sourceLocale: Je,
1209
+ targetLocales: Vt,
1210
+ loadLocale: async (s) => Ge.get(s)
1211
+ });
1212
+ window.getLocale = window.getLocale ? window.getLocale.push(St) : [St];
1213
+ window.setLocale = window.setLocale ? window.setLocale.push(Pt) : [Pt];