@telia-ace/knowledge-widget-adapters 1.0.21 → 1.0.25

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.
@@ -9,7 +9,6 @@ declare type Props = {
9
9
  action?: (action: string, value?: any) => void;
10
10
  dispatch?: DispatchAction;
11
11
  children?: ReactNode;
12
- itemRenderer?: (cm: any, props: any) => JSX.Element;
13
12
  guideId?: string;
14
13
  };
15
14
  declare const ContactList: React.SFC<Props>;
@@ -0,0 +1,51 @@
1
+ var h = Object.defineProperty, u = Object.defineProperties;
2
+ var p = Object.getOwnPropertyDescriptors;
3
+ var a = Object.getOwnPropertySymbols;
4
+ var y = Object.prototype.hasOwnProperty, E = Object.prototype.propertyIsEnumerable;
5
+ var n = (m, t, e) => t in m ? h(m, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : m[t] = e, r = (m, t) => {
6
+ for (var e in t || (t = {}))
7
+ y.call(t, e) && n(m, e, t[e]);
8
+ if (a)
9
+ for (var e of a(t))
10
+ E.call(t, e) && n(m, e, t[e]);
11
+ return m;
12
+ }, i = (m, t) => u(m, p(t));
13
+ import { Html as N, genericHtml as g, headingElement as F } from "@telia-ace/knowledge-widget-ui";
14
+ import { appendClassNames as s } from "@telia-ace/widget-utilities";
15
+ import * as l from "react";
16
+ import H, { css as $ } from "styled-components";
17
+ import { F as b } from "./index.8912b772.js";
18
+ import "@telia-ace/widget-forms";
19
+ import "@telia-ace/knowledge-widget-core";
20
+ const C = H(N)`
21
+ ${g}
22
+
23
+ ${F("h1", $`
24
+ font-weight: normal;
25
+ font-size: ${(m) => {
26
+ var t;
27
+ return (t = m.theme.fonts) == null ? void 0 : t.medium;
28
+ }};
29
+ `)}
30
+ `, S = (m) => {
31
+ const {
32
+ className: t,
33
+ renderDefault: e = () => {
34
+ },
35
+ body: { form: c },
36
+ confirmation: o,
37
+ htmlParseInstruction: f,
38
+ disabled: d
39
+ } = m;
40
+ return o ? /* @__PURE__ */ l.createElement(C, {
41
+ className: s(t, "humany-contact-method-confirmation", "humany-contact-method-email"),
42
+ html: o,
43
+ htmlParseInstruction: f
44
+ }) : c && !d ? /* @__PURE__ */ l.createElement(b, i(r({}, m), {
45
+ className: s(t, "humany-contact-method-email")
46
+ })) : e();
47
+ };
48
+ export {
49
+ S as default
50
+ };
51
+ //# sourceMappingURL=email-form-component.cb09ca59.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email-form-component.cb09ca59.js","sources":["../src/contact-methods/email/email-form-component.tsx"],"sourcesContent":["import { genericHtml, headingElement, Html } from '@telia-ace/knowledge-widget-ui';\r\nimport { appendClassNames } from '@telia-ace/widget-utilities';\r\nimport * as React from 'react';\r\nimport styled, { css } from 'styled-components';\r\nimport { ContactMethodProps, Form } from '../ui';\r\n\r\nconst StyledHtml = styled(Html)`\r\n ${genericHtml}\r\n\r\n ${headingElement(\r\n 'h1',\r\n css`\r\n font-weight: normal;\r\n font-size: ${(p) => p.theme.fonts?.medium};\r\n `\r\n )}\r\n`;\r\n\r\nconst EmailFormComponent: React.FC<ContactMethodProps> = (props) => {\r\n const {\r\n className,\r\n renderDefault = () => {},\r\n body: { form },\r\n confirmation,\r\n htmlParseInstruction,\r\n disabled,\r\n } = props;\r\n\r\n if (confirmation) {\r\n return (\r\n <StyledHtml\r\n className={appendClassNames(\r\n className,\r\n 'humany-contact-method-confirmation',\r\n 'humany-contact-method-email'\r\n )}\r\n html={confirmation}\r\n htmlParseInstruction={htmlParseInstruction}\r\n />\r\n );\r\n }\r\n\r\n if (form && !disabled) {\r\n return (\r\n <Form\r\n {...props}\r\n className={appendClassNames(className, 'humany-contact-method-email')}\r\n />\r\n );\r\n }\r\n\r\n return renderDefault();\r\n};\r\n\r\nexport default EmailFormComponent;\r\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAMA,MAAM,IAAa,EAAO,CAAI;AAAA,MACxB;AAAA;AAAA,MAEA,EACE,MACA;AAAA;AAAA,yBAEiB,CAAC,MAAM;;AAAA,gBAAE,MAAM,UAAR,kBAAe;AAAA;AAAA,SAE3C;AAAA,GAGE,IAAmD,CAAC,MAAU;AAC1D,QAAA;AAAA,IACF;AAAA,IACA,mBAAgB,MAAM;AAAA,IAAC;AAAA,IACvB,MAAM,EAAE;AAAA,IACR;AAAA,IACA;AAAA,IACA;AAAA,MACA;AAEJ,SAAI,IAEK,kBAAA,cAAA,GAAA;AAAA,IACG,WAAW,EACP,GACA,sCACA,6BACJ;AAAA,IACA,MAAM;AAAA,IACN;AAAA,EAAA,CACJ,IAIJ,KAAQ,CAAC,IAEJ,kBAAA,cAAA,GAAA,QACO,IADP;AAAA,IAEG,WAAW,EAAiB,GAAW,6BAA6B;AAAA,EAAA,EACxE,IAID,EAAc;AACzB;"}
@@ -0,0 +1,27 @@
1
+ import { Html as a, genericHtml as l } from "@telia-ace/knowledge-widget-ui";
2
+ import { appendClassNames as n } from "@telia-ace/widget-utilities";
3
+ import * as t from "react";
4
+ import p from "styled-components";
5
+ import { D as c } from "./index.8912b772.js";
6
+ import "@telia-ace/widget-forms";
7
+ import "@telia-ace/knowledge-widget-core";
8
+ const E = ({
9
+ className: o,
10
+ description: e,
11
+ body: { freetext: m },
12
+ htmlParseInstruction: r
13
+ }) => m ? /* @__PURE__ */ t.createElement("div", {
14
+ className: n(o, "humany-contact-method-free-text")
15
+ }, /* @__PURE__ */ t.createElement(i, {
16
+ html: m,
17
+ htmlParseInstruction: r
18
+ }), e && /* @__PURE__ */ t.createElement(c, {
19
+ html: e,
20
+ htmlParseInstruction: r
21
+ })) : null, i = p(a)`
22
+ ${l};
23
+ `;
24
+ export {
25
+ E as default
26
+ };
27
+ //# sourceMappingURL=free-text-component.a78d324f.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"free-text-component.a78d324f.js","sources":["../src/contact-methods/free-text/free-text-component.tsx"],"sourcesContent":["import { genericHtml, Html } from '@telia-ace/knowledge-widget-ui';\r\nimport { appendClassNames } from '@telia-ace/widget-utilities';\r\nimport * as React from 'react';\r\nimport styled from 'styled-components';\r\nimport { ContactMethodProps, Description } from '../ui';\r\n\r\nconst FreeTextComponent: React.SFC<ContactMethodProps> = ({\r\n className,\r\n description,\r\n body: { freetext },\r\n htmlParseInstruction,\r\n}) => {\r\n if (!freetext) {\r\n return null;\r\n }\r\n return (\r\n <div className={appendClassNames(className, 'humany-contact-method-free-text')}>\r\n <StyledHtml html={freetext} htmlParseInstruction={htmlParseInstruction} />\r\n {description && (\r\n <Description html={description} htmlParseInstruction={htmlParseInstruction} />\r\n )}\r\n </div>\r\n );\r\n};\r\n\r\nexport default FreeTextComponent;\r\n\r\nconst StyledHtml = styled(Html)`\r\n ${genericHtml};\r\n`;\r\n"],"names":[],"mappings":";;;;;;;AAMA,MAAM,IAAmD,CAAC;AAAA,EACtD;AAAA,EACA;AAAA,EACA,MAAM,EAAE;AAAA,EACR;AAAA,MAEK,IAIA,kBAAA,cAAA,OAAA;AAAA,EAAI,WAAW,EAAiB,GAAW,iCAAiC;AAAA,GACxE,kBAAA,cAAA,GAAA;AAAA,EAAW,MAAM;AAAA,EAAU;AAA4C,CAAA,GACvE,KACI,kBAAA,cAAA,GAAA;AAAA,EAAY,MAAM;AAAA,EAAa;AAA4C,CAAA,CAEpF,IARO,MAcT,IAAa,EAAO,CAAI;AAAA,MACxB;AAAA;"}
@@ -0,0 +1,559 @@
1
+ var _ = Object.defineProperty, J = Object.defineProperties;
2
+ var Q = Object.getOwnPropertyDescriptors;
3
+ var P = Object.getOwnPropertySymbols;
4
+ var R = Object.prototype.hasOwnProperty, V = Object.prototype.propertyIsEnumerable;
5
+ var A = (t, e, n) => e in t ? _(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, h = (t, e) => {
6
+ for (var n in e || (e = {}))
7
+ R.call(e, n) && A(t, n, e[n]);
8
+ if (P)
9
+ for (var n of P(e))
10
+ V.call(e, n) && A(t, n, e[n]);
11
+ return t;
12
+ }, g = (t, e) => J(t, Q(e));
13
+ var C = (t, e) => {
14
+ var n = {};
15
+ for (var o in t)
16
+ R.call(t, o) && e.indexOf(o) < 0 && (n[o] = t[o]);
17
+ if (t != null && P)
18
+ for (var o of P(t))
19
+ e.indexOf(o) < 0 && V.call(t, o) && (n[o] = t[o]);
20
+ return n;
21
+ };
22
+ var y = (t, e, n) => new Promise((o, a) => {
23
+ var c = (s) => {
24
+ try {
25
+ i(n.next(s));
26
+ } catch (l) {
27
+ a(l);
28
+ }
29
+ }, r = (s) => {
30
+ try {
31
+ i(n.throw(s));
32
+ } catch (l) {
33
+ a(l);
34
+ }
35
+ }, i = (s) => s.done ? o(s.value) : Promise.resolve(s.value).then(c, r);
36
+ i((n = n.apply(t, e)).next());
37
+ });
38
+ import { FormReader as S, FormBuilder as X, FormComponent as Y } from "@telia-ace/widget-forms";
39
+ import { ComponentPlatform as D, Plugin as Z } from "@telia-ace/knowledge-widget-core";
40
+ import { lock as ee, createParams as te, formatUrl as ne, appendClassNames as oe } from "@telia-ace/widget-utilities";
41
+ import m, { lazy as ae, Suspense as ie, useState as re, useEffect as se } from "react";
42
+ import { Paragraph as ce, headingElement as z, Html as le, genericHtml as de, borderTabStyle as j, linkTabStyle as me, StyledText as ue, Link as he, useComponent as pe, useRouteData as fe, Typography as ge, SymbolBadge as ye, itemList as be, ItemList as ve, useContainer as Ce } from "@telia-ace/knowledge-widget-ui";
43
+ import b, { css as N } from "styled-components";
44
+ const I = (t, e, n = !1) => t.getManyAsync("matchingClient", "router").then((o) => {
45
+ const { formData: a } = new S(e.body.form).export(n), { router: c, matchingClient: r } = o, { params: i } = c.getRouteData();
46
+ return r.customRequest(`contactmethods/${e.id}${n ? "/validatedwithpayload" : ""}`, "POST", {
47
+ body: a,
48
+ configuration: {
49
+ guideId: e.body.guideId || i.guideId
50
+ }
51
+ });
52
+ }), O = (t, e, n) => I(t, e).then((o) => n ? n(o) : o).then(({ ConfirmationText: o }) => o), k = (t, e) => I(t, e, !0).then((n) => ({
53
+ valid: n.Validation.IsValid,
54
+ errors: n.Validation.Errors,
55
+ errorTypes: n.Validation.ErrorTypes
56
+ })), H = (t, e) => I(t, e, !0).then((n) => X.fromLegacyForm(e.id, n.ContactMethod.Form).get()), $ = (t, e) => t.getAsync("matchingClient").then((n) => {
57
+ n.completeContactMethod(e.id);
58
+ });
59
+ function ke(t) {
60
+ t.getAsync("contactMethods").then((e) => {
61
+ e.create({
62
+ clientName: "email.form",
63
+ render: import("./email-form-component.cb09ca59.js"),
64
+ onEvaluate: (n) => H(t, n),
65
+ onValidate: (n) => k(t, n),
66
+ onSubmit: (n) => O(t, n),
67
+ onComplete: (n) => $(t, n)
68
+ });
69
+ });
70
+ }
71
+ const L = (t, e, n) => {
72
+ const { url: o, width: a, height: c } = e, r = n || {}, i = document.createElement("a");
73
+ return i.href = o, i.search.replace("?", "").split("&").forEach((s) => {
74
+ const [l, d] = s.split("=");
75
+ typeof d != "undefined" && (r[l] = d);
76
+ }), i.search = Object.keys(r).map((s) => `${s}=${r[s]}`).join("&"), window.open(i.href, t, `width=${a},height=${c}`), "";
77
+ };
78
+ function $e(t) {
79
+ t.getAsync("contactMethods").then((e) => {
80
+ e.create({
81
+ clientName: "chat.popup",
82
+ render: "email.form",
83
+ handleClick: (n) => {
84
+ const { title: o, body: a } = n, l = a, { form: c, guideId: r, confirmationFallback: i } = l, s = C(l, ["form", "guideId", "confirmationFallback"]);
85
+ return c ? () => {
86
+ } : (d) => {
87
+ d.preventDefault(), L(o, s);
88
+ };
89
+ },
90
+ onValidate: (n) => k(t, n),
91
+ onComplete: (n) => $(t, n),
92
+ onSubmit: (n) => {
93
+ const { title: o, body: a } = n, d = a, { form: c, guideId: r, confirmationFallback: i } = d, s = C(d, ["form", "guideId", "confirmationFallback"]), l = new S(c).export().values;
94
+ return L(o, s, l), i;
95
+ }
96
+ });
97
+ });
98
+ }
99
+ function we(t) {
100
+ t.getAsync("contactMethods").then((e) => {
101
+ e.create({
102
+ clientName: "custom.freetext",
103
+ render: import("./free-text-component.a78d324f.js")
104
+ });
105
+ });
106
+ }
107
+ function Pe(t) {
108
+ t.getAsync("contactMethods").then((e) => {
109
+ e.create({
110
+ clientName: "custom.link",
111
+ render: import("./link-component.484bbcf2.js")
112
+ });
113
+ });
114
+ }
115
+ function Ee(t) {
116
+ t.getAsync("contactMethods").then((e) => {
117
+ e.create({
118
+ clientName: "phone.text",
119
+ render: import("./phone-component.0c878514.js")
120
+ });
121
+ });
122
+ }
123
+ const E = (t, e) => y(void 0, null, function* () {
124
+ const n = t.get(e.clientName);
125
+ let { description: o, disabled: a, onClick: c } = e;
126
+ if (n) {
127
+ const { handleClick: r, handleDescription: i, handleDisabled: s } = n;
128
+ typeof r == "function" && (c = yield Promise.resolve(r(e))), typeof i == "function" && (o = yield Promise.resolve(i(e))), typeof s == "function" && (a = yield Promise.resolve(s(e)));
129
+ }
130
+ return Promise.resolve(g(h({}, e), {
131
+ description: o,
132
+ disabled: a,
133
+ onClick: c
134
+ }));
135
+ });
136
+ class x {
137
+ constructor(e, n) {
138
+ if (this.container = e, this.componentPlatform = n, this.adapters = /* @__PURE__ */ new Map(), this.subs = [], n) {
139
+ n.components().ofType("contact-list").select().actions.watch("contact-list.fetched", (r, i) => y(this, null, function* () {
140
+ const { contactMethods: s } = r;
141
+ if (s) {
142
+ const l = Promise.all(s.map((d) => E(this.adapters, d)));
143
+ yield Promise.resolve(l).then((d) => {
144
+ r.contactMethods = d;
145
+ });
146
+ }
147
+ return i(r);
148
+ }));
149
+ const a = n.components().ofType("guide").select();
150
+ a.actions.watch("guide.fetched", (r, i) => y(this, null, function* () {
151
+ const { contactMethods: s } = r;
152
+ if (s) {
153
+ const l = Promise.all(s.map((d) => E(this.adapters, d)));
154
+ yield Promise.resolve(l).then((d) => {
155
+ r.contactMethods = d;
156
+ });
157
+ }
158
+ return i(r);
159
+ })), a.actions.watch("guide.handover", (r, i) => y(this, null, function* () {
160
+ const { handoverContactMethods: s } = r;
161
+ if (s) {
162
+ const l = Promise.all(s.map((d) => E(this.adapters, d)));
163
+ yield Promise.resolve(l).then((d) => {
164
+ r.handoverContactMethods = d;
165
+ });
166
+ }
167
+ return i(r);
168
+ })), n.components().ofType("contact-method").select().actions.watch("contact-method.fetched", (r, i) => y(this, null, function* () {
169
+ const { contactMethod: s } = r;
170
+ return s ? E(this.adapters, s).then((l) => i(g(h({}, r), { contactMethod: l }))) : i(r);
171
+ }));
172
+ }
173
+ }
174
+ static create(e) {
175
+ return D.getInstance(e).then((n) => new x(e, n));
176
+ }
177
+ static getInstance(e, n = "contactMethods") {
178
+ return ee(e)(() => e.getAsync(n).then((o) => {
179
+ let a = o;
180
+ return a || D.getInstance(e).then((c) => (a = new x(e, c), e.registerAsync(n, () => a), a));
181
+ }));
182
+ }
183
+ track(e = {}, n) {
184
+ const { events: o } = this.container.get("$widget");
185
+ o.dispatch("tracking:service-client-response", {
186
+ type: n,
187
+ data: e
188
+ });
189
+ }
190
+ complete(e) {
191
+ const { id: n, title: o, clientName: a, expanded: c, body: r } = e;
192
+ this.track({ contactMethod: { id: n, title: o, expanded: c, type: a }, hasGuide: !!r.guideId }, "contact-method-complete");
193
+ const i = this.adapters.get(a);
194
+ if (i && i.onComplete)
195
+ return i.onComplete(e);
196
+ }
197
+ evaluate(e) {
198
+ const { clientName: n } = e, o = this.adapters.get(n);
199
+ return o && o.onEvaluate ? Promise.resolve(o.onEvaluate(e)) : Promise.resolve(e.body.form);
200
+ }
201
+ validate(e) {
202
+ const { id: n, title: o, clientName: a } = e, c = this.adapters.get(a);
203
+ return c && c.onValidate ? Promise.resolve(c.onValidate(e)).then((r) => {
204
+ this.track({ contactMethod: { id: n, title: o, type: a }, isValid: r.valid }, "contact-method-validate");
205
+ const { events: i } = this.container.get("$widget");
206
+ return i.dispatch("form:validated", { isValid: r.valid }), r;
207
+ }) : Promise.resolve({ valid: !0 });
208
+ }
209
+ submit(e) {
210
+ const { clientName: n } = e, o = this.adapters.get(n);
211
+ return o && o.onSubmit ? Promise.resolve(o.onSubmit(e)).then((a) => (this.complete(e), a)) : Promise.resolve("");
212
+ }
213
+ create(e) {
214
+ const { clientName: n, render: o } = e;
215
+ return this.adapters.set(n, h({
216
+ onValidate: (a) => k(this.container, a),
217
+ onEvaluate: (a) => H(this.container, a),
218
+ onComplete: (a) => $(this.container, a)
219
+ }, e)), this.container.getAsync("componentResolver").then((a) => {
220
+ typeof o == "string" ? this.subs.push(a.registerAlias(n, o)) : this.subs.push(a.registerComponent(n, ae(() => o)));
221
+ });
222
+ }
223
+ dispose() {
224
+ this.subs.forEach((e) => e());
225
+ }
226
+ }
227
+ b(ce)`
228
+ ${z("h1", N`
229
+ font-weight: normal;
230
+ font-size: ${(t) => {
231
+ var e;
232
+ return (e = t.theme.fonts) == null ? void 0 : e.medium;
233
+ }};
234
+ `)}
235
+ `;
236
+ const Ne = b(le)`
237
+ ${de}
238
+ font-weight: 300;
239
+ line-height: 1.5em;
240
+ button:focus {
241
+ ${(t) => {
242
+ var e;
243
+ return ((e = t.theme.accessibility) == null ? void 0 : e.isTabbing) && j;
244
+ }};
245
+ }
246
+
247
+ a:focus {
248
+ ${(t) => {
249
+ var e;
250
+ return ((e = t.theme.accessibility) == null ? void 0 : e.isTabbing) && me;
251
+ }};
252
+ }
253
+ `, xe = (t) => {
254
+ const e = pe(t.clientName), {
255
+ params: { contactCategory: n, guideCategory: o, phrase: a }
256
+ } = fe();
257
+ if (typeof e == "undefined")
258
+ return null;
259
+ if (e === null)
260
+ return process.env.NODE_ENV !== "production" ? /* @__PURE__ */ m.createElement(Me, {
261
+ title: `client-name: ${t.clientName}, id: ${t.id}`,
262
+ className: "humany-non-resolved-contact-method"
263
+ }, /* @__PURE__ */ m.createElement(ge, {
264
+ variant: "h5"
265
+ }, "Non resolved Contact Method type")) : null;
266
+ const c = (r = {}) => {
267
+ const i = h(h({}, t), r), {
268
+ id: s,
269
+ title: l,
270
+ clientName: d,
271
+ symbol: u,
272
+ inline: v,
273
+ onClick: f = () => {
274
+ },
275
+ description: w,
276
+ htmlParseInstruction: B,
277
+ className: K,
278
+ disabled: G,
279
+ guideId: U,
280
+ dispatch: M = () => {
281
+ },
282
+ expanded: T
283
+ } = i, W = v ? {
284
+ onKeyDown: (p) => {
285
+ p.key && p.key === "Enter" && (f(p, i), p.defaultPrevented || !T && M("expand", s));
286
+ },
287
+ onClick: (p) => {
288
+ f(p, i), p.defaultPrevented || !T && M("expand", s);
289
+ }
290
+ } : {
291
+ onClick: (p) => f(p, i),
292
+ routeName: "contact-method",
293
+ params: te({
294
+ contactCategory: n,
295
+ guideId: U,
296
+ guideCategory: o,
297
+ phrase: a,
298
+ contactMethod: s,
299
+ uriName: ne(l)
300
+ })
301
+ };
302
+ return /* @__PURE__ */ m.createElement(Ie, h(h({
303
+ title: l,
304
+ "aria-label": l,
305
+ className: K,
306
+ disabled: G,
307
+ description: w,
308
+ "data-client-name": d
309
+ }, r), W), u && /* @__PURE__ */ m.createElement(ye, {
310
+ symbol: u
311
+ }), w ? /* @__PURE__ */ m.createElement("div", {
312
+ className: "humany-contact-link-rich-content"
313
+ }, /* @__PURE__ */ m.createElement(F, null, l), /* @__PURE__ */ m.createElement(Ne, {
314
+ html: w,
315
+ htmlParseInstruction: B
316
+ })) : /* @__PURE__ */ m.createElement(F, null, l));
317
+ };
318
+ return t.expanded ? /* @__PURE__ */ m.createElement(ie, {
319
+ fallback: null
320
+ }, /* @__PURE__ */ m.createElement(e, g(h({}, t), {
321
+ renderDefault: c
322
+ }))) : c();
323
+ }, Se = N`
324
+ display: flex;
325
+ padding: ${(t) => {
326
+ var e;
327
+ return (e = t.theme.sizes) == null ? void 0 : e.large;
328
+ }};
329
+ ${(t) => t.description ? "" : "align-items: center;"}
330
+ text-decoration: none;
331
+ span {
332
+ display: inline-block;
333
+ color: ${(t) => {
334
+ var e;
335
+ return (e = t.theme.colors) == null ? void 0 : e.text;
336
+ }};
337
+ }
338
+ i {
339
+ font-size: 30px;
340
+ margin: 0 ${(t) => {
341
+ var e;
342
+ return (e = t.theme.sizes) == null ? void 0 : e.large;
343
+ }} 0 0;
344
+ min-height: 30px;
345
+ min-width: 30px;
346
+ line-height: 30px;
347
+ display: inline-block;
348
+ vertical-align: bottom;
349
+ color: ${(t) => {
350
+ var e;
351
+ return (e = t.theme.colors) == null ? void 0 : e.text;
352
+ }};
353
+ }
354
+ `, F = b(ue)`
355
+ line-height: 30px;
356
+ `, Ie = b(he)`
357
+ ${Se}
358
+
359
+ &:focus {
360
+ ${(t) => {
361
+ var e;
362
+ return ((e = t.theme.accessibility) == null ? void 0 : e.isTabbing) && j;
363
+ }};
364
+ }
365
+ `, Me = b.div`
366
+ text-align: center;
367
+ display: block;
368
+ ${(t) => {
369
+ var e, n;
370
+ return typeof ((e = t.theme.colors) == null ? void 0 : e.warning) != "undefined" && `color: ${(n = t.theme.colors) == null ? void 0 : n.warning};`;
371
+ }}
372
+ `, Te = N`
373
+ ${be}
374
+
375
+ > div {
376
+ padding: ${(t) => {
377
+ var e;
378
+ return (e = t.theme.sizes) == null ? void 0 : e.large;
379
+ }};
380
+
381
+ ${z("h1", N`
382
+ margin: 0;
383
+ `)}
384
+ }
385
+ > ul {
386
+ &:not(:first-child) {
387
+ border-top: ${(t) => t.theme.border};
388
+ }
389
+
390
+ > li {
391
+ margin: 0;
392
+ white-space: normal;
393
+
394
+ > a {
395
+ overflow: hidden;
396
+ }
397
+
398
+ &:first-child > a {
399
+ border-radius: ${(t) => `${t.theme.borderRadius} ${t.theme.borderRadius} 0 0`};
400
+ }
401
+
402
+ &:last-child:not(:first-child) > a {
403
+ border-radius: ${(t) => `0 0 ${t.theme.borderRadius} ${t.theme.borderRadius}`};
404
+ }
405
+
406
+ &:not(:last-child) {
407
+ border-bottom: ${(t) => t.theme.border};
408
+ }
409
+
410
+ > div {
411
+ padding: ${(t) => {
412
+ var e;
413
+ return (e = t.theme.sizes) == null ? void 0 : e.large;
414
+ }};
415
+ }
416
+ }
417
+ }
418
+
419
+ @media (hover: hover) {
420
+ a:hover {
421
+ background-color: ${(t) => {
422
+ var e;
423
+ return (e = t.theme.colors) == null ? void 0 : e.accent;
424
+ }};
425
+ }
426
+ }
427
+ `, Ae = b(ve)`
428
+ ${Te}
429
+ `, He = ({
430
+ contactMethods: t,
431
+ children: e,
432
+ guideId: n,
433
+ dispatch: o,
434
+ className: a = "",
435
+ action: c = () => {
436
+ },
437
+ header: r = ""
438
+ }) => t.length ? /* @__PURE__ */ m.createElement(Ae, {
439
+ header: r,
440
+ className: oe(a, "humany-contact-list"),
441
+ items: t,
442
+ renderItem: (i) => /* @__PURE__ */ m.createElement("li", {
443
+ key: i.id,
444
+ "data-contact-method": i.id
445
+ }, /* @__PURE__ */ m.createElement(xe, g(h({}, i), {
446
+ action: c,
447
+ dispatch: o,
448
+ guideId: n
449
+ })))
450
+ }, e) : null, q = (t, e) => {
451
+ if (t.actionKey === e)
452
+ return t;
453
+ if (!t.properties)
454
+ return null;
455
+ const n = Object.keys(t.properties);
456
+ let o;
457
+ for (let a = 0; a < n.length; a++)
458
+ if (o = q(t.properties[n[a]], e), o)
459
+ return o;
460
+ return !1;
461
+ }, qe = ({
462
+ className: t,
463
+ body: { form: e },
464
+ id: n,
465
+ action: o,
466
+ dispatch: a,
467
+ disabled: c,
468
+ autoFocus: r
469
+ }) => {
470
+ if (e && !c) {
471
+ const { schema: i, layout: s, data: l } = e, d = a || o || (() => {
472
+ });
473
+ return /* @__PURE__ */ m.createElement(Y, {
474
+ className: t,
475
+ schema: i,
476
+ layout: s,
477
+ data: l,
478
+ autoFocus: r,
479
+ onChange: (u, v) => {
480
+ const f = { schema: i, layout: s, data: v };
481
+ u.toString() === "submit" ? d("submit", { id: n, form: f }) : q(i, u).evaluate ? d("evaluate", { id: n, form: f }) : d("validate", { id: n, form: f });
482
+ }
483
+ });
484
+ }
485
+ return null;
486
+ }, Be = (t) => {
487
+ const [e, n] = re(null), o = Ce();
488
+ return se(() => {
489
+ let a;
490
+ return o.getAsync("componentResolver").then((c) => {
491
+ a = c.registerResolver(t, (r) => n(r));
492
+ }), () => {
493
+ a && a();
494
+ };
495
+ }, [t]), e;
496
+ };
497
+ function Re(t) {
498
+ t.getAsync("contactMethods").then((e) => {
499
+ e.create({
500
+ clientName: "custom.webservice",
501
+ render: "email.form",
502
+ onValidate: (n) => k(t, n),
503
+ onComplete: (n) => $(t, n),
504
+ onSubmit: (n) => O(t, n, (o) => g(h({}, o), {
505
+ ConfirmationText: o.ResponseHtml
506
+ }))
507
+ });
508
+ });
509
+ }
510
+ const Ke = (t, e, n) => t.getAsync("contactMethods").then((o) => {
511
+ o.create({
512
+ clientName: e,
513
+ render: "email.form",
514
+ handleClick: () => (a, c) => {
515
+ const {
516
+ body: d
517
+ } = c, u = d, { form: r, guideId: i, confirmationFallback: s } = u, l = C(u, ["form", "guideId", "confirmationFallback"]);
518
+ r || (a.preventDefault(), n(l));
519
+ },
520
+ onValidate: (a) => k(t, a),
521
+ onComplete: (a) => $(t, a),
522
+ onSubmit: (a) => {
523
+ const {
524
+ body: d
525
+ } = a, u = d, { form: c, guideId: r, confirmationFallback: i } = u, s = C(u, ["form", "guideId", "confirmationFallback"]), { values: l } = new S(c).export();
526
+ return Promise.resolve(n(s, l)).then((v) => v || i);
527
+ }
528
+ });
529
+ });
530
+ class Ge extends Z {
531
+ constructor(e, n) {
532
+ super(e, n), this.widget.implementation.configure((a) => {
533
+ a.plugin(ke).plugin($e).plugin(we).plugin(Ee).plugin(Re).plugin(Pe);
534
+ });
535
+ }
536
+ }
537
+ export {
538
+ He as C,
539
+ Ne as D,
540
+ qe as F,
541
+ Te as a,
542
+ Se as b,
543
+ $e as c,
544
+ xe as d,
545
+ x as e,
546
+ $ as f,
547
+ H as g,
548
+ ke as h,
549
+ we as i,
550
+ Ke as j,
551
+ Ge as k,
552
+ Pe as l,
553
+ Ee as p,
554
+ O as s,
555
+ Be as u,
556
+ k as v,
557
+ Re as w
558
+ };
559
+ //# sourceMappingURL=index.8912b772.js.map