@interopio/fdc3 2.7.1-beta.0 → 2.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/fdc3.umd.js CHANGED
@@ -232,10 +232,10 @@
232
232
  var type = TypeError;
233
233
 
234
234
  /** @type {import('./gOPD')} */
235
- var gOPD$6 = Object.getOwnPropertyDescriptor;
235
+ var gOPD$5 = Object.getOwnPropertyDescriptor;
236
236
 
237
237
  /** @type {import('.')} */
238
- var $gOPD$2 = gOPD$6;
238
+ var $gOPD$2 = gOPD$5;
239
239
 
240
240
  if ($gOPD$2) {
241
241
  try {
@@ -370,7 +370,7 @@
370
370
 
371
371
  var defineProperties_1 = defineProperties$1;
372
372
 
373
- var callBind$7 = {exports: {}};
373
+ var callBind$6 = {exports: {}};
374
374
 
375
375
  /** @type {import('.')} */
376
376
  var esObjectAtoms = Object;
@@ -647,16 +647,16 @@
647
647
  /** @type {import('./reflectApply')} */
648
648
  var reflectApply$1 = typeof Reflect !== 'undefined' && Reflect && Reflect.apply;
649
649
 
650
- var bind$4 = requireFunctionBind();
650
+ var bind$3 = requireFunctionBind();
651
651
 
652
652
  var $apply$2 = requireFunctionApply();
653
653
  var $call$2 = requireFunctionCall();
654
654
  var $reflectApply = reflectApply$1;
655
655
 
656
656
  /** @type {import('./actualApply')} */
657
- var actualApply$1 = $reflectApply || bind$4.call($call$2, $apply$2);
657
+ var actualApply$1 = $reflectApply || bind$3.call($call$2, $apply$2);
658
658
 
659
- var bind$3 = requireFunctionBind();
659
+ var bind$2 = requireFunctionBind();
660
660
  var $TypeError$a = type;
661
661
 
662
662
  var $call$1 = requireFunctionCall();
@@ -667,70 +667,97 @@
667
667
  if (args.length < 1 || typeof args[0] !== 'function') {
668
668
  throw new $TypeError$a('a function is required');
669
669
  }
670
- return $actualApply(bind$3, $call$1, args);
670
+ return $actualApply(bind$2, $call$1, args);
671
671
  };
672
672
 
673
- var callBind$6 = callBindApplyHelpers;
674
- var gOPD$5 = gopd$1;
673
+ var get;
674
+ var hasRequiredGet;
675
675
 
676
- var hasProtoAccessor;
677
- try {
678
- // eslint-disable-next-line no-extra-parens, no-proto
679
- hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ ([]).__proto__ === Array.prototype;
680
- } catch (e) {
681
- if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') {
682
- throw e;
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
+ }
683
691
  }
684
- }
685
692
 
686
- // eslint-disable-next-line no-extra-parens
687
- var desc = !!hasProtoAccessor && gOPD$5 && gOPD$5(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__'));
693
+ // eslint-disable-next-line no-extra-parens
694
+ var desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__'));
688
695
 
689
- var $Object$3 = Object;
690
- var $getPrototypeOf = $Object$3.getPrototypeOf;
696
+ var $Object = Object;
697
+ var $getPrototypeOf = $Object.getPrototypeOf;
691
698
 
692
- /** @type {import('./get')} */
693
- var get = desc && typeof desc.get === 'function'
694
- ? callBind$6([desc.get])
695
- : typeof $getPrototypeOf === 'function'
696
- ? /** @type {import('./get')} */ function getDunder(value) {
697
- // eslint-disable-next-line eqeqeq
698
- return $getPrototypeOf(value == null ? value : $Object$3(value));
699
- }
700
- : false;
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
+ }
701
710
 
702
- var reflectGetProto = requireReflect_getPrototypeOf();
703
- var originalGetProto = requireObject_getPrototypeOf();
711
+ var getProto$3;
712
+ var hasRequiredGetProto;
704
713
 
705
- var getDunderProto = get;
714
+ function requireGetProto () {
715
+ if (hasRequiredGetProto) return getProto$3;
716
+ hasRequiredGetProto = 1;
706
717
 
707
- /** @type {import('.')} */
708
- var getProto$3 = reflectGetProto
709
- ? function getProto(O) {
710
- // @ts-expect-error TS can't narrow inside a closure, for some reason
711
- return reflectGetProto(O);
712
- }
713
- : originalGetProto
718
+ var reflectGetProto = requireReflect_getPrototypeOf();
719
+ var originalGetProto = requireObject_getPrototypeOf();
720
+
721
+ var getDunderProto = requireGet();
722
+
723
+ /** @type {import('.')} */
724
+ getProto$3 = reflectGetProto
714
725
  ? function getProto(O) {
715
- if (!O || (typeof O !== 'object' && typeof O !== 'function')) {
716
- throw new TypeError('getProto: not an object');
717
- }
718
726
  // @ts-expect-error TS can't narrow inside a closure, for some reason
719
- return originalGetProto(O);
727
+ return reflectGetProto(O);
720
728
  }
721
- : getDunderProto
729
+ : originalGetProto
722
730
  ? function getProto(O) {
731
+ if (!O || (typeof O !== 'object' && typeof O !== 'function')) {
732
+ throw new TypeError('getProto: not an object');
733
+ }
723
734
  // @ts-expect-error TS can't narrow inside a closure, for some reason
724
- return getDunderProto(O);
735
+ return originalGetProto(O);
725
736
  }
726
- : null;
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$3;
744
+ }
727
745
 
728
- var call = Function.prototype.call;
729
- var $hasOwn = Object.prototype.hasOwnProperty;
730
- var bind$2 = requireFunctionBind();
746
+ var hasown;
747
+ var hasRequiredHasown;
731
748
 
732
- /** @type {import('.')} */
733
- var hasown = bind$2.call(call, $hasOwn);
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
+ }
734
761
 
735
762
  var undefined$1;
736
763
 
@@ -786,7 +813,7 @@
786
813
 
787
814
  var hasSymbols$2 = hasSymbols$3();
788
815
 
789
- var getProto$2 = getProto$3;
816
+ var getProto$2 = requireGetProto();
790
817
  var $ObjectGPO = requireObject_getPrototypeOf();
791
818
  var $ReflectGPO = requireReflect_getPrototypeOf();
792
819
 
@@ -973,7 +1000,7 @@
973
1000
  };
974
1001
 
975
1002
  var bind$1 = requireFunctionBind();
976
- var hasOwn$3 = hasown;
1003
+ var hasOwn$3 = requireHasown();
977
1004
  var $concat$1 = bind$1.call($call, Array.prototype.concat);
978
1005
  var $spliceApply = bind$1.call($apply$1, Array.prototype.splice);
979
1006
  var $replace$1 = bind$1.call($call, String.prototype.replace);
@@ -1183,9 +1210,9 @@
1183
1210
  } else {
1184
1211
  module.exports.apply = applyBind$1;
1185
1212
  }
1186
- } (callBind$7));
1213
+ } (callBind$6));
1187
1214
 
1188
- var callBindExports = callBind$7.exports;
1215
+ var callBindExports = callBind$6.exports;
1189
1216
 
1190
1217
  var GetIntrinsic$7 = getIntrinsic;
1191
1218
 
@@ -1195,7 +1222,7 @@
1195
1222
  var $indexOf$2 = callBindBasic([GetIntrinsic$7('%String.prototype.indexOf%')]);
1196
1223
 
1197
1224
  /** @type {import('.')} */
1198
- var callBound$i = function callBoundIntrinsic(name, allowMissing) {
1225
+ var callBound$h = function callBoundIntrinsic(name, allowMissing) {
1199
1226
  /* eslint no-extra-parens: 0 */
1200
1227
 
1201
1228
  var intrinsic = /** @type {(this: unknown, ...args: unknown[]) => unknown} */ (GetIntrinsic$7(name, !!allowMissing));
@@ -1208,10 +1235,10 @@
1208
1235
  // modified from https://github.com/es-shims/es6-shim
1209
1236
  var objectKeys$1 = objectKeys$2;
1210
1237
  var hasSymbols$1 = requireShams$1()();
1211
- var callBound$h = callBound$i;
1238
+ var callBound$g = callBound$h;
1212
1239
  var $Object$1 = esObjectAtoms;
1213
- var $push = callBound$h('Array.prototype.push');
1214
- var $propIsEnumerable = callBound$h('Object.prototype.propertyIsEnumerable');
1240
+ var $push = callBound$g('Array.prototype.push');
1241
+ var $propIsEnumerable = callBound$g('Object.prototype.propertyIsEnumerable');
1215
1242
  var originalGetSymbols = hasSymbols$1 ? $Object$1.getOwnPropertySymbols : null;
1216
1243
 
1217
1244
  // eslint-disable-next-line no-unused-vars
@@ -1344,7 +1371,7 @@
1344
1371
 
1345
1372
  var $indexOf$1 = callBind$4(GetIntrinsic$6('String.prototype.indexOf'));
1346
1373
 
1347
- var callBound$g = function callBoundIntrinsic(name, allowMissing) {
1374
+ var callBound$f = function callBoundIntrinsic(name, allowMissing) {
1348
1375
  var intrinsic = GetIntrinsic$6(name, !!allowMissing);
1349
1376
  if (typeof intrinsic === 'function' && $indexOf$1(name, '.prototype.') > -1) {
1350
1377
  return callBind$4(intrinsic);
@@ -1484,7 +1511,7 @@
1484
1511
  var gOPD$2 = gopd$1;
1485
1512
  var defineProperty = Object.defineProperty;
1486
1513
  var $TypeError$5 = esErrors;
1487
- var getProto$1 = getProto$3;
1514
+ var getProto$1 = requireGetProto();
1488
1515
  var regex = /a/;
1489
1516
 
1490
1517
  var shim$3 = function shimFlags() {
@@ -1539,22 +1566,22 @@
1539
1566
  return shams;
1540
1567
  }
1541
1568
 
1542
- var hasToStringTag$7 = requireShams()();
1543
- var callBound$f = callBound$i;
1569
+ var hasToStringTag$6 = requireShams()();
1570
+ var callBound$e = callBound$h;
1544
1571
 
1545
- var $toString$7 = callBound$f('Object.prototype.toString');
1572
+ var $toString$6 = callBound$e('Object.prototype.toString');
1546
1573
 
1547
1574
  /** @type {import('.')} */
1548
1575
  var isStandardArguments = function isArguments(value) {
1549
1576
  if (
1550
- hasToStringTag$7
1577
+ hasToStringTag$6
1551
1578
  && value
1552
1579
  && typeof value === 'object'
1553
1580
  && Symbol.toStringTag in value
1554
1581
  ) {
1555
1582
  return false;
1556
1583
  }
1557
- return $toString$7(value) === '[object Arguments]';
1584
+ return $toString$6(value) === '[object Arguments]';
1558
1585
  };
1559
1586
 
1560
1587
  /** @type {import('.')} */
@@ -1567,9 +1594,9 @@
1567
1594
  && 'length' in value
1568
1595
  && typeof value.length === 'number'
1569
1596
  && value.length >= 0
1570
- && $toString$7(value) !== '[object Array]'
1597
+ && $toString$6(value) !== '[object Array]'
1571
1598
  && 'callee' in value
1572
- && $toString$7(value.callee) === '[object Function]';
1599
+ && $toString$6(value.callee) === '[object Function]';
1573
1600
  };
1574
1601
 
1575
1602
  var supportsStandardArguments = (function () {
@@ -2249,22 +2276,22 @@
2249
2276
  };
2250
2277
 
2251
2278
  var GetIntrinsic$5 = getIntrinsic;
2252
- var callBound$e = callBound$i;
2279
+ var callBound$d = callBound$h;
2253
2280
  var inspect$2 = objectInspect;
2254
2281
 
2255
2282
  var $TypeError$3 = type;
2256
2283
  var $Map$3 = GetIntrinsic$5('%Map%', true);
2257
2284
 
2258
2285
  /** @type {<K, V>(thisArg: Map<K, V>, key: K) => V} */
2259
- var $mapGet$1 = callBound$e('Map.prototype.get', true);
2286
+ var $mapGet$1 = callBound$d('Map.prototype.get', true);
2260
2287
  /** @type {<K, V>(thisArg: Map<K, V>, key: K, value: V) => void} */
2261
- var $mapSet = callBound$e('Map.prototype.set', true);
2288
+ var $mapSet = callBound$d('Map.prototype.set', true);
2262
2289
  /** @type {<K, V>(thisArg: Map<K, V>, key: K) => boolean} */
2263
- var $mapHas$5 = callBound$e('Map.prototype.has', true);
2290
+ var $mapHas$5 = callBound$d('Map.prototype.has', true);
2264
2291
  /** @type {<K, V>(thisArg: Map<K, V>, key: K) => boolean} */
2265
- var $mapDelete = callBound$e('Map.prototype.delete', true);
2292
+ var $mapDelete = callBound$d('Map.prototype.delete', true);
2266
2293
  /** @type {<K, V>(thisArg: Map<K, V>) => number} */
2267
- var $mapSize$1 = callBound$e('Map.prototype.size', true);
2294
+ var $mapSize$1 = callBound$d('Map.prototype.size', true);
2268
2295
 
2269
2296
  /** @type {import('.')} */
2270
2297
  var sideChannelMap = !!$Map$3 && /** @type {Exclude<import('.'), false>} */ function getSideChannelMap() {
@@ -2316,7 +2343,7 @@
2316
2343
  };
2317
2344
 
2318
2345
  var GetIntrinsic$4 = getIntrinsic;
2319
- var callBound$d = callBound$i;
2346
+ var callBound$c = callBound$h;
2320
2347
  var inspect$1 = objectInspect;
2321
2348
  var getSideChannelMap$1 = sideChannelMap;
2322
2349
 
@@ -2324,13 +2351,13 @@
2324
2351
  var $WeakMap$1 = GetIntrinsic$4('%WeakMap%', true);
2325
2352
 
2326
2353
  /** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => V} */
2327
- var $weakMapGet = callBound$d('WeakMap.prototype.get', true);
2354
+ var $weakMapGet = callBound$c('WeakMap.prototype.get', true);
2328
2355
  /** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K, value: V) => void} */
2329
- var $weakMapSet = callBound$d('WeakMap.prototype.set', true);
2356
+ var $weakMapSet = callBound$c('WeakMap.prototype.set', true);
2330
2357
  /** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean} */
2331
- var $weakMapHas = callBound$d('WeakMap.prototype.has', true);
2358
+ var $weakMapHas = callBound$c('WeakMap.prototype.has', true);
2332
2359
  /** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean} */
2333
- var $weakMapDelete = callBound$d('WeakMap.prototype.delete', true);
2360
+ var $weakMapDelete = callBound$c('WeakMap.prototype.delete', true);
2334
2361
 
2335
2362
  /** @type {import('.')} */
2336
2363
  var sideChannelWeakmap = $WeakMap$1
@@ -2443,7 +2470,7 @@
2443
2470
  /** @typedef {`$${import('.').InternalSlot}`} SaltedInternalSlot */
2444
2471
  /** @typedef {{ [k in SaltedInternalSlot]?: unknown }} SlotsObject */
2445
2472
 
2446
- var hasOwn$1 = hasown;
2473
+ var hasOwn$1 = requireHasown();
2447
2474
  /** @type {import('side-channel').Channel<object, SlotsObject>} */
2448
2475
  var channel = sideChannel();
2449
2476
 
@@ -2559,35 +2586,44 @@
2559
2586
  return toString.call(arr) == '[object Array]';
2560
2587
  };
2561
2588
 
2562
- var callBound$c = callBound$i;
2589
+ var isString$2;
2590
+ var hasRequiredIsString;
2563
2591
 
2564
- /** @type {(receiver: ThisParameterType<typeof String.prototype.valueOf>, ...args: Parameters<typeof String.prototype.valueOf>) => ReturnType<typeof String.prototype.valueOf>} */
2565
- var $strValueOf = callBound$c('String.prototype.valueOf');
2592
+ function requireIsString () {
2593
+ if (hasRequiredIsString) return isString$2;
2594
+ hasRequiredIsString = 1;
2566
2595
 
2567
- /** @type {import('.')} */
2568
- var tryStringObject = function tryStringObject(value) {
2569
- try {
2570
- $strValueOf(value);
2571
- return true;
2572
- } catch (e) {
2573
- return false;
2574
- }
2575
- };
2576
- /** @type {(receiver: ThisParameterType<typeof Object.prototype.toString>, ...args: Parameters<typeof Object.prototype.toString>) => ReturnType<typeof Object.prototype.toString>} */
2577
- var $toString$6 = callBound$c('Object.prototype.toString');
2578
- var strClass = '[object String]';
2579
- var hasToStringTag$6 = requireShams()();
2596
+ var callBound = callBound$h;
2580
2597
 
2581
- /** @type {import('.')} */
2582
- var isString$2 = function isString(value) {
2583
- if (typeof value === 'string') {
2584
- return true;
2585
- }
2586
- if (!value || typeof value !== 'object') {
2587
- return false;
2588
- }
2589
- return hasToStringTag$6 ? tryStringObject(value) : $toString$6(value) === strClass;
2590
- };
2598
+ /** @type {(receiver: ThisParameterType<typeof String.prototype.valueOf>, ...args: Parameters<typeof String.prototype.valueOf>) => ReturnType<typeof String.prototype.valueOf>} */
2599
+ var $strValueOf = callBound('String.prototype.valueOf');
2600
+
2601
+ /** @type {import('.')} */
2602
+ var tryStringObject = function tryStringObject(value) {
2603
+ try {
2604
+ $strValueOf(value);
2605
+ return true;
2606
+ } catch (e) {
2607
+ return false;
2608
+ }
2609
+ };
2610
+ /** @type {(receiver: ThisParameterType<typeof Object.prototype.toString>, ...args: Parameters<typeof Object.prototype.toString>) => ReturnType<typeof Object.prototype.toString>} */
2611
+ var $toString = callBound('Object.prototype.toString');
2612
+ var strClass = '[object String]';
2613
+ var hasToStringTag = requireShams()();
2614
+
2615
+ /** @type {import('.')} */
2616
+ isString$2 = function isString(value) {
2617
+ if (typeof value === 'string') {
2618
+ return true;
2619
+ }
2620
+ if (!value || typeof value !== 'object') {
2621
+ return false;
2622
+ }
2623
+ return hasToStringTag ? tryStringObject(value) : $toString(value) === strClass;
2624
+ };
2625
+ return isString$2;
2626
+ }
2591
2627
 
2592
2628
  /** @const */
2593
2629
  var $Map$2 = typeof Map === 'function' && Map.prototype ? Map : null;
@@ -2715,11 +2751,11 @@
2715
2751
  } else {
2716
2752
  // Symbol is not available, native or shammed
2717
2753
  var isArray$2 = isarray;
2718
- var isString$1 = isString$2;
2754
+ var isString$1 = requireIsString();
2719
2755
  var GetIntrinsic$3 = getIntrinsic;
2720
2756
  var $Map = GetIntrinsic$3('%Map%', true);
2721
2757
  var $Set$1 = GetIntrinsic$3('%Set%', true);
2722
- var callBound$b = callBound$g;
2758
+ var callBound$b = callBound$f;
2723
2759
  var $arrayPush = callBound$b('Array.prototype.push');
2724
2760
  var $charCodeAt = callBound$b('String.prototype.charCodeAt');
2725
2761
  var $stringSlice = callBound$b('String.prototype.slice');
@@ -2924,7 +2960,7 @@
2924
2960
  var objectIs = polyfill;
2925
2961
 
2926
2962
  var callBind$1 = callBindExports;
2927
- var callBound$a = callBound$i;
2963
+ var callBound$a = callBound$h;
2928
2964
  var GetIntrinsic$2 = getIntrinsic;
2929
2965
 
2930
2966
  var $ArrayBuffer = GetIntrinsic$2('%ArrayBuffer%', true);
@@ -2965,7 +3001,7 @@
2965
3001
  return false;
2966
3002
  };
2967
3003
 
2968
- var callBound$9 = callBound$i;
3004
+ var callBound$9 = callBound$h;
2969
3005
 
2970
3006
  var getDay = callBound$9('Date.prototype.getDay');
2971
3007
  /** @type {import('.')} */
@@ -2991,9 +3027,9 @@
2991
3027
  return hasToStringTag$5 ? tryDateObject(value) : toStr$2(value) === dateClass;
2992
3028
  };
2993
3029
 
2994
- var callBound$8 = callBound$i;
3030
+ var callBound$8 = callBound$h;
2995
3031
  var hasToStringTag$4 = requireShams()();
2996
- var hasOwn = hasown;
3032
+ var hasOwn = requireHasown();
2997
3033
  var gOPD$1 = gopd$1;
2998
3034
 
2999
3035
  /** @type {import('.')} */
@@ -3059,7 +3095,7 @@
3059
3095
 
3060
3096
  var isRegex$1 = fn;
3061
3097
 
3062
- var callBound$7 = callBound$i;
3098
+ var callBound$7 = callBound$h;
3063
3099
 
3064
3100
  /** @type {undefined | ((thisArg: SharedArrayBuffer) => number)} */
3065
3101
  var $byteLength$1 = callBound$7('SharedArrayBuffer.prototype.byteLength', true);
@@ -3082,7 +3118,7 @@
3082
3118
  return false;
3083
3119
  };
3084
3120
 
3085
- var callBound$6 = callBound$i;
3121
+ var callBound$6 = callBound$h;
3086
3122
 
3087
3123
  var $numToStr = callBound$6('Number.prototype.toString');
3088
3124
 
@@ -3110,7 +3146,7 @@
3110
3146
  return hasToStringTag$3 ? tryNumberObject(value) : $toString$3(value) === numClass;
3111
3147
  };
3112
3148
 
3113
- var callBound$5 = callBound$i;
3149
+ var callBound$5 = callBound$h;
3114
3150
  var $boolToStr = callBound$5('Boolean.prototype.toString');
3115
3151
  var $toString$2 = callBound$5('Object.prototype.toString');
3116
3152
 
@@ -3146,7 +3182,7 @@
3146
3182
  if (hasRequiredSafeRegexTest) return safeRegexTest$1;
3147
3183
  hasRequiredSafeRegexTest = 1;
3148
3184
 
3149
- var callBound = callBound$i;
3185
+ var callBound = callBound$h;
3150
3186
  var isRegex = isRegex$1;
3151
3187
 
3152
3188
  var $exec = callBound('RegExp.prototype.exec');
@@ -3164,7 +3200,7 @@
3164
3200
  return safeRegexTest$1;
3165
3201
  }
3166
3202
 
3167
- var callBound$4 = callBound$i;
3203
+ var callBound$4 = callBound$h;
3168
3204
  var $toString$1 = callBound$4('Object.prototype.toString');
3169
3205
  var hasSymbols = hasSymbols$3();
3170
3206
  var safeRegexTest = requireSafeRegexTest();
@@ -3259,7 +3295,7 @@
3259
3295
 
3260
3296
  var isBigintExports = isBigint.exports;
3261
3297
 
3262
- var isString = isString$2;
3298
+ var isString = requireIsString();
3263
3299
  var isNumber = isNumberObject;
3264
3300
  var isBoolean = isBooleanObject;
3265
3301
  var isSymbol = isSymbolExports;
@@ -3337,7 +3373,7 @@
3337
3373
  var isWeakset = {exports: {}};
3338
3374
 
3339
3375
  var GetIntrinsic$1 = getIntrinsic;
3340
- var callBound$3 = callBound$i;
3376
+ var callBound$3 = callBound$h;
3341
3377
 
3342
3378
  var $WeakSet = GetIntrinsic$1('%WeakSet%', true);
3343
3379
 
@@ -3607,9 +3643,9 @@
3607
3643
  var forEach = forEach$1;
3608
3644
  var availableTypedArrays = availableTypedArrays$1;
3609
3645
  var callBind = callBindExports;
3610
- var callBound$2 = callBound$i;
3646
+ var callBound$2 = callBound$h;
3611
3647
  var gOPD = gopd$1;
3612
- var getProto = getProto$3;
3648
+ var getProto = requireGetProto();
3613
3649
 
3614
3650
  var $toString = callBound$2('Object.prototype.toString');
3615
3651
  var hasToStringTag = requireShams()();
@@ -3720,7 +3756,7 @@
3720
3756
  return tryTypedArrays(value);
3721
3757
  };
3722
3758
 
3723
- var callBound$1 = callBound$i;
3759
+ var callBound$1 = callBound$h;
3724
3760
  var $byteLength = callBound$1('ArrayBuffer.prototype.byteLength', true);
3725
3761
 
3726
3762
  var isArrayBuffer$1 = isArrayBuffer$2;
@@ -3734,7 +3770,7 @@
3734
3770
  }; // in node < 0.11, byteLength is an own nonconfigurable property
3735
3771
 
3736
3772
  var assign = object_assign;
3737
- var callBound = callBound$g;
3773
+ var callBound = callBound$f;
3738
3774
  var flags = regexp_prototype_flags;
3739
3775
  var GetIntrinsic = getIntrinsic;
3740
3776
  var getIterator = esGetIteratorExports;
@@ -5348,7 +5384,7 @@
5348
5384
  })(ChannelTypes || (ChannelTypes = {}));
5349
5385
  const defaultChannelsProps = ["id", "type", "broadcast", "addContextListener", "getCurrentContext"];
5350
5386
  const defaultContextProps = ["type"];
5351
- const defaultGlue42APIs = ["contexts", "channels", "interop", "intents", "appManager", "windows"];
5387
+ const defaultGlue42APIs = ["contexts", "channels", "interop", "intents", "windows"];
5352
5388
  const glueChannelNamePrefix = "___channel___";
5353
5389
  const fdc3NothingContextType = "fdc3.nothing";
5354
5390
  const RaiseTimeoutMs = 75 * 1000;
@@ -6265,22 +6301,65 @@
6265
6301
  if (missingApis.length) {
6266
6302
  return { isValid: false, error: { message: `Fdc3 cannot initialize correctly - Glue is missing the following ${missingApis.length > 1 ? "properties" : "property"}: ${missingApis.join(", ")}` } };
6267
6303
  }
6304
+ if (typeof glue.apps !== "object" && typeof glue.appManager !== "object") {
6305
+ return { isValid: false, error: { message: "Glue should be initialized with either 'apps' or 'appManager' API" } };
6306
+ }
6268
6307
  return { isValid: true };
6269
6308
  }
6270
6309
  interopInstance() {
6271
6310
  return this.glue.interop.instance;
6272
6311
  }
6273
- getApplication(name) {
6274
- return this.glue.appManager.application(name);
6312
+ async getApplication(options) {
6313
+ const isAppsAPIAvailable = this.isAppsAPIAvailable();
6314
+ if (!isAppsAPIAvailable) {
6315
+ return this.glue.appManager.application(options.name);
6316
+ }
6317
+ const app = await this.glue.apps.registry.get(options);
6318
+ return app ?? undefined;
6275
6319
  }
6276
- getAllAppManagerInstances() {
6277
- return this.glue.appManager.instances();
6320
+ async getApplicationInstances(appName) {
6321
+ const isAppsAPIAvailable = this.isAppsAPIAvailable();
6322
+ if (!isAppsAPIAvailable) {
6323
+ return this.glue.appManager.instances().filter(inst => inst.application.name === appName);
6324
+ }
6325
+ const appInstances = await this.glue.apps.instances.getMany({ appNames: [appName] });
6326
+ return appInstances;
6278
6327
  }
6279
- getApplicationInstances(appName) {
6280
- return this.getAllAppManagerInstances().filter(inst => inst.application.name === appName);
6328
+ async getAppInstanceById(id) {
6329
+ const isAppsAPIAvailable = this.isAppsAPIAvailable();
6330
+ if (!isAppsAPIAvailable) {
6331
+ return this.glue.appManager.instances().find(inst => inst.id === id);
6332
+ }
6333
+ const appInstance = await this.glue.apps.instances.get({ id });
6334
+ return appInstance ?? undefined;
6281
6335
  }
6282
- getAppInstanceById(id) {
6283
- return this.getAllAppManagerInstances().find(inst => inst.id === id);
6336
+ async getIoCDAppConfiguration(app) {
6337
+ const isAppsAPIAvailable = this.isAppsAPIAvailable();
6338
+ if (!isAppsAPIAvailable) {
6339
+ return app.getConfiguration();
6340
+ }
6341
+ const definition = app.definition;
6342
+ if (definition) {
6343
+ return definition;
6344
+ }
6345
+ const appWithDefinition = await this.glue.apps.registry.get({ name: app.name, includeDefinition: true });
6346
+ if (!appWithDefinition?.definition) {
6347
+ throw new Error(`Application definition for app '${app.name}' could not be found`);
6348
+ }
6349
+ return appWithDefinition.definition;
6350
+ }
6351
+ async startApplication({ app, context, waitForInstanceReady }) {
6352
+ const isAppsAPIAvailable = this.isAppsAPIAvailable();
6353
+ if (!isAppsAPIAvailable) {
6354
+ const glueInst = await app.start(context, { waitForAGMReady: waitForInstanceReady });
6355
+ return glueInst;
6356
+ }
6357
+ const glueInstance = await this.glue.apps.instances.start({ name: app.name, context });
6358
+ if (!waitForInstanceReady) {
6359
+ return glueInstance;
6360
+ }
6361
+ await this.glue.apps.instances.waitForReady({ id: glueInstance.id });
6362
+ return glueInstance;
6284
6363
  }
6285
6364
  async findIntents(intentFilter) {
6286
6365
  return this.glue.intents.find(intentFilter);
@@ -6404,8 +6483,15 @@
6404
6483
  getGlueVersion() {
6405
6484
  return this.glue?.version;
6406
6485
  }
6407
- registerOnInstanceStopped(cb) {
6408
- return this.glue.appManager.onInstanceStopped(cb);
6486
+ async registerOnInstanceStopped(callback) {
6487
+ const isAppsAPIAvailable = this.isAppsAPIAvailable();
6488
+ if (!isAppsAPIAvailable) {
6489
+ return this.glue.appManager.onInstanceStopped((inst) => callback(inst.id));
6490
+ }
6491
+ const unsub = await this.glue.apps.instances.onStopped((event) => {
6492
+ callback(event.instance.id);
6493
+ });
6494
+ return unsub;
6409
6495
  }
6410
6496
  async unregisterMethod(methodName) {
6411
6497
  return this.glue.interop.unregister(methodName);
@@ -6567,6 +6653,9 @@
6567
6653
  async contextsSetPaths(name, paths) {
6568
6654
  await this.glue.contexts.setPaths(name, paths);
6569
6655
  }
6656
+ isAppsAPIAvailable() {
6657
+ return typeof this.glue.apps === "object";
6658
+ }
6570
6659
  }
6571
6660
 
6572
6661
  const GLUE42_EVENT_NAME = "Glue42";
@@ -8585,7 +8674,7 @@
8585
8674
  if (!context && !resultType) {
8586
8675
  return this.convertGlue42IntentToFDC3Intent(searchedGlueIntent);
8587
8676
  }
8588
- const contextType = (context && context.type === fdc3NothingContextType) ? undefined : context?.type;
8677
+ const contextType = context?.type === fdc3NothingContextType ? undefined : context?.type;
8589
8678
  const filteredIntent = this.getGlueIntentWithFilteredHandlers(searchedGlueIntent, { contextType, resultType });
8590
8679
  if (!filteredIntent.handlers.length) {
8591
8680
  throw new Error(ResolveError.NoAppsFound);
@@ -8600,10 +8689,11 @@
8600
8689
  throw new Error(ResolveError.NoAppsFound);
8601
8690
  }
8602
8691
  this.logger?.info(`[${commandId}] - parsing glue intents to fdc3 intents and returning`);
8603
- return glueIntents.map((glueIntent) => {
8692
+ const appIntents = await Promise.all(glueIntents.map((glueIntent) => {
8604
8693
  const intentWithFilteredHandlers = this.getGlueIntentWithFilteredHandlers(glueIntent, { contextType: context.type, resultType });
8605
8694
  return this.convertGlue42IntentToFDC3Intent(intentWithFilteredHandlers);
8606
- });
8695
+ }));
8696
+ return appIntents;
8607
8697
  }
8608
8698
  async raiseIntent({ commandId, intent, context, target }) {
8609
8699
  await this.glueController.gluePromise;
@@ -8615,7 +8705,7 @@
8615
8705
  throw new Error(ResolveError.NoAppsFound);
8616
8706
  }
8617
8707
  if (!target) {
8618
- const filteredGlueIntent = this.filterGlueIntentHandlers({ commandId, intent: searchedGlueIntent, context, target });
8708
+ const filteredGlueIntent = await this.filterGlueIntentHandlers({ commandId, intent: searchedGlueIntent, context, target });
8619
8709
  this.logger?.info(`[${commandId}] - raising intent ${intent} with contextType ${context.type} and handlers ${filteredGlueIntent.handlers.map(h => h.applicationName && h.instanceId)}`);
8620
8710
  return this.invokeRaiseIntent(commandId, { intent, context: glueContext, handlers: filteredGlueIntent.handlers });
8621
8711
  }
@@ -8721,7 +8811,7 @@
8721
8811
  handler: rememberedHandlerWithFilter.handler
8722
8812
  };
8723
8813
  }
8724
- filterGlueIntentHandlers({ commandId, intent, context, target }) {
8814
+ async filterGlueIntentHandlers({ commandId, intent, context, target }) {
8725
8815
  let filteredGlueIntent;
8726
8816
  filteredGlueIntent = this.filterIntentHandlersByContext(intent, context);
8727
8817
  if (!target) {
@@ -8729,14 +8819,14 @@
8729
8819
  return filteredGlueIntent;
8730
8820
  }
8731
8821
  this.logger?.log(`[${commandId}] - filtering handlers by target (${JSON.stringify(target)}) for intent ${intent.name}`);
8732
- filteredGlueIntent = this.filterIntentHandlersByTarget({ intent, target, commandId });
8822
+ filteredGlueIntent = await this.filterIntentHandlersByTarget({ intent, target, commandId });
8733
8823
  return filteredGlueIntent;
8734
8824
  }
8735
- filterIntentHandlersByTarget({ intent, target, commandId }) {
8825
+ async filterIntentHandlersByTarget({ intent, target, commandId }) {
8736
8826
  const appName = typeof target === "string" ? target : target.appId;
8737
8827
  const instanceId = typeof target === "string" ? undefined : target.instanceId;
8738
8828
  this.logger?.info(`[${commandId}] - Checking if application with name ${appName} exists`);
8739
- const app = this.glueController.getApplication(appName);
8829
+ const app = await this.glueController.getApplication({ name: appName, includeDefinition: true, includeInstances: true });
8740
8830
  const serverInstances = this.serverInstanceAsIntentHandler(intent.name);
8741
8831
  if (!app && (typeof target === "string" || !target.instanceId || !serverInstances.length)) {
8742
8832
  throw new Error(ResolveError.TargetAppUnavailable);
@@ -8750,8 +8840,9 @@
8750
8840
  this.logger?.log(`[${commandId}] - returning all handlers for intent ${intent.name} and target: ${JSON.stringify(target)}`);
8751
8841
  return { name: intent.name, handlers: validHandlersByApplicationName };
8752
8842
  }
8843
+ const appInstances = app?.instances ?? await (this.glueController.getApplicationInstances(appName));
8753
8844
  const isValidInstanceOfTheApp = app
8754
- ? app.instances.find((inst) => inst.id === instanceId)
8845
+ ? appInstances.find((inst) => inst.id === instanceId)
8755
8846
  : serverInstances.find((inst) => inst.instance === instanceId);
8756
8847
  if (!isValidInstanceOfTheApp) {
8757
8848
  throw new Error(ResolveError.TargetInstanceUnavailable);
@@ -8816,27 +8907,33 @@
8816
8907
  this.logger?.info(`[${commandId}] - returning private channel`);
8817
8908
  return channel.toApi();
8818
8909
  }
8819
- convertGlue42IntentToFDC3Intent(glueIntent) {
8910
+ async convertGlue42IntentToFDC3Intent(glueIntent) {
8820
8911
  const { name, handlers } = glueIntent;
8912
+ const apps = await Promise.all(handlers.map(async (handler) => {
8913
+ const appName = handler.applicationName;
8914
+ const app = await this.glueController.getApplication({ name: appName, includeDefinition: true });
8915
+ const icons = [app?.icon, ...(app?.userProperties?.icons ?? []), ...(app?.customProperties?.icons ?? [])]
8916
+ .filter((icon) => !!icon)
8917
+ .map((icon) => ({ src: icon }));
8918
+ const images = [...(app?.userProperties?.images ?? []), ...(app?.customProperties?.images ?? [])]
8919
+ .filter((image) => !!image)
8920
+ .map((image) => ({ src: image }));
8921
+ const tooltip = app?.title || app?.userProperties?.tooltip || `${appName} (${handler.type})`;
8922
+ return {
8923
+ appId: appName,
8924
+ instanceId: handler.instanceId,
8925
+ name: appName,
8926
+ title: handler.applicationTitle || handler.instanceTitle || appName,
8927
+ tooltip,
8928
+ description: handler.applicationDescription,
8929
+ icons,
8930
+ images,
8931
+ resultType: handler.resultType
8932
+ };
8933
+ }));
8821
8934
  const appIntent = {
8822
8935
  intent: { name, displayName: handlers[0].displayName || "" },
8823
- apps: handlers.map((handler) => {
8824
- const appName = handler.applicationName;
8825
- const app = this.glueController.getApplication(appName);
8826
- const icons = (handler.applicationIcon ? [handler.applicationIcon, ...(app?.userProperties.icons ?? [])] : (app?.userProperties.icons ?? [])).filter((icon) => !!icon).map((icon) => ({ src: icon }));
8827
- const images = (app?.userProperties.images ?? []).filter((image) => !!image).map((image) => ({ src: image }));
8828
- return {
8829
- appId: appName,
8830
- instanceId: handler.instanceId,
8831
- name: appName,
8832
- title: handler.applicationTitle || handler.instanceTitle || appName,
8833
- tooltip: app?.userProperties.tooltip ?? `${appName} (${handler.type})`,
8834
- description: handler.applicationDescription,
8835
- icons,
8836
- images,
8837
- resultType: handler.resultType
8838
- };
8839
- })
8936
+ apps
8840
8937
  };
8841
8938
  return appIntent;
8842
8939
  }
@@ -8949,7 +9046,7 @@
8949
9046
  await this.glueController.gluePromise;
8950
9047
  this.logger?.log(`[${commandId}] - open() invoked with target ${JSON.stringify(target)} ${context ? `and contextType ${context.type}` : ""}`);
8951
9048
  const name = typeof target === "object" ? target.appId : target;
8952
- const app = this.glueController.getApplication(name);
9049
+ const app = await this.glueController.getApplication({ name });
8953
9050
  if (!app) {
8954
9051
  throw new Error(OpenError.AppNotFound);
8955
9052
  }
@@ -8960,8 +9057,7 @@
8960
9057
  }
8961
9058
  try {
8962
9059
  this.logger?.info(`[${commandId}] - opening app '${app.name}' without context`);
8963
- const inBrowser = this.glueController.isRunningInBrowser();
8964
- const glueInst = await app.start(undefined, { waitForAGMReady: !inBrowser });
9060
+ const glueInst = await this.glueController.startApplication({ app, waitForInstanceReady: !this.glueController.isRunningInBrowser() });
8965
9061
  this.logger?.info(`[${commandId}] - instance with id ${glueInst.id} started`);
8966
9062
  return this.parseGlueInstToAppIdentifier(glueInst);
8967
9063
  }
@@ -8973,12 +9069,12 @@
8973
9069
  await this.glueController.gluePromise;
8974
9070
  this.logger?.info(`[${commandId}] - findInstances() invoked with appIdentifier ${JSON.stringify(appIdentifier)}`);
8975
9071
  const { appId } = appIdentifier;
8976
- const app = this.glueController.getApplication(appId);
9072
+ const app = await this.glueController.getApplication({ name: appId, includeInstances: true, includeDefinition: true });
8977
9073
  if (!app) {
8978
9074
  throw new Error(ResolveError.NoAppsFound);
8979
9075
  }
8980
- const glueInstances = this.glueController.getApplicationInstances(appId);
8981
- const fdc3Instances = glueInstances.map(glueInst => this.parseGlueInstToAppIdentifier(glueInst));
9076
+ const appInstances = app.instances ?? await this.glueController.getApplicationInstances(appId);
9077
+ const fdc3Instances = appInstances.map(glueInst => this.parseGlueInstToAppIdentifier(glueInst));
8982
9078
  this.logger?.info(`[${commandId}] - ids of opened instances for appIdentifier ${JSON.stringify(appIdentifier)}: ${JSON.stringify(fdc3Instances.map(inst => inst.instanceId))}`);
8983
9079
  return fdc3Instances;
8984
9080
  }
@@ -8986,7 +9082,7 @@
8986
9082
  await this.glueController.gluePromise;
8987
9083
  this.logger?.info(`[${commandId}] - getAppMetadata() invoked with appIdentifier ${JSON.stringify(appIdentifier)}`);
8988
9084
  const { appId, instanceId } = appIdentifier;
8989
- const app = this.glueController.getApplication(appId);
9085
+ const app = await this.glueController.getApplication({ name: appId, includeDefinition: true, includeInstances: true });
8990
9086
  if (!app) {
8991
9087
  throw new Error(OpenError.AppNotFound);
8992
9088
  }
@@ -8994,7 +9090,7 @@
8994
9090
  this.logger?.info(`[${commandId}] - no opened instances found. Parsing app ${app.name}`);
8995
9091
  return this.parseGlueAppToAppMetadata(app);
8996
9092
  }
8997
- const instance = this.glueController.getAppInstanceById(instanceId);
9093
+ const instance = await this.glueController.getAppInstanceById(instanceId);
8998
9094
  const appMetadata = this.parseGlueAppToAppMetadata(app, instance);
8999
9095
  this.logger?.info(`[${commandId}] - found app metadata: ${appMetadata}`);
9000
9096
  return appMetadata;
@@ -9002,9 +9098,9 @@
9002
9098
  async getInfo({ commandId }) {
9003
9099
  await this.glueController.gluePromise;
9004
9100
  this.logger?.info(`${commandId} - getInfo() invoked`);
9005
- const appMetadata = this.getCurrentAppMetadata();
9101
+ const appMetadata = await this.getCurrentAppMetadata();
9006
9102
  const globalScope = typeof process !== "undefined" ? process : window;
9007
- const { provider, providerVersion, standardVersion } = globalScope.fdc3Info;
9103
+ const { provider, providerVersion, standardVersion } = globalScope.fdc3Info ?? {};
9008
9104
  return {
9009
9105
  provider,
9010
9106
  providerVersion,
@@ -9017,10 +9113,10 @@
9017
9113
  appMetadata
9018
9114
  };
9019
9115
  }
9020
- getCurrentAppMetadata() {
9116
+ async getCurrentAppMetadata() {
9021
9117
  const myInstance = this.glueController.interopInstance();
9022
9118
  const myInstanceApplicationName = myInstance.application ?? myInstance.applicationName;
9023
- const myApp = this.glueController.getApplication(myInstanceApplicationName);
9119
+ const myApp = await this.glueController.getApplication({ name: myInstanceApplicationName, includeDefinition: true });
9024
9120
  if (myApp) {
9025
9121
  return { appId: myApp.name, instanceId: myInstance.instance };
9026
9122
  }
@@ -9029,49 +9125,64 @@
9029
9125
  }
9030
9126
  parseGlueInstToAppIdentifier(glueInst) {
9031
9127
  return {
9032
- appId: glueInst.application.name,
9128
+ appId: this.isApplicationInstance(glueInst) ? glueInst.appName : glueInst.application.name,
9033
9129
  instanceId: glueInst.id
9034
9130
  };
9035
9131
  }
9036
9132
  async parseGlueAppToAppMetadata(app, instance) {
9037
- const appMetadata = await this.getBaseGlueAppToAppMetadata(app);
9133
+ const inBrowserNamespace = this.glueController.isRunningInBrowser();
9134
+ const appMetadata = inBrowserNamespace
9135
+ ? await this.getBaseGlueAppToAppMetadataInBrowser(app)
9136
+ : await this.getBaseGlueAppToAppMetadataInDesktop(app);
9038
9137
  if (!instance) {
9039
9138
  return appMetadata;
9040
9139
  }
9041
- return this.addInstanceMetadataToAppMetadata(appMetadata, instance);
9140
+ const instanceData = {
9141
+ instanceId: instance.id,
9142
+ instanceMetadata: this.isApplicationInstance(instance) ? instance.interopInstance : instance.agm
9143
+ };
9144
+ return { ...appMetadata, ...instanceData };
9042
9145
  }
9043
- async getBaseGlueAppToAppMetadata(app) {
9044
- const inBrowserNamespace = this.glueController.isRunningInBrowser();
9045
- const appConfiguration = inBrowserNamespace
9046
- ? app.userProperties
9047
- : await app.getConfiguration();
9048
- const icon = inBrowserNamespace
9049
- ? app.icon
9050
- : (await app.getConfiguration()).icon;
9146
+ async getBaseGlueAppToAppMetadataInDesktop(app) {
9147
+ const appConfiguration = await this.glueController.getIoCDAppConfiguration(app);
9148
+ const screenshots = appConfiguration.customProperties?.screenshots ?? appConfiguration.userProperties?.screenshots;
9149
+ return {
9150
+ appId: appConfiguration.name,
9151
+ name: appConfiguration.name,
9152
+ version: appConfiguration.version,
9153
+ description: appConfiguration.description,
9154
+ title: appConfiguration.title,
9155
+ icons: appConfiguration.icon ? [{ src: appConfiguration.icon }] : [],
9156
+ tooltip: appConfiguration.tooltip,
9157
+ screenshots
9158
+ };
9159
+ }
9160
+ async getBaseGlueAppToAppMetadataInBrowser(app) {
9051
9161
  return {
9052
9162
  appId: app.name,
9053
9163
  name: app.name,
9054
9164
  version: app.version,
9055
- description: appConfiguration.description,
9165
+ description: app.userProperties.description,
9056
9166
  title: app.title,
9057
- icons: icon ? [{ src: icon }] : [],
9058
- tooltip: appConfiguration.tooltip,
9059
- screenshots: inBrowserNamespace
9060
- ? appConfiguration.screenshots
9061
- : appConfiguration.customProperties.screenshots
9167
+ icons: app.icon ? [{ src: app.icon }] : [],
9168
+ tooltip: app.userProperties.tooltip,
9169
+ screenshots: app.userProperties.screenshots
9062
9170
  };
9063
9171
  }
9064
- addInstanceMetadataToAppMetadata(appMetadata, instance) {
9065
- return { ...appMetadata, instanceId: instance.id, instanceMetadata: instance.agm };
9172
+ isApplicationInstance(instance) {
9173
+ return "appName" in instance;
9066
9174
  }
9067
9175
  async openAppWithContext(app, context) {
9068
9176
  const guid = nanoid();
9069
9177
  const startContext = this.buildStartContext(context, guid);
9070
- const wrappedPromise = this.createContextListenerWrappedPromise(app);
9178
+ const wrappedPromise = this.createContextListenerWrappedPromise(app.name);
9071
9179
  this.appsStateStore.addOpenAppPromise(guid, wrappedPromise);
9072
- const inBrowser = this.glueController.isRunningInBrowser();
9073
9180
  try {
9074
- const glueInst = await app.start(startContext, { waitForAGMReady: !inBrowser });
9181
+ const glueInst = await this.glueController.startApplication({
9182
+ app,
9183
+ context: startContext,
9184
+ waitForInstanceReady: !this.glueController.isRunningInBrowser()
9185
+ });
9075
9186
  await wrappedPromise.promise;
9076
9187
  this.appsStateStore.removeOpenAppPromise(guid);
9077
9188
  return this.parseGlueInstToAppIdentifier(glueInst);
@@ -9098,15 +9209,16 @@
9098
9209
  }
9099
9210
  };
9100
9211
  }
9101
- createContextListenerWrappedPromise(app) {
9212
+ createContextListenerWrappedPromise(appName) {
9102
9213
  let resolve = () => { };
9103
9214
  let reject = () => { };
9215
+ const timeoutMessage = `Timeout of ${this.defaultContextListenerInvokedPromiseTimeout}ms hit waiting for application with appId: ${appName} to register context listener`;
9104
9216
  const promise = promisePlus(() => {
9105
9217
  return new Promise((res, rej) => {
9106
9218
  resolve = res;
9107
9219
  reject = rej;
9108
9220
  });
9109
- }, this.defaultContextListenerInvokedPromiseTimeout, `Timeout of ${this.defaultContextListenerInvokedPromiseTimeout}ms hit waiting for application with appId: ${app.name} to register context listener`);
9221
+ }, this.defaultContextListenerInvokedPromiseTimeout, timeoutMessage);
9110
9222
  return { promise, resolve, reject };
9111
9223
  }
9112
9224
  }
@@ -9533,9 +9645,12 @@
9533
9645
  this.channelsController.removePrivateChannelFromStoreById(this.id);
9534
9646
  await this.sendCollaborateMessage({ action: "disconnectedFromPrivateChannel" });
9535
9647
  this.logger?.trace(`[${commandId}] - collaborator received action ${"disconnectedFromPrivateChannel"}`);
9536
- if (this.unsubFromInstanceStopped) {
9537
- this.unsubFromInstanceStopped();
9648
+ if (!this.unsubFromInstanceStopped) {
9649
+ return;
9538
9650
  }
9651
+ const unsub = this.unsubFromInstanceStopped instanceof Promise ? await this.unsubFromInstanceStopped : this.unsubFromInstanceStopped;
9652
+ unsub();
9653
+ this.unsubFromInstanceStopped = undefined;
9539
9654
  }
9540
9655
  ensureAlive(commandId) {
9541
9656
  if (!this.disconnected) {
@@ -9554,8 +9669,8 @@
9554
9669
  throw new Error(ChannelError.AccessDenied);
9555
9670
  }
9556
9671
  subscribeForCollaboratorInstanceStop(commandId) {
9557
- const handler = (instance) => {
9558
- if (instance.id !== this.collaborator?.instanceId) {
9672
+ const handler = (id) => {
9673
+ if (id !== this.collaborator?.instanceId) {
9559
9674
  return;
9560
9675
  }
9561
9676
  this.handleCollaboratorDisconnect();
@@ -10440,7 +10555,7 @@
10440
10555
  return ioc.fdc3;
10441
10556
  };
10442
10557
 
10443
- var version = "2.7.1-beta.0";
10558
+ var version = "2.7.2";
10444
10559
 
10445
10560
  const globalScope = typeof process !== "undefined" ? process : window;
10446
10561
  globalScope.fdc3Info = {