@museumwnf/viewer-layout 2.17.0 → 2.18.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.
@@ -1,1203 +0,0 @@
1
- import { _ as e, a as t, c as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, o as d, p as f, s as p, t as ee, u as m, v as h } from "./TimelineEventList-D5Hot788.js";
2
- import { Fragment as g, computed as _, createBlock as v, createCommentVNode as y, createElementBlock as b, createElementVNode as x, createSlots as S, createTextVNode as C, createVNode as w, guardReactiveProps as T, isRef as E, mergeProps as D, normalizeClass as O, normalizeProps as k, openBlock as A, reactive as te, ref as j, renderList as M, renderSlot as N, resolveDynamicComponent as ne, toDisplayString as P, unref as F, useSlots as I, vModelCheckbox as L, vModelRadio as re, vModelSelect as R, vModelText as z, withCtx as B, withDirectives as V } from "vue";
3
- import { I18nText as H, NotFoundView as ie, byId as U, centuryPresets as W, citation as ae, dateRange as oe, entityRef as se, eventDateLabel as G, groupByCountry as ce, languageLabels as K, md as q, partnerHierarchy as J, partnerView as Y, renderBlock as X, renderInline as Z, renderPlain as Q, sheetRows as le, sortChronological as ue, sourceUrl as de, useDataPackage as fe, useFacets as pe, useGlossaryPopup as me, useI18n as he, useListQuery as $, useLocale as ge, usePagination as _e, useProjects as ve, useRecordSheet as ye, useRelatedRecords as be, useSearchLanguage as xe, useTimelineEvents as Se, yearBuckets as Ce } from "@museumwnf/viewer-core";
4
- import { useRoute as we, useRouter as Te } from "vue-router";
5
- //#region src/views/CatalogueResultsView.vue
6
- var Ee = { class: "mwnf-catalogue" }, De = {
7
- key: 0,
8
- class: "mwnf-catalogue__title"
9
- }, Oe = {
10
- key: 0,
11
- class: "mwnf-facet"
12
- }, ke = {
13
- key: 0,
14
- class: "mwnf-facet__label"
15
- }, Ae = [
16
- "value",
17
- "placeholder",
18
- "onInput"
19
- ], je = {
20
- key: 1,
21
- class: "mwnf-facet"
22
- }, Me = {
23
- key: 0,
24
- class: "mwnf-facet__label"
25
- }, Ne = [
26
- "value",
27
- "placeholder",
28
- "onInput"
29
- ], Pe = {
30
- key: 2,
31
- class: "mwnf-facet mwnf-facet--checkbox"
32
- }, Fe = ["checked", "onChange"], Ie = {
33
- key: 0,
34
- class: "mwnf-facet__label"
35
- }, Le = { class: "mwnf-catalogue__body" }, Re = { class: "mwnf-catalogue__results" }, ze = {
36
- key: 0,
37
- class: "mwnf-catalogue__aside"
38
- }, Be = {
39
- __name: "CatalogueResultsView",
40
- props: {
41
- spec: {
42
- type: Object,
43
- required: !0
44
- },
45
- entity: {
46
- type: String,
47
- default: ""
48
- }
49
- },
50
- setup(t) {
51
- let n = t, { t: r, locale: s } = he(), c = fe(), u = n.spec.entity ?? n.entity, d = _(() => n.spec), p = se(u);
52
- u && c.loadTranslations(u, "en");
53
- let ee = _(() => d.value.keys ?? [...Object.keys(d.value.facets ?? {}), ...m()]);
54
- function m() {
55
- let e = d.value.dates;
56
- return e ? [e.begin ?? "begin", e.end ?? "end"] : [];
57
- }
58
- let { filters: h, page: E, active: D, apply: O, reset: te, goToPage: j } = $({ keys: ee.value }), I = {
59
- t: r,
60
- locale: s,
61
- tr: (e, t) => c.tr(e, t, s.value, "en"),
62
- renderInline: Z,
63
- renderPlain: Q
64
- };
65
- function L(e, t) {
66
- if (typeof t.values == "function") return [t.values(e)].flat();
67
- let n = e?.[t.field];
68
- return Array.isArray(n) ? n : [n];
69
- }
70
- let re = _(() => {
71
- let e = d.value, t = p.value ?? [];
72
- e.scope && (t = t.filter((t) => e.scope(t, h, I)));
73
- for (let [n, r] of Object.entries(e.facets ?? {})) {
74
- let e = h[n];
75
- e && (t = t.filter((t) => L(t, r).map(String).includes(String(e))));
76
- }
77
- e.match && (t = t.filter((t) => e.match(t, h, I))), e.narrow && (t = e.narrow(t, h, I)), e.dates && (t = oe(t, {
78
- begin: h[e.dates.begin ?? "begin"],
79
- end: h[e.dates.end ?? "end"],
80
- mode: e.dates.mode ?? "overlap",
81
- fields: e.dates.fields
82
- }));
83
- let n = e.sort ?? "chronological";
84
- return typeof n == "function" ? n(t) : n === "chronological" ? ue(t) : n && typeof n == "object" ? ue(t, n) : t;
85
- }), R = _(() => d.value.facetScope === "matching" ? re.value : p.value ?? []), z = pe(R, () => d.value.facets ?? {}), V = _e(re, {
86
- page: E,
87
- size: () => d.value.pageSize ?? 20
88
- }), H = _(() => d.value.recordRoute ?? (n.entity ? `${n.entity}-detail` : "item"));
89
- function ie(e) {
90
- let t = I.tr(u, e.id).name ?? e.internal_name ?? e.id;
91
- return {
92
- id: e.id,
93
- image: e.images?.[0]?.url ?? "",
94
- imageAlt: Q(String(t)),
95
- name: Z(String(t)),
96
- meta: [],
97
- badge: e.type ?? "",
98
- to: {
99
- name: H.value,
100
- params: { id: e.id }
101
- }
102
- };
103
- }
104
- let U = _(() => V.value.rows.map((e) => (d.value.record ?? ie)(e, I))), W = _(() => ({
105
- filters: h,
106
- active: D.value,
107
- apply: O,
108
- reset: te,
109
- goToPage: j,
110
- matching: re.value,
111
- pageInfo: V.value,
112
- options: z.value
113
- })), ae = _(() => {
114
- let e = d.value;
115
- return e.summary ? e.summary({
116
- ...W.value,
117
- t: r,
118
- total: (p.value ?? []).length
119
- }) : [{
120
- label: r(e.summaryLabel ?? "catalogue.results.itemsFound"),
121
- count: V.value.total
122
- }];
123
- }), G = _(() => d.value.filterMode ?? "apply"), ce = _(() => d.value.controls ?? []), K = _(() => ce.value.length > 0 || !!d.value.panel);
124
- function q(e, t) {
125
- G.value === "immediate" ? O({ [e]: t }) : h[e] = t;
126
- }
127
- let J = _(() => r(d.value.empty ?? "catalogue.results.noResultsFilter")), Y = _(() => d.value.variant === "grid"), X = _(() => ({
128
- window: 5,
129
- jump: !1,
130
- ends: !0,
131
- ...d.value.pagination ?? {}
132
- }));
133
- return (t, n) => (A(), b("section", Ee, [
134
- N(t.$slots, "before", k(T(W.value))),
135
- d.value.title ? (A(), b("h1", De, P(F(r)(d.value.title)), 1)) : y("", !0),
136
- K.value || t.$slots.filters ? (A(), v(f, {
137
- key: 1,
138
- class: "mwnf-catalogue__filters",
139
- mode: G.value,
140
- title: d.value.filterTitle ? F(r)(d.value.filterTitle) : "",
141
- "reset-label": d.value.resetLabel ? F(r)(d.value.resetLabel) : "",
142
- onApply: n[2] ||= (e) => F(O)(),
143
- onReset: n[3] ||= (e) => F(te)()
144
- }, {
145
- default: B(() => [(A(!0), b(g, null, M(ce.value, (e) => (A(), b(g, { key: e.key }, [e.type === "year" ? (A(), b("label", Oe, [e.label ? (A(), b("span", ke, P(F(r)(e.label)), 1)) : y("", !0), x("input", {
146
- type: "number",
147
- class: "mwnf-facet__select",
148
- value: F(h)[e.key],
149
- placeholder: e.placeholder ? F(r)(e.placeholder) : "",
150
- onInput: (t) => F(h)[e.key] = t.target.value,
151
- onChange: n[0] ||= (e) => G.value === "immediate" ? F(O)() : null
152
- }, null, 40, Ae)])) : e.type === "query" ? (A(), b("label", je, [e.label ? (A(), b("span", Me, P(F(r)(e.label)), 1)) : y("", !0), x("input", {
153
- type: "text",
154
- class: "mwnf-facet__select",
155
- value: F(h)[e.key],
156
- placeholder: e.placeholder ? F(r)(e.placeholder) : "",
157
- onInput: (t) => F(h)[e.key] = t.target.value,
158
- onChange: n[1] ||= (e) => G.value === "immediate" ? F(O)() : null
159
- }, null, 40, Ne)])) : e.type === "checkbox" ? (A(), b("label", Pe, [x("input", {
160
- type: "checkbox",
161
- class: "mwnf-facet__checkbox",
162
- checked: F(h)[e.key] === "1",
163
- onChange: (t) => q(e.key, t.target.checked ? "1" : "")
164
- }, null, 40, Fe), e.label ? (A(), b("span", Ie, P(F(r)(e.label)), 1)) : y("", !0)])) : (A(), v(l, {
165
- key: 3,
166
- "model-value": F(h)[e.key],
167
- label: e.label ? F(r)(e.label) : "",
168
- options: F(z)[e.key] ?? [],
169
- placeholder: e.placeholder ? F(r)(e.placeholder) : "",
170
- "any-label": e.anyLabel ? F(r)(e.anyLabel) : "",
171
- "hide-empty": !!e.hideEmpty,
172
- "onUpdate:modelValue": (t) => q(e.key, t)
173
- }, null, 8, [
174
- "model-value",
175
- "label",
176
- "options",
177
- "placeholder",
178
- "any-label",
179
- "hide-empty",
180
- "onUpdate:modelValue"
181
- ]))], 64))), 128)), N(t.$slots, "filters", k(T(W.value)))]),
182
- _: 3
183
- }, 8, [
184
- "mode",
185
- "title",
186
- "reset-label"
187
- ])) : y("", !0),
188
- w(i, { parts: ae.value }, S({ _: 2 }, [t.$slots.actions ? {
189
- name: "actions",
190
- fn: B(() => [N(t.$slots, "actions", k(T(W.value)))]),
191
- key: "0"
192
- } : void 0]), 1032, ["parts"]),
193
- x("div", Le, [x("div", Re, [(A(), v(ne(Y.value ? a : e), {
194
- records: U.value,
195
- "action-label": d.value.actionLabel ? F(r)(d.value.actionLabel) : ""
196
- }, {
197
- empty: B(() => [N(t.$slots, "empty", k(T(W.value)), () => [C(P(J.value), 1)])]),
198
- _: 3
199
- }, 8, ["records", "action-label"])), w(o, {
200
- "page-info": F(V),
201
- window: X.value.window,
202
- jump: X.value.jump,
203
- ends: X.value.ends,
204
- onNavigate: F(j)
205
- }, null, 8, [
206
- "page-info",
207
- "window",
208
- "jump",
209
- "ends",
210
- "onNavigate"
211
- ])]), t.$slots.aside ? (A(), b("aside", ze, [N(t.$slots, "aside", k(T(W.value)))])) : y("", !0)]),
212
- N(t.$slots, "after", k(T(W.value)))
213
- ]));
214
- }
215
- }, Ve = ["dir", "innerHTML"], He = { class: "mwnf-record__body" }, Ue = { class: "mwnf-record__main" }, We = {
216
- key: 1,
217
- class: "mwnf-record__status"
218
- }, Ge = {
219
- key: 0,
220
- class: "mwnf-record__aside"
221
- }, Ke = {
222
- key: 2,
223
- class: "mwnf-record__status"
224
- }, qe = {
225
- __name: "RecordView",
226
- props: {
227
- spec: {
228
- type: Object,
229
- required: !0
230
- },
231
- id: {
232
- type: String,
233
- required: !0
234
- },
235
- entity: {
236
- type: String,
237
- default: ""
238
- }
239
- },
240
- setup(e) {
241
- let i = e, { t: a, locale: o } = he(), l = fe(), u = ve(), f = I(), ee = we(), E = i.spec.entity ?? i.entity, D = _(() => i.spec), O = se(E), te = U(E), j = _(() => te.value.get(i.id) ?? null), ne = _(() => O.value !== null), { language: L, languages: re, dir: R, select: z, text: V, ready: H, terms: W, glossary: oe, attribution: G } = ye(j, {
242
- entity: E,
243
- translations: i.spec.translations ?? [],
244
- attribution: i.spec.attribution ?? []
245
- }), ce = _(() => K(re.value)), { active: q, onClick: J, close: Y } = me(W), ue = _(() => q.value ? X(q.value.definition, { breaks: !0 }) : ""), pe = (e, t) => l.tr(e, t, L.value, "en"), $ = _(() => ({
246
- record: j.value,
247
- text: V.value,
248
- language: L.value,
249
- languages: ce.value,
250
- select: z,
251
- dir: R.value,
252
- glossary: oe.value,
253
- ready: H.value,
254
- attribution: G.value,
255
- t: a,
256
- tr: pe
257
- }));
258
- function ge(e) {
259
- return ((typeof e == "function" ? e($.value) : e) ?? []).map((e) => ({
260
- ...e,
261
- label: e.label ? a(e.label) : ""
262
- }));
263
- }
264
- let _e = _(() => j.value ? le(ge(D.value.fields), $.value) : []), xe = _(() => j.value ? le(ge(D.value.sections).map((e) => ({
265
- render: "block",
266
- ...e
267
- })), $.value) : []), Se = _(() => D.value.shortDescription === !1 ? "" : D.value.shortDescription ?? "short_description"), Ce = _(() => {
268
- let e = Se.value ? V.value[Se.value] : "";
269
- return e ? { html: X(String(e), {
270
- breaks: !0,
271
- glossary: oe.value
272
- }) } : null;
273
- }), Te = _(() => {
274
- if (!j.value) return "";
275
- if (D.value.title) return D.value.title($.value);
276
- let e = V.value.name ?? j.value.internal_name ?? j.value.id;
277
- return Z(String(e), { glossary: oe.value });
278
- }), Ee = _(() => {
279
- if (!j.value) return [];
280
- if (D.value.media) return D.value.media(j.value, $.value);
281
- let e = Q(String(V.value.name ?? j.value.internal_name ?? ""));
282
- return (j.value.images ?? []).map((t) => ({
283
- url: t.url,
284
- alt: t.captions?.[L.value] ?? e,
285
- caption: t.captions?.[L.value] ?? t.captions?.en ?? "",
286
- photographer: t.photographer ?? "",
287
- copyright: t.copyright ?? ""
288
- }));
289
- }), De = [
290
- {
291
- field: "author",
292
- label: "sheet.field.preparedBy"
293
- },
294
- {
295
- field: "copy_editor",
296
- label: "sheet.field.copyeditedBy"
297
- },
298
- {
299
- field: "translator",
300
- label: "sheet.field.translationBy"
301
- },
302
- {
303
- field: "translation_copy_editor",
304
- label: "sheet.field.translationCopyeditedBy"
305
- }
306
- ], Oe = _(() => (D.value.credits ?? De).map(({ field: e, label: t }) => ({
307
- label: a(t),
308
- value: V.value[e] ?? G.value[e] ?? ""
309
- })).filter((e) => e.value)), ke = _(() => String(j.value?.[D.value.workingNumber ?? "mwnf_reference"] ?? "")), Ae = _(() => {
310
- let e = D.value.citation;
311
- if (!j.value || e === !1) return "";
312
- let t = typeof e?.project == "function" ? null : e?.project ?? j.value.project_id, n = typeof e?.project == "function" ? e.project(j.value, $.value) : u.label(t), r = e?.permalink === !1 ? void 0 : typeof e?.permalink == "string" ? e.permalink : de(ee) ?? void 0;
313
- return ae({
314
- author: V.value.author ?? G.value.author,
315
- name: V.value.name ?? j.value.internal_name ?? "",
316
- project: n,
317
- permalink: r,
318
- inWord: a("record.citation.in")
319
- });
320
- }), je = be(j, {
321
- entity: E,
322
- language: L
323
- }), Me = _(() => D.value.related === !1 ? null : D.value.related ?? {}), Ne = _(() => {
324
- if (!Me.value) return [];
325
- let e = Me.value.record ?? Pe;
326
- return je.value.inPackage.map((t) => e(t, $.value));
327
- });
328
- function Pe({ record: e, justification: t }) {
329
- let n = pe(E, e.id).name ?? e.internal_name ?? e.id;
330
- return {
331
- id: e.id,
332
- image: e.images?.[0]?.url ?? "",
333
- imageAlt: Q(String(n)),
334
- name: Z(String(n)),
335
- meta: t ? [t] : [],
336
- badge: e.type ?? "",
337
- to: {
338
- name: D.value.route ?? (i.entity ? `${i.entity}-detail` : "item"),
339
- params: { id: e.id }
340
- }
341
- };
342
- }
343
- let Fe = /* @__PURE__ */ new Set([
344
- "header",
345
- "before-sheet",
346
- "after-sheet",
347
- "aside",
348
- "source",
349
- "related",
350
- "after",
351
- "default"
352
- ]), Ie = _(() => Object.keys(f).filter((e) => !Fe.has(e)));
353
- return (e, i) => ne.value && !j.value ? (A(), v(F(ie), { key: 0 })) : j.value ? (A(), b("article", {
354
- key: 1,
355
- class: "mwnf-record",
356
- onClick: i[0] ||= (...e) => F(J) && F(J)(...e)
357
- }, [
358
- N(e.$slots, "header", k(T($.value)), () => [
359
- D.value.back ? (A(), v(h, {
360
- key: 0,
361
- class: "mwnf-record__back",
362
- to: D.value.back.to,
363
- href: D.value.back.href
364
- }, {
365
- default: B(() => [C("← " + P(F(a)(D.value.back.label)), 1)]),
366
- _: 1
367
- }, 8, ["to", "href"])) : y("", !0),
368
- w(r, {
369
- languages: ce.value,
370
- language: F(L),
371
- onSelect: F(z)
372
- }, null, 8, [
373
- "languages",
374
- "language",
375
- "onSelect"
376
- ]),
377
- x("h1", {
378
- class: "mwnf-record__title",
379
- dir: F(R) || void 0,
380
- innerHTML: Te.value
381
- }, null, 8, Ve)
382
- ]),
383
- x("div", He, [x("div", Ue, [
384
- Ee.value.length ? (A(), v(t, {
385
- key: 0,
386
- images: Ee.value,
387
- variant: D.value.mediaVariant ?? ""
388
- }, null, 8, ["images", "variant"])) : y("", !0),
389
- F(H) ? y("", !0) : (A(), b("p", We, P(F(a)("core.status.loading")), 1)),
390
- N(e.$slots, "before-sheet", k(T($.value))),
391
- w(m, {
392
- rows: _e.value,
393
- layout: D.value.layout ?? "table",
394
- dir: F(R),
395
- "short-description": Ce.value,
396
- "short-description-after": D.value.shortDescriptionAfter ?? "description"
397
- }, S({ _: 2 }, [M(Ie.value, (t) => ({
398
- name: t,
399
- fn: B((n) => [N(e.$slots, t, k(T({
400
- ...n,
401
- ...$.value
402
- })))])
403
- }))]), 1032, [
404
- "rows",
405
- "layout",
406
- "dir",
407
- "short-description",
408
- "short-description-after"
409
- ]),
410
- (A(!0), b(g, null, M(xe.value, (e) => (A(), v(c, {
411
- key: e.key,
412
- heading: e.label,
413
- html: e.html,
414
- dir: F(R)
415
- }, null, 8, [
416
- "heading",
417
- "html",
418
- "dir"
419
- ]))), 128)),
420
- N(e.$slots, "after-sheet", k(T($.value))),
421
- w(n, {
422
- credits: Oe.value,
423
- "working-number": ke.value,
424
- "working-number-label": F(a)("sheet.field.workingNumber"),
425
- citation: Ae.value,
426
- "citation-heading": D.value.citation?.heading ? F(a)(D.value.citation.heading) : ""
427
- }, null, 8, [
428
- "credits",
429
- "working-number",
430
- "working-number-label",
431
- "citation",
432
- "citation-heading"
433
- ]),
434
- N(e.$slots, "source", k(T($.value)), () => [w(p)]),
435
- N(e.$slots, "related", k(T({
436
- ...$.value,
437
- records: Ne.value,
438
- outside: F(je).outside
439
- })), () => [Me.value ? (A(), v(d, {
440
- key: 0,
441
- heading: F(a)(Me.value.heading ?? "record.related.items"),
442
- records: Ne.value,
443
- variant: Me.value.variant ?? "list",
444
- "action-label": Me.value.actionLabel ? F(a)(Me.value.actionLabel) : ""
445
- }, null, 8, [
446
- "heading",
447
- "records",
448
- "variant",
449
- "action-label"
450
- ])) : y("", !0)])
451
- ]), e.$slots.aside ? (A(), b("aside", Ge, [N(e.$slots, "aside", k(T($.value)))])) : y("", !0)]),
452
- N(e.$slots, "after", k(T($.value))),
453
- w(s, {
454
- term: F(q),
455
- html: ue.value,
456
- dir: F(R),
457
- onClose: F(Y)
458
- }, null, 8, [
459
- "term",
460
- "html",
461
- "dir",
462
- "onClose"
463
- ])
464
- ])) : (A(), b("p", Ke, P(F(a)("core.status.loading")), 1));
465
- }
466
- }, Je = { class: "mwnf-partner-list" }, Ye = {
467
- key: 0,
468
- class: "mwnf-partner-list__title"
469
- }, Xe = {
470
- key: 1,
471
- class: "mwnf-partner-list__count"
472
- }, Ze = {
473
- key: 2,
474
- class: "mwnf-partner-list__toggle"
475
- }, Qe = {
476
- key: 3,
477
- class: "mwnf-partner-list__groups"
478
- }, $e = {
479
- key: 0,
480
- class: "mwnf-partner-list__group-title"
481
- }, et = { class: "mwnf-partner-list__tier" }, tt = { class: "mwnf-partner-list__row" }, nt = {
482
- key: 0,
483
- class: "mwnf-partner-list__children"
484
- }, rt = {
485
- key: 0,
486
- class: "mwnf-partner-list__tier mwnf-partner-list__tier--associated"
487
- }, it = { class: "mwnf-partner-list__tier-label" }, at = {
488
- key: 4,
489
- class: "mwnf-partner-list__empty"
490
- }, ot = {
491
- __name: "PartnerListView",
492
- props: { spec: {
493
- type: Object,
494
- required: !0
495
- } },
496
- setup(e) {
497
- let t = e, { t: n, locale: r } = he(), i = fe(), a = _(() => t.spec), o = _(() => a.value.entity ?? "partners"), s = se(o.value);
498
- o.value && i.loadTranslations(o.value, "en");
499
- let c = {
500
- t: n,
501
- locale: r,
502
- tr: (e) => i.tr(o.value, e, r.value, "en"),
503
- renderInline: Z,
504
- renderPlain: Q
505
- }, { filters: l, apply: d } = $({
506
- keys: ["order"],
507
- page: !1
508
- }), f = _(() => l.order === "desc" ? "desc" : "asc");
509
- function p() {
510
- d({ order: f.value === "asc" ? "desc" : "asc" });
511
- }
512
- let ee = _(() => {
513
- let e = a.value, t = s.value ?? [];
514
- return e.scope ? t.filter((t) => e.scope(t, c)) : t;
515
- }), m = _(() => a.value.route);
516
- function h(e) {
517
- let t = m.value;
518
- return t ? typeof t == "function" ? t(e, c) : {
519
- name: t,
520
- params: { id: e.id }
521
- } : null;
522
- }
523
- function S(e) {
524
- let t = a.value.objectsRoute;
525
- return Y(e, c.tr(e.id), {
526
- route: h,
527
- objectsRoute: t ? (e) => t(e, c) : null
528
- });
529
- }
530
- function C(e, t) {
531
- let n = t.name ?? "";
532
- return {
533
- ...Y(e, {}, {}),
534
- name: n,
535
- plainName: O(n),
536
- city: t.city ?? "",
537
- location: t.city ?? "",
538
- logos: t.logo ? [{
539
- url: t.logo,
540
- alt: O(n),
541
- type: ""
542
- }] : [],
543
- itemCount: t.count ?? 0,
544
- route: t.route ?? null
545
- };
546
- }
547
- function E(e) {
548
- if (a.value.record) {
549
- let t = a.value.record(e, c);
550
- return {
551
- partner: e,
552
- row: t,
553
- view: C(e, t)
554
- };
555
- }
556
- let t = S(e);
557
- return {
558
- partner: e,
559
- row: {
560
- name: t.name,
561
- city: t.city,
562
- logo: t.logos[0]?.url ?? "",
563
- count: t.itemCount,
564
- route: t.route
565
- },
566
- view: t
567
- };
568
- }
569
- function O(e) {
570
- return String(e ?? "").replace(/<[^>]*>/g, "");
571
- }
572
- let te = _(() => a.value.nested ? J(ee.value) : null), j = _(() => {
573
- let e = a.value, t = e.group?.tier ?? !1, n = (e.group?.order ?? "country") === "name", r = n ? ee.value.map((e) => ({
574
- ...e,
575
- country_id: "\0"
576
- })) : ee.value, i = ce(r, {
577
- label: n ? () => "" : (t) => e.label ? e.label(t, c) : t,
578
- tier: t,
579
- order: f.value
580
- }), o = (e, t) => O(e.row.name).localeCompare(O(t.row.name));
581
- return i.map((t) => {
582
- let r = t.main.map(E).sort(o), i = t.associated.map(E).sort(o);
583
- if (n && f.value === "desc" && (r.reverse(), i.reverse()), e.nested && te.value) {
584
- let e = new Set(i.map((e) => e.partner.id));
585
- r = r.map((t) => {
586
- let n = te.value.children(t.partner.id).filter((t) => e.has(t.id));
587
- for (let t of n) e.delete(t.id);
588
- return {
589
- ...t,
590
- children: n.map(E)
591
- };
592
- }), i = i.filter((t) => e.has(t.partner.id));
593
- }
594
- return {
595
- country: t.country,
596
- label: t.label,
597
- main: r,
598
- associated: i
599
- };
600
- });
601
- }), F = _(() => j.value.some((e) => e.main.length > 0 || e.associated.length > 0)), I = _(() => n(a.value.associatedLabel ?? "partner.list.associated")), L = _(() => ({
602
- objectsLabel: a.value.objectsLabel ?? "partner.item.objectsInSite",
603
- emptyLabel: a.value.emptyLabel ?? "",
604
- show: { actions: !!a.value.actions }
605
- })), re = _(() => n(a.value.foundLabel ?? "partner.list.partnersFound")), R = _(() => n(a.value.sortAscendingLabel ?? "partner.list.sortAscending")), z = _(() => n(a.value.sortDescendingLabel ?? "partner.list.sortDescending")), V = _(() => n(a.value.empty ?? "catalogue.results.noResults")), H = _(() => a.value.title ? n(a.value.title) : ""), ie = _(() => j.value.reduce((e, t) => e + t.main.length + t.associated.length, 0)), U = _(() => a.value.variant ?? "accordion"), W = _(() => ({
606
- t: n,
607
- locale: r,
608
- groups: j.value,
609
- orderDir: f.value,
610
- toggleOrder: p
611
- }));
612
- return (e, t) => (A(), b("section", Je, [
613
- H.value ? (A(), b("h1", Ye, P(H.value), 1)) : y("", !0),
614
- a.value.count ? (A(), b("div", Xe, P(re.value) + ": " + P(ie.value), 1)) : y("", !0),
615
- N(e.$slots, "before", k(T(W.value))),
616
- a.value.orderToggle ? (A(), b("div", Ze, [x("button", {
617
- type: "button",
618
- class: "mwnf-partner-list__toggle-button",
619
- onClick: p
620
- }, P(f.value === "asc" ? z.value : R.value), 1)])) : y("", !0),
621
- F.value ? (A(), b("div", Qe, [(A(!0), b(g, null, M(j.value, (t) => (A(), v(ne(U.value === "accordion" ? "details" : "section"), D({
622
- key: t.country ?? "",
623
- class: "mwnf-partner-list__group"
624
- }, { ref_for: !0 }, U.value === "accordion" ? { open: !0 } : {}), {
625
- default: B(() => [
626
- (A(), v(ne(U.value === "accordion" ? "summary" : "div"), { class: "mwnf-partner-list__group-heading" }, {
627
- default: B(() => [N(e.$slots, "group-heading", D({ group: t }, { ref_for: !0 }, W.value), () => [t.label ? (A(), b("h2", $e, P(t.label), 1)) : y("", !0)])]),
628
- _: 2
629
- }, 1024)),
630
- x("div", et, [(A(!0), b(g, null, M(t.main, (n) => (A(), b("div", {
631
- key: n.partner.id,
632
- class: "mwnf-partner-list__row-block"
633
- }, [x("div", tt, [N(e.$slots, "row", D({
634
- group: t,
635
- partner: n.partner,
636
- row: n.row,
637
- view: n.view
638
- }, { ref_for: !0 }, W.value), () => [w(u, D({
639
- variant: "line",
640
- partner: n.view
641
- }, { ref_for: !0 }, L.value), null, 16, ["partner"])])]), n.children?.length ? (A(), b("div", nt, [(A(!0), b(g, null, M(n.children, (n) => (A(), b("div", {
642
- key: n.partner.id,
643
- class: "mwnf-partner-list__row mwnf-partner-list__row--child"
644
- }, [N(e.$slots, "row", D({
645
- group: t,
646
- partner: n.partner,
647
- row: n.row,
648
- view: n.view
649
- }, { ref_for: !0 }, W.value), () => [w(u, D({
650
- variant: "line",
651
- partner: n.view
652
- }, { ref_for: !0 }, L.value), null, 16, ["partner"])])]))), 128))])) : y("", !0)]))), 128))]),
653
- t.associated.length ? (A(), b("div", rt, [x("p", it, P(I.value), 1), (A(!0), b(g, null, M(t.associated, (n) => (A(), b("div", {
654
- key: n.partner.id,
655
- class: "mwnf-partner-list__row"
656
- }, [N(e.$slots, "row", D({
657
- group: t,
658
- partner: n.partner,
659
- row: n.row,
660
- view: n.view
661
- }, { ref_for: !0 }, W.value), () => [w(u, D({
662
- variant: "line",
663
- partner: n.view
664
- }, { ref_for: !0 }, L.value), null, 16, ["partner"])])]))), 128))])) : y("", !0)
665
- ]),
666
- _: 2
667
- }, 1040))), 128))])) : (A(), b("p", at, P(V.value), 1)),
668
- N(e.$slots, "after", k(T(W.value)))
669
- ]));
670
- }
671
- }, st = { class: "mwnf-text-page" }, ct = {
672
- key: 0,
673
- class: "mwnf-text-page__back"
674
- }, lt = {
675
- key: 1,
676
- class: "mwnf-text-page__heading"
677
- }, ut = { class: "mwnf-prose" }, dt = ["innerHTML"], ft = {
678
- __name: "TextPageView",
679
- props: { spec: {
680
- type: Object,
681
- required: !0
682
- } },
683
- setup(e) {
684
- let t = e, { t: n } = he(), r = fe(), i = ge(), a = _(() => t.spec.heading ? n(t.spec.heading) : ""), o = _(() => typeof t.spec.body == "string"), s = _(() => o.value ? t.spec.body : null), c = _(() => ({
685
- t: n,
686
- tr: (e, t) => r.tr(e, t, i.value, "en"),
687
- language: i.value
688
- })), l = _(() => o.value ? null : typeof t.spec.body == "function" ? q(t.spec.body(c.value)) : null), u = _(() => t.spec.back === !1 ? null : t.spec.back === !0 ? n("core.action.back") : t.spec.back?.label ? n(t.spec.back.label) : null);
689
- return (e, n) => (A(), b("div", st, [
690
- u.value && (t.spec.back === !0 || t.spec.back?.to || t.spec.back?.href) ? (A(), b("div", ct, [w(h, {
691
- to: t.spec.back === !0 ? {} : t.spec.back?.to,
692
- href: t.spec.back === !0 ? "#" : t.spec.back?.href
693
- }, {
694
- default: B(() => [C(" ← " + P(u.value), 1)]),
695
- _: 1
696
- }, 8, ["to", "href"])])) : y("", !0),
697
- a.value ? (A(), b("h1", lt, P(a.value), 1)) : y("", !0),
698
- x("div", ut, [o.value ? (A(), v(F(H), {
699
- key: 0,
700
- keypath: s.value
701
- }, null, 8, ["keypath"])) : l.value ? (A(), b("div", {
702
- key: 1,
703
- innerHTML: l.value
704
- }, null, 8, dt)) : y("", !0)])
705
- ]));
706
- }
707
- }, pt = { class: "mwnf-search-form__row-label" }, mt = ["onUpdate:modelValue"], ht = ["value"], gt = ["onUpdate:modelValue"], _t = ["value"], vt = ["onUpdate:modelValue", "placeholder"], yt = {
708
- key: 0,
709
- class: "mwnf-search-form__dates"
710
- }, bt = {
711
- key: 1,
712
- class: "mwnf-facet"
713
- }, xt = { class: "mwnf-facet__label" }, St = { value: "" }, Ct = ["value"], wt = {
714
- key: 0,
715
- class: "mwnf-search-form__dates"
716
- }, Tt = { class: "mwnf-search-form__radio-choice" }, Et = ["value"], Dt = ["onUpdate:modelValue", "disabled"], Ot = ["onUpdate:modelValue"], kt = { class: "mwnf-facet__label" }, At = {
717
- key: 0,
718
- class: "mwnf-search-form__how-to"
719
- }, jt = {
720
- __name: "SearchFormView",
721
- props: { spec: {
722
- type: Object,
723
- required: !0
724
- } },
725
- setup(e) {
726
- let t = e, { t: n } = he(), r = Te(), i = _(() => t.spec), a = _(() => i.value.mode), o = _(() => i.value.entity ? se(i.value.entity).value ?? [] : []), s = _(() => i.value.dates === "buckets"), c = _(() => {
727
- let e = i.value.dates;
728
- if (!e || e === "buckets") return null;
729
- let t = e.presets;
730
- return typeof t == "function" ? t() : t ?? W();
731
- });
732
- function u(e) {
733
- return (e ?? []).map((e) => ({
734
- value: e,
735
- label: String(e)
736
- }));
737
- }
738
- let d = _(() => s.value ? Ce(o.value, n) : []), p = _(() => s.value ? d.value : u(c.value?.from)), ee = _(() => s.value ? d.value : u(c.value?.to)), m = _(() => !!i.value.dates), S = j(""), D = j(""), ne = i.value.language ? xe(i.value.language) : null, I = _(() => ne?.languages.value ?? []), H = ne?.language ?? j(""), ie = _(() => Object.fromEntries((i.value.facets ?? []).filter((e) => !e.options && e.type !== "year").map((e) => [e.key, { field: e.field ?? e.key }]))), U = pe(o, ie), ae = _(() => {
739
- let e = {};
740
- for (let t of i.value.facets ?? []) e[t.key] = t.options ?? U.value[t.key] ?? [];
741
- return e;
742
- }), oe = [{
743
- key: "AND",
744
- label: "catalogue.search.and"
745
- }, {
746
- key: "OR",
747
- label: "catalogue.search.or"
748
- }], G = [
749
- "catalogue.search.keywordOne",
750
- "catalogue.search.keywordTwo",
751
- "catalogue.search.keywordThree"
752
- ], ce = _(() => i.value.operators ?? oe), K = j(Array.from({ length: i.value.rows ?? 3 }, () => ({
753
- keyword: "",
754
- field: i.value.fields?.[0]?.key ?? "",
755
- cond: (i.value.operators ?? oe)[0].key
756
- })));
757
- function q(e) {
758
- return G[e] ? n(G[e]) : "";
759
- }
760
- let J = j(i.value.facets?.[0]?.key ?? ""), Y = te(Object.fromEntries((i.value.facets ?? []).map((e) => [e.key, ""]))), X = te(Object.fromEntries((i.value.extras ?? []).map((e) => [e.key, !1])));
761
- function Z() {
762
- let e = {};
763
- for (let t of i.value.extras ?? []) X[t.key] && (e[t.key] = "1");
764
- return e;
765
- }
766
- function Q(e) {
767
- return r.push({
768
- name: i.value.target,
769
- query: e
770
- });
771
- }
772
- function le() {
773
- let e = {};
774
- if (a.value === "rows") K.value.forEach((t, n) => {
775
- if (t.keyword) {
776
- if (n === 0) e.q = t.keyword, t.field && (e.field = t.field);
777
- else {
778
- let r = n + 1;
779
- e[`q${r}`] = t.keyword, t.field && (e[`field${r}`] = t.field), e[`op${r}`] = t.cond;
780
- }
781
- }
782
- }), S.value && (e.from = String(S.value)), D.value && (e.to = String(D.value)), H.value && (e.lang = H.value);
783
- else if (a.value === "radio") {
784
- let t = J.value, n = t ? Y[t] : "";
785
- n && (e[t] = String(n));
786
- }
787
- return Object.assign(e, Z()), Q(e);
788
- }
789
- function ue(e, t) {
790
- if (t !== "" && t != null) return Q({
791
- [e]: String(t),
792
- ...Z()
793
- });
794
- }
795
- function de() {
796
- return Q(Z());
797
- }
798
- let fe = _(() => a.value === "facets" ? "immediate" : "apply"), me = _(() => a.value === "radio" ? "core.action.browse" : "core.action.search"), $ = _(() => n(i.value.submitLabel ?? me.value)), ge = _(() => n(i.value.showAllLabel ?? "core.action.reset")), _e = _(() => ({
799
- mode: a.value,
800
- submit: le,
801
- showAll: de
802
- }));
803
- return (e, t) => (A(), b("section", { class: O(["mwnf-search-form", `mwnf-search-form--${a.value}`]) }, [
804
- N(e.$slots, "intro", k(T(_e.value))),
805
- N(e.$slots, "before", k(T(_e.value))),
806
- w(f, {
807
- class: "mwnf-search-form__panel",
808
- mode: fe.value,
809
- "apply-label": $.value,
810
- "reset-label": ge.value,
811
- onApply: le,
812
- onReset: de
813
- }, {
814
- default: B(() => [
815
- a.value === "rows" ? (A(), b(g, { key: 0 }, [
816
- (A(!0), b(g, null, M(K.value, (e, t) => (A(), b("div", {
817
- key: t,
818
- class: "mwnf-search-form__row"
819
- }, [
820
- x("span", pt, P(q(t)), 1),
821
- t > 0 ? V((A(), b("select", {
822
- key: 0,
823
- "onUpdate:modelValue": (t) => e.cond = t,
824
- class: "mwnf-facet__select mwnf-search-form__operator"
825
- }, [(A(!0), b(g, null, M(ce.value, (e) => (A(), b("option", {
826
- key: e.key,
827
- value: e.key
828
- }, P(F(n)(e.label)), 9, ht))), 128))], 8, mt)), [[R, e.cond]]) : y("", !0),
829
- V(x("select", {
830
- "onUpdate:modelValue": (t) => e.field = t,
831
- class: "mwnf-facet__select mwnf-search-form__field"
832
- }, [(A(!0), b(g, null, M(i.value.fields ?? [], (e) => (A(), b("option", {
833
- key: e.key,
834
- value: e.key
835
- }, P(F(n)(e.label)), 9, _t))), 128))], 8, gt), [[R, e.field]]),
836
- V(x("input", {
837
- "onUpdate:modelValue": (t) => e.keyword = t,
838
- type: "text",
839
- class: "mwnf-search-form__keyword",
840
- placeholder: F(n)("catalogue.search.keywordPlaceholder")
841
- }, null, 8, vt), [[z, e.keyword]])
842
- ]))), 128)),
843
- m.value ? (A(), b("div", yt, [w(l, {
844
- modelValue: S.value,
845
- "onUpdate:modelValue": t[0] ||= (e) => S.value = e,
846
- label: F(n)("catalogue.facet.dateFrom"),
847
- options: p.value,
848
- "any-label": "—"
849
- }, null, 8, [
850
- "modelValue",
851
- "label",
852
- "options"
853
- ]), w(l, {
854
- modelValue: D.value,
855
- "onUpdate:modelValue": t[1] ||= (e) => D.value = e,
856
- label: F(n)("catalogue.facet.dateTo"),
857
- options: ee.value,
858
- "any-label": "—"
859
- }, null, 8, [
860
- "modelValue",
861
- "label",
862
- "options"
863
- ])])) : y("", !0),
864
- i.value.language ? (A(), b("label", bt, [x("span", xt, P(F(n)("catalogue.search.language")), 1), V(x("select", {
865
- "onUpdate:modelValue": t[2] ||= (e) => E(H) ? H.value = e : null,
866
- class: "mwnf-facet__select mwnf-search-form__language"
867
- }, [x("option", St, P(F(n)("catalogue.search.anyLanguage")), 1), (A(!0), b(g, null, M(I.value, (e) => (A(), b("option", {
868
- key: e,
869
- value: e
870
- }, P(e.toUpperCase()), 9, Ct))), 128))], 512), [[R, F(H)]])])) : y("", !0)
871
- ], 64)) : a.value === "facets" ? (A(), b(g, { key: 1 }, [(A(!0), b(g, null, M(i.value.facets ?? [], (e) => (A(), v(l, {
872
- key: e.key,
873
- label: e.label ? F(n)(e.label) : "",
874
- options: ae.value[e.key] ?? [],
875
- "model-value": Y[e.key],
876
- "onUpdate:modelValue": (t) => ue(e.key, t)
877
- }, null, 8, [
878
- "label",
879
- "options",
880
- "model-value",
881
- "onUpdate:modelValue"
882
- ]))), 128)), m.value ? (A(), b("div", wt, [w(l, {
883
- "model-value": S.value,
884
- label: F(n)("catalogue.facet.startDate"),
885
- options: p.value,
886
- "onUpdate:modelValue": t[3] ||= (e) => {
887
- S.value = e, ue("from", e);
888
- }
889
- }, null, 8, [
890
- "model-value",
891
- "label",
892
- "options"
893
- ]), w(l, {
894
- "model-value": D.value,
895
- label: F(n)("catalogue.facet.endDate"),
896
- options: ee.value,
897
- "onUpdate:modelValue": t[4] ||= (e) => {
898
- D.value = e, ue("to", e);
899
- }
900
- }, null, 8, [
901
- "model-value",
902
- "label",
903
- "options"
904
- ])])) : y("", !0)], 64)) : a.value === "radio" ? (A(!0), b(g, { key: 2 }, M(i.value.facets ?? [], (e) => (A(), b("div", {
905
- key: e.key,
906
- class: "mwnf-search-form__radio-row"
907
- }, [x("label", Tt, [V(x("input", {
908
- "onUpdate:modelValue": t[5] ||= (e) => J.value = e,
909
- type: "radio",
910
- name: "mwnf-search-form-filter",
911
- value: e.key
912
- }, null, 8, Et), [[re, J.value]]), C(" " + P(e.label ? F(n)(e.label) : ""), 1)]), e.type === "year" ? V((A(), b("input", {
913
- key: 1,
914
- "onUpdate:modelValue": (t) => Y[e.key] = t,
915
- type: "number",
916
- class: "mwnf-search-form__year",
917
- disabled: J.value !== e.key
918
- }, null, 8, Dt)), [[z, Y[e.key]]]) : (A(), v(l, {
919
- key: 0,
920
- modelValue: Y[e.key],
921
- "onUpdate:modelValue": (t) => Y[e.key] = t,
922
- options: ae.value[e.key] ?? [],
923
- disabled: J.value !== e.key
924
- }, null, 8, [
925
- "modelValue",
926
- "onUpdate:modelValue",
927
- "options",
928
- "disabled"
929
- ]))]))), 128)) : y("", !0),
930
- (A(!0), b(g, null, M(i.value.extras ?? [], (e) => (A(), b("label", {
931
- key: e.key,
932
- class: "mwnf-facet mwnf-facet--checkbox"
933
- }, [V(x("input", {
934
- "onUpdate:modelValue": (t) => X[e.key] = t,
935
- type: "checkbox",
936
- class: "mwnf-facet__checkbox"
937
- }, null, 8, Ot), [[L, X[e.key]]]), x("span", kt, P(F(n)(e.label)), 1)]))), 128)),
938
- N(e.$slots, "extras", k(T(_e.value)))
939
- ]),
940
- _: 3
941
- }, 8, [
942
- "mode",
943
- "apply-label",
944
- "reset-label"
945
- ]),
946
- i.value.howTo ? (A(), b("p", At, [w(h, { to: { name: i.value.howTo } }, {
947
- default: B(() => [C(P(F(n)("catalogue.search.howTo")), 1)]),
948
- _: 1
949
- }, 8, ["to"])])) : y("", !0),
950
- N(e.$slots, "actions", k(T(_e.value)))
951
- ], 2));
952
- }
953
- }, Mt = { class: "mwnf-timeline" }, Nt = {
954
- key: 0,
955
- class: "mwnf-timeline__title"
956
- }, Pt = {
957
- key: 3,
958
- class: "mwnf-facet"
959
- }, Ft = { class: "mwnf-facet__label" }, It = [
960
- "value",
961
- "placeholder",
962
- "onInput"
963
- ], Lt = {
964
- key: 1,
965
- class: "mwnf-timeline__error"
966
- }, Rt = {
967
- __name: "TimelineResultsView",
968
- props: { spec: {
969
- type: Object,
970
- required: !0
971
- } },
972
- setup(e) {
973
- let t = e, { t: n } = he(), r = Te(), a = _(() => t.spec), s = _(() => !!a.value.entrance), c = Se({
974
- scope: t.spec.scope ?? "country",
975
- countryLabel: t.spec.countryLabel,
976
- countryIdForCode: t.spec.countryIdForCode,
977
- tr: t.spec.tr,
978
- timelinesEntity: t.spec.timelinesEntity,
979
- eventsEntity: t.spec.eventsEntity
980
- }), u = _(() => a.value.controls ?? []), d = _(() => a.value.keys ?? u.value.map((e) => e.key)), p = (e) => u.value.some((t) => t.key === e), m = _(() => ({
981
- t: n,
982
- tr: t.spec.tr,
983
- years: {
984
- min: R.value[0],
985
- max: R.value[1]
986
- }
987
- })), S = te(Object.fromEntries(d.value.map((e) => [e, ""]))), E = j(""), D = s.value ? null : $({ keys: d.value }), O = s.value ? S : D.filters;
988
- function ne(e) {
989
- if (p("collection") && e !== "" && e != null) return e === "pc" ? null : e;
990
- }
991
- function I() {
992
- for (let e of d.value) S[e] = "";
993
- E.value = "";
994
- }
995
- function L() {
996
- E.value = "";
997
- let e = !!O.begin && !!O.end;
998
- if (e && Number(O.begin) >= Number(O.end)) {
999
- E.value = n(a.value.errorPeriod ?? "timeline.form.errorPeriod");
1000
- return;
1001
- }
1002
- if (!O.country && !e) {
1003
- E.value = n(a.value.errorSelect ?? "timeline.form.errorSelect");
1004
- return;
1005
- }
1006
- let t = {};
1007
- for (let e of d.value) O[e] && (t[e] = O[e]);
1008
- r.push({
1009
- name: a.value.route,
1010
- query: t
1011
- });
1012
- }
1013
- let re = _(() => {
1014
- if (s.value) return [];
1015
- let e = O;
1016
- return c.findEvents({
1017
- country: e.country || void 0,
1018
- collection: ne(e.collection),
1019
- begin: e.begin,
1020
- end: e.end
1021
- });
1022
- }), R = _(() => {
1023
- let e = c.findEvents({
1024
- country: void 0,
1025
- collection: void 0
1026
- }).map((e) => e.year_from).filter((e) => Number.isFinite(e) && e !== 0);
1027
- return e.length ? [Math.min(...e), Math.max(...e)] : [null, null];
1028
- }), z = _e(re, {
1029
- page: () => D ? D.page.value : 1,
1030
- size: () => a.value.pageSize ?? 15
1031
- });
1032
- function V(e) {
1033
- let t = a.value.countryLabel && e.country_id ? a.value.countryLabel(e.country_id) : "";
1034
- return {
1035
- id: e.id,
1036
- date: G(e, e.text, n),
1037
- caption: t ? Z(String(t)) : "",
1038
- description: e.text?.description ? X(String(e.text.description), { breaks: !0 }) : ""
1039
- };
1040
- }
1041
- let H = _(() => z.value.rows.map((e) => (a.value.event ?? V)(e, m.value))), ie = _(() => (c.countries.value ?? []).map((e) => ({
1042
- value: e.value,
1043
- label: e.value === "all" ? n("timeline.form.allCountries") : e.label
1044
- }))), U = _(() => a.value.collections?.(m.value) ?? []), W = _(() => {
1045
- let e = {};
1046
- for (let t of u.value) (t.key === "begin" || t.key === "end") && t.options && (typeof t.options == "function" ? e[t.key] = t.options(m.value) : e[t.key] = t.options);
1047
- return e;
1048
- }), ae = _(() => ({
1049
- filters: O,
1050
- active: d.value.some((e) => O[e]),
1051
- apply: s.value ? L : (e) => D.apply(e),
1052
- reset: s.value ? I : D.reset,
1053
- goToPage: s.value ? () => {} : D.goToPage,
1054
- events: re.value,
1055
- pageInfo: z.value,
1056
- countries: ie.value,
1057
- collections: U.value,
1058
- t: n,
1059
- tr: a.value.tr
1060
- })), oe = _(() => {
1061
- let e = a.value.gallery;
1062
- return !e || s.value ? null : !e.items || e.items(ae.value);
1063
- }), se = _(() => {
1064
- let e = oe.value;
1065
- return e == null ? !1 : Array.isArray(e) ? e.length > 0 : !!e;
1066
- }), ce = _(() => {
1067
- let e = oe.value;
1068
- return Array.isArray(e) ? e.length : typeof e == "number" ? e : null;
1069
- }), K = _(() => {
1070
- if (!se.value) return null;
1071
- let e = {};
1072
- for (let t of d.value) O[t] && (e[t] = O[t]);
1073
- return {
1074
- to: {
1075
- name: a.value.gallery.route,
1076
- query: e
1077
- },
1078
- count: ce.value,
1079
- label: n(a.value.gallery.label ?? "timeline.nav.seeGallery")
1080
- };
1081
- }), q = _(() => ({
1082
- ...ae.value,
1083
- gallery: K.value
1084
- })), J = _(() => a.value.summary ? a.value.summary(q.value) : [{
1085
- label: n(a.value.summaryLabel ?? "timeline.results.eventsFound"),
1086
- count: z.value.total
1087
- }]), Y = _(() => n(a.value.empty ?? "timeline.results.noResults")), Q = _(() => ({
1088
- window: 5,
1089
- jump: !1,
1090
- ends: !0,
1091
- ...a.value.pagination ?? {}
1092
- }));
1093
- function le(e, t) {
1094
- return e.label ? n(e.label) : t ? n(t) : "";
1095
- }
1096
- return (e, t) => (A(), b("section", Mt, [
1097
- N(e.$slots, "before", k(T(q.value))),
1098
- a.value.title ? (A(), b("h1", Nt, P(F(n)(a.value.title)), 1)) : y("", !0),
1099
- w(f, {
1100
- class: "mwnf-timeline__filters",
1101
- title: a.value.filterTitle ? F(n)(a.value.filterTitle) : "",
1102
- "apply-label": s.value ? F(n)(a.value.submitLabel ?? "core.action.search") : a.value.applyLabel ? F(n)(a.value.applyLabel) : "",
1103
- "reset-label": a.value.resetLabel ? F(n)(a.value.resetLabel) : "",
1104
- onApply: t[2] ||= (e) => s.value ? L() : F(D).apply(),
1105
- onReset: t[3] ||= (e) => s.value ? I() : F(D).reset()
1106
- }, {
1107
- default: B(() => [(A(!0), b(g, null, M(u.value, (e) => (A(), b(g, { key: e.key }, [e.key === "country" ? (A(), v(l, {
1108
- key: 0,
1109
- "model-value": F(O).country,
1110
- label: le(e, "catalogue.facet.country"),
1111
- options: ie.value,
1112
- placeholder: e.placeholder ? F(n)(e.placeholder) : F(n)("timeline.form.selectCountry"),
1113
- "any-label": e.anyLabel ? F(n)(e.anyLabel) : "",
1114
- "hide-empty": !!e.hideEmpty,
1115
- "onUpdate:modelValue": t[0] ||= (e) => F(O).country = e
1116
- }, null, 8, [
1117
- "model-value",
1118
- "label",
1119
- "options",
1120
- "placeholder",
1121
- "any-label",
1122
- "hide-empty"
1123
- ])) : e.key === "collection" ? (A(), v(l, {
1124
- key: 1,
1125
- "model-value": F(O).collection,
1126
- label: le(e),
1127
- options: U.value,
1128
- placeholder: e.placeholder ? F(n)(e.placeholder) : "",
1129
- "any-label": e.anyLabel ? F(n)(e.anyLabel) : "",
1130
- "hide-empty": !!e.hideEmpty,
1131
- "onUpdate:modelValue": t[1] ||= (e) => F(O).collection = e
1132
- }, null, 8, [
1133
- "model-value",
1134
- "label",
1135
- "options",
1136
- "placeholder",
1137
- "any-label",
1138
- "hide-empty"
1139
- ])) : (e.key === "begin" || e.key === "end") && W.value[e.key] ? (A(), v(l, {
1140
- key: 2,
1141
- "model-value": F(O)[e.key],
1142
- label: le(e, e.key === "begin" ? "timeline.form.startDate" : "timeline.form.endDate"),
1143
- options: W.value[e.key],
1144
- placeholder: e.placeholder ? F(n)(e.placeholder) : F(n)(e.key === "begin" ? "timeline.form.fromYearHint" : "timeline.form.toYearHint"),
1145
- "any-label": e.anyLabel ? F(n)(e.anyLabel) : "",
1146
- "hide-empty": !!e.hideEmpty,
1147
- "onUpdate:modelValue": (t) => F(O)[e.key] = t
1148
- }, null, 8, [
1149
- "model-value",
1150
- "label",
1151
- "options",
1152
- "placeholder",
1153
- "any-label",
1154
- "hide-empty",
1155
- "onUpdate:modelValue"
1156
- ])) : (A(), b("label", Pt, [x("span", Ft, P(le(e, e.key === "begin" ? "timeline.form.startDate" : "timeline.form.endDate")), 1), x("input", {
1157
- type: "number",
1158
- class: "mwnf-facet__select",
1159
- value: F(O)[e.key],
1160
- placeholder: e.placeholder ? F(n)(e.placeholder) : F(n)(e.key === "begin" ? "timeline.form.fromYearHint" : "timeline.form.toYearHint"),
1161
- onInput: (t) => F(O)[e.key] = t.target.value
1162
- }, null, 40, It)]))], 64))), 128))]),
1163
- _: 1
1164
- }, 8, [
1165
- "title",
1166
- "apply-label",
1167
- "reset-label"
1168
- ]),
1169
- s.value && E.value ? (A(), b("p", Lt, P(E.value), 1)) : y("", !0),
1170
- s.value ? y("", !0) : (A(), b(g, { key: 2 }, [
1171
- N(e.$slots, "summary", k(T(q.value)), () => [w(i, { parts: J.value }, null, 8, ["parts"])]),
1172
- K.value ? (A(), v(h, {
1173
- key: 0,
1174
- class: "mwnf-timeline__gallery",
1175
- to: K.value.to
1176
- }, {
1177
- default: B(() => [N(e.$slots, "cross-link", k(T(q.value)), () => [C(P(K.value.label), 1), K.value.count == null ? y("", !0) : (A(), b(g, { key: 0 }, [C(" (" + P(K.value.count) + ")", 1)], 64))])]),
1178
- _: 3
1179
- }, 8, ["to"])) : y("", !0),
1180
- N(e.$slots, "event", k(T(q.value)), () => [w(ee, { events: H.value }, {
1181
- empty: B(() => [N(e.$slots, "empty", k(T(q.value)), () => [C(P(Y.value), 1)])]),
1182
- _: 3
1183
- }, 8, ["events"])]),
1184
- w(o, {
1185
- "page-info": F(z),
1186
- window: Q.value.window,
1187
- jump: Q.value.jump,
1188
- ends: Q.value.ends,
1189
- onNavigate: F(D).goToPage
1190
- }, null, 8, [
1191
- "page-info",
1192
- "window",
1193
- "jump",
1194
- "ends",
1195
- "onNavigate"
1196
- ])
1197
- ], 64)),
1198
- N(e.$slots, "after", k(T(q.value)))
1199
- ]));
1200
- }
1201
- };
1202
- //#endregion
1203
- export { qe as a, ot as i, jt as n, Be as o, ft as r, Rt as t };