@microsoft/teams-js 2.17.0 → 2.17.1-beta.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.
@@ -871,7 +871,7 @@ __webpack_require__.d(__webpack_exports__, {
871
871
  registerFocusEnterHandler: () => (/* reexport */ registerFocusEnterHandler),
872
872
  registerFullScreenHandler: () => (/* reexport */ registerFullScreenHandler),
873
873
  registerOnLoadHandler: () => (/* reexport */ registerOnLoadHandler),
874
- registerOnThemeChangeHandler: () => (/* reexport */ registerOnThemeChangeHandler),
874
+ registerOnThemeChangeHandler: () => (/* reexport */ publicAPIs_registerOnThemeChangeHandler),
875
875
  registerUserSettingsChangeHandler: () => (/* reexport */ registerUserSettingsChangeHandler),
876
876
  remoteCamera: () => (/* reexport */ remoteCamera),
877
877
  returnFocus: () => (/* reexport */ returnFocus),
@@ -895,6 +895,140 @@ __webpack_require__.d(__webpack_exports__, {
895
895
  webStorage: () => (/* reexport */ webStorage)
896
896
  });
897
897
 
898
+ // EXTERNAL MODULE: ../../node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/browser.js
899
+ var browser = __webpack_require__(302);
900
+ ;// CONCATENATED MODULE: ./src/internal/telemetry.ts
901
+
902
+ var topLevelLogger = (0,browser.debug)('teamsJs');
903
+ /**
904
+ * @internal
905
+ * Limited to Microsoft-internal use
906
+ *
907
+ * Returns a logger for a given namespace, within the pre-defined top-level teamsJs namespace
908
+ */
909
+ function getLogger(namespace) {
910
+ return topLevelLogger.extend(namespace);
911
+ }
912
+ /**
913
+ * @hidden
914
+ * Creates a string tag for labeling apiVersionTag, which is used for API function call to create message request
915
+ * sent to host(s).
916
+ *
917
+ * @internal
918
+ * Limited to Microsoft-internal use
919
+ */
920
+ function getApiVersionTag(apiVersionNumber, functionName) {
921
+ return "".concat(apiVersionNumber, "_").concat(functionName);
922
+ }
923
+ /**
924
+ * @hidden
925
+ * Check if apiVersionTag developer sends follows the pattern starting with a lowercase 'v', then
926
+ * followed by one or more digits, then concatenated with underscore and some characters to indicate api name.
927
+ * For example, 'v2_app.getContext'. If yes, return true. Otherwise, return false.
928
+ *
929
+ * @internal
930
+ * Limited to Microsoft-internal use
931
+ */
932
+ function isFollowingApiVersionTagFormat(apiVersionTag) {
933
+ var pattern = /^v\d+_[\w.]+$/;
934
+ return pattern.test(apiVersionTag);
935
+ }
936
+ /**
937
+ * Use enum to set or update API version number
938
+ * Note: V_0 = 'v0' is used for APIs who needs to be passed with correct version number
939
+ * but haven't been implemented yet.
940
+ * @internal
941
+ * Limited to Microsoft-internal use
942
+ */
943
+ var ApiVersionNumber;
944
+ (function (ApiVersionNumber) {
945
+ ApiVersionNumber["V_0"] = "v0";
946
+ ApiVersionNumber["V_1"] = "v1";
947
+ ApiVersionNumber["V_2"] = "v2";
948
+ ApiVersionNumber["V_3"] = "v3";
949
+ })(ApiVersionNumber || (ApiVersionNumber = {}));
950
+ var ApiName;
951
+ (function (ApiName) {
952
+ ApiName["App_GetContext"] = "app.getContext";
953
+ ApiName["App_Initialize"] = "app.initialize";
954
+ ApiName["App_NotifyAppLoaded"] = "app.notifyAppLoaded";
955
+ ApiName["App_NotifyExpectedFailure"] = "app.notifyExpectedFailure";
956
+ ApiName["App_NotifyFailure"] = "app.notifyFailure";
957
+ ApiName["App_NotifySuccess"] = "app.notifySuccess";
958
+ ApiName["App_OpenLink"] = "app.openLink";
959
+ ApiName["App_RegisterOnThemeChangeHandler"] = "app.registerOnThemeChangeHandler";
960
+ ApiName["AppEntity_SelectAppEntity"] = "appEntity.selectAppEntity";
961
+ ApiName["Dialog_AdaptiveCard_Bot_Open"] = "dialog.adaptiveCard.bot.open";
962
+ ApiName["Dialog_AdaptiveCard_Open"] = "dialog.adaptiveCard.open";
963
+ ApiName["Dialog_Update_Resize"] = "dialog.update.resize";
964
+ ApiName["Dialog_Url_Bot_Open"] = "dialog.url.bot.open";
965
+ ApiName["Dialog_Url_Open"] = "dialog.url.open";
966
+ ApiName["Dialog_Url_Submit"] = "dialog.url.submit";
967
+ ApiName["Dialog_Url_SendMessageToParentFromDialog"] = "dialog.url.sendMessageToParentFromDialog";
968
+ ApiName["Dialog_Url_SendMessageToDialog"] = "dialog.url.sendMessageToDialog";
969
+ ApiName["GeoLocation_GetCurrentLocation"] = "geoLocation.getCurrentLocation";
970
+ ApiName["GeoLocation_HasPermission"] = "geoLocation.hasPermission";
971
+ ApiName["GeoLocation_Map_ChooseLocation"] = "geoLocation.map.chooseLocation";
972
+ ApiName["GeoLocation_RequestPermission"] = "geoLocation.hasPermission";
973
+ ApiName["GeoLocation_ShowLocation"] = "geoLocation.showLocation";
974
+ ApiName["Location_GetLocation"] = "location.getLocation";
975
+ ApiName["Location_ShowLocation"] = "location.showLocation";
976
+ ApiName["Navigation_NavigateBack"] = "navigation.navigateBack";
977
+ ApiName["Navigation_NavigateCrossDomain"] = "navigation.navigateCrossDomain";
978
+ ApiName["Navigation_NavigateToTab"] = "navigation.navigateToTab";
979
+ ApiName["Navigation_ReturnFocus"] = "navigation.returnFocus";
980
+ ApiName["Pages_AppButton_OnClick"] = "pages.appButton.onClick";
981
+ ApiName["Pages_AppButton_OnHoverEnter"] = "pages.appButton.onHoverEnter";
982
+ ApiName["Pages_AppButton_OnHoverLeave"] = "pages.appButton.onHoverLeave";
983
+ ApiName["Pages_BackStack_NavigateBack"] = "pages.backStack.navigateBack";
984
+ ApiName["Pages_BackStack_RegisterBackButtonHandler"] = "pages.backStack.registerBackButtonHandler";
985
+ ApiName["Pages_Config_RegisterChangeConfigHandler"] = "pages.config.registerChangeConfigHandler";
986
+ ApiName["Pages_Config_RegisterOnRemoveHandlerHelper"] = "pages.config.registerOnRemoveHandlerHelper";
987
+ ApiName["Pages_Config_RegisterOnSaveHandlerHelper"] = "pages.config.registerOnSaveHandlerHelper";
988
+ ApiName["Pages_Config_SetConfig"] = "pages.config.setConfig";
989
+ ApiName["Pages_Config_SetValidityState"] = "pages.config.setValidityState";
990
+ ApiName["Pages_CurrentApp_NavigateTo"] = "pages.currentApp.navigateTo";
991
+ ApiName["Pages_CurrentApp_NavigateToDefaultPage"] = "pages.currentApp.navigateToDefaultPage";
992
+ ApiName["Pages_FullTrust_EnterFullscreen"] = "pages.fullTrust.enterFullscreen";
993
+ ApiName["Pages_FullTrust_ExitFullscreen"] = "pages.fullTrust.exitFullscreen";
994
+ ApiName["Pages_GetConfig"] = "pages.getConfig.";
995
+ ApiName["Pages_NavigateCrossDomain"] = "pages.navigateCrossDomain";
996
+ ApiName["Pages_NavigateToApp"] = "pages.navigateToApp";
997
+ ApiName["Pages_RegisterFocusEnterHandler"] = "pages.registerFocusEnterHandler";
998
+ ApiName["Pages_RegisterFullScreenHandler"] = "pages.registerFullScreenHandler";
999
+ ApiName["Pages_ReturnFocus"] = "pages.returnFocus";
1000
+ ApiName["Pages_SetCurrentFrame"] = "pages.setCurrentFrame";
1001
+ ApiName["Pages_ShareDeepLink"] = "pages.shareDeepLink";
1002
+ ApiName["Pages_Tabs_GetMruTabInstances"] = "pages.tabs.getMruTabInstances";
1003
+ ApiName["Pages_Tabs_GetTabInstances"] = "pages.tabs.getTabInstances";
1004
+ ApiName["Pages_Tabs_NavigateToTab"] = "pages.tabs.navigateToTab";
1005
+ ApiName["PublicAPIs_ExecuteDeepLink"] = "executeDeepLink";
1006
+ ApiName["PublicAPIs_GetContext"] = "getContext";
1007
+ ApiName["PublicAPIs_GetMruTabInstances"] = "getMruTabInstances";
1008
+ ApiName["PublicAPIs_GetTabInstances"] = "getTabInstances";
1009
+ ApiName["PublicAPIs_Initialize"] = "initialize";
1010
+ ApiName["PublicAPIs_RegisterAppButtonClickHandler"] = "registerAppButtonClickHandler";
1011
+ ApiName["PublicAPIs_RegisterAppButtonHoverEnterHandler"] = "registerAppButtonHoverEnterHandler";
1012
+ ApiName["PublicAPIs_RegisterAppButtonHoverLeaveHandler"] = "registerAppButtonHoverLeaveHandler";
1013
+ ApiName["PublicAPIs_RegisterBackButtonHandler"] = "registerBackButtonHandler";
1014
+ ApiName["PublicAPIs_RegisterChangeSettingsHandler"] = "registerChangeSettingsHandler";
1015
+ ApiName["PublicAPIs_RegisterFocusEnterHandler"] = "registerFocusEnterHandler";
1016
+ ApiName["PublicAPIs_RegisterFullScreenHandler"] = "registerFullScreenHandler";
1017
+ ApiName["PublicAPIs_RegisterOnLoadHandler"] = "registerOnLoadHandler";
1018
+ ApiName["PublicAPIs_RegisterOnThemeChangeHandlerHelper"] = "registerOnThemeChangeHandlerHelper";
1019
+ ApiName["PublicAPIs_SetFrameContext"] = "setFrameContext";
1020
+ ApiName["PublicAPIs_ShareDeepLink"] = "shareDeepLink";
1021
+ ApiName["RegisterHandler"] = "registerHandler";
1022
+ ApiName["RegisterOnThemeChangeHandler"] = "registerOnThemeChangeHandler";
1023
+ ApiName["Settings_Remove_Failure"] = "settings.remove.failure";
1024
+ ApiName["Settings_Remove_Success"] = "settings.remove.success";
1025
+ ApiName["Settings_Save_Failure"] = "settings.save.failure";
1026
+ ApiName["Settings_Save_Success"] = "settings.save.success";
1027
+ ApiName["Tasks_StartTask"] = "tasks.startTask";
1028
+ ApiName["Tasks_SubmitTask"] = "tasks.submitTask";
1029
+ ApiName["Tasks_UpdateTask"] = "tasks.updateTask";
1030
+ })(ApiName || (ApiName = {}));
1031
+
898
1032
  ;// CONCATENATED MODULE: ./src/internal/constants.ts
899
1033
  /**
900
1034
  * @hidden
@@ -1077,27 +1211,15 @@ var GlobalVars = /** @class */ (function () {
1077
1211
  GlobalVars.initializeCalled = false;
1078
1212
  GlobalVars.initializeCompleted = false;
1079
1213
  GlobalVars.additionalValidOrigins = [];
1214
+ GlobalVars.initializePromise = undefined;
1080
1215
  GlobalVars.isFramelessWindow = false;
1216
+ GlobalVars.frameContext = undefined;
1217
+ GlobalVars.hostClientType = undefined;
1081
1218
  GlobalVars.printCapabilityEnabled = false;
1082
1219
  return GlobalVars;
1083
1220
  }());
1084
1221
 
1085
1222
 
1086
- // EXTERNAL MODULE: ../../node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/browser.js
1087
- var browser = __webpack_require__(302);
1088
- ;// CONCATENATED MODULE: ./src/internal/telemetry.ts
1089
-
1090
- var topLevelLogger = (0,browser.debug)('teamsJs');
1091
- /**
1092
- * @internal
1093
- * Limited to Microsoft-internal use
1094
- *
1095
- * Returns a logger for a given namespace, within the pre-defined top-level teamsJs namespace
1096
- */
1097
- function getLogger(namespace) {
1098
- return topLevelLogger.extend(namespace);
1099
- }
1100
-
1101
1223
  ;// CONCATENATED MODULE: ../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-browser/native.js
1102
1224
  const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
1103
1225
  /* harmony default export */ const esm_browser_native = ({
@@ -2001,7 +2123,7 @@ function isRuntimeInitialized(runtime) {
2001
2123
  throw new Error(errorRuntimeNotSupported);
2002
2124
  }
2003
2125
  }
2004
- var runtime = _uninitializedRuntime;
2126
+ var runtime_runtime = _uninitializedRuntime;
2005
2127
  var versionAndPlatformAgnosticTeamsRuntimeConfig = {
2006
2128
  apiVersion: 3,
2007
2129
  hostVersionsInfo: teamsMinAdaptiveCardVersion,
@@ -2224,7 +2346,8 @@ function generateVersionBasedTeamsRuntimeConfig(highestSupportedVersion, version
2224
2346
  Object.keys(mapVersionToSupportedCapabilities).forEach(function (versionNumber) {
2225
2347
  if (compareSDKVersions(highestSupportedVersion, versionNumber) >= 0) {
2226
2348
  mapVersionToSupportedCapabilities[versionNumber].forEach(function (capabilityReqs) {
2227
- if (capabilityReqs.hostClientTypes.includes(GlobalVars.hostClientType)) {
2349
+ if (GlobalVars.hostClientType !== undefined &&
2350
+ capabilityReqs.hostClientTypes.includes(GlobalVars.hostClientType)) {
2228
2351
  newSupports = mergeRuntimeCapabilities(newSupports, capabilityReqs.capability);
2229
2352
  }
2230
2353
  });
@@ -2249,10 +2372,10 @@ function applyRuntimeConfig(runtimeConfig) {
2249
2372
  applyRuntimeConfigLogger('Fast-forwarding runtime %o', runtimeConfig);
2250
2373
  var ffRuntimeConfig = fastForwardRuntime(runtimeConfig);
2251
2374
  applyRuntimeConfigLogger('Applying runtime %o', ffRuntimeConfig);
2252
- runtime = utils_deepFreeze(ffRuntimeConfig);
2375
+ runtime_runtime = utils_deepFreeze(ffRuntimeConfig);
2253
2376
  }
2254
2377
  function setUnitializedRuntime() {
2255
- runtime = deepFreeze(_uninitializedRuntime);
2378
+ runtime_runtime = deepFreeze(_uninitializedRuntime);
2256
2379
  }
2257
2380
  /**
2258
2381
  * @hidden
@@ -2282,7 +2405,7 @@ var _minRuntimeConfigToUninitialize = {
2282
2405
  * @hidden
2283
2406
  * Package version.
2284
2407
  */
2285
- var version = "2.17.0";
2408
+ var version = "2.17.1-beta.1";
2286
2409
 
2287
2410
  ;// CONCATENATED MODULE: ./src/internal/internalAPIs.ts
2288
2411
 
@@ -2321,7 +2444,7 @@ function ensureInitializeCalled() {
2321
2444
  * @internal
2322
2445
  * Limited to Microsoft-internal use
2323
2446
  */
2324
- function ensureInitialized(runtime) {
2447
+ function internalAPIs_ensureInitialized(runtime) {
2325
2448
  var expectedFrameContexts = [];
2326
2449
  for (var _i = 1; _i < arguments.length; _i++) {
2327
2450
  expectedFrameContexts[_i - 1] = arguments[_i];
@@ -2472,7 +2595,7 @@ var authentication;
2472
2595
  if (!authenticateParams) {
2473
2596
  throw new Error('No parameters are provided for authentication');
2474
2597
  }
2475
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.remove, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
2598
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.remove, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
2476
2599
  return authenticateHelper(authenticateParams)
2477
2600
  .then(function (value) {
2478
2601
  try {
@@ -2484,7 +2607,7 @@ var authentication;
2484
2607
  }
2485
2608
  finally {
2486
2609
  if (!isDifferentParamsInCall) {
2487
- authParams = null;
2610
+ authParams = undefined;
2488
2611
  }
2489
2612
  }
2490
2613
  })
@@ -2498,7 +2621,7 @@ var authentication;
2498
2621
  }
2499
2622
  finally {
2500
2623
  if (!isDifferentParamsInCall) {
2501
- authParams = null;
2624
+ authParams = undefined;
2502
2625
  }
2503
2626
  }
2504
2627
  });
@@ -2726,7 +2849,7 @@ var authentication;
2726
2849
  */
2727
2850
  function notifySuccess(result, callbackUrl) {
2728
2851
  redirectIfWin32Outlook(callbackUrl, 'result', result);
2729
- ensureInitialized(runtime, FrameContexts.authentication);
2852
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.authentication);
2730
2853
  sendMessageToParent('authentication.authenticate.success', [result]);
2731
2854
  // Wait for the message to be sent before closing the window
2732
2855
  waitForMessageQueue(Communication.parentWindow, function () { return setTimeout(function () { return Communication.currentWindow.close(); }, 200); });
@@ -2749,7 +2872,7 @@ var authentication;
2749
2872
  */
2750
2873
  function notifyFailure(reason, callbackUrl) {
2751
2874
  redirectIfWin32Outlook(callbackUrl, 'reason', reason);
2752
- ensureInitialized(runtime, FrameContexts.authentication);
2875
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.authentication);
2753
2876
  sendMessageToParent('authentication.authenticate.failure', [reason]);
2754
2877
  // Wait for the message to be sent before closing the window
2755
2878
  waitForMessageQueue(Communication.parentWindow, function () { return setTimeout(function () { return Communication.currentWindow.close(); }, 200); });
@@ -2762,7 +2885,7 @@ var authentication;
2762
2885
  }
2763
2886
  }
2764
2887
  finally {
2765
- authHandlers = null;
2888
+ authHandlers = undefined;
2766
2889
  closeAuthenticationWindow();
2767
2890
  }
2768
2891
  }
@@ -2773,7 +2896,7 @@ var authentication;
2773
2896
  }
2774
2897
  }
2775
2898
  finally {
2776
- authHandlers = null;
2899
+ authHandlers = undefined;
2777
2900
  closeAuthenticationWindow();
2778
2901
  }
2779
2902
  }
@@ -2854,6 +2977,60 @@ var authentication;
2854
2977
 
2855
2978
 
2856
2979
 
2980
+
2981
+ /**
2982
+ * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY
2983
+ */
2984
+ var dialogTelemetryVersionNumber = ApiVersionNumber.V_2;
2985
+ function updateResizeHelper(apiVersionTag, dimensions) {
2986
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.task, FrameContexts.meetingStage);
2987
+ if (!dialog.update.isSupported()) {
2988
+ throw errorNotSupportedOnPlatform;
2989
+ }
2990
+ communication_sendMessageToParentWithVersion(apiVersionTag, 'tasks.updateTask', [dimensions]);
2991
+ }
2992
+ function urlOpenHelper(apiVersionTag, urlDialogInfo, submitHandler, messageFromChildHandler) {
2993
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
2994
+ if (!dialog.url.isSupported()) {
2995
+ throw errorNotSupportedOnPlatform;
2996
+ }
2997
+ if (messageFromChildHandler) {
2998
+ registerHandler('messageForParent', messageFromChildHandler);
2999
+ }
3000
+ var dialogInfo = dialog.url.getDialogInfoFromUrlDialogInfo(urlDialogInfo);
3001
+ communication_sendMessageToParentWithVersion(apiVersionTag, 'tasks.startTask', [dialogInfo], function (err, result) {
3002
+ submitHandler === null || submitHandler === void 0 ? void 0 : submitHandler({ err: err, result: result });
3003
+ removeHandler('messageForParent');
3004
+ });
3005
+ }
3006
+ function botUrlOpenHelper(apiVersionTag, urlDialogInfo, submitHandler, messageFromChildHandler) {
3007
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
3008
+ if (!dialog.url.bot.isSupported()) {
3009
+ throw errorNotSupportedOnPlatform;
3010
+ }
3011
+ if (messageFromChildHandler) {
3012
+ registerHandler('messageForParent', messageFromChildHandler);
3013
+ }
3014
+ var dialogInfo = dialog.url.getDialogInfoFromBotUrlDialogInfo(urlDialogInfo);
3015
+ communication_sendMessageToParentWithVersion(apiVersionTag, 'tasks.startTask', [dialogInfo], function (err, result) {
3016
+ submitHandler === null || submitHandler === void 0 ? void 0 : submitHandler({ err: err, result: result });
3017
+ removeHandler('messageForParent');
3018
+ });
3019
+ }
3020
+ function urlSubmitHelper(apiVersionTag, result, appIds) {
3021
+ // FrameContext content should not be here because dialog.submit can be called only from inside of a dialog (FrameContext task)
3022
+ // but it's here because Teams mobile incorrectly returns FrameContext.content when calling app.getFrameContext().
3023
+ // FrameContexts.content will be removed once the bug is fixed.
3024
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
3025
+ if (!dialog.url.isSupported()) {
3026
+ throw errorNotSupportedOnPlatform;
3027
+ }
3028
+ // Send tasks.completeTask instead of tasks.submitTask message for backward compatibility with Mobile clients
3029
+ communication_sendMessageToParentWithVersion(apiVersionTag, 'tasks.completeTask', [
3030
+ result,
3031
+ appIds ? (Array.isArray(appIds) ? appIds : [appIds]) : [],
3032
+ ]);
3033
+ }
2857
3034
  /**
2858
3035
  * This group of capabilities enables apps to show modal dialogs. There are two primary types of dialogs: URL-based dialogs and [Adaptive Card](https://learn.microsoft.com/adaptive-cards/) dialogs.
2859
3036
  * Both types of dialogs are shown on top of your app, preventing interaction with your app while they are displayed.
@@ -2913,18 +3090,7 @@ var dialog;
2913
3090
  * @beta
2914
3091
  */
2915
3092
  function open(urlDialogInfo, submitHandler, messageFromChildHandler) {
2916
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
2917
- if (!isSupported()) {
2918
- throw errorNotSupportedOnPlatform;
2919
- }
2920
- if (messageFromChildHandler) {
2921
- registerHandler('messageForParent', messageFromChildHandler);
2922
- }
2923
- var dialogInfo = getDialogInfoFromUrlDialogInfo(urlDialogInfo);
2924
- sendMessageToParent('tasks.startTask', [dialogInfo], function (err, result) {
2925
- submitHandler === null || submitHandler === void 0 ? void 0 : submitHandler({ err: err, result: result });
2926
- removeHandler('messageForParent');
2927
- });
3093
+ urlOpenHelper(getApiVersionTag(dialogTelemetryVersionNumber, ApiName.Dialog_Url_Open), urlDialogInfo, submitHandler, messageFromChildHandler);
2928
3094
  }
2929
3095
  url.open = open;
2930
3096
  /**
@@ -2941,15 +3107,7 @@ var dialog;
2941
3107
  * @beta
2942
3108
  */
2943
3109
  function submit(result, appIds) {
2944
- // FrameContext content should not be here because dialog.submit can be called only from inside of a dialog (FrameContext task)
2945
- // but it's here because Teams mobile incorrectly returns FrameContext.content when calling app.getFrameContext().
2946
- // FrameContexts.content will be removed once the bug is fixed.
2947
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
2948
- if (!isSupported()) {
2949
- throw errorNotSupportedOnPlatform;
2950
- }
2951
- // Send tasks.completeTask instead of tasks.submitTask message for backward compatibility with Mobile clients
2952
- sendMessageToParent('tasks.completeTask', [result, appIds ? (Array.isArray(appIds) ? appIds : [appIds]) : []]);
3110
+ urlSubmitHelper(getApiVersionTag(dialogTelemetryVersionNumber, ApiName.Dialog_Url_Submit), result, appIds);
2953
3111
  }
2954
3112
  url.submit = submit;
2955
3113
  /**
@@ -2965,11 +3123,11 @@ var dialog;
2965
3123
  function sendMessageToParentFromDialog(
2966
3124
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2967
3125
  message) {
2968
- ensureInitialized(runtime, FrameContexts.task);
3126
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.task);
2969
3127
  if (!isSupported()) {
2970
3128
  throw errorNotSupportedOnPlatform;
2971
3129
  }
2972
- sendMessageToParent('messageForParent', [message]);
3130
+ communication_sendMessageToParentWithVersion(getApiVersionTag(dialogTelemetryVersionNumber, ApiName.Dialog_Url_SendMessageToParentFromDialog), 'messageForParent', [message]);
2973
3131
  }
2974
3132
  url.sendMessageToParentFromDialog = sendMessageToParentFromDialog;
2975
3133
  /**
@@ -2982,11 +3140,11 @@ var dialog;
2982
3140
  function sendMessageToDialog(
2983
3141
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2984
3142
  message) {
2985
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
3143
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
2986
3144
  if (!isSupported()) {
2987
3145
  throw errorNotSupportedOnPlatform;
2988
3146
  }
2989
- sendMessageToParent('messageForChild', [message]);
3147
+ communication_sendMessageToParentWithVersion(getApiVersionTag(dialogTelemetryVersionNumber, ApiName.Dialog_Url_SendMessageToDialog), 'messageForChild', [message]);
2990
3148
  }
2991
3149
  url.sendMessageToDialog = sendMessageToDialog;
2992
3150
  /**
@@ -3000,7 +3158,7 @@ var dialog;
3000
3158
  * @beta
3001
3159
  */
3002
3160
  function registerOnMessageFromParent(listener) {
3003
- ensureInitialized(runtime, FrameContexts.task);
3161
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.task);
3004
3162
  if (!isSupported()) {
3005
3163
  throw errorNotSupportedOnPlatform;
3006
3164
  }
@@ -3026,7 +3184,7 @@ var dialog;
3026
3184
  * @beta
3027
3185
  */
3028
3186
  function isSupported() {
3029
- return ensureInitialized(runtime) && (runtime.supports.dialog && runtime.supports.dialog.url) !== undefined;
3187
+ return internalAPIs_ensureInitialized(runtime_runtime) && (runtime_runtime.supports.dialog && runtime_runtime.supports.dialog.url) !== undefined;
3030
3188
  }
3031
3189
  url.isSupported = isSupported;
3032
3190
  /**
@@ -3048,18 +3206,7 @@ var dialog;
3048
3206
  * @beta
3049
3207
  */
3050
3208
  function open(botUrlDialogInfo, submitHandler, messageFromChildHandler) {
3051
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
3052
- if (!isSupported()) {
3053
- throw errorNotSupportedOnPlatform;
3054
- }
3055
- if (messageFromChildHandler) {
3056
- registerHandler('messageForParent', messageFromChildHandler);
3057
- }
3058
- var dialogInfo = getDialogInfoFromBotUrlDialogInfo(botUrlDialogInfo);
3059
- sendMessageToParent('tasks.startTask', [dialogInfo], function (err, result) {
3060
- submitHandler === null || submitHandler === void 0 ? void 0 : submitHandler({ err: err, result: result });
3061
- removeHandler('messageForParent');
3062
- });
3209
+ botUrlOpenHelper(getApiVersionTag(dialogTelemetryVersionNumber, ApiName.Dialog_Url_Bot_Open), botUrlDialogInfo, submitHandler, messageFromChildHandler);
3063
3210
  }
3064
3211
  bot.open = open;
3065
3212
  /**
@@ -3072,8 +3219,8 @@ var dialog;
3072
3219
  * @beta
3073
3220
  */
3074
3221
  function isSupported() {
3075
- return (ensureInitialized(runtime) &&
3076
- (runtime.supports.dialog && runtime.supports.dialog.url && runtime.supports.dialog.url.bot) !== undefined);
3222
+ return (internalAPIs_ensureInitialized(runtime_runtime) &&
3223
+ (runtime_runtime.supports.dialog && runtime_runtime.supports.dialog.url && runtime_runtime.supports.dialog.url.bot) !== undefined);
3077
3224
  }
3078
3225
  bot.isSupported = isSupported;
3079
3226
  })(bot = url.bot || (url.bot = {}));
@@ -3119,7 +3266,7 @@ var dialog;
3119
3266
  * @hidden
3120
3267
  */
3121
3268
  function isSupported() {
3122
- return ensureInitialized(runtime) && runtime.supports.dialog ? true : false;
3269
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.dialog ? true : false;
3123
3270
  }
3124
3271
  dialog.isSupported = isSupported;
3125
3272
  /**
@@ -3137,11 +3284,7 @@ var dialog;
3137
3284
  * @beta
3138
3285
  */
3139
3286
  function resize(dimensions) {
3140
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.task, FrameContexts.meetingStage);
3141
- if (!isSupported()) {
3142
- throw errorNotSupportedOnPlatform;
3143
- }
3144
- sendMessageToParent('tasks.updateTask', [dimensions]);
3287
+ updateResizeHelper(getApiVersionTag(dialogTelemetryVersionNumber, ApiName.Dialog_Update_Resize), dimensions);
3145
3288
  }
3146
3289
  update.resize = resize;
3147
3290
  /**
@@ -3153,8 +3296,8 @@ var dialog;
3153
3296
  * @beta
3154
3297
  */
3155
3298
  function isSupported() {
3156
- return ensureInitialized(runtime) && runtime.supports.dialog
3157
- ? runtime.supports.dialog.update
3299
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.dialog
3300
+ ? runtime_runtime.supports.dialog.update
3158
3301
  ? true
3159
3302
  : false
3160
3303
  : false;
@@ -3179,12 +3322,12 @@ var dialog;
3179
3322
  * @beta
3180
3323
  */
3181
3324
  function open(adaptiveCardDialogInfo, submitHandler) {
3182
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
3325
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
3183
3326
  if (!isSupported()) {
3184
3327
  throw errorNotSupportedOnPlatform;
3185
3328
  }
3186
3329
  var dialogInfo = getDialogInfoFromAdaptiveCardDialogInfo(adaptiveCardDialogInfo);
3187
- sendMessageToParent('tasks.startTask', [dialogInfo], function (err, result) {
3330
+ communication_sendMessageToParentWithVersion(getApiVersionTag(dialogTelemetryVersionNumber, ApiName.Dialog_AdaptiveCard_Open), 'tasks.startTask', [dialogInfo], function (err, result) {
3188
3331
  submitHandler === null || submitHandler === void 0 ? void 0 : submitHandler({ err: err, result: result });
3189
3332
  });
3190
3333
  }
@@ -3199,11 +3342,11 @@ var dialog;
3199
3342
  * @beta
3200
3343
  */
3201
3344
  function isSupported() {
3202
- var isAdaptiveCardVersionSupported = runtime.hostVersionsInfo &&
3203
- runtime.hostVersionsInfo.adaptiveCardSchemaVersion &&
3204
- !isHostAdaptiveCardSchemaVersionUnsupported(runtime.hostVersionsInfo.adaptiveCardSchemaVersion);
3205
- return (ensureInitialized(runtime) &&
3206
- (isAdaptiveCardVersionSupported && runtime.supports.dialog && runtime.supports.dialog.card) !== undefined);
3345
+ var isAdaptiveCardVersionSupported = runtime_runtime.hostVersionsInfo &&
3346
+ runtime_runtime.hostVersionsInfo.adaptiveCardSchemaVersion &&
3347
+ !isHostAdaptiveCardSchemaVersionUnsupported(runtime_runtime.hostVersionsInfo.adaptiveCardSchemaVersion);
3348
+ return (internalAPIs_ensureInitialized(runtime_runtime) &&
3349
+ (isAdaptiveCardVersionSupported && runtime_runtime.supports.dialog && runtime_runtime.supports.dialog.card) !== undefined);
3207
3350
  }
3208
3351
  adaptiveCard.isSupported = isSupported;
3209
3352
  /**
@@ -3222,12 +3365,12 @@ var dialog;
3222
3365
  * @beta
3223
3366
  */
3224
3367
  function open(botAdaptiveCardDialogInfo, submitHandler) {
3225
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
3368
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
3226
3369
  if (!isSupported()) {
3227
3370
  throw errorNotSupportedOnPlatform;
3228
3371
  }
3229
3372
  var dialogInfo = getDialogInfoFromBotAdaptiveCardDialogInfo(botAdaptiveCardDialogInfo);
3230
- sendMessageToParent('tasks.startTask', [dialogInfo], function (err, result) {
3373
+ communication_sendMessageToParentWithVersion(getApiVersionTag(dialogTelemetryVersionNumber, ApiName.Dialog_AdaptiveCard_Bot_Open), 'tasks.startTask', [dialogInfo], function (err, result) {
3231
3374
  submitHandler === null || submitHandler === void 0 ? void 0 : submitHandler({ err: err, result: result });
3232
3375
  });
3233
3376
  }
@@ -3242,14 +3385,14 @@ var dialog;
3242
3385
  * @beta
3243
3386
  */
3244
3387
  function isSupported() {
3245
- var isAdaptiveCardVersionSupported = runtime.hostVersionsInfo &&
3246
- runtime.hostVersionsInfo.adaptiveCardSchemaVersion &&
3247
- !isHostAdaptiveCardSchemaVersionUnsupported(runtime.hostVersionsInfo.adaptiveCardSchemaVersion);
3248
- return (ensureInitialized(runtime) &&
3388
+ var isAdaptiveCardVersionSupported = runtime_runtime.hostVersionsInfo &&
3389
+ runtime_runtime.hostVersionsInfo.adaptiveCardSchemaVersion &&
3390
+ !isHostAdaptiveCardSchemaVersionUnsupported(runtime_runtime.hostVersionsInfo.adaptiveCardSchemaVersion);
3391
+ return (internalAPIs_ensureInitialized(runtime_runtime) &&
3249
3392
  (isAdaptiveCardVersionSupported &&
3250
- runtime.supports.dialog &&
3251
- runtime.supports.dialog.card &&
3252
- runtime.supports.dialog.card.bot) !== undefined);
3393
+ runtime_runtime.supports.dialog &&
3394
+ runtime_runtime.supports.dialog.card &&
3395
+ runtime_runtime.supports.dialog.card.bot) !== undefined);
3253
3396
  }
3254
3397
  bot.isSupported = isSupported;
3255
3398
  })(bot = adaptiveCard.bot || (adaptiveCard.bot = {}));
@@ -3368,7 +3511,7 @@ var menus;
3368
3511
  * @param handler - The handler to invoke when the user selects view configuration.
3369
3512
  */
3370
3513
  function setUpViews(viewConfig, handler) {
3371
- ensureInitialized(runtime);
3514
+ internalAPIs_ensureInitialized(runtime_runtime);
3372
3515
  if (!isSupported()) {
3373
3516
  throw errorNotSupportedOnPlatform;
3374
3517
  }
@@ -3378,7 +3521,7 @@ var menus;
3378
3521
  menus.setUpViews = setUpViews;
3379
3522
  function handleViewConfigItemPress(id) {
3380
3523
  if (!viewConfigItemPressHandler || !viewConfigItemPressHandler(id)) {
3381
- ensureInitialized(runtime);
3524
+ internalAPIs_ensureInitialized(runtime_runtime);
3382
3525
  sendMessageToParent('viewConfigItemPress', [id]);
3383
3526
  }
3384
3527
  }
@@ -3390,7 +3533,7 @@ var menus;
3390
3533
  * @param handler The handler to invoke when the user selects menu item.
3391
3534
  */
3392
3535
  function setNavBarMenu(items, handler) {
3393
- ensureInitialized(runtime);
3536
+ internalAPIs_ensureInitialized(runtime_runtime);
3394
3537
  if (!isSupported()) {
3395
3538
  throw errorNotSupportedOnPlatform;
3396
3539
  }
@@ -3400,7 +3543,7 @@ var menus;
3400
3543
  menus.setNavBarMenu = setNavBarMenu;
3401
3544
  function handleNavBarMenuItemPress(id) {
3402
3545
  if (!navBarMenuItemPressHandler || !navBarMenuItemPressHandler(id)) {
3403
- ensureInitialized(runtime);
3546
+ internalAPIs_ensureInitialized(runtime_runtime);
3404
3547
  sendMessageToParent('handleNavBarMenuItemPress', [id]);
3405
3548
  }
3406
3549
  }
@@ -3412,7 +3555,7 @@ var menus;
3412
3555
  * @param handler - The handler to invoke when the user selects menu item.
3413
3556
  */
3414
3557
  function showActionMenu(params, handler) {
3415
- ensureInitialized(runtime);
3558
+ internalAPIs_ensureInitialized(runtime_runtime);
3416
3559
  if (!isSupported()) {
3417
3560
  throw errorNotSupportedOnPlatform;
3418
3561
  }
@@ -3422,7 +3565,7 @@ var menus;
3422
3565
  menus.showActionMenu = showActionMenu;
3423
3566
  function handleActionMenuItemPress(id) {
3424
3567
  if (!actionMenuItemPressHandler || !actionMenuItemPressHandler(id)) {
3425
- ensureInitialized(runtime);
3568
+ internalAPIs_ensureInitialized(runtime_runtime);
3426
3569
  sendMessageToParent('handleActionMenuItemPress', [id]);
3427
3570
  }
3428
3571
  }
@@ -3433,7 +3576,7 @@ var menus;
3433
3576
  * @throws Error if {@linkcode app.initialize} has not successfully completed
3434
3577
  */
3435
3578
  function isSupported() {
3436
- return ensureInitialized(runtime) && runtime.supports.menus ? true : false;
3579
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.menus ? true : false;
3437
3580
  }
3438
3581
  menus.isSupported = isSupported;
3439
3582
  })(menus || (menus = {}));
@@ -3456,6 +3599,125 @@ var menus;
3456
3599
 
3457
3600
 
3458
3601
 
3602
+
3603
+
3604
+ /**
3605
+ * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY
3606
+ */
3607
+ var appTelemetryVersionNumber = ApiVersionNumber.V_2;
3608
+ /**
3609
+ * Number of milliseconds we'll give the initialization call to return before timing it out
3610
+ */
3611
+ var initializationTimeoutInMs = 5000;
3612
+ var appLogger = getLogger('app');
3613
+ function appInitializeHelper(apiVersionTag, validMessageOrigins) {
3614
+ if (!inServerSideRenderingEnvironment()) {
3615
+ return runWithTimeout(function () { return initializeHelper(apiVersionTag, validMessageOrigins); }, initializationTimeoutInMs, new Error('SDK initialization timed out.'));
3616
+ }
3617
+ else {
3618
+ var initializeLogger = appLogger.extend('initialize');
3619
+ // This log statement should NEVER actually be written. This code path exists only to enable compilation in server-side rendering environments.
3620
+ // If you EVER see this statement in ANY log file, something has gone horribly wrong and a bug needs to be filed.
3621
+ initializeLogger('window object undefined at initialization');
3622
+ return Promise.resolve();
3623
+ }
3624
+ }
3625
+ var initializeHelperLogger = appLogger.extend('initializeHelper');
3626
+ function initializeHelper(apiVersionTag, validMessageOrigins) {
3627
+ return new Promise(function (resolve) {
3628
+ // Independent components might not know whether the SDK is initialized so might call it to be safe.
3629
+ // Just no-op if that happens to make it easier to use.
3630
+ if (!GlobalVars.initializeCalled) {
3631
+ GlobalVars.initializeCalled = true;
3632
+ initializeHandlers();
3633
+ GlobalVars.initializePromise = initializeCommunication(validMessageOrigins, apiVersionTag).then(function (_a) {
3634
+ var context = _a.context, clientType = _a.clientType, runtimeConfig = _a.runtimeConfig, _b = _a.clientSupportedSDKVersion, clientSupportedSDKVersion = _b === void 0 ? defaultSDKVersionForCompatCheck : _b;
3635
+ GlobalVars.frameContext = context;
3636
+ GlobalVars.hostClientType = clientType;
3637
+ GlobalVars.clientSupportedSDKVersion = clientSupportedSDKVersion;
3638
+ // Temporary workaround while the Host is updated with the new argument order.
3639
+ // For now, we might receive any of these possibilities:
3640
+ // - `runtimeConfig` in `runtimeConfig` and `clientSupportedSDKVersion` in `clientSupportedSDKVersion`.
3641
+ // - `runtimeConfig` in `clientSupportedSDKVersion` and `clientSupportedSDKVersion` in `runtimeConfig`.
3642
+ // - `clientSupportedSDKVersion` in `runtimeConfig` and no `clientSupportedSDKVersion`.
3643
+ // This code supports any of these possibilities
3644
+ // Teams AppHost won't provide this runtime config
3645
+ // so we assume that if we don't have it, we must be running in Teams.
3646
+ // After Teams updates its client code, we can remove this default code.
3647
+ try {
3648
+ initializeHelperLogger('Parsing %s', runtimeConfig);
3649
+ var givenRuntimeConfig = JSON.parse(runtimeConfig);
3650
+ initializeHelperLogger('Checking if %o is a valid runtime object', givenRuntimeConfig !== null && givenRuntimeConfig !== void 0 ? givenRuntimeConfig : 'null');
3651
+ // Check that givenRuntimeConfig is a valid instance of IBaseRuntime
3652
+ if (!givenRuntimeConfig || !givenRuntimeConfig.apiVersion) {
3653
+ throw new Error('Received runtime config is invalid');
3654
+ }
3655
+ runtimeConfig && applyRuntimeConfig(givenRuntimeConfig);
3656
+ }
3657
+ catch (e) {
3658
+ if (e instanceof SyntaxError) {
3659
+ try {
3660
+ initializeHelperLogger('Attempting to parse %s as an SDK version', runtimeConfig);
3661
+ // if the given runtime config was actually meant to be a SDK version, store it as such.
3662
+ // TODO: This is a temporary workaround to allow Teams to store clientSupportedSDKVersion even when
3663
+ // it doesn't provide the runtimeConfig. After Teams updates its client code, we should
3664
+ // remove this feature.
3665
+ if (!isNaN(compareSDKVersions(runtimeConfig, defaultSDKVersionForCompatCheck))) {
3666
+ GlobalVars.clientSupportedSDKVersion = runtimeConfig;
3667
+ }
3668
+ var givenRuntimeConfig = JSON.parse(clientSupportedSDKVersion);
3669
+ initializeHelperLogger('givenRuntimeConfig parsed to %o', givenRuntimeConfig !== null && givenRuntimeConfig !== void 0 ? givenRuntimeConfig : 'null');
3670
+ if (!givenRuntimeConfig) {
3671
+ throw new Error('givenRuntimeConfig string was successfully parsed. However, it parsed to value of null');
3672
+ }
3673
+ else {
3674
+ applyRuntimeConfig(givenRuntimeConfig);
3675
+ }
3676
+ }
3677
+ catch (e) {
3678
+ if (e instanceof SyntaxError) {
3679
+ applyRuntimeConfig(generateVersionBasedTeamsRuntimeConfig(GlobalVars.clientSupportedSDKVersion, versionAndPlatformAgnosticTeamsRuntimeConfig, mapTeamsVersionToSupportedCapabilities));
3680
+ }
3681
+ else {
3682
+ throw e;
3683
+ }
3684
+ }
3685
+ }
3686
+ else {
3687
+ // If it's any error that's not a JSON parsing error, we want the program to fail.
3688
+ throw e;
3689
+ }
3690
+ }
3691
+ GlobalVars.initializeCompleted = true;
3692
+ });
3693
+ authentication.initialize();
3694
+ menus.initialize();
3695
+ pages.config.initialize();
3696
+ dialog.initialize();
3697
+ }
3698
+ // Handle additional valid message origins if specified
3699
+ if (Array.isArray(validMessageOrigins)) {
3700
+ processAdditionalValidOrigins(validMessageOrigins);
3701
+ }
3702
+ if (GlobalVars.initializePromise !== undefined) {
3703
+ resolve(GlobalVars.initializePromise);
3704
+ }
3705
+ else {
3706
+ initializeHelperLogger('GlobalVars.initializePromise is unexpectedly undefined');
3707
+ }
3708
+ });
3709
+ }
3710
+ function registerOnThemeChangeHandlerHelper(apiVersionTag, handler) {
3711
+ // allow for registration cleanup even when not called initialize
3712
+ !isNullOrUndefined(handler) && ensureInitializeCalled();
3713
+ registerOnThemeChangeHandler(apiVersionTag, handler);
3714
+ }
3715
+ function openLinkHelper(apiVersionTag, deepLink) {
3716
+ return new Promise(function (resolve) {
3717
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
3718
+ resolve(sendAndHandleStatusAndReasonWithVersion(apiVersionTag, 'executeDeepLink', deepLink));
3719
+ });
3720
+ }
3459
3721
  /**
3460
3722
  * Namespace to interact with app initialization and lifecycle.
3461
3723
  */
@@ -3535,10 +3797,6 @@ var app;
3535
3797
  return GlobalVars.frameContext;
3536
3798
  }
3537
3799
  app.getFrameContext = getFrameContext;
3538
- /**
3539
- * Number of milliseconds we'll give the initialization call to return before timing it out
3540
- */
3541
- var initializationTimeoutInMs = 5000;
3542
3800
  function logWhereTeamsJsIsBeingUsed() {
3543
3801
  if (inServerSideRenderingEnvironment()) {
3544
3802
  return;
@@ -3568,98 +3826,9 @@ var app;
3568
3826
  * @returns Promise that will be fulfilled when initialization has completed, or rejected if the initialization fails or times out
3569
3827
  */
3570
3828
  function initialize(validMessageOrigins) {
3571
- if (!inServerSideRenderingEnvironment()) {
3572
- return runWithTimeout(function () { return initializeHelper(validMessageOrigins); }, initializationTimeoutInMs, new Error('SDK initialization timed out.'));
3573
- }
3574
- else {
3575
- var initializeLogger = appLogger.extend('initialize');
3576
- // This log statement should NEVER actually be written. This code path exists only to enable compilation in server-side rendering environments.
3577
- // If you EVER see this statement in ANY log file, something has gone horribly wrong and a bug needs to be filed.
3578
- initializeLogger('window object undefined at initialization');
3579
- return Promise.resolve();
3580
- }
3829
+ return appInitializeHelper(getApiVersionTag(appTelemetryVersionNumber, ApiName.App_Initialize), validMessageOrigins);
3581
3830
  }
3582
3831
  app.initialize = initialize;
3583
- var initializeHelperLogger = appLogger.extend('initializeHelper');
3584
- function initializeHelper(validMessageOrigins) {
3585
- return new Promise(function (resolve) {
3586
- // Independent components might not know whether the SDK is initialized so might call it to be safe.
3587
- // Just no-op if that happens to make it easier to use.
3588
- if (!GlobalVars.initializeCalled) {
3589
- GlobalVars.initializeCalled = true;
3590
- initializeHandlers();
3591
- GlobalVars.initializePromise = initializeCommunication(validMessageOrigins).then(function (_a) {
3592
- var context = _a.context, clientType = _a.clientType, runtimeConfig = _a.runtimeConfig, _b = _a.clientSupportedSDKVersion, clientSupportedSDKVersion = _b === void 0 ? defaultSDKVersionForCompatCheck : _b;
3593
- GlobalVars.frameContext = context;
3594
- GlobalVars.hostClientType = clientType;
3595
- GlobalVars.clientSupportedSDKVersion = clientSupportedSDKVersion;
3596
- // Temporary workaround while the Host is updated with the new argument order.
3597
- // For now, we might receive any of these possibilities:
3598
- // - `runtimeConfig` in `runtimeConfig` and `clientSupportedSDKVersion` in `clientSupportedSDKVersion`.
3599
- // - `runtimeConfig` in `clientSupportedSDKVersion` and `clientSupportedSDKVersion` in `runtimeConfig`.
3600
- // - `clientSupportedSDKVersion` in `runtimeConfig` and no `clientSupportedSDKVersion`.
3601
- // This code supports any of these possibilities
3602
- // Teams AppHost won't provide this runtime config
3603
- // so we assume that if we don't have it, we must be running in Teams.
3604
- // After Teams updates its client code, we can remove this default code.
3605
- try {
3606
- initializeHelperLogger('Parsing %s', runtimeConfig);
3607
- var givenRuntimeConfig = JSON.parse(runtimeConfig);
3608
- initializeHelperLogger('Checking if %o is a valid runtime object', givenRuntimeConfig !== null && givenRuntimeConfig !== void 0 ? givenRuntimeConfig : 'null');
3609
- // Check that givenRuntimeConfig is a valid instance of IBaseRuntime
3610
- if (!givenRuntimeConfig || !givenRuntimeConfig.apiVersion) {
3611
- throw new Error('Received runtime config is invalid');
3612
- }
3613
- runtimeConfig && applyRuntimeConfig(givenRuntimeConfig);
3614
- }
3615
- catch (e) {
3616
- if (e instanceof SyntaxError) {
3617
- try {
3618
- initializeHelperLogger('Attempting to parse %s as an SDK version', runtimeConfig);
3619
- // if the given runtime config was actually meant to be a SDK version, store it as such.
3620
- // TODO: This is a temporary workaround to allow Teams to store clientSupportedSDKVersion even when
3621
- // it doesn't provide the runtimeConfig. After Teams updates its client code, we should
3622
- // remove this feature.
3623
- if (!isNaN(compareSDKVersions(runtimeConfig, defaultSDKVersionForCompatCheck))) {
3624
- GlobalVars.clientSupportedSDKVersion = runtimeConfig;
3625
- }
3626
- var givenRuntimeConfig = JSON.parse(clientSupportedSDKVersion);
3627
- initializeHelperLogger('givenRuntimeConfig parsed to %o', givenRuntimeConfig !== null && givenRuntimeConfig !== void 0 ? givenRuntimeConfig : 'null');
3628
- if (!givenRuntimeConfig) {
3629
- throw new Error('givenRuntimeConfig string was successfully parsed. However, it parsed to value of null');
3630
- }
3631
- else {
3632
- applyRuntimeConfig(givenRuntimeConfig);
3633
- }
3634
- }
3635
- catch (e) {
3636
- if (e instanceof SyntaxError) {
3637
- applyRuntimeConfig(generateVersionBasedTeamsRuntimeConfig(GlobalVars.clientSupportedSDKVersion, versionAndPlatformAgnosticTeamsRuntimeConfig, mapTeamsVersionToSupportedCapabilities));
3638
- }
3639
- else {
3640
- throw e;
3641
- }
3642
- }
3643
- }
3644
- else {
3645
- // If it's any error that's not a JSON parsing error, we want the program to fail.
3646
- throw e;
3647
- }
3648
- }
3649
- GlobalVars.initializeCompleted = true;
3650
- });
3651
- authentication.initialize();
3652
- menus.initialize();
3653
- pages.config.initialize();
3654
- dialog.initialize();
3655
- }
3656
- // Handle additional valid message origins if specified
3657
- if (Array.isArray(validMessageOrigins)) {
3658
- processAdditionalValidOrigins(validMessageOrigins);
3659
- }
3660
- resolve(GlobalVars.initializePromise);
3661
- });
3662
- }
3663
3832
  /**
3664
3833
  * @hidden
3665
3834
  * Undocumented function used to set a mock window for unit tests
@@ -3685,10 +3854,10 @@ var app;
3685
3854
  uninitializeHandlers();
3686
3855
  GlobalVars.initializeCalled = false;
3687
3856
  GlobalVars.initializeCompleted = false;
3688
- GlobalVars.initializePromise = null;
3857
+ GlobalVars.initializePromise = undefined;
3689
3858
  GlobalVars.additionalValidOrigins = [];
3690
- GlobalVars.frameContext = null;
3691
- GlobalVars.hostClientType = null;
3859
+ GlobalVars.frameContext = undefined;
3860
+ GlobalVars.hostClientType = undefined;
3692
3861
  GlobalVars.isFramelessWindow = false;
3693
3862
  uninitializeCommunication();
3694
3863
  }
@@ -3701,7 +3870,7 @@ var app;
3701
3870
  function getContext() {
3702
3871
  return new Promise(function (resolve) {
3703
3872
  ensureInitializeCalled();
3704
- resolve(sendAndUnwrap('getContext'));
3873
+ resolve(sendAndUnwrapWithVersion(getApiVersionTag(appTelemetryVersionNumber, ApiName.App_GetContext), 'getContext'));
3705
3874
  }).then(function (legacyContext) { return transformLegacyContextToAppContext(legacyContext); }); // converts globalcontext to app.context
3706
3875
  }
3707
3876
  app.getContext = getContext;
@@ -3710,7 +3879,7 @@ var app;
3710
3879
  */
3711
3880
  function notifyAppLoaded() {
3712
3881
  ensureInitializeCalled();
3713
- sendMessageToParent(app.Messages.AppLoaded, [version]);
3882
+ communication_sendMessageToParentWithVersion(getApiVersionTag(appTelemetryVersionNumber, ApiName.App_NotifyAppLoaded), app.Messages.AppLoaded, [version]);
3714
3883
  }
3715
3884
  app.notifyAppLoaded = notifyAppLoaded;
3716
3885
  /**
@@ -3718,7 +3887,7 @@ var app;
3718
3887
  */
3719
3888
  function notifySuccess() {
3720
3889
  ensureInitializeCalled();
3721
- sendMessageToParent(app.Messages.Success, [version]);
3890
+ communication_sendMessageToParentWithVersion(getApiVersionTag(appTelemetryVersionNumber, ApiName.App_NotifySuccess), app.Messages.Success, [version]);
3722
3891
  }
3723
3892
  app.notifySuccess = notifySuccess;
3724
3893
  /**
@@ -3729,10 +3898,7 @@ var app;
3729
3898
  */
3730
3899
  function notifyFailure(appInitializationFailedRequest) {
3731
3900
  ensureInitializeCalled();
3732
- sendMessageToParent(app.Messages.Failure, [
3733
- appInitializationFailedRequest.reason,
3734
- appInitializationFailedRequest.message,
3735
- ]);
3901
+ communication_sendMessageToParentWithVersion(getApiVersionTag(appTelemetryVersionNumber, ApiName.App_NotifyFailure), app.Messages.Failure, [appInitializationFailedRequest.reason, appInitializationFailedRequest.message]);
3736
3902
  }
3737
3903
  app.notifyFailure = notifyFailure;
3738
3904
  /**
@@ -3742,7 +3908,7 @@ var app;
3742
3908
  */
3743
3909
  function notifyExpectedFailure(expectedFailureRequest) {
3744
3910
  ensureInitializeCalled();
3745
- sendMessageToParent(app.Messages.ExpectedFailure, [expectedFailureRequest.reason, expectedFailureRequest.message]);
3911
+ communication_sendMessageToParentWithVersion(getApiVersionTag(appTelemetryVersionNumber, ApiName.App_NotifyExpectedFailure), app.Messages.ExpectedFailure, [expectedFailureRequest.reason, expectedFailureRequest.message]);
3746
3912
  }
3747
3913
  app.notifyExpectedFailure = notifyExpectedFailure;
3748
3914
  /**
@@ -3754,9 +3920,7 @@ var app;
3754
3920
  * @param handler - The handler to invoke when the user changes their theme.
3755
3921
  */
3756
3922
  function registerOnThemeChangeHandler(handler) {
3757
- // allow for registration cleanup even when not called initialize
3758
- handler && ensureInitializeCalled();
3759
- handlers_registerOnThemeChangeHandler(handler);
3923
+ registerOnThemeChangeHandlerHelper(getApiVersionTag(appTelemetryVersionNumber, ApiName.App_RegisterOnThemeChangeHandler), handler);
3760
3924
  }
3761
3925
  app.registerOnThemeChangeHandler = registerOnThemeChangeHandler;
3762
3926
  /**
@@ -3766,10 +3930,7 @@ var app;
3766
3930
  * @returns Promise that will be fulfilled when the operation has completed
3767
3931
  */
3768
3932
  function openLink(deepLink) {
3769
- return new Promise(function (resolve) {
3770
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
3771
- resolve(sendAndHandleStatusAndReason('executeDeepLink', deepLink));
3772
- });
3933
+ return openLinkHelper(getApiVersionTag(appTelemetryVersionNumber, ApiName.App_OpenLink), deepLink);
3773
3934
  }
3774
3935
  app.openLink = openLink;
3775
3936
  /**
@@ -3795,9 +3956,7 @@ var app;
3795
3956
  if (!handler) {
3796
3957
  throw new Error('[app.lifecycle.registerBeforeSuspendOrTerminateHandler] Handler cannot be null');
3797
3958
  }
3798
- if (!isSupported()) {
3799
- throw errorNotSupportedOnPlatform;
3800
- }
3959
+ internalAPIs_ensureInitialized(runtime_runtime);
3801
3960
  handlers_registerBeforeSuspendOrTerminateHandler(handler);
3802
3961
  }
3803
3962
  lifecycle.registerBeforeSuspendOrTerminateHandler = registerBeforeSuspendOrTerminateHandler;
@@ -3813,24 +3972,10 @@ var app;
3813
3972
  if (!handler) {
3814
3973
  throw new Error('[app.lifecycle.registerOnResumeHandler] Handler cannot be null');
3815
3974
  }
3816
- if (!isSupported()) {
3817
- throw errorNotSupportedOnPlatform;
3818
- }
3975
+ internalAPIs_ensureInitialized(runtime_runtime);
3819
3976
  handlers_registerOnResumeHandler(handler);
3820
3977
  }
3821
3978
  lifecycle.registerOnResumeHandler = registerOnResumeHandler;
3822
- /**
3823
- * Checks if app.lifecycle is supported by the host.
3824
- * @returns boolean to represent whether the lifecycle capability is supported
3825
- * @throws Error if {@linkcode app.initialize} has not successfully completed
3826
- *
3827
- * @beta
3828
- */
3829
- function isSupported() {
3830
- var _a;
3831
- return ensureInitialized(runtime) && !!((_a = runtime.supports.app) === null || _a === void 0 ? void 0 : _a.lifecycle);
3832
- }
3833
- lifecycle.isSupported = isSupported;
3834
3979
  })(lifecycle = app.lifecycle || (app.lifecycle = {}));
3835
3980
  })(app || (app = {}));
3836
3981
  /**
@@ -3841,6 +3986,7 @@ var app;
3841
3986
  * Limited to Microsoft-internal use
3842
3987
  */
3843
3988
  function transformLegacyContextToAppContext(legacyContext) {
3989
+ var _a;
3844
3990
  var context = {
3845
3991
  actionInfo: legacyContext.actionInfo,
3846
3992
  app: {
@@ -3862,6 +4008,8 @@ function transformLegacyContextToAppContext(legacyContext) {
3862
4008
  },
3863
4009
  page: {
3864
4010
  id: legacyContext.entityId,
4011
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
4012
+ // @ts-ignore
3865
4013
  frameContext: legacyContext.frameContext ? legacyContext.frameContext : GlobalVars.frameContext,
3866
4014
  subPageId: legacyContext.subEntityId,
3867
4015
  isFullScreen: legacyContext.isFullScreen,
@@ -3869,7 +4017,7 @@ function transformLegacyContextToAppContext(legacyContext) {
3869
4017
  sourceOrigin: legacyContext.sourceOrigin,
3870
4018
  },
3871
4019
  user: {
3872
- id: legacyContext.userObjectId,
4020
+ id: (_a = legacyContext.userObjectId) !== null && _a !== void 0 ? _a : '',
3873
4021
  displayName: legacyContext.userDisplayName,
3874
4022
  isCallingAllowed: legacyContext.isCallingAllowed,
3875
4023
  isPSTNCallingAllowed: legacyContext.isPSTNCallingAllowed,
@@ -3943,6 +4091,86 @@ function transformLegacyContextToAppContext(legacyContext) {
3943
4091
 
3944
4092
 
3945
4093
 
4094
+
4095
+ /**
4096
+ * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY
4097
+ */
4098
+ var pagesTelemetryVersionNumber = ApiVersionNumber.V_2;
4099
+ function navigateCrossDomainHelper(apiVersionTag, url) {
4100
+ return new Promise(function (resolve) {
4101
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.remove, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
4102
+ if (!pages.isSupported()) {
4103
+ throw errorNotSupportedOnPlatform;
4104
+ }
4105
+ var errorMessage = 'Cross-origin navigation is only supported for URLs matching the pattern registered in the manifest.';
4106
+ resolve(sendAndHandleStatusAndReasonWithDefaultErrorWithVersion(apiVersionTag, 'navigateCrossDomain', errorMessage, url));
4107
+ });
4108
+ }
4109
+ function backStackNavigateBackHelper(apiVersionTag) {
4110
+ return new Promise(function (resolve) {
4111
+ internalAPIs_ensureInitialized(runtime_runtime);
4112
+ if (!pages.backStack.isSupported()) {
4113
+ throw errorNotSupportedOnPlatform;
4114
+ }
4115
+ var errorMessage = 'Back navigation is not supported in the current client or context.';
4116
+ resolve(sendAndHandleStatusAndReasonWithDefaultErrorWithVersion(apiVersionTag, 'navigateBack', errorMessage));
4117
+ });
4118
+ }
4119
+ function tabsNavigateToTabHelper(apiVersionTag, tabInstance) {
4120
+ return new Promise(function (resolve) {
4121
+ internalAPIs_ensureInitialized(runtime_runtime);
4122
+ if (!pages.tabs.isSupported()) {
4123
+ throw errorNotSupportedOnPlatform;
4124
+ }
4125
+ var errorMessage = 'Invalid internalTabInstanceId and/or channelId were/was provided';
4126
+ resolve(sendAndHandleStatusAndReasonWithDefaultErrorWithVersion(apiVersionTag, 'navigateToTab', errorMessage, tabInstance));
4127
+ });
4128
+ }
4129
+ function returnFocusHelper(apiVersionTag, navigateForward) {
4130
+ internalAPIs_ensureInitialized(runtime_runtime);
4131
+ if (!pages.isSupported()) {
4132
+ throw errorNotSupportedOnPlatform;
4133
+ }
4134
+ communication_sendMessageToParentWithVersion(apiVersionTag, 'returnFocus', [navigateForward]);
4135
+ }
4136
+ function getTabInstancesHelper(apiVersionTag, tabInstanceParameters) {
4137
+ return new Promise(function (resolve) {
4138
+ internalAPIs_ensureInitialized(runtime_runtime);
4139
+ if (!pages.tabs.isSupported()) {
4140
+ throw errorNotSupportedOnPlatform;
4141
+ }
4142
+ /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
4143
+ resolve(sendAndUnwrapWithVersion(apiVersionTag, 'getTabInstances', tabInstanceParameters));
4144
+ });
4145
+ }
4146
+ function getMruTabInstancesHelper(apiVersionTag, tabInstanceParameters) {
4147
+ return new Promise(function (resolve) {
4148
+ internalAPIs_ensureInitialized(runtime_runtime);
4149
+ if (!pages.tabs.isSupported()) {
4150
+ throw errorNotSupportedOnPlatform;
4151
+ }
4152
+ /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
4153
+ resolve(sendAndUnwrapWithVersion(apiVersionTag, 'getMruTabInstances', tabInstanceParameters));
4154
+ });
4155
+ }
4156
+ function shareDeepLinkHelper(apiVersionTag, deepLinkParameters) {
4157
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
4158
+ if (!pages.isSupported()) {
4159
+ throw errorNotSupportedOnPlatform;
4160
+ }
4161
+ communication_sendMessageToParentWithVersion(apiVersionTag, 'shareDeepLink', [
4162
+ deepLinkParameters.subPageId,
4163
+ deepLinkParameters.subPageLabel,
4164
+ deepLinkParameters.subPageWebUrl,
4165
+ ]);
4166
+ }
4167
+ function setCurrentFrameHelper(apiVersionTag, frameInfo) {
4168
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
4169
+ if (!pages.isSupported()) {
4170
+ throw errorNotSupportedOnPlatform;
4171
+ }
4172
+ communication_sendMessageToParentWithVersion(apiVersionTag, 'setFrameContext', [frameInfo]);
4173
+ }
3946
4174
  /**
3947
4175
  * Navigation-specific part of the SDK.
3948
4176
  */
@@ -3956,11 +4184,7 @@ var pages;
3956
4184
  * @param navigateForward - Determines the direction to focus in host.
3957
4185
  */
3958
4186
  function returnFocus(navigateForward) {
3959
- ensureInitialized(runtime);
3960
- if (!isSupported()) {
3961
- throw errorNotSupportedOnPlatform;
3962
- }
3963
- sendMessageToParent('returnFocus', [navigateForward]);
4187
+ returnFocusHelper(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_ReturnFocus), navigateForward);
3964
4188
  }
3965
4189
  pages.returnFocus = returnFocus;
3966
4190
  /**
@@ -3976,7 +4200,7 @@ var pages;
3976
4200
  * Limited to Microsoft-internal use
3977
4201
  */
3978
4202
  function registerFocusEnterHandler(handler) {
3979
- registerHandlerHelper('focusEnter', handler, [], function () {
4203
+ registerHandlerHelperWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_RegisterFocusEnterHandler), 'focusEnter', handler, [], function () {
3980
4204
  if (!isSupported()) {
3981
4205
  throw errorNotSupportedOnPlatform;
3982
4206
  }
@@ -3990,11 +4214,7 @@ var pages;
3990
4214
  * user clicks 'Go To Website'
3991
4215
  */
3992
4216
  function setCurrentFrame(frameInfo) {
3993
- ensureInitialized(runtime, FrameContexts.content);
3994
- if (!isSupported()) {
3995
- throw errorNotSupportedOnPlatform;
3996
- }
3997
- sendMessageToParent('setFrameContext', [frameInfo]);
4217
+ setCurrentFrameHelper(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_SetCurrentFrame), frameInfo);
3998
4218
  }
3999
4219
  pages.setCurrentFrame = setCurrentFrame;
4000
4220
  /**
@@ -4017,11 +4237,11 @@ var pages;
4017
4237
  */
4018
4238
  function getConfig() {
4019
4239
  return new Promise(function (resolve) {
4020
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.settings, FrameContexts.remove, FrameContexts.sidePanel);
4240
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.settings, FrameContexts.remove, FrameContexts.sidePanel);
4021
4241
  if (!isSupported()) {
4022
4242
  throw errorNotSupportedOnPlatform;
4023
4243
  }
4024
- resolve(sendAndUnwrap('settings.getSettings'));
4244
+ resolve(sendAndUnwrapWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_GetConfig), 'settings.getSettings'));
4025
4245
  });
4026
4246
  }
4027
4247
  pages.getConfig = getConfig;
@@ -4035,14 +4255,7 @@ var pages;
4035
4255
  * @returns Promise that resolves when the navigation has completed.
4036
4256
  */
4037
4257
  function navigateCrossDomain(url) {
4038
- return new Promise(function (resolve) {
4039
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.remove, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
4040
- if (!isSupported()) {
4041
- throw errorNotSupportedOnPlatform;
4042
- }
4043
- var errorMessage = 'Cross-origin navigation is only supported for URLs matching the pattern registered in the manifest.';
4044
- resolve(sendAndHandleStatusAndReasonWithDefaultError('navigateCrossDomain', errorMessage, url));
4045
- });
4258
+ return navigateCrossDomainHelper(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_NavigateCrossDomain), url);
4046
4259
  }
4047
4260
  pages.navigateCrossDomain = navigateCrossDomain;
4048
4261
  /**
@@ -4056,15 +4269,16 @@ var pages;
4056
4269
  */
4057
4270
  function navigateToApp(params) {
4058
4271
  return new Promise(function (resolve) {
4059
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
4272
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
4060
4273
  if (!isSupported()) {
4061
4274
  throw errorNotSupportedOnPlatform;
4062
4275
  }
4063
- if (runtime.isLegacyTeams) {
4064
- resolve(sendAndHandleStatusAndReason('executeDeepLink', createTeamsAppLink(params)));
4276
+ var apiVersionTag = getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_NavigateCrossDomain);
4277
+ if (runtime_runtime.isLegacyTeams) {
4278
+ resolve(sendAndHandleStatusAndReasonWithVersion(apiVersionTag, 'executeDeepLink', createTeamsAppLink(params)));
4065
4279
  }
4066
4280
  else {
4067
- resolve(sendAndHandleStatusAndReason('pages.navigateToApp', params));
4281
+ resolve(sendAndHandleStatusAndReasonWithVersion(apiVersionTag, 'pages.navigateToApp', params));
4068
4282
  }
4069
4283
  });
4070
4284
  }
@@ -4076,15 +4290,7 @@ var pages;
4076
4290
  * @param deepLinkParameters - ID and label for the link and fallback URL.
4077
4291
  */
4078
4292
  function shareDeepLink(deepLinkParameters) {
4079
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
4080
- if (!isSupported()) {
4081
- throw errorNotSupportedOnPlatform;
4082
- }
4083
- sendMessageToParent('shareDeepLink', [
4084
- deepLinkParameters.subPageId,
4085
- deepLinkParameters.subPageLabel,
4086
- deepLinkParameters.subPageWebUrl,
4087
- ]);
4293
+ return shareDeepLinkHelper(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_ShareDeepLink), deepLinkParameters);
4088
4294
  }
4089
4295
  pages.shareDeepLink = shareDeepLink;
4090
4296
  /**
@@ -4095,7 +4301,7 @@ var pages;
4095
4301
  * @param handler - The handler to invoke when the user toggles full-screen view for a tab.
4096
4302
  */
4097
4303
  function registerFullScreenHandler(handler) {
4098
- registerHandlerHelper('fullScreenChange', handler, [], function () {
4304
+ registerHandlerHelperWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_RegisterFullScreenHandler), 'fullScreenChange', handler, [], function () {
4099
4305
  if (!isNullOrUndefined(handler) && !isSupported()) {
4100
4306
  throw errorNotSupportedOnPlatform;
4101
4307
  }
@@ -4109,7 +4315,7 @@ var pages;
4109
4315
  * @throws Error if {@linkcode app.initialize} has not successfully completed
4110
4316
  */
4111
4317
  function isSupported() {
4112
- return ensureInitialized(runtime) && runtime.supports.pages ? true : false;
4318
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.pages ? true : false;
4113
4319
  }
4114
4320
  pages.isSupported = isSupported;
4115
4321
  /**
@@ -4124,14 +4330,7 @@ var pages;
4124
4330
  * @returns Promise that resolves when the navigation has completed.
4125
4331
  */
4126
4332
  function navigateToTab(tabInstance) {
4127
- return new Promise(function (resolve) {
4128
- ensureInitialized(runtime);
4129
- if (!isSupported()) {
4130
- throw errorNotSupportedOnPlatform;
4131
- }
4132
- var errorMessage = 'Invalid internalTabInstanceId and/or channelId were/was provided';
4133
- resolve(sendAndHandleStatusAndReasonWithDefaultError('navigateToTab', errorMessage, tabInstance));
4134
- });
4333
+ return tabsNavigateToTabHelper(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_Tabs_NavigateToTab), tabInstance);
4135
4334
  }
4136
4335
  tabs.navigateToTab = navigateToTab;
4137
4336
  /**
@@ -4141,14 +4340,7 @@ var pages;
4141
4340
  * @returns Promise that resolves with the {@link TabInformation}. Contains information for the user's tabs that are owned by this application {@link TabInstance}.
4142
4341
  */
4143
4342
  function getTabInstances(tabInstanceParameters) {
4144
- return new Promise(function (resolve) {
4145
- ensureInitialized(runtime);
4146
- if (!isSupported()) {
4147
- throw errorNotSupportedOnPlatform;
4148
- }
4149
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
4150
- resolve(sendAndUnwrap('getTabInstances', tabInstanceParameters));
4151
- });
4343
+ return getTabInstancesHelper(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_Tabs_GetTabInstances), tabInstanceParameters);
4152
4344
  }
4153
4345
  tabs.getTabInstances = getTabInstances;
4154
4346
  /**
@@ -4157,14 +4349,7 @@ var pages;
4157
4349
  * @returns Promise that resolves with the {@link TabInformation}. Contains information for the users' most recently used tabs {@link TabInstance}.
4158
4350
  */
4159
4351
  function getMruTabInstances(tabInstanceParameters) {
4160
- return new Promise(function (resolve) {
4161
- ensureInitialized(runtime);
4162
- if (!isSupported()) {
4163
- throw errorNotSupportedOnPlatform;
4164
- }
4165
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
4166
- resolve(sendAndUnwrap('getMruTabInstances', tabInstanceParameters));
4167
- });
4352
+ return getMruTabInstancesHelper(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_Tabs_GetMruTabInstances), tabInstanceParameters);
4168
4353
  }
4169
4354
  tabs.getMruTabInstances = getMruTabInstances;
4170
4355
  /**
@@ -4174,8 +4359,8 @@ var pages;
4174
4359
  * @throws Error if {@linkcode app.initialize} has not successfully completed
4175
4360
  */
4176
4361
  function isSupported() {
4177
- return ensureInitialized(runtime) && runtime.supports.pages
4178
- ? runtime.supports.pages.tabs
4362
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.pages
4363
+ ? runtime_runtime.supports.pages.tabs
4179
4364
  ? true
4180
4365
  : false
4181
4366
  : false;
@@ -4209,11 +4394,11 @@ var pages;
4209
4394
  * @param validityState - Indicates whether the save or remove button is enabled for the user.
4210
4395
  */
4211
4396
  function setValidityState(validityState) {
4212
- ensureInitialized(runtime, FrameContexts.settings, FrameContexts.remove);
4397
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.settings, FrameContexts.remove);
4213
4398
  if (!isSupported()) {
4214
4399
  throw errorNotSupportedOnPlatform;
4215
4400
  }
4216
- sendMessageToParent('settings.setValidityState', [validityState]);
4401
+ communication_sendMessageToParentWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_Config_SetValidityState), 'settings.setValidityState', [validityState]);
4217
4402
  }
4218
4403
  config.setValidityState = setValidityState;
4219
4404
  /**
@@ -4224,11 +4409,11 @@ var pages;
4224
4409
  */
4225
4410
  function setConfig(instanceConfig) {
4226
4411
  return new Promise(function (resolve) {
4227
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.settings, FrameContexts.sidePanel);
4412
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.settings, FrameContexts.sidePanel);
4228
4413
  if (!isSupported()) {
4229
4414
  throw errorNotSupportedOnPlatform;
4230
4415
  }
4231
- resolve(sendAndHandleStatusAndReason('settings.setSettings', instanceConfig));
4416
+ resolve(sendAndHandleStatusAndReasonWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_Config_SetConfig), 'settings.setSettings', instanceConfig));
4232
4417
  });
4233
4418
  }
4234
4419
  config.setConfig = setConfig;
@@ -4259,12 +4444,13 @@ var pages;
4259
4444
  */
4260
4445
  function registerOnSaveHandlerHelper(handler, versionSpecificHelper) {
4261
4446
  // allow for registration cleanup even when not finished initializing
4262
- !isNullOrUndefined(handler) && ensureInitialized(runtime, FrameContexts.settings);
4447
+ !isNullOrUndefined(handler) && internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.settings);
4263
4448
  if (versionSpecificHelper) {
4264
4449
  versionSpecificHelper();
4265
4450
  }
4266
4451
  saveHandler = handler;
4267
- !isNullOrUndefined(handler) && sendMessageToParent('registerHandler', ['save']);
4452
+ !isNullOrUndefined(handler) &&
4453
+ communication_sendMessageToParentWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_Config_RegisterOnSaveHandlerHelper), 'registerHandler', ['save']);
4268
4454
  }
4269
4455
  config.registerOnSaveHandlerHelper = registerOnSaveHandlerHelper;
4270
4456
  /**
@@ -4294,12 +4480,13 @@ var pages;
4294
4480
  */
4295
4481
  function registerOnRemoveHandlerHelper(handler, versionSpecificHelper) {
4296
4482
  // allow for registration cleanup even when not finished initializing
4297
- !isNullOrUndefined(handler) && ensureInitialized(runtime, FrameContexts.remove, FrameContexts.settings);
4483
+ !isNullOrUndefined(handler) && internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.remove, FrameContexts.settings);
4298
4484
  if (versionSpecificHelper) {
4299
4485
  versionSpecificHelper();
4300
4486
  }
4301
4487
  removeHandler = handler;
4302
- !isNullOrUndefined(handler) && sendMessageToParent('registerHandler', ['remove']);
4488
+ !isNullOrUndefined(handler) &&
4489
+ communication_sendMessageToParentWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_Config_RegisterOnRemoveHandlerHelper), 'registerHandler', ['remove']);
4303
4490
  }
4304
4491
  config.registerOnRemoveHandlerHelper = registerOnRemoveHandlerHelper;
4305
4492
  function handleSave(result) {
@@ -4320,7 +4507,7 @@ var pages;
4320
4507
  * @param handler - The handler to invoke when the user clicks on Settings.
4321
4508
  */
4322
4509
  function registerChangeConfigHandler(handler) {
4323
- registerHandlerHelper('changeSettings', handler, [FrameContexts.content], function () {
4510
+ registerHandlerHelperWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_Config_RegisterChangeConfigHandler), 'changeSettings', handler, [FrameContexts.content], function () {
4324
4511
  if (!isSupported()) {
4325
4512
  throw errorNotSupportedOnPlatform;
4326
4513
  }
@@ -4338,12 +4525,12 @@ var pages;
4338
4525
  }
4339
4526
  SaveEventImpl.prototype.notifySuccess = function () {
4340
4527
  this.ensureNotNotified();
4341
- sendMessageToParent('settings.save.success');
4528
+ communication_sendMessageToParentWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Settings_Save_Success), 'settings.save.success');
4342
4529
  this.notified = true;
4343
4530
  };
4344
4531
  SaveEventImpl.prototype.notifyFailure = function (reason) {
4345
4532
  this.ensureNotNotified();
4346
- sendMessageToParent('settings.save.failure', [reason]);
4533
+ communication_sendMessageToParentWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Settings_Save_Failure), 'settings.save.failure', [reason]);
4347
4534
  this.notified = true;
4348
4535
  };
4349
4536
  SaveEventImpl.prototype.ensureNotNotified = function () {
@@ -4376,12 +4563,12 @@ var pages;
4376
4563
  }
4377
4564
  RemoveEventImpl.prototype.notifySuccess = function () {
4378
4565
  this.ensureNotNotified();
4379
- sendMessageToParent('settings.remove.success');
4566
+ communication_sendMessageToParentWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Settings_Remove_Success), 'settings.remove.success');
4380
4567
  this.notified = true;
4381
4568
  };
4382
4569
  RemoveEventImpl.prototype.notifyFailure = function (reason) {
4383
4570
  this.ensureNotNotified();
4384
- sendMessageToParent('settings.remove.failure', [reason]);
4571
+ communication_sendMessageToParentWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Settings_Remove_Failure), 'settings.remove.failure', [reason]);
4385
4572
  this.notified = true;
4386
4573
  };
4387
4574
  RemoveEventImpl.prototype.ensureNotNotified = function () {
@@ -4398,8 +4585,8 @@ var pages;
4398
4585
  * @throws Error if {@linkcode app.initialize} has not successfully completed
4399
4586
  */
4400
4587
  function isSupported() {
4401
- return ensureInitialized(runtime) && runtime.supports.pages
4402
- ? runtime.supports.pages.config
4588
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.pages
4589
+ ? runtime_runtime.supports.pages.config
4403
4590
  ? true
4404
4591
  : false
4405
4592
  : false;
@@ -4428,14 +4615,7 @@ var pages;
4428
4615
  * @returns Promise that resolves when the navigation has completed.
4429
4616
  */
4430
4617
  function navigateBack() {
4431
- return new Promise(function (resolve) {
4432
- ensureInitialized(runtime);
4433
- if (!isSupported()) {
4434
- throw errorNotSupportedOnPlatform;
4435
- }
4436
- var errorMessage = 'Back navigation is not supported in the current client or context.';
4437
- resolve(sendAndHandleStatusAndReasonWithDefaultError('navigateBack', errorMessage));
4438
- });
4618
+ return backStackNavigateBackHelper(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_BackStack_NavigateBack));
4439
4619
  }
4440
4620
  backStack.navigateBack = navigateBack;
4441
4621
  /**
@@ -4446,7 +4626,7 @@ var pages;
4446
4626
  * @param handler - The handler to invoke when the user presses the host client's back button.
4447
4627
  */
4448
4628
  function registerBackButtonHandler(handler) {
4449
- registerBackButtonHandlerHelper(handler, function () {
4629
+ registerBackButtonHandlerHelper(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_BackStack_RegisterBackButtonHandler), handler, function () {
4450
4630
  if (!isNullOrUndefined(handler) && !isSupported()) {
4451
4631
  throw errorNotSupportedOnPlatform;
4452
4632
  }
@@ -4459,18 +4639,18 @@ var pages;
4459
4639
  *
4460
4640
  * @internal
4461
4641
  * Limited to Microsoft-internal use
4462
- *
4642
+ * @param apiVersionTag - The tag indicating API version number with name
4463
4643
  * @param handler - The handler to invoke when the user presses the host client's back button.
4464
4644
  * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.
4465
4645
  */
4466
- function registerBackButtonHandlerHelper(handler, versionSpecificHelper) {
4646
+ function registerBackButtonHandlerHelper(apiVersionTag, handler, versionSpecificHelper) {
4467
4647
  // allow for registration cleanup even when not finished initializing
4468
- !isNullOrUndefined(handler) && ensureInitialized(runtime);
4648
+ !isNullOrUndefined(handler) && internalAPIs_ensureInitialized(runtime_runtime);
4469
4649
  if (versionSpecificHelper) {
4470
4650
  versionSpecificHelper();
4471
4651
  }
4472
4652
  backButtonPressHandler = handler;
4473
- !isNullOrUndefined(handler) && sendMessageToParent('registerHandler', ['backButton']);
4653
+ !isNullOrUndefined(handler) && communication_sendMessageToParentWithVersion(apiVersionTag, 'registerHandler', ['backButton']);
4474
4654
  }
4475
4655
  backStack.registerBackButtonHandlerHelper = registerBackButtonHandlerHelper;
4476
4656
  function handleBackButtonPress() {
@@ -4491,8 +4671,8 @@ var pages;
4491
4671
  * @throws Error if {@linkcode app.initialize} has not successfully completed
4492
4672
  */
4493
4673
  function isSupported() {
4494
- return ensureInitialized(runtime) && runtime.supports.pages
4495
- ? runtime.supports.pages.backStack
4674
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.pages
4675
+ ? runtime_runtime.supports.pages.backStack
4496
4676
  ? true
4497
4677
  : false
4498
4678
  : false;
@@ -4514,11 +4694,11 @@ var pages;
4514
4694
  * Place the tab into full-screen mode.
4515
4695
  */
4516
4696
  function enterFullscreen() {
4517
- ensureInitialized(runtime, FrameContexts.content);
4697
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
4518
4698
  if (!isSupported()) {
4519
4699
  throw errorNotSupportedOnPlatform;
4520
4700
  }
4521
- sendMessageToParent('enterFullscreen', []);
4701
+ communication_sendMessageToParentWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_FullTrust_EnterFullscreen), 'enterFullscreen', []);
4522
4702
  }
4523
4703
  fullTrust.enterFullscreen = enterFullscreen;
4524
4704
  /**
@@ -4528,11 +4708,11 @@ var pages;
4528
4708
  * Reverts the tab into normal-screen mode.
4529
4709
  */
4530
4710
  function exitFullscreen() {
4531
- ensureInitialized(runtime, FrameContexts.content);
4711
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
4532
4712
  if (!isSupported()) {
4533
4713
  throw errorNotSupportedOnPlatform;
4534
4714
  }
4535
- sendMessageToParent('exitFullscreen', []);
4715
+ communication_sendMessageToParentWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_FullTrust_ExitFullscreen), 'exitFullscreen', []);
4536
4716
  }
4537
4717
  fullTrust.exitFullscreen = exitFullscreen;
4538
4718
  /**
@@ -4544,8 +4724,8 @@ var pages;
4544
4724
  * @throws Error if {@linkcode app.initialize} has not successfully completed
4545
4725
  */
4546
4726
  function isSupported() {
4547
- return ensureInitialized(runtime) && runtime.supports.pages
4548
- ? runtime.supports.pages.fullTrust
4727
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.pages
4728
+ ? runtime_runtime.supports.pages.fullTrust
4549
4729
  ? true
4550
4730
  : false
4551
4731
  : false;
@@ -4563,7 +4743,7 @@ var pages;
4563
4743
  * @param handler - The handler to invoke when the personal app button is clicked in the app bar.
4564
4744
  */
4565
4745
  function onClick(handler) {
4566
- registerHandlerHelper('appButtonClick', handler, [FrameContexts.content], function () {
4746
+ registerHandlerHelperWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_AppButton_OnClick), 'appButtonClick', handler, [FrameContexts.content], function () {
4567
4747
  if (!isSupported()) {
4568
4748
  throw errorNotSupportedOnPlatform;
4569
4749
  }
@@ -4576,7 +4756,7 @@ var pages;
4576
4756
  * @param handler - The handler to invoke when entering hover of the personal app button in the app bar.
4577
4757
  */
4578
4758
  function onHoverEnter(handler) {
4579
- registerHandlerHelper('appButtonHoverEnter', handler, [FrameContexts.content], function () {
4759
+ registerHandlerHelperWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_AppButton_OnHoverEnter), 'appButtonHoverEnter', handler, [FrameContexts.content], function () {
4580
4760
  if (!isSupported()) {
4581
4761
  throw errorNotSupportedOnPlatform;
4582
4762
  }
@@ -4589,7 +4769,7 @@ var pages;
4589
4769
  * @param handler - The handler to invoke when exiting hover of the personal app button in the app bar.
4590
4770
  */
4591
4771
  function onHoverLeave(handler) {
4592
- registerHandlerHelper('appButtonHoverLeave', handler, [FrameContexts.content], function () {
4772
+ registerHandlerHelperWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_AppButton_OnHoverLeave), 'appButtonHoverLeave', handler, [FrameContexts.content], function () {
4593
4773
  if (!isSupported()) {
4594
4774
  throw errorNotSupportedOnPlatform;
4595
4775
  }
@@ -4603,8 +4783,8 @@ var pages;
4603
4783
  * @throws Error if {@linkcode app.initialize} has not successfully completed
4604
4784
  */
4605
4785
  function isSupported() {
4606
- return ensureInitialized(runtime) && runtime.supports.pages
4607
- ? runtime.supports.pages.appButton
4786
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.pages
4787
+ ? runtime_runtime.supports.pages.appButton
4608
4788
  ? true
4609
4789
  : false
4610
4790
  : false;
@@ -4628,11 +4808,11 @@ var pages;
4628
4808
  */
4629
4809
  function navigateTo(params) {
4630
4810
  return new Promise(function (resolve) {
4631
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
4811
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
4632
4812
  if (!isSupported()) {
4633
4813
  throw errorNotSupportedOnPlatform;
4634
4814
  }
4635
- resolve(sendAndHandleSdkError('pages.currentApp.navigateTo', params));
4815
+ resolve(sendAndHandleSdkErrorWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_CurrentApp_NavigateTo), 'pages.currentApp.navigateTo', params));
4636
4816
  });
4637
4817
  }
4638
4818
  currentApp.navigateTo = navigateTo;
@@ -4643,11 +4823,11 @@ var pages;
4643
4823
  */
4644
4824
  function navigateToDefaultPage() {
4645
4825
  return new Promise(function (resolve) {
4646
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
4826
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
4647
4827
  if (!isSupported()) {
4648
4828
  throw errorNotSupportedOnPlatform;
4649
4829
  }
4650
- resolve(sendAndHandleSdkError('pages.currentApp.navigateToDefaultPage'));
4830
+ resolve(sendAndHandleSdkErrorWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_CurrentApp_NavigateToDefaultPage), 'pages.currentApp.navigateToDefaultPage'));
4651
4831
  });
4652
4832
  }
4653
4833
  currentApp.navigateToDefaultPage = navigateToDefaultPage;
@@ -4660,8 +4840,8 @@ var pages;
4660
4840
  * @beta
4661
4841
  */
4662
4842
  function isSupported() {
4663
- return ensureInitialized(runtime) && runtime.supports.pages
4664
- ? runtime.supports.pages.currentApp
4843
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.pages
4844
+ ? runtime_runtime.supports.pages.currentApp
4665
4845
  ? true
4666
4846
  : false
4667
4847
  : false;
@@ -4686,6 +4866,8 @@ var handlers_spreadArray = (undefined && undefined.__spreadArray) || function (t
4686
4866
 
4687
4867
 
4688
4868
 
4869
+
4870
+
4689
4871
  var handlersLogger = getLogger('handlers');
4690
4872
  /**
4691
4873
  * @internal
@@ -4720,6 +4902,17 @@ var HandlersPrivate = /** @class */ (function () {
4720
4902
  HandlersPrivate.resumeHandler = null;
4721
4903
  };
4722
4904
  HandlersPrivate.handlers = {};
4905
+ HandlersPrivate.themeChangeHandler = null;
4906
+ /**
4907
+ * @deprecated
4908
+ */
4909
+ HandlersPrivate.loadHandler = null;
4910
+ /**
4911
+ * @deprecated
4912
+ */
4913
+ HandlersPrivate.beforeUnloadHandler = null;
4914
+ HandlersPrivate.beforeSuspendOrTerminateHandler = null;
4915
+ HandlersPrivate.resumeHandler = null;
4723
4916
  return HandlersPrivate;
4724
4917
  }());
4725
4918
  /**
@@ -4757,6 +4950,21 @@ function callHandler(name, args) {
4757
4950
  return [false, undefined];
4758
4951
  }
4759
4952
  }
4953
+ /**
4954
+ * @internal
4955
+ * Limited to Microsoft-internal use
4956
+ */
4957
+ function registerHandlerWithVersion(getApiVersionTag, name, handler, sendMessage, args) {
4958
+ if (sendMessage === void 0) { sendMessage = true; }
4959
+ if (args === void 0) { args = []; }
4960
+ if (handler) {
4961
+ HandlersPrivate.handlers[name] = handler;
4962
+ sendMessage && sendMessageToParentWithVersion(getApiVersionTag, 'registerHandler', handlers_spreadArray([name], args, true));
4963
+ }
4964
+ else {
4965
+ delete HandlersPrivate.handlers[name];
4966
+ }
4967
+ }
4760
4968
  /**
4761
4969
  * @internal
4762
4970
  * Limited to Microsoft-internal use
@@ -4766,7 +4974,8 @@ function registerHandler(name, handler, sendMessage, args) {
4766
4974
  if (args === void 0) { args = []; }
4767
4975
  if (handler) {
4768
4976
  HandlersPrivate.handlers[name] = handler;
4769
- sendMessage && sendMessageToParent('registerHandler', handlers_spreadArray([name], args, true));
4977
+ sendMessage &&
4978
+ communication_sendMessageToParentWithVersion(getApiVersionTag(ApiVersionNumber.V_0, ApiName.RegisterHandler), 'registerHandler', handlers_spreadArray([name], args, true));
4770
4979
  }
4771
4980
  else {
4772
4981
  delete HandlersPrivate.handlers[name];
@@ -4786,6 +4995,27 @@ function removeHandler(name) {
4786
4995
  function doesHandlerExist(name) {
4787
4996
  return HandlersPrivate.handlers[name] != null;
4788
4997
  }
4998
+ /**
4999
+ * @hidden
5000
+ * Undocumented helper function with shared code between deprecated version and current version of register*Handler APIs
5001
+ *
5002
+ * @internal
5003
+ * Limited to Microsoft-internal use
5004
+ *
5005
+ * @param apiVersionTag - The tag to indicate API version number with name
5006
+ * @param name - The name of the handler to register.
5007
+ * @param handler - The handler to invoke.
5008
+ * @param contexts - The context within which it is valid to register this handler.
5009
+ * @param registrationHelper - The helper function containing logic pertaining to a specific version of the API.
5010
+ */
5011
+ function registerHandlerHelperWithVersion(apiVersionTag, name, handler, contexts, registrationHelper) {
5012
+ // allow for registration cleanup even when not finished initializing
5013
+ handler && internalAPIs_ensureInitialized.apply(void 0, handlers_spreadArray([runtime_runtime], contexts, false));
5014
+ if (registrationHelper) {
5015
+ registrationHelper();
5016
+ }
5017
+ registerHandler(name, handler);
5018
+ }
4789
5019
  /**
4790
5020
  * @hidden
4791
5021
  * Undocumented helper function with shared code between deprecated version and current version of register*Handler APIs
@@ -4810,9 +5040,9 @@ function registerHandlerHelper(name, handler, contexts, registrationHelper) {
4810
5040
  * @internal
4811
5041
  * Limited to Microsoft-internal use
4812
5042
  */
4813
- function handlers_registerOnThemeChangeHandler(handler) {
5043
+ function registerOnThemeChangeHandler(apiVersionTag, handler) {
4814
5044
  HandlersPrivate.themeChangeHandler = handler;
4815
- handler && sendMessageToParent('registerHandler', ['themeChange']);
5045
+ !isNullOrUndefined(handler) && communication_sendMessageToParentWithVersion(apiVersionTag, 'registerHandler', ['themeChange']);
4816
5046
  }
4817
5047
  /**
4818
5048
  * @internal
@@ -4834,7 +5064,10 @@ function handleThemeChange(theme) {
4834
5064
  */
4835
5065
  function handlers_registerOnLoadHandler(handler) {
4836
5066
  HandlersPrivate.loadHandler = handler;
4837
- handler && sendMessageToParent('registerHandler', ['load']);
5067
+ !isNullOrUndefined(handler) &&
5068
+ communication_sendMessageToParentWithVersion(getApiVersionTag(ApiVersionNumber.V_2, ApiName.RegisterHandler), 'registerHandler', [
5069
+ 'load',
5070
+ ]);
4838
5071
  }
4839
5072
  /**
4840
5073
  * @internal
@@ -4859,7 +5092,10 @@ function handleLoad(context) {
4859
5092
  */
4860
5093
  function handlers_registerBeforeUnloadHandler(handler) {
4861
5094
  HandlersPrivate.beforeUnloadHandler = handler;
4862
- handler && sendMessageToParent('registerHandler', ['beforeUnload']);
5095
+ !isNullOrUndefined(handler) &&
5096
+ communication_sendMessageToParentWithVersion(getApiVersionTag(ApiVersionNumber.V_2, ApiName.RegisterHandler), 'registerHandler', [
5097
+ 'beforeUnload',
5098
+ ]);
4863
5099
  }
4864
5100
  /**
4865
5101
  * @internal
@@ -4893,7 +5129,7 @@ function handleBeforeUnload() {
4893
5129
  */
4894
5130
  function handlers_registerBeforeSuspendOrTerminateHandler(handler) {
4895
5131
  HandlersPrivate.beforeSuspendOrTerminateHandler = handler;
4896
- handler && sendMessageToParent('registerHandler', ['beforeUnload']);
5132
+ !isNullOrUndefined(handler) && sendMessageToParent('registerHandler', ['beforeUnload']);
4897
5133
  }
4898
5134
  /**
4899
5135
  * @internal
@@ -4901,12 +5137,13 @@ function handlers_registerBeforeSuspendOrTerminateHandler(handler) {
4901
5137
  */
4902
5138
  function handlers_registerOnResumeHandler(handler) {
4903
5139
  HandlersPrivate.resumeHandler = handler;
4904
- handler && sendMessageToParent('registerHandler', ['load']);
5140
+ !isNullOrUndefined(handler) && sendMessageToParent('registerHandler', ['load']);
4905
5141
  }
4906
5142
 
4907
5143
  ;// CONCATENATED MODULE: ./src/internal/communication.ts
4908
5144
  /* eslint-disable @typescript-eslint/ban-types */
4909
5145
  /* eslint-disable @typescript-eslint/no-explicit-any */
5146
+ /* eslint-disable strict-null-checks/all */
4910
5147
  var communication_spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) {
4911
5148
  if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
4912
5149
  if (ar || !(i in from)) {
@@ -4922,6 +5159,7 @@ var communication_spreadArray = (undefined && undefined.__spreadArray) || functi
4922
5159
 
4923
5160
 
4924
5161
 
5162
+
4925
5163
  var communicationLogger = getLogger('communication');
4926
5164
  /**
4927
5165
  * @internal
@@ -4951,7 +5189,7 @@ var CommunicationPrivate = /** @class */ (function () {
4951
5189
  * @internal
4952
5190
  * Limited to Microsoft-internal use
4953
5191
  */
4954
- function initializeCommunication(validMessageOrigins) {
5192
+ function initializeCommunication(validMessageOrigins, apiVersionTag) {
4955
5193
  // Listen for messages post to our window
4956
5194
  CommunicationPrivate.messageListener = function (evt) { return processMessage(evt); };
4957
5195
  // If we are in an iframe, our parent window is the one hosting us (i.e., window.parent); otherwise,
@@ -4981,7 +5219,7 @@ function initializeCommunication(validMessageOrigins) {
4981
5219
  // Send the initialized message to any origin, because at this point we most likely don't know the origin
4982
5220
  // of the parent window, and this message contains no data that could pose a security risk.
4983
5221
  Communication.parentOrigin = '*';
4984
- return sendMessageToParentAsync('initialize', [
5222
+ return sendMessageToParentAsyncWithVersion(apiVersionTag, 'initialize', [
4985
5223
  version,
4986
5224
  latestRuntimeApiVersion,
4987
5225
  ]).then(function (_a) {
@@ -5012,6 +5250,26 @@ function uninitializeCommunication() {
5012
5250
  CommunicationPrivate.callbacks = {};
5013
5251
  CommunicationPrivate.promiseCallbacks = {};
5014
5252
  }
5253
+ /**
5254
+ * @hidden
5255
+ * Send a message to parent and then unwrap result. Uses nativeInterface on mobile to communicate with parent context
5256
+ * Additional apiVersionTag parameter is added, which provides the ability to send api version number to parent
5257
+ * for telemetry work. The code inside of this function will be used to replace sendAndUnwrap function
5258
+ * and this function will be removed when the project is completed.
5259
+ *
5260
+ * @internal
5261
+ * Limited to Microsoft-internal use
5262
+ */
5263
+ function sendAndUnwrapWithVersion(apiVersionTag, actionName) {
5264
+ var args = [];
5265
+ for (var _i = 2; _i < arguments.length; _i++) {
5266
+ args[_i - 2] = arguments[_i];
5267
+ }
5268
+ return sendMessageToParentAsyncWithVersion(apiVersionTag, actionName, args).then(function (_a) {
5269
+ var result = _a[0];
5270
+ return result;
5271
+ });
5272
+ }
5015
5273
  /**
5016
5274
  * @internal
5017
5275
  * Limited to Microsoft-internal use
@@ -5026,6 +5284,25 @@ function sendAndUnwrap(actionName) {
5026
5284
  return result;
5027
5285
  });
5028
5286
  }
5287
+ /**
5288
+ * @hidden
5289
+ * Send a message to parent and then handle status and reason. Uses nativeInterface on mobile to communicate with parent context
5290
+ * Additional apiVersionTag parameter is added, which provides the ability to send api version number to parent
5291
+ * for telemetry work. The code inside of this function will be used to replace sendAndHandleStatusAndReason function
5292
+ * and this function will be removed when the project is completed.
5293
+ */
5294
+ function sendAndHandleStatusAndReasonWithVersion(apiVersionTag, actionName) {
5295
+ var args = [];
5296
+ for (var _i = 2; _i < arguments.length; _i++) {
5297
+ args[_i - 2] = arguments[_i];
5298
+ }
5299
+ return sendMessageToParentAsyncWithVersion(apiVersionTag, actionName, args).then(function (_a) {
5300
+ var wasSuccessful = _a[0], reason = _a[1];
5301
+ if (!wasSuccessful) {
5302
+ throw new Error(reason);
5303
+ }
5304
+ });
5305
+ }
5029
5306
  function sendAndHandleStatusAndReason(actionName) {
5030
5307
  var args = [];
5031
5308
  for (var _i = 1; _i < arguments.length; _i++) {
@@ -5038,6 +5315,28 @@ function sendAndHandleStatusAndReason(actionName) {
5038
5315
  }
5039
5316
  });
5040
5317
  }
5318
+ /**
5319
+ * @hidden
5320
+ * Send a message to parent and then handle status and reason with default error. Uses nativeInterface on mobile to communicate with parent context
5321
+ * Additional apiVersionTag parameter is added, which provides the ability to send api version number to parent
5322
+ * for telemetry work. The code inside of this function will be used to replace sendAndHandleStatusAndReasonWithDefaultError function
5323
+ * and this function will be removed when the project is completed.
5324
+ *
5325
+ * @internal
5326
+ * Limited to Microsoft-internal use
5327
+ */
5328
+ function sendAndHandleStatusAndReasonWithDefaultErrorWithVersion(apiVersionTag, actionName, defaultError) {
5329
+ var args = [];
5330
+ for (var _i = 3; _i < arguments.length; _i++) {
5331
+ args[_i - 3] = arguments[_i];
5332
+ }
5333
+ return sendMessageToParentAsyncWithVersion(apiVersionTag, actionName, args).then(function (_a) {
5334
+ var wasSuccessful = _a[0], reason = _a[1];
5335
+ if (!wasSuccessful) {
5336
+ throw new Error(reason ? reason : defaultError);
5337
+ }
5338
+ });
5339
+ }
5041
5340
  /**
5042
5341
  * @internal
5043
5342
  * Limited to Microsoft-internal use
@@ -5054,6 +5353,29 @@ function sendAndHandleStatusAndReasonWithDefaultError(actionName, defaultError)
5054
5353
  }
5055
5354
  });
5056
5355
  }
5356
+ /**
5357
+ * @hidden
5358
+ * Send a message to parent and then handle SDK error. Uses nativeInterface on mobile to communicate with parent context
5359
+ * Additional apiVersionTag parameter is added, which provides the ability to send api version number to parent
5360
+ * for telemetry work. The code inside of this function will be used to replace sendAndHandleSdkError function
5361
+ * and this function will be removed when the project is completed.
5362
+ *
5363
+ * @internal
5364
+ * Limited to Microsoft-internal use
5365
+ */
5366
+ function sendAndHandleSdkErrorWithVersion(apiVersionTag, actionName) {
5367
+ var args = [];
5368
+ for (var _i = 2; _i < arguments.length; _i++) {
5369
+ args[_i - 2] = arguments[_i];
5370
+ }
5371
+ return sendMessageToParentAsyncWithVersion(apiVersionTag, actionName, args).then(function (_a) {
5372
+ var error = _a[0], result = _a[1];
5373
+ if (error) {
5374
+ throw error;
5375
+ }
5376
+ return result;
5377
+ });
5378
+ }
5057
5379
  /**
5058
5380
  * @internal
5059
5381
  * Limited to Microsoft-internal use
@@ -5071,6 +5393,28 @@ function sendAndHandleSdkError(actionName) {
5071
5393
  return result;
5072
5394
  });
5073
5395
  }
5396
+ /**
5397
+ * @hidden
5398
+ * Send a message to parent asynchronously. Uses nativeInterface on mobile to communicate with parent context
5399
+ * Additional apiVersionTag parameter is added, which provides the ability to send api version number to parent
5400
+ * for telemetry work. The code inside of this function will be used to replace sendMessageToParentAsync function
5401
+ * and this function will be removed when the project is completed.
5402
+ *
5403
+ * @internal
5404
+ * Limited to Microsoft-internal use
5405
+ */
5406
+ function sendMessageToParentAsyncWithVersion(apiVersionTag, actionName, args) {
5407
+ if (args === void 0) { args = undefined; }
5408
+ if (!isFollowingApiVersionTagFormat(apiVersionTag)) {
5409
+ throw Error("apiVersionTag: ".concat(apiVersionTag, " passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check."));
5410
+ }
5411
+ return new Promise(function (resolve) {
5412
+ var request = sendMessageToParentHelper(apiVersionTag, actionName, args);
5413
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
5414
+ // @ts-ignore
5415
+ resolve(waitForResponse(request.id));
5416
+ });
5417
+ }
5074
5418
  /**
5075
5419
  * @hidden
5076
5420
  * Send a message to parent. Uses nativeInterface on mobile to communicate with parent context
@@ -5081,8 +5425,7 @@ function sendAndHandleSdkError(actionName) {
5081
5425
  function sendMessageToParentAsync(actionName, args) {
5082
5426
  if (args === void 0) { args = undefined; }
5083
5427
  return new Promise(function (resolve) {
5084
- var request = sendMessageToParentHelper(actionName, args);
5085
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
5428
+ var request = sendMessageToParentHelper(getApiVersionTag(ApiVersionNumber.V_0, 'testing'), actionName, args);
5086
5429
  resolve(waitForResponse(request.id));
5087
5430
  });
5088
5431
  }
@@ -5095,6 +5438,34 @@ function waitForResponse(requestId) {
5095
5438
  CommunicationPrivate.promiseCallbacks[requestId] = resolve;
5096
5439
  });
5097
5440
  }
5441
+ /**
5442
+ * @hidden
5443
+ * Send a message to parent. Uses nativeInterface on mobile to communicate with parent context
5444
+ * Additional apiVersionTag parameter is added, which provides the ability to send api version number to parent
5445
+ * for telemetry work. The code inside of this function will be used to replace sendMessageToParent function
5446
+ * and this function will be removed when the project is completed.
5447
+ */
5448
+ function communication_sendMessageToParentWithVersion(apiVersionTag, actionName, argsOrCallback, callback) {
5449
+ var args;
5450
+ if (argsOrCallback instanceof Function) {
5451
+ callback = argsOrCallback;
5452
+ }
5453
+ else if (argsOrCallback instanceof Array) {
5454
+ args = argsOrCallback;
5455
+ }
5456
+ if (!isFollowingApiVersionTagFormat(apiVersionTag)) {
5457
+ throw Error("apiVersionTag: ".concat(apiVersionTag, " passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check."));
5458
+ }
5459
+ // APIs with v0 represents beta changes haven't been implemented on them
5460
+ // Otherwise, minimum version number will be v1
5461
+ /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
5462
+ var request = sendMessageToParentHelper(apiVersionTag, actionName, args);
5463
+ if (callback) {
5464
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
5465
+ // @ts-ignore
5466
+ CommunicationPrivate.callbacks[request.id] = callback;
5467
+ }
5468
+ }
5098
5469
  /**
5099
5470
  * @internal
5100
5471
  * Limited to Microsoft-internal use
@@ -5107,9 +5478,10 @@ function sendMessageToParent(actionName, argsOrCallback, callback) {
5107
5478
  else if (argsOrCallback instanceof Array) {
5108
5479
  args = argsOrCallback;
5109
5480
  }
5110
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
5111
- var request = sendMessageToParentHelper(actionName, args);
5481
+ var request = sendMessageToParentHelper(getApiVersionTag(ApiVersionNumber.V_0, 'testing'), actionName, args);
5112
5482
  if (callback) {
5483
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
5484
+ // @ts-ignore
5113
5485
  CommunicationPrivate.callbacks[request.id] = callback;
5114
5486
  }
5115
5487
  }
@@ -5118,15 +5490,13 @@ var sendMessageToParentHelperLogger = communicationLogger.extend('sendMessageToP
5118
5490
  * @internal
5119
5491
  * Limited to Microsoft-internal use
5120
5492
  */
5121
- function sendMessageToParentHelper(actionName, args) {
5493
+ function sendMessageToParentHelper(apiVersionTag, actionName, args) {
5122
5494
  var logger = sendMessageToParentHelperLogger;
5123
5495
  var targetWindow = Communication.parentWindow;
5124
- var request = createMessageRequest(actionName, args);
5125
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
5496
+ var request = createMessageRequest(apiVersionTag, actionName, args);
5126
5497
  logger('Message %i information: %o', request.id, { actionName: actionName, args: args });
5127
5498
  if (GlobalVars.isFramelessWindow) {
5128
5499
  if (Communication.currentWindow && Communication.currentWindow.nativeInterface) {
5129
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
5130
5500
  logger('Sending message %i to parent via framelessPostMessage interface', request.id);
5131
5501
  Communication.currentWindow.nativeInterface.framelessPostMessage(JSON.stringify(request));
5132
5502
  }
@@ -5136,12 +5506,10 @@ function sendMessageToParentHelper(actionName, args) {
5136
5506
  // If the target window isn't closed and we already know its origin, send the message right away; otherwise,
5137
5507
  // queue the message and send it after the origin is established
5138
5508
  if (targetWindow && targetOrigin) {
5139
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
5140
5509
  logger('Sending message %i to parent via postMessage', request.id);
5141
5510
  targetWindow.postMessage(request, targetOrigin);
5142
5511
  }
5143
5512
  else {
5144
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
5145
5513
  logger('Adding message %i to parent message queue', request.id);
5146
5514
  getTargetMessageQueue(targetWindow).push(request);
5147
5515
  }
@@ -5253,6 +5621,8 @@ function handleParentMessage(evt) {
5253
5621
  logger('Received a response from parent for message %i', message.id);
5254
5622
  if (callback) {
5255
5623
  logger('Invoking the registered callback for message %i with arguments %o', message.id, message.args);
5624
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
5625
+ // @ts-ignore
5256
5626
  callback.apply(null, communication_spreadArray(communication_spreadArray([], message.args, true), [message.isPartialResponse], false));
5257
5627
  // Remove the callback to ensure that the callback is called only once and to free up memory if response is a complete response
5258
5628
  if (!isPartialResponse(evt)) {
@@ -5295,7 +5665,8 @@ function handleChildMessage(evt) {
5295
5665
  var message_1 = evt.data;
5296
5666
  var _a = callHandler(message_1.func, message_1.args), called = _a[0], result = _a[1];
5297
5667
  if (called && typeof result !== 'undefined') {
5298
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
5668
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
5669
+ // @ts-ignore
5299
5670
  sendMessageResponseToChild(message_1.id, Array.isArray(result) ? result : [result]);
5300
5671
  }
5301
5672
  else {
@@ -5307,7 +5678,8 @@ function handleChildMessage(evt) {
5307
5678
  }
5308
5679
  if (Communication.childWindow) {
5309
5680
  var isPartialResponse_1 = args.pop();
5310
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
5681
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
5682
+ // @ts-ignore
5311
5683
  sendMessageResponseToChild(message_1.id, args, isPartialResponse_1);
5312
5684
  }
5313
5685
  });
@@ -5348,7 +5720,7 @@ function flushMessageQueue(targetWindow) {
5348
5720
  while (targetWindow && targetOrigin && targetMessageQueue.length > 0) {
5349
5721
  var request = targetMessageQueue.shift();
5350
5722
  /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
5351
- flushMessageQueueLogger('Flushing message %i from ' + target + ' message queue via postMessage.', request.id);
5723
+ flushMessageQueueLogger('Flushing message %i from ' + target + ' message queue via postMessage.', request === null || request === void 0 ? void 0 : request.id);
5352
5724
  targetWindow.postMessage(request, targetOrigin);
5353
5725
  }
5354
5726
  }
@@ -5373,7 +5745,6 @@ function waitForMessageQueue(targetWindow, callback) {
5373
5745
  */
5374
5746
  function sendMessageResponseToChild(id, args, isPartialResponse) {
5375
5747
  var targetWindow = Communication.childWindow;
5376
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
5377
5748
  var response = createMessageResponse(id, args, isPartialResponse);
5378
5749
  var targetOrigin = getTargetOrigin(targetWindow);
5379
5750
  if (targetWindow && targetOrigin) {
@@ -5406,12 +5777,13 @@ function sendMessageEventToChild(actionName, args) {
5406
5777
  * @internal
5407
5778
  * Limited to Microsoft-internal use
5408
5779
  */
5409
- function createMessageRequest(func, args) {
5780
+ function createMessageRequest(apiVersionTag, func, args) {
5410
5781
  return {
5411
5782
  id: CommunicationPrivate.nextMessageId++,
5412
5783
  func: func,
5413
5784
  timestamp: Date.now(),
5414
5785
  args: args || [],
5786
+ apiversiontag: apiVersionTag,
5415
5787
  };
5416
5788
  }
5417
5789
  /**
@@ -5427,7 +5799,7 @@ function createMessageResponse(id, args, isPartialResponse) {
5427
5799
  }
5428
5800
  /**
5429
5801
  * @hidden
5430
- * Creates a message object without any id, used for custom actions being sent to child frame/window
5802
+ * Creates a message object without any id and api version, used for custom actions being sent to child frame/window
5431
5803
  *
5432
5804
  * @internal
5433
5805
  * Limited to Microsoft-internal use
@@ -5445,6 +5817,7 @@ function createMessageEvent(func, args) {
5445
5817
 
5446
5818
 
5447
5819
 
5820
+
5448
5821
  /**
5449
5822
  * @hidden
5450
5823
  * Namespace to interact with the logging part of the SDK.
@@ -5467,8 +5840,8 @@ var logs;
5467
5840
  */
5468
5841
  function registerGetLogHandler(handler) {
5469
5842
  // allow for registration cleanup even when not finished initializing
5470
- handler && ensureInitialized(runtime);
5471
- if (handler && !isSupported()) {
5843
+ !isNullOrUndefined(handler) && internalAPIs_ensureInitialized(runtime_runtime);
5844
+ if (!isNullOrUndefined(handler) && !isSupported()) {
5472
5845
  throw errorNotSupportedOnPlatform;
5473
5846
  }
5474
5847
  if (handler) {
@@ -5494,7 +5867,7 @@ var logs;
5494
5867
  * Limited to Microsoft-internal use
5495
5868
  */
5496
5869
  function isSupported() {
5497
- return ensureInitialized(runtime) && runtime.supports.logs ? true : false;
5870
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.logs ? true : false;
5498
5871
  }
5499
5872
  logs.isSupported = isSupported;
5500
5873
  })(logs || (logs = {}));
@@ -5565,7 +5938,7 @@ var UserSettingTypes;
5565
5938
  * Limited to Microsoft-internal use
5566
5939
  */
5567
5940
  function uploadCustomApp(manifestBlob, onComplete) {
5568
- ensureInitialized(runtime);
5941
+ internalAPIs_ensureInitialized(runtime_runtime);
5569
5942
  sendMessageToParent('uploadCustomApp', [manifestBlob], onComplete ? onComplete : getGenericOnCompleteHandler());
5570
5943
  }
5571
5944
  /**
@@ -5581,7 +5954,7 @@ function uploadCustomApp(manifestBlob, onComplete) {
5581
5954
  * Limited to Microsoft-internal use
5582
5955
  */
5583
5956
  function sendCustomMessage(actionName, args, callback) {
5584
- ensureInitialized(runtime);
5957
+ internalAPIs_ensureInitialized(runtime_runtime);
5585
5958
  sendMessageToParent(actionName, args, callback);
5586
5959
  }
5587
5960
  /**
@@ -5597,7 +5970,7 @@ function sendCustomMessage(actionName, args, callback) {
5597
5970
  * Limited to Microsoft-internal use
5598
5971
  */
5599
5972
  function sendCustomEvent(actionName, args) {
5600
- ensureInitialized(runtime);
5973
+ internalAPIs_ensureInitialized(runtime_runtime);
5601
5974
  //validate childWindow
5602
5975
  if (!Communication.childWindow) {
5603
5976
  throw new Error('The child window has not yet been initialized or is not present');
@@ -5616,7 +5989,7 @@ function sendCustomEvent(actionName, args) {
5616
5989
  */
5617
5990
  function registerCustomHandler(actionName, customHandler) {
5618
5991
  var _this = this;
5619
- ensureInitialized(runtime);
5992
+ internalAPIs_ensureInitialized(runtime_runtime);
5620
5993
  registerHandler(actionName, function () {
5621
5994
  var args = [];
5622
5995
  for (var _i = 0; _i < arguments.length; _i++) {
@@ -5636,7 +6009,7 @@ function registerCustomHandler(actionName, customHandler) {
5636
6009
  * Limited to Microsoft-internal use
5637
6010
  */
5638
6011
  function registerUserSettingsChangeHandler(settingTypes, handler) {
5639
- ensureInitialized(runtime);
6012
+ internalAPIs_ensureInitialized(runtime_runtime);
5640
6013
  registerHandler('userSettingsChange', handler, true, [settingTypes]);
5641
6014
  }
5642
6015
  /**
@@ -5649,7 +6022,7 @@ function registerUserSettingsChangeHandler(settingTypes, handler) {
5649
6022
  * Limited to Microsoft-internal use
5650
6023
  */
5651
6024
  function openFilePreview(filePreviewParameters) {
5652
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
6025
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
5653
6026
  var params = [
5654
6027
  filePreviewParameters.entityId,
5655
6028
  filePreviewParameters.title,
@@ -5697,7 +6070,7 @@ var conversations;
5697
6070
  */
5698
6071
  function openConversation(openConversationRequest) {
5699
6072
  return new Promise(function (resolve) {
5700
- ensureInitialized(runtime, FrameContexts.content);
6073
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
5701
6074
  if (!isSupported()) {
5702
6075
  throw errorNotSupportedOnPlatform;
5703
6076
  }
@@ -5710,7 +6083,8 @@ var conversations;
5710
6083
  });
5711
6084
  if (openConversationRequest.onStartConversation) {
5712
6085
  registerHandler('startConversation', function (subEntityId, conversationId, channelId, entityId) {
5713
- return openConversationRequest.onStartConversation({
6086
+ var _a;
6087
+ return (_a = openConversationRequest.onStartConversation) === null || _a === void 0 ? void 0 : _a.call(openConversationRequest, {
5714
6088
  subEntityId: subEntityId,
5715
6089
  conversationId: conversationId,
5716
6090
  channelId: channelId,
@@ -5720,7 +6094,8 @@ var conversations;
5720
6094
  }
5721
6095
  if (openConversationRequest.onCloseConversation) {
5722
6096
  registerHandler('closeConversation', function (subEntityId, conversationId, channelId, entityId) {
5723
- return openConversationRequest.onCloseConversation({
6097
+ var _a;
6098
+ return (_a = openConversationRequest.onCloseConversation) === null || _a === void 0 ? void 0 : _a.call(openConversationRequest, {
5724
6099
  subEntityId: subEntityId,
5725
6100
  conversationId: conversationId,
5726
6101
  channelId: channelId,
@@ -5741,7 +6116,7 @@ var conversations;
5741
6116
  * Limited to Microsoft-internal use
5742
6117
  */
5743
6118
  function closeConversation() {
5744
- ensureInitialized(runtime, FrameContexts.content);
6119
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
5745
6120
  if (!isSupported()) {
5746
6121
  throw errorNotSupportedOnPlatform;
5747
6122
  }
@@ -5765,7 +6140,7 @@ var conversations;
5765
6140
  */
5766
6141
  function getChatMembers() {
5767
6142
  return new Promise(function (resolve) {
5768
- ensureInitialized(runtime);
6143
+ internalAPIs_ensureInitialized(runtime_runtime);
5769
6144
  if (!isSupported()) {
5770
6145
  throw errorNotSupportedOnPlatform;
5771
6146
  }
@@ -5783,7 +6158,7 @@ var conversations;
5783
6158
  * Limited to Microsoft-internal use
5784
6159
  */
5785
6160
  function isSupported() {
5786
- return ensureInitialized(runtime) && runtime.supports.conversations ? true : false;
6161
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.conversations ? true : false;
5787
6162
  }
5788
6163
  conversations.isSupported = isSupported;
5789
6164
  })(conversations || (conversations = {}));
@@ -5871,11 +6246,11 @@ var appInstallDialog;
5871
6246
  */
5872
6247
  function openAppInstallDialog(openAPPInstallDialogParams) {
5873
6248
  return new Promise(function (resolve) {
5874
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
6249
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
5875
6250
  if (!isSupported()) {
5876
6251
  throw new Error('Not supported');
5877
6252
  }
5878
- if (runtime.isLegacyTeams) {
6253
+ if (runtime_runtime.isLegacyTeams) {
5879
6254
  resolve(sendAndHandleStatusAndReason('executeDeepLink', createTeamsDeepLinkForAppInstallDialog(openAPPInstallDialogParams.appId)));
5880
6255
  }
5881
6256
  else {
@@ -5892,7 +6267,7 @@ var appInstallDialog;
5892
6267
  * @throws Error if {@linkcode app.initialize} has not successfully completed
5893
6268
  */
5894
6269
  function isSupported() {
5895
- return ensureInitialized(runtime) && runtime.supports.appInstallDialog ? true : false;
6270
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.appInstallDialog ? true : false;
5896
6271
  }
5897
6272
  appInstallDialog.isSupported = isSupported;
5898
6273
  })(appInstallDialog || (appInstallDialog = {}));
@@ -5924,6 +6299,9 @@ var __extends = (undefined && undefined.__extends) || (function () {
5924
6299
 
5925
6300
 
5926
6301
 
6302
+
6303
+
6304
+ var mediaLogger = getLogger('media');
5927
6305
  /**
5928
6306
  * Interact with media, including capturing and viewing images.
5929
6307
  */
@@ -5962,17 +6340,17 @@ var media;
5962
6340
  if (!callback) {
5963
6341
  throw new Error('[captureImage] Callback cannot be null');
5964
6342
  }
5965
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
6343
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
5966
6344
  if (!GlobalVars.isFramelessWindow) {
5967
6345
  var notSupportedError = { errorCode: ErrorCode.NOT_SUPPORTED_ON_PLATFORM };
5968
6346
  /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
5969
- callback(notSupportedError, undefined);
6347
+ callback(notSupportedError, []);
5970
6348
  return;
5971
6349
  }
5972
6350
  if (!isCurrentSDKVersionAtLeast(captureImageMobileSupportVersion)) {
5973
6351
  var oldPlatformError = { errorCode: ErrorCode.OLD_PLATFORM };
5974
6352
  /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
5975
- callback(oldPlatformError, undefined);
6353
+ callback(oldPlatformError, []);
5976
6354
  return;
5977
6355
  }
5978
6356
  sendMessageToParent('captureImage', callback);
@@ -5987,7 +6365,7 @@ var media;
5987
6365
  * @beta
5988
6366
  */
5989
6367
  function hasPermission() {
5990
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
6368
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
5991
6369
  if (!isPermissionSupported()) {
5992
6370
  throw errorNotSupportedOnPlatform;
5993
6371
  }
@@ -6006,7 +6384,7 @@ var media;
6006
6384
  * @beta
6007
6385
  */
6008
6386
  function requestPermission() {
6009
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
6387
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
6010
6388
  if (!isPermissionSupported()) {
6011
6389
  throw errorNotSupportedOnPlatform;
6012
6390
  }
@@ -6023,7 +6401,7 @@ var media;
6023
6401
  * @throws Error if {@linkcode app.initialize} has not successfully completed
6024
6402
  */
6025
6403
  function isPermissionSupported() {
6026
- return ensureInitialized(runtime) && runtime.supports.permissions ? true : false;
6404
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.permissions ? true : false;
6027
6405
  }
6028
6406
  /**
6029
6407
  * Media object returned by the select Media API
@@ -6031,7 +6409,6 @@ var media;
6031
6409
  var Media = /** @class */ (function (_super) {
6032
6410
  __extends(Media, _super);
6033
6411
  function Media(that) {
6034
- if (that === void 0) { that = null; }
6035
6412
  var _this = _super.call(this) || this;
6036
6413
  if (that) {
6037
6414
  _this.content = that.content;
@@ -6052,17 +6429,15 @@ var media;
6052
6429
  if (!callback) {
6053
6430
  throw new Error('[get Media] Callback cannot be null');
6054
6431
  }
6055
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
6432
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
6056
6433
  if (!isCurrentSDKVersionAtLeast(mediaAPISupportVersion)) {
6057
6434
  var oldPlatformError = { errorCode: ErrorCode.OLD_PLATFORM };
6058
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
6059
- callback(oldPlatformError, null);
6435
+ callback(oldPlatformError, new Blob());
6060
6436
  return;
6061
6437
  }
6062
6438
  if (!validateGetMediaInputs(this.mimeType, this.format, this.content)) {
6063
6439
  var invalidInput = { errorCode: ErrorCode.INVALID_ARGUMENTS };
6064
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
6065
- callback(invalidInput, null);
6440
+ callback(invalidInput, new Blob());
6066
6441
  return;
6067
6442
  }
6068
6443
  // Call the new get media implementation via callbacks if the client version is greater than or equal to '2.0.0'
@@ -6083,8 +6458,7 @@ var media;
6083
6458
  function handleGetMediaCallbackRequest(mediaResult) {
6084
6459
  if (callback) {
6085
6460
  if (mediaResult && mediaResult.error) {
6086
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
6087
- callback(mediaResult.error, null);
6461
+ callback(mediaResult.error, new Blob());
6088
6462
  }
6089
6463
  else {
6090
6464
  if (mediaResult && mediaResult.mediaChunk) {
@@ -6092,17 +6466,21 @@ var media;
6092
6466
  // create file/blob when all chunks have arrived and we get 0/-1 as chunksequence number
6093
6467
  if (mediaResult.mediaChunk.chunkSequence <= 0) {
6094
6468
  var file = createFile(helper.assembleAttachment, helper.mediaMimeType);
6095
- callback(mediaResult.error, file);
6469
+ callback(mediaResult.error, file !== null && file !== void 0 ? file : new Blob());
6096
6470
  }
6097
6471
  else {
6098
6472
  // Keep pushing chunks into assemble attachment
6099
6473
  var assemble = decodeAttachment(mediaResult.mediaChunk, helper.mediaMimeType);
6100
- helper.assembleAttachment.push(assemble);
6474
+ if (assemble) {
6475
+ helper.assembleAttachment.push(assemble);
6476
+ }
6477
+ else {
6478
+ mediaLogger("Received a null assemble attachment for when decoding chunk sequence ".concat(mediaResult.mediaChunk.chunkSequence, "; not including the chunk in the assembled file."));
6479
+ }
6101
6480
  }
6102
6481
  }
6103
6482
  else {
6104
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
6105
- callback({ errorCode: ErrorCode.INTERNAL_ERROR, message: 'data received is null' }, null);
6483
+ callback({ errorCode: ErrorCode.INTERNAL_ERROR, message: 'data received is null' }, new Blob());
6106
6484
  }
6107
6485
  }
6108
6486
  }
@@ -6117,14 +6495,13 @@ var media;
6117
6495
  assembleAttachment: [],
6118
6496
  };
6119
6497
  var params = [actionName, this.content];
6120
- this.content && callback && sendMessageToParent('getMedia', params);
6498
+ this.content && !isNullOrUndefined(callback) && sendMessageToParent('getMedia', params);
6121
6499
  function handleGetMediaRequest(response) {
6122
6500
  if (callback) {
6123
6501
  /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
6124
6502
  var mediaResult = JSON.parse(response);
6125
6503
  if (mediaResult.error) {
6126
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
6127
- callback(mediaResult.error, null);
6504
+ callback(mediaResult.error, new Blob());
6128
6505
  removeHandler('getMedia' + actionName);
6129
6506
  }
6130
6507
  else {
@@ -6133,18 +6510,19 @@ var media;
6133
6510
  // create file/blob when all chunks have arrived and we get 0/-1 as chunksequence number
6134
6511
  if (mediaResult.mediaChunk.chunkSequence <= 0) {
6135
6512
  var file = createFile(helper.assembleAttachment, helper.mediaMimeType);
6136
- callback(mediaResult.error, file);
6513
+ callback(mediaResult.error, file !== null && file !== void 0 ? file : new Blob());
6137
6514
  removeHandler('getMedia' + actionName);
6138
6515
  }
6139
6516
  else {
6140
6517
  // Keep pushing chunks into assemble attachment
6141
6518
  var assemble = decodeAttachment(mediaResult.mediaChunk, helper.mediaMimeType);
6142
- helper.assembleAttachment.push(assemble);
6519
+ if (assemble) {
6520
+ helper.assembleAttachment.push(assemble);
6521
+ }
6143
6522
  }
6144
6523
  }
6145
6524
  else {
6146
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
6147
- callback({ errorCode: ErrorCode.INTERNAL_ERROR, message: 'data received is null' }, null);
6525
+ callback({ errorCode: ErrorCode.INTERNAL_ERROR, message: 'data received is null' }, new Blob());
6148
6526
  removeHandler('getMedia' + actionName);
6149
6527
  }
6150
6528
  }
@@ -6174,7 +6552,7 @@ var media;
6174
6552
  * Optional; @param callback is used to send app if host client has successfully handled the notification event or not
6175
6553
  */
6176
6554
  MediaController.prototype.notifyEventToHost = function (mediaEvent, callback) {
6177
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
6555
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
6178
6556
  try {
6179
6557
  throwExceptionIfMobileApiIsNotSupported(nonFullScreenVideoModeAPISupportVersion);
6180
6558
  }
@@ -6308,42 +6686,38 @@ var media;
6308
6686
  if (!callback) {
6309
6687
  throw new Error('[select Media] Callback cannot be null');
6310
6688
  }
6311
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
6689
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
6312
6690
  if (!isCurrentSDKVersionAtLeast(mediaAPISupportVersion)) {
6313
6691
  var oldPlatformError = { errorCode: ErrorCode.OLD_PLATFORM };
6314
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
6315
- callback(oldPlatformError, null);
6692
+ callback(oldPlatformError, []);
6316
6693
  return;
6317
6694
  }
6318
6695
  try {
6319
6696
  throwExceptionIfMediaCallIsNotSupportedOnMobile(mediaInputs);
6320
6697
  }
6321
6698
  catch (err) {
6322
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
6323
- callback(err, null);
6699
+ callback(err, []);
6324
6700
  return;
6325
6701
  }
6326
6702
  if (!validateSelectMediaInputs(mediaInputs)) {
6327
6703
  var invalidInput = { errorCode: ErrorCode.INVALID_ARGUMENTS };
6328
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
6329
- callback(invalidInput, null);
6704
+ callback(invalidInput, []);
6330
6705
  return;
6331
6706
  }
6332
6707
  var params = [mediaInputs];
6333
6708
  // What comes back from native as attachments would just be objects and will be missing getMedia method on them
6334
6709
  sendMessageToParent('selectMedia', params, function (err, localAttachments, mediaEvent) {
6710
+ var _a, _b;
6335
6711
  // MediaControllerEvent response is used to notify the app about events and is a partial response to selectMedia
6336
6712
  if (mediaEvent) {
6337
6713
  if (isVideoControllerRegistered(mediaInputs)) {
6338
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
6339
- mediaInputs.videoProps.videoController.notifyEventToApp(mediaEvent);
6714
+ (_b = (_a = mediaInputs === null || mediaInputs === void 0 ? void 0 : mediaInputs.videoProps) === null || _a === void 0 ? void 0 : _a.videoController) === null || _b === void 0 ? void 0 : _b.notifyEventToApp(mediaEvent);
6340
6715
  }
6341
6716
  return;
6342
6717
  }
6343
6718
  // Media Attachments are final response to selectMedia
6344
6719
  if (!localAttachments) {
6345
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
6346
- callback(err, null);
6720
+ callback(err, []);
6347
6721
  return;
6348
6722
  }
6349
6723
  var mediaArray = [];
@@ -6365,7 +6739,7 @@ var media;
6365
6739
  if (!callback) {
6366
6740
  throw new Error('[view images] Callback cannot be null');
6367
6741
  }
6368
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
6742
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
6369
6743
  if (!isCurrentSDKVersionAtLeast(mediaAPISupportVersion)) {
6370
6744
  var oldPlatformError = { errorCode: ErrorCode.OLD_PLATFORM };
6371
6745
  callback(oldPlatformError);
@@ -6396,7 +6770,7 @@ var media;
6396
6770
  if (!callback) {
6397
6771
  throw new Error('[media.scanBarCode] Callback cannot be null');
6398
6772
  }
6399
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
6773
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
6400
6774
  if (GlobalVars.hostClientType === HostClientType.desktop ||
6401
6775
  GlobalVars.hostClientType === HostClientType.web ||
6402
6776
  GlobalVars.hostClientType === HostClientType.rigel ||
@@ -6405,21 +6779,17 @@ var media;
6405
6779
  GlobalVars.hostClientType === HostClientType.teamsPhones ||
6406
6780
  GlobalVars.hostClientType === HostClientType.teamsDisplays) {
6407
6781
  var notSupportedError = { errorCode: ErrorCode.NOT_SUPPORTED_ON_PLATFORM };
6408
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
6409
- callback(notSupportedError, null);
6782
+ callback(notSupportedError, '');
6410
6783
  return;
6411
6784
  }
6412
6785
  if (!isCurrentSDKVersionAtLeast(scanBarCodeAPIMobileSupportVersion)) {
6413
6786
  var oldPlatformError = { errorCode: ErrorCode.OLD_PLATFORM };
6414
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
6415
- callback(oldPlatformError, null);
6787
+ callback(oldPlatformError, '');
6416
6788
  return;
6417
6789
  }
6418
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
6419
6790
  if (!validateScanBarCodeInput(config)) {
6420
6791
  var invalidInput = { errorCode: ErrorCode.INVALID_ARGUMENTS };
6421
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
6422
- callback(invalidInput, null);
6792
+ callback(invalidInput, '');
6423
6793
  return;
6424
6794
  }
6425
6795
  sendMessageToParent('media.scanBarCode', [config], callback);
@@ -6442,7 +6812,7 @@ function createFile(assembleAttachment, mimeType) {
6442
6812
  if (assembleAttachment == null || mimeType == null || assembleAttachment.length <= 0) {
6443
6813
  return null;
6444
6814
  }
6445
- var file;
6815
+ var file = null;
6446
6816
  var sequence = 1;
6447
6817
  assembleAttachment.sort(function (a, b) { return (a.sequence > b.sequence ? 1 : -1); });
6448
6818
  assembleAttachment.forEach(function (item) {
@@ -6605,8 +6975,8 @@ function validateViewImagesInput(uriList) {
6605
6975
  function validateScanBarCodeInput(barCodeConfig) {
6606
6976
  if (barCodeConfig) {
6607
6977
  if (barCodeConfig.timeOutIntervalInSec === null ||
6608
- barCodeConfig.timeOutIntervalInSec <= 0 ||
6609
- barCodeConfig.timeOutIntervalInSec > 60) {
6978
+ (barCodeConfig.timeOutIntervalInSec != undefined && barCodeConfig.timeOutIntervalInSec <= 0) ||
6979
+ (barCodeConfig.timeOutIntervalInSec != undefined && barCodeConfig.timeOutIntervalInSec > 60)) {
6610
6980
  return false;
6611
6981
  }
6612
6982
  }
@@ -6669,7 +7039,7 @@ var barCode;
6669
7039
  */
6670
7040
  function scanBarCode(barCodeConfig) {
6671
7041
  return new Promise(function (resolve) {
6672
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
7042
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
6673
7043
  if (!isSupported()) {
6674
7044
  throw errorNotSupportedOnPlatform;
6675
7045
  }
@@ -6688,7 +7058,7 @@ var barCode;
6688
7058
  * @beta
6689
7059
  */
6690
7060
  function hasPermission() {
6691
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
7061
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
6692
7062
  if (!isSupported()) {
6693
7063
  throw errorNotSupportedOnPlatform;
6694
7064
  }
@@ -6706,7 +7076,7 @@ var barCode;
6706
7076
  * @beta
6707
7077
  */
6708
7078
  function requestPermission() {
6709
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
7079
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
6710
7080
  if (!isSupported()) {
6711
7081
  throw errorNotSupportedOnPlatform;
6712
7082
  }
@@ -6725,7 +7095,7 @@ var barCode;
6725
7095
  * @beta
6726
7096
  */
6727
7097
  function isSupported() {
6728
- return ensureInitialized(runtime) && runtime.supports.barCode && runtime.supports.permissions ? true : false;
7098
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.barCode && runtime_runtime.supports.permissions ? true : false;
6729
7099
  }
6730
7100
  barCode.isSupported = isSupported;
6731
7101
  })(barCode || (barCode = {}));
@@ -6755,11 +7125,11 @@ var chat;
6755
7125
  */
6756
7126
  function openChat(openChatRequest) {
6757
7127
  return new Promise(function (resolve) {
6758
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
7128
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
6759
7129
  if (!isSupported()) {
6760
7130
  throw errorNotSupportedOnPlatform;
6761
7131
  }
6762
- if (runtime.isLegacyTeams) {
7132
+ if (runtime_runtime.isLegacyTeams) {
6763
7133
  resolve(sendAndHandleStatusAndReason('executeDeepLink', createTeamsDeepLinkForChat([openChatRequest.user], undefined /*topic*/, openChatRequest.message)));
6764
7134
  }
6765
7135
  else {
@@ -6796,11 +7166,11 @@ var chat;
6796
7166
  openChat(chatRequest);
6797
7167
  }
6798
7168
  else {
6799
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
7169
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
6800
7170
  if (!isSupported()) {
6801
7171
  throw errorNotSupportedOnPlatform;
6802
7172
  }
6803
- if (runtime.isLegacyTeams) {
7173
+ if (runtime_runtime.isLegacyTeams) {
6804
7174
  resolve(sendAndHandleStatusAndReason('executeDeepLink', createTeamsDeepLinkForChat(openChatRequest.users, openChatRequest.topic, openChatRequest.message)));
6805
7175
  }
6806
7176
  else {
@@ -6824,7 +7194,7 @@ var chat;
6824
7194
  * @beta
6825
7195
  */
6826
7196
  function isSupported() {
6827
- return ensureInitialized(runtime) && runtime.supports.chat ? true : false;
7197
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.chat ? true : false;
6828
7198
  }
6829
7199
  chat.isSupported = isSupported;
6830
7200
  })(chat || (chat = {}));
@@ -6897,7 +7267,7 @@ var clipboard;
6897
7267
  return __generator(this, function (_a) {
6898
7268
  switch (_a.label) {
6899
7269
  case 0:
6900
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task, FrameContexts.stage, FrameContexts.sidePanel);
7270
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.meetingStage, FrameContexts.task, FrameContexts.settings, FrameContexts.stage, FrameContexts.sidePanel);
6901
7271
  if (!isSupported()) {
6902
7272
  throw errorNotSupportedOnPlatform;
6903
7273
  }
@@ -6930,7 +7300,7 @@ var clipboard;
6930
7300
  return __generator(this, function (_c) {
6931
7301
  switch (_c.label) {
6932
7302
  case 0:
6933
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task, FrameContexts.stage, FrameContexts.sidePanel);
7303
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.meetingStage, FrameContexts.task, FrameContexts.settings, FrameContexts.stage, FrameContexts.sidePanel);
6934
7304
  if (!isSupported()) {
6935
7305
  throw errorNotSupportedOnPlatform;
6936
7306
  }
@@ -6955,7 +7325,7 @@ var clipboard;
6955
7325
  * @beta
6956
7326
  */
6957
7327
  function isSupported() {
6958
- return ensureInitialized(runtime) && navigator && navigator.clipboard && runtime.supports.clipboard ? true : false;
7328
+ return internalAPIs_ensureInitialized(runtime_runtime) && navigator && navigator.clipboard && runtime_runtime.supports.clipboard ? true : false;
6959
7329
  }
6960
7330
  clipboard.isSupported = isSupported;
6961
7331
  })(clipboard || (clipboard = {}));
@@ -6966,6 +7336,11 @@ var clipboard;
6966
7336
 
6967
7337
 
6968
7338
 
7339
+
7340
+ /**
7341
+ * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY
7342
+ */
7343
+ var geoLocationTelemetryVersionNumber = ApiVersionNumber.V_2;
6969
7344
  /**
6970
7345
  * Namespace to interact with the geoLocation module-specific part of the SDK. This is the newer version of location module.
6971
7346
  *
@@ -6980,11 +7355,14 @@ var geoLocation;
6980
7355
  * @beta
6981
7356
  */
6982
7357
  function getCurrentLocation() {
6983
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
7358
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
6984
7359
  if (!isSupported()) {
6985
7360
  throw errorNotSupportedOnPlatform;
6986
7361
  }
6987
- return sendAndHandleSdkError('location.getLocation', { allowChooseLocation: false, showMap: false });
7362
+ return sendAndHandleSdkErrorWithVersion(getApiVersionTag(geoLocationTelemetryVersionNumber, ApiName.GeoLocation_GetCurrentLocation), 'location.getLocation', {
7363
+ allowChooseLocation: false,
7364
+ showMap: false,
7365
+ });
6988
7366
  }
6989
7367
  geoLocation.getCurrentLocation = getCurrentLocation;
6990
7368
  /**
@@ -6996,13 +7374,13 @@ var geoLocation;
6996
7374
  * @beta
6997
7375
  */
6998
7376
  function hasPermission() {
6999
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
7377
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
7000
7378
  if (!isSupported()) {
7001
7379
  throw errorNotSupportedOnPlatform;
7002
7380
  }
7003
7381
  var permissions = DevicePermission.GeoLocation;
7004
7382
  return new Promise(function (resolve) {
7005
- resolve(sendAndHandleSdkError('permissions.has', permissions));
7383
+ resolve(sendAndHandleSdkErrorWithVersion(getApiVersionTag(geoLocationTelemetryVersionNumber, ApiName.GeoLocation_HasPermission), 'permissions.has', permissions));
7006
7384
  });
7007
7385
  }
7008
7386
  geoLocation.hasPermission = hasPermission;
@@ -7016,13 +7394,13 @@ var geoLocation;
7016
7394
  * @beta
7017
7395
  */
7018
7396
  function requestPermission() {
7019
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
7397
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
7020
7398
  if (!isSupported()) {
7021
7399
  throw errorNotSupportedOnPlatform;
7022
7400
  }
7023
7401
  var permissions = DevicePermission.GeoLocation;
7024
7402
  return new Promise(function (resolve) {
7025
- resolve(sendAndHandleSdkError('permissions.request', permissions));
7403
+ resolve(sendAndHandleSdkErrorWithVersion(getApiVersionTag(geoLocationTelemetryVersionNumber, ApiName.GeoLocation_RequestPermission), 'permissions.request', permissions));
7026
7404
  });
7027
7405
  }
7028
7406
  geoLocation.requestPermission = requestPermission;
@@ -7035,7 +7413,7 @@ var geoLocation;
7035
7413
  * @beta
7036
7414
  */
7037
7415
  function isSupported() {
7038
- return ensureInitialized(runtime) && runtime.supports.geoLocation && runtime.supports.permissions ? true : false;
7416
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.geoLocation && runtime_runtime.supports.permissions ? true : false;
7039
7417
  }
7040
7418
  geoLocation.isSupported = isSupported;
7041
7419
  /**
@@ -7053,11 +7431,14 @@ var geoLocation;
7053
7431
  * @beta
7054
7432
  */
7055
7433
  function chooseLocation() {
7056
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
7434
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
7057
7435
  if (!isSupported()) {
7058
7436
  throw errorNotSupportedOnPlatform;
7059
7437
  }
7060
- return sendAndHandleSdkError('location.getLocation', { allowChooseLocation: true, showMap: true });
7438
+ return sendAndHandleSdkErrorWithVersion(getApiVersionTag(geoLocationTelemetryVersionNumber, ApiName.GeoLocation_Map_ChooseLocation), 'location.getLocation', {
7439
+ allowChooseLocation: true,
7440
+ showMap: true,
7441
+ });
7061
7442
  }
7062
7443
  map.chooseLocation = chooseLocation;
7063
7444
  /**
@@ -7069,14 +7450,14 @@ var geoLocation;
7069
7450
  * @beta
7070
7451
  */
7071
7452
  function showLocation(location) {
7072
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
7453
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
7073
7454
  if (!isSupported()) {
7074
7455
  throw errorNotSupportedOnPlatform;
7075
7456
  }
7076
7457
  if (!location) {
7077
7458
  throw { errorCode: ErrorCode.INVALID_ARGUMENTS };
7078
7459
  }
7079
- return sendAndHandleSdkError('location.showLocation', location);
7460
+ return sendAndHandleSdkErrorWithVersion(getApiVersionTag(geoLocationTelemetryVersionNumber, ApiName.GeoLocation_ShowLocation), 'location.showLocation', location);
7080
7461
  }
7081
7462
  map.showLocation = showLocation;
7082
7463
  /**
@@ -7088,10 +7469,10 @@ var geoLocation;
7088
7469
  * @beta
7089
7470
  */
7090
7471
  function isSupported() {
7091
- return ensureInitialized(runtime) &&
7092
- runtime.supports.geoLocation &&
7093
- runtime.supports.geoLocation.map &&
7094
- runtime.supports.permissions
7472
+ return internalAPIs_ensureInitialized(runtime_runtime) &&
7473
+ runtime_runtime.supports.geoLocation &&
7474
+ runtime_runtime.supports.geoLocation.map &&
7475
+ runtime_runtime.supports.permissions
7095
7476
  ? true
7096
7477
  : false;
7097
7478
  }
@@ -7106,11 +7487,11 @@ var geoLocation;
7106
7487
  * version supported by the host, or undefined if the host does not support Adaptive Cards
7107
7488
  */
7108
7489
  function getAdaptiveCardSchemaVersion() {
7109
- if (!runtime.hostVersionsInfo) {
7490
+ if (!runtime_runtime.hostVersionsInfo) {
7110
7491
  return undefined;
7111
7492
  }
7112
7493
  else {
7113
- return runtime.hostVersionsInfo.adaptiveCardSchemaVersion;
7494
+ return runtime_runtime.hostVersionsInfo.adaptiveCardSchemaVersion;
7114
7495
  }
7115
7496
  }
7116
7497
 
@@ -7138,7 +7519,7 @@ var ChildAppWindow = /** @class */ (function () {
7138
7519
  * @param onComplete - The callback to know if the postMessage has been success/failed.
7139
7520
  */
7140
7521
  ChildAppWindow.prototype.postMessage = function (message, onComplete) {
7141
- ensureInitialized(runtime);
7522
+ internalAPIs_ensureInitialized(runtime_runtime);
7142
7523
  sendMessageToParent('messageForChild', [message], onComplete ? onComplete : getGenericOnCompleteHandler());
7143
7524
  };
7144
7525
  /**
@@ -7148,7 +7529,7 @@ var ChildAppWindow = /** @class */ (function () {
7148
7529
  * @param listener - The listener that will be called
7149
7530
  */
7150
7531
  ChildAppWindow.prototype.addEventListener = function (type, listener) {
7151
- ensureInitialized(runtime);
7532
+ internalAPIs_ensureInitialized(runtime_runtime);
7152
7533
  if (type === 'message') {
7153
7534
  registerHandler('messageForParent', listener);
7154
7535
  }
@@ -7180,7 +7561,7 @@ var ParentAppWindow = /** @class */ (function () {
7180
7561
  * @param onComplete - The callback to know if the postMessage has been success/failed.
7181
7562
  */
7182
7563
  ParentAppWindow.prototype.postMessage = function (message, onComplete) {
7183
- ensureInitialized(runtime, FrameContexts.task);
7564
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.task);
7184
7565
  sendMessageToParent('messageForParent', [message], onComplete ? onComplete : getGenericOnCompleteHandler());
7185
7566
  };
7186
7567
  /**
@@ -7190,7 +7571,7 @@ var ParentAppWindow = /** @class */ (function () {
7190
7571
  * @param listener - The listener that will be called
7191
7572
  */
7192
7573
  ParentAppWindow.prototype.addEventListener = function (type, listener) {
7193
- ensureInitialized(runtime, FrameContexts.task);
7574
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.task);
7194
7575
  if (type === 'message') {
7195
7576
  registerHandler('messageForChild', listener);
7196
7577
  }
@@ -7229,7 +7610,7 @@ var secondaryBrowser;
7229
7610
  * @beta
7230
7611
  */
7231
7612
  function open(url) {
7232
- ensureInitialized(runtime, FrameContexts.content);
7613
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
7233
7614
  if (!isSupported()) {
7234
7615
  throw errorNotSupportedOnPlatform;
7235
7616
  }
@@ -7248,7 +7629,7 @@ var secondaryBrowser;
7248
7629
  * @beta
7249
7630
  */
7250
7631
  function isSupported() {
7251
- return ensureInitialized(runtime) && runtime.supports.secondaryBrowser ? true : false;
7632
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.secondaryBrowser ? true : false;
7252
7633
  }
7253
7634
  secondaryBrowser.isSupported = isSupported;
7254
7635
  })(secondaryBrowser || (secondaryBrowser = {}));
@@ -7260,6 +7641,11 @@ var secondaryBrowser;
7260
7641
 
7261
7642
 
7262
7643
 
7644
+
7645
+ /**
7646
+ * v1 APIs telemetry file: All of APIs in this capability file should send out API version v1 ONLY
7647
+ */
7648
+ var locationTelemetryVersionNumber = ApiVersionNumber.V_1;
7263
7649
  /**
7264
7650
  * @deprecated
7265
7651
  * As of 2.1.0, please use geoLocation namespace.
@@ -7282,7 +7668,7 @@ var location_location;
7282
7668
  if (!callback) {
7283
7669
  throw new Error('[location.getLocation] Callback cannot be null');
7284
7670
  }
7285
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
7671
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
7286
7672
  if (!isCurrentSDKVersionAtLeast(locationAPIsRequiredVersion)) {
7287
7673
  throw { errorCode: ErrorCode.OLD_PLATFORM };
7288
7674
  }
@@ -7292,7 +7678,7 @@ var location_location;
7292
7678
  if (!isSupported()) {
7293
7679
  throw errorNotSupportedOnPlatform;
7294
7680
  }
7295
- sendMessageToParent('location.getLocation', [props], callback);
7681
+ communication_sendMessageToParentWithVersion(getApiVersionTag(locationTelemetryVersionNumber, ApiName.Location_GetLocation), 'location.getLocation', [props], callback);
7296
7682
  }
7297
7683
  location_1.getLocation = getLocation;
7298
7684
  /**
@@ -7308,7 +7694,7 @@ var location_location;
7308
7694
  if (!callback) {
7309
7695
  throw new Error('[location.showLocation] Callback cannot be null');
7310
7696
  }
7311
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
7697
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
7312
7698
  if (!isCurrentSDKVersionAtLeast(locationAPIsRequiredVersion)) {
7313
7699
  throw { errorCode: ErrorCode.OLD_PLATFORM };
7314
7700
  }
@@ -7318,7 +7704,7 @@ var location_location;
7318
7704
  if (!isSupported()) {
7319
7705
  throw errorNotSupportedOnPlatform;
7320
7706
  }
7321
- sendMessageToParent('location.showLocation', [location], callback);
7707
+ communication_sendMessageToParentWithVersion(getApiVersionTag(locationTelemetryVersionNumber, ApiName.Location_ShowLocation), 'location.showLocation', [location], callback);
7322
7708
  }
7323
7709
  location_1.showLocation = showLocation;
7324
7710
  /**
@@ -7332,7 +7718,7 @@ var location_location;
7332
7718
  * @returns boolean to represent whether Location is supported
7333
7719
  */
7334
7720
  function isSupported() {
7335
- return ensureInitialized(runtime) && runtime.supports.location ? true : false;
7721
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.location ? true : false;
7336
7722
  }
7337
7723
  location_1.isSupported = isSupported;
7338
7724
  })(location_location || (location_location = {}));
@@ -7517,7 +7903,7 @@ var meeting;
7517
7903
  if (!callback) {
7518
7904
  throw new Error('[get incoming client audio state] Callback cannot be null');
7519
7905
  }
7520
- ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
7906
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
7521
7907
  sendMessageToParent('getIncomingClientAudioState', callback);
7522
7908
  }
7523
7909
  meeting.getIncomingClientAudioState = getIncomingClientAudioState;
@@ -7539,7 +7925,7 @@ var meeting;
7539
7925
  if (!callback) {
7540
7926
  throw new Error('[toggle incoming client audio] Callback cannot be null');
7541
7927
  }
7542
- ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
7928
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
7543
7929
  sendMessageToParent('toggleIncomingClientAudio', callback);
7544
7930
  }
7545
7931
  meeting.toggleIncomingClientAudio = toggleIncomingClientAudio;
@@ -7558,7 +7944,7 @@ var meeting;
7558
7944
  if (!callback) {
7559
7945
  throw new Error('[get meeting details] Callback cannot be null');
7560
7946
  }
7561
- ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage, FrameContexts.settings, FrameContexts.content);
7947
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel, FrameContexts.meetingStage, FrameContexts.settings, FrameContexts.content);
7562
7948
  sendMessageToParent('meeting.getMeetingDetails', callback);
7563
7949
  }
7564
7950
  meeting.getMeetingDetails = getMeetingDetails;
@@ -7577,7 +7963,7 @@ var meeting;
7577
7963
  if (!callback) {
7578
7964
  throw new Error('[get Authentication Token For AnonymousUser] Callback cannot be null');
7579
7965
  }
7580
- ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage, FrameContexts.task);
7966
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel, FrameContexts.meetingStage, FrameContexts.task);
7581
7967
  sendMessageToParent('meeting.getAuthenticationTokenForAnonymousUser', callback);
7582
7968
  }
7583
7969
  meeting.getAuthenticationTokenForAnonymousUser = getAuthenticationTokenForAnonymousUser;
@@ -7598,7 +7984,7 @@ var meeting;
7598
7984
  if (!callback) {
7599
7985
  throw new Error('[get live stream state] Callback cannot be null');
7600
7986
  }
7601
- ensureInitialized(runtime, FrameContexts.sidePanel);
7987
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel);
7602
7988
  sendMessageToParent('meeting.getLiveStreamState', callback);
7603
7989
  }
7604
7990
  meeting.getLiveStreamState = getLiveStreamState;
@@ -7622,7 +8008,7 @@ var meeting;
7622
8008
  if (!callback) {
7623
8009
  throw new Error('[request start live streaming] Callback cannot be null');
7624
8010
  }
7625
- ensureInitialized(runtime, FrameContexts.sidePanel);
8011
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel);
7626
8012
  sendMessageToParent('meeting.requestStartLiveStreaming', [streamUrl, streamKey], callback);
7627
8013
  }
7628
8014
  meeting.requestStartLiveStreaming = requestStartLiveStreaming;
@@ -7641,7 +8027,7 @@ var meeting;
7641
8027
  if (!callback) {
7642
8028
  throw new Error('[request stop live streaming] Callback cannot be null');
7643
8029
  }
7644
- ensureInitialized(runtime, FrameContexts.sidePanel);
8030
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel);
7645
8031
  sendMessageToParent('meeting.requestStopLiveStreaming', callback);
7646
8032
  }
7647
8033
  meeting.requestStopLiveStreaming = requestStopLiveStreaming;
@@ -7661,7 +8047,7 @@ var meeting;
7661
8047
  if (!handler) {
7662
8048
  throw new Error('[register live stream changed handler] Handler cannot be null');
7663
8049
  }
7664
- ensureInitialized(runtime, FrameContexts.sidePanel);
8050
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel);
7665
8051
  registerHandler('meeting.liveStreamChanged', handler);
7666
8052
  }
7667
8053
  meeting.registerLiveStreamChangedHandler = registerLiveStreamChangedHandler;
@@ -7687,7 +8073,7 @@ var meeting;
7687
8073
  if (!callback) {
7688
8074
  throw new Error('[share app content to stage] Callback cannot be null');
7689
8075
  }
7690
- ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
8076
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
7691
8077
  sendMessageToParent('meeting.shareAppContentToStage', [appContentUrl], callback);
7692
8078
  }
7693
8079
  meeting.shareAppContentToStage = shareAppContentToStage;
@@ -7712,7 +8098,7 @@ var meeting;
7712
8098
  if (!callback) {
7713
8099
  throw new Error('[get app content stage sharing capabilities] Callback cannot be null');
7714
8100
  }
7715
- ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
8101
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
7716
8102
  sendMessageToParent('meeting.getAppContentStageSharingCapabilities', callback);
7717
8103
  }
7718
8104
  meeting.getAppContentStageSharingCapabilities = getAppContentStageSharingCapabilities;
@@ -7729,7 +8115,7 @@ var meeting;
7729
8115
  if (!callback) {
7730
8116
  throw new Error('[stop sharing app content to stage] Callback cannot be null');
7731
8117
  }
7732
- ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
8118
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
7733
8119
  sendMessageToParent('meeting.stopSharingAppContentToStage', callback);
7734
8120
  }
7735
8121
  meeting.stopSharingAppContentToStage = stopSharingAppContentToStage;
@@ -7751,7 +8137,7 @@ var meeting;
7751
8137
  if (!callback) {
7752
8138
  throw new Error('[get app content stage sharing state] Callback cannot be null');
7753
8139
  }
7754
- ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
8140
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
7755
8141
  sendMessageToParent('meeting.getAppContentStageSharingState', callback);
7756
8142
  }
7757
8143
  meeting.getAppContentStageSharingState = getAppContentStageSharingState;
@@ -7774,7 +8160,7 @@ var meeting;
7774
8160
  if (!handler) {
7775
8161
  throw new Error('[registerSpeakingStateChangeHandler] Handler cannot be null');
7776
8162
  }
7777
- ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
8163
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
7778
8164
  registerHandler('meeting.speakingStateChanged', handler);
7779
8165
  }
7780
8166
  meeting.registerSpeakingStateChangeHandler = registerSpeakingStateChangeHandler;
@@ -7798,7 +8184,7 @@ var meeting;
7798
8184
  if (!handler) {
7799
8185
  throw new Error('[registerRaiseHandStateChangedHandler] Handler cannot be null');
7800
8186
  }
7801
- ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
8187
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
7802
8188
  registerHandler('meeting.raiseHandStateChanged', handler);
7803
8189
  }
7804
8190
  meeting.registerRaiseHandStateChangedHandler = registerRaiseHandStateChangedHandler;
@@ -7820,7 +8206,7 @@ var meeting;
7820
8206
  if (!handler) {
7821
8207
  throw new Error('[registerMeetingReactionReceivedHandler] Handler cannot be null');
7822
8208
  }
7823
- ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
8209
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
7824
8210
  registerHandler('meeting.meetingReactionReceived', handler);
7825
8211
  }
7826
8212
  meeting.registerMeetingReactionReceivedHandler = registerMeetingReactionReceivedHandler;
@@ -7855,7 +8241,7 @@ var meeting;
7855
8241
  * @beta
7856
8242
  */
7857
8243
  function setOptions(shareInformation) {
7858
- ensureInitialized(runtime, FrameContexts.sidePanel);
8244
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel);
7859
8245
  if (shareInformation.contentUrl) {
7860
8246
  new URL(shareInformation.contentUrl);
7861
8247
  }
@@ -7895,7 +8281,7 @@ var meeting;
7895
8281
  if (!requestAppAudioHandlingParams.micMuteStateChangedCallback) {
7896
8282
  throw new Error('[requestAppAudioHandling] Callback Mic mute state handler cannot be null');
7897
8283
  }
7898
- ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
8284
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
7899
8285
  if (requestAppAudioHandlingParams.isAppHandlingAudio) {
7900
8286
  startAppAudioHandling(requestAppAudioHandlingParams, callback);
7901
8287
  }
@@ -7977,7 +8363,7 @@ var meeting;
7977
8363
  }
7978
8364
  meeting.updateMicState = updateMicState;
7979
8365
  function setMicStateWithReason(micState, reason) {
7980
- ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
8366
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
7981
8367
  sendMessageToParent('meeting.updateMicState', [micState, reason]);
7982
8368
  }
7983
8369
  })(meeting || (meeting = {}));
@@ -8018,7 +8404,7 @@ var monetization;
8018
8404
  resolve(sendAndHandleSdkError('monetization.openPurchaseExperience', planInfo));
8019
8405
  });
8020
8406
  };
8021
- ensureInitialized(runtime, FrameContexts.content);
8407
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
8022
8408
  return callCallbackWithErrorOrResultOrNullFromPromiseAndReturnPromise(wrappedFunction, callback);
8023
8409
  }
8024
8410
  monetization.openPurchaseExperience = openPurchaseExperience;
@@ -8031,7 +8417,7 @@ var monetization;
8031
8417
  * @throws Error if {@linkcode app.initialize} has not successfully completed
8032
8418
  */
8033
8419
  function isSupported() {
8034
- return ensureInitialized(runtime) && runtime.supports.monetization ? true : false;
8420
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.monetization ? true : false;
8035
8421
  }
8036
8422
  monetization.isSupported = isSupported;
8037
8423
  })(monetization || (monetization = {}));
@@ -8054,7 +8440,7 @@ var calendar;
8054
8440
  */
8055
8441
  function openCalendarItem(openCalendarItemParams) {
8056
8442
  return new Promise(function (resolve) {
8057
- ensureInitialized(runtime, FrameContexts.content);
8443
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
8058
8444
  if (!isSupported()) {
8059
8445
  throw new Error('Not supported');
8060
8446
  }
@@ -8072,11 +8458,11 @@ var calendar;
8072
8458
  */
8073
8459
  function composeMeeting(composeMeetingParams) {
8074
8460
  return new Promise(function (resolve) {
8075
- ensureInitialized(runtime, FrameContexts.content);
8461
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
8076
8462
  if (!isSupported()) {
8077
8463
  throw new Error('Not supported');
8078
8464
  }
8079
- if (runtime.isLegacyTeams) {
8465
+ if (runtime_runtime.isLegacyTeams) {
8080
8466
  resolve(sendAndHandleStatusAndReason('executeDeepLink', createTeamsDeepLinkForCalendar(composeMeetingParams.attendees, composeMeetingParams.startTime, composeMeetingParams.endTime, composeMeetingParams.subject, composeMeetingParams.content)));
8081
8467
  }
8082
8468
  else {
@@ -8092,7 +8478,7 @@ var calendar;
8092
8478
  * @throws Error if {@linkcode app.initialize} has not successfully completed
8093
8479
  */
8094
8480
  function isSupported() {
8095
- return ensureInitialized(runtime) && runtime.supports.calendar ? true : false;
8481
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.calendar ? true : false;
8096
8482
  }
8097
8483
  calendar.isSupported = isSupported;
8098
8484
  })(calendar || (calendar = {}));
@@ -8114,7 +8500,7 @@ var mail;
8114
8500
  */
8115
8501
  function openMailItem(openMailItemParams) {
8116
8502
  return new Promise(function (resolve) {
8117
- ensureInitialized(runtime, FrameContexts.content);
8503
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
8118
8504
  if (!isSupported()) {
8119
8505
  throw new Error('Not supported');
8120
8506
  }
@@ -8133,7 +8519,7 @@ var mail;
8133
8519
  */
8134
8520
  function composeMail(composeMailParams) {
8135
8521
  return new Promise(function (resolve) {
8136
- ensureInitialized(runtime, FrameContexts.content);
8522
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
8137
8523
  if (!isSupported()) {
8138
8524
  throw new Error('Not supported');
8139
8525
  }
@@ -8148,7 +8534,7 @@ var mail;
8148
8534
  * @throws Error if {@linkcode app.initialize} has not successfully completed
8149
8535
  */
8150
8536
  function isSupported() {
8151
- return ensureInitialized(runtime) && runtime.supports.mail ? true : false;
8537
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.mail ? true : false;
8152
8538
  }
8153
8539
  mail.isSupported = isSupported;
8154
8540
  /** Defines compose mail types. */
@@ -8183,7 +8569,7 @@ var teamsCore;
8183
8569
  */
8184
8570
  function enablePrintCapability() {
8185
8571
  if (!GlobalVars.printCapabilityEnabled) {
8186
- ensureInitialized(runtime);
8572
+ internalAPIs_ensureInitialized(runtime_runtime);
8187
8573
  if (!isSupported()) {
8188
8574
  throw errorNotSupportedOnPlatform;
8189
8575
  }
@@ -8239,7 +8625,7 @@ var teamsCore;
8239
8625
  */
8240
8626
  function registerOnLoadHandlerHelper(handler, versionSpecificHelper) {
8241
8627
  // allow for registration cleanup even when not finished initializing
8242
- !isNullOrUndefined(handler) && ensureInitialized(runtime);
8628
+ !isNullOrUndefined(handler) && internalAPIs_ensureInitialized(runtime_runtime);
8243
8629
  if (!isNullOrUndefined(handler) && versionSpecificHelper) {
8244
8630
  versionSpecificHelper();
8245
8631
  }
@@ -8280,7 +8666,7 @@ var teamsCore;
8280
8666
  */
8281
8667
  function registerBeforeUnloadHandlerHelper(handler, versionSpecificHelper) {
8282
8668
  // allow for registration cleanup even when not finished initializing
8283
- !isNullOrUndefined(handler) && ensureInitialized(runtime);
8669
+ !isNullOrUndefined(handler) && internalAPIs_ensureInitialized(runtime_runtime);
8284
8670
  if (!isNullOrUndefined(handler) && versionSpecificHelper) {
8285
8671
  versionSpecificHelper();
8286
8672
  }
@@ -8296,7 +8682,7 @@ var teamsCore;
8296
8682
  *
8297
8683
  */
8298
8684
  function isSupported() {
8299
- return ensureInitialized(runtime) && runtime.supports.teamsCore ? true : false;
8685
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.teamsCore ? true : false;
8300
8686
  }
8301
8687
  teamsCore.isSupported = isSupported;
8302
8688
  })(teamsCore || (teamsCore = {}));
@@ -8323,7 +8709,7 @@ var people;
8323
8709
  */
8324
8710
  function selectPeople(param1, param2) {
8325
8711
  var _a;
8326
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task, FrameContexts.settings);
8712
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task, FrameContexts.settings);
8327
8713
  var callback = undefined;
8328
8714
  var peoplePickerInputs = undefined;
8329
8715
  if (typeof param1 === 'function') {
@@ -8357,7 +8743,7 @@ var people;
8357
8743
  * @throws Error if {@linkcode app.initialize} has not successfully completed
8358
8744
  */
8359
8745
  function isSupported() {
8360
- return ensureInitialized(runtime) && runtime.supports.people ? true : false;
8746
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.people ? true : false;
8361
8747
  }
8362
8748
  people_1.isSupported = isSupported;
8363
8749
  })(people || (people = {}));
@@ -8447,7 +8833,7 @@ var profile;
8447
8833
  * @beta
8448
8834
  */
8449
8835
  function showProfile(showProfileRequest) {
8450
- ensureInitialized(runtime, FrameContexts.content);
8836
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
8451
8837
  return new Promise(function (resolve) {
8452
8838
  var _a = validateShowProfileRequest(showProfileRequest), isValid = _a[0], message = _a[1];
8453
8839
  if (!isValid) {
@@ -8478,7 +8864,7 @@ var profile;
8478
8864
  * @beta
8479
8865
  */
8480
8866
  function isSupported() {
8481
- return ensureInitialized(runtime) && runtime.supports.profile ? true : false;
8867
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.profile ? true : false;
8482
8868
  }
8483
8869
  profile.isSupported = isSupported;
8484
8870
  })(profile || (profile = {}));
@@ -9369,7 +9755,7 @@ var videoEffects;
9369
9755
  * ```
9370
9756
  */
9371
9757
  function registerForVideoFrame(parameters) {
9372
- ensureInitialized(runtime, FrameContexts.sidePanel);
9758
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel);
9373
9759
  if (!isSupported()) {
9374
9760
  throw errorNotSupportedOnPlatform;
9375
9761
  }
@@ -9401,7 +9787,7 @@ var videoEffects;
9401
9787
  * @param effectId - Newly selected effect id.
9402
9788
  */
9403
9789
  function notifySelectedVideoEffectChanged(effectChangeType, effectId) {
9404
- ensureInitialized(runtime, FrameContexts.sidePanel);
9790
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel);
9405
9791
  if (!isSupported()) {
9406
9792
  throw errorNotSupportedOnPlatform;
9407
9793
  }
@@ -9414,7 +9800,7 @@ var videoEffects;
9414
9800
  * @param callback - Function to be called when new video effect is applied.
9415
9801
  */
9416
9802
  function registerForVideoEffect(callback) {
9417
- ensureInitialized(runtime, FrameContexts.sidePanel);
9803
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel);
9418
9804
  if (!isSupported()) {
9419
9805
  throw errorNotSupportedOnPlatform;
9420
9806
  }
@@ -9447,15 +9833,15 @@ var videoEffects;
9447
9833
  *
9448
9834
  */
9449
9835
  function isSupported() {
9450
- return (ensureInitialized(runtime) &&
9451
- !!runtime.supports.video &&
9836
+ return (internalAPIs_ensureInitialized(runtime_runtime) &&
9837
+ !!runtime_runtime.supports.video &&
9452
9838
  /** A host should support either mediaStream or sharedFrame sub-capability to support the video capability */
9453
- (!!runtime.supports.video.mediaStream || !!runtime.supports.video.sharedFrame));
9839
+ (!!runtime_runtime.supports.video.mediaStream || !!runtime_runtime.supports.video.sharedFrame));
9454
9840
  }
9455
9841
  videoEffects.isSupported = isSupported;
9456
9842
  function registerForMediaStream(videoFrameHandler, config) {
9457
9843
  var _this = this;
9458
- ensureInitialized(runtime, FrameContexts.sidePanel);
9844
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel);
9459
9845
  if (!isSupported() || !doesSupportMediaStream()) {
9460
9846
  throw errorNotSupportedOnPlatform;
9461
9847
  }
@@ -9494,7 +9880,7 @@ var videoEffects;
9494
9880
  }); };
9495
9881
  }
9496
9882
  function registerForVideoBuffer(videoBufferHandler, config) {
9497
- ensureInitialized(runtime, FrameContexts.sidePanel);
9883
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel);
9498
9884
  if (!isSupported() || !doesSupportSharedFrame()) {
9499
9885
  throw errorNotSupportedOnPlatform;
9500
9886
  }
@@ -9524,9 +9910,9 @@ var videoEffects;
9524
9910
  }
9525
9911
  function doesSupportMediaStream() {
9526
9912
  var _a;
9527
- return (ensureInitialized(runtime, FrameContexts.sidePanel) &&
9913
+ return (internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel) &&
9528
9914
  isTextureStreamAvailable() &&
9529
- !!((_a = runtime.supports.video) === null || _a === void 0 ? void 0 : _a.mediaStream));
9915
+ !!((_a = runtime_runtime.supports.video) === null || _a === void 0 ? void 0 : _a.mediaStream));
9530
9916
  }
9531
9917
  function isTextureStreamAvailable() {
9532
9918
  var _a, _b, _c, _d;
@@ -9534,7 +9920,7 @@ var videoEffects;
9534
9920
  }
9535
9921
  function doesSupportSharedFrame() {
9536
9922
  var _a;
9537
- return ensureInitialized(runtime, FrameContexts.sidePanel) && !!((_a = runtime.supports.video) === null || _a === void 0 ? void 0 : _a.sharedFrame);
9923
+ return internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel) && !!((_a = runtime_runtime.supports.video) === null || _a === void 0 ? void 0 : _a.sharedFrame);
9538
9924
  }
9539
9925
  })(videoEffects || (videoEffects = {})); //end of video namespace
9540
9926
 
@@ -9599,7 +9985,7 @@ var search;
9599
9985
  * @beta
9600
9986
  */
9601
9987
  function registerHandlers(onClosedHandler, onExecuteHandler, onChangeHandler) {
9602
- ensureInitialized(runtime, FrameContexts.content);
9988
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
9603
9989
  if (!isSupported()) {
9604
9990
  throw errorNotSupportedOnPlatform;
9605
9991
  }
@@ -9617,7 +10003,7 @@ var search;
9617
10003
  * @beta
9618
10004
  */
9619
10005
  function unregisterHandlers() {
9620
- ensureInitialized(runtime, FrameContexts.content);
10006
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
9621
10007
  if (!isSupported()) {
9622
10008
  throw errorNotSupportedOnPlatform;
9623
10009
  }
@@ -9638,7 +10024,7 @@ var search;
9638
10024
  * @beta
9639
10025
  */
9640
10026
  function isSupported() {
9641
- return ensureInitialized(runtime) && runtime.supports.search ? true : false;
10027
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.search ? true : false;
9642
10028
  }
9643
10029
  search.isSupported = isSupported;
9644
10030
  /**
@@ -9648,7 +10034,7 @@ var search;
9648
10034
  */
9649
10035
  function closeSearch() {
9650
10036
  return new Promise(function (resolve) {
9651
- ensureInitialized(runtime, FrameContexts.content);
10037
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
9652
10038
  if (!isSupported()) {
9653
10039
  throw new Error('Not supported');
9654
10040
  }
@@ -9691,7 +10077,7 @@ var sharing;
9691
10077
  var wrappedFunction = function () { return Promise.reject(err); };
9692
10078
  return callCallbackWithSdkErrorFromPromiseAndReturnPromise(wrappedFunction, callback);
9693
10079
  }
9694
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
10080
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
9695
10081
  return callCallbackWithSdkErrorFromPromiseAndReturnPromise(shareWebContentHelper, callback, shareWebContentRequest);
9696
10082
  }
9697
10083
  sharing.shareWebContent = shareWebContent;
@@ -9758,7 +10144,7 @@ var sharing;
9758
10144
  * @throws Error if {@linkcode app.initialize} has not successfully completed
9759
10145
  */
9760
10146
  function isSupported() {
9761
- return ensureInitialized(runtime) && runtime.supports.sharing ? true : false;
10147
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.sharing ? true : false;
9762
10148
  }
9763
10149
  sharing.isSupported = isSupported;
9764
10150
  })(sharing || (sharing = {}));
@@ -9804,7 +10190,7 @@ var stageView;
9804
10190
  */
9805
10191
  function open(stageViewParams) {
9806
10192
  return new Promise(function (resolve) {
9807
- ensureInitialized(runtime, FrameContexts.content);
10193
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
9808
10194
  if (!isSupported()) {
9809
10195
  throw errorNotSupportedOnPlatform;
9810
10196
  }
@@ -9824,7 +10210,7 @@ var stageView;
9824
10210
  *
9825
10211
  */
9826
10212
  function isSupported() {
9827
- return ensureInitialized(runtime) && runtime.supports.stageView ? true : false;
10213
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.stageView ? true : false;
9828
10214
  }
9829
10215
  stageView.isSupported = isSupported;
9830
10216
  })(stageView || (stageView = {}));
@@ -9919,7 +10305,7 @@ var visualMedia;
9919
10305
  * @beta
9920
10306
  */
9921
10307
  function hasPermission() {
9922
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
10308
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
9923
10309
  if (!image.isSupported()) {
9924
10310
  throw errorNotSupportedOnPlatform;
9925
10311
  }
@@ -9937,7 +10323,7 @@ var visualMedia;
9937
10323
  * @beta
9938
10324
  */
9939
10325
  function requestPermission() {
9940
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
10326
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
9941
10327
  if (!image.isSupported()) {
9942
10328
  throw errorNotSupportedOnPlatform;
9943
10329
  }
@@ -9968,7 +10354,7 @@ var visualMedia;
9968
10354
  return visualMedia_generator(this, function (_a) {
9969
10355
  switch (_a.label) {
9970
10356
  case 0:
9971
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
10357
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
9972
10358
  ensureSupported();
9973
10359
  ensureImageInputValid(cameraImageInputs);
9974
10360
  return [4 /*yield*/, sendAndHandleSdkError('visualMedia.image.captureImages', cameraImageInputs)];
@@ -9996,7 +10382,7 @@ var visualMedia;
9996
10382
  return visualMedia_generator(this, function (_a) {
9997
10383
  switch (_a.label) {
9998
10384
  case 0:
9999
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
10385
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
10000
10386
  ensureSupported();
10001
10387
  ensureImageInputValid(galleryImageInputs);
10002
10388
  return [4 /*yield*/, sendAndHandleSdkError('visualMedia.image.retrieveImages', galleryImageInputs)];
@@ -10018,10 +10404,10 @@ var visualMedia;
10018
10404
  * @beta
10019
10405
  */
10020
10406
  function isSupported() {
10021
- return ensureInitialized(runtime) &&
10022
- runtime.supports.visualMedia &&
10023
- runtime.supports.visualMedia.image &&
10024
- runtime.supports.permissions
10407
+ return internalAPIs_ensureInitialized(runtime_runtime) &&
10408
+ runtime_runtime.supports.visualMedia &&
10409
+ runtime_runtime.supports.visualMedia.image &&
10410
+ runtime_runtime.supports.permissions
10025
10411
  ? true
10026
10412
  : false;
10027
10413
  }
@@ -10088,7 +10474,7 @@ var webStorage;
10088
10474
  * @beta
10089
10475
  */
10090
10476
  function isWebStorageClearedOnUserLogOut() {
10091
- ensureInitialized(runtime);
10477
+ internalAPIs_ensureInitialized(runtime_runtime);
10092
10478
  return isSupported();
10093
10479
  }
10094
10480
  webStorage.isWebStorageClearedOnUserLogOut = isWebStorageClearedOnUserLogOut;
@@ -10101,7 +10487,7 @@ var webStorage;
10101
10487
  * @beta
10102
10488
  */
10103
10489
  function isSupported() {
10104
- return ensureInitialized(runtime) && runtime.supports.webStorage ? true : false;
10490
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.webStorage ? true : false;
10105
10491
  }
10106
10492
  webStorage.isSupported = isSupported;
10107
10493
  })(webStorage || (webStorage = {}));
@@ -10144,11 +10530,11 @@ var call;
10144
10530
  function startCall(startCallParams) {
10145
10531
  return new Promise(function (resolve) {
10146
10532
  var _a;
10147
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
10533
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
10148
10534
  if (!isSupported()) {
10149
10535
  throw errorNotSupportedOnPlatform;
10150
10536
  }
10151
- if (runtime.isLegacyTeams) {
10537
+ if (runtime_runtime.isLegacyTeams) {
10152
10538
  resolve(sendAndUnwrap('executeDeepLink', createTeamsDeepLinkForCall(startCallParams.targets, (_a = startCallParams.requestedModalities) === null || _a === void 0 ? void 0 : _a.includes(CallModalities.Video), startCallParams.source)).then(function (result) {
10153
10539
  if (!result) {
10154
10540
  throw new Error(errorCallNotStarted);
@@ -10169,7 +10555,7 @@ var call;
10169
10555
  * @throws Error if {@linkcode app.initialize} has not successfully completed
10170
10556
  */
10171
10557
  function isSupported() {
10172
- return ensureInitialized(runtime) && runtime.supports.call ? true : false;
10558
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.call ? true : false;
10173
10559
  }
10174
10560
  call.isSupported = isSupported;
10175
10561
  })(call || (call = {}));
@@ -10256,6 +10642,12 @@ var appInitialization;
10256
10642
 
10257
10643
 
10258
10644
 
10645
+
10646
+
10647
+ /**
10648
+ * v1 APIs telemetry file: All of APIs in this capability file should send out API version v1 ONLY
10649
+ */
10650
+ var publicAPIsTelemetryVersionNumber = ApiVersionNumber.V_1;
10259
10651
  /**
10260
10652
  * @deprecated
10261
10653
  * As of 2.0.0, please use {@link app.initialize app.initialize(validMessageOrigins?: string[]): Promise\<void\>} instead.
@@ -10267,7 +10659,7 @@ var appInitialization;
10267
10659
  * https: protocol otherwise they will be ignored. Example: https://www.example.com
10268
10660
  */
10269
10661
  function initialize(callback, validMessageOrigins) {
10270
- app.initialize(validMessageOrigins).then(function () {
10662
+ appInitializeHelper(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_Initialize), validMessageOrigins).then(function () {
10271
10663
  if (callback) {
10272
10664
  callback();
10273
10665
  }
@@ -10301,7 +10693,7 @@ function print() {
10301
10693
  */
10302
10694
  function getContext(callback) {
10303
10695
  ensureInitializeCalled();
10304
- sendMessageToParent('getContext', function (context) {
10696
+ communication_sendMessageToParentWithVersion(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_GetContext), 'getContext', function (context) {
10305
10697
  if (!context.frameContext) {
10306
10698
  // Fallback logic for frameContext properties
10307
10699
  context.frameContext = GlobalVars.frameContext;
@@ -10318,8 +10710,8 @@ function getContext(callback) {
10318
10710
  *
10319
10711
  * @param handler - The handler to invoke when the user changes their theme.
10320
10712
  */
10321
- function registerOnThemeChangeHandler(handler) {
10322
- app.registerOnThemeChangeHandler(handler);
10713
+ function publicAPIs_registerOnThemeChangeHandler(handler) {
10714
+ registerOnThemeChangeHandlerHelper(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_RegisterOnThemeChangeHandlerHelper), handler);
10323
10715
  }
10324
10716
  /**
10325
10717
  * @deprecated
@@ -10331,7 +10723,7 @@ function registerOnThemeChangeHandler(handler) {
10331
10723
  * @param handler - The handler to invoke when the user toggles full-screen view for a tab.
10332
10724
  */
10333
10725
  function registerFullScreenHandler(handler) {
10334
- registerHandlerHelper('fullScreenChange', handler, []);
10726
+ registerHandlerHelperWithVersion(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_RegisterFullScreenHandler), 'fullScreenChange', handler, []);
10335
10727
  }
10336
10728
  /**
10337
10729
  * @deprecated
@@ -10343,7 +10735,7 @@ function registerFullScreenHandler(handler) {
10343
10735
  * @param handler - The handler to invoke when the personal app button is clicked in the app bar.
10344
10736
  */
10345
10737
  function registerAppButtonClickHandler(handler) {
10346
- registerHandlerHelper('appButtonClick', handler, [FrameContexts.content]);
10738
+ registerHandlerHelperWithVersion(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_RegisterAppButtonClickHandler), 'appButtonClick', handler, [FrameContexts.content]);
10347
10739
  }
10348
10740
  /**
10349
10741
  * @deprecated
@@ -10355,7 +10747,7 @@ function registerAppButtonClickHandler(handler) {
10355
10747
  * @param handler - The handler to invoke when entering hover of the personal app button in the app bar.
10356
10748
  */
10357
10749
  function registerAppButtonHoverEnterHandler(handler) {
10358
- registerHandlerHelper('appButtonHoverEnter', handler, [FrameContexts.content]);
10750
+ registerHandlerHelperWithVersion(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_RegisterAppButtonHoverEnterHandler), 'appButtonHoverEnter', handler, [FrameContexts.content]);
10359
10751
  }
10360
10752
  /**
10361
10753
  * @deprecated
@@ -10367,7 +10759,7 @@ function registerAppButtonHoverEnterHandler(handler) {
10367
10759
  *
10368
10760
  */
10369
10761
  function registerAppButtonHoverLeaveHandler(handler) {
10370
- registerHandlerHelper('appButtonHoverLeave', handler, [FrameContexts.content]);
10762
+ registerHandlerHelperWithVersion(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_RegisterAppButtonHoverLeaveHandler), 'appButtonHoverLeave', handler, [FrameContexts.content]);
10371
10763
  }
10372
10764
  /**
10373
10765
  * @deprecated
@@ -10381,7 +10773,7 @@ function registerAppButtonHoverLeaveHandler(handler) {
10381
10773
  * @param handler - The handler to invoke when the user presses their Team client's back button.
10382
10774
  */
10383
10775
  function registerBackButtonHandler(handler) {
10384
- pages.backStack.registerBackButtonHandlerHelper(handler);
10776
+ pages.backStack.registerBackButtonHandlerHelper(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_RegisterBackButtonHandler), handler);
10385
10777
  }
10386
10778
  /**
10387
10779
  * @deprecated
@@ -10418,7 +10810,7 @@ function registerBeforeUnloadHandler(handler) {
10418
10810
  * @param handler - The handler to invoked by the app when they want the focus to be in the place of their choice.
10419
10811
  */
10420
10812
  function registerFocusEnterHandler(handler) {
10421
- registerHandlerHelper('focusEnter', handler, []);
10813
+ registerHandlerHelperWithVersion(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_RegisterFocusEnterHandler), 'focusEnter', handler, []);
10422
10814
  }
10423
10815
  /**
10424
10816
  * @deprecated
@@ -10429,7 +10821,7 @@ function registerFocusEnterHandler(handler) {
10429
10821
  * @param handler - The handler to invoke when the user click on Settings.
10430
10822
  */
10431
10823
  function registerChangeSettingsHandler(handler) {
10432
- registerHandlerHelper('changeSettings', handler, [FrameContexts.content]);
10824
+ registerHandlerHelperWithVersion(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_RegisterChangeSettingsHandler), 'changeSettings', handler, [FrameContexts.content]);
10433
10825
  }
10434
10826
  /**
10435
10827
  * @deprecated
@@ -10442,8 +10834,8 @@ function registerChangeSettingsHandler(handler) {
10442
10834
  * @param tabInstanceParameters - OPTIONAL Flags that specify whether to scope call to favorite teams or channels.
10443
10835
  */
10444
10836
  function getTabInstances(callback, tabInstanceParameters) {
10445
- ensureInitialized(runtime);
10446
- pages.tabs.getTabInstances(tabInstanceParameters).then(function (tabInfo) {
10837
+ internalAPIs_ensureInitialized(runtime_runtime);
10838
+ getTabInstancesHelper(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_GetTabInstances), tabInstanceParameters).then(function (tabInfo) {
10447
10839
  callback(tabInfo);
10448
10840
  });
10449
10841
  }
@@ -10457,8 +10849,8 @@ function getTabInstances(callback, tabInstanceParameters) {
10457
10849
  * @param tabInstanceParameters - OPTIONAL Ignored, kept for future use
10458
10850
  */
10459
10851
  function getMruTabInstances(callback, tabInstanceParameters) {
10460
- ensureInitialized(runtime);
10461
- pages.tabs.getMruTabInstances(tabInstanceParameters).then(function (tabInfo) {
10852
+ internalAPIs_ensureInitialized(runtime_runtime);
10853
+ getMruTabInstancesHelper(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_GetMruTabInstances), tabInstanceParameters).then(function (tabInfo) {
10462
10854
  callback(tabInfo);
10463
10855
  });
10464
10856
  }
@@ -10471,7 +10863,7 @@ function getMruTabInstances(callback, tabInstanceParameters) {
10471
10863
  * @param deepLinkParameters - ID and label for the link and fallback URL.
10472
10864
  */
10473
10865
  function shareDeepLink(deepLinkParameters) {
10474
- pages.shareDeepLink({
10866
+ shareDeepLinkHelper(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_ShareDeepLink), {
10475
10867
  subPageId: deepLinkParameters.subEntityId,
10476
10868
  subPageLabel: deepLinkParameters.subEntityLabel,
10477
10869
  subPageWebUrl: deepLinkParameters.subEntityWebUrl,
@@ -10486,10 +10878,9 @@ function shareDeepLink(deepLinkParameters) {
10486
10878
  * @param deepLink - deep link.
10487
10879
  */
10488
10880
  function executeDeepLink(deepLink, onComplete) {
10489
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
10881
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
10490
10882
  var completionHandler = onComplete !== null && onComplete !== void 0 ? onComplete : getGenericOnCompleteHandler();
10491
- app
10492
- .openLink(deepLink)
10883
+ openLinkHelper(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_ExecuteDeepLink), deepLink)
10493
10884
  .then(function () {
10494
10885
  completionHandler(true);
10495
10886
  })
@@ -10506,7 +10897,7 @@ function executeDeepLink(deepLink, onComplete) {
10506
10897
  * @param frameContext - FrameContext information to be set
10507
10898
  */
10508
10899
  function setFrameContext(frameContext) {
10509
- pages.setCurrentFrame(frameContext);
10900
+ setCurrentFrameHelper(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_SetFrameContext), frameContext);
10510
10901
  }
10511
10902
  /**
10512
10903
  * @deprecated
@@ -10520,7 +10911,8 @@ function setFrameContext(frameContext) {
10520
10911
  * They must have https: protocol otherwise they will be ignored. Example: https:www.example.com
10521
10912
  */
10522
10913
  function initializeWithFrameContext(frameContext, callback, validMessageOrigins) {
10523
- pages.initializeWithFrameContext(frameContext, callback, validMessageOrigins);
10914
+ appInitializeHelper(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_Initialize), validMessageOrigins).then(function () { return callback && callback(); });
10915
+ setCurrentFrameHelper(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_SetFrameContext), frameContext);
10524
10916
  }
10525
10917
 
10526
10918
  ;// CONCATENATED MODULE: ./src/public/navigation.ts
@@ -10529,6 +10921,11 @@ function initializeWithFrameContext(frameContext, callback, validMessageOrigins)
10529
10921
 
10530
10922
 
10531
10923
 
10924
+
10925
+ /**
10926
+ * v1 APIs telemetry file: All of APIs in this capability file should send out API version v1 ONLY
10927
+ */
10928
+ var navigationTelemetryVersionNumber = ApiVersionNumber.V_1;
10532
10929
  /**
10533
10930
  * @deprecated
10534
10931
  * As of 2.0.0, please use {@link pages.returnFocus pages.returnFocus(navigateForward?: boolean): void} instead.
@@ -10538,7 +10935,7 @@ function initializeWithFrameContext(frameContext, callback, validMessageOrigins)
10538
10935
  * @param navigateForward - Determines the direction to focus in teams app.
10539
10936
  */
10540
10937
  function returnFocus(navigateForward) {
10541
- pages.returnFocus(navigateForward);
10938
+ returnFocusHelper(getApiVersionTag(navigationTelemetryVersionNumber, ApiName.Navigation_ReturnFocus), navigateForward);
10542
10939
  }
10543
10940
  /**
10544
10941
  * @deprecated
@@ -10550,10 +10947,9 @@ function returnFocus(navigateForward) {
10550
10947
  * @param onComplete - The callback to invoke when the action is complete.
10551
10948
  */
10552
10949
  function navigateToTab(tabInstance, onComplete) {
10553
- ensureInitialized(runtime);
10950
+ internalAPIs_ensureInitialized(runtime_runtime);
10554
10951
  var completionHandler = onComplete !== null && onComplete !== void 0 ? onComplete : getGenericOnCompleteHandler();
10555
- pages.tabs
10556
- .navigateToTab(tabInstance)
10952
+ tabsNavigateToTabHelper(getApiVersionTag(navigationTelemetryVersionNumber, ApiName.Navigation_NavigateToTab), tabInstance)
10557
10953
  .then(function () {
10558
10954
  completionHandler(true);
10559
10955
  })
@@ -10575,10 +10971,9 @@ function navigateToTab(tabInstance, onComplete) {
10575
10971
  * @param onComplete - The callback to invoke when the action is complete.
10576
10972
  */
10577
10973
  function navigateCrossDomain(url, onComplete) {
10578
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.remove, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
10974
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.remove, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
10579
10975
  var completionHandler = onComplete !== null && onComplete !== void 0 ? onComplete : getGenericOnCompleteHandler();
10580
- pages
10581
- .navigateCrossDomain(url)
10976
+ navigateCrossDomainHelper(getApiVersionTag(navigationTelemetryVersionNumber, ApiName.Navigation_NavigateCrossDomain), url)
10582
10977
  .then(function () {
10583
10978
  completionHandler(true);
10584
10979
  })
@@ -10596,10 +10991,9 @@ function navigateCrossDomain(url, onComplete) {
10596
10991
  * @param onComplete - The callback to invoke when the action is complete.
10597
10992
  */
10598
10993
  function navigateBack(onComplete) {
10599
- ensureInitialized(runtime);
10994
+ internalAPIs_ensureInitialized(runtime_runtime);
10600
10995
  var completionHandler = onComplete !== null && onComplete !== void 0 ? onComplete : getGenericOnCompleteHandler();
10601
- pages.backStack
10602
- .navigateBack()
10996
+ backStackNavigateBackHelper(getApiVersionTag(navigationTelemetryVersionNumber, ApiName.Navigation_NavigateBack))
10603
10997
  .then(function () {
10604
10998
  completionHandler(true);
10605
10999
  })
@@ -10645,7 +11039,7 @@ var settings;
10645
11039
  * @param callback - The callback to invoke when the {@link Settings} object is retrieved.
10646
11040
  */
10647
11041
  function getSettings(callback) {
10648
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.settings, FrameContexts.remove, FrameContexts.sidePanel);
11042
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.settings, FrameContexts.remove, FrameContexts.sidePanel);
10649
11043
  pages.getConfig().then(function (config) {
10650
11044
  callback(config);
10651
11045
  });
@@ -10661,7 +11055,7 @@ var settings;
10661
11055
  * @param - Set the desired settings for this instance.
10662
11056
  */
10663
11057
  function setSettings(instanceSettings, onComplete) {
10664
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.settings, FrameContexts.sidePanel);
11058
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.settings, FrameContexts.sidePanel);
10665
11059
  var completionHandler = onComplete !== null && onComplete !== void 0 ? onComplete : getGenericOnCompleteHandler();
10666
11060
  pages.config
10667
11061
  .setConfig(instanceSettings)
@@ -10724,6 +11118,11 @@ var tasks_rest = (undefined && undefined.__rest) || function (s, e) {
10724
11118
 
10725
11119
 
10726
11120
 
11121
+
11122
+ /**
11123
+ * v1 APIs telemetry file: All of APIs in this capability file should send out API version v1 ONLY
11124
+ */
11125
+ var tasksTelemetryVersionNumber = ApiVersionNumber.V_1;
10727
11126
  /**
10728
11127
  * @deprecated
10729
11128
  * As of 2.0.0, please use {@link dialog} namespace instead.
@@ -10750,22 +11149,23 @@ var tasks;
10750
11149
  * @param submitHandler - Handler to call when the task module is completed
10751
11150
  */
10752
11151
  function startTask(taskInfo, submitHandler) {
11152
+ var apiVersionTag = getApiVersionTag(tasksTelemetryVersionNumber, ApiName.Tasks_StartTask);
10753
11153
  var dialogSubmitHandler = submitHandler
10754
11154
  ? function (sdkResponse) { var _a, _b; return submitHandler((_a = sdkResponse.err) !== null && _a !== void 0 ? _a : '', (_b = sdkResponse.result) !== null && _b !== void 0 ? _b : ''); }
10755
11155
  : undefined;
10756
11156
  if (taskInfo.card === undefined && taskInfo.url === undefined) {
10757
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
10758
- sendMessageToParent('tasks.startTask', [taskInfo], submitHandler);
11157
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
11158
+ communication_sendMessageToParentWithVersion(apiVersionTag, 'tasks.startTask', [taskInfo], submitHandler);
10759
11159
  }
10760
11160
  else if (taskInfo.card) {
10761
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
10762
- sendMessageToParent('tasks.startTask', [taskInfo], submitHandler);
11161
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
11162
+ communication_sendMessageToParentWithVersion(apiVersionTag, 'tasks.startTask', [taskInfo], submitHandler);
10763
11163
  }
10764
11164
  else if (taskInfo.completionBotId !== undefined) {
10765
- dialog.url.bot.open(getBotUrlDialogInfoFromTaskInfo(taskInfo), dialogSubmitHandler);
11165
+ botUrlOpenHelper(apiVersionTag, getBotUrlDialogInfoFromTaskInfo(taskInfo), dialogSubmitHandler);
10766
11166
  }
10767
11167
  else {
10768
- dialog.url.open(getUrlDialogInfoFromTaskInfo(taskInfo), dialogSubmitHandler);
11168
+ urlOpenHelper(apiVersionTag, getUrlDialogInfoFromTaskInfo(taskInfo), dialogSubmitHandler);
10769
11169
  }
10770
11170
  return new ChildAppWindow();
10771
11171
  }
@@ -10785,7 +11185,7 @@ var tasks;
10785
11185
  if (Object.keys(extra).length) {
10786
11186
  throw new Error('resize requires a TaskInfo argument containing only width and height');
10787
11187
  }
10788
- dialog.update.resize(taskInfo);
11188
+ updateResizeHelper(getApiVersionTag(tasksTelemetryVersionNumber, ApiName.Tasks_UpdateTask), taskInfo);
10789
11189
  }
10790
11190
  tasks.updateTask = updateTask;
10791
11191
  /**
@@ -10798,7 +11198,7 @@ var tasks;
10798
11198
  * @param appIds - Valid application(s) that can receive the result of the submitted dialogs. Specifying this parameter helps prevent malicious apps from retrieving the dialog result. Multiple app IDs can be specified because a web app from a single underlying domain can power multiple apps across different environments and branding schemes.
10799
11199
  */
10800
11200
  function submitTask(result, appIds) {
10801
- dialog.url.submit(result, appIds);
11201
+ urlSubmitHelper(getApiVersionTag(tasksTelemetryVersionNumber, ApiName.Tasks_SubmitTask), result, appIds);
10802
11202
  }
10803
11203
  tasks.submitTask = submitTask;
10804
11204
  /**
@@ -10929,8 +11329,8 @@ var liveShare;
10929
11329
  * @throws Error if {@linkcode app.initialize} has not successfully completed
10930
11330
  */
10931
11331
  function isSupported() {
10932
- return ensureInitialized(runtime, FrameContexts.meetingStage, FrameContexts.sidePanel) &&
10933
- runtime.supports.interactive
11332
+ return internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.meetingStage, FrameContexts.sidePanel) &&
11333
+ runtime_runtime.supports.interactive
10934
11334
  ? true
10935
11335
  : false;
10936
11336
  }
@@ -11403,7 +11803,7 @@ var marketplace;
11403
11803
  * @beta
11404
11804
  */
11405
11805
  function getCart() {
11406
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
11806
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
11407
11807
  if (!isSupported()) {
11408
11808
  throw errorNotSupportedOnPlatform;
11409
11809
  }
@@ -11418,7 +11818,7 @@ var marketplace;
11418
11818
  * @beta
11419
11819
  */
11420
11820
  function addOrUpdateCartItems(addOrUpdateCartItemsParams) {
11421
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
11821
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
11422
11822
  if (!isSupported()) {
11423
11823
  throw errorNotSupportedOnPlatform;
11424
11824
  }
@@ -11438,7 +11838,7 @@ var marketplace;
11438
11838
  * @beta
11439
11839
  */
11440
11840
  function removeCartItems(removeCartItemsParams) {
11441
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
11841
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
11442
11842
  if (!isSupported()) {
11443
11843
  throw errorNotSupportedOnPlatform;
11444
11844
  }
@@ -11460,7 +11860,7 @@ var marketplace;
11460
11860
  * @beta
11461
11861
  */
11462
11862
  function updateCartStatus(updateCartStatusParams) {
11463
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
11863
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
11464
11864
  if (!isSupported()) {
11465
11865
  throw errorNotSupportedOnPlatform;
11466
11866
  }
@@ -11480,7 +11880,7 @@ var marketplace;
11480
11880
  * @beta
11481
11881
  */
11482
11882
  function isSupported() {
11483
- return ensureInitialized(runtime) && runtime.supports.marketplace ? true : false;
11883
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.marketplace ? true : false;
11484
11884
  }
11485
11885
  marketplace.isSupported = isSupported;
11486
11886
  })(marketplace || (marketplace = {}));
@@ -11645,7 +12045,7 @@ var files;
11645
12045
  * Limited to Microsoft-internal use
11646
12046
  */
11647
12047
  function getCloudStorageFolders(channelId, callback) {
11648
- ensureInitialized(runtime, FrameContexts.content);
12048
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
11649
12049
  if (!channelId || channelId.length === 0) {
11650
12050
  throw new Error('[files.getCloudStorageFolders] channelId name cannot be null or empty');
11651
12051
  }
@@ -11668,7 +12068,7 @@ var files;
11668
12068
  * Limited to Microsoft-internal use
11669
12069
  */
11670
12070
  function addCloudStorageFolder(channelId, callback) {
11671
- ensureInitialized(runtime, FrameContexts.content);
12071
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
11672
12072
  if (!channelId || channelId.length === 0) {
11673
12073
  throw new Error('[files.addCloudStorageFolder] channelId name cannot be null or empty');
11674
12074
  }
@@ -11693,7 +12093,7 @@ var files;
11693
12093
  * Limited to Microsoft-internal use
11694
12094
  */
11695
12095
  function deleteCloudStorageFolder(channelId, folderToDelete, callback) {
11696
- ensureInitialized(runtime, FrameContexts.content);
12096
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
11697
12097
  if (!channelId) {
11698
12098
  throw new Error('[files.deleteCloudStorageFolder] channelId name cannot be null or empty');
11699
12099
  }
@@ -11721,7 +12121,7 @@ var files;
11721
12121
  * Limited to Microsoft-internal use
11722
12122
  */
11723
12123
  function getCloudStorageFolderContents(folder, providerCode, callback) {
11724
- ensureInitialized(runtime, FrameContexts.content);
12124
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
11725
12125
  if (!folder || !providerCode) {
11726
12126
  throw new Error('[files.getCloudStorageFolderContents] folder/providerCode name cannot be null or empty');
11727
12127
  }
@@ -11749,7 +12149,7 @@ var files;
11749
12149
  * Limited to Microsoft-internal use
11750
12150
  */
11751
12151
  function openCloudStorageFile(file, providerCode, fileOpenPreference) {
11752
- ensureInitialized(runtime, FrameContexts.content);
12152
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
11753
12153
  if (!file || !providerCode) {
11754
12154
  throw new Error('[files.openCloudStorageFile] file/providerCode cannot be null or empty');
11755
12155
  }
@@ -11771,7 +12171,7 @@ var files;
11771
12171
  */
11772
12172
  function getExternalProviders(excludeAddedProviders, callback) {
11773
12173
  if (excludeAddedProviders === void 0) { excludeAddedProviders = false; }
11774
- ensureInitialized(runtime, FrameContexts.content);
12174
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
11775
12175
  if (!callback) {
11776
12176
  throw new Error('[files.getExternalProviders] Callback cannot be null');
11777
12177
  }
@@ -11788,7 +12188,7 @@ var files;
11788
12188
  */
11789
12189
  function copyMoveFiles(selectedFiles, providerCode, destinationFolder, destinationProviderCode, isMove, callback) {
11790
12190
  if (isMove === void 0) { isMove = false; }
11791
- ensureInitialized(runtime, FrameContexts.content);
12191
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
11792
12192
  if (!selectedFiles || selectedFiles.length === 0) {
11793
12193
  throw new Error('[files.copyMoveFiles] selectedFiles cannot be null or empty');
11794
12194
  }
@@ -11819,7 +12219,7 @@ var files;
11819
12219
  * Limited to Microsoft-internal use
11820
12220
  */
11821
12221
  function getFileDownloads(callback) {
11822
- ensureInitialized(runtime, FrameContexts.content);
12222
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
11823
12223
  if (!callback) {
11824
12224
  throw new Error('[files.getFileDownloads] Callback cannot be null');
11825
12225
  }
@@ -11839,7 +12239,7 @@ var files;
11839
12239
  */
11840
12240
  function openDownloadFolder(fileObjectId, callback) {
11841
12241
  if (fileObjectId === void 0) { fileObjectId = undefined; }
11842
- ensureInitialized(runtime, FrameContexts.content);
12242
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
11843
12243
  if (!callback) {
11844
12244
  throw new Error('[files.openDownloadFolder] Callback cannot be null');
11845
12245
  }
@@ -11863,7 +12263,7 @@ var files;
11863
12263
  * Limited to Microsoft-internal use
11864
12264
  */
11865
12265
  function addCloudStorageProvider(callback) {
11866
- ensureInitialized(runtime, FrameContexts.content);
12266
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
11867
12267
  if (!callback) {
11868
12268
  throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.addCloudStorageProvider] callback cannot be null');
11869
12269
  }
@@ -11885,7 +12285,7 @@ var files;
11885
12285
  * Limited to Microsoft-internal use
11886
12286
  */
11887
12287
  function removeCloudStorageProvider(logoutRequest, callback) {
11888
- ensureInitialized(runtime, FrameContexts.content);
12288
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
11889
12289
  if (!callback) {
11890
12290
  throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.removeCloudStorageProvider] callback cannot be null');
11891
12291
  }
@@ -11908,7 +12308,7 @@ var files;
11908
12308
  * Limited to Microsoft-internal use
11909
12309
  */
11910
12310
  function addCloudStorageProviderFile(addNewFileRequest, callback) {
11911
- ensureInitialized(runtime, FrameContexts.content);
12311
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
11912
12312
  if (!callback) {
11913
12313
  throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.addCloudStorageProviderFile] callback cannot be null');
11914
12314
  }
@@ -11931,7 +12331,7 @@ var files;
11931
12331
  * Limited to Microsoft-internal use
11932
12332
  */
11933
12333
  function renameCloudStorageProviderFile(renameFileRequest, callback) {
11934
- ensureInitialized(runtime, FrameContexts.content);
12334
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
11935
12335
  if (!callback) {
11936
12336
  throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.renameCloudStorageProviderFile] callback cannot be null');
11937
12337
  }
@@ -11955,7 +12355,7 @@ var files;
11955
12355
  * Limited to Microsoft-internal use
11956
12356
  */
11957
12357
  function deleteCloudStorageProviderFile(deleteFileRequest, callback) {
11958
- ensureInitialized(runtime, FrameContexts.content);
12358
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
11959
12359
  if (!callback) {
11960
12360
  throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.deleteCloudStorageProviderFile] callback cannot be null');
11961
12361
  }
@@ -11982,7 +12382,7 @@ var files;
11982
12382
  * Limited to Microsoft-internal use
11983
12383
  */
11984
12384
  function downloadCloudStorageProviderFile(downloadFileRequest, callback) {
11985
- ensureInitialized(runtime, FrameContexts.content);
12385
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
11986
12386
  if (!callback) {
11987
12387
  throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.downloadCloudStorageProviderFile] callback cannot be null');
11988
12388
  }
@@ -12009,7 +12409,7 @@ var files;
12009
12409
  * Limited to Microsoft-internal use
12010
12410
  */
12011
12411
  function uploadCloudStorageProviderFile(uploadFileRequest, callback) {
12012
- ensureInitialized(runtime, FrameContexts.content);
12412
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
12013
12413
  if (!callback) {
12014
12414
  throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.uploadCloudStorageProviderFile] callback cannot be null');
12015
12415
  }
@@ -12037,7 +12437,7 @@ var files;
12037
12437
  * @internal Limited to Microsoft-internal use
12038
12438
  */
12039
12439
  function registerCloudStorageProviderListChangeHandler(handler) {
12040
- ensureInitialized(runtime);
12440
+ internalAPIs_ensureInitialized(runtime_runtime);
12041
12441
  if (!handler) {
12042
12442
  throw new Error('[registerCloudStorageProviderListChangeHandler] Handler cannot be null');
12043
12443
  }
@@ -12057,7 +12457,7 @@ var files;
12057
12457
  * Limited to Microsoft-internal use
12058
12458
  */
12059
12459
  function registerCloudStorageProviderContentChangeHandler(handler) {
12060
- ensureInitialized(runtime);
12460
+ internalAPIs_ensureInitialized(runtime_runtime);
12061
12461
  if (!handler) {
12062
12462
  throw new Error('[registerCloudStorageProviderContentChangeHandler] Handler cannot be null');
12063
12463
  }
@@ -12098,7 +12498,7 @@ var meetingRoom;
12098
12498
  */
12099
12499
  function getPairedMeetingRoomInfo() {
12100
12500
  return new Promise(function (resolve) {
12101
- ensureInitialized(runtime);
12501
+ internalAPIs_ensureInitialized(runtime_runtime);
12102
12502
  if (!isSupported()) {
12103
12503
  throw errorNotSupportedOnPlatform;
12104
12504
  }
@@ -12121,7 +12521,7 @@ var meetingRoom;
12121
12521
  if (!commandName || commandName.length == 0) {
12122
12522
  throw new Error('[meetingRoom.sendCommandToPairedMeetingRoom] Command name cannot be null or empty');
12123
12523
  }
12124
- ensureInitialized(runtime);
12524
+ internalAPIs_ensureInitialized(runtime_runtime);
12125
12525
  if (!isSupported()) {
12126
12526
  throw errorNotSupportedOnPlatform;
12127
12527
  }
@@ -12143,12 +12543,12 @@ var meetingRoom;
12143
12543
  if (!handler) {
12144
12544
  throw new Error('[meetingRoom.registerMeetingRoomCapabilitiesUpdateHandler] Handler cannot be null');
12145
12545
  }
12146
- ensureInitialized(runtime);
12546
+ internalAPIs_ensureInitialized(runtime_runtime);
12147
12547
  if (!isSupported()) {
12148
12548
  throw errorNotSupportedOnPlatform;
12149
12549
  }
12150
12550
  registerHandler('meetingRoom.meetingRoomCapabilitiesUpdate', function (capabilities) {
12151
- ensureInitialized(runtime);
12551
+ internalAPIs_ensureInitialized(runtime_runtime);
12152
12552
  handler(capabilities);
12153
12553
  });
12154
12554
  }
@@ -12168,12 +12568,12 @@ var meetingRoom;
12168
12568
  if (!handler) {
12169
12569
  throw new Error('[meetingRoom.registerMeetingRoomStatesUpdateHandler] Handler cannot be null');
12170
12570
  }
12171
- ensureInitialized(runtime);
12571
+ internalAPIs_ensureInitialized(runtime_runtime);
12172
12572
  if (!isSupported()) {
12173
12573
  throw errorNotSupportedOnPlatform;
12174
12574
  }
12175
12575
  registerHandler('meetingRoom.meetingRoomStatesUpdate', function (states) {
12176
- ensureInitialized(runtime);
12576
+ internalAPIs_ensureInitialized(runtime_runtime);
12177
12577
  handler(states);
12178
12578
  });
12179
12579
  }
@@ -12190,7 +12590,7 @@ var meetingRoom;
12190
12590
  * Limited to Microsoft-internal use
12191
12591
  */
12192
12592
  function isSupported() {
12193
- return ensureInitialized(runtime) && runtime.supports.meetingRoom ? true : false;
12593
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.meetingRoom ? true : false;
12194
12594
  }
12195
12595
  meetingRoom.isSupported = isSupported;
12196
12596
  })(meetingRoom || (meetingRoom = {}));
@@ -12213,7 +12613,7 @@ var notifications;
12213
12613
  * Limited to Microsoft-internal use
12214
12614
  */
12215
12615
  function showNotification(showNotificationParameters) {
12216
- ensureInitialized(runtime, FrameContexts.content);
12616
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
12217
12617
  if (!isSupported()) {
12218
12618
  throw errorNotSupportedOnPlatform;
12219
12619
  }
@@ -12232,7 +12632,7 @@ var notifications;
12232
12632
  * Limited to Microsoft-internal use
12233
12633
  */
12234
12634
  function isSupported() {
12235
- return ensureInitialized(runtime) && runtime.supports.notifications ? true : false;
12635
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.notifications ? true : false;
12236
12636
  }
12237
12637
  notifications.isSupported = isSupported;
12238
12638
  })(notifications || (notifications = {}));
@@ -12323,7 +12723,7 @@ var remoteCamera;
12323
12723
  if (!callback) {
12324
12724
  throw new Error('[remoteCamera.getCapableParticipants] Callback cannot be null');
12325
12725
  }
12326
- ensureInitialized(runtime, FrameContexts.sidePanel);
12726
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel);
12327
12727
  if (!isSupported()) {
12328
12728
  throw errorNotSupportedOnPlatform;
12329
12729
  }
@@ -12350,7 +12750,7 @@ var remoteCamera;
12350
12750
  if (!callback) {
12351
12751
  throw new Error('[remoteCamera.requestControl] Callback cannot be null');
12352
12752
  }
12353
- ensureInitialized(runtime, FrameContexts.sidePanel);
12753
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel);
12354
12754
  if (!isSupported()) {
12355
12755
  throw errorNotSupportedOnPlatform;
12356
12756
  }
@@ -12374,7 +12774,7 @@ var remoteCamera;
12374
12774
  if (!callback) {
12375
12775
  throw new Error('[remoteCamera.sendControlCommand] Callback cannot be null');
12376
12776
  }
12377
- ensureInitialized(runtime, FrameContexts.sidePanel);
12777
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel);
12378
12778
  if (!isSupported()) {
12379
12779
  throw errorNotSupportedOnPlatform;
12380
12780
  }
@@ -12394,7 +12794,7 @@ var remoteCamera;
12394
12794
  if (!callback) {
12395
12795
  throw new Error('[remoteCamera.terminateSession] Callback cannot be null');
12396
12796
  }
12397
- ensureInitialized(runtime, FrameContexts.sidePanel);
12797
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel);
12398
12798
  if (!isSupported()) {
12399
12799
  throw errorNotSupportedOnPlatform;
12400
12800
  }
@@ -12415,7 +12815,7 @@ var remoteCamera;
12415
12815
  if (!handler) {
12416
12816
  throw new Error('[remoteCamera.registerOnCapableParticipantsChangeHandler] Handler cannot be null');
12417
12817
  }
12418
- ensureInitialized(runtime, FrameContexts.sidePanel);
12818
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel);
12419
12819
  if (!isSupported()) {
12420
12820
  throw errorNotSupportedOnPlatform;
12421
12821
  }
@@ -12436,7 +12836,7 @@ var remoteCamera;
12436
12836
  if (!handler) {
12437
12837
  throw new Error('[remoteCamera.registerOnErrorHandler] Handler cannot be null');
12438
12838
  }
12439
- ensureInitialized(runtime, FrameContexts.sidePanel);
12839
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel);
12440
12840
  if (!isSupported()) {
12441
12841
  throw errorNotSupportedOnPlatform;
12442
12842
  }
@@ -12457,7 +12857,7 @@ var remoteCamera;
12457
12857
  if (!handler) {
12458
12858
  throw new Error('[remoteCamera.registerOnDeviceStateChangeHandler] Handler cannot be null');
12459
12859
  }
12460
- ensureInitialized(runtime, FrameContexts.sidePanel);
12860
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel);
12461
12861
  if (!isSupported()) {
12462
12862
  throw errorNotSupportedOnPlatform;
12463
12863
  }
@@ -12478,7 +12878,7 @@ var remoteCamera;
12478
12878
  if (!handler) {
12479
12879
  throw new Error('[remoteCamera.registerOnSessionStatusChangeHandler] Handler cannot be null');
12480
12880
  }
12481
- ensureInitialized(runtime, FrameContexts.sidePanel);
12881
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel);
12482
12882
  if (!isSupported()) {
12483
12883
  throw errorNotSupportedOnPlatform;
12484
12884
  }
@@ -12497,7 +12897,7 @@ var remoteCamera;
12497
12897
  * Limited to Microsoft-internal use
12498
12898
  */
12499
12899
  function isSupported() {
12500
- return ensureInitialized(runtime) && runtime.supports.remoteCamera ? true : false;
12900
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.remoteCamera ? true : false;
12501
12901
  }
12502
12902
  remoteCamera.isSupported = isSupported;
12503
12903
  })(remoteCamera || (remoteCamera = {}));
@@ -12508,6 +12908,11 @@ var remoteCamera;
12508
12908
 
12509
12909
 
12510
12910
 
12911
+
12912
+ /**
12913
+ * v1 APIs telemetry file: All of APIs in this capability file should send out API version v1 ONLY
12914
+ */
12915
+ var appEntityTelemetryVersionNumber = ApiVersionNumber.V_1;
12511
12916
  /**
12512
12917
  * @hidden
12513
12918
  * Namespace to interact with the application entities specific part of the SDK.
@@ -12534,7 +12939,7 @@ var appEntity;
12534
12939
  * Limited to Microsoft-internal use
12535
12940
  */
12536
12941
  function selectAppEntity(threadId, categories, subEntityId, callback) {
12537
- ensureInitialized(runtime, FrameContexts.content);
12942
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
12538
12943
  if (!isSupported()) {
12539
12944
  throw errorNotSupportedOnPlatform;
12540
12945
  }
@@ -12544,7 +12949,7 @@ var appEntity;
12544
12949
  if (!callback) {
12545
12950
  throw new Error('[appEntity.selectAppEntity] Callback cannot be null');
12546
12951
  }
12547
- sendMessageToParent('appEntity.selectAppEntity', [threadId, categories, subEntityId], callback);
12952
+ communication_sendMessageToParentWithVersion(getApiVersionTag(appEntityTelemetryVersionNumber, ApiName.AppEntity_SelectAppEntity), 'appEntity.selectAppEntity', [threadId, categories, subEntityId], callback);
12548
12953
  }
12549
12954
  appEntity_1.selectAppEntity = selectAppEntity;
12550
12955
  /**
@@ -12559,7 +12964,7 @@ var appEntity;
12559
12964
  * Limited to Microsoft-internal use
12560
12965
  */
12561
12966
  function isSupported() {
12562
- return ensureInitialized(runtime) && runtime.supports.appEntity ? true : false;
12967
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.appEntity ? true : false;
12563
12968
  }
12564
12969
  appEntity_1.isSupported = isSupported;
12565
12970
  })(appEntity || (appEntity = {}));
@@ -12597,7 +13002,7 @@ var teams;
12597
13002
  * Limited to Microsoft-internal use
12598
13003
  */
12599
13004
  function getTeamChannels(groupId, callback) {
12600
- ensureInitialized(runtime, FrameContexts.content);
13005
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
12601
13006
  if (!isSupported()) {
12602
13007
  throw errorNotSupportedOnPlatform;
12603
13008
  }
@@ -12622,7 +13027,7 @@ var teams;
12622
13027
  * Limited to Microsoft-internal use
12623
13028
  */
12624
13029
  function refreshSiteUrl(threadId, callback) {
12625
- ensureInitialized(runtime);
13030
+ internalAPIs_ensureInitialized(runtime_runtime);
12626
13031
  if (!isSupported()) {
12627
13032
  throw errorNotSupportedOnPlatform;
12628
13033
  }
@@ -12647,7 +13052,7 @@ var teams;
12647
13052
  * Limited to Microsoft-internal use
12648
13053
  */
12649
13054
  function isSupported() {
12650
- return ensureInitialized(runtime) && runtime.supports.teams ? true : false;
13055
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.teams ? true : false;
12651
13056
  }
12652
13057
  teams.isSupported = isSupported;
12653
13058
  /**
@@ -12676,7 +13081,7 @@ var teams;
12676
13081
  */
12677
13082
  function getUserJoinedTeams(teamInstanceParameters) {
12678
13083
  return new Promise(function (resolve) {
12679
- ensureInitialized(runtime);
13084
+ internalAPIs_ensureInitialized(runtime_runtime);
12680
13085
  if (!isSupported()) {
12681
13086
  throw errorNotSupportedOnPlatform;
12682
13087
  }
@@ -12705,9 +13110,9 @@ var teams;
12705
13110
  * Limited to Microsoft-internal use
12706
13111
  */
12707
13112
  function isSupported() {
12708
- return ensureInitialized(runtime) && runtime.supports.teams
12709
- ? runtime.supports.teams.fullTrust
12710
- ? runtime.supports.teams.fullTrust.joinedTeams
13113
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.teams
13114
+ ? runtime_runtime.supports.teams.fullTrust
13115
+ ? runtime_runtime.supports.teams.fullTrust.joinedTeams
12711
13116
  ? true
12712
13117
  : false
12713
13118
  : false
@@ -12727,7 +13132,7 @@ var teams;
12727
13132
  */
12728
13133
  function getConfigSetting(key) {
12729
13134
  return new Promise(function (resolve) {
12730
- ensureInitialized(runtime);
13135
+ internalAPIs_ensureInitialized(runtime_runtime);
12731
13136
  if (!isSupported()) {
12732
13137
  throw errorNotSupportedOnPlatform;
12733
13138
  }
@@ -12747,8 +13152,8 @@ var teams;
12747
13152
  * Limited to Microsoft-internal use
12748
13153
  */
12749
13154
  function isSupported() {
12750
- return ensureInitialized(runtime) && runtime.supports.teams
12751
- ? runtime.supports.teams.fullTrust
13155
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.teams
13156
+ ? runtime_runtime.supports.teams.fullTrust
12752
13157
  ? true
12753
13158
  : false
12754
13159
  : false;
@@ -12850,9 +13255,9 @@ var videoEffectsEx;
12850
13255
  if (!parameters.videoFrameHandler || !parameters.videoBufferHandler) {
12851
13256
  throw new Error('Both videoFrameHandler and videoBufferHandler must be provided');
12852
13257
  }
12853
- if (ensureInitialized(runtime, FrameContexts.sidePanel)) {
13258
+ if (internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel)) {
12854
13259
  registerHandler('video.setFrameProcessTimeLimit', function (timeLimit) { return videoPerformanceMonitor === null || videoPerformanceMonitor === void 0 ? void 0 : videoPerformanceMonitor.setFrameProcessTimeLimit(timeLimit); }, false);
12855
- if ((_a = runtime.supports.video) === null || _a === void 0 ? void 0 : _a.mediaStream) {
13260
+ if ((_a = runtime_runtime.supports.video) === null || _a === void 0 ? void 0 : _a.mediaStream) {
12856
13261
  registerHandler('video.startVideoExtensibilityVideoStream', function (mediaStreamInfo) { return videoEffectsEx_awaiter(_this, void 0, void 0, function () {
12857
13262
  var streamId, metadataInTexture, handler, _a;
12858
13263
  return videoEffectsEx_generator(this, function (_b) {
@@ -12879,7 +13284,7 @@ var videoEffectsEx;
12879
13284
  }); }, false);
12880
13285
  sendMessageToParent('video.mediaStream.registerForVideoFrame', [parameters.config]);
12881
13286
  }
12882
- else if ((_b = runtime.supports.video) === null || _b === void 0 ? void 0 : _b.sharedFrame) {
13287
+ else if ((_b = runtime_runtime.supports.video) === null || _b === void 0 ? void 0 : _b.sharedFrame) {
12883
13288
  registerHandler('video.newVideoFrame', function (videoBufferData) {
12884
13289
  if (videoBufferData) {
12885
13290
  videoPerformanceMonitor === null || videoPerformanceMonitor === void 0 ? void 0 : videoPerformanceMonitor.reportStartFrameProcessing(videoBufferData.width, videoBufferData.height);
@@ -12937,7 +13342,7 @@ var videoEffectsEx;
12937
13342
  * Limited to Microsoft-internal use
12938
13343
  */
12939
13344
  function notifySelectedVideoEffectChanged(effectChangeType, effectId, effectParam) {
12940
- ensureInitialized(runtime, FrameContexts.sidePanel);
13345
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel);
12941
13346
  if (!isSupported()) {
12942
13347
  throw errorNotSupportedOnPlatform;
12943
13348
  }
@@ -12954,7 +13359,7 @@ var videoEffectsEx;
12954
13359
  * Limited to Microsoft-internal use
12955
13360
  */
12956
13361
  function registerForVideoEffect(callback) {
12957
- ensureInitialized(runtime, FrameContexts.sidePanel);
13362
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel);
12958
13363
  if (!isSupported()) {
12959
13364
  throw errorNotSupportedOnPlatform;
12960
13365
  }
@@ -12971,7 +13376,7 @@ var videoEffectsEx;
12971
13376
  * Limited to Microsoft-internal use
12972
13377
  */
12973
13378
  function updatePersonalizedEffects(effects) {
12974
- ensureInitialized(runtime, FrameContexts.sidePanel);
13379
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel);
12975
13380
  if (!videoEffects.isSupported()) {
12976
13381
  throw errorNotSupportedOnPlatform;
12977
13382
  }
@@ -12992,7 +13397,7 @@ var videoEffectsEx;
12992
13397
  * Limited to Microsoft-internal use
12993
13398
  */
12994
13399
  function isSupported() {
12995
- ensureInitialized(runtime);
13400
+ internalAPIs_ensureInitialized(runtime_runtime);
12996
13401
  return videoEffects.isSupported();
12997
13402
  }
12998
13403
  videoEffectsEx.isSupported = isSupported;
@@ -13033,7 +13438,7 @@ var videoEffectsEx;
13033
13438
  * Limited to Microsoft-internal use
13034
13439
  */
13035
13440
  function notifyFatalError(errorMessage) {
13036
- ensureInitialized(runtime);
13441
+ internalAPIs_ensureInitialized(runtime_runtime);
13037
13442
  if (!videoEffects.isSupported()) {
13038
13443
  throw errorNotSupportedOnPlatform;
13039
13444
  }