@museumwnf/viewer-layout 2.18.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -12
- package/dist/{FeaturedRecord-mRyLN7Mt.js → FeaturedRecord-Dw6uf3ax.js} +1 -1
- package/dist/ItemDetailView-DT5EjZjB.js +284 -0
- package/dist/OnDisplayIn-eSG5r48j.js +407 -0
- package/dist/Theme-DJeeA6tZ.js +319 -0
- package/dist/{OnDisplayIn-D6r_KvpI.js → TimelineEventList-BhkWyY5-.js} +315 -647
- package/dist/TimelineResultsView-CgGVsJcp.js +1636 -0
- package/dist/{content-CHXh6D_q.js → content-BxaDJIvY.js} +2 -2
- package/dist/content.js +5 -5
- package/dist/dxa.js +549 -388
- package/dist/index.js +5 -5
- package/dist/views.js +30 -30
- package/package.json +1 -1
- package/src/tokens.reference.css +1 -1
- package/dist/PictureNarrative-B_GPQvYP.js +0 -444
- package/dist/Theme-Caz0E8w1.js +0 -140
- package/dist/TimelineResultsView-CMqrkr9z.js +0 -1911
|
@@ -0,0 +1,1636 @@
|
|
|
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 ee, t as p, u as te, y as m } from "./TimelineEventList-BhkWyY5-.js";
|
|
2
|
+
import { Fragment as h, computed as g, createBlock as _, createCommentVNode as v, createElementBlock as y, createElementVNode as b, createSlots as x, createTextVNode as S, createVNode as C, guardReactiveProps as w, isRef as T, mergeProps as E, normalizeClass as D, normalizeProps as O, openBlock as k, reactive as ne, ref as A, renderList as j, renderSlot as M, resolveDynamicComponent as N, toDisplayString as P, unref as F, useSlots as I, vModelCheckbox as L, vModelRadio as R, vModelSelect as z, vModelText as B, watch as V, withCtx as H, withDirectives as U } from "vue";
|
|
3
|
+
import { I18nText as re, NotFoundView as ie, byId as W, centuryPresets as ae, citation as G, dateRange as K, entityRef as oe, eventDateLabel as q, glossaryEntries as J, glossaryTermsForText as Y, groupByCountry as se, languageLabels as ce, md as X, mdInline as Z, partnerHierarchy as Q, partnerView as le, renderBlock as ue, renderInline as $, renderPlain as de, sheetRows as fe, sortChronological as pe, sourceUrl as me, useCollectionTree as he, useDataPackage as ge, useFacets as _e, useGlossaryPopup as ve, useI18n as ye, useListQuery as be, useLocale as xe, usePagination as Se, useProjects as Ce, useRecordLanguage as we, useRecordSheet as Te, useRelatedRecords as Ee, useSearchLanguage as De, useTimelineEvents as Oe, yearBuckets as ke } from "@museumwnf/viewer-core";
|
|
4
|
+
import { useRoute as Ae, useRouter as je } from "vue-router";
|
|
5
|
+
//#region src/views/CatalogueResultsView.vue
|
|
6
|
+
var Me = { class: "mwnf-catalogue" }, Ne = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "mwnf-catalogue__title"
|
|
9
|
+
}, Pe = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "mwnf-facet"
|
|
12
|
+
}, Fe = {
|
|
13
|
+
key: 0,
|
|
14
|
+
class: "mwnf-facet__label"
|
|
15
|
+
}, Ie = [
|
|
16
|
+
"value",
|
|
17
|
+
"placeholder",
|
|
18
|
+
"onInput"
|
|
19
|
+
], Le = {
|
|
20
|
+
key: 1,
|
|
21
|
+
class: "mwnf-facet"
|
|
22
|
+
}, Re = {
|
|
23
|
+
key: 0,
|
|
24
|
+
class: "mwnf-facet__label"
|
|
25
|
+
}, ze = [
|
|
26
|
+
"value",
|
|
27
|
+
"placeholder",
|
|
28
|
+
"onInput"
|
|
29
|
+
], Be = {
|
|
30
|
+
key: 2,
|
|
31
|
+
class: "mwnf-facet mwnf-facet--checkbox"
|
|
32
|
+
}, Ve = ["checked", "onChange"], He = {
|
|
33
|
+
key: 0,
|
|
34
|
+
class: "mwnf-facet__label"
|
|
35
|
+
}, Ue = { class: "mwnf-catalogue__body" }, We = { class: "mwnf-catalogue__results" }, Ge = {
|
|
36
|
+
key: 0,
|
|
37
|
+
class: "mwnf-catalogue__aside"
|
|
38
|
+
}, Ke = {
|
|
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 } = ye(), c = ge(), u = n.spec.entity ?? n.entity, d = g(() => n.spec), ee = oe(u);
|
|
52
|
+
u && c.loadTranslations(u, "en");
|
|
53
|
+
let p = g(() => d.value.keys ?? [...Object.keys(d.value.facets ?? {}), ...te()]);
|
|
54
|
+
function te() {
|
|
55
|
+
let e = d.value.dates;
|
|
56
|
+
return e ? [e.begin ?? "begin", e.end ?? "end"] : [];
|
|
57
|
+
}
|
|
58
|
+
let { filters: m, page: T, active: E, apply: D, reset: ne, goToPage: A } = be({ keys: p.value }), I = {
|
|
59
|
+
t: r,
|
|
60
|
+
locale: s,
|
|
61
|
+
tr: (e, t) => c.tr(e, t, s.value, "en"),
|
|
62
|
+
renderInline: $,
|
|
63
|
+
renderPlain: de
|
|
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 R = g(() => {
|
|
71
|
+
let e = d.value, t = ee.value ?? [];
|
|
72
|
+
e.scope && (t = t.filter((t) => e.scope(t, m, I)));
|
|
73
|
+
for (let [n, r] of Object.entries(e.facets ?? {})) {
|
|
74
|
+
let e = m[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, m, I))), e.narrow && (t = e.narrow(t, m, I)), e.dates && (t = K(t, {
|
|
78
|
+
begin: m[e.dates.begin ?? "begin"],
|
|
79
|
+
end: m[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" ? pe(t) : n && typeof n == "object" ? pe(t, n) : t;
|
|
85
|
+
}), z = g(() => d.value.facetScope === "matching" ? R.value : ee.value ?? []), B = _e(z, () => d.value.facets ?? {}), V = Se(R, {
|
|
86
|
+
page: T,
|
|
87
|
+
size: () => d.value.pageSize ?? 20
|
|
88
|
+
}), U = g(() => d.value.recordRoute ?? (n.entity ? `${n.entity}-detail` : "item"));
|
|
89
|
+
function re(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: de(String(t)),
|
|
95
|
+
name: $(String(t)),
|
|
96
|
+
meta: [],
|
|
97
|
+
badge: e.type ?? "",
|
|
98
|
+
to: {
|
|
99
|
+
name: U.value,
|
|
100
|
+
params: { id: e.id }
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
let ie = g(() => V.value.rows.map((e) => (d.value.record ?? re)(e, I))), W = g(() => ({
|
|
105
|
+
filters: m,
|
|
106
|
+
active: E.value,
|
|
107
|
+
apply: D,
|
|
108
|
+
reset: ne,
|
|
109
|
+
goToPage: A,
|
|
110
|
+
matching: R.value,
|
|
111
|
+
pageInfo: V.value,
|
|
112
|
+
options: B.value
|
|
113
|
+
})), ae = g(() => {
|
|
114
|
+
let e = d.value;
|
|
115
|
+
return e.summary ? e.summary({
|
|
116
|
+
...W.value,
|
|
117
|
+
t: r,
|
|
118
|
+
total: (ee.value ?? []).length
|
|
119
|
+
}) : [{
|
|
120
|
+
label: r(e.summaryLabel ?? "catalogue.results.itemsFound"),
|
|
121
|
+
count: V.value.total
|
|
122
|
+
}];
|
|
123
|
+
}), G = g(() => d.value.filterMode ?? "apply"), q = g(() => d.value.controls ?? []), J = g(() => q.value.length > 0 || !!d.value.panel);
|
|
124
|
+
function Y(e, t) {
|
|
125
|
+
G.value === "immediate" ? D({ [e]: t }) : m[e] = t;
|
|
126
|
+
}
|
|
127
|
+
let se = g(() => r(d.value.empty ?? "catalogue.results.noResultsFilter")), ce = g(() => d.value.variant === "grid"), X = g(() => ({
|
|
128
|
+
window: 5,
|
|
129
|
+
jump: !1,
|
|
130
|
+
ends: !0,
|
|
131
|
+
...d.value.pagination ?? {}
|
|
132
|
+
}));
|
|
133
|
+
return (t, n) => (k(), y("section", Me, [
|
|
134
|
+
M(t.$slots, "before", O(w(W.value))),
|
|
135
|
+
d.value.title ? (k(), y("h1", Ne, P(F(r)(d.value.title)), 1)) : v("", !0),
|
|
136
|
+
J.value || t.$slots.filters ? (k(), _(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(D)(),
|
|
143
|
+
onReset: n[3] ||= (e) => F(ne)()
|
|
144
|
+
}, {
|
|
145
|
+
default: H(() => [(k(!0), y(h, null, j(q.value, (e) => (k(), y(h, { key: e.key }, [e.type === "year" ? (k(), y("label", Pe, [e.label ? (k(), y("span", Fe, P(F(r)(e.label)), 1)) : v("", !0), b("input", {
|
|
146
|
+
type: "number",
|
|
147
|
+
class: "mwnf-facet__select",
|
|
148
|
+
value: F(m)[e.key],
|
|
149
|
+
placeholder: e.placeholder ? F(r)(e.placeholder) : "",
|
|
150
|
+
onInput: (t) => F(m)[e.key] = t.target.value,
|
|
151
|
+
onChange: n[0] ||= (e) => G.value === "immediate" ? F(D)() : null
|
|
152
|
+
}, null, 40, Ie)])) : e.type === "query" ? (k(), y("label", Le, [e.label ? (k(), y("span", Re, P(F(r)(e.label)), 1)) : v("", !0), b("input", {
|
|
153
|
+
type: "text",
|
|
154
|
+
class: "mwnf-facet__select",
|
|
155
|
+
value: F(m)[e.key],
|
|
156
|
+
placeholder: e.placeholder ? F(r)(e.placeholder) : "",
|
|
157
|
+
onInput: (t) => F(m)[e.key] = t.target.value,
|
|
158
|
+
onChange: n[1] ||= (e) => G.value === "immediate" ? F(D)() : null
|
|
159
|
+
}, null, 40, ze)])) : e.type === "checkbox" ? (k(), y("label", Be, [b("input", {
|
|
160
|
+
type: "checkbox",
|
|
161
|
+
class: "mwnf-facet__checkbox",
|
|
162
|
+
checked: F(m)[e.key] === "1",
|
|
163
|
+
onChange: (t) => Y(e.key, t.target.checked ? "1" : "")
|
|
164
|
+
}, null, 40, Ve), e.label ? (k(), y("span", He, P(F(r)(e.label)), 1)) : v("", !0)])) : (k(), _(l, {
|
|
165
|
+
key: 3,
|
|
166
|
+
"model-value": F(m)[e.key],
|
|
167
|
+
label: e.label ? F(r)(e.label) : "",
|
|
168
|
+
options: F(B)[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) => Y(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)), M(t.$slots, "filters", O(w(W.value)))]),
|
|
182
|
+
_: 3
|
|
183
|
+
}, 8, [
|
|
184
|
+
"mode",
|
|
185
|
+
"title",
|
|
186
|
+
"reset-label"
|
|
187
|
+
])) : v("", !0),
|
|
188
|
+
C(i, { parts: ae.value }, x({ _: 2 }, [t.$slots.actions ? {
|
|
189
|
+
name: "actions",
|
|
190
|
+
fn: H(() => [M(t.$slots, "actions", O(w(W.value)))]),
|
|
191
|
+
key: "0"
|
|
192
|
+
} : void 0]), 1032, ["parts"]),
|
|
193
|
+
b("div", Ue, [b("div", We, [(k(), _(N(ce.value ? a : e), {
|
|
194
|
+
records: ie.value,
|
|
195
|
+
"action-label": d.value.actionLabel ? F(r)(d.value.actionLabel) : ""
|
|
196
|
+
}, {
|
|
197
|
+
empty: H(() => [M(t.$slots, "empty", O(w(W.value)), () => [S(P(se.value), 1)])]),
|
|
198
|
+
_: 3
|
|
199
|
+
}, 8, ["records", "action-label"])), C(o, {
|
|
200
|
+
"page-info": F(V),
|
|
201
|
+
window: X.value.window,
|
|
202
|
+
jump: X.value.jump,
|
|
203
|
+
ends: X.value.ends,
|
|
204
|
+
onNavigate: F(A)
|
|
205
|
+
}, null, 8, [
|
|
206
|
+
"page-info",
|
|
207
|
+
"window",
|
|
208
|
+
"jump",
|
|
209
|
+
"ends",
|
|
210
|
+
"onNavigate"
|
|
211
|
+
])]), t.$slots.aside ? (k(), y("aside", Ge, [M(t.$slots, "aside", O(w(W.value)))])) : v("", !0)]),
|
|
212
|
+
M(t.$slots, "after", O(w(W.value)))
|
|
213
|
+
]));
|
|
214
|
+
}
|
|
215
|
+
}, qe = ["dir", "innerHTML"], Je = { class: "mwnf-record__body" }, Ye = { class: "mwnf-record__main" }, Xe = {
|
|
216
|
+
key: 1,
|
|
217
|
+
class: "mwnf-record__status"
|
|
218
|
+
}, Ze = {
|
|
219
|
+
key: 0,
|
|
220
|
+
class: "mwnf-record__aside"
|
|
221
|
+
}, Qe = {
|
|
222
|
+
key: 2,
|
|
223
|
+
class: "mwnf-record__status"
|
|
224
|
+
}, $e = {
|
|
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 } = ye(), l = ge(), u = Ce(), f = I(), p = Ae(), T = i.spec.entity ?? i.entity, E = g(() => i.spec), D = oe(T), ne = W(T), A = g(() => ne.value.get(i.id) ?? null), N = g(() => D.value !== null), { language: L, languages: R, dir: z, select: B, text: V, ready: U, terms: re, glossary: ae, attribution: K } = Te(A, {
|
|
242
|
+
entity: T,
|
|
243
|
+
translations: i.spec.translations ?? [],
|
|
244
|
+
attribution: i.spec.attribution ?? []
|
|
245
|
+
}), q = g(() => ce(R.value)), { active: J, onClick: Y, close: se } = ve(re), X = g(() => J.value ? ue(J.value.definition, { breaks: !0 }) : ""), Z = (e, t) => l.tr(e, t, L.value, "en"), Q = g(() => ({
|
|
246
|
+
record: A.value,
|
|
247
|
+
text: V.value,
|
|
248
|
+
language: L.value,
|
|
249
|
+
languages: q.value,
|
|
250
|
+
select: B,
|
|
251
|
+
dir: z.value,
|
|
252
|
+
glossary: ae.value,
|
|
253
|
+
ready: U.value,
|
|
254
|
+
attribution: K.value,
|
|
255
|
+
t: a,
|
|
256
|
+
tr: Z
|
|
257
|
+
}));
|
|
258
|
+
function le(e) {
|
|
259
|
+
return ((typeof e == "function" ? e(Q.value) : e) ?? []).map((e) => ({
|
|
260
|
+
...e,
|
|
261
|
+
label: e.label ? a(e.label) : ""
|
|
262
|
+
}));
|
|
263
|
+
}
|
|
264
|
+
let pe = g(() => A.value ? fe(le(E.value.fields), Q.value) : []), he = g(() => A.value ? fe(le(E.value.sections).map((e) => ({
|
|
265
|
+
render: "block",
|
|
266
|
+
...e
|
|
267
|
+
})), Q.value) : []), _e = g(() => E.value.shortDescription === !1 ? "" : E.value.shortDescription ?? "short_description"), be = g(() => {
|
|
268
|
+
let e = _e.value ? V.value[_e.value] : "";
|
|
269
|
+
return e ? { html: ue(String(e), {
|
|
270
|
+
breaks: !0,
|
|
271
|
+
glossary: ae.value
|
|
272
|
+
}) } : null;
|
|
273
|
+
}), xe = g(() => {
|
|
274
|
+
if (!A.value) return "";
|
|
275
|
+
if (E.value.title) return E.value.title(Q.value);
|
|
276
|
+
let e = V.value.name ?? A.value.internal_name ?? A.value.id;
|
|
277
|
+
return $(String(e), { glossary: ae.value });
|
|
278
|
+
}), Se = g(() => {
|
|
279
|
+
if (!A.value) return [];
|
|
280
|
+
if (E.value.media) return E.value.media(A.value, Q.value);
|
|
281
|
+
let e = de(String(V.value.name ?? A.value.internal_name ?? ""));
|
|
282
|
+
return (A.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
|
+
}), we = [
|
|
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
|
+
], De = g(() => (E.value.credits ?? we).map(({ field: e, label: t }) => ({
|
|
307
|
+
label: a(t),
|
|
308
|
+
value: V.value[e] ?? K.value[e] ?? ""
|
|
309
|
+
})).filter((e) => e.value)), Oe = g(() => String(A.value?.[E.value.workingNumber ?? "mwnf_reference"] ?? "")), ke = g(() => {
|
|
310
|
+
let e = E.value.citation;
|
|
311
|
+
if (!A.value || e === !1) return "";
|
|
312
|
+
let t = typeof e?.project == "function" ? null : e?.project ?? A.value.project_id, n = typeof e?.project == "function" ? e.project(A.value, Q.value) : u.label(t), r = e?.permalink === !1 ? void 0 : typeof e?.permalink == "string" ? e.permalink : me(p) ?? void 0;
|
|
313
|
+
return G({
|
|
314
|
+
author: V.value.author ?? K.value.author,
|
|
315
|
+
name: V.value.name ?? A.value.internal_name ?? "",
|
|
316
|
+
project: n,
|
|
317
|
+
permalink: r,
|
|
318
|
+
inWord: a("record.citation.in")
|
|
319
|
+
});
|
|
320
|
+
}), je = Ee(A, {
|
|
321
|
+
entity: T,
|
|
322
|
+
language: L
|
|
323
|
+
}), Me = g(() => E.value.related === !1 ? null : E.value.related ?? {}), Ne = g(() => {
|
|
324
|
+
if (!Me.value) return [];
|
|
325
|
+
let e = Me.value.record ?? Pe;
|
|
326
|
+
return je.value.inPackage.map((t) => e(t, Q.value));
|
|
327
|
+
});
|
|
328
|
+
function Pe({ record: e, justification: t }) {
|
|
329
|
+
let n = Z(T, e.id).name ?? e.internal_name ?? e.id;
|
|
330
|
+
return {
|
|
331
|
+
id: e.id,
|
|
332
|
+
image: e.images?.[0]?.url ?? "",
|
|
333
|
+
imageAlt: de(String(n)),
|
|
334
|
+
name: $(String(n)),
|
|
335
|
+
meta: t ? [t] : [],
|
|
336
|
+
badge: e.type ?? "",
|
|
337
|
+
to: {
|
|
338
|
+
name: E.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 = g(() => Object.keys(f).filter((e) => !Fe.has(e)));
|
|
353
|
+
return (e, i) => N.value && !A.value ? (k(), _(F(ie), { key: 0 })) : A.value ? (k(), y("article", {
|
|
354
|
+
key: 1,
|
|
355
|
+
class: "mwnf-record",
|
|
356
|
+
onClick: i[0] ||= (...e) => F(Y) && F(Y)(...e)
|
|
357
|
+
}, [
|
|
358
|
+
M(e.$slots, "header", O(w(Q.value)), () => [
|
|
359
|
+
E.value.back ? (k(), _(m, {
|
|
360
|
+
key: 0,
|
|
361
|
+
class: "mwnf-record__back",
|
|
362
|
+
to: E.value.back.to,
|
|
363
|
+
href: E.value.back.href
|
|
364
|
+
}, {
|
|
365
|
+
default: H(() => [S("← " + P(F(a)(E.value.back.label)), 1)]),
|
|
366
|
+
_: 1
|
|
367
|
+
}, 8, ["to", "href"])) : v("", !0),
|
|
368
|
+
C(r, {
|
|
369
|
+
languages: q.value,
|
|
370
|
+
language: F(L),
|
|
371
|
+
onSelect: F(B)
|
|
372
|
+
}, null, 8, [
|
|
373
|
+
"languages",
|
|
374
|
+
"language",
|
|
375
|
+
"onSelect"
|
|
376
|
+
]),
|
|
377
|
+
b("h1", {
|
|
378
|
+
class: "mwnf-record__title",
|
|
379
|
+
dir: F(z) || void 0,
|
|
380
|
+
innerHTML: xe.value
|
|
381
|
+
}, null, 8, qe)
|
|
382
|
+
]),
|
|
383
|
+
b("div", Je, [b("div", Ye, [
|
|
384
|
+
Se.value.length ? (k(), _(t, {
|
|
385
|
+
key: 0,
|
|
386
|
+
images: Se.value,
|
|
387
|
+
variant: E.value.mediaVariant ?? ""
|
|
388
|
+
}, null, 8, ["images", "variant"])) : v("", !0),
|
|
389
|
+
F(U) ? v("", !0) : (k(), y("p", Xe, P(F(a)("core.status.loading")), 1)),
|
|
390
|
+
M(e.$slots, "before-sheet", O(w(Q.value))),
|
|
391
|
+
C(te, {
|
|
392
|
+
rows: pe.value,
|
|
393
|
+
layout: E.value.layout ?? "table",
|
|
394
|
+
dir: F(z),
|
|
395
|
+
"short-description": be.value,
|
|
396
|
+
"short-description-after": E.value.shortDescriptionAfter ?? "description"
|
|
397
|
+
}, x({ _: 2 }, [j(Ie.value, (t) => ({
|
|
398
|
+
name: t,
|
|
399
|
+
fn: H((n) => [M(e.$slots, t, O(w({
|
|
400
|
+
...n,
|
|
401
|
+
...Q.value
|
|
402
|
+
})))])
|
|
403
|
+
}))]), 1032, [
|
|
404
|
+
"rows",
|
|
405
|
+
"layout",
|
|
406
|
+
"dir",
|
|
407
|
+
"short-description",
|
|
408
|
+
"short-description-after"
|
|
409
|
+
]),
|
|
410
|
+
(k(!0), y(h, null, j(he.value, (e) => (k(), _(c, {
|
|
411
|
+
key: e.key,
|
|
412
|
+
heading: e.label,
|
|
413
|
+
html: e.html,
|
|
414
|
+
dir: F(z)
|
|
415
|
+
}, null, 8, [
|
|
416
|
+
"heading",
|
|
417
|
+
"html",
|
|
418
|
+
"dir"
|
|
419
|
+
]))), 128)),
|
|
420
|
+
M(e.$slots, "after-sheet", O(w(Q.value))),
|
|
421
|
+
C(n, {
|
|
422
|
+
credits: De.value,
|
|
423
|
+
"working-number": Oe.value,
|
|
424
|
+
"working-number-label": F(a)("sheet.field.workingNumber"),
|
|
425
|
+
citation: ke.value,
|
|
426
|
+
"citation-heading": E.value.citation?.heading ? F(a)(E.value.citation.heading) : ""
|
|
427
|
+
}, null, 8, [
|
|
428
|
+
"credits",
|
|
429
|
+
"working-number",
|
|
430
|
+
"working-number-label",
|
|
431
|
+
"citation",
|
|
432
|
+
"citation-heading"
|
|
433
|
+
]),
|
|
434
|
+
M(e.$slots, "source", O(w(Q.value)), () => [C(ee)]),
|
|
435
|
+
M(e.$slots, "related", O(w({
|
|
436
|
+
...Q.value,
|
|
437
|
+
records: Ne.value,
|
|
438
|
+
outside: F(je).outside
|
|
439
|
+
})), () => [Me.value ? (k(), _(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
|
+
])) : v("", !0)])
|
|
451
|
+
]), e.$slots.aside ? (k(), y("aside", Ze, [M(e.$slots, "aside", O(w(Q.value)))])) : v("", !0)]),
|
|
452
|
+
M(e.$slots, "after", O(w(Q.value))),
|
|
453
|
+
C(s, {
|
|
454
|
+
term: F(J),
|
|
455
|
+
html: X.value,
|
|
456
|
+
dir: F(z),
|
|
457
|
+
onClose: F(se)
|
|
458
|
+
}, null, 8, [
|
|
459
|
+
"term",
|
|
460
|
+
"html",
|
|
461
|
+
"dir",
|
|
462
|
+
"onClose"
|
|
463
|
+
])
|
|
464
|
+
])) : (k(), y("p", Qe, P(F(a)("core.status.loading")), 1));
|
|
465
|
+
}
|
|
466
|
+
}, et = ["dir"], tt = {
|
|
467
|
+
key: 0,
|
|
468
|
+
class: "mwnf-essay__breadcrumb"
|
|
469
|
+
}, nt = { class: "mwnf-essay__breadcrumb-label" }, rt = {
|
|
470
|
+
key: 1,
|
|
471
|
+
class: "mwnf-essay__breadcrumb-link"
|
|
472
|
+
}, it = ["aria-label"], at = { class: "mwnf-essay__title" }, ot = {
|
|
473
|
+
key: 0,
|
|
474
|
+
class: "mwnf-essay__number"
|
|
475
|
+
}, st = ["innerHTML"], ct = { class: "mwnf-essay__body" }, lt = { class: "mwnf-essay__main" }, ut = {
|
|
476
|
+
key: 0,
|
|
477
|
+
class: "mwnf-essay__status"
|
|
478
|
+
}, dt = ["innerHTML"], ft = ["innerHTML"], pt = {
|
|
479
|
+
key: 4,
|
|
480
|
+
class: "mwnf-essay__nav"
|
|
481
|
+
}, mt = {
|
|
482
|
+
key: 1,
|
|
483
|
+
class: "mwnf-essay__nav-spacer"
|
|
484
|
+
}, ht = {
|
|
485
|
+
key: 0,
|
|
486
|
+
class: "mwnf-essay__side"
|
|
487
|
+
}, gt = {
|
|
488
|
+
key: 0,
|
|
489
|
+
class: "mwnf-essay__panel"
|
|
490
|
+
}, _t = {
|
|
491
|
+
key: 0,
|
|
492
|
+
class: "mwnf-essay__variants"
|
|
493
|
+
}, vt = ["aria-pressed", "onClick"], yt = ["src", "alt"], bt = ["innerHTML"], xt = {
|
|
494
|
+
key: 0,
|
|
495
|
+
class: "mwnf-essay__panel-label"
|
|
496
|
+
}, St = ["innerHTML"], Ct = ["innerHTML"], wt = {
|
|
497
|
+
key: 0,
|
|
498
|
+
class: "mwnf-essay__thumbs"
|
|
499
|
+
}, Tt = ["onClick"], Et = ["src"], Dt = {
|
|
500
|
+
key: 2,
|
|
501
|
+
class: "mwnf-essay__status"
|
|
502
|
+
}, Ot = {
|
|
503
|
+
__name: "EssayView",
|
|
504
|
+
props: {
|
|
505
|
+
spec: {
|
|
506
|
+
type: Object,
|
|
507
|
+
required: !0
|
|
508
|
+
},
|
|
509
|
+
id: {
|
|
510
|
+
type: String,
|
|
511
|
+
required: !0
|
|
512
|
+
}
|
|
513
|
+
},
|
|
514
|
+
setup(e) {
|
|
515
|
+
let n = e, { t: r } = ye(), i = ge(), o = I();
|
|
516
|
+
function c(e) {
|
|
517
|
+
return !!e && typeof e.walk == "function" && typeof e.children == "function";
|
|
518
|
+
}
|
|
519
|
+
function l(e) {
|
|
520
|
+
return typeof e == "string" ? e : "themes";
|
|
521
|
+
}
|
|
522
|
+
let u = n.spec.entity ?? "items", d = n.spec.tree, f = d?.entity ?? (d?.themes ? l(d.themes) : n.spec.entity ?? "collections"), p = c(d) ? d : d?.themes ? he({
|
|
523
|
+
source: "themes",
|
|
524
|
+
entity: f,
|
|
525
|
+
childType: d.childType
|
|
526
|
+
}) : he({
|
|
527
|
+
purpose: d?.purpose,
|
|
528
|
+
rootId: d?.rootId,
|
|
529
|
+
childType: d?.childType,
|
|
530
|
+
entity: f,
|
|
531
|
+
order: d?.order
|
|
532
|
+
}), te = oe(f), x = g(() => te.value !== null), T = g(() => n.spec), E = g(() => p.byId.value.get(n.id) ?? null), ne = g(() => p.parents(n.id).at(-1) ?? null), N = g(() => {
|
|
533
|
+
if (ne.value) return p.children(ne.value.id);
|
|
534
|
+
let e = p.root.value;
|
|
535
|
+
return e ? p.children(e.id) : p.walk().filter((e) => p.parents(e.id).length === 0);
|
|
536
|
+
}), L = g(() => N.value.findIndex((e) => e.id === n.id)), R = g(() => T.value.navigation || !1), z = g(() => R.value === "siblings" ? L.value > 0 ? N.value[L.value - 1] : null : R.value === "tree" ? p.previous(n.id) : null), B = g(() => R.value === "siblings" ? L.value !== -1 && L.value < N.value.length - 1 ? N.value[L.value + 1] : null : R.value === "tree" ? p.next(n.id) : null), { language: U, dir: re } = we(E, { entity: f }), ae = g(() => E.value ? i.tr(f, E.value.id, U.value, "en") : {}), G = A(!1);
|
|
537
|
+
V(() => [E.value?.id, U.value], async () => {
|
|
538
|
+
if (G.value = !1, !E.value) {
|
|
539
|
+
G.value = !0;
|
|
540
|
+
return;
|
|
541
|
+
}
|
|
542
|
+
let e = U.value === "en" ? ["en"] : [U.value, "en"];
|
|
543
|
+
await Promise.all([f, u].flatMap((t) => e.map((e) => i.loadTranslations(t, e)))), G.value = !0;
|
|
544
|
+
}, { immediate: !0 });
|
|
545
|
+
function K(e) {
|
|
546
|
+
if (!e) return "";
|
|
547
|
+
let t = T.value.placeholder, n = (e) => !!e && !!t && t.test(e), r = i.tr(f, e.id, U.value, "en");
|
|
548
|
+
if (r.title && !n(r.title)) return r.title;
|
|
549
|
+
let a = i.tr(f, e.id, "en").title;
|
|
550
|
+
return a && !n(a) ? a : e.internal_name ?? e.id;
|
|
551
|
+
}
|
|
552
|
+
let q = g(() => ({
|
|
553
|
+
node: E.value,
|
|
554
|
+
text: ae.value,
|
|
555
|
+
language: U.value,
|
|
556
|
+
tree: p,
|
|
557
|
+
select: Ie,
|
|
558
|
+
t: r,
|
|
559
|
+
tr: (e, t) => i.tr(e, t, U.value, "en")
|
|
560
|
+
}));
|
|
561
|
+
function se(e, t) {
|
|
562
|
+
return t.split(".").reduce((e, t) => e?.[t], e);
|
|
563
|
+
}
|
|
564
|
+
function ce(e, t) {
|
|
565
|
+
return e === !1 || e == null ? "" : typeof e == "function" ? e(t) ?? "" : se(t.text, e) ?? "";
|
|
566
|
+
}
|
|
567
|
+
let X = g(() => ce(T.value.quote ?? "quote", q.value)), Z = g(() => ce(T.value.body ?? "description", q.value)), Q = g(() => {
|
|
568
|
+
if (!T.value.glossary || !E.value) return [];
|
|
569
|
+
let e = [X.value, Z.value].filter(Boolean);
|
|
570
|
+
return Y(e.join("\n\n"), U.value);
|
|
571
|
+
}), le = g(() => J(Q.value)), { active: fe, onClick: pe, close: me } = ve(Q), _e = g(() => fe.value ? ue(fe.value.definition, { breaks: !0 }) : ""), be = g(() => E.value ? T.value.heading ? T.value.heading(q.value) : $(String(K(E.value)), { glossary: le.value }) : ""), xe = g(() => X.value ? $(String(X.value), { glossary: le.value }) : ""), Se = g(() => Z.value ? ue(String(Z.value), {
|
|
572
|
+
breaks: !0,
|
|
573
|
+
glossary: le.value
|
|
574
|
+
}) : ""), Ce = g(() => E.value ? T.value.about?.(E.value) ?? !1 : !1), Te = g(() => !!Ce.value);
|
|
575
|
+
function Ee(e) {
|
|
576
|
+
let t = Ce.value;
|
|
577
|
+
return t && typeof t == "object" ? !!t[e] : !!T.value.aboutKeeps?.includes(e);
|
|
578
|
+
}
|
|
579
|
+
let De = [
|
|
580
|
+
[1e3, "M"],
|
|
581
|
+
[900, "CM"],
|
|
582
|
+
[500, "D"],
|
|
583
|
+
[400, "CD"],
|
|
584
|
+
[100, "C"],
|
|
585
|
+
[90, "XC"],
|
|
586
|
+
[50, "L"],
|
|
587
|
+
[40, "XL"],
|
|
588
|
+
[10, "X"],
|
|
589
|
+
[9, "IX"],
|
|
590
|
+
[5, "V"],
|
|
591
|
+
[4, "IV"],
|
|
592
|
+
[1, "I"]
|
|
593
|
+
];
|
|
594
|
+
function Oe(e) {
|
|
595
|
+
let t = e, n = "";
|
|
596
|
+
for (let [e, r] of De) for (; t >= e;) n += r, t -= e;
|
|
597
|
+
return n;
|
|
598
|
+
}
|
|
599
|
+
let ke = g(() => {
|
|
600
|
+
let e = T.value.numbering;
|
|
601
|
+
if (!e || !E.value) return "";
|
|
602
|
+
let t = (N.value.length ? N.value : [E.value]).findIndex((e) => e.id === n.id), r = t >= 0 ? t + 1 : 1;
|
|
603
|
+
return e === "roman" ? Oe(r) : String(r);
|
|
604
|
+
});
|
|
605
|
+
function Ae(e) {
|
|
606
|
+
return e ? Array.isArray(e.items) ? e.items.map((e) => e && typeof e == "object" ? e.id : e).filter((e) => e != null) : Array.isArray(e.item_ids) ? e.item_ids.filter((e) => e != null) : Array.isArray(e.pictures) ? e.pictures.map((e) => e?.picture_item_id).filter((e) => e != null) : [] : [];
|
|
607
|
+
}
|
|
608
|
+
let je = W(u), Me = g(() => {
|
|
609
|
+
let e = T.value.items?.of ?? Ae;
|
|
610
|
+
return E.value ? e(E.value, q.value) : [];
|
|
611
|
+
}), Ne = g(() => Me.value.map((e) => je.value.get(e)).filter(Boolean)), Pe = A(null);
|
|
612
|
+
V(Ne, (e) => {
|
|
613
|
+
e.some((e) => e.id === Pe.value) || (Pe.value = e[0]?.id ?? null);
|
|
614
|
+
}, { immediate: !0 });
|
|
615
|
+
let Fe = g(() => Ne.value.find((e) => e.id === Pe.value) ?? Ne.value[0] ?? null);
|
|
616
|
+
function Ie(e) {
|
|
617
|
+
Pe.value = e;
|
|
618
|
+
}
|
|
619
|
+
function Le(e) {
|
|
620
|
+
let t = T.value.items?.route;
|
|
621
|
+
return !t || !e ? null : typeof t == "function" ? t(e, q.value) : {
|
|
622
|
+
name: t,
|
|
623
|
+
params: { id: e.id }
|
|
624
|
+
};
|
|
625
|
+
}
|
|
626
|
+
function Re(e) {
|
|
627
|
+
let t = T.value.route;
|
|
628
|
+
return !t || !e ? null : typeof t == "function" ? t(e, q.value) : {
|
|
629
|
+
name: t,
|
|
630
|
+
params: { id: e.id }
|
|
631
|
+
};
|
|
632
|
+
}
|
|
633
|
+
function ze(e) {
|
|
634
|
+
if (!e) return null;
|
|
635
|
+
let t = i.tr(u, e.id, U.value, "en").name ?? e.internal_name ?? e.id;
|
|
636
|
+
return {
|
|
637
|
+
name: $(String(t)),
|
|
638
|
+
image: e.images?.[0]?.url ?? "",
|
|
639
|
+
imageAlt: de(String(t))
|
|
640
|
+
};
|
|
641
|
+
}
|
|
642
|
+
let Be = g(() => {
|
|
643
|
+
let e = Fe.value;
|
|
644
|
+
if (!e) return null;
|
|
645
|
+
let t = ze(e), n = T.value.items?.caption?.(e, E.value, q.value);
|
|
646
|
+
return {
|
|
647
|
+
...t,
|
|
648
|
+
...n
|
|
649
|
+
};
|
|
650
|
+
}), Ve = g(() => !!T.value.panel), He = g(() => {
|
|
651
|
+
let e = Fe.value;
|
|
652
|
+
if (!e) return [];
|
|
653
|
+
let t = Be.value, n = e.images?.[0]?.url ? [{
|
|
654
|
+
id: "__primary",
|
|
655
|
+
image: e.images[0].url,
|
|
656
|
+
alt: t?.imageAlt ?? "",
|
|
657
|
+
caption: {
|
|
658
|
+
title: t?.name ?? "",
|
|
659
|
+
justification: "",
|
|
660
|
+
fields: null
|
|
661
|
+
}
|
|
662
|
+
}] : [], r = T.value.panel?.variants?.(e, q.value) ?? [];
|
|
663
|
+
return [...n, ...r.map((e, t) => ({
|
|
664
|
+
id: e.id ?? `variant-${t}`,
|
|
665
|
+
...e
|
|
666
|
+
}))];
|
|
667
|
+
}), Ue = A(null);
|
|
668
|
+
V(He, (e) => {
|
|
669
|
+
e.some((e) => e.id === Ue.value) || (Ue.value = e[0]?.id ?? null);
|
|
670
|
+
}, { immediate: !0 });
|
|
671
|
+
let We = g(() => He.value.find((e) => e.id === Ue.value) ?? He.value[0] ?? null);
|
|
672
|
+
function Ge(e) {
|
|
673
|
+
Ue.value = e;
|
|
674
|
+
}
|
|
675
|
+
let Ke = g(() => {
|
|
676
|
+
let e = We.value;
|
|
677
|
+
return e?.image ? [{
|
|
678
|
+
url: e.image,
|
|
679
|
+
alt: e.alt ?? ""
|
|
680
|
+
}] : [];
|
|
681
|
+
}), qe = g(() => {
|
|
682
|
+
let e = Fe.value;
|
|
683
|
+
return !e || !T.value.panel?.fields ? [] : T.value.panel.fields(e, E.value, q.value) ?? [];
|
|
684
|
+
}), Je = g(() => {
|
|
685
|
+
let e = We.value?.caption?.fields;
|
|
686
|
+
return e == null ? qe.value : e.map((e) => ({
|
|
687
|
+
label: e.label ? r(e.label) : "",
|
|
688
|
+
value: e.value
|
|
689
|
+
}));
|
|
690
|
+
}), Ye = g(() => {
|
|
691
|
+
let e = We.value?.caption?.justification;
|
|
692
|
+
return e ? $(String(e)) : "";
|
|
693
|
+
}), Xe = g(() => Ne.value.map((e) => {
|
|
694
|
+
let t = ze(e), n = T.value.items?.meta?.(e, q.value) ?? [], r = T.value.items?.badge?.(e, q.value) ?? "";
|
|
695
|
+
return {
|
|
696
|
+
id: e.id,
|
|
697
|
+
image: t.image,
|
|
698
|
+
imageAlt: t.imageAlt,
|
|
699
|
+
name: t.name,
|
|
700
|
+
meta: n,
|
|
701
|
+
badge: r,
|
|
702
|
+
to: Le(e)
|
|
703
|
+
};
|
|
704
|
+
})), Ze = g(() => T.value.breadcrumb && E.value ? p.parents(n.id) : []), Qe = g(() => {
|
|
705
|
+
let e = T.value.tabs;
|
|
706
|
+
return e ? e === "children" ? E.value ? p.children(E.value.id) : [] : N.value : [];
|
|
707
|
+
}), $e = g(() => T.value.previous ?? "exhibition.theme.previous"), Ot = g(() => T.value.next ?? "exhibition.theme.next"), kt = g(() => T.value.backTo ?? "record.action.backToResults"), At = g(() => T.value.inThisTheme ?? "exhibition.theme.inThisTheme"), jt = g(() => T.value.seeAll ?? "exhibition.theme.seeAllInTheme"), Mt = g(() => ({
|
|
708
|
+
...q.value,
|
|
709
|
+
items: Ne.value,
|
|
710
|
+
selected: Fe.value,
|
|
711
|
+
selectedVariant: We.value,
|
|
712
|
+
selectVariant: Ge,
|
|
713
|
+
breadcrumb: Ze.value,
|
|
714
|
+
previous: z.value,
|
|
715
|
+
next: B.value
|
|
716
|
+
})), Nt = g(() => Te.value && !Ee("panel") ? !1 : Ve.value || Ne.value.length > 0 || !!o.aside), Pt = g(() => (!Te.value || Ee("navigation")) && !!R.value && !!(z.value || B.value));
|
|
717
|
+
return (n, i) => x.value && !E.value ? (k(), _(F(ie), { key: 0 })) : E.value ? (k(), y("article", {
|
|
718
|
+
key: 1,
|
|
719
|
+
class: D(["mwnf-essay", { "mwnf-essay--about": Te.value }]),
|
|
720
|
+
dir: F(re) || void 0,
|
|
721
|
+
onClick: i[0] ||= (...e) => F(pe) && F(pe)(...e)
|
|
722
|
+
}, [
|
|
723
|
+
M(n.$slots, "header", O(w(Mt.value)), () => [
|
|
724
|
+
Ze.value.length ? (k(), y("p", tt, [b("span", nt, P(F(r)(kt.value)), 1), (k(!0), y(h, null, j(Ze.value, (e) => (k(), y(h, { key: e.id }, [Re(e) ? (k(), _(m, {
|
|
725
|
+
key: 0,
|
|
726
|
+
to: Re(e),
|
|
727
|
+
class: "mwnf-essay__breadcrumb-link"
|
|
728
|
+
}, {
|
|
729
|
+
default: H(() => [S(P(K(e)), 1)]),
|
|
730
|
+
_: 2
|
|
731
|
+
}, 1032, ["to"])) : (k(), y("span", rt, P(K(e)), 1))], 64))), 128))])) : v("", !0),
|
|
732
|
+
Qe.value.length > 1 ? (k(), y("div", {
|
|
733
|
+
key: 1,
|
|
734
|
+
class: "mwnf-essay__tabs",
|
|
735
|
+
role: "tablist",
|
|
736
|
+
"aria-label": F(r)(At.value)
|
|
737
|
+
}, [(k(!0), y(h, null, j(Qe.value, (t) => (k(), _(m, {
|
|
738
|
+
key: t.id,
|
|
739
|
+
to: Re(t),
|
|
740
|
+
class: D(["mwnf-essay__tab", { "mwnf-essay__tab--active": t.id === e.id }])
|
|
741
|
+
}, {
|
|
742
|
+
default: H(() => [S(P(K(t)), 1)]),
|
|
743
|
+
_: 2
|
|
744
|
+
}, 1032, ["to", "class"]))), 128))], 8, it)) : v("", !0),
|
|
745
|
+
b("h1", at, [ke.value ? (k(), y("span", ot, P(ke.value), 1)) : v("", !0), b("span", { innerHTML: be.value }, null, 8, st)])
|
|
746
|
+
]),
|
|
747
|
+
b("div", ct, [b("div", lt, [
|
|
748
|
+
G.value ? v("", !0) : (k(), y("p", ut, P(F(r)("core.status.loading")), 1)),
|
|
749
|
+
xe.value ? (k(), y("p", {
|
|
750
|
+
key: 1,
|
|
751
|
+
class: "mwnf-essay__quote",
|
|
752
|
+
innerHTML: xe.value
|
|
753
|
+
}, null, 8, dt)) : v("", !0),
|
|
754
|
+
M(n.$slots, "before-body", O(w(Mt.value))),
|
|
755
|
+
Se.value ? (k(), y("div", {
|
|
756
|
+
key: 2,
|
|
757
|
+
class: "mwnf-essay__prose mwnf-sheet__block",
|
|
758
|
+
innerHTML: Se.value
|
|
759
|
+
}, null, 8, ft)) : v("", !0),
|
|
760
|
+
M(n.$slots, "after-body", O(w(Mt.value))),
|
|
761
|
+
Te.value ? v("", !0) : M(n.$slots, "justifications", O(w(Mt.value)), void 0, void 0, 3),
|
|
762
|
+
Pt.value ? (k(), y("div", pt, [M(n.$slots, "navigation", O(w(Mt.value)), () => [z.value ? (k(), _(m, {
|
|
763
|
+
key: 0,
|
|
764
|
+
to: Re(z.value),
|
|
765
|
+
class: "mwnf-essay__nav-link mwnf-essay__nav-link--previous"
|
|
766
|
+
}, {
|
|
767
|
+
default: H(() => [S("← " + P(F(r)($e.value)), 1)]),
|
|
768
|
+
_: 1
|
|
769
|
+
}, 8, ["to"])) : (k(), y("span", mt)), B.value ? (k(), _(m, {
|
|
770
|
+
key: 2,
|
|
771
|
+
to: Re(B.value),
|
|
772
|
+
class: "mwnf-essay__nav-link mwnf-essay__nav-link--next"
|
|
773
|
+
}, {
|
|
774
|
+
default: H(() => [S(P(F(r)(Ot.value)) + " →", 1)]),
|
|
775
|
+
_: 1
|
|
776
|
+
}, 8, ["to"])) : v("", !0)])])) : v("", !0)
|
|
777
|
+
]), Nt.value ? (k(), y("div", ht, [
|
|
778
|
+
M(n.$slots, "panel", O(w(Mt.value)), () => [Ve.value && Be.value ? (k(), y("div", gt, [
|
|
779
|
+
C(t, { images: Ke.value }, null, 8, ["images"]),
|
|
780
|
+
He.value.length > 1 ? (k(), y("ul", _t, [(k(!0), y(h, null, j(He.value, (e) => (k(), y("li", { key: e.id }, [b("button", {
|
|
781
|
+
type: "button",
|
|
782
|
+
class: D(["mwnf-essay__variant", { "mwnf-essay__variant--active": e.id === We.value?.id }]),
|
|
783
|
+
"aria-pressed": e.id === We.value?.id ? "true" : "false",
|
|
784
|
+
onClick: (t) => Ge(e.id)
|
|
785
|
+
}, [e.image ? (k(), y("img", {
|
|
786
|
+
key: 0,
|
|
787
|
+
src: e.image,
|
|
788
|
+
alt: e.alt ?? "",
|
|
789
|
+
loading: "lazy"
|
|
790
|
+
}, null, 8, yt)) : v("", !0)], 10, vt)]))), 128))])) : v("", !0),
|
|
791
|
+
b("h3", {
|
|
792
|
+
class: "mwnf-essay__panel-name",
|
|
793
|
+
innerHTML: We.value?.caption?.title || Be.value.name
|
|
794
|
+
}, null, 8, bt),
|
|
795
|
+
(k(!0), y(h, null, j(Je.value, (e, t) => (k(), y("p", {
|
|
796
|
+
key: t,
|
|
797
|
+
class: "mwnf-essay__panel-field"
|
|
798
|
+
}, [e.label ? (k(), y("span", xt, P(e.label), 1)) : v("", !0), b("span", { innerHTML: e.value }, null, 8, St)]))), 128)),
|
|
799
|
+
Ye.value ? (k(), y("p", {
|
|
800
|
+
key: 1,
|
|
801
|
+
class: "mwnf-essay__panel-justification mwnf-sheet__block",
|
|
802
|
+
innerHTML: Ye.value
|
|
803
|
+
}, null, 8, Ct)) : v("", !0),
|
|
804
|
+
Le(Fe.value) ? (k(), _(m, {
|
|
805
|
+
key: 2,
|
|
806
|
+
to: Le(Fe.value),
|
|
807
|
+
class: "mwnf-essay__panel-link"
|
|
808
|
+
}, {
|
|
809
|
+
default: H(() => [S(P(F(r)(jt.value)) + " →", 1)]),
|
|
810
|
+
_: 1
|
|
811
|
+
}, 8, ["to"])) : v("", !0)
|
|
812
|
+
])) : v("", !0)]),
|
|
813
|
+
M(n.$slots, "thumbnails", O(w(Mt.value)), () => [Ve.value && Ne.value.length > 1 ? (k(), y("ul", wt, [(k(!0), y(h, null, j(Ne.value, (e) => (k(), y("li", { key: e.id }, [b("button", {
|
|
814
|
+
type: "button",
|
|
815
|
+
class: D(["mwnf-essay__thumb", { "mwnf-essay__thumb--active": e.id === Fe.value?.id }]),
|
|
816
|
+
onClick: (t) => Ie(e.id)
|
|
817
|
+
}, [e.images?.[0]?.url ? (k(), y("img", {
|
|
818
|
+
key: 0,
|
|
819
|
+
src: e.images[0].url,
|
|
820
|
+
alt: "",
|
|
821
|
+
loading: "lazy"
|
|
822
|
+
}, null, 8, Et)) : v("", !0)], 10, Tt)]))), 128))])) : !Ve.value && Xe.value.length ? (k(), _(a, {
|
|
823
|
+
key: 1,
|
|
824
|
+
records: Xe.value
|
|
825
|
+
}, null, 8, ["records"])) : v("", !0)]),
|
|
826
|
+
M(n.$slots, "aside", O(w(Mt.value)))
|
|
827
|
+
])) : v("", !0)]),
|
|
828
|
+
M(n.$slots, "after", O(w(Mt.value)), () => [C(ee)]),
|
|
829
|
+
C(s, {
|
|
830
|
+
term: F(fe),
|
|
831
|
+
html: _e.value,
|
|
832
|
+
dir: F(re),
|
|
833
|
+
onClose: F(me)
|
|
834
|
+
}, null, 8, [
|
|
835
|
+
"term",
|
|
836
|
+
"html",
|
|
837
|
+
"dir",
|
|
838
|
+
"onClose"
|
|
839
|
+
])
|
|
840
|
+
], 10, et)) : (k(), y("p", Dt, P(F(r)("core.status.loading")), 1));
|
|
841
|
+
}
|
|
842
|
+
}, kt = { class: "mwnf-link-list" }, At = {
|
|
843
|
+
key: 0,
|
|
844
|
+
class: "mwnf-link-list__back"
|
|
845
|
+
}, jt = {
|
|
846
|
+
key: 1,
|
|
847
|
+
class: "mwnf-link-list__title"
|
|
848
|
+
}, Mt = {
|
|
849
|
+
key: 2,
|
|
850
|
+
class: "mwnf-link-list__groups"
|
|
851
|
+
}, Nt = {
|
|
852
|
+
key: 0,
|
|
853
|
+
class: "mwnf-link-list__heading"
|
|
854
|
+
}, Pt = {
|
|
855
|
+
key: 1,
|
|
856
|
+
class: "mwnf-link-list__links"
|
|
857
|
+
}, Ft = ["innerHTML"], It = ["innerHTML"], Lt = {
|
|
858
|
+
key: 3,
|
|
859
|
+
class: "mwnf-link-list__empty"
|
|
860
|
+
}, Rt = {
|
|
861
|
+
__name: "LinkListView",
|
|
862
|
+
props: { spec: {
|
|
863
|
+
type: Object,
|
|
864
|
+
required: !0
|
|
865
|
+
} },
|
|
866
|
+
setup(e) {
|
|
867
|
+
let t = e, { t: n } = ye(), r = g(() => ((typeof t.spec.groups == "function" ? t.spec.groups({}) : t.spec.groups ?? []) ?? []).filter((e) => e.links?.length > 0)), i = g(() => t.spec.title ? n(t.spec.title) : ""), a = g(() => t.spec.back?.label ? n(t.spec.back.label) : ""), o = g(() => n(t.spec.empty ?? "catalogue.results.noResults"));
|
|
868
|
+
return (e, s) => (k(), y("div", kt, [
|
|
869
|
+
t.spec.back && a.value ? (k(), y("div", At, [C(m, {
|
|
870
|
+
to: t.spec.back.to,
|
|
871
|
+
href: t.spec.back.href
|
|
872
|
+
}, {
|
|
873
|
+
default: H(() => [S(" ← " + P(a.value), 1)]),
|
|
874
|
+
_: 1
|
|
875
|
+
}, 8, ["to", "href"])])) : v("", !0),
|
|
876
|
+
i.value ? (k(), y("h1", jt, P(i.value), 1)) : v("", !0),
|
|
877
|
+
M(e.$slots, "before"),
|
|
878
|
+
r.value.length ? (k(), y("div", Mt, [(k(!0), y(h, null, j(r.value, (t, r) => (k(), y("section", {
|
|
879
|
+
key: r,
|
|
880
|
+
class: "mwnf-link-list__group"
|
|
881
|
+
}, [M(e.$slots, "group", { group: t }, () => [t.heading ? (k(), y("h2", Nt, P(F(n)(t.heading)), 1)) : v("", !0), t.links?.length ? (k(), y("ul", Pt, [(k(!0), y(h, null, j(t.links, (e, t) => (k(), y("li", {
|
|
882
|
+
key: t,
|
|
883
|
+
class: "mwnf-link-list__item"
|
|
884
|
+
}, [C(m, {
|
|
885
|
+
class: "mwnf-link-list__link",
|
|
886
|
+
to: e.to,
|
|
887
|
+
href: e.href
|
|
888
|
+
}, {
|
|
889
|
+
default: H(() => [b("span", { innerHTML: F(Z)(e.label) }, null, 8, Ft)]),
|
|
890
|
+
_: 2
|
|
891
|
+
}, 1032, ["to", "href"]), e.note ? (k(), y("div", {
|
|
892
|
+
key: 0,
|
|
893
|
+
class: "mwnf-link-list__note",
|
|
894
|
+
innerHTML: F(Z)(e.note)
|
|
895
|
+
}, null, 8, It)) : v("", !0)]))), 128))])) : v("", !0)])]))), 128))])) : (k(), y("div", Lt, P(o.value), 1)),
|
|
896
|
+
M(e.$slots, "after")
|
|
897
|
+
]));
|
|
898
|
+
}
|
|
899
|
+
}, zt = { class: "mwnf-partner-list" }, Bt = {
|
|
900
|
+
key: 0,
|
|
901
|
+
class: "mwnf-partner-list__title"
|
|
902
|
+
}, Vt = {
|
|
903
|
+
key: 1,
|
|
904
|
+
class: "mwnf-partner-list__count"
|
|
905
|
+
}, Ht = {
|
|
906
|
+
key: 2,
|
|
907
|
+
class: "mwnf-partner-list__toggle"
|
|
908
|
+
}, Ut = {
|
|
909
|
+
key: 3,
|
|
910
|
+
class: "mwnf-partner-list__groups"
|
|
911
|
+
}, Wt = {
|
|
912
|
+
key: 0,
|
|
913
|
+
class: "mwnf-partner-list__group-title"
|
|
914
|
+
}, Gt = { class: "mwnf-partner-list__tier" }, Kt = { class: "mwnf-partner-list__row" }, qt = {
|
|
915
|
+
key: 0,
|
|
916
|
+
class: "mwnf-partner-list__children"
|
|
917
|
+
}, Jt = {
|
|
918
|
+
key: 0,
|
|
919
|
+
class: "mwnf-partner-list__tier mwnf-partner-list__tier--associated"
|
|
920
|
+
}, Yt = { class: "mwnf-partner-list__tier-label" }, Xt = {
|
|
921
|
+
key: 4,
|
|
922
|
+
class: "mwnf-partner-list__empty"
|
|
923
|
+
}, Zt = {
|
|
924
|
+
__name: "PartnerListView",
|
|
925
|
+
props: { spec: {
|
|
926
|
+
type: Object,
|
|
927
|
+
required: !0
|
|
928
|
+
} },
|
|
929
|
+
setup(e) {
|
|
930
|
+
let t = e, { t: n, locale: r } = ye(), i = ge(), a = g(() => t.spec), o = g(() => a.value.entity ?? "partners"), s = oe(o.value);
|
|
931
|
+
o.value && i.loadTranslations(o.value, "en");
|
|
932
|
+
let c = {
|
|
933
|
+
t: n,
|
|
934
|
+
locale: r,
|
|
935
|
+
tr: (e) => i.tr(o.value, e, r.value, "en"),
|
|
936
|
+
renderInline: $,
|
|
937
|
+
renderPlain: de
|
|
938
|
+
}, { filters: l, apply: d } = be({
|
|
939
|
+
keys: ["order"],
|
|
940
|
+
page: !1
|
|
941
|
+
}), f = g(() => l.order === "desc" ? "desc" : "asc");
|
|
942
|
+
function ee() {
|
|
943
|
+
d({ order: f.value === "asc" ? "desc" : "asc" });
|
|
944
|
+
}
|
|
945
|
+
let p = g(() => {
|
|
946
|
+
let e = a.value, t = s.value ?? [];
|
|
947
|
+
return e.scope ? t.filter((t) => e.scope(t, c)) : t;
|
|
948
|
+
}), te = g(() => a.value.route);
|
|
949
|
+
function m(e) {
|
|
950
|
+
let t = te.value;
|
|
951
|
+
return t ? typeof t == "function" ? t(e, c) : {
|
|
952
|
+
name: t,
|
|
953
|
+
params: { id: e.id }
|
|
954
|
+
} : null;
|
|
955
|
+
}
|
|
956
|
+
function x(e) {
|
|
957
|
+
let t = a.value.objectsRoute;
|
|
958
|
+
return le(e, c.tr(e.id), {
|
|
959
|
+
route: m,
|
|
960
|
+
objectsRoute: t ? (e) => t(e, c) : null
|
|
961
|
+
});
|
|
962
|
+
}
|
|
963
|
+
function S(e, t) {
|
|
964
|
+
let n = t.name ?? "";
|
|
965
|
+
return {
|
|
966
|
+
...le(e, {}, {}),
|
|
967
|
+
name: n,
|
|
968
|
+
plainName: D(n),
|
|
969
|
+
city: t.city ?? "",
|
|
970
|
+
location: t.city ?? "",
|
|
971
|
+
logos: t.logo ? [{
|
|
972
|
+
url: t.logo,
|
|
973
|
+
alt: D(n),
|
|
974
|
+
type: ""
|
|
975
|
+
}] : [],
|
|
976
|
+
itemCount: t.count ?? 0,
|
|
977
|
+
route: t.route ?? null
|
|
978
|
+
};
|
|
979
|
+
}
|
|
980
|
+
function T(e) {
|
|
981
|
+
if (a.value.record) {
|
|
982
|
+
let t = a.value.record(e, c);
|
|
983
|
+
return {
|
|
984
|
+
partner: e,
|
|
985
|
+
row: t,
|
|
986
|
+
view: S(e, t)
|
|
987
|
+
};
|
|
988
|
+
}
|
|
989
|
+
let t = x(e);
|
|
990
|
+
return {
|
|
991
|
+
partner: e,
|
|
992
|
+
row: {
|
|
993
|
+
name: t.name,
|
|
994
|
+
city: t.city,
|
|
995
|
+
logo: t.logos[0]?.url ?? "",
|
|
996
|
+
count: t.itemCount,
|
|
997
|
+
route: t.route
|
|
998
|
+
},
|
|
999
|
+
view: t
|
|
1000
|
+
};
|
|
1001
|
+
}
|
|
1002
|
+
function D(e) {
|
|
1003
|
+
return String(e ?? "").replace(/<[^>]*>/g, "");
|
|
1004
|
+
}
|
|
1005
|
+
let ne = g(() => a.value.nested ? Q(p.value) : null), A = g(() => {
|
|
1006
|
+
let e = a.value, t = e.group?.tier ?? !1, n = (e.group?.order ?? "country") === "name", r = n ? p.value.map((e) => ({
|
|
1007
|
+
...e,
|
|
1008
|
+
country_id: "\0"
|
|
1009
|
+
})) : p.value, i = se(r, {
|
|
1010
|
+
label: n ? () => "" : (t) => e.label ? e.label(t, c) : t,
|
|
1011
|
+
tier: t,
|
|
1012
|
+
order: f.value
|
|
1013
|
+
}), o = (e, t) => D(e.row.name).localeCompare(D(t.row.name));
|
|
1014
|
+
return i.map((t) => {
|
|
1015
|
+
let r = t.main.map(T).sort(o), i = t.associated.map(T).sort(o);
|
|
1016
|
+
if (n && f.value === "desc" && (r.reverse(), i.reverse()), e.nested && ne.value) {
|
|
1017
|
+
let e = new Set(i.map((e) => e.partner.id));
|
|
1018
|
+
r = r.map((t) => {
|
|
1019
|
+
let n = ne.value.children(t.partner.id).filter((t) => e.has(t.id));
|
|
1020
|
+
for (let t of n) e.delete(t.id);
|
|
1021
|
+
return {
|
|
1022
|
+
...t,
|
|
1023
|
+
children: n.map(T)
|
|
1024
|
+
};
|
|
1025
|
+
}), i = i.filter((t) => e.has(t.partner.id));
|
|
1026
|
+
}
|
|
1027
|
+
return {
|
|
1028
|
+
country: t.country,
|
|
1029
|
+
label: t.label,
|
|
1030
|
+
main: r,
|
|
1031
|
+
associated: i
|
|
1032
|
+
};
|
|
1033
|
+
});
|
|
1034
|
+
}), F = g(() => A.value.some((e) => e.main.length > 0 || e.associated.length > 0)), I = g(() => n(a.value.associatedLabel ?? "partner.list.associated")), L = g(() => ({
|
|
1035
|
+
objectsLabel: a.value.objectsLabel ?? "partner.item.objectsInSite",
|
|
1036
|
+
emptyLabel: a.value.emptyLabel ?? "",
|
|
1037
|
+
show: { actions: !!a.value.actions }
|
|
1038
|
+
})), R = g(() => n(a.value.foundLabel ?? "partner.list.partnersFound")), z = g(() => n(a.value.sortAscendingLabel ?? "partner.list.sortAscending")), B = g(() => n(a.value.sortDescendingLabel ?? "partner.list.sortDescending")), V = g(() => n(a.value.empty ?? "catalogue.results.noResults")), U = g(() => a.value.title ? n(a.value.title) : ""), re = g(() => A.value.reduce((e, t) => e + t.main.length + t.associated.length, 0)), ie = g(() => a.value.variant ?? "accordion"), W = g(() => ({
|
|
1039
|
+
t: n,
|
|
1040
|
+
locale: r,
|
|
1041
|
+
groups: A.value,
|
|
1042
|
+
orderDir: f.value,
|
|
1043
|
+
toggleOrder: ee
|
|
1044
|
+
}));
|
|
1045
|
+
return (e, t) => (k(), y("section", zt, [
|
|
1046
|
+
U.value ? (k(), y("h1", Bt, P(U.value), 1)) : v("", !0),
|
|
1047
|
+
a.value.count ? (k(), y("div", Vt, P(R.value) + ": " + P(re.value), 1)) : v("", !0),
|
|
1048
|
+
M(e.$slots, "before", O(w(W.value))),
|
|
1049
|
+
a.value.orderToggle ? (k(), y("div", Ht, [b("button", {
|
|
1050
|
+
type: "button",
|
|
1051
|
+
class: "mwnf-partner-list__toggle-button",
|
|
1052
|
+
onClick: ee
|
|
1053
|
+
}, P(f.value === "asc" ? B.value : z.value), 1)])) : v("", !0),
|
|
1054
|
+
F.value ? (k(), y("div", Ut, [(k(!0), y(h, null, j(A.value, (t) => (k(), _(N(ie.value === "accordion" ? "details" : "section"), E({
|
|
1055
|
+
key: t.country ?? "",
|
|
1056
|
+
class: "mwnf-partner-list__group"
|
|
1057
|
+
}, { ref_for: !0 }, ie.value === "accordion" ? { open: !0 } : {}), {
|
|
1058
|
+
default: H(() => [
|
|
1059
|
+
(k(), _(N(ie.value === "accordion" ? "summary" : "div"), { class: "mwnf-partner-list__group-heading" }, {
|
|
1060
|
+
default: H(() => [M(e.$slots, "group-heading", E({ group: t }, { ref_for: !0 }, W.value), () => [t.label ? (k(), y("h2", Wt, P(t.label), 1)) : v("", !0)])]),
|
|
1061
|
+
_: 2
|
|
1062
|
+
}, 1024)),
|
|
1063
|
+
b("div", Gt, [(k(!0), y(h, null, j(t.main, (n) => (k(), y("div", {
|
|
1064
|
+
key: n.partner.id,
|
|
1065
|
+
class: "mwnf-partner-list__row-block"
|
|
1066
|
+
}, [b("div", Kt, [M(e.$slots, "row", E({
|
|
1067
|
+
group: t,
|
|
1068
|
+
partner: n.partner,
|
|
1069
|
+
row: n.row,
|
|
1070
|
+
view: n.view
|
|
1071
|
+
}, { ref_for: !0 }, W.value), () => [C(u, E({
|
|
1072
|
+
variant: "line",
|
|
1073
|
+
partner: n.view
|
|
1074
|
+
}, { ref_for: !0 }, L.value), null, 16, ["partner"])])]), n.children?.length ? (k(), y("div", qt, [(k(!0), y(h, null, j(n.children, (n) => (k(), y("div", {
|
|
1075
|
+
key: n.partner.id,
|
|
1076
|
+
class: "mwnf-partner-list__row mwnf-partner-list__row--child"
|
|
1077
|
+
}, [M(e.$slots, "row", E({
|
|
1078
|
+
group: t,
|
|
1079
|
+
partner: n.partner,
|
|
1080
|
+
row: n.row,
|
|
1081
|
+
view: n.view
|
|
1082
|
+
}, { ref_for: !0 }, W.value), () => [C(u, E({
|
|
1083
|
+
variant: "line",
|
|
1084
|
+
partner: n.view
|
|
1085
|
+
}, { ref_for: !0 }, L.value), null, 16, ["partner"])])]))), 128))])) : v("", !0)]))), 128))]),
|
|
1086
|
+
t.associated.length ? (k(), y("div", Jt, [b("p", Yt, P(I.value), 1), (k(!0), y(h, null, j(t.associated, (n) => (k(), y("div", {
|
|
1087
|
+
key: n.partner.id,
|
|
1088
|
+
class: "mwnf-partner-list__row"
|
|
1089
|
+
}, [M(e.$slots, "row", E({
|
|
1090
|
+
group: t,
|
|
1091
|
+
partner: n.partner,
|
|
1092
|
+
row: n.row,
|
|
1093
|
+
view: n.view
|
|
1094
|
+
}, { ref_for: !0 }, W.value), () => [C(u, E({
|
|
1095
|
+
variant: "line",
|
|
1096
|
+
partner: n.view
|
|
1097
|
+
}, { ref_for: !0 }, L.value), null, 16, ["partner"])])]))), 128))])) : v("", !0)
|
|
1098
|
+
]),
|
|
1099
|
+
_: 2
|
|
1100
|
+
}, 1040))), 128))])) : (k(), y("p", Xt, P(V.value), 1)),
|
|
1101
|
+
M(e.$slots, "after", O(w(W.value)))
|
|
1102
|
+
]));
|
|
1103
|
+
}
|
|
1104
|
+
}, Qt = { class: "mwnf-text-page" }, $t = {
|
|
1105
|
+
key: 0,
|
|
1106
|
+
class: "mwnf-text-page__back"
|
|
1107
|
+
}, en = {
|
|
1108
|
+
key: 1,
|
|
1109
|
+
class: "mwnf-text-page__heading"
|
|
1110
|
+
}, tn = { class: "mwnf-prose" }, nn = ["innerHTML"], rn = {
|
|
1111
|
+
__name: "TextPageView",
|
|
1112
|
+
props: { spec: {
|
|
1113
|
+
type: Object,
|
|
1114
|
+
required: !0
|
|
1115
|
+
} },
|
|
1116
|
+
setup(e) {
|
|
1117
|
+
let t = e, { t: n } = ye(), r = ge(), i = xe(), a = g(() => t.spec.heading ? n(t.spec.heading) : ""), o = g(() => typeof t.spec.body == "string"), s = g(() => o.value ? t.spec.body : null), c = g(() => ({
|
|
1118
|
+
t: n,
|
|
1119
|
+
tr: (e, t) => r.tr(e, t, i.value, "en"),
|
|
1120
|
+
language: i.value
|
|
1121
|
+
})), l = g(() => o.value ? null : typeof t.spec.body == "function" ? X(t.spec.body(c.value)) : null), u = g(() => t.spec.back === !1 ? null : t.spec.back === !0 ? n("core.action.back") : t.spec.back?.label ? n(t.spec.back.label) : null);
|
|
1122
|
+
return (e, n) => (k(), y("div", Qt, [
|
|
1123
|
+
u.value && (t.spec.back === !0 || t.spec.back?.to || t.spec.back?.href) ? (k(), y("div", $t, [C(m, {
|
|
1124
|
+
to: t.spec.back === !0 ? {} : t.spec.back?.to,
|
|
1125
|
+
href: t.spec.back === !0 ? "#" : t.spec.back?.href
|
|
1126
|
+
}, {
|
|
1127
|
+
default: H(() => [S(" ← " + P(u.value), 1)]),
|
|
1128
|
+
_: 1
|
|
1129
|
+
}, 8, ["to", "href"])])) : v("", !0),
|
|
1130
|
+
a.value ? (k(), y("h1", en, P(a.value), 1)) : v("", !0),
|
|
1131
|
+
b("div", tn, [o.value ? (k(), _(F(re), {
|
|
1132
|
+
key: 0,
|
|
1133
|
+
keypath: s.value
|
|
1134
|
+
}, null, 8, ["keypath"])) : l.value ? (k(), y("div", {
|
|
1135
|
+
key: 1,
|
|
1136
|
+
innerHTML: l.value
|
|
1137
|
+
}, null, 8, nn)) : v("", !0)])
|
|
1138
|
+
]));
|
|
1139
|
+
}
|
|
1140
|
+
}, an = { class: "mwnf-search-form__row-label" }, on = ["onUpdate:modelValue"], sn = ["value"], cn = ["onUpdate:modelValue"], ln = ["value"], un = ["onUpdate:modelValue", "placeholder"], dn = {
|
|
1141
|
+
key: 0,
|
|
1142
|
+
class: "mwnf-search-form__dates"
|
|
1143
|
+
}, fn = {
|
|
1144
|
+
key: 1,
|
|
1145
|
+
class: "mwnf-facet"
|
|
1146
|
+
}, pn = { class: "mwnf-facet__label" }, mn = { value: "" }, hn = ["value"], gn = {
|
|
1147
|
+
key: 0,
|
|
1148
|
+
class: "mwnf-search-form__dates"
|
|
1149
|
+
}, _n = { class: "mwnf-search-form__radio-choice" }, vn = ["value"], yn = ["onUpdate:modelValue", "disabled"], bn = ["onUpdate:modelValue"], xn = { class: "mwnf-facet__label" }, Sn = {
|
|
1150
|
+
key: 0,
|
|
1151
|
+
class: "mwnf-search-form__how-to"
|
|
1152
|
+
}, Cn = {
|
|
1153
|
+
__name: "SearchFormView",
|
|
1154
|
+
props: { spec: {
|
|
1155
|
+
type: Object,
|
|
1156
|
+
required: !0
|
|
1157
|
+
} },
|
|
1158
|
+
setup(e) {
|
|
1159
|
+
let t = e, { t: n } = ye(), r = je(), i = g(() => t.spec), a = g(() => i.value.mode), o = g(() => i.value.entity ? oe(i.value.entity).value ?? [] : []), s = g(() => i.value.dates === "buckets"), c = g(() => {
|
|
1160
|
+
let e = i.value.dates;
|
|
1161
|
+
if (!e || e === "buckets") return null;
|
|
1162
|
+
let t = e.presets;
|
|
1163
|
+
return typeof t == "function" ? t() : t ?? ae();
|
|
1164
|
+
});
|
|
1165
|
+
function u(e) {
|
|
1166
|
+
return (e ?? []).map((e) => ({
|
|
1167
|
+
value: e,
|
|
1168
|
+
label: String(e)
|
|
1169
|
+
}));
|
|
1170
|
+
}
|
|
1171
|
+
let d = g(() => s.value ? ke(o.value, n) : []), ee = g(() => s.value ? d.value : u(c.value?.from)), p = g(() => s.value ? d.value : u(c.value?.to)), te = g(() => !!i.value.dates), x = A(""), E = A(""), N = i.value.language ? De(i.value.language) : null, I = g(() => N?.languages.value ?? []), V = N?.language ?? A(""), re = g(() => Object.fromEntries((i.value.facets ?? []).filter((e) => !e.options && e.type !== "year").map((e) => [e.key, { field: e.field ?? e.key }]))), ie = _e(o, re), W = g(() => {
|
|
1172
|
+
let e = {};
|
|
1173
|
+
for (let t of i.value.facets ?? []) e[t.key] = t.options ?? ie.value[t.key] ?? [];
|
|
1174
|
+
return e;
|
|
1175
|
+
}), G = [{
|
|
1176
|
+
key: "AND",
|
|
1177
|
+
label: "catalogue.search.and"
|
|
1178
|
+
}, {
|
|
1179
|
+
key: "OR",
|
|
1180
|
+
label: "catalogue.search.or"
|
|
1181
|
+
}], K = [
|
|
1182
|
+
"catalogue.search.keywordOne",
|
|
1183
|
+
"catalogue.search.keywordTwo",
|
|
1184
|
+
"catalogue.search.keywordThree"
|
|
1185
|
+
], q = g(() => i.value.operators ?? G), J = A(Array.from({ length: i.value.rows ?? 3 }, () => ({
|
|
1186
|
+
keyword: "",
|
|
1187
|
+
field: i.value.fields?.[0]?.key ?? "",
|
|
1188
|
+
cond: (i.value.operators ?? G)[0].key
|
|
1189
|
+
})));
|
|
1190
|
+
function Y(e) {
|
|
1191
|
+
return K[e] ? n(K[e]) : "";
|
|
1192
|
+
}
|
|
1193
|
+
let se = A(i.value.facets?.[0]?.key ?? ""), ce = ne(Object.fromEntries((i.value.facets ?? []).map((e) => [e.key, ""]))), X = ne(Object.fromEntries((i.value.extras ?? []).map((e) => [e.key, !1])));
|
|
1194
|
+
function Z() {
|
|
1195
|
+
let e = {};
|
|
1196
|
+
for (let t of i.value.extras ?? []) X[t.key] && (e[t.key] = "1");
|
|
1197
|
+
return e;
|
|
1198
|
+
}
|
|
1199
|
+
function Q(e) {
|
|
1200
|
+
return r.push({
|
|
1201
|
+
name: i.value.target,
|
|
1202
|
+
query: e
|
|
1203
|
+
});
|
|
1204
|
+
}
|
|
1205
|
+
function le() {
|
|
1206
|
+
let e = {};
|
|
1207
|
+
if (a.value === "rows") J.value.forEach((t, n) => {
|
|
1208
|
+
if (t.keyword) {
|
|
1209
|
+
if (n === 0) e.q = t.keyword, t.field && (e.field = t.field);
|
|
1210
|
+
else {
|
|
1211
|
+
let r = n + 1;
|
|
1212
|
+
e[`q${r}`] = t.keyword, t.field && (e[`field${r}`] = t.field), e[`op${r}`] = t.cond;
|
|
1213
|
+
}
|
|
1214
|
+
}
|
|
1215
|
+
}), x.value && (e.from = String(x.value)), E.value && (e.to = String(E.value)), V.value && (e.lang = V.value);
|
|
1216
|
+
else if (a.value === "radio") {
|
|
1217
|
+
let t = se.value, n = t ? ce[t] : "";
|
|
1218
|
+
n && (e[t] = String(n));
|
|
1219
|
+
}
|
|
1220
|
+
return Object.assign(e, Z()), Q(e);
|
|
1221
|
+
}
|
|
1222
|
+
function ue(e, t) {
|
|
1223
|
+
if (t !== "" && t != null) return Q({
|
|
1224
|
+
[e]: String(t),
|
|
1225
|
+
...Z()
|
|
1226
|
+
});
|
|
1227
|
+
}
|
|
1228
|
+
function $() {
|
|
1229
|
+
return Q(Z());
|
|
1230
|
+
}
|
|
1231
|
+
let de = g(() => a.value === "facets" ? "immediate" : "apply"), fe = g(() => a.value === "radio" ? "core.action.browse" : "core.action.search"), pe = g(() => n(i.value.submitLabel ?? fe.value)), me = g(() => n(i.value.showAllLabel ?? "core.action.reset")), he = g(() => ({
|
|
1232
|
+
mode: a.value,
|
|
1233
|
+
submit: le,
|
|
1234
|
+
showAll: $
|
|
1235
|
+
}));
|
|
1236
|
+
return (e, t) => (k(), y("section", { class: D(["mwnf-search-form", `mwnf-search-form--${a.value}`]) }, [
|
|
1237
|
+
M(e.$slots, "intro", O(w(he.value))),
|
|
1238
|
+
M(e.$slots, "before", O(w(he.value))),
|
|
1239
|
+
C(f, {
|
|
1240
|
+
class: "mwnf-search-form__panel",
|
|
1241
|
+
mode: de.value,
|
|
1242
|
+
"apply-label": pe.value,
|
|
1243
|
+
"reset-label": me.value,
|
|
1244
|
+
onApply: le,
|
|
1245
|
+
onReset: $
|
|
1246
|
+
}, {
|
|
1247
|
+
default: H(() => [
|
|
1248
|
+
a.value === "rows" ? (k(), y(h, { key: 0 }, [
|
|
1249
|
+
(k(!0), y(h, null, j(J.value, (e, t) => (k(), y("div", {
|
|
1250
|
+
key: t,
|
|
1251
|
+
class: "mwnf-search-form__row"
|
|
1252
|
+
}, [
|
|
1253
|
+
b("span", an, P(Y(t)), 1),
|
|
1254
|
+
t > 0 ? U((k(), y("select", {
|
|
1255
|
+
key: 0,
|
|
1256
|
+
"onUpdate:modelValue": (t) => e.cond = t,
|
|
1257
|
+
class: "mwnf-facet__select mwnf-search-form__operator"
|
|
1258
|
+
}, [(k(!0), y(h, null, j(q.value, (e) => (k(), y("option", {
|
|
1259
|
+
key: e.key,
|
|
1260
|
+
value: e.key
|
|
1261
|
+
}, P(F(n)(e.label)), 9, sn))), 128))], 8, on)), [[z, e.cond]]) : v("", !0),
|
|
1262
|
+
U(b("select", {
|
|
1263
|
+
"onUpdate:modelValue": (t) => e.field = t,
|
|
1264
|
+
class: "mwnf-facet__select mwnf-search-form__field"
|
|
1265
|
+
}, [(k(!0), y(h, null, j(i.value.fields ?? [], (e) => (k(), y("option", {
|
|
1266
|
+
key: e.key,
|
|
1267
|
+
value: e.key
|
|
1268
|
+
}, P(F(n)(e.label)), 9, ln))), 128))], 8, cn), [[z, e.field]]),
|
|
1269
|
+
U(b("input", {
|
|
1270
|
+
"onUpdate:modelValue": (t) => e.keyword = t,
|
|
1271
|
+
type: "text",
|
|
1272
|
+
class: "mwnf-search-form__keyword",
|
|
1273
|
+
placeholder: F(n)("catalogue.search.keywordPlaceholder")
|
|
1274
|
+
}, null, 8, un), [[B, e.keyword]])
|
|
1275
|
+
]))), 128)),
|
|
1276
|
+
te.value ? (k(), y("div", dn, [C(l, {
|
|
1277
|
+
modelValue: x.value,
|
|
1278
|
+
"onUpdate:modelValue": t[0] ||= (e) => x.value = e,
|
|
1279
|
+
label: F(n)("catalogue.facet.dateFrom"),
|
|
1280
|
+
options: ee.value,
|
|
1281
|
+
"any-label": "—"
|
|
1282
|
+
}, null, 8, [
|
|
1283
|
+
"modelValue",
|
|
1284
|
+
"label",
|
|
1285
|
+
"options"
|
|
1286
|
+
]), C(l, {
|
|
1287
|
+
modelValue: E.value,
|
|
1288
|
+
"onUpdate:modelValue": t[1] ||= (e) => E.value = e,
|
|
1289
|
+
label: F(n)("catalogue.facet.dateTo"),
|
|
1290
|
+
options: p.value,
|
|
1291
|
+
"any-label": "—"
|
|
1292
|
+
}, null, 8, [
|
|
1293
|
+
"modelValue",
|
|
1294
|
+
"label",
|
|
1295
|
+
"options"
|
|
1296
|
+
])])) : v("", !0),
|
|
1297
|
+
i.value.language ? (k(), y("label", fn, [b("span", pn, P(F(n)("catalogue.search.language")), 1), U(b("select", {
|
|
1298
|
+
"onUpdate:modelValue": t[2] ||= (e) => T(V) ? V.value = e : null,
|
|
1299
|
+
class: "mwnf-facet__select mwnf-search-form__language"
|
|
1300
|
+
}, [b("option", mn, P(F(n)("catalogue.search.anyLanguage")), 1), (k(!0), y(h, null, j(I.value, (e) => (k(), y("option", {
|
|
1301
|
+
key: e,
|
|
1302
|
+
value: e
|
|
1303
|
+
}, P(e.toUpperCase()), 9, hn))), 128))], 512), [[z, F(V)]])])) : v("", !0)
|
|
1304
|
+
], 64)) : a.value === "facets" ? (k(), y(h, { key: 1 }, [(k(!0), y(h, null, j(i.value.facets ?? [], (e) => (k(), _(l, {
|
|
1305
|
+
key: e.key,
|
|
1306
|
+
label: e.label ? F(n)(e.label) : "",
|
|
1307
|
+
options: W.value[e.key] ?? [],
|
|
1308
|
+
"model-value": ce[e.key],
|
|
1309
|
+
"onUpdate:modelValue": (t) => ue(e.key, t)
|
|
1310
|
+
}, null, 8, [
|
|
1311
|
+
"label",
|
|
1312
|
+
"options",
|
|
1313
|
+
"model-value",
|
|
1314
|
+
"onUpdate:modelValue"
|
|
1315
|
+
]))), 128)), te.value ? (k(), y("div", gn, [C(l, {
|
|
1316
|
+
"model-value": x.value,
|
|
1317
|
+
label: F(n)("catalogue.facet.startDate"),
|
|
1318
|
+
options: ee.value,
|
|
1319
|
+
"onUpdate:modelValue": t[3] ||= (e) => {
|
|
1320
|
+
x.value = e, ue("from", e);
|
|
1321
|
+
}
|
|
1322
|
+
}, null, 8, [
|
|
1323
|
+
"model-value",
|
|
1324
|
+
"label",
|
|
1325
|
+
"options"
|
|
1326
|
+
]), C(l, {
|
|
1327
|
+
"model-value": E.value,
|
|
1328
|
+
label: F(n)("catalogue.facet.endDate"),
|
|
1329
|
+
options: p.value,
|
|
1330
|
+
"onUpdate:modelValue": t[4] ||= (e) => {
|
|
1331
|
+
E.value = e, ue("to", e);
|
|
1332
|
+
}
|
|
1333
|
+
}, null, 8, [
|
|
1334
|
+
"model-value",
|
|
1335
|
+
"label",
|
|
1336
|
+
"options"
|
|
1337
|
+
])])) : v("", !0)], 64)) : a.value === "radio" ? (k(!0), y(h, { key: 2 }, j(i.value.facets ?? [], (e) => (k(), y("div", {
|
|
1338
|
+
key: e.key,
|
|
1339
|
+
class: "mwnf-search-form__radio-row"
|
|
1340
|
+
}, [b("label", _n, [U(b("input", {
|
|
1341
|
+
"onUpdate:modelValue": t[5] ||= (e) => se.value = e,
|
|
1342
|
+
type: "radio",
|
|
1343
|
+
name: "mwnf-search-form-filter",
|
|
1344
|
+
value: e.key
|
|
1345
|
+
}, null, 8, vn), [[R, se.value]]), S(" " + P(e.label ? F(n)(e.label) : ""), 1)]), e.type === "year" ? U((k(), y("input", {
|
|
1346
|
+
key: 1,
|
|
1347
|
+
"onUpdate:modelValue": (t) => ce[e.key] = t,
|
|
1348
|
+
type: "number",
|
|
1349
|
+
class: "mwnf-search-form__year",
|
|
1350
|
+
disabled: se.value !== e.key
|
|
1351
|
+
}, null, 8, yn)), [[B, ce[e.key]]]) : (k(), _(l, {
|
|
1352
|
+
key: 0,
|
|
1353
|
+
modelValue: ce[e.key],
|
|
1354
|
+
"onUpdate:modelValue": (t) => ce[e.key] = t,
|
|
1355
|
+
options: W.value[e.key] ?? [],
|
|
1356
|
+
disabled: se.value !== e.key
|
|
1357
|
+
}, null, 8, [
|
|
1358
|
+
"modelValue",
|
|
1359
|
+
"onUpdate:modelValue",
|
|
1360
|
+
"options",
|
|
1361
|
+
"disabled"
|
|
1362
|
+
]))]))), 128)) : v("", !0),
|
|
1363
|
+
(k(!0), y(h, null, j(i.value.extras ?? [], (e) => (k(), y("label", {
|
|
1364
|
+
key: e.key,
|
|
1365
|
+
class: "mwnf-facet mwnf-facet--checkbox"
|
|
1366
|
+
}, [U(b("input", {
|
|
1367
|
+
"onUpdate:modelValue": (t) => X[e.key] = t,
|
|
1368
|
+
type: "checkbox",
|
|
1369
|
+
class: "mwnf-facet__checkbox"
|
|
1370
|
+
}, null, 8, bn), [[L, X[e.key]]]), b("span", xn, P(F(n)(e.label)), 1)]))), 128)),
|
|
1371
|
+
M(e.$slots, "extras", O(w(he.value)))
|
|
1372
|
+
]),
|
|
1373
|
+
_: 3
|
|
1374
|
+
}, 8, [
|
|
1375
|
+
"mode",
|
|
1376
|
+
"apply-label",
|
|
1377
|
+
"reset-label"
|
|
1378
|
+
]),
|
|
1379
|
+
i.value.howTo ? (k(), y("p", Sn, [C(m, { to: { name: i.value.howTo } }, {
|
|
1380
|
+
default: H(() => [S(P(F(n)("catalogue.search.howTo")), 1)]),
|
|
1381
|
+
_: 1
|
|
1382
|
+
}, 8, ["to"])])) : v("", !0),
|
|
1383
|
+
M(e.$slots, "actions", O(w(he.value)))
|
|
1384
|
+
], 2));
|
|
1385
|
+
}
|
|
1386
|
+
}, wn = { class: "mwnf-timeline" }, Tn = {
|
|
1387
|
+
key: 0,
|
|
1388
|
+
class: "mwnf-timeline__title"
|
|
1389
|
+
}, En = {
|
|
1390
|
+
key: 3,
|
|
1391
|
+
class: "mwnf-facet"
|
|
1392
|
+
}, Dn = { class: "mwnf-facet__label" }, On = [
|
|
1393
|
+
"value",
|
|
1394
|
+
"placeholder",
|
|
1395
|
+
"onInput"
|
|
1396
|
+
], kn = {
|
|
1397
|
+
key: 1,
|
|
1398
|
+
class: "mwnf-timeline__error"
|
|
1399
|
+
}, An = {
|
|
1400
|
+
__name: "TimelineResultsView",
|
|
1401
|
+
props: { spec: {
|
|
1402
|
+
type: Object,
|
|
1403
|
+
required: !0
|
|
1404
|
+
} },
|
|
1405
|
+
setup(e) {
|
|
1406
|
+
let t = e, { t: n } = ye(), r = je(), a = g(() => t.spec), s = g(() => !!a.value.entrance), c = Oe({
|
|
1407
|
+
scope: t.spec.scope ?? "country",
|
|
1408
|
+
countryLabel: t.spec.countryLabel,
|
|
1409
|
+
countryIdForCode: t.spec.countryIdForCode,
|
|
1410
|
+
tr: t.spec.tr,
|
|
1411
|
+
timelinesEntity: t.spec.timelinesEntity,
|
|
1412
|
+
eventsEntity: t.spec.eventsEntity
|
|
1413
|
+
}), u = g(() => a.value.controls ?? []), d = g(() => a.value.keys ?? u.value.map((e) => e.key)), ee = (e) => u.value.some((t) => t.key === e), te = g(() => ({
|
|
1414
|
+
t: n,
|
|
1415
|
+
tr: t.spec.tr,
|
|
1416
|
+
years: {
|
|
1417
|
+
min: z.value[0],
|
|
1418
|
+
max: z.value[1]
|
|
1419
|
+
}
|
|
1420
|
+
})), x = ne(Object.fromEntries(d.value.map((e) => [e, ""]))), T = A(""), E = s.value ? null : be({ keys: d.value }), D = s.value ? x : E.filters;
|
|
1421
|
+
function N(e) {
|
|
1422
|
+
if (ee("collection") && e !== "" && e != null) return e === "pc" ? null : e;
|
|
1423
|
+
}
|
|
1424
|
+
function I() {
|
|
1425
|
+
for (let e of d.value) x[e] = "";
|
|
1426
|
+
T.value = "";
|
|
1427
|
+
}
|
|
1428
|
+
function L() {
|
|
1429
|
+
T.value = "";
|
|
1430
|
+
let e = !!D.begin && !!D.end;
|
|
1431
|
+
if (e && Number(D.begin) >= Number(D.end)) {
|
|
1432
|
+
T.value = n(a.value.errorPeriod ?? "timeline.form.errorPeriod");
|
|
1433
|
+
return;
|
|
1434
|
+
}
|
|
1435
|
+
if (!D.country && !e) {
|
|
1436
|
+
T.value = n(a.value.errorSelect ?? "timeline.form.errorSelect");
|
|
1437
|
+
return;
|
|
1438
|
+
}
|
|
1439
|
+
let t = {};
|
|
1440
|
+
for (let e of d.value) D[e] && (t[e] = D[e]);
|
|
1441
|
+
r.push({
|
|
1442
|
+
name: a.value.route,
|
|
1443
|
+
query: t
|
|
1444
|
+
});
|
|
1445
|
+
}
|
|
1446
|
+
let R = g(() => {
|
|
1447
|
+
if (s.value) return [];
|
|
1448
|
+
let e = D;
|
|
1449
|
+
return c.findEvents({
|
|
1450
|
+
country: e.country || void 0,
|
|
1451
|
+
collection: N(e.collection),
|
|
1452
|
+
begin: e.begin,
|
|
1453
|
+
end: e.end
|
|
1454
|
+
});
|
|
1455
|
+
}), z = g(() => {
|
|
1456
|
+
let e = c.findEvents({
|
|
1457
|
+
country: void 0,
|
|
1458
|
+
collection: void 0
|
|
1459
|
+
}).map((e) => e.year_from).filter((e) => Number.isFinite(e) && e !== 0);
|
|
1460
|
+
return e.length ? [Math.min(...e), Math.max(...e)] : [null, null];
|
|
1461
|
+
}), B = Se(R, {
|
|
1462
|
+
page: () => E ? E.page.value : 1,
|
|
1463
|
+
size: () => a.value.pageSize ?? 15
|
|
1464
|
+
});
|
|
1465
|
+
function V(e) {
|
|
1466
|
+
let t = a.value.countryLabel && e.country_id ? a.value.countryLabel(e.country_id) : "";
|
|
1467
|
+
return {
|
|
1468
|
+
id: e.id,
|
|
1469
|
+
date: q(e, e.text, n),
|
|
1470
|
+
caption: t ? $(String(t)) : "",
|
|
1471
|
+
description: e.text?.description ? ue(String(e.text.description), { breaks: !0 }) : ""
|
|
1472
|
+
};
|
|
1473
|
+
}
|
|
1474
|
+
let U = g(() => B.value.rows.map((e) => (a.value.event ?? V)(e, te.value))), re = g(() => (c.countries.value ?? []).map((e) => ({
|
|
1475
|
+
value: e.value,
|
|
1476
|
+
label: e.value === "all" ? n("timeline.form.allCountries") : e.label
|
|
1477
|
+
}))), ie = g(() => a.value.collections?.(te.value) ?? []), W = g(() => {
|
|
1478
|
+
let e = {};
|
|
1479
|
+
for (let t of u.value) (t.key === "begin" || t.key === "end") && t.options && (typeof t.options == "function" ? e[t.key] = t.options(te.value) : e[t.key] = t.options);
|
|
1480
|
+
return e;
|
|
1481
|
+
}), ae = g(() => ({
|
|
1482
|
+
filters: D,
|
|
1483
|
+
active: d.value.some((e) => D[e]),
|
|
1484
|
+
apply: s.value ? L : (e) => E.apply(e),
|
|
1485
|
+
reset: s.value ? I : E.reset,
|
|
1486
|
+
goToPage: s.value ? () => {} : E.goToPage,
|
|
1487
|
+
events: R.value,
|
|
1488
|
+
pageInfo: B.value,
|
|
1489
|
+
countries: re.value,
|
|
1490
|
+
collections: ie.value,
|
|
1491
|
+
t: n,
|
|
1492
|
+
tr: a.value.tr
|
|
1493
|
+
})), G = g(() => {
|
|
1494
|
+
let e = a.value.gallery;
|
|
1495
|
+
return !e || s.value ? null : !e.items || e.items(ae.value);
|
|
1496
|
+
}), K = g(() => {
|
|
1497
|
+
let e = G.value;
|
|
1498
|
+
return e == null ? !1 : Array.isArray(e) ? e.length > 0 : !!e;
|
|
1499
|
+
}), oe = g(() => {
|
|
1500
|
+
let e = G.value;
|
|
1501
|
+
return Array.isArray(e) ? e.length : typeof e == "number" ? e : null;
|
|
1502
|
+
}), J = g(() => {
|
|
1503
|
+
if (!K.value) return null;
|
|
1504
|
+
let e = {};
|
|
1505
|
+
for (let t of d.value) D[t] && (e[t] = D[t]);
|
|
1506
|
+
return {
|
|
1507
|
+
to: {
|
|
1508
|
+
name: a.value.gallery.route,
|
|
1509
|
+
query: e
|
|
1510
|
+
},
|
|
1511
|
+
count: oe.value,
|
|
1512
|
+
label: n(a.value.gallery.label ?? "timeline.nav.seeGallery")
|
|
1513
|
+
};
|
|
1514
|
+
}), Y = g(() => ({
|
|
1515
|
+
...ae.value,
|
|
1516
|
+
gallery: J.value
|
|
1517
|
+
})), se = g(() => a.value.summary ? a.value.summary(Y.value) : [{
|
|
1518
|
+
label: n(a.value.summaryLabel ?? "timeline.results.eventsFound"),
|
|
1519
|
+
count: B.value.total
|
|
1520
|
+
}]), ce = g(() => n(a.value.empty ?? "timeline.results.noResults")), X = g(() => ({
|
|
1521
|
+
window: 5,
|
|
1522
|
+
jump: !1,
|
|
1523
|
+
ends: !0,
|
|
1524
|
+
...a.value.pagination ?? {}
|
|
1525
|
+
}));
|
|
1526
|
+
function Z(e, t) {
|
|
1527
|
+
return e.label ? n(e.label) : t ? n(t) : "";
|
|
1528
|
+
}
|
|
1529
|
+
return (e, t) => (k(), y("section", wn, [
|
|
1530
|
+
M(e.$slots, "before", O(w(Y.value))),
|
|
1531
|
+
a.value.title ? (k(), y("h1", Tn, P(F(n)(a.value.title)), 1)) : v("", !0),
|
|
1532
|
+
C(f, {
|
|
1533
|
+
class: "mwnf-timeline__filters",
|
|
1534
|
+
title: a.value.filterTitle ? F(n)(a.value.filterTitle) : "",
|
|
1535
|
+
"apply-label": s.value ? F(n)(a.value.submitLabel ?? "core.action.search") : a.value.applyLabel ? F(n)(a.value.applyLabel) : "",
|
|
1536
|
+
"reset-label": a.value.resetLabel ? F(n)(a.value.resetLabel) : "",
|
|
1537
|
+
onApply: t[2] ||= (e) => s.value ? L() : F(E).apply(),
|
|
1538
|
+
onReset: t[3] ||= (e) => s.value ? I() : F(E).reset()
|
|
1539
|
+
}, {
|
|
1540
|
+
default: H(() => [(k(!0), y(h, null, j(u.value, (e) => (k(), y(h, { key: e.key }, [e.key === "country" ? (k(), _(l, {
|
|
1541
|
+
key: 0,
|
|
1542
|
+
"model-value": F(D).country,
|
|
1543
|
+
label: Z(e, "catalogue.facet.country"),
|
|
1544
|
+
options: re.value,
|
|
1545
|
+
placeholder: e.placeholder ? F(n)(e.placeholder) : F(n)("timeline.form.selectCountry"),
|
|
1546
|
+
"any-label": e.anyLabel ? F(n)(e.anyLabel) : "",
|
|
1547
|
+
"hide-empty": !!e.hideEmpty,
|
|
1548
|
+
"onUpdate:modelValue": t[0] ||= (e) => F(D).country = e
|
|
1549
|
+
}, null, 8, [
|
|
1550
|
+
"model-value",
|
|
1551
|
+
"label",
|
|
1552
|
+
"options",
|
|
1553
|
+
"placeholder",
|
|
1554
|
+
"any-label",
|
|
1555
|
+
"hide-empty"
|
|
1556
|
+
])) : e.key === "collection" ? (k(), _(l, {
|
|
1557
|
+
key: 1,
|
|
1558
|
+
"model-value": F(D).collection,
|
|
1559
|
+
label: Z(e),
|
|
1560
|
+
options: ie.value,
|
|
1561
|
+
placeholder: e.placeholder ? F(n)(e.placeholder) : "",
|
|
1562
|
+
"any-label": e.anyLabel ? F(n)(e.anyLabel) : "",
|
|
1563
|
+
"hide-empty": !!e.hideEmpty,
|
|
1564
|
+
"onUpdate:modelValue": t[1] ||= (e) => F(D).collection = e
|
|
1565
|
+
}, null, 8, [
|
|
1566
|
+
"model-value",
|
|
1567
|
+
"label",
|
|
1568
|
+
"options",
|
|
1569
|
+
"placeholder",
|
|
1570
|
+
"any-label",
|
|
1571
|
+
"hide-empty"
|
|
1572
|
+
])) : (e.key === "begin" || e.key === "end") && W.value[e.key] ? (k(), _(l, {
|
|
1573
|
+
key: 2,
|
|
1574
|
+
"model-value": F(D)[e.key],
|
|
1575
|
+
label: Z(e, e.key === "begin" ? "timeline.form.startDate" : "timeline.form.endDate"),
|
|
1576
|
+
options: W.value[e.key],
|
|
1577
|
+
placeholder: e.placeholder ? F(n)(e.placeholder) : F(n)(e.key === "begin" ? "timeline.form.fromYearHint" : "timeline.form.toYearHint"),
|
|
1578
|
+
"any-label": e.anyLabel ? F(n)(e.anyLabel) : "",
|
|
1579
|
+
"hide-empty": !!e.hideEmpty,
|
|
1580
|
+
"onUpdate:modelValue": (t) => F(D)[e.key] = t
|
|
1581
|
+
}, null, 8, [
|
|
1582
|
+
"model-value",
|
|
1583
|
+
"label",
|
|
1584
|
+
"options",
|
|
1585
|
+
"placeholder",
|
|
1586
|
+
"any-label",
|
|
1587
|
+
"hide-empty",
|
|
1588
|
+
"onUpdate:modelValue"
|
|
1589
|
+
])) : (k(), y("label", En, [b("span", Dn, P(Z(e, e.key === "begin" ? "timeline.form.startDate" : "timeline.form.endDate")), 1), b("input", {
|
|
1590
|
+
type: "number",
|
|
1591
|
+
class: "mwnf-facet__select",
|
|
1592
|
+
value: F(D)[e.key],
|
|
1593
|
+
placeholder: e.placeholder ? F(n)(e.placeholder) : F(n)(e.key === "begin" ? "timeline.form.fromYearHint" : "timeline.form.toYearHint"),
|
|
1594
|
+
onInput: (t) => F(D)[e.key] = t.target.value
|
|
1595
|
+
}, null, 40, On)]))], 64))), 128))]),
|
|
1596
|
+
_: 1
|
|
1597
|
+
}, 8, [
|
|
1598
|
+
"title",
|
|
1599
|
+
"apply-label",
|
|
1600
|
+
"reset-label"
|
|
1601
|
+
]),
|
|
1602
|
+
s.value && T.value ? (k(), y("p", kn, P(T.value), 1)) : v("", !0),
|
|
1603
|
+
s.value ? v("", !0) : (k(), y(h, { key: 2 }, [
|
|
1604
|
+
M(e.$slots, "summary", O(w(Y.value)), () => [C(i, { parts: se.value }, null, 8, ["parts"])]),
|
|
1605
|
+
J.value ? (k(), _(m, {
|
|
1606
|
+
key: 0,
|
|
1607
|
+
class: "mwnf-timeline__gallery",
|
|
1608
|
+
to: J.value.to
|
|
1609
|
+
}, {
|
|
1610
|
+
default: H(() => [M(e.$slots, "cross-link", O(w(Y.value)), () => [S(P(J.value.label), 1), J.value.count == null ? v("", !0) : (k(), y(h, { key: 0 }, [S(" (" + P(J.value.count) + ")", 1)], 64))])]),
|
|
1611
|
+
_: 3
|
|
1612
|
+
}, 8, ["to"])) : v("", !0),
|
|
1613
|
+
M(e.$slots, "event", O(w(Y.value)), () => [C(p, { events: U.value }, {
|
|
1614
|
+
empty: H(() => [M(e.$slots, "empty", O(w(Y.value)), () => [S(P(ce.value), 1)])]),
|
|
1615
|
+
_: 3
|
|
1616
|
+
}, 8, ["events"])]),
|
|
1617
|
+
C(o, {
|
|
1618
|
+
"page-info": F(B),
|
|
1619
|
+
window: X.value.window,
|
|
1620
|
+
jump: X.value.jump,
|
|
1621
|
+
ends: X.value.ends,
|
|
1622
|
+
onNavigate: F(E).goToPage
|
|
1623
|
+
}, null, 8, [
|
|
1624
|
+
"page-info",
|
|
1625
|
+
"window",
|
|
1626
|
+
"jump",
|
|
1627
|
+
"ends",
|
|
1628
|
+
"onNavigate"
|
|
1629
|
+
])
|
|
1630
|
+
], 64)),
|
|
1631
|
+
M(e.$slots, "after", O(w(Y.value)))
|
|
1632
|
+
]));
|
|
1633
|
+
}
|
|
1634
|
+
};
|
|
1635
|
+
//#endregion
|
|
1636
|
+
export { Rt as a, Ke as c, Zt as i, Cn as n, Ot as o, rn as r, $e as s, An as t };
|