@salesforce/lds-adapters-platform-admin-success-guidance 1.100.2

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.
Files changed (66) hide show
  1. package/LICENSE.txt +82 -0
  2. package/dist/es/es2018/platform-admin-success-guidance.js +4189 -0
  3. package/dist/types/src/generated/adapters/adapter-utils.d.ts +66 -0
  4. package/dist/types/src/generated/adapters/evaluateStep.d.ts +14 -0
  5. package/dist/types/src/generated/adapters/getAssistant.d.ts +27 -0
  6. package/dist/types/src/generated/adapters/getAssistantInfoList.d.ts +27 -0
  7. package/dist/types/src/generated/adapters/getAssistantList.d.ts +27 -0
  8. package/dist/types/src/generated/adapters/getAssistantTarget.d.ts +27 -0
  9. package/dist/types/src/generated/adapters/getQuestionnaire.d.ts +27 -0
  10. package/dist/types/src/generated/adapters/getQuestionnaires.d.ts +27 -0
  11. package/dist/types/src/generated/adapters/initialize.d.ts +14 -0
  12. package/dist/types/src/generated/adapters/saveAssistant.d.ts +16 -0
  13. package/dist/types/src/generated/adapters/saveAssistantList.d.ts +16 -0
  14. package/dist/types/src/generated/adapters/saveQuestionnaire.d.ts +16 -0
  15. package/dist/types/src/generated/artifacts/main.d.ts +11 -0
  16. package/dist/types/src/generated/artifacts/sfdc.d.ts +24 -0
  17. package/dist/types/src/generated/resources/getAssistantPlatformByAssistantName.d.ts +16 -0
  18. package/dist/types/src/generated/resources/getAssistantPlatformInfoByAssistantTarget.d.ts +16 -0
  19. package/dist/types/src/generated/resources/getAssistantPlatformListByAssistantTarget.d.ts +16 -0
  20. package/dist/types/src/generated/resources/getAssistantPlatformListInfoByAssistantTarget.d.ts +16 -0
  21. package/dist/types/src/generated/resources/getAssistantPlatformQuestionnaireByQuestionnaireName.d.ts +16 -0
  22. package/dist/types/src/generated/resources/getAssistantPlatformQuestionnairesByAssistantName.d.ts +16 -0
  23. package/dist/types/src/generated/resources/patchAssistantPlatformByAssistantName.d.ts +16 -0
  24. package/dist/types/src/generated/resources/patchAssistantPlatformListByAssistantTarget.d.ts +16 -0
  25. package/dist/types/src/generated/resources/patchAssistantPlatformQuestionnaireByQuestionnaireName.d.ts +16 -0
  26. package/dist/types/src/generated/resources/patchAssistantPlatformStepByStepName.d.ts +12 -0
  27. package/dist/types/src/generated/resources/putAssistantPlatformInitializeByAssistantTarget.d.ts +12 -0
  28. package/dist/types/src/generated/types/AbstractLightningAssistantActionRepresentation.d.ts +40 -0
  29. package/dist/types/src/generated/types/AssistantData.d.ts +30 -0
  30. package/dist/types/src/generated/types/LightningAssistantAnswerDataInputRepresentation.d.ts +35 -0
  31. package/dist/types/src/generated/types/LightningAssistantCategoryRepresentation.d.ts +35 -0
  32. package/dist/types/src/generated/types/LightningAssistantChoiceRepresentation.d.ts +38 -0
  33. package/dist/types/src/generated/types/LightningAssistantCustomActionRepresentation.d.ts +41 -0
  34. package/dist/types/src/generated/types/LightningAssistantInfoListRepresentation.d.ts +42 -0
  35. package/dist/types/src/generated/types/LightningAssistantInfoRepresentation.d.ts +56 -0
  36. package/dist/types/src/generated/types/LightningAssistantInitializationRepresentation.d.ts +44 -0
  37. package/dist/types/src/generated/types/LightningAssistantInputRepresentation.d.ts +29 -0
  38. package/dist/types/src/generated/types/LightningAssistantItemInputRepresentation.d.ts +38 -0
  39. package/dist/types/src/generated/types/LightningAssistantLayoutNodeRepresentation.d.ts +57 -0
  40. package/dist/types/src/generated/types/LightningAssistantLinkActionRepresentation.d.ts +37 -0
  41. package/dist/types/src/generated/types/LightningAssistantLinkRepresentation.d.ts +32 -0
  42. package/dist/types/src/generated/types/LightningAssistantListInputRepresentation.d.ts +33 -0
  43. package/dist/types/src/generated/types/LightningAssistantListRepresentation.d.ts +51 -0
  44. package/dist/types/src/generated/types/LightningAssistantLsfActionRepresentation.d.ts +44 -0
  45. package/dist/types/src/generated/types/LightningAssistantNoActionRepresentation.d.ts +27 -0
  46. package/dist/types/src/generated/types/LightningAssistantQuestionRepresentation.d.ts +43 -0
  47. package/dist/types/src/generated/types/LightningAssistantQuestionnaireInputRepresentation.d.ts +36 -0
  48. package/dist/types/src/generated/types/LightningAssistantQuestionnaireListRepresentation.d.ts +41 -0
  49. package/dist/types/src/generated/types/LightningAssistantQuestionnaireRepresentation.d.ts +54 -0
  50. package/dist/types/src/generated/types/LightningAssistantRepresentation.d.ts +99 -0
  51. package/dist/types/src/generated/types/LightningAssistantStepRepresentation.d.ts +76 -0
  52. package/dist/types/src/generated/types/LightningAssistantTargetRepresentation.d.ts +42 -0
  53. package/dist/types/src/generated/types/LightningAssistantTrailheadActionRepresentation.d.ts +37 -0
  54. package/dist/types/src/generated/types/LightningAssistantUpdateInputRepresentation.d.ts +33 -0
  55. package/dist/types/src/generated/types/LightningAssistantVideoActionRepresentation.d.ts +34 -0
  56. package/dist/types/src/generated/types/LightningAssistantWalkthroughActionRepresentation.d.ts +34 -0
  57. package/dist/types/src/generated/types/QuestionnaireData.d.ts +30 -0
  58. package/dist/types/src/generated/types/UpdateAssistantData.d.ts +30 -0
  59. package/dist/types/src/generated/types/type-utils.d.ts +39 -0
  60. package/dist/umd/es2018/platform-admin-success-guidance.js +4207 -0
  61. package/dist/umd/es5/platform-admin-success-guidance.js +4243 -0
  62. package/package.json +69 -0
  63. package/sfdc/index.d.ts +1 -0
  64. package/sfdc/index.js +4489 -0
  65. package/src/raml/api.raml +736 -0
  66. package/src/raml/luvio.raml +98 -0
@@ -0,0 +1,4243 @@
1
+ /**
2
+ * Copyright (c) 2022, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+
7
+ (function (global, factory) {
8
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@luvio/engine')) :
9
+ typeof define === 'function' && define.amd ? define(['exports', '@luvio/engine'], factory) :
10
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["platformAdmin-success-guidance"] = {}, global.engine));
11
+ })(this, (function (exports, engine) { 'use strict';
12
+
13
+ var ObjectPrototypeHasOwnProperty = Object.prototype.hasOwnProperty;
14
+ var ObjectKeys$1 = Object.keys;
15
+ var ArrayIsArray$1 = Array.isArray;
16
+ /**
17
+ * Validates an adapter config is well-formed.
18
+ * @param config The config to validate.
19
+ * @param adapter The adapter validation configuration.
20
+ * @param oneOf The keys the config must contain at least one of.
21
+ * @throws A TypeError if config doesn't satisfy the adapter's config validation.
22
+ */
23
+ function validateConfig(config, adapter, oneOf) {
24
+ var displayName = adapter.displayName;
25
+ var _a = adapter.parameters, required = _a.required, optional = _a.optional, unsupported = _a.unsupported;
26
+ if (config === undefined ||
27
+ required.every(function (req) { return ObjectPrototypeHasOwnProperty.call(config, req); }) === false) {
28
+ throw new TypeError("adapter ".concat(displayName, " configuration must specify ").concat(required.sort().join(', ')));
29
+ }
30
+ if (oneOf && oneOf.some(function (req) { return ObjectPrototypeHasOwnProperty.call(config, req); }) === false) {
31
+ throw new TypeError("adapter ".concat(displayName, " configuration must specify one of ").concat(oneOf.sort().join(', ')));
32
+ }
33
+ if (unsupported !== undefined &&
34
+ unsupported.some(function (req) { return ObjectPrototypeHasOwnProperty.call(config, req); })) {
35
+ throw new TypeError("adapter ".concat(displayName, " does not yet support ").concat(unsupported.sort().join(', ')));
36
+ }
37
+ var supported = required.concat(optional);
38
+ if (ObjectKeys$1(config).some(function (key) { return !supported.includes(key); })) {
39
+ throw new TypeError("adapter ".concat(displayName, " configuration supports only ").concat(supported.sort().join(', ')));
40
+ }
41
+ }
42
+ function untrustedIsObject(untrusted) {
43
+ return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
44
+ }
45
+ function areRequiredParametersPresent(config, configPropertyNames) {
46
+ return configPropertyNames.parameters.required.every(function (req) { return req in config; });
47
+ }
48
+ var snapshotRefreshOptions = {
49
+ overrides: {
50
+ headers: {
51
+ 'Cache-Control': 'no-cache',
52
+ },
53
+ }
54
+ };
55
+ var keyPrefix = 'LEAP';
56
+
57
+ var ObjectFreeze = Object.freeze, ObjectKeys = Object.keys;
58
+ var ArrayIsArray = Array.isArray;
59
+ var JSONStringify = JSON.stringify;
60
+ function equalsArray(a, b, equalsItem) {
61
+ var aLength = a.length;
62
+ var bLength = b.length;
63
+ if (aLength !== bLength) {
64
+ return false;
65
+ }
66
+ for (var i = 0; i < aLength; i++) {
67
+ if (equalsItem(a[i], b[i]) === false) {
68
+ return false;
69
+ }
70
+ }
71
+ return true;
72
+ }
73
+ function deepFreeze(value) {
74
+ // No need to freeze primitives
75
+ if (typeof value !== 'object' || value === null) {
76
+ return;
77
+ }
78
+ if (ArrayIsArray(value)) {
79
+ for (var i = 0, len = value.length; i < len; i += 1) {
80
+ deepFreeze(value[i]);
81
+ }
82
+ }
83
+ else {
84
+ var keys = ObjectKeys(value);
85
+ for (var i = 0, len = keys.length; i < len; i += 1) {
86
+ deepFreeze(value[keys[i]]);
87
+ }
88
+ }
89
+ ObjectFreeze(value);
90
+ }
91
+ function createLink(ref) {
92
+ return {
93
+ __ref: engine.serializeStructuredKey(ref),
94
+ };
95
+ }
96
+
97
+ var VERSION$l = "fec1ea773d37039808d8d9e4e4d7c085";
98
+ function validate$h(obj, path) {
99
+ if (path === void 0) { path = 'LightningAssistantChoiceRepresentation'; }
100
+ var v_error = (function () {
101
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
102
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
103
+ }
104
+ if (obj.description !== undefined) {
105
+ var obj_description = obj.description;
106
+ var path_description = path + '.description';
107
+ if (typeof obj_description !== 'string') {
108
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
109
+ }
110
+ }
111
+ var obj_developerName = obj.developerName;
112
+ var path_developerName = path + '.developerName';
113
+ if (typeof obj_developerName !== 'string') {
114
+ return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
115
+ }
116
+ var obj_next = obj.next;
117
+ var path_next = path + '.next';
118
+ if (typeof obj_next !== 'string') {
119
+ return new TypeError('Expected "string" but received "' + typeof obj_next + '" (at "' + path_next + '")');
120
+ }
121
+ var obj_title = obj.title;
122
+ var path_title = path + '.title';
123
+ if (typeof obj_title !== 'string') {
124
+ return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
125
+ }
126
+ })();
127
+ return v_error === undefined ? null : v_error;
128
+ }
129
+ var select$w = function LightningAssistantChoiceRepresentationSelect() {
130
+ return {
131
+ kind: 'Fragment',
132
+ version: VERSION$l,
133
+ private: [],
134
+ selections: [
135
+ {
136
+ name: 'description',
137
+ kind: 'Scalar',
138
+ required: false
139
+ },
140
+ {
141
+ name: 'developerName',
142
+ kind: 'Scalar'
143
+ },
144
+ {
145
+ name: 'next',
146
+ kind: 'Scalar'
147
+ },
148
+ {
149
+ name: 'title',
150
+ kind: 'Scalar'
151
+ }
152
+ ]
153
+ };
154
+ };
155
+ function equals$e(existing, incoming) {
156
+ var existing_description = existing.description;
157
+ var incoming_description = incoming.description;
158
+ // if at least one of these optionals is defined
159
+ if (existing_description !== undefined || incoming_description !== undefined) {
160
+ // if one of these is not defined we know the other is defined and therefore
161
+ // not equal
162
+ if (existing_description === undefined || incoming_description === undefined) {
163
+ return false;
164
+ }
165
+ if (!(existing_description === incoming_description)) {
166
+ return false;
167
+ }
168
+ }
169
+ var existing_developerName = existing.developerName;
170
+ var incoming_developerName = incoming.developerName;
171
+ if (!(existing_developerName === incoming_developerName)) {
172
+ return false;
173
+ }
174
+ var existing_next = existing.next;
175
+ var incoming_next = incoming.next;
176
+ if (!(existing_next === incoming_next)) {
177
+ return false;
178
+ }
179
+ var existing_title = existing.title;
180
+ var incoming_title = incoming.title;
181
+ if (!(existing_title === incoming_title)) {
182
+ return false;
183
+ }
184
+ return true;
185
+ }
186
+
187
+ var VERSION$k = "545ec40aff7b3db184e84760ae732370";
188
+ function validate$g(obj, path) {
189
+ if (path === void 0) { path = 'LightningAssistantLinkRepresentation'; }
190
+ var v_error = (function () {
191
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
192
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
193
+ }
194
+ var obj_label = obj.label;
195
+ var path_label = path + '.label';
196
+ if (typeof obj_label !== 'string') {
197
+ return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
198
+ }
199
+ var obj_url = obj.url;
200
+ var path_url = path + '.url';
201
+ if (typeof obj_url !== 'string') {
202
+ return new TypeError('Expected "string" but received "' + typeof obj_url + '" (at "' + path_url + '")');
203
+ }
204
+ })();
205
+ return v_error === undefined ? null : v_error;
206
+ }
207
+ var select$v = function LightningAssistantLinkRepresentationSelect() {
208
+ return {
209
+ kind: 'Fragment',
210
+ version: VERSION$k,
211
+ private: [],
212
+ selections: [
213
+ {
214
+ name: 'label',
215
+ kind: 'Scalar'
216
+ },
217
+ {
218
+ name: 'url',
219
+ kind: 'Scalar'
220
+ }
221
+ ]
222
+ };
223
+ };
224
+ function equals$d(existing, incoming) {
225
+ var existing_label = existing.label;
226
+ var incoming_label = incoming.label;
227
+ if (!(existing_label === incoming_label)) {
228
+ return false;
229
+ }
230
+ var existing_url = existing.url;
231
+ var incoming_url = incoming.url;
232
+ if (!(existing_url === incoming_url)) {
233
+ return false;
234
+ }
235
+ return true;
236
+ }
237
+
238
+ var VERSION$j = "33d491734169be0180f670c757b53a34";
239
+ function validate$f(obj, path) {
240
+ if (path === void 0) { path = 'LightningAssistantQuestionRepresentation'; }
241
+ var v_error = (function () {
242
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
243
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
244
+ }
245
+ var obj_choices = obj.choices;
246
+ var path_choices = path + '.choices';
247
+ if (!ArrayIsArray(obj_choices)) {
248
+ return new TypeError('Expected "array" but received "' + typeof obj_choices + '" (at "' + path_choices + '")');
249
+ }
250
+ for (var i = 0; i < obj_choices.length; i++) {
251
+ var obj_choices_item = obj_choices[i];
252
+ var path_choices_item = path_choices + '[' + i + ']';
253
+ var referencepath_choices_itemValidationError = validate$h(obj_choices_item, path_choices_item);
254
+ if (referencepath_choices_itemValidationError !== null) {
255
+ var message = 'Object doesn\'t match LightningAssistantChoiceRepresentation (at "' + path_choices_item + '")\n';
256
+ message += referencepath_choices_itemValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
257
+ return new TypeError(message);
258
+ }
259
+ }
260
+ if (obj.description !== undefined) {
261
+ var obj_description = obj.description;
262
+ var path_description = path + '.description';
263
+ if (typeof obj_description !== 'string') {
264
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
265
+ }
266
+ }
267
+ var obj_developerName = obj.developerName;
268
+ var path_developerName = path + '.developerName';
269
+ if (typeof obj_developerName !== 'string') {
270
+ return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
271
+ }
272
+ if (obj.link !== undefined) {
273
+ var obj_link_1 = obj.link;
274
+ var path_link_1 = path + '.link';
275
+ var obj_link_union0 = null;
276
+ var obj_link_union0_error = (function () {
277
+ var referencepath_linkValidationError = validate$g(obj_link_1, path_link_1);
278
+ if (referencepath_linkValidationError !== null) {
279
+ var message = 'Object doesn\'t match LightningAssistantLinkRepresentation (at "' + path_link_1 + '")\n';
280
+ message += referencepath_linkValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
281
+ return new TypeError(message);
282
+ }
283
+ })();
284
+ if (obj_link_union0_error != null) {
285
+ obj_link_union0 = obj_link_union0_error.message;
286
+ }
287
+ var obj_link_union1 = null;
288
+ var obj_link_union1_error = (function () {
289
+ if (obj_link_1 !== null) {
290
+ return new TypeError('Expected "null" but received "' + typeof obj_link_1 + '" (at "' + path_link_1 + '")');
291
+ }
292
+ })();
293
+ if (obj_link_union1_error != null) {
294
+ obj_link_union1 = obj_link_union1_error.message;
295
+ }
296
+ if (obj_link_union0 && obj_link_union1) {
297
+ var message = 'Object doesn\'t match union (at "' + path_link_1 + '")';
298
+ message += '\n' + obj_link_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
299
+ message += '\n' + obj_link_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
300
+ return new TypeError(message);
301
+ }
302
+ }
303
+ var obj_title = obj.title;
304
+ var path_title = path + '.title';
305
+ if (typeof obj_title !== 'string') {
306
+ return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
307
+ }
308
+ })();
309
+ return v_error === undefined ? null : v_error;
310
+ }
311
+ var select$u = function LightningAssistantQuestionRepresentationSelect() {
312
+ var _a = select$w(), LightningAssistantChoiceRepresentation__selections = _a.selections;
313
+ var _b = select$v(), LightningAssistantLinkRepresentation__selections = _b.selections;
314
+ return {
315
+ kind: 'Fragment',
316
+ version: VERSION$j,
317
+ private: [],
318
+ selections: [
319
+ {
320
+ name: 'choices',
321
+ kind: 'Object',
322
+ plural: true,
323
+ selections: LightningAssistantChoiceRepresentation__selections
324
+ },
325
+ {
326
+ name: 'description',
327
+ kind: 'Scalar',
328
+ required: false
329
+ },
330
+ {
331
+ name: 'developerName',
332
+ kind: 'Scalar'
333
+ },
334
+ {
335
+ name: 'link',
336
+ kind: 'Object',
337
+ nullable: true,
338
+ selections: LightningAssistantLinkRepresentation__selections,
339
+ required: false
340
+ },
341
+ {
342
+ name: 'title',
343
+ kind: 'Scalar'
344
+ }
345
+ ]
346
+ };
347
+ };
348
+ function equals$c(existing, incoming) {
349
+ var existing_description = existing.description;
350
+ var incoming_description = incoming.description;
351
+ // if at least one of these optionals is defined
352
+ if (existing_description !== undefined || incoming_description !== undefined) {
353
+ // if one of these is not defined we know the other is defined and therefore
354
+ // not equal
355
+ if (existing_description === undefined || incoming_description === undefined) {
356
+ return false;
357
+ }
358
+ if (!(existing_description === incoming_description)) {
359
+ return false;
360
+ }
361
+ }
362
+ var existing_developerName = existing.developerName;
363
+ var incoming_developerName = incoming.developerName;
364
+ if (!(existing_developerName === incoming_developerName)) {
365
+ return false;
366
+ }
367
+ var existing_title = existing.title;
368
+ var incoming_title = incoming.title;
369
+ if (!(existing_title === incoming_title)) {
370
+ return false;
371
+ }
372
+ var existing_choices = existing.choices;
373
+ var incoming_choices = incoming.choices;
374
+ var equals_choices_items = equalsArray(existing_choices, incoming_choices, function (existing_choices_item, incoming_choices_item) {
375
+ if (!(equals$e(existing_choices_item, incoming_choices_item))) {
376
+ return false;
377
+ }
378
+ });
379
+ if (equals_choices_items === false) {
380
+ return false;
381
+ }
382
+ var existing_link = existing.link;
383
+ var incoming_link = incoming.link;
384
+ // if at least one of these optionals is defined
385
+ if (existing_link !== undefined || incoming_link !== undefined) {
386
+ // if one of these is not defined we know the other is defined and therefore
387
+ // not equal
388
+ if (existing_link === undefined || incoming_link === undefined) {
389
+ return false;
390
+ }
391
+ if (!(existing_link === incoming_link
392
+ || (existing_link != null &&
393
+ incoming_link != null &&
394
+ equals$d(existing_link, incoming_link)))) {
395
+ return false;
396
+ }
397
+ }
398
+ return true;
399
+ }
400
+
401
+ var VERSION$i = "defc7152bc133ff8e890226cd2092bf0";
402
+ function validate$e(obj, path) {
403
+ if (path === void 0) { path = 'LightningAssistantQuestionnaireRepresentation'; }
404
+ var v_error = (function () {
405
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
406
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
407
+ }
408
+ var obj_assistantTarget = obj.assistantTarget;
409
+ var path_assistantTarget = path + '.assistantTarget';
410
+ if (typeof obj_assistantTarget !== 'string') {
411
+ return new TypeError('Expected "string" but received "' + typeof obj_assistantTarget + '" (at "' + path_assistantTarget + '")');
412
+ }
413
+ if (obj.description !== undefined) {
414
+ var obj_description = obj.description;
415
+ var path_description = path + '.description';
416
+ if (typeof obj_description !== 'string') {
417
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
418
+ }
419
+ }
420
+ var obj_developerName = obj.developerName;
421
+ var path_developerName = path + '.developerName';
422
+ if (typeof obj_developerName !== 'string') {
423
+ return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
424
+ }
425
+ var obj_questions = obj.questions;
426
+ var path_questions = path + '.questions';
427
+ if (!ArrayIsArray(obj_questions)) {
428
+ return new TypeError('Expected "array" but received "' + typeof obj_questions + '" (at "' + path_questions + '")');
429
+ }
430
+ for (var i = 0; i < obj_questions.length; i++) {
431
+ var obj_questions_item = obj_questions[i];
432
+ var path_questions_item = path_questions + '[' + i + ']';
433
+ var referencepath_questions_itemValidationError = validate$f(obj_questions_item, path_questions_item);
434
+ if (referencepath_questions_itemValidationError !== null) {
435
+ var message = 'Object doesn\'t match LightningAssistantQuestionRepresentation (at "' + path_questions_item + '")\n';
436
+ message += referencepath_questions_itemValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
437
+ return new TypeError(message);
438
+ }
439
+ }
440
+ var obj_status = obj.status;
441
+ var path_status = path + '.status';
442
+ if (typeof obj_status !== 'string') {
443
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
444
+ }
445
+ var obj_title = obj.title;
446
+ var path_title = path + '.title';
447
+ if (typeof obj_title !== 'string') {
448
+ return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
449
+ }
450
+ })();
451
+ return v_error === undefined ? null : v_error;
452
+ }
453
+ var RepresentationType$8 = 'LightningAssistantQuestionnaireRepresentation';
454
+ function keyBuilder$j(luvio, config) {
455
+ return keyPrefix + '::' + RepresentationType$8 + ':' + config.questionnaire_name;
456
+ }
457
+ function keyBuilderFromType$7(luvio, object) {
458
+ var keyParams = {
459
+ questionnaire_name: object.developerName
460
+ };
461
+ return keyBuilder$j(luvio, keyParams);
462
+ }
463
+ function normalize$8(input, existing, path, luvio, store, timestamp) {
464
+ return input;
465
+ }
466
+ var select$t = function LightningAssistantQuestionnaireRepresentationSelect() {
467
+ var _a = select$u(), LightningAssistantQuestionRepresentation__selections = _a.selections;
468
+ return {
469
+ kind: 'Fragment',
470
+ version: VERSION$i,
471
+ private: [],
472
+ selections: [
473
+ {
474
+ name: 'assistantTarget',
475
+ kind: 'Scalar'
476
+ },
477
+ {
478
+ name: 'description',
479
+ kind: 'Scalar',
480
+ required: false
481
+ },
482
+ {
483
+ name: 'developerName',
484
+ kind: 'Scalar'
485
+ },
486
+ {
487
+ name: 'questions',
488
+ kind: 'Object',
489
+ plural: true,
490
+ selections: LightningAssistantQuestionRepresentation__selections
491
+ },
492
+ {
493
+ name: 'status',
494
+ kind: 'Scalar'
495
+ },
496
+ {
497
+ name: 'title',
498
+ kind: 'Scalar'
499
+ }
500
+ ]
501
+ };
502
+ };
503
+ function equals$b(existing, incoming) {
504
+ var existing_assistantTarget = existing.assistantTarget;
505
+ var incoming_assistantTarget = incoming.assistantTarget;
506
+ if (!(existing_assistantTarget === incoming_assistantTarget)) {
507
+ return false;
508
+ }
509
+ var existing_description = existing.description;
510
+ var incoming_description = incoming.description;
511
+ // if at least one of these optionals is defined
512
+ if (existing_description !== undefined || incoming_description !== undefined) {
513
+ // if one of these is not defined we know the other is defined and therefore
514
+ // not equal
515
+ if (existing_description === undefined || incoming_description === undefined) {
516
+ return false;
517
+ }
518
+ if (!(existing_description === incoming_description)) {
519
+ return false;
520
+ }
521
+ }
522
+ var existing_developerName = existing.developerName;
523
+ var incoming_developerName = incoming.developerName;
524
+ if (!(existing_developerName === incoming_developerName)) {
525
+ return false;
526
+ }
527
+ var existing_status = existing.status;
528
+ var incoming_status = incoming.status;
529
+ if (!(existing_status === incoming_status)) {
530
+ return false;
531
+ }
532
+ var existing_title = existing.title;
533
+ var incoming_title = incoming.title;
534
+ if (!(existing_title === incoming_title)) {
535
+ return false;
536
+ }
537
+ var existing_questions = existing.questions;
538
+ var incoming_questions = incoming.questions;
539
+ var equals_questions_items = equalsArray(existing_questions, incoming_questions, function (existing_questions_item, incoming_questions_item) {
540
+ if (!(equals$c(existing_questions_item, incoming_questions_item))) {
541
+ return false;
542
+ }
543
+ });
544
+ if (equals_questions_items === false) {
545
+ return false;
546
+ }
547
+ return true;
548
+ }
549
+ var ingest$8 = function LightningAssistantQuestionnaireRepresentationIngest(input, path, luvio, store, timestamp) {
550
+ if (process.env.NODE_ENV !== 'production') {
551
+ var validateError = validate$e(input);
552
+ if (validateError !== null) {
553
+ throw validateError;
554
+ }
555
+ }
556
+ var key = keyBuilderFromType$7(luvio, input);
557
+ var existingRecord = store.readEntry(key);
558
+ var ttlToUse = path.ttl !== undefined ? path.ttl : 2592000000;
559
+ var incomingRecord = normalize$8(input, store.readEntry(key), {
560
+ fullPath: key,
561
+ parent: path.parent,
562
+ propertyName: path.propertyName,
563
+ ttl: ttlToUse
564
+ });
565
+ if (existingRecord === undefined || equals$b(existingRecord, incomingRecord) === false) {
566
+ luvio.storePublish(key, incomingRecord);
567
+ }
568
+ if (ttlToUse !== undefined) {
569
+ var storeMetadataParams = {
570
+ ttl: ttlToUse,
571
+ namespace: "LEAP",
572
+ version: VERSION$i,
573
+ representationName: RepresentationType$8,
574
+ };
575
+ luvio.publishStoreMetadata(key, storeMetadataParams);
576
+ }
577
+ return createLink(key);
578
+ };
579
+ function getTypeCacheKeys$8(luvio, input, fullPathFactory) {
580
+ var rootKeySet = new engine.StoreKeyMap();
581
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
582
+ var rootKey = keyBuilderFromType$7(luvio, input);
583
+ rootKeySet.set(rootKey, {
584
+ namespace: keyPrefix,
585
+ representationName: RepresentationType$8,
586
+ mergeable: false
587
+ });
588
+ return rootKeySet;
589
+ }
590
+
591
+ function select$s(luvio, params) {
592
+ return select$t();
593
+ }
594
+ function keyBuilder$i(luvio, params) {
595
+ return keyBuilder$j(luvio, {
596
+ questionnaire_name: params.urlParams.questionnaireName
597
+ });
598
+ }
599
+ function getResponseCacheKeys$a(luvio, resourceParams, response) {
600
+ return getTypeCacheKeys$8(luvio, response);
601
+ }
602
+ function ingestSuccess$a(luvio, resourceParams, response, snapshotRefresh) {
603
+ var body = response.body;
604
+ var key = keyBuilder$i(luvio, resourceParams);
605
+ luvio.storeIngest(key, ingest$8, body);
606
+ var snapshot = luvio.storeLookup({
607
+ recordId: key,
608
+ node: select$s(),
609
+ variables: {},
610
+ }, snapshotRefresh);
611
+ if (process.env.NODE_ENV !== 'production') {
612
+ if (snapshot.state !== 'Fulfilled') {
613
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
614
+ }
615
+ }
616
+ return snapshot;
617
+ }
618
+ function ingestError$5(luvio, params, error, snapshotRefresh) {
619
+ var key = keyBuilder$i(luvio, params);
620
+ var errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
621
+ luvio.storeIngestError(key, errorSnapshot);
622
+ return errorSnapshot;
623
+ }
624
+ function createResourceRequest$a(config) {
625
+ var headers = {};
626
+ return {
627
+ baseUri: '/services/data/v58.0',
628
+ basePath: '/assistant-platform/questionnaire/' + config.urlParams.questionnaireName + '',
629
+ method: 'get',
630
+ body: null,
631
+ urlParams: config.urlParams,
632
+ queryParams: {},
633
+ headers: headers,
634
+ priority: 'normal',
635
+ };
636
+ }
637
+
638
+ var getQuestionnaire_ConfigPropertyNames = {
639
+ displayName: 'getQuestionnaire',
640
+ parameters: {
641
+ required: ['questionnaireName'],
642
+ optional: []
643
+ }
644
+ };
645
+ function createResourceParams$a(config) {
646
+ var resourceParams = {
647
+ urlParams: {
648
+ questionnaireName: config.questionnaireName
649
+ }
650
+ };
651
+ return resourceParams;
652
+ }
653
+ function keyBuilder$h(luvio, config) {
654
+ var resourceParams = createResourceParams$a(config);
655
+ return keyBuilder$i(luvio, resourceParams);
656
+ }
657
+ function typeCheckConfig$a(untrustedConfig) {
658
+ var config = {};
659
+ var untrustedConfig_questionnaireName = untrustedConfig.questionnaireName;
660
+ if (typeof untrustedConfig_questionnaireName === 'string') {
661
+ config.questionnaireName = untrustedConfig_questionnaireName;
662
+ }
663
+ return config;
664
+ }
665
+ function validateAdapterConfig$a(untrustedConfig, configPropertyNames) {
666
+ if (!untrustedIsObject(untrustedConfig)) {
667
+ return null;
668
+ }
669
+ if (process.env.NODE_ENV !== 'production') {
670
+ validateConfig(untrustedConfig, configPropertyNames);
671
+ }
672
+ var config = typeCheckConfig$a(untrustedConfig);
673
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
674
+ return null;
675
+ }
676
+ return config;
677
+ }
678
+ function adapterFragment$5(luvio, config) {
679
+ createResourceParams$a(config);
680
+ return select$s();
681
+ }
682
+ function onFetchResponseSuccess$5(luvio, config, resourceParams, response) {
683
+ var snapshot = ingestSuccess$a(luvio, resourceParams, response, {
684
+ config: config,
685
+ resolve: function () { return buildNetworkSnapshot$a(luvio, config, snapshotRefreshOptions); }
686
+ });
687
+ return luvio.storeBroadcast().then(function () { return snapshot; });
688
+ }
689
+ function onFetchResponseError$5(luvio, config, resourceParams, response) {
690
+ var snapshot = ingestError$5(luvio, resourceParams, response, {
691
+ config: config,
692
+ resolve: function () { return buildNetworkSnapshot$a(luvio, config, snapshotRefreshOptions); }
693
+ });
694
+ return luvio.storeBroadcast().then(function () { return snapshot; });
695
+ }
696
+ function buildNetworkSnapshot$a(luvio, config, options) {
697
+ var resourceParams = createResourceParams$a(config);
698
+ var request = createResourceRequest$a(resourceParams);
699
+ return luvio.dispatchResourceRequest(request, options)
700
+ .then(function (response) {
701
+ return luvio.handleSuccessResponse(function () { return onFetchResponseSuccess$5(luvio, config, resourceParams, response); }, function () { return getResponseCacheKeys$a(luvio, resourceParams, response.body); });
702
+ }, function (response) {
703
+ return luvio.handleErrorResponse(function () { return onFetchResponseError$5(luvio, config, resourceParams, response); });
704
+ });
705
+ }
706
+ function buildNetworkSnapshotCachePolicy$5(context, coercedAdapterRequestContext) {
707
+ var luvio = context.luvio, config = context.config;
708
+ var networkPriority = coercedAdapterRequestContext.networkPriority, requestCorrelator = coercedAdapterRequestContext.requestCorrelator, eventObservers = coercedAdapterRequestContext.eventObservers;
709
+ var dispatchOptions = {
710
+ resourceRequestContext: {
711
+ requestCorrelator: requestCorrelator,
712
+ luvioRequestMethod: undefined,
713
+ },
714
+ eventObservers: eventObservers
715
+ };
716
+ if (networkPriority !== 'normal') {
717
+ dispatchOptions.overrides = {
718
+ priority: networkPriority
719
+ };
720
+ }
721
+ return buildNetworkSnapshot$a(luvio, config, dispatchOptions);
722
+ }
723
+ function buildCachedSnapshotCachePolicy$5(context, storeLookup) {
724
+ var luvio = context.luvio, config = context.config;
725
+ var selector = {
726
+ recordId: keyBuilder$h(luvio, config),
727
+ node: adapterFragment$5(luvio, config),
728
+ variables: {},
729
+ };
730
+ var cacheSnapshot = storeLookup(selector, {
731
+ config: config,
732
+ resolve: function () { return buildNetworkSnapshot$a(luvio, config, snapshotRefreshOptions); }
733
+ });
734
+ return cacheSnapshot;
735
+ }
736
+ var getQuestionnaireAdapterFactory = function (luvio) { return function LEAP__getQuestionnaire(untrustedConfig, requestContext) {
737
+ var config = validateAdapterConfig$a(untrustedConfig, getQuestionnaire_ConfigPropertyNames);
738
+ // Invalid or incomplete config
739
+ if (config === null) {
740
+ return null;
741
+ }
742
+ return luvio.applyCachePolicy((requestContext || {}), { config: config, luvio: luvio }, // BuildSnapshotContext
743
+ buildCachedSnapshotCachePolicy$5, buildNetworkSnapshotCachePolicy$5);
744
+ }; };
745
+
746
+ function validate$d(obj, path) {
747
+ if (path === void 0) { path = 'LightningAssistantQuestionnaireInputRepresentation'; }
748
+ var v_error = (function () {
749
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
750
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
751
+ }
752
+ var obj_questionToAnswer = obj.questionToAnswer;
753
+ var path_questionToAnswer = path + '.questionToAnswer';
754
+ if (typeof obj_questionToAnswer !== 'object' || ArrayIsArray(obj_questionToAnswer) || obj_questionToAnswer === null) {
755
+ return new TypeError('Expected "object" but received "' + typeof obj_questionToAnswer + '" (at "' + path_questionToAnswer + '")');
756
+ }
757
+ var obj_questionToAnswer_keys = ObjectKeys(obj_questionToAnswer);
758
+ for (var i = 0; i < obj_questionToAnswer_keys.length; i++) {
759
+ var key = obj_questionToAnswer_keys[i];
760
+ var obj_questionToAnswer_prop = obj_questionToAnswer[key];
761
+ var path_questionToAnswer_prop = path_questionToAnswer + '["' + key + '"]';
762
+ if (typeof obj_questionToAnswer_prop !== 'object' || ArrayIsArray(obj_questionToAnswer_prop) || obj_questionToAnswer_prop === null) {
763
+ return new TypeError('Expected "object" but received "' + typeof obj_questionToAnswer_prop + '" (at "' + path_questionToAnswer_prop + '")');
764
+ }
765
+ }
766
+ var obj_status = obj.status;
767
+ var path_status = path + '.status';
768
+ if (typeof obj_status !== 'string') {
769
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
770
+ }
771
+ })();
772
+ return v_error === undefined ? null : v_error;
773
+ }
774
+
775
+ function select$r(luvio, params) {
776
+ return select$t();
777
+ }
778
+ function getResponseCacheKeys$9(luvio, resourceParams, response) {
779
+ return getTypeCacheKeys$8(luvio, response);
780
+ }
781
+ function ingestSuccess$9(luvio, resourceParams, response) {
782
+ var body = response.body;
783
+ var key = keyBuilderFromType$7(luvio, body);
784
+ luvio.storeIngest(key, ingest$8, body);
785
+ var snapshot = luvio.storeLookup({
786
+ recordId: key,
787
+ node: select$r(),
788
+ variables: {},
789
+ });
790
+ if (process.env.NODE_ENV !== 'production') {
791
+ if (snapshot.state !== 'Fulfilled') {
792
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
793
+ }
794
+ }
795
+ return snapshot;
796
+ }
797
+ function createResourceRequest$9(config) {
798
+ var headers = {};
799
+ return {
800
+ baseUri: '/services/data/v58.0',
801
+ basePath: '/assistant-platform/questionnaire/' + config.urlParams.questionnaireName + '',
802
+ method: 'patch',
803
+ body: config.body,
804
+ urlParams: config.urlParams,
805
+ queryParams: {},
806
+ headers: headers,
807
+ priority: 'normal',
808
+ };
809
+ }
810
+
811
+ var saveQuestionnaire_ConfigPropertyNames = {
812
+ displayName: 'saveQuestionnaire',
813
+ parameters: {
814
+ required: ['questionnaireName', 'questionnaireData'],
815
+ optional: []
816
+ }
817
+ };
818
+ function createResourceParams$9(config) {
819
+ var resourceParams = {
820
+ urlParams: {
821
+ questionnaireName: config.questionnaireName
822
+ },
823
+ body: {
824
+ questionnaireData: config.questionnaireData
825
+ }
826
+ };
827
+ return resourceParams;
828
+ }
829
+ function typeCheckConfig$9(untrustedConfig) {
830
+ var config = {};
831
+ var untrustedConfig_questionnaireName = untrustedConfig.questionnaireName;
832
+ if (typeof untrustedConfig_questionnaireName === 'string') {
833
+ config.questionnaireName = untrustedConfig_questionnaireName;
834
+ }
835
+ var untrustedConfig_questionnaireData = untrustedConfig.questionnaireData;
836
+ var referenceLightningAssistantQuestionnaireInputRepresentationValidationError = validate$d(untrustedConfig_questionnaireData);
837
+ if (referenceLightningAssistantQuestionnaireInputRepresentationValidationError === null) {
838
+ config.questionnaireData = untrustedConfig_questionnaireData;
839
+ }
840
+ return config;
841
+ }
842
+ function validateAdapterConfig$9(untrustedConfig, configPropertyNames) {
843
+ if (!untrustedIsObject(untrustedConfig)) {
844
+ return null;
845
+ }
846
+ if (process.env.NODE_ENV !== 'production') {
847
+ validateConfig(untrustedConfig, configPropertyNames);
848
+ }
849
+ var config = typeCheckConfig$9(untrustedConfig);
850
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
851
+ return null;
852
+ }
853
+ return config;
854
+ }
855
+ function buildNetworkSnapshot$9(luvio, config, options) {
856
+ var resourceParams = createResourceParams$9(config);
857
+ var request = createResourceRequest$9(resourceParams);
858
+ return luvio.dispatchResourceRequest(request, options)
859
+ .then(function (response) {
860
+ return luvio.handleSuccessResponse(function () {
861
+ var snapshot = ingestSuccess$9(luvio, resourceParams, response);
862
+ return luvio.storeBroadcast().then(function () { return snapshot; });
863
+ }, function () { return getResponseCacheKeys$9(luvio, resourceParams, response.body); });
864
+ }, function (response) {
865
+ deepFreeze(response);
866
+ throw response;
867
+ });
868
+ }
869
+ var saveQuestionnaireAdapterFactory = function (luvio) {
870
+ return function saveQuestionnaire(untrustedConfig) {
871
+ var config = validateAdapterConfig$9(untrustedConfig, saveQuestionnaire_ConfigPropertyNames);
872
+ // Invalid or incomplete config
873
+ if (config === null) {
874
+ throw new Error('Invalid config for "saveQuestionnaire"');
875
+ }
876
+ return buildNetworkSnapshot$9(luvio, config);
877
+ };
878
+ };
879
+
880
+ /******************************************************************************
881
+ Copyright (c) Microsoft Corporation.
882
+
883
+ Permission to use, copy, modify, and/or distribute this software for any
884
+ purpose with or without fee is hereby granted.
885
+
886
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
887
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
888
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
889
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
890
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
891
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
892
+ PERFORMANCE OF THIS SOFTWARE.
893
+ ***************************************************************************** */
894
+
895
+ function __spreadArray(to, from, pack) {
896
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
897
+ if (ar || !(i in from)) {
898
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
899
+ ar[i] = from[i];
900
+ }
901
+ }
902
+ return to.concat(ar || Array.prototype.slice.call(from));
903
+ }
904
+
905
+ var VERSION$h = "a9a46e0cf983e314934e0703d28f75bf";
906
+ var select$q = function LightningAssistantLinkActionRepresentationSelect() {
907
+ var AbstractLightningAssistantActionRepresentationSelections = select$j().selections;
908
+ return {
909
+ kind: 'Fragment',
910
+ version: VERSION$h,
911
+ private: [],
912
+ selections: __spreadArray(__spreadArray([], AbstractLightningAssistantActionRepresentationSelections, true), [
913
+ {
914
+ name: 'iconName',
915
+ kind: 'Scalar',
916
+ required: false
917
+ },
918
+ {
919
+ name: 'label',
920
+ kind: 'Scalar',
921
+ required: false
922
+ },
923
+ {
924
+ name: 'url',
925
+ kind: 'Scalar'
926
+ }
927
+ ], false)
928
+ };
929
+ };
930
+
931
+ var VERSION$g = "c2fb7ece6f9eba9ca7b25608a670310a";
932
+ var select$p = function LightningAssistantCustomActionRepresentationSelect() {
933
+ var AbstractLightningAssistantActionRepresentationSelections = select$j().selections;
934
+ return {
935
+ kind: 'Fragment',
936
+ version: VERSION$g,
937
+ private: [],
938
+ selections: __spreadArray(__spreadArray([], AbstractLightningAssistantActionRepresentationSelections, true), [
939
+ {
940
+ name: 'actionComponent',
941
+ kind: 'Scalar'
942
+ },
943
+ {
944
+ name: 'customData',
945
+ kind: 'Scalar',
946
+ map: true
947
+ },
948
+ {
949
+ name: 'iconName',
950
+ kind: 'Scalar',
951
+ required: false
952
+ }
953
+ ], false)
954
+ };
955
+ };
956
+
957
+ var VERSION$f = "376fdaae939e8f46021d153816e03c56";
958
+ var select$o = function LightningAssistantNoActionRepresentationSelect() {
959
+ var AbstractLightningAssistantActionRepresentationSelections = select$j().selections;
960
+ return {
961
+ kind: 'Fragment',
962
+ version: VERSION$f,
963
+ private: [],
964
+ selections: __spreadArray([], AbstractLightningAssistantActionRepresentationSelections, true)
965
+ };
966
+ };
967
+
968
+ var VERSION$e = "2e0cc24f5c0ab2bbf7b6dade0eecb17e";
969
+ var select$n = function LightningAssistantLsfActionRepresentationSelect() {
970
+ var AbstractLightningAssistantActionRepresentationSelections = select$j().selections;
971
+ return {
972
+ kind: 'Fragment',
973
+ version: VERSION$e,
974
+ private: [],
975
+ selections: __spreadArray(__spreadArray([], AbstractLightningAssistantActionRepresentationSelections, true), [
976
+ {
977
+ name: 'customData',
978
+ kind: 'Scalar',
979
+ map: true,
980
+ required: false
981
+ },
982
+ {
983
+ name: 'iconName',
984
+ kind: 'Scalar',
985
+ required: false
986
+ },
987
+ {
988
+ name: 'label',
989
+ kind: 'Scalar',
990
+ required: false
991
+ },
992
+ {
993
+ name: 'lsf',
994
+ kind: 'Scalar'
995
+ }
996
+ ], false)
997
+ };
998
+ };
999
+
1000
+ var VERSION$d = "d7605ace66fce89a8ae0436b797d125d";
1001
+ var select$m = function LightningAssistantVideoActionRepresentationSelect() {
1002
+ var AbstractLightningAssistantActionRepresentationSelections = select$j().selections;
1003
+ return {
1004
+ kind: 'Fragment',
1005
+ version: VERSION$d,
1006
+ private: [],
1007
+ selections: __spreadArray(__spreadArray([], AbstractLightningAssistantActionRepresentationSelections, true), [
1008
+ {
1009
+ name: 'iconName',
1010
+ kind: 'Scalar',
1011
+ required: false
1012
+ },
1013
+ {
1014
+ name: 'url',
1015
+ kind: 'Scalar'
1016
+ }
1017
+ ], false)
1018
+ };
1019
+ };
1020
+
1021
+ var VERSION$c = "fe9b2afa38e1fc9af6abd29c7fd3e307";
1022
+ var select$l = function LightningAssistantWalkthroughActionRepresentationSelect() {
1023
+ var AbstractLightningAssistantActionRepresentationSelections = select$j().selections;
1024
+ return {
1025
+ kind: 'Fragment',
1026
+ version: VERSION$c,
1027
+ private: [],
1028
+ selections: __spreadArray(__spreadArray([], AbstractLightningAssistantActionRepresentationSelections, true), [
1029
+ {
1030
+ name: 'iconName',
1031
+ kind: 'Scalar',
1032
+ required: false
1033
+ },
1034
+ {
1035
+ name: 'promptId',
1036
+ kind: 'Scalar'
1037
+ }
1038
+ ], false)
1039
+ };
1040
+ };
1041
+
1042
+ var VERSION$b = "2abd7cd970bb200649e8944e43b72de5";
1043
+ var select$k = function LightningAssistantTrailheadActionRepresentationSelect() {
1044
+ var AbstractLightningAssistantActionRepresentationSelections = select$j().selections;
1045
+ return {
1046
+ kind: 'Fragment',
1047
+ version: VERSION$b,
1048
+ private: [],
1049
+ selections: __spreadArray(__spreadArray([], AbstractLightningAssistantActionRepresentationSelections, true), [
1050
+ {
1051
+ name: 'iconName',
1052
+ kind: 'Scalar',
1053
+ required: false
1054
+ },
1055
+ {
1056
+ name: 'moduleId',
1057
+ kind: 'Scalar'
1058
+ },
1059
+ {
1060
+ name: 'url',
1061
+ kind: 'Scalar'
1062
+ }
1063
+ ], false)
1064
+ };
1065
+ };
1066
+
1067
+ var DiscriminatorValues;
1068
+ (function (DiscriminatorValues) {
1069
+ DiscriminatorValues["Link"] = "Link";
1070
+ DiscriminatorValues["Custom"] = "Custom";
1071
+ DiscriminatorValues["NoAction"] = "NoAction";
1072
+ DiscriminatorValues["Lsf"] = "Lsf";
1073
+ DiscriminatorValues["Video"] = "Video";
1074
+ DiscriminatorValues["Walkthrough"] = "Walkthrough";
1075
+ DiscriminatorValues["TlxModule"] = "TlxModule";
1076
+ })(DiscriminatorValues || (DiscriminatorValues = {}));
1077
+ var VERSION$a = "ee8eb1dcdc27527e958bea3bc608ab0c";
1078
+ function validate$c(obj, path) {
1079
+ if (path === void 0) { path = 'AbstractLightningAssistantActionRepresentation'; }
1080
+ var v_error = (function () {
1081
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1082
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1083
+ }
1084
+ var obj_actionType = obj.actionType;
1085
+ var path_actionType = path + '.actionType';
1086
+ if (typeof obj_actionType !== 'string') {
1087
+ return new TypeError('Expected "string" but received "' + typeof obj_actionType + '" (at "' + path_actionType + '")');
1088
+ }
1089
+ })();
1090
+ return v_error === undefined ? null : v_error;
1091
+ }
1092
+ var selectChildren = function AbstractLightningAssistantActionRepresentationSelectChildren() {
1093
+ var _a;
1094
+ var lightningAssistantLinkActionRepresentationSelections = select$q();
1095
+ var lightningAssistantCustomActionRepresentationSelections = select$p();
1096
+ var lightningAssistantNoActionRepresentationSelections = select$o();
1097
+ var lightningAssistantLsfActionRepresentationSelections = select$n();
1098
+ var lightningAssistantVideoActionRepresentationSelections = select$m();
1099
+ var lightningAssistantWalkthroughActionRepresentationSelections = select$l();
1100
+ var lightningAssistantTrailheadActionRepresentationSelections = select$k();
1101
+ return {
1102
+ kind: 'Fragment',
1103
+ union: true,
1104
+ discriminator: 'actionType',
1105
+ unionSelections: (_a = {},
1106
+ _a[DiscriminatorValues.Link] = lightningAssistantLinkActionRepresentationSelections,
1107
+ _a[DiscriminatorValues.Custom] = lightningAssistantCustomActionRepresentationSelections,
1108
+ _a[DiscriminatorValues.NoAction] = lightningAssistantNoActionRepresentationSelections,
1109
+ _a[DiscriminatorValues.Lsf] = lightningAssistantLsfActionRepresentationSelections,
1110
+ _a[DiscriminatorValues.Video] = lightningAssistantVideoActionRepresentationSelections,
1111
+ _a[DiscriminatorValues.Walkthrough] = lightningAssistantWalkthroughActionRepresentationSelections,
1112
+ _a[DiscriminatorValues.TlxModule] = lightningAssistantTrailheadActionRepresentationSelections,
1113
+ _a)
1114
+ };
1115
+ };
1116
+ var select$j = function AbstractLightningAssistantActionRepresentationSelect() {
1117
+ return {
1118
+ kind: 'Fragment',
1119
+ version: VERSION$a,
1120
+ private: [],
1121
+ selections: [
1122
+ {
1123
+ name: 'actionType',
1124
+ kind: 'Scalar'
1125
+ }
1126
+ ]
1127
+ };
1128
+ };
1129
+ function equals$a(existing, incoming) {
1130
+ var existing_actionType = existing.actionType;
1131
+ var incoming_actionType = incoming.actionType;
1132
+ if (!(existing_actionType === incoming_actionType)) {
1133
+ return false;
1134
+ }
1135
+ return true;
1136
+ }
1137
+
1138
+ var VERSION$9 = "28b96e40cf73e94d0650007d61c3214a";
1139
+ function validate$b(obj, path) {
1140
+ if (path === void 0) { path = 'LightningAssistantStepRepresentation'; }
1141
+ var v_error = (function () {
1142
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1143
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1144
+ }
1145
+ var obj_action = obj.action;
1146
+ var path_action = path + '.action';
1147
+ var referencepath_actionValidationError = validate$c(obj_action, path_action);
1148
+ if (referencepath_actionValidationError !== null) {
1149
+ var message = 'Object doesn\'t match AbstractLightningAssistantActionRepresentation (at "' + path_action + '")\n';
1150
+ message += referencepath_actionValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1151
+ return new TypeError(message);
1152
+ }
1153
+ if (obj.description !== undefined) {
1154
+ var obj_description = obj.description;
1155
+ var path_description = path + '.description';
1156
+ if (typeof obj_description !== 'string') {
1157
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
1158
+ }
1159
+ }
1160
+ if (obj.figureComponent !== undefined) {
1161
+ var obj_figureComponent = obj.figureComponent;
1162
+ var path_figureComponent = path + '.figureComponent';
1163
+ if (typeof obj_figureComponent !== 'string') {
1164
+ return new TypeError('Expected "string" but received "' + typeof obj_figureComponent + '" (at "' + path_figureComponent + '")');
1165
+ }
1166
+ }
1167
+ if (obj.firstSeenTime !== undefined) {
1168
+ var obj_firstSeenTime = obj.firstSeenTime;
1169
+ var path_firstSeenTime = path + '.firstSeenTime';
1170
+ if (typeof obj_firstSeenTime !== 'string') {
1171
+ return new TypeError('Expected "string" but received "' + typeof obj_firstSeenTime + '" (at "' + path_firstSeenTime + '")');
1172
+ }
1173
+ }
1174
+ var obj_id = obj.id;
1175
+ var path_id = path + '.id';
1176
+ if (typeof obj_id !== 'string') {
1177
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
1178
+ }
1179
+ var obj_isManaged = obj.isManaged;
1180
+ var path_isManaged = path + '.isManaged';
1181
+ if (typeof obj_isManaged !== 'boolean') {
1182
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isManaged + '" (at "' + path_isManaged + '")');
1183
+ }
1184
+ var obj_status = obj.status;
1185
+ var path_status = path + '.status';
1186
+ if (typeof obj_status !== 'string') {
1187
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
1188
+ }
1189
+ if (obj.stepComponent !== undefined) {
1190
+ var obj_stepComponent = obj.stepComponent;
1191
+ var path_stepComponent = path + '.stepComponent';
1192
+ if (typeof obj_stepComponent !== 'string') {
1193
+ return new TypeError('Expected "string" but received "' + typeof obj_stepComponent + '" (at "' + path_stepComponent + '")');
1194
+ }
1195
+ }
1196
+ var obj_tags = obj.tags;
1197
+ var path_tags = path + '.tags';
1198
+ if (!ArrayIsArray(obj_tags)) {
1199
+ return new TypeError('Expected "array" but received "' + typeof obj_tags + '" (at "' + path_tags + '")');
1200
+ }
1201
+ for (var i = 0; i < obj_tags.length; i++) {
1202
+ var obj_tags_item = obj_tags[i];
1203
+ var path_tags_item = path_tags + '[' + i + ']';
1204
+ if (typeof obj_tags_item !== 'string') {
1205
+ return new TypeError('Expected "string" but received "' + typeof obj_tags_item + '" (at "' + path_tags_item + '")');
1206
+ }
1207
+ }
1208
+ var obj_title = obj.title;
1209
+ var path_title = path + '.title';
1210
+ if (typeof obj_title !== 'string') {
1211
+ return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
1212
+ }
1213
+ var obj_updateStrategy = obj.updateStrategy;
1214
+ var path_updateStrategy = path + '.updateStrategy';
1215
+ if (typeof obj_updateStrategy !== 'string') {
1216
+ return new TypeError('Expected "string" but received "' + typeof obj_updateStrategy + '" (at "' + path_updateStrategy + '")');
1217
+ }
1218
+ })();
1219
+ return v_error === undefined ? null : v_error;
1220
+ }
1221
+ var RepresentationType$7 = 'LightningAssistantStepRepresentation';
1222
+ function keyBuilder$g(luvio, config) {
1223
+ return keyPrefix + '::' + RepresentationType$7 + ':' + config.step_id;
1224
+ }
1225
+ function keyBuilderFromType$6(luvio, object) {
1226
+ var keyParams = {
1227
+ step_id: object.id
1228
+ };
1229
+ return keyBuilder$g(luvio, keyParams);
1230
+ }
1231
+ function normalize$7(input, existing, path, luvio, store, timestamp) {
1232
+ return input;
1233
+ }
1234
+ var select$i = function LightningAssistantStepRepresentationSelect() {
1235
+ var AbstractLightningAssistantActionRepresentation__unionSelections = selectChildren();
1236
+ return {
1237
+ kind: 'Fragment',
1238
+ version: VERSION$9,
1239
+ private: [],
1240
+ selections: [
1241
+ {
1242
+ kind: 'Object',
1243
+ name: 'action',
1244
+ discriminator: AbstractLightningAssistantActionRepresentation__unionSelections.discriminator,
1245
+ union: true,
1246
+ nullable: false,
1247
+ unionSelections: AbstractLightningAssistantActionRepresentation__unionSelections.unionSelections
1248
+ },
1249
+ {
1250
+ name: 'description',
1251
+ kind: 'Scalar',
1252
+ required: false
1253
+ },
1254
+ {
1255
+ name: 'figureComponent',
1256
+ kind: 'Scalar',
1257
+ required: false
1258
+ },
1259
+ {
1260
+ name: 'firstSeenTime',
1261
+ kind: 'Scalar',
1262
+ required: false
1263
+ },
1264
+ {
1265
+ name: 'id',
1266
+ kind: 'Scalar'
1267
+ },
1268
+ {
1269
+ name: 'isManaged',
1270
+ kind: 'Scalar'
1271
+ },
1272
+ {
1273
+ name: 'status',
1274
+ kind: 'Scalar'
1275
+ },
1276
+ {
1277
+ name: 'stepComponent',
1278
+ kind: 'Scalar',
1279
+ required: false
1280
+ },
1281
+ {
1282
+ name: 'tags',
1283
+ kind: 'Scalar',
1284
+ plural: true
1285
+ },
1286
+ {
1287
+ name: 'title',
1288
+ kind: 'Scalar'
1289
+ },
1290
+ {
1291
+ name: 'updateStrategy',
1292
+ kind: 'Scalar'
1293
+ }
1294
+ ]
1295
+ };
1296
+ };
1297
+ function equals$9(existing, incoming) {
1298
+ var existing_isManaged = existing.isManaged;
1299
+ var incoming_isManaged = incoming.isManaged;
1300
+ if (!(existing_isManaged === incoming_isManaged)) {
1301
+ return false;
1302
+ }
1303
+ var existing_description = existing.description;
1304
+ var incoming_description = incoming.description;
1305
+ // if at least one of these optionals is defined
1306
+ if (existing_description !== undefined || incoming_description !== undefined) {
1307
+ // if one of these is not defined we know the other is defined and therefore
1308
+ // not equal
1309
+ if (existing_description === undefined || incoming_description === undefined) {
1310
+ return false;
1311
+ }
1312
+ if (!(existing_description === incoming_description)) {
1313
+ return false;
1314
+ }
1315
+ }
1316
+ var existing_figureComponent = existing.figureComponent;
1317
+ var incoming_figureComponent = incoming.figureComponent;
1318
+ // if at least one of these optionals is defined
1319
+ if (existing_figureComponent !== undefined || incoming_figureComponent !== undefined) {
1320
+ // if one of these is not defined we know the other is defined and therefore
1321
+ // not equal
1322
+ if (existing_figureComponent === undefined || incoming_figureComponent === undefined) {
1323
+ return false;
1324
+ }
1325
+ if (!(existing_figureComponent === incoming_figureComponent)) {
1326
+ return false;
1327
+ }
1328
+ }
1329
+ var existing_firstSeenTime = existing.firstSeenTime;
1330
+ var incoming_firstSeenTime = incoming.firstSeenTime;
1331
+ // if at least one of these optionals is defined
1332
+ if (existing_firstSeenTime !== undefined || incoming_firstSeenTime !== undefined) {
1333
+ // if one of these is not defined we know the other is defined and therefore
1334
+ // not equal
1335
+ if (existing_firstSeenTime === undefined || incoming_firstSeenTime === undefined) {
1336
+ return false;
1337
+ }
1338
+ if (!(existing_firstSeenTime === incoming_firstSeenTime)) {
1339
+ return false;
1340
+ }
1341
+ }
1342
+ var existing_id = existing.id;
1343
+ var incoming_id = incoming.id;
1344
+ if (!(existing_id === incoming_id)) {
1345
+ return false;
1346
+ }
1347
+ var existing_status = existing.status;
1348
+ var incoming_status = incoming.status;
1349
+ if (!(existing_status === incoming_status)) {
1350
+ return false;
1351
+ }
1352
+ var existing_stepComponent = existing.stepComponent;
1353
+ var incoming_stepComponent = incoming.stepComponent;
1354
+ // if at least one of these optionals is defined
1355
+ if (existing_stepComponent !== undefined || incoming_stepComponent !== undefined) {
1356
+ // if one of these is not defined we know the other is defined and therefore
1357
+ // not equal
1358
+ if (existing_stepComponent === undefined || incoming_stepComponent === undefined) {
1359
+ return false;
1360
+ }
1361
+ if (!(existing_stepComponent === incoming_stepComponent)) {
1362
+ return false;
1363
+ }
1364
+ }
1365
+ var existing_title = existing.title;
1366
+ var incoming_title = incoming.title;
1367
+ if (!(existing_title === incoming_title)) {
1368
+ return false;
1369
+ }
1370
+ var existing_updateStrategy = existing.updateStrategy;
1371
+ var incoming_updateStrategy = incoming.updateStrategy;
1372
+ if (!(existing_updateStrategy === incoming_updateStrategy)) {
1373
+ return false;
1374
+ }
1375
+ var existing_action = existing.action;
1376
+ var incoming_action = incoming.action;
1377
+ if (!(equals$a(existing_action, incoming_action))) {
1378
+ return false;
1379
+ }
1380
+ var existing_tags = existing.tags;
1381
+ var incoming_tags = incoming.tags;
1382
+ var equals_tags_items = equalsArray(existing_tags, incoming_tags, function (existing_tags_item, incoming_tags_item) {
1383
+ if (!(existing_tags_item === incoming_tags_item)) {
1384
+ return false;
1385
+ }
1386
+ });
1387
+ if (equals_tags_items === false) {
1388
+ return false;
1389
+ }
1390
+ return true;
1391
+ }
1392
+ var ingest$7 = function LightningAssistantStepRepresentationIngest(input, path, luvio, store, timestamp) {
1393
+ if (process.env.NODE_ENV !== 'production') {
1394
+ var validateError = validate$b(input);
1395
+ if (validateError !== null) {
1396
+ throw validateError;
1397
+ }
1398
+ }
1399
+ var key = keyBuilderFromType$6(luvio, input);
1400
+ var existingRecord = store.readEntry(key);
1401
+ var ttlToUse = path.ttl !== undefined ? path.ttl : 2592000000;
1402
+ var incomingRecord = normalize$7(input, store.readEntry(key), {
1403
+ fullPath: key,
1404
+ parent: path.parent,
1405
+ propertyName: path.propertyName,
1406
+ ttl: ttlToUse
1407
+ });
1408
+ if (existingRecord === undefined || equals$9(existingRecord, incomingRecord) === false) {
1409
+ luvio.storePublish(key, incomingRecord);
1410
+ }
1411
+ if (ttlToUse !== undefined) {
1412
+ var storeMetadataParams = {
1413
+ ttl: ttlToUse,
1414
+ namespace: "LEAP",
1415
+ version: VERSION$9,
1416
+ representationName: RepresentationType$7,
1417
+ };
1418
+ luvio.publishStoreMetadata(key, storeMetadataParams);
1419
+ }
1420
+ return createLink(key);
1421
+ };
1422
+ function getTypeCacheKeys$7(luvio, input, fullPathFactory) {
1423
+ var rootKeySet = new engine.StoreKeyMap();
1424
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1425
+ var rootKey = keyBuilderFromType$6(luvio, input);
1426
+ rootKeySet.set(rootKey, {
1427
+ namespace: keyPrefix,
1428
+ representationName: RepresentationType$7,
1429
+ mergeable: false
1430
+ });
1431
+ return rootKeySet;
1432
+ }
1433
+
1434
+ function select$h(luvio, params) {
1435
+ return select$i();
1436
+ }
1437
+ function getResponseCacheKeys$8(luvio, resourceParams, response) {
1438
+ return getTypeCacheKeys$7(luvio, response);
1439
+ }
1440
+ function ingestSuccess$8(luvio, resourceParams, response) {
1441
+ var body = response.body;
1442
+ var key = keyBuilderFromType$6(luvio, body);
1443
+ luvio.storeIngest(key, ingest$7, body);
1444
+ var snapshot = luvio.storeLookup({
1445
+ recordId: key,
1446
+ node: select$h(),
1447
+ variables: {},
1448
+ });
1449
+ if (process.env.NODE_ENV !== 'production') {
1450
+ if (snapshot.state !== 'Fulfilled') {
1451
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1452
+ }
1453
+ }
1454
+ return snapshot;
1455
+ }
1456
+ function createResourceRequest$8(config) {
1457
+ var headers = {};
1458
+ return {
1459
+ baseUri: '/services/data/v58.0',
1460
+ basePath: '/assistant-platform/step/' + config.urlParams.stepName + '',
1461
+ method: 'patch',
1462
+ body: null,
1463
+ urlParams: config.urlParams,
1464
+ queryParams: {},
1465
+ headers: headers,
1466
+ priority: 'normal',
1467
+ };
1468
+ }
1469
+
1470
+ var evaluateStep_ConfigPropertyNames = {
1471
+ displayName: 'evaluateStep',
1472
+ parameters: {
1473
+ required: ['stepName'],
1474
+ optional: []
1475
+ }
1476
+ };
1477
+ function createResourceParams$8(config) {
1478
+ var resourceParams = {
1479
+ urlParams: {
1480
+ stepName: config.stepName
1481
+ }
1482
+ };
1483
+ return resourceParams;
1484
+ }
1485
+ function typeCheckConfig$8(untrustedConfig) {
1486
+ var config = {};
1487
+ var untrustedConfig_stepName = untrustedConfig.stepName;
1488
+ if (typeof untrustedConfig_stepName === 'string') {
1489
+ config.stepName = untrustedConfig_stepName;
1490
+ }
1491
+ return config;
1492
+ }
1493
+ function validateAdapterConfig$8(untrustedConfig, configPropertyNames) {
1494
+ if (!untrustedIsObject(untrustedConfig)) {
1495
+ return null;
1496
+ }
1497
+ if (process.env.NODE_ENV !== 'production') {
1498
+ validateConfig(untrustedConfig, configPropertyNames);
1499
+ }
1500
+ var config = typeCheckConfig$8(untrustedConfig);
1501
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1502
+ return null;
1503
+ }
1504
+ return config;
1505
+ }
1506
+ function buildNetworkSnapshot$8(luvio, config, options) {
1507
+ var resourceParams = createResourceParams$8(config);
1508
+ var request = createResourceRequest$8(resourceParams);
1509
+ return luvio.dispatchResourceRequest(request, options)
1510
+ .then(function (response) {
1511
+ return luvio.handleSuccessResponse(function () {
1512
+ var snapshot = ingestSuccess$8(luvio, resourceParams, response);
1513
+ return luvio.storeBroadcast().then(function () { return snapshot; });
1514
+ }, function () { return getResponseCacheKeys$8(luvio, resourceParams, response.body); });
1515
+ }, function (response) {
1516
+ deepFreeze(response);
1517
+ throw response;
1518
+ });
1519
+ }
1520
+ var evaluateStepAdapterFactory = function (luvio) {
1521
+ return function evaluateStep(untrustedConfig) {
1522
+ var config = validateAdapterConfig$8(untrustedConfig, evaluateStep_ConfigPropertyNames);
1523
+ // Invalid or incomplete config
1524
+ if (config === null) {
1525
+ throw new Error('Invalid config for "evaluateStep"');
1526
+ }
1527
+ return buildNetworkSnapshot$8(luvio, config);
1528
+ };
1529
+ };
1530
+
1531
+ var VERSION$8 = "bc99d93cdafe8300d6f09b735c390bcd";
1532
+ function validate$a(obj, path) {
1533
+ if (path === void 0) { path = 'LightningAssistantLayoutNodeRepresentation'; }
1534
+ var v_error = (function () {
1535
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1536
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1537
+ }
1538
+ var obj_children = obj.children;
1539
+ var path_children = path + '.children';
1540
+ if (!ArrayIsArray(obj_children)) {
1541
+ return new TypeError('Expected "array" but received "' + typeof obj_children + '" (at "' + path_children + '")');
1542
+ }
1543
+ for (var i = 0; i < obj_children.length; i++) {
1544
+ var obj_children_item = obj_children[i];
1545
+ var path_children_item = path_children + '[' + i + ']';
1546
+ if (obj_children_item === undefined) {
1547
+ return new TypeError('Expected "defined" but received "' + typeof obj_children_item + '" (at "' + path_children_item + '")');
1548
+ }
1549
+ }
1550
+ var obj_description = obj.description;
1551
+ var path_description = path + '.description';
1552
+ var obj_description_union0 = null;
1553
+ var obj_description_union0_error = (function () {
1554
+ if (typeof obj_description !== 'string') {
1555
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
1556
+ }
1557
+ })();
1558
+ if (obj_description_union0_error != null) {
1559
+ obj_description_union0 = obj_description_union0_error.message;
1560
+ }
1561
+ var obj_description_union1 = null;
1562
+ var obj_description_union1_error = (function () {
1563
+ if (obj_description !== null) {
1564
+ return new TypeError('Expected "null" but received "' + typeof obj_description + '" (at "' + path_description + '")');
1565
+ }
1566
+ })();
1567
+ if (obj_description_union1_error != null) {
1568
+ obj_description_union1 = obj_description_union1_error.message;
1569
+ }
1570
+ if (obj_description_union0 && obj_description_union1) {
1571
+ var message = 'Object doesn\'t match union (at "' + path_description + '")';
1572
+ message += '\n' + obj_description_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1573
+ message += '\n' + obj_description_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1574
+ return new TypeError(message);
1575
+ }
1576
+ var obj_status = obj.status;
1577
+ var path_status = path + '.status';
1578
+ var obj_status_union0 = null;
1579
+ var obj_status_union0_error = (function () {
1580
+ if (typeof obj_status !== 'string') {
1581
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
1582
+ }
1583
+ })();
1584
+ if (obj_status_union0_error != null) {
1585
+ obj_status_union0 = obj_status_union0_error.message;
1586
+ }
1587
+ var obj_status_union1 = null;
1588
+ var obj_status_union1_error = (function () {
1589
+ if (obj_status !== null) {
1590
+ return new TypeError('Expected "null" but received "' + typeof obj_status + '" (at "' + path_status + '")');
1591
+ }
1592
+ })();
1593
+ if (obj_status_union1_error != null) {
1594
+ obj_status_union1 = obj_status_union1_error.message;
1595
+ }
1596
+ if (obj_status_union0 && obj_status_union1) {
1597
+ var message = 'Object doesn\'t match union (at "' + path_status + '")';
1598
+ message += '\n' + obj_status_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1599
+ message += '\n' + obj_status_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1600
+ return new TypeError(message);
1601
+ }
1602
+ var obj_step = obj.step;
1603
+ var path_step = path + '.step';
1604
+ var obj_step_union0 = null;
1605
+ var obj_step_union0_error = (function () {
1606
+ if (typeof obj_step !== 'object') {
1607
+ return new TypeError('Expected "object" but received "' + typeof obj_step + '" (at "' + path_step + '")');
1608
+ }
1609
+ })();
1610
+ if (obj_step_union0_error != null) {
1611
+ obj_step_union0 = obj_step_union0_error.message;
1612
+ }
1613
+ var obj_step_union1 = null;
1614
+ var obj_step_union1_error = (function () {
1615
+ if (obj_step !== null) {
1616
+ return new TypeError('Expected "null" but received "' + typeof obj_step + '" (at "' + path_step + '")');
1617
+ }
1618
+ })();
1619
+ if (obj_step_union1_error != null) {
1620
+ obj_step_union1 = obj_step_union1_error.message;
1621
+ }
1622
+ if (obj_step_union0 && obj_step_union1) {
1623
+ var message = 'Object doesn\'t match union (at "' + path_step + '")';
1624
+ message += '\n' + obj_step_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1625
+ message += '\n' + obj_step_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1626
+ return new TypeError(message);
1627
+ }
1628
+ var obj_tags = obj.tags;
1629
+ var path_tags = path + '.tags';
1630
+ if (!ArrayIsArray(obj_tags)) {
1631
+ return new TypeError('Expected "array" but received "' + typeof obj_tags + '" (at "' + path_tags + '")');
1632
+ }
1633
+ for (var i = 0; i < obj_tags.length; i++) {
1634
+ var obj_tags_item = obj_tags[i];
1635
+ var path_tags_item = path_tags + '[' + i + ']';
1636
+ if (typeof obj_tags_item !== 'string') {
1637
+ return new TypeError('Expected "string" but received "' + typeof obj_tags_item + '" (at "' + path_tags_item + '")');
1638
+ }
1639
+ }
1640
+ var obj_title = obj.title;
1641
+ var path_title = path + '.title';
1642
+ var obj_title_union0 = null;
1643
+ var obj_title_union0_error = (function () {
1644
+ if (typeof obj_title !== 'string') {
1645
+ return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
1646
+ }
1647
+ })();
1648
+ if (obj_title_union0_error != null) {
1649
+ obj_title_union0 = obj_title_union0_error.message;
1650
+ }
1651
+ var obj_title_union1 = null;
1652
+ var obj_title_union1_error = (function () {
1653
+ if (obj_title !== null) {
1654
+ return new TypeError('Expected "null" but received "' + typeof obj_title + '" (at "' + path_title + '")');
1655
+ }
1656
+ })();
1657
+ if (obj_title_union1_error != null) {
1658
+ obj_title_union1 = obj_title_union1_error.message;
1659
+ }
1660
+ if (obj_title_union0 && obj_title_union1) {
1661
+ var message = 'Object doesn\'t match union (at "' + path_title + '")';
1662
+ message += '\n' + obj_title_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1663
+ message += '\n' + obj_title_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1664
+ return new TypeError(message);
1665
+ }
1666
+ var obj_type = obj.type;
1667
+ var path_type = path + '.type';
1668
+ if (typeof obj_type !== 'string') {
1669
+ return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
1670
+ }
1671
+ })();
1672
+ return v_error === undefined ? null : v_error;
1673
+ }
1674
+ var RepresentationType$6 = 'LightningAssistantLayoutNodeRepresentation';
1675
+ function normalize$6(input, existing, path, luvio, store, timestamp) {
1676
+ var input_step = input.step;
1677
+ var input_step_id = path.fullPath + '__step';
1678
+ if (input_step !== null && typeof input_step === 'object') {
1679
+ input.step = ingest$7(input_step, {
1680
+ fullPath: input_step_id,
1681
+ propertyName: 'step',
1682
+ parent: {
1683
+ data: input,
1684
+ key: path.fullPath,
1685
+ existing: existing,
1686
+ },
1687
+ ttl: path.ttl
1688
+ }, luvio, store);
1689
+ }
1690
+ return input;
1691
+ }
1692
+ var select$g = function LightningAssistantLayoutNodeRepresentationSelect() {
1693
+ return {
1694
+ kind: 'Fragment',
1695
+ version: VERSION$8,
1696
+ private: [],
1697
+ selections: [
1698
+ {
1699
+ name: 'children',
1700
+ kind: 'Object',
1701
+ // any
1702
+ },
1703
+ {
1704
+ name: 'description',
1705
+ kind: 'Scalar'
1706
+ },
1707
+ {
1708
+ name: 'status',
1709
+ kind: 'Scalar'
1710
+ },
1711
+ {
1712
+ name: 'step',
1713
+ kind: 'Link',
1714
+ nullable: true,
1715
+ fragment: select$i()
1716
+ },
1717
+ {
1718
+ name: 'tags',
1719
+ kind: 'Scalar',
1720
+ plural: true
1721
+ },
1722
+ {
1723
+ name: 'title',
1724
+ kind: 'Scalar'
1725
+ },
1726
+ {
1727
+ name: 'type',
1728
+ kind: 'Scalar'
1729
+ }
1730
+ ]
1731
+ };
1732
+ };
1733
+ function equals$8(existing, incoming) {
1734
+ var existing_type = existing.type;
1735
+ var incoming_type = incoming.type;
1736
+ if (!(existing_type === incoming_type)) {
1737
+ return false;
1738
+ }
1739
+ var existing_children = existing.children;
1740
+ var incoming_children = incoming.children;
1741
+ var equals_children_items = equalsArray(existing_children, incoming_children, function (existing_children_item, incoming_children_item) {
1742
+ if (JSONStringify(incoming_children_item) !== JSONStringify(existing_children_item)) {
1743
+ return false;
1744
+ }
1745
+ });
1746
+ if (equals_children_items === false) {
1747
+ return false;
1748
+ }
1749
+ var existing_description = existing.description;
1750
+ var incoming_description = incoming.description;
1751
+ if (!(existing_description === incoming_description)) {
1752
+ return false;
1753
+ }
1754
+ var existing_status = existing.status;
1755
+ var incoming_status = incoming.status;
1756
+ if (!(existing_status === incoming_status)) {
1757
+ return false;
1758
+ }
1759
+ var existing_step = existing.step;
1760
+ var incoming_step = incoming.step;
1761
+ if (!(existing_step === incoming_step
1762
+ || (existing_step != null &&
1763
+ incoming_step != null &&
1764
+ existing_step.__ref != null &&
1765
+ incoming_step.__ref != null &&
1766
+ existing_step.__ref === incoming_step.__ref))) {
1767
+ return false;
1768
+ }
1769
+ var existing_tags = existing.tags;
1770
+ var incoming_tags = incoming.tags;
1771
+ var equals_tags_items = equalsArray(existing_tags, incoming_tags, function (existing_tags_item, incoming_tags_item) {
1772
+ if (!(existing_tags_item === incoming_tags_item)) {
1773
+ return false;
1774
+ }
1775
+ });
1776
+ if (equals_tags_items === false) {
1777
+ return false;
1778
+ }
1779
+ var existing_title = existing.title;
1780
+ var incoming_title = incoming.title;
1781
+ if (!(existing_title === incoming_title)) {
1782
+ return false;
1783
+ }
1784
+ return true;
1785
+ }
1786
+ var ingest$6 = function LightningAssistantLayoutNodeRepresentationIngest(input, path, luvio, store, timestamp) {
1787
+ if (process.env.NODE_ENV !== 'production') {
1788
+ var validateError = validate$a(input);
1789
+ if (validateError !== null) {
1790
+ throw validateError;
1791
+ }
1792
+ }
1793
+ var key = path.fullPath;
1794
+ var existingRecord = store.readEntry(key);
1795
+ var ttlToUse = path.ttl !== undefined ? path.ttl : 2592000000;
1796
+ var incomingRecord = normalize$6(input, store.readEntry(key), {
1797
+ fullPath: key,
1798
+ parent: path.parent,
1799
+ propertyName: path.propertyName,
1800
+ ttl: ttlToUse
1801
+ }, luvio, store);
1802
+ if (existingRecord === undefined || equals$8(existingRecord, incomingRecord) === false) {
1803
+ luvio.storePublish(key, incomingRecord);
1804
+ }
1805
+ if (ttlToUse !== undefined) {
1806
+ var storeMetadataParams = {
1807
+ ttl: ttlToUse,
1808
+ namespace: "LEAP",
1809
+ version: VERSION$8,
1810
+ representationName: RepresentationType$6,
1811
+ };
1812
+ luvio.publishStoreMetadata(key, storeMetadataParams);
1813
+ }
1814
+ return createLink(key);
1815
+ };
1816
+ function getTypeCacheKeys$6(luvio, input, fullPathFactory) {
1817
+ var rootKeySet = new engine.StoreKeyMap();
1818
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1819
+ var rootKey = fullPathFactory();
1820
+ rootKeySet.set(rootKey, {
1821
+ namespace: keyPrefix,
1822
+ representationName: RepresentationType$6,
1823
+ mergeable: false
1824
+ });
1825
+ if (input.step !== null && typeof input.step === 'object') {
1826
+ var input_step = getTypeCacheKeys$7(luvio, input.step);
1827
+ rootKeySet.merge(input_step);
1828
+ }
1829
+ return rootKeySet;
1830
+ }
1831
+
1832
+ var VERSION$7 = "596a25b0bee0b1db5495fe57dd7bd025";
1833
+ function validate$9(obj, path) {
1834
+ if (path === void 0) { path = 'LightningAssistantRepresentation'; }
1835
+ var v_error = (function () {
1836
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1837
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1838
+ }
1839
+ var obj_assistantTarget = obj.assistantTarget;
1840
+ var path_assistantTarget = path + '.assistantTarget';
1841
+ if (typeof obj_assistantTarget !== 'string') {
1842
+ return new TypeError('Expected "string" but received "' + typeof obj_assistantTarget + '" (at "' + path_assistantTarget + '")');
1843
+ }
1844
+ if (obj.category !== undefined) {
1845
+ var obj_category = obj.category;
1846
+ var path_category = path + '.category';
1847
+ if (typeof obj_category !== 'string') {
1848
+ return new TypeError('Expected "string" but received "' + typeof obj_category + '" (at "' + path_category + '")');
1849
+ }
1850
+ }
1851
+ if (obj.categoryName !== undefined) {
1852
+ var obj_categoryName = obj.categoryName;
1853
+ var path_categoryName = path + '.categoryName';
1854
+ if (typeof obj_categoryName !== 'string') {
1855
+ return new TypeError('Expected "string" but received "' + typeof obj_categoryName + '" (at "' + path_categoryName + '")');
1856
+ }
1857
+ }
1858
+ if (obj.completionDate !== undefined) {
1859
+ var obj_completionDate = obj.completionDate;
1860
+ var path_completionDate = path + '.completionDate';
1861
+ if (typeof obj_completionDate !== 'string') {
1862
+ return new TypeError('Expected "string" but received "' + typeof obj_completionDate + '" (at "' + path_completionDate + '")');
1863
+ }
1864
+ }
1865
+ var obj_contentVersion = obj.contentVersion;
1866
+ var path_contentVersion = path + '.contentVersion';
1867
+ if (typeof obj_contentVersion !== 'string') {
1868
+ return new TypeError('Expected "string" but received "' + typeof obj_contentVersion + '" (at "' + path_contentVersion + '")');
1869
+ }
1870
+ var obj_debugModeEnabled = obj.debugModeEnabled;
1871
+ var path_debugModeEnabled = path + '.debugModeEnabled';
1872
+ if (typeof obj_debugModeEnabled !== 'boolean') {
1873
+ return new TypeError('Expected "boolean" but received "' + typeof obj_debugModeEnabled + '" (at "' + path_debugModeEnabled + '")');
1874
+ }
1875
+ if (obj.description !== undefined) {
1876
+ var obj_description = obj.description;
1877
+ var path_description = path + '.description';
1878
+ if (typeof obj_description !== 'string') {
1879
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
1880
+ }
1881
+ }
1882
+ var obj_developerName = obj.developerName;
1883
+ var path_developerName = path + '.developerName';
1884
+ if (typeof obj_developerName !== 'string') {
1885
+ return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
1886
+ }
1887
+ if (obj.estimatedMinutesToComplete !== undefined) {
1888
+ var obj_estimatedMinutesToComplete = obj.estimatedMinutesToComplete;
1889
+ var path_estimatedMinutesToComplete = path + '.estimatedMinutesToComplete';
1890
+ if (typeof obj_estimatedMinutesToComplete !== 'number' || (typeof obj_estimatedMinutesToComplete === 'number' && Math.floor(obj_estimatedMinutesToComplete) !== obj_estimatedMinutesToComplete)) {
1891
+ return new TypeError('Expected "integer" but received "' + typeof obj_estimatedMinutesToComplete + '" (at "' + path_estimatedMinutesToComplete + '")');
1892
+ }
1893
+ }
1894
+ var obj_icon = obj.icon;
1895
+ var path_icon = path + '.icon';
1896
+ if (typeof obj_icon !== 'string') {
1897
+ return new TypeError('Expected "string" but received "' + typeof obj_icon + '" (at "' + path_icon + '")');
1898
+ }
1899
+ var obj_isArchived = obj.isArchived;
1900
+ var path_isArchived = path + '.isArchived';
1901
+ if (typeof obj_isArchived !== 'boolean') {
1902
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isArchived + '" (at "' + path_isArchived + '")');
1903
+ }
1904
+ var obj_isPreview = obj.isPreview;
1905
+ var path_isPreview = path + '.isPreview';
1906
+ if (typeof obj_isPreview !== 'boolean') {
1907
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isPreview + '" (at "' + path_isPreview + '")');
1908
+ }
1909
+ var obj_layout = obj.layout;
1910
+ var path_layout = path + '.layout';
1911
+ if (typeof obj_layout !== 'object') {
1912
+ return new TypeError('Expected "object" but received "' + typeof obj_layout + '" (at "' + path_layout + '")');
1913
+ }
1914
+ var obj_numberOfSteps = obj.numberOfSteps;
1915
+ var path_numberOfSteps = path + '.numberOfSteps';
1916
+ if (typeof obj_numberOfSteps !== 'number' || (typeof obj_numberOfSteps === 'number' && Math.floor(obj_numberOfSteps) !== obj_numberOfSteps)) {
1917
+ return new TypeError('Expected "integer" but received "' + typeof obj_numberOfSteps + '" (at "' + path_numberOfSteps + '")');
1918
+ }
1919
+ obj.progress;
1920
+ var obj_questionnaireIds = obj.questionnaireIds;
1921
+ var path_questionnaireIds = path + '.questionnaireIds';
1922
+ if (!ArrayIsArray(obj_questionnaireIds)) {
1923
+ return new TypeError('Expected "array" but received "' + typeof obj_questionnaireIds + '" (at "' + path_questionnaireIds + '")');
1924
+ }
1925
+ for (var i = 0; i < obj_questionnaireIds.length; i++) {
1926
+ var obj_questionnaireIds_item = obj_questionnaireIds[i];
1927
+ var path_questionnaireIds_item = path_questionnaireIds + '[' + i + ']';
1928
+ if (typeof obj_questionnaireIds_item !== 'string') {
1929
+ return new TypeError('Expected "string" but received "' + typeof obj_questionnaireIds_item + '" (at "' + path_questionnaireIds_item + '")');
1930
+ }
1931
+ }
1932
+ var obj_status = obj.status;
1933
+ var path_status = path + '.status';
1934
+ if (typeof obj_status !== 'string') {
1935
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
1936
+ }
1937
+ var obj_title = obj.title;
1938
+ var path_title = path + '.title';
1939
+ if (typeof obj_title !== 'string') {
1940
+ return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
1941
+ }
1942
+ })();
1943
+ return v_error === undefined ? null : v_error;
1944
+ }
1945
+ var RepresentationType$5 = 'LightningAssistantRepresentation';
1946
+ function keyBuilder$f(luvio, config) {
1947
+ return keyPrefix + '::' + RepresentationType$5 + ':' + config.assistant_name;
1948
+ }
1949
+ function keyBuilderFromType$5(luvio, object) {
1950
+ var keyParams = {
1951
+ assistant_name: object.developerName
1952
+ };
1953
+ return keyBuilder$f(luvio, keyParams);
1954
+ }
1955
+ function normalize$5(input, existing, path, luvio, store, timestamp) {
1956
+ var input_layout = input.layout;
1957
+ var input_layout_id = path.fullPath + '__layout';
1958
+ input.layout = ingest$6(input_layout, {
1959
+ fullPath: input_layout_id,
1960
+ propertyName: 'layout',
1961
+ parent: {
1962
+ data: input,
1963
+ key: path.fullPath,
1964
+ existing: existing,
1965
+ },
1966
+ ttl: path.ttl
1967
+ }, luvio, store);
1968
+ return input;
1969
+ }
1970
+ var select$f = function LightningAssistantRepresentationSelect() {
1971
+ return {
1972
+ kind: 'Fragment',
1973
+ version: VERSION$7,
1974
+ private: [],
1975
+ selections: [
1976
+ {
1977
+ name: 'assistantTarget',
1978
+ kind: 'Scalar'
1979
+ },
1980
+ {
1981
+ name: 'category',
1982
+ kind: 'Scalar',
1983
+ required: false
1984
+ },
1985
+ {
1986
+ name: 'categoryName',
1987
+ kind: 'Scalar',
1988
+ required: false
1989
+ },
1990
+ {
1991
+ name: 'completionDate',
1992
+ kind: 'Scalar',
1993
+ required: false
1994
+ },
1995
+ {
1996
+ name: 'contentVersion',
1997
+ kind: 'Scalar'
1998
+ },
1999
+ {
2000
+ name: 'debugModeEnabled',
2001
+ kind: 'Scalar'
2002
+ },
2003
+ {
2004
+ name: 'description',
2005
+ kind: 'Scalar',
2006
+ required: false
2007
+ },
2008
+ {
2009
+ name: 'developerName',
2010
+ kind: 'Scalar'
2011
+ },
2012
+ {
2013
+ name: 'estimatedMinutesToComplete',
2014
+ kind: 'Scalar',
2015
+ required: false
2016
+ },
2017
+ {
2018
+ name: 'icon',
2019
+ kind: 'Scalar'
2020
+ },
2021
+ {
2022
+ name: 'isArchived',
2023
+ kind: 'Scalar'
2024
+ },
2025
+ {
2026
+ name: 'isPreview',
2027
+ kind: 'Scalar'
2028
+ },
2029
+ {
2030
+ name: 'layout',
2031
+ kind: 'Link',
2032
+ fragment: select$g()
2033
+ },
2034
+ {
2035
+ name: 'numberOfSteps',
2036
+ kind: 'Scalar'
2037
+ },
2038
+ {
2039
+ name: 'progress',
2040
+ kind: 'Scalar'
2041
+ },
2042
+ {
2043
+ name: 'questionnaireIds',
2044
+ kind: 'Scalar',
2045
+ plural: true
2046
+ },
2047
+ {
2048
+ name: 'status',
2049
+ kind: 'Scalar'
2050
+ },
2051
+ {
2052
+ name: 'title',
2053
+ kind: 'Scalar'
2054
+ }
2055
+ ]
2056
+ };
2057
+ };
2058
+ function equals$7(existing, incoming) {
2059
+ var existing_debugModeEnabled = existing.debugModeEnabled;
2060
+ var incoming_debugModeEnabled = incoming.debugModeEnabled;
2061
+ if (!(existing_debugModeEnabled === incoming_debugModeEnabled)) {
2062
+ return false;
2063
+ }
2064
+ var existing_isArchived = existing.isArchived;
2065
+ var incoming_isArchived = incoming.isArchived;
2066
+ if (!(existing_isArchived === incoming_isArchived)) {
2067
+ return false;
2068
+ }
2069
+ var existing_isPreview = existing.isPreview;
2070
+ var incoming_isPreview = incoming.isPreview;
2071
+ if (!(existing_isPreview === incoming_isPreview)) {
2072
+ return false;
2073
+ }
2074
+ var existing_estimatedMinutesToComplete = existing.estimatedMinutesToComplete;
2075
+ var incoming_estimatedMinutesToComplete = incoming.estimatedMinutesToComplete;
2076
+ // if at least one of these optionals is defined
2077
+ if (existing_estimatedMinutesToComplete !== undefined || incoming_estimatedMinutesToComplete !== undefined) {
2078
+ // if one of these is not defined we know the other is defined and therefore
2079
+ // not equal
2080
+ if (existing_estimatedMinutesToComplete === undefined || incoming_estimatedMinutesToComplete === undefined) {
2081
+ return false;
2082
+ }
2083
+ if (!(existing_estimatedMinutesToComplete === incoming_estimatedMinutesToComplete)) {
2084
+ return false;
2085
+ }
2086
+ }
2087
+ var existing_numberOfSteps = existing.numberOfSteps;
2088
+ var incoming_numberOfSteps = incoming.numberOfSteps;
2089
+ if (!(existing_numberOfSteps === incoming_numberOfSteps)) {
2090
+ return false;
2091
+ }
2092
+ var existing_assistantTarget = existing.assistantTarget;
2093
+ var incoming_assistantTarget = incoming.assistantTarget;
2094
+ if (!(existing_assistantTarget === incoming_assistantTarget)) {
2095
+ return false;
2096
+ }
2097
+ var existing_category = existing.category;
2098
+ var incoming_category = incoming.category;
2099
+ // if at least one of these optionals is defined
2100
+ if (existing_category !== undefined || incoming_category !== undefined) {
2101
+ // if one of these is not defined we know the other is defined and therefore
2102
+ // not equal
2103
+ if (existing_category === undefined || incoming_category === undefined) {
2104
+ return false;
2105
+ }
2106
+ if (!(existing_category === incoming_category)) {
2107
+ return false;
2108
+ }
2109
+ }
2110
+ var existing_categoryName = existing.categoryName;
2111
+ var incoming_categoryName = incoming.categoryName;
2112
+ // if at least one of these optionals is defined
2113
+ if (existing_categoryName !== undefined || incoming_categoryName !== undefined) {
2114
+ // if one of these is not defined we know the other is defined and therefore
2115
+ // not equal
2116
+ if (existing_categoryName === undefined || incoming_categoryName === undefined) {
2117
+ return false;
2118
+ }
2119
+ if (!(existing_categoryName === incoming_categoryName)) {
2120
+ return false;
2121
+ }
2122
+ }
2123
+ var existing_completionDate = existing.completionDate;
2124
+ var incoming_completionDate = incoming.completionDate;
2125
+ // if at least one of these optionals is defined
2126
+ if (existing_completionDate !== undefined || incoming_completionDate !== undefined) {
2127
+ // if one of these is not defined we know the other is defined and therefore
2128
+ // not equal
2129
+ if (existing_completionDate === undefined || incoming_completionDate === undefined) {
2130
+ return false;
2131
+ }
2132
+ if (!(existing_completionDate === incoming_completionDate)) {
2133
+ return false;
2134
+ }
2135
+ }
2136
+ var existing_contentVersion = existing.contentVersion;
2137
+ var incoming_contentVersion = incoming.contentVersion;
2138
+ if (!(existing_contentVersion === incoming_contentVersion)) {
2139
+ return false;
2140
+ }
2141
+ var existing_description = existing.description;
2142
+ var incoming_description = incoming.description;
2143
+ // if at least one of these optionals is defined
2144
+ if (existing_description !== undefined || incoming_description !== undefined) {
2145
+ // if one of these is not defined we know the other is defined and therefore
2146
+ // not equal
2147
+ if (existing_description === undefined || incoming_description === undefined) {
2148
+ return false;
2149
+ }
2150
+ if (!(existing_description === incoming_description)) {
2151
+ return false;
2152
+ }
2153
+ }
2154
+ var existing_developerName = existing.developerName;
2155
+ var incoming_developerName = incoming.developerName;
2156
+ if (!(existing_developerName === incoming_developerName)) {
2157
+ return false;
2158
+ }
2159
+ var existing_icon = existing.icon;
2160
+ var incoming_icon = incoming.icon;
2161
+ if (!(existing_icon === incoming_icon)) {
2162
+ return false;
2163
+ }
2164
+ var existing_status = existing.status;
2165
+ var incoming_status = incoming.status;
2166
+ if (!(existing_status === incoming_status)) {
2167
+ return false;
2168
+ }
2169
+ var existing_title = existing.title;
2170
+ var incoming_title = incoming.title;
2171
+ if (!(existing_title === incoming_title)) {
2172
+ return false;
2173
+ }
2174
+ var existing_progress = existing.progress;
2175
+ var incoming_progress = incoming.progress;
2176
+ if (!(existing_progress === incoming_progress)) {
2177
+ return false;
2178
+ }
2179
+ var existing_layout = existing.layout;
2180
+ var incoming_layout = incoming.layout;
2181
+ if (!(existing_layout.__ref === incoming_layout.__ref)) {
2182
+ return false;
2183
+ }
2184
+ var existing_questionnaireIds = existing.questionnaireIds;
2185
+ var incoming_questionnaireIds = incoming.questionnaireIds;
2186
+ var equals_questionnaireIds_items = equalsArray(existing_questionnaireIds, incoming_questionnaireIds, function (existing_questionnaireIds_item, incoming_questionnaireIds_item) {
2187
+ if (!(existing_questionnaireIds_item === incoming_questionnaireIds_item)) {
2188
+ return false;
2189
+ }
2190
+ });
2191
+ if (equals_questionnaireIds_items === false) {
2192
+ return false;
2193
+ }
2194
+ return true;
2195
+ }
2196
+ var ingest$5 = function LightningAssistantRepresentationIngest(input, path, luvio, store, timestamp) {
2197
+ if (process.env.NODE_ENV !== 'production') {
2198
+ var validateError = validate$9(input);
2199
+ if (validateError !== null) {
2200
+ throw validateError;
2201
+ }
2202
+ }
2203
+ var key = keyBuilderFromType$5(luvio, input);
2204
+ var existingRecord = store.readEntry(key);
2205
+ var ttlToUse = path.ttl !== undefined ? path.ttl : 2592000000;
2206
+ var incomingRecord = normalize$5(input, store.readEntry(key), {
2207
+ fullPath: key,
2208
+ parent: path.parent,
2209
+ propertyName: path.propertyName,
2210
+ ttl: ttlToUse
2211
+ }, luvio, store);
2212
+ if (existingRecord === undefined || equals$7(existingRecord, incomingRecord) === false) {
2213
+ luvio.storePublish(key, incomingRecord);
2214
+ }
2215
+ if (ttlToUse !== undefined) {
2216
+ var storeMetadataParams = {
2217
+ ttl: ttlToUse,
2218
+ namespace: "LEAP",
2219
+ version: VERSION$7,
2220
+ representationName: RepresentationType$5,
2221
+ };
2222
+ luvio.publishStoreMetadata(key, storeMetadataParams);
2223
+ }
2224
+ return createLink(key);
2225
+ };
2226
+ function getTypeCacheKeys$5(luvio, input, fullPathFactory) {
2227
+ var rootKeySet = new engine.StoreKeyMap();
2228
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
2229
+ var rootKey = keyBuilderFromType$5(luvio, input);
2230
+ rootKeySet.set(rootKey, {
2231
+ namespace: keyPrefix,
2232
+ representationName: RepresentationType$5,
2233
+ mergeable: false
2234
+ });
2235
+ var input_layout = getTypeCacheKeys$6(luvio, input.layout, function () { return rootKey + "__" + "layout"; });
2236
+ rootKeySet.merge(input_layout);
2237
+ return rootKeySet;
2238
+ }
2239
+
2240
+ function select$e(luvio, params) {
2241
+ return select$f();
2242
+ }
2243
+ function keyBuilder$e(luvio, params) {
2244
+ return keyBuilder$f(luvio, {
2245
+ assistant_name: params.urlParams.assistantName
2246
+ });
2247
+ }
2248
+ function getResponseCacheKeys$7(luvio, resourceParams, response) {
2249
+ return getTypeCacheKeys$5(luvio, response);
2250
+ }
2251
+ function ingestSuccess$7(luvio, resourceParams, response, snapshotRefresh) {
2252
+ var body = response.body;
2253
+ var key = keyBuilder$e(luvio, resourceParams);
2254
+ luvio.storeIngest(key, ingest$5, body);
2255
+ var snapshot = luvio.storeLookup({
2256
+ recordId: key,
2257
+ node: select$e(),
2258
+ variables: {},
2259
+ }, snapshotRefresh);
2260
+ if (process.env.NODE_ENV !== 'production') {
2261
+ if (snapshot.state !== 'Fulfilled') {
2262
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
2263
+ }
2264
+ }
2265
+ return snapshot;
2266
+ }
2267
+ function ingestError$4(luvio, params, error, snapshotRefresh) {
2268
+ var key = keyBuilder$e(luvio, params);
2269
+ var errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
2270
+ luvio.storeIngestError(key, errorSnapshot);
2271
+ return errorSnapshot;
2272
+ }
2273
+ function createResourceRequest$7(config) {
2274
+ var headers = {};
2275
+ return {
2276
+ baseUri: '/services/data/v58.0',
2277
+ basePath: '/assistant-platform/' + config.urlParams.assistantName + '',
2278
+ method: 'get',
2279
+ body: null,
2280
+ urlParams: config.urlParams,
2281
+ queryParams: {},
2282
+ headers: headers,
2283
+ priority: 'normal',
2284
+ };
2285
+ }
2286
+
2287
+ var getAssistant_ConfigPropertyNames = {
2288
+ displayName: 'getAssistant',
2289
+ parameters: {
2290
+ required: ['assistantName'],
2291
+ optional: []
2292
+ }
2293
+ };
2294
+ function createResourceParams$7(config) {
2295
+ var resourceParams = {
2296
+ urlParams: {
2297
+ assistantName: config.assistantName
2298
+ }
2299
+ };
2300
+ return resourceParams;
2301
+ }
2302
+ function keyBuilder$d(luvio, config) {
2303
+ var resourceParams = createResourceParams$7(config);
2304
+ return keyBuilder$e(luvio, resourceParams);
2305
+ }
2306
+ function typeCheckConfig$7(untrustedConfig) {
2307
+ var config = {};
2308
+ var untrustedConfig_assistantName = untrustedConfig.assistantName;
2309
+ if (typeof untrustedConfig_assistantName === 'string') {
2310
+ config.assistantName = untrustedConfig_assistantName;
2311
+ }
2312
+ return config;
2313
+ }
2314
+ function validateAdapterConfig$7(untrustedConfig, configPropertyNames) {
2315
+ if (!untrustedIsObject(untrustedConfig)) {
2316
+ return null;
2317
+ }
2318
+ if (process.env.NODE_ENV !== 'production') {
2319
+ validateConfig(untrustedConfig, configPropertyNames);
2320
+ }
2321
+ var config = typeCheckConfig$7(untrustedConfig);
2322
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
2323
+ return null;
2324
+ }
2325
+ return config;
2326
+ }
2327
+ function adapterFragment$4(luvio, config) {
2328
+ createResourceParams$7(config);
2329
+ return select$e();
2330
+ }
2331
+ function onFetchResponseSuccess$4(luvio, config, resourceParams, response) {
2332
+ var snapshot = ingestSuccess$7(luvio, resourceParams, response, {
2333
+ config: config,
2334
+ resolve: function () { return buildNetworkSnapshot$7(luvio, config, snapshotRefreshOptions); }
2335
+ });
2336
+ return luvio.storeBroadcast().then(function () { return snapshot; });
2337
+ }
2338
+ function onFetchResponseError$4(luvio, config, resourceParams, response) {
2339
+ var snapshot = ingestError$4(luvio, resourceParams, response, {
2340
+ config: config,
2341
+ resolve: function () { return buildNetworkSnapshot$7(luvio, config, snapshotRefreshOptions); }
2342
+ });
2343
+ return luvio.storeBroadcast().then(function () { return snapshot; });
2344
+ }
2345
+ function buildNetworkSnapshot$7(luvio, config, options) {
2346
+ var resourceParams = createResourceParams$7(config);
2347
+ var request = createResourceRequest$7(resourceParams);
2348
+ return luvio.dispatchResourceRequest(request, options)
2349
+ .then(function (response) {
2350
+ return luvio.handleSuccessResponse(function () { return onFetchResponseSuccess$4(luvio, config, resourceParams, response); }, function () { return getResponseCacheKeys$7(luvio, resourceParams, response.body); });
2351
+ }, function (response) {
2352
+ return luvio.handleErrorResponse(function () { return onFetchResponseError$4(luvio, config, resourceParams, response); });
2353
+ });
2354
+ }
2355
+ function buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext) {
2356
+ var luvio = context.luvio, config = context.config;
2357
+ var networkPriority = coercedAdapterRequestContext.networkPriority, requestCorrelator = coercedAdapterRequestContext.requestCorrelator, eventObservers = coercedAdapterRequestContext.eventObservers;
2358
+ var dispatchOptions = {
2359
+ resourceRequestContext: {
2360
+ requestCorrelator: requestCorrelator,
2361
+ luvioRequestMethod: undefined,
2362
+ },
2363
+ eventObservers: eventObservers
2364
+ };
2365
+ if (networkPriority !== 'normal') {
2366
+ dispatchOptions.overrides = {
2367
+ priority: networkPriority
2368
+ };
2369
+ }
2370
+ return buildNetworkSnapshot$7(luvio, config, dispatchOptions);
2371
+ }
2372
+ function buildCachedSnapshotCachePolicy$4(context, storeLookup) {
2373
+ var luvio = context.luvio, config = context.config;
2374
+ var selector = {
2375
+ recordId: keyBuilder$d(luvio, config),
2376
+ node: adapterFragment$4(luvio, config),
2377
+ variables: {},
2378
+ };
2379
+ var cacheSnapshot = storeLookup(selector, {
2380
+ config: config,
2381
+ resolve: function () { return buildNetworkSnapshot$7(luvio, config, snapshotRefreshOptions); }
2382
+ });
2383
+ return cacheSnapshot;
2384
+ }
2385
+ var getAssistantAdapterFactory = function (luvio) { return function LEAP__getAssistant(untrustedConfig, requestContext) {
2386
+ var config = validateAdapterConfig$7(untrustedConfig, getAssistant_ConfigPropertyNames);
2387
+ // Invalid or incomplete config
2388
+ if (config === null) {
2389
+ return null;
2390
+ }
2391
+ return luvio.applyCachePolicy((requestContext || {}), { config: config, luvio: luvio }, // BuildSnapshotContext
2392
+ buildCachedSnapshotCachePolicy$4, buildNetworkSnapshotCachePolicy$4);
2393
+ }; };
2394
+
2395
+ function validate$8(obj, path) {
2396
+ if (path === void 0) { path = 'LightningAssistantUpdateInputRepresentation'; }
2397
+ var v_error = (function () {
2398
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2399
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2400
+ }
2401
+ var obj_items = obj.items;
2402
+ var path_items = path + '.items';
2403
+ if (typeof obj_items !== 'object' || ArrayIsArray(obj_items) || obj_items === null) {
2404
+ return new TypeError('Expected "object" but received "' + typeof obj_items + '" (at "' + path_items + '")');
2405
+ }
2406
+ var obj_items_keys = ObjectKeys(obj_items);
2407
+ for (var i = 0; i < obj_items_keys.length; i++) {
2408
+ var key = obj_items_keys[i];
2409
+ var obj_items_prop = obj_items[key];
2410
+ var path_items_prop = path_items + '["' + key + '"]';
2411
+ if (typeof obj_items_prop !== 'object' || ArrayIsArray(obj_items_prop) || obj_items_prop === null) {
2412
+ return new TypeError('Expected "object" but received "' + typeof obj_items_prop + '" (at "' + path_items_prop + '")');
2413
+ }
2414
+ }
2415
+ })();
2416
+ return v_error === undefined ? null : v_error;
2417
+ }
2418
+
2419
+ function select$d(luvio, params) {
2420
+ return select$f();
2421
+ }
2422
+ function getResponseCacheKeys$6(luvio, resourceParams, response) {
2423
+ return getTypeCacheKeys$5(luvio, response);
2424
+ }
2425
+ function ingestSuccess$6(luvio, resourceParams, response) {
2426
+ var body = response.body;
2427
+ var key = keyBuilderFromType$5(luvio, body);
2428
+ luvio.storeIngest(key, ingest$5, body);
2429
+ var snapshot = luvio.storeLookup({
2430
+ recordId: key,
2431
+ node: select$d(),
2432
+ variables: {},
2433
+ });
2434
+ if (process.env.NODE_ENV !== 'production') {
2435
+ if (snapshot.state !== 'Fulfilled') {
2436
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
2437
+ }
2438
+ }
2439
+ return snapshot;
2440
+ }
2441
+ function createResourceRequest$6(config) {
2442
+ var headers = {};
2443
+ return {
2444
+ baseUri: '/services/data/v58.0',
2445
+ basePath: '/assistant-platform/' + config.urlParams.assistantName + '',
2446
+ method: 'patch',
2447
+ body: config.body,
2448
+ urlParams: config.urlParams,
2449
+ queryParams: {},
2450
+ headers: headers,
2451
+ priority: 'normal',
2452
+ };
2453
+ }
2454
+
2455
+ var saveAssistant_ConfigPropertyNames = {
2456
+ displayName: 'saveAssistant',
2457
+ parameters: {
2458
+ required: ['assistantName', 'assistantData'],
2459
+ optional: []
2460
+ }
2461
+ };
2462
+ function createResourceParams$6(config) {
2463
+ var resourceParams = {
2464
+ urlParams: {
2465
+ assistantName: config.assistantName
2466
+ },
2467
+ body: {
2468
+ assistantData: config.assistantData
2469
+ }
2470
+ };
2471
+ return resourceParams;
2472
+ }
2473
+ function typeCheckConfig$6(untrustedConfig) {
2474
+ var config = {};
2475
+ var untrustedConfig_assistantName = untrustedConfig.assistantName;
2476
+ if (typeof untrustedConfig_assistantName === 'string') {
2477
+ config.assistantName = untrustedConfig_assistantName;
2478
+ }
2479
+ var untrustedConfig_assistantData = untrustedConfig.assistantData;
2480
+ var referenceLightningAssistantUpdateInputRepresentationValidationError = validate$8(untrustedConfig_assistantData);
2481
+ if (referenceLightningAssistantUpdateInputRepresentationValidationError === null) {
2482
+ config.assistantData = untrustedConfig_assistantData;
2483
+ }
2484
+ return config;
2485
+ }
2486
+ function validateAdapterConfig$6(untrustedConfig, configPropertyNames) {
2487
+ if (!untrustedIsObject(untrustedConfig)) {
2488
+ return null;
2489
+ }
2490
+ if (process.env.NODE_ENV !== 'production') {
2491
+ validateConfig(untrustedConfig, configPropertyNames);
2492
+ }
2493
+ var config = typeCheckConfig$6(untrustedConfig);
2494
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
2495
+ return null;
2496
+ }
2497
+ return config;
2498
+ }
2499
+ function buildNetworkSnapshot$6(luvio, config, options) {
2500
+ var resourceParams = createResourceParams$6(config);
2501
+ var request = createResourceRequest$6(resourceParams);
2502
+ return luvio.dispatchResourceRequest(request, options)
2503
+ .then(function (response) {
2504
+ return luvio.handleSuccessResponse(function () {
2505
+ var snapshot = ingestSuccess$6(luvio, resourceParams, response);
2506
+ return luvio.storeBroadcast().then(function () { return snapshot; });
2507
+ }, function () { return getResponseCacheKeys$6(luvio, resourceParams, response.body); });
2508
+ }, function (response) {
2509
+ deepFreeze(response);
2510
+ throw response;
2511
+ });
2512
+ }
2513
+ var saveAssistantAdapterFactory = function (luvio) {
2514
+ return function saveAssistant(untrustedConfig) {
2515
+ var config = validateAdapterConfig$6(untrustedConfig, saveAssistant_ConfigPropertyNames);
2516
+ // Invalid or incomplete config
2517
+ if (config === null) {
2518
+ throw new Error('Invalid config for "saveAssistant"');
2519
+ }
2520
+ return buildNetworkSnapshot$6(luvio, config);
2521
+ };
2522
+ };
2523
+
2524
+ var VERSION$6 = "042081dc16ad8bafa711efc0ff696bde";
2525
+ function validate$7(obj, path) {
2526
+ if (path === void 0) { path = 'LightningAssistantQuestionnaireListRepresentation'; }
2527
+ var v_error = (function () {
2528
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2529
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2530
+ }
2531
+ var obj_assistantName = obj.assistantName;
2532
+ var path_assistantName = path + '.assistantName';
2533
+ if (typeof obj_assistantName !== 'string') {
2534
+ return new TypeError('Expected "string" but received "' + typeof obj_assistantName + '" (at "' + path_assistantName + '")');
2535
+ }
2536
+ var obj_questionnaireNames = obj.questionnaireNames;
2537
+ var path_questionnaireNames = path + '.questionnaireNames';
2538
+ if (!ArrayIsArray(obj_questionnaireNames)) {
2539
+ return new TypeError('Expected "array" but received "' + typeof obj_questionnaireNames + '" (at "' + path_questionnaireNames + '")');
2540
+ }
2541
+ for (var i = 0; i < obj_questionnaireNames.length; i++) {
2542
+ var obj_questionnaireNames_item = obj_questionnaireNames[i];
2543
+ var path_questionnaireNames_item = path_questionnaireNames + '[' + i + ']';
2544
+ if (typeof obj_questionnaireNames_item !== 'string') {
2545
+ return new TypeError('Expected "string" but received "' + typeof obj_questionnaireNames_item + '" (at "' + path_questionnaireNames_item + '")');
2546
+ }
2547
+ }
2548
+ })();
2549
+ return v_error === undefined ? null : v_error;
2550
+ }
2551
+ var RepresentationType$4 = 'LightningAssistantQuestionnaireListRepresentation';
2552
+ function keyBuilder$c(luvio, config) {
2553
+ return keyPrefix + '::' + RepresentationType$4 + ':' + config.assistant_name;
2554
+ }
2555
+ function keyBuilderFromType$4(luvio, object) {
2556
+ var keyParams = {
2557
+ assistant_name: object.assistantName
2558
+ };
2559
+ return keyBuilder$c(luvio, keyParams);
2560
+ }
2561
+ function normalize$4(input, existing, path, luvio, store, timestamp) {
2562
+ return input;
2563
+ }
2564
+ var select$c = function LightningAssistantQuestionnaireListRepresentationSelect() {
2565
+ return {
2566
+ kind: 'Fragment',
2567
+ version: VERSION$6,
2568
+ private: [],
2569
+ selections: [
2570
+ {
2571
+ name: 'assistantName',
2572
+ kind: 'Scalar'
2573
+ },
2574
+ {
2575
+ name: 'questionnaireNames',
2576
+ kind: 'Scalar',
2577
+ plural: true
2578
+ }
2579
+ ]
2580
+ };
2581
+ };
2582
+ function equals$6(existing, incoming) {
2583
+ var existing_assistantName = existing.assistantName;
2584
+ var incoming_assistantName = incoming.assistantName;
2585
+ if (!(existing_assistantName === incoming_assistantName)) {
2586
+ return false;
2587
+ }
2588
+ var existing_questionnaireNames = existing.questionnaireNames;
2589
+ var incoming_questionnaireNames = incoming.questionnaireNames;
2590
+ var equals_questionnaireNames_items = equalsArray(existing_questionnaireNames, incoming_questionnaireNames, function (existing_questionnaireNames_item, incoming_questionnaireNames_item) {
2591
+ if (!(existing_questionnaireNames_item === incoming_questionnaireNames_item)) {
2592
+ return false;
2593
+ }
2594
+ });
2595
+ if (equals_questionnaireNames_items === false) {
2596
+ return false;
2597
+ }
2598
+ return true;
2599
+ }
2600
+ var ingest$4 = function LightningAssistantQuestionnaireListRepresentationIngest(input, path, luvio, store, timestamp) {
2601
+ if (process.env.NODE_ENV !== 'production') {
2602
+ var validateError = validate$7(input);
2603
+ if (validateError !== null) {
2604
+ throw validateError;
2605
+ }
2606
+ }
2607
+ var key = keyBuilderFromType$4(luvio, input);
2608
+ var existingRecord = store.readEntry(key);
2609
+ var ttlToUse = path.ttl !== undefined ? path.ttl : 2592000000;
2610
+ var incomingRecord = normalize$4(input, store.readEntry(key), {
2611
+ fullPath: key,
2612
+ parent: path.parent,
2613
+ propertyName: path.propertyName,
2614
+ ttl: ttlToUse
2615
+ });
2616
+ if (existingRecord === undefined || equals$6(existingRecord, incomingRecord) === false) {
2617
+ luvio.storePublish(key, incomingRecord);
2618
+ }
2619
+ if (ttlToUse !== undefined) {
2620
+ var storeMetadataParams = {
2621
+ ttl: ttlToUse,
2622
+ namespace: "LEAP",
2623
+ version: VERSION$6,
2624
+ representationName: RepresentationType$4,
2625
+ };
2626
+ luvio.publishStoreMetadata(key, storeMetadataParams);
2627
+ }
2628
+ return createLink(key);
2629
+ };
2630
+ function getTypeCacheKeys$4(luvio, input, fullPathFactory) {
2631
+ var rootKeySet = new engine.StoreKeyMap();
2632
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
2633
+ var rootKey = keyBuilderFromType$4(luvio, input);
2634
+ rootKeySet.set(rootKey, {
2635
+ namespace: keyPrefix,
2636
+ representationName: RepresentationType$4,
2637
+ mergeable: false
2638
+ });
2639
+ return rootKeySet;
2640
+ }
2641
+
2642
+ function select$b(luvio, params) {
2643
+ return select$c();
2644
+ }
2645
+ function keyBuilder$b(luvio, params) {
2646
+ return keyBuilder$c(luvio, {
2647
+ assistant_name: params.urlParams.assistantName
2648
+ });
2649
+ }
2650
+ function getResponseCacheKeys$5(luvio, resourceParams, response) {
2651
+ return getTypeCacheKeys$4(luvio, response);
2652
+ }
2653
+ function ingestSuccess$5(luvio, resourceParams, response, snapshotRefresh) {
2654
+ var body = response.body;
2655
+ var key = keyBuilder$b(luvio, resourceParams);
2656
+ luvio.storeIngest(key, ingest$4, body);
2657
+ var snapshot = luvio.storeLookup({
2658
+ recordId: key,
2659
+ node: select$b(),
2660
+ variables: {},
2661
+ }, snapshotRefresh);
2662
+ if (process.env.NODE_ENV !== 'production') {
2663
+ if (snapshot.state !== 'Fulfilled') {
2664
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
2665
+ }
2666
+ }
2667
+ return snapshot;
2668
+ }
2669
+ function ingestError$3(luvio, params, error, snapshotRefresh) {
2670
+ var key = keyBuilder$b(luvio, params);
2671
+ var errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
2672
+ luvio.storeIngestError(key, errorSnapshot);
2673
+ return errorSnapshot;
2674
+ }
2675
+ function createResourceRequest$5(config) {
2676
+ var headers = {};
2677
+ return {
2678
+ baseUri: '/services/data/v58.0',
2679
+ basePath: '/assistant-platform/' + config.urlParams.assistantName + '/questionnaires',
2680
+ method: 'get',
2681
+ body: null,
2682
+ urlParams: config.urlParams,
2683
+ queryParams: {},
2684
+ headers: headers,
2685
+ priority: 'normal',
2686
+ };
2687
+ }
2688
+
2689
+ var getQuestionnaires_ConfigPropertyNames = {
2690
+ displayName: 'getQuestionnaires',
2691
+ parameters: {
2692
+ required: ['assistantName'],
2693
+ optional: []
2694
+ }
2695
+ };
2696
+ function createResourceParams$5(config) {
2697
+ var resourceParams = {
2698
+ urlParams: {
2699
+ assistantName: config.assistantName
2700
+ }
2701
+ };
2702
+ return resourceParams;
2703
+ }
2704
+ function keyBuilder$a(luvio, config) {
2705
+ var resourceParams = createResourceParams$5(config);
2706
+ return keyBuilder$b(luvio, resourceParams);
2707
+ }
2708
+ function typeCheckConfig$5(untrustedConfig) {
2709
+ var config = {};
2710
+ var untrustedConfig_assistantName = untrustedConfig.assistantName;
2711
+ if (typeof untrustedConfig_assistantName === 'string') {
2712
+ config.assistantName = untrustedConfig_assistantName;
2713
+ }
2714
+ return config;
2715
+ }
2716
+ function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
2717
+ if (!untrustedIsObject(untrustedConfig)) {
2718
+ return null;
2719
+ }
2720
+ if (process.env.NODE_ENV !== 'production') {
2721
+ validateConfig(untrustedConfig, configPropertyNames);
2722
+ }
2723
+ var config = typeCheckConfig$5(untrustedConfig);
2724
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
2725
+ return null;
2726
+ }
2727
+ return config;
2728
+ }
2729
+ function adapterFragment$3(luvio, config) {
2730
+ createResourceParams$5(config);
2731
+ return select$b();
2732
+ }
2733
+ function onFetchResponseSuccess$3(luvio, config, resourceParams, response) {
2734
+ var snapshot = ingestSuccess$5(luvio, resourceParams, response, {
2735
+ config: config,
2736
+ resolve: function () { return buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions); }
2737
+ });
2738
+ return luvio.storeBroadcast().then(function () { return snapshot; });
2739
+ }
2740
+ function onFetchResponseError$3(luvio, config, resourceParams, response) {
2741
+ var snapshot = ingestError$3(luvio, resourceParams, response, {
2742
+ config: config,
2743
+ resolve: function () { return buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions); }
2744
+ });
2745
+ return luvio.storeBroadcast().then(function () { return snapshot; });
2746
+ }
2747
+ function buildNetworkSnapshot$5(luvio, config, options) {
2748
+ var resourceParams = createResourceParams$5(config);
2749
+ var request = createResourceRequest$5(resourceParams);
2750
+ return luvio.dispatchResourceRequest(request, options)
2751
+ .then(function (response) {
2752
+ return luvio.handleSuccessResponse(function () { return onFetchResponseSuccess$3(luvio, config, resourceParams, response); }, function () { return getResponseCacheKeys$5(luvio, resourceParams, response.body); });
2753
+ }, function (response) {
2754
+ return luvio.handleErrorResponse(function () { return onFetchResponseError$3(luvio, config, resourceParams, response); });
2755
+ });
2756
+ }
2757
+ function buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext) {
2758
+ var luvio = context.luvio, config = context.config;
2759
+ var networkPriority = coercedAdapterRequestContext.networkPriority, requestCorrelator = coercedAdapterRequestContext.requestCorrelator, eventObservers = coercedAdapterRequestContext.eventObservers;
2760
+ var dispatchOptions = {
2761
+ resourceRequestContext: {
2762
+ requestCorrelator: requestCorrelator,
2763
+ luvioRequestMethod: undefined,
2764
+ },
2765
+ eventObservers: eventObservers
2766
+ };
2767
+ if (networkPriority !== 'normal') {
2768
+ dispatchOptions.overrides = {
2769
+ priority: networkPriority
2770
+ };
2771
+ }
2772
+ return buildNetworkSnapshot$5(luvio, config, dispatchOptions);
2773
+ }
2774
+ function buildCachedSnapshotCachePolicy$3(context, storeLookup) {
2775
+ var luvio = context.luvio, config = context.config;
2776
+ var selector = {
2777
+ recordId: keyBuilder$a(luvio, config),
2778
+ node: adapterFragment$3(luvio, config),
2779
+ variables: {},
2780
+ };
2781
+ var cacheSnapshot = storeLookup(selector, {
2782
+ config: config,
2783
+ resolve: function () { return buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions); }
2784
+ });
2785
+ return cacheSnapshot;
2786
+ }
2787
+ var getQuestionnairesAdapterFactory = function (luvio) { return function LEAP__getQuestionnaires(untrustedConfig, requestContext) {
2788
+ var config = validateAdapterConfig$5(untrustedConfig, getQuestionnaires_ConfigPropertyNames);
2789
+ // Invalid or incomplete config
2790
+ if (config === null) {
2791
+ return null;
2792
+ }
2793
+ return luvio.applyCachePolicy((requestContext || {}), { config: config, luvio: luvio }, // BuildSnapshotContext
2794
+ buildCachedSnapshotCachePolicy$3, buildNetworkSnapshotCachePolicy$3);
2795
+ }; };
2796
+
2797
+ var VERSION$5 = "107898f86df2248eab831be29f7e7205";
2798
+ function validate$6(obj, path) {
2799
+ if (path === void 0) { path = 'LightningAssistantCategoryRepresentation'; }
2800
+ var v_error = (function () {
2801
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2802
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2803
+ }
2804
+ var obj_developerName = obj.developerName;
2805
+ var path_developerName = path + '.developerName';
2806
+ if (typeof obj_developerName !== 'string') {
2807
+ return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
2808
+ }
2809
+ var obj_recommended = obj.recommended;
2810
+ var path_recommended = path + '.recommended';
2811
+ if (typeof obj_recommended !== 'boolean') {
2812
+ return new TypeError('Expected "boolean" but received "' + typeof obj_recommended + '" (at "' + path_recommended + '")');
2813
+ }
2814
+ var obj_title = obj.title;
2815
+ var path_title = path + '.title';
2816
+ if (typeof obj_title !== 'string') {
2817
+ return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
2818
+ }
2819
+ })();
2820
+ return v_error === undefined ? null : v_error;
2821
+ }
2822
+ var select$a = function LightningAssistantCategoryRepresentationSelect() {
2823
+ return {
2824
+ kind: 'Fragment',
2825
+ version: VERSION$5,
2826
+ private: [],
2827
+ selections: [
2828
+ {
2829
+ name: 'developerName',
2830
+ kind: 'Scalar'
2831
+ },
2832
+ {
2833
+ name: 'recommended',
2834
+ kind: 'Scalar'
2835
+ },
2836
+ {
2837
+ name: 'title',
2838
+ kind: 'Scalar'
2839
+ }
2840
+ ]
2841
+ };
2842
+ };
2843
+ function equals$5(existing, incoming) {
2844
+ var existing_recommended = existing.recommended;
2845
+ var incoming_recommended = incoming.recommended;
2846
+ if (!(existing_recommended === incoming_recommended)) {
2847
+ return false;
2848
+ }
2849
+ var existing_developerName = existing.developerName;
2850
+ var incoming_developerName = incoming.developerName;
2851
+ if (!(existing_developerName === incoming_developerName)) {
2852
+ return false;
2853
+ }
2854
+ var existing_title = existing.title;
2855
+ var incoming_title = incoming.title;
2856
+ if (!(existing_title === incoming_title)) {
2857
+ return false;
2858
+ }
2859
+ return true;
2860
+ }
2861
+
2862
+ var VERSION$4 = "f629b70d652ad385840baede1ec16739";
2863
+ function validate$5(obj, path) {
2864
+ if (path === void 0) { path = 'LightningAssistantTargetRepresentation'; }
2865
+ var v_error = (function () {
2866
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2867
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2868
+ }
2869
+ var obj_categoryList = obj.categoryList;
2870
+ var path_categoryList = path + '.categoryList';
2871
+ if (!ArrayIsArray(obj_categoryList)) {
2872
+ return new TypeError('Expected "array" but received "' + typeof obj_categoryList + '" (at "' + path_categoryList + '")');
2873
+ }
2874
+ for (var i = 0; i < obj_categoryList.length; i++) {
2875
+ var obj_categoryList_item = obj_categoryList[i];
2876
+ var path_categoryList_item = path_categoryList + '[' + i + ']';
2877
+ var referencepath_categoryList_itemValidationError = validate$6(obj_categoryList_item, path_categoryList_item);
2878
+ if (referencepath_categoryList_itemValidationError !== null) {
2879
+ var message = 'Object doesn\'t match LightningAssistantCategoryRepresentation (at "' + path_categoryList_item + '")\n';
2880
+ message += referencepath_categoryList_itemValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
2881
+ return new TypeError(message);
2882
+ }
2883
+ }
2884
+ var obj_developerName = obj.developerName;
2885
+ var path_developerName = path + '.developerName';
2886
+ if (typeof obj_developerName !== 'string') {
2887
+ return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
2888
+ }
2889
+ })();
2890
+ return v_error === undefined ? null : v_error;
2891
+ }
2892
+ var RepresentationType$3 = 'LightningAssistantTargetRepresentation';
2893
+ function keyBuilder$9(luvio, config) {
2894
+ return keyPrefix + '::' + RepresentationType$3 + ':' + config.assistant_target;
2895
+ }
2896
+ function keyBuilderFromType$3(luvio, object) {
2897
+ var keyParams = {
2898
+ assistant_target: object.developerName
2899
+ };
2900
+ return keyBuilder$9(luvio, keyParams);
2901
+ }
2902
+ function normalize$3(input, existing, path, luvio, store, timestamp) {
2903
+ return input;
2904
+ }
2905
+ var select$9 = function LightningAssistantTargetRepresentationSelect() {
2906
+ var _a = select$a(), LightningAssistantCategoryRepresentation__selections = _a.selections;
2907
+ return {
2908
+ kind: 'Fragment',
2909
+ version: VERSION$4,
2910
+ private: [],
2911
+ selections: [
2912
+ {
2913
+ name: 'categoryList',
2914
+ kind: 'Object',
2915
+ plural: true,
2916
+ selections: LightningAssistantCategoryRepresentation__selections
2917
+ },
2918
+ {
2919
+ name: 'developerName',
2920
+ kind: 'Scalar'
2921
+ }
2922
+ ]
2923
+ };
2924
+ };
2925
+ function equals$4(existing, incoming) {
2926
+ var existing_developerName = existing.developerName;
2927
+ var incoming_developerName = incoming.developerName;
2928
+ if (!(existing_developerName === incoming_developerName)) {
2929
+ return false;
2930
+ }
2931
+ var existing_categoryList = existing.categoryList;
2932
+ var incoming_categoryList = incoming.categoryList;
2933
+ var equals_categoryList_items = equalsArray(existing_categoryList, incoming_categoryList, function (existing_categoryList_item, incoming_categoryList_item) {
2934
+ if (!(equals$5(existing_categoryList_item, incoming_categoryList_item))) {
2935
+ return false;
2936
+ }
2937
+ });
2938
+ if (equals_categoryList_items === false) {
2939
+ return false;
2940
+ }
2941
+ return true;
2942
+ }
2943
+ var ingest$3 = function LightningAssistantTargetRepresentationIngest(input, path, luvio, store, timestamp) {
2944
+ if (process.env.NODE_ENV !== 'production') {
2945
+ var validateError = validate$5(input);
2946
+ if (validateError !== null) {
2947
+ throw validateError;
2948
+ }
2949
+ }
2950
+ var key = keyBuilderFromType$3(luvio, input);
2951
+ var existingRecord = store.readEntry(key);
2952
+ var ttlToUse = path.ttl !== undefined ? path.ttl : 2592000000;
2953
+ var incomingRecord = normalize$3(input, store.readEntry(key), {
2954
+ fullPath: key,
2955
+ parent: path.parent,
2956
+ propertyName: path.propertyName,
2957
+ ttl: ttlToUse
2958
+ });
2959
+ if (existingRecord === undefined || equals$4(existingRecord, incomingRecord) === false) {
2960
+ luvio.storePublish(key, incomingRecord);
2961
+ }
2962
+ if (ttlToUse !== undefined) {
2963
+ var storeMetadataParams = {
2964
+ ttl: ttlToUse,
2965
+ namespace: "LEAP",
2966
+ version: VERSION$4,
2967
+ representationName: RepresentationType$3,
2968
+ };
2969
+ luvio.publishStoreMetadata(key, storeMetadataParams);
2970
+ }
2971
+ return createLink(key);
2972
+ };
2973
+ function getTypeCacheKeys$3(luvio, input, fullPathFactory) {
2974
+ var rootKeySet = new engine.StoreKeyMap();
2975
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
2976
+ var rootKey = keyBuilderFromType$3(luvio, input);
2977
+ rootKeySet.set(rootKey, {
2978
+ namespace: keyPrefix,
2979
+ representationName: RepresentationType$3,
2980
+ mergeable: false
2981
+ });
2982
+ return rootKeySet;
2983
+ }
2984
+
2985
+ function select$8(luvio, params) {
2986
+ return select$9();
2987
+ }
2988
+ function keyBuilder$8(luvio, params) {
2989
+ return keyBuilder$9(luvio, {
2990
+ assistant_target: params.urlParams.assistantTarget
2991
+ });
2992
+ }
2993
+ function getResponseCacheKeys$4(luvio, resourceParams, response) {
2994
+ return getTypeCacheKeys$3(luvio, response);
2995
+ }
2996
+ function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
2997
+ var body = response.body;
2998
+ var key = keyBuilder$8(luvio, resourceParams);
2999
+ luvio.storeIngest(key, ingest$3, body);
3000
+ var snapshot = luvio.storeLookup({
3001
+ recordId: key,
3002
+ node: select$8(),
3003
+ variables: {},
3004
+ }, snapshotRefresh);
3005
+ if (process.env.NODE_ENV !== 'production') {
3006
+ if (snapshot.state !== 'Fulfilled') {
3007
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
3008
+ }
3009
+ }
3010
+ return snapshot;
3011
+ }
3012
+ function ingestError$2(luvio, params, error, snapshotRefresh) {
3013
+ var key = keyBuilder$8(luvio, params);
3014
+ var errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
3015
+ luvio.storeIngestError(key, errorSnapshot);
3016
+ return errorSnapshot;
3017
+ }
3018
+ function createResourceRequest$4(config) {
3019
+ var headers = {};
3020
+ return {
3021
+ baseUri: '/services/data/v58.0',
3022
+ basePath: '/assistant-platform/' + config.urlParams.assistantTarget + '/info',
3023
+ method: 'get',
3024
+ body: null,
3025
+ urlParams: config.urlParams,
3026
+ queryParams: {},
3027
+ headers: headers,
3028
+ priority: 'normal',
3029
+ };
3030
+ }
3031
+
3032
+ var getAssistantTarget_ConfigPropertyNames = {
3033
+ displayName: 'getAssistantTarget',
3034
+ parameters: {
3035
+ required: ['assistantTarget'],
3036
+ optional: []
3037
+ }
3038
+ };
3039
+ function createResourceParams$4(config) {
3040
+ var resourceParams = {
3041
+ urlParams: {
3042
+ assistantTarget: config.assistantTarget
3043
+ }
3044
+ };
3045
+ return resourceParams;
3046
+ }
3047
+ function keyBuilder$7(luvio, config) {
3048
+ var resourceParams = createResourceParams$4(config);
3049
+ return keyBuilder$8(luvio, resourceParams);
3050
+ }
3051
+ function typeCheckConfig$4(untrustedConfig) {
3052
+ var config = {};
3053
+ var untrustedConfig_assistantTarget = untrustedConfig.assistantTarget;
3054
+ if (typeof untrustedConfig_assistantTarget === 'string') {
3055
+ config.assistantTarget = untrustedConfig_assistantTarget;
3056
+ }
3057
+ return config;
3058
+ }
3059
+ function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
3060
+ if (!untrustedIsObject(untrustedConfig)) {
3061
+ return null;
3062
+ }
3063
+ if (process.env.NODE_ENV !== 'production') {
3064
+ validateConfig(untrustedConfig, configPropertyNames);
3065
+ }
3066
+ var config = typeCheckConfig$4(untrustedConfig);
3067
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
3068
+ return null;
3069
+ }
3070
+ return config;
3071
+ }
3072
+ function adapterFragment$2(luvio, config) {
3073
+ createResourceParams$4(config);
3074
+ return select$8();
3075
+ }
3076
+ function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
3077
+ var snapshot = ingestSuccess$4(luvio, resourceParams, response, {
3078
+ config: config,
3079
+ resolve: function () { return buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions); }
3080
+ });
3081
+ return luvio.storeBroadcast().then(function () { return snapshot; });
3082
+ }
3083
+ function onFetchResponseError$2(luvio, config, resourceParams, response) {
3084
+ var snapshot = ingestError$2(luvio, resourceParams, response, {
3085
+ config: config,
3086
+ resolve: function () { return buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions); }
3087
+ });
3088
+ return luvio.storeBroadcast().then(function () { return snapshot; });
3089
+ }
3090
+ function buildNetworkSnapshot$4(luvio, config, options) {
3091
+ var resourceParams = createResourceParams$4(config);
3092
+ var request = createResourceRequest$4(resourceParams);
3093
+ return luvio.dispatchResourceRequest(request, options)
3094
+ .then(function (response) {
3095
+ return luvio.handleSuccessResponse(function () { return onFetchResponseSuccess$2(luvio, config, resourceParams, response); }, function () { return getResponseCacheKeys$4(luvio, resourceParams, response.body); });
3096
+ }, function (response) {
3097
+ return luvio.handleErrorResponse(function () { return onFetchResponseError$2(luvio, config, resourceParams, response); });
3098
+ });
3099
+ }
3100
+ function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
3101
+ var luvio = context.luvio, config = context.config;
3102
+ var networkPriority = coercedAdapterRequestContext.networkPriority, requestCorrelator = coercedAdapterRequestContext.requestCorrelator, eventObservers = coercedAdapterRequestContext.eventObservers;
3103
+ var dispatchOptions = {
3104
+ resourceRequestContext: {
3105
+ requestCorrelator: requestCorrelator,
3106
+ luvioRequestMethod: undefined,
3107
+ },
3108
+ eventObservers: eventObservers
3109
+ };
3110
+ if (networkPriority !== 'normal') {
3111
+ dispatchOptions.overrides = {
3112
+ priority: networkPriority
3113
+ };
3114
+ }
3115
+ return buildNetworkSnapshot$4(luvio, config, dispatchOptions);
3116
+ }
3117
+ function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
3118
+ var luvio = context.luvio, config = context.config;
3119
+ var selector = {
3120
+ recordId: keyBuilder$7(luvio, config),
3121
+ node: adapterFragment$2(luvio, config),
3122
+ variables: {},
3123
+ };
3124
+ var cacheSnapshot = storeLookup(selector, {
3125
+ config: config,
3126
+ resolve: function () { return buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions); }
3127
+ });
3128
+ return cacheSnapshot;
3129
+ }
3130
+ var getAssistantTargetAdapterFactory = function (luvio) { return function LEAP__getAssistantTarget(untrustedConfig, requestContext) {
3131
+ var config = validateAdapterConfig$4(untrustedConfig, getAssistantTarget_ConfigPropertyNames);
3132
+ // Invalid or incomplete config
3133
+ if (config === null) {
3134
+ return null;
3135
+ }
3136
+ return luvio.applyCachePolicy((requestContext || {}), { config: config, luvio: luvio }, // BuildSnapshotContext
3137
+ buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
3138
+ }; };
3139
+
3140
+ var VERSION$3 = "f2e480ff95d6a6b46f4a4b00d2d40a04";
3141
+ function validate$4(obj, path) {
3142
+ if (path === void 0) { path = 'LightningAssistantInitializationRepresentation'; }
3143
+ var v_error = (function () {
3144
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3145
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3146
+ }
3147
+ var obj_assistantTarget = obj.assistantTarget;
3148
+ var path_assistantTarget = path + '.assistantTarget';
3149
+ if (typeof obj_assistantTarget !== 'string') {
3150
+ return new TypeError('Expected "string" but received "' + typeof obj_assistantTarget + '" (at "' + path_assistantTarget + '")');
3151
+ }
3152
+ var obj_isInitialized = obj.isInitialized;
3153
+ var path_isInitialized = path + '.isInitialized';
3154
+ if (typeof obj_isInitialized !== 'boolean') {
3155
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isInitialized + '" (at "' + path_isInitialized + '")');
3156
+ }
3157
+ })();
3158
+ return v_error === undefined ? null : v_error;
3159
+ }
3160
+ var RepresentationType$2 = 'LightningAssistantInitializationRepresentation';
3161
+ function keyBuilder$6(luvio, config) {
3162
+ return keyPrefix + '::' + RepresentationType$2 + ':' + config.is_initialized + ':' + config.assistant_target;
3163
+ }
3164
+ function keyBuilderFromType$2(luvio, object) {
3165
+ var keyParams = {
3166
+ is_initialized: object.isInitialized,
3167
+ assistant_target: object.assistantTarget
3168
+ };
3169
+ return keyBuilder$6(luvio, keyParams);
3170
+ }
3171
+ function normalize$2(input, existing, path, luvio, store, timestamp) {
3172
+ return input;
3173
+ }
3174
+ var select$7 = function LightningAssistantInitializationRepresentationSelect() {
3175
+ return {
3176
+ kind: 'Fragment',
3177
+ version: VERSION$3,
3178
+ private: [],
3179
+ selections: [
3180
+ {
3181
+ name: 'assistantTarget',
3182
+ kind: 'Scalar'
3183
+ },
3184
+ {
3185
+ name: 'isInitialized',
3186
+ kind: 'Scalar'
3187
+ }
3188
+ ]
3189
+ };
3190
+ };
3191
+ function equals$3(existing, incoming) {
3192
+ var existing_isInitialized = existing.isInitialized;
3193
+ var incoming_isInitialized = incoming.isInitialized;
3194
+ if (!(existing_isInitialized === incoming_isInitialized)) {
3195
+ return false;
3196
+ }
3197
+ var existing_assistantTarget = existing.assistantTarget;
3198
+ var incoming_assistantTarget = incoming.assistantTarget;
3199
+ if (!(existing_assistantTarget === incoming_assistantTarget)) {
3200
+ return false;
3201
+ }
3202
+ return true;
3203
+ }
3204
+ var ingest$2 = function LightningAssistantInitializationRepresentationIngest(input, path, luvio, store, timestamp) {
3205
+ if (process.env.NODE_ENV !== 'production') {
3206
+ var validateError = validate$4(input);
3207
+ if (validateError !== null) {
3208
+ throw validateError;
3209
+ }
3210
+ }
3211
+ var key = keyBuilderFromType$2(luvio, input);
3212
+ var existingRecord = store.readEntry(key);
3213
+ var ttlToUse = path.ttl !== undefined ? path.ttl : 2592000000;
3214
+ var incomingRecord = normalize$2(input, store.readEntry(key), {
3215
+ fullPath: key,
3216
+ parent: path.parent,
3217
+ propertyName: path.propertyName,
3218
+ ttl: ttlToUse
3219
+ });
3220
+ if (existingRecord === undefined || equals$3(existingRecord, incomingRecord) === false) {
3221
+ luvio.storePublish(key, incomingRecord);
3222
+ }
3223
+ if (ttlToUse !== undefined) {
3224
+ var storeMetadataParams = {
3225
+ ttl: ttlToUse,
3226
+ namespace: "LEAP",
3227
+ version: VERSION$3,
3228
+ representationName: RepresentationType$2,
3229
+ };
3230
+ luvio.publishStoreMetadata(key, storeMetadataParams);
3231
+ }
3232
+ return createLink(key);
3233
+ };
3234
+ function getTypeCacheKeys$2(luvio, input, fullPathFactory) {
3235
+ var rootKeySet = new engine.StoreKeyMap();
3236
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
3237
+ var rootKey = keyBuilderFromType$2(luvio, input);
3238
+ rootKeySet.set(rootKey, {
3239
+ namespace: keyPrefix,
3240
+ representationName: RepresentationType$2,
3241
+ mergeable: false
3242
+ });
3243
+ return rootKeySet;
3244
+ }
3245
+
3246
+ function select$6(luvio, params) {
3247
+ return select$7();
3248
+ }
3249
+ function getResponseCacheKeys$3(luvio, resourceParams, response) {
3250
+ return getTypeCacheKeys$2(luvio, response);
3251
+ }
3252
+ function ingestSuccess$3(luvio, resourceParams, response) {
3253
+ var body = response.body;
3254
+ var key = keyBuilderFromType$2(luvio, body);
3255
+ luvio.storeIngest(key, ingest$2, body);
3256
+ var snapshot = luvio.storeLookup({
3257
+ recordId: key,
3258
+ node: select$6(),
3259
+ variables: {},
3260
+ });
3261
+ if (process.env.NODE_ENV !== 'production') {
3262
+ if (snapshot.state !== 'Fulfilled') {
3263
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
3264
+ }
3265
+ }
3266
+ return snapshot;
3267
+ }
3268
+ function createResourceRequest$3(config) {
3269
+ var headers = {};
3270
+ return {
3271
+ baseUri: '/services/data/v58.0',
3272
+ basePath: '/assistant-platform/' + config.urlParams.assistantTarget + '/initialize',
3273
+ method: 'put',
3274
+ body: null,
3275
+ urlParams: config.urlParams,
3276
+ queryParams: {},
3277
+ headers: headers,
3278
+ priority: 'normal',
3279
+ };
3280
+ }
3281
+
3282
+ var initialize_ConfigPropertyNames = {
3283
+ displayName: 'initialize',
3284
+ parameters: {
3285
+ required: ['assistantTarget'],
3286
+ optional: []
3287
+ }
3288
+ };
3289
+ function createResourceParams$3(config) {
3290
+ var resourceParams = {
3291
+ urlParams: {
3292
+ assistantTarget: config.assistantTarget
3293
+ }
3294
+ };
3295
+ return resourceParams;
3296
+ }
3297
+ function typeCheckConfig$3(untrustedConfig) {
3298
+ var config = {};
3299
+ var untrustedConfig_assistantTarget = untrustedConfig.assistantTarget;
3300
+ if (typeof untrustedConfig_assistantTarget === 'string') {
3301
+ config.assistantTarget = untrustedConfig_assistantTarget;
3302
+ }
3303
+ return config;
3304
+ }
3305
+ function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
3306
+ if (!untrustedIsObject(untrustedConfig)) {
3307
+ return null;
3308
+ }
3309
+ if (process.env.NODE_ENV !== 'production') {
3310
+ validateConfig(untrustedConfig, configPropertyNames);
3311
+ }
3312
+ var config = typeCheckConfig$3(untrustedConfig);
3313
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
3314
+ return null;
3315
+ }
3316
+ return config;
3317
+ }
3318
+ function buildNetworkSnapshot$3(luvio, config, options) {
3319
+ var resourceParams = createResourceParams$3(config);
3320
+ var request = createResourceRequest$3(resourceParams);
3321
+ return luvio.dispatchResourceRequest(request, options)
3322
+ .then(function (response) {
3323
+ return luvio.handleSuccessResponse(function () {
3324
+ var snapshot = ingestSuccess$3(luvio, resourceParams, response);
3325
+ return luvio.storeBroadcast().then(function () { return snapshot; });
3326
+ }, function () { return getResponseCacheKeys$3(luvio, resourceParams, response.body); });
3327
+ }, function (response) {
3328
+ deepFreeze(response);
3329
+ throw response;
3330
+ });
3331
+ }
3332
+ var initializeAdapterFactory = function (luvio) {
3333
+ return function initialize(untrustedConfig) {
3334
+ var config = validateAdapterConfig$3(untrustedConfig, initialize_ConfigPropertyNames);
3335
+ // Invalid or incomplete config
3336
+ if (config === null) {
3337
+ throw new Error('Invalid config for "initialize"');
3338
+ }
3339
+ return buildNetworkSnapshot$3(luvio, config);
3340
+ };
3341
+ };
3342
+
3343
+ var VERSION$2 = "86eec990f47f496e2991fb9e5ccf0802";
3344
+ function validate$3(obj, path) {
3345
+ if (path === void 0) { path = 'LightningAssistantListRepresentation'; }
3346
+ var v_error = (function () {
3347
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3348
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3349
+ }
3350
+ var obj_assistantList = obj.assistantList;
3351
+ var path_assistantList = path + '.assistantList';
3352
+ if (!ArrayIsArray(obj_assistantList)) {
3353
+ return new TypeError('Expected "array" but received "' + typeof obj_assistantList + '" (at "' + path_assistantList + '")');
3354
+ }
3355
+ for (var i = 0; i < obj_assistantList.length; i++) {
3356
+ var obj_assistantList_item = obj_assistantList[i];
3357
+ var path_assistantList_item = path_assistantList + '[' + i + ']';
3358
+ if (typeof obj_assistantList_item !== 'object') {
3359
+ return new TypeError('Expected "object" but received "' + typeof obj_assistantList_item + '" (at "' + path_assistantList_item + '")');
3360
+ }
3361
+ }
3362
+ var obj_assistantTarget = obj.assistantTarget;
3363
+ var path_assistantTarget = path + '.assistantTarget';
3364
+ if (typeof obj_assistantTarget !== 'string') {
3365
+ return new TypeError('Expected "string" but received "' + typeof obj_assistantTarget + '" (at "' + path_assistantTarget + '")');
3366
+ }
3367
+ })();
3368
+ return v_error === undefined ? null : v_error;
3369
+ }
3370
+ var RepresentationType$1 = 'LightningAssistantListRepresentation';
3371
+ function keyBuilder$5(luvio, config) {
3372
+ return keyPrefix + '::' + RepresentationType$1 + ':' + config.assistant_target;
3373
+ }
3374
+ function keyBuilderFromType$1(luvio, object) {
3375
+ var keyParams = {
3376
+ assistant_target: object.assistantTarget
3377
+ };
3378
+ return keyBuilder$5(luvio, keyParams);
3379
+ }
3380
+ function normalize$1(input, existing, path, luvio, store, timestamp) {
3381
+ var input_assistantList = input.assistantList;
3382
+ var input_assistantList_id = path.fullPath + '__assistantList';
3383
+ for (var i = 0; i < input_assistantList.length; i++) {
3384
+ var input_assistantList_item = input_assistantList[i];
3385
+ var input_assistantList_item_id = input_assistantList_id + '__' + i;
3386
+ input_assistantList[i] = ingest$5(input_assistantList_item, {
3387
+ fullPath: input_assistantList_item_id,
3388
+ propertyName: i,
3389
+ parent: {
3390
+ data: input,
3391
+ key: path.fullPath,
3392
+ existing: existing,
3393
+ },
3394
+ ttl: path.ttl
3395
+ }, luvio, store);
3396
+ }
3397
+ return input;
3398
+ }
3399
+ var select$5 = function LightningAssistantListRepresentationSelect() {
3400
+ return {
3401
+ kind: 'Fragment',
3402
+ version: VERSION$2,
3403
+ private: [],
3404
+ selections: [
3405
+ {
3406
+ name: 'assistantList',
3407
+ kind: 'Link',
3408
+ plural: true,
3409
+ fragment: select$f()
3410
+ },
3411
+ {
3412
+ name: 'assistantTarget',
3413
+ kind: 'Scalar'
3414
+ }
3415
+ ]
3416
+ };
3417
+ };
3418
+ function equals$2(existing, incoming) {
3419
+ var existing_assistantTarget = existing.assistantTarget;
3420
+ var incoming_assistantTarget = incoming.assistantTarget;
3421
+ if (!(existing_assistantTarget === incoming_assistantTarget)) {
3422
+ return false;
3423
+ }
3424
+ var existing_assistantList = existing.assistantList;
3425
+ var incoming_assistantList = incoming.assistantList;
3426
+ var equals_assistantList_items = equalsArray(existing_assistantList, incoming_assistantList, function (existing_assistantList_item, incoming_assistantList_item) {
3427
+ if (!(existing_assistantList_item.__ref === incoming_assistantList_item.__ref)) {
3428
+ return false;
3429
+ }
3430
+ });
3431
+ if (equals_assistantList_items === false) {
3432
+ return false;
3433
+ }
3434
+ return true;
3435
+ }
3436
+ var ingest$1 = function LightningAssistantListRepresentationIngest(input, path, luvio, store, timestamp) {
3437
+ if (process.env.NODE_ENV !== 'production') {
3438
+ var validateError = validate$3(input);
3439
+ if (validateError !== null) {
3440
+ throw validateError;
3441
+ }
3442
+ }
3443
+ var key = keyBuilderFromType$1(luvio, input);
3444
+ var existingRecord = store.readEntry(key);
3445
+ var ttlToUse = path.ttl !== undefined ? path.ttl : 2592000000;
3446
+ var incomingRecord = normalize$1(input, store.readEntry(key), {
3447
+ fullPath: key,
3448
+ parent: path.parent,
3449
+ propertyName: path.propertyName,
3450
+ ttl: ttlToUse
3451
+ }, luvio, store);
3452
+ if (existingRecord === undefined || equals$2(existingRecord, incomingRecord) === false) {
3453
+ luvio.storePublish(key, incomingRecord);
3454
+ }
3455
+ if (ttlToUse !== undefined) {
3456
+ var storeMetadataParams = {
3457
+ ttl: ttlToUse,
3458
+ namespace: "LEAP",
3459
+ version: VERSION$2,
3460
+ representationName: RepresentationType$1,
3461
+ };
3462
+ luvio.publishStoreMetadata(key, storeMetadataParams);
3463
+ }
3464
+ return createLink(key);
3465
+ };
3466
+ function getTypeCacheKeys$1(luvio, input, fullPathFactory) {
3467
+ var rootKeySet = new engine.StoreKeyMap();
3468
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
3469
+ var rootKey = keyBuilderFromType$1(luvio, input);
3470
+ rootKeySet.set(rootKey, {
3471
+ namespace: keyPrefix,
3472
+ representationName: RepresentationType$1,
3473
+ mergeable: false
3474
+ });
3475
+ var input_assistantList_length = input.assistantList.length;
3476
+ for (var i = 0; i < input_assistantList_length; i++) {
3477
+ rootKeySet.merge(getTypeCacheKeys$5(luvio, input.assistantList[i]));
3478
+ }
3479
+ return rootKeySet;
3480
+ }
3481
+
3482
+ function select$4(luvio, params) {
3483
+ return select$5();
3484
+ }
3485
+ function keyBuilder$4(luvio, params) {
3486
+ return keyBuilder$5(luvio, {
3487
+ assistant_target: params.urlParams.assistantTarget
3488
+ });
3489
+ }
3490
+ function getResponseCacheKeys$2(luvio, resourceParams, response) {
3491
+ return getTypeCacheKeys$1(luvio, response);
3492
+ }
3493
+ function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
3494
+ var body = response.body;
3495
+ var key = keyBuilder$4(luvio, resourceParams);
3496
+ luvio.storeIngest(key, ingest$1, body);
3497
+ var snapshot = luvio.storeLookup({
3498
+ recordId: key,
3499
+ node: select$4(),
3500
+ variables: {},
3501
+ }, snapshotRefresh);
3502
+ if (process.env.NODE_ENV !== 'production') {
3503
+ if (snapshot.state !== 'Fulfilled') {
3504
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
3505
+ }
3506
+ }
3507
+ return snapshot;
3508
+ }
3509
+ function ingestError$1(luvio, params, error, snapshotRefresh) {
3510
+ var key = keyBuilder$4(luvio, params);
3511
+ var errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
3512
+ luvio.storeIngestError(key, errorSnapshot);
3513
+ return errorSnapshot;
3514
+ }
3515
+ function createResourceRequest$2(config) {
3516
+ var headers = {};
3517
+ return {
3518
+ baseUri: '/services/data/v58.0',
3519
+ basePath: '/assistant-platform/' + config.urlParams.assistantTarget + '/list',
3520
+ method: 'get',
3521
+ body: null,
3522
+ urlParams: config.urlParams,
3523
+ queryParams: {},
3524
+ headers: headers,
3525
+ priority: 'normal',
3526
+ };
3527
+ }
3528
+
3529
+ var getAssistantList_ConfigPropertyNames = {
3530
+ displayName: 'getAssistantList',
3531
+ parameters: {
3532
+ required: ['assistantTarget'],
3533
+ optional: []
3534
+ }
3535
+ };
3536
+ function createResourceParams$2(config) {
3537
+ var resourceParams = {
3538
+ urlParams: {
3539
+ assistantTarget: config.assistantTarget
3540
+ }
3541
+ };
3542
+ return resourceParams;
3543
+ }
3544
+ function keyBuilder$3(luvio, config) {
3545
+ var resourceParams = createResourceParams$2(config);
3546
+ return keyBuilder$4(luvio, resourceParams);
3547
+ }
3548
+ function typeCheckConfig$2(untrustedConfig) {
3549
+ var config = {};
3550
+ var untrustedConfig_assistantTarget = untrustedConfig.assistantTarget;
3551
+ if (typeof untrustedConfig_assistantTarget === 'string') {
3552
+ config.assistantTarget = untrustedConfig_assistantTarget;
3553
+ }
3554
+ return config;
3555
+ }
3556
+ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
3557
+ if (!untrustedIsObject(untrustedConfig)) {
3558
+ return null;
3559
+ }
3560
+ if (process.env.NODE_ENV !== 'production') {
3561
+ validateConfig(untrustedConfig, configPropertyNames);
3562
+ }
3563
+ var config = typeCheckConfig$2(untrustedConfig);
3564
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
3565
+ return null;
3566
+ }
3567
+ return config;
3568
+ }
3569
+ function adapterFragment$1(luvio, config) {
3570
+ createResourceParams$2(config);
3571
+ return select$4();
3572
+ }
3573
+ function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
3574
+ var snapshot = ingestSuccess$2(luvio, resourceParams, response, {
3575
+ config: config,
3576
+ resolve: function () { return buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions); }
3577
+ });
3578
+ return luvio.storeBroadcast().then(function () { return snapshot; });
3579
+ }
3580
+ function onFetchResponseError$1(luvio, config, resourceParams, response) {
3581
+ var snapshot = ingestError$1(luvio, resourceParams, response, {
3582
+ config: config,
3583
+ resolve: function () { return buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions); }
3584
+ });
3585
+ return luvio.storeBroadcast().then(function () { return snapshot; });
3586
+ }
3587
+ function buildNetworkSnapshot$2(luvio, config, options) {
3588
+ var resourceParams = createResourceParams$2(config);
3589
+ var request = createResourceRequest$2(resourceParams);
3590
+ return luvio.dispatchResourceRequest(request, options)
3591
+ .then(function (response) {
3592
+ return luvio.handleSuccessResponse(function () { return onFetchResponseSuccess$1(luvio, config, resourceParams, response); }, function () { return getResponseCacheKeys$2(luvio, resourceParams, response.body); });
3593
+ }, function (response) {
3594
+ return luvio.handleErrorResponse(function () { return onFetchResponseError$1(luvio, config, resourceParams, response); });
3595
+ });
3596
+ }
3597
+ function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
3598
+ var luvio = context.luvio, config = context.config;
3599
+ var networkPriority = coercedAdapterRequestContext.networkPriority, requestCorrelator = coercedAdapterRequestContext.requestCorrelator, eventObservers = coercedAdapterRequestContext.eventObservers;
3600
+ var dispatchOptions = {
3601
+ resourceRequestContext: {
3602
+ requestCorrelator: requestCorrelator,
3603
+ luvioRequestMethod: undefined,
3604
+ },
3605
+ eventObservers: eventObservers
3606
+ };
3607
+ if (networkPriority !== 'normal') {
3608
+ dispatchOptions.overrides = {
3609
+ priority: networkPriority
3610
+ };
3611
+ }
3612
+ return buildNetworkSnapshot$2(luvio, config, dispatchOptions);
3613
+ }
3614
+ function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
3615
+ var luvio = context.luvio, config = context.config;
3616
+ var selector = {
3617
+ recordId: keyBuilder$3(luvio, config),
3618
+ node: adapterFragment$1(luvio, config),
3619
+ variables: {},
3620
+ };
3621
+ var cacheSnapshot = storeLookup(selector, {
3622
+ config: config,
3623
+ resolve: function () { return buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions); }
3624
+ });
3625
+ return cacheSnapshot;
3626
+ }
3627
+ var getAssistantListAdapterFactory = function (luvio) { return function LEAP__getAssistantList(untrustedConfig, requestContext) {
3628
+ var config = validateAdapterConfig$2(untrustedConfig, getAssistantList_ConfigPropertyNames);
3629
+ // Invalid or incomplete config
3630
+ if (config === null) {
3631
+ return null;
3632
+ }
3633
+ return luvio.applyCachePolicy((requestContext || {}), { config: config, luvio: luvio }, // BuildSnapshotContext
3634
+ buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
3635
+ }; };
3636
+
3637
+ function validate$2(obj, path) {
3638
+ if (path === void 0) { path = 'LightningAssistantListInputRepresentation'; }
3639
+ var v_error = (function () {
3640
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3641
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3642
+ }
3643
+ var obj_assistantList = obj.assistantList;
3644
+ var path_assistantList = path + '.assistantList';
3645
+ if (typeof obj_assistantList !== 'object' || ArrayIsArray(obj_assistantList) || obj_assistantList === null) {
3646
+ return new TypeError('Expected "object" but received "' + typeof obj_assistantList + '" (at "' + path_assistantList + '")');
3647
+ }
3648
+ var obj_assistantList_keys = ObjectKeys(obj_assistantList);
3649
+ for (var i = 0; i < obj_assistantList_keys.length; i++) {
3650
+ var key = obj_assistantList_keys[i];
3651
+ var obj_assistantList_prop = obj_assistantList[key];
3652
+ var path_assistantList_prop = path_assistantList + '["' + key + '"]';
3653
+ if (typeof obj_assistantList_prop !== 'object' || ArrayIsArray(obj_assistantList_prop) || obj_assistantList_prop === null) {
3654
+ return new TypeError('Expected "object" but received "' + typeof obj_assistantList_prop + '" (at "' + path_assistantList_prop + '")');
3655
+ }
3656
+ }
3657
+ })();
3658
+ return v_error === undefined ? null : v_error;
3659
+ }
3660
+
3661
+ function select$3(luvio, params) {
3662
+ return select$5();
3663
+ }
3664
+ function getResponseCacheKeys$1(luvio, resourceParams, response) {
3665
+ return getTypeCacheKeys$1(luvio, response);
3666
+ }
3667
+ function ingestSuccess$1(luvio, resourceParams, response) {
3668
+ var body = response.body;
3669
+ var key = keyBuilderFromType$1(luvio, body);
3670
+ luvio.storeIngest(key, ingest$1, body);
3671
+ var snapshot = luvio.storeLookup({
3672
+ recordId: key,
3673
+ node: select$3(),
3674
+ variables: {},
3675
+ });
3676
+ if (process.env.NODE_ENV !== 'production') {
3677
+ if (snapshot.state !== 'Fulfilled') {
3678
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
3679
+ }
3680
+ }
3681
+ return snapshot;
3682
+ }
3683
+ function createResourceRequest$1(config) {
3684
+ var headers = {};
3685
+ return {
3686
+ baseUri: '/services/data/v58.0',
3687
+ basePath: '/assistant-platform/' + config.urlParams.assistantTarget + '/list',
3688
+ method: 'patch',
3689
+ body: config.body,
3690
+ urlParams: config.urlParams,
3691
+ queryParams: {},
3692
+ headers: headers,
3693
+ priority: 'normal',
3694
+ };
3695
+ }
3696
+
3697
+ var saveAssistantList_ConfigPropertyNames = {
3698
+ displayName: 'saveAssistantList',
3699
+ parameters: {
3700
+ required: ['assistantTarget', 'assistantData'],
3701
+ optional: []
3702
+ }
3703
+ };
3704
+ function createResourceParams$1(config) {
3705
+ var resourceParams = {
3706
+ urlParams: {
3707
+ assistantTarget: config.assistantTarget
3708
+ },
3709
+ body: {
3710
+ assistantData: config.assistantData
3711
+ }
3712
+ };
3713
+ return resourceParams;
3714
+ }
3715
+ function typeCheckConfig$1(untrustedConfig) {
3716
+ var config = {};
3717
+ var untrustedConfig_assistantTarget = untrustedConfig.assistantTarget;
3718
+ if (typeof untrustedConfig_assistantTarget === 'string') {
3719
+ config.assistantTarget = untrustedConfig_assistantTarget;
3720
+ }
3721
+ var untrustedConfig_assistantData = untrustedConfig.assistantData;
3722
+ var referenceLightningAssistantListInputRepresentationValidationError = validate$2(untrustedConfig_assistantData);
3723
+ if (referenceLightningAssistantListInputRepresentationValidationError === null) {
3724
+ config.assistantData = untrustedConfig_assistantData;
3725
+ }
3726
+ return config;
3727
+ }
3728
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
3729
+ if (!untrustedIsObject(untrustedConfig)) {
3730
+ return null;
3731
+ }
3732
+ if (process.env.NODE_ENV !== 'production') {
3733
+ validateConfig(untrustedConfig, configPropertyNames);
3734
+ }
3735
+ var config = typeCheckConfig$1(untrustedConfig);
3736
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
3737
+ return null;
3738
+ }
3739
+ return config;
3740
+ }
3741
+ function buildNetworkSnapshot$1(luvio, config, options) {
3742
+ var resourceParams = createResourceParams$1(config);
3743
+ var request = createResourceRequest$1(resourceParams);
3744
+ return luvio.dispatchResourceRequest(request, options)
3745
+ .then(function (response) {
3746
+ return luvio.handleSuccessResponse(function () {
3747
+ var snapshot = ingestSuccess$1(luvio, resourceParams, response);
3748
+ return luvio.storeBroadcast().then(function () { return snapshot; });
3749
+ }, function () { return getResponseCacheKeys$1(luvio, resourceParams, response.body); });
3750
+ }, function (response) {
3751
+ deepFreeze(response);
3752
+ throw response;
3753
+ });
3754
+ }
3755
+ var saveAssistantListAdapterFactory = function (luvio) {
3756
+ return function saveAssistantList(untrustedConfig) {
3757
+ var config = validateAdapterConfig$1(untrustedConfig, saveAssistantList_ConfigPropertyNames);
3758
+ // Invalid or incomplete config
3759
+ if (config === null) {
3760
+ throw new Error('Invalid config for "saveAssistantList"');
3761
+ }
3762
+ return buildNetworkSnapshot$1(luvio, config);
3763
+ };
3764
+ };
3765
+
3766
+ var VERSION$1 = "60c238eb770e68fa40b048eee3d01775";
3767
+ function validate$1(obj, path) {
3768
+ if (path === void 0) { path = 'LightningAssistantInfoRepresentation'; }
3769
+ var v_error = (function () {
3770
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3771
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3772
+ }
3773
+ var obj_assistantTarget = obj.assistantTarget;
3774
+ var path_assistantTarget = path + '.assistantTarget';
3775
+ if (typeof obj_assistantTarget !== 'string') {
3776
+ return new TypeError('Expected "string" but received "' + typeof obj_assistantTarget + '" (at "' + path_assistantTarget + '")');
3777
+ }
3778
+ if (obj.category !== undefined) {
3779
+ var obj_category = obj.category;
3780
+ var path_category = path + '.category';
3781
+ if (typeof obj_category !== 'string') {
3782
+ return new TypeError('Expected "string" but received "' + typeof obj_category + '" (at "' + path_category + '")');
3783
+ }
3784
+ }
3785
+ if (obj.categoryName !== undefined) {
3786
+ var obj_categoryName = obj.categoryName;
3787
+ var path_categoryName = path + '.categoryName';
3788
+ if (typeof obj_categoryName !== 'string') {
3789
+ return new TypeError('Expected "string" but received "' + typeof obj_categoryName + '" (at "' + path_categoryName + '")');
3790
+ }
3791
+ }
3792
+ var obj_contentVersion = obj.contentVersion;
3793
+ var path_contentVersion = path + '.contentVersion';
3794
+ if (typeof obj_contentVersion !== 'string') {
3795
+ return new TypeError('Expected "string" but received "' + typeof obj_contentVersion + '" (at "' + path_contentVersion + '")');
3796
+ }
3797
+ var obj_debugModeEnabled = obj.debugModeEnabled;
3798
+ var path_debugModeEnabled = path + '.debugModeEnabled';
3799
+ if (typeof obj_debugModeEnabled !== 'boolean') {
3800
+ return new TypeError('Expected "boolean" but received "' + typeof obj_debugModeEnabled + '" (at "' + path_debugModeEnabled + '")');
3801
+ }
3802
+ var obj_description = obj.description;
3803
+ var path_description = path + '.description';
3804
+ if (typeof obj_description !== 'string') {
3805
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
3806
+ }
3807
+ var obj_developerName = obj.developerName;
3808
+ var path_developerName = path + '.developerName';
3809
+ if (typeof obj_developerName !== 'string') {
3810
+ return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
3811
+ }
3812
+ var obj_icon = obj.icon;
3813
+ var path_icon = path + '.icon';
3814
+ if (typeof obj_icon !== 'string') {
3815
+ return new TypeError('Expected "string" but received "' + typeof obj_icon + '" (at "' + path_icon + '")');
3816
+ }
3817
+ var obj_isPreview = obj.isPreview;
3818
+ var path_isPreview = path + '.isPreview';
3819
+ if (typeof obj_isPreview !== 'boolean') {
3820
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isPreview + '" (at "' + path_isPreview + '")');
3821
+ }
3822
+ var obj_title = obj.title;
3823
+ var path_title = path + '.title';
3824
+ if (typeof obj_title !== 'string') {
3825
+ return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
3826
+ }
3827
+ })();
3828
+ return v_error === undefined ? null : v_error;
3829
+ }
3830
+ var select$2 = function LightningAssistantInfoRepresentationSelect() {
3831
+ return {
3832
+ kind: 'Fragment',
3833
+ version: VERSION$1,
3834
+ private: [],
3835
+ selections: [
3836
+ {
3837
+ name: 'assistantTarget',
3838
+ kind: 'Scalar'
3839
+ },
3840
+ {
3841
+ name: 'category',
3842
+ kind: 'Scalar',
3843
+ required: false
3844
+ },
3845
+ {
3846
+ name: 'categoryName',
3847
+ kind: 'Scalar',
3848
+ required: false
3849
+ },
3850
+ {
3851
+ name: 'contentVersion',
3852
+ kind: 'Scalar'
3853
+ },
3854
+ {
3855
+ name: 'debugModeEnabled',
3856
+ kind: 'Scalar'
3857
+ },
3858
+ {
3859
+ name: 'description',
3860
+ kind: 'Scalar'
3861
+ },
3862
+ {
3863
+ name: 'developerName',
3864
+ kind: 'Scalar'
3865
+ },
3866
+ {
3867
+ name: 'icon',
3868
+ kind: 'Scalar'
3869
+ },
3870
+ {
3871
+ name: 'isPreview',
3872
+ kind: 'Scalar'
3873
+ },
3874
+ {
3875
+ name: 'title',
3876
+ kind: 'Scalar'
3877
+ }
3878
+ ]
3879
+ };
3880
+ };
3881
+ function equals$1(existing, incoming) {
3882
+ var existing_debugModeEnabled = existing.debugModeEnabled;
3883
+ var incoming_debugModeEnabled = incoming.debugModeEnabled;
3884
+ if (!(existing_debugModeEnabled === incoming_debugModeEnabled)) {
3885
+ return false;
3886
+ }
3887
+ var existing_isPreview = existing.isPreview;
3888
+ var incoming_isPreview = incoming.isPreview;
3889
+ if (!(existing_isPreview === incoming_isPreview)) {
3890
+ return false;
3891
+ }
3892
+ var existing_assistantTarget = existing.assistantTarget;
3893
+ var incoming_assistantTarget = incoming.assistantTarget;
3894
+ if (!(existing_assistantTarget === incoming_assistantTarget)) {
3895
+ return false;
3896
+ }
3897
+ var existing_category = existing.category;
3898
+ var incoming_category = incoming.category;
3899
+ // if at least one of these optionals is defined
3900
+ if (existing_category !== undefined || incoming_category !== undefined) {
3901
+ // if one of these is not defined we know the other is defined and therefore
3902
+ // not equal
3903
+ if (existing_category === undefined || incoming_category === undefined) {
3904
+ return false;
3905
+ }
3906
+ if (!(existing_category === incoming_category)) {
3907
+ return false;
3908
+ }
3909
+ }
3910
+ var existing_categoryName = existing.categoryName;
3911
+ var incoming_categoryName = incoming.categoryName;
3912
+ // if at least one of these optionals is defined
3913
+ if (existing_categoryName !== undefined || incoming_categoryName !== undefined) {
3914
+ // if one of these is not defined we know the other is defined and therefore
3915
+ // not equal
3916
+ if (existing_categoryName === undefined || incoming_categoryName === undefined) {
3917
+ return false;
3918
+ }
3919
+ if (!(existing_categoryName === incoming_categoryName)) {
3920
+ return false;
3921
+ }
3922
+ }
3923
+ var existing_contentVersion = existing.contentVersion;
3924
+ var incoming_contentVersion = incoming.contentVersion;
3925
+ if (!(existing_contentVersion === incoming_contentVersion)) {
3926
+ return false;
3927
+ }
3928
+ var existing_description = existing.description;
3929
+ var incoming_description = incoming.description;
3930
+ if (!(existing_description === incoming_description)) {
3931
+ return false;
3932
+ }
3933
+ var existing_developerName = existing.developerName;
3934
+ var incoming_developerName = incoming.developerName;
3935
+ if (!(existing_developerName === incoming_developerName)) {
3936
+ return false;
3937
+ }
3938
+ var existing_icon = existing.icon;
3939
+ var incoming_icon = incoming.icon;
3940
+ if (!(existing_icon === incoming_icon)) {
3941
+ return false;
3942
+ }
3943
+ var existing_title = existing.title;
3944
+ var incoming_title = incoming.title;
3945
+ if (!(existing_title === incoming_title)) {
3946
+ return false;
3947
+ }
3948
+ return true;
3949
+ }
3950
+
3951
+ var VERSION = "d3f2957d23e995fb380f62e85e1d26ea";
3952
+ function validate(obj, path) {
3953
+ if (path === void 0) { path = 'LightningAssistantInfoListRepresentation'; }
3954
+ var v_error = (function () {
3955
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3956
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3957
+ }
3958
+ var obj_assistantInfoList = obj.assistantInfoList;
3959
+ var path_assistantInfoList = path + '.assistantInfoList';
3960
+ if (!ArrayIsArray(obj_assistantInfoList)) {
3961
+ return new TypeError('Expected "array" but received "' + typeof obj_assistantInfoList + '" (at "' + path_assistantInfoList + '")');
3962
+ }
3963
+ for (var i = 0; i < obj_assistantInfoList.length; i++) {
3964
+ var obj_assistantInfoList_item = obj_assistantInfoList[i];
3965
+ var path_assistantInfoList_item = path_assistantInfoList + '[' + i + ']';
3966
+ var referencepath_assistantInfoList_itemValidationError = validate$1(obj_assistantInfoList_item, path_assistantInfoList_item);
3967
+ if (referencepath_assistantInfoList_itemValidationError !== null) {
3968
+ var message = 'Object doesn\'t match LightningAssistantInfoRepresentation (at "' + path_assistantInfoList_item + '")\n';
3969
+ message += referencepath_assistantInfoList_itemValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
3970
+ return new TypeError(message);
3971
+ }
3972
+ }
3973
+ var obj_assistantTarget = obj.assistantTarget;
3974
+ var path_assistantTarget = path + '.assistantTarget';
3975
+ if (typeof obj_assistantTarget !== 'string') {
3976
+ return new TypeError('Expected "string" but received "' + typeof obj_assistantTarget + '" (at "' + path_assistantTarget + '")');
3977
+ }
3978
+ })();
3979
+ return v_error === undefined ? null : v_error;
3980
+ }
3981
+ var RepresentationType = 'LightningAssistantInfoListRepresentation';
3982
+ function keyBuilder$2(luvio, config) {
3983
+ return keyPrefix + '::' + RepresentationType + ':' + config.assistant_target;
3984
+ }
3985
+ function keyBuilderFromType(luvio, object) {
3986
+ var keyParams = {
3987
+ assistant_target: object.assistantTarget
3988
+ };
3989
+ return keyBuilder$2(luvio, keyParams);
3990
+ }
3991
+ function normalize(input, existing, path, luvio, store, timestamp) {
3992
+ return input;
3993
+ }
3994
+ var select$1 = function LightningAssistantInfoListRepresentationSelect() {
3995
+ var _a = select$2(), LightningAssistantInfoRepresentation__selections = _a.selections;
3996
+ return {
3997
+ kind: 'Fragment',
3998
+ version: VERSION,
3999
+ private: [],
4000
+ selections: [
4001
+ {
4002
+ name: 'assistantInfoList',
4003
+ kind: 'Object',
4004
+ plural: true,
4005
+ selections: LightningAssistantInfoRepresentation__selections
4006
+ },
4007
+ {
4008
+ name: 'assistantTarget',
4009
+ kind: 'Scalar'
4010
+ }
4011
+ ]
4012
+ };
4013
+ };
4014
+ function equals(existing, incoming) {
4015
+ var existing_assistantTarget = existing.assistantTarget;
4016
+ var incoming_assistantTarget = incoming.assistantTarget;
4017
+ if (!(existing_assistantTarget === incoming_assistantTarget)) {
4018
+ return false;
4019
+ }
4020
+ var existing_assistantInfoList = existing.assistantInfoList;
4021
+ var incoming_assistantInfoList = incoming.assistantInfoList;
4022
+ var equals_assistantInfoList_items = equalsArray(existing_assistantInfoList, incoming_assistantInfoList, function (existing_assistantInfoList_item, incoming_assistantInfoList_item) {
4023
+ if (!(equals$1(existing_assistantInfoList_item, incoming_assistantInfoList_item))) {
4024
+ return false;
4025
+ }
4026
+ });
4027
+ if (equals_assistantInfoList_items === false) {
4028
+ return false;
4029
+ }
4030
+ return true;
4031
+ }
4032
+ var ingest = function LightningAssistantInfoListRepresentationIngest(input, path, luvio, store, timestamp) {
4033
+ if (process.env.NODE_ENV !== 'production') {
4034
+ var validateError = validate(input);
4035
+ if (validateError !== null) {
4036
+ throw validateError;
4037
+ }
4038
+ }
4039
+ var key = keyBuilderFromType(luvio, input);
4040
+ var existingRecord = store.readEntry(key);
4041
+ var ttlToUse = path.ttl !== undefined ? path.ttl : 2592000000;
4042
+ var incomingRecord = normalize(input, store.readEntry(key), {
4043
+ fullPath: key,
4044
+ parent: path.parent,
4045
+ propertyName: path.propertyName,
4046
+ ttl: ttlToUse
4047
+ });
4048
+ if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
4049
+ luvio.storePublish(key, incomingRecord);
4050
+ }
4051
+ if (ttlToUse !== undefined) {
4052
+ var storeMetadataParams = {
4053
+ ttl: ttlToUse,
4054
+ namespace: "LEAP",
4055
+ version: VERSION,
4056
+ representationName: RepresentationType,
4057
+ };
4058
+ luvio.publishStoreMetadata(key, storeMetadataParams);
4059
+ }
4060
+ return createLink(key);
4061
+ };
4062
+ function getTypeCacheKeys(luvio, input, fullPathFactory) {
4063
+ var rootKeySet = new engine.StoreKeyMap();
4064
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
4065
+ var rootKey = keyBuilderFromType(luvio, input);
4066
+ rootKeySet.set(rootKey, {
4067
+ namespace: keyPrefix,
4068
+ representationName: RepresentationType,
4069
+ mergeable: false
4070
+ });
4071
+ return rootKeySet;
4072
+ }
4073
+
4074
+ function select(luvio, params) {
4075
+ return select$1();
4076
+ }
4077
+ function keyBuilder$1(luvio, params) {
4078
+ return keyBuilder$2(luvio, {
4079
+ assistant_target: params.urlParams.assistantTarget
4080
+ });
4081
+ }
4082
+ function getResponseCacheKeys(luvio, resourceParams, response) {
4083
+ return getTypeCacheKeys(luvio, response);
4084
+ }
4085
+ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
4086
+ var body = response.body;
4087
+ var key = keyBuilder$1(luvio, resourceParams);
4088
+ luvio.storeIngest(key, ingest, body);
4089
+ var snapshot = luvio.storeLookup({
4090
+ recordId: key,
4091
+ node: select(),
4092
+ variables: {},
4093
+ }, snapshotRefresh);
4094
+ if (process.env.NODE_ENV !== 'production') {
4095
+ if (snapshot.state !== 'Fulfilled') {
4096
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
4097
+ }
4098
+ }
4099
+ return snapshot;
4100
+ }
4101
+ function ingestError(luvio, params, error, snapshotRefresh) {
4102
+ var key = keyBuilder$1(luvio, params);
4103
+ var errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
4104
+ luvio.storeIngestError(key, errorSnapshot);
4105
+ return errorSnapshot;
4106
+ }
4107
+ function createResourceRequest(config) {
4108
+ var headers = {};
4109
+ return {
4110
+ baseUri: '/services/data/v58.0',
4111
+ basePath: '/assistant-platform/' + config.urlParams.assistantTarget + '/list/info',
4112
+ method: 'get',
4113
+ body: null,
4114
+ urlParams: config.urlParams,
4115
+ queryParams: {},
4116
+ headers: headers,
4117
+ priority: 'normal',
4118
+ };
4119
+ }
4120
+
4121
+ var getAssistantInfoList_ConfigPropertyNames = {
4122
+ displayName: 'getAssistantInfoList',
4123
+ parameters: {
4124
+ required: ['assistantTarget'],
4125
+ optional: []
4126
+ }
4127
+ };
4128
+ function createResourceParams(config) {
4129
+ var resourceParams = {
4130
+ urlParams: {
4131
+ assistantTarget: config.assistantTarget
4132
+ }
4133
+ };
4134
+ return resourceParams;
4135
+ }
4136
+ function keyBuilder(luvio, config) {
4137
+ var resourceParams = createResourceParams(config);
4138
+ return keyBuilder$1(luvio, resourceParams);
4139
+ }
4140
+ function typeCheckConfig(untrustedConfig) {
4141
+ var config = {};
4142
+ var untrustedConfig_assistantTarget = untrustedConfig.assistantTarget;
4143
+ if (typeof untrustedConfig_assistantTarget === 'string') {
4144
+ config.assistantTarget = untrustedConfig_assistantTarget;
4145
+ }
4146
+ return config;
4147
+ }
4148
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
4149
+ if (!untrustedIsObject(untrustedConfig)) {
4150
+ return null;
4151
+ }
4152
+ if (process.env.NODE_ENV !== 'production') {
4153
+ validateConfig(untrustedConfig, configPropertyNames);
4154
+ }
4155
+ var config = typeCheckConfig(untrustedConfig);
4156
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
4157
+ return null;
4158
+ }
4159
+ return config;
4160
+ }
4161
+ function adapterFragment(luvio, config) {
4162
+ createResourceParams(config);
4163
+ return select();
4164
+ }
4165
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
4166
+ var snapshot = ingestSuccess(luvio, resourceParams, response, {
4167
+ config: config,
4168
+ resolve: function () { return buildNetworkSnapshot(luvio, config, snapshotRefreshOptions); }
4169
+ });
4170
+ return luvio.storeBroadcast().then(function () { return snapshot; });
4171
+ }
4172
+ function onFetchResponseError(luvio, config, resourceParams, response) {
4173
+ var snapshot = ingestError(luvio, resourceParams, response, {
4174
+ config: config,
4175
+ resolve: function () { return buildNetworkSnapshot(luvio, config, snapshotRefreshOptions); }
4176
+ });
4177
+ return luvio.storeBroadcast().then(function () { return snapshot; });
4178
+ }
4179
+ function buildNetworkSnapshot(luvio, config, options) {
4180
+ var resourceParams = createResourceParams(config);
4181
+ var request = createResourceRequest(resourceParams);
4182
+ return luvio.dispatchResourceRequest(request, options)
4183
+ .then(function (response) {
4184
+ return luvio.handleSuccessResponse(function () { return onFetchResponseSuccess(luvio, config, resourceParams, response); }, function () { return getResponseCacheKeys(luvio, resourceParams, response.body); });
4185
+ }, function (response) {
4186
+ return luvio.handleErrorResponse(function () { return onFetchResponseError(luvio, config, resourceParams, response); });
4187
+ });
4188
+ }
4189
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
4190
+ var luvio = context.luvio, config = context.config;
4191
+ var networkPriority = coercedAdapterRequestContext.networkPriority, requestCorrelator = coercedAdapterRequestContext.requestCorrelator, eventObservers = coercedAdapterRequestContext.eventObservers;
4192
+ var dispatchOptions = {
4193
+ resourceRequestContext: {
4194
+ requestCorrelator: requestCorrelator,
4195
+ luvioRequestMethod: undefined,
4196
+ },
4197
+ eventObservers: eventObservers
4198
+ };
4199
+ if (networkPriority !== 'normal') {
4200
+ dispatchOptions.overrides = {
4201
+ priority: networkPriority
4202
+ };
4203
+ }
4204
+ return buildNetworkSnapshot(luvio, config, dispatchOptions);
4205
+ }
4206
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
4207
+ var luvio = context.luvio, config = context.config;
4208
+ var selector = {
4209
+ recordId: keyBuilder(luvio, config),
4210
+ node: adapterFragment(luvio, config),
4211
+ variables: {},
4212
+ };
4213
+ var cacheSnapshot = storeLookup(selector, {
4214
+ config: config,
4215
+ resolve: function () { return buildNetworkSnapshot(luvio, config, snapshotRefreshOptions); }
4216
+ });
4217
+ return cacheSnapshot;
4218
+ }
4219
+ var getAssistantInfoListAdapterFactory = function (luvio) { return function LEAP__getAssistantInfoList(untrustedConfig, requestContext) {
4220
+ var config = validateAdapterConfig(untrustedConfig, getAssistantInfoList_ConfigPropertyNames);
4221
+ // Invalid or incomplete config
4222
+ if (config === null) {
4223
+ return null;
4224
+ }
4225
+ return luvio.applyCachePolicy((requestContext || {}), { config: config, luvio: luvio }, // BuildSnapshotContext
4226
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
4227
+ }; };
4228
+
4229
+ exports.evaluateStepAdapterFactory = evaluateStepAdapterFactory;
4230
+ exports.getAssistantAdapterFactory = getAssistantAdapterFactory;
4231
+ exports.getAssistantInfoListAdapterFactory = getAssistantInfoListAdapterFactory;
4232
+ exports.getAssistantListAdapterFactory = getAssistantListAdapterFactory;
4233
+ exports.getAssistantTargetAdapterFactory = getAssistantTargetAdapterFactory;
4234
+ exports.getQuestionnaireAdapterFactory = getQuestionnaireAdapterFactory;
4235
+ exports.getQuestionnairesAdapterFactory = getQuestionnairesAdapterFactory;
4236
+ exports.initializeAdapterFactory = initializeAdapterFactory;
4237
+ exports.saveAssistantAdapterFactory = saveAssistantAdapterFactory;
4238
+ exports.saveAssistantListAdapterFactory = saveAssistantListAdapterFactory;
4239
+ exports.saveQuestionnaireAdapterFactory = saveQuestionnaireAdapterFactory;
4240
+
4241
+ Object.defineProperty(exports, '__esModule', { value: true });
4242
+
4243
+ }));