@telia-ace/knowledge-widget-types-grid 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.
- package/dist/index.a2cdbc37.js +15 -0
- package/dist/index.a2cdbc37.js.map +1 -0
- package/dist/index.js +366 -575
- package/dist/index.js.map +1 -1
- package/package.json +12 -8
- package/dist/index2.js +0 -6
- package/dist/index2.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,173 +1,114 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
var j = Object.defineProperty, Y = Object.defineProperties;
|
|
2
|
+
var z = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var P = Object.getOwnPropertySymbols;
|
|
4
|
+
var J = Object.prototype.hasOwnProperty, X = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var H = (i, e, t) => e in i ? j(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, F = (i, e) => {
|
|
6
|
+
for (var t in e || (e = {}))
|
|
7
|
+
J.call(e, t) && H(i, t, e[t]);
|
|
8
|
+
if (P)
|
|
9
|
+
for (var t of P(e))
|
|
10
|
+
X.call(e, t) && H(i, t, e[t]);
|
|
11
|
+
return i;
|
|
12
|
+
}, Q = (i, e) => Y(i, z(e));
|
|
13
|
+
var E = (i, e, t) => new Promise((n, s) => {
|
|
14
|
+
var a = (d) => {
|
|
15
|
+
try {
|
|
16
|
+
o(t.next(d));
|
|
17
|
+
} catch (h) {
|
|
18
|
+
s(h);
|
|
16
19
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
var fulfilled = (value) => {
|
|
23
|
-
try {
|
|
24
|
-
step(generator.next(value));
|
|
25
|
-
} catch (e) {
|
|
26
|
-
reject(e);
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
var rejected = (value) => {
|
|
30
|
-
try {
|
|
31
|
-
step(generator.throw(value));
|
|
32
|
-
} catch (e) {
|
|
33
|
-
reject(e);
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
37
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
import { Widget } from "@telia-ace/widget-types-grid";
|
|
41
|
-
export { Component, DetachedComponent, NotFound, genericComponentStyling } from "@telia-ace/widget-types-grid";
|
|
42
|
-
import { DialogItemType, WidgetRenderState } from "@telia-ace/knowledge-widget-core";
|
|
43
|
-
import { removeNullAndUndefinedValues, shallowCompare, deepClone } from "@telia-ace/widget-utilities";
|
|
44
|
-
import { FormBuilder } from "@telia-ace/widget-forms";
|
|
45
|
-
const convertLegacySymbol = (symbol) => {
|
|
46
|
-
if (symbol) {
|
|
47
|
-
const { Type, Content } = symbol;
|
|
48
|
-
if (Type && Content) {
|
|
49
|
-
return { type: Type, content: Content };
|
|
20
|
+
}, c = (d) => {
|
|
21
|
+
try {
|
|
22
|
+
o(t.throw(d));
|
|
23
|
+
} catch (h) {
|
|
24
|
+
s(h);
|
|
50
25
|
}
|
|
26
|
+
}, o = (d) => d.done ? n(d.value) : Promise.resolve(d.value).then(a, c);
|
|
27
|
+
o((t = t.apply(i, e)).next());
|
|
28
|
+
});
|
|
29
|
+
import { Widget as Z } from "@telia-ace/widget-types-grid";
|
|
30
|
+
import { Component as Ct, DetachedComponent as bt, NotFound as yt, genericComponentStyling as Nt } from "@telia-ace/widget-types-grid";
|
|
31
|
+
import { DialogItemType as R, WidgetRenderState as O } from "@telia-ace/knowledge-widget-core";
|
|
32
|
+
import { removeNullAndUndefinedValues as tt, shallowCompare as S, deepClone as et } from "@telia-ace/widget-utilities";
|
|
33
|
+
import { FormBuilder as _ } from "@telia-ace/widget-forms";
|
|
34
|
+
const v = (i) => {
|
|
35
|
+
if (i) {
|
|
36
|
+
const { Type: e, Content: t } = i;
|
|
37
|
+
if (e && t)
|
|
38
|
+
return { type: e, content: t };
|
|
51
39
|
}
|
|
52
|
-
}
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
ConfirmationText,
|
|
100
|
-
ExpandFormAutomatically,
|
|
101
|
-
Form,
|
|
102
|
-
Description
|
|
103
|
-
}, Validation) => {
|
|
104
|
-
const { Adapter } = Exit || { Adapter: {} };
|
|
105
|
-
const { ClientName = "", Settings = {}, CustomClientName = "" } = Adapter;
|
|
106
|
-
const settings = {
|
|
107
|
-
id: Id.toString(),
|
|
108
|
-
title: Title,
|
|
109
|
-
description: Description,
|
|
110
|
-
symbol: convertLegacySymbol(DefaultIcon),
|
|
111
|
-
clientName: ClientName === "custom.adapter" ? CustomClientName : ClientName,
|
|
112
|
-
expanded: true,
|
|
113
|
-
inline: true,
|
|
40
|
+
}, D = (i) => i.map((e) => {
|
|
41
|
+
const t = {
|
|
42
|
+
id: e.Id.toString(),
|
|
43
|
+
title: e.Name,
|
|
44
|
+
symbol: v(e.DefaultIcon),
|
|
45
|
+
activeSymbol: e.ActiveIcon && v(e.ActiveIcon),
|
|
46
|
+
description: e.Description || e.Attributes && e.Attributes.description || "",
|
|
47
|
+
matches: e.GuidesCount
|
|
48
|
+
};
|
|
49
|
+
return e.Children && e.Children.length && (t.items = D(e.Children)), t;
|
|
50
|
+
}), y = (i, e) => i.filter(({ Type: t }) => t === e).map(({ Id: t, Title: n, Body: s }) => ({
|
|
51
|
+
id: t.toString(),
|
|
52
|
+
title: n,
|
|
53
|
+
body: s
|
|
54
|
+
})), G = (i) => i.map(({ Id: e, Title: t, DefaultIcon: n, ListNotices: s, Notices: a }) => ({
|
|
55
|
+
id: e.toString(),
|
|
56
|
+
title: t,
|
|
57
|
+
symbol: v(n),
|
|
58
|
+
defaultHeaderOptions: {
|
|
59
|
+
visible: !!s.length
|
|
60
|
+
},
|
|
61
|
+
notifications: (s || []).concat(a || []).map(({ Id: c, Title: o, Body: d, Type: h, Modified: f }) => ({
|
|
62
|
+
id: c.toString(),
|
|
63
|
+
title: o,
|
|
64
|
+
body: d,
|
|
65
|
+
modified: f,
|
|
66
|
+
expandable: h === "listNotice"
|
|
67
|
+
}))
|
|
68
|
+
})), q = ({
|
|
69
|
+
Id: i,
|
|
70
|
+
Title: e,
|
|
71
|
+
DefaultIcon: t,
|
|
72
|
+
Exits: [n],
|
|
73
|
+
ExitType: s,
|
|
74
|
+
ConfirmationText: a,
|
|
75
|
+
ExpandFormAutomatically: c,
|
|
76
|
+
Form: o,
|
|
77
|
+
Description: d
|
|
78
|
+
}, h) => {
|
|
79
|
+
const { Adapter: f } = n || { Adapter: {} }, { ClientName: g = "", Settings: C = {}, CustomClientName: I = "" } = f, u = {
|
|
80
|
+
id: i.toString(),
|
|
81
|
+
title: e,
|
|
82
|
+
description: d,
|
|
83
|
+
symbol: v(t),
|
|
84
|
+
clientName: g === "custom.adapter" ? I : g,
|
|
85
|
+
expanded: !0,
|
|
86
|
+
inline: !0,
|
|
114
87
|
body: {}
|
|
115
88
|
};
|
|
116
|
-
if (
|
|
117
|
-
const { displayTextBeforeClick, textBeforeClick } =
|
|
118
|
-
|
|
119
|
-
settings.expanded = false;
|
|
120
|
-
settings.title = textBeforeClick;
|
|
121
|
-
}
|
|
122
|
-
if (ClientName.indexOf("phone.text") > -1) {
|
|
123
|
-
settings.body.phoneNumber = Settings.phoneNumber;
|
|
124
|
-
} else {
|
|
125
|
-
settings.body.freetext = Settings.freetext;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
if (ClientName.indexOf("chat.popup") > -1 || ClientName.indexOf("link") > -1 || ClientName === "custom.adapter" && ExitType === "custom") {
|
|
129
|
-
settings.body = Settings;
|
|
130
|
-
settings.body.confirmationFallback = ConfirmationText;
|
|
131
|
-
}
|
|
132
|
-
if (ClientName.indexOf("ace") > -1) {
|
|
133
|
-
settings.body = Settings;
|
|
134
|
-
}
|
|
135
|
-
if (Form && Form.HasValueComponents) {
|
|
136
|
-
if (Validation) {
|
|
137
|
-
settings.body.form = FormBuilder.fromLegacyForm(Id.toString(), Form, Validation).get();
|
|
138
|
-
} else {
|
|
139
|
-
settings.body.form = FormBuilder.fromLegacyForm(Id.toString(), Form).get();
|
|
140
|
-
}
|
|
141
|
-
if (!ExpandFormAutomatically) {
|
|
142
|
-
settings.expanded = settings.inline = false;
|
|
143
|
-
}
|
|
89
|
+
if (g.indexOf("phone") > -1 || g.indexOf("freetext") > -1) {
|
|
90
|
+
const { displayTextBeforeClick: m, textBeforeClick: r } = C;
|
|
91
|
+
m === "true" && (u.expanded = !1, u.title = r), g.indexOf("phone.text") > -1 ? u.body.phoneNumber = C.phoneNumber : u.body.freetext = C.freetext;
|
|
144
92
|
}
|
|
145
|
-
return
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}));
|
|
165
|
-
};
|
|
166
|
-
const formatLegacyData = (type, data) => {
|
|
167
|
-
switch (type) {
|
|
168
|
-
case ServiceClientQueryType.MatchByCategory:
|
|
169
|
-
case ServiceClientQueryType.Match: {
|
|
170
|
-
const result = {
|
|
93
|
+
return (g.indexOf("chat.popup") > -1 || g.indexOf("link") > -1 || g === "custom.adapter" && s === "custom") && (u.body = C, u.body.confirmationFallback = a), g.indexOf("ace") > -1 && (u.body = C), o && o.HasValueComponents && (h ? u.body.form = _.fromLegacyForm(i.toString(), o, h).get() : u.body.form = _.fromLegacyForm(i.toString(), o).get(), c || (u.expanded = u.inline = !1)), u;
|
|
94
|
+
}, A = (i = []) => i.map(({ Id: e, Title: t, TotalMatches: n, Symbol: s, DefaultIcon: a, ActiveIcon: c }) => ({
|
|
95
|
+
id: e.toString(),
|
|
96
|
+
title: t,
|
|
97
|
+
matches: n,
|
|
98
|
+
symbol: v(a || s),
|
|
99
|
+
defaultIcon: v(a),
|
|
100
|
+
activeIcon: v(c)
|
|
101
|
+
})), L = (i) => i.map(({ Id: e, Title: t, Tags: n, FirstPublishedDate: s, Modified: a }) => ({
|
|
102
|
+
id: e.toString(),
|
|
103
|
+
title: t,
|
|
104
|
+
tags: A(n),
|
|
105
|
+
published: s,
|
|
106
|
+
modified: a
|
|
107
|
+
})), it = (i, e) => {
|
|
108
|
+
switch (i) {
|
|
109
|
+
case p.MatchByCategory:
|
|
110
|
+
case p.Match: {
|
|
111
|
+
const t = {
|
|
171
112
|
guides: [],
|
|
172
113
|
matches: 0,
|
|
173
114
|
topNotifications: [],
|
|
@@ -176,196 +117,133 @@ const formatLegacyData = (type, data) => {
|
|
|
176
117
|
notificationLists: [],
|
|
177
118
|
tags: [],
|
|
178
119
|
byCategory: []
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
guides: mapGuides(Matches2),
|
|
193
|
-
matches: TotalMatches2
|
|
194
|
-
}));
|
|
195
|
-
result.tags = mapTags(Tags);
|
|
196
|
-
result.notificationLists = mapNotificationLists(NoticeLists || []);
|
|
197
|
-
result.topNotifications = mapNotices(Notices || [], "noticeRowTop");
|
|
198
|
-
result.middleNotifications = mapNotices(Notices || [], "noticeRowMiddle");
|
|
199
|
-
result.bottomNotifications = mapNotices(Notices || [], "footerNotice");
|
|
200
|
-
return result;
|
|
120
|
+
}, {
|
|
121
|
+
Matches: n,
|
|
122
|
+
TotalMatches: s,
|
|
123
|
+
Notices: a,
|
|
124
|
+
NoticeLists: c,
|
|
125
|
+
Tags: o,
|
|
126
|
+
ByCategory: d
|
|
127
|
+
} = e;
|
|
128
|
+
return t.guides = L(n), t.matches = s, t.byCategory = (d || []).map(({ Id: h, Matches: f, TotalMatches: g }) => ({
|
|
129
|
+
id: h,
|
|
130
|
+
guides: L(f),
|
|
131
|
+
matches: g
|
|
132
|
+
})), t.tags = A(o), t.notificationLists = G(c || []), t.topNotifications = y(a || [], "noticeRowTop"), t.middleNotifications = y(a || [], "noticeRowMiddle"), t.bottomNotifications = y(a || [], "footerNotice"), t;
|
|
201
133
|
}
|
|
202
|
-
case
|
|
203
|
-
const { Children, GuidesCountTotal } =
|
|
204
|
-
|
|
205
|
-
categories:
|
|
206
|
-
matches:
|
|
134
|
+
case p.Categories: {
|
|
135
|
+
const { Children: t, GuidesCountTotal: n } = e;
|
|
136
|
+
return {
|
|
137
|
+
categories: D(t || []),
|
|
138
|
+
matches: n
|
|
207
139
|
};
|
|
208
|
-
return result;
|
|
209
140
|
}
|
|
210
|
-
case
|
|
141
|
+
case p.Guide: {
|
|
211
142
|
const {
|
|
212
|
-
Id,
|
|
213
|
-
Title,
|
|
214
|
-
Body,
|
|
215
|
-
Related,
|
|
216
|
-
Options,
|
|
217
|
-
ConnectionId,
|
|
218
|
-
ContactMethods,
|
|
219
|
-
EnableFeedback,
|
|
220
|
-
HandoverExists,
|
|
221
|
-
FirstPublishedDate,
|
|
222
|
-
Modified,
|
|
223
|
-
ModifiedByDisplayName,
|
|
224
|
-
FirstPublishedByDisplayName,
|
|
225
|
-
Categories,
|
|
226
|
-
Tags,
|
|
227
|
-
SeoMetaDescription,
|
|
228
|
-
SeoAllowIndex,
|
|
229
|
-
Perspectives,
|
|
230
|
-
PerspectiveKey,
|
|
231
|
-
Translations
|
|
232
|
-
} =
|
|
233
|
-
const perspective = PerspectiveKey || Object.values(Perspectives).find((connection) => connection === ConnectionId) || Perspectives["Default"] || null;
|
|
234
|
-
const result = {
|
|
143
|
+
Id: t,
|
|
144
|
+
Title: n,
|
|
145
|
+
Body: s,
|
|
146
|
+
Related: a,
|
|
147
|
+
Options: c,
|
|
148
|
+
ConnectionId: o,
|
|
149
|
+
ContactMethods: d,
|
|
150
|
+
EnableFeedback: h,
|
|
151
|
+
HandoverExists: f,
|
|
152
|
+
FirstPublishedDate: g,
|
|
153
|
+
Modified: C,
|
|
154
|
+
ModifiedByDisplayName: I,
|
|
155
|
+
FirstPublishedByDisplayName: u,
|
|
156
|
+
Categories: m,
|
|
157
|
+
Tags: r,
|
|
158
|
+
SeoMetaDescription: l,
|
|
159
|
+
SeoAllowIndex: k,
|
|
160
|
+
Perspectives: w,
|
|
161
|
+
PerspectiveKey: B,
|
|
162
|
+
Translations: T
|
|
163
|
+
} = e, $ = B || Object.values(w).find((N) => N === o) || w.Default || null, U = {
|
|
235
164
|
guide: {
|
|
236
|
-
id:
|
|
237
|
-
title:
|
|
238
|
-
body:
|
|
239
|
-
modified:
|
|
240
|
-
published:
|
|
241
|
-
modifiedBy:
|
|
242
|
-
publishedBy:
|
|
243
|
-
connection:
|
|
244
|
-
categories:
|
|
245
|
-
hasHandover:
|
|
246
|
-
allowFeedback:
|
|
247
|
-
seoMetaDescription:
|
|
248
|
-
seoAllowIndex:
|
|
249
|
-
perspectives:
|
|
250
|
-
perspective
|
|
251
|
-
translations: Object.keys(
|
|
252
|
-
acc[key] = Translations[key].toString();
|
|
253
|
-
return acc;
|
|
254
|
-
}, {})
|
|
165
|
+
id: t.toString(),
|
|
166
|
+
title: n,
|
|
167
|
+
body: s,
|
|
168
|
+
modified: C,
|
|
169
|
+
published: g,
|
|
170
|
+
modifiedBy: I,
|
|
171
|
+
publishedBy: u,
|
|
172
|
+
connection: o,
|
|
173
|
+
categories: m,
|
|
174
|
+
hasHandover: f,
|
|
175
|
+
allowFeedback: h,
|
|
176
|
+
seoMetaDescription: l,
|
|
177
|
+
seoAllowIndex: k,
|
|
178
|
+
perspectives: w,
|
|
179
|
+
perspective: $,
|
|
180
|
+
translations: Object.keys(T || {}).reduce((N, x) => (N[x] = T[x].toString(), N), {})
|
|
255
181
|
},
|
|
256
|
-
related:
|
|
182
|
+
related: L(a || []),
|
|
257
183
|
dialog: [],
|
|
258
|
-
contactMethods: (
|
|
259
|
-
tags:
|
|
184
|
+
contactMethods: (d || []).map((N) => q(N)),
|
|
185
|
+
tags: A(r)
|
|
260
186
|
};
|
|
261
|
-
(
|
|
262
|
-
if (!
|
|
187
|
+
return (c || []).forEach(({ CanAccess: N, Description: x, ConnectionId: V, Properties: b }) => {
|
|
188
|
+
if (!N)
|
|
263
189
|
return;
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
type: DialogItemType.default,
|
|
190
|
+
const M = {
|
|
191
|
+
id: t.toString(),
|
|
192
|
+
title: x,
|
|
193
|
+
connection: V,
|
|
194
|
+
type: R.default,
|
|
270
195
|
parent: {
|
|
271
|
-
id:
|
|
272
|
-
title:
|
|
273
|
-
tags:
|
|
196
|
+
id: t.toString(),
|
|
197
|
+
title: n,
|
|
198
|
+
tags: A(r)
|
|
274
199
|
}
|
|
275
200
|
};
|
|
276
|
-
if (
|
|
277
|
-
|
|
278
|
-
Properties.Uri && (item.href = Properties.Uri);
|
|
279
|
-
Properties.Target && (item.target = Properties.Target);
|
|
280
|
-
switch (Properties.Type) {
|
|
201
|
+
if (b.Type === "Guide" || b.Type === "Link")
|
|
202
|
+
switch (b.Id && (M.id = b.Id.toString()), b.Uri && (M.href = b.Uri), b.Target && (M.target = b.Target), b.Type) {
|
|
281
203
|
case "Guide":
|
|
282
|
-
|
|
204
|
+
M.type = R.guide;
|
|
283
205
|
break;
|
|
284
206
|
case "Link":
|
|
285
|
-
|
|
207
|
+
M.type = R.link;
|
|
286
208
|
break;
|
|
287
209
|
}
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
});
|
|
291
|
-
return result;
|
|
210
|
+
U.dialog.push(M);
|
|
211
|
+
}), U;
|
|
292
212
|
}
|
|
293
|
-
case
|
|
294
|
-
const { Children, Matches, Notices, NoticeLists } =
|
|
295
|
-
|
|
296
|
-
contactMethods: (
|
|
297
|
-
categories:
|
|
298
|
-
topNotifications:
|
|
299
|
-
middleNotifications:
|
|
300
|
-
bottomNotifications:
|
|
301
|
-
notificationLists:
|
|
213
|
+
case p.Contacts: {
|
|
214
|
+
const { Children: t, Matches: n, Notices: s, NoticeLists: a } = e;
|
|
215
|
+
return {
|
|
216
|
+
contactMethods: (n || []).map((o) => q(o)),
|
|
217
|
+
categories: D(t || []),
|
|
218
|
+
topNotifications: y(s || [], "noticeRowTop"),
|
|
219
|
+
middleNotifications: y(s || [], "noticeRowMiddle"),
|
|
220
|
+
bottomNotifications: y(s || [], "footerNotice"),
|
|
221
|
+
notificationLists: G(a || [])
|
|
302
222
|
};
|
|
303
|
-
return result;
|
|
304
|
-
}
|
|
305
|
-
case ServiceClientQueryType.ContactMethod: {
|
|
306
|
-
const { ContactMethod: ContactMethod2 } = data;
|
|
307
|
-
return mapContactMethodSettings(ContactMethod2 || {});
|
|
308
223
|
}
|
|
309
|
-
case
|
|
310
|
-
|
|
311
|
-
return
|
|
224
|
+
case p.ContactMethod: {
|
|
225
|
+
const { ContactMethod: t } = e;
|
|
226
|
+
return q(t || {});
|
|
312
227
|
}
|
|
313
|
-
case
|
|
314
|
-
|
|
228
|
+
case p.Tags:
|
|
229
|
+
case p.TagsOnGuides:
|
|
230
|
+
return A(e || []);
|
|
231
|
+
case p.Notifications: {
|
|
232
|
+
const { Notices: t, NoticeLists: n } = e;
|
|
315
233
|
return {
|
|
316
|
-
topNotifications:
|
|
317
|
-
middleNotifications:
|
|
318
|
-
bottomNotifications:
|
|
319
|
-
notificationLists:
|
|
234
|
+
topNotifications: y(t || [], "noticeRowTop"),
|
|
235
|
+
middleNotifications: y(t || [], "noticeRowMiddle"),
|
|
236
|
+
bottomNotifications: y(t || [], "footerNotice"),
|
|
237
|
+
notificationLists: G(n || [])
|
|
320
238
|
};
|
|
321
239
|
}
|
|
322
240
|
default:
|
|
323
241
|
return {};
|
|
324
242
|
}
|
|
325
243
|
};
|
|
326
|
-
var
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
DataType2["GuidesByCategory"] = "guides-by-category";
|
|
330
|
-
DataType2["RowNotifications"] = "row-notices";
|
|
331
|
-
DataType2["NotificationLists"] = "notification-lists";
|
|
332
|
-
DataType2["GuideCategories"] = "guide-categories";
|
|
333
|
-
DataType2["ContactMethodCategories"] = "contact-method-categories";
|
|
334
|
-
DataType2["ContactMethod"] = "contact-method";
|
|
335
|
-
DataType2["ContactMethods"] = "contact-methods";
|
|
336
|
-
DataType2["Tags"] = "tags";
|
|
337
|
-
DataType2["TagsOnGuides"] = "tagsonguides";
|
|
338
|
-
return DataType2;
|
|
339
|
-
})(DataType || {});
|
|
340
|
-
var ServiceClientQueryType = /* @__PURE__ */ ((ServiceClientQueryType2) => {
|
|
341
|
-
ServiceClientQueryType2["Match"] = "match";
|
|
342
|
-
ServiceClientQueryType2["Categories"] = "categories";
|
|
343
|
-
ServiceClientQueryType2["Guide"] = "guide";
|
|
344
|
-
ServiceClientQueryType2["Contacts"] = "contacts";
|
|
345
|
-
ServiceClientQueryType2["ContactMethod"] = "contact-method";
|
|
346
|
-
ServiceClientQueryType2["MatchByCategory"] = "match-by-category";
|
|
347
|
-
ServiceClientQueryType2["Tags"] = "tags";
|
|
348
|
-
ServiceClientQueryType2["TagsOnGuides"] = "tagsonguides";
|
|
349
|
-
ServiceClientQueryType2["Notifications"] = "notifications";
|
|
350
|
-
return ServiceClientQueryType2;
|
|
351
|
-
})(ServiceClientQueryType || {});
|
|
352
|
-
var FeedbackType = /* @__PURE__ */ ((FeedbackType2) => {
|
|
353
|
-
FeedbackType2["Positive"] = "Positive";
|
|
354
|
-
FeedbackType2["Negative"] = "Negative";
|
|
355
|
-
return FeedbackType2;
|
|
356
|
-
})(FeedbackType || {});
|
|
357
|
-
var SortingType = /* @__PURE__ */ ((SortingType2) => {
|
|
358
|
-
SortingType2["POPULARITY_DESCENDING"] = "popularity-descending";
|
|
359
|
-
SortingType2["ALPHABETIC_ASCENDING"] = "alphabetic-ascending";
|
|
360
|
-
SortingType2["ALPHABETIC_DESCENDING"] = "alphabetic-descending";
|
|
361
|
-
SortingType2["MODIFIED_ASCENDING"] = "modified-ascending";
|
|
362
|
-
SortingType2["MODIFIED_DESCENDING"] = "modified-descending";
|
|
363
|
-
SortingType2["PUBLISHED_ASCENDING"] = "published-ascending";
|
|
364
|
-
SortingType2["PUBLISHED_DESCENDING"] = "published-descending";
|
|
365
|
-
return SortingType2;
|
|
366
|
-
})(SortingType || {});
|
|
367
|
-
const determineServiceClientQueryType = (type) => {
|
|
368
|
-
switch (type) {
|
|
244
|
+
var st = /* @__PURE__ */ ((i) => (i.Guide = "guide", i.Guides = "guides", i.GuidesByCategory = "guides-by-category", i.RowNotifications = "row-notices", i.NotificationLists = "notification-lists", i.GuideCategories = "guide-categories", i.ContactMethodCategories = "contact-method-categories", i.ContactMethod = "contact-method", i.ContactMethods = "contact-methods", i.Tags = "tags", i.TagsOnGuides = "tagsonguides", i))(st || {}), p = /* @__PURE__ */ ((i) => (i.Match = "match", i.Categories = "categories", i.Guide = "guide", i.Contacts = "contacts", i.ContactMethod = "contact-method", i.MatchByCategory = "match-by-category", i.Tags = "tags", i.TagsOnGuides = "tagsonguides", i.Notifications = "notifications", i))(p || {}), nt = /* @__PURE__ */ ((i) => (i.Positive = "Positive", i.Negative = "Negative", i))(nt || {}), ot = /* @__PURE__ */ ((i) => (i.POPULARITY_DESCENDING = "popularity-descending", i.ALPHABETIC_ASCENDING = "alphabetic-ascending", i.ALPHABETIC_DESCENDING = "alphabetic-descending", i.MODIFIED_ASCENDING = "modified-ascending", i.MODIFIED_DESCENDING = "modified-descending", i.PUBLISHED_ASCENDING = "published-ascending", i.PUBLISHED_DESCENDING = "published-descending", i))(ot || {});
|
|
245
|
+
const W = (i) => {
|
|
246
|
+
switch (i) {
|
|
369
247
|
case "guides":
|
|
370
248
|
return "match";
|
|
371
249
|
case "guides-by-category":
|
|
@@ -389,298 +267,211 @@ const determineServiceClientQueryType = (type) => {
|
|
|
389
267
|
default:
|
|
390
268
|
throw "error";
|
|
391
269
|
}
|
|
392
|
-
}
|
|
393
|
-
const
|
|
394
|
-
|
|
395
|
-
const renderState = yield invoke("renderState");
|
|
396
|
-
return renderState === WidgetRenderState.hidden;
|
|
270
|
+
}, at = (i) => E(void 0, null, function* () {
|
|
271
|
+
const { invoke: e } = i.get("$widget");
|
|
272
|
+
return (yield e("renderState")) === O.hidden;
|
|
397
273
|
});
|
|
398
|
-
class
|
|
399
|
-
constructor(
|
|
400
|
-
this.container =
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
this.
|
|
407
|
-
const hasUnresolved = queries.some((query) => !query.resolved);
|
|
408
|
-
if (hasUnresolved) {
|
|
409
|
-
unresolvedCount = 1;
|
|
410
|
-
}
|
|
411
|
-
});
|
|
412
|
-
return unresolvedCount;
|
|
413
|
-
};
|
|
414
|
-
this.events = container.get("$widget").events;
|
|
415
|
-
this.events.subscribe("widget:settings-updated", () => this.queries = /* @__PURE__ */ new Map());
|
|
416
|
-
this.events.subscribe("widget:render-state-changed", (event, { next, previous }) => {
|
|
417
|
-
if (previous === WidgetRenderState.hidden && next === WidgetRenderState.open) {
|
|
418
|
-
this.fetchAllUnresolvedQueries();
|
|
419
|
-
}
|
|
274
|
+
class K {
|
|
275
|
+
constructor(e, t) {
|
|
276
|
+
this.container = e, this.matchingClient = t, this.queries = /* @__PURE__ */ new Map(), this.lastTake = 0, this.getUnresolvedQueries = () => {
|
|
277
|
+
let n = 0;
|
|
278
|
+
return this.queries.forEach((s, a) => {
|
|
279
|
+
s.some((o) => !o.resolved) && (n = 1);
|
|
280
|
+
}), n;
|
|
281
|
+
}, this.events = e.get("$widget").events, this.events.subscribe("widget:settings-updated", () => this.queries = /* @__PURE__ */ new Map()), this.events.subscribe("widget:render-state-changed", (n, { next: s, previous: a }) => {
|
|
282
|
+
a === O.hidden && s === O.open && this.fetchAllUnresolvedQueries();
|
|
420
283
|
});
|
|
421
284
|
}
|
|
422
|
-
static getInstance(
|
|
423
|
-
return
|
|
285
|
+
static getInstance(e) {
|
|
286
|
+
return e.getAsync("dataClient");
|
|
424
287
|
}
|
|
425
|
-
fetch(
|
|
426
|
-
return new Promise((
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
this.
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
this.track(query.data, serviceClientQueryType, query.error);
|
|
444
|
-
if (query.data && query.error) {
|
|
445
|
-
reject({ error: query.error });
|
|
446
|
-
} else {
|
|
447
|
-
resolve(query.data);
|
|
448
|
-
}
|
|
449
|
-
} else {
|
|
450
|
-
query.resolvers.push({ resolve, reject });
|
|
451
|
-
}
|
|
452
|
-
queries.splice(index, 1);
|
|
453
|
-
queries.push(query);
|
|
454
|
-
this.queries.set(serviceClientQueryType, queries);
|
|
455
|
-
if (!query.loading && !query.resolved) {
|
|
456
|
-
return this.runQuery(serviceClientQueryType, params);
|
|
457
|
-
}
|
|
458
|
-
} else {
|
|
459
|
-
queries.push({
|
|
460
|
-
params,
|
|
461
|
-
resolved: false,
|
|
462
|
-
loading: true,
|
|
288
|
+
fetch(e, t) {
|
|
289
|
+
return new Promise((n, s) => {
|
|
290
|
+
t.take && (this.lastTake = +(t.take || 0)), tt(t);
|
|
291
|
+
const a = W(e), c = this.queries.get(a) || [], o = c.find((d) => S(d.params, t));
|
|
292
|
+
if (o) {
|
|
293
|
+
const d = c.indexOf(o);
|
|
294
|
+
if (o.resolved ? (this.events.dispatch("data-client:fetched", {
|
|
295
|
+
params: t,
|
|
296
|
+
type: a,
|
|
297
|
+
response: o.data,
|
|
298
|
+
unresolvedQueries: this.getUnresolvedQueries()
|
|
299
|
+
}), this.track(o.data, a, o.error), o.data && o.error ? s({ error: o.error }) : n(o.data)) : o.resolvers.push({ resolve: n, reject: s }), c.splice(d, 1), c.push(o), this.queries.set(a, c), !o.loading && !o.resolved)
|
|
300
|
+
return this.runQuery(a, t);
|
|
301
|
+
} else
|
|
302
|
+
return c.push({
|
|
303
|
+
params: t,
|
|
304
|
+
resolved: !1,
|
|
305
|
+
loading: !0,
|
|
463
306
|
data: {},
|
|
464
|
-
resolvers: [{ resolve, reject }]
|
|
465
|
-
});
|
|
466
|
-
|
|
467
|
-
return this.runQuery(serviceClientQueryType, params);
|
|
468
|
-
}
|
|
469
|
-
}).then((res) => deepClone(res));
|
|
307
|
+
resolvers: [{ resolve: n, reject: s }]
|
|
308
|
+
}), this.queries.set(a, c), this.runQuery(a, t);
|
|
309
|
+
}).then((n) => et(n));
|
|
470
310
|
}
|
|
471
|
-
read(
|
|
472
|
-
const { select } =
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
}
|
|
481
|
-
} else {
|
|
482
|
-
acc.push(query.data);
|
|
483
|
-
}
|
|
484
|
-
return acc;
|
|
311
|
+
read(e, t) {
|
|
312
|
+
const { select: n } = t, s = W(e);
|
|
313
|
+
return (this.queries.get(s) || []).reduce((o, d) => {
|
|
314
|
+
if (typeof n == "function") {
|
|
315
|
+
const h = n(d.data);
|
|
316
|
+
h && o.push(h);
|
|
317
|
+
} else
|
|
318
|
+
o.push(d.data);
|
|
319
|
+
return o;
|
|
485
320
|
}, []);
|
|
486
|
-
return result;
|
|
487
321
|
}
|
|
488
|
-
feedback(
|
|
489
|
-
return this.matchingClient.giveFeedback(
|
|
322
|
+
feedback(e, t, n) {
|
|
323
|
+
return this.matchingClient.giveFeedback(e, t, n);
|
|
490
324
|
}
|
|
491
|
-
setLoadingStatus(
|
|
492
|
-
const
|
|
493
|
-
|
|
494
|
-
if (query) {
|
|
495
|
-
query.loading = loading;
|
|
496
|
-
}
|
|
497
|
-
this.queries.set(type, queries);
|
|
325
|
+
setLoadingStatus(e, t, n) {
|
|
326
|
+
const s = this.queries.get(e) || [], a = s.find((c) => S(c.params, t));
|
|
327
|
+
a && (a.loading = n), this.queries.set(e, s);
|
|
498
328
|
}
|
|
499
|
-
runQuery(
|
|
500
|
-
return
|
|
329
|
+
runQuery(e, t) {
|
|
330
|
+
return E(this, null, function* () {
|
|
501
331
|
const {
|
|
502
|
-
searchPhrase = "",
|
|
503
|
-
categories = "0",
|
|
504
|
-
contactMethodCategoryId = "0",
|
|
505
|
-
contactMethodId = "0",
|
|
506
|
-
tagId = void 0,
|
|
507
|
-
take = 5,
|
|
508
|
-
connection = "",
|
|
509
|
-
guideId,
|
|
510
|
-
expandCategories = "descendants",
|
|
511
|
-
currentCategory,
|
|
512
|
-
sorting = "popularity-descending",
|
|
513
|
-
guideIds = []
|
|
514
|
-
} =
|
|
515
|
-
|
|
516
|
-
if (yield widgetIsHidden(this.container)) {
|
|
332
|
+
searchPhrase: n = "",
|
|
333
|
+
categories: s = "0",
|
|
334
|
+
contactMethodCategoryId: a = "0",
|
|
335
|
+
contactMethodId: c = "0",
|
|
336
|
+
tagId: o = void 0,
|
|
337
|
+
take: d = 5,
|
|
338
|
+
connection: h = "",
|
|
339
|
+
guideId: f,
|
|
340
|
+
expandCategories: g = "descendants",
|
|
341
|
+
currentCategory: C,
|
|
342
|
+
sorting: I = "popularity-descending",
|
|
343
|
+
guideIds: u = []
|
|
344
|
+
} = t, m = n.toString().trim();
|
|
345
|
+
if (yield at(this.container))
|
|
517
346
|
return Promise.resolve();
|
|
518
|
-
|
|
519
|
-
switch (type) {
|
|
347
|
+
switch (e) {
|
|
520
348
|
case "match": {
|
|
521
|
-
const
|
|
522
|
-
const [
|
|
523
|
-
const sortKeysMap = /* @__PURE__ */ new Map([
|
|
524
|
-
["popularity", "popularity"],
|
|
525
|
-
["alphabetic", "title"],
|
|
526
|
-
["modified", "lastModified"],
|
|
527
|
-
["published", "firstPublished"]
|
|
528
|
-
]);
|
|
349
|
+
const r = (l) => {
|
|
350
|
+
const [k, w] = l.split("-");
|
|
529
351
|
return {
|
|
530
|
-
type:
|
|
531
|
-
|
|
352
|
+
type: (/* @__PURE__ */ new Map([
|
|
353
|
+
["popularity", "popularity"],
|
|
354
|
+
["alphabetic", "title"],
|
|
355
|
+
["modified", "lastModified"],
|
|
356
|
+
["published", "firstPublished"]
|
|
357
|
+
])).get(k),
|
|
358
|
+
direction: w
|
|
532
359
|
};
|
|
533
360
|
};
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
sorting: formatSortingValues(sorting),
|
|
544
|
-
ids: guideIds
|
|
545
|
-
}).then((matches) => matches && this.handleResponse(matches, type, params));
|
|
546
|
-
}
|
|
547
|
-
case "match-by-category": {
|
|
548
|
-
return this.matchingClient.match(trimmedPhrase, {
|
|
549
|
-
groupByCategory: true,
|
|
550
|
-
categories: categories === "0" ? [] : Array.isArray(categories) ? categories : [+categories],
|
|
551
|
-
take: +take,
|
|
552
|
-
tags: tagId
|
|
553
|
-
}).then((matches) => matches && this.handleResponse(matches, type, params));
|
|
361
|
+
return u.length ? this.matchingClient.customRequest("guides", "POST", {
|
|
362
|
+
configuration: { ids: u, take: +d }
|
|
363
|
+
}).then((l) => l && this.handleResponse(l, e, t)) : this.matchingClient.match(m, {
|
|
364
|
+
categories: s === "0" ? [] : Array.isArray(s) ? s : [+s],
|
|
365
|
+
take: +d,
|
|
366
|
+
tags: o,
|
|
367
|
+
sorting: r(I),
|
|
368
|
+
ids: u
|
|
369
|
+
}).then((l) => l && this.handleResponse(l, e, t));
|
|
554
370
|
}
|
|
555
|
-
case "
|
|
556
|
-
return this.matchingClient.
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
371
|
+
case "match-by-category":
|
|
372
|
+
return this.matchingClient.match(m, {
|
|
373
|
+
groupByCategory: !0,
|
|
374
|
+
categories: s === "0" ? [] : Array.isArray(s) ? s : [+s],
|
|
375
|
+
take: +d,
|
|
376
|
+
tags: o
|
|
377
|
+
}).then((r) => r && this.handleResponse(r, e, t));
|
|
378
|
+
case "guide":
|
|
379
|
+
return this.matchingClient.getGuide(f, { connectionId: h }).then((r) => {
|
|
380
|
+
r && this.handleResponse(r, e, t);
|
|
381
|
+
}).catch((r) => {
|
|
382
|
+
const l = {
|
|
562
383
|
message: "Something went wrong.",
|
|
563
|
-
status:
|
|
384
|
+
status: r.status || 400
|
|
564
385
|
};
|
|
565
|
-
|
|
566
|
-
error.message = "The guide could not be found.";
|
|
567
|
-
}
|
|
568
|
-
this.handleResponse({}, type, params, error);
|
|
386
|
+
l.status === 404 && (l.message = "The guide could not be found."), this.handleResponse({}, e, t, l);
|
|
569
387
|
});
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
case "
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
}
|
|
578
|
-
return this.matchingClient.contacts(+contactMethodCategoryId, { phrase: trimmedPhrase }).then((result) => result && this.handleResponse(result, type, params));
|
|
579
|
-
}
|
|
580
|
-
case "contact-method": {
|
|
581
|
-
return this.matchingClient.getContactMethod(+contactMethodId, { guideId, currentCategory }).then((result) => result && this.handleResponse(result, type, params));
|
|
582
|
-
}
|
|
583
|
-
case "tags": {
|
|
388
|
+
case "categories":
|
|
389
|
+
return this.matchingClient.getCategories({ phrase: m, expand: g, tags: o }).then((r) => r && this.handleResponse(r, e, t));
|
|
390
|
+
case "contacts":
|
|
391
|
+
return f ? this.matchingClient.contactMethods(+f, { phrase: m }).then((r) => r && this.handleResponse(r, e, t)) : this.matchingClient.contacts(+a, { phrase: m }).then((r) => r && this.handleResponse(r, e, t));
|
|
392
|
+
case "contact-method":
|
|
393
|
+
return this.matchingClient.getContactMethod(+c, { guideId: f, currentCategory: C }).then((r) => r && this.handleResponse(r, e, t));
|
|
394
|
+
case "tags":
|
|
584
395
|
return this.matchingClient.customRequest("tags", "GET", {
|
|
585
396
|
configuration: {
|
|
586
397
|
take: 999999,
|
|
587
|
-
phrase:
|
|
588
|
-
categories:
|
|
398
|
+
phrase: m,
|
|
399
|
+
categories: s === "0" ? [] : Array.isArray(s) ? s : [+s]
|
|
589
400
|
}
|
|
590
|
-
}).then((
|
|
591
|
-
|
|
592
|
-
case "tagsonguides": {
|
|
401
|
+
}).then((r) => r && this.handleResponse(r, e, t));
|
|
402
|
+
case "tagsonguides":
|
|
593
403
|
return this.matchingClient.customRequest("tagsonguides", "GET", {
|
|
594
404
|
configuration: {
|
|
595
405
|
take: 999999,
|
|
596
|
-
phrase:
|
|
597
|
-
categories:
|
|
598
|
-
tags:
|
|
406
|
+
phrase: m,
|
|
407
|
+
categories: s === "0" ? [] : Array.isArray(s) ? s : [+s],
|
|
408
|
+
tags: o
|
|
599
409
|
}
|
|
600
|
-
}).then((
|
|
601
|
-
|
|
602
|
-
case "notifications": {
|
|
410
|
+
}).then((r) => r && this.handleResponse(r, e, t));
|
|
411
|
+
case "notifications":
|
|
603
412
|
return this.matchingClient.customRequest("notices", "GET", {
|
|
604
413
|
configuration: {
|
|
605
|
-
phrase:
|
|
606
|
-
categories:
|
|
414
|
+
phrase: m,
|
|
415
|
+
categories: s === "0" ? [] : Array.isArray(s) ? s : [+s]
|
|
607
416
|
}
|
|
608
|
-
}).then((
|
|
609
|
-
}
|
|
417
|
+
}).then((r) => r && this.handleResponse(r, e, t));
|
|
610
418
|
}
|
|
611
419
|
});
|
|
612
420
|
}
|
|
613
|
-
handleResponse(
|
|
614
|
-
const
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
421
|
+
handleResponse(e = {}, t, n, s) {
|
|
422
|
+
const a = this.queries.get(t) || [], c = a.find((o) => S(o.params, n));
|
|
423
|
+
if (c) {
|
|
424
|
+
const o = s || it(t, e);
|
|
425
|
+
this.track(o, t, s), c.resolvers.forEach((h) => {
|
|
426
|
+
s ? h.reject({ error: o }) : h.resolve(o);
|
|
427
|
+
});
|
|
428
|
+
const d = a.indexOf(c);
|
|
429
|
+
d > -1 && a.splice(d, 1), a.push(Q(F({}, c), { error: s, resolvers: [], data: o, resolved: !0 })), this.setLoadingStatus(t, n, !1), this.queries.set(t, a), s || this.events.dispatch("data-client:fetched", {
|
|
430
|
+
type: t,
|
|
431
|
+
params: n,
|
|
432
|
+
response: o,
|
|
433
|
+
unresolvedQueries: this.getUnresolvedQueries()
|
|
625
434
|
});
|
|
626
|
-
const index = queries.indexOf(existing);
|
|
627
|
-
if (index > -1) {
|
|
628
|
-
queries.splice(index, 1);
|
|
629
|
-
}
|
|
630
|
-
queries.push(__spreadProps(__spreadValues({}, existing), { error, resolvers: [], data: formatted, resolved: true }));
|
|
631
|
-
this.setLoadingStatus(type, params, false);
|
|
632
|
-
this.queries.set(type, queries);
|
|
633
|
-
if (!error) {
|
|
634
|
-
this.events.dispatch("data-client:fetched", {
|
|
635
|
-
type,
|
|
636
|
-
params,
|
|
637
|
-
response: formatted,
|
|
638
|
-
unresolvedQueries: this.getUnresolvedQueries()
|
|
639
|
-
});
|
|
640
|
-
}
|
|
641
435
|
}
|
|
642
436
|
}
|
|
643
437
|
fetchAllUnresolvedQueries() {
|
|
644
|
-
for (const [
|
|
645
|
-
|
|
646
|
-
this.runQuery(
|
|
438
|
+
for (const [e, t] of this.queries)
|
|
439
|
+
t.filter((n) => !n.resolved).forEach((n) => {
|
|
440
|
+
this.runQuery(e, n.params);
|
|
647
441
|
});
|
|
648
|
-
}
|
|
649
442
|
}
|
|
650
|
-
track(
|
|
651
|
-
const
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
type,
|
|
660
|
-
error
|
|
661
|
-
});
|
|
662
|
-
}
|
|
443
|
+
track(e = {}, t, n) {
|
|
444
|
+
const s = this.container.get("$widget");
|
|
445
|
+
s && !n ? s.events.dispatch("tracking:service-client-response", {
|
|
446
|
+
type: t,
|
|
447
|
+
data: e
|
|
448
|
+
}) : s && s.events.dispatch("tracking:service-client-error", {
|
|
449
|
+
type: t,
|
|
450
|
+
error: n
|
|
451
|
+
});
|
|
663
452
|
}
|
|
664
|
-
static create(
|
|
665
|
-
return
|
|
453
|
+
static create(e) {
|
|
454
|
+
return e.getAsync("matchingClient").then((t) => new K(e, t));
|
|
666
455
|
}
|
|
667
456
|
}
|
|
668
|
-
const
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
};
|
|
673
|
-
const createDataClient = (container) => {
|
|
674
|
-
return import("./index2.js").then(({ DataClient: DataClient2 }) => {
|
|
675
|
-
return DataClient2.create(container);
|
|
676
|
-
});
|
|
677
|
-
};
|
|
678
|
-
class ExtendedWidget extends Widget {
|
|
679
|
-
constructor(container) {
|
|
680
|
-
super(container);
|
|
681
|
-
this.container.registerAsync("contactMethods", () => createContactMethodPlatform(this.container));
|
|
682
|
-
this.container.registerAsync("dataClient", () => createDataClient(this.container));
|
|
457
|
+
const rt = (i) => import("@telia-ace/knowledge-widget-adapters").then(({ ContactMethodPlatform: e }) => e.create(i)), ct = (i) => import("./index.a2cdbc37.js").then(({ DataClient: e }) => e.create(i));
|
|
458
|
+
class ft extends Z {
|
|
459
|
+
constructor(e) {
|
|
460
|
+
super(e), this.container.registerAsync("contactMethods", () => rt(this.container)), this.container.registerAsync("dataClient", () => ct(this.container));
|
|
683
461
|
}
|
|
684
462
|
}
|
|
685
|
-
export {
|
|
463
|
+
export {
|
|
464
|
+
Ct as Component,
|
|
465
|
+
K as DataClient,
|
|
466
|
+
st as DataType,
|
|
467
|
+
bt as DetachedComponent,
|
|
468
|
+
nt as FeedbackType,
|
|
469
|
+
ft as GridWidget,
|
|
470
|
+
yt as NotFound,
|
|
471
|
+
p as ServiceClientQueryType,
|
|
472
|
+
ot as SortingType,
|
|
473
|
+
W as determineServiceClientQueryType,
|
|
474
|
+
it as formatLegacyData,
|
|
475
|
+
Nt as genericComponentStyling
|
|
476
|
+
};
|
|
686
477
|
//# sourceMappingURL=index.js.map
|