@interopio/fdc3 2.5.1 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/fdc3.umd.js CHANGED
@@ -35,10 +35,10 @@
35
35
  return a;
36
36
  }
37
37
 
38
- var toStr$9 = Object.prototype.toString;
38
+ var toStr$8 = Object.prototype.toString;
39
39
 
40
40
  var isArguments$3 = function isArguments(value) {
41
- var str = toStr$9.call(value);
41
+ var str = toStr$8.call(value);
42
42
  var isArgs = str === '[object Arguments]';
43
43
  if (!isArgs) {
44
44
  isArgs = str !== '[object Array]' &&
@@ -46,17 +46,17 @@
46
46
  typeof value === 'object' &&
47
47
  typeof value.length === 'number' &&
48
48
  value.length >= 0 &&
49
- toStr$9.call(value.callee) === '[object Function]';
49
+ toStr$8.call(value.callee) === '[object Function]';
50
50
  }
51
51
  return isArgs;
52
52
  };
53
53
 
54
- var implementation$b;
55
- var hasRequiredImplementation;
54
+ var implementation$a;
55
+ var hasRequiredImplementation$1;
56
56
 
57
- function requireImplementation () {
58
- if (hasRequiredImplementation) return implementation$b;
59
- hasRequiredImplementation = 1;
57
+ function requireImplementation$1 () {
58
+ if (hasRequiredImplementation$1) return implementation$a;
59
+ hasRequiredImplementation$1 = 1;
60
60
 
61
61
  var keysShim;
62
62
  if (!Object.keys) {
@@ -177,15 +177,15 @@
177
177
  return theKeys;
178
178
  };
179
179
  }
180
- implementation$b = keysShim;
181
- return implementation$b;
180
+ implementation$a = keysShim;
181
+ return implementation$a;
182
182
  }
183
183
 
184
184
  var slice = Array.prototype.slice;
185
185
  var isArgs = isArguments$3;
186
186
 
187
187
  var origKeys = Object.keys;
188
- var keysShim = origKeys ? function keys(o) { return origKeys(o); } : requireImplementation();
188
+ var keysShim = origKeys ? function keys(o) { return origKeys(o); } : requireImplementation$1();
189
189
 
190
190
  var originalKeys = Object.keys;
191
191
 
@@ -212,6 +212,274 @@
212
212
 
213
213
  var objectKeys$2 = keysShim;
214
214
 
215
+ /** @type {import('.')} */
216
+ var $defineProperty$3 = Object.defineProperty || false;
217
+ if ($defineProperty$3) {
218
+ try {
219
+ $defineProperty$3({}, 'a', { value: 1 });
220
+ } catch (e) {
221
+ // IE 8 has a broken defineProperty
222
+ $defineProperty$3 = false;
223
+ }
224
+ }
225
+
226
+ var esDefineProperty = $defineProperty$3;
227
+
228
+ /** @type {import('./syntax')} */
229
+ var syntax = SyntaxError;
230
+
231
+ /** @type {import('./type')} */
232
+ var type = TypeError;
233
+
234
+ /** @type {import('./gOPD')} */
235
+ var gOPD$5 = Object.getOwnPropertyDescriptor;
236
+
237
+ /** @type {import('.')} */
238
+ var $gOPD$2 = gOPD$5;
239
+
240
+ if ($gOPD$2) {
241
+ try {
242
+ $gOPD$2([], 'length');
243
+ } catch (e) {
244
+ // IE 8 has a broken gOPD
245
+ $gOPD$2 = null;
246
+ }
247
+ }
248
+
249
+ var gopd$1 = $gOPD$2;
250
+
251
+ var $defineProperty$2 = esDefineProperty;
252
+
253
+ var $SyntaxError$2 = syntax;
254
+ var $TypeError$a = type;
255
+
256
+ var gopd = gopd$1;
257
+
258
+ /** @type {import('.')} */
259
+ var defineDataProperty$1 = function defineDataProperty(
260
+ obj,
261
+ property,
262
+ value
263
+ ) {
264
+ if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {
265
+ throw new $TypeError$a('`obj` must be an object or a function`');
266
+ }
267
+ if (typeof property !== 'string' && typeof property !== 'symbol') {
268
+ throw new $TypeError$a('`property` must be a string or a symbol`');
269
+ }
270
+ if (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) {
271
+ throw new $TypeError$a('`nonEnumerable`, if provided, must be a boolean or null');
272
+ }
273
+ if (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) {
274
+ throw new $TypeError$a('`nonWritable`, if provided, must be a boolean or null');
275
+ }
276
+ if (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) {
277
+ throw new $TypeError$a('`nonConfigurable`, if provided, must be a boolean or null');
278
+ }
279
+ if (arguments.length > 6 && typeof arguments[6] !== 'boolean') {
280
+ throw new $TypeError$a('`loose`, if provided, must be a boolean');
281
+ }
282
+
283
+ var nonEnumerable = arguments.length > 3 ? arguments[3] : null;
284
+ var nonWritable = arguments.length > 4 ? arguments[4] : null;
285
+ var nonConfigurable = arguments.length > 5 ? arguments[5] : null;
286
+ var loose = arguments.length > 6 ? arguments[6] : false;
287
+
288
+ /* @type {false | TypedPropertyDescriptor<unknown>} */
289
+ var desc = !!gopd && gopd(obj, property);
290
+
291
+ if ($defineProperty$2) {
292
+ $defineProperty$2(obj, property, {
293
+ configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,
294
+ enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,
295
+ value: value,
296
+ writable: nonWritable === null && desc ? desc.writable : !nonWritable
297
+ });
298
+ } else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) {
299
+ // must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable
300
+ obj[property] = value; // eslint-disable-line no-param-reassign
301
+ } else {
302
+ throw new $SyntaxError$2('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.');
303
+ }
304
+ };
305
+
306
+ var $defineProperty$1 = esDefineProperty;
307
+
308
+ var hasPropertyDescriptors = function hasPropertyDescriptors() {
309
+ return !!$defineProperty$1;
310
+ };
311
+
312
+ hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {
313
+ // node v0.6 has a bug where array lengths can be Set but not Defined
314
+ if (!$defineProperty$1) {
315
+ return null;
316
+ }
317
+ try {
318
+ return $defineProperty$1([], 'length', { value: 1 }).length !== 1;
319
+ } catch (e) {
320
+ // In Firefox 4-22, defining length on an array throws an exception.
321
+ return true;
322
+ }
323
+ };
324
+
325
+ var hasPropertyDescriptors_1 = hasPropertyDescriptors;
326
+
327
+ var keys = objectKeys$2;
328
+ var hasSymbols$5 = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
329
+
330
+ var toStr$7 = Object.prototype.toString;
331
+ var concat = Array.prototype.concat;
332
+ var defineDataProperty = defineDataProperty$1;
333
+
334
+ var isFunction = function (fn) {
335
+ return typeof fn === 'function' && toStr$7.call(fn) === '[object Function]';
336
+ };
337
+
338
+ var supportsDescriptors$2 = hasPropertyDescriptors_1();
339
+
340
+ var defineProperty$1 = function (object, name, value, predicate) {
341
+ if (name in object) {
342
+ if (predicate === true) {
343
+ if (object[name] === value) {
344
+ return;
345
+ }
346
+ } else if (!isFunction(predicate) || !predicate()) {
347
+ return;
348
+ }
349
+ }
350
+
351
+ if (supportsDescriptors$2) {
352
+ defineDataProperty(object, name, value, true);
353
+ } else {
354
+ defineDataProperty(object, name, value);
355
+ }
356
+ };
357
+
358
+ var defineProperties$1 = function (object, map) {
359
+ var predicates = arguments.length > 2 ? arguments[2] : {};
360
+ var props = keys(map);
361
+ if (hasSymbols$5) {
362
+ props = concat.call(props, Object.getOwnPropertySymbols(map));
363
+ }
364
+ for (var i = 0; i < props.length; i += 1) {
365
+ defineProperty$1(object, props[i], map[props[i]], predicates[props[i]]);
366
+ }
367
+ };
368
+
369
+ defineProperties$1.supportsDescriptors = !!supportsDescriptors$2;
370
+
371
+ var defineProperties_1 = defineProperties$1;
372
+
373
+ var callBind$6 = {exports: {}};
374
+
375
+ var implementation$9;
376
+ var hasRequiredImplementation;
377
+
378
+ function requireImplementation () {
379
+ if (hasRequiredImplementation) return implementation$9;
380
+ hasRequiredImplementation = 1;
381
+
382
+ /* eslint no-invalid-this: 1 */
383
+
384
+ var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
385
+ var toStr = Object.prototype.toString;
386
+ var max = Math.max;
387
+ var funcType = '[object Function]';
388
+
389
+ var concatty = function concatty(a, b) {
390
+ var arr = [];
391
+
392
+ for (var i = 0; i < a.length; i += 1) {
393
+ arr[i] = a[i];
394
+ }
395
+ for (var j = 0; j < b.length; j += 1) {
396
+ arr[j + a.length] = b[j];
397
+ }
398
+
399
+ return arr;
400
+ };
401
+
402
+ var slicy = function slicy(arrLike, offset) {
403
+ var arr = [];
404
+ for (var i = offset, j = 0; i < arrLike.length; i += 1, j += 1) {
405
+ arr[j] = arrLike[i];
406
+ }
407
+ return arr;
408
+ };
409
+
410
+ var joiny = function (arr, joiner) {
411
+ var str = '';
412
+ for (var i = 0; i < arr.length; i += 1) {
413
+ str += arr[i];
414
+ if (i + 1 < arr.length) {
415
+ str += joiner;
416
+ }
417
+ }
418
+ return str;
419
+ };
420
+
421
+ implementation$9 = function bind(that) {
422
+ var target = this;
423
+ if (typeof target !== 'function' || toStr.apply(target) !== funcType) {
424
+ throw new TypeError(ERROR_MESSAGE + target);
425
+ }
426
+ var args = slicy(arguments, 1);
427
+
428
+ var bound;
429
+ var binder = function () {
430
+ if (this instanceof bound) {
431
+ var result = target.apply(
432
+ this,
433
+ concatty(args, arguments)
434
+ );
435
+ if (Object(result) === result) {
436
+ return result;
437
+ }
438
+ return this;
439
+ }
440
+ return target.apply(
441
+ that,
442
+ concatty(args, arguments)
443
+ );
444
+
445
+ };
446
+
447
+ var boundLength = max(0, target.length - args.length);
448
+ var boundArgs = [];
449
+ for (var i = 0; i < boundLength; i++) {
450
+ boundArgs[i] = '$' + i;
451
+ }
452
+
453
+ bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);
454
+
455
+ if (target.prototype) {
456
+ var Empty = function Empty() {};
457
+ Empty.prototype = target.prototype;
458
+ bound.prototype = new Empty();
459
+ Empty.prototype = null;
460
+ }
461
+
462
+ return bound;
463
+ };
464
+ return implementation$9;
465
+ }
466
+
467
+ var functionBind;
468
+ var hasRequiredFunctionBind;
469
+
470
+ function requireFunctionBind () {
471
+ if (hasRequiredFunctionBind) return functionBind;
472
+ hasRequiredFunctionBind = 1;
473
+
474
+ var implementation = requireImplementation();
475
+
476
+ functionBind = Function.prototype.bind || implementation;
477
+ return functionBind;
478
+ }
479
+
480
+ /** @type {import('.')} */
481
+ var esObjectAtoms = Object;
482
+
215
483
  /** @type {import('.')} */
216
484
  var esErrors = Error;
217
485
 
@@ -224,15 +492,42 @@
224
492
  /** @type {import('./ref')} */
225
493
  var ref = ReferenceError;
226
494
 
227
- /** @type {import('./syntax')} */
228
- var syntax = SyntaxError;
229
-
230
- /** @type {import('./type')} */
231
- var type = TypeError;
232
-
233
495
  /** @type {import('./uri')} */
234
496
  var uri = URIError;
235
497
 
498
+ /** @type {import('./abs')} */
499
+ var abs$1 = Math.abs;
500
+
501
+ /** @type {import('./floor')} */
502
+ var floor$1 = Math.floor;
503
+
504
+ /** @type {import('./max')} */
505
+ var max$1 = Math.max;
506
+
507
+ /** @type {import('./min')} */
508
+ var min$1 = Math.min;
509
+
510
+ /** @type {import('./pow')} */
511
+ var pow$1 = Math.pow;
512
+
513
+ /** @type {import('./round')} */
514
+ var round$1 = Math.round;
515
+
516
+ /** @type {import('./isNaN')} */
517
+ var _isNaN = Number.isNaN || function isNaN(a) {
518
+ return a !== a;
519
+ };
520
+
521
+ var $isNaN = _isNaN;
522
+
523
+ /** @type {import('./sign')} */
524
+ var sign$1 = function sign(number) {
525
+ if ($isNaN(number) || number === 0) {
526
+ return number;
527
+ }
528
+ return number < 0 ? -1 : 1;
529
+ };
530
+
236
531
  var shams$1;
237
532
  var hasRequiredShams;
238
533
 
@@ -240,11 +535,13 @@
240
535
  if (hasRequiredShams) return shams$1;
241
536
  hasRequiredShams = 1;
242
537
 
538
+ /** @type {import('./shams')} */
243
539
  /* eslint complexity: [2, 18], max-statements: [2, 33] */
244
540
  shams$1 = function hasSymbols() {
245
541
  if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
246
542
  if (typeof Symbol.iterator === 'symbol') { return true; }
247
543
 
544
+ /** @type {{ [k in symbol]?: unknown }} */
248
545
  var obj = {};
249
546
  var sym = Symbol('test');
250
547
  var symObj = Object(sym);
@@ -263,7 +560,7 @@
263
560
 
264
561
  var symVal = 42;
265
562
  obj[sym] = symVal;
266
- for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
563
+ for (var _ in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
267
564
  if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
268
565
 
269
566
  if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
@@ -274,7 +571,8 @@
274
571
  if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
275
572
 
276
573
  if (typeof Object.getOwnPropertyDescriptor === 'function') {
277
- var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
574
+ // eslint-disable-next-line no-extra-parens
575
+ var descriptor = /** @type {PropertyDescriptor} */ (Object.getOwnPropertyDescriptor(obj, sym));
278
576
  if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
279
577
  }
280
578
 
@@ -286,7 +584,8 @@
286
584
  var origSymbol = typeof Symbol !== 'undefined' && Symbol;
287
585
  var hasSymbolSham = requireShams();
288
586
 
289
- var hasSymbols$5 = function hasNativeSymbols() {
587
+ /** @type {import('.')} */
588
+ var hasSymbols$4 = function hasNativeSymbols() {
290
589
  if (typeof origSymbol !== 'function') { return false; }
291
590
  if (typeof Symbol !== 'function') { return false; }
292
591
  if (typeof origSymbol('foo') !== 'symbol') { return false; }
@@ -295,124 +594,191 @@
295
594
  return hasSymbolSham();
296
595
  };
297
596
 
298
- var test = {
299
- __proto__: null,
300
- foo: {}
301
- };
597
+ var Reflect_getPrototypeOf;
598
+ var hasRequiredReflect_getPrototypeOf;
302
599
 
303
- var $Object$1 = Object;
600
+ function requireReflect_getPrototypeOf () {
601
+ if (hasRequiredReflect_getPrototypeOf) return Reflect_getPrototypeOf;
602
+ hasRequiredReflect_getPrototypeOf = 1;
304
603
 
305
- /** @type {import('.')} */
306
- var hasProto$1 = function hasProto() {
307
- // @ts-expect-error: TS errors on an inherited property for some reason
308
- return { __proto__: test }.foo === test.foo
309
- && !(test instanceof $Object$1);
310
- };
604
+ /** @type {import('./Reflect.getPrototypeOf')} */
605
+ Reflect_getPrototypeOf = (typeof Reflect !== 'undefined' && Reflect.getPrototypeOf) || null;
606
+ return Reflect_getPrototypeOf;
607
+ }
311
608
 
312
- /* eslint no-invalid-this: 1 */
609
+ var Object_getPrototypeOf;
610
+ var hasRequiredObject_getPrototypeOf;
313
611
 
314
- var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
315
- var toStr$8 = Object.prototype.toString;
316
- var max = Math.max;
317
- var funcType = '[object Function]';
612
+ function requireObject_getPrototypeOf () {
613
+ if (hasRequiredObject_getPrototypeOf) return Object_getPrototypeOf;
614
+ hasRequiredObject_getPrototypeOf = 1;
318
615
 
319
- var concatty = function concatty(a, b) {
320
- var arr = [];
616
+ var $Object = esObjectAtoms;
321
617
 
322
- for (var i = 0; i < a.length; i += 1) {
323
- arr[i] = a[i];
324
- }
325
- for (var j = 0; j < b.length; j += 1) {
326
- arr[j + a.length] = b[j];
327
- }
618
+ /** @type {import('./Object.getPrototypeOf')} */
619
+ Object_getPrototypeOf = $Object.getPrototypeOf || null;
620
+ return Object_getPrototypeOf;
621
+ }
328
622
 
329
- return arr;
330
- };
623
+ var functionCall;
624
+ var hasRequiredFunctionCall;
331
625
 
332
- var slicy = function slicy(arrLike, offset) {
333
- var arr = [];
334
- for (var i = offset, j = 0; i < arrLike.length; i += 1, j += 1) {
335
- arr[j] = arrLike[i];
336
- }
337
- return arr;
338
- };
626
+ function requireFunctionCall () {
627
+ if (hasRequiredFunctionCall) return functionCall;
628
+ hasRequiredFunctionCall = 1;
339
629
 
340
- var joiny = function (arr, joiner) {
341
- var str = '';
342
- for (var i = 0; i < arr.length; i += 1) {
343
- str += arr[i];
344
- if (i + 1 < arr.length) {
345
- str += joiner;
346
- }
347
- }
348
- return str;
349
- };
630
+ /** @type {import('./functionCall')} */
631
+ functionCall = Function.prototype.call;
632
+ return functionCall;
633
+ }
350
634
 
351
- var implementation$a = function bind(that) {
352
- var target = this;
353
- if (typeof target !== 'function' || toStr$8.apply(target) !== funcType) {
354
- throw new TypeError(ERROR_MESSAGE + target);
355
- }
356
- var args = slicy(arguments, 1);
357
-
358
- var bound;
359
- var binder = function () {
360
- if (this instanceof bound) {
361
- var result = target.apply(
362
- this,
363
- concatty(args, arguments)
364
- );
365
- if (Object(result) === result) {
366
- return result;
367
- }
368
- return this;
369
- }
370
- return target.apply(
371
- that,
372
- concatty(args, arguments)
373
- );
635
+ var functionApply;
636
+ var hasRequiredFunctionApply;
374
637
 
375
- };
638
+ function requireFunctionApply () {
639
+ if (hasRequiredFunctionApply) return functionApply;
640
+ hasRequiredFunctionApply = 1;
376
641
 
377
- var boundLength = max(0, target.length - args.length);
378
- var boundArgs = [];
379
- for (var i = 0; i < boundLength; i++) {
380
- boundArgs[i] = '$' + i;
381
- }
642
+ /** @type {import('./functionApply')} */
643
+ functionApply = Function.prototype.apply;
644
+ return functionApply;
645
+ }
382
646
 
383
- bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);
647
+ /** @type {import('./reflectApply')} */
648
+ var reflectApply$1 = typeof Reflect !== 'undefined' && Reflect && Reflect.apply;
384
649
 
385
- if (target.prototype) {
386
- var Empty = function Empty() {};
387
- Empty.prototype = target.prototype;
388
- bound.prototype = new Empty();
389
- Empty.prototype = null;
390
- }
650
+ var bind$2 = requireFunctionBind();
391
651
 
392
- return bound;
393
- };
652
+ var $apply$1 = requireFunctionApply();
653
+ var $call$2 = requireFunctionCall();
654
+ var $reflectApply = reflectApply$1;
394
655
 
395
- var implementation$9 = implementation$a;
656
+ /** @type {import('./actualApply')} */
657
+ var actualApply = $reflectApply || bind$2.call($call$2, $apply$1);
396
658
 
397
- var functionBind = Function.prototype.bind || implementation$9;
659
+ var bind$1 = requireFunctionBind();
660
+ var $TypeError$9 = type;
398
661
 
399
- var call = Function.prototype.call;
400
- var $hasOwn = Object.prototype.hasOwnProperty;
401
- var bind$1 = functionBind;
662
+ var $call$1 = requireFunctionCall();
663
+ var $actualApply = actualApply;
402
664
 
403
665
  /** @type {import('.')} */
404
- var hasown = bind$1.call(call, $hasOwn);
666
+ var callBindApplyHelpers = function callBindBasic(args) {
667
+ if (args.length < 1 || typeof args[0] !== 'function') {
668
+ throw new $TypeError$9('a function is required');
669
+ }
670
+ return $actualApply(bind$1, $call$1, args);
671
+ };
672
+
673
+ var get;
674
+ var hasRequiredGet;
675
+
676
+ function requireGet () {
677
+ if (hasRequiredGet) return get;
678
+ hasRequiredGet = 1;
679
+
680
+ var callBind = callBindApplyHelpers;
681
+ var gOPD = gopd$1;
682
+
683
+ var hasProtoAccessor;
684
+ try {
685
+ // eslint-disable-next-line no-extra-parens, no-proto
686
+ hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ ([]).__proto__ === Array.prototype;
687
+ } catch (e) {
688
+ if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') {
689
+ throw e;
690
+ }
691
+ }
692
+
693
+ // eslint-disable-next-line no-extra-parens
694
+ var desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__'));
695
+
696
+ var $Object = Object;
697
+ var $getPrototypeOf = $Object.getPrototypeOf;
698
+
699
+ /** @type {import('./get')} */
700
+ get = desc && typeof desc.get === 'function'
701
+ ? callBind([desc.get])
702
+ : typeof $getPrototypeOf === 'function'
703
+ ? /** @type {import('./get')} */ function getDunder(value) {
704
+ // eslint-disable-next-line eqeqeq
705
+ return $getPrototypeOf(value == null ? value : $Object(value));
706
+ }
707
+ : false;
708
+ return get;
709
+ }
710
+
711
+ var getProto$2;
712
+ var hasRequiredGetProto;
713
+
714
+ function requireGetProto () {
715
+ if (hasRequiredGetProto) return getProto$2;
716
+ hasRequiredGetProto = 1;
717
+
718
+ var reflectGetProto = requireReflect_getPrototypeOf();
719
+ var originalGetProto = requireObject_getPrototypeOf();
720
+
721
+ var getDunderProto = requireGet();
722
+
723
+ /** @type {import('.')} */
724
+ getProto$2 = reflectGetProto
725
+ ? function getProto(O) {
726
+ // @ts-expect-error TS can't narrow inside a closure, for some reason
727
+ return reflectGetProto(O);
728
+ }
729
+ : originalGetProto
730
+ ? function getProto(O) {
731
+ if (!O || (typeof O !== 'object' && typeof O !== 'function')) {
732
+ throw new TypeError('getProto: not an object');
733
+ }
734
+ // @ts-expect-error TS can't narrow inside a closure, for some reason
735
+ return originalGetProto(O);
736
+ }
737
+ : getDunderProto
738
+ ? function getProto(O) {
739
+ // @ts-expect-error TS can't narrow inside a closure, for some reason
740
+ return getDunderProto(O);
741
+ }
742
+ : null;
743
+ return getProto$2;
744
+ }
745
+
746
+ var hasown;
747
+ var hasRequiredHasown;
748
+
749
+ function requireHasown () {
750
+ if (hasRequiredHasown) return hasown;
751
+ hasRequiredHasown = 1;
752
+
753
+ var call = Function.prototype.call;
754
+ var $hasOwn = Object.prototype.hasOwnProperty;
755
+ var bind = requireFunctionBind();
756
+
757
+ /** @type {import('.')} */
758
+ hasown = bind.call(call, $hasOwn);
759
+ return hasown;
760
+ }
405
761
 
406
762
  var undefined$1;
407
763
 
764
+ var $Object$1 = esObjectAtoms;
765
+
408
766
  var $Error = esErrors;
409
767
  var $EvalError = _eval;
410
768
  var $RangeError = range;
411
769
  var $ReferenceError = ref;
412
- var $SyntaxError$2 = syntax;
413
- var $TypeError$6 = type;
770
+ var $SyntaxError$1 = syntax;
771
+ var $TypeError$8 = type;
414
772
  var $URIError = uri;
415
773
 
774
+ var abs = abs$1;
775
+ var floor = floor$1;
776
+ var max = max$1;
777
+ var min = min$1;
778
+ var pow = pow$1;
779
+ var round = round$1;
780
+ var sign = sign$1;
781
+
416
782
  var $Function = Function;
417
783
 
418
784
  // eslint-disable-next-line consistent-return
@@ -422,19 +788,13 @@
422
788
  } catch (e) {}
423
789
  };
424
790
 
425
- var $gOPD$2 = Object.getOwnPropertyDescriptor;
426
- if ($gOPD$2) {
427
- try {
428
- $gOPD$2({}, '');
429
- } catch (e) {
430
- $gOPD$2 = null; // this is IE 8, which has a broken gOPD
431
- }
432
- }
791
+ var $gOPD$1 = gopd$1;
792
+ var $defineProperty = esDefineProperty;
433
793
 
434
794
  var throwTypeError = function () {
435
- throw new $TypeError$6();
795
+ throw new $TypeError$8();
436
796
  };
437
- var ThrowTypeError = $gOPD$2
797
+ var ThrowTypeError = $gOPD$1
438
798
  ? (function () {
439
799
  try {
440
800
  // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
@@ -443,7 +803,7 @@
443
803
  } catch (calleeThrows) {
444
804
  try {
445
805
  // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
446
- return $gOPD$2(arguments, 'callee').get;
806
+ return $gOPD$1(arguments, 'callee').get;
447
807
  } catch (gOPDthrows) {
448
808
  return throwTypeError;
449
809
  }
@@ -451,14 +811,14 @@
451
811
  }())
452
812
  : throwTypeError;
453
813
 
454
- var hasSymbols$4 = hasSymbols$5();
455
- var hasProto = hasProto$1();
814
+ var hasSymbols$3 = hasSymbols$4();
456
815
 
457
- var getProto$1 = Object.getPrototypeOf || (
458
- hasProto
459
- ? function (x) { return x.__proto__; } // eslint-disable-line no-proto
460
- : null
461
- );
816
+ var getProto$1 = requireGetProto();
817
+ var $ObjectGPO = requireObject_getPrototypeOf();
818
+ var $ReflectGPO = requireReflect_getPrototypeOf();
819
+
820
+ var $apply = requireFunctionApply();
821
+ var $call = requireFunctionCall();
462
822
 
463
823
  var needsEval = {};
464
824
 
@@ -469,7 +829,7 @@
469
829
  '%AggregateError%': typeof AggregateError === 'undefined' ? undefined$1 : AggregateError,
470
830
  '%Array%': Array,
471
831
  '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
472
- '%ArrayIteratorPrototype%': hasSymbols$4 && getProto$1 ? getProto$1([][Symbol.iterator]()) : undefined$1,
832
+ '%ArrayIteratorPrototype%': hasSymbols$3 && getProto$1 ? getProto$1([][Symbol.iterator]()) : undefined$1,
473
833
  '%AsyncFromSyncIteratorPrototype%': undefined$1,
474
834
  '%AsyncFunction%': needsEval,
475
835
  '%AsyncGenerator%': needsEval,
@@ -499,13 +859,14 @@
499
859
  '%Int32Array%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array,
500
860
  '%isFinite%': isFinite,
501
861
  '%isNaN%': isNaN,
502
- '%IteratorPrototype%': hasSymbols$4 && getProto$1 ? getProto$1(getProto$1([][Symbol.iterator]())) : undefined$1,
862
+ '%IteratorPrototype%': hasSymbols$3 && getProto$1 ? getProto$1(getProto$1([][Symbol.iterator]())) : undefined$1,
503
863
  '%JSON%': typeof JSON === 'object' ? JSON : undefined$1,
504
864
  '%Map%': typeof Map === 'undefined' ? undefined$1 : Map,
505
- '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols$4 || !getProto$1 ? undefined$1 : getProto$1(new Map()[Symbol.iterator]()),
865
+ '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols$3 || !getProto$1 ? undefined$1 : getProto$1(new Map()[Symbol.iterator]()),
506
866
  '%Math%': Math,
507
867
  '%Number%': Number,
508
- '%Object%': Object,
868
+ '%Object%': $Object$1,
869
+ '%Object.getOwnPropertyDescriptor%': $gOPD$1,
509
870
  '%parseFloat%': parseFloat,
510
871
  '%parseInt%': parseInt,
511
872
  '%Promise%': typeof Promise === 'undefined' ? undefined$1 : Promise,
@@ -515,15 +876,15 @@
515
876
  '%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
516
877
  '%RegExp%': RegExp,
517
878
  '%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
518
- '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols$4 || !getProto$1 ? undefined$1 : getProto$1(new Set()[Symbol.iterator]()),
879
+ '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols$3 || !getProto$1 ? undefined$1 : getProto$1(new Set()[Symbol.iterator]()),
519
880
  '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer,
520
881
  '%String%': String,
521
- '%StringIteratorPrototype%': hasSymbols$4 && getProto$1 ? getProto$1(''[Symbol.iterator]()) : undefined$1,
522
- '%Symbol%': hasSymbols$4 ? Symbol : undefined$1,
523
- '%SyntaxError%': $SyntaxError$2,
882
+ '%StringIteratorPrototype%': hasSymbols$3 && getProto$1 ? getProto$1(''[Symbol.iterator]()) : undefined$1,
883
+ '%Symbol%': hasSymbols$3 ? Symbol : undefined$1,
884
+ '%SyntaxError%': $SyntaxError$1,
524
885
  '%ThrowTypeError%': ThrowTypeError,
525
886
  '%TypedArray%': TypedArray,
526
- '%TypeError%': $TypeError$6,
887
+ '%TypeError%': $TypeError$8,
527
888
  '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined$1 : Uint8Array,
528
889
  '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined$1 : Uint8ClampedArray,
529
890
  '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined$1 : Uint16Array,
@@ -531,7 +892,20 @@
531
892
  '%URIError%': $URIError,
532
893
  '%WeakMap%': typeof WeakMap === 'undefined' ? undefined$1 : WeakMap,
533
894
  '%WeakRef%': typeof WeakRef === 'undefined' ? undefined$1 : WeakRef,
534
- '%WeakSet%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet
895
+ '%WeakSet%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet,
896
+
897
+ '%Function.prototype.call%': $call,
898
+ '%Function.prototype.apply%': $apply,
899
+ '%Object.defineProperty%': $defineProperty,
900
+ '%Object.getPrototypeOf%': $ObjectGPO,
901
+ '%Math.abs%': abs,
902
+ '%Math.floor%': floor,
903
+ '%Math.max%': max,
904
+ '%Math.min%': min,
905
+ '%Math.pow%': pow,
906
+ '%Math.round%': round,
907
+ '%Math.sign%': sign,
908
+ '%Reflect.getPrototypeOf%': $ReflectGPO
535
909
  };
536
910
 
537
911
  if (getProto$1) {
@@ -624,13 +998,13 @@
624
998
  '%WeakSetPrototype%': ['WeakSet', 'prototype']
625
999
  };
626
1000
 
627
- var bind = functionBind;
628
- var hasOwn$2 = hasown;
629
- var $concat$1 = bind.call(Function.call, Array.prototype.concat);
630
- var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
631
- var $replace$1 = bind.call(Function.call, String.prototype.replace);
632
- var $strSlice = bind.call(Function.call, String.prototype.slice);
633
- var $exec$1 = bind.call(Function.call, RegExp.prototype.exec);
1001
+ var bind = requireFunctionBind();
1002
+ var hasOwn$2 = requireHasown();
1003
+ var $concat$1 = bind.call($call, Array.prototype.concat);
1004
+ var $spliceApply = bind.call($apply, Array.prototype.splice);
1005
+ var $replace$1 = bind.call($call, String.prototype.replace);
1006
+ var $strSlice = bind.call($call, String.prototype.slice);
1007
+ var $exec$1 = bind.call($call, RegExp.prototype.exec);
634
1008
 
635
1009
  /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
636
1010
  var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
@@ -639,9 +1013,9 @@
639
1013
  var first = $strSlice(string, 0, 1);
640
1014
  var last = $strSlice(string, -1);
641
1015
  if (first === '%' && last !== '%') {
642
- throw new $SyntaxError$2('invalid intrinsic syntax, expected closing `%`');
1016
+ throw new $SyntaxError$1('invalid intrinsic syntax, expected closing `%`');
643
1017
  } else if (last === '%' && first !== '%') {
644
- throw new $SyntaxError$2('invalid intrinsic syntax, expected opening `%`');
1018
+ throw new $SyntaxError$1('invalid intrinsic syntax, expected opening `%`');
645
1019
  }
646
1020
  var result = [];
647
1021
  $replace$1(string, rePropName, function (match, number, quote, subString) {
@@ -665,7 +1039,7 @@
665
1039
  value = doEval(intrinsicName);
666
1040
  }
667
1041
  if (typeof value === 'undefined' && !allowMissing) {
668
- throw new $TypeError$6('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
1042
+ throw new $TypeError$8('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
669
1043
  }
670
1044
 
671
1045
  return {
@@ -675,19 +1049,19 @@
675
1049
  };
676
1050
  }
677
1051
 
678
- throw new $SyntaxError$2('intrinsic ' + name + ' does not exist!');
1052
+ throw new $SyntaxError$1('intrinsic ' + name + ' does not exist!');
679
1053
  };
680
1054
 
681
1055
  var getIntrinsic = function GetIntrinsic(name, allowMissing) {
682
1056
  if (typeof name !== 'string' || name.length === 0) {
683
- throw new $TypeError$6('intrinsic name must be a non-empty string');
1057
+ throw new $TypeError$8('intrinsic name must be a non-empty string');
684
1058
  }
685
1059
  if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
686
- throw new $TypeError$6('"allowMissing" argument must be a boolean');
1060
+ throw new $TypeError$8('"allowMissing" argument must be a boolean');
687
1061
  }
688
1062
 
689
1063
  if ($exec$1(/^%?[^%]*%?$/, name) === null) {
690
- throw new $SyntaxError$2('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
1064
+ throw new $SyntaxError$1('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
691
1065
  }
692
1066
  var parts = stringToPath(name);
693
1067
  var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
@@ -714,7 +1088,7 @@
714
1088
  )
715
1089
  && first !== last
716
1090
  ) {
717
- throw new $SyntaxError$2('property names with quotes must have matching quotes');
1091
+ throw new $SyntaxError$1('property names with quotes must have matching quotes');
718
1092
  }
719
1093
  if (part === 'constructor' || !isOwn) {
720
1094
  skipFurtherCaching = true;
@@ -728,12 +1102,12 @@
728
1102
  } else if (value != null) {
729
1103
  if (!(part in value)) {
730
1104
  if (!allowMissing) {
731
- throw new $TypeError$6('base intrinsic for ' + name + ' exists, but the property is not available.');
1105
+ throw new $TypeError$8('base intrinsic for ' + name + ' exists, but the property is not available.');
732
1106
  }
733
- return void undefined$1;
1107
+ return void 0;
734
1108
  }
735
- if ($gOPD$2 && (i + 1) >= parts.length) {
736
- var desc = $gOPD$2(value, part);
1109
+ if ($gOPD$1 && (i + 1) >= parts.length) {
1110
+ var desc = $gOPD$1(value, part);
737
1111
  isOwn = !!desc;
738
1112
 
739
1113
  // By convention, when a data property is converted to an accessor
@@ -761,184 +1135,21 @@
761
1135
  return value;
762
1136
  };
763
1137
 
764
- var esDefineProperty;
765
- var hasRequiredEsDefineProperty;
766
-
767
- function requireEsDefineProperty () {
768
- if (hasRequiredEsDefineProperty) return esDefineProperty;
769
- hasRequiredEsDefineProperty = 1;
770
-
771
- var GetIntrinsic = getIntrinsic;
772
-
773
- /** @type {import('.')} */
774
- var $defineProperty = GetIntrinsic('%Object.defineProperty%', true) || false;
775
- if ($defineProperty) {
776
- try {
777
- $defineProperty({}, 'a', { value: 1 });
778
- } catch (e) {
779
- // IE 8 has a broken defineProperty
780
- $defineProperty = false;
781
- }
782
- }
783
-
784
- esDefineProperty = $defineProperty;
785
- return esDefineProperty;
786
- }
787
-
788
- var GetIntrinsic$7 = getIntrinsic;
789
-
790
- var $gOPD$1 = GetIntrinsic$7('%Object.getOwnPropertyDescriptor%', true);
791
-
792
- if ($gOPD$1) {
793
- try {
794
- $gOPD$1([], 'length');
795
- } catch (e) {
796
- // IE 8 has a broken gOPD
797
- $gOPD$1 = null;
798
- }
799
- }
800
-
801
- var gopd$1 = $gOPD$1;
802
-
803
- var $defineProperty$1 = requireEsDefineProperty();
804
-
805
- var $SyntaxError$1 = syntax;
806
- var $TypeError$5 = type;
807
-
808
- var gopd = gopd$1;
809
-
810
- /** @type {import('.')} */
811
- var defineDataProperty$1 = function defineDataProperty(
812
- obj,
813
- property,
814
- value
815
- ) {
816
- if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {
817
- throw new $TypeError$5('`obj` must be an object or a function`');
818
- }
819
- if (typeof property !== 'string' && typeof property !== 'symbol') {
820
- throw new $TypeError$5('`property` must be a string or a symbol`');
821
- }
822
- if (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) {
823
- throw new $TypeError$5('`nonEnumerable`, if provided, must be a boolean or null');
824
- }
825
- if (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) {
826
- throw new $TypeError$5('`nonWritable`, if provided, must be a boolean or null');
827
- }
828
- if (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) {
829
- throw new $TypeError$5('`nonConfigurable`, if provided, must be a boolean or null');
830
- }
831
- if (arguments.length > 6 && typeof arguments[6] !== 'boolean') {
832
- throw new $TypeError$5('`loose`, if provided, must be a boolean');
833
- }
834
-
835
- var nonEnumerable = arguments.length > 3 ? arguments[3] : null;
836
- var nonWritable = arguments.length > 4 ? arguments[4] : null;
837
- var nonConfigurable = arguments.length > 5 ? arguments[5] : null;
838
- var loose = arguments.length > 6 ? arguments[6] : false;
839
-
840
- /* @type {false | TypedPropertyDescriptor<unknown>} */
841
- var desc = !!gopd && gopd(obj, property);
842
-
843
- if ($defineProperty$1) {
844
- $defineProperty$1(obj, property, {
845
- configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,
846
- enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,
847
- value: value,
848
- writable: nonWritable === null && desc ? desc.writable : !nonWritable
849
- });
850
- } else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) {
851
- // must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable
852
- obj[property] = value; // eslint-disable-line no-param-reassign
853
- } else {
854
- throw new $SyntaxError$1('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.');
855
- }
856
- };
857
-
858
- var $defineProperty = requireEsDefineProperty();
859
-
860
- var hasPropertyDescriptors = function hasPropertyDescriptors() {
861
- return !!$defineProperty;
862
- };
863
-
864
- hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {
865
- // node v0.6 has a bug where array lengths can be Set but not Defined
866
- if (!$defineProperty) {
867
- return null;
868
- }
869
- try {
870
- return $defineProperty([], 'length', { value: 1 }).length !== 1;
871
- } catch (e) {
872
- // In Firefox 4-22, defining length on an array throws an exception.
873
- return true;
874
- }
875
- };
876
-
877
- var hasPropertyDescriptors_1 = hasPropertyDescriptors;
878
-
879
- var keys = objectKeys$2;
880
- var hasSymbols$3 = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
881
-
882
- var toStr$7 = Object.prototype.toString;
883
- var concat = Array.prototype.concat;
884
- var defineDataProperty = defineDataProperty$1;
885
-
886
- var isFunction = function (fn) {
887
- return typeof fn === 'function' && toStr$7.call(fn) === '[object Function]';
888
- };
889
-
890
- var supportsDescriptors$2 = hasPropertyDescriptors_1();
891
-
892
- var defineProperty$1 = function (object, name, value, predicate) {
893
- if (name in object) {
894
- if (predicate === true) {
895
- if (object[name] === value) {
896
- return;
897
- }
898
- } else if (!isFunction(predicate) || !predicate()) {
899
- return;
900
- }
901
- }
902
-
903
- if (supportsDescriptors$2) {
904
- defineDataProperty(object, name, value, true);
905
- } else {
906
- defineDataProperty(object, name, value);
907
- }
908
- };
909
-
910
- var defineProperties$1 = function (object, map) {
911
- var predicates = arguments.length > 2 ? arguments[2] : {};
912
- var props = keys(map);
913
- if (hasSymbols$3) {
914
- props = concat.call(props, Object.getOwnPropertySymbols(map));
915
- }
916
- for (var i = 0; i < props.length; i += 1) {
917
- defineProperty$1(object, props[i], map[props[i]], predicates[props[i]]);
918
- }
919
- };
920
-
921
- defineProperties$1.supportsDescriptors = !!supportsDescriptors$2;
922
-
923
- var defineProperties_1 = defineProperties$1;
924
-
925
- var callBind$6 = {exports: {}};
926
-
927
- var GetIntrinsic$6 = getIntrinsic;
1138
+ var GetIntrinsic$8 = getIntrinsic;
928
1139
  var define$5 = defineDataProperty$1;
929
1140
  var hasDescriptors$1 = hasPropertyDescriptors_1();
930
1141
  var gOPD$4 = gopd$1;
931
1142
 
932
- var $TypeError$4 = type;
933
- var $floor$1 = GetIntrinsic$6('%Math.floor%');
1143
+ var $TypeError$7 = type;
1144
+ var $floor$1 = GetIntrinsic$8('%Math.floor%');
934
1145
 
935
1146
  /** @type {import('.')} */
936
1147
  var setFunctionLength = function setFunctionLength(fn, length) {
937
1148
  if (typeof fn !== 'function') {
938
- throw new $TypeError$4('`fn` is not a function');
1149
+ throw new $TypeError$7('`fn` is not a function');
939
1150
  }
940
1151
  if (typeof length !== 'number' || length < 0 || length > 0xFFFFFFFF || $floor$1(length) !== length) {
941
- throw new $TypeError$4('`length` must be a positive 32-bit integer');
1152
+ throw new $TypeError$7('`length` must be a positive 32-bit integer');
942
1153
  }
943
1154
 
944
1155
  var loose = arguments.length > 2 && !!arguments[2];
@@ -967,7 +1178,7 @@
967
1178
 
968
1179
  (function (module) {
969
1180
 
970
- var bind = functionBind;
1181
+ var bind = requireFunctionBind();
971
1182
  var GetIntrinsic = getIntrinsic;
972
1183
  var setFunctionLength$1 = setFunctionLength;
973
1184
 
@@ -976,7 +1187,7 @@
976
1187
  var $call = GetIntrinsic('%Function.prototype.call%');
977
1188
  var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
978
1189
 
979
- var $defineProperty = requireEsDefineProperty();
1190
+ var $defineProperty = esDefineProperty;
980
1191
  var $max = GetIntrinsic('%Math.max%');
981
1192
 
982
1193
  module.exports = function callBind(originalFunction) {
@@ -1004,15 +1215,15 @@
1004
1215
 
1005
1216
  var callBindExports = callBind$6.exports;
1006
1217
 
1007
- var GetIntrinsic$5 = getIntrinsic;
1218
+ var GetIntrinsic$7 = getIntrinsic;
1008
1219
 
1009
1220
  var callBind$5 = callBindExports;
1010
1221
 
1011
- var $indexOf$1 = callBind$5(GetIntrinsic$5('String.prototype.indexOf'));
1222
+ var $indexOf$2 = callBind$5(GetIntrinsic$7('String.prototype.indexOf'));
1012
1223
 
1013
- var callBound$c = function callBoundIntrinsic(name, allowMissing) {
1014
- var intrinsic = GetIntrinsic$5(name, !!allowMissing);
1015
- if (typeof intrinsic === 'function' && $indexOf$1(name, '.prototype.') > -1) {
1224
+ var callBound$e = function callBoundIntrinsic(name, allowMissing) {
1225
+ var intrinsic = GetIntrinsic$7(name, !!allowMissing);
1226
+ if (typeof intrinsic === 'function' && $indexOf$2(name, '.prototype.') > -1) {
1016
1227
  return callBind$5(intrinsic);
1017
1228
  }
1018
1229
  return intrinsic;
@@ -1021,10 +1232,10 @@
1021
1232
  // modified from https://github.com/es-shims/es6-shim
1022
1233
  var objectKeys$1 = objectKeys$2;
1023
1234
  var hasSymbols$2 = requireShams()();
1024
- var callBound$b = callBound$c;
1235
+ var callBound$d = callBound$e;
1025
1236
  var toObject = Object;
1026
- var $push = callBound$b('Array.prototype.push');
1027
- var $propIsEnumerable = callBound$b('Object.prototype.propertyIsEnumerable');
1237
+ var $push = callBound$d('Array.prototype.push');
1238
+ var $propIsEnumerable = callBound$d('Object.prototype.propertyIsEnumerable');
1028
1239
  var originalGetSymbols = hasSymbols$2 ? Object.getOwnPropertySymbols : null;
1029
1240
 
1030
1241
  // eslint-disable-next-line no-unused-vars
@@ -1185,12 +1396,12 @@
1185
1396
  var hasDescriptors = hasPropertyDescriptors_1();
1186
1397
  var functionsHaveConfigurableNames = functionsHaveNames_1.functionsHaveConfigurableNames();
1187
1398
 
1188
- var $TypeError$3 = type;
1399
+ var $TypeError$6 = type;
1189
1400
 
1190
1401
  /** @type {import('.')} */
1191
1402
  var setFunctionName$1 = function setFunctionName(fn, name) {
1192
1403
  if (typeof fn !== 'function') {
1193
- throw new $TypeError$3('`fn` is not a function');
1404
+ throw new $TypeError$6('`fn` is not a function');
1194
1405
  }
1195
1406
  var loose = arguments.length > 2 && !!arguments[2];
1196
1407
  if (!loose || functionsHaveConfigurableNames) {
@@ -1204,13 +1415,13 @@
1204
1415
  };
1205
1416
 
1206
1417
  var setFunctionName = setFunctionName$1;
1207
- var $TypeError$2 = type;
1418
+ var $TypeError$5 = type;
1208
1419
 
1209
1420
  var $Object = Object;
1210
1421
 
1211
1422
  var implementation$5 = setFunctionName(function flags() {
1212
1423
  if (this == null || this !== $Object(this)) {
1213
- throw new $TypeError$2('RegExp.prototype.flags getter called on non-object');
1424
+ throw new $TypeError$5('RegExp.prototype.flags getter called on non-object');
1214
1425
  }
1215
1426
  var result = '';
1216
1427
  if (this.hasIndices) {
@@ -1327,9 +1538,9 @@
1327
1538
  };
1328
1539
 
1329
1540
  var hasToStringTag$7 = shams();
1330
- var callBound$a = callBound$c;
1541
+ var callBound$c = callBound$e;
1331
1542
 
1332
- var $toString$4 = callBound$a('Object.prototype.toString');
1543
+ var $toString$4 = callBound$c('Object.prototype.toString');
1333
1544
 
1334
1545
  var isStandardArguments = function isArguments(value) {
1335
1546
  if (hasToStringTag$7 && value && typeof value === 'object' && Symbol.toStringTag in value) {
@@ -1417,7 +1628,7 @@
1417
1628
  num === Infinity
1418
1629
  || num === -Infinity
1419
1630
  || num !== num
1420
- || (num && num > -1000 && num < 1000)
1631
+ || (num && num > -1e3 && num < 1000)
1421
1632
  || $test.call(/e/, str)
1422
1633
  ) {
1423
1634
  return str;
@@ -1438,10 +1649,21 @@
1438
1649
  var inspectCustom = utilInspect.custom;
1439
1650
  var inspectSymbol = isSymbol$2(inspectCustom) ? inspectCustom : null;
1440
1651
 
1652
+ var quotes = {
1653
+ __proto__: null,
1654
+ 'double': '"',
1655
+ single: "'"
1656
+ };
1657
+ var quoteREs = {
1658
+ __proto__: null,
1659
+ 'double': /(["\\])/g,
1660
+ single: /(['\\])/g
1661
+ };
1662
+
1441
1663
  var objectInspect = function inspect_(obj, options, depth, seen) {
1442
1664
  var opts = options || {};
1443
1665
 
1444
- if (has$1(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {
1666
+ if (has$1(opts, 'quoteStyle') && !has$1(quotes, opts.quoteStyle)) {
1445
1667
  throw new TypeError('option "quoteStyle" must be "single" or "double"');
1446
1668
  }
1447
1669
  if (
@@ -1613,7 +1835,10 @@
1613
1835
  if (typeof window !== 'undefined' && obj === window) {
1614
1836
  return '{ [object Window] }';
1615
1837
  }
1616
- if (obj === commonjsGlobal) {
1838
+ if (
1839
+ (typeof globalThis !== 'undefined' && obj === globalThis)
1840
+ || (typeof commonjsGlobal !== 'undefined' && obj === commonjsGlobal)
1841
+ ) {
1617
1842
  return '{ [object globalThis] }';
1618
1843
  }
1619
1844
  if (!isDate$1(obj) && !isRegExp(obj)) {
@@ -1633,7 +1858,8 @@
1633
1858
  };
1634
1859
 
1635
1860
  function wrapQuotes(s, defaultStyle, opts) {
1636
- var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'";
1861
+ var style = opts.quoteStyle || defaultStyle;
1862
+ var quoteChar = quotes[style];
1637
1863
  return quoteChar + s + quoteChar;
1638
1864
  }
1639
1865
 
@@ -1791,8 +2017,10 @@
1791
2017
  var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');
1792
2018
  return inspectString($slice$1.call(str, 0, opts.maxStringLength), opts) + trailer;
1793
2019
  }
2020
+ var quoteRE = quoteREs[opts.quoteStyle || 'single'];
2021
+ quoteRE.lastIndex = 0;
1794
2022
  // eslint-disable-next-line no-control-regex
1795
- var s = $replace.call($replace.call(str, /(['\\])/g, '\\$1'), /[\x00-\x1f]/g, lowbyte);
2023
+ var s = $replace.call($replace.call(str, quoteRE, '\\$1'), /[\x00-\x1f]/g, lowbyte);
1796
2024
  return wrapQuotes(s, 'single', opts);
1797
2025
  }
1798
2026
 
@@ -1892,135 +2120,328 @@
1892
2120
  return xs;
1893
2121
  }
1894
2122
 
1895
- var GetIntrinsic$4 = getIntrinsic;
1896
- var callBound$9 = callBound$c;
1897
- var inspect = objectInspect;
1898
-
1899
- var $TypeError$1 = type;
1900
- var $WeakMap$1 = GetIntrinsic$4('%WeakMap%', true);
1901
- var $Map$3 = GetIntrinsic$4('%Map%', true);
2123
+ var inspect$3 = objectInspect;
1902
2124
 
1903
- var $weakMapGet = callBound$9('WeakMap.prototype.get', true);
1904
- var $weakMapSet = callBound$9('WeakMap.prototype.set', true);
1905
- var $weakMapHas = callBound$9('WeakMap.prototype.has', true);
1906
- var $mapGet$1 = callBound$9('Map.prototype.get', true);
1907
- var $mapSet = callBound$9('Map.prototype.set', true);
1908
- var $mapHas$5 = callBound$9('Map.prototype.has', true);
2125
+ var $TypeError$4 = type;
1909
2126
 
1910
2127
  /*
1911
2128
  * This function traverses the list returning the node corresponding to the given key.
1912
2129
  *
1913
- * That node is also moved to the head of the list, so that if it's accessed again we don't need to traverse the whole list. By doing so, all the recently used nodes can be accessed relatively quickly.
2130
+ * That node is also moved to the head of the list, so that if it's accessed again we don't need to traverse the whole list.
2131
+ * By doing so, all the recently used nodes can be accessed relatively quickly.
1914
2132
  */
1915
- /** @type {import('.').listGetNode} */
1916
- var listGetNode = function (list, key) { // eslint-disable-line consistent-return
2133
+ /** @type {import('./list.d.ts').listGetNode} */
2134
+ // eslint-disable-next-line consistent-return
2135
+ var listGetNode = function (list, key, isDelete) {
1917
2136
  /** @type {typeof list | NonNullable<(typeof list)['next']>} */
1918
2137
  var prev = list;
1919
2138
  /** @type {(typeof list)['next']} */
1920
2139
  var curr;
1921
- for (; (curr = prev.next) !== null; prev = curr) {
2140
+ // eslint-disable-next-line eqeqeq
2141
+ for (; (curr = prev.next) != null; prev = curr) {
1922
2142
  if (curr.key === key) {
1923
2143
  prev.next = curr.next;
1924
- // eslint-disable-next-line no-extra-parens
1925
- curr.next = /** @type {NonNullable<typeof list.next>} */ (list.next);
1926
- list.next = curr; // eslint-disable-line no-param-reassign
2144
+ if (!isDelete) {
2145
+ // eslint-disable-next-line no-extra-parens
2146
+ curr.next = /** @type {NonNullable<typeof list.next>} */ (list.next);
2147
+ list.next = curr; // eslint-disable-line no-param-reassign
2148
+ }
1927
2149
  return curr;
1928
2150
  }
1929
2151
  }
1930
2152
  };
1931
2153
 
1932
- /** @type {import('.').listGet} */
2154
+ /** @type {import('./list.d.ts').listGet} */
1933
2155
  var listGet = function (objects, key) {
2156
+ if (!objects) {
2157
+ return void 0;
2158
+ }
1934
2159
  var node = listGetNode(objects, key);
1935
2160
  return node && node.value;
1936
2161
  };
1937
- /** @type {import('.').listSet} */
2162
+ /** @type {import('./list.d.ts').listSet} */
1938
2163
  var listSet = function (objects, key, value) {
1939
2164
  var node = listGetNode(objects, key);
1940
2165
  if (node) {
1941
2166
  node.value = value;
1942
2167
  } else {
1943
2168
  // Prepend the new node to the beginning of the list
1944
- objects.next = /** @type {import('.').ListNode<typeof value>} */ ({ // eslint-disable-line no-param-reassign, no-extra-parens
2169
+ objects.next = /** @type {import('./list.d.ts').ListNode<typeof value, typeof key>} */ ({ // eslint-disable-line no-param-reassign, no-extra-parens
1945
2170
  key: key,
1946
2171
  next: objects.next,
1947
2172
  value: value
1948
2173
  });
1949
2174
  }
1950
2175
  };
1951
- /** @type {import('.').listHas} */
2176
+ /** @type {import('./list.d.ts').listHas} */
1952
2177
  var listHas = function (objects, key) {
2178
+ if (!objects) {
2179
+ return false;
2180
+ }
1953
2181
  return !!listGetNode(objects, key);
1954
2182
  };
2183
+ /** @type {import('./list.d.ts').listDelete} */
2184
+ // eslint-disable-next-line consistent-return
2185
+ var listDelete = function (objects, key) {
2186
+ if (objects) {
2187
+ return listGetNode(objects, key, true);
2188
+ }
2189
+ };
2190
+
2191
+ /** @type {import('.')} */
2192
+ var sideChannelList = function getSideChannelList() {
2193
+ /** @typedef {ReturnType<typeof getSideChannelList>} Channel */
2194
+ /** @typedef {Parameters<Channel['get']>[0]} K */
2195
+ /** @typedef {Parameters<Channel['set']>[1]} V */
2196
+
2197
+ /** @type {import('./list.d.ts').RootNode<V, K> | undefined} */ var $o;
2198
+
2199
+ /** @type {Channel} */
2200
+ var channel = {
2201
+ assert: function (key) {
2202
+ if (!channel.has(key)) {
2203
+ throw new $TypeError$4('Side channel does not contain ' + inspect$3(key));
2204
+ }
2205
+ },
2206
+ 'delete': function (key) {
2207
+ var root = $o && $o.next;
2208
+ var deletedNode = listDelete($o, key);
2209
+ if (deletedNode && root && root === deletedNode) {
2210
+ $o = void 0;
2211
+ }
2212
+ return !!deletedNode;
2213
+ },
2214
+ get: function (key) {
2215
+ return listGet($o, key);
2216
+ },
2217
+ has: function (key) {
2218
+ return listHas($o, key);
2219
+ },
2220
+ set: function (key, value) {
2221
+ if (!$o) {
2222
+ // Initialize the linked list as an empty node, so that we don't have to special-case handling of the first node: we can always refer to it as (previous node).next, instead of something like (list).head
2223
+ $o = {
2224
+ next: void 0
2225
+ };
2226
+ }
2227
+ // eslint-disable-next-line no-extra-parens
2228
+ listSet(/** @type {NonNullable<typeof $o>} */ ($o), key, value);
2229
+ }
2230
+ };
2231
+ // @ts-expect-error TODO: figure out why this is erroring
2232
+ return channel;
2233
+ };
2234
+
2235
+ var GetIntrinsic$6 = getIntrinsic;
2236
+
2237
+ var callBindBasic = callBindApplyHelpers;
2238
+
2239
+ /** @type {(thisArg: string, searchString: string, position?: number) => number} */
2240
+ var $indexOf$1 = callBindBasic([GetIntrinsic$6('%String.prototype.indexOf%')]);
2241
+
2242
+ /** @type {import('.')} */
2243
+ var callBound$b = function callBoundIntrinsic(name, allowMissing) {
2244
+ // eslint-disable-next-line no-extra-parens
2245
+ var intrinsic = /** @type {Parameters<typeof callBindBasic>[0][0]} */ (GetIntrinsic$6(name, !!allowMissing));
2246
+ if (typeof intrinsic === 'function' && $indexOf$1(name, '.prototype.') > -1) {
2247
+ return callBindBasic([intrinsic]);
2248
+ }
2249
+ return intrinsic;
2250
+ };
2251
+
2252
+ var GetIntrinsic$5 = getIntrinsic;
2253
+ var callBound$a = callBound$b;
2254
+ var inspect$2 = objectInspect;
2255
+
2256
+ var $TypeError$3 = type;
2257
+ var $Map$3 = GetIntrinsic$5('%Map%', true);
2258
+
2259
+ /** @type {<K, V>(thisArg: Map<K, V>, key: K) => V} */
2260
+ var $mapGet$1 = callBound$a('Map.prototype.get', true);
2261
+ /** @type {<K, V>(thisArg: Map<K, V>, key: K, value: V) => void} */
2262
+ var $mapSet = callBound$a('Map.prototype.set', true);
2263
+ /** @type {<K, V>(thisArg: Map<K, V>, key: K) => boolean} */
2264
+ var $mapHas$5 = callBound$a('Map.prototype.has', true);
2265
+ /** @type {<K, V>(thisArg: Map<K, V>, key: K) => boolean} */
2266
+ var $mapDelete = callBound$a('Map.prototype.delete', true);
2267
+ /** @type {<K, V>(thisArg: Map<K, V>) => number} */
2268
+ var $mapSize$1 = callBound$a('Map.prototype.size', true);
2269
+
2270
+ /** @type {import('.')} */
2271
+ var sideChannelMap = !!$Map$3 && /** @type {Exclude<import('.'), false>} */ function getSideChannelMap() {
2272
+ /** @typedef {ReturnType<typeof getSideChannelMap>} Channel */
2273
+ /** @typedef {Parameters<Channel['get']>[0]} K */
2274
+ /** @typedef {Parameters<Channel['set']>[1]} V */
2275
+
2276
+ /** @type {Map<K, V> | undefined} */ var $m;
2277
+
2278
+ /** @type {Channel} */
2279
+ var channel = {
2280
+ assert: function (key) {
2281
+ if (!channel.has(key)) {
2282
+ throw new $TypeError$3('Side channel does not contain ' + inspect$2(key));
2283
+ }
2284
+ },
2285
+ 'delete': function (key) {
2286
+ if ($m) {
2287
+ var result = $mapDelete($m, key);
2288
+ if ($mapSize$1($m) === 0) {
2289
+ $m = void 0;
2290
+ }
2291
+ return result;
2292
+ }
2293
+ return false;
2294
+ },
2295
+ get: function (key) { // eslint-disable-line consistent-return
2296
+ if ($m) {
2297
+ return $mapGet$1($m, key);
2298
+ }
2299
+ },
2300
+ has: function (key) {
2301
+ if ($m) {
2302
+ return $mapHas$5($m, key);
2303
+ }
2304
+ return false;
2305
+ },
2306
+ set: function (key, value) {
2307
+ if (!$m) {
2308
+ // @ts-expect-error TS can't handle narrowing a variable inside a closure
2309
+ $m = new $Map$3();
2310
+ }
2311
+ $mapSet($m, key, value);
2312
+ }
2313
+ };
2314
+
2315
+ // @ts-expect-error TODO: figure out why TS is erroring here
2316
+ return channel;
2317
+ };
2318
+
2319
+ var GetIntrinsic$4 = getIntrinsic;
2320
+ var callBound$9 = callBound$b;
2321
+ var inspect$1 = objectInspect;
2322
+ var getSideChannelMap$1 = sideChannelMap;
2323
+
2324
+ var $TypeError$2 = type;
2325
+ var $WeakMap$1 = GetIntrinsic$4('%WeakMap%', true);
2326
+
2327
+ /** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => V} */
2328
+ var $weakMapGet = callBound$9('WeakMap.prototype.get', true);
2329
+ /** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K, value: V) => void} */
2330
+ var $weakMapSet = callBound$9('WeakMap.prototype.set', true);
2331
+ /** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean} */
2332
+ var $weakMapHas = callBound$9('WeakMap.prototype.has', true);
2333
+ /** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean} */
2334
+ var $weakMapDelete = callBound$9('WeakMap.prototype.delete', true);
2335
+
2336
+ /** @type {import('.')} */
2337
+ var sideChannelWeakmap = $WeakMap$1
2338
+ ? /** @type {Exclude<import('.'), false>} */ function getSideChannelWeakMap() {
2339
+ /** @typedef {ReturnType<typeof getSideChannelWeakMap>} Channel */
2340
+ /** @typedef {Parameters<Channel['get']>[0]} K */
2341
+ /** @typedef {Parameters<Channel['set']>[1]} V */
2342
+
2343
+ /** @type {WeakMap<K & object, V> | undefined} */ var $wm;
2344
+ /** @type {Channel | undefined} */ var $m;
2345
+
2346
+ /** @type {Channel} */
2347
+ var channel = {
2348
+ assert: function (key) {
2349
+ if (!channel.has(key)) {
2350
+ throw new $TypeError$2('Side channel does not contain ' + inspect$1(key));
2351
+ }
2352
+ },
2353
+ 'delete': function (key) {
2354
+ if ($WeakMap$1 && key && (typeof key === 'object' || typeof key === 'function')) {
2355
+ if ($wm) {
2356
+ return $weakMapDelete($wm, key);
2357
+ }
2358
+ } else if (getSideChannelMap$1) {
2359
+ if ($m) {
2360
+ return $m['delete'](key);
2361
+ }
2362
+ }
2363
+ return false;
2364
+ },
2365
+ get: function (key) {
2366
+ if ($WeakMap$1 && key && (typeof key === 'object' || typeof key === 'function')) {
2367
+ if ($wm) {
2368
+ return $weakMapGet($wm, key);
2369
+ }
2370
+ }
2371
+ return $m && $m.get(key);
2372
+ },
2373
+ has: function (key) {
2374
+ if ($WeakMap$1 && key && (typeof key === 'object' || typeof key === 'function')) {
2375
+ if ($wm) {
2376
+ return $weakMapHas($wm, key);
2377
+ }
2378
+ }
2379
+ return !!$m && $m.has(key);
2380
+ },
2381
+ set: function (key, value) {
2382
+ if ($WeakMap$1 && key && (typeof key === 'object' || typeof key === 'function')) {
2383
+ if (!$wm) {
2384
+ $wm = new $WeakMap$1();
2385
+ }
2386
+ $weakMapSet($wm, key, value);
2387
+ } else if (getSideChannelMap$1) {
2388
+ if (!$m) {
2389
+ $m = getSideChannelMap$1();
2390
+ }
2391
+ // eslint-disable-next-line no-extra-parens
2392
+ /** @type {NonNullable<typeof $m>} */ ($m).set(key, value);
2393
+ }
2394
+ }
2395
+ };
2396
+
2397
+ // @ts-expect-error TODO: figure out why this is erroring
2398
+ return channel;
2399
+ }
2400
+ : getSideChannelMap$1;
2401
+
2402
+ var $TypeError$1 = type;
2403
+ var inspect = objectInspect;
2404
+ var getSideChannelList = sideChannelList;
2405
+ var getSideChannelMap = sideChannelMap;
2406
+ var getSideChannelWeakMap = sideChannelWeakmap;
2407
+
2408
+ var makeChannel = getSideChannelWeakMap || getSideChannelMap || getSideChannelList;
1955
2409
 
1956
2410
  /** @type {import('.')} */
1957
2411
  var sideChannel = function getSideChannel() {
1958
- /** @type {WeakMap<object, unknown>} */ var $wm;
1959
- /** @type {Map<object, unknown>} */ var $m;
1960
- /** @type {import('.').RootNode<unknown>} */ var $o;
2412
+ /** @typedef {ReturnType<typeof getSideChannel>} Channel */
2413
+
2414
+ /** @type {Channel | undefined} */ var $channelData;
1961
2415
 
1962
- /** @type {import('.').Channel} */
2416
+ /** @type {Channel} */
1963
2417
  var channel = {
1964
2418
  assert: function (key) {
1965
2419
  if (!channel.has(key)) {
1966
2420
  throw new $TypeError$1('Side channel does not contain ' + inspect(key));
1967
2421
  }
1968
2422
  },
1969
- get: function (key) { // eslint-disable-line consistent-return
1970
- if ($WeakMap$1 && key && (typeof key === 'object' || typeof key === 'function')) {
1971
- if ($wm) {
1972
- return $weakMapGet($wm, key);
1973
- }
1974
- } else if ($Map$3) {
1975
- if ($m) {
1976
- return $mapGet$1($m, key);
1977
- }
1978
- } else {
1979
- if ($o) { // eslint-disable-line no-lonely-if
1980
- return listGet($o, key);
1981
- }
1982
- }
2423
+ 'delete': function (key) {
2424
+ return !!$channelData && $channelData['delete'](key);
2425
+ },
2426
+ get: function (key) {
2427
+ return $channelData && $channelData.get(key);
1983
2428
  },
1984
2429
  has: function (key) {
1985
- if ($WeakMap$1 && key && (typeof key === 'object' || typeof key === 'function')) {
1986
- if ($wm) {
1987
- return $weakMapHas($wm, key);
1988
- }
1989
- } else if ($Map$3) {
1990
- if ($m) {
1991
- return $mapHas$5($m, key);
1992
- }
1993
- } else {
1994
- if ($o) { // eslint-disable-line no-lonely-if
1995
- return listHas($o, key);
1996
- }
1997
- }
1998
- return false;
2430
+ return !!$channelData && $channelData.has(key);
1999
2431
  },
2000
2432
  set: function (key, value) {
2001
- if ($WeakMap$1 && key && (typeof key === 'object' || typeof key === 'function')) {
2002
- if (!$wm) {
2003
- $wm = new $WeakMap$1();
2004
- }
2005
- $weakMapSet($wm, key, value);
2006
- } else if ($Map$3) {
2007
- if (!$m) {
2008
- $m = new $Map$3();
2009
- }
2010
- $mapSet($m, key, value);
2011
- } else {
2012
- if (!$o) {
2013
- // Initialize the linked list as an empty node, so that we don't have to special-case handling of the first node: we can always refer to it as (previous node).next, instead of something like (list).head
2014
- $o = { key: {}, next: null };
2015
- }
2016
- listSet($o, key, value);
2433
+ if (!$channelData) {
2434
+ $channelData = makeChannel();
2017
2435
  }
2436
+
2437
+ $channelData.set(key, value);
2018
2438
  }
2019
2439
  };
2440
+ // @ts-expect-error TODO: figure out why this is erroring
2020
2441
  return channel;
2021
2442
  };
2022
2443
 
2023
- var hasOwn = hasown;
2444
+ var hasOwn = requireHasown();
2024
2445
  var channel = sideChannel();
2025
2446
 
2026
2447
  var $TypeError = type;
@@ -2108,7 +2529,7 @@
2108
2529
  }
2109
2530
  return {
2110
2531
  done: true,
2111
- value: void undefined
2532
+ value: void 0
2112
2533
  };
2113
2534
  }
2114
2535
  }
@@ -2251,7 +2672,7 @@
2251
2672
  var isArguments$1 = isArguments$2;
2252
2673
  var getStopIterationIterator = stopIterationIterator;
2253
2674
 
2254
- if (hasSymbols$5() || requireShams()()) {
2675
+ if (hasSymbols$4() || requireShams()()) {
2255
2676
  var $iterator = Symbol.iterator;
2256
2677
  // Symbol is available natively or shammed
2257
2678
  // natively:
@@ -2278,7 +2699,7 @@
2278
2699
  var GetIntrinsic$3 = getIntrinsic;
2279
2700
  var $Map = GetIntrinsic$3('%Map%', true);
2280
2701
  var $Set$1 = GetIntrinsic$3('%Set%', true);
2281
- var callBound$8 = callBound$c;
2702
+ var callBound$8 = callBound$e;
2282
2703
  var $arrayPush = callBound$8('Array.prototype.push');
2283
2704
  var $charCodeAt = callBound$8('String.prototype.charCodeAt');
2284
2705
  var $stringSlice = callBound$8('String.prototype.slice');
@@ -2483,7 +2904,7 @@
2483
2904
  var objectIs = polyfill;
2484
2905
 
2485
2906
  var callBind$1 = callBindExports;
2486
- var callBound$7 = callBound$c;
2907
+ var callBound$7 = callBound$e;
2487
2908
  var GetIntrinsic$2 = getIntrinsic;
2488
2909
 
2489
2910
  var $ArrayBuffer = GetIntrinsic$2('%ArrayBuffer%', true);
@@ -2544,7 +2965,7 @@
2544
2965
  return hasToStringTag$5 ? tryDateObject(value) : toStr$4.call(value) === dateClass;
2545
2966
  };
2546
2967
 
2547
- var callBound$6 = callBound$c;
2968
+ var callBound$6 = callBound$e;
2548
2969
  var hasToStringTag$4 = shams();
2549
2970
  var has;
2550
2971
  var $exec;
@@ -2601,7 +3022,7 @@
2601
3022
  return $toString$2(value) === regexClass;
2602
3023
  };
2603
3024
 
2604
- var callBound$5 = callBound$c;
3025
+ var callBound$5 = callBound$e;
2605
3026
 
2606
3027
  var $byteLength$1 = callBound$5('SharedArrayBuffer.prototype.byteLength', true);
2607
3028
 
@@ -2645,7 +3066,7 @@
2645
3066
  return hasToStringTag$3 ? tryNumberObject(value) : toStr$3.call(value) === numClass;
2646
3067
  };
2647
3068
 
2648
- var callBound$4 = callBound$c;
3069
+ var callBound$4 = callBound$e;
2649
3070
  var $boolToStr = callBound$4('Boolean.prototype.toString');
2650
3071
  var $toString$1 = callBound$4('Object.prototype.toString');
2651
3072
 
@@ -2673,7 +3094,7 @@
2673
3094
  var isSymbol$1 = {exports: {}};
2674
3095
 
2675
3096
  var toStr$2 = Object.prototype.toString;
2676
- var hasSymbols = hasSymbols$5();
3097
+ var hasSymbols = hasSymbols$4();
2677
3098
 
2678
3099
  if (hasSymbols) {
2679
3100
  var symToStr = Symbol.prototype.toString;
@@ -2835,7 +3256,7 @@
2835
3256
  var isWeakset = {exports: {}};
2836
3257
 
2837
3258
  var GetIntrinsic$1 = getIntrinsic;
2838
- var callBound$3 = callBound$c;
3259
+ var callBound$3 = callBound$e;
2839
3260
 
2840
3261
  var $WeakSet = GetIntrinsic$1('%WeakSet%', true);
2841
3262
 
@@ -3093,7 +3514,7 @@
3093
3514
  var forEach = forEach_1;
3094
3515
  var availableTypedArrays = availableTypedArrays$1;
3095
3516
  var callBind = callBindExports;
3096
- var callBound$2 = callBound$c;
3517
+ var callBound$2 = callBound$e;
3097
3518
  var gOPD = gopd$1;
3098
3519
 
3099
3520
  /** @type {(O: object) => string} */
@@ -3205,7 +3626,7 @@
3205
3626
  return tryTypedArrays(value);
3206
3627
  };
3207
3628
 
3208
- var callBound$1 = callBound$c;
3629
+ var callBound$1 = callBound$e;
3209
3630
  var $byteLength = callBound$1('ArrayBuffer.prototype.byteLength', true);
3210
3631
 
3211
3632
  var isArrayBuffer$1 = isArrayBuffer$2;
@@ -3219,7 +3640,7 @@
3219
3640
  }; // in node < 0.11, byteLength is an own nonconfigurable property
3220
3641
 
3221
3642
  var assign = object_assign;
3222
- var callBound = callBound$c;
3643
+ var callBound = callBound$e;
3223
3644
  var flags = regexp_prototype_flags;
3224
3645
  var GetIntrinsic = getIntrinsic;
3225
3646
  var getIterator = esGetIteratorExports;
@@ -3611,11 +4032,12 @@
3611
4032
 
3612
4033
  var deepEqual$1 = /*@__PURE__*/getDefaultExportFromCjs(deepEqual);
3613
4034
 
4035
+ /* @ts-self-types="./index.d.ts" */
3614
4036
  let urlAlphabet =
3615
4037
  'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict';
3616
4038
  let nanoid = (size = 21) => {
3617
4039
  let id = '';
3618
- let i = size;
4040
+ let i = size | 0;
3619
4041
  while (i--) {
3620
4042
  id += urlAlphabet[(Math.random() * 64) | 0];
3621
4043
  }
@@ -3625,21 +4047,17 @@
3625
4047
  const isValidNonEmptyObject = (obj) => {
3626
4048
  return typeof obj === "object" && !Array.isArray(obj) && Object.keys(obj).length !== 0;
3627
4049
  };
3628
- const AsyncListener = (actualUnsub) => {
3629
- return {
3630
- unsubscribe() {
3631
- if (!actualUnsub) {
3632
- console.error("Failed to unsubscribe!");
3633
- return;
3634
- }
3635
- if (typeof actualUnsub === "function") {
3636
- actualUnsub();
3637
- }
3638
- else {
3639
- actualUnsub.then((unsubFunc) => unsubFunc()).catch(console.error);
3640
- }
4050
+ const getListenerWithAsyncUnsubscribe = (unsub) => {
4051
+ const asyncUnsub = () => new Promise((res, rej) => {
4052
+ try {
4053
+ unsub();
4054
+ res();
3641
4055
  }
3642
- };
4056
+ catch (err) {
4057
+ rej(err instanceof Error ? err : new Error(err));
4058
+ }
4059
+ });
4060
+ return { unsubscribe: asyncUnsub };
3643
4061
  };
3644
4062
  const promisePlus = (promise, timeoutMilliseconds, timeoutMessage) => {
3645
4063
  return new Promise((resolve, reject) => {
@@ -4746,6 +5164,9 @@
4746
5164
  }
4747
5165
  mergeBaseAppDataWithGlueManifest(baseAppData, hostManifestDefinition) {
4748
5166
  let baseApplicationDefinition = baseAppData;
5167
+ if (hostManifestDefinition.customProperties) {
5168
+ baseApplicationDefinition.userProperties = { ...baseAppData.userProperties, ...hostManifestDefinition.customProperties };
5169
+ }
4749
5170
  if (hostManifestDefinition.details) {
4750
5171
  const details = { ...baseAppData.createOptions, ...hostManifestDefinition.details };
4751
5172
  baseApplicationDefinition.createOptions = details;
@@ -4841,16 +5262,24 @@
4841
5262
  const IO_ERRORS = errors.intents;
4842
5263
  const BrowserClientControlMethodName = "T42.Web.Client.Control";
4843
5264
  const DesktopClientControlMethodName = "T42.Channels.Command";
5265
+ const GlueReceivedPromiseTimeout = 120 * 1000;
4844
5266
 
4845
5267
  const ioConnectFDC3SystemMethod = "FDC3.Collaborate";
4846
5268
  const PrivateChannelPrefix = "___privateFDC3Channel___";
4847
- var PrivateChannelEventMethods;
4848
- (function (PrivateChannelEventMethods) {
4849
- PrivateChannelEventMethods["ListenerAdded"] = "listenerAdded";
4850
- PrivateChannelEventMethods["OnAddContextListener"] = "onAddContextListener";
4851
- PrivateChannelEventMethods["OnUnsubscribe"] = "onUnsubscribe";
4852
- PrivateChannelEventMethods["OnDisconnect"] = "onDisconnect";
4853
- })(PrivateChannelEventMethods || (PrivateChannelEventMethods = {}));
5269
+ var LegacyPrivateChannelEventMethods;
5270
+ (function (LegacyPrivateChannelEventMethods) {
5271
+ LegacyPrivateChannelEventMethods["ListenerAdded"] = "listenerAdded";
5272
+ LegacyPrivateChannelEventMethods["OnAddContextListener"] = "onAddContextListener";
5273
+ LegacyPrivateChannelEventMethods["OnUnsubscribe"] = "onUnsubscribe";
5274
+ LegacyPrivateChannelEventMethods["OnDisconnect"] = "onDisconnect";
5275
+ })(LegacyPrivateChannelEventMethods || (LegacyPrivateChannelEventMethods = {}));
5276
+ var NewPrivateChannelEventMethods;
5277
+ (function (NewPrivateChannelEventMethods) {
5278
+ NewPrivateChannelEventMethods["ContextListenerAdded"] = "contextListenerAdded";
5279
+ NewPrivateChannelEventMethods["AddContextListener"] = "addContextListener";
5280
+ NewPrivateChannelEventMethods["Unsubscribe"] = "unsubscribe";
5281
+ NewPrivateChannelEventMethods["Disconnect"] = "disconnect";
5282
+ })(NewPrivateChannelEventMethods || (NewPrivateChannelEventMethods = {}));
4854
5283
 
4855
5284
  /**
4856
5285
  * Wraps values in an `Ok` type.
@@ -5698,19 +6127,19 @@
5698
6127
  object({
5699
6128
  channelId: optional(nonEmptyStringDecoder)
5700
6129
  });
6130
+ const privateChannelEventTypesDecoder = oneOf(constant("addContextListener"), constant("unsubscribe"), constant("disconnect"));
6131
+ const optionalPrivateChannelEventTypesDecoder = optional(privateChannelEventTypesDecoder);
6132
+ const optionalFdc3EventTypesDecoder = optional(constant("userChannelChanged"));
5701
6133
 
5702
6134
  class GlueController {
5703
6135
  channelsParser;
5704
- channelsStateStore;
5705
6136
  glue;
5706
6137
  _logger;
5707
6138
  glueInitPromise;
5708
6139
  resolveGluePromise;
5709
6140
  rejectGluePromise;
5710
- defaultGluePromiseTimeout = 120 * 1000;
5711
- constructor(channelsParser, channelsStateStore) {
6141
+ constructor(channelsParser) {
5712
6142
  this.channelsParser = channelsParser;
5713
- this.channelsStateStore = channelsStateStore;
5714
6143
  }
5715
6144
  get gluePromise() {
5716
6145
  return this.glueInitPromise.then(this.initializeLogger.bind(this));
@@ -5728,7 +6157,7 @@
5728
6157
  this.resolveGluePromise = resolve;
5729
6158
  this.rejectGluePromise = reject;
5730
6159
  });
5731
- }, this.defaultGluePromiseTimeout, `Timeout of ${this.defaultGluePromiseTimeout}ms waiting for Glue to initialize`);
6160
+ }, GlueReceivedPromiseTimeout, `Timeout of ${GlueReceivedPromiseTimeout}ms waiting to receive initialized 'io'`);
5732
6161
  }
5733
6162
  get logger() {
5734
6163
  return this._logger;
@@ -5750,11 +6179,14 @@
5750
6179
  getApplication(name) {
5751
6180
  return this.glue.appManager.application(name);
5752
6181
  }
6182
+ getAllAppManagerInstances() {
6183
+ return this.glue.appManager.instances();
6184
+ }
5753
6185
  getApplicationInstances(appName) {
5754
- return this.glue.appManager.instances().filter(inst => inst.application.name === appName);
6186
+ return this.getAllAppManagerInstances().filter(inst => inst.application.name === appName);
5755
6187
  }
5756
6188
  getAppInstanceById(id) {
5757
- return this.glue.appManager.instances().find(inst => inst.id === id);
6189
+ return this.getAllAppManagerInstances().find(inst => inst.id === id);
5758
6190
  }
5759
6191
  async findIntents(intentFilter) {
5760
6192
  return this.glue.intents.find(intentFilter);
@@ -5787,11 +6219,11 @@
5787
6219
  }
5788
6220
  return myWin.getContext();
5789
6221
  }
5790
- addIntentListener(intent, handler) {
5791
- const registerMethodExists = this.glue.intents.register;
5792
- return registerMethodExists
5793
- ? this.glue.intents.register(intent, handler)
5794
- : this.glue.intents.addIntentListener(intent, handler);
6222
+ async addIntentListener(intent, handler) {
6223
+ if (typeof this.glue.intents.register === "function") {
6224
+ return await this.glue.intents.register(intent, handler);
6225
+ }
6226
+ return this.glue.intents.addIntentListener(intent, handler);
5795
6227
  }
5796
6228
  getAllContexts() {
5797
6229
  return this.glue.contexts.all();
@@ -5866,7 +6298,11 @@
5866
6298
  }
5867
6299
  getMyWindow() {
5868
6300
  const win = this.glue.windows.my();
5869
- return isValidNonEmptyObject(win) ? win : undefined;
6301
+ const isValidWindow = isValidNonEmptyObject(win);
6302
+ if (isValidWindow) {
6303
+ return win;
6304
+ }
6305
+ return this.glue.windows.findById(this.glue.interop.instance.instance);
5870
6306
  }
5871
6307
  getMyInteropInstance() {
5872
6308
  return this.glue.interop.instance;
@@ -5947,9 +6383,12 @@
5947
6383
  getPrefs(app) {
5948
6384
  return this.glue.prefs.get(app);
5949
6385
  }
6386
+ isRunningInBrowser() {
6387
+ return typeof window !== "undefined" && !window.iodesktop;
6388
+ }
5950
6389
  async checkIsFdc3DataWrappingSupported() {
5951
- const globalBrowserNamespace = window.glue42core || window.iobrowser;
5952
- const methodName = globalBrowserNamespace ? BrowserClientControlMethodName : DesktopClientControlMethodName;
6390
+ const inBrowserNamespace = this.isRunningInBrowser();
6391
+ const methodName = inBrowserNamespace ? BrowserClientControlMethodName : DesktopClientControlMethodName;
5953
6392
  const myServer = this.glue.interop.servers().find((server) => server.instance === this.glue.interop.instance.instance);
5954
6393
  if (!myServer) {
5955
6394
  return false;
@@ -5958,7 +6397,7 @@
5958
6397
  if (!registersControlMethod) {
5959
6398
  return false;
5960
6399
  }
5961
- const data = globalBrowserNamespace ? { domain: "system", operation: "isFdc3DataWrappingSupported" } : { command: "isFdc3DataWrappingSupported" };
6400
+ const data = inBrowserNamespace ? { domain: "system", operation: "isFdc3DataWrappingSupported" } : { command: "isFdc3DataWrappingSupported" };
5962
6401
  try {
5963
6402
  const res = await this.glue.interop.invoke(methodName, data, { instance: this.interopInstance().instance });
5964
6403
  return res.returned.isSupported;
@@ -5984,7 +6423,7 @@
5984
6423
  }
5985
6424
  return {
5986
6425
  source: {
5987
- appId: instanceServer.applicationName,
6426
+ appId: instanceServer.application ?? instanceServer.applicationName,
5988
6427
  instanceId: instanceServer.instance
5989
6428
  }
5990
6429
  };
@@ -6043,7 +6482,7 @@
6043
6482
  const REQUEST_GLUE_RESPONSE = "requestGlueResponse";
6044
6483
  const FDC3_READY = "fdc3Ready";
6045
6484
 
6046
- class EventDispatcher {
6485
+ class WebEventDispatcher {
6047
6486
  fireFdc3Ready() {
6048
6487
  const event = new Event(FDC3_READY);
6049
6488
  window.dispatchEvent(event);
@@ -6063,9 +6502,851 @@
6063
6502
 
6064
6503
  // To parse this data:
6065
6504
  //
6066
- // import { Convert, AgentErrorResponseMessage, AgentRequestMessage, AgentResponseMessage, BridgeErrorResponseMessage, BridgeRequestMessage, BridgeResponseMessage, BroadcastAgentRequest, BroadcastBridgeRequest, ConnectionStepMessage, ConnectionStep2Hello, ConnectionStep3Handshake, ConnectionStep4AuthenticationFailed, ConnectionStep6ConnectedAgentsUpdate, FindInstancesAgentErrorResponse, FindInstancesAgentRequest, FindInstancesAgentResponse, FindInstancesBridgeErrorResponse, FindInstancesBridgeRequest, FindInstancesBridgeResponse, FindIntentAgentErrorResponse, FindIntentAgentRequest, FindIntentAgentResponse, FindIntentBridgeErrorResponse, FindIntentBridgeRequest, FindIntentBridgeResponse, FindIntentsByContextAgentErrorResponse, FindIntentsByContextAgentRequest, FindIntentsByContextAgentResponse, FindIntentsByContextBridgeErrorResponse, FindIntentsByContextBridgeRequest, FindIntentsByContextBridgeResponse, GetAppMetadataAgentErrorResponse, GetAppMetadataAgentRequest, GetAppMetadataAgentResponse, GetAppMetadataBridgeErrorResponse, GetAppMetadataBridgeRequest, GetAppMetadataBridgeResponse, OpenAgentErrorResponse, OpenAgentRequest, OpenAgentResponse, OpenBridgeErrorResponse, OpenBridgeRequest, OpenBridgeResponse, PrivateChannelBroadcastAgentRequest, PrivateChannelBroadcastBridgeRequest, PrivateChannelEventListenerAddedAgentRequest, PrivateChannelEventListenerAddedBridgeRequest, PrivateChannelEventListenerRemovedAgentRequest, PrivateChannelEventListenerRemovedBridgeRequest, PrivateChannelOnAddContextListenerAgentRequest, PrivateChannelOnAddContextListenerBridgeRequest, PrivateChannelOnDisconnectAgentRequest, PrivateChannelOnDisconnectBridgeRequest, PrivateChannelOnUnsubscribeAgentRequest, PrivateChannelOnUnsubscribeBridgeRequest, RaiseIntentAgentErrorResponse, RaiseIntentAgentRequest, RaiseIntentAgentResponse, RaiseIntentBridgeErrorResponse, RaiseIntentBridgeRequest, RaiseIntentBridgeResponse, RaiseIntentResultAgentErrorResponse, RaiseIntentResultAgentResponse, RaiseIntentResultBridgeErrorResponse, RaiseIntentResultBridgeResponse, Context } from "./file";
6505
+ // import { Convert, Action, Chart, ChatInitSettings, ChatMessage, ChatRoom, ChatSearchCriteria, Contact, ContactList, Context, Country, Currency, Email, FileAttachment, Instrument, InstrumentList, Interaction, Message, Nothing, Order, OrderList, Organization, Portfolio, Position, Product, TimeRange, Trade, TradeList, TransactionResult, Valuation } from "./file";
6506
+ //
6507
+ // const action = Convert.toAction(json);
6508
+ // const chart = Convert.toChart(json);
6509
+ // const chatInitSettings = Convert.toChatInitSettings(json);
6510
+ // const chatMessage = Convert.toChatMessage(json);
6511
+ // const chatRoom = Convert.toChatRoom(json);
6512
+ // const chatSearchCriteria = Convert.toChatSearchCriteria(json);
6513
+ // const contact = Convert.toContact(json);
6514
+ // const contactList = Convert.toContactList(json);
6515
+ // const context = Convert.toContext(json);
6516
+ // const country = Convert.toCountry(json);
6517
+ // const currency = Convert.toCurrency(json);
6518
+ // const email = Convert.toEmail(json);
6519
+ // const fileAttachment = Convert.toFileAttachment(json);
6520
+ // const instrument = Convert.toInstrument(json);
6521
+ // const instrumentList = Convert.toInstrumentList(json);
6522
+ // const interaction = Convert.toInteraction(json);
6523
+ // const message = Convert.toMessage(json);
6524
+ // const nothing = Convert.toNothing(json);
6525
+ // const order = Convert.toOrder(json);
6526
+ // const orderList = Convert.toOrderList(json);
6527
+ // const organization = Convert.toOrganization(json);
6528
+ // const portfolio = Convert.toPortfolio(json);
6529
+ // const position = Convert.toPosition(json);
6530
+ // const product = Convert.toProduct(json);
6531
+ // const timeRange = Convert.toTimeRange(json);
6532
+ // const trade = Convert.toTrade(json);
6533
+ // const tradeList = Convert.toTradeList(json);
6534
+ // const transactionResult = Convert.toTransactionResult(json);
6535
+ // const valuation = Convert.toValuation(json);
6536
+ //
6537
+ // These functions will throw an error if the JSON doesn't
6538
+ // match the expected interface, even if the JSON is valid.
6539
+ /**
6540
+ * Free text to be used for a keyword search
6541
+ *
6542
+ * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or
6543
+ * `'Meeting'` although other string values are permitted.
6544
+ */
6545
+ // Converts JSON strings to/from your types
6546
+ // and asserts the results of JSON.parse at runtime
6547
+ function a$2(typ) {
6548
+ return { arrayItems: typ };
6549
+ }
6550
+ function u$2(...typs) {
6551
+ return { unionMembers: typs };
6552
+ }
6553
+ function o$2(props, additional) {
6554
+ return { props, additional };
6555
+ }
6556
+ function m$2(additional) {
6557
+ return { props: [], additional };
6558
+ }
6559
+ function r$2(name) {
6560
+ return { ref: name };
6561
+ }
6562
+ ({
6563
+ Action: o$2([
6564
+ { json: 'action', js: 'action', typ: u$2(undefined, r$2('ActionType')) },
6565
+ { json: 'app', js: 'app', typ: u$2(undefined, r$2('AppIdentifier')) },
6566
+ { json: 'channelId', js: 'channelId', typ: u$2(undefined, '') },
6567
+ { json: 'context', js: 'context', typ: r$2('ContextElement') },
6568
+ { json: 'intent', js: 'intent', typ: u$2(undefined, '') },
6569
+ { json: 'title', js: 'title', typ: '' },
6570
+ { json: 'type', js: 'type', typ: r$2('ActionTypeEnum') },
6571
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('any')) },
6572
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6573
+ ], 'any'),
6574
+ AppIdentifier: o$2([
6575
+ { json: 'appId', js: 'appId', typ: '' },
6576
+ { json: 'desktopAgent', js: 'desktopAgent', typ: u$2(undefined, '') },
6577
+ { json: 'instanceId', js: 'instanceId', typ: u$2(undefined, '') },
6578
+ ], 'any'),
6579
+ ContextElement: o$2([
6580
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('any')) },
6581
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6582
+ { json: 'type', js: 'type', typ: '' },
6583
+ ], 'any'),
6584
+ Chart: o$2([
6585
+ { json: 'instruments', js: 'instruments', typ: a$2(r$2('InstrumentElement')) },
6586
+ { json: 'otherConfig', js: 'otherConfig', typ: u$2(undefined, a$2(r$2('ContextElement'))) },
6587
+ { json: 'range', js: 'range', typ: u$2(undefined, r$2('TimeRangeObject')) },
6588
+ { json: 'style', js: 'style', typ: u$2(undefined, r$2('ChartStyle')) },
6589
+ { json: 'type', js: 'type', typ: r$2('ChartType') },
6590
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('any')) },
6591
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6592
+ ], 'any'),
6593
+ InstrumentElement: o$2([
6594
+ { json: 'id', js: 'id', typ: r$2('PurpleInstrumentIdentifiers') },
6595
+ { json: 'market', js: 'market', typ: u$2(undefined, r$2('OrganizationMarket')) },
6596
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6597
+ { json: 'type', js: 'type', typ: r$2('PurpleInteractionType') },
6598
+ ], 'any'),
6599
+ PurpleInstrumentIdentifiers: o$2([
6600
+ { json: 'BBG', js: 'BBG', typ: u$2(undefined, '') },
6601
+ { json: 'CUSIP', js: 'CUSIP', typ: u$2(undefined, '') },
6602
+ { json: 'FDS_ID', js: 'FDS_ID', typ: u$2(undefined, '') },
6603
+ { json: 'FIGI', js: 'FIGI', typ: u$2(undefined, '') },
6604
+ { json: 'ISIN', js: 'ISIN', typ: u$2(undefined, '') },
6605
+ { json: 'PERMID', js: 'PERMID', typ: u$2(undefined, '') },
6606
+ { json: 'RIC', js: 'RIC', typ: u$2(undefined, '') },
6607
+ { json: 'SEDOL', js: 'SEDOL', typ: u$2(undefined, '') },
6608
+ { json: 'ticker', js: 'ticker', typ: u$2(undefined, '') },
6609
+ ], 'any'),
6610
+ OrganizationMarket: o$2([
6611
+ { json: 'BBG', js: 'BBG', typ: u$2(undefined, '') },
6612
+ { json: 'COUNTRY_ISOALPHA2', js: 'COUNTRY_ISOALPHA2', typ: u$2(undefined, '') },
6613
+ { json: 'MIC', js: 'MIC', typ: u$2(undefined, '') },
6614
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6615
+ ], 'any'),
6616
+ TimeRangeObject: o$2([
6617
+ { json: 'endTime', js: 'endTime', typ: u$2(undefined, Date) },
6618
+ { json: 'startTime', js: 'startTime', typ: u$2(undefined, Date) },
6619
+ { json: 'type', js: 'type', typ: r$2('TimeRangeType') },
6620
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('any')) },
6621
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6622
+ ], 'any'),
6623
+ ChatInitSettings: o$2([
6624
+ { json: 'chatName', js: 'chatName', typ: u$2(undefined, '') },
6625
+ { json: 'members', js: 'members', typ: u$2(undefined, r$2('ContactListObject')) },
6626
+ { json: 'message', js: 'message', typ: u$2(undefined, u$2(r$2('MessageObject'), '')) },
6627
+ { json: 'options', js: 'options', typ: u$2(undefined, r$2('ChatOptions')) },
6628
+ { json: 'type', js: 'type', typ: r$2('ChatInitSettingsType') },
6629
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('any')) },
6630
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6631
+ ], 'any'),
6632
+ ContactListObject: o$2([
6633
+ { json: 'contacts', js: 'contacts', typ: a$2(r$2('ContactElement')) },
6634
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('')) },
6635
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6636
+ { json: 'type', js: 'type', typ: r$2('ContactListType') },
6637
+ ], 'any'),
6638
+ ContactElement: o$2([
6639
+ { json: 'id', js: 'id', typ: r$2('PurpleContactIdentifiers') },
6640
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6641
+ { json: 'type', js: 'type', typ: r$2('FluffyInteractionType') },
6642
+ ], 'any'),
6643
+ PurpleContactIdentifiers: o$2([
6644
+ { json: 'email', js: 'email', typ: u$2(undefined, '') },
6645
+ { json: 'FDS_ID', js: 'FDS_ID', typ: u$2(undefined, '') },
6646
+ ], 'any'),
6647
+ MessageObject: o$2([
6648
+ { json: 'entities', js: 'entities', typ: u$2(undefined, m$2(r$2('EntityValue'))) },
6649
+ { json: 'text', js: 'text', typ: u$2(undefined, r$2('PurpleMessageText')) },
6650
+ { json: 'type', js: 'type', typ: r$2('MessageType') },
6651
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('any')) },
6652
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6653
+ ], 'any'),
6654
+ EntityValue: o$2([
6655
+ { json: 'action', js: 'action', typ: u$2(undefined, r$2('ActionType')) },
6656
+ { json: 'app', js: 'app', typ: u$2(undefined, r$2('AppIdentifier')) },
6657
+ { json: 'channelId', js: 'channelId', typ: u$2(undefined, '') },
6658
+ { json: 'context', js: 'context', typ: u$2(undefined, r$2('ContextElement')) },
6659
+ { json: 'intent', js: 'intent', typ: u$2(undefined, '') },
6660
+ { json: 'title', js: 'title', typ: u$2(undefined, '') },
6661
+ { json: 'type', js: 'type', typ: r$2('EntityType') },
6662
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('any')) },
6663
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6664
+ { json: 'data', js: 'data', typ: u$2(undefined, r$2('EntityData')) },
6665
+ ], 'any'),
6666
+ PurpleMessageText: o$2([
6667
+ { json: 'text/markdown', js: 'text/markdown', typ: u$2(undefined, '') },
6668
+ { json: 'text/plain', js: 'text/plain', typ: u$2(undefined, '') },
6669
+ ], 'any'),
6670
+ ChatOptions: o$2([
6671
+ { json: 'allowAddUser', js: 'allowAddUser', typ: u$2(undefined, true) },
6672
+ { json: 'allowHistoryBrowsing', js: 'allowHistoryBrowsing', typ: u$2(undefined, true) },
6673
+ { json: 'allowMessageCopy', js: 'allowMessageCopy', typ: u$2(undefined, true) },
6674
+ { json: 'groupRecipients', js: 'groupRecipients', typ: u$2(undefined, true) },
6675
+ { json: 'isPublic', js: 'isPublic', typ: u$2(undefined, true) },
6676
+ ], 'any'),
6677
+ ChatMessage: o$2([
6678
+ { json: 'chatRoom', js: 'chatRoom', typ: r$2('ChatRoomObject') },
6679
+ { json: 'message', js: 'message', typ: r$2('MessageObject') },
6680
+ { json: 'type', js: 'type', typ: r$2('ChatMessageType') },
6681
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('any')) },
6682
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6683
+ ], 'any'),
6684
+ ChatRoomObject: o$2([
6685
+ { json: 'id', js: 'id', typ: m$2('') },
6686
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6687
+ { json: 'providerName', js: 'providerName', typ: '' },
6688
+ { json: 'type', js: 'type', typ: r$2('ChatRoomType') },
6689
+ { json: 'url', js: 'url', typ: u$2(undefined, '') },
6690
+ ], 'any'),
6691
+ ChatRoom: o$2([
6692
+ { json: 'id', js: 'id', typ: m$2('') },
6693
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6694
+ { json: 'providerName', js: 'providerName', typ: '' },
6695
+ { json: 'type', js: 'type', typ: r$2('ChatRoomType') },
6696
+ { json: 'url', js: 'url', typ: u$2(undefined, '') },
6697
+ ], 'any'),
6698
+ ChatSearchCriteria: o$2([
6699
+ { json: 'criteria', js: 'criteria', typ: a$2(u$2(r$2('OrganizationObject'), '')) },
6700
+ { json: 'type', js: 'type', typ: r$2('ChatSearchCriteriaType') },
6701
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('any')) },
6702
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6703
+ ], 'any'),
6704
+ OrganizationObject: o$2([
6705
+ { json: 'id', js: 'id', typ: r$2('Identifiers') },
6706
+ { json: 'market', js: 'market', typ: u$2(undefined, r$2('OrganizationMarket')) },
6707
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6708
+ { json: 'type', js: 'type', typ: r$2('TentacledInteractionType') },
6709
+ ], 'any'),
6710
+ Identifiers: o$2([
6711
+ { json: 'BBG', js: 'BBG', typ: u$2(undefined, '') },
6712
+ { json: 'CUSIP', js: 'CUSIP', typ: u$2(undefined, '') },
6713
+ { json: 'FDS_ID', js: 'FDS_ID', typ: u$2(undefined, '') },
6714
+ { json: 'FIGI', js: 'FIGI', typ: u$2(undefined, '') },
6715
+ { json: 'ISIN', js: 'ISIN', typ: u$2(undefined, '') },
6716
+ { json: 'PERMID', js: 'PERMID', typ: u$2(undefined, '') },
6717
+ { json: 'RIC', js: 'RIC', typ: u$2(undefined, '') },
6718
+ { json: 'SEDOL', js: 'SEDOL', typ: u$2(undefined, '') },
6719
+ { json: 'ticker', js: 'ticker', typ: u$2(undefined, '') },
6720
+ { json: 'LEI', js: 'LEI', typ: u$2(undefined, '') },
6721
+ { json: 'email', js: 'email', typ: u$2(undefined, '') },
6722
+ ], 'any'),
6723
+ Contact: o$2([
6724
+ { json: 'id', js: 'id', typ: r$2('FluffyContactIdentifiers') },
6725
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6726
+ { json: 'type', js: 'type', typ: r$2('FluffyInteractionType') },
6727
+ ], 'any'),
6728
+ FluffyContactIdentifiers: o$2([
6729
+ { json: 'email', js: 'email', typ: u$2(undefined, '') },
6730
+ { json: 'FDS_ID', js: 'FDS_ID', typ: u$2(undefined, '') },
6731
+ ], 'any'),
6732
+ ContactList: o$2([
6733
+ { json: 'contacts', js: 'contacts', typ: a$2(r$2('ContactElement')) },
6734
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('')) },
6735
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6736
+ { json: 'type', js: 'type', typ: r$2('ContactListType') },
6737
+ ], 'any'),
6738
+ Context: o$2([
6739
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('any')) },
6740
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6741
+ { json: 'type', js: 'type', typ: '' },
6742
+ ], 'any'),
6743
+ Country: o$2([
6744
+ { json: 'id', js: 'id', typ: r$2('CountryID') },
6745
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6746
+ { json: 'type', js: 'type', typ: r$2('CountryType') },
6747
+ ], 'any'),
6748
+ CountryID: o$2([
6749
+ { json: 'COUNTRY_ISOALPHA2', js: 'COUNTRY_ISOALPHA2', typ: u$2(undefined, '') },
6750
+ { json: 'COUNTRY_ISOALPHA3', js: 'COUNTRY_ISOALPHA3', typ: u$2(undefined, '') },
6751
+ { json: 'ISOALPHA2', js: 'ISOALPHA2', typ: u$2(undefined, '') },
6752
+ { json: 'ISOALPHA3', js: 'ISOALPHA3', typ: u$2(undefined, '') },
6753
+ ], 'any'),
6754
+ Currency: o$2([
6755
+ { json: 'id', js: 'id', typ: r$2('CurrencyID') },
6756
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6757
+ { json: 'type', js: 'type', typ: r$2('CurrencyType') },
6758
+ ], 'any'),
6759
+ CurrencyID: o$2([{ json: 'CURRENCY_ISOCODE', js: 'CURRENCY_ISOCODE', typ: u$2(undefined, '') }], 'any'),
6760
+ Email: o$2([
6761
+ { json: 'recipients', js: 'recipients', typ: r$2('EmailRecipients') },
6762
+ { json: 'subject', js: 'subject', typ: u$2(undefined, '') },
6763
+ { json: 'textBody', js: 'textBody', typ: u$2(undefined, '') },
6764
+ { json: 'type', js: 'type', typ: r$2('EmailType') },
6765
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('any')) },
6766
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6767
+ ], 'any'),
6768
+ EmailRecipients: o$2([
6769
+ { json: 'id', js: 'id', typ: u$2(undefined, r$2('ContactTIdentifiers')) },
6770
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6771
+ { json: 'type', js: 'type', typ: r$2('EmailRecipientsType') },
6772
+ { json: 'contacts', js: 'contacts', typ: u$2(undefined, a$2(r$2('ContactElement'))) },
6773
+ ], 'any'),
6774
+ ContactTIdentifiers: o$2([
6775
+ { json: 'email', js: 'email', typ: u$2(undefined, '') },
6776
+ { json: 'FDS_ID', js: 'FDS_ID', typ: u$2(undefined, '') },
6777
+ ], 'any'),
6778
+ FileAttachment: o$2([
6779
+ { json: 'data', js: 'data', typ: r$2('FileAttachmentData') },
6780
+ { json: 'type', js: 'type', typ: r$2('FileAttachmentType') },
6781
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('any')) },
6782
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6783
+ ], 'any'),
6784
+ Instrument: o$2([
6785
+ { json: 'id', js: 'id', typ: r$2('FluffyInstrumentIdentifiers') },
6786
+ { json: 'market', js: 'market', typ: u$2(undefined, r$2('PurpleMarket')) },
6787
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6788
+ { json: 'type', js: 'type', typ: r$2('PurpleInteractionType') },
6789
+ ], 'any'),
6790
+ FluffyInstrumentIdentifiers: o$2([
6791
+ { json: 'BBG', js: 'BBG', typ: u$2(undefined, '') },
6792
+ { json: 'CUSIP', js: 'CUSIP', typ: u$2(undefined, '') },
6793
+ { json: 'FDS_ID', js: 'FDS_ID', typ: u$2(undefined, '') },
6794
+ { json: 'FIGI', js: 'FIGI', typ: u$2(undefined, '') },
6795
+ { json: 'ISIN', js: 'ISIN', typ: u$2(undefined, '') },
6796
+ { json: 'PERMID', js: 'PERMID', typ: u$2(undefined, '') },
6797
+ { json: 'RIC', js: 'RIC', typ: u$2(undefined, '') },
6798
+ { json: 'SEDOL', js: 'SEDOL', typ: u$2(undefined, '') },
6799
+ { json: 'ticker', js: 'ticker', typ: u$2(undefined, '') },
6800
+ ], 'any'),
6801
+ PurpleMarket: o$2([
6802
+ { json: 'BBG', js: 'BBG', typ: u$2(undefined, '') },
6803
+ { json: 'COUNTRY_ISOALPHA2', js: 'COUNTRY_ISOALPHA2', typ: u$2(undefined, '') },
6804
+ { json: 'MIC', js: 'MIC', typ: u$2(undefined, '') },
6805
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6806
+ ], 'any'),
6807
+ InstrumentList: o$2([
6808
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('')) },
6809
+ { json: 'instruments', js: 'instruments', typ: a$2(r$2('InstrumentElement')) },
6810
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6811
+ { json: 'type', js: 'type', typ: r$2('InstrumentListType') },
6812
+ ], 'any'),
6813
+ Interaction: o$2([
6814
+ { json: 'description', js: 'description', typ: '' },
6815
+ { json: 'id', js: 'id', typ: u$2(undefined, r$2('InteractionID')) },
6816
+ { json: 'initiator', js: 'initiator', typ: u$2(undefined, r$2('ContactElement')) },
6817
+ { json: 'interactionType', js: 'interactionType', typ: '' },
6818
+ { json: 'origin', js: 'origin', typ: u$2(undefined, '') },
6819
+ { json: 'participants', js: 'participants', typ: r$2('ContactListObject') },
6820
+ { json: 'timeRange', js: 'timeRange', typ: r$2('TimeRangeObject') },
6821
+ { json: 'type', js: 'type', typ: r$2('InteractionType') },
6822
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6823
+ ], 'any'),
6824
+ InteractionID: o$2([
6825
+ { json: 'SALESFORCE', js: 'SALESFORCE', typ: u$2(undefined, '') },
6826
+ { json: 'SINGLETRACK', js: 'SINGLETRACK', typ: u$2(undefined, '') },
6827
+ { json: 'URI', js: 'URI', typ: u$2(undefined, '') },
6828
+ ], 'any'),
6829
+ Message: o$2([
6830
+ { json: 'entities', js: 'entities', typ: u$2(undefined, m$2(r$2('EntityValue'))) },
6831
+ { json: 'text', js: 'text', typ: u$2(undefined, r$2('FluffyMessageText')) },
6832
+ { json: 'type', js: 'type', typ: r$2('MessageType') },
6833
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('any')) },
6834
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6835
+ ], 'any'),
6836
+ FluffyMessageText: o$2([
6837
+ { json: 'text/markdown', js: 'text/markdown', typ: u$2(undefined, '') },
6838
+ { json: 'text/plain', js: 'text/plain', typ: u$2(undefined, '') },
6839
+ ], 'any'),
6840
+ Nothing: o$2([
6841
+ { json: 'type', js: 'type', typ: r$2('NothingType') },
6842
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('any')) },
6843
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6844
+ ], 'any'),
6845
+ Order: o$2([
6846
+ { json: 'details', js: 'details', typ: u$2(undefined, r$2('PurpleOrderDetails')) },
6847
+ { json: 'id', js: 'id', typ: m$2('') },
6848
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6849
+ { json: 'type', js: 'type', typ: r$2('OrderType') },
6850
+ ], 'any'),
6851
+ PurpleOrderDetails: o$2([{ json: 'product', js: 'product', typ: u$2(undefined, r$2('ProductObject')) }], 'any'),
6852
+ ProductObject: o$2([
6853
+ { json: 'id', js: 'id', typ: m$2('') },
6854
+ { json: 'instrument', js: 'instrument', typ: u$2(undefined, r$2('InstrumentElement')) },
6855
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6856
+ { json: 'type', js: 'type', typ: r$2('ProductType') },
6857
+ ], 'any'),
6858
+ OrderList: o$2([
6859
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('')) },
6860
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6861
+ { json: 'orders', js: 'orders', typ: a$2(r$2('OrderElement')) },
6862
+ { json: 'type', js: 'type', typ: r$2('OrderListType') },
6863
+ ], 'any'),
6864
+ OrderElement: o$2([
6865
+ { json: 'details', js: 'details', typ: u$2(undefined, r$2('FluffyOrderDetails')) },
6866
+ { json: 'id', js: 'id', typ: m$2('') },
6867
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6868
+ { json: 'type', js: 'type', typ: r$2('OrderType') },
6869
+ ], 'any'),
6870
+ FluffyOrderDetails: o$2([{ json: 'product', js: 'product', typ: u$2(undefined, r$2('ProductObject')) }], 'any'),
6871
+ Organization: o$2([
6872
+ { json: 'id', js: 'id', typ: r$2('OrganizationIdentifiers') },
6873
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6874
+ { json: 'type', js: 'type', typ: r$2('StickyInteractionType') },
6875
+ ], 'any'),
6876
+ OrganizationIdentifiers: o$2([
6877
+ { json: 'FDS_ID', js: 'FDS_ID', typ: u$2(undefined, '') },
6878
+ { json: 'LEI', js: 'LEI', typ: u$2(undefined, '') },
6879
+ { json: 'PERMID', js: 'PERMID', typ: u$2(undefined, '') },
6880
+ ], 'any'),
6881
+ Portfolio: o$2([
6882
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('')) },
6883
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6884
+ { json: 'positions', js: 'positions', typ: a$2(r$2('PositionElement')) },
6885
+ { json: 'type', js: 'type', typ: r$2('PortfolioType') },
6886
+ ], 'any'),
6887
+ PositionElement: o$2([
6888
+ { json: 'holding', js: 'holding', typ: 3.14 },
6889
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('')) },
6890
+ { json: 'instrument', js: 'instrument', typ: r$2('InstrumentElement') },
6891
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6892
+ { json: 'type', js: 'type', typ: r$2('PositionType') },
6893
+ ], 'any'),
6894
+ Position: o$2([
6895
+ { json: 'holding', js: 'holding', typ: 3.14 },
6896
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('')) },
6897
+ { json: 'instrument', js: 'instrument', typ: r$2('InstrumentElement') },
6898
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6899
+ { json: 'type', js: 'type', typ: r$2('PositionType') },
6900
+ ], 'any'),
6901
+ Product: o$2([
6902
+ { json: 'id', js: 'id', typ: m$2('') },
6903
+ { json: 'instrument', js: 'instrument', typ: u$2(undefined, r$2('InstrumentElement')) },
6904
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6905
+ { json: 'type', js: 'type', typ: r$2('ProductType') },
6906
+ ], 'any'),
6907
+ TimeRange: o$2([
6908
+ { json: 'endTime', js: 'endTime', typ: u$2(undefined, Date) },
6909
+ { json: 'startTime', js: 'startTime', typ: u$2(undefined, Date) },
6910
+ { json: 'type', js: 'type', typ: r$2('TimeRangeType') },
6911
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('any')) },
6912
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6913
+ ], 'any'),
6914
+ Trade: o$2([
6915
+ { json: 'id', js: 'id', typ: m$2('') },
6916
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6917
+ { json: 'product', js: 'product', typ: r$2('ProductObject') },
6918
+ { json: 'type', js: 'type', typ: r$2('TradeType') },
6919
+ ], 'any'),
6920
+ TradeList: o$2([
6921
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('')) },
6922
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6923
+ { json: 'trades', js: 'trades', typ: a$2(r$2('TradeElement')) },
6924
+ { json: 'type', js: 'type', typ: r$2('TradeListType') },
6925
+ ], 'any'),
6926
+ TradeElement: o$2([
6927
+ { json: 'id', js: 'id', typ: m$2('') },
6928
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6929
+ { json: 'product', js: 'product', typ: r$2('ProductObject') },
6930
+ { json: 'type', js: 'type', typ: r$2('TradeType') },
6931
+ ], 'any'),
6932
+ TransactionResult: o$2([
6933
+ { json: 'context', js: 'context', typ: u$2(undefined, r$2('ContextElement')) },
6934
+ { json: 'message', js: 'message', typ: u$2(undefined, '') },
6935
+ { json: 'status', js: 'status', typ: r$2('TransactionStatus') },
6936
+ { json: 'type', js: 'type', typ: r$2('TransactionResultType') },
6937
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('any')) },
6938
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6939
+ ], 'any'),
6940
+ Valuation: o$2([
6941
+ { json: 'CURRENCY_ISOCODE', js: 'CURRENCY_ISOCODE', typ: '' },
6942
+ { json: 'expiryTime', js: 'expiryTime', typ: u$2(undefined, Date) },
6943
+ { json: 'price', js: 'price', typ: u$2(undefined, 3.14) },
6944
+ { json: 'type', js: 'type', typ: r$2('ValuationType') },
6945
+ { json: 'valuationTime', js: 'valuationTime', typ: u$2(undefined, Date) },
6946
+ { json: 'value', js: 'value', typ: 3.14 },
6947
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('any')) },
6948
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6949
+ ], 'any')});
6950
+
6951
+ // To parse this data:
6952
+ //
6953
+ // import { Convert, WebConnectionProtocol1Hello, WebConnectionProtocol2LoadURL, WebConnectionProtocol3Handshake, WebConnectionProtocol4ValidateAppIdentity, WebConnectionProtocol5ValidateAppIdentityFailedResponse, WebConnectionProtocol5ValidateAppIdentitySuccessResponse, WebConnectionProtocol6Goodbye, WebConnectionProtocolMessage, AddContextListenerRequest, AddContextListenerResponse, AddEventListenerRequest, AddEventListenerResponse, AddIntentListenerRequest, AddIntentListenerResponse, AgentEventMessage, AgentResponseMessage, AppRequestMessage, BroadcastEvent, BroadcastRequest, BroadcastResponse, ChannelChangedEvent, ContextListenerUnsubscribeRequest, ContextListenerUnsubscribeResponse, CreatePrivateChannelRequest, CreatePrivateChannelResponse, EventListenerUnsubscribeRequest, EventListenerUnsubscribeResponse, Fdc3UserInterfaceChannelSelected, Fdc3UserInterfaceChannels, Fdc3UserInterfaceDrag, Fdc3UserInterfaceHandshake, Fdc3UserInterfaceHello, Fdc3UserInterfaceMessage, Fdc3UserInterfaceResolve, Fdc3UserInterfaceResolveAction, Fdc3UserInterfaceRestyle, FindInstancesRequest, FindInstancesResponse, FindIntentRequest, FindIntentResponse, FindIntentsByContextRequest, FindIntentsByContextResponse, GetAppMetadataRequest, GetAppMetadataResponse, GetCurrentChannelRequest, GetCurrentChannelResponse, GetCurrentContextRequest, GetCurrentContextResponse, GetInfoRequest, GetInfoResponse, GetOrCreateChannelRequest, GetOrCreateChannelResponse, GetUserChannelsRequest, GetUserChannelsResponse, HeartbeatAcknowledgementRequest, HeartbeatEvent, IntentEvent, IntentListenerUnsubscribeRequest, IntentListenerUnsubscribeResponse, IntentResultRequest, IntentResultResponse, JoinUserChannelRequest, JoinUserChannelResponse, LeaveCurrentChannelRequest, LeaveCurrentChannelResponse, OpenRequest, OpenResponse, PrivateChannelAddEventListenerRequest, PrivateChannelAddEventListenerResponse, PrivateChannelDisconnectRequest, PrivateChannelDisconnectResponse, PrivateChannelOnAddContextListenerEvent, PrivateChannelOnDisconnectEvent, PrivateChannelOnUnsubscribeEvent, PrivateChannelUnsubscribeEventListenerRequest, PrivateChannelUnsubscribeEventListenerResponse, RaiseIntentForContextRequest, RaiseIntentForContextResponse, RaiseIntentRequest, RaiseIntentResponse, RaiseIntentResultResponse } from "./file";
6954
+ //
6955
+ // const webConnectionProtocol1Hello = Convert.toWebConnectionProtocol1Hello(json);
6956
+ // const webConnectionProtocol2LoadURL = Convert.toWebConnectionProtocol2LoadURL(json);
6957
+ // const webConnectionProtocol3Handshake = Convert.toWebConnectionProtocol3Handshake(json);
6958
+ // const webConnectionProtocol4ValidateAppIdentity = Convert.toWebConnectionProtocol4ValidateAppIdentity(json);
6959
+ // const webConnectionProtocol5ValidateAppIdentityFailedResponse = Convert.toWebConnectionProtocol5ValidateAppIdentityFailedResponse(json);
6960
+ // const webConnectionProtocol5ValidateAppIdentitySuccessResponse = Convert.toWebConnectionProtocol5ValidateAppIdentitySuccessResponse(json);
6961
+ // const webConnectionProtocol6Goodbye = Convert.toWebConnectionProtocol6Goodbye(json);
6962
+ // const webConnectionProtocolMessage = Convert.toWebConnectionProtocolMessage(json);
6963
+ // const addContextListenerRequest = Convert.toAddContextListenerRequest(json);
6964
+ // const addContextListenerResponse = Convert.toAddContextListenerResponse(json);
6965
+ // const addEventListenerRequest = Convert.toAddEventListenerRequest(json);
6966
+ // const addEventListenerResponse = Convert.toAddEventListenerResponse(json);
6967
+ // const addIntentListenerRequest = Convert.toAddIntentListenerRequest(json);
6968
+ // const addIntentListenerResponse = Convert.toAddIntentListenerResponse(json);
6969
+ // const agentEventMessage = Convert.toAgentEventMessage(json);
6970
+ // const agentResponseMessage = Convert.toAgentResponseMessage(json);
6971
+ // const appRequestMessage = Convert.toAppRequestMessage(json);
6972
+ // const broadcastEvent = Convert.toBroadcastEvent(json);
6973
+ // const broadcastRequest = Convert.toBroadcastRequest(json);
6974
+ // const broadcastResponse = Convert.toBroadcastResponse(json);
6975
+ // const channelChangedEvent = Convert.toChannelChangedEvent(json);
6976
+ // const contextListenerUnsubscribeRequest = Convert.toContextListenerUnsubscribeRequest(json);
6977
+ // const contextListenerUnsubscribeResponse = Convert.toContextListenerUnsubscribeResponse(json);
6978
+ // const createPrivateChannelRequest = Convert.toCreatePrivateChannelRequest(json);
6979
+ // const createPrivateChannelResponse = Convert.toCreatePrivateChannelResponse(json);
6980
+ // const eventListenerUnsubscribeRequest = Convert.toEventListenerUnsubscribeRequest(json);
6981
+ // const eventListenerUnsubscribeResponse = Convert.toEventListenerUnsubscribeResponse(json);
6982
+ // const fdc3UserInterfaceChannelSelected = Convert.toFdc3UserInterfaceChannelSelected(json);
6983
+ // const fdc3UserInterfaceChannels = Convert.toFdc3UserInterfaceChannels(json);
6984
+ // const fdc3UserInterfaceDrag = Convert.toFdc3UserInterfaceDrag(json);
6985
+ // const fdc3UserInterfaceHandshake = Convert.toFdc3UserInterfaceHandshake(json);
6986
+ // const fdc3UserInterfaceHello = Convert.toFdc3UserInterfaceHello(json);
6987
+ // const fdc3UserInterfaceMessage = Convert.toFdc3UserInterfaceMessage(json);
6988
+ // const fdc3UserInterfaceResolve = Convert.toFdc3UserInterfaceResolve(json);
6989
+ // const fdc3UserInterfaceResolveAction = Convert.toFdc3UserInterfaceResolveAction(json);
6990
+ // const fdc3UserInterfaceRestyle = Convert.toFdc3UserInterfaceRestyle(json);
6991
+ // const findInstancesRequest = Convert.toFindInstancesRequest(json);
6992
+ // const findInstancesResponse = Convert.toFindInstancesResponse(json);
6993
+ // const findIntentRequest = Convert.toFindIntentRequest(json);
6994
+ // const findIntentResponse = Convert.toFindIntentResponse(json);
6995
+ // const findIntentsByContextRequest = Convert.toFindIntentsByContextRequest(json);
6996
+ // const findIntentsByContextResponse = Convert.toFindIntentsByContextResponse(json);
6997
+ // const getAppMetadataRequest = Convert.toGetAppMetadataRequest(json);
6998
+ // const getAppMetadataResponse = Convert.toGetAppMetadataResponse(json);
6999
+ // const getCurrentChannelRequest = Convert.toGetCurrentChannelRequest(json);
7000
+ // const getCurrentChannelResponse = Convert.toGetCurrentChannelResponse(json);
7001
+ // const getCurrentContextRequest = Convert.toGetCurrentContextRequest(json);
7002
+ // const getCurrentContextResponse = Convert.toGetCurrentContextResponse(json);
7003
+ // const getInfoRequest = Convert.toGetInfoRequest(json);
7004
+ // const getInfoResponse = Convert.toGetInfoResponse(json);
7005
+ // const getOrCreateChannelRequest = Convert.toGetOrCreateChannelRequest(json);
7006
+ // const getOrCreateChannelResponse = Convert.toGetOrCreateChannelResponse(json);
7007
+ // const getUserChannelsRequest = Convert.toGetUserChannelsRequest(json);
7008
+ // const getUserChannelsResponse = Convert.toGetUserChannelsResponse(json);
7009
+ // const heartbeatAcknowledgementRequest = Convert.toHeartbeatAcknowledgementRequest(json);
7010
+ // const heartbeatEvent = Convert.toHeartbeatEvent(json);
7011
+ // const intentEvent = Convert.toIntentEvent(json);
7012
+ // const intentListenerUnsubscribeRequest = Convert.toIntentListenerUnsubscribeRequest(json);
7013
+ // const intentListenerUnsubscribeResponse = Convert.toIntentListenerUnsubscribeResponse(json);
7014
+ // const intentResultRequest = Convert.toIntentResultRequest(json);
7015
+ // const intentResultResponse = Convert.toIntentResultResponse(json);
7016
+ // const joinUserChannelRequest = Convert.toJoinUserChannelRequest(json);
7017
+ // const joinUserChannelResponse = Convert.toJoinUserChannelResponse(json);
7018
+ // const leaveCurrentChannelRequest = Convert.toLeaveCurrentChannelRequest(json);
7019
+ // const leaveCurrentChannelResponse = Convert.toLeaveCurrentChannelResponse(json);
7020
+ // const openRequest = Convert.toOpenRequest(json);
7021
+ // const openResponse = Convert.toOpenResponse(json);
7022
+ // const privateChannelAddEventListenerRequest = Convert.toPrivateChannelAddEventListenerRequest(json);
7023
+ // const privateChannelAddEventListenerResponse = Convert.toPrivateChannelAddEventListenerResponse(json);
7024
+ // const privateChannelDisconnectRequest = Convert.toPrivateChannelDisconnectRequest(json);
7025
+ // const privateChannelDisconnectResponse = Convert.toPrivateChannelDisconnectResponse(json);
7026
+ // const privateChannelOnAddContextListenerEvent = Convert.toPrivateChannelOnAddContextListenerEvent(json);
7027
+ // const privateChannelOnDisconnectEvent = Convert.toPrivateChannelOnDisconnectEvent(json);
7028
+ // const privateChannelOnUnsubscribeEvent = Convert.toPrivateChannelOnUnsubscribeEvent(json);
7029
+ // const privateChannelUnsubscribeEventListenerRequest = Convert.toPrivateChannelUnsubscribeEventListenerRequest(json);
7030
+ // const privateChannelUnsubscribeEventListenerResponse = Convert.toPrivateChannelUnsubscribeEventListenerResponse(json);
7031
+ // const raiseIntentForContextRequest = Convert.toRaiseIntentForContextRequest(json);
7032
+ // const raiseIntentForContextResponse = Convert.toRaiseIntentForContextResponse(json);
7033
+ // const raiseIntentRequest = Convert.toRaiseIntentRequest(json);
7034
+ // const raiseIntentResponse = Convert.toRaiseIntentResponse(json);
7035
+ // const raiseIntentResultResponse = Convert.toRaiseIntentResultResponse(json);
7036
+ //
7037
+ // These functions will throw an error if the JSON doesn't
7038
+ // match the expected interface, even if the JSON is valid.
7039
+ /**
7040
+ * Identifies the type of the message and it is typically set to the FDC3 function name that
7041
+ * the message relates to, e.g. 'findIntent', with 'Response' appended.
7042
+ */
7043
+ // Converts JSON strings to/from your types
7044
+ // and asserts the results of JSON.parse at runtime
7045
+ function a$1(typ) {
7046
+ return { arrayItems: typ };
7047
+ }
7048
+ function u$1(...typs) {
7049
+ return { unionMembers: typs };
7050
+ }
7051
+ function o$1(props, additional) {
7052
+ return { props, additional };
7053
+ }
7054
+ function m$1(additional) {
7055
+ return { props: [], additional };
7056
+ }
7057
+ function r$1(name) {
7058
+ return { ref: name };
7059
+ }
7060
+ ({
7061
+ WebConnectionProtocol1HelloPayload: o$1([
7062
+ { json: 'actualUrl', js: 'actualUrl', typ: '' },
7063
+ { json: 'channelSelector', js: 'channelSelector', typ: u$1(undefined, true) },
7064
+ { json: 'fdc3Version', js: 'fdc3Version', typ: '' },
7065
+ { json: 'identityUrl', js: 'identityUrl', typ: '' },
7066
+ { json: 'intentResolver', js: 'intentResolver', typ: u$1(undefined, true) },
7067
+ ], 'any'),
7068
+ WebConnectionProtocol3HandshakePayload: o$1([
7069
+ { json: 'appLaunchTimeout', js: 'appLaunchTimeout', typ: u$1(undefined, 3.14) },
7070
+ { json: 'channelSelectorUrl', js: 'channelSelectorUrl', typ: u$1(true, '') },
7071
+ { json: 'fdc3Version', js: 'fdc3Version', typ: '' },
7072
+ { json: 'intentResolverUrl', js: 'intentResolverUrl', typ: u$1(true, '') },
7073
+ { json: 'messageExchangeTimeout', js: 'messageExchangeTimeout', typ: u$1(undefined, 3.14) },
7074
+ ], false),
7075
+ WebConnectionProtocol4ValidateAppIdentityPayload: o$1([
7076
+ { json: 'actualUrl', js: 'actualUrl', typ: '' },
7077
+ { json: 'identityUrl', js: 'identityUrl', typ: '' },
7078
+ { json: 'instanceId', js: 'instanceId', typ: u$1(undefined, '') },
7079
+ { json: 'instanceUuid', js: 'instanceUuid', typ: u$1(undefined, '') },
7080
+ ], false),
7081
+ WebConnectionProtocol5ValidateAppIdentityFailedResponsePayload: o$1([{ json: 'message', js: 'message', typ: u$1(undefined, '') }], false),
7082
+ ImplementationMetadata: o$1([
7083
+ { json: 'appMetadata', js: 'appMetadata', typ: r$1('AppMetadata') },
7084
+ { json: 'fdc3Version', js: 'fdc3Version', typ: '' },
7085
+ { json: 'optionalFeatures', js: 'optionalFeatures', typ: r$1('OptionalFeatures') },
7086
+ { json: 'provider', js: 'provider', typ: '' },
7087
+ { json: 'providerVersion', js: 'providerVersion', typ: u$1(undefined, '') },
7088
+ ], false),
7089
+ AppMetadata: o$1([
7090
+ { json: 'appId', js: 'appId', typ: '' },
7091
+ { json: 'description', js: 'description', typ: u$1(undefined, '') },
7092
+ { json: 'desktopAgent', js: 'desktopAgent', typ: u$1(undefined, '') },
7093
+ { json: 'icons', js: 'icons', typ: u$1(undefined, a$1(r$1('Icon'))) },
7094
+ { json: 'instanceId', js: 'instanceId', typ: u$1(undefined, '') },
7095
+ { json: 'instanceMetadata', js: 'instanceMetadata', typ: u$1(undefined, m$1('any')) },
7096
+ { json: 'name', js: 'name', typ: u$1(undefined, '') },
7097
+ { json: 'resultType', js: 'resultType', typ: u$1(undefined, u$1(null, '')) },
7098
+ { json: 'screenshots', js: 'screenshots', typ: u$1(undefined, a$1(r$1('Image'))) },
7099
+ { json: 'title', js: 'title', typ: u$1(undefined, '') },
7100
+ { json: 'tooltip', js: 'tooltip', typ: u$1(undefined, '') },
7101
+ { json: 'version', js: 'version', typ: u$1(undefined, '') },
7102
+ ], false),
7103
+ Icon: o$1([
7104
+ { json: 'size', js: 'size', typ: u$1(undefined, '') },
7105
+ { json: 'src', js: 'src', typ: '' },
7106
+ { json: 'type', js: 'type', typ: u$1(undefined, '') },
7107
+ ], false),
7108
+ Image: o$1([
7109
+ { json: 'label', js: 'label', typ: u$1(undefined, '') },
7110
+ { json: 'size', js: 'size', typ: u$1(undefined, '') },
7111
+ { json: 'src', js: 'src', typ: '' },
7112
+ { json: 'type', js: 'type', typ: u$1(undefined, '') },
7113
+ ], false),
7114
+ WebConnectionProtocolMessage: o$1([
7115
+ { json: 'meta', js: 'meta', typ: r$1('ConnectionStepMetadata') },
7116
+ { json: 'payload', js: 'payload', typ: u$1(undefined, m$1('any')) },
7117
+ { json: 'type', js: 'type', typ: r$1('ConnectionStepMessageType') },
7118
+ ], false),
7119
+ ConnectionStepMetadata: o$1([
7120
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7121
+ { json: 'connectionAttemptUuid', js: 'connectionAttemptUuid', typ: u$1(undefined, '') },
7122
+ ], false),
7123
+ AddContextListenerRequestMeta: o$1([
7124
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7125
+ { json: 'source', js: 'source', typ: u$1(undefined, r$1('AppIdentifier')) },
7126
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7127
+ ], false),
7128
+ AppIdentifier: o$1([
7129
+ { json: 'appId', js: 'appId', typ: '' },
7130
+ { json: 'desktopAgent', js: 'desktopAgent', typ: u$1(undefined, '') },
7131
+ { json: 'instanceId', js: 'instanceId', typ: u$1(undefined, '') },
7132
+ ], 'any'),
7133
+ AddContextListenerRequestPayload: o$1([
7134
+ { json: 'channelId', js: 'channelId', typ: u$1(null, '') },
7135
+ { json: 'contextType', js: 'contextType', typ: u$1(null, '') },
7136
+ ], false),
7137
+ AddContextListenerResponseMeta: o$1([
7138
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7139
+ { json: 'responseUuid', js: 'responseUuid', typ: '' },
7140
+ { json: 'source', js: 'source', typ: u$1(undefined, r$1('AppIdentifier')) },
7141
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7142
+ ], false),
7143
+ AddContextListenerResponsePayload: o$1([
7144
+ { json: 'error', js: 'error', typ: u$1(undefined, r$1('PurpleError')) },
7145
+ { json: 'listenerUUID', js: 'listenerUUID', typ: u$1(undefined, '') },
7146
+ ], false),
7147
+ AddEventListenerRequestPayload: o$1([{ json: 'type', js: 'type', typ: u$1(r$1('FDC3EventType'), null) }], false),
7148
+ AddEventListenerResponsePayload: o$1([
7149
+ { json: 'error', js: 'error', typ: u$1(undefined, r$1('ResponsePayloadError')) },
7150
+ { json: 'listenerUUID', js: 'listenerUUID', typ: u$1(undefined, '') },
7151
+ ], false),
7152
+ PayloadObject: o$1([
7153
+ { json: 'error', js: 'error', typ: u$1(undefined, r$1('FluffyError')) },
7154
+ { json: 'listenerUUID', js: 'listenerUUID', typ: u$1(undefined, '') },
7155
+ ], 'any'),
7156
+ AgentResponseMessageMeta: o$1([
7157
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7158
+ { json: 'responseUuid', js: 'responseUuid', typ: '' },
7159
+ { json: 'source', js: 'source', typ: u$1(undefined, r$1('AppIdentifier')) },
7160
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7161
+ ], false),
7162
+ AgentResponseMessageResponsePayload: o$1([{ json: 'error', js: 'error', typ: u$1(undefined, r$1('ResponsePayloadError')) }], 'any'),
7163
+ AppRequestMessageMeta: o$1([
7164
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7165
+ { json: 'source', js: 'source', typ: u$1(undefined, r$1('AppIdentifier')) },
7166
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7167
+ ], false),
7168
+ BroadcastEventPayload: o$1([
7169
+ { json: 'channelId', js: 'channelId', typ: u$1(null, '') },
7170
+ { json: 'context', js: 'context', typ: r$1('Context') },
7171
+ { json: 'originatingApp', js: 'originatingApp', typ: u$1(undefined, r$1('AppIdentifier')) },
7172
+ ], false),
7173
+ Context: o$1([
7174
+ { json: 'id', js: 'id', typ: u$1(undefined, m$1('any')) },
7175
+ { json: 'name', js: 'name', typ: u$1(undefined, '') },
7176
+ { json: 'type', js: 'type', typ: '' },
7177
+ ], 'any'),
7178
+ BroadcastResponseResponsePayload: o$1([{ json: 'error', js: 'error', typ: u$1(undefined, r$1('ResponsePayloadError')) }], 'any'),
7179
+ ChannelChangedEventPayload: o$1([{ json: 'newChannelId', js: 'newChannelId', typ: u$1(null, '') }], false),
7180
+ CreatePrivateChannelResponsePayload: o$1([
7181
+ { json: 'error', js: 'error', typ: u$1(undefined, r$1('PurpleError')) },
7182
+ { json: 'privateChannel', js: 'privateChannel', typ: u$1(undefined, r$1('Channel')) },
7183
+ ], false),
7184
+ Channel: o$1([
7185
+ { json: 'displayMetadata', js: 'displayMetadata', typ: u$1(undefined, r$1('DisplayMetadata')) },
7186
+ { json: 'id', js: 'id', typ: '' },
7187
+ { json: 'type', js: 'type', typ: r$1('Type') },
7188
+ ], false),
7189
+ DisplayMetadata: o$1([
7190
+ { json: 'color', js: 'color', typ: u$1(undefined, '') },
7191
+ { json: 'glyph', js: 'glyph', typ: u$1(undefined, '') },
7192
+ { json: 'name', js: 'name', typ: u$1(undefined, '') },
7193
+ ], false),
7194
+ Fdc3UserInterfaceChannelSelectedPayload: o$1([{ json: 'selected', js: 'selected', typ: u$1(null, '') }], false),
7195
+ Fdc3UserInterfaceChannelsPayload: o$1([
7196
+ { json: 'selected', js: 'selected', typ: u$1(null, '') },
7197
+ { json: 'userChannels', js: 'userChannels', typ: a$1(r$1('Channel')) },
7198
+ ], false),
7199
+ InitialCSS: o$1([
7200
+ { json: 'bottom', js: 'bottom', typ: u$1(undefined, '') },
7201
+ { json: 'height', js: 'height', typ: u$1(undefined, '') },
7202
+ { json: 'left', js: 'left', typ: u$1(undefined, '') },
7203
+ { json: 'maxHeight', js: 'maxHeight', typ: u$1(undefined, '') },
7204
+ { json: 'maxWidth', js: 'maxWidth', typ: u$1(undefined, '') },
7205
+ { json: 'right', js: 'right', typ: u$1(undefined, '') },
7206
+ { json: 'top', js: 'top', typ: u$1(undefined, '') },
7207
+ { json: 'transition', js: 'transition', typ: u$1(undefined, '') },
7208
+ { json: 'width', js: 'width', typ: u$1(undefined, '') },
7209
+ { json: 'zIndex', js: 'zIndex', typ: u$1(undefined, '') },
7210
+ ], 'any'),
7211
+ Fdc3UserInterfaceMessage: o$1([
7212
+ { json: 'payload', js: 'payload', typ: u$1(undefined, m$1('any')) },
7213
+ { json: 'type', js: 'type', typ: r$1('Fdc3UserInterfaceMessageType') },
7214
+ ], false),
7215
+ IntentMetadata: o$1([
7216
+ { json: 'displayName', js: 'displayName', typ: u$1(undefined, '') },
7217
+ { json: 'name', js: 'name', typ: '' },
7218
+ ], false),
7219
+ Fdc3UserInterfaceResolveActionPayload: o$1([
7220
+ { json: 'action', js: 'action', typ: r$1('Action') },
7221
+ { json: 'appIdentifier', js: 'appIdentifier', typ: u$1(undefined, r$1('AppIdentifier')) },
7222
+ { json: 'intent', js: 'intent', typ: u$1(undefined, '') },
7223
+ ], false),
7224
+ UpdatedCSS: o$1([
7225
+ { json: 'bottom', js: 'bottom', typ: u$1(undefined, '') },
7226
+ { json: 'height', js: 'height', typ: u$1(undefined, '') },
7227
+ { json: 'left', js: 'left', typ: u$1(undefined, '') },
7228
+ { json: 'maxHeight', js: 'maxHeight', typ: u$1(undefined, '') },
7229
+ { json: 'maxWidth', js: 'maxWidth', typ: u$1(undefined, '') },
7230
+ { json: 'right', js: 'right', typ: u$1(undefined, '') },
7231
+ { json: 'top', js: 'top', typ: u$1(undefined, '') },
7232
+ { json: 'transition', js: 'transition', typ: u$1(undefined, '') },
7233
+ { json: 'width', js: 'width', typ: u$1(undefined, '') },
7234
+ { json: 'zIndex', js: 'zIndex', typ: u$1(undefined, '') },
7235
+ ], 'any'),
7236
+ FindInstancesResponsePayload: o$1([
7237
+ { json: 'error', js: 'error', typ: u$1(undefined, r$1('FindInstancesErrors')) },
7238
+ { json: 'appIdentifiers', js: 'appIdentifiers', typ: u$1(undefined, a$1(r$1('AppMetadata'))) },
7239
+ ], false),
7240
+ FindIntentRequestPayload: o$1([
7241
+ { json: 'context', js: 'context', typ: u$1(undefined, r$1('Context')) },
7242
+ { json: 'intent', js: 'intent', typ: '' },
7243
+ { json: 'resultType', js: 'resultType', typ: u$1(undefined, '') },
7244
+ ], false),
7245
+ FindIntentResponsePayload: o$1([
7246
+ { json: 'error', js: 'error', typ: u$1(undefined, r$1('FindInstancesErrors')) },
7247
+ { json: 'appIntent', js: 'appIntent', typ: u$1(undefined, r$1('AppIntent')) },
7248
+ ], false),
7249
+ FindIntentsByContextRequestPayload: o$1([
7250
+ { json: 'context', js: 'context', typ: r$1('Context') },
7251
+ { json: 'resultType', js: 'resultType', typ: u$1(undefined, '') },
7252
+ ], false),
7253
+ FindIntentsByContextResponsePayload: o$1([
7254
+ { json: 'error', js: 'error', typ: u$1(undefined, r$1('FindInstancesErrors')) },
7255
+ { json: 'appIntents', js: 'appIntents', typ: u$1(undefined, a$1(r$1('AppIntent'))) },
7256
+ ], false),
7257
+ GetAppMetadataResponsePayload: o$1([
7258
+ { json: 'error', js: 'error', typ: u$1(undefined, r$1('FindInstancesErrors')) },
7259
+ { json: 'appMetadata', js: 'appMetadata', typ: u$1(undefined, r$1('AppMetadata')) },
7260
+ ], false),
7261
+ GetCurrentChannelResponsePayload: o$1([
7262
+ { json: 'error', js: 'error', typ: u$1(undefined, r$1('ResponsePayloadError')) },
7263
+ { json: 'channel', js: 'channel', typ: u$1(undefined, u$1(r$1('Channel'), null)) },
7264
+ ], false),
7265
+ GetCurrentContextRequestPayload: o$1([
7266
+ { json: 'channelId', js: 'channelId', typ: '' },
7267
+ { json: 'contextType', js: 'contextType', typ: u$1(null, '') },
7268
+ ], false),
7269
+ GetCurrentContextResponsePayload: o$1([
7270
+ { json: 'error', js: 'error', typ: u$1(undefined, r$1('PurpleError')) },
7271
+ { json: 'context', js: 'context', typ: u$1(undefined, u$1(null, r$1('Context'))) },
7272
+ ], false),
7273
+ GetInfoResponsePayload: o$1([
7274
+ { json: 'error', js: 'error', typ: u$1(undefined, r$1('ResponsePayloadError')) },
7275
+ { json: 'implementationMetadata', js: 'implementationMetadata', typ: u$1(undefined, r$1('ImplementationMetadata')) },
7276
+ ], false),
7277
+ GetOrCreateChannelResponsePayload: o$1([
7278
+ { json: 'error', js: 'error', typ: u$1(undefined, r$1('PurpleError')) },
7279
+ { json: 'channel', js: 'channel', typ: u$1(undefined, r$1('Channel')) },
7280
+ ], false),
7281
+ GetUserChannelsResponsePayload: o$1([
7282
+ { json: 'error', js: 'error', typ: u$1(undefined, r$1('PurpleError')) },
7283
+ { json: 'userChannels', js: 'userChannels', typ: u$1(undefined, a$1(r$1('Channel'))) },
7284
+ ], false),
7285
+ IntentEventPayload: o$1([
7286
+ { json: 'context', js: 'context', typ: r$1('Context') },
7287
+ { json: 'intent', js: 'intent', typ: '' },
7288
+ { json: 'originatingApp', js: 'originatingApp', typ: u$1(undefined, r$1('AppIdentifier')) },
7289
+ { json: 'raiseIntentRequestUuid', js: 'raiseIntentRequestUuid', typ: '' },
7290
+ ], false),
7291
+ IntentResult: o$1([
7292
+ { json: 'context', js: 'context', typ: u$1(undefined, r$1('Context')) },
7293
+ { json: 'channel', js: 'channel', typ: u$1(undefined, r$1('Channel')) },
7294
+ ], false),
7295
+ JoinUserChannelResponsePayload: o$1([{ json: 'error', js: 'error', typ: u$1(undefined, r$1('PurpleError')) }], false),
7296
+ LeaveCurrentChannelResponsePayload: o$1([{ json: 'error', js: 'error', typ: u$1(undefined, r$1('PurpleError')) }], false),
7297
+ OpenRequestPayload: o$1([
7298
+ { json: 'app', js: 'app', typ: r$1('AppIdentifier') },
7299
+ { json: 'context', js: 'context', typ: u$1(undefined, r$1('Context')) },
7300
+ ], false),
7301
+ OpenResponsePayload: o$1([
7302
+ { json: 'error', js: 'error', typ: u$1(undefined, r$1('OpenErrorResponsePayload')) },
7303
+ { json: 'appIdentifier', js: 'appIdentifier', typ: u$1(undefined, r$1('AppIdentifier')) },
7304
+ ], false),
7305
+ PrivateChannelAddEventListenerRequestPayload: o$1([
7306
+ { json: 'listenerType', js: 'listenerType', typ: u$1(r$1('PrivateChannelEventType'), null) },
7307
+ { json: 'privateChannelId', js: 'privateChannelId', typ: '' },
7308
+ ], false),
7309
+ PrivateChannelAddEventListenerResponsePayload: o$1([
7310
+ { json: 'error', js: 'error', typ: u$1(undefined, r$1('PurpleError')) },
7311
+ { json: 'listenerUUID', js: 'listenerUUID', typ: u$1(undefined, '') },
7312
+ ], false),
7313
+ PrivateChannelDisconnectResponsePayload: o$1([{ json: 'error', js: 'error', typ: u$1(undefined, r$1('PurpleError')) }], false),
7314
+ PrivateChannelOnAddContextListenerEventPayload: o$1([
7315
+ { json: 'contextType', js: 'contextType', typ: u$1(null, '') },
7316
+ { json: 'privateChannelId', js: 'privateChannelId', typ: '' },
7317
+ ], false),
7318
+ PrivateChannelOnUnsubscribeEventPayload: o$1([
7319
+ { json: 'contextType', js: 'contextType', typ: u$1(null, '') },
7320
+ { json: 'privateChannelId', js: 'privateChannelId', typ: '' },
7321
+ ], false),
7322
+ RaiseIntentForContextRequestPayload: o$1([
7323
+ { json: 'app', js: 'app', typ: u$1(undefined, r$1('AppIdentifier')) },
7324
+ { json: 'context', js: 'context', typ: r$1('Context') },
7325
+ ], false),
7326
+ RaiseIntentForContextResponsePayload: o$1([
7327
+ { json: 'error', js: 'error', typ: u$1(undefined, r$1('FindInstancesErrors')) },
7328
+ { json: 'intentResolution', js: 'intentResolution', typ: u$1(undefined, r$1('IntentResolution')) },
7329
+ { json: 'appIntents', js: 'appIntents', typ: u$1(undefined, a$1(r$1('AppIntent'))) },
7330
+ ], false),
7331
+ RaiseIntentRequestPayload: o$1([
7332
+ { json: 'app', js: 'app', typ: u$1(undefined, r$1('AppIdentifier')) },
7333
+ { json: 'context', js: 'context', typ: r$1('Context') },
7334
+ { json: 'intent', js: 'intent', typ: '' },
7335
+ ], false),
7336
+ RaiseIntentResponsePayload: o$1([
7337
+ { json: 'error', js: 'error', typ: u$1(undefined, r$1('FindInstancesErrors')) },
7338
+ { json: 'intentResolution', js: 'intentResolution', typ: u$1(undefined, r$1('IntentResolution')) },
7339
+ { json: 'appIntent', js: 'appIntent', typ: u$1(undefined, r$1('AppIntent')) },
7340
+ ], false),
7341
+ RaiseIntentResultResponsePayload: o$1([
7342
+ { json: 'error', js: 'error', typ: u$1(undefined, r$1('ResponsePayloadError')) },
7343
+ { json: 'intentResult', js: 'intentResult', typ: u$1(undefined, r$1('IntentResult')) },
7344
+ ], false)});
7345
+
7346
+ // To parse this data:
7347
+ //
7348
+ // import { Convert, AgentErrorResponseMessage, AgentRequestMessage, AgentResponseMessage, BridgeErrorResponseMessage, BridgeRequestMessage, BridgeResponseMessage, BroadcastAgentRequest, BroadcastBridgeRequest, ConnectionStepMessage, ConnectionStep2Hello, ConnectionStep3Handshake, ConnectionStep4AuthenticationFailed, ConnectionStep6ConnectedAgentsUpdate, FindInstancesAgentErrorResponse, FindInstancesAgentRequest, FindInstancesAgentResponse, FindInstancesBridgeErrorResponse, FindInstancesBridgeRequest, FindInstancesBridgeResponse, FindIntentAgentErrorResponse, FindIntentAgentRequest, FindIntentAgentResponse, FindIntentBridgeErrorResponse, FindIntentBridgeRequest, FindIntentBridgeResponse, FindIntentsByContextAgentErrorResponse, FindIntentsByContextAgentRequest, FindIntentsByContextAgentResponse, FindIntentsByContextBridgeErrorResponse, FindIntentsByContextBridgeRequest, FindIntentsByContextBridgeResponse, GetAppMetadataAgentErrorResponse, GetAppMetadataAgentRequest, GetAppMetadataAgentResponse, GetAppMetadataBridgeErrorResponse, GetAppMetadataBridgeRequest, GetAppMetadataBridgeResponse, OpenAgentErrorResponse, OpenAgentRequest, OpenAgentResponse, OpenBridgeErrorResponse, OpenBridgeRequest, OpenBridgeResponse, PrivateChannelBroadcastAgentRequest, PrivateChannelBroadcastBridgeRequest, PrivateChannelEventListenerAddedAgentRequest, PrivateChannelEventListenerAddedBridgeRequest, PrivateChannelEventListenerRemovedAgentRequest, PrivateChannelEventListenerRemovedBridgeRequest, PrivateChannelOnAddContextListenerAgentRequest, PrivateChannelOnAddContextListenerBridgeRequest, PrivateChannelOnDisconnectAgentRequest, PrivateChannelOnDisconnectBridgeRequest, PrivateChannelOnUnsubscribeAgentRequest, PrivateChannelOnUnsubscribeBridgeRequest, RaiseIntentAgentErrorResponse, RaiseIntentAgentRequest, RaiseIntentAgentResponse, RaiseIntentBridgeErrorResponse, RaiseIntentBridgeRequest, RaiseIntentBridgeResponse, RaiseIntentResultAgentErrorResponse, RaiseIntentResultAgentResponse, RaiseIntentResultBridgeErrorResponse, RaiseIntentResultBridgeResponse } from "./file";
6067
7349
  //
6068
- // const fDC3DesktopAgentAPISchema = Convert.toFDC3DesktopAgentAPISchema(json);
6069
7350
  // const agentErrorResponseMessage = Convert.toAgentErrorResponseMessage(json);
6070
7351
  // const agentRequestMessage = Convert.toAgentRequestMessage(json);
6071
7352
  // const agentResponseMessage = Convert.toAgentResponseMessage(json);
@@ -6074,7 +7355,7 @@
6074
7355
  // const bridgeResponseMessage = Convert.toBridgeResponseMessage(json);
6075
7356
  // const broadcastAgentRequest = Convert.toBroadcastAgentRequest(json);
6076
7357
  // const broadcastBridgeRequest = Convert.toBroadcastBridgeRequest(json);
6077
- // const bridgingCommons = Convert.toBridgingCommons(json);
7358
+ // const bridgeCommonDefinitions = Convert.toBridgeCommonDefinitions(json);
6078
7359
  // const connectionStepMessage = Convert.toConnectionStepMessage(json);
6079
7360
  // const connectionStep2Hello = Convert.toConnectionStep2Hello(json);
6080
7361
  // const connectionStep3Handshake = Convert.toConnectionStep3Handshake(json);
@@ -6132,17 +7413,439 @@
6132
7413
  // const raiseIntentResultAgentResponse = Convert.toRaiseIntentResultAgentResponse(json);
6133
7414
  // const raiseIntentResultBridgeErrorResponse = Convert.toRaiseIntentResultBridgeErrorResponse(json);
6134
7415
  // const raiseIntentResultBridgeResponse = Convert.toRaiseIntentResultBridgeResponse(json);
6135
- // const context = Convert.toContext(json);
6136
7416
  //
6137
7417
  // These functions will throw an error if the JSON doesn't
6138
7418
  // match the expected interface, even if the JSON is valid.
6139
7419
  // Converts JSON strings to/from your types
6140
7420
  // and asserts the results of JSON.parse at runtime
7421
+ function a(typ) {
7422
+ return { arrayItems: typ };
7423
+ }
7424
+ function u(...typs) {
7425
+ return { unionMembers: typs };
7426
+ }
7427
+ function o(props, additional) {
7428
+ return { props, additional };
7429
+ }
7430
+ function m(additional) {
7431
+ return { props: [], additional };
7432
+ }
7433
+ function r(name) {
7434
+ return { ref: name };
7435
+ }
7436
+ ({
7437
+ AgentRequestMetadata: o([
7438
+ { json: 'destination', js: 'destination', typ: u(undefined, r('BridgeParticipantIdentifier')) },
7439
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7440
+ { json: 'source', js: 'source', typ: u(undefined, r('SourceIdentifier')) },
7441
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7442
+ ], false),
7443
+ BridgeParticipantIdentifier: o([
7444
+ { json: 'desktopAgent', js: 'desktopAgent', typ: '' },
7445
+ { json: 'appId', js: 'appId', typ: u(undefined, '') },
7446
+ { json: 'instanceId', js: 'instanceId', typ: u(undefined, '') },
7447
+ ], 'any'),
7448
+ SourceIdentifier: o([
7449
+ { json: 'appId', js: 'appId', typ: u(undefined, '') },
7450
+ { json: 'desktopAgent', js: 'desktopAgent', typ: u(undefined, '') },
7451
+ { json: 'instanceId', js: 'instanceId', typ: u(undefined, '') },
7452
+ ], 'any'),
7453
+ ResponseErrorMessagePayload: o([{ json: 'error', js: 'error', typ: u(undefined, r('ResponseErrorDetail')) }], 'any'),
7454
+ BridgeRequestMetadata: o([
7455
+ { json: 'destination', js: 'destination', typ: u(undefined, r('BridgeParticipantIdentifier')) },
7456
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7457
+ { json: 'source', js: 'source', typ: r('BridgeParticipantIdentifier') },
7458
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7459
+ ], false),
7460
+ BridgeResponseMessageMeta: o([
7461
+ { json: 'errorDetails', js: 'errorDetails', typ: u(undefined, a(r('ResponseErrorDetail'))) },
7462
+ { json: 'errorSources', js: 'errorSources', typ: u(undefined, a(r('DesktopAgentIdentifier'))) },
7463
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7464
+ { json: 'responseUuid', js: 'responseUuid', typ: '' },
7465
+ { json: 'sources', js: 'sources', typ: u(undefined, a(r('DesktopAgentIdentifier'))) },
7466
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7467
+ ], false),
7468
+ SourceObject: o([
7469
+ { json: 'appId', js: 'appId', typ: '' },
7470
+ { json: 'desktopAgent', js: 'desktopAgent', typ: u(undefined, '') },
7471
+ { json: 'instanceId', js: 'instanceId', typ: u(undefined, '') },
7472
+ ], 'any'),
7473
+ Context: o([
7474
+ { json: 'id', js: 'id', typ: u(undefined, m('any')) },
7475
+ { json: 'name', js: 'name', typ: u(undefined, '') },
7476
+ { json: 'type', js: 'type', typ: '' },
7477
+ ], 'any'),
7478
+ MetaSource: o([
7479
+ { json: 'appId', js: 'appId', typ: '' },
7480
+ { json: 'desktopAgent', js: 'desktopAgent', typ: '' },
7481
+ { json: 'instanceId', js: 'instanceId', typ: u(undefined, '') },
7482
+ ], 'any'),
7483
+ ConnectionStepMetadata: o([
7484
+ { json: 'requestUuid', js: 'requestUuid', typ: u(undefined, '') },
7485
+ { json: 'responseUuid', js: 'responseUuid', typ: u(undefined, '') },
7486
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7487
+ ], false),
7488
+ ConnectionStep2HelloPayload: o([
7489
+ { json: 'authRequired', js: 'authRequired', typ: true },
7490
+ { json: 'authToken', js: 'authToken', typ: u(undefined, '') },
7491
+ { json: 'desktopAgentBridgeVersion', js: 'desktopAgentBridgeVersion', typ: '' },
7492
+ { json: 'supportedFDC3Versions', js: 'supportedFDC3Versions', typ: a('') },
7493
+ ], false),
7494
+ ConnectionStep3HandshakePayload: o([
7495
+ { json: 'authToken', js: 'authToken', typ: u(undefined, '') },
7496
+ { json: 'channelsState', js: 'channelsState', typ: m(a(r('Context'))) },
7497
+ { json: 'implementationMetadata', js: 'implementationMetadata', typ: r('ConnectingAgentImplementationMetadata') },
7498
+ { json: 'requestedName', js: 'requestedName', typ: '' },
7499
+ ], false),
7500
+ ConnectingAgentImplementationMetadata: o([
7501
+ { json: 'fdc3Version', js: 'fdc3Version', typ: '' },
7502
+ { json: 'optionalFeatures', js: 'optionalFeatures', typ: r('OptionalFeatures') },
7503
+ { json: 'provider', js: 'provider', typ: '' },
7504
+ { json: 'providerVersion', js: 'providerVersion', typ: u(undefined, '') },
7505
+ ], false),
7506
+ ConnectionStep4AuthenticationFailedPayload: o([{ json: 'message', js: 'message', typ: u(undefined, '') }], false),
7507
+ ConnectionStep6ConnectedAgentsUpdatePayload: o([
7508
+ { json: 'addAgent', js: 'addAgent', typ: u(undefined, '') },
7509
+ { json: 'allAgents', js: 'allAgents', typ: a(r('DesktopAgentImplementationMetadata')) },
7510
+ { json: 'channelsState', js: 'channelsState', typ: u(undefined, m(a(r('Context')))) },
7511
+ { json: 'removeAgent', js: 'removeAgent', typ: u(undefined, '') },
7512
+ ], false),
7513
+ DesktopAgentImplementationMetadata: o([
7514
+ { json: 'desktopAgent', js: 'desktopAgent', typ: '' },
7515
+ { json: 'fdc3Version', js: 'fdc3Version', typ: '' },
7516
+ { json: 'optionalFeatures', js: 'optionalFeatures', typ: r('OptionalFeatures') },
7517
+ { json: 'provider', js: 'provider', typ: '' },
7518
+ { json: 'providerVersion', js: 'providerVersion', typ: u(undefined, '') },
7519
+ ], false),
7520
+ FindInstancesAgentRequestMeta: o([
7521
+ { json: 'destination', js: 'destination', typ: u(undefined, r('DestinationObject')) },
7522
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7523
+ { json: 'source', js: 'source', typ: u(undefined, r('SourceIdentifier')) },
7524
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7525
+ ], false),
7526
+ DestinationObject: o([
7527
+ { json: 'desktopAgent', js: 'desktopAgent', typ: '' },
7528
+ { json: 'appId', js: 'appId', typ: u(undefined, '') },
7529
+ { json: 'instanceId', js: 'instanceId', typ: u(undefined, '') },
7530
+ ], 'any'),
7531
+ AppIdentifier: o([
7532
+ { json: 'appId', js: 'appId', typ: '' },
7533
+ { json: 'desktopAgent', js: 'desktopAgent', typ: u(undefined, '') },
7534
+ { json: 'instanceId', js: 'instanceId', typ: u(undefined, '') },
7535
+ ], 'any'),
7536
+ AppMetadata: o([
7537
+ { json: 'appId', js: 'appId', typ: '' },
7538
+ { json: 'description', js: 'description', typ: u(undefined, '') },
7539
+ { json: 'desktopAgent', js: 'desktopAgent', typ: u(undefined, '') },
7540
+ { json: 'icons', js: 'icons', typ: u(undefined, a(r('Icon'))) },
7541
+ { json: 'instanceId', js: 'instanceId', typ: u(undefined, '') },
7542
+ { json: 'instanceMetadata', js: 'instanceMetadata', typ: u(undefined, m('any')) },
7543
+ { json: 'name', js: 'name', typ: u(undefined, '') },
7544
+ { json: 'resultType', js: 'resultType', typ: u(undefined, u(null, '')) },
7545
+ { json: 'screenshots', js: 'screenshots', typ: u(undefined, a(r('Image'))) },
7546
+ { json: 'title', js: 'title', typ: u(undefined, '') },
7547
+ { json: 'tooltip', js: 'tooltip', typ: u(undefined, '') },
7548
+ { json: 'version', js: 'version', typ: u(undefined, '') },
7549
+ ], false),
7550
+ Icon: o([
7551
+ { json: 'size', js: 'size', typ: u(undefined, '') },
7552
+ { json: 'src', js: 'src', typ: '' },
7553
+ { json: 'type', js: 'type', typ: u(undefined, '') },
7554
+ ], false),
7555
+ Image: o([
7556
+ { json: 'label', js: 'label', typ: u(undefined, '') },
7557
+ { json: 'size', js: 'size', typ: u(undefined, '') },
7558
+ { json: 'src', js: 'src', typ: '' },
7559
+ { json: 'type', js: 'type', typ: u(undefined, '') },
7560
+ ], false),
7561
+ FindInstancesBridgeRequestMeta: o([
7562
+ { json: 'destination', js: 'destination', typ: u(undefined, r('DestinationObject')) },
7563
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7564
+ { json: 'source', js: 'source', typ: r('MetaSourceObject') },
7565
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7566
+ ], false),
7567
+ MetaSourceObject: o([
7568
+ { json: 'appId', js: 'appId', typ: u(undefined, '') },
7569
+ { json: 'desktopAgent', js: 'desktopAgent', typ: '' },
7570
+ { json: 'instanceId', js: 'instanceId', typ: u(undefined, '') },
7571
+ ], 'any'),
7572
+ FindIntentAgentRequestMeta: o([
7573
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7574
+ { json: 'source', js: 'source', typ: u(undefined, r('SourceIdentifier')) },
7575
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7576
+ { json: 'destination', js: 'destination', typ: u(undefined, r('BridgeParticipantIdentifier')) },
7577
+ ], false),
7578
+ FindIntentAgentRequestPayload: o([
7579
+ { json: 'context', js: 'context', typ: u(undefined, r('Context')) },
7580
+ { json: 'intent', js: 'intent', typ: '' },
7581
+ { json: 'resultType', js: 'resultType', typ: u(undefined, '') },
7582
+ ], false),
7583
+ IntentMetadata: o([
7584
+ { json: 'displayName', js: 'displayName', typ: u(undefined, '') },
7585
+ { json: 'name', js: 'name', typ: '' },
7586
+ ], false),
7587
+ FindIntentBridgeRequestMeta: o([
7588
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7589
+ { json: 'source', js: 'source', typ: r('BridgeParticipantIdentifier') },
7590
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7591
+ { json: 'destination', js: 'destination', typ: u(undefined, r('BridgeParticipantIdentifier')) },
7592
+ ], false),
7593
+ FindIntentBridgeRequestPayload: o([
7594
+ { json: 'context', js: 'context', typ: u(undefined, r('Context')) },
7595
+ { json: 'intent', js: 'intent', typ: '' },
7596
+ { json: 'resultType', js: 'resultType', typ: u(undefined, '') },
7597
+ ], false),
7598
+ FindIntentBridgeResponseMeta: o([
7599
+ { json: 'errorDetails', js: 'errorDetails', typ: u(undefined, a(r('ResponseErrorDetail'))) },
7600
+ { json: 'errorSources', js: 'errorSources', typ: u(undefined, a(r('DesktopAgentIdentifier'))) },
7601
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7602
+ { json: 'responseUuid', js: 'responseUuid', typ: '' },
7603
+ { json: 'sources', js: 'sources', typ: u(undefined, a(r('DesktopAgentIdentifier'))) },
7604
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7605
+ ], false),
7606
+ FindIntentsByContextAgentRequestMeta: o([
7607
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7608
+ { json: 'source', js: 'source', typ: u(undefined, r('SourceObject')) },
7609
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7610
+ { json: 'destination', js: 'destination', typ: u(undefined, r('BridgeParticipantIdentifier')) },
7611
+ ], false),
7612
+ FindIntentsByContextAgentRequestPayload: o([
7613
+ { json: 'context', js: 'context', typ: r('Context') },
7614
+ { json: 'resultType', js: 'resultType', typ: u(undefined, '') },
7615
+ ], false),
7616
+ FindIntentsByContextBridgeRequestMeta: o([
7617
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7618
+ { json: 'source', js: 'source', typ: r('MetaSource') },
7619
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7620
+ { json: 'destination', js: 'destination', typ: u(undefined, r('BridgeParticipantIdentifier')) },
7621
+ ], false),
7622
+ FindIntentsByContextBridgeRequestPayload: o([
7623
+ { json: 'context', js: 'context', typ: r('Context') },
7624
+ { json: 'resultType', js: 'resultType', typ: u(undefined, '') },
7625
+ ], false),
7626
+ FindIntentsByContextBridgeResponseMeta: o([
7627
+ { json: 'errorDetails', js: 'errorDetails', typ: u(undefined, a(r('ResponseErrorDetail'))) },
7628
+ { json: 'errorSources', js: 'errorSources', typ: u(undefined, a(r('DesktopAgentIdentifier'))) },
7629
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7630
+ { json: 'responseUuid', js: 'responseUuid', typ: '' },
7631
+ { json: 'sources', js: 'sources', typ: u(undefined, a(r('DesktopAgentIdentifier'))) },
7632
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7633
+ ], false),
7634
+ GetAppMetadataAgentRequestMeta: o([
7635
+ { json: 'destination', js: 'destination', typ: u(undefined, r('DestinationObject')) },
7636
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7637
+ { json: 'source', js: 'source', typ: u(undefined, r('SourceIdentifier')) },
7638
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7639
+ ], false),
7640
+ AppObject: o([
7641
+ { json: 'desktopAgent', js: 'desktopAgent', typ: '' },
7642
+ { json: 'appId', js: 'appId', typ: '' },
7643
+ { json: 'instanceId', js: 'instanceId', typ: u(undefined, '') },
7644
+ ], 'any'),
7645
+ GetAppMetadataBridgeRequestMeta: o([
7646
+ { json: 'destination', js: 'destination', typ: u(undefined, r('DestinationObject')) },
7647
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7648
+ { json: 'source', js: 'source', typ: r('MetaSourceObject') },
7649
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7650
+ ], false),
7651
+ GetAppMetadataBridgeResponseMeta: o([
7652
+ { json: 'errorDetails', js: 'errorDetails', typ: u(undefined, a(r('ResponseErrorDetail'))) },
7653
+ { json: 'errorSources', js: 'errorSources', typ: u(undefined, a(r('DesktopAgentIdentifier'))) },
7654
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7655
+ { json: 'responseUuid', js: 'responseUuid', typ: '' },
7656
+ { json: 'sources', js: 'sources', typ: u(undefined, a(r('DesktopAgentIdentifier'))) },
7657
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7658
+ ], false),
7659
+ OpenAgentRequestMeta: o([
7660
+ { json: 'destination', js: 'destination', typ: u(undefined, r('DestinationObject')) },
7661
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7662
+ { json: 'source', js: 'source', typ: r('SourceObject') },
7663
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7664
+ ], false),
7665
+ OpenAgentRequestPayload: o([
7666
+ { json: 'app', js: 'app', typ: r('AppToOpen') },
7667
+ { json: 'context', js: 'context', typ: u(undefined, r('Context')) },
7668
+ ], false),
7669
+ AppToOpen: o([
7670
+ { json: 'desktopAgent', js: 'desktopAgent', typ: '' },
7671
+ { json: 'appId', js: 'appId', typ: '' },
7672
+ { json: 'instanceId', js: 'instanceId', typ: u(undefined, '') },
7673
+ ], 'any'),
7674
+ OpenBridgeRequestMeta: o([
7675
+ { json: 'destination', js: 'destination', typ: u(undefined, r('DestinationObject')) },
7676
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7677
+ { json: 'source', js: 'source', typ: r('MetaSource') },
7678
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7679
+ ], false),
7680
+ OpenBridgeRequestPayload: o([
7681
+ { json: 'app', js: 'app', typ: r('AppToOpen') },
7682
+ { json: 'context', js: 'context', typ: u(undefined, r('Context')) },
7683
+ ], false),
7684
+ OpenBridgeResponseMeta: o([
7685
+ { json: 'errorDetails', js: 'errorDetails', typ: u(undefined, a(r('ResponseErrorDetail'))) },
7686
+ { json: 'errorSources', js: 'errorSources', typ: u(undefined, a(r('DesktopAgentIdentifier'))) },
7687
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7688
+ { json: 'responseUuid', js: 'responseUuid', typ: '' },
7689
+ { json: 'sources', js: 'sources', typ: u(undefined, a(r('DesktopAgentIdentifier'))) },
7690
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7691
+ ], false),
7692
+ PrivateChannelBroadcastAgentRequestMeta: o([
7693
+ { json: 'destination', js: 'destination', typ: u(undefined, r('MetaDestination')) },
7694
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7695
+ { json: 'source', js: 'source', typ: u(undefined, r('SourceObject')) },
7696
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7697
+ ], false),
7698
+ MetaDestination: o([
7699
+ { json: 'desktopAgent', js: 'desktopAgent', typ: '' },
7700
+ { json: 'appId', js: 'appId', typ: '' },
7701
+ { json: 'instanceId', js: 'instanceId', typ: u(undefined, '') },
7702
+ ], 'any'),
7703
+ PrivateChannelBroadcastBridgeRequestMeta: o([
7704
+ { json: 'destination', js: 'destination', typ: u(undefined, r('MetaDestination')) },
7705
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7706
+ { json: 'source', js: 'source', typ: r('MetaSource') },
7707
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7708
+ ], false),
7709
+ PrivateChannelEventListenerAddedAgentRequestMeta: o([
7710
+ { json: 'destination', js: 'destination', typ: u(undefined, r('MetaDestination')) },
7711
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7712
+ { json: 'source', js: 'source', typ: u(undefined, r('SourceObject')) },
7713
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7714
+ ], false),
7715
+ PrivateChannelEventListenerAddedBridgeRequestMeta: o([
7716
+ { json: 'destination', js: 'destination', typ: u(undefined, r('MetaDestination')) },
7717
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7718
+ { json: 'source', js: 'source', typ: r('MetaSource') },
7719
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7720
+ ], false),
7721
+ PrivateChannelEventListenerRemovedAgentRequestMeta: o([
7722
+ { json: 'destination', js: 'destination', typ: u(undefined, r('MetaDestination')) },
7723
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7724
+ { json: 'source', js: 'source', typ: u(undefined, r('SourceObject')) },
7725
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7726
+ ], false),
7727
+ PrivateChannelEventListenerRemovedBridgeRequestMeta: o([
7728
+ { json: 'destination', js: 'destination', typ: u(undefined, r('MetaDestination')) },
7729
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7730
+ { json: 'source', js: 'source', typ: r('MetaSource') },
7731
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7732
+ ], false),
7733
+ PrivateChannelOnAddContextListenerAgentRequestMeta: o([
7734
+ { json: 'destination', js: 'destination', typ: u(undefined, r('MetaDestination')) },
7735
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7736
+ { json: 'source', js: 'source', typ: u(undefined, r('SourceObject')) },
7737
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7738
+ ], false),
7739
+ PrivateChannelOnAddContextListenerAgentRequestPayload: o([
7740
+ { json: 'channelId', js: 'channelId', typ: '' },
7741
+ { json: 'contextType', js: 'contextType', typ: u(null, '') },
7742
+ ], false),
7743
+ PrivateChannelOnAddContextListenerBridgeRequestMeta: o([
7744
+ { json: 'destination', js: 'destination', typ: u(undefined, r('MetaDestination')) },
7745
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7746
+ { json: 'source', js: 'source', typ: r('MetaSource') },
7747
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7748
+ ], false),
7749
+ PrivateChannelOnAddContextListenerBridgeRequestPayload: o([
7750
+ { json: 'channelId', js: 'channelId', typ: '' },
7751
+ { json: 'contextType', js: 'contextType', typ: u(null, '') },
7752
+ ], false),
7753
+ PrivateChannelOnDisconnectAgentRequestMeta: o([
7754
+ { json: 'destination', js: 'destination', typ: u(undefined, r('MetaDestination')) },
7755
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7756
+ { json: 'source', js: 'source', typ: u(undefined, r('SourceObject')) },
7757
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7758
+ ], false),
7759
+ PrivateChannelOnDisconnectBridgeRequestMeta: o([
7760
+ { json: 'destination', js: 'destination', typ: u(undefined, r('MetaDestination')) },
7761
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7762
+ { json: 'source', js: 'source', typ: r('MetaSource') },
7763
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7764
+ ], false),
7765
+ PrivateChannelOnUnsubscribeAgentRequestMeta: o([
7766
+ { json: 'destination', js: 'destination', typ: u(undefined, r('MetaDestination')) },
7767
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7768
+ { json: 'source', js: 'source', typ: u(undefined, r('SourceObject')) },
7769
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7770
+ ], false),
7771
+ PrivateChannelOnUnsubscribeAgentRequestPayload: o([
7772
+ { json: 'channelId', js: 'channelId', typ: '' },
7773
+ { json: 'contextType', js: 'contextType', typ: u(null, '') },
7774
+ ], false),
7775
+ ERequestMetadata: o([
7776
+ { json: 'destination', js: 'destination', typ: u(undefined, r('MetaDestination')) },
7777
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7778
+ { json: 'source', js: 'source', typ: r('MetaSource') },
7779
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7780
+ ], false),
7781
+ PrivateChannelOnUnsubscribeBridgeRequestPayload: o([
7782
+ { json: 'channelId', js: 'channelId', typ: '' },
7783
+ { json: 'contextType', js: 'contextType', typ: u(null, '') },
7784
+ ], false),
7785
+ AppDestinationIdentifier: o([
7786
+ { json: 'desktopAgent', js: 'desktopAgent', typ: '' },
7787
+ { json: 'appId', js: 'appId', typ: '' },
7788
+ { json: 'instanceId', js: 'instanceId', typ: u(undefined, '') },
7789
+ ], 'any'),
7790
+ RaiseIntentBridgeResponseMeta: o([
7791
+ { json: 'errorDetails', js: 'errorDetails', typ: u(undefined, a(r('ResponseErrorDetail'))) },
7792
+ { json: 'errorSources', js: 'errorSources', typ: u(undefined, a(r('DesktopAgentIdentifier'))) },
7793
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7794
+ { json: 'responseUuid', js: 'responseUuid', typ: '' },
7795
+ { json: 'sources', js: 'sources', typ: u(undefined, a(r('DesktopAgentIdentifier'))) },
7796
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7797
+ ], false),
7798
+ IntentResult: o([
7799
+ { json: 'context', js: 'context', typ: u(undefined, r('Context')) },
7800
+ { json: 'channel', js: 'channel', typ: u(undefined, r('Channel')) },
7801
+ ], false),
7802
+ Channel: o([
7803
+ { json: 'displayMetadata', js: 'displayMetadata', typ: u(undefined, r('DisplayMetadata')) },
7804
+ { json: 'id', js: 'id', typ: '' },
7805
+ { json: 'type', js: 'type', typ: r('Type') },
7806
+ ], false),
7807
+ DisplayMetadata: o([
7808
+ { json: 'color', js: 'color', typ: u(undefined, '') },
7809
+ { json: 'glyph', js: 'glyph', typ: u(undefined, '') },
7810
+ { json: 'name', js: 'name', typ: u(undefined, '') },
7811
+ ], false),
7812
+ RaiseIntentResultBridgeResponseMeta: o([
7813
+ { json: 'errorDetails', js: 'errorDetails', typ: u(undefined, a(r('ResponseErrorDetail'))) },
7814
+ { json: 'errorSources', js: 'errorSources', typ: u(undefined, a(r('DesktopAgentIdentifier'))) },
7815
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7816
+ { json: 'responseUuid', js: 'responseUuid', typ: '' },
7817
+ { json: 'sources', js: 'sources', typ: u(undefined, a(r('DesktopAgentIdentifier'))) },
7818
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7819
+ ], false)});
6141
7820
 
6142
7821
  /**
6143
7822
  * SPDX-License-Identifier: Apache-2.0
6144
7823
  * Copyright FINOS FDC3 contributors - see NOTICE file
6145
7824
  */
7825
+ /**
7826
+ * Contains constants representing the errors that can be encountered when trying to connect to a web-based Desktop Agent with the getAgent function.
7827
+ */
7828
+ var AgentError;
7829
+ (function (AgentError) {
7830
+ /** Returned if no Desktop Agent was found by any means available or
7831
+ * if the Agent previously connected to is not contactable on a
7832
+ * subsequent connection attempt.*/
7833
+ AgentError["AgentNotFound"] = "AgentNotFound";
7834
+ /** Returned if validation of the app identity by the Desktop Agent
7835
+ * Failed or the app is not being allowed to connect to the Desktop Agent
7836
+ * for another reason. */
7837
+ AgentError["AccessDenied"] = "AccessDenied";
7838
+ /** Returned if an error or exception occurs while trying to set
7839
+ * up communication with a Desktop Agent. */
7840
+ AgentError["ErrorOnConnect"] = "ErrorOnConnect";
7841
+ /** Returned if the failover function is not a function, or it did not
7842
+ * resolve to one of the allowed types. */
7843
+ AgentError["InvalidFailover"] = "InvalidFailover";
7844
+ /** Returned if an API call rejects after a timeout. Used where an API call
7845
+ * is not aligned to another error enumeration.
7846
+ */
7847
+ AgentError["ApiTimeout"] = "ApiTimeout";
7848
+ })(AgentError || (AgentError = {}));
6146
7849
  /** Constants representing the errors that can be encountered when calling the `open` method on the DesktopAgent object (`fdc3`). */
6147
7850
  var OpenError;
6148
7851
  (function (OpenError) {
@@ -6158,6 +7861,8 @@
6158
7861
  OpenError["MalformedContext"] = "MalformedContext";
6159
7862
  /** @experimental Returned if the specified Desktop Agent is not found, via a connected Desktop Agent Bridge.*/
6160
7863
  OpenError["DesktopAgentNotFound"] = "DesktopAgentNotFound";
7864
+ /** Returned if a timeout occurs before a call to open is resolved for any reason other than the not adding its context listener in time.*/
7865
+ OpenError["ApiTimeout"] = "ApiTimeout";
6161
7866
  })(OpenError || (OpenError = {}));
6162
7867
  /** Constants representing the errors that can be encountered when calling the `findIntent`, `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the DesktopAgent (`fdc3`). */
6163
7868
  var ResolveError;
@@ -6180,6 +7885,8 @@
6180
7885
  ResolveError["MalformedContext"] = "MalformedContext";
6181
7886
  /** @experimental Returned if the specified Desktop Agent is not found, via a connected Desktop Agent Bridge.*/
6182
7887
  ResolveError["DesktopAgentNotFound"] = "DesktopAgentNotFound";
7888
+ /** Returned if a timeout occurs before the API call is resolved for any reason other than the resolver timing out (use ResolverTimeout) or an app launched by a raiseIntent function doesn't add its intent listener in time (use IntentDeliveryFailed).*/
7889
+ ResolveError["ApiTimeout"] = "ApiTimeout";
6183
7890
  })(ResolveError || (ResolveError = {}));
6184
7891
  var ResultError;
6185
7892
  (function (ResultError) {
@@ -6187,6 +7894,8 @@
6187
7894
  ResultError["NoResultReturned"] = "NoResultReturned";
6188
7895
  /** Returned if the Intent handler function processing the raised intent throws an error or rejects the Promise it returned. */
6189
7896
  ResultError["IntentHandlerRejected"] = "IntentHandlerRejected";
7897
+ /** Returned if a timeout occurs before the getResult() API call is resolved.*/
7898
+ ResultError["ApiTimeout"] = "ApiTimeout";
6190
7899
  })(ResultError || (ResultError = {}));
6191
7900
  var ChannelError;
6192
7901
  (function (ChannelError) {
@@ -6198,6 +7907,8 @@
6198
7907
  ChannelError["CreationFailed"] = "CreationFailed";
6199
7908
  /** Returned if a call to the `broadcast` functions is made with an invalid context argument. Contexts should be Objects with at least a `type` field that has a `string` value.*/
6200
7909
  ChannelError["MalformedContext"] = "MalformedContext";
7910
+ /** Returned if a timeout occurs before any Channel related API call is resolved.*/
7911
+ ChannelError["ApiTimeout"] = "ApiTimeout";
6201
7912
  })(ChannelError || (ChannelError = {}));
6202
7913
  var BridgingError;
6203
7914
  (function (BridgingError) {
@@ -6210,28 +7921,51 @@
6210
7921
  /** @experimental Returned if a message to a Bridge deviates from the schema for that message sufficiently that it could not be processed. */
6211
7922
  BridgingError["MalformedMessage"] = "MalformedMessage";
6212
7923
  })(BridgingError || (BridgingError = {}));
6213
-
6214
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
6215
- var e = new Error(message);
6216
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
6217
- };
7924
+
7925
+ /**
7926
+ * Type representing the different log-levels that can be set.
7927
+ */
7928
+ var LogLevel;
7929
+ (function (LogLevel) {
7930
+ LogLevel[LogLevel["NONE"] = 0] = "NONE";
7931
+ LogLevel[LogLevel["ERROR"] = 1] = "ERROR";
7932
+ LogLevel[LogLevel["WARN"] = 2] = "WARN";
7933
+ LogLevel[LogLevel["INFO"] = 3] = "INFO";
7934
+ LogLevel[LogLevel["DEBUG"] = 4] = "DEBUG";
7935
+ })(LogLevel || (LogLevel = {}));
7936
+ /** Enumeration of values used to describe types of web-based
7937
+ * Desktop Agent. Each 'type' refers to the means by which
7938
+ * a connection to the agent is made and/or an interface to it
7939
+ * received. */
7940
+ var WebDesktopAgentType;
7941
+ (function (WebDesktopAgentType) {
7942
+ /** Denotes Desktop Agents that inject the FDC3 interface
7943
+ * at `window.fdc3`. */
7944
+ WebDesktopAgentType["Preload"] = "PRELOAD";
7945
+ /** Denotes Desktop Agents that run (or provide an interface)
7946
+ * within a parent window or frame, a reference to which
7947
+ * will be found at `window.opener`, `window.parent`,
7948
+ * `window.parent.opener` etc. */
7949
+ WebDesktopAgentType["ProxyParent"] = "PROXY_PARENT";
7950
+ /** Denotes Desktop Agents that are connected to by loading a URL
7951
+ * into a hidden iframe whose URL was returned by a parent window
7952
+ * or frame. */
7953
+ WebDesktopAgentType["ProxyUrl"] = "PROXY_URL";
7954
+ /** Denotes a Desktop Agent that was returned by a failover
7955
+ * function that was passed by the application. */
7956
+ WebDesktopAgentType["Failover"] = "FAILOVER";
7957
+ })(WebDesktopAgentType || (WebDesktopAgentType = {}));
6218
7958
 
6219
7959
  /**
6220
7960
  * Ensures at compile time that the given string tuple is exhaustive on a given union type, i.e. contains ALL possible values of the given UNION_TYPE.
6221
7961
  */
6222
- var exhaustiveStringTuple = function () { return function () {
6223
- var tuple = [];
6224
- for (var _i = 0; _i < arguments.length; _i++) {
6225
- tuple[_i] = arguments[_i];
6226
- }
6227
- return tuple;
6228
- }; };
7962
+ const exhaustiveStringTuple = () => (...tuple) => tuple;
6229
7963
 
6230
- var STANDARD_CONTEXT_TYPES = exhaustiveStringTuple()('fdc3.action', 'fdc3.chart', 'fdc3.chat.initSettings', 'fdc3.chat.message', 'fdc3.chat.room', 'fdc3.chat.searchCriteria', 'fdc3.contact', 'fdc3.contactList', 'fdc3.country', 'fdc3.currency', 'fdc3.email', 'fdc3.instrument', 'fdc3.instrumentList', 'fdc3.interaction', 'fdc3.message', 'fdc3.organization', 'fdc3.portfolio', 'fdc3.position', 'fdc3.nothing', 'fdc3.timeRange', 'fdc3.transactionResult', 'fdc3.valuation');
7964
+ const STANDARD_CONTEXT_TYPES = exhaustiveStringTuple()('fdc3.action', 'fdc3.chart', 'fdc3.chat.initSettings', 'fdc3.chat.message', 'fdc3.chat.room', 'fdc3.chat.searchCriteria', 'fdc3.contact', 'fdc3.contactList', 'fdc3.country', 'fdc3.currency', 'fdc3.email', 'fdc3.instrument', 'fdc3.instrumentList', 'fdc3.interaction', 'fdc3.message', 'fdc3.organization', 'fdc3.portfolio', 'fdc3.position', 'fdc3.nothing', 'fdc3.timeRange', 'fdc3.transactionResult', 'fdc3.valuation');
6231
7965
  // used internally to check if a given intent/context is a standard one
6232
7966
  new Set(STANDARD_CONTEXT_TYPES);
6233
7967
 
6234
- var STANDARD_INTENTS = exhaustiveStringTuple()('CreateInteraction', 'SendChatMessage', 'StartCall', 'StartChat', 'StartEmail', 'ViewAnalysis', 'ViewChat', 'ViewChart', 'ViewContact', 'ViewHoldings', 'ViewInstrument', 'ViewInteractions', 'ViewMessages', 'ViewNews', 'ViewOrders', 'ViewProfile', 'ViewQuote', 'ViewResearch');
7968
+ const STANDARD_INTENTS = exhaustiveStringTuple()('CreateInteraction', 'CreateOrUpdateProfile', 'SendChatMessage', 'StartCall', 'StartChat', 'StartEmail', 'ViewAnalysis', 'ViewChat', 'ViewChart', 'ViewContact', 'ViewHoldings', 'ViewInstrument', 'ViewInteractions', 'ViewMessages', 'ViewNews', 'ViewOrders', 'ViewProfile', 'ViewQuote', 'ViewResearch');
6235
7969
  // used internally to check if a given intent/context is a standard one
6236
7970
  new Set(STANDARD_INTENTS);
6237
7971
 
@@ -6275,6 +8009,7 @@
6275
8009
  var Intents;
6276
8010
  (function (Intents) {
6277
8011
  Intents["CreateInteraction"] = "CreateInteraction";
8012
+ Intents["CreateOrUpdateProfile"] = "CreateOrUpdateProfile";
6278
8013
  Intents["SendChatMessage"] = "SendChatMessage";
6279
8014
  Intents["StartCall"] = "StartCall";
6280
8015
  Intents["StartChat"] = "StartChat";
@@ -6294,6 +8029,90 @@
6294
8029
  Intents["ViewResearch"] = "ViewResearch";
6295
8030
  })(Intents || (Intents = {}));
6296
8031
 
8032
+ /* eslint-disable @typescript-eslint/no-explicit-any */
8033
+ //check if color is supported in (node) console;
8034
+ let noColor = true;
8035
+ //else only occurs in a browser and can't be tested in node
8036
+ /* istanbul ignore if */
8037
+ if (typeof process !== 'undefined') {
8038
+ const argv = process.argv || /* istanbul ignore next */ [];
8039
+ const env = process.env || /* istanbul ignore next */ {};
8040
+ noColor =
8041
+ (!!env.NO_COLOR || argv.includes('--no-color')) &&
8042
+ !(!!env.FORCE_COLOR ||
8043
+ argv.includes('--color') ||
8044
+ process.platform === 'win32' /* istanbul ignore next */ ||
8045
+ ((process.stdout || {}).isTTY && env.TERM !== 'dumb') ||
8046
+ /* istanbul ignore next */ !!env.CI);
8047
+ }
8048
+ class AbstractFDC3Logger {
8049
+ /** This should be overridden by sub-classes to set the prefix applied
8050
+ * to log messages. */
8051
+ /* istanbul ignore next */ static get prefix() {
8052
+ return '';
8053
+ }
8054
+ //sub-classes should override this default log level
8055
+ static logLevel = LogLevel.DEBUG;
8056
+ static setLogLevel(level) {
8057
+ if (level in LogLevel) {
8058
+ this.logLevel = level;
8059
+ }
8060
+ else {
8061
+ /* istanbul ignore next */
8062
+ this.error(`Ignoring unrecognized LogLevel '${level}'! Current log level: '${this.logLevel} (${LogLevel[this.logLevel]})'`);
8063
+ }
8064
+ }
8065
+ static debugColor(value) {
8066
+ return noColor ? /* istanbul ignore next */ value : '\x1b[30m\x1b[2m' + value + '\x1b[22m\x1b[39m';
8067
+ }
8068
+ static logColor(value) {
8069
+ return noColor ? /* istanbul ignore next */ value : '\x1b[32m\x1b[2m' + value + '\x1b[22m\x1b[39m';
8070
+ }
8071
+ static warnColor(value) {
8072
+ return noColor ? /* istanbul ignore next */ value : '\x1b[33m' + value + '\x1b[39m';
8073
+ }
8074
+ static errorColor(value) {
8075
+ return noColor ? /* istanbul ignore next */ value : '\x1b[31m' + value + '\x1b[39m';
8076
+ }
8077
+ static debug(...params) {
8078
+ if (this.logLevel >= LogLevel.DEBUG) {
8079
+ console.debug(...this.prefixAndColorize(this.prefix, params, this.debugColor));
8080
+ }
8081
+ }
8082
+ static log(...params) {
8083
+ if (this.logLevel >= LogLevel.INFO) {
8084
+ console.log(...this.prefixAndColorize(this.prefix, params, this.logColor));
8085
+ }
8086
+ }
8087
+ static warn(...params) {
8088
+ if (this.logLevel >= LogLevel.WARN) {
8089
+ console.warn(...this.prefixAndColorize(this.prefix, params, this.warnColor));
8090
+ }
8091
+ }
8092
+ static error(...params) {
8093
+ if (this.logLevel >= LogLevel.ERROR) {
8094
+ console.error(...this.prefixAndColorize(this.prefix, params, this.errorColor));
8095
+ }
8096
+ }
8097
+ static prefixAndColorize = (prefix, params, colorFn) => {
8098
+ const prefixed = [prefix, ...params];
8099
+ return prefixed.map(value => {
8100
+ if (typeof value === 'string') {
8101
+ //just color strings
8102
+ return colorFn(value);
8103
+ }
8104
+ else if (value && value.stack && value.message) {
8105
+ //probably an error
8106
+ return colorFn(value.stack);
8107
+ }
8108
+ else {
8109
+ //something else... lets hope it stringifies
8110
+ return colorFn(JSON.stringify(value, null, 2));
8111
+ }
8112
+ });
8113
+ };
8114
+ }
8115
+
6297
8116
  class DesktopAgent {
6298
8117
  intentsController;
6299
8118
  applicationController;
@@ -6307,6 +8126,7 @@
6307
8126
  const api = {
6308
8127
  getStartupContext: this.getStartupContext.bind(this),
6309
8128
  addContextListener: this.addContextListener.bind(this),
8129
+ addEventListener: this.addEventListener.bind(this),
6310
8130
  addIntentListener: this.addIntentListener.bind(this),
6311
8131
  broadcast: this.broadcast.bind(this),
6312
8132
  createPrivateChannel: this.createPrivateChannel.bind(this),
@@ -6448,6 +8268,13 @@
6448
8268
  async leaveCurrentChannels() {
6449
8269
  return this.channelsController.leave(generateCommandId());
6450
8270
  }
8271
+ async addEventListener(type, handler) {
8272
+ optionalFdc3EventTypesDecoder.runWithException(type);
8273
+ if (typeof handler !== "function") {
8274
+ throw new Error("Please provide the handler as a function!");
8275
+ }
8276
+ return this.channelsController.addEventListener({ commandId: generateCommandId(), type, handler });
8277
+ }
6451
8278
  }
6452
8279
 
6453
8280
  class AppChannel {
@@ -6565,13 +8392,13 @@
6565
8392
  async addContextListener(contextType, handler) {
6566
8393
  if (arguments.length === 1) {
6567
8394
  if (typeof contextType !== "function") {
6568
- throw { message: ChannelError.AccessDenied, reason: `Expected function as an argument, got ${typeof contextType}` };
8395
+ throw new Error(ChannelError.AccessDenied);
6569
8396
  }
6570
8397
  return this.channelsController.addContextListener({ commandId: generateCommandId(), handler: contextType, channelId: this.id });
6571
8398
  }
6572
8399
  const contextTypeDecoder = optionalNonEmptyStringDecoder.runWithException(contextType);
6573
8400
  if (typeof handler !== "function") {
6574
- throw { message: ChannelError.AccessDenied, reason: `Expected function as an argument, got ${typeof handler}` };
8401
+ throw new Error(ChannelError.AccessDenied);
6575
8402
  }
6576
8403
  return this.channelsController.addContextListener({ commandId: generateCommandId(), handler, contextType: contextTypeDecoder, channelId: this.id });
6577
8404
  }
@@ -6602,6 +8429,22 @@
6602
8429
  };
6603
8430
  return subHandler;
6604
8431
  };
8432
+ const parseHandlerToEventHandler = ({ handler, eventType, contextType }) => {
8433
+ const eventHandler = (event) => {
8434
+ const { type, details } = event;
8435
+ if (eventType && type !== eventType) {
8436
+ return;
8437
+ }
8438
+ if (contextType) {
8439
+ if (details.type === contextType) {
8440
+ handler(details, details.metadata);
8441
+ }
8442
+ return;
8443
+ }
8444
+ handler(details, details.metadata);
8445
+ };
8446
+ return eventHandler;
8447
+ };
6605
8448
 
6606
8449
  class IntentsController {
6607
8450
  glueController;
@@ -6639,11 +8482,11 @@
6639
8482
  this.logger?.info(`[${commandId}] - findIntent() invoked for intent ${intent} with contextType ${context?.type} and resultType ${resultType}`);
6640
8483
  const glueIntents = await this.glueController.findIntents({ name: intent });
6641
8484
  if (!glueIntents.length) {
6642
- throw { message: ResolveError.NoAppsFound, reason: `There are no apps handling the passed intent ${intent}` };
8485
+ throw new Error(ResolveError.NoAppsFound);
6643
8486
  }
6644
8487
  const searchedGlueIntent = glueIntents.find((glueIntent) => glueIntent.name === intent);
6645
8488
  if (!searchedGlueIntent) {
6646
- throw { message: ResolveError.NoAppsFound, reason: `There are no apps handling the passed intent ${intent}` };
8489
+ throw new Error(ResolveError.NoAppsFound);
6647
8490
  }
6648
8491
  if (!context && !resultType) {
6649
8492
  return this.convertGlue42IntentToFDC3Intent(searchedGlueIntent);
@@ -6651,7 +8494,7 @@
6651
8494
  const contextType = (context && context.type === fdc3NothingContextType) ? undefined : context?.type;
6652
8495
  const filteredIntent = this.getGlueIntentWithFilteredHandlers(searchedGlueIntent, { contextType, resultType });
6653
8496
  if (!filteredIntent.handlers.length) {
6654
- throw { message: ResolveError.NoAppsFound, reason: `No apps handling intent ${intent} with contextType ${context?.type} and resultType ${resultType}` };
8497
+ throw new Error(ResolveError.NoAppsFound);
6655
8498
  }
6656
8499
  return this.convertGlue42IntentToFDC3Intent(filteredIntent);
6657
8500
  }
@@ -6660,7 +8503,7 @@
6660
8503
  this.logger?.info(`[${commandId}] - findIntentsByContext() invoked for context type ${context.type} and resultType ${resultType}`);
6661
8504
  const glueIntents = await this.glueController.findIntents({ contextType: context.type, resultType });
6662
8505
  if (!glueIntents.length) {
6663
- throw { message: ResolveError.NoAppsFound, reason: `No apps registering intent with contextType ${context.type} ${resultType ? `and resultType ${resultType}` : ""}` };
8506
+ throw new Error(ResolveError.NoAppsFound);
6664
8507
  }
6665
8508
  this.logger?.info(`[${commandId}] - parsing glue intents to fdc3 intents and returning`);
6666
8509
  return glueIntents.map((glueIntent) => {
@@ -6670,11 +8513,12 @@
6670
8513
  }
6671
8514
  async raiseIntent({ commandId, intent, context, target }) {
6672
8515
  await this.glueController.gluePromise;
6673
- this.logger?.info(`[${commandId}] - raiseIntent() invoked for intent ${intent} with contextType: ${context.type} and target: ${target}`);
8516
+ this.logger?.info(`[${commandId}] - raiseIntent() invoked for intent ${intent} with contextType: ${context.type} and target: ${JSON.stringify(target)}`);
6674
8517
  const glueContext = { type: context.type, data: { ...context } };
6675
8518
  const searchedGlueIntent = (await this.glueController.findIntents({ name: intent })).find(glueIntent => glueIntent.name === intent);
8519
+ this.logger?.info(`[${commandId}] - searchedGlueIntent: ${JSON.stringify(searchedGlueIntent)}`);
6676
8520
  if (!searchedGlueIntent) {
6677
- throw { message: ResolveError.NoAppsFound, reason: `There's no app registering an intent '${intent}'` };
8521
+ throw new Error(ResolveError.NoAppsFound);
6678
8522
  }
6679
8523
  if (!target) {
6680
8524
  const filteredGlueIntent = this.filterGlueIntentHandlers({ commandId, intent: searchedGlueIntent, context, target });
@@ -6682,14 +8526,17 @@
6682
8526
  return this.invokeRaiseIntent(commandId, { intent, context: glueContext, handlers: filteredGlueIntent.handlers });
6683
8527
  }
6684
8528
  if (target?.instanceId) {
6685
- this.logger?.info(`[${commandId}] - raising intent ${intent} with contextType ${context.type} to target instance of app ${target.appId} and id ${target.instanceId}`);
6686
- return this.invokeRaiseIntent(commandId, {
6687
- intent,
6688
- context: glueContext,
6689
- target: { instance: target.instanceId }
6690
- });
8529
+ return this.raiseIntentToInstanceTarget({ intent, context: glueContext, target: { instance: target.instanceId } }, searchedGlueIntent.handlers, target, commandId);
6691
8530
  }
6692
8531
  const targetAppName = typeof target === "string" ? target : target.appId;
8532
+ const appHandlersWithAppId = searchedGlueIntent.handlers.filter((handler) => handler.applicationName === targetAppName);
8533
+ if (!appHandlersWithAppId.length) {
8534
+ throw new Error(ResolveError.TargetAppUnavailable);
8535
+ }
8536
+ const appHandlersWithContextType = appHandlersWithAppId.filter((handler) => !handler.instanceId && handler.contextTypes?.includes(context.type));
8537
+ if (!appHandlersWithContextType.length) {
8538
+ throw new Error(ResolveError.NoAppsFound);
8539
+ }
6693
8540
  return this.invokeRaiseIntent(commandId, {
6694
8541
  intent,
6695
8542
  context: glueContext,
@@ -6739,7 +8586,23 @@
6739
8586
  await this.glueController.gluePromise;
6740
8587
  this.logger?.info(`[${commandId}] - addIntentListener() invoked for intent ${intent}`);
6741
8588
  const wrappedHandler = this.getWrappedIntentHandler(handler);
6742
- return this.glueController.addIntentListener(intent, wrappedHandler);
8589
+ const unsub = await this.glueController.addIntentListener(intent, wrappedHandler);
8590
+ return getListenerWithAsyncUnsubscribe(unsub.unsubscribe);
8591
+ }
8592
+ raiseIntentToInstanceTarget(request, glueHandlers, target, commandId) {
8593
+ this.logger?.info(`[${commandId}] - raising intent ${request.intent} with contextType ${request.context?.type} to target instance of app ${target.appId} and id ${target.instanceId}`);
8594
+ const handlersWithSameAppName = glueHandlers.filter((handler) => handler.applicationName === target.appId);
8595
+ const handlersWithSameContext = this.getGlueIntentWithFilteredHandlers({ name: request.intent, handlers: handlersWithSameAppName }, { contextType: request.context?.type }).handlers;
8596
+ if (!handlersWithSameContext.length) {
8597
+ this.logger?.info(`[${commandId}] - No handlers found for intent ${request.intent} with appName ${target.appId} and contextType ${request.context?.type}`);
8598
+ throw new Error(ResolveError.NoAppsFound);
8599
+ }
8600
+ const isValidInstanceHandler = handlersWithSameContext.find((handler) => handler.instanceId === target.instanceId);
8601
+ if (!isValidInstanceHandler) {
8602
+ this.logger?.info(`[${commandId}] - There's no instance with id ${target.instanceId} of the passed app ${target.appId}`);
8603
+ throw new Error(ResolveError.TargetInstanceUnavailable);
8604
+ }
8605
+ return this.invokeRaiseIntent(commandId, request);
6743
8606
  }
6744
8607
  async checkForRememberedIntentHandlerForContext(contextType) {
6745
8608
  let prefs;
@@ -6782,12 +8645,12 @@
6782
8645
  const app = this.glueController.getApplication(appName);
6783
8646
  const serverInstances = this.serverInstanceAsIntentHandler(intent.name);
6784
8647
  if (!app && (typeof target === "string" || !target.instanceId || !serverInstances.length)) {
6785
- throw { message: ResolveError.TargetAppUnavailable, reason: `There's no app with appId ${appName}` };
8648
+ throw new Error(ResolveError.TargetAppUnavailable);
6786
8649
  }
6787
8650
  this.logger?.info(`[${commandId}] - target app ${appName} found. Filtering handlers by applicationName: ${appName}`);
6788
8651
  const validHandlersByApplicationName = intent.handlers.filter((handler) => handler.applicationName === appName);
6789
8652
  if (!validHandlersByApplicationName.length) {
6790
- throw { message: ResolveError.NoAppsFound, reason: `Intent ${intent.name} exists but there's no app with appId ${appName} registering it` };
8653
+ throw new Error(ResolveError.NoAppsFound);
6791
8654
  }
6792
8655
  if (!instanceId) {
6793
8656
  this.logger?.log(`[${commandId}] - returning all handlers for intent ${intent.name} and target: ${JSON.stringify(target)}`);
@@ -6797,12 +8660,12 @@
6797
8660
  ? app.instances.find((inst) => inst.id === instanceId)
6798
8661
  : serverInstances.find((inst) => inst.instance === instanceId);
6799
8662
  if (!isValidInstanceOfTheApp) {
6800
- throw { message: ResolveError.TargetInstanceUnavailable, reason: `There's no instance with id ${instanceId} of the passed app ${appName}` };
8663
+ throw new Error(ResolveError.TargetInstanceUnavailable);
6801
8664
  }
6802
8665
  this.logger?.info(`[${commandId}] - Filtering handlers by instanceId: ${instanceId}`);
6803
8666
  const validHandlersByInstanceId = validHandlersByApplicationName.filter((handler) => handler.instanceId === instanceId);
6804
8667
  if (!validHandlersByInstanceId.length) {
6805
- throw { message: ResolveError.IntentDeliveryFailed, reason: `There's no instance with id ${instanceId} of app ${appName} registering intent ${intent.name}` };
8668
+ throw new Error(ResolveError.IntentDeliveryFailed);
6806
8669
  }
6807
8670
  return { name: intent.name, handlers: validHandlersByInstanceId };
6808
8671
  }
@@ -6814,7 +8677,7 @@
6814
8677
  filterIntentHandlersByContext(intent, context) {
6815
8678
  const filteredGlueIntent = this.getGlueIntentWithFilteredHandlers(intent, { contextType: context.type });
6816
8679
  if (!filteredGlueIntent.handlers.length) {
6817
- throw { message: ResolveError.NoAppsFound, reason: `There's no app registering an intent with the passed context type ${context.type}` };
8680
+ throw new Error(ResolveError.NoAppsFound);
6818
8681
  }
6819
8682
  return filteredGlueIntent;
6820
8683
  }
@@ -6866,15 +8729,17 @@
6866
8729
  apps: handlers.map((handler) => {
6867
8730
  const appName = handler.applicationName;
6868
8731
  const app = this.glueController.getApplication(appName);
8732
+ const icons = (handler.applicationIcon ? [handler.applicationIcon, ...(app?.userProperties.icons ?? [])] : (app?.userProperties.icons ?? [])).filter((icon) => !!icon).map((icon) => ({ src: icon }));
8733
+ const images = (app?.userProperties.images ?? []).filter((image) => !!image).map((image) => ({ src: image }));
6869
8734
  return {
6870
8735
  appId: appName,
6871
8736
  instanceId: handler.instanceId,
6872
8737
  name: appName,
6873
8738
  title: handler.applicationTitle || handler.instanceTitle || appName,
6874
- tooltip: app?.userProperties.tooltip || `${appName} (${handler.type})`,
8739
+ tooltip: app?.userProperties.tooltip ?? `${appName} (${handler.type})`,
6875
8740
  description: handler.applicationDescription,
6876
- icons: handler.applicationIcon ? [handler.applicationIcon, ...(app?.userProperties.icons || [])] : app?.userProperties.icons,
6877
- images: app?.userProperties.images,
8741
+ icons,
8742
+ images,
6878
8743
  resultType: handler.resultType
6879
8744
  };
6880
8745
  })
@@ -6936,8 +8801,9 @@
6936
8801
  return { name, handlers: filteredHandlers };
6937
8802
  }
6938
8803
  async invokeRaiseIntent(commandId, request) {
8804
+ const inBrowser = this.glueController.isRunningInBrowser();
6939
8805
  try {
6940
- const glueIntentResult = await this.glueController.raiseIntent({ ...request, timeout: RaiseTimeoutMs });
8806
+ const glueIntentResult = await this.glueController.raiseIntent({ ...request, timeout: RaiseTimeoutMs, options: { waitForAGMReady: !inBrowser } });
6941
8807
  return {
6942
8808
  source: {
6943
8809
  appId: glueIntentResult.handler.applicationName,
@@ -6948,7 +8814,7 @@
6948
8814
  };
6949
8815
  }
6950
8816
  catch (error) {
6951
- throw this.parseIoToFdc3Error(error);
8817
+ throw new Error(this.parseIoToFdc3Error(error).message);
6952
8818
  }
6953
8819
  }
6954
8820
  parseIoToFdc3Error(error) {
@@ -6962,10 +8828,7 @@
6962
8828
  this.logger?.info(`[${commandId}] - raiseIntentForContext() invoked with contextType ${context.type} and target ${target}`);
6963
8829
  const appIntents = await this.findIntentsByContext({ commandId, context });
6964
8830
  if (!appIntents || appIntents.length === 0) {
6965
- throw {
6966
- message: ResolveError.NoAppsFound,
6967
- reason: `No apps registering intent with contextType ${context.type} ${target ? `and target ${JSON.stringify(target)}` : ""}`
6968
- };
8831
+ throw new Error(ResolveError.NoAppsFound);
6969
8832
  }
6970
8833
  return this.raiseIntent({ commandId, intent: appIntents[0].intent.name, context, target });
6971
8834
  }
@@ -6990,50 +8853,51 @@
6990
8853
  }
6991
8854
  async open({ commandId, target, context }) {
6992
8855
  await this.glueController.gluePromise;
6993
- this.logger?.log(`[${commandId}] - open() invoked with target ${target} ${context ? `and contextType ${context.type}` : ""}`);
8856
+ this.logger?.log(`[${commandId}] - open() invoked with target ${JSON.stringify(target)} ${context ? `and contextType ${context.type}` : ""}`);
6994
8857
  const name = typeof target === "object" ? target.appId : target;
6995
8858
  const app = this.glueController.getApplication(name);
6996
8859
  if (!app) {
6997
- throw { message: OpenError.AppNotFound, reason: `Cannot find targeted ${name} application` };
8860
+ throw new Error(OpenError.AppNotFound);
6998
8861
  }
6999
8862
  if (context) {
7000
8863
  await this.glueEventsController.initializeCollaborateMethod();
7001
- this.logger?.info(`[${commandId}] - opening app ${app} with startup context`);
8864
+ this.logger?.info(`[${commandId}] - opening app '${app.name}' with startup context`);
7002
8865
  return this.openAppWithContext(app, context);
7003
8866
  }
7004
8867
  try {
7005
- this.logger?.info(`[${commandId}] - opening app ${app}`);
7006
- const glueInst = await app.start();
8868
+ this.logger?.info(`[${commandId}] - opening app '${app.name}' without context`);
8869
+ const inBrowser = this.glueController.isRunningInBrowser();
8870
+ const glueInst = await app.start(undefined, { waitForAGMReady: !inBrowser });
7007
8871
  this.logger?.info(`[${commandId}] - instance with id ${glueInst.id} started`);
7008
8872
  return this.parseGlueInstToAppIdentifier(glueInst);
7009
8873
  }
7010
8874
  catch (error) {
7011
- throw { message: OpenError.ErrorOnLaunch, reason: typeof error === "string" ? error : JSON.stringify(error) };
8875
+ throw new Error(OpenError.ErrorOnLaunch);
7012
8876
  }
7013
8877
  }
7014
8878
  async findInstances({ commandId, appIdentifier }) {
7015
8879
  await this.glueController.gluePromise;
7016
- this.logger?.info(`[${commandId}] - findInstances() invoked with appIdentifier ${appIdentifier}`);
8880
+ this.logger?.info(`[${commandId}] - findInstances() invoked with appIdentifier ${JSON.stringify(appIdentifier)}`);
7017
8881
  const { appId } = appIdentifier;
7018
8882
  const app = this.glueController.getApplication(appId);
7019
8883
  if (!app) {
7020
- throw { message: ResolveError.NoAppsFound, reason: `App with appId: ${appId} does not exist` };
8884
+ throw new Error(ResolveError.NoAppsFound);
7021
8885
  }
7022
8886
  const glueInstances = this.glueController.getApplicationInstances(appId);
7023
8887
  const fdc3Instances = glueInstances.map(glueInst => this.parseGlueInstToAppIdentifier(glueInst));
7024
- this.logger?.info(`[${commandId}] - ids of opened instances for appIdentifier ${appIdentifier}: ${JSON.stringify(fdc3Instances.map(inst => inst.instanceId))}`);
8888
+ this.logger?.info(`[${commandId}] - ids of opened instances for appIdentifier ${JSON.stringify(appIdentifier)}: ${JSON.stringify(fdc3Instances.map(inst => inst.instanceId))}`);
7025
8889
  return fdc3Instances;
7026
8890
  }
7027
8891
  async getAppMetadata({ commandId, appIdentifier }) {
7028
8892
  await this.glueController.gluePromise;
7029
- this.logger?.info(`[${commandId}] - getAppMetadata() invoked with appIdentifier ${appIdentifier}`);
8893
+ this.logger?.info(`[${commandId}] - getAppMetadata() invoked with appIdentifier ${JSON.stringify(appIdentifier)}`);
7030
8894
  const { appId, instanceId } = appIdentifier;
7031
8895
  const app = this.glueController.getApplication(appId);
7032
8896
  if (!app) {
7033
- throw { message: OpenError.AppNotFound, reason: `Cannot find application with appId: ${appId}` };
8897
+ throw new Error(OpenError.AppNotFound);
7034
8898
  }
7035
8899
  if (!instanceId) {
7036
- this.logger?.info(`[${commandId}] - no opened instances found. Parsing app ${app}`);
8900
+ this.logger?.info(`[${commandId}] - no opened instances found. Parsing app ${app.name}`);
7037
8901
  return this.parseGlueAppToAppMetadata(app);
7038
8902
  }
7039
8903
  const instance = this.glueController.getAppInstanceById(instanceId);
@@ -7044,8 +8908,9 @@
7044
8908
  async getInfo({ commandId }) {
7045
8909
  await this.glueController.gluePromise;
7046
8910
  this.logger?.info(`${commandId} - getInfo() invoked`);
7047
- const appMetadata = await this.getCurrentAppMetadata();
7048
- const { provider, providerVersion, standardVersion } = window.fdc3Info;
8911
+ const appMetadata = this.getCurrentAppMetadata();
8912
+ const globalScope = typeof process !== "undefined" ? process : window;
8913
+ const { provider, providerVersion, standardVersion } = globalScope.fdc3Info;
7049
8914
  return {
7050
8915
  provider,
7051
8916
  providerVersion,
@@ -7060,10 +8925,13 @@
7060
8925
  }
7061
8926
  getCurrentAppMetadata() {
7062
8927
  const myInstance = this.glueController.interopInstance();
7063
- return Promise.resolve({
7064
- appId: myInstance.applicationName,
7065
- instanceId: myInstance.instance
7066
- });
8928
+ const myInstanceApplicationName = myInstance.application ?? myInstance.applicationName;
8929
+ const myApp = this.glueController.getApplication(myInstanceApplicationName);
8930
+ if (myApp) {
8931
+ return { appId: myApp.name, instanceId: myInstance.instance };
8932
+ }
8933
+ this.logger?.info(`No application found with name ${myInstanceApplicationName} probably because it's an iframe.`);
8934
+ return { appId: myInstanceApplicationName, instanceId: myInstance.instance };
7067
8935
  }
7068
8936
  parseGlueInstToAppIdentifier(glueInst) {
7069
8937
  return {
@@ -7079,13 +8947,13 @@
7079
8947
  return this.addInstanceMetadataToAppMetadata(appMetadata, instance);
7080
8948
  }
7081
8949
  async getBaseGlueAppToAppMetadata(app) {
7082
- const desktopGlobal = window.glue42gd || window.iodesktop;
7083
- const appConfiguration = desktopGlobal
7084
- ? await app.getConfiguration()
7085
- : app.userProperties;
7086
- const icon = desktopGlobal
7087
- ? (await app.getConfiguration()).icon
7088
- : app.icon;
8950
+ const inBrowserNamespace = this.glueController.isRunningInBrowser();
8951
+ const appConfiguration = inBrowserNamespace
8952
+ ? app.userProperties
8953
+ : await app.getConfiguration();
8954
+ const icon = inBrowserNamespace
8955
+ ? app.icon
8956
+ : (await app.getConfiguration()).icon;
7089
8957
  return {
7090
8958
  appId: app.name,
7091
8959
  name: app.name,
@@ -7094,9 +8962,9 @@
7094
8962
  title: app.title,
7095
8963
  icons: icon ? [{ src: icon }] : [],
7096
8964
  tooltip: appConfiguration.tooltip,
7097
- screenshots: desktopGlobal
7098
- ? appConfiguration.customProperties.screenshots
7099
- : appConfiguration.screenshots
8965
+ screenshots: inBrowserNamespace
8966
+ ? appConfiguration.screenshots
8967
+ : appConfiguration.customProperties.screenshots
7100
8968
  };
7101
8969
  }
7102
8970
  addInstanceMetadataToAppMetadata(appMetadata, instance) {
@@ -7107,24 +8975,26 @@
7107
8975
  const startContext = this.buildStartContext(context, guid);
7108
8976
  const wrappedPromise = this.createContextListenerWrappedPromise(app);
7109
8977
  this.appsStateStore.addOpenAppPromise(guid, wrappedPromise);
8978
+ const inBrowser = this.glueController.isRunningInBrowser();
7110
8979
  try {
7111
- const glueInst = await app.start(startContext);
8980
+ const glueInst = await app.start(startContext, { waitForAGMReady: !inBrowser });
7112
8981
  await wrappedPromise.promise;
7113
8982
  this.appsStateStore.removeOpenAppPromise(guid);
7114
8983
  return this.parseGlueInstToAppIdentifier(glueInst);
7115
8984
  }
7116
8985
  catch (error) {
7117
8986
  this.appsStateStore.removeOpenAppPromise(guid);
7118
- throw { message: OpenError.AppTimeout, reason: typeof error === "string" ? error : JSON.stringify(error) };
8987
+ throw new Error(OpenError.AppTimeout);
7119
8988
  }
7120
8989
  }
7121
8990
  buildStartContext(fdc3Context, guid) {
7122
8991
  const myInteropInstance = this.glueController.getMyInteropInstance();
8992
+ const appId = myInteropInstance.application || myInteropInstance.applicationName || "";
7123
8993
  return {
7124
8994
  fdc3: {
7125
8995
  collaborationId: guid,
7126
8996
  openApp: {
7127
- appId: myInteropInstance.application || myInteropInstance.applicationName || "",
8997
+ appId,
7128
8998
  instanceId: myInteropInstance.instance
7129
8999
  },
7130
9000
  context: {
@@ -7147,7 +9017,7 @@
7147
9017
  }
7148
9018
  }
7149
9019
 
7150
- class EventReceiver {
9020
+ class WebEventReceiver {
7151
9021
  glueController;
7152
9022
  eventDispatcher;
7153
9023
  glueResponseReceived = false;
@@ -7174,7 +9044,7 @@
7174
9044
  }
7175
9045
  glueReceiverHandler(event) {
7176
9046
  const data = event.detail;
7177
- if (!data || !data.glue42) {
9047
+ if (!data?.glue42) {
7178
9048
  return;
7179
9049
  }
7180
9050
  const glue42Event = data.glue42.event;
@@ -7358,7 +9228,8 @@
7358
9228
  this.isCreator = isCreator;
7359
9229
  this.id = channelId;
7360
9230
  const myServerInstance = this.channelsController.getMyServerInstance();
7361
- this.myAppMetadata = { source: { appId: myServerInstance.applicationName, instanceId: myServerInstance.instance } };
9231
+ const myAppId = myServerInstance.application || myServerInstance.applicationName;
9232
+ this.myAppMetadata = { source: { appId: myAppId, instanceId: myServerInstance.instance } };
7362
9233
  }
7363
9234
  toApi() {
7364
9235
  const api = {
@@ -7368,10 +9239,11 @@
7368
9239
  broadcast: this.broadcast.bind(this),
7369
9240
  getCurrentContext: this.getCurrentContext.bind(this),
7370
9241
  addContextListener: this.addContextListener.bind(this),
7371
- onAddContextListener: this.onAddContextListener.bind(this),
7372
- onUnsubscribe: this.onUnsubscribe.bind(this),
7373
- onDisconnect: this.onDisconnect.bind(this),
9242
+ onAddContextListener: this.legacyOnAddContextListener.bind(this),
9243
+ onUnsubscribe: this.legacyOnUnsubscribe.bind(this),
9244
+ onDisconnect: this.legacyOnDisconnect.bind(this),
7374
9245
  disconnect: this.disconnect.bind(this),
9246
+ addEventListener: this.addEventListener.bind(this),
7375
9247
  };
7376
9248
  return api;
7377
9249
  }
@@ -7387,54 +9259,62 @@
7387
9259
  }
7388
9260
  async handleCollaboratorJoin(collaborator, commandId) {
7389
9261
  this.setCollaborator(collaborator, commandId);
7390
- await Promise.all(this.myListenerTypesBeforeBound.map((contextType) => {
7391
- const listenerAddedArgs = {
7392
- action: "addedContextListenerOnPrivateChannel",
7393
- correlationId: this.id,
7394
- collaborationObject: {
7395
- channelId: this.id,
7396
- contextType: contextType || undefined
7397
- }
7398
- };
7399
- this.logger?.trace(`[${commandId}] - announcing ${"addedContextListenerOnPrivateChannel"} to collaborator ${JSON.stringify(this.collaborator)}`);
7400
- return this.channelsController.invokeSystemMethod(listenerAddedArgs, this.collaborator?.instanceId);
7401
- })).catch((err) => this.logger?.error(err));
9262
+ await Promise.all(this.myListenerTypesBeforeBound.map((contextType) => this.sendCollaborateMessage({ action: "addedContextListenerOnPrivateChannel", contextType }))).catch((err) => this.logger?.error(err));
7402
9263
  }
7403
9264
  handleCollaboratorBroadcast(context, metadata, commandId) {
7404
9265
  this.logger?.trace(`[${commandId}] - heard context with type ${context.type} broadcasted on the channel`);
7405
9266
  this.lastBroadcastedContextType = context.type;
7406
9267
  this.broadcastedContexts[context.type] = { context, metadata };
7407
9268
  this.logger?.trace(`[${commandId}] - invoking all context listeners`);
7408
- this.registry.execute(PrivateChannelEventMethods.ListenerAdded, context, metadata);
9269
+ this.executeCollaboratorBroadcastEvents(context, metadata);
7409
9270
  }
7410
9271
  handleCollaboratorAddContextListener(contextType, commandId) {
7411
9272
  this.logger?.trace(`[${commandId}] - heard collaborator added context listener for type ${contextType}`);
7412
9273
  this.collaboratorListenerTypes.push(contextType);
7413
- this.registry.execute(PrivateChannelEventMethods.OnAddContextListener, contextType);
9274
+ this.executeCollaboratorAddContextListenerEvents(contextType);
7414
9275
  }
7415
9276
  handleCollaboratorRemovedListener(contextType, commandId) {
7416
9277
  this.logger?.trace(`[${commandId}] - heard collaborator removed context listener with type ${contextType}`);
7417
- const index = this.collaboratorListenerTypes.indexOf(contextType);
7418
- this.collaboratorListenerTypes.splice(index, 1);
7419
- this.registry.execute(PrivateChannelEventMethods.OnUnsubscribe, contextType);
9278
+ this.collaboratorListenerTypes.splice(this.collaboratorListenerTypes.indexOf(contextType), 1);
9279
+ this.executeCollaboratorUnsubscribeEvents(contextType);
7420
9280
  }
7421
9281
  handleCollaboratorDisconnect() {
7422
9282
  this.disconnected = true;
7423
- this.collaboratorListenerTypes.forEach((contextType) => this.registry.execute(PrivateChannelEventMethods.OnUnsubscribe, contextType));
7424
- this.registry.execute(PrivateChannelEventMethods.OnDisconnect);
9283
+ this.executeCollaboratorDisconnectEvents();
7425
9284
  }
7426
9285
  async announceJoin(targetInstance, commandId) {
7427
- const joinChannelArgs = {
7428
- action: "joinPrivateChannel",
7429
- correlationId: this.id,
7430
- collaborationObject: {
7431
- channelId: this.id
7432
- }
7433
- };
7434
- this.logger?.trace(`[${commandId}] - announcing ${"joinPrivateChannel"} to target instance with id ${JSON.stringify(targetInstance)}`);
7435
- await this.channelsController.invokeSystemMethod(joinChannelArgs, targetInstance);
9286
+ await this.sendCollaborateMessage({ action: "joinPrivateChannel" });
7436
9287
  this.logger?.trace(`[${commandId}] - collaborator received ${"joinPrivateChannel"} action`);
7437
9288
  }
9289
+ async addEventListener(type, handler) {
9290
+ const decodedType = optionalPrivateChannelEventTypesDecoder.run(type);
9291
+ if (!decodedType.ok) {
9292
+ this.logger?.error(`Expected first argument 'type' as one of ${Object.values(NewPrivateChannelEventMethods).join(", ")}, got ${type}`);
9293
+ throw new Error(ChannelError.AccessDenied);
9294
+ }
9295
+ if (typeof handler !== "function") {
9296
+ this.logger?.error(`Expected function as an argument, got ${typeof handler}`);
9297
+ throw new Error(ChannelError.AccessDenied);
9298
+ }
9299
+ const commandId = generateCommandId();
9300
+ this.ensureAlive(commandId);
9301
+ this.logger?.trace(`[${commandId}] - adding event listener for type ${type}`);
9302
+ return this.addEventListenerByEventType(type, handler);
9303
+ }
9304
+ addEventListenerByEventType(type, handler) {
9305
+ const replayArgs = type === "addContextListener"
9306
+ ? this.collaboratorListenerTypes.map((contextType) => ({ type: NewPrivateChannelEventMethods.AddContextListener, details: { contextType } }))
9307
+ : undefined;
9308
+ if (type) {
9309
+ const unsubscribe = this.registry.add(type, handler, replayArgs);
9310
+ return getListenerWithAsyncUnsubscribe(unsubscribe);
9311
+ }
9312
+ const addContextListener = this.addEventListenerByEventType("addContextListener", handler);
9313
+ const unsubscribeListener = this.addEventListenerByEventType("unsubscribe", handler);
9314
+ const disconnectListener = this.addEventListenerByEventType("disconnect", handler);
9315
+ const unsubscribe = () => [addContextListener, unsubscribeListener, disconnectListener].forEach((listener) => listener.unsubscribe());
9316
+ return getListenerWithAsyncUnsubscribe(unsubscribe);
9317
+ }
7438
9318
  async broadcast(context) {
7439
9319
  const contextDecoderResult = contextDecoder.run(context);
7440
9320
  if (!contextDecoderResult.ok) {
@@ -7445,17 +9325,7 @@
7445
9325
  this.ensureBound(commandId, "broadcast");
7446
9326
  this.lastBroadcastedContextType = context.type;
7447
9327
  this.broadcastedContexts[context.type] = { context, metadata: this.myAppMetadata };
7448
- const broadcastArgs = {
7449
- action: "publishOnPrivateChannel",
7450
- correlationId: this.id,
7451
- collaborationObject: {
7452
- channelId: this.id,
7453
- contextType: context.type,
7454
- payload: context
7455
- }
7456
- };
7457
- this.logger?.trace(`[${commandId}] - announcing ${"publishOnPrivateChannel"} to collaborator ${JSON.stringify(this.collaborator)}`);
7458
- await this.channelsController.invokeSystemMethod(broadcastArgs, this.collaborator?.instanceId);
9328
+ this.sendCollaborateMessage({ action: "publishOnPrivateChannel", contextType: context.type, payload: context });
7459
9329
  this.logger?.trace(`[${commandId}] - collaborator received context for action ${"publishOnPrivateChannel"}`);
7460
9330
  }
7461
9331
  async getCurrentContext(contextType) {
@@ -7467,7 +9337,10 @@
7467
9337
  if (!contextType && !this.lastBroadcastedContextType) {
7468
9338
  return null;
7469
9339
  }
7470
- const searchedType = contextType || this.lastBroadcastedContextType;
9340
+ const searchedType = contextType ?? this.lastBroadcastedContextType;
9341
+ if (!searchedType) {
9342
+ throw new Error("No context type specified and no last broadcasted context available");
9343
+ }
7471
9344
  this.logger?.trace(`[${commandId}] - Returning context with type ${searchedType}`);
7472
9345
  return this.broadcastedContexts[searchedType].context;
7473
9346
  }
@@ -7476,51 +9349,42 @@
7476
9349
  this.ensureAlive(commandId);
7477
9350
  optionalNonEmptyStringDecoder.runWithException(contextType);
7478
9351
  if (typeof handler !== "function") {
7479
- throw { message: ChannelError.AccessDenied, reason: `Expected function as an argument, got ${typeof contextType}` };
9352
+ throw new Error(ChannelError.AccessDenied);
7480
9353
  }
7481
9354
  this.logger?.trace(`[${commandId}] - adding subscription for broadcasted contexts with type: ${contextType}`);
7482
- const subHandler = (data, metadata) => {
7483
- if (contextType) {
7484
- if (data.type === contextType) {
7485
- handler(data, metadata);
7486
- }
7487
- return;
7488
- }
7489
- handler(data, metadata);
7490
- };
7491
- const lastBroadcastedContextPerType = this.retrieveLatestBroadcastedContextPerType(contextType);
7492
- const replayArgs = lastBroadcastedContextPerType ? [[lastBroadcastedContextPerType.context, lastBroadcastedContextPerType.metadata]] : undefined;
7493
- const unsub = this.registry.add(PrivateChannelEventMethods.ListenerAdded, subHandler, replayArgs);
9355
+ const unsub = this.addContextListenerInRegistry(contextType, handler);
7494
9356
  if (!this.collaborator) {
7495
9357
  this.myListenerTypesBeforeBound.push(contextType);
7496
9358
  const unsubscribe = this.getAddContextListenerUnsub(unsub, contextType, commandId);
7497
- return AsyncListener(unsubscribe);
9359
+ return { unsubscribe };
7498
9360
  }
7499
- const listenerAddedArgs = {
7500
- action: "addedContextListenerOnPrivateChannel",
7501
- correlationId: this.id,
7502
- collaborationObject: {
7503
- channelId: this.id,
7504
- contextType: contextType || undefined
7505
- }
7506
- };
7507
- this.logger?.trace(`[${commandId}] - announcing ${"addedContextListenerOnPrivateChannel"} to collaborator ${JSON.stringify(this.collaborator)}`);
7508
- await this.channelsController.invokeSystemMethod(listenerAddedArgs, this.collaborator?.instanceId);
9361
+ await this.sendCollaborateMessage({ action: "addedContextListenerOnPrivateChannel", contextType });
7509
9362
  this.logger?.trace(`[${commandId}] - collaborator received action ${"addedContextListenerOnPrivateChannel"}`);
7510
9363
  const unsubscribe = this.getAddContextListenerUnsub(unsub, contextType, commandId);
7511
- return AsyncListener(unsubscribe);
9364
+ return { unsubscribe };
7512
9365
  }
9366
+ addContextListenerInRegistry = (contextType, handler) => {
9367
+ const legacySubHandler = parseContextHandler(handler, contextType);
9368
+ const lastBroadcastedContextPerType = this.retrieveLatestBroadcastedContextPerType(contextType);
9369
+ const legacyReplayArgs = lastBroadcastedContextPerType ? [[lastBroadcastedContextPerType.context, lastBroadcastedContextPerType.metadata]] : undefined;
9370
+ const legacyUnsub = this.registry.add(LegacyPrivateChannelEventMethods.ListenerAdded, legacySubHandler, legacyReplayArgs);
9371
+ const replayArgs = lastBroadcastedContextPerType ? [{ type: NewPrivateChannelEventMethods.ContextListenerAdded, details: { contextType: lastBroadcastedContextPerType.context.type, metadata: lastBroadcastedContextPerType.metadata } }] : undefined;
9372
+ const subHandler = parseHandlerToEventHandler({ handler, eventType: NewPrivateChannelEventMethods.ContextListenerAdded, contextType });
9373
+ const newUnsub = this.registry.add(NewPrivateChannelEventMethods.ContextListenerAdded, subHandler, replayArgs);
9374
+ const unsub = () => {
9375
+ legacyUnsub();
9376
+ newUnsub();
9377
+ };
9378
+ return unsub;
9379
+ };
7513
9380
  retrieveLatestBroadcastedContextPerType(contextType) {
7514
- if (!contextType && !this.lastBroadcastedContextType) {
7515
- return;
9381
+ if (contextType) {
9382
+ return this.broadcastedContexts[contextType];
7516
9383
  }
7517
- if (!contextType && this.lastBroadcastedContextType) {
7518
- return {
7519
- context: this.broadcastedContexts[this.lastBroadcastedContextType].context,
7520
- metadata: this.broadcastedContexts[this.lastBroadcastedContextType].metadata
7521
- };
9384
+ if (!this.lastBroadcastedContextType) {
9385
+ return;
7522
9386
  }
7523
- return this.broadcastedContexts[contextType];
9387
+ return this.broadcastedContexts[this.lastBroadcastedContextType];
7524
9388
  }
7525
9389
  getAddContextListenerUnsub(unsub, contextType, commandId) {
7526
9390
  return async () => {
@@ -7530,45 +9394,36 @@
7530
9394
  this.myListenerTypesBeforeBound.splice(index, 1);
7531
9395
  return;
7532
9396
  }
7533
- const unsubArgs = {
7534
- action: "removedContextListenerOnPrivateChannel",
7535
- correlationId: this.id,
7536
- collaborationObject: {
7537
- channelId: this.id,
7538
- contextType: contextType || undefined
7539
- }
7540
- };
7541
- this.logger?.trace(`[${commandId}] - announcing unsubscribe from context listener for type ${contextType}`);
7542
- await this.channelsController.invokeSystemMethod(unsubArgs, this.collaborator?.instanceId);
9397
+ await this.sendCollaborateMessage({ action: "removedContextListenerOnPrivateChannel", contextType });
7543
9398
  this.logger?.trace(`[${commandId}] - collaborator heard ${"removedContextListenerOnPrivateChannel"}`);
7544
9399
  };
7545
9400
  }
7546
- onAddContextListener(handler) {
9401
+ legacyOnAddContextListener(handler) {
7547
9402
  if (typeof handler !== "function") {
7548
- throw { message: ChannelError.AccessDenied, reason: `Expected function as an argument, got ${typeof handler}` };
9403
+ throw new Error(ChannelError.AccessDenied);
7549
9404
  }
7550
9405
  const commandId = generateCommandId();
7551
9406
  this.ensureAlive(commandId);
7552
- const unsub = this.registry.add(PrivateChannelEventMethods.OnAddContextListener, handler, this.collaboratorListenerTypes);
7553
- return AsyncListener(unsub);
9407
+ const unsub = this.registry.add(LegacyPrivateChannelEventMethods.OnAddContextListener, handler, this.collaboratorListenerTypes);
9408
+ return getListenerWithAsyncUnsubscribe(unsub);
7554
9409
  }
7555
- onUnsubscribe(handler) {
9410
+ legacyOnUnsubscribe(handler) {
7556
9411
  if (typeof handler !== "function") {
7557
- throw { message: ChannelError.AccessDenied, reason: `Expected function as an argument, got ${typeof handler}` };
9412
+ throw new Error(ChannelError.AccessDenied);
7558
9413
  }
7559
9414
  const commandId = generateCommandId();
7560
9415
  this.ensureAlive(commandId);
7561
- const unsub = this.registry.add(PrivateChannelEventMethods.OnUnsubscribe, handler);
7562
- return AsyncListener(unsub);
9416
+ const unsub = this.registry.add(LegacyPrivateChannelEventMethods.OnUnsubscribe, handler);
9417
+ return getListenerWithAsyncUnsubscribe(unsub);
7563
9418
  }
7564
- onDisconnect(handler) {
9419
+ legacyOnDisconnect(handler) {
7565
9420
  if (typeof handler !== "function") {
7566
- throw { message: ChannelError.AccessDenied, reason: `Expected function as an argument, got ${typeof handler}` };
9421
+ throw new Error(ChannelError.AccessDenied);
7567
9422
  }
7568
9423
  const commandId = generateCommandId();
7569
9424
  this.ensureAlive(commandId);
7570
- const unsub = this.registry.add(PrivateChannelEventMethods.OnDisconnect, handler);
7571
- return AsyncListener(unsub);
9425
+ const unsub = this.registry.add(LegacyPrivateChannelEventMethods.OnDisconnect, handler);
9426
+ return getListenerWithAsyncUnsubscribe(unsub);
7572
9427
  }
7573
9428
  async disconnect() {
7574
9429
  const commandId = generateCommandId();
@@ -7581,15 +9436,8 @@
7581
9436
  this.logger?.trace(`[${commandId}] - disconnect invoked`);
7582
9437
  this.disconnected = true;
7583
9438
  this.logger?.trace(`[${commandId}] - announcing ${"disconnectedFromPrivateChannel"} to collaborator ${JSON.stringify(this.collaborator)}`);
7584
- const disconnectArgs = {
7585
- action: "disconnectedFromPrivateChannel",
7586
- correlationId: this.id,
7587
- collaborationObject: {
7588
- channelId: this.id
7589
- }
7590
- };
7591
9439
  this.channelsController.removePrivateChannelFromStoreById(this.id);
7592
- await this.channelsController.invokeSystemMethod(disconnectArgs, this.collaborator?.instanceId);
9440
+ await this.sendCollaborateMessage({ action: "disconnectedFromPrivateChannel" });
7593
9441
  this.logger?.trace(`[${commandId}] - collaborator received action ${"disconnectedFromPrivateChannel"}`);
7594
9442
  if (this.unsubFromInstanceStopped) {
7595
9443
  this.unsubFromInstanceStopped();
@@ -7601,7 +9449,7 @@
7601
9449
  }
7602
9450
  const errorMsg = "Channel is disconnected - operation is no longer available";
7603
9451
  this.logger?.error(`[${commandId}] - ${errorMsg}`);
7604
- throw { message: ChannelError.AccessDenied, reason: errorMsg };
9452
+ throw new Error(ChannelError.AccessDenied);
7605
9453
  }
7606
9454
  ensureBound(commandId, operation) {
7607
9455
  if (this.collaborator) {
@@ -7609,7 +9457,7 @@
7609
9457
  }
7610
9458
  const errorMsg = `There's no collaborator on the other side of the channel - operation ${operation} is unavailable`;
7611
9459
  this.logger?.error(`[${commandId}] - ${errorMsg}`);
7612
- throw { message: ChannelError.AccessDenied, reason: errorMsg };
9460
+ throw new Error(ChannelError.AccessDenied);
7613
9461
  }
7614
9462
  subscribeForCollaboratorInstanceStop(commandId) {
7615
9463
  const handler = (instance) => {
@@ -7620,6 +9468,43 @@
7620
9468
  };
7621
9469
  this.unsubFromInstanceStopped = this.channelsController.subscribeOnInstanceStop(this.id, handler.bind(this), commandId);
7622
9470
  }
9471
+ async sendCollaborateMessage({ action, contextType, payload }) {
9472
+ const args = {
9473
+ action,
9474
+ correlationId: this.id,
9475
+ collaborationObject: {
9476
+ channelId: this.id,
9477
+ contextType,
9478
+ payload
9479
+ }
9480
+ };
9481
+ this.logger?.trace(`Sending '${action}' collaborate message ${JSON.stringify(args)} to collaborator ${JSON.stringify(this.collaborator)}`);
9482
+ await this.channelsController.invokeSystemMethod(args, this.collaborator?.instanceId);
9483
+ }
9484
+ executeCollaboratorAddContextListenerEvents(contextType) {
9485
+ this.registry.execute(LegacyPrivateChannelEventMethods.OnAddContextListener, contextType);
9486
+ const event = { type: NewPrivateChannelEventMethods.AddContextListener, details: { contextType } };
9487
+ this.registry.execute(NewPrivateChannelEventMethods.AddContextListener, event);
9488
+ }
9489
+ executeCollaboratorBroadcastEvents(context, metadata) {
9490
+ this.registry.execute(LegacyPrivateChannelEventMethods.ListenerAdded, context, metadata);
9491
+ const event = {
9492
+ type: NewPrivateChannelEventMethods.ContextListenerAdded,
9493
+ details: { context, metadata }
9494
+ };
9495
+ this.registry.execute(NewPrivateChannelEventMethods.ContextListenerAdded, event);
9496
+ }
9497
+ executeCollaboratorUnsubscribeEvents(contextType) {
9498
+ this.registry.execute(LegacyPrivateChannelEventMethods.OnUnsubscribe, contextType);
9499
+ const event = { type: NewPrivateChannelEventMethods.Unsubscribe, details: { contextType } };
9500
+ this.registry.execute(NewPrivateChannelEventMethods.Unsubscribe, event);
9501
+ }
9502
+ executeCollaboratorDisconnectEvents() {
9503
+ this.collaboratorListenerTypes.forEach((contextType) => this.executeCollaboratorUnsubscribeEvents(contextType));
9504
+ this.registry.execute(LegacyPrivateChannelEventMethods.OnDisconnect);
9505
+ const event = { type: NewPrivateChannelEventMethods.Disconnect, details: {} };
9506
+ this.registry.execute(NewPrivateChannelEventMethods.Disconnect, event);
9507
+ }
7623
9508
  }
7624
9509
 
7625
9510
  class ChannelsFactory {
@@ -7821,7 +9706,7 @@
7821
9706
  const subHandler = parseContextHandler(handler, contextType);
7822
9707
  if (!channelIdToSubscribeTo || onMultiChannels) {
7823
9708
  const unsubscribe = this.glueController.channelsSubscribe(subHandler, contextType);
7824
- return { unsubscribe };
9709
+ return getListenerWithAsyncUnsubscribe(unsubscribe);
7825
9710
  }
7826
9711
  return this.addContextListenerByChannelId({ commandId, handler: subHandler, invokedOnChannelModel: !!channelId, channelId: channelIdToSubscribeTo, contextType });
7827
9712
  }
@@ -7994,6 +9879,14 @@
7994
9879
  this.logger?.info(`[${commandId}] - leaving channel '${ioChannelToLeave.name}'`);
7995
9880
  return this.glueController.leaveChannel({ channel: ioChannelToLeave.name });
7996
9881
  }
9882
+ async addEventListener({ commandId, type, handler }) {
9883
+ await this.initDonePromise;
9884
+ this.logger?.info(`[${commandId}] - addEventListener() invoked for event type ${type}`);
9885
+ if (!type || type === "userChannelChanged") {
9886
+ return this.subscribeForChannelChangedEvent(handler);
9887
+ }
9888
+ throw new Error(`Received unknown event type: ${type}`);
9889
+ }
7997
9890
  get logger() {
7998
9891
  if (!this._logger) {
7999
9892
  this._logger = this.glueController.initSubLogger("fdc3.channels.controller");
@@ -8031,7 +9924,7 @@
8031
9924
  }
8032
9925
  async handleWindowContextOnOpening(commandId, handler, contextType) {
8033
9926
  const myWindow = this.glueController.getMyWindow();
8034
- if (!myWindow) {
9927
+ if (!myWindow || !Object.keys(myWindow).length) {
8035
9928
  this.logger?.trace(`[${commandId}] - Cannot get window context because this is not a Glue window, it's probably an iframe`);
8036
9929
  this.invokeContextHandlerWithStartupContext = false;
8037
9930
  return;
@@ -8112,12 +10005,10 @@
8112
10005
  if (channelType === ChannelTypes.App) {
8113
10006
  this.logger?.info(`[${commandId}] - subscribing for fdc3 app channel with id ${channelId} (underlying glue context with same name)`);
8114
10007
  const unsubscribe = await this.glueController.contextsSubscribe(channelId, subHandler);
8115
- return {
8116
- unsubscribe: () => {
8117
- this.logger?.info(`[${commandId}] - invoking unsubscribe for app channel with id ${channelId}`);
8118
- unsubscribe();
8119
- }
8120
- };
10008
+ return getListenerWithAsyncUnsubscribe(() => {
10009
+ this.logger?.info(`[${commandId}] - invoking unsubscribe for app channel with id ${channelId}`);
10010
+ unsubscribe();
10011
+ });
8121
10012
  }
8122
10013
  this.logger?.error("Cannot add a context listener on an invalid channel");
8123
10014
  throw new Error(ChannelError.AccessDenied);
@@ -8134,6 +10025,28 @@
8134
10025
  this.logger?.error(`Channel with id: ${channelId} does not exist`);
8135
10026
  throw new Error(ChannelError.NoChannelFound);
8136
10027
  }
10028
+ subscribeForChannelChangedEvent(handler) {
10029
+ const wrappedCallback = async (channelName) => {
10030
+ if (!channelName) {
10031
+ this.invokeChannelChangedEventHandler(null, handler);
10032
+ return;
10033
+ }
10034
+ const fdc3ChannelName = await this.glueController.getFDC3ChannelIdByIoChannelName(channelName);
10035
+ if (!fdc3ChannelName) {
10036
+ return;
10037
+ }
10038
+ this.invokeChannelChangedEventHandler(fdc3ChannelName, handler);
10039
+ };
10040
+ const unsubscribe = this.glueController.setOnChannelChanged(wrappedCallback);
10041
+ return getListenerWithAsyncUnsubscribe(unsubscribe);
10042
+ }
10043
+ invokeChannelChangedEventHandler(channelId, handler) {
10044
+ const event = {
10045
+ type: "userChannelChanged",
10046
+ details: { currentChannelId: channelId }
10047
+ };
10048
+ handler(event);
10049
+ }
8137
10050
  }
8138
10051
 
8139
10052
  class LegacyDataWrappingChannelsController {
@@ -8171,7 +10084,7 @@
8171
10084
  if (!invokedOnChannelModel) {
8172
10085
  this.logger?.info(`[${commandId}] - subscribing for fdc3 user channel with id ${channelId}`);
8173
10086
  const unsubscribe = this.glueController.legacyChannelsSubscribe(handler, contextType);
8174
- return { unsubscribe };
10087
+ return getListenerWithAsyncUnsubscribe(unsubscribe);
8175
10088
  }
8176
10089
  const ioChannelName = await this.glueController.getIoChannelNameByFDC3ChannelId(channelId);
8177
10090
  if (!ioChannelName) {
@@ -8181,7 +10094,7 @@
8181
10094
  const contextToSubscribeTo = this.parser.mapChannelNameToContextName(ioChannelName);
8182
10095
  this.logger?.info(`[${commandId}] - subscribing for fdc3 user channel with id ${channelId}`);
8183
10096
  const unsubscribe = await this.glueController.contextsSubscribe(contextToSubscribeTo, handler);
8184
- return { unsubscribe };
10097
+ return getListenerWithAsyncUnsubscribe(unsubscribe);
8185
10098
  }
8186
10099
  get logger() {
8187
10100
  if (!this._logger) {
@@ -8227,7 +10140,7 @@
8227
10140
  if (!invokedOnChannelModel) {
8228
10141
  this.logger?.info(`[${commandId}] - subscribing for fdc3 user channel with id ${channelId}`);
8229
10142
  const unsubscribe = this.glueController.channelsSubscribe(handler, contextType);
8230
- return { unsubscribe };
10143
+ return getListenerWithAsyncUnsubscribe(unsubscribe);
8231
10144
  }
8232
10145
  const ioChannelName = await this.glueController.getIoChannelNameByFDC3ChannelId(channelId);
8233
10146
  if (!ioChannelName) {
@@ -8237,7 +10150,7 @@
8237
10150
  const contextToSubscribeTo = this.parser.mapChannelNameToContextName(ioChannelName);
8238
10151
  this.logger?.info(`[${commandId}] - subscribing for fdc3 user channel with id ${channelId}`);
8239
10152
  const unsubscribe = await this.glueController.contextsSubscribe(contextToSubscribeTo, handler);
8240
- return { unsubscribe };
10153
+ return getListenerWithAsyncUnsubscribe(unsubscribe);
8241
10154
  }
8242
10155
  get logger() {
8243
10156
  if (!this._logger) {
@@ -8247,9 +10160,55 @@
8247
10160
  }
8248
10161
  }
8249
10162
 
10163
+ class NodeEventReceiver {
10164
+ glueController;
10165
+ glueReceived = false;
10166
+ glueInitialized = false;
10167
+ timer;
10168
+ constructor(glueController) {
10169
+ this.glueController = glueController;
10170
+ }
10171
+ start() {
10172
+ setTimeout(this.clearInterval, GlueReceivedPromiseTimeout);
10173
+ this.setupInterval();
10174
+ }
10175
+ setupInterval() {
10176
+ this.timer = setInterval(() => {
10177
+ if (this.glueReceived) {
10178
+ return this.clearInterval();
10179
+ }
10180
+ const glueAvailable = typeof (process.io ?? process.glue) !== "undefined";
10181
+ if (!glueAvailable) {
10182
+ return;
10183
+ }
10184
+ this.glueReceived = true;
10185
+ const glue = process.io ?? process.glue;
10186
+ const glueValidator = this.glueController.validateGlue(glue);
10187
+ if (!glueValidator.isValid) {
10188
+ this.glueController.initializeFailed(glueValidator.error);
10189
+ return this.clearInterval();
10190
+ }
10191
+ this.clearInterval();
10192
+ this.glueController.initialize(glue);
10193
+ this.glueInitialized = true;
10194
+ }, 100);
10195
+ }
10196
+ clearInterval() {
10197
+ if (!this.timer) {
10198
+ return;
10199
+ }
10200
+ clearInterval(this.timer);
10201
+ this.timer = undefined;
10202
+ if (!this.glueReceived && !this.glueInitialized) {
10203
+ this.glueController.initializeFailed(`Timeout ${GlueReceivedPromiseTimeout}ms waiting for 'io' to be available on the process object`);
10204
+ }
10205
+ }
10206
+ }
10207
+
8250
10208
  class IoC {
8251
- _eventDispatcher;
8252
- _eventReceiver;
10209
+ _webEventDispatcher;
10210
+ _webEventReceiver;
10211
+ _nodeEventReceiver;
8253
10212
  _desktopAgent;
8254
10213
  _glueController;
8255
10214
  _intentsController;
@@ -8267,14 +10226,15 @@
8267
10226
  return this;
8268
10227
  }
8269
10228
  get eventReceiver() {
8270
- if (!this._eventReceiver) {
8271
- this._eventReceiver = new EventReceiver(this.glueController, this.eventDispatcher);
10229
+ const inNode = typeof process !== "undefined";
10230
+ if (inNode) {
10231
+ return this.nodeEventReceiver;
8272
10232
  }
8273
- return this._eventReceiver;
10233
+ return this.webEventReceiver;
8274
10234
  }
8275
10235
  get glueController() {
8276
10236
  if (!this._glueController) {
8277
- this._glueController = new GlueController(this.channelsParser, this.channelsStateStore);
10237
+ this._glueController = new GlueController(this.channelsParser);
8278
10238
  }
8279
10239
  return this._glueController;
8280
10240
  }
@@ -8284,11 +10244,23 @@
8284
10244
  }
8285
10245
  return this._fdc3;
8286
10246
  }
8287
- get eventDispatcher() {
8288
- if (!this._eventDispatcher) {
8289
- this._eventDispatcher = new EventDispatcher();
10247
+ get nodeEventReceiver() {
10248
+ if (!this._nodeEventReceiver) {
10249
+ this._nodeEventReceiver = new NodeEventReceiver(this.glueController);
10250
+ }
10251
+ return this._nodeEventReceiver;
10252
+ }
10253
+ get webEventReceiver() {
10254
+ if (!this._webEventReceiver) {
10255
+ this._webEventReceiver = new WebEventReceiver(this.glueController, this.webEventDispatcher);
10256
+ }
10257
+ return this._webEventReceiver;
10258
+ }
10259
+ get webEventDispatcher() {
10260
+ if (!this._webEventDispatcher) {
10261
+ this._webEventDispatcher = new WebEventDispatcher();
8290
10262
  }
8291
- return this._eventDispatcher;
10263
+ return this._webEventDispatcher;
8292
10264
  }
8293
10265
  get channelsFactory() {
8294
10266
  if (!this._channelsFactory) {
@@ -8374,17 +10346,18 @@
8374
10346
  return ioc.fdc3;
8375
10347
  };
8376
10348
 
8377
- var version = "2.5.1";
10349
+ var version = "2.6.0";
8378
10350
 
8379
- let globalFdc3 = window.fdc3;
8380
- window.fdc3Info = {
10351
+ const globalScope = typeof process !== "undefined" ? process : window;
10352
+ globalScope.fdc3Info = {
8381
10353
  provider: "io.Connect",
8382
10354
  providerVersion: version,
8383
- standardVersion: "2.1"
10355
+ standardVersion: "2.2"
8384
10356
  };
10357
+ let globalFdc3 = globalScope.fdc3;
8385
10358
  if (typeof globalFdc3 === "undefined") {
8386
10359
  globalFdc3 = fdc3Factory();
8387
- window.fdc3 = globalFdc3;
10360
+ globalScope.fdc3 = globalFdc3;
8388
10361
  }
8389
10362
  else {
8390
10363
  console.warn("Defaulting to using the auto-injected fdc3.");