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