@openfin/node-adapter 44.100.62 → 45.100.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/out/node-adapter.js +359 -175
  2. package/package.json +5 -5
@@ -44,13 +44,13 @@ var system = {};
44
44
 
45
45
  var base = {};
46
46
 
47
- var __classPrivateFieldSet$h = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
47
+ var __classPrivateFieldSet$i = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
48
48
  if (kind === "m") throw new TypeError("Private method is not writable");
49
49
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
50
50
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
51
51
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
52
52
  };
53
- var __classPrivateFieldGet$i = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
53
+ var __classPrivateFieldGet$j = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
54
54
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
55
55
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
56
56
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
@@ -134,9 +134,9 @@ class EmitterBase extends Base {
134
134
  this.emit = (eventType, payload, ...args) => {
135
135
  return this.hasEmitter() ? this.getOrCreateEmitter().emit(eventType, payload, ...args) : false;
136
136
  };
137
- this.hasEmitter = () => this.wire.eventAggregator.has(__classPrivateFieldGet$i(this, _EmitterBase_emitterAccessor, "f"));
137
+ this.hasEmitter = () => this.wire.eventAggregator.has(__classPrivateFieldGet$j(this, _EmitterBase_emitterAccessor, "f"));
138
138
  this.getOrCreateEmitter = () => {
139
- return this.wire.eventAggregator.getOrCreate(__classPrivateFieldGet$i(this, _EmitterBase_emitterAccessor, "f"));
139
+ return this.wire.eventAggregator.getOrCreate(__classPrivateFieldGet$j(this, _EmitterBase_emitterAccessor, "f"));
140
140
  };
141
141
  this.listeners = (type) => this.hasEmitter() ? this.getOrCreateEmitter().listeners(type) : [];
142
142
  this.listenerCount = (type) => this.hasEmitter() ? this.getOrCreateEmitter().listenerCount(type) : 0;
@@ -174,8 +174,8 @@ class EmitterBase extends Base {
174
174
  // This will only be reached if unsubscribe from event that does not exist but do not want to error here
175
175
  return Promise.resolve();
176
176
  };
177
- __classPrivateFieldSet$h(this, _EmitterBase_emitterAccessor, [topic, ...additionalAccessors], "f");
178
- __classPrivateFieldSet$h(this, _EmitterBase_deregisterOnceListeners, new WeakMap(), "f");
177
+ __classPrivateFieldSet$i(this, _EmitterBase_emitterAccessor, [topic, ...additionalAccessors], "f");
178
+ __classPrivateFieldSet$i(this, _EmitterBase_deregisterOnceListeners, new WeakMap(), "f");
179
179
  }
180
180
  /**
181
181
  * Adds a listener to the end of the listeners array for the specified event.
@@ -203,7 +203,7 @@ class EmitterBase extends Base {
203
203
  */
204
204
  async once(eventType, listener, options) {
205
205
  const deregister = () => this.deregisterEventListener(eventType);
206
- __classPrivateFieldGet$i(this, _EmitterBase_deregisterOnceListeners, "f").set(listener, deregister);
206
+ __classPrivateFieldGet$j(this, _EmitterBase_deregisterOnceListeners, "f").set(listener, deregister);
207
207
  await this.registerEventListener(eventType, options, (emitter) => {
208
208
  emitter.once(eventType, deregister);
209
209
  emitter.once(eventType, listener);
@@ -234,7 +234,7 @@ class EmitterBase extends Base {
234
234
  */
235
235
  async prependOnceListener(eventType, listener, options) {
236
236
  const deregister = () => this.deregisterEventListener(eventType);
237
- __classPrivateFieldGet$i(this, _EmitterBase_deregisterOnceListeners, "f").set(listener, deregister);
237
+ __classPrivateFieldGet$j(this, _EmitterBase_deregisterOnceListeners, "f").set(listener, deregister);
238
238
  await this.registerEventListener(eventType, options, (emitter) => {
239
239
  emitter.prependOnceListener(eventType, listener);
240
240
  emitter.once(eventType, deregister);
@@ -253,7 +253,7 @@ class EmitterBase extends Base {
253
253
  const emitter = await this.deregisterEventListener(eventType, options);
254
254
  if (emitter) {
255
255
  emitter.removeListener(eventType, listener);
256
- const deregister = __classPrivateFieldGet$i(this, _EmitterBase_deregisterOnceListeners, "f").get(listener);
256
+ const deregister = __classPrivateFieldGet$j(this, _EmitterBase_deregisterOnceListeners, "f").get(listener);
257
257
  if (deregister) {
258
258
  emitter.removeListener(eventType, deregister);
259
259
  }
@@ -299,7 +299,7 @@ class EmitterBase extends Base {
299
299
  deleteEmitterIfNothingRegistered(emitter) {
300
300
  // TODO: maybe emitterMap should clean up itself..
301
301
  if (emitter.eventNames().length === 0) {
302
- this.wire.eventAggregator.delete(__classPrivateFieldGet$i(this, _EmitterBase_emitterAccessor, "f"));
302
+ this.wire.eventAggregator.delete(__classPrivateFieldGet$j(this, _EmitterBase_emitterAccessor, "f"));
303
303
  }
304
304
  }
305
305
  }
@@ -5502,6 +5502,11 @@ class System extends base_1$m.EmitterBase {
5502
5502
  /**
5503
5503
  * Returns a unique identifier (UUID) provided by the machine.
5504
5504
  *
5505
+ * On Windows, the machine ID is the `MachineGuid` value located in the Windows Registry at:
5506
+ * `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography`.
5507
+ *
5508
+ * On macOS, the machine ID is the hardware UUID of the machine, obtained via native OS APIs.
5509
+ *
5505
5510
  * @example
5506
5511
  * ```js
5507
5512
  * fin.System.getMachineId().then(id => console.log(id)).catch(err => console.log(err));
@@ -7590,12 +7595,12 @@ class ChannelError extends Error {
7590
7595
  }
7591
7596
  channelError.ChannelError = ChannelError;
7592
7597
 
7593
- var __classPrivateFieldGet$h = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
7598
+ var __classPrivateFieldGet$i = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
7594
7599
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
7595
7600
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
7596
7601
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
7597
7602
  };
7598
- var __classPrivateFieldSet$g = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
7603
+ var __classPrivateFieldSet$h = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
7599
7604
  if (kind === "m") throw new TypeError("Private method is not writable");
7600
7605
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
7601
7606
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
@@ -7639,7 +7644,7 @@ class ChannelClient extends channel_1$1.ChannelBase {
7639
7644
  static closeChannelByEndpointId(id) {
7640
7645
  const channel = channelClientsByEndpointId.get(id);
7641
7646
  if (channel) {
7642
- __classPrivateFieldGet$h(channel, _ChannelClient_close, "f").call(channel);
7647
+ __classPrivateFieldGet$i(channel, _ChannelClient_close, "f").call(channel);
7643
7648
  }
7644
7649
  }
7645
7650
  /**
@@ -7650,7 +7655,7 @@ class ChannelClient extends channel_1$1.ChannelBase {
7650
7655
  for (const channelClient of channelClientsByEndpointId.values()) {
7651
7656
  if (channelClient.providerIdentity.channelId === eventPayload.channelId) {
7652
7657
  channelClient.disconnectListener(eventPayload);
7653
- __classPrivateFieldGet$h(channelClient, _ChannelClient_close, "f").call(channelClient);
7658
+ __classPrivateFieldGet$i(channelClient, _ChannelClient_close, "f").call(channelClient);
7654
7659
  }
7655
7660
  }
7656
7661
  }
@@ -7665,12 +7670,12 @@ class ChannelClient extends channel_1$1.ChannelBase {
7665
7670
  this.processAction = (action, payload, senderIdentity) => super.processAction(action, payload, senderIdentity);
7666
7671
  _ChannelClient_close.set(this, () => {
7667
7672
  channelClientsByEndpointId.delete(this.endpointId);
7668
- __classPrivateFieldGet$h(this, _ChannelClient_strategy, "f").close();
7673
+ __classPrivateFieldGet$i(this, _ChannelClient_strategy, "f").close();
7669
7674
  });
7670
- __classPrivateFieldSet$g(this, _ChannelClient_protectedObj, new channel_1$1.ProtectedItems(routingInfo, close), "f");
7675
+ __classPrivateFieldSet$h(this, _ChannelClient_protectedObj, new channel_1$1.ProtectedItems(routingInfo, close), "f");
7671
7676
  this.disconnectListener = () => undefined;
7672
7677
  this.endpointId = routingInfo.endpointId;
7673
- __classPrivateFieldSet$g(this, _ChannelClient_strategy, strategy, "f");
7678
+ __classPrivateFieldSet$h(this, _ChannelClient_strategy, strategy, "f");
7674
7679
  channelClientsByEndpointId.set(this.endpointId, this);
7675
7680
  strategy.receive(this.processAction);
7676
7681
  }
@@ -7678,7 +7683,7 @@ class ChannelClient extends channel_1$1.ChannelBase {
7678
7683
  * a read-only provider identity
7679
7684
  */
7680
7685
  get providerIdentity() {
7681
- const protectedObj = __classPrivateFieldGet$h(this, _ChannelClient_protectedObj, "f");
7686
+ const protectedObj = __classPrivateFieldGet$i(this, _ChannelClient_protectedObj, "f");
7682
7687
  return protectedObj.providerIdentity;
7683
7688
  }
7684
7689
  /**
@@ -7707,9 +7712,9 @@ class ChannelClient extends channel_1$1.ChannelBase {
7707
7712
  * ```
7708
7713
  */
7709
7714
  async dispatch(action, payload) {
7710
- if (__classPrivateFieldGet$h(this, _ChannelClient_strategy, "f").isEndpointConnected(this.providerIdentity.channelId)) {
7715
+ if (__classPrivateFieldGet$i(this, _ChannelClient_strategy, "f").isEndpointConnected(this.providerIdentity.channelId)) {
7711
7716
  const callSites = transport_errors_1$3.RuntimeError.getCallSite();
7712
- return __classPrivateFieldGet$h(this, _ChannelClient_strategy, "f").send(this.providerIdentity.channelId, action, payload).catch((e) => {
7717
+ return __classPrivateFieldGet$i(this, _ChannelClient_strategy, "f").send(this.providerIdentity.channelId, action, payload).catch((e) => {
7713
7718
  throw new channel_error_1$1.ChannelError(e, action, payload, callSites);
7714
7719
  });
7715
7720
  }
@@ -7761,10 +7766,10 @@ class ChannelClient extends channel_1$1.ChannelBase {
7761
7766
  */
7762
7767
  async disconnect() {
7763
7768
  await this.sendDisconnectAction();
7764
- __classPrivateFieldGet$h(this, _ChannelClient_close, "f").call(this);
7769
+ __classPrivateFieldGet$i(this, _ChannelClient_close, "f").call(this);
7765
7770
  }
7766
7771
  async sendDisconnectAction() {
7767
- const protectedObj = __classPrivateFieldGet$h(this, _ChannelClient_protectedObj, "f");
7772
+ const protectedObj = __classPrivateFieldGet$i(this, _ChannelClient_protectedObj, "f");
7768
7773
  await protectedObj.close();
7769
7774
  }
7770
7775
  /**
@@ -7797,13 +7802,13 @@ exhaustive.exhaustiveCheck = exhaustiveCheck;
7797
7802
 
7798
7803
  var strategy$3 = {};
7799
7804
 
7800
- var __classPrivateFieldSet$f = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
7805
+ var __classPrivateFieldSet$g = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
7801
7806
  if (kind === "m") throw new TypeError("Private method is not writable");
7802
7807
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
7803
7808
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
7804
7809
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
7805
7810
  };
7806
- var __classPrivateFieldGet$g = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
7811
+ var __classPrivateFieldGet$h = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
7807
7812
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
7808
7813
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
7809
7814
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
@@ -7828,7 +7833,7 @@ class ClassicStrategy {
7828
7833
  // connection problems occur
7829
7834
  _ClassicStrategy_pendingMessagesByEndpointId.set(this, new Map());
7830
7835
  this.send = async (endpointId, action, payload) => {
7831
- const to = __classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
7836
+ const to = __classPrivateFieldGet$h(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
7832
7837
  if (!to) {
7833
7838
  throw new Error(`Could not locate routing info for endpoint ${endpointId}`);
7834
7839
  }
@@ -7840,13 +7845,13 @@ class ClassicStrategy {
7840
7845
  }
7841
7846
  delete cleanId.isLocalEndpointId;
7842
7847
  // grab the promise before awaiting it to save in our pending messages map
7843
- const p = __classPrivateFieldGet$g(this, _ClassicStrategy_wire, "f").sendAction('send-channel-message', {
7848
+ const p = __classPrivateFieldGet$h(this, _ClassicStrategy_wire, "f").sendAction('send-channel-message', {
7844
7849
  ...cleanId,
7845
7850
  providerIdentity: this.providerIdentity,
7846
7851
  action,
7847
7852
  payload
7848
7853
  });
7849
- __classPrivateFieldGet$g(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.add(p);
7854
+ __classPrivateFieldGet$h(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.add(p);
7850
7855
  const raw = await p
7851
7856
  .catch((error) => {
7852
7857
  if ('cause' in error) {
@@ -7856,16 +7861,16 @@ class ClassicStrategy {
7856
7861
  })
7857
7862
  .finally(() => {
7858
7863
  // clean up the pending promise
7859
- __classPrivateFieldGet$g(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.delete(p);
7864
+ __classPrivateFieldGet$h(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.delete(p);
7860
7865
  });
7861
7866
  return raw.payload.data.result;
7862
7867
  };
7863
7868
  this.close = async () => {
7864
7869
  this.messageReceiver.removeEndpoint(this.providerIdentity.channelId, this.endpointId);
7865
- [...__classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").keys()].forEach((id) => this.closeEndpoint(id));
7866
- __classPrivateFieldSet$f(this, _ClassicStrategy_endpointIdentityMap, new Map(), "f");
7870
+ [...__classPrivateFieldGet$h(this, _ClassicStrategy_endpointIdentityMap, "f").keys()].forEach((id) => this.closeEndpoint(id));
7871
+ __classPrivateFieldSet$g(this, _ClassicStrategy_endpointIdentityMap, new Map(), "f");
7867
7872
  };
7868
- __classPrivateFieldSet$f(this, _ClassicStrategy_wire, wire, "f");
7873
+ __classPrivateFieldSet$g(this, _ClassicStrategy_wire, wire, "f");
7869
7874
  }
7870
7875
  onEndpointDisconnect(endpointId, listener) {
7871
7876
  // Never fires for 'classic'.
@@ -7874,20 +7879,20 @@ class ClassicStrategy {
7874
7879
  this.messageReceiver.addEndpoint(listener, this.providerIdentity.channelId, this.endpointId);
7875
7880
  }
7876
7881
  async closeEndpoint(endpointId) {
7877
- const id = __classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
7878
- __classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").delete(endpointId);
7879
- const pendingSet = __classPrivateFieldGet$g(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId);
7882
+ const id = __classPrivateFieldGet$h(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
7883
+ __classPrivateFieldGet$h(this, _ClassicStrategy_endpointIdentityMap, "f").delete(endpointId);
7884
+ const pendingSet = __classPrivateFieldGet$h(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId);
7880
7885
  pendingSet?.forEach((p) => {
7881
7886
  const errorMsg = `Channel connection with identity uuid: ${id?.uuid} / name: ${id?.name} / endpointId: ${endpointId} no longer connected.`;
7882
7887
  p.cancel(new Error(errorMsg));
7883
7888
  });
7884
7889
  }
7885
7890
  isEndpointConnected(endpointId) {
7886
- return __classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").has(endpointId);
7891
+ return __classPrivateFieldGet$h(this, _ClassicStrategy_endpointIdentityMap, "f").has(endpointId);
7887
7892
  }
7888
7893
  addEndpoint(endpointId, payload) {
7889
- __classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").set(endpointId, payload.endpointIdentity);
7890
- __classPrivateFieldGet$g(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").set(endpointId, new Set());
7894
+ __classPrivateFieldGet$h(this, _ClassicStrategy_endpointIdentityMap, "f").set(endpointId, payload.endpointIdentity);
7895
+ __classPrivateFieldGet$h(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").set(endpointId, new Set());
7891
7896
  }
7892
7897
  isValidEndpointPayload(payload) {
7893
7898
  return (typeof payload?.endpointIdentity?.endpointId === 'string' ||
@@ -7922,12 +7927,12 @@ function errorToPOJO(error) {
7922
7927
  }
7923
7928
  errors.errorToPOJO = errorToPOJO;
7924
7929
 
7925
- var __classPrivateFieldGet$f = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
7930
+ var __classPrivateFieldGet$g = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
7926
7931
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
7927
7932
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
7928
7933
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
7929
7934
  };
7930
- var __classPrivateFieldSet$e = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
7935
+ var __classPrivateFieldSet$f = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
7931
7936
  if (kind === "m") throw new TypeError("Private method is not writable");
7932
7937
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
7933
7938
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
@@ -7962,8 +7967,8 @@ class RTCEndpoint {
7962
7967
  if (this.rtc.rtcClient.connectionState !== 'connected') {
7963
7968
  this.rtc.rtcClient.removeEventListener('connectionstatechange', this.connectionStateChangeHandler);
7964
7969
  this.close();
7965
- if (__classPrivateFieldGet$f(this, _RTCEndpoint_disconnectListener, "f")) {
7966
- __classPrivateFieldGet$f(this, _RTCEndpoint_disconnectListener, "f").call(this);
7970
+ if (__classPrivateFieldGet$g(this, _RTCEndpoint_disconnectListener, "f")) {
7971
+ __classPrivateFieldGet$g(this, _RTCEndpoint_disconnectListener, "f").call(this);
7967
7972
  }
7968
7973
  }
7969
7974
  };
@@ -8011,9 +8016,9 @@ class RTCEndpoint {
8011
8016
  data = new TextDecoder().decode(e.data);
8012
8017
  }
8013
8018
  const { messageId, action, payload } = JSON.parse(data);
8014
- if (__classPrivateFieldGet$f(this, _RTCEndpoint_processAction, "f")) {
8019
+ if (__classPrivateFieldGet$g(this, _RTCEndpoint_processAction, "f")) {
8015
8020
  try {
8016
- const res = await __classPrivateFieldGet$f(this, _RTCEndpoint_processAction, "f").call(this, action, payload, endpointIdentity);
8021
+ const res = await __classPrivateFieldGet$g(this, _RTCEndpoint_processAction, "f").call(this, action, payload, endpointIdentity);
8017
8022
  this.rtc.channels.response.send(JSON.stringify({
8018
8023
  messageId,
8019
8024
  payload: res,
@@ -8047,25 +8052,25 @@ class RTCEndpoint {
8047
8052
  datachannel.onclose = (e) => {
8048
8053
  [...this.responseMap.values()].forEach((promise) => promise.reject(new Error('RTCDataChannel closed unexpectedly, this is most commonly caused by message size. Note: RTC Channels have a message size limit of ~255kB.')));
8049
8054
  this.close();
8050
- if (__classPrivateFieldGet$f(this, _RTCEndpoint_disconnectListener, "f")) {
8051
- __classPrivateFieldGet$f(this, _RTCEndpoint_disconnectListener, "f").call(this);
8055
+ if (__classPrivateFieldGet$g(this, _RTCEndpoint_disconnectListener, "f")) {
8056
+ __classPrivateFieldGet$g(this, _RTCEndpoint_disconnectListener, "f").call(this);
8052
8057
  }
8053
8058
  };
8054
8059
  });
8055
8060
  }
8056
8061
  onDisconnect(listener) {
8057
- if (!__classPrivateFieldGet$f(this, _RTCEndpoint_disconnectListener, "f")) {
8058
- __classPrivateFieldSet$e(this, _RTCEndpoint_disconnectListener, listener, "f");
8062
+ if (!__classPrivateFieldGet$g(this, _RTCEndpoint_disconnectListener, "f")) {
8063
+ __classPrivateFieldSet$f(this, _RTCEndpoint_disconnectListener, listener, "f");
8059
8064
  }
8060
8065
  else {
8061
8066
  throw new Error('RTCEndpoint disconnectListener cannot be set twice.');
8062
8067
  }
8063
8068
  }
8064
8069
  receive(listener) {
8065
- if (__classPrivateFieldGet$f(this, _RTCEndpoint_processAction, "f")) {
8070
+ if (__classPrivateFieldGet$g(this, _RTCEndpoint_processAction, "f")) {
8066
8071
  throw new Error('You have already set a listener for this RTC Endpoint.');
8067
8072
  }
8068
- __classPrivateFieldSet$e(this, _RTCEndpoint_processAction, listener, "f");
8073
+ __classPrivateFieldSet$f(this, _RTCEndpoint_processAction, listener, "f");
8069
8074
  }
8070
8075
  get connected() {
8071
8076
  return this.rtc.rtcClient.connectionState === 'connected';
@@ -8076,12 +8081,12 @@ _RTCEndpoint_processAction = new WeakMap(), _RTCEndpoint_disconnectListener = ne
8076
8081
 
8077
8082
  var strategy$1 = {};
8078
8083
 
8079
- var __classPrivateFieldGet$e = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8084
+ var __classPrivateFieldGet$f = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8080
8085
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
8081
8086
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
8082
8087
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
8083
8088
  };
8084
- var __classPrivateFieldSet$d = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
8089
+ var __classPrivateFieldSet$e = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
8085
8090
  if (kind === "m") throw new TypeError("Private method is not writable");
8086
8091
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
8087
8092
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
@@ -8102,11 +8107,11 @@ class EndpointStrategy {
8102
8107
  return this.getEndpointById(endpointId).send(action, payload);
8103
8108
  };
8104
8109
  this.close = async () => {
8105
- if (__classPrivateFieldGet$e(this, _EndpointStrategy_connected, "f")) {
8106
- __classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").forEach((endpoint) => endpoint.close());
8107
- __classPrivateFieldSet$d(this, _EndpointStrategy_endpointMap, new Map(), "f");
8110
+ if (__classPrivateFieldGet$f(this, _EndpointStrategy_connected, "f")) {
8111
+ __classPrivateFieldGet$f(this, _EndpointStrategy_endpointMap, "f").forEach((endpoint) => endpoint.close());
8112
+ __classPrivateFieldSet$e(this, _EndpointStrategy_endpointMap, new Map(), "f");
8108
8113
  }
8109
- __classPrivateFieldSet$d(this, _EndpointStrategy_connected, false, "f");
8114
+ __classPrivateFieldSet$e(this, _EndpointStrategy_connected, false, "f");
8110
8115
  };
8111
8116
  this.isValidEndpointPayload = validateEndpoint;
8112
8117
  }
@@ -8114,39 +8119,39 @@ class EndpointStrategy {
8114
8119
  this.getEndpointById(endpointId).onDisconnect(listener);
8115
8120
  }
8116
8121
  receive(listener) {
8117
- if (__classPrivateFieldGet$e(this, _EndpointStrategy_processAction, "f")) {
8122
+ if (__classPrivateFieldGet$f(this, _EndpointStrategy_processAction, "f")) {
8118
8123
  throw new Error(`You have already set a listener for this ${this.StrategyName} Strategy`);
8119
8124
  }
8120
- __classPrivateFieldSet$d(this, _EndpointStrategy_processAction, listener, "f");
8125
+ __classPrivateFieldSet$e(this, _EndpointStrategy_processAction, listener, "f");
8121
8126
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
8122
- __classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").forEach((endpoint) => endpoint.receive(__classPrivateFieldGet$e(this, _EndpointStrategy_processAction, "f")));
8127
+ __classPrivateFieldGet$f(this, _EndpointStrategy_endpointMap, "f").forEach((endpoint) => endpoint.receive(__classPrivateFieldGet$f(this, _EndpointStrategy_processAction, "f")));
8123
8128
  }
8124
8129
  getEndpointById(endpointId) {
8125
- const endpoint = __classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").get(endpointId);
8130
+ const endpoint = __classPrivateFieldGet$f(this, _EndpointStrategy_endpointMap, "f").get(endpointId);
8126
8131
  if (!endpoint) {
8127
8132
  throw new Error(`Client with endpoint id ${endpointId} is not connected`);
8128
8133
  }
8129
8134
  return endpoint;
8130
8135
  }
8131
8136
  get connected() {
8132
- return __classPrivateFieldGet$e(this, _EndpointStrategy_connected, "f");
8137
+ return __classPrivateFieldGet$f(this, _EndpointStrategy_connected, "f");
8133
8138
  }
8134
8139
  isEndpointConnected(endpointId) {
8135
- return __classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").has(endpointId);
8140
+ return __classPrivateFieldGet$f(this, _EndpointStrategy_endpointMap, "f").has(endpointId);
8136
8141
  }
8137
8142
  addEndpoint(endpointId, payload) {
8138
- if (!__classPrivateFieldGet$e(this, _EndpointStrategy_connected, "f")) {
8143
+ if (!__classPrivateFieldGet$f(this, _EndpointStrategy_connected, "f")) {
8139
8144
  console.warn(`Adding endpoint to disconnected ${this.StrategyName} Strategy`);
8140
8145
  return;
8141
8146
  }
8142
8147
  const clientStrat = new this.EndpointType(payload);
8143
- if (__classPrivateFieldGet$e(this, _EndpointStrategy_processAction, "f")) {
8144
- clientStrat.receive(__classPrivateFieldGet$e(this, _EndpointStrategy_processAction, "f"));
8148
+ if (__classPrivateFieldGet$f(this, _EndpointStrategy_processAction, "f")) {
8149
+ clientStrat.receive(__classPrivateFieldGet$f(this, _EndpointStrategy_processAction, "f"));
8145
8150
  }
8146
- __classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").set(endpointId, clientStrat);
8151
+ __classPrivateFieldGet$f(this, _EndpointStrategy_endpointMap, "f").set(endpointId, clientStrat);
8147
8152
  }
8148
8153
  async closeEndpoint(endpointId) {
8149
- __classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").delete(endpointId);
8154
+ __classPrivateFieldGet$f(this, _EndpointStrategy_endpointMap, "f").delete(endpointId);
8150
8155
  }
8151
8156
  }
8152
8157
  strategy$1.EndpointStrategy = EndpointStrategy;
@@ -8328,12 +8333,12 @@ function runtimeUuidMeetsMinimumRuntimeVersion(runtimeUuid, minVersion) {
8328
8333
  }
8329
8334
  runtimeVersioning.runtimeUuidMeetsMinimumRuntimeVersion = runtimeUuidMeetsMinimumRuntimeVersion;
8330
8335
 
8331
- var __classPrivateFieldGet$d = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8336
+ var __classPrivateFieldGet$e = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8332
8337
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
8333
8338
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
8334
8339
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
8335
8340
  };
8336
- var __classPrivateFieldSet$c = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
8341
+ var __classPrivateFieldSet$d = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
8337
8342
  if (kind === "m") throw new TypeError("Private method is not writable");
8338
8343
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
8339
8344
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
@@ -8377,19 +8382,19 @@ class ChannelProvider extends channel_1.ChannelBase {
8377
8382
  * a read-only array containing all the identities of connecting clients.
8378
8383
  */
8379
8384
  get connections() {
8380
- return [...__classPrivateFieldGet$d(this, _ChannelProvider_connections, "f")];
8385
+ return [...__classPrivateFieldGet$e(this, _ChannelProvider_connections, "f")];
8381
8386
  }
8382
8387
  static handleClientDisconnection(channel, payload) {
8383
8388
  if (payload?.endpointId) {
8384
8389
  const { uuid, name, endpointId, isLocalEndpointId } = payload;
8385
- __classPrivateFieldGet$d(channel, _ChannelProvider_removeEndpoint, "f").call(channel, { uuid, name, endpointId, isLocalEndpointId });
8390
+ __classPrivateFieldGet$e(channel, _ChannelProvider_removeEndpoint, "f").call(channel, { uuid, name, endpointId, isLocalEndpointId });
8386
8391
  }
8387
8392
  else {
8388
8393
  // this is here to support older runtimes that did not have endpointId
8389
8394
  const multipleRemoves = channel.connections.filter((identity) => {
8390
8395
  return identity.uuid === payload.uuid && identity.name === payload.name;
8391
8396
  });
8392
- multipleRemoves.forEach(__classPrivateFieldGet$d(channel, _ChannelProvider_removeEndpoint, "f"));
8397
+ multipleRemoves.forEach(__classPrivateFieldGet$e(channel, _ChannelProvider_removeEndpoint, "f"));
8393
8398
  }
8394
8399
  channel.disconnectListener(payload);
8395
8400
  }
@@ -8406,8 +8411,8 @@ class ChannelProvider extends channel_1.ChannelBase {
8406
8411
  _ChannelProvider_strategy.set(this, void 0);
8407
8412
  _ChannelProvider_removeEndpoint.set(this, (identity) => {
8408
8413
  const remainingConnections = this.connections.filter((clientIdentity) => clientIdentity.endpointId !== identity.endpointId);
8409
- __classPrivateFieldGet$d(this, _ChannelProvider_strategy, "f").closeEndpoint(identity.endpointId);
8410
- __classPrivateFieldSet$c(this, _ChannelProvider_connections, remainingConnections, "f");
8414
+ __classPrivateFieldGet$e(this, _ChannelProvider_strategy, "f").closeEndpoint(identity.endpointId);
8415
+ __classPrivateFieldSet$d(this, _ChannelProvider_connections, remainingConnections, "f");
8411
8416
  });
8412
8417
  // Must be bound.
8413
8418
  this.processAction = async (action, payload, senderIdentity) => {
@@ -8421,17 +8426,17 @@ class ChannelProvider extends channel_1.ChannelBase {
8421
8426
  return super.processAction(action, payload, senderIdentity);
8422
8427
  };
8423
8428
  _ChannelProvider_close.set(this, () => {
8424
- __classPrivateFieldGet$d(this, _ChannelProvider_strategy, "f").close();
8429
+ __classPrivateFieldGet$e(this, _ChannelProvider_strategy, "f").close();
8425
8430
  const remove = ChannelProvider.removalMap.get(this);
8426
8431
  if (remove) {
8427
8432
  remove();
8428
8433
  }
8429
8434
  });
8430
- __classPrivateFieldSet$c(this, _ChannelProvider_protectedObj, new channel_1.ProtectedItems(providerIdentity, close), "f");
8435
+ __classPrivateFieldSet$d(this, _ChannelProvider_protectedObj, new channel_1.ProtectedItems(providerIdentity, close), "f");
8431
8436
  this.connectListener = () => undefined;
8432
8437
  this.disconnectListener = () => undefined;
8433
- __classPrivateFieldSet$c(this, _ChannelProvider_connections, [], "f");
8434
- __classPrivateFieldSet$c(this, _ChannelProvider_strategy, strategy, "f");
8438
+ __classPrivateFieldSet$d(this, _ChannelProvider_connections, [], "f");
8439
+ __classPrivateFieldSet$d(this, _ChannelProvider_strategy, strategy, "f");
8435
8440
  strategy.receive(this.processAction);
8436
8441
  }
8437
8442
  /**
@@ -8462,16 +8467,16 @@ class ChannelProvider extends channel_1.ChannelBase {
8462
8467
  */
8463
8468
  dispatch(to, action, payload) {
8464
8469
  const endpointId = to.endpointId ?? this.getEndpointIdForOpenFinId(to, action);
8465
- if (endpointId && __classPrivateFieldGet$d(this, _ChannelProvider_strategy, "f").isEndpointConnected(endpointId)) {
8470
+ if (endpointId && __classPrivateFieldGet$e(this, _ChannelProvider_strategy, "f").isEndpointConnected(endpointId)) {
8466
8471
  const callSites = transport_errors_1$2.RuntimeError.getCallSite();
8467
- return __classPrivateFieldGet$d(this, _ChannelProvider_strategy, "f").send(endpointId, action, payload).catch((e) => {
8472
+ return __classPrivateFieldGet$e(this, _ChannelProvider_strategy, "f").send(endpointId, action, payload).catch((e) => {
8468
8473
  throw new channel_error_1.ChannelError(e, action, payload, callSites);
8469
8474
  });
8470
8475
  }
8471
8476
  return Promise.reject(new Error(`Client connection with identity uuid: ${to.uuid} / name: ${to.name} / endpointId: ${endpointId} no longer connected.`));
8472
8477
  }
8473
8478
  async processConnection(senderId, payload) {
8474
- __classPrivateFieldGet$d(this, _ChannelProvider_connections, "f").push(senderId);
8479
+ __classPrivateFieldGet$e(this, _ChannelProvider_connections, "f").push(senderId);
8475
8480
  return this.connectListener(senderId, payload);
8476
8481
  }
8477
8482
  /**
@@ -8494,7 +8499,7 @@ class ChannelProvider extends channel_1.ChannelBase {
8494
8499
  * ```
8495
8500
  */
8496
8501
  publish(action, payload) {
8497
- return this.connections.map((to) => __classPrivateFieldGet$d(this, _ChannelProvider_strategy, "f").send(to.endpointId, action, payload));
8502
+ return this.connections.map((to) => __classPrivateFieldGet$e(this, _ChannelProvider_strategy, "f").send(to.endpointId, action, payload));
8498
8503
  }
8499
8504
  /**
8500
8505
  * Register a listener that is called on every new client connection.
@@ -8568,11 +8573,11 @@ class ChannelProvider extends channel_1.ChannelBase {
8568
8573
  * ```
8569
8574
  */
8570
8575
  async destroy() {
8571
- const protectedObj = __classPrivateFieldGet$d(this, _ChannelProvider_protectedObj, "f");
8576
+ const protectedObj = __classPrivateFieldGet$e(this, _ChannelProvider_protectedObj, "f");
8572
8577
  protectedObj.providerIdentity;
8573
- __classPrivateFieldSet$c(this, _ChannelProvider_connections, [], "f");
8578
+ __classPrivateFieldSet$d(this, _ChannelProvider_connections, [], "f");
8574
8579
  await protectedObj.close();
8575
- __classPrivateFieldGet$d(this, _ChannelProvider_close, "f").call(this);
8580
+ __classPrivateFieldGet$e(this, _ChannelProvider_close, "f").call(this);
8576
8581
  }
8577
8582
  /**
8578
8583
  * Returns an array with info on every Client connected to the Provider
@@ -8642,7 +8647,7 @@ class ChannelProvider extends channel_1.ChannelBase {
8642
8647
  getEndpointIdForOpenFinId(clientIdentity, action) {
8643
8648
  const matchingConnections = this.connections.filter((c) => c.name === clientIdentity.name && c.uuid === clientIdentity.uuid);
8644
8649
  if (matchingConnections.length >= 2) {
8645
- const protectedObj = __classPrivateFieldGet$d(this, _ChannelProvider_protectedObj, "f");
8650
+ const protectedObj = __classPrivateFieldGet$e(this, _ChannelProvider_protectedObj, "f");
8646
8651
  const { uuid, name } = clientIdentity;
8647
8652
  const providerUuid = protectedObj?.providerIdentity.uuid;
8648
8653
  const providerName = protectedObj?.providerIdentity.name;
@@ -8854,13 +8859,13 @@ class CombinedStrategy {
8854
8859
  }
8855
8860
  strategy.default = CombinedStrategy;
8856
8861
 
8857
- var __classPrivateFieldSet$b = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
8862
+ var __classPrivateFieldSet$c = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
8858
8863
  if (kind === "m") throw new TypeError("Private method is not writable");
8859
8864
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
8860
8865
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
8861
8866
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
8862
8867
  };
8863
- var __classPrivateFieldGet$c = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8868
+ var __classPrivateFieldGet$d = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8864
8869
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
8865
8870
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
8866
8871
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
@@ -8909,8 +8914,8 @@ class ConnectionManager extends base_1$j.Base {
8909
8914
  };
8910
8915
  this.providerMap = new Map();
8911
8916
  this.protocolManager = new protocol_manager_1.ProtocolManager(this.wire.environment.type === 'node' ? ['classic'] : ['rtc', 'classic']);
8912
- __classPrivateFieldSet$b(this, _ConnectionManager_messageReceiver, new message_receiver_1.MessageReceiver(wire), "f");
8913
- __classPrivateFieldSet$b(this, _ConnectionManager_rtcConnectionManager, new ice_manager_1.RTCICEManager(wire), "f");
8917
+ __classPrivateFieldSet$c(this, _ConnectionManager_messageReceiver, new message_receiver_1.MessageReceiver(wire), "f");
8918
+ __classPrivateFieldSet$c(this, _ConnectionManager_rtcConnectionManager, new ice_manager_1.RTCICEManager(wire), "f");
8914
8919
  wire.registerMessageHandler(this.onmessage.bind(this));
8915
8920
  }
8916
8921
  createProvider(options, providerIdentity) {
@@ -8921,7 +8926,7 @@ class ConnectionManager extends base_1$j.Base {
8921
8926
  case 'rtc':
8922
8927
  return new strategy_2.RTCStrategy();
8923
8928
  case 'classic':
8924
- return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$c(this, _ConnectionManager_messageReceiver, "f"),
8929
+ return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$d(this, _ConnectionManager_messageReceiver, "f"),
8925
8930
  // Providers do not have an endpointId, use channelId as endpointId in the strategy.
8926
8931
  providerIdentity.channelId, providerIdentity);
8927
8932
  default:
@@ -8957,7 +8962,7 @@ class ConnectionManager extends base_1$j.Base {
8957
8962
  const supportedProtocols = await Promise.all(protocols.map(async (type) => {
8958
8963
  switch (type) {
8959
8964
  case 'rtc': {
8960
- const { rtcClient, channels, offer, rtcConnectionId, channelsOpened } = await __classPrivateFieldGet$c(this, _ConnectionManager_rtcConnectionManager, "f").startClientOffer();
8965
+ const { rtcClient, channels, offer, rtcConnectionId, channelsOpened } = await __classPrivateFieldGet$d(this, _ConnectionManager_rtcConnectionManager, "f").startClientOffer();
8961
8966
  rtcPacket = { rtcClient, channels, channelsOpened };
8962
8967
  return {
8963
8968
  type: 'rtc',
@@ -8984,18 +8989,18 @@ class ConnectionManager extends base_1$j.Base {
8984
8989
  routingInfo.endpointId = this.wire.environment.getNextMessageId();
8985
8990
  // For New Clients connecting to Old Providers. To prevent multi-dispatching and publishing, we delete previously-connected
8986
8991
  // clients that are in the same context as the newly-connected client.
8987
- __classPrivateFieldGet$c(this, _ConnectionManager_messageReceiver, "f").checkForPreviousClientConnection(routingInfo.channelId);
8992
+ __classPrivateFieldGet$d(this, _ConnectionManager_messageReceiver, "f").checkForPreviousClientConnection(routingInfo.channelId);
8988
8993
  }
8989
8994
  const answer = routingInfo.answer ?? {
8990
8995
  supportedProtocols: [{ type: 'classic', version: 1 }]
8991
8996
  };
8992
8997
  const createStrategyFromAnswer = async (protocol) => {
8993
8998
  if (protocol.type === 'rtc' && rtcPacket) {
8994
- await __classPrivateFieldGet$c(this, _ConnectionManager_rtcConnectionManager, "f").finishClientOffer(rtcPacket.rtcClient, protocol.payload.answer, rtcPacket.channelsOpened);
8999
+ await __classPrivateFieldGet$d(this, _ConnectionManager_rtcConnectionManager, "f").finishClientOffer(rtcPacket.rtcClient, protocol.payload.answer, rtcPacket.channelsOpened);
8995
9000
  return new strategy_2.RTCStrategy();
8996
9001
  }
8997
9002
  if (protocol.type === 'classic') {
8998
- return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$c(this, _ConnectionManager_messageReceiver, "f"), routingInfo.endpointId, routingInfo);
9003
+ return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$d(this, _ConnectionManager_messageReceiver, "f"), routingInfo.endpointId, routingInfo);
8999
9004
  }
9000
9005
  return null;
9001
9006
  };
@@ -9063,7 +9068,7 @@ class ConnectionManager extends base_1$j.Base {
9063
9068
  clientAnswer = await overlappingProtocols.reduce(async (accumP, protocolToUse) => {
9064
9069
  const answer = await accumP;
9065
9070
  if (protocolToUse.type === 'rtc') {
9066
- const { answer: rtcAnswer, rtcClient, channels } = await __classPrivateFieldGet$c(this, _ConnectionManager_rtcConnectionManager, "f").createProviderAnswer(protocolToUse.payload.rtcConnectionId, protocolToUse.payload.offer);
9071
+ const { answer: rtcAnswer, rtcClient, channels } = await __classPrivateFieldGet$d(this, _ConnectionManager_rtcConnectionManager, "f").createProviderAnswer(protocolToUse.payload.rtcConnectionId, protocolToUse.payload.offer);
9067
9072
  answer.supportedProtocols.push({
9068
9073
  type: 'rtc',
9069
9074
  version: strategy_2.RTCInfo.version,
@@ -9111,13 +9116,13 @@ _ConnectionManager_messageReceiver = new WeakMap(), _ConnectionManager_rtcConnec
9111
9116
  *
9112
9117
  * @packageDocumentation
9113
9118
  */
9114
- var __classPrivateFieldSet$a = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
9119
+ var __classPrivateFieldSet$b = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
9115
9120
  if (kind === "m") throw new TypeError("Private method is not writable");
9116
9121
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
9117
9122
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
9118
9123
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
9119
9124
  };
9120
- var __classPrivateFieldGet$b = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9125
+ var __classPrivateFieldGet$c = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9121
9126
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
9122
9127
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
9123
9128
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
@@ -9174,11 +9179,11 @@ class Channel extends base_1$i.EmitterBase {
9174
9179
  client_1.ChannelClient.handleProviderDisconnect(eventPayload);
9175
9180
  }),
9176
9181
  this.on('connected', (...args) => {
9177
- __classPrivateFieldGet$b(this, _Channel_internalEmitter, "f").emit('connected', ...args);
9182
+ __classPrivateFieldGet$c(this, _Channel_internalEmitter, "f").emit('connected', ...args);
9178
9183
  })
9179
9184
  ]).catch(() => new Error('error setting up channel connection listeners'));
9180
9185
  }));
9181
- __classPrivateFieldSet$a(this, _Channel_connectionManager, new connection_manager_1.ConnectionManager(wire), "f");
9186
+ __classPrivateFieldSet$b(this, _Channel_connectionManager, new connection_manager_1.ConnectionManager(wire), "f");
9182
9187
  }
9183
9188
  /**
9184
9189
  *
@@ -9253,7 +9258,7 @@ class Channel extends base_1$i.EmitterBase {
9253
9258
  resolve(true);
9254
9259
  }
9255
9260
  };
9256
- __classPrivateFieldGet$b(this, _Channel_internalEmitter, "f").on('connected', connectedListener);
9261
+ __classPrivateFieldGet$c(this, _Channel_internalEmitter, "f").on('connected', connectedListener);
9257
9262
  });
9258
9263
  try {
9259
9264
  if (retryInfo.count > 0) {
@@ -9285,7 +9290,7 @@ class Channel extends base_1$i.EmitterBase {
9285
9290
  finally {
9286
9291
  retryInfo.count += 1;
9287
9292
  // in case of other errors, remove our listener
9288
- __classPrivateFieldGet$b(this, _Channel_internalEmitter, "f").removeListener('connected', connectedListener);
9293
+ __classPrivateFieldGet$c(this, _Channel_internalEmitter, "f").removeListener('connected', connectedListener);
9289
9294
  }
9290
9295
  } while (shouldWait); // If we're waiting we retry the above loop
9291
9296
  // Should wait was false, no channel was found.
@@ -9344,12 +9349,12 @@ class Channel extends base_1$i.EmitterBase {
9344
9349
  async connect(channelName, options = {}) {
9345
9350
  // Make sure we don't connect before listeners are set up
9346
9351
  // This also errors if we're not in OpenFin, ensuring we don't run unnecessary code
9347
- await __classPrivateFieldGet$b(this, _Channel_readyToConnect, "f").getValue();
9352
+ await __classPrivateFieldGet$c(this, _Channel_readyToConnect, "f").getValue();
9348
9353
  if (!channelName || typeof channelName !== 'string') {
9349
9354
  throw new Error('Please provide a channelName string to connect to a channel.');
9350
9355
  }
9351
9356
  const opts = { wait: true, ...this.wire.environment.getDefaultChannelOptions().connect, ...options };
9352
- const { offer, rtc: rtcPacket } = await __classPrivateFieldGet$b(this, _Channel_connectionManager, "f").createClientOffer(opts);
9357
+ const { offer, rtc: rtcPacket } = await __classPrivateFieldGet$c(this, _Channel_connectionManager, "f").createClientOffer(opts);
9353
9358
  let connectionUrl;
9354
9359
  if (this.fin.me.isFrame || this.fin.me.isView || this.fin.me.isWindow) {
9355
9360
  connectionUrl = (await this.fin.me.getInfo()).url;
@@ -9361,7 +9366,7 @@ class Channel extends base_1$i.EmitterBase {
9361
9366
  connectionUrl
9362
9367
  };
9363
9368
  const routingInfo = await this.safeConnect(channelName, opts.wait, connectPayload);
9364
- const strategy = await __classPrivateFieldGet$b(this, _Channel_connectionManager, "f").createClientStrategy(rtcPacket, routingInfo);
9369
+ const strategy = await __classPrivateFieldGet$c(this, _Channel_connectionManager, "f").createClientStrategy(rtcPacket, routingInfo);
9365
9370
  const channel = new client_1.ChannelClient(routingInfo, () => client_1.ChannelClient.wireClose(this.wire, routingInfo, routingInfo.endpointId), strategy);
9366
9371
  // It is the client's responsibility to handle endpoint disconnection to the provider.
9367
9372
  // If the endpoint dies, the client will force a disconnection through the core.
@@ -9430,7 +9435,7 @@ class Channel extends base_1$i.EmitterBase {
9430
9435
  throw new Error('Please provide a channelName to create a channel');
9431
9436
  }
9432
9437
  const { payload: { data: providerIdentity } } = await this.wire.sendAction('create-channel', { channelName });
9433
- const channel = __classPrivateFieldGet$b(this, _Channel_connectionManager, "f").createProvider(options, providerIdentity);
9438
+ const channel = __classPrivateFieldGet$c(this, _Channel_connectionManager, "f").createProvider(options, providerIdentity);
9434
9439
  // TODO: fix typing (internal)
9435
9440
  // @ts-expect-error
9436
9441
  this.on('client-disconnected', (eventPayload) => {
@@ -10321,13 +10326,13 @@ var Factory$3 = {};
10321
10326
 
10322
10327
  var Instance$2 = {};
10323
10328
 
10324
- var __classPrivateFieldSet$9 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
10329
+ var __classPrivateFieldSet$a = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
10325
10330
  if (kind === "m") throw new TypeError("Private method is not writable");
10326
10331
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
10327
10332
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
10328
10333
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
10329
10334
  };
10330
- var __classPrivateFieldGet$a = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
10335
+ var __classPrivateFieldGet$b = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
10331
10336
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
10332
10337
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
10333
10338
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
@@ -10364,24 +10369,24 @@ class Platform extends base_1$a.EmitterBase {
10364
10369
  this.wire.sendAction('platform-get-client', this.identity).catch((e) => {
10365
10370
  // don't expose
10366
10371
  });
10367
- if (!Platform.clientMap.has(__classPrivateFieldGet$a(this, _Platform_channelName, "f"))) {
10368
- const clientPromise = __classPrivateFieldGet$a(this, _Platform_connectToProvider, "f").call(this);
10369
- Platform.clientMap.set(__classPrivateFieldGet$a(this, _Platform_channelName, "f"), clientPromise);
10372
+ if (!Platform.clientMap.has(__classPrivateFieldGet$b(this, _Platform_channelName, "f"))) {
10373
+ const clientPromise = __classPrivateFieldGet$b(this, _Platform_connectToProvider, "f").call(this);
10374
+ Platform.clientMap.set(__classPrivateFieldGet$b(this, _Platform_channelName, "f"), clientPromise);
10370
10375
  }
10371
10376
  // we set it above
10372
10377
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
10373
- return Platform.clientMap.get(__classPrivateFieldGet$a(this, _Platform_channelName, "f"));
10378
+ return Platform.clientMap.get(__classPrivateFieldGet$b(this, _Platform_channelName, "f"));
10374
10379
  };
10375
10380
  _Platform_connectToProvider.set(this, async () => {
10376
10381
  try {
10377
- const client = await this._channel.connect(__classPrivateFieldGet$a(this, _Platform_channelName, "f"), { wait: false });
10382
+ const client = await this._channel.connect(__classPrivateFieldGet$b(this, _Platform_channelName, "f"), { wait: false });
10378
10383
  client.onDisconnection(() => {
10379
- Platform.clientMap.delete(__classPrivateFieldGet$a(this, _Platform_channelName, "f"));
10384
+ Platform.clientMap.delete(__classPrivateFieldGet$b(this, _Platform_channelName, "f"));
10380
10385
  });
10381
10386
  return client;
10382
10387
  }
10383
10388
  catch (e) {
10384
- Platform.clientMap.delete(__classPrivateFieldGet$a(this, _Platform_channelName, "f"));
10389
+ Platform.clientMap.delete(__classPrivateFieldGet$b(this, _Platform_channelName, "f"));
10385
10390
  throw new Error('The targeted Platform is not currently running. Listen for application-started event for the given Uuid.');
10386
10391
  }
10387
10392
  });
@@ -10394,7 +10399,7 @@ class Platform extends base_1$a.EmitterBase {
10394
10399
  if (errorMsg) {
10395
10400
  throw new Error(errorMsg);
10396
10401
  }
10397
- __classPrivateFieldSet$9(this, _Platform_channelName, channelName, "f");
10402
+ __classPrivateFieldSet$a(this, _Platform_channelName, channelName, "f");
10398
10403
  this._channel = this.fin.InterApplicationBus.Channel;
10399
10404
  this.identity = { uuid: identity.uuid };
10400
10405
  this.Layout = this.fin.Platform.Layout;
@@ -11450,13 +11455,13 @@ const createRelayedDispatch = (client, target, relayId, relayErrorMsg) => async
11450
11455
  };
11451
11456
  channelApiRelay.createRelayedDispatch = createRelayedDispatch;
11452
11457
 
11453
- var __classPrivateFieldSet$8 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
11458
+ var __classPrivateFieldSet$9 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
11454
11459
  if (kind === "m") throw new TypeError("Private method is not writable");
11455
11460
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
11456
11461
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
11457
11462
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
11458
11463
  };
11459
- var __classPrivateFieldGet$9 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
11464
+ var __classPrivateFieldGet$a = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
11460
11465
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
11461
11466
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
11462
11467
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
@@ -11510,7 +11515,7 @@ class LayoutNode {
11510
11515
  * console.log(`The parent ColumnOrRow is root: ${parentIsRoot}`);
11511
11516
  * ```
11512
11517
  */
11513
- this.isRoot = () => __classPrivateFieldGet$9(this, _LayoutNode_client, "f").isRoot(this.entityId);
11518
+ this.isRoot = () => __classPrivateFieldGet$a(this, _LayoutNode_client, "f").isRoot(this.entityId);
11514
11519
  /**
11515
11520
  * Checks if the TabStack or ColumnOrRow exists
11516
11521
  *
@@ -11530,7 +11535,7 @@ class LayoutNode {
11530
11535
  * console.log(`The entity exists: ${exists}`);
11531
11536
  * ```
11532
11537
  */
11533
- this.exists = () => __classPrivateFieldGet$9(this, _LayoutNode_client, "f").exists(this.entityId);
11538
+ this.exists = () => __classPrivateFieldGet$a(this, _LayoutNode_client, "f").exists(this.entityId);
11534
11539
  /**
11535
11540
  * Retrieves the parent of the TabStack or ColumnOrRow
11536
11541
  *
@@ -11551,11 +11556,11 @@ class LayoutNode {
11551
11556
  * ```
11552
11557
  */
11553
11558
  this.getParent = async () => {
11554
- const parent = await __classPrivateFieldGet$9(this, _LayoutNode_client, "f").getParent(this.entityId);
11559
+ const parent = await __classPrivateFieldGet$a(this, _LayoutNode_client, "f").getParent(this.entityId);
11555
11560
  if (!parent) {
11556
11561
  return undefined;
11557
11562
  }
11558
- return LayoutNode.getEntity(parent, __classPrivateFieldGet$9(this, _LayoutNode_client, "f"));
11563
+ return LayoutNode.getEntity(parent, __classPrivateFieldGet$a(this, _LayoutNode_client, "f"));
11559
11564
  };
11560
11565
  /**
11561
11566
  * Creates a new TabStack adjacent to the given TabStack or ColumnOrRow. Inputs can be new views to create, or existing views.
@@ -11606,8 +11611,8 @@ class LayoutNode {
11606
11611
  * @experimental
11607
11612
  */
11608
11613
  this.createAdjacentStack = async (views, options) => {
11609
- const entityId = await __classPrivateFieldGet$9(this, _LayoutNode_client, "f").createAdjacentStack(this.entityId, views, options);
11610
- return LayoutNode.getEntity({ entityId, type: 'stack' }, __classPrivateFieldGet$9(this, _LayoutNode_client, "f"));
11614
+ const entityId = await __classPrivateFieldGet$a(this, _LayoutNode_client, "f").createAdjacentStack(this.entityId, views, options);
11615
+ return LayoutNode.getEntity({ entityId, type: 'stack' }, __classPrivateFieldGet$a(this, _LayoutNode_client, "f"));
11611
11616
  };
11612
11617
  /**
11613
11618
  * Retrieves the adjacent TabStacks of the given TabStack or ColumnOrRow.
@@ -11635,16 +11640,16 @@ class LayoutNode {
11635
11640
  * @experimental
11636
11641
  */
11637
11642
  this.getAdjacentStacks = async (edge) => {
11638
- const adjacentStacks = await __classPrivateFieldGet$9(this, _LayoutNode_client, "f").getAdjacentStacks({
11643
+ const adjacentStacks = await __classPrivateFieldGet$a(this, _LayoutNode_client, "f").getAdjacentStacks({
11639
11644
  targetId: this.entityId,
11640
11645
  edge
11641
11646
  });
11642
11647
  return adjacentStacks.map((stack) => LayoutNode.getEntity({
11643
11648
  type: 'stack',
11644
11649
  entityId: stack.entityId
11645
- }, __classPrivateFieldGet$9(this, _LayoutNode_client, "f")));
11650
+ }, __classPrivateFieldGet$a(this, _LayoutNode_client, "f")));
11646
11651
  };
11647
- __classPrivateFieldSet$8(this, _LayoutNode_client, client, "f");
11652
+ __classPrivateFieldSet$9(this, _LayoutNode_client, client, "f");
11648
11653
  this.entityId = entityId;
11649
11654
  }
11650
11655
  }
@@ -11718,7 +11723,7 @@ class TabStack extends LayoutNode {
11718
11723
  * ```
11719
11724
  * @experimental
11720
11725
  */
11721
- this.getViews = () => __classPrivateFieldGet$9(this, _TabStack_client, "f").getStackViews(this.entityId);
11726
+ this.getViews = () => __classPrivateFieldGet$a(this, _TabStack_client, "f").getStackViews(this.entityId);
11722
11727
  /**
11723
11728
  * Adds or creates a view in this {@link TabStack}.
11724
11729
  *
@@ -11749,7 +11754,7 @@ class TabStack extends LayoutNode {
11749
11754
  * ```
11750
11755
  * @experimental
11751
11756
  */
11752
- this.addView = async (view, options = { index: 0 }) => __classPrivateFieldGet$9(this, _TabStack_client, "f").addViewToStack(this.entityId, view, options);
11757
+ this.addView = async (view, options = { index: 0 }) => __classPrivateFieldGet$a(this, _TabStack_client, "f").addViewToStack(this.entityId, view, options);
11753
11758
  /**
11754
11759
  * Removes a view from this {@link TabStack}.
11755
11760
  *
@@ -11779,7 +11784,7 @@ class TabStack extends LayoutNode {
11779
11784
  * ```
11780
11785
  */
11781
11786
  this.removeView = async (view) => {
11782
- await __classPrivateFieldGet$9(this, _TabStack_client, "f").removeViewFromStack(this.entityId, view);
11787
+ await __classPrivateFieldGet$a(this, _TabStack_client, "f").removeViewFromStack(this.entityId, view);
11783
11788
  };
11784
11789
  /**
11785
11790
  * Sets the active view of the {@link TabStack} without focusing it.
@@ -11803,9 +11808,9 @@ class TabStack extends LayoutNode {
11803
11808
  * @experimental
11804
11809
  */
11805
11810
  this.setActiveView = async (view) => {
11806
- await __classPrivateFieldGet$9(this, _TabStack_client, "f").setStackActiveView(this.entityId, view);
11811
+ await __classPrivateFieldGet$a(this, _TabStack_client, "f").setStackActiveView(this.entityId, view);
11807
11812
  };
11808
- __classPrivateFieldSet$8(this, _TabStack_client, client, "f");
11813
+ __classPrivateFieldSet$9(this, _TabStack_client, client, "f");
11809
11814
  }
11810
11815
  }
11811
11816
  layoutEntities.TabStack = TabStack;
@@ -11844,10 +11849,10 @@ class ColumnOrRow extends LayoutNode {
11844
11849
  * ```
11845
11850
  */
11846
11851
  this.getContent = async () => {
11847
- const contentItemEntities = await __classPrivateFieldGet$9(this, _ColumnOrRow_client, "f").getContent(this.entityId);
11848
- return contentItemEntities.map((entity) => LayoutNode.getEntity(entity, __classPrivateFieldGet$9(this, _ColumnOrRow_client, "f")));
11852
+ const contentItemEntities = await __classPrivateFieldGet$a(this, _ColumnOrRow_client, "f").getContent(this.entityId);
11853
+ return contentItemEntities.map((entity) => LayoutNode.getEntity(entity, __classPrivateFieldGet$a(this, _ColumnOrRow_client, "f")));
11849
11854
  };
11850
- __classPrivateFieldSet$8(this, _ColumnOrRow_client, client, "f");
11855
+ __classPrivateFieldSet$9(this, _ColumnOrRow_client, client, "f");
11851
11856
  this.type = type;
11852
11857
  }
11853
11858
  }
@@ -11862,7 +11867,7 @@ layout_constants.LAYOUT_CONTROLLER_ID = 'layout-entities';
11862
11867
  // TODO: eventually export this somehow
11863
11868
  layout_constants.DEFAULT_LAYOUT_KEY = '__default__';
11864
11869
 
11865
- var __classPrivateFieldGet$8 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
11870
+ var __classPrivateFieldGet$9 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
11866
11871
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
11867
11872
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
11868
11873
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
@@ -12013,7 +12018,7 @@ class Layout extends base_1$9.Base {
12013
12018
  * @internal
12014
12019
  */
12015
12020
  static getClient(layout) {
12016
- return __classPrivateFieldGet$8(layout, _Layout_layoutClient, "f").getValue();
12021
+ return __classPrivateFieldGet$9(layout, _Layout_layoutClient, "f").getValue();
12017
12022
  }
12018
12023
  /**
12019
12024
  * @internal
@@ -12236,7 +12241,7 @@ class Layout extends base_1$9.Base {
12236
12241
  this.wire.sendAction('layout-get-root-item').catch(() => {
12237
12242
  // don't expose
12238
12243
  });
12239
- const client = await __classPrivateFieldGet$8(this, _Layout_layoutClient, "f").getValue();
12244
+ const client = await __classPrivateFieldGet$9(this, _Layout_layoutClient, "f").getValue();
12240
12245
  const root = await client.getRoot('layoutName' in this.identity ? this.identity : undefined);
12241
12246
  return layout_entities_1.LayoutNode.getEntity(root, client);
12242
12247
  }
@@ -12254,7 +12259,7 @@ class Layout extends base_1$9.Base {
12254
12259
  this.wire.sendAction('layout-get-stack-by-view').catch(() => {
12255
12260
  // don't expose
12256
12261
  });
12257
- const client = await __classPrivateFieldGet$8(this, _Layout_layoutClient, "f").getValue();
12262
+ const client = await __classPrivateFieldGet$9(this, _Layout_layoutClient, "f").getValue();
12258
12263
  const stack = await client.getStackByView(identity);
12259
12264
  if (!stack) {
12260
12265
  throw new Error(`No stack found for view: ${identity.uuid}/${identity.name}`);
@@ -12274,7 +12279,7 @@ class Layout extends base_1$9.Base {
12274
12279
  this.wire.sendAction('layout-add-view').catch((e) => {
12275
12280
  // don't expose
12276
12281
  });
12277
- const { identity } = await __classPrivateFieldGet$8(this, _Layout_instances, "m", _Layout_forwardLayoutAction).call(this, 'layout-add-view', {
12282
+ const { identity } = await __classPrivateFieldGet$9(this, _Layout_instances, "m", _Layout_forwardLayoutAction).call(this, 'layout-add-view', {
12278
12283
  viewOptions,
12279
12284
  location,
12280
12285
  targetView
@@ -12292,7 +12297,7 @@ class Layout extends base_1$9.Base {
12292
12297
  this.wire.sendAction('layout-close-view').catch((e) => {
12293
12298
  // don't expose
12294
12299
  });
12295
- await __classPrivateFieldGet$8(this, _Layout_instances, "m", _Layout_forwardLayoutAction).call(this, 'layout-close-view', { viewIdentity });
12300
+ await __classPrivateFieldGet$9(this, _Layout_instances, "m", _Layout_forwardLayoutAction).call(this, 'layout-close-view', { viewIdentity });
12296
12301
  }
12297
12302
  }
12298
12303
  Instance$1.Layout = Layout;
@@ -12306,12 +12311,12 @@ async function _Layout_forwardLayoutAction(action, payload) {
12306
12311
  return client.dispatch(action, { target: this.identity, opts: payload });
12307
12312
  };
12308
12313
 
12309
- var __classPrivateFieldGet$7 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
12314
+ var __classPrivateFieldGet$8 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
12310
12315
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
12311
12316
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
12312
12317
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12313
12318
  };
12314
- var __classPrivateFieldSet$7 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
12319
+ var __classPrivateFieldSet$8 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
12315
12320
  if (kind === "m") throw new TypeError("Private method is not writable");
12316
12321
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
12317
12322
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
@@ -12377,23 +12382,23 @@ class LayoutModule extends base_1$8.Base {
12377
12382
  if (!this.wire.environment.layoutAllowedInContext(this.fin)) {
12378
12383
  throw new Error('Layout.init can only be called from a Window context.');
12379
12384
  }
12380
- if (__classPrivateFieldGet$7(this, _LayoutModule_layoutInitializationAttempted, "f")) {
12385
+ if (__classPrivateFieldGet$8(this, _LayoutModule_layoutInitializationAttempted, "f")) {
12381
12386
  throw new Error('Layout.init was already called, please use Layout.create to add additional layouts.');
12382
12387
  }
12383
12388
  if (this.wire.environment.type === 'openfin') {
12384
12389
  // preload the client
12385
12390
  await this.fin.Platform.getCurrentSync().getClient();
12386
12391
  }
12387
- __classPrivateFieldSet$7(this, _LayoutModule_layoutInitializationAttempted, true, "f");
12392
+ __classPrivateFieldSet$8(this, _LayoutModule_layoutInitializationAttempted, true, "f");
12388
12393
  // TODO: rename to createLayoutManager
12389
- __classPrivateFieldSet$7(this, _LayoutModule_layoutManager, await this.wire.environment.initLayoutManager(this.fin, this.wire, options), "f");
12390
- await this.wire.environment.applyLayoutSnapshot(this.fin, __classPrivateFieldGet$7(this, _LayoutModule_layoutManager, "f"), options);
12394
+ __classPrivateFieldSet$8(this, _LayoutModule_layoutManager, await this.wire.environment.initLayoutManager(this.fin, this.wire, options), "f");
12395
+ await this.wire.environment.applyLayoutSnapshot(this.fin, __classPrivateFieldGet$8(this, _LayoutModule_layoutManager, "f"), options);
12391
12396
  const meIdentity = { name: this.fin.me.name, uuid: this.fin.me.uuid };
12392
12397
  if (!options.layoutManagerOverride) {
12393
12398
  // CORE-1081 to be removed when we actually delete the `layoutManager` prop
12394
12399
  // in single-layout case, we return the undocumented layoutManager type
12395
12400
  const layoutIdentity = { layoutName: layout_constants_1.DEFAULT_LAYOUT_KEY, ...meIdentity };
12396
- return __classPrivateFieldGet$7(this, _LayoutModule_getLayoutManagerSpy, "f").call(this, layoutIdentity);
12401
+ return __classPrivateFieldGet$8(this, _LayoutModule_getLayoutManagerSpy, "f").call(this, layoutIdentity);
12397
12402
  }
12398
12403
  return this.wrapSync(meIdentity);
12399
12404
  };
@@ -12422,13 +12427,13 @@ class LayoutModule extends base_1$8.Base {
12422
12427
  * @returns
12423
12428
  */
12424
12429
  this.getCurrentLayoutManagerSync = () => {
12425
- return __classPrivateFieldGet$7(this, _LayoutModule_instances, "m", _LayoutModule_getSafeLayoutManager).call(this, `fin.Platform.Layout.getCurrentLayoutManagerSync()`);
12430
+ return __classPrivateFieldGet$8(this, _LayoutModule_instances, "m", _LayoutModule_getSafeLayoutManager).call(this, `fin.Platform.Layout.getCurrentLayoutManagerSync()`);
12426
12431
  };
12427
12432
  this.create = async (options) => {
12428
- return this.wire.environment.createLayout(__classPrivateFieldGet$7(this, _LayoutModule_instances, "m", _LayoutModule_getSafeLayoutManager).call(this, `fin.Platform.Layout.create()`), options);
12433
+ return this.wire.environment.createLayout(__classPrivateFieldGet$8(this, _LayoutModule_instances, "m", _LayoutModule_getSafeLayoutManager).call(this, `fin.Platform.Layout.create()`), options);
12429
12434
  };
12430
12435
  this.destroy = async (layoutIdentity) => {
12431
- return this.wire.environment.destroyLayout(__classPrivateFieldGet$7(this, _LayoutModule_instances, "m", _LayoutModule_getSafeLayoutManager).call(this, `fin.Platform.Layout.destroy()`), layoutIdentity);
12436
+ return this.wire.environment.destroyLayout(__classPrivateFieldGet$8(this, _LayoutModule_instances, "m", _LayoutModule_getSafeLayoutManager).call(this, `fin.Platform.Layout.destroy()`), layoutIdentity);
12432
12437
  };
12433
12438
  }
12434
12439
  /**
@@ -12569,10 +12574,10 @@ class LayoutModule extends base_1$8.Base {
12569
12574
  }
12570
12575
  Factory$2.LayoutModule = LayoutModule;
12571
12576
  _LayoutModule_layoutInitializationAttempted = new WeakMap(), _LayoutModule_layoutManager = new WeakMap(), _LayoutModule_getLayoutManagerSpy = new WeakMap(), _LayoutModule_instances = new WeakSet(), _LayoutModule_getSafeLayoutManager = function _LayoutModule_getSafeLayoutManager(method) {
12572
- if (!__classPrivateFieldGet$7(this, _LayoutModule_layoutManager, "f")) {
12577
+ if (!__classPrivateFieldGet$8(this, _LayoutModule_layoutManager, "f")) {
12573
12578
  throw new Error(`You must call init before using the API ${method}`);
12574
12579
  }
12575
- return __classPrivateFieldGet$7(this, _LayoutModule_layoutManager, "f");
12580
+ return __classPrivateFieldGet$8(this, _LayoutModule_layoutManager, "f");
12576
12581
  };
12577
12582
 
12578
12583
  (function (exports) {
@@ -13537,13 +13542,13 @@ class PrivateChannelProvider {
13537
13542
  }
13538
13543
  PrivateChannelProvider$1.PrivateChannelProvider = PrivateChannelProvider;
13539
13544
 
13540
- var __classPrivateFieldSet$6 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
13545
+ var __classPrivateFieldSet$7 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
13541
13546
  if (kind === "m") throw new TypeError("Private method is not writable");
13542
13547
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
13543
13548
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
13544
13549
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
13545
13550
  };
13546
- var __classPrivateFieldGet$6 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
13551
+ var __classPrivateFieldGet$7 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
13547
13552
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
13548
13553
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
13549
13554
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
@@ -13734,12 +13739,12 @@ class InteropBroker extends base_1$6.Base {
13734
13739
  _InteropBroker_contextGroups.set(this, void 0);
13735
13740
  _InteropBroker_providerPromise.set(this, void 0);
13736
13741
  this.getProvider = () => {
13737
- return __classPrivateFieldGet$6(this, _InteropBroker_providerPromise, "f").getValue();
13742
+ return __classPrivateFieldGet$7(this, _InteropBroker_providerPromise, "f").getValue();
13738
13743
  };
13739
13744
  this.interopClients = new Map();
13740
13745
  this.contextGroupsById = new Map();
13741
- __classPrivateFieldSet$6(this, _InteropBroker_contextGroups, options.contextGroups ?? [...defaultContextGroups], "f");
13742
- __classPrivateFieldSet$6(this, _InteropBroker_fdc3Info, options.fdc3Info, "f");
13746
+ __classPrivateFieldSet$7(this, _InteropBroker_contextGroups, options.contextGroups ?? [...defaultContextGroups], "f");
13747
+ __classPrivateFieldSet$7(this, _InteropBroker_fdc3Info, options.fdc3Info, "f");
13743
13748
  if (options?.logging) {
13744
13749
  this.logging = options.logging;
13745
13750
  }
@@ -13747,7 +13752,7 @@ class InteropBroker extends base_1$6.Base {
13747
13752
  this.lastContextMap = new Map();
13748
13753
  this.sessionContextGroupMap = new Map();
13749
13754
  this.privateChannelProviderMap = new Map();
13750
- __classPrivateFieldSet$6(this, _InteropBroker_providerPromise, new lazy_1$1.Lazy(createProvider), "f");
13755
+ __classPrivateFieldSet$7(this, _InteropBroker_providerPromise, new lazy_1$1.Lazy(createProvider), "f");
13751
13756
  this.setContextGroupMap();
13752
13757
  this.setupChannelProvider();
13753
13758
  }
@@ -13919,8 +13924,8 @@ class InteropBroker extends base_1$6.Base {
13919
13924
  if (!this.getContextGroups().find((contextGroupInfo) => contextGroupInfo.id === contextGroupId)) {
13920
13925
  throw new Error(`Attempting to join a context group that does not exist: ${contextGroupId}. You may only join existing context groups.`);
13921
13926
  }
13922
- const oldContextGroupId = clientSubscriptionState.contextGroupId;
13923
- if (oldContextGroupId !== contextGroupId) {
13927
+ const previousContextGroupId = clientSubscriptionState.contextGroupId;
13928
+ if (previousContextGroupId !== contextGroupId) {
13924
13929
  clientSubscriptionState.contextGroupId = contextGroupId;
13925
13930
  await this.setCurrentContextGroupInClientOptions(clientIdentity, contextGroupId);
13926
13931
  const contextGroupMap = this.contextGroupsById.get(contextGroupId);
@@ -13939,6 +13944,13 @@ class InteropBroker extends base_1$6.Base {
13939
13944
  }
13940
13945
  }
13941
13946
  }
13947
+ // All settled will suppress uncaught exceptions. We don't want to await this because it could
13948
+ // result in the operation hanging.
13949
+ Promise.allSettled(this.channel.publish('client-changed-context-group', {
13950
+ identity: clientIdentity,
13951
+ contextGroupId,
13952
+ previousContextGroupId: previousContextGroupId || null
13953
+ }));
13942
13954
  }
13943
13955
  }
13944
13956
  // Removes the target from its context group. Similar structure to joinContextGroup.
@@ -13998,10 +14010,18 @@ class InteropBroker extends base_1$6.Base {
13998
14010
  // don't expose, analytics-only call
13999
14011
  });
14000
14012
  const clientState = this.getClientState(clientIdentity);
14013
+ const previousContextGroupId = clientState?.contextGroupId;
14001
14014
  if (clientState) {
14002
14015
  clientState.contextGroupId = undefined;
14003
14016
  }
14004
14017
  await this.setCurrentContextGroupInClientOptions(clientIdentity, null);
14018
+ // All settled will suppress uncaught exceptions. We don't want to await this because it could
14019
+ // result in the operation hanging.
14020
+ Promise.allSettled(this.channel.publish('client-changed-context-group', {
14021
+ identity: clientIdentity,
14022
+ contextGroupId: null,
14023
+ previousContextGroupId: previousContextGroupId || null
14024
+ }));
14005
14025
  }
14006
14026
  // Used by platform windows to know what client groups the provider has declared. Also used internally to access context groups. Overrideable so that the platform developer can modify it.
14007
14027
  /**
@@ -14015,7 +14035,7 @@ class InteropBroker extends base_1$6.Base {
14015
14035
  // don't expose, analytics-only call
14016
14036
  });
14017
14037
  // Create copy for immutability
14018
- return __classPrivateFieldGet$6(this, _InteropBroker_contextGroups, "f").map((contextGroup) => {
14038
+ return __classPrivateFieldGet$7(this, _InteropBroker_contextGroups, "f").map((contextGroup) => {
14019
14039
  return { ...contextGroup };
14020
14040
  });
14021
14041
  }
@@ -14426,7 +14446,7 @@ class InteropBroker extends base_1$6.Base {
14426
14446
  const { fdc3Version } = payload;
14427
14447
  return {
14428
14448
  fdc3Version,
14429
- ...__classPrivateFieldGet$6(this, _InteropBroker_fdc3Info, "f"),
14449
+ ...__classPrivateFieldGet$7(this, _InteropBroker_fdc3Info, "f"),
14430
14450
  optionalFeatures: {
14431
14451
  OriginatingAppMetadata: false,
14432
14452
  UserChannelMembershipAPIs: true
@@ -14811,13 +14831,13 @@ var InteropClient$1 = {};
14811
14831
 
14812
14832
  var SessionContextGroupClient$1 = {};
14813
14833
 
14814
- var __classPrivateFieldSet$5 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
14834
+ var __classPrivateFieldSet$6 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
14815
14835
  if (kind === "m") throw new TypeError("Private method is not writable");
14816
14836
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
14817
14837
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
14818
14838
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
14819
14839
  };
14820
- var __classPrivateFieldGet$5 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
14840
+ var __classPrivateFieldGet$6 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
14821
14841
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
14822
14842
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
14823
14843
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
@@ -14831,7 +14851,7 @@ class SessionContextGroupClient extends base_1$5.Base {
14831
14851
  super(wire);
14832
14852
  _SessionContextGroupClient_clientPromise.set(this, void 0);
14833
14853
  this.id = id;
14834
- __classPrivateFieldSet$5(this, _SessionContextGroupClient_clientPromise, client, "f");
14854
+ __classPrivateFieldSet$6(this, _SessionContextGroupClient_clientPromise, client, "f");
14835
14855
  }
14836
14856
  /**
14837
14857
  * Sets a context for the session context group.
@@ -14843,7 +14863,7 @@ class SessionContextGroupClient extends base_1$5.Base {
14843
14863
  this.wire.sendAction('interop-session-context-group-set-context').catch((e) => {
14844
14864
  // don't expose, analytics-only call
14845
14865
  });
14846
- const client = await __classPrivateFieldGet$5(this, _SessionContextGroupClient_clientPromise, "f");
14866
+ const client = await __classPrivateFieldGet$6(this, _SessionContextGroupClient_clientPromise, "f");
14847
14867
  return client.dispatch(`sessionContextGroup:setContext-${this.id}`, {
14848
14868
  sessionContextGroupId: this.id,
14849
14869
  context
@@ -14853,7 +14873,7 @@ class SessionContextGroupClient extends base_1$5.Base {
14853
14873
  this.wire.sendAction('interop-session-context-group-get-context').catch((e) => {
14854
14874
  // don't expose, analytics-only call
14855
14875
  });
14856
- const client = await __classPrivateFieldGet$5(this, _SessionContextGroupClient_clientPromise, "f");
14876
+ const client = await __classPrivateFieldGet$6(this, _SessionContextGroupClient_clientPromise, "f");
14857
14877
  return client.dispatch(`sessionContextGroup:getContext-${this.id}`, {
14858
14878
  sessionContextGroupId: this.id,
14859
14879
  type
@@ -14866,7 +14886,7 @@ class SessionContextGroupClient extends base_1$5.Base {
14866
14886
  if (typeof contextHandler !== 'function') {
14867
14887
  throw new Error("Non-function argument passed to the first parameter 'handler'. Be aware that the argument order does not match the FDC3 standard.");
14868
14888
  }
14869
- const client = await __classPrivateFieldGet$5(this, _SessionContextGroupClient_clientPromise, "f");
14889
+ const client = await __classPrivateFieldGet$6(this, _SessionContextGroupClient_clientPromise, "f");
14870
14890
  let handlerId;
14871
14891
  if (contextType) {
14872
14892
  handlerId = `sessionContextHandler:invoke-${this.id}-${contextType}-${(0, utils_1$6.generateId)()}`;
@@ -14879,7 +14899,7 @@ class SessionContextGroupClient extends base_1$5.Base {
14879
14899
  return { unsubscribe: await this.createUnsubscribeCb(handlerId) };
14880
14900
  }
14881
14901
  async createUnsubscribeCb(handlerId) {
14882
- const client = await __classPrivateFieldGet$5(this, _SessionContextGroupClient_clientPromise, "f");
14902
+ const client = await __classPrivateFieldGet$6(this, _SessionContextGroupClient_clientPromise, "f");
14883
14903
  return async () => {
14884
14904
  client.remove(handlerId);
14885
14905
  await client.dispatch(`sessionContextGroup:handlerRemoved-${this.id}`, { handlerId });
@@ -14897,6 +14917,139 @@ class SessionContextGroupClient extends base_1$5.Base {
14897
14917
  SessionContextGroupClient$1.default = SessionContextGroupClient;
14898
14918
  _SessionContextGroupClient_clientPromise = new WeakMap();
14899
14919
 
14920
+ var channelEvents = {};
14921
+
14922
+ var __classPrivateFieldSet$5 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
14923
+ if (kind === "m") throw new TypeError("Private method is not writable");
14924
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
14925
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
14926
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
14927
+ };
14928
+ var __classPrivateFieldGet$5 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
14929
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
14930
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
14931
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
14932
+ };
14933
+ var _a, _ChannelEvents_channelClient, _ChannelEvents_isChannelReady, _ChannelEvents_actionsByClient, _ChannelEvents_getActions, _ChannelEvents_createRegistration, _ChannelEvents_getRegistration, _ChannelEvents_getOrCreateRegistration;
14934
+ Object.defineProperty(channelEvents, "__esModule", { value: true });
14935
+ channelEvents.ChannelEvents = void 0;
14936
+ /**
14937
+ * Channel events creates a event like syntax out of a channel action, allowing multiple events to be triggered
14938
+ * from a single action (normally only one callback can be created per action).
14939
+ *
14940
+ * This Class essentially allows us to multiplex channel actions to multiple callbacks.
14941
+ */
14942
+ class ChannelEvents {
14943
+ constructor(channelClient) {
14944
+ // eslint-disable-next-line
14945
+ _ChannelEvents_channelClient.set(this, void 0);
14946
+ _ChannelEvents_isChannelReady.set(this, false);
14947
+ _ChannelEvents_getActions.set(this, async () => {
14948
+ const channelClient = await __classPrivateFieldGet$5(this, _ChannelEvents_channelClient, "f");
14949
+ let actions = __classPrivateFieldGet$5(ChannelEvents, _a, "f", _ChannelEvents_actionsByClient).get(channelClient);
14950
+ if (!actions) {
14951
+ actions = {};
14952
+ __classPrivateFieldGet$5(ChannelEvents, _a, "f", _ChannelEvents_actionsByClient).set(channelClient, actions);
14953
+ }
14954
+ return actions;
14955
+ });
14956
+ _ChannelEvents_createRegistration.set(this, (actionId) => {
14957
+ const callbacks = [];
14958
+ let registrationPromise;
14959
+ const onChannelAction = (data) => {
14960
+ callbacks.forEach((callback) => callback(data));
14961
+ };
14962
+ return {
14963
+ callbacks,
14964
+ dispose: async (callback) => {
14965
+ const index = callbacks.indexOf(callback);
14966
+ if (index >= 0) {
14967
+ callbacks.splice(index, 1);
14968
+ if (callbacks.length === 0) {
14969
+ const client = await __classPrivateFieldGet$5(this, _ChannelEvents_channelClient, "f");
14970
+ client.remove(actionId);
14971
+ }
14972
+ }
14973
+ },
14974
+ waitForRegistration: async () => {
14975
+ // Use lazy eval to only setup and register the channel on first attempt.
14976
+ if (!registrationPromise) {
14977
+ registrationPromise = (async () => {
14978
+ const client = await __classPrivateFieldGet$5(this, _ChannelEvents_channelClient, "f");
14979
+ await client.register(actionId, onChannelAction);
14980
+ })();
14981
+ }
14982
+ await registrationPromise;
14983
+ }
14984
+ };
14985
+ });
14986
+ _ChannelEvents_getRegistration.set(this, async (actionId) => {
14987
+ const actions = await __classPrivateFieldGet$5(this, _ChannelEvents_getActions, "f").call(this);
14988
+ return actions[actionId];
14989
+ });
14990
+ _ChannelEvents_getOrCreateRegistration.set(this, async (actionId) => {
14991
+ const actions = await __classPrivateFieldGet$5(this, _ChannelEvents_getActions, "f").call(this);
14992
+ const registration = await __classPrivateFieldGet$5(this, _ChannelEvents_getRegistration, "f").call(this, actionId);
14993
+ if (!registration) {
14994
+ actions[actionId] = __classPrivateFieldGet$5(this, _ChannelEvents_createRegistration, "f").call(this, actionId);
14995
+ }
14996
+ return actions[actionId];
14997
+ });
14998
+ /**
14999
+ * Add a listener for the given channel action.
15000
+ *
15001
+ * This will register a handler for the specified channel action if this is the first time we have requested one, or reuse an existing one if it exists.
15002
+ *
15003
+ * Note, only void channel actions are currently supported.
15004
+ *
15005
+ * @param action Action ID, must match the underlying channel action.
15006
+ * @param callback Callback to be called whenever the action is dispatched.
15007
+ */
15008
+ this.addListener = async (action, callback) => {
15009
+ const event = await __classPrivateFieldGet$5(this, _ChannelEvents_getOrCreateRegistration, "f").call(this, action);
15010
+ event.callbacks.push(callback);
15011
+ // This ensures we only resolve the subscription once the action is registered
15012
+ await event.waitForRegistration();
15013
+ };
15014
+ /**
15015
+ * Removes a callback associated with a given action if it exists.
15016
+ *
15017
+ * If this callback is the last one associated with the specified action, the underlying channel action registration is
15018
+ * also removed.
15019
+ * @param action Action ID to remove
15020
+ * @param callback Callback to remove.
15021
+ */
15022
+ this.removeListener = async (action, callback) => {
15023
+ if (!__classPrivateFieldGet$5(this, _ChannelEvents_isChannelReady, "f")) {
15024
+ return;
15025
+ }
15026
+ const registration = await __classPrivateFieldGet$5(this, _ChannelEvents_getRegistration, "f").call(this, action);
15027
+ if (registration) {
15028
+ const event = await __classPrivateFieldGet$5(this, _ChannelEvents_getOrCreateRegistration, "f").call(this, action);
15029
+ await event.dispose(callback);
15030
+ }
15031
+ };
15032
+ __classPrivateFieldSet$5(this, _ChannelEvents_channelClient, channelClient, "f");
15033
+ Promise.resolve(channelClient)
15034
+ .then(() => {
15035
+ __classPrivateFieldSet$5(this, _ChannelEvents_isChannelReady, true, "f");
15036
+ })
15037
+ .catch(() => {
15038
+ // eslint-disable-next-line
15039
+ console.warn('Channel Connection error occurred in channel client. Channel-events registrations will fail.');
15040
+ });
15041
+ }
15042
+ }
15043
+ channelEvents.ChannelEvents = ChannelEvents;
15044
+ _a = ChannelEvents, _ChannelEvents_channelClient = new WeakMap(), _ChannelEvents_isChannelReady = new WeakMap(), _ChannelEvents_getActions = new WeakMap(), _ChannelEvents_createRegistration = new WeakMap(), _ChannelEvents_getRegistration = new WeakMap(), _ChannelEvents_getOrCreateRegistration = new WeakMap();
15045
+ /**
15046
+ * Static map of actions by channel client. This ensures we can reuse the same event and keep track of all its callbacks.
15047
+ *
15048
+ * Weak map will also ensure that when a channel is GC'ed we also tear down the actions/callbacks associated
15049
+ * with it.
15050
+ */
15051
+ _ChannelEvents_actionsByClient = { value: new WeakMap() };
15052
+
14900
15053
  var __classPrivateFieldSet$4 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
14901
15054
  if (kind === "m") throw new TypeError("Private method is not writable");
14902
15055
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
@@ -14911,12 +15064,13 @@ var __classPrivateFieldGet$4 = (commonjsGlobal && commonjsGlobal.__classPrivateF
14911
15064
  var __importDefault$4 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
14912
15065
  return (mod && mod.__esModule) ? mod : { "default": mod };
14913
15066
  };
14914
- var _InteropClient_clientPromise, _InteropClient_sessionContextGroups, _InteropClient_fdc3Factory;
15067
+ var _InteropClient_clientPromise, _InteropClient_sessionContextGroups, _InteropClient_fdc3Factory, _InteropClient_channelEvents;
14915
15068
  Object.defineProperty(InteropClient$1, "__esModule", { value: true });
14916
15069
  InteropClient$1.InteropClient = void 0;
14917
15070
  const base_1$4 = base;
14918
15071
  const SessionContextGroupClient_1 = __importDefault$4(SessionContextGroupClient$1);
14919
15072
  const utils_1$5 = utils$3;
15073
+ const channel_events_1 = channelEvents;
14920
15074
  /**
14921
15075
  * The Interop Client API is broken up into two groups:
14922
15076
  *
@@ -14975,13 +15129,43 @@ class InteropClient extends base_1$4.Base {
14975
15129
  _InteropClient_clientPromise.set(this, void 0);
14976
15130
  _InteropClient_sessionContextGroups.set(this, void 0);
14977
15131
  _InteropClient_fdc3Factory.set(this, void 0);
15132
+ _InteropClient_channelEvents.set(this, void 0);
15133
+ /*
15134
+ Client APIs
15135
+ */
15136
+ /**
15137
+ * `addListener` allows the InteropClient to subscribe to events emitted by the connected InteropBroker.
15138
+ * @param type The event type to subscribe to.
15139
+ * @param listener Callback invoked whenever the event occurs.
15140
+ * @returns Promise resolving with void once the listener is registered.
15141
+ */
15142
+ this.addListener = async (type, listener) => {
15143
+ try {
15144
+ await __classPrivateFieldGet$4(this, _InteropClient_channelEvents, "f").addListener(type, listener);
15145
+ }
15146
+ catch (error) {
15147
+ throw new Error(`An unexpected error occurred when adding a listener to the event ${type}. \n${error.stack}.`);
15148
+ }
15149
+ };
15150
+ /**
15151
+ * `removeListener` removes a registered event listener.
15152
+ * @param type The event type to subscribe to.
15153
+ * @param listener Callback to be removed.
15154
+ * @returns Promise resolving with void even if no callback was found.
15155
+ */
15156
+ this.removeListener = async (type, listener) => {
15157
+ try {
15158
+ await __classPrivateFieldGet$4(this, _InteropClient_channelEvents, "f").removeListener(type, listener);
15159
+ }
15160
+ catch (error) {
15161
+ throw new Error(`An unexpected error occurred when removing a listener for the event ${type}. \n${error.stack}.`);
15162
+ }
15163
+ };
14978
15164
  __classPrivateFieldSet$4(this, _InteropClient_sessionContextGroups, new Map(), "f");
14979
15165
  __classPrivateFieldSet$4(this, _InteropClient_clientPromise, clientPromise, "f");
14980
15166
  __classPrivateFieldSet$4(this, _InteropClient_fdc3Factory, fdc3Factory, "f");
15167
+ __classPrivateFieldSet$4(this, _InteropClient_channelEvents, new channel_events_1.ChannelEvents(clientPromise), "f");
14981
15168
  }
14982
- /*
14983
- Client APIs
14984
- */
14985
15169
  /**
14986
15170
  * Sets a context for the context group of the current entity.
14987
15171
  *
@@ -15495,7 +15679,7 @@ class InteropClient extends base_1$4.Base {
15495
15679
  }
15496
15680
  }
15497
15681
  InteropClient$1.InteropClient = InteropClient;
15498
- _InteropClient_clientPromise = new WeakMap(), _InteropClient_sessionContextGroups = new WeakMap(), _InteropClient_fdc3Factory = new WeakMap();
15682
+ _InteropClient_clientPromise = new WeakMap(), _InteropClient_sessionContextGroups = new WeakMap(), _InteropClient_fdc3Factory = new WeakMap(), _InteropClient_channelEvents = new WeakMap();
15499
15683
 
15500
15684
  var overrideCheck$1 = {};
15501
15685
 
@@ -18189,7 +18373,7 @@ class NodeEnvironment extends BaseEnvironment_1 {
18189
18373
  };
18190
18374
  }
18191
18375
  getAdapterVersionSync() {
18192
- return "44.100.62";
18376
+ return "45.100.19";
18193
18377
  }
18194
18378
  observeBounds(element, onChange) {
18195
18379
  throw new Error('Method not implemented.');