@openfin/core 43.101.4 → 43.102.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/out/stub.js CHANGED
@@ -316,7 +316,10 @@ events.WindowEvents = WindowEvents;
316
316
  };
317
317
  Object.defineProperty(exports, "__esModule", { value: true });
318
318
  // Deprecated shim to preserve v30 namespace names
319
- __exportStar(events, exports);
319
+ __exportStar(events, exports);
320
+ /**
321
+ * End of Interop Client Events
322
+ */
320
323
  } (OpenFin$2));
321
324
 
322
325
  var OpenFin = /*@__PURE__*/getDefaultExportFromCjs(OpenFin$2);
@@ -332,13 +335,13 @@ var system = {};
332
335
 
333
336
  var base = {};
334
337
 
335
- var __classPrivateFieldSet$h = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
338
+ var __classPrivateFieldSet$i = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
336
339
  if (kind === "m") throw new TypeError("Private method is not writable");
337
340
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
338
341
  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");
339
342
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
340
343
  };
341
- var __classPrivateFieldGet$i = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
344
+ var __classPrivateFieldGet$j = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
342
345
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
343
346
  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");
344
347
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
@@ -422,9 +425,9 @@ class EmitterBase extends Base {
422
425
  this.emit = (eventType, payload, ...args) => {
423
426
  return this.hasEmitter() ? this.getOrCreateEmitter().emit(eventType, payload, ...args) : false;
424
427
  };
425
- this.hasEmitter = () => this.wire.eventAggregator.has(__classPrivateFieldGet$i(this, _EmitterBase_emitterAccessor, "f"));
428
+ this.hasEmitter = () => this.wire.eventAggregator.has(__classPrivateFieldGet$j(this, _EmitterBase_emitterAccessor, "f"));
426
429
  this.getOrCreateEmitter = () => {
427
- return this.wire.eventAggregator.getOrCreate(__classPrivateFieldGet$i(this, _EmitterBase_emitterAccessor, "f"));
430
+ return this.wire.eventAggregator.getOrCreate(__classPrivateFieldGet$j(this, _EmitterBase_emitterAccessor, "f"));
428
431
  };
429
432
  this.listeners = (type) => this.hasEmitter() ? this.getOrCreateEmitter().listeners(type) : [];
430
433
  this.listenerCount = (type) => this.hasEmitter() ? this.getOrCreateEmitter().listenerCount(type) : 0;
@@ -462,8 +465,8 @@ class EmitterBase extends Base {
462
465
  // This will only be reached if unsubscribe from event that does not exist but do not want to error here
463
466
  return Promise.resolve();
464
467
  };
465
- __classPrivateFieldSet$h(this, _EmitterBase_emitterAccessor, [topic, ...additionalAccessors], "f");
466
- __classPrivateFieldSet$h(this, _EmitterBase_deregisterOnceListeners, new WeakMap(), "f");
468
+ __classPrivateFieldSet$i(this, _EmitterBase_emitterAccessor, [topic, ...additionalAccessors], "f");
469
+ __classPrivateFieldSet$i(this, _EmitterBase_deregisterOnceListeners, new WeakMap(), "f");
467
470
  }
468
471
  /**
469
472
  * Adds a listener to the end of the listeners array for the specified event.
@@ -491,7 +494,7 @@ class EmitterBase extends Base {
491
494
  */
492
495
  async once(eventType, listener, options) {
493
496
  const deregister = () => this.deregisterEventListener(eventType);
494
- __classPrivateFieldGet$i(this, _EmitterBase_deregisterOnceListeners, "f").set(listener, deregister);
497
+ __classPrivateFieldGet$j(this, _EmitterBase_deregisterOnceListeners, "f").set(listener, deregister);
495
498
  await this.registerEventListener(eventType, options, (emitter) => {
496
499
  emitter.once(eventType, deregister);
497
500
  emitter.once(eventType, listener);
@@ -522,7 +525,7 @@ class EmitterBase extends Base {
522
525
  */
523
526
  async prependOnceListener(eventType, listener, options) {
524
527
  const deregister = () => this.deregisterEventListener(eventType);
525
- __classPrivateFieldGet$i(this, _EmitterBase_deregisterOnceListeners, "f").set(listener, deregister);
528
+ __classPrivateFieldGet$j(this, _EmitterBase_deregisterOnceListeners, "f").set(listener, deregister);
526
529
  await this.registerEventListener(eventType, options, (emitter) => {
527
530
  emitter.prependOnceListener(eventType, listener);
528
531
  emitter.once(eventType, deregister);
@@ -541,7 +544,7 @@ class EmitterBase extends Base {
541
544
  const emitter = await this.deregisterEventListener(eventType, options);
542
545
  if (emitter) {
543
546
  emitter.removeListener(eventType, listener);
544
- const deregister = __classPrivateFieldGet$i(this, _EmitterBase_deregisterOnceListeners, "f").get(listener);
547
+ const deregister = __classPrivateFieldGet$j(this, _EmitterBase_deregisterOnceListeners, "f").get(listener);
545
548
  if (deregister) {
546
549
  emitter.removeListener(eventType, deregister);
547
550
  }
@@ -587,7 +590,7 @@ class EmitterBase extends Base {
587
590
  deleteEmitterIfNothingRegistered(emitter) {
588
591
  // TODO: maybe emitterMap should clean up itself..
589
592
  if (emitter.eventNames().length === 0) {
590
- this.wire.eventAggregator.delete(__classPrivateFieldGet$i(this, _EmitterBase_emitterAccessor, "f"));
593
+ this.wire.eventAggregator.delete(__classPrivateFieldGet$j(this, _EmitterBase_emitterAccessor, "f"));
591
594
  }
592
595
  }
593
596
  }
@@ -819,11 +822,11 @@ const handleDeprecatedWarnings = (options) => {
819
822
  };
820
823
  warnings.handleDeprecatedWarnings = handleDeprecatedWarnings;
821
824
 
822
- var hasRequiredFactory$2;
825
+ var hasRequiredFactory$1;
823
826
 
824
- function requireFactory$2 () {
825
- if (hasRequiredFactory$2) return Factory$6;
826
- hasRequiredFactory$2 = 1;
827
+ function requireFactory$1 () {
828
+ if (hasRequiredFactory$1) return Factory$6;
829
+ hasRequiredFactory$1 = 1;
827
830
  Object.defineProperty(Factory$6, "__esModule", { value: true });
828
831
  Factory$6.ViewModule = void 0;
829
832
  const base_1 = base;
@@ -1038,8 +1041,8 @@ var main = {};
1038
1041
 
1039
1042
  Object.defineProperty(main, "__esModule", { value: true });
1040
1043
  main.WebContents = void 0;
1041
- const base_1$n = base;
1042
- class WebContents extends base_1$n.EmitterBase {
1044
+ const base_1$p = base;
1045
+ class WebContents extends base_1$p.EmitterBase {
1043
1046
  /**
1044
1047
  * @param identity The identity of the {@link OpenFin.WebContentsEvents WebContents}.
1045
1048
  * @param entityType The type of the {@link OpenFin.WebContentsEvents WebContents}.
@@ -2120,11 +2123,11 @@ class WebContents extends base_1$n.EmitterBase {
2120
2123
  }
2121
2124
  main.WebContents = WebContents;
2122
2125
 
2123
- var hasRequiredInstance$2;
2126
+ var hasRequiredInstance$1;
2124
2127
 
2125
- function requireInstance$2 () {
2126
- if (hasRequiredInstance$2) return Instance$5;
2127
- hasRequiredInstance$2 = 1;
2128
+ function requireInstance$1 () {
2129
+ if (hasRequiredInstance$1) return Instance$5;
2130
+ hasRequiredInstance$1 = 1;
2128
2131
  var _View_providerChannelClient;
2129
2132
  Object.defineProperty(Instance$5, "__esModule", { value: true });
2130
2133
  Instance$5.View = void 0;
@@ -2704,1160 +2707,1139 @@ function requireView () {
2704
2707
  *
2705
2708
  * @packageDocumentation
2706
2709
  */
2707
- __exportStar(requireFactory$2(), exports);
2708
- __exportStar(requireInstance$2(), exports);
2710
+ __exportStar(requireFactory$1(), exports);
2711
+ __exportStar(requireInstance$1(), exports);
2709
2712
  } (view));
2710
2713
  return view;
2711
2714
  }
2712
2715
 
2713
- var hasRequiredInstance$1;
2714
-
2715
- function requireInstance$1 () {
2716
- if (hasRequiredInstance$1) return Instance$6;
2717
- hasRequiredInstance$1 = 1;
2718
- Object.defineProperty(Instance$6, "__esModule", { value: true });
2719
- Instance$6.Application = void 0;
2720
- /* eslint-disable import/prefer-default-export */
2721
- const base_1 = base;
2722
- const window_1 = requireWindow();
2723
- const view_1 = requireView();
2724
- /**
2725
- * An object representing an application. Allows the developer to create,
2726
- * execute, show/close an application as well as listen to {@link OpenFin.ApplicationEvents application events}.
2727
- */
2728
- class Application extends base_1.EmitterBase {
2729
- /**
2730
- * @internal
2731
- */
2732
- constructor(wire, identity) {
2733
- super(wire, 'application', identity.uuid);
2734
- this.identity = identity;
2735
- this.window = new window_1._Window(this.wire, {
2736
- uuid: this.identity.uuid,
2737
- name: this.identity.uuid
2738
- });
2739
- }
2740
- windowListFromIdentityList(identityList) {
2741
- const windowList = [];
2742
- identityList.forEach((identity) => {
2743
- windowList.push(new window_1._Window(this.wire, {
2744
- uuid: identity.uuid,
2745
- name: identity.name
2746
- }));
2747
- });
2748
- return windowList;
2749
- }
2750
- /**
2751
- * Determines if the application is currently running.
2752
- *
2753
- * @example
2754
- *
2755
- * ```js
2756
- * async function isAppRunning() {
2757
- * const app = await fin.Application.getCurrent();
2758
- * return await app.isRunning();
2759
- * }
2760
- * isAppRunning().then(running => console.log(`Current app is running: ${running}`)).catch(err => console.log(err));
2761
- * ```
2762
- */
2763
- isRunning() {
2764
- return this.wire.sendAction('is-application-running', this.identity).then(({ payload }) => payload.data);
2765
- }
2766
- /**
2767
- * Closes the application and any child windows created by the application.
2768
- * Cleans the application from state so it is no longer found in getAllApplications.
2769
- * @param force Close will be prevented from closing when force is false and
2770
- * ‘close-requested’ has been subscribed to for application’s main window.
2771
- *
2772
- * @example
2773
- *
2774
- * ```js
2775
- * async function closeApp() {
2776
- * const allApps1 = await fin.System.getAllApplications(); //[{uuid: 'app1', isRunning: true}, {uuid: 'app2', isRunning: true}]
2777
- * const app = await fin.Application.wrap({uuid: 'app2'});
2778
- * await app.quit();
2779
- * const allApps2 = await fin.System.getAllApplications(); //[{uuid: 'app1', isRunning: true}]
2780
- *
2781
- * }
2782
- * closeApp().then(() => console.log('Application quit')).catch(err => console.log(err));
2783
- * ```
2784
- */
2785
- async quit(force = false) {
2786
- try {
2787
- await this._close(force);
2788
- await this.wire.sendAction('destroy-application', { force, ...this.identity });
2789
- }
2790
- catch (error) {
2791
- const acceptableErrors = ['Remote connection has closed', 'Could not locate the requested application'];
2792
- if (!acceptableErrors.some((msg) => error.message.includes(msg))) {
2793
- throw error;
2794
- }
2795
- }
2796
- }
2797
- async _close(force = false) {
2798
- try {
2799
- await this.wire.sendAction('close-application', { force, ...this.identity });
2800
- }
2801
- catch (error) {
2802
- if (!error.message.includes('Remote connection has closed')) {
2803
- throw error;
2804
- }
2805
- }
2806
- }
2807
- /**
2808
- * @deprecated use Application.quit instead
2809
- * Closes the application and any child windows created by the application.
2810
- * @param force - Close will be prevented from closing when force is false and ‘close-requested’ has been subscribed to for application’s main window.
2811
- * @param callback - called if the method succeeds.
2812
- * @param errorCallback - called if the method fails. The reason for failure is passed as an argument.
2813
- *
2814
- * @example
2815
- *
2816
- * ```js
2817
- * async function closeApp() {
2818
- * const app = await fin.Application.getCurrent();
2819
- * return await app.close();
2820
- * }
2821
- * closeApp().then(() => console.log('Application closed')).catch(err => console.log(err));
2822
- * ```
2823
- */
2824
- close(force = false) {
2825
- console.warn('Deprecation Warning: Application.close is deprecated Please use Application.quit');
2826
- this.wire.sendAction('application-close', this.identity).catch((e) => {
2827
- // we do not want to expose this error, just continue if this analytics-only call fails
2828
- });
2829
- return this._close(force);
2830
- }
2831
- /**
2832
- * Retrieves an array of wrapped fin.Windows for each of the application’s child windows.
2833
- *
2834
- * @example
2835
- *
2836
- * ```js
2837
- * async function getChildWindows() {
2838
- * const app = await fin.Application.getCurrent();
2839
- * return await app.getChildWindows();
2840
- * }
2841
- *
2842
- * getChildWindows().then(children => console.log(children)).catch(err => console.log(err));
2843
- * ```
2844
- */
2845
- getChildWindows() {
2846
- return this.wire.sendAction('get-child-windows', this.identity).then(({ payload }) => {
2847
- const identityList = [];
2848
- payload.data.forEach((winName) => {
2849
- identityList.push({ uuid: this.identity.uuid, name: winName });
2850
- });
2851
- return this.windowListFromIdentityList(identityList);
2852
- });
2853
- }
2854
- /**
2855
- * Retrieves the JSON manifest that was used to create the application. Invokes the error callback
2856
- * if the application was not created from a manifest.
2857
- *
2858
- * @example
2859
- *
2860
- * ```js
2861
- * async function getManifest() {
2862
- * const app = await fin.Application.getCurrent();
2863
- * return await app.getManifest();
2864
- * }
2865
- *
2866
- * getManifest().then(manifest => console.log(manifest)).catch(err => console.log(err));
2867
- * ```
2868
- */
2869
- getManifest() {
2870
- return this.wire.sendAction('get-application-manifest', this.identity).then(({ payload }) => payload.data);
2871
- }
2872
- /**
2873
- * Retrieves UUID of the application that launches this application. Invokes the error callback
2874
- * if the application was created from a manifest.
2875
- *
2876
- * @example
2877
- *
2878
- * ```js
2879
- * async function getParentUuid() {
2880
- * const app = await fin.Application.start({
2881
- * uuid: 'app-1',
2882
- * name: 'myApp',
2883
- * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.getParentUuid.html',
2884
- * autoShow: true
2885
- * });
2886
- * return await app.getParentUuid();
2887
- * }
2888
- *
2889
- * getParentUuid().then(parentUuid => console.log(parentUuid)).catch(err => console.log(err));
2890
- * ```
2891
- */
2892
- getParentUuid() {
2893
- return this.wire.sendAction('get-parent-application', this.identity).then(({ payload }) => payload.data);
2894
- }
2895
- /**
2896
- * Retrieves current application's shortcut configuration.
2897
- *
2898
- * @example
2899
- *
2900
- * ```js
2901
- * async function getShortcuts() {
2902
- * const app = await fin.Application.wrap({ uuid: 'testapp' });
2903
- * return await app.getShortcuts();
2904
- * }
2905
- * getShortcuts().then(config => console.log(config)).catch(err => console.log(err));
2906
- * ```
2907
- */
2908
- getShortcuts() {
2909
- return this.wire.sendAction('get-shortcuts', this.identity).then(({ payload }) => payload.data);
2910
- }
2911
- /**
2912
- * Retrieves current application's views.
2913
- * @experimental
2914
- *
2915
- * @example
2916
- *
2917
- * ```js
2918
- * async function getViews() {
2919
- * const app = await fin.Application.getCurrent();
2920
- * return await app.getViews();
2921
- * }
2922
- * getViews().then(views => console.log(views)).catch(err => console.log(err));
2923
- * ```
2924
- */
2925
- async getViews() {
2926
- const { payload } = await this.wire.sendAction('application-get-views', this.identity);
2927
- return payload.data.map((id) => new view_1.View(this.wire, id));
2928
- }
2929
- /**
2930
- * Returns the current zoom level of the application.
2931
- *
2932
- * @example
2933
- *
2934
- * ```js
2935
- * async function getZoomLevel() {
2936
- * const app = await fin.Application.getCurrent();
2937
- * return await app.getZoomLevel();
2938
- * }
2939
- *
2940
- * getZoomLevel().then(zoomLevel => console.log(zoomLevel)).catch(err => console.log(err));
2941
- * ```
2942
- */
2943
- getZoomLevel() {
2944
- return this.wire.sendAction('get-application-zoom-level', this.identity).then(({ payload }) => payload.data);
2945
- }
2946
- /**
2947
- * Returns an instance of the main Window of the application
2948
- *
2949
- * @example
2950
- *
2951
- * ```js
2952
- * async function getWindow() {
2953
- * const app = await fin.Application.start({
2954
- * uuid: 'app-1',
2955
- * name: 'myApp',
2956
- * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.getWindow.html',
2957
- * autoShow: true
2958
- * });
2959
- * return await app.getWindow();
2960
- * }
2961
- *
2962
- * getWindow().then(win => {
2963
- * win.showAt(0, 400);
2964
- * win.flash();
2965
- * }).catch(err => console.log(err));
2966
- * ```
2967
- */
2968
- getWindow() {
2969
- this.wire.sendAction('application-get-window', this.identity).catch((e) => {
2970
- // we do not want to expose this error, just continue if this analytics-only call fails
2971
- });
2972
- return Promise.resolve(this.window);
2973
- }
2974
- /**
2975
- * Manually registers a user with the licensing service. The only data sent by this call is userName and appName.
2976
- * @param userName - username to be passed to the RVM.
2977
- * @param appName - app name to be passed to the RVM.
2978
- *
2979
- * @example
2980
- *
2981
- * ```js
2982
- * async function registerUser() {
2983
- * const app = await fin.Application.getCurrent();
2984
- * return await app.registerUser('user', 'myApp');
2985
- * }
2986
- *
2987
- * registerUser().then(() => console.log('Successfully registered the user')).catch(err => console.log(err));
2988
- * ```
2989
- */
2990
- registerUser(userName, appName) {
2991
- return this.wire.sendAction('register-user', { userName, appName, ...this.identity }).then(() => undefined);
2992
- }
2993
- /**
2994
- * Removes the application’s icon from the tray.
2995
- *
2996
- * @example
2997
- *
2998
- * ```js
2999
- * async function removeTrayIcon() {
3000
- * const app = await fin.Application.getCurrent();
3001
- * return await app.removeTrayIcon();
3002
- * }
3003
- *
3004
- * removeTrayIcon().then(() => console.log('Removed the tray icon.')).catch(err => console.log(err));
3005
- * ```
3006
- */
3007
- removeTrayIcon() {
3008
- return this.wire.sendAction('remove-tray-icon', this.identity).then(() => undefined);
3009
- }
3010
- /**
3011
- * Restarts the application.
3012
- *
3013
- * @example
3014
- *
3015
- * ```js
3016
- * async function restartApp() {
3017
- * const app = await fin.Application.getCurrent();
3018
- * return await app.restart();
3019
- * }
3020
- * restartApp().then(() => console.log('Application restarted')).catch(err => console.log(err));
3021
- * ```
3022
- */
3023
- restart() {
3024
- return this.wire.sendAction('restart-application', this.identity).then(() => undefined);
3025
- }
3026
- /**
3027
- * DEPRECATED method to run the application.
3028
- * Needed when starting application via {@link Application.create}, but NOT needed when starting via {@link Application.start}.
3029
- *
3030
- * @example
3031
- *
3032
- * ```js
3033
- * async function run() {
3034
- * const app = await fin.Application.create({
3035
- * name: 'myApp',
3036
- * uuid: 'app-1',
3037
- * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.run.html',
3038
- * autoShow: true
3039
- * });
3040
- * await app.run();
3041
- * }
3042
- * run().then(() => console.log('Application is running')).catch(err => console.log(err));
3043
- * ```
3044
- *
3045
- * @ignore
3046
- */
3047
- run() {
3048
- console.warn('Deprecation Warning: Application.run is deprecated Please use fin.Application.start');
3049
- this.wire.sendAction('application-run', this.identity).catch((e) => {
3050
- // we do not want to expose this error, just continue if this analytics-only call fails
3051
- });
3052
- return this._run();
3053
- }
3054
- _run(opts = {}) {
3055
- return this.wire
3056
- .sendAction('run-application', {
3057
- manifestUrl: this._manifestUrl,
3058
- opts,
3059
- ...this.identity
3060
- })
3061
- .then(() => undefined);
3062
- }
3063
- /**
3064
- * Instructs the RVM to schedule one restart of the application.
3065
- *
3066
- * @example
3067
- *
3068
- * ```js
3069
- * async function scheduleRestart() {
3070
- * const app = await fin.Application.getCurrent();
3071
- * return await app.scheduleRestart();
3072
- * }
3073
- *
3074
- * scheduleRestart().then(() => console.log('Application is scheduled to restart')).catch(err => console.log(err));
3075
- * ```
3076
- */
3077
- scheduleRestart() {
3078
- return this.wire.sendAction('relaunch-on-close', this.identity).then(() => undefined);
3079
- }
3080
- /**
3081
- * Sends a message to the RVM to upload the application's logs. On success,
3082
- * an object containing logId is returned.
3083
- *
3084
- * @example
3085
- *
3086
- * ```js
3087
- * async function sendLog() {
3088
- * const app = await fin.Application.getCurrent();
3089
- * return await app.sendApplicationLog();
3090
- * }
3091
- *
3092
- * sendLog().then(info => console.log(info.logId)).catch(err => console.log(err));
3093
- * ```
3094
- */
3095
- async sendApplicationLog() {
3096
- const { payload } = await this.wire.sendAction('send-application-log', this.identity);
3097
- return payload.data;
3098
- }
3099
- /**
3100
- * Sets or removes a custom JumpList for the application. Only applicable in Windows OS.
3101
- * If categories is null the previously set custom JumpList (if any) will be replaced by the standard JumpList for the app (managed by Windows).
3102
- *
3103
- * Note: If the "name" property is omitted it defaults to "tasks".
3104
- * @param jumpListCategories An array of JumpList Categories to populate. If null, remove any existing JumpList configuration and set to Windows default.
3105
- *
3106
- *
3107
- * @remarks If categories is null the previously set custom JumpList (if any) will be replaced by the standard JumpList for the app (managed by Windows).
3108
- *
3109
- * The bottommost item in the jumplist will always be an item pointing to the current app. Its name is taken from the manifest's
3110
- * **` shortcut.name `** and uses **` shortcut.company `** as a fallback. Clicking that item will launch the app from its current manifest.
3111
- *
3112
- * Note: If the "name" property is omitted it defaults to "tasks".
3113
- *
3114
- * Note: Window OS caches jumplists icons, therefore an icon change might only be visible after the cache is removed or the
3115
- * uuid or shortcut.name is changed.
3116
- *
3117
- * @example
3118
- *
3119
- * ```js
3120
- * const app = fin.Application.getCurrentSync();
3121
- * const appName = 'My App';
3122
- * const jumpListConfig = [ // array of JumpList categories
3123
- * {
3124
- * // has no name and no type so `type` is assumed to be "tasks"
3125
- * items: [ // array of JumpList items
3126
- * {
3127
- * type: 'task',
3128
- * title: `Launch ${appName}`,
3129
- * description: `Runs ${appName} with the default configuration`,
3130
- * deepLink: 'fins://path.to/app/manifest.json',
3131
- * iconPath: 'https://path.to/app/icon.ico',
3132
- * iconIndex: 0
3133
- * },
3134
- * { type: 'separator' },
3135
- * {
3136
- * type: 'task',
3137
- * title: `Restore ${appName}`,
3138
- * description: 'Restore to last configuration',
3139
- * deepLink: 'fins://path.to/app/manifest.json?$$use-last-configuration=true',
3140
- * iconPath: 'https://path.to/app/icon.ico',
3141
- * iconIndex: 0
3142
- * },
3143
- * ]
3144
- * },
3145
- * {
3146
- * name: 'Tools',
3147
- * items: [ // array of JumpList items
3148
- * {
3149
- * type: 'task',
3150
- * title: 'Tool A',
3151
- * description: 'Runs Tool A',
3152
- * deepLink: 'fins://path.to/tool-a/manifest.json',
3153
- * iconPath: 'https://path.to/tool-a/icon.ico',
3154
- * iconIndex: 0
3155
- * },
3156
- * {
3157
- * type: 'task',
3158
- * title: 'Tool B',
3159
- * description: 'Runs Tool B',
3160
- * deepLink: 'fins://path.to/tool-b/manifest.json',
3161
- * iconPath: 'https://path.to/tool-b/icon.ico',
3162
- * iconIndex: 0
3163
- * }]
3164
- * }
3165
- * ];
3166
- *
3167
- * app.setJumpList(jumpListConfig).then(() => console.log('JumpList applied')).catch(e => console.log(`JumpList failed to apply: ${e.toString()}`));
3168
- * ```
3169
- *
3170
- * To handle deeplink args:
3171
- * ```js
3172
- * function handleUseLastConfiguration() {
3173
- * // this handler is called when the app is being launched
3174
- * app.on('run-requested', event => {
3175
- * if(event.userAppConfigArgs['use-last-configuration']) {
3176
- * // your logic here
3177
- * }
3178
- * });
3179
- * // this handler is called when the app was already running when the launch was requested
3180
- * fin.desktop.main(function(args) {
3181
- * if(args && args['use-last-configuration']) {
3182
- * // your logic here
3183
- * }
3184
- * });
3185
- * }
3186
- * ```
3187
- */
3188
- async setJumpList(jumpListCategories) {
3189
- await this.wire.sendAction('set-jump-list', { config: jumpListCategories, ...this.identity });
3190
- }
3191
- /**
3192
- * Adds a customizable icon in the system tray. To listen for a click on the icon use the `tray-icon-clicked` event.
3193
- * @param icon Image URL or base64 encoded string to be used as the icon
3194
- *
3195
- * @example
3196
- *
3197
- * ```js
3198
- * const imageUrl = "http://cdn.openfin.co/assets/testing/icons/circled-digit-one.png";
3199
- * const base64EncodedImage = "iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIAQMAAAD+wSzIAAAABlBMVEX\
3200
- * ///+/v7+jQ3Y5AAAADklEQVQI12P4AIX8EAgALgAD/aNpbtEAAAAASUVORK5CYII";
3201
- * const dataURL = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DH\
3202
- * xgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==";
3203
- *
3204
- * async function setTrayIcon(icon) {
3205
- * const app = await fin.Application.getCurrent();
3206
- * return await app.setTrayIcon(icon);
3207
- * }
3208
- *
3209
- * // use image url to set tray icon
3210
- * setTrayIcon(imageUrl).then(() => console.log('Setting tray icon')).catch(err => console.log(err));
3211
- *
3212
- * // use base64 encoded string to set tray icon
3213
- * setTrayIcon(base64EncodedImage).then(() => console.log('Setting tray icon')).catch(err => console.log(err));
3214
- *
3215
- * // use a dataURL to set tray icon
3216
- * setTrayIcon(dataURL).then(() => console.log('Setting tray icon')).catch(err => console.log(err));
3217
- * ```
3218
- */
3219
- setTrayIcon(icon) {
3220
- return this.wire
3221
- .sendAction('set-tray-icon', {
3222
- enabledIcon: icon,
3223
- ...this.identity
3224
- })
3225
- .then(() => undefined);
3226
- }
3227
- /**
3228
- * Set hover text for this application's system tray icon.
3229
- * Note: Application must first set a tray icon with {@link Application.setTrayIcon}.
3230
- * @param toolTip
3231
- *
3232
- * @example
3233
- *
3234
- * ```js
3235
- * const app = fin.Application.getCurrentSync();
3236
- * const iconUrl = "http://cdn.openfin.co/assets/testing/icons/circled-digit-one.png";
3237
- *
3238
- * await app.setTrayIcon(iconUrl);
3239
- *
3240
- * await app.setTrayIconToolTip('My Application');
3241
- * ```
3242
- */
3243
- async setTrayIconToolTip(toolTip) {
3244
- await this.wire.sendAction('set-tray-icon-tooltip', { ...this.identity, toolTip });
3245
- }
3246
- /**
3247
- * Sets new application's shortcut configuration. Windows only.
3248
- * @param config New application's shortcut configuration.
3249
- *
3250
- * @remarks Application has to be launched with a manifest and has to have shortcut configuration (icon url, name, etc.) in its manifest
3251
- * to be able to change shortcut states.
3252
- *
3253
- * @example
3254
- *
3255
- * ```js
3256
- * async function setShortcuts(config) {
3257
- * const app = await fin.Application.getCurrent();
3258
- * return app.setShortcuts(config);
3259
- * }
3260
- *
3261
- * setShortcuts({
3262
- * desktop: true,
3263
- * startMenu: false,
3264
- * systemStartup: true
3265
- * }).then(() => console.log('Shortcuts are set.')).catch(err => console.log(err));
3266
- * ```
3267
- */
3268
- setShortcuts(config) {
3269
- return this.wire.sendAction('set-shortcuts', { data: config, ...this.identity }).then(() => undefined);
3270
- }
3271
- /**
3272
- * Sets the query string in all shortcuts for this app. Requires RVM 5.5+.
3273
- * @param queryString The new query string for this app's shortcuts.
3274
- *
3275
- * @example
3276
- *
3277
- * ```js
3278
- * const newQueryArgs = 'arg=true&arg2=false';
3279
- * const app = await fin.Application.getCurrent();
3280
- * try {
3281
- * await app.setShortcutQueryParams(newQueryArgs);
3282
- * } catch(err) {
3283
- * console.error(err)
3284
- * }
3285
- * ```
3286
- */
3287
- async setShortcutQueryParams(queryString) {
3288
- await this.wire.sendAction('set-shortcut-query-args', { data: queryString, ...this.identity });
3289
- }
3290
- /**
3291
- * Sets the zoom level of the application. The original size is 0 and each increment above or below represents zooming 20%
3292
- * larger or smaller to default limits of 300% and 50% of original size, respectively.
3293
- * @param level The zoom level
3294
- *
3295
- * @example
3296
- *
3297
- * ```js
3298
- * async function setZoomLevel(number) {
3299
- * const app = await fin.Application.getCurrent();
3300
- * return await app.setZoomLevel(number);
3301
- * }
3302
- *
3303
- * setZoomLevel(5).then(() => console.log('Setting a zoom level')).catch(err => console.log(err));
3304
- * ```
3305
- */
3306
- setZoomLevel(level) {
3307
- return this.wire.sendAction('set-application-zoom-level', { level, ...this.identity }).then(() => undefined);
3308
- }
3309
- /**
3310
- * Sets a username to correlate with App Log Management.
3311
- * @param username Username to correlate with App's Log.
3312
- *
3313
- * @example
3314
- *
3315
- * ```js
3316
- * async function setAppLogUser() {
3317
- * const app = await fin.Application.getCurrent();
3318
- * return await app.setAppLogUsername('username');
3319
- * }
3320
- *
3321
- * setAppLogUser().then(() => console.log('Success')).catch(err => console.log(err));
3322
- *
3323
- * ```
3324
- */
3325
- async setAppLogUsername(username) {
3326
- await this.wire.sendAction('set-app-log-username', { data: username, ...this.identity });
3327
- }
3328
- /**
3329
- * Retrieves information about the system tray. If the system tray is not set, it will throw an error message.
3330
- * @remarks The only information currently returned is the position and dimensions.
3331
- *
3332
- * @example
3333
- *
3334
- * ```js
3335
- * async function getTrayIconInfo() {
3336
- * const app = await fin.Application.wrap({ uuid: 'testapp' });
3337
- * return await app.getTrayIconInfo();
3338
- * }
3339
- * getTrayIconInfo().then(info => console.log(info)).catch(err => console.log(err));
3340
- * ```
3341
- */
3342
- getTrayIconInfo() {
3343
- return this.wire.sendAction('get-tray-icon-info', this.identity).then(({ payload }) => payload.data);
3344
- }
3345
- /**
3346
- * Checks if the application has an associated tray icon.
3347
- *
3348
- * @example
3349
- *
3350
- * ```js
3351
- * const app = await fin.Application.wrap({ uuid: 'testapp' });
3352
- * const hasTrayIcon = await app.hasTrayIcon();
3353
- * console.log(hasTrayIcon);
3354
- * ```
3355
- */
3356
- hasTrayIcon() {
3357
- return this.wire.sendAction('has-tray-icon', this.identity).then(({ payload }) => payload.data);
3358
- }
3359
- /**
3360
- * Closes the application by terminating its process.
3361
- *
3362
- * @example
3363
- *
3364
- * ```js
3365
- * async function terminateApp() {
3366
- * const app = await fin.Application.getCurrent();
3367
- * return await app.terminate();
3368
- * }
3369
- * terminateApp().then(() => console.log('Application terminated')).catch(err => console.log(err));
3370
- * ```
3371
- */
3372
- terminate() {
3373
- return this.wire.sendAction('terminate-application', this.identity).then(() => undefined);
3374
- }
3375
- /**
3376
- * Waits for a hanging application. This method can be called in response to an application
3377
- * "not-responding" to allow the application to continue and to generate another "not-responding"
3378
- * message after a certain period of time.
3379
- *
3380
- * @ignore
3381
- */
3382
- wait() {
3383
- return this.wire.sendAction('wait-for-hung-application', this.identity).then(() => undefined);
3384
- }
3385
- /**
3386
- * Retrieves information about the application.
3387
- *
3388
- * @remarks If the application was not launched from a manifest, the call will return the closest parent application `manifest`
3389
- * and `manifestUrl`. `initialOptions` shows the parameters used when launched programmatically, or the `startup_app` options
3390
- * if launched from manifest. The `parentUuid` will be the uuid of the immediate parent (if applicable).
3391
- *
3392
- * @example
3393
- *
3394
- * ```js
3395
- * async function getInfo() {
3396
- * const app = await fin.Application.getCurrent();
3397
- * return await app.getInfo();
3398
- * }
3399
- *
3400
- * getInfo().then(info => console.log(info)).catch(err => console.log(err));
3401
- * ```
3402
- */
3403
- getInfo() {
3404
- return this.wire.sendAction('get-info', this.identity).then(({ payload }) => payload.data);
3405
- }
3406
- /**
3407
- * Retrieves all process information for entities (windows and views) associated with an application.
3408
- *
3409
- * @example
3410
- * ```js
3411
- * const app = await fin.Application.getCurrent();
3412
- * const processInfo = await app.getProcessInfo();
3413
- * ```
3414
- * @experimental
3415
- */
3416
- async getProcessInfo() {
3417
- const { payload: { data } } = await this.wire.sendAction('application-get-process-info', this.identity);
3418
- return data;
3419
- }
3420
- /**
3421
- * Sets file auto download location. It's only allowed in the same application.
3422
- *
3423
- * Note: This method is restricted by default and must be enabled via
3424
- * <a href="https://developers.openfin.co/docs/api-security">API security settings</a>.
3425
- * @param downloadLocation file auto download location
3426
- *
3427
- * @throws if setting file auto download location on different applications.
3428
- * @example
3429
- *
3430
- * ```js
3431
- * const downloadLocation = 'C:\\dev\\temp';
3432
- * const app = await fin.Application.getCurrent();
3433
- * try {
3434
- * await app.setFileDownloadLocation(downloadLocation);
3435
- * console.log('File download location is set');
3436
- * } catch(err) {
3437
- * console.error(err)
3438
- * }
3439
- * ```
3440
- */
3441
- async setFileDownloadLocation(downloadLocation) {
3442
- const { name } = this.wire.me;
3443
- const entityIdentity = { uuid: this.identity.uuid, name };
3444
- await this.wire.sendAction('set-file-download-location', { ...entityIdentity, downloadLocation });
3445
- }
3446
- /**
3447
- * Gets file auto download location. It's only allowed in the same application. If file auto download location is not set, it will return the default location.
3448
- *
3449
- * Note: This method is restricted by default and must be enabled via
3450
- * <a href="https://developers.openfin.co/docs/api-security">API security settings</a>.
3451
- *
3452
- * @throws if getting file auto download location on different applications.
3453
- * @example
3454
- *
3455
- * ```js
3456
- * const app = await fin.Application.getCurrent();
3457
- * const fileDownloadDir = await app.getFileDownloadLocation();
3458
- * ```
3459
- */
3460
- async getFileDownloadLocation() {
3461
- const { payload: { data } } = await this.wire.sendAction('get-file-download-location', this.identity);
3462
- return data;
3463
- }
3464
- /**
3465
- * Shows a menu on the tray icon. Use with tray-icon-clicked event.
3466
- * @param options
3467
- * @typeParam Data User-defined shape for data returned upon menu item click. Should be a
3468
- * [union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types)
3469
- * of all possible data shapes for the entire menu, and the click handler should process
3470
- * these with a "reducer" pattern.
3471
- * @throws if the application has no tray icon set
3472
- * @throws if the system tray is currently hidden
3473
- * @example
3474
- *
3475
- * ```js
3476
- * const iconUrl = 'http://cdn.openfin.co/assets/testing/icons/circled-digit-one.png';
3477
- * const app = fin.Application.getCurrentSync();
3478
- *
3479
- * await app.setTrayIcon(iconUrl);
3480
- *
3481
- * const template = [
3482
- * {
3483
- * label: 'Menu Item 1',
3484
- * data: 'hello from item 1'
3485
- * },
3486
- * { type: 'separator' },
3487
- * {
3488
- * label: 'Menu Item 2',
3489
- * type: 'checkbox',
3490
- * checked: true,
3491
- * data: 'The user clicked the checkbox'
3492
- * },
3493
- * {
3494
- * label: 'see more',
3495
- * enabled: false,
3496
- * submenu: [
3497
- * { label: 'submenu 1', data: 'hello from submenu' }
3498
- * ]
3499
- * }
3500
- * ];
3501
- *
3502
- * app.addListener('tray-icon-clicked', (event) => {
3503
- * // right-click
3504
- * if (event.button === 2) {
3505
- * app.showTrayIconPopupMenu({ template }).then(r => {
3506
- * if (r.result === 'closed') {
3507
- * console.log('nothing happened');
3508
- * } else {
3509
- * console.log(r.data);
3510
- * }
3511
- * });
3512
- * }
3513
- * });
3514
- * ```
3515
- */
3516
- async showTrayIconPopupMenu(options) {
3517
- const { name } = this.wire.me;
3518
- const entityIdentity = { uuid: this.identity.uuid, name };
3519
- const { payload } = await this.wire.sendAction('show-tray-icon-popup-menu', { ...entityIdentity, options });
3520
- return payload.data;
3521
- }
3522
- /**
3523
- * Closes the tray icon menu.
3524
- *
3525
- * @throws if the application has no tray icon set
3526
- * @example
3527
- *
3528
- * ```js
3529
- * const app = fin.Application.getCurrentSync();
3530
- *
3531
- * await app.closeTrayIconPopupMenu();
3532
- * ```
3533
- */
3534
- async closeTrayIconPopupMenu() {
3535
- const { name } = this.wire.me;
3536
- const entityIdentity = { uuid: this.identity.uuid, name };
3537
- await this.wire.sendAction('close-tray-icon-popup-menu', { ...entityIdentity });
3538
- }
3539
- }
3540
- Instance$6.Application = Application;
3541
- return Instance$6;
2716
+ Object.defineProperty(Instance$6, "__esModule", { value: true });
2717
+ Instance$6.Application = void 0;
2718
+ /* eslint-disable import/prefer-default-export */
2719
+ const base_1$o = base;
2720
+ const window_1$1 = requireWindow();
2721
+ const view_1 = requireView();
2722
+ /**
2723
+ * An object representing an application. Allows the developer to create,
2724
+ * execute, show/close an application as well as listen to {@link OpenFin.ApplicationEvents application events}.
2725
+ */
2726
+ class Application extends base_1$o.EmitterBase {
2727
+ /**
2728
+ * @internal
2729
+ */
2730
+ constructor(wire, identity) {
2731
+ super(wire, 'application', identity.uuid);
2732
+ this.identity = identity;
2733
+ this.window = new window_1$1._Window(this.wire, {
2734
+ uuid: this.identity.uuid,
2735
+ name: this.identity.uuid
2736
+ });
2737
+ }
2738
+ windowListFromIdentityList(identityList) {
2739
+ const windowList = [];
2740
+ identityList.forEach((identity) => {
2741
+ windowList.push(new window_1$1._Window(this.wire, {
2742
+ uuid: identity.uuid,
2743
+ name: identity.name
2744
+ }));
2745
+ });
2746
+ return windowList;
2747
+ }
2748
+ /**
2749
+ * Determines if the application is currently running.
2750
+ *
2751
+ * @example
2752
+ *
2753
+ * ```js
2754
+ * async function isAppRunning() {
2755
+ * const app = await fin.Application.getCurrent();
2756
+ * return await app.isRunning();
2757
+ * }
2758
+ * isAppRunning().then(running => console.log(`Current app is running: ${running}`)).catch(err => console.log(err));
2759
+ * ```
2760
+ */
2761
+ isRunning() {
2762
+ return this.wire.sendAction('is-application-running', this.identity).then(({ payload }) => payload.data);
2763
+ }
2764
+ /**
2765
+ * Closes the application and any child windows created by the application.
2766
+ * Cleans the application from state so it is no longer found in getAllApplications.
2767
+ * @param force Close will be prevented from closing when force is false and
2768
+ * ‘close-requested’ has been subscribed to for application’s main window.
2769
+ *
2770
+ * @example
2771
+ *
2772
+ * ```js
2773
+ * async function closeApp() {
2774
+ * const allApps1 = await fin.System.getAllApplications(); //[{uuid: 'app1', isRunning: true}, {uuid: 'app2', isRunning: true}]
2775
+ * const app = await fin.Application.wrap({uuid: 'app2'});
2776
+ * await app.quit();
2777
+ * const allApps2 = await fin.System.getAllApplications(); //[{uuid: 'app1', isRunning: true}]
2778
+ *
2779
+ * }
2780
+ * closeApp().then(() => console.log('Application quit')).catch(err => console.log(err));
2781
+ * ```
2782
+ */
2783
+ async quit(force = false) {
2784
+ try {
2785
+ await this._close(force);
2786
+ await this.wire.sendAction('destroy-application', { force, ...this.identity });
2787
+ }
2788
+ catch (error) {
2789
+ const acceptableErrors = ['Remote connection has closed', 'Could not locate the requested application'];
2790
+ if (!acceptableErrors.some((msg) => error.message.includes(msg))) {
2791
+ throw error;
2792
+ }
2793
+ }
2794
+ }
2795
+ async _close(force = false) {
2796
+ try {
2797
+ await this.wire.sendAction('close-application', { force, ...this.identity });
2798
+ }
2799
+ catch (error) {
2800
+ if (!error.message.includes('Remote connection has closed')) {
2801
+ throw error;
2802
+ }
2803
+ }
2804
+ }
2805
+ /**
2806
+ * @deprecated use Application.quit instead
2807
+ * Closes the application and any child windows created by the application.
2808
+ * @param force - Close will be prevented from closing when force is false and ‘close-requested’ has been subscribed to for application’s main window.
2809
+ * @param callback - called if the method succeeds.
2810
+ * @param errorCallback - called if the method fails. The reason for failure is passed as an argument.
2811
+ *
2812
+ * @example
2813
+ *
2814
+ * ```js
2815
+ * async function closeApp() {
2816
+ * const app = await fin.Application.getCurrent();
2817
+ * return await app.close();
2818
+ * }
2819
+ * closeApp().then(() => console.log('Application closed')).catch(err => console.log(err));
2820
+ * ```
2821
+ */
2822
+ close(force = false) {
2823
+ console.warn('Deprecation Warning: Application.close is deprecated Please use Application.quit');
2824
+ this.wire.sendAction('application-close', this.identity).catch((e) => {
2825
+ // we do not want to expose this error, just continue if this analytics-only call fails
2826
+ });
2827
+ return this._close(force);
2828
+ }
2829
+ /**
2830
+ * Retrieves an array of wrapped fin.Windows for each of the application’s child windows.
2831
+ *
2832
+ * @example
2833
+ *
2834
+ * ```js
2835
+ * async function getChildWindows() {
2836
+ * const app = await fin.Application.getCurrent();
2837
+ * return await app.getChildWindows();
2838
+ * }
2839
+ *
2840
+ * getChildWindows().then(children => console.log(children)).catch(err => console.log(err));
2841
+ * ```
2842
+ */
2843
+ getChildWindows() {
2844
+ return this.wire.sendAction('get-child-windows', this.identity).then(({ payload }) => {
2845
+ const identityList = [];
2846
+ payload.data.forEach((winName) => {
2847
+ identityList.push({ uuid: this.identity.uuid, name: winName });
2848
+ });
2849
+ return this.windowListFromIdentityList(identityList);
2850
+ });
2851
+ }
2852
+ /**
2853
+ * Retrieves the JSON manifest that was used to create the application. Invokes the error callback
2854
+ * if the application was not created from a manifest.
2855
+ *
2856
+ * @example
2857
+ *
2858
+ * ```js
2859
+ * async function getManifest() {
2860
+ * const app = await fin.Application.getCurrent();
2861
+ * return await app.getManifest();
2862
+ * }
2863
+ *
2864
+ * getManifest().then(manifest => console.log(manifest)).catch(err => console.log(err));
2865
+ * ```
2866
+ */
2867
+ getManifest() {
2868
+ return this.wire.sendAction('get-application-manifest', this.identity).then(({ payload }) => payload.data);
2869
+ }
2870
+ /**
2871
+ * Retrieves UUID of the application that launches this application. Invokes the error callback
2872
+ * if the application was created from a manifest.
2873
+ *
2874
+ * @example
2875
+ *
2876
+ * ```js
2877
+ * async function getParentUuid() {
2878
+ * const app = await fin.Application.start({
2879
+ * uuid: 'app-1',
2880
+ * name: 'myApp',
2881
+ * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.getParentUuid.html',
2882
+ * autoShow: true
2883
+ * });
2884
+ * return await app.getParentUuid();
2885
+ * }
2886
+ *
2887
+ * getParentUuid().then(parentUuid => console.log(parentUuid)).catch(err => console.log(err));
2888
+ * ```
2889
+ */
2890
+ getParentUuid() {
2891
+ return this.wire.sendAction('get-parent-application', this.identity).then(({ payload }) => payload.data);
2892
+ }
2893
+ /**
2894
+ * Retrieves current application's shortcut configuration.
2895
+ *
2896
+ * @example
2897
+ *
2898
+ * ```js
2899
+ * async function getShortcuts() {
2900
+ * const app = await fin.Application.wrap({ uuid: 'testapp' });
2901
+ * return await app.getShortcuts();
2902
+ * }
2903
+ * getShortcuts().then(config => console.log(config)).catch(err => console.log(err));
2904
+ * ```
2905
+ */
2906
+ getShortcuts() {
2907
+ return this.wire.sendAction('get-shortcuts', this.identity).then(({ payload }) => payload.data);
2908
+ }
2909
+ /**
2910
+ * Retrieves current application's views.
2911
+ * @experimental
2912
+ *
2913
+ * @example
2914
+ *
2915
+ * ```js
2916
+ * async function getViews() {
2917
+ * const app = await fin.Application.getCurrent();
2918
+ * return await app.getViews();
2919
+ * }
2920
+ * getViews().then(views => console.log(views)).catch(err => console.log(err));
2921
+ * ```
2922
+ */
2923
+ async getViews() {
2924
+ const { payload } = await this.wire.sendAction('application-get-views', this.identity);
2925
+ return payload.data.map((id) => new view_1.View(this.wire, id));
2926
+ }
2927
+ /**
2928
+ * Returns the current zoom level of the application.
2929
+ *
2930
+ * @example
2931
+ *
2932
+ * ```js
2933
+ * async function getZoomLevel() {
2934
+ * const app = await fin.Application.getCurrent();
2935
+ * return await app.getZoomLevel();
2936
+ * }
2937
+ *
2938
+ * getZoomLevel().then(zoomLevel => console.log(zoomLevel)).catch(err => console.log(err));
2939
+ * ```
2940
+ */
2941
+ getZoomLevel() {
2942
+ return this.wire.sendAction('get-application-zoom-level', this.identity).then(({ payload }) => payload.data);
2943
+ }
2944
+ /**
2945
+ * Returns an instance of the main Window of the application
2946
+ *
2947
+ * @example
2948
+ *
2949
+ * ```js
2950
+ * async function getWindow() {
2951
+ * const app = await fin.Application.start({
2952
+ * uuid: 'app-1',
2953
+ * name: 'myApp',
2954
+ * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.getWindow.html',
2955
+ * autoShow: true
2956
+ * });
2957
+ * return await app.getWindow();
2958
+ * }
2959
+ *
2960
+ * getWindow().then(win => {
2961
+ * win.showAt(0, 400);
2962
+ * win.flash();
2963
+ * }).catch(err => console.log(err));
2964
+ * ```
2965
+ */
2966
+ getWindow() {
2967
+ this.wire.sendAction('application-get-window', this.identity).catch((e) => {
2968
+ // we do not want to expose this error, just continue if this analytics-only call fails
2969
+ });
2970
+ return Promise.resolve(this.window);
2971
+ }
2972
+ /**
2973
+ * Manually registers a user with the licensing service. The only data sent by this call is userName and appName.
2974
+ * @param userName - username to be passed to the RVM.
2975
+ * @param appName - app name to be passed to the RVM.
2976
+ *
2977
+ * @example
2978
+ *
2979
+ * ```js
2980
+ * async function registerUser() {
2981
+ * const app = await fin.Application.getCurrent();
2982
+ * return await app.registerUser('user', 'myApp');
2983
+ * }
2984
+ *
2985
+ * registerUser().then(() => console.log('Successfully registered the user')).catch(err => console.log(err));
2986
+ * ```
2987
+ */
2988
+ registerUser(userName, appName) {
2989
+ return this.wire.sendAction('register-user', { userName, appName, ...this.identity }).then(() => undefined);
2990
+ }
2991
+ /**
2992
+ * Removes the application’s icon from the tray.
2993
+ *
2994
+ * @example
2995
+ *
2996
+ * ```js
2997
+ * async function removeTrayIcon() {
2998
+ * const app = await fin.Application.getCurrent();
2999
+ * return await app.removeTrayIcon();
3000
+ * }
3001
+ *
3002
+ * removeTrayIcon().then(() => console.log('Removed the tray icon.')).catch(err => console.log(err));
3003
+ * ```
3004
+ */
3005
+ removeTrayIcon() {
3006
+ return this.wire.sendAction('remove-tray-icon', this.identity).then(() => undefined);
3007
+ }
3008
+ /**
3009
+ * Restarts the application.
3010
+ *
3011
+ * @example
3012
+ *
3013
+ * ```js
3014
+ * async function restartApp() {
3015
+ * const app = await fin.Application.getCurrent();
3016
+ * return await app.restart();
3017
+ * }
3018
+ * restartApp().then(() => console.log('Application restarted')).catch(err => console.log(err));
3019
+ * ```
3020
+ */
3021
+ restart() {
3022
+ return this.wire.sendAction('restart-application', this.identity).then(() => undefined);
3023
+ }
3024
+ /**
3025
+ * DEPRECATED method to run the application.
3026
+ * Needed when starting application via {@link Application.create}, but NOT needed when starting via {@link Application.start}.
3027
+ *
3028
+ * @example
3029
+ *
3030
+ * ```js
3031
+ * async function run() {
3032
+ * const app = await fin.Application.create({
3033
+ * name: 'myApp',
3034
+ * uuid: 'app-1',
3035
+ * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.run.html',
3036
+ * autoShow: true
3037
+ * });
3038
+ * await app.run();
3039
+ * }
3040
+ * run().then(() => console.log('Application is running')).catch(err => console.log(err));
3041
+ * ```
3042
+ *
3043
+ * @ignore
3044
+ */
3045
+ run() {
3046
+ console.warn('Deprecation Warning: Application.run is deprecated Please use fin.Application.start');
3047
+ this.wire.sendAction('application-run', this.identity).catch((e) => {
3048
+ // we do not want to expose this error, just continue if this analytics-only call fails
3049
+ });
3050
+ return this._run();
3051
+ }
3052
+ _run(opts = {}) {
3053
+ return this.wire
3054
+ .sendAction('run-application', {
3055
+ manifestUrl: this._manifestUrl,
3056
+ opts,
3057
+ ...this.identity
3058
+ })
3059
+ .then(() => undefined);
3060
+ }
3061
+ /**
3062
+ * Instructs the RVM to schedule one restart of the application.
3063
+ *
3064
+ * @example
3065
+ *
3066
+ * ```js
3067
+ * async function scheduleRestart() {
3068
+ * const app = await fin.Application.getCurrent();
3069
+ * return await app.scheduleRestart();
3070
+ * }
3071
+ *
3072
+ * scheduleRestart().then(() => console.log('Application is scheduled to restart')).catch(err => console.log(err));
3073
+ * ```
3074
+ */
3075
+ scheduleRestart() {
3076
+ return this.wire.sendAction('relaunch-on-close', this.identity).then(() => undefined);
3077
+ }
3078
+ /**
3079
+ * Sends a message to the RVM to upload the application's logs. On success,
3080
+ * an object containing logId is returned.
3081
+ *
3082
+ * @example
3083
+ *
3084
+ * ```js
3085
+ * async function sendLog() {
3086
+ * const app = await fin.Application.getCurrent();
3087
+ * return await app.sendApplicationLog();
3088
+ * }
3089
+ *
3090
+ * sendLog().then(info => console.log(info.logId)).catch(err => console.log(err));
3091
+ * ```
3092
+ */
3093
+ async sendApplicationLog() {
3094
+ const { payload } = await this.wire.sendAction('send-application-log', this.identity);
3095
+ return payload.data;
3096
+ }
3097
+ /**
3098
+ * Sets or removes a custom JumpList for the application. Only applicable in Windows OS.
3099
+ * If categories is null the previously set custom JumpList (if any) will be replaced by the standard JumpList for the app (managed by Windows).
3100
+ *
3101
+ * Note: If the "name" property is omitted it defaults to "tasks".
3102
+ * @param jumpListCategories An array of JumpList Categories to populate. If null, remove any existing JumpList configuration and set to Windows default.
3103
+ *
3104
+ *
3105
+ * @remarks If categories is null the previously set custom JumpList (if any) will be replaced by the standard JumpList for the app (managed by Windows).
3106
+ *
3107
+ * The bottommost item in the jumplist will always be an item pointing to the current app. Its name is taken from the manifest's
3108
+ * **` shortcut.name `** and uses **` shortcut.company `** as a fallback. Clicking that item will launch the app from its current manifest.
3109
+ *
3110
+ * Note: If the "name" property is omitted it defaults to "tasks".
3111
+ *
3112
+ * Note: Window OS caches jumplists icons, therefore an icon change might only be visible after the cache is removed or the
3113
+ * uuid or shortcut.name is changed.
3114
+ *
3115
+ * @example
3116
+ *
3117
+ * ```js
3118
+ * const app = fin.Application.getCurrentSync();
3119
+ * const appName = 'My App';
3120
+ * const jumpListConfig = [ // array of JumpList categories
3121
+ * {
3122
+ * // has no name and no type so `type` is assumed to be "tasks"
3123
+ * items: [ // array of JumpList items
3124
+ * {
3125
+ * type: 'task',
3126
+ * title: `Launch ${appName}`,
3127
+ * description: `Runs ${appName} with the default configuration`,
3128
+ * deepLink: 'fins://path.to/app/manifest.json',
3129
+ * iconPath: 'https://path.to/app/icon.ico',
3130
+ * iconIndex: 0
3131
+ * },
3132
+ * { type: 'separator' },
3133
+ * {
3134
+ * type: 'task',
3135
+ * title: `Restore ${appName}`,
3136
+ * description: 'Restore to last configuration',
3137
+ * deepLink: 'fins://path.to/app/manifest.json?$$use-last-configuration=true',
3138
+ * iconPath: 'https://path.to/app/icon.ico',
3139
+ * iconIndex: 0
3140
+ * },
3141
+ * ]
3142
+ * },
3143
+ * {
3144
+ * name: 'Tools',
3145
+ * items: [ // array of JumpList items
3146
+ * {
3147
+ * type: 'task',
3148
+ * title: 'Tool A',
3149
+ * description: 'Runs Tool A',
3150
+ * deepLink: 'fins://path.to/tool-a/manifest.json',
3151
+ * iconPath: 'https://path.to/tool-a/icon.ico',
3152
+ * iconIndex: 0
3153
+ * },
3154
+ * {
3155
+ * type: 'task',
3156
+ * title: 'Tool B',
3157
+ * description: 'Runs Tool B',
3158
+ * deepLink: 'fins://path.to/tool-b/manifest.json',
3159
+ * iconPath: 'https://path.to/tool-b/icon.ico',
3160
+ * iconIndex: 0
3161
+ * }]
3162
+ * }
3163
+ * ];
3164
+ *
3165
+ * app.setJumpList(jumpListConfig).then(() => console.log('JumpList applied')).catch(e => console.log(`JumpList failed to apply: ${e.toString()}`));
3166
+ * ```
3167
+ *
3168
+ * To handle deeplink args:
3169
+ * ```js
3170
+ * function handleUseLastConfiguration() {
3171
+ * // this handler is called when the app is being launched
3172
+ * app.on('run-requested', event => {
3173
+ * if(event.userAppConfigArgs['use-last-configuration']) {
3174
+ * // your logic here
3175
+ * }
3176
+ * });
3177
+ * // this handler is called when the app was already running when the launch was requested
3178
+ * fin.desktop.main(function(args) {
3179
+ * if(args && args['use-last-configuration']) {
3180
+ * // your logic here
3181
+ * }
3182
+ * });
3183
+ * }
3184
+ * ```
3185
+ */
3186
+ async setJumpList(jumpListCategories) {
3187
+ await this.wire.sendAction('set-jump-list', { config: jumpListCategories, ...this.identity });
3188
+ }
3189
+ /**
3190
+ * Adds a customizable icon in the system tray. To listen for a click on the icon use the `tray-icon-clicked` event.
3191
+ * @param icon Image URL or base64 encoded string to be used as the icon
3192
+ *
3193
+ * @example
3194
+ *
3195
+ * ```js
3196
+ * const imageUrl = "http://cdn.openfin.co/assets/testing/icons/circled-digit-one.png";
3197
+ * const base64EncodedImage = "iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIAQMAAAD+wSzIAAAABlBMVEX\
3198
+ * ///+/v7+jQ3Y5AAAADklEQVQI12P4AIX8EAgALgAD/aNpbtEAAAAASUVORK5CYII";
3199
+ * const dataURL = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DH\
3200
+ * xgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==";
3201
+ *
3202
+ * async function setTrayIcon(icon) {
3203
+ * const app = await fin.Application.getCurrent();
3204
+ * return await app.setTrayIcon(icon);
3205
+ * }
3206
+ *
3207
+ * // use image url to set tray icon
3208
+ * setTrayIcon(imageUrl).then(() => console.log('Setting tray icon')).catch(err => console.log(err));
3209
+ *
3210
+ * // use base64 encoded string to set tray icon
3211
+ * setTrayIcon(base64EncodedImage).then(() => console.log('Setting tray icon')).catch(err => console.log(err));
3212
+ *
3213
+ * // use a dataURL to set tray icon
3214
+ * setTrayIcon(dataURL).then(() => console.log('Setting tray icon')).catch(err => console.log(err));
3215
+ * ```
3216
+ */
3217
+ setTrayIcon(icon) {
3218
+ return this.wire
3219
+ .sendAction('set-tray-icon', {
3220
+ enabledIcon: icon,
3221
+ ...this.identity
3222
+ })
3223
+ .then(() => undefined);
3224
+ }
3225
+ /**
3226
+ * Set hover text for this application's system tray icon.
3227
+ * Note: Application must first set a tray icon with {@link Application.setTrayIcon}.
3228
+ * @param toolTip
3229
+ *
3230
+ * @example
3231
+ *
3232
+ * ```js
3233
+ * const app = fin.Application.getCurrentSync();
3234
+ * const iconUrl = "http://cdn.openfin.co/assets/testing/icons/circled-digit-one.png";
3235
+ *
3236
+ * await app.setTrayIcon(iconUrl);
3237
+ *
3238
+ * await app.setTrayIconToolTip('My Application');
3239
+ * ```
3240
+ */
3241
+ async setTrayIconToolTip(toolTip) {
3242
+ await this.wire.sendAction('set-tray-icon-tooltip', { ...this.identity, toolTip });
3243
+ }
3244
+ /**
3245
+ * Sets new application's shortcut configuration. Windows only.
3246
+ * @param config New application's shortcut configuration.
3247
+ *
3248
+ * @remarks Application has to be launched with a manifest and has to have shortcut configuration (icon url, name, etc.) in its manifest
3249
+ * to be able to change shortcut states.
3250
+ *
3251
+ * @example
3252
+ *
3253
+ * ```js
3254
+ * async function setShortcuts(config) {
3255
+ * const app = await fin.Application.getCurrent();
3256
+ * return app.setShortcuts(config);
3257
+ * }
3258
+ *
3259
+ * setShortcuts({
3260
+ * desktop: true,
3261
+ * startMenu: false,
3262
+ * systemStartup: true
3263
+ * }).then(() => console.log('Shortcuts are set.')).catch(err => console.log(err));
3264
+ * ```
3265
+ */
3266
+ setShortcuts(config) {
3267
+ return this.wire.sendAction('set-shortcuts', { data: config, ...this.identity }).then(() => undefined);
3268
+ }
3269
+ /**
3270
+ * Sets the query string in all shortcuts for this app. Requires RVM 5.5+.
3271
+ * @param queryString The new query string for this app's shortcuts.
3272
+ *
3273
+ * @example
3274
+ *
3275
+ * ```js
3276
+ * const newQueryArgs = 'arg=true&arg2=false';
3277
+ * const app = await fin.Application.getCurrent();
3278
+ * try {
3279
+ * await app.setShortcutQueryParams(newQueryArgs);
3280
+ * } catch(err) {
3281
+ * console.error(err)
3282
+ * }
3283
+ * ```
3284
+ */
3285
+ async setShortcutQueryParams(queryString) {
3286
+ await this.wire.sendAction('set-shortcut-query-args', { data: queryString, ...this.identity });
3287
+ }
3288
+ /**
3289
+ * Sets the zoom level of the application. The original size is 0 and each increment above or below represents zooming 20%
3290
+ * larger or smaller to default limits of 300% and 50% of original size, respectively.
3291
+ * @param level The zoom level
3292
+ *
3293
+ * @example
3294
+ *
3295
+ * ```js
3296
+ * async function setZoomLevel(number) {
3297
+ * const app = await fin.Application.getCurrent();
3298
+ * return await app.setZoomLevel(number);
3299
+ * }
3300
+ *
3301
+ * setZoomLevel(5).then(() => console.log('Setting a zoom level')).catch(err => console.log(err));
3302
+ * ```
3303
+ */
3304
+ setZoomLevel(level) {
3305
+ return this.wire.sendAction('set-application-zoom-level', { level, ...this.identity }).then(() => undefined);
3306
+ }
3307
+ /**
3308
+ * Sets a username to correlate with App Log Management.
3309
+ * @param username Username to correlate with App's Log.
3310
+ *
3311
+ * @example
3312
+ *
3313
+ * ```js
3314
+ * async function setAppLogUser() {
3315
+ * const app = await fin.Application.getCurrent();
3316
+ * return await app.setAppLogUsername('username');
3317
+ * }
3318
+ *
3319
+ * setAppLogUser().then(() => console.log('Success')).catch(err => console.log(err));
3320
+ *
3321
+ * ```
3322
+ */
3323
+ async setAppLogUsername(username) {
3324
+ await this.wire.sendAction('set-app-log-username', { data: username, ...this.identity });
3325
+ }
3326
+ /**
3327
+ * Retrieves information about the system tray. If the system tray is not set, it will throw an error message.
3328
+ * @remarks The only information currently returned is the position and dimensions.
3329
+ *
3330
+ * @example
3331
+ *
3332
+ * ```js
3333
+ * async function getTrayIconInfo() {
3334
+ * const app = await fin.Application.wrap({ uuid: 'testapp' });
3335
+ * return await app.getTrayIconInfo();
3336
+ * }
3337
+ * getTrayIconInfo().then(info => console.log(info)).catch(err => console.log(err));
3338
+ * ```
3339
+ */
3340
+ getTrayIconInfo() {
3341
+ return this.wire.sendAction('get-tray-icon-info', this.identity).then(({ payload }) => payload.data);
3342
+ }
3343
+ /**
3344
+ * Checks if the application has an associated tray icon.
3345
+ *
3346
+ * @example
3347
+ *
3348
+ * ```js
3349
+ * const app = await fin.Application.wrap({ uuid: 'testapp' });
3350
+ * const hasTrayIcon = await app.hasTrayIcon();
3351
+ * console.log(hasTrayIcon);
3352
+ * ```
3353
+ */
3354
+ hasTrayIcon() {
3355
+ return this.wire.sendAction('has-tray-icon', this.identity).then(({ payload }) => payload.data);
3356
+ }
3357
+ /**
3358
+ * Closes the application by terminating its process.
3359
+ *
3360
+ * @example
3361
+ *
3362
+ * ```js
3363
+ * async function terminateApp() {
3364
+ * const app = await fin.Application.getCurrent();
3365
+ * return await app.terminate();
3366
+ * }
3367
+ * terminateApp().then(() => console.log('Application terminated')).catch(err => console.log(err));
3368
+ * ```
3369
+ */
3370
+ terminate() {
3371
+ return this.wire.sendAction('terminate-application', this.identity).then(() => undefined);
3372
+ }
3373
+ /**
3374
+ * Waits for a hanging application. This method can be called in response to an application
3375
+ * "not-responding" to allow the application to continue and to generate another "not-responding"
3376
+ * message after a certain period of time.
3377
+ *
3378
+ * @ignore
3379
+ */
3380
+ wait() {
3381
+ return this.wire.sendAction('wait-for-hung-application', this.identity).then(() => undefined);
3382
+ }
3383
+ /**
3384
+ * Retrieves information about the application.
3385
+ *
3386
+ * @remarks If the application was not launched from a manifest, the call will return the closest parent application `manifest`
3387
+ * and `manifestUrl`. `initialOptions` shows the parameters used when launched programmatically, or the `startup_app` options
3388
+ * if launched from manifest. The `parentUuid` will be the uuid of the immediate parent (if applicable).
3389
+ *
3390
+ * @example
3391
+ *
3392
+ * ```js
3393
+ * async function getInfo() {
3394
+ * const app = await fin.Application.getCurrent();
3395
+ * return await app.getInfo();
3396
+ * }
3397
+ *
3398
+ * getInfo().then(info => console.log(info)).catch(err => console.log(err));
3399
+ * ```
3400
+ */
3401
+ getInfo() {
3402
+ return this.wire.sendAction('get-info', this.identity).then(({ payload }) => payload.data);
3403
+ }
3404
+ /**
3405
+ * Retrieves all process information for entities (windows and views) associated with an application.
3406
+ *
3407
+ * @example
3408
+ * ```js
3409
+ * const app = await fin.Application.getCurrent();
3410
+ * const processInfo = await app.getProcessInfo();
3411
+ * ```
3412
+ * @experimental
3413
+ */
3414
+ async getProcessInfo() {
3415
+ const { payload: { data } } = await this.wire.sendAction('application-get-process-info', this.identity);
3416
+ return data;
3417
+ }
3418
+ /**
3419
+ * Sets file auto download location. It's only allowed in the same application.
3420
+ *
3421
+ * Note: This method is restricted by default and must be enabled via
3422
+ * <a href="https://developers.openfin.co/docs/api-security">API security settings</a>.
3423
+ * @param downloadLocation file auto download location
3424
+ *
3425
+ * @throws if setting file auto download location on different applications.
3426
+ * @example
3427
+ *
3428
+ * ```js
3429
+ * const downloadLocation = 'C:\\dev\\temp';
3430
+ * const app = await fin.Application.getCurrent();
3431
+ * try {
3432
+ * await app.setFileDownloadLocation(downloadLocation);
3433
+ * console.log('File download location is set');
3434
+ * } catch(err) {
3435
+ * console.error(err)
3436
+ * }
3437
+ * ```
3438
+ */
3439
+ async setFileDownloadLocation(downloadLocation) {
3440
+ const { name } = this.wire.me;
3441
+ const entityIdentity = { uuid: this.identity.uuid, name };
3442
+ await this.wire.sendAction('set-file-download-location', { ...entityIdentity, downloadLocation });
3443
+ }
3444
+ /**
3445
+ * Gets file auto download location. It's only allowed in the same application. If file auto download location is not set, it will return the default location.
3446
+ *
3447
+ * Note: This method is restricted by default and must be enabled via
3448
+ * <a href="https://developers.openfin.co/docs/api-security">API security settings</a>.
3449
+ *
3450
+ * @throws if getting file auto download location on different applications.
3451
+ * @example
3452
+ *
3453
+ * ```js
3454
+ * const app = await fin.Application.getCurrent();
3455
+ * const fileDownloadDir = await app.getFileDownloadLocation();
3456
+ * ```
3457
+ */
3458
+ async getFileDownloadLocation() {
3459
+ const { payload: { data } } = await this.wire.sendAction('get-file-download-location', this.identity);
3460
+ return data;
3461
+ }
3462
+ /**
3463
+ * Shows a menu on the tray icon. Use with tray-icon-clicked event.
3464
+ * @param options
3465
+ * @typeParam Data User-defined shape for data returned upon menu item click. Should be a
3466
+ * [union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types)
3467
+ * of all possible data shapes for the entire menu, and the click handler should process
3468
+ * these with a "reducer" pattern.
3469
+ * @throws if the application has no tray icon set
3470
+ * @throws if the system tray is currently hidden
3471
+ * @example
3472
+ *
3473
+ * ```js
3474
+ * const iconUrl = 'http://cdn.openfin.co/assets/testing/icons/circled-digit-one.png';
3475
+ * const app = fin.Application.getCurrentSync();
3476
+ *
3477
+ * await app.setTrayIcon(iconUrl);
3478
+ *
3479
+ * const template = [
3480
+ * {
3481
+ * label: 'Menu Item 1',
3482
+ * data: 'hello from item 1'
3483
+ * },
3484
+ * { type: 'separator' },
3485
+ * {
3486
+ * label: 'Menu Item 2',
3487
+ * type: 'checkbox',
3488
+ * checked: true,
3489
+ * data: 'The user clicked the checkbox'
3490
+ * },
3491
+ * {
3492
+ * label: 'see more',
3493
+ * enabled: false,
3494
+ * submenu: [
3495
+ * { label: 'submenu 1', data: 'hello from submenu' }
3496
+ * ]
3497
+ * }
3498
+ * ];
3499
+ *
3500
+ * app.addListener('tray-icon-clicked', (event) => {
3501
+ * // right-click
3502
+ * if (event.button === 2) {
3503
+ * app.showTrayIconPopupMenu({ template }).then(r => {
3504
+ * if (r.result === 'closed') {
3505
+ * console.log('nothing happened');
3506
+ * } else {
3507
+ * console.log(r.data);
3508
+ * }
3509
+ * });
3510
+ * }
3511
+ * });
3512
+ * ```
3513
+ */
3514
+ async showTrayIconPopupMenu(options) {
3515
+ const { name } = this.wire.me;
3516
+ const entityIdentity = { uuid: this.identity.uuid, name };
3517
+ const { payload } = await this.wire.sendAction('show-tray-icon-popup-menu', { ...entityIdentity, options });
3518
+ return payload.data;
3519
+ }
3520
+ /**
3521
+ * Closes the tray icon menu.
3522
+ *
3523
+ * @throws if the application has no tray icon set
3524
+ * @example
3525
+ *
3526
+ * ```js
3527
+ * const app = fin.Application.getCurrentSync();
3528
+ *
3529
+ * await app.closeTrayIconPopupMenu();
3530
+ * ```
3531
+ */
3532
+ async closeTrayIconPopupMenu() {
3533
+ const { name } = this.wire.me;
3534
+ const entityIdentity = { uuid: this.identity.uuid, name };
3535
+ await this.wire.sendAction('close-tray-icon-popup-menu', { ...entityIdentity });
3536
+ }
3542
3537
  }
3538
+ Instance$6.Application = Application;
3543
3539
 
3544
- var hasRequiredFactory$1;
3545
-
3546
- function requireFactory$1 () {
3547
- if (hasRequiredFactory$1) return Factory$7;
3548
- hasRequiredFactory$1 = 1;
3549
- Object.defineProperty(Factory$7, "__esModule", { value: true });
3550
- Factory$7.ApplicationModule = void 0;
3551
- const base_1 = base;
3552
- const validate_1 = validate;
3553
- const Instance_1 = requireInstance$1();
3554
- /**
3555
- * Static namespace for OpenFin API methods that interact with the {@link Application} class, available under `fin.Application`.
3556
- */
3557
- class ApplicationModule extends base_1.Base {
3558
- /**
3559
- * Asynchronously returns an API handle for the given Application identity.
3560
- *
3561
- * @remarks Wrapping an Application identity that does not yet exist will *not* throw an error, and instead
3562
- * returns a stub object that cannot yet perform rendering tasks. This can be useful for plumbing eventing
3563
- * for an Application throughout its entire lifecycle.
3564
- *
3565
- * @example
3566
- *
3567
- * ```js
3568
- * fin.Application.wrap({ uuid: 'testapp' })
3569
- * .then(app => app.isRunning())
3570
- * .then(running => console.log('Application is running: ' + running))
3571
- * .catch(err => console.log(err));
3572
- * ```
3573
- *
3574
- */
3575
- async wrap(identity) {
3576
- this.wire.sendAction('wrap-application').catch((e) => {
3577
- // we do not want to expose this error, just continue if this analytics-only call fails
3578
- });
3579
- const errorMsg = (0, validate_1.validateIdentity)(identity);
3580
- if (errorMsg) {
3581
- throw new Error(errorMsg);
3582
- }
3583
- return new Instance_1.Application(this.wire, identity);
3584
- }
3585
- /**
3586
- * Synchronously returns an API handle for the given Application identity.
3587
- *
3588
- * @remarks Wrapping an Application identity that does not yet exist will *not* throw an error, and instead
3589
- * returns a stub object that cannot yet perform rendering tasks. This can be useful for plumbing eventing
3590
- * for an Aplication throughout its entire lifecycle.
3591
- *
3592
- * @example
3593
- *
3594
- * ```js
3595
- * const app = fin.Application.wrapSync({ uuid: 'testapp' });
3596
- * await app.close();
3597
- * ```
3598
- *
3599
- */
3600
- wrapSync(identity) {
3601
- this.wire.sendAction('wrap-application-sync').catch((e) => {
3602
- // we do not want to expose this error, just continue if this analytics-only call fails
3603
- });
3604
- const errorMsg = (0, validate_1.validateIdentity)(identity);
3605
- if (errorMsg) {
3606
- throw new Error(errorMsg);
3607
- }
3608
- return new Instance_1.Application(this.wire, identity);
3609
- }
3610
- async _create(appOptions) {
3611
- // set defaults:
3612
- if (appOptions.waitForPageLoad === undefined) {
3613
- appOptions.waitForPageLoad = false;
3614
- }
3615
- if (appOptions.autoShow === undefined && appOptions.isPlatformController === undefined) {
3616
- appOptions.autoShow = true;
3617
- }
3618
- await this.wire.sendAction('create-application', appOptions);
3619
- return this.wrap({ uuid: appOptions.uuid });
3620
- }
3621
- /**
3622
- * DEPRECATED method to create a new Application. Use {@link Application.ApplicationModule.start Application.start} instead.
3623
- *
3624
- * @example
3625
- *
3626
- * ```js
3627
- * async function createApp() {
3628
- * const app = await fin.Application.create({
3629
- * name: 'myApp',
3630
- * uuid: 'app-3',
3631
- * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.create.html',
3632
- * autoShow: true
3633
- * });
3634
- * await app.run();
3635
- * }
3636
- *
3637
- * createApp().then(() => console.log('Application is created')).catch(err => console.log(err));
3638
- * ```
3639
- *
3640
- * @ignore
3641
- */
3642
- create(appOptions) {
3643
- console.warn('Deprecation Warning: fin.Application.create is deprecated. Please use fin.Application.start');
3644
- this.wire.sendAction('application-create').catch((e) => {
3645
- // we do not want to expose this error, just continue if this analytics-only call fails
3646
- });
3647
- return this._create(appOptions);
3648
- }
3649
- /**
3650
- * Creates and starts a new Application.
3651
- *
3652
- * @example
3653
- *
3654
- * ```js
3655
- * async function start() {
3656
- * return fin.Application.start({
3657
- * name: 'app-1',
3658
- * uuid: 'app-1',
3659
- * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.start.html',
3660
- * autoShow: true
3661
- * });
3662
- * }
3663
- * start().then(() => console.log('Application is running')).catch(err => console.log(err));
3664
- * ```
3665
- *
3666
- */
3667
- async start(appOptions) {
3668
- this.wire.sendAction('start-application').catch((e) => {
3669
- // we do not want to expose this error, just continue if this analytics-only call fails
3670
- });
3671
- const app = await this._create(appOptions);
3672
- await this.wire.sendAction('run-application', { uuid: appOptions.uuid });
3673
- return app;
3674
- }
3675
- /**
3676
- * Asynchronously starts a batch of applications given an array of application identifiers and manifestUrls.
3677
- * Returns once the RVM is finished attempting to launch the applications.
3678
- * @param opts - Parameters that the RVM will use.
3679
- *
3680
- * @example
3681
- *
3682
- * ```js
3683
- *
3684
- * const applicationInfoArray = [
3685
- * {
3686
- * "uuid": 'App-1',
3687
- * "manifestUrl": 'http://localhost:5555/app1.json',
3688
- * },
3689
- * {
3690
- * "uuid": 'App-2',
3691
- * "manifestUrl": 'http://localhost:5555/app2.json',
3692
- * },
3693
- * {
3694
- * "uuid": 'App-3',
3695
- * "manifestUrl": 'http://localhost:5555/app3.json',
3696
- * }
3697
- * ]
3698
- *
3699
- * fin.Application.startManyManifests(applicationInfoArray)
3700
- * .then(() => {
3701
- * console.log('RVM has finished launching the application list.');
3702
- * })
3703
- * .catch((err) => {
3704
- * console.log(err);
3705
- * })
3706
- * ```
3707
- *
3708
- * @experimental
3709
- */
3710
- async startManyManifests(applications, opts) {
3711
- return this.wire.sendAction('run-applications', { applications, opts }).then(() => undefined);
3712
- }
3713
- /**
3714
- * Asynchronously returns an Application object that represents the current application
3715
- *
3716
- * @example
3717
- *
3718
- * ```js
3719
- * async function isCurrentAppRunning () {
3720
- * const app = await fin.Application.getCurrent();
3721
- * return app.isRunning();
3722
- * }
3723
- *
3724
- * isCurrentAppRunning().then(running => {
3725
- * console.log(`Current app is running: ${running}`);
3726
- * }).catch(err => {
3727
- * console.error(err);
3728
- * });
3729
- *
3730
- * ```
3731
- */
3732
- getCurrent() {
3733
- this.wire.sendAction('get-current-application').catch((e) => {
3734
- // we do not want to expose this error, just continue if this analytics-only call fails
3735
- });
3736
- return this.wrap({ uuid: this.wire.me.uuid });
3737
- }
3738
- /**
3739
- * Synchronously returns an Application object that represents the current application
3740
- *
3741
- * @example
3742
- *
3743
- * ```js
3744
- * async function isCurrentAppRunning () {
3745
- * const app = fin.Application.getCurrentSync();
3746
- * return app.isRunning();
3747
- * }
3748
- *
3749
- * isCurrentAppRunning().then(running => {
3750
- * console.log(`Current app is running: ${running}`);
3751
- * }).catch(err => {
3752
- * console.error(err);
3753
- * });
3754
- *
3755
- * ```
3756
- */
3757
- getCurrentSync() {
3758
- this.wire.sendAction('get-current-application-sync').catch((e) => {
3759
- // we do not want to expose this error, just continue if this analytics-only call fails
3760
- });
3761
- return this.wrapSync({ uuid: this.wire.me.uuid });
3762
- }
3763
- /**
3764
- * Retrieves application's manifest and returns a running instance of the application.
3765
- * @param manifestUrl - The URL of app's manifest.
3766
- * @param opts - Parameters that the RVM will use.
3767
- *
3768
- * @example
3769
- *
3770
- * ```js
3771
- * fin.Application.startFromManifest('http://localhost:5555/app.json').then(app => console.log('App is running')).catch(err => console.log(err));
3772
- *
3773
- * // For a local manifest file:
3774
- * fin.Application.startFromManifest('file:///C:/somefolder/app.json').then(app => console.log('App is running')).catch(err => console.log(err));
3775
- * ```
3776
- */
3777
- async startFromManifest(manifestUrl, opts) {
3778
- this.wire.sendAction('application-start-from-manifest').catch((e) => {
3779
- // we do not want to expose this error, just continue if this analytics-only call fails
3780
- });
3781
- const app = await this._createFromManifest(manifestUrl);
3782
- // @ts-expect-error using private method without warning.
3783
- await app._run(opts); // eslint-disable-line no-underscore-dangle
3784
- return app;
3785
- }
3786
- /**
3787
- * @deprecated Use {@link Application.ApplicationModule.startFromManifest Application.startFromManifest} instead.
3788
- * Retrieves application's manifest and returns a wrapped application.
3789
- * @param manifestUrl - The URL of app's manifest.
3790
- * @param callback - called if the method succeeds.
3791
- * @param errorCallback - called if the method fails. The reason for failure is passed as an argument.
3792
- *
3793
- * @example
3794
- *
3795
- * ```js
3796
- * fin.Application.createFromManifest('http://localhost:5555/app.json').then(app => console.log(app)).catch(err => console.log(err));
3797
- * ```
3798
- * @ignore
3799
- */
3800
- createFromManifest(manifestUrl) {
3801
- console.warn('Deprecation Warning: fin.Application.createFromManifest is deprecated. Please use fin.Application.startFromManifest');
3802
- this.wire.sendAction('application-create-from-manifest').catch((e) => {
3803
- // we do not want to expose this error, just continue if this analytics-only call fails
3804
- });
3805
- return this._createFromManifest(manifestUrl);
3806
- }
3807
- _createFromManifest(manifestUrl) {
3808
- return this.wire
3809
- .sendAction('get-application-manifest', { manifestUrl })
3810
- .then(({ payload }) => {
3811
- const uuid = payload.data.platform ? payload.data.platform.uuid : payload.data.startup_app.uuid;
3812
- return this.wrap({ uuid });
3813
- })
3814
- .then((app) => {
3815
- app._manifestUrl = manifestUrl; // eslint-disable-line no-underscore-dangle
3816
- return app;
3817
- });
3818
- }
3819
- }
3820
- Factory$7.ApplicationModule = ApplicationModule;
3821
- return Factory$7;
3540
+ Object.defineProperty(Factory$7, "__esModule", { value: true });
3541
+ Factory$7.ApplicationModule = void 0;
3542
+ const base_1$n = base;
3543
+ const validate_1$4 = validate;
3544
+ const Instance_1$5 = Instance$6;
3545
+ /**
3546
+ * Static namespace for OpenFin API methods that interact with the {@link Application} class, available under `fin.Application`.
3547
+ */
3548
+ class ApplicationModule extends base_1$n.Base {
3549
+ /**
3550
+ * Asynchronously returns an API handle for the given Application identity.
3551
+ *
3552
+ * @remarks Wrapping an Application identity that does not yet exist will *not* throw an error, and instead
3553
+ * returns a stub object that cannot yet perform rendering tasks. This can be useful for plumbing eventing
3554
+ * for an Application throughout its entire lifecycle.
3555
+ *
3556
+ * @example
3557
+ *
3558
+ * ```js
3559
+ * fin.Application.wrap({ uuid: 'testapp' })
3560
+ * .then(app => app.isRunning())
3561
+ * .then(running => console.log('Application is running: ' + running))
3562
+ * .catch(err => console.log(err));
3563
+ * ```
3564
+ *
3565
+ */
3566
+ async wrap(identity) {
3567
+ this.wire.sendAction('wrap-application').catch((e) => {
3568
+ // we do not want to expose this error, just continue if this analytics-only call fails
3569
+ });
3570
+ const errorMsg = (0, validate_1$4.validateIdentity)(identity);
3571
+ if (errorMsg) {
3572
+ throw new Error(errorMsg);
3573
+ }
3574
+ return new Instance_1$5.Application(this.wire, identity);
3575
+ }
3576
+ /**
3577
+ * Synchronously returns an API handle for the given Application identity.
3578
+ *
3579
+ * @remarks Wrapping an Application identity that does not yet exist will *not* throw an error, and instead
3580
+ * returns a stub object that cannot yet perform rendering tasks. This can be useful for plumbing eventing
3581
+ * for an Aplication throughout its entire lifecycle.
3582
+ *
3583
+ * @example
3584
+ *
3585
+ * ```js
3586
+ * const app = fin.Application.wrapSync({ uuid: 'testapp' });
3587
+ * await app.close();
3588
+ * ```
3589
+ *
3590
+ */
3591
+ wrapSync(identity) {
3592
+ this.wire.sendAction('wrap-application-sync').catch((e) => {
3593
+ // we do not want to expose this error, just continue if this analytics-only call fails
3594
+ });
3595
+ const errorMsg = (0, validate_1$4.validateIdentity)(identity);
3596
+ if (errorMsg) {
3597
+ throw new Error(errorMsg);
3598
+ }
3599
+ return new Instance_1$5.Application(this.wire, identity);
3600
+ }
3601
+ async _create(appOptions) {
3602
+ // set defaults:
3603
+ if (appOptions.waitForPageLoad === undefined) {
3604
+ appOptions.waitForPageLoad = false;
3605
+ }
3606
+ if (appOptions.autoShow === undefined && appOptions.isPlatformController === undefined) {
3607
+ appOptions.autoShow = true;
3608
+ }
3609
+ await this.wire.sendAction('create-application', appOptions);
3610
+ return this.wrap({ uuid: appOptions.uuid });
3611
+ }
3612
+ /**
3613
+ * DEPRECATED method to create a new Application. Use {@link Application.ApplicationModule.start Application.start} instead.
3614
+ *
3615
+ * @example
3616
+ *
3617
+ * ```js
3618
+ * async function createApp() {
3619
+ * const app = await fin.Application.create({
3620
+ * name: 'myApp',
3621
+ * uuid: 'app-3',
3622
+ * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.create.html',
3623
+ * autoShow: true
3624
+ * });
3625
+ * await app.run();
3626
+ * }
3627
+ *
3628
+ * createApp().then(() => console.log('Application is created')).catch(err => console.log(err));
3629
+ * ```
3630
+ *
3631
+ * @ignore
3632
+ */
3633
+ create(appOptions) {
3634
+ console.warn('Deprecation Warning: fin.Application.create is deprecated. Please use fin.Application.start');
3635
+ this.wire.sendAction('application-create').catch((e) => {
3636
+ // we do not want to expose this error, just continue if this analytics-only call fails
3637
+ });
3638
+ return this._create(appOptions);
3639
+ }
3640
+ /**
3641
+ * Creates and starts a new Application.
3642
+ *
3643
+ * @example
3644
+ *
3645
+ * ```js
3646
+ * async function start() {
3647
+ * return fin.Application.start({
3648
+ * name: 'app-1',
3649
+ * uuid: 'app-1',
3650
+ * url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Application.start.html',
3651
+ * autoShow: true
3652
+ * });
3653
+ * }
3654
+ * start().then(() => console.log('Application is running')).catch(err => console.log(err));
3655
+ * ```
3656
+ *
3657
+ */
3658
+ async start(appOptions) {
3659
+ this.wire.sendAction('start-application').catch((e) => {
3660
+ // we do not want to expose this error, just continue if this analytics-only call fails
3661
+ });
3662
+ const app = await this._create(appOptions);
3663
+ await this.wire.sendAction('run-application', { uuid: appOptions.uuid });
3664
+ return app;
3665
+ }
3666
+ /**
3667
+ * Asynchronously starts a batch of applications given an array of application identifiers and manifestUrls.
3668
+ * Returns once the RVM is finished attempting to launch the applications.
3669
+ * @param opts - Parameters that the RVM will use.
3670
+ *
3671
+ * @example
3672
+ *
3673
+ * ```js
3674
+ *
3675
+ * const applicationInfoArray = [
3676
+ * {
3677
+ * "uuid": 'App-1',
3678
+ * "manifestUrl": 'http://localhost:5555/app1.json',
3679
+ * },
3680
+ * {
3681
+ * "uuid": 'App-2',
3682
+ * "manifestUrl": 'http://localhost:5555/app2.json',
3683
+ * },
3684
+ * {
3685
+ * "uuid": 'App-3',
3686
+ * "manifestUrl": 'http://localhost:5555/app3.json',
3687
+ * }
3688
+ * ]
3689
+ *
3690
+ * fin.Application.startManyManifests(applicationInfoArray)
3691
+ * .then(() => {
3692
+ * console.log('RVM has finished launching the application list.');
3693
+ * })
3694
+ * .catch((err) => {
3695
+ * console.log(err);
3696
+ * })
3697
+ * ```
3698
+ *
3699
+ * @experimental
3700
+ */
3701
+ async startManyManifests(applications, opts) {
3702
+ return this.wire.sendAction('run-applications', { applications, opts }).then(() => undefined);
3703
+ }
3704
+ /**
3705
+ * Asynchronously returns an Application object that represents the current application
3706
+ *
3707
+ * @example
3708
+ *
3709
+ * ```js
3710
+ * async function isCurrentAppRunning () {
3711
+ * const app = await fin.Application.getCurrent();
3712
+ * return app.isRunning();
3713
+ * }
3714
+ *
3715
+ * isCurrentAppRunning().then(running => {
3716
+ * console.log(`Current app is running: ${running}`);
3717
+ * }).catch(err => {
3718
+ * console.error(err);
3719
+ * });
3720
+ *
3721
+ * ```
3722
+ */
3723
+ getCurrent() {
3724
+ this.wire.sendAction('get-current-application').catch((e) => {
3725
+ // we do not want to expose this error, just continue if this analytics-only call fails
3726
+ });
3727
+ return this.wrap({ uuid: this.wire.me.uuid });
3728
+ }
3729
+ /**
3730
+ * Synchronously returns an Application object that represents the current application
3731
+ *
3732
+ * @example
3733
+ *
3734
+ * ```js
3735
+ * async function isCurrentAppRunning () {
3736
+ * const app = fin.Application.getCurrentSync();
3737
+ * return app.isRunning();
3738
+ * }
3739
+ *
3740
+ * isCurrentAppRunning().then(running => {
3741
+ * console.log(`Current app is running: ${running}`);
3742
+ * }).catch(err => {
3743
+ * console.error(err);
3744
+ * });
3745
+ *
3746
+ * ```
3747
+ */
3748
+ getCurrentSync() {
3749
+ this.wire.sendAction('get-current-application-sync').catch((e) => {
3750
+ // we do not want to expose this error, just continue if this analytics-only call fails
3751
+ });
3752
+ return this.wrapSync({ uuid: this.wire.me.uuid });
3753
+ }
3754
+ /**
3755
+ * Retrieves application's manifest and returns a running instance of the application.
3756
+ * @param manifestUrl - The URL of app's manifest.
3757
+ * @param opts - Parameters that the RVM will use.
3758
+ *
3759
+ * @example
3760
+ *
3761
+ * ```js
3762
+ * fin.Application.startFromManifest('http://localhost:5555/app.json').then(app => console.log('App is running')).catch(err => console.log(err));
3763
+ *
3764
+ * // For a local manifest file:
3765
+ * fin.Application.startFromManifest('file:///C:/somefolder/app.json').then(app => console.log('App is running')).catch(err => console.log(err));
3766
+ * ```
3767
+ */
3768
+ async startFromManifest(manifestUrl, opts) {
3769
+ this.wire.sendAction('application-start-from-manifest').catch((e) => {
3770
+ // we do not want to expose this error, just continue if this analytics-only call fails
3771
+ });
3772
+ const app = await this._createFromManifest(manifestUrl);
3773
+ // @ts-expect-error using private method without warning.
3774
+ await app._run(opts); // eslint-disable-line no-underscore-dangle
3775
+ return app;
3776
+ }
3777
+ /**
3778
+ * @deprecated Use {@link Application.ApplicationModule.startFromManifest Application.startFromManifest} instead.
3779
+ * Retrieves application's manifest and returns a wrapped application.
3780
+ * @param manifestUrl - The URL of app's manifest.
3781
+ * @param callback - called if the method succeeds.
3782
+ * @param errorCallback - called if the method fails. The reason for failure is passed as an argument.
3783
+ *
3784
+ * @example
3785
+ *
3786
+ * ```js
3787
+ * fin.Application.createFromManifest('http://localhost:5555/app.json').then(app => console.log(app)).catch(err => console.log(err));
3788
+ * ```
3789
+ * @ignore
3790
+ */
3791
+ createFromManifest(manifestUrl) {
3792
+ console.warn('Deprecation Warning: fin.Application.createFromManifest is deprecated. Please use fin.Application.startFromManifest');
3793
+ this.wire.sendAction('application-create-from-manifest').catch((e) => {
3794
+ // we do not want to expose this error, just continue if this analytics-only call fails
3795
+ });
3796
+ return this._createFromManifest(manifestUrl);
3797
+ }
3798
+ _createFromManifest(manifestUrl) {
3799
+ return this.wire
3800
+ .sendAction('get-application-manifest', { manifestUrl })
3801
+ .then(({ payload }) => {
3802
+ const uuid = payload.data.platform ? payload.data.platform.uuid : payload.data.startup_app.uuid;
3803
+ return this.wrap({ uuid });
3804
+ })
3805
+ .then((app) => {
3806
+ app._manifestUrl = manifestUrl; // eslint-disable-line no-underscore-dangle
3807
+ return app;
3808
+ });
3809
+ }
3822
3810
  }
3811
+ Factory$7.ApplicationModule = ApplicationModule;
3823
3812
 
3824
- var hasRequiredApplication;
3825
-
3826
- function requireApplication () {
3827
- if (hasRequiredApplication) return application;
3828
- hasRequiredApplication = 1;
3829
- (function (exports) {
3830
- var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3831
- if (k2 === undefined) k2 = k;
3832
- var desc = Object.getOwnPropertyDescriptor(m, k);
3833
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
3834
- desc = { enumerable: true, get: function() { return m[k]; } };
3835
- }
3836
- Object.defineProperty(o, k2, desc);
3837
- }) : (function(o, m, k, k2) {
3838
- if (k2 === undefined) k2 = k;
3839
- o[k2] = m[k];
3840
- }));
3841
- var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
3842
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
3843
- };
3844
- Object.defineProperty(exports, "__esModule", { value: true });
3845
- /**
3846
- * Entry points for the OpenFin `Application` API (`fin.Application`).
3847
- *
3848
- * * {@link ApplicationModule} contains static members of the `Application` API, accessible through `fin.Application`.
3849
- * * {@link Application} describes an instance of an OpenFin Application, e.g. as returned by `fin.Application.getCurrent`.
3850
- *
3851
- * These are separate code entities, and are documented separately. In the [previous version of the API documentation](https://cdn.openfin.co/docs/javascript/32.114.76.10/index.html),
3852
- * both of these were documented on the same page.
3853
- *
3854
- * @packageDocumentation
3855
- */
3856
- __exportStar(requireFactory$1(), exports);
3857
- __exportStar(requireInstance$1(), exports);
3858
- } (application));
3859
- return application;
3860
- }
3813
+ (function (exports) {
3814
+ var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3815
+ if (k2 === undefined) k2 = k;
3816
+ var desc = Object.getOwnPropertyDescriptor(m, k);
3817
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
3818
+ desc = { enumerable: true, get: function() { return m[k]; } };
3819
+ }
3820
+ Object.defineProperty(o, k2, desc);
3821
+ }) : (function(o, m, k, k2) {
3822
+ if (k2 === undefined) k2 = k;
3823
+ o[k2] = m[k];
3824
+ }));
3825
+ var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
3826
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
3827
+ };
3828
+ Object.defineProperty(exports, "__esModule", { value: true });
3829
+ /**
3830
+ * Entry points for the OpenFin `Application` API (`fin.Application`).
3831
+ *
3832
+ * * {@link ApplicationModule} contains static members of the `Application` API, accessible through `fin.Application`.
3833
+ * * {@link Application} describes an instance of an OpenFin Application, e.g. as returned by `fin.Application.getCurrent`.
3834
+ *
3835
+ * These are separate code entities, and are documented separately. In the [previous version of the API documentation](https://cdn.openfin.co/docs/javascript/32.114.76.10/index.html),
3836
+ * both of these were documented on the same page.
3837
+ *
3838
+ * @packageDocumentation
3839
+ */
3840
+ __exportStar(Factory$7, exports);
3841
+ __exportStar(Instance$6, exports);
3842
+ } (application));
3861
3843
 
3862
3844
  var promisifySubscription$1 = {};
3863
3845
 
@@ -3901,7 +3883,7 @@ function requireInstance () {
3901
3883
  /* eslint-disable @typescript-eslint/no-unused-vars */
3902
3884
  /* eslint-disable no-console */
3903
3885
  /* eslint-disable @typescript-eslint/no-non-null-assertion */
3904
- const application_1 = requireApplication();
3886
+ const application_1 = application;
3905
3887
  const main_1 = main;
3906
3888
  const view_1 = requireView();
3907
3889
  const warnings_1 = warnings;
@@ -5811,6 +5793,11 @@ class System extends base_1$m.EmitterBase {
5811
5793
  /**
5812
5794
  * Returns a unique identifier (UUID) provided by the machine.
5813
5795
  *
5796
+ * On Windows, the machine ID is the `MachineGuid` value located in the Windows Registry at:
5797
+ * `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography`.
5798
+ *
5799
+ * On macOS, the machine ID is the hardware UUID of the machine, obtained via native OS APIs.
5800
+ *
5814
5801
  * @example
5815
5802
  * ```js
5816
5803
  * fin.System.getMachineId().then(id => console.log(id)).catch(err => console.log(err));
@@ -7899,12 +7886,12 @@ class ChannelError extends Error {
7899
7886
  }
7900
7887
  channelError.ChannelError = ChannelError;
7901
7888
 
7902
- var __classPrivateFieldGet$h = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
7889
+ var __classPrivateFieldGet$i = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
7903
7890
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
7904
7891
  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");
7905
7892
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
7906
7893
  };
7907
- var __classPrivateFieldSet$g = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
7894
+ var __classPrivateFieldSet$h = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
7908
7895
  if (kind === "m") throw new TypeError("Private method is not writable");
7909
7896
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
7910
7897
  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");
@@ -7948,7 +7935,7 @@ class ChannelClient extends channel_1$1.ChannelBase {
7948
7935
  static closeChannelByEndpointId(id) {
7949
7936
  const channel = channelClientsByEndpointId.get(id);
7950
7937
  if (channel) {
7951
- __classPrivateFieldGet$h(channel, _ChannelClient_close, "f").call(channel);
7938
+ __classPrivateFieldGet$i(channel, _ChannelClient_close, "f").call(channel);
7952
7939
  }
7953
7940
  }
7954
7941
  /**
@@ -7959,7 +7946,7 @@ class ChannelClient extends channel_1$1.ChannelBase {
7959
7946
  for (const channelClient of channelClientsByEndpointId.values()) {
7960
7947
  if (channelClient.providerIdentity.channelId === eventPayload.channelId) {
7961
7948
  channelClient.disconnectListener(eventPayload);
7962
- __classPrivateFieldGet$h(channelClient, _ChannelClient_close, "f").call(channelClient);
7949
+ __classPrivateFieldGet$i(channelClient, _ChannelClient_close, "f").call(channelClient);
7963
7950
  }
7964
7951
  }
7965
7952
  }
@@ -7974,12 +7961,12 @@ class ChannelClient extends channel_1$1.ChannelBase {
7974
7961
  this.processAction = (action, payload, senderIdentity) => super.processAction(action, payload, senderIdentity);
7975
7962
  _ChannelClient_close.set(this, () => {
7976
7963
  channelClientsByEndpointId.delete(this.endpointId);
7977
- __classPrivateFieldGet$h(this, _ChannelClient_strategy, "f").close();
7964
+ __classPrivateFieldGet$i(this, _ChannelClient_strategy, "f").close();
7978
7965
  });
7979
- __classPrivateFieldSet$g(this, _ChannelClient_protectedObj, new channel_1$1.ProtectedItems(routingInfo, close), "f");
7966
+ __classPrivateFieldSet$h(this, _ChannelClient_protectedObj, new channel_1$1.ProtectedItems(routingInfo, close), "f");
7980
7967
  this.disconnectListener = () => undefined;
7981
7968
  this.endpointId = routingInfo.endpointId;
7982
- __classPrivateFieldSet$g(this, _ChannelClient_strategy, strategy, "f");
7969
+ __classPrivateFieldSet$h(this, _ChannelClient_strategy, strategy, "f");
7983
7970
  channelClientsByEndpointId.set(this.endpointId, this);
7984
7971
  strategy.receive(this.processAction);
7985
7972
  }
@@ -7987,7 +7974,7 @@ class ChannelClient extends channel_1$1.ChannelBase {
7987
7974
  * a read-only provider identity
7988
7975
  */
7989
7976
  get providerIdentity() {
7990
- const protectedObj = __classPrivateFieldGet$h(this, _ChannelClient_protectedObj, "f");
7977
+ const protectedObj = __classPrivateFieldGet$i(this, _ChannelClient_protectedObj, "f");
7991
7978
  return protectedObj.providerIdentity;
7992
7979
  }
7993
7980
  /**
@@ -8016,9 +8003,9 @@ class ChannelClient extends channel_1$1.ChannelBase {
8016
8003
  * ```
8017
8004
  */
8018
8005
  async dispatch(action, payload) {
8019
- if (__classPrivateFieldGet$h(this, _ChannelClient_strategy, "f").isEndpointConnected(this.providerIdentity.channelId)) {
8006
+ if (__classPrivateFieldGet$i(this, _ChannelClient_strategy, "f").isEndpointConnected(this.providerIdentity.channelId)) {
8020
8007
  const callSites = transport_errors_1$2.RuntimeError.getCallSite();
8021
- return __classPrivateFieldGet$h(this, _ChannelClient_strategy, "f").send(this.providerIdentity.channelId, action, payload).catch((e) => {
8008
+ return __classPrivateFieldGet$i(this, _ChannelClient_strategy, "f").send(this.providerIdentity.channelId, action, payload).catch((e) => {
8022
8009
  throw new channel_error_1$1.ChannelError(e, action, payload, callSites);
8023
8010
  });
8024
8011
  }
@@ -8070,10 +8057,10 @@ class ChannelClient extends channel_1$1.ChannelBase {
8070
8057
  */
8071
8058
  async disconnect() {
8072
8059
  await this.sendDisconnectAction();
8073
- __classPrivateFieldGet$h(this, _ChannelClient_close, "f").call(this);
8060
+ __classPrivateFieldGet$i(this, _ChannelClient_close, "f").call(this);
8074
8061
  }
8075
8062
  async sendDisconnectAction() {
8076
- const protectedObj = __classPrivateFieldGet$h(this, _ChannelClient_protectedObj, "f");
8063
+ const protectedObj = __classPrivateFieldGet$i(this, _ChannelClient_protectedObj, "f");
8077
8064
  await protectedObj.close();
8078
8065
  }
8079
8066
  /**
@@ -8106,13 +8093,13 @@ exhaustive.exhaustiveCheck = exhaustiveCheck;
8106
8093
 
8107
8094
  var strategy$3 = {};
8108
8095
 
8109
- var __classPrivateFieldSet$f = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
8096
+ var __classPrivateFieldSet$g = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
8110
8097
  if (kind === "m") throw new TypeError("Private method is not writable");
8111
8098
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
8112
8099
  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");
8113
8100
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
8114
8101
  };
8115
- var __classPrivateFieldGet$g = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8102
+ var __classPrivateFieldGet$h = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8116
8103
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
8117
8104
  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");
8118
8105
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
@@ -8137,7 +8124,7 @@ class ClassicStrategy {
8137
8124
  // connection problems occur
8138
8125
  _ClassicStrategy_pendingMessagesByEndpointId.set(this, new Map());
8139
8126
  this.send = async (endpointId, action, payload) => {
8140
- const to = __classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
8127
+ const to = __classPrivateFieldGet$h(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
8141
8128
  if (!to) {
8142
8129
  throw new Error(`Could not locate routing info for endpoint ${endpointId}`);
8143
8130
  }
@@ -8149,13 +8136,13 @@ class ClassicStrategy {
8149
8136
  }
8150
8137
  delete cleanId.isLocalEndpointId;
8151
8138
  // grab the promise before awaiting it to save in our pending messages map
8152
- const p = __classPrivateFieldGet$g(this, _ClassicStrategy_wire, "f").sendAction('send-channel-message', {
8139
+ const p = __classPrivateFieldGet$h(this, _ClassicStrategy_wire, "f").sendAction('send-channel-message', {
8153
8140
  ...cleanId,
8154
8141
  providerIdentity: this.providerIdentity,
8155
8142
  action,
8156
8143
  payload
8157
8144
  });
8158
- __classPrivateFieldGet$g(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.add(p);
8145
+ __classPrivateFieldGet$h(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.add(p);
8159
8146
  const raw = await p
8160
8147
  .catch((error) => {
8161
8148
  if ('cause' in error) {
@@ -8165,16 +8152,16 @@ class ClassicStrategy {
8165
8152
  })
8166
8153
  .finally(() => {
8167
8154
  // clean up the pending promise
8168
- __classPrivateFieldGet$g(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.delete(p);
8155
+ __classPrivateFieldGet$h(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.delete(p);
8169
8156
  });
8170
8157
  return raw.payload.data.result;
8171
8158
  };
8172
8159
  this.close = async () => {
8173
8160
  this.messageReceiver.removeEndpoint(this.providerIdentity.channelId, this.endpointId);
8174
- [...__classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").keys()].forEach((id) => this.closeEndpoint(id));
8175
- __classPrivateFieldSet$f(this, _ClassicStrategy_endpointIdentityMap, new Map(), "f");
8161
+ [...__classPrivateFieldGet$h(this, _ClassicStrategy_endpointIdentityMap, "f").keys()].forEach((id) => this.closeEndpoint(id));
8162
+ __classPrivateFieldSet$g(this, _ClassicStrategy_endpointIdentityMap, new Map(), "f");
8176
8163
  };
8177
- __classPrivateFieldSet$f(this, _ClassicStrategy_wire, wire, "f");
8164
+ __classPrivateFieldSet$g(this, _ClassicStrategy_wire, wire, "f");
8178
8165
  }
8179
8166
  onEndpointDisconnect(endpointId, listener) {
8180
8167
  // Never fires for 'classic'.
@@ -8183,20 +8170,20 @@ class ClassicStrategy {
8183
8170
  this.messageReceiver.addEndpoint(listener, this.providerIdentity.channelId, this.endpointId);
8184
8171
  }
8185
8172
  async closeEndpoint(endpointId) {
8186
- const id = __classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
8187
- __classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").delete(endpointId);
8188
- const pendingSet = __classPrivateFieldGet$g(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId);
8173
+ const id = __classPrivateFieldGet$h(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
8174
+ __classPrivateFieldGet$h(this, _ClassicStrategy_endpointIdentityMap, "f").delete(endpointId);
8175
+ const pendingSet = __classPrivateFieldGet$h(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId);
8189
8176
  pendingSet?.forEach((p) => {
8190
8177
  const errorMsg = `Channel connection with identity uuid: ${id?.uuid} / name: ${id?.name} / endpointId: ${endpointId} no longer connected.`;
8191
8178
  p.cancel(new Error(errorMsg));
8192
8179
  });
8193
8180
  }
8194
8181
  isEndpointConnected(endpointId) {
8195
- return __classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").has(endpointId);
8182
+ return __classPrivateFieldGet$h(this, _ClassicStrategy_endpointIdentityMap, "f").has(endpointId);
8196
8183
  }
8197
8184
  addEndpoint(endpointId, payload) {
8198
- __classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").set(endpointId, payload.endpointIdentity);
8199
- __classPrivateFieldGet$g(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").set(endpointId, new Set());
8185
+ __classPrivateFieldGet$h(this, _ClassicStrategy_endpointIdentityMap, "f").set(endpointId, payload.endpointIdentity);
8186
+ __classPrivateFieldGet$h(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").set(endpointId, new Set());
8200
8187
  }
8201
8188
  isValidEndpointPayload(payload) {
8202
8189
  return (typeof payload?.endpointIdentity?.endpointId === 'string' ||
@@ -8231,12 +8218,12 @@ function errorToPOJO(error) {
8231
8218
  }
8232
8219
  errors.errorToPOJO = errorToPOJO;
8233
8220
 
8234
- var __classPrivateFieldGet$f = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8221
+ var __classPrivateFieldGet$g = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8235
8222
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
8236
8223
  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");
8237
8224
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
8238
8225
  };
8239
- var __classPrivateFieldSet$e = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
8226
+ var __classPrivateFieldSet$f = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
8240
8227
  if (kind === "m") throw new TypeError("Private method is not writable");
8241
8228
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
8242
8229
  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");
@@ -8271,8 +8258,8 @@ class RTCEndpoint {
8271
8258
  if (this.rtc.rtcClient.connectionState !== 'connected') {
8272
8259
  this.rtc.rtcClient.removeEventListener('connectionstatechange', this.connectionStateChangeHandler);
8273
8260
  this.close();
8274
- if (__classPrivateFieldGet$f(this, _RTCEndpoint_disconnectListener, "f")) {
8275
- __classPrivateFieldGet$f(this, _RTCEndpoint_disconnectListener, "f").call(this);
8261
+ if (__classPrivateFieldGet$g(this, _RTCEndpoint_disconnectListener, "f")) {
8262
+ __classPrivateFieldGet$g(this, _RTCEndpoint_disconnectListener, "f").call(this);
8276
8263
  }
8277
8264
  }
8278
8265
  };
@@ -8320,9 +8307,9 @@ class RTCEndpoint {
8320
8307
  data = new TextDecoder().decode(e.data);
8321
8308
  }
8322
8309
  const { messageId, action, payload } = JSON.parse(data);
8323
- if (__classPrivateFieldGet$f(this, _RTCEndpoint_processAction, "f")) {
8310
+ if (__classPrivateFieldGet$g(this, _RTCEndpoint_processAction, "f")) {
8324
8311
  try {
8325
- const res = await __classPrivateFieldGet$f(this, _RTCEndpoint_processAction, "f").call(this, action, payload, endpointIdentity);
8312
+ const res = await __classPrivateFieldGet$g(this, _RTCEndpoint_processAction, "f").call(this, action, payload, endpointIdentity);
8326
8313
  this.rtc.channels.response.send(JSON.stringify({
8327
8314
  messageId,
8328
8315
  payload: res,
@@ -8356,25 +8343,25 @@ class RTCEndpoint {
8356
8343
  datachannel.onclose = (e) => {
8357
8344
  [...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.')));
8358
8345
  this.close();
8359
- if (__classPrivateFieldGet$f(this, _RTCEndpoint_disconnectListener, "f")) {
8360
- __classPrivateFieldGet$f(this, _RTCEndpoint_disconnectListener, "f").call(this);
8346
+ if (__classPrivateFieldGet$g(this, _RTCEndpoint_disconnectListener, "f")) {
8347
+ __classPrivateFieldGet$g(this, _RTCEndpoint_disconnectListener, "f").call(this);
8361
8348
  }
8362
8349
  };
8363
8350
  });
8364
8351
  }
8365
8352
  onDisconnect(listener) {
8366
- if (!__classPrivateFieldGet$f(this, _RTCEndpoint_disconnectListener, "f")) {
8367
- __classPrivateFieldSet$e(this, _RTCEndpoint_disconnectListener, listener, "f");
8353
+ if (!__classPrivateFieldGet$g(this, _RTCEndpoint_disconnectListener, "f")) {
8354
+ __classPrivateFieldSet$f(this, _RTCEndpoint_disconnectListener, listener, "f");
8368
8355
  }
8369
8356
  else {
8370
8357
  throw new Error('RTCEndpoint disconnectListener cannot be set twice.');
8371
8358
  }
8372
8359
  }
8373
8360
  receive(listener) {
8374
- if (__classPrivateFieldGet$f(this, _RTCEndpoint_processAction, "f")) {
8361
+ if (__classPrivateFieldGet$g(this, _RTCEndpoint_processAction, "f")) {
8375
8362
  throw new Error('You have already set a listener for this RTC Endpoint.');
8376
8363
  }
8377
- __classPrivateFieldSet$e(this, _RTCEndpoint_processAction, listener, "f");
8364
+ __classPrivateFieldSet$f(this, _RTCEndpoint_processAction, listener, "f");
8378
8365
  }
8379
8366
  get connected() {
8380
8367
  return this.rtc.rtcClient.connectionState === 'connected';
@@ -8385,12 +8372,12 @@ _RTCEndpoint_processAction = new WeakMap(), _RTCEndpoint_disconnectListener = ne
8385
8372
 
8386
8373
  var strategy$1 = {};
8387
8374
 
8388
- var __classPrivateFieldGet$e = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8375
+ var __classPrivateFieldGet$f = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8389
8376
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
8390
8377
  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");
8391
8378
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
8392
8379
  };
8393
- var __classPrivateFieldSet$d = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
8380
+ var __classPrivateFieldSet$e = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
8394
8381
  if (kind === "m") throw new TypeError("Private method is not writable");
8395
8382
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
8396
8383
  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");
@@ -8411,11 +8398,11 @@ class EndpointStrategy {
8411
8398
  return this.getEndpointById(endpointId).send(action, payload);
8412
8399
  };
8413
8400
  this.close = async () => {
8414
- if (__classPrivateFieldGet$e(this, _EndpointStrategy_connected, "f")) {
8415
- __classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").forEach((endpoint) => endpoint.close());
8416
- __classPrivateFieldSet$d(this, _EndpointStrategy_endpointMap, new Map(), "f");
8401
+ if (__classPrivateFieldGet$f(this, _EndpointStrategy_connected, "f")) {
8402
+ __classPrivateFieldGet$f(this, _EndpointStrategy_endpointMap, "f").forEach((endpoint) => endpoint.close());
8403
+ __classPrivateFieldSet$e(this, _EndpointStrategy_endpointMap, new Map(), "f");
8417
8404
  }
8418
- __classPrivateFieldSet$d(this, _EndpointStrategy_connected, false, "f");
8405
+ __classPrivateFieldSet$e(this, _EndpointStrategy_connected, false, "f");
8419
8406
  };
8420
8407
  this.isValidEndpointPayload = validateEndpoint;
8421
8408
  }
@@ -8423,39 +8410,39 @@ class EndpointStrategy {
8423
8410
  this.getEndpointById(endpointId).onDisconnect(listener);
8424
8411
  }
8425
8412
  receive(listener) {
8426
- if (__classPrivateFieldGet$e(this, _EndpointStrategy_processAction, "f")) {
8413
+ if (__classPrivateFieldGet$f(this, _EndpointStrategy_processAction, "f")) {
8427
8414
  throw new Error(`You have already set a listener for this ${this.StrategyName} Strategy`);
8428
8415
  }
8429
- __classPrivateFieldSet$d(this, _EndpointStrategy_processAction, listener, "f");
8416
+ __classPrivateFieldSet$e(this, _EndpointStrategy_processAction, listener, "f");
8430
8417
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
8431
- __classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").forEach((endpoint) => endpoint.receive(__classPrivateFieldGet$e(this, _EndpointStrategy_processAction, "f")));
8418
+ __classPrivateFieldGet$f(this, _EndpointStrategy_endpointMap, "f").forEach((endpoint) => endpoint.receive(__classPrivateFieldGet$f(this, _EndpointStrategy_processAction, "f")));
8432
8419
  }
8433
8420
  getEndpointById(endpointId) {
8434
- const endpoint = __classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").get(endpointId);
8421
+ const endpoint = __classPrivateFieldGet$f(this, _EndpointStrategy_endpointMap, "f").get(endpointId);
8435
8422
  if (!endpoint) {
8436
8423
  throw new Error(`Client with endpoint id ${endpointId} is not connected`);
8437
8424
  }
8438
8425
  return endpoint;
8439
8426
  }
8440
8427
  get connected() {
8441
- return __classPrivateFieldGet$e(this, _EndpointStrategy_connected, "f");
8428
+ return __classPrivateFieldGet$f(this, _EndpointStrategy_connected, "f");
8442
8429
  }
8443
8430
  isEndpointConnected(endpointId) {
8444
- return __classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").has(endpointId);
8431
+ return __classPrivateFieldGet$f(this, _EndpointStrategy_endpointMap, "f").has(endpointId);
8445
8432
  }
8446
8433
  addEndpoint(endpointId, payload) {
8447
- if (!__classPrivateFieldGet$e(this, _EndpointStrategy_connected, "f")) {
8434
+ if (!__classPrivateFieldGet$f(this, _EndpointStrategy_connected, "f")) {
8448
8435
  console.warn(`Adding endpoint to disconnected ${this.StrategyName} Strategy`);
8449
8436
  return;
8450
8437
  }
8451
8438
  const clientStrat = new this.EndpointType(payload);
8452
- if (__classPrivateFieldGet$e(this, _EndpointStrategy_processAction, "f")) {
8453
- clientStrat.receive(__classPrivateFieldGet$e(this, _EndpointStrategy_processAction, "f"));
8439
+ if (__classPrivateFieldGet$f(this, _EndpointStrategy_processAction, "f")) {
8440
+ clientStrat.receive(__classPrivateFieldGet$f(this, _EndpointStrategy_processAction, "f"));
8454
8441
  }
8455
- __classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").set(endpointId, clientStrat);
8442
+ __classPrivateFieldGet$f(this, _EndpointStrategy_endpointMap, "f").set(endpointId, clientStrat);
8456
8443
  }
8457
8444
  async closeEndpoint(endpointId) {
8458
- __classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").delete(endpointId);
8445
+ __classPrivateFieldGet$f(this, _EndpointStrategy_endpointMap, "f").delete(endpointId);
8459
8446
  }
8460
8447
  }
8461
8448
  strategy$1.EndpointStrategy = EndpointStrategy;
@@ -8637,12 +8624,12 @@ function runtimeUuidMeetsMinimumRuntimeVersion(runtimeUuid, minVersion) {
8637
8624
  }
8638
8625
  runtimeVersioning.runtimeUuidMeetsMinimumRuntimeVersion = runtimeUuidMeetsMinimumRuntimeVersion;
8639
8626
 
8640
- var __classPrivateFieldGet$d = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8627
+ var __classPrivateFieldGet$e = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8641
8628
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
8642
8629
  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");
8643
8630
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
8644
8631
  };
8645
- var __classPrivateFieldSet$c = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
8632
+ var __classPrivateFieldSet$d = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
8646
8633
  if (kind === "m") throw new TypeError("Private method is not writable");
8647
8634
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
8648
8635
  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");
@@ -8686,19 +8673,19 @@ class ChannelProvider extends channel_1.ChannelBase {
8686
8673
  * a read-only array containing all the identities of connecting clients.
8687
8674
  */
8688
8675
  get connections() {
8689
- return [...__classPrivateFieldGet$d(this, _ChannelProvider_connections, "f")];
8676
+ return [...__classPrivateFieldGet$e(this, _ChannelProvider_connections, "f")];
8690
8677
  }
8691
8678
  static handleClientDisconnection(channel, payload) {
8692
8679
  if (payload?.endpointId) {
8693
8680
  const { uuid, name, endpointId, isLocalEndpointId } = payload;
8694
- __classPrivateFieldGet$d(channel, _ChannelProvider_removeEndpoint, "f").call(channel, { uuid, name, endpointId, isLocalEndpointId });
8681
+ __classPrivateFieldGet$e(channel, _ChannelProvider_removeEndpoint, "f").call(channel, { uuid, name, endpointId, isLocalEndpointId });
8695
8682
  }
8696
8683
  else {
8697
8684
  // this is here to support older runtimes that did not have endpointId
8698
8685
  const multipleRemoves = channel.connections.filter((identity) => {
8699
8686
  return identity.uuid === payload.uuid && identity.name === payload.name;
8700
8687
  });
8701
- multipleRemoves.forEach(__classPrivateFieldGet$d(channel, _ChannelProvider_removeEndpoint, "f"));
8688
+ multipleRemoves.forEach(__classPrivateFieldGet$e(channel, _ChannelProvider_removeEndpoint, "f"));
8702
8689
  }
8703
8690
  channel.disconnectListener(payload);
8704
8691
  }
@@ -8715,8 +8702,8 @@ class ChannelProvider extends channel_1.ChannelBase {
8715
8702
  _ChannelProvider_strategy.set(this, void 0);
8716
8703
  _ChannelProvider_removeEndpoint.set(this, (identity) => {
8717
8704
  const remainingConnections = this.connections.filter((clientIdentity) => clientIdentity.endpointId !== identity.endpointId);
8718
- __classPrivateFieldGet$d(this, _ChannelProvider_strategy, "f").closeEndpoint(identity.endpointId);
8719
- __classPrivateFieldSet$c(this, _ChannelProvider_connections, remainingConnections, "f");
8705
+ __classPrivateFieldGet$e(this, _ChannelProvider_strategy, "f").closeEndpoint(identity.endpointId);
8706
+ __classPrivateFieldSet$d(this, _ChannelProvider_connections, remainingConnections, "f");
8720
8707
  });
8721
8708
  // Must be bound.
8722
8709
  this.processAction = async (action, payload, senderIdentity) => {
@@ -8730,17 +8717,17 @@ class ChannelProvider extends channel_1.ChannelBase {
8730
8717
  return super.processAction(action, payload, senderIdentity);
8731
8718
  };
8732
8719
  _ChannelProvider_close.set(this, () => {
8733
- __classPrivateFieldGet$d(this, _ChannelProvider_strategy, "f").close();
8720
+ __classPrivateFieldGet$e(this, _ChannelProvider_strategy, "f").close();
8734
8721
  const remove = ChannelProvider.removalMap.get(this);
8735
8722
  if (remove) {
8736
8723
  remove();
8737
8724
  }
8738
8725
  });
8739
- __classPrivateFieldSet$c(this, _ChannelProvider_protectedObj, new channel_1.ProtectedItems(providerIdentity, close), "f");
8726
+ __classPrivateFieldSet$d(this, _ChannelProvider_protectedObj, new channel_1.ProtectedItems(providerIdentity, close), "f");
8740
8727
  this.connectListener = () => undefined;
8741
8728
  this.disconnectListener = () => undefined;
8742
- __classPrivateFieldSet$c(this, _ChannelProvider_connections, [], "f");
8743
- __classPrivateFieldSet$c(this, _ChannelProvider_strategy, strategy, "f");
8729
+ __classPrivateFieldSet$d(this, _ChannelProvider_connections, [], "f");
8730
+ __classPrivateFieldSet$d(this, _ChannelProvider_strategy, strategy, "f");
8744
8731
  strategy.receive(this.processAction);
8745
8732
  }
8746
8733
  /**
@@ -8771,16 +8758,16 @@ class ChannelProvider extends channel_1.ChannelBase {
8771
8758
  */
8772
8759
  dispatch(to, action, payload) {
8773
8760
  const endpointId = to.endpointId ?? this.getEndpointIdForOpenFinId(to, action);
8774
- if (endpointId && __classPrivateFieldGet$d(this, _ChannelProvider_strategy, "f").isEndpointConnected(endpointId)) {
8761
+ if (endpointId && __classPrivateFieldGet$e(this, _ChannelProvider_strategy, "f").isEndpointConnected(endpointId)) {
8775
8762
  const callSites = transport_errors_1$1.RuntimeError.getCallSite();
8776
- return __classPrivateFieldGet$d(this, _ChannelProvider_strategy, "f").send(endpointId, action, payload).catch((e) => {
8763
+ return __classPrivateFieldGet$e(this, _ChannelProvider_strategy, "f").send(endpointId, action, payload).catch((e) => {
8777
8764
  throw new channel_error_1.ChannelError(e, action, payload, callSites);
8778
8765
  });
8779
8766
  }
8780
8767
  return Promise.reject(new Error(`Client connection with identity uuid: ${to.uuid} / name: ${to.name} / endpointId: ${endpointId} no longer connected.`));
8781
8768
  }
8782
8769
  async processConnection(senderId, payload) {
8783
- __classPrivateFieldGet$d(this, _ChannelProvider_connections, "f").push(senderId);
8770
+ __classPrivateFieldGet$e(this, _ChannelProvider_connections, "f").push(senderId);
8784
8771
  return this.connectListener(senderId, payload);
8785
8772
  }
8786
8773
  /**
@@ -8803,7 +8790,7 @@ class ChannelProvider extends channel_1.ChannelBase {
8803
8790
  * ```
8804
8791
  */
8805
8792
  publish(action, payload) {
8806
- return this.connections.map((to) => __classPrivateFieldGet$d(this, _ChannelProvider_strategy, "f").send(to.endpointId, action, payload));
8793
+ return this.connections.map((to) => __classPrivateFieldGet$e(this, _ChannelProvider_strategy, "f").send(to.endpointId, action, payload));
8807
8794
  }
8808
8795
  /**
8809
8796
  * Register a listener that is called on every new client connection.
@@ -8877,11 +8864,11 @@ class ChannelProvider extends channel_1.ChannelBase {
8877
8864
  * ```
8878
8865
  */
8879
8866
  async destroy() {
8880
- const protectedObj = __classPrivateFieldGet$d(this, _ChannelProvider_protectedObj, "f");
8867
+ const protectedObj = __classPrivateFieldGet$e(this, _ChannelProvider_protectedObj, "f");
8881
8868
  protectedObj.providerIdentity;
8882
- __classPrivateFieldSet$c(this, _ChannelProvider_connections, [], "f");
8869
+ __classPrivateFieldSet$d(this, _ChannelProvider_connections, [], "f");
8883
8870
  await protectedObj.close();
8884
- __classPrivateFieldGet$d(this, _ChannelProvider_close, "f").call(this);
8871
+ __classPrivateFieldGet$e(this, _ChannelProvider_close, "f").call(this);
8885
8872
  }
8886
8873
  /**
8887
8874
  * Returns an array with info on every Client connected to the Provider
@@ -8951,7 +8938,7 @@ class ChannelProvider extends channel_1.ChannelBase {
8951
8938
  getEndpointIdForOpenFinId(clientIdentity, action) {
8952
8939
  const matchingConnections = this.connections.filter((c) => c.name === clientIdentity.name && c.uuid === clientIdentity.uuid);
8953
8940
  if (matchingConnections.length >= 2) {
8954
- const protectedObj = __classPrivateFieldGet$d(this, _ChannelProvider_protectedObj, "f");
8941
+ const protectedObj = __classPrivateFieldGet$e(this, _ChannelProvider_protectedObj, "f");
8955
8942
  const { uuid, name } = clientIdentity;
8956
8943
  const providerUuid = protectedObj?.providerIdentity.uuid;
8957
8944
  const providerName = protectedObj?.providerIdentity.name;
@@ -9163,13 +9150,13 @@ class CombinedStrategy {
9163
9150
  }
9164
9151
  strategy.default = CombinedStrategy;
9165
9152
 
9166
- var __classPrivateFieldSet$b = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
9153
+ var __classPrivateFieldSet$c = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
9167
9154
  if (kind === "m") throw new TypeError("Private method is not writable");
9168
9155
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
9169
9156
  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");
9170
9157
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
9171
9158
  };
9172
- var __classPrivateFieldGet$c = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9159
+ var __classPrivateFieldGet$d = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9173
9160
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
9174
9161
  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");
9175
9162
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
@@ -9218,8 +9205,8 @@ class ConnectionManager extends base_1$j.Base {
9218
9205
  };
9219
9206
  this.providerMap = new Map();
9220
9207
  this.protocolManager = new protocol_manager_1.ProtocolManager(this.wire.environment.type === 'node' ? ['classic'] : ['rtc', 'classic']);
9221
- __classPrivateFieldSet$b(this, _ConnectionManager_messageReceiver, new message_receiver_1.MessageReceiver(wire), "f");
9222
- __classPrivateFieldSet$b(this, _ConnectionManager_rtcConnectionManager, new ice_manager_1.RTCICEManager(wire), "f");
9208
+ __classPrivateFieldSet$c(this, _ConnectionManager_messageReceiver, new message_receiver_1.MessageReceiver(wire), "f");
9209
+ __classPrivateFieldSet$c(this, _ConnectionManager_rtcConnectionManager, new ice_manager_1.RTCICEManager(wire), "f");
9223
9210
  wire.registerMessageHandler(this.onmessage.bind(this));
9224
9211
  }
9225
9212
  createProvider(options, providerIdentity) {
@@ -9230,7 +9217,7 @@ class ConnectionManager extends base_1$j.Base {
9230
9217
  case 'rtc':
9231
9218
  return new strategy_2.RTCStrategy();
9232
9219
  case 'classic':
9233
- return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$c(this, _ConnectionManager_messageReceiver, "f"),
9220
+ return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$d(this, _ConnectionManager_messageReceiver, "f"),
9234
9221
  // Providers do not have an endpointId, use channelId as endpointId in the strategy.
9235
9222
  providerIdentity.channelId, providerIdentity);
9236
9223
  default:
@@ -9266,7 +9253,7 @@ class ConnectionManager extends base_1$j.Base {
9266
9253
  const supportedProtocols = await Promise.all(protocols.map(async (type) => {
9267
9254
  switch (type) {
9268
9255
  case 'rtc': {
9269
- const { rtcClient, channels, offer, rtcConnectionId, channelsOpened } = await __classPrivateFieldGet$c(this, _ConnectionManager_rtcConnectionManager, "f").startClientOffer();
9256
+ const { rtcClient, channels, offer, rtcConnectionId, channelsOpened } = await __classPrivateFieldGet$d(this, _ConnectionManager_rtcConnectionManager, "f").startClientOffer();
9270
9257
  rtcPacket = { rtcClient, channels, channelsOpened };
9271
9258
  return {
9272
9259
  type: 'rtc',
@@ -9293,18 +9280,18 @@ class ConnectionManager extends base_1$j.Base {
9293
9280
  routingInfo.endpointId = this.wire.environment.getNextMessageId();
9294
9281
  // For New Clients connecting to Old Providers. To prevent multi-dispatching and publishing, we delete previously-connected
9295
9282
  // clients that are in the same context as the newly-connected client.
9296
- __classPrivateFieldGet$c(this, _ConnectionManager_messageReceiver, "f").checkForPreviousClientConnection(routingInfo.channelId);
9283
+ __classPrivateFieldGet$d(this, _ConnectionManager_messageReceiver, "f").checkForPreviousClientConnection(routingInfo.channelId);
9297
9284
  }
9298
9285
  const answer = routingInfo.answer ?? {
9299
9286
  supportedProtocols: [{ type: 'classic', version: 1 }]
9300
9287
  };
9301
9288
  const createStrategyFromAnswer = async (protocol) => {
9302
9289
  if (protocol.type === 'rtc' && rtcPacket) {
9303
- await __classPrivateFieldGet$c(this, _ConnectionManager_rtcConnectionManager, "f").finishClientOffer(rtcPacket.rtcClient, protocol.payload.answer, rtcPacket.channelsOpened);
9290
+ await __classPrivateFieldGet$d(this, _ConnectionManager_rtcConnectionManager, "f").finishClientOffer(rtcPacket.rtcClient, protocol.payload.answer, rtcPacket.channelsOpened);
9304
9291
  return new strategy_2.RTCStrategy();
9305
9292
  }
9306
9293
  if (protocol.type === 'classic') {
9307
- return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$c(this, _ConnectionManager_messageReceiver, "f"), routingInfo.endpointId, routingInfo);
9294
+ return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$d(this, _ConnectionManager_messageReceiver, "f"), routingInfo.endpointId, routingInfo);
9308
9295
  }
9309
9296
  return null;
9310
9297
  };
@@ -9372,7 +9359,7 @@ class ConnectionManager extends base_1$j.Base {
9372
9359
  clientAnswer = await overlappingProtocols.reduce(async (accumP, protocolToUse) => {
9373
9360
  const answer = await accumP;
9374
9361
  if (protocolToUse.type === 'rtc') {
9375
- const { answer: rtcAnswer, rtcClient, channels } = await __classPrivateFieldGet$c(this, _ConnectionManager_rtcConnectionManager, "f").createProviderAnswer(protocolToUse.payload.rtcConnectionId, protocolToUse.payload.offer);
9362
+ const { answer: rtcAnswer, rtcClient, channels } = await __classPrivateFieldGet$d(this, _ConnectionManager_rtcConnectionManager, "f").createProviderAnswer(protocolToUse.payload.rtcConnectionId, protocolToUse.payload.offer);
9376
9363
  answer.supportedProtocols.push({
9377
9364
  type: 'rtc',
9378
9365
  version: strategy_2.RTCInfo.version,
@@ -9420,13 +9407,13 @@ _ConnectionManager_messageReceiver = new WeakMap(), _ConnectionManager_rtcConnec
9420
9407
  *
9421
9408
  * @packageDocumentation
9422
9409
  */
9423
- var __classPrivateFieldSet$a = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
9410
+ var __classPrivateFieldSet$b = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
9424
9411
  if (kind === "m") throw new TypeError("Private method is not writable");
9425
9412
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
9426
9413
  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");
9427
9414
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
9428
9415
  };
9429
- var __classPrivateFieldGet$b = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9416
+ var __classPrivateFieldGet$c = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9430
9417
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
9431
9418
  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");
9432
9419
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
@@ -9483,11 +9470,11 @@ class Channel extends base_1$i.EmitterBase {
9483
9470
  client_1.ChannelClient.handleProviderDisconnect(eventPayload);
9484
9471
  }),
9485
9472
  this.on('connected', (...args) => {
9486
- __classPrivateFieldGet$b(this, _Channel_internalEmitter, "f").emit('connected', ...args);
9473
+ __classPrivateFieldGet$c(this, _Channel_internalEmitter, "f").emit('connected', ...args);
9487
9474
  })
9488
9475
  ]).catch(() => new Error('error setting up channel connection listeners'));
9489
9476
  }));
9490
- __classPrivateFieldSet$a(this, _Channel_connectionManager, new connection_manager_1.ConnectionManager(wire), "f");
9477
+ __classPrivateFieldSet$b(this, _Channel_connectionManager, new connection_manager_1.ConnectionManager(wire), "f");
9491
9478
  }
9492
9479
  /**
9493
9480
  *
@@ -9562,7 +9549,7 @@ class Channel extends base_1$i.EmitterBase {
9562
9549
  resolve(true);
9563
9550
  }
9564
9551
  };
9565
- __classPrivateFieldGet$b(this, _Channel_internalEmitter, "f").on('connected', connectedListener);
9552
+ __classPrivateFieldGet$c(this, _Channel_internalEmitter, "f").on('connected', connectedListener);
9566
9553
  });
9567
9554
  try {
9568
9555
  if (retryInfo.count > 0) {
@@ -9594,7 +9581,7 @@ class Channel extends base_1$i.EmitterBase {
9594
9581
  finally {
9595
9582
  retryInfo.count += 1;
9596
9583
  // in case of other errors, remove our listener
9597
- __classPrivateFieldGet$b(this, _Channel_internalEmitter, "f").removeListener('connected', connectedListener);
9584
+ __classPrivateFieldGet$c(this, _Channel_internalEmitter, "f").removeListener('connected', connectedListener);
9598
9585
  }
9599
9586
  } while (shouldWait); // If we're waiting we retry the above loop
9600
9587
  // Should wait was false, no channel was found.
@@ -9653,12 +9640,12 @@ class Channel extends base_1$i.EmitterBase {
9653
9640
  async connect(channelName, options = {}) {
9654
9641
  // Make sure we don't connect before listeners are set up
9655
9642
  // This also errors if we're not in OpenFin, ensuring we don't run unnecessary code
9656
- await __classPrivateFieldGet$b(this, _Channel_readyToConnect, "f").getValue();
9643
+ await __classPrivateFieldGet$c(this, _Channel_readyToConnect, "f").getValue();
9657
9644
  if (!channelName || typeof channelName !== 'string') {
9658
9645
  throw new Error('Please provide a channelName string to connect to a channel.');
9659
9646
  }
9660
9647
  const opts = { wait: true, ...this.wire.environment.getDefaultChannelOptions().connect, ...options };
9661
- const { offer, rtc: rtcPacket } = await __classPrivateFieldGet$b(this, _Channel_connectionManager, "f").createClientOffer(opts);
9648
+ const { offer, rtc: rtcPacket } = await __classPrivateFieldGet$c(this, _Channel_connectionManager, "f").createClientOffer(opts);
9662
9649
  let connectionUrl;
9663
9650
  if (this.fin.me.isFrame || this.fin.me.isView || this.fin.me.isWindow) {
9664
9651
  connectionUrl = (await this.fin.me.getInfo()).url;
@@ -9670,7 +9657,7 @@ class Channel extends base_1$i.EmitterBase {
9670
9657
  connectionUrl
9671
9658
  };
9672
9659
  const routingInfo = await this.safeConnect(channelName, opts.wait, connectPayload);
9673
- const strategy = await __classPrivateFieldGet$b(this, _Channel_connectionManager, "f").createClientStrategy(rtcPacket, routingInfo);
9660
+ const strategy = await __classPrivateFieldGet$c(this, _Channel_connectionManager, "f").createClientStrategy(rtcPacket, routingInfo);
9674
9661
  const channel = new client_1.ChannelClient(routingInfo, () => client_1.ChannelClient.wireClose(this.wire, routingInfo, routingInfo.endpointId), strategy);
9675
9662
  // It is the client's responsibility to handle endpoint disconnection to the provider.
9676
9663
  // If the endpoint dies, the client will force a disconnection through the core.
@@ -9739,7 +9726,7 @@ class Channel extends base_1$i.EmitterBase {
9739
9726
  throw new Error('Please provide a channelName to create a channel');
9740
9727
  }
9741
9728
  const { payload: { data: providerIdentity } } = await this.wire.sendAction('create-channel', { channelName });
9742
- const channel = __classPrivateFieldGet$b(this, _Channel_connectionManager, "f").createProvider(options, providerIdentity);
9729
+ const channel = __classPrivateFieldGet$c(this, _Channel_connectionManager, "f").createProvider(options, providerIdentity);
9743
9730
  // TODO: fix typing (internal)
9744
9731
  // @ts-expect-error
9745
9732
  this.on('client-disconnected', (eventPayload) => {
@@ -10630,13 +10617,13 @@ var Factory$3 = {};
10630
10617
 
10631
10618
  var Instance$2 = {};
10632
10619
 
10633
- var __classPrivateFieldSet$9 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
10620
+ var __classPrivateFieldSet$a = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
10634
10621
  if (kind === "m") throw new TypeError("Private method is not writable");
10635
10622
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
10636
10623
  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");
10637
10624
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
10638
10625
  };
10639
- var __classPrivateFieldGet$a = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
10626
+ var __classPrivateFieldGet$b = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
10640
10627
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
10641
10628
  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");
10642
10629
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
@@ -10673,24 +10660,24 @@ class Platform extends base_1$a.EmitterBase {
10673
10660
  this.wire.sendAction('platform-get-client', this.identity).catch((e) => {
10674
10661
  // don't expose
10675
10662
  });
10676
- if (!Platform.clientMap.has(__classPrivateFieldGet$a(this, _Platform_channelName, "f"))) {
10677
- const clientPromise = __classPrivateFieldGet$a(this, _Platform_connectToProvider, "f").call(this);
10678
- Platform.clientMap.set(__classPrivateFieldGet$a(this, _Platform_channelName, "f"), clientPromise);
10663
+ if (!Platform.clientMap.has(__classPrivateFieldGet$b(this, _Platform_channelName, "f"))) {
10664
+ const clientPromise = __classPrivateFieldGet$b(this, _Platform_connectToProvider, "f").call(this);
10665
+ Platform.clientMap.set(__classPrivateFieldGet$b(this, _Platform_channelName, "f"), clientPromise);
10679
10666
  }
10680
10667
  // we set it above
10681
10668
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
10682
- return Platform.clientMap.get(__classPrivateFieldGet$a(this, _Platform_channelName, "f"));
10669
+ return Platform.clientMap.get(__classPrivateFieldGet$b(this, _Platform_channelName, "f"));
10683
10670
  };
10684
10671
  _Platform_connectToProvider.set(this, async () => {
10685
10672
  try {
10686
- const client = await this._channel.connect(__classPrivateFieldGet$a(this, _Platform_channelName, "f"), { wait: false });
10673
+ const client = await this._channel.connect(__classPrivateFieldGet$b(this, _Platform_channelName, "f"), { wait: false });
10687
10674
  client.onDisconnection(() => {
10688
- Platform.clientMap.delete(__classPrivateFieldGet$a(this, _Platform_channelName, "f"));
10675
+ Platform.clientMap.delete(__classPrivateFieldGet$b(this, _Platform_channelName, "f"));
10689
10676
  });
10690
10677
  return client;
10691
10678
  }
10692
10679
  catch (e) {
10693
- Platform.clientMap.delete(__classPrivateFieldGet$a(this, _Platform_channelName, "f"));
10680
+ Platform.clientMap.delete(__classPrivateFieldGet$b(this, _Platform_channelName, "f"));
10694
10681
  throw new Error('The targeted Platform is not currently running. Listen for application-started event for the given Uuid.');
10695
10682
  }
10696
10683
  });
@@ -10703,7 +10690,7 @@ class Platform extends base_1$a.EmitterBase {
10703
10690
  if (errorMsg) {
10704
10691
  throw new Error(errorMsg);
10705
10692
  }
10706
- __classPrivateFieldSet$9(this, _Platform_channelName, channelName, "f");
10693
+ __classPrivateFieldSet$a(this, _Platform_channelName, channelName, "f");
10707
10694
  this._channel = this.fin.InterApplicationBus.Channel;
10708
10695
  this.identity = { uuid: identity.uuid };
10709
10696
  this.Layout = this.fin.Platform.Layout;
@@ -11759,13 +11746,13 @@ const createRelayedDispatch = (client, target, relayId, relayErrorMsg) => async
11759
11746
  };
11760
11747
  channelApiRelay.createRelayedDispatch = createRelayedDispatch;
11761
11748
 
11762
- var __classPrivateFieldSet$8 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
11749
+ var __classPrivateFieldSet$9 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
11763
11750
  if (kind === "m") throw new TypeError("Private method is not writable");
11764
11751
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
11765
11752
  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");
11766
11753
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
11767
11754
  };
11768
- var __classPrivateFieldGet$9 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
11755
+ var __classPrivateFieldGet$a = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
11769
11756
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
11770
11757
  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");
11771
11758
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
@@ -11819,7 +11806,7 @@ class LayoutNode {
11819
11806
  * console.log(`The parent ColumnOrRow is root: ${parentIsRoot}`);
11820
11807
  * ```
11821
11808
  */
11822
- this.isRoot = () => __classPrivateFieldGet$9(this, _LayoutNode_client, "f").isRoot(this.entityId);
11809
+ this.isRoot = () => __classPrivateFieldGet$a(this, _LayoutNode_client, "f").isRoot(this.entityId);
11823
11810
  /**
11824
11811
  * Checks if the TabStack or ColumnOrRow exists
11825
11812
  *
@@ -11839,7 +11826,7 @@ class LayoutNode {
11839
11826
  * console.log(`The entity exists: ${exists}`);
11840
11827
  * ```
11841
11828
  */
11842
- this.exists = () => __classPrivateFieldGet$9(this, _LayoutNode_client, "f").exists(this.entityId);
11829
+ this.exists = () => __classPrivateFieldGet$a(this, _LayoutNode_client, "f").exists(this.entityId);
11843
11830
  /**
11844
11831
  * Retrieves the parent of the TabStack or ColumnOrRow
11845
11832
  *
@@ -11860,11 +11847,11 @@ class LayoutNode {
11860
11847
  * ```
11861
11848
  */
11862
11849
  this.getParent = async () => {
11863
- const parent = await __classPrivateFieldGet$9(this, _LayoutNode_client, "f").getParent(this.entityId);
11850
+ const parent = await __classPrivateFieldGet$a(this, _LayoutNode_client, "f").getParent(this.entityId);
11864
11851
  if (!parent) {
11865
11852
  return undefined;
11866
11853
  }
11867
- return LayoutNode.getEntity(parent, __classPrivateFieldGet$9(this, _LayoutNode_client, "f"));
11854
+ return LayoutNode.getEntity(parent, __classPrivateFieldGet$a(this, _LayoutNode_client, "f"));
11868
11855
  };
11869
11856
  /**
11870
11857
  * Creates a new TabStack adjacent to the given TabStack or ColumnOrRow. Inputs can be new views to create, or existing views.
@@ -11915,8 +11902,8 @@ class LayoutNode {
11915
11902
  * @experimental
11916
11903
  */
11917
11904
  this.createAdjacentStack = async (views, options) => {
11918
- const entityId = await __classPrivateFieldGet$9(this, _LayoutNode_client, "f").createAdjacentStack(this.entityId, views, options);
11919
- return LayoutNode.getEntity({ entityId, type: 'stack' }, __classPrivateFieldGet$9(this, _LayoutNode_client, "f"));
11905
+ const entityId = await __classPrivateFieldGet$a(this, _LayoutNode_client, "f").createAdjacentStack(this.entityId, views, options);
11906
+ return LayoutNode.getEntity({ entityId, type: 'stack' }, __classPrivateFieldGet$a(this, _LayoutNode_client, "f"));
11920
11907
  };
11921
11908
  /**
11922
11909
  * Retrieves the adjacent TabStacks of the given TabStack or ColumnOrRow.
@@ -11944,16 +11931,16 @@ class LayoutNode {
11944
11931
  * @experimental
11945
11932
  */
11946
11933
  this.getAdjacentStacks = async (edge) => {
11947
- const adjacentStacks = await __classPrivateFieldGet$9(this, _LayoutNode_client, "f").getAdjacentStacks({
11934
+ const adjacentStacks = await __classPrivateFieldGet$a(this, _LayoutNode_client, "f").getAdjacentStacks({
11948
11935
  targetId: this.entityId,
11949
11936
  edge
11950
11937
  });
11951
11938
  return adjacentStacks.map((stack) => LayoutNode.getEntity({
11952
11939
  type: 'stack',
11953
11940
  entityId: stack.entityId
11954
- }, __classPrivateFieldGet$9(this, _LayoutNode_client, "f")));
11941
+ }, __classPrivateFieldGet$a(this, _LayoutNode_client, "f")));
11955
11942
  };
11956
- __classPrivateFieldSet$8(this, _LayoutNode_client, client, "f");
11943
+ __classPrivateFieldSet$9(this, _LayoutNode_client, client, "f");
11957
11944
  this.entityId = entityId;
11958
11945
  }
11959
11946
  }
@@ -12027,7 +12014,7 @@ class TabStack extends LayoutNode {
12027
12014
  * ```
12028
12015
  * @experimental
12029
12016
  */
12030
- this.getViews = () => __classPrivateFieldGet$9(this, _TabStack_client, "f").getStackViews(this.entityId);
12017
+ this.getViews = () => __classPrivateFieldGet$a(this, _TabStack_client, "f").getStackViews(this.entityId);
12031
12018
  /**
12032
12019
  * Adds or creates a view in this {@link TabStack}.
12033
12020
  *
@@ -12058,7 +12045,7 @@ class TabStack extends LayoutNode {
12058
12045
  * ```
12059
12046
  * @experimental
12060
12047
  */
12061
- this.addView = async (view, options = { index: 0 }) => __classPrivateFieldGet$9(this, _TabStack_client, "f").addViewToStack(this.entityId, view, options);
12048
+ this.addView = async (view, options = { index: 0 }) => __classPrivateFieldGet$a(this, _TabStack_client, "f").addViewToStack(this.entityId, view, options);
12062
12049
  /**
12063
12050
  * Removes a view from this {@link TabStack}.
12064
12051
  *
@@ -12088,7 +12075,7 @@ class TabStack extends LayoutNode {
12088
12075
  * ```
12089
12076
  */
12090
12077
  this.removeView = async (view) => {
12091
- await __classPrivateFieldGet$9(this, _TabStack_client, "f").removeViewFromStack(this.entityId, view);
12078
+ await __classPrivateFieldGet$a(this, _TabStack_client, "f").removeViewFromStack(this.entityId, view);
12092
12079
  };
12093
12080
  /**
12094
12081
  * Sets the active view of the {@link TabStack} without focusing it.
@@ -12112,9 +12099,9 @@ class TabStack extends LayoutNode {
12112
12099
  * @experimental
12113
12100
  */
12114
12101
  this.setActiveView = async (view) => {
12115
- await __classPrivateFieldGet$9(this, _TabStack_client, "f").setStackActiveView(this.entityId, view);
12102
+ await __classPrivateFieldGet$a(this, _TabStack_client, "f").setStackActiveView(this.entityId, view);
12116
12103
  };
12117
- __classPrivateFieldSet$8(this, _TabStack_client, client, "f");
12104
+ __classPrivateFieldSet$9(this, _TabStack_client, client, "f");
12118
12105
  }
12119
12106
  }
12120
12107
  layoutEntities.TabStack = TabStack;
@@ -12153,10 +12140,10 @@ class ColumnOrRow extends LayoutNode {
12153
12140
  * ```
12154
12141
  */
12155
12142
  this.getContent = async () => {
12156
- const contentItemEntities = await __classPrivateFieldGet$9(this, _ColumnOrRow_client, "f").getContent(this.entityId);
12157
- return contentItemEntities.map((entity) => LayoutNode.getEntity(entity, __classPrivateFieldGet$9(this, _ColumnOrRow_client, "f")));
12143
+ const contentItemEntities = await __classPrivateFieldGet$a(this, _ColumnOrRow_client, "f").getContent(this.entityId);
12144
+ return contentItemEntities.map((entity) => LayoutNode.getEntity(entity, __classPrivateFieldGet$a(this, _ColumnOrRow_client, "f")));
12158
12145
  };
12159
- __classPrivateFieldSet$8(this, _ColumnOrRow_client, client, "f");
12146
+ __classPrivateFieldSet$9(this, _ColumnOrRow_client, client, "f");
12160
12147
  this.type = type;
12161
12148
  }
12162
12149
  }
@@ -12171,7 +12158,7 @@ layout_constants.LAYOUT_CONTROLLER_ID = 'layout-entities';
12171
12158
  // TODO: eventually export this somehow
12172
12159
  layout_constants.DEFAULT_LAYOUT_KEY = '__default__';
12173
12160
 
12174
- var __classPrivateFieldGet$8 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
12161
+ var __classPrivateFieldGet$9 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
12175
12162
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
12176
12163
  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");
12177
12164
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
@@ -12322,7 +12309,7 @@ class Layout extends base_1$9.Base {
12322
12309
  * @internal
12323
12310
  */
12324
12311
  static getClient(layout) {
12325
- return __classPrivateFieldGet$8(layout, _Layout_layoutClient, "f").getValue();
12312
+ return __classPrivateFieldGet$9(layout, _Layout_layoutClient, "f").getValue();
12326
12313
  }
12327
12314
  /**
12328
12315
  * @internal
@@ -12545,7 +12532,7 @@ class Layout extends base_1$9.Base {
12545
12532
  this.wire.sendAction('layout-get-root-item').catch(() => {
12546
12533
  // don't expose
12547
12534
  });
12548
- const client = await __classPrivateFieldGet$8(this, _Layout_layoutClient, "f").getValue();
12535
+ const client = await __classPrivateFieldGet$9(this, _Layout_layoutClient, "f").getValue();
12549
12536
  const root = await client.getRoot('layoutName' in this.identity ? this.identity : undefined);
12550
12537
  return layout_entities_1.LayoutNode.getEntity(root, client);
12551
12538
  }
@@ -12563,7 +12550,7 @@ class Layout extends base_1$9.Base {
12563
12550
  this.wire.sendAction('layout-get-stack-by-view').catch(() => {
12564
12551
  // don't expose
12565
12552
  });
12566
- const client = await __classPrivateFieldGet$8(this, _Layout_layoutClient, "f").getValue();
12553
+ const client = await __classPrivateFieldGet$9(this, _Layout_layoutClient, "f").getValue();
12567
12554
  const stack = await client.getStackByView(identity);
12568
12555
  if (!stack) {
12569
12556
  throw new Error(`No stack found for view: ${identity.uuid}/${identity.name}`);
@@ -12583,7 +12570,7 @@ class Layout extends base_1$9.Base {
12583
12570
  this.wire.sendAction('layout-add-view').catch((e) => {
12584
12571
  // don't expose
12585
12572
  });
12586
- const { identity } = await __classPrivateFieldGet$8(this, _Layout_instances, "m", _Layout_forwardLayoutAction).call(this, 'layout-add-view', {
12573
+ const { identity } = await __classPrivateFieldGet$9(this, _Layout_instances, "m", _Layout_forwardLayoutAction).call(this, 'layout-add-view', {
12587
12574
  viewOptions,
12588
12575
  location,
12589
12576
  targetView
@@ -12601,7 +12588,7 @@ class Layout extends base_1$9.Base {
12601
12588
  this.wire.sendAction('layout-close-view').catch((e) => {
12602
12589
  // don't expose
12603
12590
  });
12604
- await __classPrivateFieldGet$8(this, _Layout_instances, "m", _Layout_forwardLayoutAction).call(this, 'layout-close-view', { viewIdentity });
12591
+ await __classPrivateFieldGet$9(this, _Layout_instances, "m", _Layout_forwardLayoutAction).call(this, 'layout-close-view', { viewIdentity });
12605
12592
  }
12606
12593
  }
12607
12594
  Instance$1.Layout = Layout;
@@ -12615,12 +12602,12 @@ async function _Layout_forwardLayoutAction(action, payload) {
12615
12602
  return client.dispatch(action, { target: this.identity, opts: payload });
12616
12603
  };
12617
12604
 
12618
- var __classPrivateFieldGet$7 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
12605
+ var __classPrivateFieldGet$8 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
12619
12606
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
12620
12607
  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");
12621
12608
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12622
12609
  };
12623
- var __classPrivateFieldSet$7 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
12610
+ var __classPrivateFieldSet$8 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
12624
12611
  if (kind === "m") throw new TypeError("Private method is not writable");
12625
12612
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
12626
12613
  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");
@@ -12686,23 +12673,23 @@ class LayoutModule extends base_1$8.Base {
12686
12673
  if (!this.wire.environment.layoutAllowedInContext(this.fin)) {
12687
12674
  throw new Error('Layout.init can only be called from a Window context.');
12688
12675
  }
12689
- if (__classPrivateFieldGet$7(this, _LayoutModule_layoutInitializationAttempted, "f")) {
12676
+ if (__classPrivateFieldGet$8(this, _LayoutModule_layoutInitializationAttempted, "f")) {
12690
12677
  throw new Error('Layout.init was already called, please use Layout.create to add additional layouts.');
12691
12678
  }
12692
12679
  if (this.wire.environment.type === 'openfin') {
12693
12680
  // preload the client
12694
12681
  await this.fin.Platform.getCurrentSync().getClient();
12695
12682
  }
12696
- __classPrivateFieldSet$7(this, _LayoutModule_layoutInitializationAttempted, true, "f");
12683
+ __classPrivateFieldSet$8(this, _LayoutModule_layoutInitializationAttempted, true, "f");
12697
12684
  // TODO: rename to createLayoutManager
12698
- __classPrivateFieldSet$7(this, _LayoutModule_layoutManager, await this.wire.environment.initLayoutManager(this.fin, this.wire, options), "f");
12699
- await this.wire.environment.applyLayoutSnapshot(this.fin, __classPrivateFieldGet$7(this, _LayoutModule_layoutManager, "f"), options);
12685
+ __classPrivateFieldSet$8(this, _LayoutModule_layoutManager, await this.wire.environment.initLayoutManager(this.fin, this.wire, options), "f");
12686
+ await this.wire.environment.applyLayoutSnapshot(this.fin, __classPrivateFieldGet$8(this, _LayoutModule_layoutManager, "f"), options);
12700
12687
  const meIdentity = { name: this.fin.me.name, uuid: this.fin.me.uuid };
12701
12688
  if (!options.layoutManagerOverride) {
12702
12689
  // CORE-1081 to be removed when we actually delete the `layoutManager` prop
12703
12690
  // in single-layout case, we return the undocumented layoutManager type
12704
12691
  const layoutIdentity = { layoutName: layout_constants_1.DEFAULT_LAYOUT_KEY, ...meIdentity };
12705
- return __classPrivateFieldGet$7(this, _LayoutModule_getLayoutManagerSpy, "f").call(this, layoutIdentity);
12692
+ return __classPrivateFieldGet$8(this, _LayoutModule_getLayoutManagerSpy, "f").call(this, layoutIdentity);
12706
12693
  }
12707
12694
  return this.wrapSync(meIdentity);
12708
12695
  };
@@ -12731,13 +12718,13 @@ class LayoutModule extends base_1$8.Base {
12731
12718
  * @returns
12732
12719
  */
12733
12720
  this.getCurrentLayoutManagerSync = () => {
12734
- return __classPrivateFieldGet$7(this, _LayoutModule_instances, "m", _LayoutModule_getSafeLayoutManager).call(this, `fin.Platform.Layout.getCurrentLayoutManagerSync()`);
12721
+ return __classPrivateFieldGet$8(this, _LayoutModule_instances, "m", _LayoutModule_getSafeLayoutManager).call(this, `fin.Platform.Layout.getCurrentLayoutManagerSync()`);
12735
12722
  };
12736
12723
  this.create = async (options) => {
12737
- return this.wire.environment.createLayout(__classPrivateFieldGet$7(this, _LayoutModule_instances, "m", _LayoutModule_getSafeLayoutManager).call(this, `fin.Platform.Layout.create()`), options);
12724
+ return this.wire.environment.createLayout(__classPrivateFieldGet$8(this, _LayoutModule_instances, "m", _LayoutModule_getSafeLayoutManager).call(this, `fin.Platform.Layout.create()`), options);
12738
12725
  };
12739
12726
  this.destroy = async (layoutIdentity) => {
12740
- return this.wire.environment.destroyLayout(__classPrivateFieldGet$7(this, _LayoutModule_instances, "m", _LayoutModule_getSafeLayoutManager).call(this, `fin.Platform.Layout.destroy()`), layoutIdentity);
12727
+ return this.wire.environment.destroyLayout(__classPrivateFieldGet$8(this, _LayoutModule_instances, "m", _LayoutModule_getSafeLayoutManager).call(this, `fin.Platform.Layout.destroy()`), layoutIdentity);
12741
12728
  };
12742
12729
  }
12743
12730
  /**
@@ -12878,10 +12865,10 @@ class LayoutModule extends base_1$8.Base {
12878
12865
  }
12879
12866
  Factory$2.LayoutModule = LayoutModule;
12880
12867
  _LayoutModule_layoutInitializationAttempted = new WeakMap(), _LayoutModule_layoutManager = new WeakMap(), _LayoutModule_getLayoutManagerSpy = new WeakMap(), _LayoutModule_instances = new WeakSet(), _LayoutModule_getSafeLayoutManager = function _LayoutModule_getSafeLayoutManager(method) {
12881
- if (!__classPrivateFieldGet$7(this, _LayoutModule_layoutManager, "f")) {
12868
+ if (!__classPrivateFieldGet$8(this, _LayoutModule_layoutManager, "f")) {
12882
12869
  throw new Error(`You must call init before using the API ${method}`);
12883
12870
  }
12884
- return __classPrivateFieldGet$7(this, _LayoutModule_layoutManager, "f");
12871
+ return __classPrivateFieldGet$8(this, _LayoutModule_layoutManager, "f");
12885
12872
  };
12886
12873
 
12887
12874
  (function (exports) {
@@ -13846,13 +13833,13 @@ class PrivateChannelProvider {
13846
13833
  }
13847
13834
  PrivateChannelProvider$1.PrivateChannelProvider = PrivateChannelProvider;
13848
13835
 
13849
- var __classPrivateFieldSet$6 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
13836
+ var __classPrivateFieldSet$7 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
13850
13837
  if (kind === "m") throw new TypeError("Private method is not writable");
13851
13838
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
13852
13839
  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");
13853
13840
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
13854
13841
  };
13855
- var __classPrivateFieldGet$6 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
13842
+ var __classPrivateFieldGet$7 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
13856
13843
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
13857
13844
  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");
13858
13845
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
@@ -14043,12 +14030,12 @@ class InteropBroker extends base_1$6.Base {
14043
14030
  _InteropBroker_contextGroups.set(this, void 0);
14044
14031
  _InteropBroker_providerPromise.set(this, void 0);
14045
14032
  this.getProvider = () => {
14046
- return __classPrivateFieldGet$6(this, _InteropBroker_providerPromise, "f").getValue();
14033
+ return __classPrivateFieldGet$7(this, _InteropBroker_providerPromise, "f").getValue();
14047
14034
  };
14048
14035
  this.interopClients = new Map();
14049
14036
  this.contextGroupsById = new Map();
14050
- __classPrivateFieldSet$6(this, _InteropBroker_contextGroups, options.contextGroups ?? [...defaultContextGroups], "f");
14051
- __classPrivateFieldSet$6(this, _InteropBroker_fdc3Info, options.fdc3Info, "f");
14037
+ __classPrivateFieldSet$7(this, _InteropBroker_contextGroups, options.contextGroups ?? [...defaultContextGroups], "f");
14038
+ __classPrivateFieldSet$7(this, _InteropBroker_fdc3Info, options.fdc3Info, "f");
14052
14039
  if (options?.logging) {
14053
14040
  this.logging = options.logging;
14054
14041
  }
@@ -14056,7 +14043,7 @@ class InteropBroker extends base_1$6.Base {
14056
14043
  this.lastContextMap = new Map();
14057
14044
  this.sessionContextGroupMap = new Map();
14058
14045
  this.privateChannelProviderMap = new Map();
14059
- __classPrivateFieldSet$6(this, _InteropBroker_providerPromise, new lazy_1$1.Lazy(createProvider), "f");
14046
+ __classPrivateFieldSet$7(this, _InteropBroker_providerPromise, new lazy_1$1.Lazy(createProvider), "f");
14060
14047
  this.setContextGroupMap();
14061
14048
  this.setupChannelProvider();
14062
14049
  }
@@ -14228,8 +14215,8 @@ class InteropBroker extends base_1$6.Base {
14228
14215
  if (!this.getContextGroups().find((contextGroupInfo) => contextGroupInfo.id === contextGroupId)) {
14229
14216
  throw new Error(`Attempting to join a context group that does not exist: ${contextGroupId}. You may only join existing context groups.`);
14230
14217
  }
14231
- const oldContextGroupId = clientSubscriptionState.contextGroupId;
14232
- if (oldContextGroupId !== contextGroupId) {
14218
+ const previousContextGroupId = clientSubscriptionState.contextGroupId;
14219
+ if (previousContextGroupId !== contextGroupId) {
14233
14220
  clientSubscriptionState.contextGroupId = contextGroupId;
14234
14221
  await this.setCurrentContextGroupInClientOptions(clientIdentity, contextGroupId);
14235
14222
  const contextGroupMap = this.contextGroupsById.get(contextGroupId);
@@ -14248,6 +14235,13 @@ class InteropBroker extends base_1$6.Base {
14248
14235
  }
14249
14236
  }
14250
14237
  }
14238
+ // All settled will suppress uncaught exceptions. We don't want to await this because it could
14239
+ // result in the operation hanging.
14240
+ Promise.allSettled(this.channel.publish('client-changed-context-group', {
14241
+ identity: clientIdentity,
14242
+ contextGroupId,
14243
+ previousContextGroupId: previousContextGroupId || null
14244
+ }));
14251
14245
  }
14252
14246
  }
14253
14247
  // Removes the target from its context group. Similar structure to joinContextGroup.
@@ -14307,10 +14301,18 @@ class InteropBroker extends base_1$6.Base {
14307
14301
  // don't expose, analytics-only call
14308
14302
  });
14309
14303
  const clientState = this.getClientState(clientIdentity);
14304
+ const previousContextGroupId = clientState?.contextGroupId;
14310
14305
  if (clientState) {
14311
14306
  clientState.contextGroupId = undefined;
14312
14307
  }
14313
14308
  await this.setCurrentContextGroupInClientOptions(clientIdentity, null);
14309
+ // All settled will suppress uncaught exceptions. We don't want to await this because it could
14310
+ // result in the operation hanging.
14311
+ Promise.allSettled(this.channel.publish('client-changed-context-group', {
14312
+ identity: clientIdentity,
14313
+ contextGroupId: null,
14314
+ previousContextGroupId: previousContextGroupId || null
14315
+ }));
14314
14316
  }
14315
14317
  // 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.
14316
14318
  /**
@@ -14324,7 +14326,7 @@ class InteropBroker extends base_1$6.Base {
14324
14326
  // don't expose, analytics-only call
14325
14327
  });
14326
14328
  // Create copy for immutability
14327
- return __classPrivateFieldGet$6(this, _InteropBroker_contextGroups, "f").map((contextGroup) => {
14329
+ return __classPrivateFieldGet$7(this, _InteropBroker_contextGroups, "f").map((contextGroup) => {
14328
14330
  return { ...contextGroup };
14329
14331
  });
14330
14332
  }
@@ -14735,7 +14737,7 @@ class InteropBroker extends base_1$6.Base {
14735
14737
  const { fdc3Version } = payload;
14736
14738
  return {
14737
14739
  fdc3Version,
14738
- ...__classPrivateFieldGet$6(this, _InteropBroker_fdc3Info, "f"),
14740
+ ...__classPrivateFieldGet$7(this, _InteropBroker_fdc3Info, "f"),
14739
14741
  optionalFeatures: {
14740
14742
  OriginatingAppMetadata: false,
14741
14743
  UserChannelMembershipAPIs: true
@@ -15120,13 +15122,13 @@ var InteropClient$1 = {};
15120
15122
 
15121
15123
  var SessionContextGroupClient$1 = {};
15122
15124
 
15123
- var __classPrivateFieldSet$5 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
15125
+ var __classPrivateFieldSet$6 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
15124
15126
  if (kind === "m") throw new TypeError("Private method is not writable");
15125
15127
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
15126
15128
  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");
15127
15129
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
15128
15130
  };
15129
- var __classPrivateFieldGet$5 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
15131
+ var __classPrivateFieldGet$6 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
15130
15132
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
15131
15133
  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");
15132
15134
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
@@ -15140,7 +15142,7 @@ class SessionContextGroupClient extends base_1$5.Base {
15140
15142
  super(wire);
15141
15143
  _SessionContextGroupClient_clientPromise.set(this, void 0);
15142
15144
  this.id = id;
15143
- __classPrivateFieldSet$5(this, _SessionContextGroupClient_clientPromise, client, "f");
15145
+ __classPrivateFieldSet$6(this, _SessionContextGroupClient_clientPromise, client, "f");
15144
15146
  }
15145
15147
  /**
15146
15148
  * Sets a context for the session context group.
@@ -15152,7 +15154,7 @@ class SessionContextGroupClient extends base_1$5.Base {
15152
15154
  this.wire.sendAction('interop-session-context-group-set-context').catch((e) => {
15153
15155
  // don't expose, analytics-only call
15154
15156
  });
15155
- const client = await __classPrivateFieldGet$5(this, _SessionContextGroupClient_clientPromise, "f");
15157
+ const client = await __classPrivateFieldGet$6(this, _SessionContextGroupClient_clientPromise, "f");
15156
15158
  return client.dispatch(`sessionContextGroup:setContext-${this.id}`, {
15157
15159
  sessionContextGroupId: this.id,
15158
15160
  context
@@ -15162,7 +15164,7 @@ class SessionContextGroupClient extends base_1$5.Base {
15162
15164
  this.wire.sendAction('interop-session-context-group-get-context').catch((e) => {
15163
15165
  // don't expose, analytics-only call
15164
15166
  });
15165
- const client = await __classPrivateFieldGet$5(this, _SessionContextGroupClient_clientPromise, "f");
15167
+ const client = await __classPrivateFieldGet$6(this, _SessionContextGroupClient_clientPromise, "f");
15166
15168
  return client.dispatch(`sessionContextGroup:getContext-${this.id}`, {
15167
15169
  sessionContextGroupId: this.id,
15168
15170
  type
@@ -15175,7 +15177,7 @@ class SessionContextGroupClient extends base_1$5.Base {
15175
15177
  if (typeof contextHandler !== 'function') {
15176
15178
  throw new Error("Non-function argument passed to the first parameter 'handler'. Be aware that the argument order does not match the FDC3 standard.");
15177
15179
  }
15178
- const client = await __classPrivateFieldGet$5(this, _SessionContextGroupClient_clientPromise, "f");
15180
+ const client = await __classPrivateFieldGet$6(this, _SessionContextGroupClient_clientPromise, "f");
15179
15181
  let handlerId;
15180
15182
  if (contextType) {
15181
15183
  handlerId = `sessionContextHandler:invoke-${this.id}-${contextType}-${(0, utils_1$6.generateId)()}`;
@@ -15188,7 +15190,7 @@ class SessionContextGroupClient extends base_1$5.Base {
15188
15190
  return { unsubscribe: await this.createUnsubscribeCb(handlerId) };
15189
15191
  }
15190
15192
  async createUnsubscribeCb(handlerId) {
15191
- const client = await __classPrivateFieldGet$5(this, _SessionContextGroupClient_clientPromise, "f");
15193
+ const client = await __classPrivateFieldGet$6(this, _SessionContextGroupClient_clientPromise, "f");
15192
15194
  return async () => {
15193
15195
  client.remove(handlerId);
15194
15196
  await client.dispatch(`sessionContextGroup:handlerRemoved-${this.id}`, { handlerId });
@@ -15206,6 +15208,139 @@ class SessionContextGroupClient extends base_1$5.Base {
15206
15208
  SessionContextGroupClient$1.default = SessionContextGroupClient;
15207
15209
  _SessionContextGroupClient_clientPromise = new WeakMap();
15208
15210
 
15211
+ var channelEvents = {};
15212
+
15213
+ var __classPrivateFieldSet$5 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
15214
+ if (kind === "m") throw new TypeError("Private method is not writable");
15215
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
15216
+ 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");
15217
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
15218
+ };
15219
+ var __classPrivateFieldGet$5 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
15220
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
15221
+ 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");
15222
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
15223
+ };
15224
+ var _a, _ChannelEvents_channelClient, _ChannelEvents_isChannelReady, _ChannelEvents_actionsByClient, _ChannelEvents_getActions, _ChannelEvents_createRegistration, _ChannelEvents_getRegistration, _ChannelEvents_getOrCreateRegistration;
15225
+ Object.defineProperty(channelEvents, "__esModule", { value: true });
15226
+ channelEvents.ChannelEvents = void 0;
15227
+ /**
15228
+ * Channel events creates a event like syntax out of a channel action, allowing multiple events to be triggered
15229
+ * from a single action (normally only one callback can be created per action).
15230
+ *
15231
+ * This Class essentially allows us to multiplex channel actions to multiple callbacks.
15232
+ */
15233
+ class ChannelEvents {
15234
+ constructor(channelClient) {
15235
+ // eslint-disable-next-line
15236
+ _ChannelEvents_channelClient.set(this, void 0);
15237
+ _ChannelEvents_isChannelReady.set(this, false);
15238
+ _ChannelEvents_getActions.set(this, async () => {
15239
+ const channelClient = await __classPrivateFieldGet$5(this, _ChannelEvents_channelClient, "f");
15240
+ let actions = __classPrivateFieldGet$5(ChannelEvents, _a, "f", _ChannelEvents_actionsByClient).get(channelClient);
15241
+ if (!actions) {
15242
+ actions = {};
15243
+ __classPrivateFieldGet$5(ChannelEvents, _a, "f", _ChannelEvents_actionsByClient).set(channelClient, actions);
15244
+ }
15245
+ return actions;
15246
+ });
15247
+ _ChannelEvents_createRegistration.set(this, (actionId) => {
15248
+ const callbacks = [];
15249
+ let registrationPromise;
15250
+ const onChannelAction = (data) => {
15251
+ callbacks.forEach((callback) => callback(data));
15252
+ };
15253
+ return {
15254
+ callbacks,
15255
+ dispose: async (callback) => {
15256
+ const index = callbacks.indexOf(callback);
15257
+ if (index >= 0) {
15258
+ callbacks.splice(index, 1);
15259
+ if (callbacks.length === 0) {
15260
+ const client = await __classPrivateFieldGet$5(this, _ChannelEvents_channelClient, "f");
15261
+ client.remove(actionId);
15262
+ }
15263
+ }
15264
+ },
15265
+ waitForRegistration: async () => {
15266
+ // Use lazy eval to only setup and register the channel on first attempt.
15267
+ if (!registrationPromise) {
15268
+ registrationPromise = (async () => {
15269
+ const client = await __classPrivateFieldGet$5(this, _ChannelEvents_channelClient, "f");
15270
+ await client.register(actionId, onChannelAction);
15271
+ })();
15272
+ }
15273
+ await registrationPromise;
15274
+ }
15275
+ };
15276
+ });
15277
+ _ChannelEvents_getRegistration.set(this, async (actionId) => {
15278
+ const actions = await __classPrivateFieldGet$5(this, _ChannelEvents_getActions, "f").call(this);
15279
+ return actions[actionId];
15280
+ });
15281
+ _ChannelEvents_getOrCreateRegistration.set(this, async (actionId) => {
15282
+ const actions = await __classPrivateFieldGet$5(this, _ChannelEvents_getActions, "f").call(this);
15283
+ const registration = await __classPrivateFieldGet$5(this, _ChannelEvents_getRegistration, "f").call(this, actionId);
15284
+ if (!registration) {
15285
+ actions[actionId] = __classPrivateFieldGet$5(this, _ChannelEvents_createRegistration, "f").call(this, actionId);
15286
+ }
15287
+ return actions[actionId];
15288
+ });
15289
+ /**
15290
+ * Add a listener for the given channel action.
15291
+ *
15292
+ * 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.
15293
+ *
15294
+ * Note, only void channel actions are currently supported.
15295
+ *
15296
+ * @param action Action ID, must match the underlying channel action.
15297
+ * @param callback Callback to be called whenever the action is dispatched.
15298
+ */
15299
+ this.addListener = async (action, callback) => {
15300
+ const event = await __classPrivateFieldGet$5(this, _ChannelEvents_getOrCreateRegistration, "f").call(this, action);
15301
+ event.callbacks.push(callback);
15302
+ // This ensures we only resolve the subscription once the action is registered
15303
+ await event.waitForRegistration();
15304
+ };
15305
+ /**
15306
+ * Removes a callback associated with a given action if it exists.
15307
+ *
15308
+ * If this callback is the last one associated with the specified action, the underlying channel action registration is
15309
+ * also removed.
15310
+ * @param action Action ID to remove
15311
+ * @param callback Callback to remove.
15312
+ */
15313
+ this.removeListener = async (action, callback) => {
15314
+ if (!__classPrivateFieldGet$5(this, _ChannelEvents_isChannelReady, "f")) {
15315
+ return;
15316
+ }
15317
+ const registration = await __classPrivateFieldGet$5(this, _ChannelEvents_getRegistration, "f").call(this, action);
15318
+ if (registration) {
15319
+ const event = await __classPrivateFieldGet$5(this, _ChannelEvents_getOrCreateRegistration, "f").call(this, action);
15320
+ await event.dispose(callback);
15321
+ }
15322
+ };
15323
+ __classPrivateFieldSet$5(this, _ChannelEvents_channelClient, channelClient, "f");
15324
+ Promise.resolve(channelClient)
15325
+ .then(() => {
15326
+ __classPrivateFieldSet$5(this, _ChannelEvents_isChannelReady, true, "f");
15327
+ })
15328
+ .catch(() => {
15329
+ // eslint-disable-next-line
15330
+ console.warn('Channel Connection error occurred in channel client. Channel-events registrations will fail.');
15331
+ });
15332
+ }
15333
+ }
15334
+ channelEvents.ChannelEvents = ChannelEvents;
15335
+ _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();
15336
+ /**
15337
+ * Static map of actions by channel client. This ensures we can reuse the same event and keep track of all its callbacks.
15338
+ *
15339
+ * Weak map will also ensure that when a channel is GC'ed we also tear down the actions/callbacks associated
15340
+ * with it.
15341
+ */
15342
+ _ChannelEvents_actionsByClient = { value: new WeakMap() };
15343
+
15209
15344
  var __classPrivateFieldSet$4 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
15210
15345
  if (kind === "m") throw new TypeError("Private method is not writable");
15211
15346
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
@@ -15220,12 +15355,13 @@ var __classPrivateFieldGet$4 = (commonjsGlobal && commonjsGlobal.__classPrivateF
15220
15355
  var __importDefault$4 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
15221
15356
  return (mod && mod.__esModule) ? mod : { "default": mod };
15222
15357
  };
15223
- var _InteropClient_clientPromise, _InteropClient_sessionContextGroups, _InteropClient_fdc3Factory;
15358
+ var _InteropClient_clientPromise, _InteropClient_sessionContextGroups, _InteropClient_fdc3Factory, _InteropClient_channelEvents;
15224
15359
  Object.defineProperty(InteropClient$1, "__esModule", { value: true });
15225
15360
  InteropClient$1.InteropClient = void 0;
15226
15361
  const base_1$4 = base;
15227
15362
  const SessionContextGroupClient_1 = __importDefault$4(SessionContextGroupClient$1);
15228
15363
  const utils_1$5 = utils$3;
15364
+ const channel_events_1 = channelEvents;
15229
15365
  /**
15230
15366
  * The Interop Client API is broken up into two groups:
15231
15367
  *
@@ -15284,13 +15420,43 @@ class InteropClient extends base_1$4.Base {
15284
15420
  _InteropClient_clientPromise.set(this, void 0);
15285
15421
  _InteropClient_sessionContextGroups.set(this, void 0);
15286
15422
  _InteropClient_fdc3Factory.set(this, void 0);
15423
+ _InteropClient_channelEvents.set(this, void 0);
15424
+ /*
15425
+ Client APIs
15426
+ */
15427
+ /**
15428
+ * `addListener` allows the InteropClient to subscribe to events emitted by the connected InteropBroker.
15429
+ * @param type The event type to subscribe to.
15430
+ * @param listener Callback invoked whenever the event occurs.
15431
+ * @returns Promise resolving with void once the listener is registered.
15432
+ */
15433
+ this.addListener = async (type, listener) => {
15434
+ try {
15435
+ await __classPrivateFieldGet$4(this, _InteropClient_channelEvents, "f").addListener(type, listener);
15436
+ }
15437
+ catch (error) {
15438
+ throw new Error(`An unexpected error occurred when adding a listener to the event ${type}. \n${error.stack}.`);
15439
+ }
15440
+ };
15441
+ /**
15442
+ * `removeListener` removes a registered event listener.
15443
+ * @param type The event type to subscribe to.
15444
+ * @param listener Callback to be removed.
15445
+ * @returns Promise resolving with void even if no callback was found.
15446
+ */
15447
+ this.removeListener = async (type, listener) => {
15448
+ try {
15449
+ await __classPrivateFieldGet$4(this, _InteropClient_channelEvents, "f").removeListener(type, listener);
15450
+ }
15451
+ catch (error) {
15452
+ throw new Error(`An unexpected error occurred when removing a listener for the event ${type}. \n${error.stack}.`);
15453
+ }
15454
+ };
15287
15455
  __classPrivateFieldSet$4(this, _InteropClient_sessionContextGroups, new Map(), "f");
15288
15456
  __classPrivateFieldSet$4(this, _InteropClient_clientPromise, clientPromise, "f");
15289
15457
  __classPrivateFieldSet$4(this, _InteropClient_fdc3Factory, fdc3Factory, "f");
15458
+ __classPrivateFieldSet$4(this, _InteropClient_channelEvents, new channel_events_1.ChannelEvents(clientPromise), "f");
15290
15459
  }
15291
- /*
15292
- Client APIs
15293
- */
15294
15460
  /**
15295
15461
  * Sets a context for the context group of the current entity.
15296
15462
  *
@@ -15804,7 +15970,7 @@ class InteropClient extends base_1$4.Base {
15804
15970
  }
15805
15971
  }
15806
15972
  InteropClient$1.InteropClient = InteropClient;
15807
- _InteropClient_clientPromise = new WeakMap(), _InteropClient_sessionContextGroups = new WeakMap(), _InteropClient_fdc3Factory = new WeakMap();
15973
+ _InteropClient_clientPromise = new WeakMap(), _InteropClient_sessionContextGroups = new WeakMap(), _InteropClient_fdc3Factory = new WeakMap(), _InteropClient_channelEvents = new WeakMap();
15808
15974
 
15809
15975
  var overrideCheck$1 = {};
15810
15976
 
@@ -17684,7 +17850,7 @@ const events_1$3 = require$$0;
17684
17850
  // Import from the file rather than the directory in case someone consuming types is using module resolution other than "node"
17685
17851
  const index_1 = system;
17686
17852
  const index_2 = requireWindow();
17687
- const index_3 = requireApplication();
17853
+ const index_3 = application;
17688
17854
  const index_4 = interappbus;
17689
17855
  const index_5 = clipboard;
17690
17856
  const index_6 = externalApplication;