@museumwnf/viewer-layout 2.14.0 → 2.15.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/dist/views.js CHANGED
@@ -1,15 +1,16 @@
1
- import { S as e, _ as t, a as n, b as r, c as i, d as a, f as o, g as s, h as c, l, m as u, n as d, o as f, p, r as m, s as ee, t as h, u as g, v as _, x as v, y } from "./TimelineLookup-D8qr1tmY.js";
2
- import { Fragment as b, computed as x, createBlock as S, createCommentVNode as C, createElementBlock as w, createElementVNode as T, createSlots as E, createTextVNode as D, createVNode as O, guardReactiveProps as k, isRef as A, mergeProps as j, normalizeClass as M, normalizeProps as N, openBlock as P, reactive as F, ref as I, renderList as L, renderSlot as R, resolveDynamicComponent as z, toDisplayString as B, unref as V, useSlots as H, vModelCheckbox as U, vModelRadio as te, vModelSelect as W, vModelText as ne, watch as G, withCtx as K, withDirectives as q } from "vue";
3
- import { I18nText as J, NotFoundView as re, byId as ie, centuryPresets as Y, citation as X, dateRange as ae, entityRef as oe, eventDateLabel as Z, glossaryEntries as se, glossaryTermsForText as Q, groupByCountry as ce, languageLabels as le, md as ue, mdInline as de, mwnfLinks as fe, partnerHierarchy as pe, projectName as me, renderBlock as he, renderInline as $, renderPlain as ge, sheetRows as _e, sortChronological as ve, sourceUrl as ye, useCollectionTree as be, useDataPackage as xe, useFacets as Se, useFeaturedRecord as Ce, useGlossaryPopup as we, useI18n as Te, useListQuery as Ee, useLocale as De, usePagination as Oe, useProjects as ke, useRecordLanguage as Ae, useRecordSheet as je, useRelatedRecords as Me, useSearchLanguage as Ne, useSiteConfig as Pe, useTimelineEvents as Fe, yearBuckets as Ie } from "@museumwnf/viewer-core";
4
- import { useRoute as Le, useRouter as Re } from "vue-router";
1
+ import { a as e, i as t, n, o as r, t as i } from "./TimelineLookup-DRc43FkL.js";
2
+ import { a, g as o, i as s, m as ee, n as te, r as c, s as l } from "./TimelineEventList-BmfLBaTT.js";
3
+ import { a as u, i as d, n as f, o as p, r as m, t as ne } from "./TimelineResultsView-D78PPWk-.js";
4
+ 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, mergeProps as T, normalizeClass as E, normalizeProps as D, openBlock as O, ref as k, renderList as A, renderSlot as j, toDisplayString as M, unref as N, useSlots as re, watch as P, withCtx as F } from "vue";
5
+ import { I18nText as ie, NotFoundView as ae, byId as oe, entityRef as se, glossaryEntries as ce, glossaryTermsForText as le, mdInline as I, mwnfLinks as L, renderBlock as ue, renderInline as de, renderPlain as fe, useCollectionTree as pe, useDataPackage as me, useFeaturedRecord as R, useGlossaryPopup as he, useI18n as ge, useProjects as z, useRecordLanguage as _e, useSiteConfig as B } from "@museumwnf/viewer-core";
5
6
  //#region src/views/HomeView.vue
6
- var ze = { class: "mwnf-home" }, Be = {
7
+ var V = { class: "mwnf-home" }, ve = {
7
8
  key: 0,
8
9
  class: "mwnf-home__welcome"
9
- }, Ve = {
10
+ }, ye = {
10
11
  key: 0,
11
12
  class: "mwnf-home__title"
12
- }, He = {
13
+ }, H = {
13
14
  __name: "HomeView",
14
15
  props: {
15
16
  title: {
@@ -29,12 +30,12 @@ var ze = { class: "mwnf-home" }, Be = {
29
30
  default: null
30
31
  }
31
32
  },
32
- setup(e) {
33
- let t = e, { t: n, locale: i } = Te(), a = Pe(), o = x(() => ({
34
- ...a.home ?? {},
35
- ...s(t)
33
+ setup(t) {
34
+ let n = t, { t: i, locale: a } = ge(), o = B(), s = g(() => ({
35
+ ...o.home ?? {},
36
+ ...ee(n)
36
37
  }));
37
- function s(e) {
38
+ function ee(e) {
38
39
  let t = {};
39
40
  for (let n of [
40
41
  "title",
@@ -44,546 +45,86 @@ var ze = { class: "mwnf-home" }, Be = {
44
45
  ]) e[n] != null && e[n] !== "" && (t[n] = e[n]);
45
46
  return t;
46
47
  }
47
- let c = x(() => (o.value.cards ?? []).map((e) => ({
48
+ let te = g(() => (s.value.cards ?? []).map((e) => ({
48
49
  ...e,
49
- title: e.title ? n(e.title) : "",
50
- description: e.description ? n(e.description) : "",
51
- action: e.action ? n(e.action) : ""
52
- }))), l = x(() => o.value.featured ?? null), u = l.value?.entity ?? "", d = xe();
53
- u && d.loadTranslations(u, "en");
54
- let f = u ? Ce(u, {
55
- seed: l.value?.seed,
56
- images: l.value?.images ?? "images"
57
- }) : x(() => null), p = x(() => f.value ? d.tr(u, f.value.id, i.value, "en") : {});
58
- function m(e, t, n) {
50
+ title: e.title ? i(e.title) : "",
51
+ description: e.description ? i(e.description) : "",
52
+ action: e.action ? i(e.action) : ""
53
+ }))), c = g(() => s.value.featured ?? null), l = c.value?.entity ?? "", u = me();
54
+ l && u.loadTranslations(l, "en");
55
+ let d = l ? R(l, {
56
+ seed: c.value?.seed,
57
+ images: c.value?.images ?? "images"
58
+ }) : g(() => null), f = g(() => d.value ? u.tr(l, d.value.id, a.value, "en") : {});
59
+ function p(e, t, n) {
59
60
  return typeof e == "function" ? e(t, n) : typeof e != "string" || !e ? "" : n[e] ?? t[e] ?? "";
60
61
  }
61
- let ee = x(() => {
62
- let e = f.value, t = l.value;
62
+ let m = g(() => {
63
+ let e = d.value, t = c.value;
63
64
  if (!e || !t) return null;
64
- let r = p.value.name ?? e.internal_name ?? e.id, i = typeof t.meta == "function" ? t.meta(e, p.value) : (t.meta ?? []).map((t) => m(t, e, p.value)), a = t.images ?? "images";
65
+ let n = f.value.name ?? e.internal_name ?? e.id, r = typeof t.meta == "function" ? t.meta(e, f.value) : (t.meta ?? []).map((t) => p(t, e, f.value)), a = t.images ?? "images";
65
66
  return {
66
- heading: t.heading ? n(t.heading) : "",
67
+ heading: t.heading ? i(t.heading) : "",
67
68
  image: e[a]?.[0]?.url ?? "",
68
- imageAlt: ge(String(r)),
69
- eyebrow: String(m(t.eyebrow, e, p.value) ?? ""),
70
- name: $(String(r)),
71
- meta: i.filter(Boolean).map(String),
72
- action: t.action ? n(t.action) : "",
69
+ imageAlt: fe(String(n)),
70
+ eyebrow: String(p(t.eyebrow, e, f.value) ?? ""),
71
+ name: de(String(n)),
72
+ meta: r.filter(Boolean).map(String),
73
+ action: t.action ? i(t.action) : "",
73
74
  to: typeof t.to == "function" ? t.to(e) : {
74
75
  name: t.route ?? "item",
75
76
  params: { id: e.id }
76
77
  }
77
78
  };
78
79
  });
79
- return (e, t) => (P(), w("section", ze, [
80
- o.value.title || o.value.intro ? (P(), w("header", Be, [o.value.title ? (P(), w("h1", Ve, B(V(n)(o.value.title)), 1)) : C("", !0), o.value.intro ? (P(), S(V(J), {
80
+ return (t, n) => (O(), y("section", V, [
81
+ s.value.title || s.value.intro ? (O(), y("header", ve, [s.value.title ? (O(), y("h1", ye, M(N(i)(s.value.title)), 1)) : v("", !0), s.value.intro ? (O(), _(N(ie), {
81
82
  key: 1,
82
83
  tag: "div",
83
84
  class: "mwnf-home__intro",
84
- keypath: o.value.intro
85
- }, null, 8, ["keypath"])) : C("", !0)])) : C("", !0),
86
- R(e.$slots, "before"),
87
- O(v, { cards: c.value }, null, 8, ["cards"]),
88
- R(e.$slots, "default"),
89
- ee.value ? (P(), S(r, N(j({ key: 1 }, ee.value)), null, 16)) : C("", !0),
90
- R(e.$slots, "after")
85
+ keypath: s.value.intro
86
+ }, null, 8, ["keypath"])) : v("", !0)])) : v("", !0),
87
+ j(t.$slots, "before"),
88
+ C(r, { cards: te.value }, null, 8, ["cards"]),
89
+ j(t.$slots, "default"),
90
+ m.value ? (O(), _(e, D(T({ key: 1 }, m.value)), null, 16)) : v("", !0),
91
+ j(t.$slots, "after")
91
92
  ]));
92
93
  }
93
- }, Ue = { class: "mwnf-catalogue" }, We = {
94
- key: 0,
95
- class: "mwnf-catalogue__title"
96
- }, Ge = {
97
- key: 0,
98
- class: "mwnf-facet"
99
- }, Ke = {
100
- key: 0,
101
- class: "mwnf-facet__label"
102
- }, qe = [
103
- "value",
104
- "placeholder",
105
- "onInput"
106
- ], Je = {
107
- key: 1,
108
- class: "mwnf-facet"
109
- }, Ye = {
110
- key: 0,
111
- class: "mwnf-facet__label"
112
- }, Xe = [
113
- "value",
114
- "placeholder",
115
- "onInput"
116
- ], Ze = {
117
- key: 2,
118
- class: "mwnf-facet mwnf-facet--checkbox"
119
- }, Qe = ["checked", "onChange"], $e = {
120
- key: 0,
121
- class: "mwnf-facet__label"
122
- }, et = { class: "mwnf-catalogue__body" }, tt = { class: "mwnf-catalogue__results" }, nt = {
123
- key: 0,
124
- class: "mwnf-catalogue__aside"
125
- }, rt = {
126
- __name: "CatalogueResultsView",
127
- props: {
128
- spec: {
129
- type: Object,
130
- required: !0
131
- },
132
- entity: {
133
- type: String,
134
- default: ""
135
- }
136
- },
137
- setup(e) {
138
- let n = e, { t: r, locale: i } = Te(), a = xe(), o = n.spec.entity ?? n.entity, l = x(() => n.spec), d = oe(o);
139
- o && a.loadTranslations(o, "en");
140
- let f = x(() => l.value.keys ?? [...Object.keys(l.value.facets ?? {}), ...p()]);
141
- function p() {
142
- let e = l.value.dates;
143
- return e ? [e.begin ?? "begin", e.end ?? "end"] : [];
144
- }
145
- let { filters: m, page: ee, active: h, apply: g, reset: v, goToPage: A } = Ee({ keys: f.value }), j = {
146
- t: r,
147
- locale: i,
148
- tr: (e, t) => a.tr(e, t, i.value, "en"),
149
- renderInline: $,
150
- renderPlain: ge
151
- };
152
- function M(e, t) {
153
- if (typeof t.values == "function") return [t.values(e)].flat();
154
- let n = e?.[t.field];
155
- return Array.isArray(n) ? n : [n];
156
- }
157
- let F = x(() => {
158
- let e = l.value, t = d.value ?? [];
159
- e.scope && (t = t.filter((t) => e.scope(t, m, j)));
160
- for (let [n, r] of Object.entries(e.facets ?? {})) {
161
- let e = m[n];
162
- e && (t = t.filter((t) => M(t, r).map(String).includes(String(e))));
163
- }
164
- e.match && (t = t.filter((t) => e.match(t, m, j))), e.narrow && (t = e.narrow(t, m, j)), e.dates && (t = ae(t, {
165
- begin: m[e.dates.begin ?? "begin"],
166
- end: m[e.dates.end ?? "end"],
167
- mode: e.dates.mode ?? "overlap",
168
- fields: e.dates.fields
169
- }));
170
- let n = e.sort ?? "chronological";
171
- return typeof n == "function" ? n(t) : n === "chronological" ? ve(t) : n && typeof n == "object" ? ve(t, n) : t;
172
- }), I = x(() => l.value.facetScope === "matching" ? F.value : d.value ?? []), H = Se(I, () => l.value.facets ?? {}), U = Oe(F, {
173
- page: ee,
174
- size: () => l.value.pageSize ?? 20
175
- }), te = x(() => l.value.recordRoute ?? (n.entity ? `${n.entity}-detail` : "item"));
176
- function W(e) {
177
- let t = j.tr(o, e.id).name ?? e.internal_name ?? e.id;
178
- return {
179
- id: e.id,
180
- image: e.images?.[0]?.url ?? "",
181
- imageAlt: ge(String(t)),
182
- name: $(String(t)),
183
- meta: [],
184
- badge: e.type ?? "",
185
- to: {
186
- name: te.value,
187
- params: { id: e.id }
188
- }
189
- };
190
- }
191
- let ne = x(() => U.value.rows.map((e) => (l.value.record ?? W)(e, j))), G = x(() => ({
192
- filters: m,
193
- active: h.value,
194
- apply: g,
195
- reset: v,
196
- goToPage: A,
197
- matching: F.value,
198
- pageInfo: U.value,
199
- options: H.value
200
- })), q = x(() => {
201
- let e = l.value;
202
- return e.summary ? e.summary({
203
- ...G.value,
204
- t: r,
205
- total: (d.value ?? []).length
206
- }) : [{
207
- label: r(e.summaryLabel ?? "catalogue.results.itemsFound"),
208
- count: U.value.total
209
- }];
210
- }), J = x(() => l.value.filterMode ?? "apply"), re = x(() => l.value.controls ?? []), ie = x(() => re.value.length > 0 || !!l.value.panel);
211
- function Y(e, t) {
212
- J.value === "immediate" ? g({ [e]: t }) : m[e] = t;
213
- }
214
- let X = x(() => r(l.value.empty ?? "catalogue.results.noResultsFilter")), Z = x(() => l.value.variant === "grid"), se = x(() => ({
215
- window: 5,
216
- jump: !1,
217
- ends: !0,
218
- ...l.value.pagination ?? {}
219
- }));
220
- return (e, n) => (P(), w("section", Ue, [
221
- R(e.$slots, "before", N(k(G.value))),
222
- l.value.title ? (P(), w("h1", We, B(V(r)(l.value.title)), 1)) : C("", !0),
223
- ie.value || e.$slots.filters ? (P(), S(c, {
224
- key: 1,
225
- class: "mwnf-catalogue__filters",
226
- mode: J.value,
227
- title: l.value.filterTitle ? V(r)(l.value.filterTitle) : "",
228
- "reset-label": l.value.resetLabel ? V(r)(l.value.resetLabel) : "",
229
- onApply: n[2] ||= (e) => V(g)(),
230
- onReset: n[3] ||= (e) => V(v)()
231
- }, {
232
- default: K(() => [(P(!0), w(b, null, L(re.value, (e) => (P(), w(b, { key: e.key }, [e.type === "year" ? (P(), w("label", Ge, [e.label ? (P(), w("span", Ke, B(V(r)(e.label)), 1)) : C("", !0), T("input", {
233
- type: "number",
234
- class: "mwnf-facet__select",
235
- value: V(m)[e.key],
236
- placeholder: e.placeholder ? V(r)(e.placeholder) : "",
237
- onInput: (t) => V(m)[e.key] = t.target.value,
238
- onChange: n[0] ||= (e) => J.value === "immediate" ? V(g)() : null
239
- }, null, 40, qe)])) : e.type === "query" ? (P(), w("label", Je, [e.label ? (P(), w("span", Ye, B(V(r)(e.label)), 1)) : C("", !0), T("input", {
240
- type: "text",
241
- class: "mwnf-facet__select",
242
- value: V(m)[e.key],
243
- placeholder: e.placeholder ? V(r)(e.placeholder) : "",
244
- onInput: (t) => V(m)[e.key] = t.target.value,
245
- onChange: n[1] ||= (e) => J.value === "immediate" ? V(g)() : null
246
- }, null, 40, Xe)])) : e.type === "checkbox" ? (P(), w("label", Ze, [T("input", {
247
- type: "checkbox",
248
- class: "mwnf-facet__checkbox",
249
- checked: V(m)[e.key] === "1",
250
- onChange: (t) => Y(e.key, t.target.checked ? "1" : "")
251
- }, null, 40, Qe), e.label ? (P(), w("span", $e, B(V(r)(e.label)), 1)) : C("", !0)])) : (P(), S(s, {
252
- key: 3,
253
- "model-value": V(m)[e.key],
254
- label: e.label ? V(r)(e.label) : "",
255
- options: V(H)[e.key] ?? [],
256
- placeholder: e.placeholder ? V(r)(e.placeholder) : "",
257
- "any-label": e.anyLabel ? V(r)(e.anyLabel) : "",
258
- "hide-empty": !!e.hideEmpty,
259
- "onUpdate:modelValue": (t) => Y(e.key, t)
260
- }, null, 8, [
261
- "model-value",
262
- "label",
263
- "options",
264
- "placeholder",
265
- "any-label",
266
- "hide-empty",
267
- "onUpdate:modelValue"
268
- ]))], 64))), 128)), R(e.$slots, "filters", N(k(G.value)))]),
269
- _: 3
270
- }, 8, [
271
- "mode",
272
- "title",
273
- "reset-label"
274
- ])) : C("", !0),
275
- O(u, { parts: q.value }, E({ _: 2 }, [e.$slots.actions ? {
276
- name: "actions",
277
- fn: K(() => [R(e.$slots, "actions", N(k(G.value)))]),
278
- key: "0"
279
- } : void 0]), 1032, ["parts"]),
280
- T("div", et, [T("div", tt, [(P(), S(z(Z.value ? _ : y), {
281
- records: ne.value,
282
- "action-label": l.value.actionLabel ? V(r)(l.value.actionLabel) : ""
283
- }, {
284
- empty: K(() => [R(e.$slots, "empty", N(k(G.value)), () => [D(B(X.value), 1)])]),
285
- _: 3
286
- }, 8, ["records", "action-label"])), O(t, {
287
- "page-info": V(U),
288
- window: se.value.window,
289
- jump: se.value.jump,
290
- ends: se.value.ends,
291
- onNavigate: V(A)
292
- }, null, 8, [
293
- "page-info",
294
- "window",
295
- "jump",
296
- "ends",
297
- "onNavigate"
298
- ])]), e.$slots.aside ? (P(), w("aside", nt, [R(e.$slots, "aside", N(k(G.value)))])) : C("", !0)]),
299
- R(e.$slots, "after", N(k(G.value)))
300
- ]));
301
- }
302
- }, it = ["dir", "innerHTML"], at = { class: "mwnf-record__body" }, ot = { class: "mwnf-record__main" }, st = {
303
- key: 1,
304
- class: "mwnf-record__status"
305
- }, ct = {
306
- key: 0,
307
- class: "mwnf-record__aside"
308
- }, lt = {
309
- key: 2,
310
- class: "mwnf-record__status"
311
- }, ut = {
312
- __name: "RecordView",
313
- props: {
314
- spec: {
315
- type: Object,
316
- required: !0
317
- },
318
- id: {
319
- type: String,
320
- required: !0
321
- },
322
- entity: {
323
- type: String,
324
- default: ""
325
- }
326
- },
327
- setup(t) {
328
- let n = t, { t: r, locale: s } = Te(), c = xe(), u = ke(), d = H(), m = Le(), h = n.spec.entity ?? n.entity, _ = x(() => n.spec), v = oe(h), y = ie(h), A = x(() => y.value.get(n.id) ?? null), j = x(() => v.value !== null), { language: M, languages: F, dir: I, select: z, text: U, ready: te, terms: W, glossary: ne, attribution: G } = je(A, {
329
- entity: h,
330
- translations: n.spec.translations ?? [],
331
- attribution: n.spec.attribution ?? []
332
- }), q = x(() => le(F.value)), { active: J, onClick: Y, close: ae } = we(W), Z = x(() => J.value ? he(J.value.definition, { breaks: !0 }) : ""), se = (e, t) => c.tr(e, t, M.value, "en"), Q = x(() => ({
333
- record: A.value,
334
- text: U.value,
335
- language: M.value,
336
- languages: q.value,
337
- select: z,
338
- dir: I.value,
339
- glossary: ne.value,
340
- ready: te.value,
341
- attribution: G.value,
342
- t: r,
343
- tr: se
344
- }));
345
- function ce(e) {
346
- return ((typeof e == "function" ? e(Q.value) : e) ?? []).map((e) => ({
347
- ...e,
348
- label: e.label ? r(e.label) : ""
349
- }));
350
- }
351
- let ue = x(() => A.value ? _e(ce(_.value.fields), Q.value) : []), de = x(() => A.value ? _e(ce(_.value.sections).map((e) => ({
352
- render: "block",
353
- ...e
354
- })), Q.value) : []), fe = x(() => _.value.shortDescription === !1 ? "" : _.value.shortDescription ?? "short_description"), pe = x(() => {
355
- let e = fe.value ? U.value[fe.value] : "";
356
- return e ? { html: he(String(e), {
357
- breaks: !0,
358
- glossary: ne.value
359
- }) } : null;
360
- }), ve = x(() => {
361
- if (!A.value) return "";
362
- if (_.value.title) return _.value.title(Q.value);
363
- let e = U.value.name ?? A.value.internal_name ?? A.value.id;
364
- return $(String(e), { glossary: ne.value });
365
- }), be = x(() => {
366
- if (!A.value) return [];
367
- if (_.value.media) return _.value.media(A.value, Q.value);
368
- let e = ge(String(U.value.name ?? A.value.internal_name ?? ""));
369
- return (A.value.images ?? []).map((t) => ({
370
- url: t.url,
371
- alt: t.captions?.[M.value] ?? e,
372
- caption: t.captions?.[M.value] ?? t.captions?.en ?? "",
373
- photographer: t.photographer ?? "",
374
- copyright: t.copyright ?? ""
375
- }));
376
- }), Se = [
377
- {
378
- field: "author",
379
- label: "sheet.field.preparedBy"
380
- },
381
- {
382
- field: "copy_editor",
383
- label: "sheet.field.copyeditedBy"
384
- },
385
- {
386
- field: "translator",
387
- label: "sheet.field.translationBy"
388
- },
389
- {
390
- field: "translation_copy_editor",
391
- label: "sheet.field.translationCopyeditedBy"
392
- }
393
- ], Ce = x(() => (_.value.credits ?? Se).map(({ field: e, label: t }) => ({
394
- label: r(t),
395
- value: U.value[e] ?? G.value[e] ?? ""
396
- })).filter((e) => e.value)), Ee = x(() => String(A.value?.[_.value.workingNumber ?? "mwnf_reference"] ?? "")), De = x(() => {
397
- let e = _.value.citation;
398
- if (!A.value || e === !1) return "";
399
- 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) ?? me(e?.project ?? A.value.project_key, r), i = e?.permalink === !1 ? void 0 : typeof e?.permalink == "string" ? e.permalink : ye(m) ?? void 0;
400
- return X({
401
- author: U.value.author ?? G.value.author,
402
- name: U.value.name ?? A.value.internal_name ?? "",
403
- project: n,
404
- permalink: i,
405
- inWord: r("record.citation.in")
406
- });
407
- }), Oe = Me(A, {
408
- entity: h,
409
- language: M
410
- }), Ae = x(() => _.value.related === !1 ? null : _.value.related ?? {}), Ne = x(() => {
411
- if (!Ae.value) return [];
412
- let e = Ae.value.record ?? Pe;
413
- return Oe.value.inPackage.map((t) => e(t, Q.value));
414
- });
415
- function Pe({ record: e, justification: t }) {
416
- let r = se(h, e.id).name ?? e.internal_name ?? e.id;
417
- return {
418
- id: e.id,
419
- image: e.images?.[0]?.url ?? "",
420
- imageAlt: ge(String(r)),
421
- name: $(String(r)),
422
- meta: t ? [t] : [],
423
- badge: e.type ?? "",
424
- to: {
425
- name: _.value.route ?? (n.entity ? `${n.entity}-detail` : "item"),
426
- params: { id: e.id }
427
- }
428
- };
429
- }
430
- let Fe = /* @__PURE__ */ new Set([
431
- "header",
432
- "before-sheet",
433
- "after-sheet",
434
- "aside",
435
- "source",
436
- "related",
437
- "after",
438
- "default"
439
- ]), Ie = x(() => Object.keys(d).filter((e) => !Fe.has(e)));
440
- return (t, n) => j.value && !A.value ? (P(), S(V(re), { key: 0 })) : A.value ? (P(), w("article", {
441
- key: 1,
442
- class: "mwnf-record",
443
- onClick: n[0] ||= (...e) => V(Y) && V(Y)(...e)
444
- }, [
445
- R(t.$slots, "header", N(k(Q.value)), () => [
446
- _.value.back ? (P(), S(e, {
447
- key: 0,
448
- class: "mwnf-record__back",
449
- to: _.value.back.to,
450
- href: _.value.back.href
451
- }, {
452
- default: K(() => [D("← " + B(V(r)(_.value.back.label)), 1)]),
453
- _: 1
454
- }, 8, ["to", "href"])) : C("", !0),
455
- O(p, {
456
- languages: q.value,
457
- language: V(M),
458
- onSelect: V(z)
459
- }, null, 8, [
460
- "languages",
461
- "language",
462
- "onSelect"
463
- ]),
464
- T("h1", {
465
- class: "mwnf-record__title",
466
- dir: V(I) || void 0,
467
- innerHTML: ve.value
468
- }, null, 8, it)
469
- ]),
470
- T("div", at, [T("div", ot, [
471
- be.value.length ? (P(), S(ee, {
472
- key: 0,
473
- images: be.value,
474
- variant: _.value.mediaVariant ?? ""
475
- }, null, 8, ["images", "variant"])) : C("", !0),
476
- V(te) ? C("", !0) : (P(), w("p", st, B(V(r)("core.status.loading")), 1)),
477
- R(t.$slots, "before-sheet", N(k(Q.value))),
478
- O(o, {
479
- rows: ue.value,
480
- layout: _.value.layout ?? "table",
481
- dir: V(I),
482
- "short-description": pe.value,
483
- "short-description-after": _.value.shortDescriptionAfter ?? "description"
484
- }, E({ _: 2 }, [L(Ie.value, (e) => ({
485
- name: e,
486
- fn: K((n) => [R(t.$slots, e, N(k({
487
- ...n,
488
- ...Q.value
489
- })))])
490
- }))]), 1032, [
491
- "rows",
492
- "layout",
493
- "dir",
494
- "short-description",
495
- "short-description-after"
496
- ]),
497
- (P(!0), w(b, null, L(de.value, (e) => (P(), S(a, {
498
- key: e.key,
499
- heading: e.label,
500
- html: e.html,
501
- dir: V(I)
502
- }, null, 8, [
503
- "heading",
504
- "html",
505
- "dir"
506
- ]))), 128)),
507
- R(t.$slots, "after-sheet", N(k(Q.value))),
508
- O(g, {
509
- credits: Ce.value,
510
- "working-number": Ee.value,
511
- "working-number-label": V(r)("sheet.field.workingNumber"),
512
- citation: De.value,
513
- "citation-heading": _.value.citation?.heading ? V(r)(_.value.citation.heading) : ""
514
- }, null, 8, [
515
- "credits",
516
- "working-number",
517
- "working-number-label",
518
- "citation",
519
- "citation-heading"
520
- ]),
521
- R(t.$slots, "source", N(k(Q.value)), () => [O(l)]),
522
- R(t.$slots, "related", N(k({
523
- ...Q.value,
524
- records: Ne.value,
525
- outside: V(Oe).outside
526
- })), () => [Ae.value ? (P(), S(i, {
527
- key: 0,
528
- heading: V(r)(Ae.value.heading ?? "record.related.items"),
529
- records: Ne.value,
530
- variant: Ae.value.variant ?? "list",
531
- "action-label": Ae.value.actionLabel ? V(r)(Ae.value.actionLabel) : ""
532
- }, null, 8, [
533
- "heading",
534
- "records",
535
- "variant",
536
- "action-label"
537
- ])) : C("", !0)])
538
- ]), t.$slots.aside ? (P(), w("aside", ct, [R(t.$slots, "aside", N(k(Q.value)))])) : C("", !0)]),
539
- R(t.$slots, "after", N(k(Q.value))),
540
- O(f, {
541
- term: V(J),
542
- html: Z.value,
543
- dir: V(I),
544
- onClose: V(ae)
545
- }, null, 8, [
546
- "term",
547
- "html",
548
- "dir",
549
- "onClose"
550
- ])
551
- ])) : (P(), w("p", lt, B(V(r)("core.status.loading")), 1));
552
- }
553
- }, dt = {
94
+ }, U = {
554
95
  key: 0,
555
96
  class: "mwnf-sheet-source"
556
- }, ft = {
97
+ }, W = {
557
98
  key: 0,
558
99
  class: "mwnf-sheet-source__line"
559
- }, pt = {
100
+ }, be = {
560
101
  key: 1,
561
102
  class: "mwnf-sheet-source__uid"
562
- }, mt = {
103
+ }, xe = {
563
104
  key: 2,
564
105
  class: "mwnf-sheet-source__collection"
565
- }, ht = ["href"], gt = {
106
+ }, Se = ["href"], Ce = {
566
107
  key: 1,
567
108
  class: "mwnf-sheet-notice"
568
- }, _t = { key: 1 }, vt = {
109
+ }, we = { key: 1 }, Te = {
569
110
  key: 0,
570
111
  class: "mwnf-sheet-related"
571
- }, yt = {
112
+ }, Ee = {
572
113
  key: 0,
573
114
  class: "mwnf-sheet-related__heading mwnf-sheet-related__heading--caps"
574
- }, bt = {
115
+ }, De = {
575
116
  key: 1,
576
117
  class: "mwnf-sheet-related__description"
577
- }, xt = {
118
+ }, Oe = {
578
119
  key: 0,
579
120
  class: "mwnf-sheet-related__references"
580
- }, St = {
581
- key: 1,
121
+ }, ke = { key: 2 }, Ae = {
122
+ key: 3,
582
123
  class: "mwnf-sheet-related__unresolved"
583
- }, Ct = {
124
+ }, je = {
584
125
  key: 2,
585
126
  class: "mwnf-sheet-related__line"
586
- }, wt = ["href"], Tt = ["href"], Et = { key: 7 }, Dt = { class: "mwnf-sheet-related__heading" }, Ot = { key: 0 }, kt = { class: "mwnf-sheet-related__subheading" }, At = ["href"], jt = { key: 1 }, Mt = { class: "mwnf-sheet-related__unresolved" }, Nt = { key: 1 }, Pt = { class: "mwnf-sheet-related__subheading" }, Ft = ["href"], It = { key: 1 }, Lt = { class: "mwnf-sheet-related__unresolved" }, Rt = { key: 8 }, zt = { class: "mwnf-sheet-related__heading" }, Bt = { class: "mwnf-sheet-related__line" }, Vt = ["href"], Ht = { key: 9 }, Ut = { class: "mwnf-sheet-related__heading" }, Wt = { class: "mwnf-sheet-related__line" }, Gt = ["href"], Kt = { key: 10 }, qt = { class: "mwnf-sheet-related__heading" }, Jt = {
127
+ }, Me = ["href"], Ne = ["href"], G = { key: 7 }, Pe = { class: "mwnf-sheet-related__heading" }, Fe = { key: 0 }, Ie = { class: "mwnf-sheet-related__subheading" }, Le = ["href"], Re = { key: 1 }, ze = { class: "mwnf-sheet-related__unresolved" }, Be = { key: 1 }, K = { class: "mwnf-sheet-related__subheading" }, q = ["href"], J = { key: 1 }, Ve = { class: "mwnf-sheet-related__unresolved" }, He = { key: 8 }, Y = { class: "mwnf-sheet-related__heading" }, Ue = { class: "mwnf-sheet-related__line" }, We = ["href"], X = { key: 9 }, Z = { class: "mwnf-sheet-related__heading" }, Ge = { class: "mwnf-sheet-related__line" }, Q = ["href"], Ke = { key: 10 }, qe = { class: "mwnf-sheet-related__heading" }, Je = {
587
128
  __name: "RecordSheetView",
588
129
  props: {
589
130
  spec: {
@@ -603,24 +144,24 @@ var ze = { class: "mwnf-home" }, Be = {
603
144
  default: null
604
145
  }
605
146
  },
606
- setup(t) {
607
- let r = t, o = H(), s = /* @__PURE__ */ new Set([
147
+ setup(e) {
148
+ let r = e, a = re(), ee = /* @__PURE__ */ new Set([
608
149
  "before-sheet",
609
150
  "museum",
610
151
  "related"
611
- ]), c = x(() => Object.keys(o).filter((e) => !s.has(e))), l = x(() => !r.dataGetter || r.dataGetter(r.id) != null), { t: u } = Te(), d = x(() => r.spec), f = ke(), p = (e, t) => (e.name ?? "").localeCompare(t.name ?? ""), ee = (e) => (e.gallery_references ?? []).filter((e) => e.kind === "gallery").sort(p), g = (e) => (e.gallery_references ?? []).filter((e) => e.kind === "exhibition").sort(p), _ = (e) => f.links(e.project_id)?.artisticIntroductionUrl ?? null, v = (e) => f.links(e.project_id)?.relatedDatabaseUrl ?? null;
612
- function y(e, t) {
152
+ ]), te = g(() => Object.keys(a).filter((e) => !ee.has(e))), c = g(() => !r.dataGetter || r.dataGetter(r.id) != null), { t: d } = ge(), f = g(() => r.spec), p = z(), m = (e, t) => (e.name ?? "").localeCompare(t.name ?? ""), ne = (e) => (e.gallery_references ?? []).filter((e) => e.kind === "gallery").sort(m), T = (e) => (e.gallery_references ?? []).filter((e) => e.kind === "exhibition").sort(m), k = (e) => p.links(e.project_id)?.artisticIntroductionUrl ?? null, P = (e) => p.links(e.project_id)?.relatedDatabaseUrl ?? null;
153
+ function ie(e, t) {
613
154
  if (!e) return null;
614
- let n = d.value.sourceDatabase === !1 ? null : d.value.sourceDatabase ?? null, r = null;
155
+ let n = f.value.sourceDatabase === !1 ? null : f.value.sourceDatabase ?? null, r = null;
615
156
  if (n) {
616
- let i = n.chipClass ? n.chipClass(e, t) : null, a = f.label(e.project_id);
157
+ let i = n.chipClass ? n.chipClass(e, t) : null, a = p.label(e.project_id);
617
158
  (i || a) && (r = {
618
159
  chipClass: i,
619
160
  name: a,
620
- label: u(n.label ?? "record.sheet.sourceDatabase")
161
+ label: d(n.label ?? "record.sheet.sourceDatabase")
621
162
  });
622
163
  }
623
- let i = n && n.addToCollection !== !1 ? u(n.addToCollection?.label ?? "record.action.addToCollection") : null, a = n ? e.backward_compatibility ?? "" : "", o = d.value.notice === !1 ? null : d.value.notice ?? null, s = o && o.show(e, t) ? u(o.label) : null;
164
+ let i = n && n.addToCollection !== !1 ? d(n.addToCollection?.label ?? "record.action.addToCollection") : null, a = n ? e.backward_compatibility ?? "" : "", o = f.value.notice === !1 ? null : f.value.notice ?? null, s = o && o.show(e, t) ? d(o.label) : null;
624
165
  return {
625
166
  source: r,
626
167
  addToCollectionLabel: i,
@@ -628,102 +169,104 @@ var ze = { class: "mwnf-home" }, Be = {
628
169
  backwardCompatibility: a
629
170
  };
630
171
  }
631
- function A(e, t) {
632
- let n = d.value.museum === !1 ? null : d.value.museum ?? null;
172
+ function oe(e, t) {
173
+ let n = f.value.museum === !1 ? null : f.value.museum ?? null;
633
174
  return !n || !e ? null : {
634
175
  to: n.route ? n.route(e, t) : null,
635
176
  label: n.label ? n.label(e, t) : ""
636
177
  };
637
178
  }
638
- function j(e, t) {
179
+ function se(e, t) {
639
180
  if (!e) return null;
640
- let n = d.value.related ?? {}, i = t.records ?? [], a = t.outside ?? [], o = r.dataGetter ? i.filter((e) => r.dataGetter(e.id) != null) : i, s = r.dataGetter ? i.filter((e) => r.dataGetter(e.id) == null).map((t) => (e.related_items ?? []).find((e) => e.id === t.id)).filter(Boolean) : [], c = [...a, ...s].map((e) => ({
181
+ let n = f.value.related ?? {}, i = t.records ?? [], a = t.outside ?? [], o = r.dataGetter ? i.filter((e) => r.dataGetter(e.id) != null) : i, s = r.dataGetter ? i.filter((e) => r.dataGetter(e.id) == null).map((t) => (e.related_items ?? []).find((e) => e.id === t.id)).filter(Boolean) : [], ee = [...a, ...s].map((e) => ({
641
182
  ...e,
183
+ name: e.project_id ? p.label(e.project_id) : null,
642
184
  chipClass: n.outsideChip ? n.outsideChip(e, t) : null
643
- })), l = n.onDisplayIn && n.onDisplayIn !== !1 ? {
644
- linkPendingLabel: u(n.onDisplayIn.linkPendingLabel),
645
- galleries: ee(e),
646
- exhibitions: g(e)
647
- } : null, p = n.databaseLabel && v(e) ? {
648
- url: v(e),
649
- label: u(n.databaseLabel),
650
- name: f.label(e.project_id)
651
- } : null, m = n.overallDatabase && n.overallDatabase !== !1 ? {
652
- label: u(n.overallDatabase.label),
653
- linkLabel: u(n.overallDatabase.linkLabel)
185
+ })), te = n.onDisplayIn && n.onDisplayIn !== !1 ? {
186
+ linkPendingLabel: d(n.onDisplayIn.linkPendingLabel),
187
+ galleries: ne(e),
188
+ exhibitions: T(e)
189
+ } : null, c = n.databaseLabel && P(e) ? {
190
+ url: P(e),
191
+ label: d(n.databaseLabel),
192
+ name: p.label(e.project_id)
193
+ } : null, l = n.overallDatabase && n.overallDatabase !== !1 ? {
194
+ label: d(n.overallDatabase.label),
195
+ linkLabel: d(n.overallDatabase.linkLabel)
654
196
  } : null;
655
197
  return {
656
- title: n.title ? u(n.title) : "",
657
- description: n.description ? u(n.description) : "",
658
- heading: u(n.heading ?? "record.related.items"),
198
+ title: n.title ? d(n.title) : "",
199
+ description: n.description ? d(n.description) : "",
200
+ heading: d(n.heading ?? "record.related.items"),
659
201
  variant: n.variant ?? "grid",
660
- actionLabel: n.actionLabel ? u(n.actionLabel) : "",
202
+ actionLabel: n.actionLabel ? d(n.actionLabel) : "",
661
203
  inPackage: o,
662
- references: c,
663
- notInPackageLabel: n.notInPackageLabel ? u(n.notInPackageLabel) : "",
664
- artisticIntroduction: n.artisticIntroductionLabel && _(e) ? {
665
- url: _(e),
666
- label: u(n.artisticIntroductionLabel)
204
+ references: ee,
205
+ notInPackageLabel: n.notInPackageLabel ? d(n.notInPackageLabel) : "",
206
+ artisticIntroduction: n.artisticIntroductionLabel && k(e) ? {
207
+ url: k(e),
208
+ label: d(n.artisticIntroductionLabel)
667
209
  } : null,
668
210
  timeline: n.timeline ? n.timeline(e, t) : null,
669
211
  glossary: n.glossary !== !1,
670
212
  dynasties: n.dynasties ? n.dynasties(e, t.language, t) : null,
671
213
  media: n.media === !1 ? [] : e.media ?? [],
672
- onDisplayIn: l,
673
- database: p,
674
- overallDatabase: m,
214
+ onDisplayIn: te,
215
+ database: c,
216
+ overallDatabase: l,
675
217
  download: n.download === !1 ? null : {
676
- label: u("record.action.download"),
677
- pdfLabel: u("record.action.downloadPdf")
218
+ label: d("record.action.download"),
219
+ pdfLabel: d("record.action.downloadPdf")
678
220
  }
679
221
  };
680
222
  }
681
- function F() {
223
+ function ce() {
682
224
  window.print();
683
225
  }
684
- return (r, o) => l.value ? (P(), S(ut, {
226
+ return (r, a) => c.value ? (O(), _(u, {
685
227
  key: 0,
686
- spec: d.value,
687
- id: t.id,
688
- entity: t.entity
689
- }, E({
690
- "before-sheet": K((e) => [R(r.$slots, "before-sheet", N(k(e)), () => [(P(!0), w(b, null, L([y(e.record, e)], (t) => (P(), w(b, { key: "before-sheet" }, [t?.source || t?.backwardCompatibility || t?.addToCollectionLabel ? (P(), w("div", dt, [
691
- t.source ? (P(), w("p", ft, [t.source.chipClass ? (P(), w("span", {
228
+ spec: f.value,
229
+ id: e.id,
230
+ entity: e.entity
231
+ }, x({
232
+ "before-sheet": F((e) => [j(r.$slots, "before-sheet", D(w(e)), () => [(O(!0), y(h, null, A([ie(e.record, e)], (t) => (O(), y(h, { key: "before-sheet" }, [t?.source || t?.backwardCompatibility || t?.addToCollectionLabel ? (O(), y("div", U, [
233
+ t.source ? (O(), y("p", W, [t.source.chipClass ? (O(), y("span", {
692
234
  key: 0,
693
- class: M(["mwnf-chip", t.source.chipClass]),
235
+ class: E(["mwnf-chip", t.source.chipClass]),
694
236
  "aria-hidden": "true"
695
- }, null, 2)) : C("", !0), t.source.name ? (P(), w(b, { key: 1 }, [D(B(t.source.label) + ": " + B(t.source.name), 1)], 64)) : C("", !0)])) : C("", !0),
696
- t.backwardCompatibility ? (P(), w("p", pt, [T("code", null, B(t.backwardCompatibility), 1)])) : C("", !0),
697
- t.addToCollectionLabel ? (P(), w("p", mt, [T("a", {
698
- href: V(fe).myCollection,
237
+ }, null, 2)) : v("", !0), t.source.name ? (O(), y(h, { key: 1 }, [S(M(t.source.label) + ": " + M(t.source.name), 1)], 64)) : v("", !0)])) : v("", !0),
238
+ t.backwardCompatibility ? (O(), y("p", be, [b("code", null, M(t.backwardCompatibility), 1)])) : v("", !0),
239
+ t.addToCollectionLabel ? (O(), y("p", xe, [b("a", {
240
+ href: N(L).myCollection,
699
241
  target: "_blank",
700
242
  rel: "noopener"
701
- }, "↗ " + B(t.addToCollectionLabel), 9, ht)])) : C("", !0)
702
- ])) : C("", !0), t?.notice ? (P(), w("div", gt, [D(B(t.notice) + " ", 1), T("strong", null, [T("em", null, B(e.languages.map((e) => e.label).join(", ")), 1)])])) : C("", !0)], 64))), 128))])]),
703
- museum: K((t) => [R(r.$slots, "museum", N(k(t)), () => [(P(!0), w(b, null, L([A(t.row?.value, t)], (t) => (P(), w(b, { key: "museum" }, [t?.to ? (P(), S(e, {
243
+ }, "↗ " + M(t.addToCollectionLabel), 9, Se)])) : v("", !0)
244
+ ])) : v("", !0), t?.notice ? (O(), y("div", Ce, [S(M(t.notice) + " ", 1), b("strong", null, [b("em", null, M(e.languages.map((e) => e.label).join(", ")), 1)])])) : v("", !0)], 64))), 128))])]),
245
+ museum: F((e) => [j(r.$slots, "museum", D(w(e)), () => [(O(!0), y(h, null, A([oe(e.row?.value, e)], (e) => (O(), y(h, { key: "museum" }, [e?.to ? (O(), _(o, {
704
246
  key: 0,
705
- to: t.to
247
+ to: e.to
706
248
  }, {
707
- default: K(() => [D(B(t.label), 1)]),
249
+ default: F(() => [S(M(e.label), 1)]),
708
250
  _: 2
709
- }, 1032, ["to"])) : t ? (P(), w("span", _t, B(t.label), 1)) : C("", !0)], 64))), 128))])]),
710
- related: K((e) => [R(r.$slots, "related", N(k(e)), () => [(P(!0), w(b, null, L([j(e.record, e)], (t) => (P(), w(b, { key: e.record?.id ?? "related" }, [t ? (P(), w("div", vt, [
711
- t.title ? (P(), w("p", yt, B(t.title), 1)) : C("", !0),
712
- t.description ? (P(), w("p", bt, B(t.description), 1)) : C("", !0),
713
- O(i, {
714
- heading: t.heading,
715
- records: t.inPackage,
716
- variant: t.variant,
717
- "action-label": t.actionLabel
251
+ }, 1032, ["to"])) : e ? (O(), y("span", we, M(e.label), 1)) : v("", !0)], 64))), 128))])]),
252
+ related: F((e) => [j(r.$slots, "related", D(w(e)), () => [(O(!0), y(h, null, A([se(e.record, e)], (r) => (O(), y(h, { key: e.record?.id ?? "related" }, [r ? (O(), y("div", Te, [
253
+ r.title ? (O(), y("p", Ee, M(r.title), 1)) : v("", !0),
254
+ r.description ? (O(), y("p", De, M(r.description), 1)) : v("", !0),
255
+ C(s, {
256
+ heading: r.heading,
257
+ records: r.inPackage,
258
+ variant: r.variant,
259
+ "action-label": r.actionLabel
718
260
  }, {
719
- default: K(() => [t.references.length ? (P(), w("ul", xt, [(P(!0), w(b, null, L(t.references, (e) => (P(), w("li", { key: e.id }, [
720
- e.chipClass ? (P(), w("span", {
261
+ default: F(() => [r.references.length ? (O(), y("ul", Oe, [(O(!0), y(h, null, A(r.references, (e) => (O(), y("li", { key: e.id }, [
262
+ e.chipClass ? (O(), y("span", {
721
263
  key: 0,
722
- class: M(["mwnf-chip", e.chipClass])
723
- }, B(e.project_key), 3)) : C("", !0),
724
- T("code", null, B(e.backward_compatibility), 1),
725
- t.notInPackageLabel ? (P(), w("span", St, B(t.notInPackageLabel), 1)) : C("", !0)
726
- ]))), 128))])) : C("", !0)]),
264
+ class: E(["mwnf-chip", e.chipClass]),
265
+ "aria-hidden": "true"
266
+ }, null, 2)) : v("", !0),
267
+ e.name ? (O(), y(h, { key: 1 }, [S(M(e.name), 1)], 64)) : (O(), y("code", ke, M(e.backward_compatibility), 1)),
268
+ r.notInPackageLabel ? (O(), y("span", Ae, M(r.notInPackageLabel), 1)) : v("", !0)
269
+ ]))), 128))])) : v("", !0)]),
727
270
  _: 2
728
271
  }, 1032, [
729
272
  "heading",
@@ -731,129 +274,129 @@ var ze = { class: "mwnf-home" }, Be = {
731
274
  "variant",
732
275
  "action-label"
733
276
  ]),
734
- t.artisticIntroduction ? (P(), w("p", Ct, [T("a", {
735
- href: t.artisticIntroduction.url,
277
+ r.artisticIntroduction ? (O(), y("p", je, [b("a", {
278
+ href: r.artisticIntroduction.url,
736
279
  target: "_blank",
737
280
  rel: "noopener"
738
- }, "↗ " + B(t.artisticIntroduction.label), 9, wt)])) : C("", !0),
739
- t.timeline ? (P(), S(h, {
281
+ }, "↗ " + M(r.artisticIntroduction.label), 9, Me)])) : v("", !0),
282
+ r.timeline ? (O(), _(i, {
740
283
  key: e.record.id,
741
- info: t.timeline
742
- }, null, 8, ["info"])) : C("", !0),
743
- t.glossary ? (P(), S(n, {
284
+ info: r.timeline
285
+ }, null, 8, ["info"])) : v("", !0),
286
+ r.glossary ? (O(), _(t, {
744
287
  key: 4,
745
288
  language: e.language,
746
289
  dir: e.dir
747
- }, null, 8, ["language", "dir"])) : C("", !0),
748
- t.dynasties?.records?.length ? (P(), S(m, {
290
+ }, null, 8, ["language", "dir"])) : v("", !0),
291
+ r.dynasties?.records?.length ? (O(), _(n, {
749
292
  key: 5,
750
- heading: V(u)("record.dynasty.list"),
751
- dynasties: t.dynasties.records,
752
- tr: t.dynasties.tr,
293
+ heading: N(d)("record.dynasty.list"),
294
+ dynasties: r.dynasties.records,
295
+ tr: r.dynasties.tr,
753
296
  dir: e.dir
754
297
  }, null, 8, [
755
298
  "heading",
756
299
  "dynasties",
757
300
  "tr",
758
301
  "dir"
759
- ])) : C("", !0),
760
- t.media.length ? (P(), S(a, {
302
+ ])) : v("", !0),
303
+ r.media.length ? (O(), _(l, {
761
304
  key: 6,
762
- heading: V(u)("record.related.audioVideo")
305
+ heading: N(d)("record.related.audioVideo")
763
306
  }, {
764
- default: K(() => [(P(!0), w(b, null, L(t.media, (e) => (P(), w("p", {
307
+ default: F(() => [(O(!0), y(h, null, A(r.media, (e) => (O(), y("p", {
765
308
  key: e.url,
766
309
  class: "mwnf-sheet-related__line"
767
- }, [T("a", {
310
+ }, [b("a", {
768
311
  href: e.url,
769
312
  target: "_blank",
770
313
  rel: "noopener"
771
- }, "↗ " + B(e.title ?? e.url), 9, Tt)]))), 128))]),
314
+ }, "↗ " + M(e.title ?? e.url), 9, Ne)]))), 128))]),
772
315
  _: 2
773
- }, 1032, ["heading"])) : C("", !0),
774
- t.onDisplayIn && (t.onDisplayIn.galleries.length || t.onDisplayIn.exhibitions.length) ? (P(), w("div", Et, [
775
- T("p", Dt, B(V(u)("record.related.onDisplayIn")), 1),
776
- t.onDisplayIn.exhibitions.length ? (P(), w("div", Ot, [T("p", kt, B(V(u)("record.related.exhibitions")), 1), (P(!0), w(b, null, L(t.onDisplayIn.exhibitions, (e) => (P(), w("p", {
316
+ }, 1032, ["heading"])) : v("", !0),
317
+ r.onDisplayIn && (r.onDisplayIn.galleries.length || r.onDisplayIn.exhibitions.length) ? (O(), y("div", G, [
318
+ b("p", Pe, M(N(d)("record.related.onDisplayIn")), 1),
319
+ r.onDisplayIn.exhibitions.length ? (O(), y("div", Fe, [b("p", Ie, M(N(d)("record.related.exhibitions")), 1), (O(!0), y(h, null, A(r.onDisplayIn.exhibitions, (e) => (O(), y("p", {
777
320
  key: e.id,
778
321
  class: "mwnf-sheet-related__line"
779
- }, [e.legacy_host ? (P(), w("a", {
322
+ }, [e.legacy_host ? (O(), y("a", {
780
323
  key: 0,
781
324
  href: e.legacy_host,
782
325
  target: "_blank",
783
326
  rel: "noopener"
784
- }, "↗ " + B(e.name), 9, At)) : (P(), w("span", jt, [D(B(e.name) + " ", 1), T("span", Mt, B(t.onDisplayIn.linkPendingLabel), 1)]))]))), 128))])) : C("", !0),
785
- t.onDisplayIn.galleries.length ? (P(), w("div", Nt, [T("p", Pt, B(V(u)("record.related.galleries")), 1), (P(!0), w(b, null, L(t.onDisplayIn.galleries, (e) => (P(), w("p", {
327
+ }, "↗ " + M(e.name), 9, Le)) : (O(), y("span", Re, [S(M(e.name) + " ", 1), b("span", ze, M(r.onDisplayIn.linkPendingLabel), 1)]))]))), 128))])) : v("", !0),
328
+ r.onDisplayIn.galleries.length ? (O(), y("div", Be, [b("p", K, M(N(d)("record.related.galleries")), 1), (O(!0), y(h, null, A(r.onDisplayIn.galleries, (e) => (O(), y("p", {
786
329
  key: e.id,
787
330
  class: "mwnf-sheet-related__line"
788
- }, [e.legacy_host ? (P(), w("a", {
331
+ }, [e.legacy_host ? (O(), y("a", {
789
332
  key: 0,
790
333
  href: e.legacy_host,
791
334
  target: "_blank",
792
335
  rel: "noopener"
793
- }, "↗ " + B(e.name), 9, Ft)) : (P(), w("span", It, [D(B(e.name) + " ", 1), T("span", Lt, B(t.onDisplayIn.linkPendingLabel), 1)]))]))), 128))])) : C("", !0)
794
- ])) : C("", !0),
795
- t.database ? (P(), w("div", Rt, [T("p", zt, B(t.database.label), 1), T("p", Bt, [T("a", {
796
- href: t.database.url,
336
+ }, "↗ " + M(e.name), 9, q)) : (O(), y("span", J, [S(M(e.name) + " ", 1), b("span", Ve, M(r.onDisplayIn.linkPendingLabel), 1)]))]))), 128))])) : v("", !0)
337
+ ])) : v("", !0),
338
+ r.database ? (O(), y("div", He, [b("p", Y, M(r.database.label), 1), b("p", Ue, [b("a", {
339
+ href: r.database.url,
797
340
  target: "_blank",
798
341
  rel: "noopener"
799
- }, "↗ " + B(t.database.name), 9, Vt)])])) : C("", !0),
800
- t.overallDatabase ? (P(), w("div", Ht, [T("p", Ut, B(t.overallDatabase.label), 1), T("p", Wt, [T("a", {
801
- href: V(fe).overallDatabase,
342
+ }, "↗ " + M(r.database.name), 9, We)])])) : v("", !0),
343
+ r.overallDatabase ? (O(), y("div", X, [b("p", Z, M(r.overallDatabase.label), 1), b("p", Ge, [b("a", {
344
+ href: N(L).overallDatabase,
802
345
  target: "_blank",
803
346
  rel: "noopener"
804
- }, "↗ " + B(t.overallDatabase.linkLabel), 9, Gt)])])) : C("", !0),
805
- t.download ? (P(), w("div", Kt, [T("p", qt, B(t.download.label), 1), T("p", {
347
+ }, "↗ " + M(r.overallDatabase.linkLabel), 9, Q)])])) : v("", !0),
348
+ r.download ? (O(), y("div", Ke, [b("p", qe, M(r.download.label), 1), b("p", {
806
349
  class: "mwnf-sheet-related__line mwnf-sheet-related__line--action",
807
- onClick: F
808
- }, "➤ " + B(t.download.pdfLabel), 1)])) : C("", !0)
809
- ])) : C("", !0)], 64))), 128))])]),
350
+ onClick: ce
351
+ }, "➤ " + M(r.download.pdfLabel), 1)])) : v("", !0)
352
+ ])) : v("", !0)], 64))), 128))])]),
810
353
  _: 2
811
- }, [L(c.value, (e) => ({
354
+ }, [A(te.value, (e) => ({
812
355
  name: e,
813
- fn: K((t) => [R(r.$slots, e, N(k(t)))])
356
+ fn: F((t) => [j(r.$slots, e, D(w(t)))])
814
357
  }))]), 1032, [
815
358
  "spec",
816
359
  "id",
817
360
  "entity"
818
- ])) : (P(), S(V(re), { key: 1 }));
361
+ ])) : (O(), _(N(ae), { key: 1 }));
819
362
  }
820
- }, Yt = ["dir"], Xt = {
363
+ }, Ye = ["dir"], Xe = {
821
364
  key: 0,
822
365
  class: "mwnf-essay__breadcrumb"
823
- }, Zt = { class: "mwnf-essay__breadcrumb-label" }, Qt = {
366
+ }, Ze = { class: "mwnf-essay__breadcrumb-label" }, Qe = {
824
367
  key: 1,
825
368
  class: "mwnf-essay__breadcrumb-link"
826
- }, $t = ["aria-label"], en = { class: "mwnf-essay__title" }, tn = {
369
+ }, $e = ["aria-label"], et = { class: "mwnf-essay__title" }, tt = {
827
370
  key: 0,
828
371
  class: "mwnf-essay__number"
829
- }, nn = ["innerHTML"], rn = { class: "mwnf-essay__body" }, an = { class: "mwnf-essay__main" }, on = {
372
+ }, nt = ["innerHTML"], rt = { class: "mwnf-essay__body" }, it = { class: "mwnf-essay__main" }, at = {
830
373
  key: 0,
831
374
  class: "mwnf-essay__status"
832
- }, sn = ["innerHTML"], cn = ["innerHTML"], ln = {
375
+ }, ot = ["innerHTML"], st = ["innerHTML"], ct = {
833
376
  key: 4,
834
377
  class: "mwnf-essay__nav"
835
- }, un = {
378
+ }, lt = {
836
379
  key: 1,
837
380
  class: "mwnf-essay__nav-spacer"
838
- }, dn = {
381
+ }, ut = {
839
382
  key: 0,
840
383
  class: "mwnf-essay__side"
841
- }, fn = {
384
+ }, dt = {
842
385
  key: 0,
843
386
  class: "mwnf-essay__panel"
844
- }, pn = {
387
+ }, ft = {
845
388
  key: 0,
846
389
  class: "mwnf-essay__variants"
847
- }, mn = ["aria-pressed", "onClick"], hn = ["src", "alt"], gn = ["innerHTML"], _n = {
390
+ }, pt = ["aria-pressed", "onClick"], mt = ["src", "alt"], ht = ["innerHTML"], gt = {
848
391
  key: 0,
849
392
  class: "mwnf-essay__panel-label"
850
- }, vn = ["innerHTML"], yn = ["innerHTML"], bn = {
393
+ }, _t = ["innerHTML"], vt = ["innerHTML"], yt = {
851
394
  key: 0,
852
395
  class: "mwnf-essay__thumbs"
853
- }, xn = ["onClick"], Sn = ["src"], Cn = {
396
+ }, bt = ["onClick"], xt = ["src"], St = {
854
397
  key: 2,
855
398
  class: "mwnf-essay__status"
856
- }, wn = {
399
+ }, Ct = {
857
400
  __name: "EssayView",
858
401
  props: {
859
402
  spec: {
@@ -865,72 +408,72 @@ var ze = { class: "mwnf-home" }, Be = {
865
408
  required: !0
866
409
  }
867
410
  },
868
- setup(t) {
869
- let n = t, { t: r } = Te(), i = xe(), a = H();
870
- function o(e) {
411
+ setup(e) {
412
+ let t = e, { t: n } = ge(), r = me(), i = re();
413
+ function s(e) {
871
414
  return !!e && typeof e.walk == "function" && typeof e.children == "function";
872
415
  }
873
- function s(e) {
416
+ function l(e) {
874
417
  return typeof e == "string" ? e : "themes";
875
418
  }
876
- let c = n.spec.entity ?? "items", u = n.spec.tree, d = u?.entity ?? (u?.themes ? s(u.themes) : n.spec.entity ?? "collections"), p = o(u) ? u : u?.themes ? be({
419
+ let u = t.spec.entity ?? "items", d = t.spec.tree, f = d?.entity ?? (d?.themes ? l(d.themes) : t.spec.entity ?? "collections"), p = s(d) ? d : d?.themes ? pe({
877
420
  source: "themes",
878
- entity: d,
879
- childType: u.childType
880
- }) : be({
881
- purpose: u?.purpose,
882
- rootId: u?.rootId,
883
- childType: u?.childType,
884
- entity: d,
885
- order: u?.order
886
- }), m = oe(d), h = x(() => m.value !== null), g = x(() => n.spec), v = x(() => p.byId.value.get(n.id) ?? null), y = x(() => p.parents(n.id).at(-1) ?? null), E = x(() => {
887
- if (y.value) return p.children(y.value.id);
421
+ entity: f,
422
+ childType: d.childType
423
+ }) : pe({
424
+ purpose: d?.purpose,
425
+ rootId: d?.rootId,
426
+ childType: d?.childType,
427
+ entity: f,
428
+ order: d?.order
429
+ }), m = se(f), ne = g(() => m.value !== null), x = g(() => t.spec), T = g(() => p.byId.value.get(t.id) ?? null), ie = g(() => p.parents(t.id).at(-1) ?? null), I = g(() => {
430
+ if (ie.value) return p.children(ie.value.id);
888
431
  let e = p.root.value;
889
432
  return e ? p.children(e.id) : p.walk().filter((e) => p.parents(e.id).length === 0);
890
- }), A = x(() => E.value.findIndex((e) => e.id === n.id)), j = x(() => g.value.navigation || !1), F = x(() => j.value === "siblings" ? A.value > 0 ? E.value[A.value - 1] : null : j.value === "tree" ? p.previous(n.id) : null), z = x(() => j.value === "siblings" ? A.value !== -1 && A.value < E.value.length - 1 ? E.value[A.value + 1] : null : j.value === "tree" ? p.next(n.id) : null), { language: U, dir: te } = Ae(v, { entity: d }), W = x(() => v.value ? i.tr(d, v.value.id, U.value, "en") : {}), ne = I(!1);
891
- G(() => [v.value?.id, U.value], async () => {
892
- if (ne.value = !1, !v.value) {
893
- ne.value = !0;
433
+ }), L = g(() => I.value.findIndex((e) => e.id === t.id)), R = g(() => x.value.navigation || !1), z = g(() => R.value === "siblings" ? L.value > 0 ? I.value[L.value - 1] : null : R.value === "tree" ? p.previous(t.id) : null), B = g(() => R.value === "siblings" ? L.value !== -1 && L.value < I.value.length - 1 ? I.value[L.value + 1] : null : R.value === "tree" ? p.next(t.id) : null), { language: V, dir: ve } = _e(T, { entity: f }), ye = g(() => T.value ? r.tr(f, T.value.id, V.value, "en") : {}), H = k(!1);
434
+ P(() => [T.value?.id, V.value], async () => {
435
+ if (H.value = !1, !T.value) {
436
+ H.value = !0;
894
437
  return;
895
438
  }
896
- let e = U.value === "en" ? ["en"] : [U.value, "en"];
897
- await Promise.all([d, c].flatMap((t) => e.map((e) => i.loadTranslations(t, e)))), ne.value = !0;
439
+ let e = V.value === "en" ? ["en"] : [V.value, "en"];
440
+ await Promise.all([f, u].flatMap((t) => e.map((e) => r.loadTranslations(t, e)))), H.value = !0;
898
441
  }, { immediate: !0 });
899
- function q(e) {
442
+ function U(e) {
900
443
  if (!e) return "";
901
- let t = g.value.placeholder, n = (e) => !!e && !!t && t.test(e), r = i.tr(d, e.id, U.value, "en");
902
- if (r.title && !n(r.title)) return r.title;
903
- let a = i.tr(d, e.id, "en").title;
444
+ let t = x.value.placeholder, n = (e) => !!e && !!t && t.test(e), i = r.tr(f, e.id, V.value, "en");
445
+ if (i.title && !n(i.title)) return i.title;
446
+ let a = r.tr(f, e.id, "en").title;
904
447
  return a && !n(a) ? a : e.internal_name ?? e.id;
905
448
  }
906
- let J = x(() => ({
907
- node: v.value,
908
- text: W.value,
909
- language: U.value,
449
+ let W = g(() => ({
450
+ node: T.value,
451
+ text: ye.value,
452
+ language: V.value,
910
453
  tree: p,
911
- select: Ie,
912
- t: r,
913
- tr: (e, t) => i.tr(e, t, U.value, "en")
454
+ select: Ve,
455
+ t: n,
456
+ tr: (e, t) => r.tr(e, t, V.value, "en")
914
457
  }));
915
- function Y(e, t) {
458
+ function be(e, t) {
916
459
  return t.split(".").reduce((e, t) => e?.[t], e);
917
460
  }
918
- function X(e, t) {
919
- return e === !1 || e == null ? "" : typeof e == "function" ? e(t) ?? "" : Y(t.text, e) ?? "";
461
+ function xe(e, t) {
462
+ return e === !1 || e == null ? "" : typeof e == "function" ? e(t) ?? "" : be(t.text, e) ?? "";
920
463
  }
921
- let ae = x(() => X(g.value.quote ?? "quote", J.value)), Z = x(() => X(g.value.body ?? "description", J.value)), ce = x(() => {
922
- if (!g.value.glossary || !v.value) return [];
923
- let e = [ae.value, Z.value].filter(Boolean);
924
- return Q(e.join("\n\n"), U.value);
925
- }), le = x(() => se(ce.value)), { active: ue, onClick: de, close: fe } = we(ce), pe = x(() => ue.value ? he(ue.value.definition, { breaks: !0 }) : ""), me = x(() => v.value ? g.value.heading ? g.value.heading(J.value) : $(String(q(v.value)), { glossary: le.value }) : ""), _e = x(() => ae.value ? $(String(ae.value), { glossary: le.value }) : ""), ve = x(() => Z.value ? he(String(Z.value), {
464
+ let Se = g(() => xe(x.value.quote ?? "quote", W.value)), Ce = g(() => xe(x.value.body ?? "description", W.value)), we = g(() => {
465
+ if (!x.value.glossary || !T.value) return [];
466
+ let e = [Se.value, Ce.value].filter(Boolean);
467
+ return le(e.join("\n\n"), V.value);
468
+ }), Te = g(() => ce(we.value)), { active: Ee, onClick: De, close: Oe } = he(we), ke = g(() => Ee.value ? ue(Ee.value.definition, { breaks: !0 }) : ""), Ae = g(() => T.value ? x.value.heading ? x.value.heading(W.value) : de(String(U(T.value)), { glossary: Te.value }) : ""), je = g(() => Se.value ? de(String(Se.value), { glossary: Te.value }) : ""), Me = g(() => Ce.value ? ue(String(Ce.value), {
926
469
  breaks: !0,
927
- glossary: le.value
928
- }) : ""), ye = x(() => v.value ? g.value.about?.(v.value) ?? !1 : !1), Se = x(() => !!ye.value);
929
- function Ce(e) {
930
- let t = ye.value;
931
- return t && typeof t == "object" ? !!t[e] : !!g.value.aboutKeeps?.includes(e);
470
+ glossary: Te.value
471
+ }) : ""), Ne = g(() => T.value ? x.value.about?.(T.value) ?? !1 : !1), G = g(() => !!Ne.value);
472
+ function Pe(e) {
473
+ let t = Ne.value;
474
+ return t && typeof t == "object" ? !!t[e] : !!x.value.aboutKeeps?.includes(e);
932
475
  }
933
- let Ee = [
476
+ let Fe = [
934
477
  [1e3, "M"],
935
478
  [900, "CM"],
936
479
  [500, "D"],
@@ -945,66 +488,66 @@ var ze = { class: "mwnf-home" }, Be = {
945
488
  [4, "IV"],
946
489
  [1, "I"]
947
490
  ];
948
- function De(e) {
491
+ function Ie(e) {
949
492
  let t = e, n = "";
950
- for (let [e, r] of Ee) for (; t >= e;) n += r, t -= e;
493
+ for (let [e, r] of Fe) for (; t >= e;) n += r, t -= e;
951
494
  return n;
952
495
  }
953
- let Oe = x(() => {
954
- let e = g.value.numbering;
955
- if (!e || !v.value) return "";
956
- let t = (E.value.length ? E.value : [v.value]).findIndex((e) => e.id === n.id), r = t >= 0 ? t + 1 : 1;
957
- return e === "roman" ? De(r) : String(r);
496
+ let Le = g(() => {
497
+ let e = x.value.numbering;
498
+ if (!e || !T.value) return "";
499
+ let n = (I.value.length ? I.value : [T.value]).findIndex((e) => e.id === t.id), r = n >= 0 ? n + 1 : 1;
500
+ return e === "roman" ? Ie(r) : String(r);
958
501
  });
959
- function ke(e) {
502
+ function Re(e) {
960
503
  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) : [] : [];
961
504
  }
962
- let je = ie(c), Me = x(() => {
963
- let e = g.value.items?.of ?? ke;
964
- return v.value ? e(v.value, J.value) : [];
965
- }), Ne = x(() => Me.value.map((e) => je.value.get(e)).filter(Boolean)), Pe = I(null);
966
- G(Ne, (e) => {
967
- e.some((e) => e.id === Pe.value) || (Pe.value = e[0]?.id ?? null);
505
+ let ze = oe(u), Be = g(() => {
506
+ let e = x.value.items?.of ?? Re;
507
+ return T.value ? e(T.value, W.value) : [];
508
+ }), K = g(() => Be.value.map((e) => ze.value.get(e)).filter(Boolean)), q = k(null);
509
+ P(K, (e) => {
510
+ e.some((e) => e.id === q.value) || (q.value = e[0]?.id ?? null);
968
511
  }, { immediate: !0 });
969
- let Fe = x(() => Ne.value.find((e) => e.id === Pe.value) ?? Ne.value[0] ?? null);
970
- function Ie(e) {
971
- Pe.value = e;
512
+ let J = g(() => K.value.find((e) => e.id === q.value) ?? K.value[0] ?? null);
513
+ function Ve(e) {
514
+ q.value = e;
972
515
  }
973
- function Le(e) {
974
- let t = g.value.items?.route;
975
- return !t || !e ? null : typeof t == "function" ? t(e, J.value) : {
516
+ function He(e) {
517
+ let t = x.value.items?.route;
518
+ return !t || !e ? null : typeof t == "function" ? t(e, W.value) : {
976
519
  name: t,
977
520
  params: { id: e.id }
978
521
  };
979
522
  }
980
- function Re(e) {
981
- let t = g.value.route;
982
- return !t || !e ? null : typeof t == "function" ? t(e, J.value) : {
523
+ function Y(e) {
524
+ let t = x.value.route;
525
+ return !t || !e ? null : typeof t == "function" ? t(e, W.value) : {
983
526
  name: t,
984
527
  params: { id: e.id }
985
528
  };
986
529
  }
987
- function ze(e) {
530
+ function Ue(e) {
988
531
  if (!e) return null;
989
- let t = i.tr(c, e.id, U.value, "en").name ?? e.internal_name ?? e.id;
532
+ let t = r.tr(u, e.id, V.value, "en").name ?? e.internal_name ?? e.id;
990
533
  return {
991
- name: $(String(t)),
534
+ name: de(String(t)),
992
535
  image: e.images?.[0]?.url ?? "",
993
- imageAlt: ge(String(t))
536
+ imageAlt: fe(String(t))
994
537
  };
995
538
  }
996
- let Be = x(() => {
997
- let e = Fe.value;
539
+ let We = g(() => {
540
+ let e = J.value;
998
541
  if (!e) return null;
999
- let t = ze(e), n = g.value.items?.caption?.(e, v.value, J.value);
542
+ let t = Ue(e), n = x.value.items?.caption?.(e, T.value, W.value);
1000
543
  return {
1001
544
  ...t,
1002
545
  ...n
1003
546
  };
1004
- }), Ve = x(() => !!g.value.panel), He = x(() => {
1005
- let e = Fe.value;
547
+ }), X = g(() => !!x.value.panel), Z = g(() => {
548
+ let e = J.value;
1006
549
  if (!e) return [];
1007
- let t = Be.value, n = e.images?.[0]?.url ? [{
550
+ let t = We.value, n = e.images?.[0]?.url ? [{
1008
551
  id: "__primary",
1009
552
  image: e.images[0].url,
1010
553
  alt: t?.imageAlt ?? "",
@@ -1013,39 +556,39 @@ var ze = { class: "mwnf-home" }, Be = {
1013
556
  justification: "",
1014
557
  fields: null
1015
558
  }
1016
- }] : [], r = g.value.panel?.variants?.(e, J.value) ?? [];
559
+ }] : [], r = x.value.panel?.variants?.(e, W.value) ?? [];
1017
560
  return [...n, ...r.map((e, t) => ({
1018
561
  id: e.id ?? `variant-${t}`,
1019
562
  ...e
1020
563
  }))];
1021
- }), Ue = I(null);
1022
- G(He, (e) => {
1023
- e.some((e) => e.id === Ue.value) || (Ue.value = e[0]?.id ?? null);
564
+ }), Ge = k(null);
565
+ P(Z, (e) => {
566
+ e.some((e) => e.id === Ge.value) || (Ge.value = e[0]?.id ?? null);
1024
567
  }, { immediate: !0 });
1025
- let We = x(() => He.value.find((e) => e.id === Ue.value) ?? He.value[0] ?? null);
1026
- function Ge(e) {
1027
- Ue.value = e;
568
+ let Q = g(() => Z.value.find((e) => e.id === Ge.value) ?? Z.value[0] ?? null);
569
+ function Ke(e) {
570
+ Ge.value = e;
1028
571
  }
1029
- let Ke = x(() => {
1030
- let e = We.value;
572
+ let qe = g(() => {
573
+ let e = Q.value;
1031
574
  return e?.image ? [{
1032
575
  url: e.image,
1033
576
  alt: e.alt ?? ""
1034
577
  }] : [];
1035
- }), qe = x(() => {
1036
- let e = Fe.value;
1037
- return !e || !g.value.panel?.fields ? [] : g.value.panel.fields(e, v.value, J.value) ?? [];
1038
- }), Je = x(() => {
1039
- let e = We.value?.caption?.fields;
1040
- return e == null ? qe.value : e.map((e) => ({
1041
- label: e.label ? r(e.label) : "",
578
+ }), Je = g(() => {
579
+ let e = J.value;
580
+ return !e || !x.value.panel?.fields ? [] : x.value.panel.fields(e, T.value, W.value) ?? [];
581
+ }), Ct = g(() => {
582
+ let e = Q.value?.caption?.fields;
583
+ return e == null ? Je.value : e.map((e) => ({
584
+ label: e.label ? n(e.label) : "",
1042
585
  value: e.value
1043
586
  }));
1044
- }), Ye = x(() => {
1045
- let e = We.value?.caption?.justification;
1046
- return e ? $(String(e)) : "";
1047
- }), Xe = x(() => Ne.value.map((e) => {
1048
- let t = ze(e), n = g.value.items?.meta?.(e, J.value) ?? [], r = g.value.items?.badge?.(e, J.value) ?? "";
587
+ }), wt = g(() => {
588
+ let e = Q.value?.caption?.justification;
589
+ return e ? de(String(e)) : "";
590
+ }), Tt = g(() => K.value.map((e) => {
591
+ let t = Ue(e), n = x.value.items?.meta?.(e, W.value) ?? [], r = x.value.items?.badge?.(e, W.value) ?? "";
1049
592
  return {
1050
593
  id: e.id,
1051
594
  image: t.image,
@@ -1053,955 +596,203 @@ var ze = { class: "mwnf-home" }, Be = {
1053
596
  name: t.name,
1054
597
  meta: n,
1055
598
  badge: r,
1056
- to: Le(e)
599
+ to: He(e)
1057
600
  };
1058
- })), Ze = x(() => g.value.breadcrumb && v.value ? p.parents(n.id) : []), Qe = x(() => {
1059
- let e = g.value.tabs;
1060
- return e ? e === "children" ? v.value ? p.children(v.value.id) : [] : E.value : [];
1061
- }), $e = x(() => g.value.previous ?? "exhibition.theme.previous"), et = x(() => g.value.next ?? "exhibition.theme.next"), tt = x(() => g.value.backTo ?? "record.action.backToResults"), nt = x(() => g.value.inThisTheme ?? "exhibition.theme.inThisTheme"), rt = x(() => g.value.seeAll ?? "exhibition.theme.seeAllInTheme"), it = x(() => ({
1062
- ...J.value,
1063
- items: Ne.value,
1064
- selected: Fe.value,
1065
- selectedVariant: We.value,
1066
- selectVariant: Ge,
1067
- breadcrumb: Ze.value,
1068
- previous: F.value,
1069
- next: z.value
1070
- })), at = x(() => Se.value && !Ce("panel") ? !1 : Ve.value || Ne.value.length > 0 || !!a.aside), ot = x(() => (!Se.value || Ce("navigation")) && !!j.value && !!(F.value || z.value));
1071
- return (n, i) => h.value && !v.value ? (P(), S(V(re), { key: 0 })) : v.value ? (P(), w("article", {
601
+ })), Et = g(() => x.value.breadcrumb && T.value ? p.parents(t.id) : []), Dt = g(() => {
602
+ let e = x.value.tabs;
603
+ return e ? e === "children" ? T.value ? p.children(T.value.id) : [] : I.value : [];
604
+ }), Ot = g(() => x.value.previous ?? "exhibition.theme.previous"), kt = g(() => x.value.next ?? "exhibition.theme.next"), At = g(() => x.value.backTo ?? "record.action.backToResults"), jt = g(() => x.value.inThisTheme ?? "exhibition.theme.inThisTheme"), Mt = g(() => x.value.seeAll ?? "exhibition.theme.seeAllInTheme"), $ = g(() => ({
605
+ ...W.value,
606
+ items: K.value,
607
+ selected: J.value,
608
+ selectedVariant: Q.value,
609
+ selectVariant: Ke,
610
+ breadcrumb: Et.value,
611
+ previous: z.value,
612
+ next: B.value
613
+ })), Nt = g(() => G.value && !Pe("panel") ? !1 : X.value || K.value.length > 0 || !!i.aside), Pt = g(() => (!G.value || Pe("navigation")) && !!R.value && !!(z.value || B.value));
614
+ return (t, r) => ne.value && !T.value ? (O(), _(N(ae), { key: 0 })) : T.value ? (O(), y("article", {
1072
615
  key: 1,
1073
- class: M(["mwnf-essay", { "mwnf-essay--about": Se.value }]),
1074
- dir: V(te) || void 0,
1075
- onClick: i[0] ||= (...e) => V(de) && V(de)(...e)
616
+ class: E(["mwnf-essay", { "mwnf-essay--about": G.value }]),
617
+ dir: N(ve) || void 0,
618
+ onClick: r[0] ||= (...e) => N(De) && N(De)(...e)
1076
619
  }, [
1077
- R(n.$slots, "header", N(k(it.value)), () => [
1078
- Ze.value.length ? (P(), w("p", Xt, [T("span", Zt, B(V(r)(tt.value)), 1), (P(!0), w(b, null, L(Ze.value, (t) => (P(), w(b, { key: t.id }, [Re(t) ? (P(), S(e, {
620
+ j(t.$slots, "header", D(w($.value)), () => [
621
+ Et.value.length ? (O(), y("p", Xe, [b("span", Ze, M(N(n)(At.value)), 1), (O(!0), y(h, null, A(Et.value, (e) => (O(), y(h, { key: e.id }, [Y(e) ? (O(), _(o, {
1079
622
  key: 0,
1080
- to: Re(t),
623
+ to: Y(e),
1081
624
  class: "mwnf-essay__breadcrumb-link"
1082
625
  }, {
1083
- default: K(() => [D(B(q(t)), 1)]),
626
+ default: F(() => [S(M(U(e)), 1)]),
1084
627
  _: 2
1085
- }, 1032, ["to"])) : (P(), w("span", Qt, B(q(t)), 1))], 64))), 128))])) : C("", !0),
1086
- Qe.value.length > 1 ? (P(), w("div", {
628
+ }, 1032, ["to"])) : (O(), y("span", Qe, M(U(e)), 1))], 64))), 128))])) : v("", !0),
629
+ Dt.value.length > 1 ? (O(), y("div", {
1087
630
  key: 1,
1088
631
  class: "mwnf-essay__tabs",
1089
632
  role: "tablist",
1090
- "aria-label": V(r)(nt.value)
1091
- }, [(P(!0), w(b, null, L(Qe.value, (n) => (P(), S(e, {
1092
- key: n.id,
1093
- to: Re(n),
1094
- class: M(["mwnf-essay__tab", { "mwnf-essay__tab--active": n.id === t.id }])
633
+ "aria-label": N(n)(jt.value)
634
+ }, [(O(!0), y(h, null, A(Dt.value, (t) => (O(), _(o, {
635
+ key: t.id,
636
+ to: Y(t),
637
+ class: E(["mwnf-essay__tab", { "mwnf-essay__tab--active": t.id === e.id }])
1095
638
  }, {
1096
- default: K(() => [D(B(q(n)), 1)]),
639
+ default: F(() => [S(M(U(t)), 1)]),
1097
640
  _: 2
1098
- }, 1032, ["to", "class"]))), 128))], 8, $t)) : C("", !0),
1099
- T("h1", en, [Oe.value ? (P(), w("span", tn, B(Oe.value), 1)) : C("", !0), T("span", { innerHTML: me.value }, null, 8, nn)])
641
+ }, 1032, ["to", "class"]))), 128))], 8, $e)) : v("", !0),
642
+ b("h1", et, [Le.value ? (O(), y("span", tt, M(Le.value), 1)) : v("", !0), b("span", { innerHTML: Ae.value }, null, 8, nt)])
1100
643
  ]),
1101
- T("div", rn, [T("div", an, [
1102
- ne.value ? C("", !0) : (P(), w("p", on, B(V(r)("core.status.loading")), 1)),
1103
- _e.value ? (P(), w("p", {
644
+ b("div", rt, [b("div", it, [
645
+ H.value ? v("", !0) : (O(), y("p", at, M(N(n)("core.status.loading")), 1)),
646
+ je.value ? (O(), y("p", {
1104
647
  key: 1,
1105
648
  class: "mwnf-essay__quote",
1106
- innerHTML: _e.value
1107
- }, null, 8, sn)) : C("", !0),
1108
- R(n.$slots, "before-body", N(k(it.value))),
1109
- ve.value ? (P(), w("div", {
649
+ innerHTML: je.value
650
+ }, null, 8, ot)) : v("", !0),
651
+ j(t.$slots, "before-body", D(w($.value))),
652
+ Me.value ? (O(), y("div", {
1110
653
  key: 2,
1111
654
  class: "mwnf-essay__prose mwnf-sheet__block",
1112
- innerHTML: ve.value
1113
- }, null, 8, cn)) : C("", !0),
1114
- R(n.$slots, "after-body", N(k(it.value))),
1115
- Se.value ? C("", !0) : R(n.$slots, "justifications", N(k(it.value)), void 0, void 0, 3),
1116
- ot.value ? (P(), w("div", ln, [R(n.$slots, "navigation", N(k(it.value)), () => [F.value ? (P(), S(e, {
655
+ innerHTML: Me.value
656
+ }, null, 8, st)) : v("", !0),
657
+ j(t.$slots, "after-body", D(w($.value))),
658
+ G.value ? v("", !0) : j(t.$slots, "justifications", D(w($.value)), void 0, void 0, 3),
659
+ Pt.value ? (O(), y("div", ct, [j(t.$slots, "navigation", D(w($.value)), () => [z.value ? (O(), _(o, {
1117
660
  key: 0,
1118
- to: Re(F.value),
661
+ to: Y(z.value),
1119
662
  class: "mwnf-essay__nav-link mwnf-essay__nav-link--previous"
1120
663
  }, {
1121
- default: K(() => [D("← " + B(V(r)($e.value)), 1)]),
664
+ default: F(() => [S("← " + M(N(n)(Ot.value)), 1)]),
1122
665
  _: 1
1123
- }, 8, ["to"])) : (P(), w("span", un)), z.value ? (P(), S(e, {
666
+ }, 8, ["to"])) : (O(), y("span", lt)), B.value ? (O(), _(o, {
1124
667
  key: 2,
1125
- to: Re(z.value),
668
+ to: Y(B.value),
1126
669
  class: "mwnf-essay__nav-link mwnf-essay__nav-link--next"
1127
670
  }, {
1128
- default: K(() => [D(B(V(r)(et.value)) + " →", 1)]),
671
+ default: F(() => [S(M(N(n)(kt.value)) + " →", 1)]),
1129
672
  _: 1
1130
- }, 8, ["to"])) : C("", !0)])])) : C("", !0)
1131
- ]), at.value ? (P(), w("div", dn, [
1132
- R(n.$slots, "panel", N(k(it.value)), () => [Ve.value && Be.value ? (P(), w("div", fn, [
1133
- O(ee, { images: Ke.value }, null, 8, ["images"]),
1134
- He.value.length > 1 ? (P(), w("ul", pn, [(P(!0), w(b, null, L(He.value, (e) => (P(), w("li", { key: e.id }, [T("button", {
673
+ }, 8, ["to"])) : v("", !0)])])) : v("", !0)
674
+ ]), Nt.value ? (O(), y("div", ut, [
675
+ j(t.$slots, "panel", D(w($.value)), () => [X.value && We.value ? (O(), y("div", dt, [
676
+ C(c, { images: qe.value }, null, 8, ["images"]),
677
+ Z.value.length > 1 ? (O(), y("ul", ft, [(O(!0), y(h, null, A(Z.value, (e) => (O(), y("li", { key: e.id }, [b("button", {
1135
678
  type: "button",
1136
- class: M(["mwnf-essay__variant", { "mwnf-essay__variant--active": e.id === We.value?.id }]),
1137
- "aria-pressed": e.id === We.value?.id ? "true" : "false",
1138
- onClick: (t) => Ge(e.id)
1139
- }, [e.image ? (P(), w("img", {
679
+ class: E(["mwnf-essay__variant", { "mwnf-essay__variant--active": e.id === Q.value?.id }]),
680
+ "aria-pressed": e.id === Q.value?.id ? "true" : "false",
681
+ onClick: (t) => Ke(e.id)
682
+ }, [e.image ? (O(), y("img", {
1140
683
  key: 0,
1141
684
  src: e.image,
1142
685
  alt: e.alt ?? "",
1143
686
  loading: "lazy"
1144
- }, null, 8, hn)) : C("", !0)], 10, mn)]))), 128))])) : C("", !0),
1145
- T("h3", {
687
+ }, null, 8, mt)) : v("", !0)], 10, pt)]))), 128))])) : v("", !0),
688
+ b("h3", {
1146
689
  class: "mwnf-essay__panel-name",
1147
- innerHTML: We.value?.caption?.title || Be.value.name
1148
- }, null, 8, gn),
1149
- (P(!0), w(b, null, L(Je.value, (e, t) => (P(), w("p", {
690
+ innerHTML: Q.value?.caption?.title || We.value.name
691
+ }, null, 8, ht),
692
+ (O(!0), y(h, null, A(Ct.value, (e, t) => (O(), y("p", {
1150
693
  key: t,
1151
694
  class: "mwnf-essay__panel-field"
1152
- }, [e.label ? (P(), w("span", _n, B(e.label), 1)) : C("", !0), T("span", { innerHTML: e.value }, null, 8, vn)]))), 128)),
1153
- Ye.value ? (P(), w("p", {
695
+ }, [e.label ? (O(), y("span", gt, M(e.label), 1)) : v("", !0), b("span", { innerHTML: e.value }, null, 8, _t)]))), 128)),
696
+ wt.value ? (O(), y("p", {
1154
697
  key: 1,
1155
698
  class: "mwnf-essay__panel-justification mwnf-sheet__block",
1156
- innerHTML: Ye.value
1157
- }, null, 8, yn)) : C("", !0),
1158
- Le(Fe.value) ? (P(), S(e, {
699
+ innerHTML: wt.value
700
+ }, null, 8, vt)) : v("", !0),
701
+ He(J.value) ? (O(), _(o, {
1159
702
  key: 2,
1160
- to: Le(Fe.value),
703
+ to: He(J.value),
1161
704
  class: "mwnf-essay__panel-link"
1162
705
  }, {
1163
- default: K(() => [D(B(V(r)(rt.value)) + " →", 1)]),
706
+ default: F(() => [S(M(N(n)(Mt.value)) + " →", 1)]),
1164
707
  _: 1
1165
- }, 8, ["to"])) : C("", !0)
1166
- ])) : C("", !0)]),
1167
- R(n.$slots, "thumbnails", N(k(it.value)), () => [Ve.value && Ne.value.length > 1 ? (P(), w("ul", bn, [(P(!0), w(b, null, L(Ne.value, (e) => (P(), w("li", { key: e.id }, [T("button", {
708
+ }, 8, ["to"])) : v("", !0)
709
+ ])) : v("", !0)]),
710
+ j(t.$slots, "thumbnails", D(w($.value)), () => [X.value && K.value.length > 1 ? (O(), y("ul", yt, [(O(!0), y(h, null, A(K.value, (e) => (O(), y("li", { key: e.id }, [b("button", {
1168
711
  type: "button",
1169
- class: M(["mwnf-essay__thumb", { "mwnf-essay__thumb--active": e.id === Fe.value?.id }]),
1170
- onClick: (t) => Ie(e.id)
1171
- }, [e.images?.[0]?.url ? (P(), w("img", {
712
+ class: E(["mwnf-essay__thumb", { "mwnf-essay__thumb--active": e.id === J.value?.id }]),
713
+ onClick: (t) => Ve(e.id)
714
+ }, [e.images?.[0]?.url ? (O(), y("img", {
1172
715
  key: 0,
1173
716
  src: e.images[0].url,
1174
717
  alt: "",
1175
718
  loading: "lazy"
1176
- }, null, 8, Sn)) : C("", !0)], 10, xn)]))), 128))])) : !Ve.value && Xe.value.length ? (P(), S(_, {
719
+ }, null, 8, xt)) : v("", !0)], 10, bt)]))), 128))])) : !X.value && Tt.value.length ? (O(), _(ee, {
1177
720
  key: 1,
1178
- records: Xe.value
1179
- }, null, 8, ["records"])) : C("", !0)]),
1180
- R(n.$slots, "aside", N(k(it.value)))
1181
- ])) : C("", !0)]),
1182
- R(n.$slots, "after", N(k(it.value)), () => [O(l)]),
1183
- O(f, {
1184
- term: V(ue),
1185
- html: pe.value,
1186
- dir: V(te),
1187
- onClose: V(fe)
721
+ records: Tt.value
722
+ }, null, 8, ["records"])) : v("", !0)]),
723
+ j(t.$slots, "aside", D(w($.value)))
724
+ ])) : v("", !0)]),
725
+ j(t.$slots, "after", D(w($.value)), () => [C(a)]),
726
+ C(te, {
727
+ term: N(Ee),
728
+ html: ke.value,
729
+ dir: N(ve),
730
+ onClose: N(Oe)
1188
731
  }, null, 8, [
1189
732
  "term",
1190
733
  "html",
1191
734
  "dir",
1192
735
  "onClose"
1193
736
  ])
1194
- ], 10, Yt)) : (P(), w("p", Cn, B(V(r)("core.status.loading")), 1));
737
+ ], 10, Ye)) : (O(), y("p", St, M(N(n)("core.status.loading")), 1));
1195
738
  }
1196
- }, Tn = { class: "mwnf-link-list" }, En = {
739
+ }, wt = { class: "mwnf-link-list" }, Tt = {
1197
740
  key: 0,
1198
741
  class: "mwnf-link-list__back"
1199
- }, Dn = {
742
+ }, Et = {
1200
743
  key: 1,
1201
744
  class: "mwnf-link-list__title"
1202
- }, On = {
745
+ }, Dt = {
1203
746
  key: 2,
1204
747
  class: "mwnf-link-list__groups"
1205
- }, kn = {
748
+ }, Ot = {
1206
749
  key: 0,
1207
750
  class: "mwnf-link-list__heading"
1208
- }, An = {
751
+ }, kt = {
1209
752
  key: 1,
1210
753
  class: "mwnf-link-list__links"
1211
- }, jn = ["innerHTML"], Mn = ["innerHTML"], Nn = {
754
+ }, At = ["innerHTML"], jt = ["innerHTML"], Mt = {
1212
755
  key: 3,
1213
756
  class: "mwnf-link-list__empty"
1214
- }, Pn = {
757
+ }, $ = {
1215
758
  __name: "LinkListView",
1216
759
  props: { spec: {
1217
760
  type: Object,
1218
761
  required: !0
1219
762
  } },
1220
- setup(t) {
1221
- let n = t, { t: r } = Te(), i = x(() => ((typeof n.spec.groups == "function" ? n.spec.groups({}) : n.spec.groups ?? []) ?? []).filter((e) => e.links?.length > 0)), a = x(() => n.spec.title ? r(n.spec.title) : ""), o = x(() => n.spec.back?.label ? r(n.spec.back.label) : ""), s = x(() => r(n.spec.empty ?? "catalogue.results.noResults"));
1222
- return (t, c) => (P(), w("div", Tn, [
1223
- n.spec.back && o.value ? (P(), w("div", En, [O(e, {
1224
- to: n.spec.back.to,
1225
- href: n.spec.back.href
763
+ setup(e) {
764
+ let t = e, { t: n } = ge(), 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) : ""), s = g(() => n(t.spec.empty ?? "catalogue.results.noResults"));
765
+ return (e, ee) => (O(), y("div", wt, [
766
+ t.spec.back && a.value ? (O(), y("div", Tt, [C(o, {
767
+ to: t.spec.back.to,
768
+ href: t.spec.back.href
1226
769
  }, {
1227
- default: K(() => [D(" ← " + B(o.value), 1)]),
770
+ default: F(() => [S(" ← " + M(a.value), 1)]),
1228
771
  _: 1
1229
- }, 8, ["to", "href"])])) : C("", !0),
1230
- a.value ? (P(), w("h1", Dn, B(a.value), 1)) : C("", !0),
1231
- R(t.$slots, "before"),
1232
- i.value.length ? (P(), w("div", On, [(P(!0), w(b, null, L(i.value, (n, i) => (P(), w("section", {
1233
- key: i,
772
+ }, 8, ["to", "href"])])) : v("", !0),
773
+ i.value ? (O(), y("h1", Et, M(i.value), 1)) : v("", !0),
774
+ j(e.$slots, "before"),
775
+ r.value.length ? (O(), y("div", Dt, [(O(!0), y(h, null, A(r.value, (t, r) => (O(), y("section", {
776
+ key: r,
1234
777
  class: "mwnf-link-list__group"
1235
- }, [R(t.$slots, "group", { group: n }, () => [n.heading ? (P(), w("h2", kn, B(V(r)(n.heading)), 1)) : C("", !0), n.links?.length ? (P(), w("ul", An, [(P(!0), w(b, null, L(n.links, (t, n) => (P(), w("li", {
1236
- key: n,
778
+ }, [j(e.$slots, "group", { group: t }, () => [t.heading ? (O(), y("h2", Ot, M(N(n)(t.heading)), 1)) : v("", !0), t.links?.length ? (O(), y("ul", kt, [(O(!0), y(h, null, A(t.links, (e, t) => (O(), y("li", {
779
+ key: t,
1237
780
  class: "mwnf-link-list__item"
1238
- }, [O(e, {
781
+ }, [C(o, {
1239
782
  class: "mwnf-link-list__link",
1240
- to: t.to,
1241
- href: t.href
783
+ to: e.to,
784
+ href: e.href
1242
785
  }, {
1243
- default: K(() => [T("span", { innerHTML: V(de)(t.label) }, null, 8, jn)]),
786
+ default: F(() => [b("span", { innerHTML: N(I)(e.label) }, null, 8, At)]),
1244
787
  _: 2
1245
- }, 1032, ["to", "href"]), t.note ? (P(), w("div", {
788
+ }, 1032, ["to", "href"]), e.note ? (O(), y("div", {
1246
789
  key: 0,
1247
790
  class: "mwnf-link-list__note",
1248
- innerHTML: V(de)(t.note)
1249
- }, null, 8, Mn)) : C("", !0)]))), 128))])) : C("", !0)])]))), 128))])) : (P(), w("div", Nn, B(s.value), 1)),
1250
- R(t.$slots, "after")
1251
- ]));
1252
- }
1253
- }, Fn = { class: "mwnf-partner-list" }, In = {
1254
- key: 0,
1255
- class: "mwnf-partner-list__title"
1256
- }, Ln = {
1257
- key: 1,
1258
- class: "mwnf-partner-list__count"
1259
- }, Rn = {
1260
- key: 2,
1261
- class: "mwnf-partner-list__toggle"
1262
- }, zn = {
1263
- key: 3,
1264
- class: "mwnf-partner-list__groups"
1265
- }, Bn = {
1266
- key: 0,
1267
- class: "mwnf-partner-list__group-title"
1268
- }, Vn = { class: "mwnf-partner-list__tier" }, Hn = { class: "mwnf-partner-list__row" }, Un = ["src", "alt"], Wn = ["innerHTML"], Gn = { key: 0 }, Kn = {
1269
- key: 1,
1270
- class: "mwnf-partner-list__meta"
1271
- }, qn = {
1272
- key: 0,
1273
- class: "mwnf-partner-list__children"
1274
- }, Jn = ["src", "alt"], Yn = ["innerHTML"], Xn = { key: 0 }, Zn = {
1275
- key: 1,
1276
- class: "mwnf-partner-list__meta"
1277
- }, Qn = {
1278
- key: 0,
1279
- class: "mwnf-partner-list__tier mwnf-partner-list__tier--associated"
1280
- }, $n = { class: "mwnf-partner-list__tier-label" }, er = ["src", "alt"], tr = ["innerHTML"], nr = { key: 0 }, rr = {
1281
- key: 1,
1282
- class: "mwnf-partner-list__meta"
1283
- }, ir = {
1284
- key: 4,
1285
- class: "mwnf-partner-list__empty"
1286
- }, ar = {
1287
- __name: "PartnerListView",
1288
- props: { spec: {
1289
- type: Object,
1290
- required: !0
1291
- } },
1292
- setup(t) {
1293
- let n = t, { t: r, locale: i } = Te(), a = xe(), o = x(() => n.spec), s = x(() => o.value.entity ?? "partners"), c = oe(s.value);
1294
- s.value && a.loadTranslations(s.value, "en");
1295
- let l = {
1296
- t: r,
1297
- locale: i,
1298
- tr: (e) => a.tr(s.value, e, i.value, "en"),
1299
- renderInline: $,
1300
- renderPlain: ge
1301
- }, { filters: u, apply: d } = Ee({
1302
- keys: ["order"],
1303
- page: !1
1304
- }), f = x(() => u.order === "desc" ? "desc" : "asc");
1305
- function p() {
1306
- d({ order: f.value === "asc" ? "desc" : "asc" });
1307
- }
1308
- let m = x(() => {
1309
- let e = o.value, t = c.value ?? [];
1310
- return e.scope ? t.filter((t) => e.scope(t, l)) : t;
1311
- }), ee = x(() => o.value.route);
1312
- function h(e) {
1313
- let t = ee.value;
1314
- return t ? typeof t == "function" ? t(e, l) : {
1315
- name: t,
1316
- params: { id: e.id }
1317
- } : null;
1318
- }
1319
- function g(e, t) {
1320
- let n = t.tr(e.id), r = n.name ?? e.internal_name ?? e.id;
1321
- return {
1322
- name: t.renderInline(String(r)),
1323
- city: n.city ?? "",
1324
- logo: e.logos?.[0]?.url ?? "",
1325
- count: e.item_count ?? 0,
1326
- route: h(e)
1327
- };
1328
- }
1329
- function _(e) {
1330
- return (o.value.record ?? g)(e, l);
1331
- }
1332
- function v(e) {
1333
- return String(e ?? "").replace(/<[^>]*>/g, "");
1334
- }
1335
- let y = x(() => o.value.nested ? pe(m.value) : null), E = x(() => {
1336
- let e = o.value, t = e.group?.tier ?? !1, n = (e.group?.order ?? "country") === "name", r = n ? m.value.map((e) => ({
1337
- ...e,
1338
- country_id: "\0"
1339
- })) : m.value, i = ce(r, {
1340
- label: n ? () => "" : (t) => e.label ? e.label(t, l) : t,
1341
- tier: t,
1342
- order: f.value
1343
- }), a = (e, t) => v(e.row.name).localeCompare(v(t.row.name));
1344
- return i.map((t) => {
1345
- let r = t.main.map((e) => ({
1346
- partner: e,
1347
- row: _(e)
1348
- })).sort(a), i = t.associated.map((e) => ({
1349
- partner: e,
1350
- row: _(e)
1351
- })).sort(a);
1352
- if (n && f.value === "desc" && (r.reverse(), i.reverse()), e.nested && y.value) {
1353
- let e = new Set(i.map((e) => e.partner.id));
1354
- r = r.map((t) => {
1355
- let n = y.value.children(t.partner.id).filter((t) => e.has(t.id));
1356
- for (let t of n) e.delete(t.id);
1357
- return {
1358
- ...t,
1359
- children: n.map((e) => ({
1360
- partner: e,
1361
- row: _(e)
1362
- }))
1363
- };
1364
- }), i = i.filter((t) => e.has(t.partner.id));
1365
- }
1366
- return {
1367
- country: t.country,
1368
- label: t.label,
1369
- main: r,
1370
- associated: i
1371
- };
1372
- });
1373
- }), D = x(() => E.value.some((e) => e.main.length > 0 || e.associated.length > 0)), O = x(() => r(o.value.associatedLabel ?? "partner.list.associated")), A = x(() => r(o.value.objectsLabel ?? "partner.item.objectsInSite")), M = x(() => r(o.value.foundLabel ?? "partner.list.partnersFound")), F = x(() => r(o.value.sortAscendingLabel ?? "partner.list.sortAscending")), I = x(() => r(o.value.sortDescendingLabel ?? "partner.list.sortDescending")), V = x(() => r(o.value.empty ?? "catalogue.results.noResults")), H = x(() => o.value.title ? r(o.value.title) : ""), U = x(() => E.value.reduce((e, t) => e + t.main.length + t.associated.length, 0)), te = x(() => o.value.variant ?? "accordion"), W = x(() => ({
1374
- t: r,
1375
- locale: i,
1376
- groups: E.value,
1377
- orderDir: f.value,
1378
- toggleOrder: p
1379
- }));
1380
- return (t, n) => (P(), w("section", Fn, [
1381
- H.value ? (P(), w("h1", In, B(H.value), 1)) : C("", !0),
1382
- o.value.count ? (P(), w("div", Ln, B(M.value) + ": " + B(U.value), 1)) : C("", !0),
1383
- R(t.$slots, "before", N(k(W.value))),
1384
- o.value.orderToggle ? (P(), w("div", Rn, [T("button", {
1385
- type: "button",
1386
- class: "mwnf-partner-list__toggle-button",
1387
- onClick: p
1388
- }, B(f.value === "asc" ? I.value : F.value), 1)])) : C("", !0),
1389
- D.value ? (P(), w("div", zn, [(P(!0), w(b, null, L(E.value, (n) => (P(), S(z(te.value === "accordion" ? "details" : "section"), j({
1390
- key: n.country ?? "",
1391
- class: "mwnf-partner-list__group"
1392
- }, { ref_for: !0 }, te.value === "accordion" ? { open: !0 } : {}), {
1393
- default: K(() => [
1394
- (P(), S(z(te.value === "accordion" ? "summary" : "div"), { class: "mwnf-partner-list__group-heading" }, {
1395
- default: K(() => [R(t.$slots, "group-heading", j({ group: n }, { ref_for: !0 }, W.value), () => [n.label ? (P(), w("h2", Bn, B(n.label), 1)) : C("", !0)])]),
1396
- _: 2
1397
- }, 1024)),
1398
- T("div", Vn, [(P(!0), w(b, null, L(n.main, (r) => (P(), w("div", {
1399
- key: r.partner.id,
1400
- class: "mwnf-partner-list__row-block"
1401
- }, [T("div", Hn, [R(t.$slots, "row", j({
1402
- group: n,
1403
- partner: r.partner,
1404
- row: r.row
1405
- }, { ref_for: !0 }, W.value), () => [
1406
- r.row.logo ? (P(), w("img", {
1407
- key: 0,
1408
- class: "mwnf-partner-list__logo",
1409
- src: r.row.logo,
1410
- alt: v(r.row.name),
1411
- loading: "lazy"
1412
- }, null, 8, Un)) : C("", !0),
1413
- (P(), S(z(r.row.route ? e : "span"), {
1414
- class: "mwnf-partner-list__name",
1415
- to: r.row.route
1416
- }, {
1417
- default: K(() => [T("span", { innerHTML: r.row.name }, null, 8, Wn), r.row.city ? (P(), w("span", Gn, ", " + B(r.row.city), 1)) : C("", !0)]),
1418
- _: 2
1419
- }, 1032, ["to"])),
1420
- r.row.count ? (P(), w("span", Kn, B(r.row.count) + " " + B(A.value), 1)) : C("", !0)
1421
- ])]), r.children?.length ? (P(), w("div", qn, [(P(!0), w(b, null, L(r.children, (r) => (P(), w("div", {
1422
- key: r.partner.id,
1423
- class: "mwnf-partner-list__row mwnf-partner-list__row--child"
1424
- }, [R(t.$slots, "row", j({
1425
- group: n,
1426
- partner: r.partner,
1427
- row: r.row
1428
- }, { ref_for: !0 }, W.value), () => [
1429
- r.row.logo ? (P(), w("img", {
1430
- key: 0,
1431
- class: "mwnf-partner-list__logo",
1432
- src: r.row.logo,
1433
- alt: v(r.row.name),
1434
- loading: "lazy"
1435
- }, null, 8, Jn)) : C("", !0),
1436
- (P(), S(z(r.row.route ? e : "span"), {
1437
- class: "mwnf-partner-list__name",
1438
- to: r.row.route
1439
- }, {
1440
- default: K(() => [T("span", { innerHTML: r.row.name }, null, 8, Yn), r.row.city ? (P(), w("span", Xn, ", " + B(r.row.city), 1)) : C("", !0)]),
1441
- _: 2
1442
- }, 1032, ["to"])),
1443
- r.row.count ? (P(), w("span", Zn, B(r.row.count) + " " + B(A.value), 1)) : C("", !0)
1444
- ])]))), 128))])) : C("", !0)]))), 128))]),
1445
- n.associated.length ? (P(), w("div", Qn, [T("p", $n, B(O.value), 1), (P(!0), w(b, null, L(n.associated, (r) => (P(), w("div", {
1446
- key: r.partner.id,
1447
- class: "mwnf-partner-list__row"
1448
- }, [R(t.$slots, "row", j({
1449
- group: n,
1450
- partner: r.partner,
1451
- row: r.row
1452
- }, { ref_for: !0 }, W.value), () => [
1453
- r.row.logo ? (P(), w("img", {
1454
- key: 0,
1455
- class: "mwnf-partner-list__logo",
1456
- src: r.row.logo,
1457
- alt: v(r.row.name),
1458
- loading: "lazy"
1459
- }, null, 8, er)) : C("", !0),
1460
- (P(), S(z(r.row.route ? e : "span"), {
1461
- class: "mwnf-partner-list__name",
1462
- to: r.row.route
1463
- }, {
1464
- default: K(() => [T("span", { innerHTML: r.row.name }, null, 8, tr), r.row.city ? (P(), w("span", nr, ", " + B(r.row.city), 1)) : C("", !0)]),
1465
- _: 2
1466
- }, 1032, ["to"])),
1467
- r.row.count ? (P(), w("span", rr, B(r.row.count) + " " + B(A.value), 1)) : C("", !0)
1468
- ])]))), 128))])) : C("", !0)
1469
- ]),
1470
- _: 2
1471
- }, 1040))), 128))])) : (P(), w("p", ir, B(V.value), 1)),
1472
- R(t.$slots, "after", N(k(W.value)))
1473
- ]));
1474
- }
1475
- }, or = { class: "mwnf-text-page" }, sr = {
1476
- key: 0,
1477
- class: "mwnf-text-page__back"
1478
- }, cr = {
1479
- key: 1,
1480
- class: "mwnf-text-page__heading"
1481
- }, lr = { class: "mwnf-prose" }, ur = ["innerHTML"], dr = {
1482
- __name: "TextPageView",
1483
- props: { spec: {
1484
- type: Object,
1485
- required: !0
1486
- } },
1487
- setup(t) {
1488
- let n = t, { t: r } = Te(), i = xe(), a = De(), o = x(() => n.spec.heading ? r(n.spec.heading) : ""), s = x(() => typeof n.spec.body == "string"), c = x(() => s.value ? n.spec.body : null), l = x(() => ({
1489
- t: r,
1490
- tr: (e, t) => i.tr(e, t, a.value, "en"),
1491
- language: a.value
1492
- })), u = x(() => s.value ? null : typeof n.spec.body == "function" ? ue(n.spec.body(l.value)) : null), d = x(() => n.spec.back === !1 ? null : n.spec.back === !0 ? r("core.action.back") : n.spec.back?.label ? r(n.spec.back.label) : null);
1493
- return (t, r) => (P(), w("div", or, [
1494
- d.value && (n.spec.back === !0 || n.spec.back?.to || n.spec.back?.href) ? (P(), w("div", sr, [O(e, {
1495
- to: n.spec.back === !0 ? {} : n.spec.back?.to,
1496
- href: n.spec.back === !0 ? "#" : n.spec.back?.href
1497
- }, {
1498
- default: K(() => [D(" ← " + B(d.value), 1)]),
1499
- _: 1
1500
- }, 8, ["to", "href"])])) : C("", !0),
1501
- o.value ? (P(), w("h1", cr, B(o.value), 1)) : C("", !0),
1502
- T("div", lr, [s.value ? (P(), S(V(J), {
1503
- key: 0,
1504
- keypath: c.value
1505
- }, null, 8, ["keypath"])) : u.value ? (P(), w("div", {
1506
- key: 1,
1507
- innerHTML: u.value
1508
- }, null, 8, ur)) : C("", !0)])
1509
- ]));
1510
- }
1511
- }, fr = { class: "mwnf-search-form__row-label" }, pr = ["onUpdate:modelValue"], mr = ["value"], hr = ["onUpdate:modelValue"], gr = ["value"], _r = ["onUpdate:modelValue", "placeholder"], vr = {
1512
- key: 0,
1513
- class: "mwnf-search-form__dates"
1514
- }, yr = {
1515
- key: 1,
1516
- class: "mwnf-facet"
1517
- }, br = { class: "mwnf-facet__label" }, xr = { value: "" }, Sr = ["value"], Cr = {
1518
- key: 0,
1519
- class: "mwnf-search-form__dates"
1520
- }, wr = { class: "mwnf-search-form__radio-choice" }, Tr = ["value"], Er = ["onUpdate:modelValue", "disabled"], Dr = ["onUpdate:modelValue"], Or = { class: "mwnf-facet__label" }, kr = {
1521
- key: 0,
1522
- class: "mwnf-search-form__how-to"
1523
- }, Ar = {
1524
- __name: "SearchFormView",
1525
- props: { spec: {
1526
- type: Object,
1527
- required: !0
1528
- } },
1529
- setup(t) {
1530
- let n = t, { t: r } = Te(), i = Re(), a = x(() => n.spec), o = x(() => a.value.mode), l = x(() => a.value.entity ? oe(a.value.entity).value ?? [] : []), u = x(() => a.value.dates === "buckets"), d = x(() => {
1531
- let e = a.value.dates;
1532
- if (!e || e === "buckets") return null;
1533
- let t = e.presets;
1534
- return typeof t == "function" ? t() : t ?? Y();
1535
- });
1536
- function f(e) {
1537
- return (e ?? []).map((e) => ({
1538
- value: e,
1539
- label: String(e)
1540
- }));
1541
- }
1542
- let p = x(() => u.value ? Ie(l.value, r) : []), m = x(() => u.value ? p.value : f(d.value?.from)), ee = x(() => u.value ? p.value : f(d.value?.to)), h = x(() => !!a.value.dates), g = I(""), _ = I(""), v = a.value.language ? Ne(a.value.language) : null, y = x(() => v?.languages.value ?? []), E = v?.language ?? I(""), j = x(() => Object.fromEntries((a.value.facets ?? []).filter((e) => !e.options && e.type !== "year").map((e) => [e.key, { field: e.field ?? e.key }]))), z = Se(l, j), H = x(() => {
1543
- let e = {};
1544
- for (let t of a.value.facets ?? []) e[t.key] = t.options ?? z.value[t.key] ?? [];
1545
- return e;
1546
- }), G = [{
1547
- key: "AND",
1548
- label: "catalogue.search.and"
1549
- }, {
1550
- key: "OR",
1551
- label: "catalogue.search.or"
1552
- }], J = [
1553
- "catalogue.search.keywordOne",
1554
- "catalogue.search.keywordTwo",
1555
- "catalogue.search.keywordThree"
1556
- ], re = x(() => a.value.operators ?? G), ie = I(Array.from({ length: a.value.rows ?? 3 }, () => ({
1557
- keyword: "",
1558
- field: a.value.fields?.[0]?.key ?? "",
1559
- cond: (a.value.operators ?? G)[0].key
1560
- })));
1561
- function X(e) {
1562
- return J[e] ? r(J[e]) : "";
1563
- }
1564
- let ae = I(a.value.facets?.[0]?.key ?? ""), Z = F(Object.fromEntries((a.value.facets ?? []).map((e) => [e.key, ""]))), se = F(Object.fromEntries((a.value.extras ?? []).map((e) => [e.key, !1])));
1565
- function Q() {
1566
- let e = {};
1567
- for (let t of a.value.extras ?? []) se[t.key] && (e[t.key] = "1");
1568
- return e;
1569
- }
1570
- function ce(e) {
1571
- return i.push({
1572
- name: a.value.target,
1573
- query: e
1574
- });
1575
- }
1576
- function le() {
1577
- let e = {};
1578
- if (o.value === "rows") ie.value.forEach((t, n) => {
1579
- if (t.keyword) {
1580
- if (n === 0) e.q = t.keyword, t.field && (e.field = t.field);
1581
- else {
1582
- let r = n + 1;
1583
- e[`q${r}`] = t.keyword, t.field && (e[`field${r}`] = t.field), e[`op${r}`] = t.cond;
1584
- }
1585
- }
1586
- }), g.value && (e.from = String(g.value)), _.value && (e.to = String(_.value)), E.value && (e.lang = E.value);
1587
- else if (o.value === "radio") {
1588
- let t = ae.value, n = t ? Z[t] : "";
1589
- n && (e[t] = String(n));
1590
- }
1591
- return Object.assign(e, Q()), ce(e);
1592
- }
1593
- function ue(e, t) {
1594
- if (t !== "" && t != null) return ce({
1595
- [e]: String(t),
1596
- ...Q()
1597
- });
1598
- }
1599
- function de() {
1600
- return ce(Q());
1601
- }
1602
- let fe = x(() => o.value === "facets" ? "immediate" : "apply"), pe = x(() => o.value === "radio" ? "core.action.browse" : "core.action.search"), me = x(() => r(a.value.submitLabel ?? pe.value)), he = x(() => r(a.value.showAllLabel ?? "core.action.reset")), $ = x(() => ({
1603
- mode: o.value,
1604
- submit: le,
1605
- showAll: de
1606
- }));
1607
- return (t, n) => (P(), w("section", { class: M(["mwnf-search-form", `mwnf-search-form--${o.value}`]) }, [
1608
- R(t.$slots, "intro", N(k($.value))),
1609
- R(t.$slots, "before", N(k($.value))),
1610
- O(c, {
1611
- class: "mwnf-search-form__panel",
1612
- mode: fe.value,
1613
- "apply-label": me.value,
1614
- "reset-label": he.value,
1615
- onApply: le,
1616
- onReset: de
1617
- }, {
1618
- default: K(() => [
1619
- o.value === "rows" ? (P(), w(b, { key: 0 }, [
1620
- (P(!0), w(b, null, L(ie.value, (e, t) => (P(), w("div", {
1621
- key: t,
1622
- class: "mwnf-search-form__row"
1623
- }, [
1624
- T("span", fr, B(X(t)), 1),
1625
- t > 0 ? q((P(), w("select", {
1626
- key: 0,
1627
- "onUpdate:modelValue": (t) => e.cond = t,
1628
- class: "mwnf-facet__select mwnf-search-form__operator"
1629
- }, [(P(!0), w(b, null, L(re.value, (e) => (P(), w("option", {
1630
- key: e.key,
1631
- value: e.key
1632
- }, B(V(r)(e.label)), 9, mr))), 128))], 8, pr)), [[W, e.cond]]) : C("", !0),
1633
- q(T("select", {
1634
- "onUpdate:modelValue": (t) => e.field = t,
1635
- class: "mwnf-facet__select mwnf-search-form__field"
1636
- }, [(P(!0), w(b, null, L(a.value.fields ?? [], (e) => (P(), w("option", {
1637
- key: e.key,
1638
- value: e.key
1639
- }, B(V(r)(e.label)), 9, gr))), 128))], 8, hr), [[W, e.field]]),
1640
- q(T("input", {
1641
- "onUpdate:modelValue": (t) => e.keyword = t,
1642
- type: "text",
1643
- class: "mwnf-search-form__keyword",
1644
- placeholder: V(r)("catalogue.search.keywordPlaceholder")
1645
- }, null, 8, _r), [[ne, e.keyword]])
1646
- ]))), 128)),
1647
- h.value ? (P(), w("div", vr, [O(s, {
1648
- modelValue: g.value,
1649
- "onUpdate:modelValue": n[0] ||= (e) => g.value = e,
1650
- label: V(r)("catalogue.facet.dateFrom"),
1651
- options: m.value,
1652
- "any-label": "—"
1653
- }, null, 8, [
1654
- "modelValue",
1655
- "label",
1656
- "options"
1657
- ]), O(s, {
1658
- modelValue: _.value,
1659
- "onUpdate:modelValue": n[1] ||= (e) => _.value = e,
1660
- label: V(r)("catalogue.facet.dateTo"),
1661
- options: ee.value,
1662
- "any-label": "—"
1663
- }, null, 8, [
1664
- "modelValue",
1665
- "label",
1666
- "options"
1667
- ])])) : C("", !0),
1668
- a.value.language ? (P(), w("label", yr, [T("span", br, B(V(r)("catalogue.search.language")), 1), q(T("select", {
1669
- "onUpdate:modelValue": n[2] ||= (e) => A(E) ? E.value = e : null,
1670
- class: "mwnf-facet__select mwnf-search-form__language"
1671
- }, [T("option", xr, B(V(r)("catalogue.search.anyLanguage")), 1), (P(!0), w(b, null, L(y.value, (e) => (P(), w("option", {
1672
- key: e,
1673
- value: e
1674
- }, B(e.toUpperCase()), 9, Sr))), 128))], 512), [[W, V(E)]])])) : C("", !0)
1675
- ], 64)) : o.value === "facets" ? (P(), w(b, { key: 1 }, [(P(!0), w(b, null, L(a.value.facets ?? [], (e) => (P(), S(s, {
1676
- key: e.key,
1677
- label: e.label ? V(r)(e.label) : "",
1678
- options: H.value[e.key] ?? [],
1679
- "model-value": Z[e.key],
1680
- "onUpdate:modelValue": (t) => ue(e.key, t)
1681
- }, null, 8, [
1682
- "label",
1683
- "options",
1684
- "model-value",
1685
- "onUpdate:modelValue"
1686
- ]))), 128)), h.value ? (P(), w("div", Cr, [O(s, {
1687
- "model-value": g.value,
1688
- label: V(r)("catalogue.facet.startDate"),
1689
- options: m.value,
1690
- "onUpdate:modelValue": n[3] ||= (e) => {
1691
- g.value = e, ue("from", e);
1692
- }
1693
- }, null, 8, [
1694
- "model-value",
1695
- "label",
1696
- "options"
1697
- ]), O(s, {
1698
- "model-value": _.value,
1699
- label: V(r)("catalogue.facet.endDate"),
1700
- options: ee.value,
1701
- "onUpdate:modelValue": n[4] ||= (e) => {
1702
- _.value = e, ue("to", e);
1703
- }
1704
- }, null, 8, [
1705
- "model-value",
1706
- "label",
1707
- "options"
1708
- ])])) : C("", !0)], 64)) : o.value === "radio" ? (P(!0), w(b, { key: 2 }, L(a.value.facets ?? [], (e) => (P(), w("div", {
1709
- key: e.key,
1710
- class: "mwnf-search-form__radio-row"
1711
- }, [T("label", wr, [q(T("input", {
1712
- "onUpdate:modelValue": n[5] ||= (e) => ae.value = e,
1713
- type: "radio",
1714
- name: "mwnf-search-form-filter",
1715
- value: e.key
1716
- }, null, 8, Tr), [[te, ae.value]]), D(" " + B(e.label ? V(r)(e.label) : ""), 1)]), e.type === "year" ? q((P(), w("input", {
1717
- key: 1,
1718
- "onUpdate:modelValue": (t) => Z[e.key] = t,
1719
- type: "number",
1720
- class: "mwnf-search-form__year",
1721
- disabled: ae.value !== e.key
1722
- }, null, 8, Er)), [[ne, Z[e.key]]]) : (P(), S(s, {
1723
- key: 0,
1724
- modelValue: Z[e.key],
1725
- "onUpdate:modelValue": (t) => Z[e.key] = t,
1726
- options: H.value[e.key] ?? [],
1727
- disabled: ae.value !== e.key
1728
- }, null, 8, [
1729
- "modelValue",
1730
- "onUpdate:modelValue",
1731
- "options",
1732
- "disabled"
1733
- ]))]))), 128)) : C("", !0),
1734
- (P(!0), w(b, null, L(a.value.extras ?? [], (e) => (P(), w("label", {
1735
- key: e.key,
1736
- class: "mwnf-facet mwnf-facet--checkbox"
1737
- }, [q(T("input", {
1738
- "onUpdate:modelValue": (t) => se[e.key] = t,
1739
- type: "checkbox",
1740
- class: "mwnf-facet__checkbox"
1741
- }, null, 8, Dr), [[U, se[e.key]]]), T("span", Or, B(V(r)(e.label)), 1)]))), 128)),
1742
- R(t.$slots, "extras", N(k($.value)))
1743
- ]),
1744
- _: 3
1745
- }, 8, [
1746
- "mode",
1747
- "apply-label",
1748
- "reset-label"
1749
- ]),
1750
- a.value.howTo ? (P(), w("p", kr, [O(e, { to: { name: a.value.howTo } }, {
1751
- default: K(() => [D(B(V(r)("catalogue.search.howTo")), 1)]),
1752
- _: 1
1753
- }, 8, ["to"])])) : C("", !0),
1754
- R(t.$slots, "actions", N(k($.value)))
1755
- ], 2));
1756
- }
1757
- }, jr = { class: "mwnf-timeline" }, Mr = {
1758
- key: 0,
1759
- class: "mwnf-timeline__title"
1760
- }, Nr = {
1761
- key: 3,
1762
- class: "mwnf-facet"
1763
- }, Pr = { class: "mwnf-facet__label" }, Fr = [
1764
- "value",
1765
- "placeholder",
1766
- "onInput"
1767
- ], Ir = {
1768
- key: 1,
1769
- class: "mwnf-timeline__error"
1770
- }, Lr = {
1771
- __name: "TimelineResultsView",
1772
- props: { spec: {
1773
- type: Object,
1774
- required: !0
1775
- } },
1776
- setup(n) {
1777
- let r = n, { t: i } = Te(), a = Re(), o = x(() => r.spec), l = x(() => !!o.value.entrance), f = Fe({
1778
- scope: r.spec.scope ?? "country",
1779
- countryLabel: r.spec.countryLabel,
1780
- countryIdForCode: r.spec.countryIdForCode,
1781
- tr: r.spec.tr,
1782
- timelinesEntity: r.spec.timelinesEntity,
1783
- eventsEntity: r.spec.eventsEntity
1784
- }), p = x(() => o.value.controls ?? []), m = x(() => o.value.keys ?? p.value.map((e) => e.key)), ee = (e) => p.value.some((t) => t.key === e), h = x(() => ({
1785
- t: i,
1786
- tr: r.spec.tr,
1787
- years: {
1788
- min: z.value[0],
1789
- max: z.value[1]
1790
- }
1791
- })), g = F(Object.fromEntries(m.value.map((e) => [e, ""]))), _ = I(""), v = l.value ? null : Ee({ keys: m.value }), y = l.value ? g : v.filters;
1792
- function E(e) {
1793
- if (ee("collection") && e !== "" && e != null) return e === "pc" ? null : e;
1794
- }
1795
- function A() {
1796
- for (let e of m.value) g[e] = "";
1797
- _.value = "";
1798
- }
1799
- function j() {
1800
- _.value = "";
1801
- let e = !!y.begin && !!y.end;
1802
- if (e && Number(y.begin) >= Number(y.end)) {
1803
- _.value = i(o.value.errorPeriod ?? "timeline.form.errorPeriod");
1804
- return;
1805
- }
1806
- if (!y.country && !e) {
1807
- _.value = i(o.value.errorSelect ?? "timeline.form.errorSelect");
1808
- return;
1809
- }
1810
- let t = {};
1811
- for (let e of m.value) y[e] && (t[e] = y[e]);
1812
- a.push({
1813
- name: o.value.route,
1814
- query: t
1815
- });
1816
- }
1817
- let M = x(() => {
1818
- if (l.value) return [];
1819
- let e = y;
1820
- return f.findEvents({
1821
- country: e.country || void 0,
1822
- collection: E(e.collection),
1823
- begin: e.begin,
1824
- end: e.end
1825
- });
1826
- }), z = x(() => {
1827
- let e = f.findEvents({
1828
- country: void 0,
1829
- collection: void 0
1830
- }).map((e) => e.year_from).filter((e) => Number.isFinite(e) && e !== 0);
1831
- return e.length ? [Math.min(...e), Math.max(...e)] : [null, null];
1832
- }), H = Oe(M, {
1833
- page: () => v ? v.page.value : 1,
1834
- size: () => o.value.pageSize ?? 15
1835
- });
1836
- function U(e) {
1837
- let t = o.value.countryLabel && e.country_id ? o.value.countryLabel(e.country_id) : "";
1838
- return {
1839
- id: e.id,
1840
- date: Z(e, e.text, i),
1841
- caption: t ? $(String(t)) : "",
1842
- description: e.text?.description ? he(String(e.text.description), { breaks: !0 }) : ""
1843
- };
1844
- }
1845
- let te = x(() => H.value.rows.map((e) => (o.value.event ?? U)(e, h.value))), W = x(() => (f.countries.value ?? []).map((e) => ({
1846
- value: e.value,
1847
- label: e.value === "all" ? i("timeline.form.allCountries") : e.label
1848
- }))), ne = x(() => o.value.collections?.(h.value) ?? []), G = x(() => {
1849
- let e = {};
1850
- for (let t of p.value) (t.key === "begin" || t.key === "end") && t.options && (typeof t.options == "function" ? e[t.key] = t.options(h.value) : e[t.key] = t.options);
1851
- return e;
1852
- }), q = x(() => ({
1853
- filters: y,
1854
- active: m.value.some((e) => y[e]),
1855
- apply: l.value ? j : (e) => v.apply(e),
1856
- reset: l.value ? A : v.reset,
1857
- goToPage: l.value ? () => {} : v.goToPage,
1858
- events: M.value,
1859
- pageInfo: H.value,
1860
- countries: W.value,
1861
- collections: ne.value,
1862
- t: i,
1863
- tr: o.value.tr
1864
- })), J = x(() => {
1865
- let e = o.value.gallery;
1866
- return !e || l.value ? null : !e.items || e.items(q.value);
1867
- }), re = x(() => {
1868
- let e = J.value;
1869
- return e == null ? !1 : Array.isArray(e) ? e.length > 0 : !!e;
1870
- }), ie = x(() => {
1871
- let e = J.value;
1872
- return Array.isArray(e) ? e.length : typeof e == "number" ? e : null;
1873
- }), Y = x(() => {
1874
- if (!re.value) return null;
1875
- let e = {};
1876
- for (let t of m.value) y[t] && (e[t] = y[t]);
1877
- return {
1878
- to: {
1879
- name: o.value.gallery.route,
1880
- query: e
1881
- },
1882
- count: ie.value,
1883
- label: i(o.value.gallery.label ?? "timeline.nav.seeGallery")
1884
- };
1885
- }), X = x(() => ({
1886
- ...q.value,
1887
- gallery: Y.value
1888
- })), ae = x(() => o.value.summary ? o.value.summary(X.value) : [{
1889
- label: i(o.value.summaryLabel ?? "timeline.results.eventsFound"),
1890
- count: H.value.total
1891
- }]), oe = x(() => i(o.value.empty ?? "timeline.results.noResults")), se = x(() => ({
1892
- window: 5,
1893
- jump: !1,
1894
- ends: !0,
1895
- ...o.value.pagination ?? {}
1896
- }));
1897
- function Q(e, t) {
1898
- return e.label ? i(e.label) : t ? i(t) : "";
1899
- }
1900
- return (n, r) => (P(), w("section", jr, [
1901
- R(n.$slots, "before", N(k(X.value))),
1902
- o.value.title ? (P(), w("h1", Mr, B(V(i)(o.value.title)), 1)) : C("", !0),
1903
- O(c, {
1904
- class: "mwnf-timeline__filters",
1905
- title: o.value.filterTitle ? V(i)(o.value.filterTitle) : "",
1906
- "apply-label": l.value ? V(i)(o.value.submitLabel ?? "core.action.search") : o.value.applyLabel ? V(i)(o.value.applyLabel) : "",
1907
- "reset-label": o.value.resetLabel ? V(i)(o.value.resetLabel) : "",
1908
- onApply: r[2] ||= (e) => l.value ? j() : V(v).apply(),
1909
- onReset: r[3] ||= (e) => l.value ? A() : V(v).reset()
1910
- }, {
1911
- default: K(() => [(P(!0), w(b, null, L(p.value, (e) => (P(), w(b, { key: e.key }, [e.key === "country" ? (P(), S(s, {
1912
- key: 0,
1913
- "model-value": V(y).country,
1914
- label: Q(e, "catalogue.facet.country"),
1915
- options: W.value,
1916
- placeholder: e.placeholder ? V(i)(e.placeholder) : V(i)("timeline.form.selectCountry"),
1917
- "any-label": e.anyLabel ? V(i)(e.anyLabel) : "",
1918
- "hide-empty": !!e.hideEmpty,
1919
- "onUpdate:modelValue": r[0] ||= (e) => V(y).country = e
1920
- }, null, 8, [
1921
- "model-value",
1922
- "label",
1923
- "options",
1924
- "placeholder",
1925
- "any-label",
1926
- "hide-empty"
1927
- ])) : e.key === "collection" ? (P(), S(s, {
1928
- key: 1,
1929
- "model-value": V(y).collection,
1930
- label: Q(e),
1931
- options: ne.value,
1932
- placeholder: e.placeholder ? V(i)(e.placeholder) : "",
1933
- "any-label": e.anyLabel ? V(i)(e.anyLabel) : "",
1934
- "hide-empty": !!e.hideEmpty,
1935
- "onUpdate:modelValue": r[1] ||= (e) => V(y).collection = e
1936
- }, null, 8, [
1937
- "model-value",
1938
- "label",
1939
- "options",
1940
- "placeholder",
1941
- "any-label",
1942
- "hide-empty"
1943
- ])) : (e.key === "begin" || e.key === "end") && G.value[e.key] ? (P(), S(s, {
1944
- key: 2,
1945
- "model-value": V(y)[e.key],
1946
- label: Q(e, e.key === "begin" ? "timeline.form.startDate" : "timeline.form.endDate"),
1947
- options: G.value[e.key],
1948
- placeholder: e.placeholder ? V(i)(e.placeholder) : V(i)(e.key === "begin" ? "timeline.form.fromYearHint" : "timeline.form.toYearHint"),
1949
- "any-label": e.anyLabel ? V(i)(e.anyLabel) : "",
1950
- "hide-empty": !!e.hideEmpty,
1951
- "onUpdate:modelValue": (t) => V(y)[e.key] = t
1952
- }, null, 8, [
1953
- "model-value",
1954
- "label",
1955
- "options",
1956
- "placeholder",
1957
- "any-label",
1958
- "hide-empty",
1959
- "onUpdate:modelValue"
1960
- ])) : (P(), w("label", Nr, [T("span", Pr, B(Q(e, e.key === "begin" ? "timeline.form.startDate" : "timeline.form.endDate")), 1), T("input", {
1961
- type: "number",
1962
- class: "mwnf-facet__select",
1963
- value: V(y)[e.key],
1964
- placeholder: e.placeholder ? V(i)(e.placeholder) : V(i)(e.key === "begin" ? "timeline.form.fromYearHint" : "timeline.form.toYearHint"),
1965
- onInput: (t) => V(y)[e.key] = t.target.value
1966
- }, null, 40, Fr)]))], 64))), 128))]),
1967
- _: 1
1968
- }, 8, [
1969
- "title",
1970
- "apply-label",
1971
- "reset-label"
1972
- ]),
1973
- l.value && _.value ? (P(), w("p", Ir, B(_.value), 1)) : C("", !0),
1974
- l.value ? C("", !0) : (P(), w(b, { key: 2 }, [
1975
- R(n.$slots, "summary", N(k(X.value)), () => [O(u, { parts: ae.value }, null, 8, ["parts"])]),
1976
- Y.value ? (P(), S(e, {
1977
- key: 0,
1978
- class: "mwnf-timeline__gallery",
1979
- to: Y.value.to
1980
- }, {
1981
- default: K(() => [R(n.$slots, "cross-link", N(k(X.value)), () => [D(B(Y.value.label), 1), Y.value.count == null ? C("", !0) : (P(), w(b, { key: 0 }, [D(" (" + B(Y.value.count) + ")", 1)], 64))])]),
1982
- _: 3
1983
- }, 8, ["to"])) : C("", !0),
1984
- R(n.$slots, "event", N(k(X.value)), () => [O(d, { events: te.value }, {
1985
- empty: K(() => [R(n.$slots, "empty", N(k(X.value)), () => [D(B(oe.value), 1)])]),
1986
- _: 3
1987
- }, 8, ["events"])]),
1988
- O(t, {
1989
- "page-info": V(H),
1990
- window: se.value.window,
1991
- jump: se.value.jump,
1992
- ends: se.value.ends,
1993
- onNavigate: V(v).goToPage
1994
- }, null, 8, [
1995
- "page-info",
1996
- "window",
1997
- "jump",
1998
- "ends",
1999
- "onNavigate"
2000
- ])
2001
- ], 64)),
2002
- R(n.$slots, "after", N(k(X.value)))
791
+ innerHTML: N(I)(e.note)
792
+ }, null, 8, jt)) : v("", !0)]))), 128))])) : v("", !0)])]))), 128))])) : (O(), y("div", Mt, M(s.value), 1)),
793
+ j(e.$slots, "after")
2003
794
  ]));
2004
795
  }
2005
796
  };
2006
797
  //#endregion
2007
- export { rt as CatalogueResultsView, wn as EssayView, He as HomeView, Pn as LinkListView, ar as PartnerListView, Jt as RecordSheetView, ut as RecordView, Ar as SearchFormView, dr as TextPageView, Lr as TimelineResultsView };
798
+ export { p as CatalogueResultsView, Ct as EssayView, H as HomeView, $ as LinkListView, d as PartnerListView, Je as RecordSheetView, u as RecordView, f as SearchFormView, m as TextPageView, ne as TimelineResultsView };