@paroicms/content-loading-plugin 0.1.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.
@@ -0,0 +1,1654 @@
1
+ const gt = (e, t) => e === t, ge = Symbol("solid-proxy"), Z = {
2
+ equals: gt
3
+ };
4
+ let Fe = He;
5
+ const T = 1, z = 2, De = {
6
+ owned: null,
7
+ cleanups: null,
8
+ context: null,
9
+ owner: null
10
+ };
11
+ var y = null;
12
+ let ue = null, mt = null, b = null, R = null, k = null, re = 0;
13
+ function Be(e, t) {
14
+ const n = b, r = y, o = e.length === 0, i = t === void 0 ? r : t, a = o ? De : {
15
+ owned: null,
16
+ cleanups: null,
17
+ context: i ? i.context : null,
18
+ owner: i
19
+ }, s = o ? e : () => e(() => I(() => oe(a)));
20
+ y = a, b = null;
21
+ try {
22
+ return N(s, !0);
23
+ } finally {
24
+ b = n, y = r;
25
+ }
26
+ }
27
+ function x(e, t) {
28
+ t = t ? Object.assign({}, Z, t) : Z;
29
+ const n = {
30
+ value: e,
31
+ observers: null,
32
+ observerSlots: null,
33
+ comparator: t.equals || void 0
34
+ }, r = (o) => (typeof o == "function" && (o = o(n.value)), Ke(n, o));
35
+ return [Ge.bind(n), r];
36
+ }
37
+ function O(e, t, n) {
38
+ const r = $e(e, t, !1, T);
39
+ H(r);
40
+ }
41
+ function be(e, t, n) {
42
+ Fe = St;
43
+ const r = $e(e, t, !1, T);
44
+ r.user = !0, k ? k.push(r) : H(r);
45
+ }
46
+ function E(e, t, n) {
47
+ n = n ? Object.assign({}, Z, n) : Z;
48
+ const r = $e(e, t, !0, 0);
49
+ return r.observers = null, r.observerSlots = null, r.comparator = n.equals || void 0, H(r), Ge.bind(r);
50
+ }
51
+ function yt(e) {
52
+ return N(e, !1);
53
+ }
54
+ function I(e) {
55
+ if (b === null)
56
+ return e();
57
+ const t = b;
58
+ b = null;
59
+ try {
60
+ return e();
61
+ } finally {
62
+ b = t;
63
+ }
64
+ }
65
+ function K(e, t, n) {
66
+ const r = Array.isArray(e);
67
+ let o, i = n && n.defer;
68
+ return (a) => {
69
+ let s;
70
+ if (r) {
71
+ s = Array(e.length);
72
+ for (let l = 0; l < e.length; l++)
73
+ s[l] = e[l]();
74
+ } else
75
+ s = e();
76
+ if (i)
77
+ return i = !1, a;
78
+ const c = I(() => t(s, o, a));
79
+ return o = s, c;
80
+ };
81
+ }
82
+ function Me(e) {
83
+ return y === null || (y.cleanups === null ? y.cleanups = [e] : y.cleanups.push(e)), e;
84
+ }
85
+ function je() {
86
+ return y;
87
+ }
88
+ function qe(e, t) {
89
+ const n = y, r = b;
90
+ y = e, b = null;
91
+ try {
92
+ return N(t, !0);
93
+ } catch (o) {
94
+ Ae(o);
95
+ } finally {
96
+ y = n, b = r;
97
+ }
98
+ }
99
+ function wt(e) {
100
+ const t = b, n = y;
101
+ return Promise.resolve().then(() => {
102
+ b = t, y = n;
103
+ let r;
104
+ return N(e, !1), b = y = null, r ? r.done : void 0;
105
+ });
106
+ }
107
+ function Ve(e, t) {
108
+ const n = Symbol("context");
109
+ return {
110
+ id: n,
111
+ Provider: At(n),
112
+ defaultValue: e
113
+ };
114
+ }
115
+ function We(e) {
116
+ let t;
117
+ return y && y.context && (t = y.context[e.id]) !== void 0 ? t : e.defaultValue;
118
+ }
119
+ function Se(e) {
120
+ const t = E(e), n = E(() => me(t()));
121
+ return n.toArray = () => {
122
+ const r = n();
123
+ return Array.isArray(r) ? r : r != null ? [r] : [];
124
+ }, n;
125
+ }
126
+ function Ge() {
127
+ if (this.sources && this.state)
128
+ if (this.state === T)
129
+ H(this);
130
+ else {
131
+ const e = R;
132
+ R = null, N(() => te(this), !1), R = e;
133
+ }
134
+ if (b) {
135
+ const e = this.observers ? this.observers.length : 0;
136
+ b.sources ? (b.sources.push(this), b.sourceSlots.push(e)) : (b.sources = [this], b.sourceSlots = [e]), this.observers ? (this.observers.push(b), this.observerSlots.push(b.sources.length - 1)) : (this.observers = [b], this.observerSlots = [b.sources.length - 1]);
137
+ }
138
+ return this.value;
139
+ }
140
+ function Ke(e, t, n) {
141
+ let r = e.value;
142
+ return (!e.comparator || !e.comparator(r, t)) && (e.value = t, e.observers && e.observers.length && N(() => {
143
+ for (let o = 0; o < e.observers.length; o += 1) {
144
+ const i = e.observers[o], a = ue && ue.running;
145
+ a && ue.disposed.has(i), (a ? !i.tState : !i.state) && (i.pure ? R.push(i) : k.push(i), i.observers && Xe(i)), a || (i.state = T);
146
+ }
147
+ if (R.length > 1e6)
148
+ throw R = [], new Error();
149
+ }, !1)), t;
150
+ }
151
+ function H(e) {
152
+ if (!e.fn)
153
+ return;
154
+ oe(e);
155
+ const t = re;
156
+ vt(e, e.value, t);
157
+ }
158
+ function vt(e, t, n) {
159
+ let r;
160
+ const o = y, i = b;
161
+ b = y = e;
162
+ try {
163
+ r = e.fn(t);
164
+ } catch (a) {
165
+ return e.pure && (e.state = T, e.owned && e.owned.forEach(oe), e.owned = null), e.updatedAt = n + 1, Ae(a);
166
+ } finally {
167
+ b = i, y = o;
168
+ }
169
+ (!e.updatedAt || e.updatedAt <= n) && (e.updatedAt != null && "observers" in e ? Ke(e, r) : e.value = r, e.updatedAt = n);
170
+ }
171
+ function $e(e, t, n, r = T, o) {
172
+ const i = {
173
+ fn: e,
174
+ state: r,
175
+ updatedAt: null,
176
+ owned: null,
177
+ sources: null,
178
+ sourceSlots: null,
179
+ cleanups: null,
180
+ value: t,
181
+ owner: y,
182
+ context: y ? y.context : null,
183
+ pure: n
184
+ };
185
+ return y === null || y !== De && (y.owned ? y.owned.push(i) : y.owned = [i]), i;
186
+ }
187
+ function ee(e) {
188
+ if (e.state === 0)
189
+ return;
190
+ if (e.state === z)
191
+ return te(e);
192
+ if (e.suspense && I(e.suspense.inFallback))
193
+ return e.suspense.effects.push(e);
194
+ const t = [e];
195
+ for (; (e = e.owner) && (!e.updatedAt || e.updatedAt < re); )
196
+ e.state && t.push(e);
197
+ for (let n = t.length - 1; n >= 0; n--)
198
+ if (e = t[n], e.state === T)
199
+ H(e);
200
+ else if (e.state === z) {
201
+ const r = R;
202
+ R = null, N(() => te(e, t[0]), !1), R = r;
203
+ }
204
+ }
205
+ function N(e, t) {
206
+ if (R)
207
+ return e();
208
+ let n = !1;
209
+ t || (R = []), k ? n = !0 : k = [], re++;
210
+ try {
211
+ const r = e();
212
+ return bt(n), r;
213
+ } catch (r) {
214
+ n || (k = null), R = null, Ae(r);
215
+ }
216
+ }
217
+ function bt(e) {
218
+ if (R && (He(R), R = null), e)
219
+ return;
220
+ const t = k;
221
+ k = null, t.length && N(() => Fe(t), !1);
222
+ }
223
+ function He(e) {
224
+ for (let t = 0; t < e.length; t++)
225
+ ee(e[t]);
226
+ }
227
+ function St(e) {
228
+ let t, n = 0;
229
+ for (t = 0; t < e.length; t++) {
230
+ const r = e[t];
231
+ r.user ? e[n++] = r : ee(r);
232
+ }
233
+ for (t = 0; t < n; t++)
234
+ ee(e[t]);
235
+ }
236
+ function te(e, t) {
237
+ e.state = 0;
238
+ for (let n = 0; n < e.sources.length; n += 1) {
239
+ const r = e.sources[n];
240
+ if (r.sources) {
241
+ const o = r.state;
242
+ o === T ? r !== t && (!r.updatedAt || r.updatedAt < re) && ee(r) : o === z && te(r, t);
243
+ }
244
+ }
245
+ }
246
+ function Xe(e) {
247
+ for (let t = 0; t < e.observers.length; t += 1) {
248
+ const n = e.observers[t];
249
+ n.state || (n.state = z, n.pure ? R.push(n) : k.push(n), n.observers && Xe(n));
250
+ }
251
+ }
252
+ function oe(e) {
253
+ let t;
254
+ if (e.sources)
255
+ for (; e.sources.length; ) {
256
+ const n = e.sources.pop(), r = e.sourceSlots.pop(), o = n.observers;
257
+ if (o && o.length) {
258
+ const i = o.pop(), a = n.observerSlots.pop();
259
+ r < o.length && (i.sourceSlots[a] = r, o[r] = i, n.observerSlots[r] = a);
260
+ }
261
+ }
262
+ if (e.owned) {
263
+ for (t = e.owned.length - 1; t >= 0; t--)
264
+ oe(e.owned[t]);
265
+ e.owned = null;
266
+ }
267
+ if (e.cleanups) {
268
+ for (t = e.cleanups.length - 1; t >= 0; t--)
269
+ e.cleanups[t]();
270
+ e.cleanups = null;
271
+ }
272
+ e.state = 0;
273
+ }
274
+ function $t(e) {
275
+ return e instanceof Error ? e : new Error(typeof e == "string" ? e : "Unknown error", {
276
+ cause: e
277
+ });
278
+ }
279
+ function Ae(e, t = y) {
280
+ throw $t(e);
281
+ }
282
+ function me(e) {
283
+ if (typeof e == "function" && !e.length)
284
+ return me(e());
285
+ if (Array.isArray(e)) {
286
+ const t = [];
287
+ for (let n = 0; n < e.length; n++) {
288
+ const r = me(e[n]);
289
+ Array.isArray(r) ? t.push.apply(t, r) : t.push(r);
290
+ }
291
+ return t;
292
+ }
293
+ return e;
294
+ }
295
+ function At(e, t) {
296
+ return function(r) {
297
+ let o;
298
+ return O(() => o = I(() => (y.context = {
299
+ ...y.context,
300
+ [e]: r.value
301
+ }, Se(() => r.children))), void 0), o;
302
+ };
303
+ }
304
+ function A(e, t) {
305
+ return I(() => e(t || {}));
306
+ }
307
+ function Q() {
308
+ return !0;
309
+ }
310
+ const Et = {
311
+ get(e, t, n) {
312
+ return t === ge ? n : e.get(t);
313
+ },
314
+ has(e, t) {
315
+ return t === ge ? !0 : e.has(t);
316
+ },
317
+ set: Q,
318
+ deleteProperty: Q,
319
+ getOwnPropertyDescriptor(e, t) {
320
+ return {
321
+ configurable: !0,
322
+ enumerable: !0,
323
+ get() {
324
+ return e.get(t);
325
+ },
326
+ set: Q,
327
+ deleteProperty: Q
328
+ };
329
+ },
330
+ ownKeys(e) {
331
+ return e.keys();
332
+ }
333
+ };
334
+ function fe(e) {
335
+ return (e = typeof e == "function" ? e() : e) ? e : {};
336
+ }
337
+ function Rt() {
338
+ for (let e = 0, t = this.length; e < t; ++e) {
339
+ const n = this[e]();
340
+ if (n !== void 0)
341
+ return n;
342
+ }
343
+ }
344
+ function Ct(...e) {
345
+ let t = !1;
346
+ for (let a = 0; a < e.length; a++) {
347
+ const s = e[a];
348
+ t = t || !!s && ge in s, e[a] = typeof s == "function" ? (t = !0, E(s)) : s;
349
+ }
350
+ if (t)
351
+ return new Proxy({
352
+ get(a) {
353
+ for (let s = e.length - 1; s >= 0; s--) {
354
+ const c = fe(e[s])[a];
355
+ if (c !== void 0)
356
+ return c;
357
+ }
358
+ },
359
+ has(a) {
360
+ for (let s = e.length - 1; s >= 0; s--)
361
+ if (a in fe(e[s]))
362
+ return !0;
363
+ return !1;
364
+ },
365
+ keys() {
366
+ const a = [];
367
+ for (let s = 0; s < e.length; s++)
368
+ a.push(...Object.keys(fe(e[s])));
369
+ return [...new Set(a)];
370
+ }
371
+ }, Et);
372
+ const n = {}, r = /* @__PURE__ */ Object.create(null);
373
+ for (let a = e.length - 1; a >= 0; a--) {
374
+ const s = e[a];
375
+ if (!s)
376
+ continue;
377
+ const c = Object.getOwnPropertyNames(s);
378
+ for (let l = c.length - 1; l >= 0; l--) {
379
+ const u = c[l];
380
+ if (u === "__proto__" || u === "constructor")
381
+ continue;
382
+ const h = Object.getOwnPropertyDescriptor(s, u);
383
+ if (!r[u])
384
+ r[u] = h.get ? {
385
+ enumerable: !0,
386
+ configurable: !0,
387
+ get: Rt.bind(n[u] = [h.get.bind(s)])
388
+ } : h.value !== void 0 ? h : void 0;
389
+ else {
390
+ const p = n[u];
391
+ p && (h.get ? p.push(h.get.bind(s)) : h.value !== void 0 && p.push(() => h.value));
392
+ }
393
+ }
394
+ }
395
+ const o = {}, i = Object.keys(r);
396
+ for (let a = i.length - 1; a >= 0; a--) {
397
+ const s = i[a], c = r[s];
398
+ c && c.get ? Object.defineProperty(o, s, c) : o[s] = c ? c.value : void 0;
399
+ }
400
+ return o;
401
+ }
402
+ const Lt = (e) => `Stale read from <${e}>.`;
403
+ function q(e) {
404
+ const t = e.keyed, n = E(() => e.when, void 0, {
405
+ equals: (r, o) => t ? r === o : !r == !o
406
+ });
407
+ return E(() => {
408
+ const r = n();
409
+ if (r) {
410
+ const o = e.children;
411
+ return typeof o == "function" && o.length > 0 ? I(() => o(t ? r : () => {
412
+ if (!I(n))
413
+ throw Lt("Show");
414
+ return e.when;
415
+ })) : o;
416
+ }
417
+ return e.fallback;
418
+ }, void 0, void 0);
419
+ }
420
+ function Pt(e, t, n) {
421
+ let r = n.length, o = t.length, i = r, a = 0, s = 0, c = t[o - 1].nextSibling, l = null;
422
+ for (; a < o || s < i; ) {
423
+ if (t[a] === n[s]) {
424
+ a++, s++;
425
+ continue;
426
+ }
427
+ for (; t[o - 1] === n[i - 1]; )
428
+ o--, i--;
429
+ if (o === a) {
430
+ const u = i < r ? s ? n[s - 1].nextSibling : n[i - s] : c;
431
+ for (; s < i; )
432
+ e.insertBefore(n[s++], u);
433
+ } else if (i === s)
434
+ for (; a < o; )
435
+ (!l || !l.has(t[a])) && t[a].remove(), a++;
436
+ else if (t[a] === n[i - 1] && n[s] === t[o - 1]) {
437
+ const u = t[--o].nextSibling;
438
+ e.insertBefore(n[s++], t[a++].nextSibling), e.insertBefore(n[--i], u), t[o] = n[i];
439
+ } else {
440
+ if (!l) {
441
+ l = /* @__PURE__ */ new Map();
442
+ let h = s;
443
+ for (; h < i; )
444
+ l.set(n[h], h++);
445
+ }
446
+ const u = l.get(t[a]);
447
+ if (u != null)
448
+ if (s < u && u < i) {
449
+ let h = a, p = 1, m;
450
+ for (; ++h < o && h < i && !((m = l.get(t[h])) == null || m !== u + p); )
451
+ p++;
452
+ if (p > u - s) {
453
+ const v = t[a];
454
+ for (; s < u; )
455
+ e.insertBefore(n[s++], v);
456
+ } else
457
+ e.replaceChild(n[s++], t[a++]);
458
+ } else
459
+ a++;
460
+ else
461
+ t[a++].remove();
462
+ }
463
+ }
464
+ }
465
+ const xe = "_$DX_DELEGATE";
466
+ function Ee(e, t, n, r = {}) {
467
+ let o;
468
+ return Be((i) => {
469
+ o = i, t === document ? e() : P(t, e(), t.firstChild ? null : void 0, n);
470
+ }, r.owner), () => {
471
+ o(), t.textContent = "";
472
+ };
473
+ }
474
+ function C(e, t, n) {
475
+ let r;
476
+ const o = () => {
477
+ const a = document.createElement("template");
478
+ return a.innerHTML = e, a.content.firstChild;
479
+ }, i = () => (r || (r = o())).cloneNode(!0);
480
+ return i.cloneNode = i, i;
481
+ }
482
+ function se(e, t = window.document) {
483
+ const n = t[xe] || (t[xe] = /* @__PURE__ */ new Set());
484
+ for (let r = 0, o = e.length; r < o; r++) {
485
+ const i = e[r];
486
+ n.has(i) || (n.add(i), t.addEventListener(i, _t));
487
+ }
488
+ }
489
+ function ie(e, t, n) {
490
+ n == null ? e.removeAttribute(t) : e.setAttribute(t, n);
491
+ }
492
+ function Qe(e, t) {
493
+ t == null ? e.removeAttribute("class") : e.className = t;
494
+ }
495
+ function xt(e, t, n) {
496
+ return I(() => e(t, n));
497
+ }
498
+ function P(e, t, n, r) {
499
+ if (n !== void 0 && !r && (r = []), typeof t != "function")
500
+ return ne(e, t, r, n);
501
+ O((o) => ne(e, t(), o, n), r);
502
+ }
503
+ function _t(e) {
504
+ const t = `$$${e.type}`;
505
+ let n = e.composedPath && e.composedPath()[0] || e.target;
506
+ for (e.target !== n && Object.defineProperty(e, "target", {
507
+ configurable: !0,
508
+ value: n
509
+ }), Object.defineProperty(e, "currentTarget", {
510
+ configurable: !0,
511
+ get() {
512
+ return n || document;
513
+ }
514
+ }); n; ) {
515
+ const r = n[t];
516
+ if (r && !n.disabled) {
517
+ const o = n[`${t}Data`];
518
+ if (o !== void 0 ? r.call(n, o, e) : r.call(n, e), e.cancelBubble)
519
+ return;
520
+ }
521
+ n = n._$host || n.parentNode || n.host;
522
+ }
523
+ }
524
+ function ne(e, t, n, r, o) {
525
+ for (; typeof n == "function"; )
526
+ n = n();
527
+ if (t === n)
528
+ return n;
529
+ const i = typeof t, a = r !== void 0;
530
+ if (e = a && n[0] && n[0].parentNode || e, i === "string" || i === "number") {
531
+ if (i === "number" && (t = t.toString(), t === n))
532
+ return n;
533
+ if (a) {
534
+ let s = n[0];
535
+ s && s.nodeType === 3 ? s.data !== t && (s.data = t) : s = document.createTextNode(t), n = j(e, n, r, s);
536
+ } else
537
+ n !== "" && typeof n == "string" ? n = e.firstChild.data = t : n = e.textContent = t;
538
+ } else if (t == null || i === "boolean")
539
+ n = j(e, n, r);
540
+ else {
541
+ if (i === "function")
542
+ return O(() => {
543
+ let s = t();
544
+ for (; typeof s == "function"; )
545
+ s = s();
546
+ n = ne(e, s, n, r);
547
+ }), () => n;
548
+ if (Array.isArray(t)) {
549
+ const s = [], c = n && Array.isArray(n);
550
+ if (ye(s, t, n, o))
551
+ return O(() => n = ne(e, s, n, r, !0)), () => n;
552
+ if (s.length === 0) {
553
+ if (n = j(e, n, r), a)
554
+ return n;
555
+ } else
556
+ c ? n.length === 0 ? _e(e, s, r) : Pt(e, n, s) : (n && j(e), _e(e, s));
557
+ n = s;
558
+ } else if (t.nodeType) {
559
+ if (Array.isArray(n)) {
560
+ if (a)
561
+ return n = j(e, n, r, t);
562
+ j(e, n, null, t);
563
+ } else
564
+ n == null || n === "" || !e.firstChild ? e.appendChild(t) : e.replaceChild(t, e.firstChild);
565
+ n = t;
566
+ }
567
+ }
568
+ return n;
569
+ }
570
+ function ye(e, t, n, r) {
571
+ let o = !1;
572
+ for (let i = 0, a = t.length; i < a; i++) {
573
+ let s = t[i], c = n && n[e.length], l;
574
+ if (!(s == null || s === !0 || s === !1))
575
+ if ((l = typeof s) == "object" && s.nodeType)
576
+ e.push(s);
577
+ else if (Array.isArray(s))
578
+ o = ye(e, s, c) || o;
579
+ else if (l === "function")
580
+ if (r) {
581
+ for (; typeof s == "function"; )
582
+ s = s();
583
+ o = ye(e, Array.isArray(s) ? s : [s], Array.isArray(c) ? c : [c]) || o;
584
+ } else
585
+ e.push(s), o = !0;
586
+ else {
587
+ const u = String(s);
588
+ c && c.nodeType === 3 && c.data === u ? e.push(c) : e.push(document.createTextNode(u));
589
+ }
590
+ }
591
+ return o;
592
+ }
593
+ function _e(e, t, n = null) {
594
+ for (let r = 0, o = t.length; r < o; r++)
595
+ e.insertBefore(t[r], n);
596
+ }
597
+ function j(e, t, n, r) {
598
+ if (n === void 0)
599
+ return e.textContent = "";
600
+ const o = r || document.createTextNode("");
601
+ if (t.length) {
602
+ let i = !1;
603
+ for (let a = t.length - 1; a >= 0; a--) {
604
+ const s = t[a];
605
+ if (o !== s) {
606
+ const c = s.parentNode === e;
607
+ !i && !a ? c ? e.replaceChild(o, s) : e.insertBefore(o, n) : c && s.remove();
608
+ } else
609
+ i = !0;
610
+ }
611
+ } else
612
+ e.insertBefore(o, n);
613
+ return [o];
614
+ }
615
+ const Ot = !1;
616
+ function we(e) {
617
+ return e.varName ? ` for '${e.varName}'` : "";
618
+ }
619
+ function It(e) {
620
+ return (
621
+ // use type coercion to parse the _entirety_ of the string (`parseFloat` alone does not do this)...
622
+ !isNaN(e) && !isNaN(parseFloat(e))
623
+ );
624
+ }
625
+ function Ut(e, t = {}) {
626
+ if (e == null || e === "" && !t.allowEmpty)
627
+ throw new Error(`Missing string value${we(t)}`);
628
+ return typeof e == "string" ? e : e.toString();
629
+ }
630
+ function W(e, t = {}) {
631
+ return e == null || e === "" && !t.allowEmpty ? void 0 : Ut(e, t);
632
+ }
633
+ function kt(e, t = {}) {
634
+ if (typeof e == "number")
635
+ return e;
636
+ if (e == null)
637
+ throw new Error(`Missing number value${we(t)}`);
638
+ if (typeof e == "string" && It(e))
639
+ return Number(e);
640
+ throw new Error(`Cannot convert to number the value of type '${typeof e}'${we(t)}`);
641
+ }
642
+ function J(e, t = {}) {
643
+ return e == null ? void 0 : kt(e, t);
644
+ }
645
+ var Tt = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 };
646
+ const Oe = W(Tt.VITE_API_PORT, { varName: "VITE_API_PORT" }), Je = Oe ? `//${document.location.hostname}:${Oe}/api/plugin/content-loading` : `//${document.location.host}/api/plugin/content-loading`, Ye = "/assets/plugin/content-loading/0.0.1";
647
+ async function Nt(e) {
648
+ const t = `${Je}${e}`, n = await fetch(t);
649
+ if (n.status !== 200)
650
+ throw new Error(`api error ${n.status}`);
651
+ return await n.text();
652
+ }
653
+ var Ze = (e) => e != null && (e = Object.getPrototypeOf(e), e === Array.prototype || e === Object.prototype);
654
+ function ze(e, t, n) {
655
+ for (const [r, o] of Object.entries(t)) {
656
+ const i = `${n}.${r}`;
657
+ e[i] = o, Ze(o) && ze(e, o, i);
658
+ }
659
+ }
660
+ function Ft(e) {
661
+ const t = { ...e };
662
+ for (const [n, r] of Object.entries(e))
663
+ Ze(r) && ze(t, r, n);
664
+ return t;
665
+ }
666
+ var Dt = (e, t) => {
667
+ if (t)
668
+ for (const [n, r] of Object.entries(t))
669
+ e = e.replace(new RegExp(`{{\\s*${n}\\s*}}`, "g"), r);
670
+ return e;
671
+ }, Bt = (e) => e;
672
+ function Mt(e, t = Bt) {
673
+ return (n, ...r) => {
674
+ n[0] === "." && (n = n.slice(1));
675
+ const o = e()?.[n];
676
+ switch (typeof o) {
677
+ case "function":
678
+ return o(...r);
679
+ case "string":
680
+ return t(o, r[0]);
681
+ default:
682
+ return o;
683
+ }
684
+ };
685
+ }
686
+ const jt = {
687
+ nothingGet: "No results found for",
688
+ search: "Search"
689
+ }, qt = {
690
+ loadMore: "Load more"
691
+ }, Vt = {
692
+ searchApp: jt,
693
+ infiniteLoading: qt
694
+ }, Wt = {
695
+ nothingGet: "Aucun résultat trouvé pour",
696
+ search: "Rechercher"
697
+ }, Gt = {
698
+ loadMore: "Charger la suite"
699
+ }, Kt = {
700
+ searchApp: Wt,
701
+ infiniteLoading: Gt
702
+ }, Ie = { en: Vt, fr: Kt };
703
+ function ae(e) {
704
+ const t = E(() => {
705
+ const r = e in Ie ? e : "en";
706
+ return Ft(Ie[r]);
707
+ });
708
+ return { t: Mt(t, Dt) };
709
+ }
710
+ var Ht = /* @__PURE__ */ C("<button class=InfiniteLoading-btn type=button>"), Xt = /* @__PURE__ */ C("<div class=InfiniteLoading-actionArea>"), Qt = /* @__PURE__ */ C("<img class=InfiniteLoading-spinner width=50 height=50 alt=…>");
711
+ function Jt(e, {
712
+ language: t
713
+ }) {
714
+ const n = J(e.dataset.start), r = J(e.dataset.total), o = J(e.dataset.limit), i = W(e.dataset.parentId), a = W(e.dataset.template), s = W(e.dataset.labeledById);
715
+ if (!(n === void 0 || r === void 0 || i === void 0 || o === void 0 || a === void 0)) {
716
+ if (!t)
717
+ throw new Error("Missing language");
718
+ Yt({
719
+ language: t,
720
+ limit: o,
721
+ parentId: i,
722
+ root: e,
723
+ start: n,
724
+ total: r,
725
+ templateName: a,
726
+ labeledById: s
727
+ });
728
+ }
729
+ }
730
+ function Yt({
731
+ language: e,
732
+ limit: t,
733
+ root: n,
734
+ start: r,
735
+ total: o,
736
+ parentId: i,
737
+ templateName: a,
738
+ labeledById: s
739
+ }) {
740
+ const {
741
+ t: c
742
+ } = ae(e);
743
+ let l = r;
744
+ if (l >= o)
745
+ return;
746
+ const u = (() => {
747
+ var v = Ht();
748
+ return v.$$click = m, P(v, () => c("infiniteLoading.loadMore")), v;
749
+ })(), h = (() => {
750
+ var v = Xt();
751
+ return P(v, u), v;
752
+ })(), p = (() => {
753
+ var v = Qt();
754
+ return ie(v, "src", `${Ye}/spinner.svg`), v;
755
+ })();
756
+ n.appendChild(h);
757
+ async function m() {
758
+ n.appendChild(p);
759
+ const v = await Zt({
760
+ limit: t,
761
+ newStart: l,
762
+ parentId: i,
763
+ templateName: a,
764
+ labeledById: s
765
+ });
766
+ for (const f of v)
767
+ n.insertBefore(f, h);
768
+ l += t, l >= o && h.remove(), p.remove();
769
+ }
770
+ }
771
+ async function Zt({
772
+ limit: e,
773
+ newStart: t,
774
+ parentId: n,
775
+ templateName: r,
776
+ labeledById: o
777
+ }) {
778
+ const i = o ? `?labeled=${encodeURIComponent(o)}` : "", a = `/partials?templateName=${encodeURIComponent(r)}&children-of=${encodeURIComponent(n)}&start=${encodeURIComponent(t)}&limit=${encodeURIComponent(e)}${i}`, s = await Nt(a), c = document.createElement("div");
779
+ return c.innerHTML = s, [...c.children];
780
+ }
781
+ se(["click"]);
782
+ function et() {
783
+ let e = /* @__PURE__ */ new Set();
784
+ function t(o) {
785
+ return e.add(o), () => e.delete(o);
786
+ }
787
+ let n = !1;
788
+ function r(o, i) {
789
+ if (n)
790
+ return !(n = !1);
791
+ const a = {
792
+ to: o,
793
+ options: i,
794
+ defaultPrevented: !1,
795
+ preventDefault: () => a.defaultPrevented = !0
796
+ };
797
+ for (const s of e)
798
+ s.listener({
799
+ ...a,
800
+ from: s.location,
801
+ retry: (c) => {
802
+ c && (n = !0), s.navigate(o, { ...i, resolve: !1 });
803
+ }
804
+ });
805
+ return !a.defaultPrevented;
806
+ }
807
+ return {
808
+ subscribe: t,
809
+ confirm: r
810
+ };
811
+ }
812
+ let ve;
813
+ function Re() {
814
+ (!window.history.state || window.history.state._depth == null) && window.history.replaceState({ ...window.history.state, _depth: window.history.length - 1 }, ""), ve = window.history.state._depth;
815
+ }
816
+ Re();
817
+ function zt(e) {
818
+ return {
819
+ ...e,
820
+ _depth: window.history.state && window.history.state._depth
821
+ };
822
+ }
823
+ function en(e, t) {
824
+ let n = !1;
825
+ return () => {
826
+ const r = ve;
827
+ Re();
828
+ const o = r == null ? null : ve - r;
829
+ if (n) {
830
+ n = !1;
831
+ return;
832
+ }
833
+ o && t(o) ? (n = !0, window.history.go(-o)) : e();
834
+ };
835
+ }
836
+ const tn = /^(?:[a-z0-9]+:)?\/\//i, nn = /^\/+|(\/)\/+$/g, tt = "http://sr";
837
+ function G(e, t = !1) {
838
+ const n = e.replace(nn, "$1");
839
+ return n ? t || /^[?#]/.test(n) ? n : "/" + n : "";
840
+ }
841
+ function Y(e, t, n) {
842
+ if (tn.test(t))
843
+ return;
844
+ const r = G(e), o = n && G(n);
845
+ let i = "";
846
+ return !o || t.startsWith("/") ? i = r : o.toLowerCase().indexOf(r.toLowerCase()) !== 0 ? i = r + o : i = o, (i || "/") + G(t, !i);
847
+ }
848
+ function rn(e, t) {
849
+ if (e == null)
850
+ throw new Error(t);
851
+ return e;
852
+ }
853
+ function on(e, t) {
854
+ return G(e).replace(/\/*(\*.*)?$/g, "") + G(t);
855
+ }
856
+ function nt(e) {
857
+ const t = {};
858
+ return e.searchParams.forEach((n, r) => {
859
+ t[r] = n;
860
+ }), t;
861
+ }
862
+ function sn(e, t, n) {
863
+ const [r, o] = e.split("/*", 2), i = r.split("/").filter(Boolean), a = i.length;
864
+ return (s) => {
865
+ const c = s.split("/").filter(Boolean), l = c.length - a;
866
+ if (l < 0 || l > 0 && o === void 0 && !t)
867
+ return null;
868
+ const u = {
869
+ path: a ? "" : "/",
870
+ params: {}
871
+ }, h = (p) => n === void 0 ? void 0 : n[p];
872
+ for (let p = 0; p < a; p++) {
873
+ const m = i[p], v = c[p], f = m[0] === ":", d = f ? m.slice(1) : m;
874
+ if (f && he(v, h(d)))
875
+ u.params[d] = v;
876
+ else if (f || !he(v, m))
877
+ return null;
878
+ u.path += `/${v}`;
879
+ }
880
+ if (o) {
881
+ const p = l ? c.slice(-l).join("/") : "";
882
+ if (he(p, h(o)))
883
+ u.params[o] = p;
884
+ else
885
+ return null;
886
+ }
887
+ return u;
888
+ };
889
+ }
890
+ function he(e, t) {
891
+ const n = (r) => r.localeCompare(e, void 0, { sensitivity: "base" }) === 0;
892
+ return t === void 0 ? !0 : typeof t == "string" ? n(t) : typeof t == "function" ? t(e) : Array.isArray(t) ? t.some(n) : t instanceof RegExp ? t.test(e) : !1;
893
+ }
894
+ function an(e) {
895
+ const [t, n] = e.pattern.split("/*", 2), r = t.split("/").filter(Boolean);
896
+ return r.reduce((o, i) => o + (i.startsWith(":") ? 2 : 3), r.length - (n === void 0 ? 0 : 1));
897
+ }
898
+ function rt(e) {
899
+ const t = /* @__PURE__ */ new Map(), n = je();
900
+ return new Proxy({}, {
901
+ get(r, o) {
902
+ return t.has(o) || qe(n, () => t.set(o, E(() => e()[o]))), t.get(o)();
903
+ },
904
+ getOwnPropertyDescriptor() {
905
+ return {
906
+ enumerable: !0,
907
+ configurable: !0
908
+ };
909
+ },
910
+ ownKeys() {
911
+ return Reflect.ownKeys(e());
912
+ }
913
+ });
914
+ }
915
+ function ot(e) {
916
+ let t = /(\/?\:[^\/]+)\?/.exec(e);
917
+ if (!t)
918
+ return [e];
919
+ let n = e.slice(0, t.index), r = e.slice(t.index + t[0].length);
920
+ const o = [n, n += t[1]];
921
+ for (; t = /^(\/\:[^\/]+)\?/.exec(r); )
922
+ o.push(n += t[1]), r = r.slice(t[0].length);
923
+ return ot(r).reduce((i, a) => [...i, ...o.map((s) => s + a)], []);
924
+ }
925
+ const ln = 100, st = Ve(), it = Ve(), Ce = () => rn(We(st), "<A> and 'use' router primitives can be only used inside a Route."), at = () => Ce().navigatorFactory(), cn = () => Ce().location, un = () => Ce().params;
926
+ function fn(e, t = "") {
927
+ const { component: n, load: r, children: o, info: i } = e, a = !o || Array.isArray(o) && !o.length, s = {
928
+ key: e,
929
+ component: n,
930
+ load: r,
931
+ info: i
932
+ };
933
+ return lt(e.path).reduce((c, l) => {
934
+ for (const u of ot(l)) {
935
+ const h = on(t, u);
936
+ let p = a ? h : h.split("/*", 1)[0];
937
+ p = p.split("/").map((m) => m.startsWith(":") || m.startsWith("*") ? m : encodeURIComponent(m)).join("/"), c.push({
938
+ ...s,
939
+ originalPath: l,
940
+ pattern: p,
941
+ matcher: sn(p, !a, e.matchFilters)
942
+ });
943
+ }
944
+ return c;
945
+ }, []);
946
+ }
947
+ function hn(e, t = 0) {
948
+ return {
949
+ routes: e,
950
+ score: an(e[e.length - 1]) * 1e4 - t,
951
+ matcher(n) {
952
+ const r = [];
953
+ for (let o = e.length - 1; o >= 0; o--) {
954
+ const i = e[o], a = i.matcher(n);
955
+ if (!a)
956
+ return null;
957
+ r.unshift({
958
+ ...a,
959
+ route: i
960
+ });
961
+ }
962
+ return r;
963
+ }
964
+ };
965
+ }
966
+ function lt(e) {
967
+ return Array.isArray(e) ? e : [e];
968
+ }
969
+ function ct(e, t = "", n = [], r = []) {
970
+ const o = lt(e);
971
+ for (let i = 0, a = o.length; i < a; i++) {
972
+ const s = o[i];
973
+ if (s && typeof s == "object") {
974
+ s.hasOwnProperty("path") || (s.path = "");
975
+ const c = fn(s, t);
976
+ for (const l of c) {
977
+ n.push(l);
978
+ const u = Array.isArray(s.children) && s.children.length === 0;
979
+ if (s.children && !u)
980
+ ct(s.children, l.pattern, n, r);
981
+ else {
982
+ const h = hn([...n], r.length);
983
+ r.push(h);
984
+ }
985
+ n.pop();
986
+ }
987
+ }
988
+ }
989
+ return n.length ? r : r.sort((i, a) => a.score - i.score);
990
+ }
991
+ function de(e, t) {
992
+ for (let n = 0, r = e.length; n < r; n++) {
993
+ const o = e[n].matcher(t);
994
+ if (o)
995
+ return o;
996
+ }
997
+ return [];
998
+ }
999
+ function dn(e, t) {
1000
+ const n = new URL(tt), r = E((c) => {
1001
+ const l = e();
1002
+ try {
1003
+ return new URL(l, n);
1004
+ } catch {
1005
+ return console.error(`Invalid path ${l}`), c;
1006
+ }
1007
+ }, n, {
1008
+ equals: (c, l) => c.href === l.href
1009
+ }), o = E(() => r().pathname), i = E(() => r().search, !0), a = E(() => r().hash), s = () => "";
1010
+ return {
1011
+ get pathname() {
1012
+ return o();
1013
+ },
1014
+ get search() {
1015
+ return i();
1016
+ },
1017
+ get hash() {
1018
+ return a();
1019
+ },
1020
+ get state() {
1021
+ return t();
1022
+ },
1023
+ get key() {
1024
+ return s();
1025
+ },
1026
+ query: rt(K(i, () => nt(r())))
1027
+ };
1028
+ }
1029
+ let B;
1030
+ function pn() {
1031
+ return B;
1032
+ }
1033
+ function gn(e, t, n, r = {}) {
1034
+ const { signal: [o, i], utils: a = {} } = e, s = a.parsePath || ((w) => w), c = a.renderPath || ((w) => w), l = a.beforeLeave || et(), u = Y("", r.base || "");
1035
+ if (u === void 0)
1036
+ throw new Error(`${u} is not a valid base path`);
1037
+ u && !o().value && i({ value: u, replace: !0, scroll: !1 });
1038
+ const [h, p] = x(!1);
1039
+ let m;
1040
+ const v = (w, $) => {
1041
+ $.value === f() && $.state === S() || (m === void 0 && p(!0), B = w, m = $, wt(() => {
1042
+ m === $ && (d(m.value), g(m.state), F[1]([]));
1043
+ }).finally(() => {
1044
+ m === $ && yt(() => {
1045
+ B = void 0, w === "navigate" && dt(m), p(!1), m = void 0;
1046
+ });
1047
+ }));
1048
+ }, [f, d] = x(o().value), [S, g] = x(o().state), U = dn(f, S), L = [], F = x([]), V = E(() => typeof r.transformUrl == "function" ? de(t(), r.transformUrl(U.pathname)) : de(t(), U.pathname)), ut = rt(() => {
1049
+ const w = V(), $ = {};
1050
+ for (let _ = 0; _ < w.length; _++)
1051
+ Object.assign($, w[_].params);
1052
+ return $;
1053
+ }), Le = {
1054
+ pattern: u,
1055
+ path: () => u,
1056
+ outlet: () => null,
1057
+ resolvePath(w) {
1058
+ return Y(u, w);
1059
+ }
1060
+ };
1061
+ return O(K(o, (w) => v("native", w), { defer: !0 })), {
1062
+ base: Le,
1063
+ location: U,
1064
+ params: ut,
1065
+ isRouting: h,
1066
+ renderPath: c,
1067
+ parsePath: s,
1068
+ navigatorFactory: ht,
1069
+ matches: V,
1070
+ beforeLeave: l,
1071
+ preloadRoute: pt,
1072
+ singleFlight: r.singleFlight === void 0 ? !0 : r.singleFlight,
1073
+ submissions: F
1074
+ };
1075
+ function ft(w, $, _) {
1076
+ I(() => {
1077
+ if (typeof $ == "number") {
1078
+ $ && (a.go ? a.go($) : console.warn("Router integration does not support relative routing"));
1079
+ return;
1080
+ }
1081
+ const { replace: le, resolve: ce, scroll: M, state: X } = {
1082
+ replace: !1,
1083
+ resolve: !0,
1084
+ scroll: !0,
1085
+ ..._
1086
+ }, D = ce ? w.resolvePath($) : Y("", $);
1087
+ if (D === void 0)
1088
+ throw new Error(`Path '${$}' is not a routable path`);
1089
+ if (L.length >= ln)
1090
+ throw new Error("Too many redirects");
1091
+ const Pe = f();
1092
+ (D !== Pe || X !== S()) && (Ot || l.confirm(D, _) && (L.push({ value: Pe, replace: le, scroll: M, state: S() }), v("navigate", {
1093
+ value: D,
1094
+ state: X
1095
+ })));
1096
+ });
1097
+ }
1098
+ function ht(w) {
1099
+ return w = w || We(it) || Le, ($, _) => ft(w, $, _);
1100
+ }
1101
+ function dt(w) {
1102
+ const $ = L[0];
1103
+ $ && (i({
1104
+ ...w,
1105
+ replace: $.replace,
1106
+ scroll: $.scroll
1107
+ }), L.length = 0);
1108
+ }
1109
+ function pt(w, $ = {}) {
1110
+ const _ = de(t(), w.pathname), le = B;
1111
+ B = "preload";
1112
+ for (let ce in _) {
1113
+ const { route: M, params: X } = _[ce];
1114
+ M.component && M.component.preload && M.component.preload();
1115
+ const { load: D } = M;
1116
+ $.preloadData && D && qe(n(), () => D({
1117
+ params: X,
1118
+ location: {
1119
+ pathname: w.pathname,
1120
+ search: w.search,
1121
+ hash: w.hash,
1122
+ query: nt(w),
1123
+ state: null,
1124
+ key: ""
1125
+ },
1126
+ intent: "preload"
1127
+ }));
1128
+ }
1129
+ B = le;
1130
+ }
1131
+ }
1132
+ function mn(e, t, n, r) {
1133
+ const { base: o, location: i, params: a } = e, { pattern: s, component: c, load: l } = r().route, u = E(() => r().path);
1134
+ c && c.preload && c.preload();
1135
+ const h = l ? l({ params: a, location: i, intent: B || "initial" }) : void 0;
1136
+ return {
1137
+ parent: t,
1138
+ pattern: s,
1139
+ path: u,
1140
+ outlet: () => c ? A(c, {
1141
+ params: a,
1142
+ location: i,
1143
+ data: h,
1144
+ get children() {
1145
+ return n();
1146
+ }
1147
+ }) : n(),
1148
+ resolvePath(m) {
1149
+ return Y(o.path(), m, u());
1150
+ }
1151
+ };
1152
+ }
1153
+ const yn = (e) => (t) => {
1154
+ const {
1155
+ base: n
1156
+ } = t, r = Se(() => t.children), o = E(() => ct(r(), t.base || ""));
1157
+ let i;
1158
+ const a = gn(e, o, () => i, {
1159
+ base: n,
1160
+ singleFlight: t.singleFlight,
1161
+ transformUrl: t.transformUrl
1162
+ });
1163
+ return e.create && e.create(a), A(st.Provider, {
1164
+ value: a,
1165
+ get children() {
1166
+ return A(wn, {
1167
+ routerState: a,
1168
+ get root() {
1169
+ return t.root;
1170
+ },
1171
+ get load() {
1172
+ return t.rootLoad;
1173
+ },
1174
+ get children() {
1175
+ return [E(() => (i = je()) && null), A(vn, {
1176
+ routerState: a,
1177
+ get branches() {
1178
+ return o();
1179
+ }
1180
+ })];
1181
+ }
1182
+ });
1183
+ }
1184
+ });
1185
+ };
1186
+ function wn(e) {
1187
+ const t = e.routerState.location, n = e.routerState.params, r = E(() => e.load && I(() => {
1188
+ e.load({
1189
+ params: n,
1190
+ location: t,
1191
+ intent: pn() || "initial"
1192
+ });
1193
+ }));
1194
+ return A(q, {
1195
+ get when() {
1196
+ return e.root;
1197
+ },
1198
+ keyed: !0,
1199
+ get fallback() {
1200
+ return e.children;
1201
+ },
1202
+ children: (o) => A(o, {
1203
+ params: n,
1204
+ location: t,
1205
+ get data() {
1206
+ return r();
1207
+ },
1208
+ get children() {
1209
+ return e.children;
1210
+ }
1211
+ })
1212
+ });
1213
+ }
1214
+ function vn(e) {
1215
+ const t = [];
1216
+ let n;
1217
+ const r = E(K(e.routerState.matches, (o, i, a) => {
1218
+ let s = i && o.length === i.length;
1219
+ const c = [];
1220
+ for (let l = 0, u = o.length; l < u; l++) {
1221
+ const h = i && i[l], p = o[l];
1222
+ a && h && p.route.key === h.route.key ? c[l] = a[l] : (s = !1, t[l] && t[l](), Be((m) => {
1223
+ t[l] = m, c[l] = mn(e.routerState, c[l - 1] || e.routerState.base, Ue(() => r()[l + 1]), () => e.routerState.matches()[l]);
1224
+ }));
1225
+ }
1226
+ return t.splice(o.length).forEach((l) => l()), a && s ? a : (n = c[0], c);
1227
+ }));
1228
+ return Ue(() => r() && n)();
1229
+ }
1230
+ const Ue = (e) => () => A(q, {
1231
+ get when() {
1232
+ return e();
1233
+ },
1234
+ keyed: !0,
1235
+ children: (t) => A(it.Provider, {
1236
+ value: t,
1237
+ get children() {
1238
+ return t.outlet();
1239
+ }
1240
+ })
1241
+ }), pe = (e) => {
1242
+ const t = Se(() => e.children);
1243
+ return Ct(e, {
1244
+ get children() {
1245
+ return t();
1246
+ }
1247
+ });
1248
+ };
1249
+ function bn([e, t], n, r) {
1250
+ return [e, r ? (o) => t(r(o)) : t];
1251
+ }
1252
+ function Sn(e) {
1253
+ if (e === "#")
1254
+ return null;
1255
+ try {
1256
+ return document.querySelector(e);
1257
+ } catch {
1258
+ return null;
1259
+ }
1260
+ }
1261
+ function $n(e) {
1262
+ let t = !1;
1263
+ const n = (o) => typeof o == "string" ? { value: o } : o, r = bn(x(n(e.get()), {
1264
+ equals: (o, i) => o.value === i.value && o.state === i.state
1265
+ }), void 0, (o) => (!t && e.set(o), o));
1266
+ return e.init && Me(e.init((o = e.get()) => {
1267
+ t = !0, r[1](n(o)), t = !1;
1268
+ })), yn({
1269
+ signal: r,
1270
+ create: e.create,
1271
+ utils: e.utils
1272
+ });
1273
+ }
1274
+ function An(e, t, n) {
1275
+ return e.addEventListener(t, n), () => e.removeEventListener(t, n);
1276
+ }
1277
+ function En(e, t) {
1278
+ const n = Sn(`#${e}`);
1279
+ n ? n.scrollIntoView() : t && window.scrollTo(0, 0);
1280
+ }
1281
+ const Rn = /* @__PURE__ */ new Map();
1282
+ function Cn(e = !0, t = !1, n = "/_server", r) {
1283
+ return (o) => {
1284
+ const i = o.base.path(), a = o.navigatorFactory(o.base);
1285
+ let s = {};
1286
+ function c(f) {
1287
+ return f.namespaceURI === "http://www.w3.org/2000/svg";
1288
+ }
1289
+ function l(f) {
1290
+ if (f.defaultPrevented || f.button !== 0 || f.metaKey || f.altKey || f.ctrlKey || f.shiftKey)
1291
+ return;
1292
+ const d = f.composedPath().find((V) => V instanceof Node && V.nodeName.toUpperCase() === "A");
1293
+ if (!d || t && !d.hasAttribute("link"))
1294
+ return;
1295
+ const S = c(d), g = S ? d.href.baseVal : d.href;
1296
+ if ((S ? d.target.baseVal : d.target) || !g && !d.hasAttribute("state"))
1297
+ return;
1298
+ const L = (d.getAttribute("rel") || "").split(/\s+/);
1299
+ if (d.hasAttribute("download") || L && L.includes("external"))
1300
+ return;
1301
+ const F = S ? new URL(g, document.baseURI) : new URL(g);
1302
+ if (!(F.origin !== window.location.origin || i && F.pathname && !F.pathname.toLowerCase().startsWith(i.toLowerCase())))
1303
+ return [d, F];
1304
+ }
1305
+ function u(f) {
1306
+ const d = l(f);
1307
+ if (!d)
1308
+ return;
1309
+ const [S, g] = d, U = o.parsePath(g.pathname + g.search + g.hash), L = S.getAttribute("state");
1310
+ f.preventDefault(), a(U, {
1311
+ resolve: !1,
1312
+ replace: S.hasAttribute("replace"),
1313
+ scroll: !S.hasAttribute("noscroll"),
1314
+ state: L && JSON.parse(L)
1315
+ });
1316
+ }
1317
+ function h(f) {
1318
+ const d = l(f);
1319
+ if (!d)
1320
+ return;
1321
+ const [S, g] = d;
1322
+ s[g.pathname] || o.preloadRoute(g, { preloadData: S.getAttribute("preload") !== "false" });
1323
+ }
1324
+ function p(f) {
1325
+ const d = l(f);
1326
+ if (!d)
1327
+ return;
1328
+ const [S, g] = d;
1329
+ s[g.pathname] || (s[g.pathname] = setTimeout(() => {
1330
+ o.preloadRoute(g, { preloadData: S.getAttribute("preload") !== "false" }), delete s[g.pathname];
1331
+ }, 200));
1332
+ }
1333
+ function m(f) {
1334
+ const d = l(f);
1335
+ if (!d)
1336
+ return;
1337
+ const [, S] = d;
1338
+ s[S.pathname] && (clearTimeout(s[S.pathname]), delete s[S.pathname]);
1339
+ }
1340
+ function v(f) {
1341
+ if (f.defaultPrevented)
1342
+ return;
1343
+ let d = f.submitter && f.submitter.hasAttribute("formaction") ? f.submitter.getAttribute("formaction") : f.target.getAttribute("action");
1344
+ if (!d)
1345
+ return;
1346
+ if (!d.startsWith("https://action/")) {
1347
+ const g = new URL(d, tt);
1348
+ if (d = o.parsePath(g.pathname + g.search), !d.startsWith(n))
1349
+ return;
1350
+ }
1351
+ if (f.target.method.toUpperCase() !== "POST")
1352
+ throw new Error("Only POST forms are supported for Actions");
1353
+ const S = Rn.get(d);
1354
+ if (S) {
1355
+ f.preventDefault();
1356
+ const g = new FormData(f.target);
1357
+ f.submitter && f.submitter.name && g.append(f.submitter.name, f.submitter.value), S.call({ r: o, f: f.target }, g);
1358
+ }
1359
+ }
1360
+ se(["click", "submit"]), document.addEventListener("click", u), e && (document.addEventListener("mouseover", p), document.addEventListener("mouseout", m), document.addEventListener("focusin", h), document.addEventListener("touchstart", h)), document.addEventListener("submit", v), Me(() => {
1361
+ document.removeEventListener("click", u), e && (document.removeEventListener("mouseover", p), document.removeEventListener("mouseout", m), document.removeEventListener("focusin", h), document.removeEventListener("touchstart", h)), document.removeEventListener("submit", v);
1362
+ });
1363
+ };
1364
+ }
1365
+ function Ln(e) {
1366
+ const t = e.replace(/^.*?#/, "");
1367
+ if (!t.startsWith("/")) {
1368
+ const [, n = "/"] = window.location.hash.split("#", 2);
1369
+ return `${n}#${t}`;
1370
+ }
1371
+ return t;
1372
+ }
1373
+ function Pn(e) {
1374
+ const t = () => window.location.hash.slice(1), n = et();
1375
+ return $n({
1376
+ get: t,
1377
+ set({ value: r, replace: o, scroll: i, state: a }) {
1378
+ o ? window.history.replaceState(zt(a), "", "#" + r) : window.history.pushState(a, "", "#" + r);
1379
+ const s = r.indexOf("#"), c = s >= 0 ? r.slice(s + 1) : "";
1380
+ En(c, i), Re();
1381
+ },
1382
+ init: (r) => An(window, "hashchange", en(r, (o) => !n.confirm(o && o < 0 ? o : t()))),
1383
+ create: Cn(e.preload, e.explicitLinks, e.actionBase),
1384
+ utils: {
1385
+ go: (r) => window.history.go(r),
1386
+ renderPath: (r) => `#${r}`,
1387
+ parsePath: Ln,
1388
+ beforeLeave: n
1389
+ }
1390
+ })(e);
1391
+ }
1392
+ function xn(e) {
1393
+ const t = at(), n = cn(), {
1394
+ href: r,
1395
+ state: o
1396
+ } = e, i = typeof r == "function" ? r({
1397
+ navigate: t,
1398
+ location: n
1399
+ }) : r;
1400
+ return t(i, {
1401
+ replace: !0,
1402
+ state: o
1403
+ }), null;
1404
+ }
1405
+ const _n = {};
1406
+ async function ke({
1407
+ language: e,
1408
+ text: t,
1409
+ limit: n,
1410
+ start: r,
1411
+ templateName: o
1412
+ }) {
1413
+ const i = `${Je}/search?language=${encodeURIComponent(
1414
+ e
1415
+ )}&q=${encodeURIComponent(t)}&limit=${encodeURIComponent(
1416
+ n
1417
+ )}&start=${encodeURIComponent(r)}&tpl=${encodeURIComponent(o)}`, a = await fetch(i, {
1418
+ method: "GET"
1419
+ });
1420
+ if (a.status !== 200) {
1421
+ const c = await a.text();
1422
+ throw new Error(`API error (${a.status}): ${c}`);
1423
+ }
1424
+ return await a.json();
1425
+ }
1426
+ const On = "_SearchForm_1a5n6_1", In = {
1427
+ SearchForm: On
1428
+ };
1429
+ var Un = /* @__PURE__ */ C("<form><input type=search><button type=submit>");
1430
+ const kn = (e) => {
1431
+ const t = at(), [n, r] = x(e.value ?? ""), {
1432
+ t: o
1433
+ } = ae(e.language);
1434
+ be(K(() => e.value, () => r(e.value ?? "")));
1435
+ const i = async (a) => {
1436
+ a.preventDefault(), t(`/q/${encodeURIComponent(n())}`);
1437
+ };
1438
+ return (() => {
1439
+ var a = Un(), s = a.firstChild, c = s.nextSibling;
1440
+ return a.addEventListener("submit", i), s.addEventListener("change", (l) => r(l.currentTarget.value)), P(c, () => o("searchApp.search")), O((l) => {
1441
+ var u = In.SearchForm, h = o("searchApp.search");
1442
+ return u !== l.e && Qe(a, l.e = u), h !== l.t && ie(s, "placeholder", l.t = h), l;
1443
+ }, {
1444
+ e: void 0,
1445
+ t: void 0
1446
+ }), O(() => s.value = n()), a;
1447
+ })();
1448
+ };
1449
+ var Tn = /* @__PURE__ */ C("<div class=SearchPageResponse>"), Te = /* @__PURE__ */ C("<div>"), Nn = /* @__PURE__ */ C("<img class=SearchPageResponse-spinner width=80 height=80 alt=…>"), Fn = /* @__PURE__ */ C("<button type=button>"), Dn = /* @__PURE__ */ C("<div class=SearchPageResponse-noResultMessage> <span>");
1450
+ function Ne({
1451
+ language: e,
1452
+ limit: t,
1453
+ templateName: n
1454
+ }) {
1455
+ const {
1456
+ t: r
1457
+ } = ae(e), o = un(), [i, a] = x(""), [s, c] = x(0), [l, u] = x(0), [h, p] = x(!1);
1458
+ be(K(() => o.searchString, m));
1459
+ async function m() {
1460
+ if (o.searchString) {
1461
+ p(!0);
1462
+ try {
1463
+ a(""), u(0);
1464
+ const f = await ke({
1465
+ language: e,
1466
+ text: decodeURIComponent(o.searchString),
1467
+ limit: t,
1468
+ start: l(),
1469
+ templateName: n
1470
+ });
1471
+ if (c(f.total), u(l() + t), !f.html)
1472
+ return;
1473
+ a(f.html);
1474
+ } finally {
1475
+ p(!1);
1476
+ }
1477
+ }
1478
+ }
1479
+ async function v() {
1480
+ if (!o.searchString)
1481
+ return;
1482
+ const f = s();
1483
+ if (f === void 0 || l() >= f)
1484
+ return;
1485
+ const d = await ke({
1486
+ language: e,
1487
+ text: decodeURIComponent(o.searchString),
1488
+ limit: t,
1489
+ start: l(),
1490
+ templateName: n
1491
+ });
1492
+ d.html && (a(`${i()}${d.html}`), u(l() + t));
1493
+ }
1494
+ return (() => {
1495
+ var f = Te();
1496
+ return P(f, A(kn, {
1497
+ language: e,
1498
+ get value() {
1499
+ return E(() => !!o.searchString)() ? decodeURIComponent(o.searchString) : void 0;
1500
+ }
1501
+ }), null), P(f, A(q, {
1502
+ get when() {
1503
+ return o.searchString;
1504
+ },
1505
+ get children() {
1506
+ var d = Tn();
1507
+ return P(d, (() => {
1508
+ var S = E(() => !!h());
1509
+ return () => S() ? (() => {
1510
+ var g = Nn();
1511
+ return ie(g, "src", `${Ye}/spinner.svg`), g;
1512
+ })() : A(q, {
1513
+ get when() {
1514
+ return i();
1515
+ },
1516
+ get fallback() {
1517
+ return (() => {
1518
+ var g = Dn(), U = g.firstChild, L = U.nextSibling;
1519
+ return P(g, () => r("searchApp.nothingGet"), U), P(L, () => o.searchString), g;
1520
+ })();
1521
+ },
1522
+ get children() {
1523
+ return [(() => {
1524
+ var g = Te();
1525
+ return O(() => g.innerHTML = i()), g;
1526
+ })(), A(q, {
1527
+ get when() {
1528
+ return l() < s();
1529
+ },
1530
+ get children() {
1531
+ var g = Fn();
1532
+ return g.$$click = v, P(g, () => r("infiniteLoading.loadMore")), g;
1533
+ }
1534
+ })];
1535
+ }
1536
+ });
1537
+ })()), d;
1538
+ }
1539
+ }), null), O(() => Qe(f, _n.SiteApp)), f;
1540
+ })();
1541
+ }
1542
+ se(["click"]);
1543
+ function Bn(e, {
1544
+ language: t
1545
+ }) {
1546
+ if (!t)
1547
+ throw new Error("Missing language");
1548
+ const n = J(e.dataset.limit), r = W(e.dataset.template);
1549
+ n === void 0 || r === void 0 || Ee(() => A(Pn, {
1550
+ explicitLinks: !0,
1551
+ get children() {
1552
+ return [A(pe, {
1553
+ path: "/",
1554
+ component: () => A(xn, {
1555
+ href: "/q"
1556
+ })
1557
+ }), A(pe, {
1558
+ path: "/q",
1559
+ component: () => A(Ne, {
1560
+ language: t,
1561
+ templateName: r,
1562
+ limit: n
1563
+ })
1564
+ }), A(pe, {
1565
+ path: "/q/:searchString",
1566
+ component: () => A(Ne, {
1567
+ language: t,
1568
+ templateName: r,
1569
+ limit: n
1570
+ })
1571
+ })];
1572
+ }
1573
+ }), e);
1574
+ }
1575
+ var Mn = /* @__PURE__ */ C("<input class=SearchOpenerOverlay-input type=search required>"), jn = /* @__PURE__ */ C("<div class=SearchOpenerOverlay><form class=SearchOpenerOverlay-form><button class=SearchOpenerOverlay-btn type=submit>");
1576
+ function qn({
1577
+ searchURL: e,
1578
+ language: t,
1579
+ setSearchFormOverlayIsOpen: n
1580
+ }) {
1581
+ let r;
1582
+ const [o, i] = x(""), {
1583
+ t: a
1584
+ } = ae(t), s = (() => {
1585
+ var l = Mn();
1586
+ return l.addEventListener("change", (u) => i(u.currentTarget.value)), O(() => ie(l, "placeholder", a("searchApp.search"))), O(() => l.value = o()), l;
1587
+ })(), c = (l) => {
1588
+ l.preventDefault(), window.location.href = `${e}#/q/${encodeURIComponent(o())}`, n(!1);
1589
+ };
1590
+ return be(() => {
1591
+ s.focus();
1592
+ }), (() => {
1593
+ var l = jn(), u = l.firstChild, h = u.firstChild;
1594
+ l.$$click = (m) => {
1595
+ m.target === r && n(!1);
1596
+ };
1597
+ var p = r;
1598
+ return typeof p == "function" ? xt(p, l) : r = l, u.addEventListener("submit", c), P(u, s, h), P(h, () => a("searchApp.search")), l;
1599
+ })();
1600
+ }
1601
+ se(["click"]);
1602
+ var Vn = /* @__PURE__ */ C('<button type=button class=SearchOpenerBtn><svg class=SearchOpenerBtn-svg width=20 height=20 version=1.1 id=Capa_1 xmlns=http://www.w3.org/2000/svg viewBox="0 0 490.4 490.4"><title>Search Icon</title><g id=SVGRepo_bgCarrier stroke-width=0></g><g id=SVGRepo_tracerCarrier stroke-linecap=round stroke-linejoin=round></g><g id=SVGRepo_iconCarrier><g><path d="M484.1,454.796l-110.5-110.6c29.8-36.3,47.6-82.8,47.6-133.4c0-116.3-94.3-210.6-210.6-210.6S0,94.496,0,210.796 s94.3,210.6,210.6,210.6c50.8,0,97.4-18,133.8-48l110.5,110.5c12.9,11.8,25,4.2,29.2,0C492.5,475.596,492.5,463.096,484.1,454.796z M41.1,210.796c0-93.6,75.9-169.5,169.5-169.5s169.6,75.9,169.6,169.5s-75.9,169.5-169.5,169.5S41.1,304.396,41.1,210.796z"></path> '), Wn = /* @__PURE__ */ C("<div>");
1603
+ function Gn({
1604
+ searchIconColor: e,
1605
+ language: t,
1606
+ searchURL: n
1607
+ }) {
1608
+ const [r, o] = x(!1), i = (() => {
1609
+ var s = Vn(), c = s.firstChild;
1610
+ return e != null ? c.style.setProperty("fill", e) : c.style.removeProperty("fill"), s;
1611
+ })(), a = Wn();
1612
+ return document.body.appendChild(a), i.addEventListener("click", () => o(!0)), Ee(() => A(q, {
1613
+ get when() {
1614
+ return r();
1615
+ },
1616
+ get children() {
1617
+ return A(qn, {
1618
+ searchURL: n,
1619
+ language: t,
1620
+ setSearchFormOverlayIsOpen: o
1621
+ });
1622
+ }
1623
+ }), a), i;
1624
+ }
1625
+ function Kn(e, {
1626
+ language: t
1627
+ }) {
1628
+ const n = e.dataset.searchUrl, r = e.dataset.iconColor;
1629
+ if (!t)
1630
+ throw new Error("Missing language");
1631
+ if (!n)
1632
+ throw new Error("Missing search url");
1633
+ Ee(() => A(Gn, {
1634
+ language: t,
1635
+ searchURL: n,
1636
+ searchIconColor: r
1637
+ }), e);
1638
+ }
1639
+ document.addEventListener("DOMContentLoaded", () => {
1640
+ const e = document.documentElement.lang, t = {
1641
+ searchOpener: Kn,
1642
+ searchForm: Bn,
1643
+ infiniteLoading: Jt
1644
+ }, n = document.querySelectorAll("[data-effect]");
1645
+ for (const r of n) {
1646
+ const o = r.dataset.effect;
1647
+ if (!o)
1648
+ continue;
1649
+ const i = t[o];
1650
+ i && i(r, {
1651
+ language: e
1652
+ });
1653
+ }
1654
+ });