@telia-ace/knowledge-widget-components-guide 1.0.38-experimental.8 → 1.0.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,859 @@
1
+ var be = Object.defineProperty, fe = Object.defineProperties;
2
+ var ye = Object.getOwnPropertyDescriptors;
3
+ var W = Object.getOwnPropertySymbols;
4
+ var ee = Object.prototype.hasOwnProperty, te = Object.prototype.propertyIsEnumerable;
5
+ var _ = (e, t, n) => t in e ? be(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, S = (e, t) => {
6
+ for (var n in t || (t = {}))
7
+ ee.call(t, n) && _(e, n, t[n]);
8
+ if (W)
9
+ for (var n of W(t))
10
+ te.call(t, n) && _(e, n, t[n]);
11
+ return e;
12
+ }, D = (e, t) => fe(e, ye(t));
13
+ var F = (e, t) => {
14
+ var n = {};
15
+ for (var o in e)
16
+ ee.call(e, o) && t.indexOf(o) < 0 && (n[o] = e[o]);
17
+ if (e != null && W)
18
+ for (var o of W(e))
19
+ t.indexOf(o) < 0 && te.call(e, o) && (n[o] = e[o]);
20
+ return n;
21
+ };
22
+ import { css as G } from "@emotion/react";
23
+ import r from "@emotion/styled";
24
+ import { ContactList as oe, contactLink as pe } from "@telia-ace/knowledge-widget-adapters";
25
+ import { NotFound as $e, Component as Ee } from "@telia-ace/knowledge-widget-types-grid";
26
+ import { useRouteData as q, List as ke, TextLink as le, paddedBorderTabStyle as re, Feedback as we, StyledHeaderText as xe, useDispatch as se, useProperties as J, useContainer as ie, Tooltip as Le, Text as K, SymbolBadge as O, StyledListButton as T, useFavorites as ze, StyledText as ne, FavoriteButton as Se, DrawerList as ce, DrawerAnimationType as me, DropdownList as de, useChildren as Be, Lightbox as Ne, DialogLink as Ce, embeddedLinkMapper as ve, createEmptyComponent as De, Loader as Re, loadingOpacity as Fe, Paragraph as Te, genericHtml as Oe, headingElement as Ie, DialogList as We, contentBox as He, Metadata as Pe, Button as Me, linkTabStyle as je } from "@telia-ace/knowledge-widget-ui";
27
+ import { appendClassNames as H, buildCategoryTrail as Ae, createParams as Ve } from "@telia-ace/widget-utilities";
28
+ import a, { useMemo as P, useState as Ge, useEffect as qe, useCallback as V, forwardRef as Je } from "react";
29
+ import { PickerTypes as p } from "@telia-ace/knowledge-widget-core";
30
+ const Ke = ({
31
+ className: e,
32
+ defaultAnswerVersionLabel: t,
33
+ guide: { perspective: n, perspectives: o },
34
+ availablePerspectives: u = []
35
+ }) => {
36
+ const { name: c, params: l } = q(), h = P(() => !o || !u.length ? [] : u.filter(({ name: m }) => !!o[m]).map(({ name: m, title: d }) => ({ label: d, connection: o[m] })), [o, u]);
37
+ return /* @__PURE__ */ a.createElement(
38
+ Ue,
39
+ {
40
+ className: H(e, "humany-guide-answer-version-picker"),
41
+ items: h,
42
+ renderItem: (m) => {
43
+ const d = m.label === "Default" ? t : m.label, g = n === m.connection, b = g && (!l.connection || n === l.connection);
44
+ return /* @__PURE__ */ a.createElement("li", { key: m.connection, "data-version": m.connection }, /* @__PURE__ */ a.createElement(
45
+ Xe,
46
+ {
47
+ key: m.connection,
48
+ as: b ? "span" : void 0,
49
+ text: d,
50
+ routeName: c,
51
+ selected: g,
52
+ "aria-label": d,
53
+ title: d,
54
+ params: D(S({}, l), {
55
+ connection: m.connection
56
+ })
57
+ }
58
+ ));
59
+ }
60
+ }
61
+ );
62
+ }, Qe = Ke, Ue = r(ke)`
63
+ display: flex;
64
+ align-items: center;
65
+ flex-wrap: wrap;
66
+
67
+ list-style: none;
68
+ padding: 0;
69
+ margin: 0;
70
+
71
+ li:not(:last-child) {
72
+ margin: 0 calc(${(e) => {
73
+ var t;
74
+ return (t = e.theme.sizes) == null ? void 0 : t.small;
75
+ }} * 2) 0 0;
76
+ }
77
+
78
+ li > span {
79
+ cursor: default;
80
+ }
81
+ `, Xe = r(le)`
82
+ font-weight: 300;
83
+ color: ${(e) => {
84
+ var t;
85
+ return (t = e.theme.colors) == null ? void 0 : t.text;
86
+ }};
87
+ text-decoration: none;
88
+
89
+ ${(e) => e.selected && G`
90
+ font-weight: bold;
91
+ text-decoration: underline;
92
+ `}
93
+
94
+ &:focus-visible {
95
+ ${re};
96
+ }
97
+ `, Ye = r(oe)`
98
+ border-top: ${(e) => e.theme.border};
99
+ ${(e) => e.backButtonShown === "true" && `border-bottom: ${e.theme.border};`}
100
+ `, Ze = r(we)`
101
+ ${(e) => {
102
+ var t, n;
103
+ return `padding: ${(t = e.theme.sizes) == null ? void 0 : t.large} ${(n = e.theme.sizes) == null ? void 0 : n.large};`;
104
+ }}
105
+ `, _e = r(xe)`
106
+ ${(e) => {
107
+ var t, n;
108
+ return `padding: ${(t = e.theme.sizes) == null ? void 0 : t.large} ${(n = e.theme.sizes) == null ? void 0 : n.large};`;
109
+ }}
110
+
111
+ display: block;
112
+ font-size: ${(e) => {
113
+ var t;
114
+ return (t = e.theme.fonts) == null ? void 0 : t.normal;
115
+ }};
116
+ font-weight: bold;
117
+ `, et = ({ backButtonShown: e = !1, accordion: t = !1 }) => {
118
+ const n = se(), {
119
+ loading: o = !1,
120
+ dialog: u = [],
121
+ guide: c,
122
+ handoverContactMethods: l = [],
123
+ contactHeader: h,
124
+ showFeedback: m,
125
+ feedbackDirection: d = "horizontal",
126
+ feedbackRecognitionLabel: g,
127
+ feedbackGiven: b,
128
+ feedbackHeader: $,
129
+ positiveFeedbackLabel: E,
130
+ negativeFeedbackLabel: f,
131
+ contactFeedbackLabel: s
132
+ } = J();
133
+ return !m || !c || !c.allowFeedback || o && !b || u.length ? null : b && g && !l.length ? /* @__PURE__ */ a.createElement(_e, { accordion: t ? "true" : "false" }, g) : c.hasHandover && l.length ? /* @__PURE__ */ a.createElement(
134
+ Ye,
135
+ {
136
+ backButtonShown: e ? "true" : "false",
137
+ accordion: t ? "true" : "false",
138
+ header: h,
139
+ contactMethods: l,
140
+ dispatch: n
141
+ }
142
+ ) : /* @__PURE__ */ a.createElement(
143
+ Ze,
144
+ {
145
+ accordion: t ? "true" : "false",
146
+ positive: E,
147
+ negative: c.hasHandover ? s : f,
148
+ header: $,
149
+ selected: b,
150
+ onFeedback: (k) => n("feedback", k),
151
+ direction: d
152
+ }
153
+ );
154
+ }, tt = et, nt = ({
155
+ guide: { categories: e = [] },
156
+ toolbar: { picker: t = p.NONE }
157
+ }) => {
158
+ const [n, o] = Ge([]), u = ie();
159
+ return qe(() => {
160
+ Ae(
161
+ "index",
162
+ e.map((c) => c.toString()),
163
+ u
164
+ ).then((c) => {
165
+ o(c);
166
+ });
167
+ }, [e]), n.length ? /* @__PURE__ */ a.createElement(
168
+ Le,
169
+ {
170
+ className: "humany-guide-category-tooltip",
171
+ sticky: t === p.DRAWER,
172
+ content: /* @__PURE__ */ a.createElement(a.Fragment, null, n.map((c) => /* @__PURE__ */ a.createElement(
173
+ ot,
174
+ {
175
+ className: "humany-guide-category-trail",
176
+ key: c.map((l) => l.id).join(".")
177
+ },
178
+ c.map((l, h) => /* @__PURE__ */ a.createElement(
179
+ K,
180
+ {
181
+ className: "humany-guide-category-trail-segment",
182
+ key: l.id
183
+ },
184
+ l.symbol && h === 0 && /* @__PURE__ */ a.createElement(O, { size: 14, symbol: l.symbol }),
185
+ l.title,
186
+ h !== c.length - 1 && /* @__PURE__ */ a.createElement(lt, { className: "humany-category-separator" }, "/")
187
+ ))
188
+ )))
189
+ },
190
+ t === p.DRAWER ? /* @__PURE__ */ a.createElement(
191
+ T,
192
+ {
193
+ className: "humany-guide-category-tooltip-button",
194
+ "data-has-label": "false",
195
+ "data-has-symbol": "true"
196
+ },
197
+ /* @__PURE__ */ a.createElement(
198
+ ae,
199
+ {
200
+ size: 19,
201
+ symbol: { type: "Svg", content: "information" }
202
+ }
203
+ )
204
+ ) : /* @__PURE__ */ a.createElement(ae, { size: 19, symbol: { type: "Svg", content: "information" } })
205
+ ) : null;
206
+ }, at = nt, ot = r.div`
207
+ i,
208
+ svg {
209
+ margin: 0 ${(e) => {
210
+ var t;
211
+ return (t = e.theme.sizes) == null ? void 0 : t.small;
212
+ }} 0 0;
213
+ }
214
+
215
+ &:not(:last-child) {
216
+ margin: 0 0 ${(e) => {
217
+ var t;
218
+ return (t = e.theme.sizes) == null ? void 0 : t.small;
219
+ }};
220
+ }
221
+ `, lt = r(K)`
222
+ margin: 0 ${(e) => {
223
+ var t;
224
+ return (t = e.theme.sizes) == null ? void 0 : t.small;
225
+ }};
226
+ `, ae = r(O)`
227
+ display: block;
228
+ `, rt = ({
229
+ header: e,
230
+ tooltip: t,
231
+ printActionLabel: n,
232
+ copyActionLabel: o,
233
+ addFavoriteTooltip: u,
234
+ removeFavoriteCancelLabel: c,
235
+ removeFavoriteConfirmLabel: l,
236
+ removeFavoriteHeader: h,
237
+ removeFavoriteLabel: m,
238
+ removeFavoriteTooltip: d,
239
+ toolbarFunctionsCloseButtonAriaLabel: g,
240
+ allowCopy: b = !1,
241
+ allowPrint: $ = !1,
242
+ showFavoriteToggle: E = !1,
243
+ picker: f = p.NONE,
244
+ guide: s,
245
+ dispatch: k
246
+ }) => {
247
+ const [B, C] = ze(), i = V(
248
+ (y) => {
249
+ s && k("copy", s);
250
+ },
251
+ [s, k]
252
+ ), L = V(() => {
253
+ s && k("print");
254
+ }, [s, k]), z = P(() => {
255
+ const { id: y, title: R } = s, v = [];
256
+ if (b && v.push({
257
+ type: "copy",
258
+ child: /* @__PURE__ */ a.createElement(
259
+ T,
260
+ {
261
+ "data-has-label": o ? "true" : "false",
262
+ "data-has-symbol": "true",
263
+ title: o,
264
+ "aria-label": n,
265
+ onClick: i
266
+ },
267
+ /* @__PURE__ */ a.createElement(A, { size: 16, symbol: { type: "Svg", content: "copy" } }),
268
+ o && /* @__PURE__ */ a.createElement(ne, null, o)
269
+ )
270
+ }), $ && v.push({
271
+ type: "print",
272
+ child: /* @__PURE__ */ a.createElement(
273
+ T,
274
+ {
275
+ "data-has-label": n ? "true" : "false",
276
+ "data-has-symbol": "true",
277
+ title: n,
278
+ "aria-label": n,
279
+ onClick: L
280
+ },
281
+ /* @__PURE__ */ a.createElement(A, { size: 16, symbol: { type: "Svg", content: "print" } }),
282
+ n && /* @__PURE__ */ a.createElement(ne, null, n)
283
+ )
284
+ }), E) {
285
+ const I = B.indexOf(y) > -1;
286
+ v.push({
287
+ type: "favorite",
288
+ child: /* @__PURE__ */ a.createElement(
289
+ Se,
290
+ {
291
+ id: y,
292
+ guideTitle: R,
293
+ isFavorite: I,
294
+ buttonLabel: I ? d : u,
295
+ addFavoriteTooltip: u,
296
+ removeFavoriteCancelLabel: c,
297
+ removeFavoriteConfirmLabel: l,
298
+ removeFavoriteHeader: h,
299
+ removeFavoriteLabel: m,
300
+ removeFavoriteTooltip: d,
301
+ actions: C
302
+ }
303
+ )
304
+ });
305
+ }
306
+ return v;
307
+ }, [
308
+ B,
309
+ s,
310
+ b,
311
+ $,
312
+ E,
313
+ n,
314
+ o,
315
+ u,
316
+ c,
317
+ l,
318
+ h,
319
+ m,
320
+ d
321
+ ]);
322
+ if (!z.length)
323
+ return null;
324
+ const w = /* @__PURE__ */ a.createElement(
325
+ ct,
326
+ {
327
+ tabIndex: 0,
328
+ title: t,
329
+ "data-has-symbol": "true",
330
+ "data-has-label": "false"
331
+ },
332
+ /* @__PURE__ */ a.createElement(A, { symbol: { type: "Svg", content: "options" }, size: 18 })
333
+ ), N = ({ type: y, child: R }) => /* @__PURE__ */ a.createElement("li", { key: y, "data-function-type": y }, R);
334
+ return f === p.DROPDOWN ? /* @__PURE__ */ a.createElement(
335
+ it,
336
+ {
337
+ className: "humany-guide-functions-dropdown-list",
338
+ header: e,
339
+ items: z,
340
+ trigger: w,
341
+ renderItem: N,
342
+ closeButtonAriaLabel: g
343
+ }
344
+ ) : f === p.DRAWER ? /* @__PURE__ */ a.createElement(
345
+ ce,
346
+ {
347
+ className: "humany-guide-functions-drawer-list",
348
+ animation: { type: me.SlideInBottom },
349
+ header: e,
350
+ items: z,
351
+ trigger: w,
352
+ renderItem: N,
353
+ closeButtonAriaLabel: g
354
+ }
355
+ ) : null;
356
+ }, st = rt, A = r(O)`
357
+ circle {
358
+ fill: ${(e) => {
359
+ var t;
360
+ return (t = e.theme.colors) == null ? void 0 : t.text;
361
+ }};
362
+ }
363
+
364
+ line,
365
+ path,
366
+ rect {
367
+ stroke: ${(e) => {
368
+ var t;
369
+ return (t = e.theme.colors) == null ? void 0 : t.text;
370
+ }};
371
+ }
372
+ `, it = r(de)`
373
+ display: block;
374
+ min-height: auto;
375
+ `, ct = r(T)`
376
+ padding: calc(${(e) => {
377
+ var t;
378
+ return (t = e.theme.sizes) == null ? void 0 : t.small;
379
+ }} * 2) 0;
380
+ `, mt = (e, t) => {
381
+ var n;
382
+ return ((n = t.find((o) => o.id === e.id)) == null ? void 0 : n.label) || "";
383
+ }, dt = (c) => {
384
+ var l = c, {
385
+ header: e,
386
+ tooltip: t,
387
+ picker: n = p.NONE,
388
+ guide: o
389
+ } = l, u = F(l, [
390
+ "header",
391
+ "tooltip",
392
+ "picker",
393
+ "guide"
394
+ ]);
395
+ const { name: h, params: m } = q(), d = P(() => Object.keys(o.translations || {}).reduce((E, f) => {
396
+ const s = {};
397
+ return s.key = f, s.id = (o.translations || {})[f], s.label = u[`${f}LanguageLabel`], (s.id || s.label) && E.push(s), E;
398
+ }, []), [o, u]);
399
+ if (!d.length)
400
+ return null;
401
+ const g = mt(o, d), b = /* @__PURE__ */ a.createElement(
402
+ ht,
403
+ {
404
+ tabIndex: 0,
405
+ title: t,
406
+ "data-has-symbol": "true",
407
+ "data-has-label": n === p.DROPDOWN && g ? "true" : "false"
408
+ },
409
+ n === p.DROPDOWN && /* @__PURE__ */ a.createElement(a.Fragment, null, g && /* @__PURE__ */ a.createElement(bt, null, g), /* @__PURE__ */ a.createElement(
410
+ ft,
411
+ {
412
+ symbol: { type: "Svg", content: "caret-down" },
413
+ size: 11
414
+ }
415
+ )),
416
+ n === p.DRAWER && /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(gt, { symbol: { type: "Svg", content: "language" }, size: 20 }))
417
+ ), $ = ({ label: E, key: f, id: s }) => /* @__PURE__ */ a.createElement("li", { key: f, "data-language": f }, /* @__PURE__ */ a.createElement(
418
+ pt,
419
+ {
420
+ tabIndex: 0,
421
+ text: E,
422
+ routeName: h,
423
+ selected: o.id === s,
424
+ params: Ve(D(S({}, m), {
425
+ connection: void 0,
426
+ guide: s
427
+ }))
428
+ }
429
+ ));
430
+ return n === p.DROPDOWN ? /* @__PURE__ */ a.createElement(
431
+ yt,
432
+ {
433
+ className: "humany-guide-languages-dropdown-list",
434
+ header: e,
435
+ items: d,
436
+ trigger: b,
437
+ renderItem: $
438
+ }
439
+ ) : n === p.DRAWER ? /* @__PURE__ */ a.createElement(
440
+ ce,
441
+ {
442
+ className: "humany-guide-languages-drawer-list",
443
+ animation: { type: me.SlideInBottom },
444
+ header: e,
445
+ items: d,
446
+ trigger: b,
447
+ renderItem: $
448
+ }
449
+ ) : null;
450
+ }, ut = dt, ht = r(T)`
451
+ &&& {
452
+ margin: 0 ${(e) => {
453
+ var t;
454
+ return `calc(${(t = e.theme.sizes) == null ? void 0 : t.small} * 2)`;
455
+ }} 0 0;
456
+ }
457
+ `, gt = r(O)`
458
+ circle {
459
+ fill: ${(e) => {
460
+ var t;
461
+ return (t = e.theme.colors) == null ? void 0 : t.text;
462
+ }};
463
+ }
464
+
465
+ line,
466
+ path,
467
+ rect {
468
+ stroke: ${(e) => {
469
+ var t;
470
+ return (t = e.theme.colors) == null ? void 0 : t.text;
471
+ }};
472
+ }
473
+ `, bt = r(K)`
474
+ margin: 0 ${(e) => {
475
+ var t;
476
+ return (t = e.theme.sizes) == null ? void 0 : t.small;
477
+ }} 0 0;
478
+ font-size: ${(e) => {
479
+ var t;
480
+ return (t = e.theme.fonts) == null ? void 0 : t.normal;
481
+ }};
482
+ `, ft = r(O)`
483
+ align-self: flex-end;
484
+ stroke-width: 2px;
485
+ stroke-linecap: round;
486
+
487
+ && {
488
+ width: 0.6em;
489
+ height: 1em;
490
+ }
491
+ line {
492
+ stroke: ${(e) => {
493
+ var t;
494
+ return (t = e.theme.colors) == null ? void 0 : t.text;
495
+ }};
496
+ }
497
+ `, yt = r(de)`
498
+ display: block;
499
+ min-height: auto;
500
+ `, pt = r(le)`
501
+ color: ${(e) => {
502
+ var t, n;
503
+ return e.selected ? (t = e.theme.colors) == null ? void 0 : t.primary : (n = e.theme.colors) == null ? void 0 : n.text;
504
+ }};
505
+ ${(e) => e.selected && "font-weight: bold;"}
506
+
507
+ outline: none;
508
+ &:focus-visible {
509
+ ${re}
510
+ text-decoration: underline;
511
+ }
512
+ `, $t = (e) => {
513
+ const {
514
+ allowCopy: t = !1,
515
+ allowPrint: n = !1,
516
+ guideCategories: o = !1,
517
+ language: u = !1,
518
+ showFavoriteToggle: c = !1,
519
+ picker: l = p.NONE
520
+ } = e;
521
+ return !t && !n && !u && !c && !o || l === p.NONE;
522
+ }, Et = ({ className: e = "", dispatch: t }) => {
523
+ const y = J(), {
524
+ toolbarLanguageHeader: n,
525
+ toolbarFunctionsHeader: o,
526
+ toolbarLanguageTooltip: u,
527
+ toolbarFunctionsTooltip: c,
528
+ toolbarFunctionsCloseButtonAriaLabel: l,
529
+ printActionLabel: h,
530
+ copyActionLabel: m,
531
+ addFavoriteTooltip: d,
532
+ removeFavoriteCancelLabel: g,
533
+ removeFavoriteConfirmLabel: b,
534
+ removeFavoriteHeader: $,
535
+ removeFavoriteLabel: E,
536
+ removeFavoriteTooltip: f,
537
+ guide: s,
538
+ toolbar: k
539
+ } = y, B = F(y, [
540
+ "toolbarLanguageHeader",
541
+ "toolbarFunctionsHeader",
542
+ "toolbarLanguageTooltip",
543
+ "toolbarFunctionsTooltip",
544
+ "toolbarFunctionsCloseButtonAriaLabel",
545
+ "printActionLabel",
546
+ "copyActionLabel",
547
+ "addFavoriteTooltip",
548
+ "removeFavoriteCancelLabel",
549
+ "removeFavoriteConfirmLabel",
550
+ "removeFavoriteHeader",
551
+ "removeFavoriteLabel",
552
+ "removeFavoriteTooltip",
553
+ "guide",
554
+ "toolbar"
555
+ ]);
556
+ if (!s || !k || $t(k))
557
+ return null;
558
+ const { language: C, guideCategories: i, allowCopy: L, allowPrint: z, showFavoriteToggle: w, picker: N } = k;
559
+ return /* @__PURE__ */ a.createElement(wt, { className: H("humany-guide-toolbar", e) }, C && Object.keys(s.translations || {}).length > 1 && /* @__PURE__ */ a.createElement(
560
+ ut,
561
+ S({
562
+ guide: s,
563
+ header: n,
564
+ tooltip: u,
565
+ picker: N
566
+ }, B)
567
+ ), i && /* @__PURE__ */ a.createElement(at, { guide: s, toolbar: k }), (L || z || w) && /* @__PURE__ */ a.createElement(
568
+ st,
569
+ {
570
+ guide: s,
571
+ header: o,
572
+ tooltip: c,
573
+ printActionLabel: h,
574
+ copyActionLabel: m,
575
+ addFavoriteTooltip: d,
576
+ removeFavoriteCancelLabel: g,
577
+ removeFavoriteConfirmLabel: b,
578
+ removeFavoriteHeader: $,
579
+ removeFavoriteLabel: E,
580
+ removeFavoriteTooltip: f,
581
+ toolbarFunctionsCloseButtonAriaLabel: l,
582
+ allowCopy: L,
583
+ allowPrint: z,
584
+ showFavoriteToggle: w,
585
+ picker: N,
586
+ dispatch: t
587
+ }
588
+ ));
589
+ }, kt = Et, wt = r.div`
590
+ display: flex;
591
+ align-items: center;
592
+ justify-content: space-between;
593
+ margin: 0 0 0 auto;
594
+
595
+ > :not(:last-child) {
596
+ margin: 0 calc(${(e) => {
597
+ var t;
598
+ return (t = e.theme.sizes) == null ? void 0 : t.small;
599
+ }} * 2) 0 0;
600
+ }
601
+ `, Gt = Je(
602
+ (u, o) => {
603
+ var c = u, { className: e, accordion: t = !1 } = c, n = F(c, ["className", "accordion"]);
604
+ const {
605
+ loading: l = !1,
606
+ dialog: h = [],
607
+ contactMethods: m = [],
608
+ showHeader: d = !0,
609
+ showAnswerVersions: g = !1,
610
+ defaultAnswerVersionLabel: b = "Default",
611
+ backButtonLabel: $,
612
+ metadataByLabel: E,
613
+ metadataModifiedLabel: f,
614
+ metadataPublishedLabel: s,
615
+ availablePerspectives: k,
616
+ metadata: B,
617
+ toolbar: C,
618
+ guide: i,
619
+ error: L
620
+ } = J(), {
621
+ params: { connection: z }
622
+ } = q(), w = ie(), N = Be(), y = se(), R = P(() => ({
623
+ transform: {
624
+ img: (x) => /* @__PURE__ */ a.createElement(Ne, { attrs: x, htmlBody: (i == null ? void 0 : i.body) || "" }),
625
+ a: (x) => {
626
+ const Y = x, { children: he } = Y, X = F(Y, ["children"])["data-target"];
627
+ if (X && h.length) {
628
+ const Z = h.find(
629
+ ({ connection: ge }) => ge === X
630
+ );
631
+ if (Z)
632
+ return /* @__PURE__ */ a.createElement(Ce, S({}, Z), he);
633
+ }
634
+ return ve(w)(x);
635
+ }
636
+ }
637
+ }), [i, w, h]), v = V(() => {
638
+ y("back");
639
+ }, [y]);
640
+ if (!i && !L && !l)
641
+ return De(w, D(S({}, n), {
642
+ className: H(e, "humany-guide")
643
+ }));
644
+ const { id: I = "", title: Q = "", body: M = "", translations: U = {} } = i || {};
645
+ if (L && L.status === 404)
646
+ return /* @__PURE__ */ a.createElement($e, { showSearch: !1 });
647
+ const j = !!t && !!z, ue = Object.keys(U).find((x) => U[x] === `${I}`);
648
+ return /* @__PURE__ */ a.createElement(
649
+ xt,
650
+ D(S({
651
+ ref: o
652
+ }, n), {
653
+ "data-loading": l,
654
+ className: H(e, "humany-guide")
655
+ }),
656
+ /* @__PURE__ */ a.createElement(
657
+ Nt,
658
+ {
659
+ "data-loading": l,
660
+ accordion: t ? "true" : "false",
661
+ className: "humany-guide-content"
662
+ },
663
+ (g && i || !!C) && /* @__PURE__ */ a.createElement(Bt, { className: "humany-guide-top" }, g && i && /* @__PURE__ */ a.createElement(
664
+ Qe,
665
+ {
666
+ defaultAnswerVersionLabel: b,
667
+ availablePerspectives: k,
668
+ guide: i
669
+ }
670
+ ), !!C && /* @__PURE__ */ a.createElement(kt, { dispatch: y })),
671
+ !!(Q || M) && /* @__PURE__ */ a.createElement(
672
+ Lt,
673
+ {
674
+ className: "humany-guide-body",
675
+ accordion: t ? "true" : "false",
676
+ header: d && Q || void 0,
677
+ html: M,
678
+ htmlParseInstruction: R,
679
+ lang: ue
680
+ }
681
+ ),
682
+ h && M.indexOf("h-option-link") === -1 && /* @__PURE__ */ a.createElement(St, { dialog: h }),
683
+ /* @__PURE__ */ a.createElement(
684
+ zt,
685
+ {
686
+ backButtonShown: j ? "true" : "false",
687
+ contactMethods: m,
688
+ dispatch: y,
689
+ guideId: i && i.id
690
+ }
691
+ ),
692
+ !m.length && /* @__PURE__ */ a.createElement(tt, { backButtonShown: j, accordion: t }),
693
+ j && /* @__PURE__ */ a.createElement(Dt, { "aria-label": $, onClick: v }, /* @__PURE__ */ a.createElement(
694
+ Rt,
695
+ {
696
+ width: "7",
697
+ height: "13",
698
+ viewBox: "0 0 7 13",
699
+ fill: "none",
700
+ xmlns: "http://www.w3.org/2000/svg"
701
+ },
702
+ /* @__PURE__ */ a.createElement("line", { x1: "6.64645", y1: "12.5513", x2: "0.648357", y2: "6.55319" }),
703
+ /* @__PURE__ */ a.createElement("line", { x1: "0.646447", y1: "6.64455", x2: "6.64454", y2: "0.646465" })
704
+ ), $ && /* @__PURE__ */ a.createElement("span", null, $)),
705
+ B && /* @__PURE__ */ a.createElement(
706
+ Ct,
707
+ D(S({}, B), {
708
+ modified: i == null ? void 0 : i.modified,
709
+ published: i == null ? void 0 : i.published,
710
+ modifiedBy: i == null ? void 0 : i.modifiedBy,
711
+ publishedBy: i == null ? void 0 : i.publishedBy,
712
+ byLabel: E,
713
+ modifiedLabel: f,
714
+ publishedLabel: s
715
+ })
716
+ ),
717
+ N.map((x) => /* @__PURE__ */ a.createElement(
718
+ vt,
719
+ {
720
+ key: x.id,
721
+ id: x.id,
722
+ branch: "default",
723
+ embedded: !0
724
+ }
725
+ ))
726
+ ),
727
+ /* @__PURE__ */ a.createElement(Re, { loading: l })
728
+ );
729
+ }
730
+ ), xt = r.div`
731
+ ${Fe}
732
+ min-width: 0;
733
+ `, Lt = r(Te)`
734
+ ${Oe}
735
+ ${(e) => {
736
+ var t;
737
+ return `padding: ${(t = e.theme.sizes) == null ? void 0 : t.large};`;
738
+ }}
739
+ display: block;
740
+ line-height: 1.6em;
741
+
742
+ ${(e) => {
743
+ var t, n;
744
+ return Ie(e)(
745
+ "h1",
746
+ G`
747
+ font-size: ${(t = e.theme.fonts) == null ? void 0 : t.large};
748
+ font-weight: normal;
749
+ line-height: 1.6em;
750
+ line-height: 1.6em;
751
+ margin: 0 0 ${(n = e.theme.sizes) == null ? void 0 : n.small};
752
+ `
753
+ );
754
+ }}
755
+
756
+ p {
757
+ font-weight: 300;
758
+ font-size: ${(e) => {
759
+ var t;
760
+ return (t = e.theme.fonts) == null ? void 0 : t.normal;
761
+ }};
762
+ color: ${(e) => {
763
+ var t;
764
+ return (t = e.theme.colors) == null ? void 0 : t.text;
765
+ }};
766
+ a {
767
+ display: inline;
768
+ }
769
+ }
770
+ `, zt = r(oe)`
771
+ border-top: ${(e) => e.theme.border};
772
+ ${(e) => e.backButtonShown === "true" && `border-bottom: ${e.theme.border};`}
773
+ `, St = r(We)`
774
+ ${(e) => {
775
+ var t, n;
776
+ return `padding: 0 ${(t = e.theme.sizes) == null ? void 0 : t.large} ${(n = e.theme.sizes) == null ? void 0 : n.large};`;
777
+ }}
778
+ display: block;
779
+ `, Bt = r.div`
780
+ ${(e) => {
781
+ var t, n;
782
+ return `padding: calc(${(t = e.theme.sizes) == null ? void 0 : t.normal}*2) ${(n = e.theme.sizes) == null ? void 0 : n.large};`;
783
+ }}
784
+ display: flex;
785
+ justify-content: space-between;
786
+ align-items: center;
787
+ border-bottom: ${(e) => e.theme.border};
788
+ border-radius: ${(e) => `${e.theme.borderRadius} ${e.theme.borderRadius}`} 0 0;
789
+ background-color: #ffffff;
790
+ `, Nt = r.div`
791
+ ${He}
792
+ display: block;
793
+ > a {
794
+ ${pe}
795
+ }
796
+
797
+ ${(e) => e.accordion === "true" && G`
798
+ white-space: normal;
799
+ box-shadow: none;
800
+ background-color: #fafafa;
801
+ `}
802
+ `, Ct = r(Pe)`
803
+ display: block;
804
+ ${(e) => {
805
+ var t, n;
806
+ return `padding: calc(${(t = e.theme.sizes) == null ? void 0 : t.normal}*2) ${(n = e.theme.sizes) == null ? void 0 : n.large};`;
807
+ }}
808
+ font-weight: 300;
809
+ font-size: ${(e) => {
810
+ var t;
811
+ return (t = e.theme.fonts) == null ? void 0 : t.normal;
812
+ }};
813
+ color: ${(e) => {
814
+ var t;
815
+ return (t = e.theme.colors) == null ? void 0 : t.text;
816
+ }};
817
+ border-top: ${(e) => e.theme.border};
818
+ `, vt = r(Ee)`
819
+ border-top: ${(e) => e.theme.border};
820
+ `, Dt = r(Me)`
821
+ ${(e) => {
822
+ var t, n;
823
+ return `padding: ${(t = e.theme.sizes) == null ? void 0 : t.normal} calc(${(n = e.theme.sizes) == null ? void 0 : n.normal} * 2);`;
824
+ }}
825
+ color: ${(e) => {
826
+ var t;
827
+ return (t = e.theme.colors) == null ? void 0 : t.primary;
828
+ }};
829
+ text-decoration: underline;
830
+ font-size: ${(e) => {
831
+ var t;
832
+ return (t = e.theme.fonts) == null ? void 0 : t.normal;
833
+ }};
834
+ span {
835
+ font-weight: 300;
836
+ }
837
+ &:focus-visible {
838
+ ${je}
839
+ padding: ${(e) => {
840
+ var t, n;
841
+ return `calc(${(t = e.theme.sizes) == null ? void 0 : t.small} / 2) ${(n = e.theme.sizes) == null ? void 0 : n.small}`;
842
+ }};
843
+ }
844
+ `, Rt = r.svg`
845
+ margin-right: ${(e) => {
846
+ var t;
847
+ return (t = e.theme.sizes) == null ? void 0 : t.small;
848
+ }};
849
+ line {
850
+ stroke: ${(e) => {
851
+ var t;
852
+ return (t = e.theme.colors) == null ? void 0 : t.primary;
853
+ }};
854
+ }
855
+ `;
856
+ export {
857
+ Gt as default
858
+ };
859
+ //# sourceMappingURL=guide.35a46def.js.map