@microsoft/teams-js 2.34.1-beta.0 → 2.35.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. package/dist/esm/packages/teams-js/dts/internal/childCommunication.d.ts +38 -0
  2. package/dist/esm/packages/teams-js/dts/internal/communication.d.ts +0 -11
  3. package/dist/esm/packages/teams-js/dts/internal/communicationUtils.d.ts +20 -0
  4. package/dist/esm/packages/teams-js/dts/internal/pagesHelpers.d.ts +3 -0
  5. package/dist/esm/packages/teams-js/dts/private/externalAppAuthenticationForCEA.d.ts +17 -1
  6. package/dist/esm/packages/teams-js/dts/private/hostEntity/hostEntity.d.ts +9 -1
  7. package/dist/esm/packages/teams-js/dts/private/privateAPIs.d.ts +1 -2
  8. package/dist/esm/packages/teams-js/src/internal/childCommunication.js +1 -0
  9. package/dist/esm/packages/teams-js/src/internal/communication.js +1 -1
  10. package/dist/esm/packages/teams-js/src/internal/communicationUtils.js +1 -0
  11. package/dist/esm/packages/teams-js/src/internal/handlers.js +1 -1
  12. package/dist/esm/packages/teams-js/src/internal/pagesHelpers.js +1 -1
  13. package/dist/esm/packages/teams-js/src/private/externalAppAuthenticationForCEA.js +1 -1
  14. package/dist/esm/packages/teams-js/src/private/hostEntity/hostEntity.js +1 -1
  15. package/dist/esm/packages/teams-js/src/private/privateAPIs.js +1 -1
  16. package/dist/esm/packages/teams-js/src/public/pages/backStack.js +1 -1
  17. package/dist/esm/packages/teams-js/src/public/pages/config.js +1 -1
  18. package/dist/esm/packages/teams-js/src/public/version.js +1 -1
  19. package/dist/umd/MicrosoftTeams.js +975 -887
  20. package/dist/umd/MicrosoftTeams.js.map +1 -1
  21. package/dist/umd/MicrosoftTeams.min.js +1 -1
  22. package/dist/umd/MicrosoftTeams.min.js.map +1 -1
  23. package/package.json +1 -1
@@ -1254,6 +1254,17 @@ __webpack_require__.d(appButton_namespaceObject, {
1254
1254
  onHoverLeave: () => (onHoverLeave)
1255
1255
  });
1256
1256
 
1257
+ // NAMESPACE OBJECT: ./src/public/pages/backStack.ts
1258
+ var backStack_namespaceObject = {};
1259
+ __webpack_require__.r(backStack_namespaceObject);
1260
+ __webpack_require__.d(backStack_namespaceObject, {
1261
+ _initialize: () => (backStack_initialize),
1262
+ isSupported: () => (backStack_isSupported),
1263
+ navigateBack: () => (navigateBack),
1264
+ registerBackButtonHandler: () => (registerBackButtonHandler),
1265
+ registerBackButtonHandlerHelper: () => (registerBackButtonHandlerHelper)
1266
+ });
1267
+
1257
1268
  // NAMESPACE OBJECT: ./src/public/pages/currentApp.ts
1258
1269
  var currentApp_namespaceObject = {};
1259
1270
  __webpack_require__.r(currentApp_namespaceObject);
@@ -1306,17 +1317,6 @@ __webpack_require__.d(pages_namespaceObject, {
1306
1317
  tabs: () => (tabs_namespaceObject)
1307
1318
  });
1308
1319
 
1309
- // NAMESPACE OBJECT: ./src/public/pages/backStack.ts
1310
- var backStack_namespaceObject = {};
1311
- __webpack_require__.r(backStack_namespaceObject);
1312
- __webpack_require__.d(backStack_namespaceObject, {
1313
- _initialize: () => (backStack_initialize),
1314
- isSupported: () => (backStack_isSupported),
1315
- navigateBack: () => (navigateBack),
1316
- registerBackButtonHandler: () => (registerBackButtonHandler),
1317
- registerBackButtonHandlerHelper: () => (registerBackButtonHandlerHelper)
1318
- });
1319
-
1320
1320
  // NAMESPACE OBJECT: ./src/private/logs.ts
1321
1321
  var logs_namespaceObject = {};
1322
1322
  __webpack_require__.r(logs_namespaceObject);
@@ -1968,35 +1968,422 @@ __webpack_require__.d(marketplace_namespaceObject, {
1968
1968
  updateCartStatus: () => (updateCartStatus)
1969
1969
  });
1970
1970
 
1971
- // EXTERNAL MODULE: ../../node_modules/.pnpm/debug@4.3.5/node_modules/debug/src/browser.js
1972
- var browser = __webpack_require__(815);
1973
- // EXTERNAL MODULE: ../../node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.js
1974
- var base64_js = __webpack_require__(933);
1975
- ;// ../../node_modules/.pnpm/skeleton-buffer@file+skeleton-buffer/node_modules/skeleton-buffer/index.js
1976
-
1977
-
1978
- const _Buffer = Buffer;
1979
-
1980
-
1981
- const K_MAX_LENGTH = 0x7fffffff;
1982
-
1983
- /**
1984
- * If `Buffer.TYPED_ARRAY_SUPPORT`:
1985
- * === true Use Uint8Array implementation (fastest)
1986
- * === false Print warning and recommend using `buffer` v4.x which has an Object
1987
- * implementation (most compatible, even IE6)
1988
- *
1989
- * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
1990
- * Opera 11.6+, iOS 4.2+.
1991
- *
1992
- * We report that the browser does not support typed arrays if the are not subclassable
1993
- * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`
1994
- * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support
1995
- * for __proto__ and has a buggy typed array implementation.
1996
- */
1997
- Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport();
1971
+ ;// ./src/public/interfaces.ts
1972
+ /* eslint-disable @typescript-eslint/no-explicit-any*/
1973
+ /**
1974
+ * Allowed user file open preferences
1975
+ */
1976
+ var FileOpenPreference;
1977
+ (function (FileOpenPreference) {
1978
+ /** Indicates that the user should be prompted to open the file in inline. */
1979
+ FileOpenPreference["Inline"] = "inline";
1980
+ /** Indicates that the user should be prompted to open the file in the native desktop application associated with the file type. */
1981
+ FileOpenPreference["Desktop"] = "desktop";
1982
+ /** Indicates that the user should be prompted to open the file in a web browser. */
1983
+ FileOpenPreference["Web"] = "web";
1984
+ })(FileOpenPreference || (FileOpenPreference = {}));
1985
+ /**
1986
+ * Types of Action Objects
1987
+ *
1988
+ * @beta
1989
+ */
1990
+ var ActionObjectType;
1991
+ (function (ActionObjectType) {
1992
+ /** Represents content within a Microsoft 365 application. */
1993
+ ActionObjectType["M365Content"] = "m365content";
1994
+ })(ActionObjectType || (ActionObjectType = {}));
1995
+ /**
1996
+ * These correspond with field names in the MSGraph.
1997
+ * See [commonly accessed resources](https://learn.microsoft.com/graph/api/resources/onedrive?view=graph-rest-1.0#commonly-accessed-resources).
1998
+ * @beta
1999
+ */
2000
+ var SecondaryM365ContentIdName;
2001
+ (function (SecondaryM365ContentIdName) {
2002
+ /** OneDrive ID */
2003
+ SecondaryM365ContentIdName["DriveId"] = "driveId";
2004
+ /** Teams Group ID */
2005
+ SecondaryM365ContentIdName["GroupId"] = "groupId";
2006
+ /** SharePoint ID */
2007
+ SecondaryM365ContentIdName["SiteId"] = "siteId";
2008
+ /** User ID */
2009
+ SecondaryM365ContentIdName["UserId"] = "userId";
2010
+ })(SecondaryM365ContentIdName || (SecondaryM365ContentIdName = {}));
2011
+ function isSdkError(err) {
2012
+ return (err === null || err === void 0 ? void 0 : err.errorCode) !== undefined;
2013
+ }
2014
+ /** Error codes used to identify different types of errors that can occur while developing apps. */
2015
+ var ErrorCode;
2016
+ (function (ErrorCode) {
2017
+ /**
2018
+ * API not supported in the current platform.
2019
+ */
2020
+ ErrorCode[ErrorCode["NOT_SUPPORTED_ON_PLATFORM"] = 100] = "NOT_SUPPORTED_ON_PLATFORM";
2021
+ /**
2022
+ * Internal error encountered while performing the required operation.
2023
+ */
2024
+ ErrorCode[ErrorCode["INTERNAL_ERROR"] = 500] = "INTERNAL_ERROR";
2025
+ /**
2026
+ * API is not supported in the current context
2027
+ */
2028
+ ErrorCode[ErrorCode["NOT_SUPPORTED_IN_CURRENT_CONTEXT"] = 501] = "NOT_SUPPORTED_IN_CURRENT_CONTEXT";
2029
+ /**
2030
+ Permissions denied by user
2031
+ */
2032
+ ErrorCode[ErrorCode["PERMISSION_DENIED"] = 1000] = "PERMISSION_DENIED";
2033
+ /**
2034
+ * Network issue
2035
+ */
2036
+ ErrorCode[ErrorCode["NETWORK_ERROR"] = 2000] = "NETWORK_ERROR";
2037
+ /**
2038
+ * Underlying hardware doesn't support the capability
2039
+ */
2040
+ ErrorCode[ErrorCode["NO_HW_SUPPORT"] = 3000] = "NO_HW_SUPPORT";
2041
+ /**
2042
+ * One or more arguments are invalid
2043
+ */
2044
+ ErrorCode[ErrorCode["INVALID_ARGUMENTS"] = 4000] = "INVALID_ARGUMENTS";
2045
+ /**
2046
+ * User is not authorized for this operation
2047
+ */
2048
+ ErrorCode[ErrorCode["UNAUTHORIZED_USER_OPERATION"] = 5000] = "UNAUTHORIZED_USER_OPERATION";
2049
+ /**
2050
+ * Could not complete the operation due to insufficient resources
2051
+ */
2052
+ ErrorCode[ErrorCode["INSUFFICIENT_RESOURCES"] = 6000] = "INSUFFICIENT_RESOURCES";
2053
+ /**
2054
+ * Platform throttled the request because of API was invoked too frequently
2055
+ */
2056
+ ErrorCode[ErrorCode["THROTTLE"] = 7000] = "THROTTLE";
2057
+ /**
2058
+ * User aborted the operation
2059
+ */
2060
+ ErrorCode[ErrorCode["USER_ABORT"] = 8000] = "USER_ABORT";
2061
+ /**
2062
+ * Could not complete the operation in the given time interval
2063
+ */
2064
+ ErrorCode[ErrorCode["OPERATION_TIMED_OUT"] = 8001] = "OPERATION_TIMED_OUT";
2065
+ /**
2066
+ * Platform code is old and doesn't implement this API
2067
+ */
2068
+ ErrorCode[ErrorCode["OLD_PLATFORM"] = 9000] = "OLD_PLATFORM";
2069
+ /**
2070
+ * The file specified was not found on the given location
2071
+ */
2072
+ ErrorCode[ErrorCode["FILE_NOT_FOUND"] = 404] = "FILE_NOT_FOUND";
2073
+ /**
2074
+ * The return value is too big and has exceeded our size boundries
2075
+ */
2076
+ ErrorCode[ErrorCode["SIZE_EXCEEDED"] = 10000] = "SIZE_EXCEEDED";
2077
+ })(ErrorCode || (ErrorCode = {}));
2078
+ /** @hidden */
2079
+ var DevicePermission;
2080
+ (function (DevicePermission) {
2081
+ DevicePermission["GeoLocation"] = "geolocation";
2082
+ DevicePermission["Media"] = "media";
2083
+ })(DevicePermission || (DevicePermission = {}));
2084
+ /**
2085
+ * @hidden
2086
+ *
2087
+ * @beta
2088
+ */
2089
+ var Cohort;
2090
+ (function (Cohort) {
2091
+ Cohort["BCAIS"] = "bcais";
2092
+ Cohort["BCWAF"] = "bcwaf";
2093
+ Cohort["BCWBF"] = "bcwbf";
2094
+ })(Cohort || (Cohort = {}));
2095
+ /**
2096
+ * @hidden
2097
+ *
2098
+ * @beta
2099
+ */
2100
+ var Persona;
2101
+ (function (Persona) {
2102
+ /**
2103
+ * User has a faculty license
2104
+ */
2105
+ Persona["Faculty"] = "faculty";
2106
+ /**
2107
+ * User has a student license
2108
+ */
2109
+ Persona["Student"] = "student";
2110
+ /**
2111
+ * When user is not a faculty or student
2112
+ */
2113
+ Persona["Other"] = "other";
2114
+ })(Persona || (Persona = {}));
2115
+ /**
2116
+ * @hidden
2117
+ *
2118
+ * @beta
2119
+ */
2120
+ // https://learn.microsoft.com/en-us/graph/api/resources/user?view=graph-rest-1.0#legalagegroupclassification-values
2121
+ var LegalAgeGroupClassification;
2122
+ (function (LegalAgeGroupClassification) {
2123
+ /**
2124
+ * The user is considered an adult based on the age-related regulations of their country or region.
2125
+ */
2126
+ LegalAgeGroupClassification["Adult"] = "adult";
2127
+ /**
2128
+ * The user is a minor but is from a country or region that has no age-related regulations.
2129
+ */
2130
+ LegalAgeGroupClassification["MinorNoParentalConsentRequired"] = "minorNoParentalConsentRequired";
2131
+ /**
2132
+ * Reserved for future use
2133
+ */
2134
+ LegalAgeGroupClassification["MinorWithoutParentalConsent"] = "minorWithoutParentalConsent";
2135
+ /**
2136
+ * The user is considered a minor based on the age-related regulations of their country or region, and the administrator
2137
+ * of the account obtained appropriate consent from a parent or guardian.
2138
+ */
2139
+ LegalAgeGroupClassification["MinorWithParentalConsent"] = "minorWithParentalConsent";
2140
+ /**
2141
+ * The user is from a country or region that has additional age-related regulations, such as the United States,
2142
+ * United Kingdom, European Union, or South Korea, and the user's age is between a minor and an adult age
2143
+ * (as stipulated based on country or region). Generally, this means that teenagers are considered as notAdult in regulated countries.
2144
+ */
2145
+ LegalAgeGroupClassification["NonAdult"] = "nonAdult";
2146
+ })(LegalAgeGroupClassification || (LegalAgeGroupClassification = {}));
2147
+ /**
2148
+ * @hidden
2149
+ *
2150
+ * @beta
2151
+ */
2152
+ var EduType;
2153
+ (function (EduType) {
2154
+ /**
2155
+ * User is from a tenant labeled as “HigherEd”
2156
+ */
2157
+ EduType["HigherEducation"] = "higherEducation";
2158
+ /**
2159
+ * User is from a tenant labeled as “K12”
2160
+ */
2161
+ EduType["K12"] = "k12";
2162
+ /**
2163
+ * User is from a tenant labeled as “Others” (e.g. research institutions)
2164
+ */
2165
+ EduType["Other"] = "other";
2166
+ })(EduType || (EduType = {}));
2167
+ /**
2168
+ * Currently supported Mime type
2169
+ */
2170
+ var ClipboardSupportedMimeType;
2171
+ (function (ClipboardSupportedMimeType) {
2172
+ ClipboardSupportedMimeType["TextPlain"] = "text/plain";
2173
+ ClipboardSupportedMimeType["TextHtml"] = "text/html";
2174
+ ClipboardSupportedMimeType["ImagePNG"] = "image/png";
2175
+ ClipboardSupportedMimeType["ImageJPEG"] = "image/jpeg";
2176
+ })(ClipboardSupportedMimeType || (ClipboardSupportedMimeType = {}));
1998
2177
 
1999
- if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' && typeof console.error === 'function') {
2178
+ ;// ./src/artifactsForCDN/validDomains.json
2179
+ const validDomains_namespaceObject = /*#__PURE__*/JSON.parse('{"validOrigins":["teams.microsoft.com","teams.microsoft.us","gov.teams.microsoft.us","dod.teams.microsoft.us","int.teams.microsoft.com","outlook.office.com","outlook-sdf.office.com","outlook.office365.com","outlook-sdf.office365.com","outlook.live.com","outlook-sdf.live.com","teams.live.com","local.teams.live.com","local.teams.live.com:8080","local.teams.office.com","local.teams.office.com:8080","devspaces.skype.com","*.www.office.com","www.office.com","word.office.com","excel.office.com","powerpoint.office.com","www.officeppe.com","*.www.microsoft365.com","www.microsoft365.com","bing.com","edgeservices.bing.com","work.bing.com","www.bing.com","www.staging-bing-int.com","*.cloud.microsoft","*.m365.cloud.microsoft","chatuxmanager.svc.cloud.microsoft","copilot.microsoft.com","windows.msn.com","fa000000125.resources.office.net","fa000000129.resources.office.net","fa000000124.resources.office.net","fa000000128.resources.office.net","fa000000136.resources.office.net"]}');
2180
+ var artifactsForCDN_validDomains_namespaceObject = /*#__PURE__*/__webpack_require__.t(validDomains_namespaceObject, 2);
2181
+ ;// ./src/internal/constants.ts
2182
+
2183
+ /**
2184
+ * @hidden
2185
+ * The client version when all SDK APIs started to check platform compatibility for the APIs was 1.6.0.
2186
+ * Modified to 2.0.1 which is hightest till now so that if any client doesn't pass version in initialize function, it will be set to highest.
2187
+ * Mobile clients are passing versions, hence will be applicable to web and desktop clients only.
2188
+ *
2189
+ * @internal
2190
+ * Limited to Microsoft-internal use
2191
+ */
2192
+ const defaultSDKVersionForCompatCheck = '2.0.1';
2193
+ /**
2194
+ * @hidden
2195
+ * This is the client version when selectMedia API - VideoAndImage is supported on mobile.
2196
+ *
2197
+ * @internal
2198
+ * Limited to Microsoft-internal use
2199
+ */
2200
+ const videoAndImageMediaAPISupportVersion = '2.0.2';
2201
+ /**
2202
+ * @hidden
2203
+ * This is the client version when selectMedia API - Video with non-full screen mode is supported on mobile.
2204
+ *
2205
+ * @internal
2206
+ * Limited to Microsoft-internal use
2207
+ */
2208
+ const nonFullScreenVideoModeAPISupportVersion = '2.0.3';
2209
+ /**
2210
+ * @hidden
2211
+ * This is the client version when selectMedia API - ImageOutputFormats is supported on mobile.
2212
+ *
2213
+ * @internal
2214
+ * Limited to Microsoft-internal use
2215
+ */
2216
+ const imageOutputFormatsAPISupportVersion = '2.0.4';
2217
+ /**
2218
+ * @hidden
2219
+ * Minimum required client supported version for {@link getUserJoinedTeams} to be supported on {@link HostClientType.android}
2220
+ *
2221
+ * @internal
2222
+ * Limited to Microsoft-internal use
2223
+ */
2224
+ const getUserJoinedTeamsSupportedAndroidClientVersion = '2.0.1';
2225
+ /**
2226
+ * @hidden
2227
+ * This is the client version when location APIs (getLocation and showLocation) are supported.
2228
+ *
2229
+ * @internal
2230
+ * Limited to Microsoft-internal use
2231
+ */
2232
+ const locationAPIsRequiredVersion = '1.9.0';
2233
+ /**
2234
+ * @hidden
2235
+ * This is the client version when permisisons are supported
2236
+ *
2237
+ * @internal
2238
+ * Limited to Microsoft-internal use
2239
+ */
2240
+ const permissionsAPIsRequiredVersion = '2.0.1';
2241
+ /**
2242
+ * @hidden
2243
+ * This is the client version when people picker API is supported on mobile.
2244
+ *
2245
+ * @internal
2246
+ * Limited to Microsoft-internal use
2247
+ */
2248
+ const peoplePickerRequiredVersion = '2.0.0';
2249
+ /**
2250
+ * @hidden
2251
+ * This is the client version when captureImage API is supported on mobile.
2252
+ *
2253
+ * @internal
2254
+ * Limited to Microsoft-internal use
2255
+ */
2256
+ const captureImageMobileSupportVersion = '1.7.0';
2257
+ /**
2258
+ * @hidden
2259
+ * This is the client version when media APIs are supported on all three platforms ios, android and web.
2260
+ *
2261
+ * @internal
2262
+ * Limited to Microsoft-internal use
2263
+ */
2264
+ const mediaAPISupportVersion = '1.8.0';
2265
+ /**
2266
+ * @hidden
2267
+ * This is the client version when getMedia API is supported via Callbacks on all three platforms ios, android and web.
2268
+ *
2269
+ * @internal
2270
+ * Limited to Microsoft-internal use
2271
+ */
2272
+ const getMediaCallbackSupportVersion = '2.0.0';
2273
+ /**
2274
+ * @hidden
2275
+ * This is the client version when scanBarCode API is supported on mobile.
2276
+ *
2277
+ * @internal
2278
+ * Limited to Microsoft-internal use
2279
+ */
2280
+ const scanBarCodeAPIMobileSupportVersion = '1.9.0';
2281
+ /**
2282
+ * @hidden
2283
+ * Fallback list of valid origins in JSON format
2284
+ *
2285
+ * @internal
2286
+ * Limited to Microsoft-internal use
2287
+ */
2288
+ const validOriginsLocal = artifactsForCDN_validDomains_namespaceObject;
2289
+ /**
2290
+ * @hidden
2291
+ * Fallback list of valid origins
2292
+ *
2293
+ * @internal
2294
+ * Limited to Microsoft-internal use
2295
+ */
2296
+ const validOriginsFallback = validOriginsLocal.validOrigins;
2297
+ /**
2298
+ * @hidden
2299
+ * Timeout length for Fetch Call for Valid Origins
2300
+ *
2301
+ * @internal
2302
+ * Limited to Microsoft-internal use
2303
+ */
2304
+ const ORIGIN_LIST_FETCH_TIMEOUT_IN_MS = 1500;
2305
+ /**
2306
+ * @hidden
2307
+ * CDN endpoint of the list of valid origins
2308
+ *
2309
+ * @internal
2310
+ * Limited to Microsoft-internal use
2311
+ */
2312
+ const validOriginsCdnEndpoint = new URL('https://res.cdn.office.net/teams-js/validDomains/json/validDomains.json');
2313
+ /**
2314
+ * @hidden
2315
+ * USer specified message origins should satisfy this test
2316
+ *
2317
+ * @internal
2318
+ * Limited to Microsoft-internal use
2319
+ */
2320
+ const userOriginUrlValidationRegExp = /^https:\/\//;
2321
+ /**
2322
+ * @hidden
2323
+ * The protocol used for deep links into Teams
2324
+ *
2325
+ * @internal
2326
+ * Limited to Microsoft-internal use
2327
+ */
2328
+ const teamsDeepLinkProtocol = 'https';
2329
+ /**
2330
+ * @hidden
2331
+ * The host used for deep links into Teams
2332
+ *
2333
+ * @internal
2334
+ * Limited to Microsoft-internal use
2335
+ */
2336
+ const teamsDeepLinkHost = 'teams.microsoft.com';
2337
+ /** @hidden */
2338
+ const errorLibraryNotInitialized = 'The library has not yet been initialized';
2339
+ /** @hidden */
2340
+ const errorRuntimeNotInitialized = 'The runtime has not yet been initialized';
2341
+ /** @hidden */
2342
+ const errorRuntimeNotSupported = 'The runtime version is not supported';
2343
+ /** @hidden */
2344
+ const errorCallNotStarted = 'The call was not properly started';
2345
+
2346
+ ;// ./src/internal/globalVars.ts
2347
+ class GlobalVars {
2348
+ }
2349
+ GlobalVars.initializeCalled = false;
2350
+ GlobalVars.initializeCompleted = false;
2351
+ GlobalVars.additionalValidOrigins = [];
2352
+ GlobalVars.initializePromise = undefined;
2353
+ GlobalVars.isFramelessWindow = false;
2354
+ GlobalVars.frameContext = undefined;
2355
+ GlobalVars.hostClientType = undefined;
2356
+ GlobalVars.printCapabilityEnabled = false;
2357
+
2358
+ // EXTERNAL MODULE: ../../node_modules/.pnpm/debug@4.3.5/node_modules/debug/src/browser.js
2359
+ var browser = __webpack_require__(815);
2360
+ // EXTERNAL MODULE: ../../node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.js
2361
+ var base64_js = __webpack_require__(933);
2362
+ ;// ../../node_modules/.pnpm/skeleton-buffer@file+skeleton-buffer/node_modules/skeleton-buffer/index.js
2363
+
2364
+
2365
+ const _Buffer = Buffer;
2366
+
2367
+
2368
+ const K_MAX_LENGTH = 0x7fffffff;
2369
+
2370
+ /**
2371
+ * If `Buffer.TYPED_ARRAY_SUPPORT`:
2372
+ * === true Use Uint8Array implementation (fastest)
2373
+ * === false Print warning and recommend using `buffer` v4.x which has an Object
2374
+ * implementation (most compatible, even IE6)
2375
+ *
2376
+ * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
2377
+ * Opera 11.6+, iOS 4.2+.
2378
+ *
2379
+ * We report that the browser does not support typed arrays if the are not subclassable
2380
+ * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`
2381
+ * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support
2382
+ * for __proto__ and has a buggy typed array implementation.
2383
+ */
2384
+ Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport();
2385
+
2386
+ if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' && typeof console.error === 'function') {
2000
2387
  console.error('This browser lacks typed array (Uint8Array) support which is required');
2001
2388
  }
2002
2389
 
@@ -2932,213 +3319,6 @@ function validate_validate(uuid) {
2932
3319
  }
2933
3320
 
2934
3321
  /* harmony default export */ const esm_browser_validate = (validate_validate);
2935
- ;// ./src/public/interfaces.ts
2936
- /* eslint-disable @typescript-eslint/no-explicit-any*/
2937
- /**
2938
- * Allowed user file open preferences
2939
- */
2940
- var FileOpenPreference;
2941
- (function (FileOpenPreference) {
2942
- /** Indicates that the user should be prompted to open the file in inline. */
2943
- FileOpenPreference["Inline"] = "inline";
2944
- /** Indicates that the user should be prompted to open the file in the native desktop application associated with the file type. */
2945
- FileOpenPreference["Desktop"] = "desktop";
2946
- /** Indicates that the user should be prompted to open the file in a web browser. */
2947
- FileOpenPreference["Web"] = "web";
2948
- })(FileOpenPreference || (FileOpenPreference = {}));
2949
- /**
2950
- * Types of Action Objects
2951
- *
2952
- * @beta
2953
- */
2954
- var ActionObjectType;
2955
- (function (ActionObjectType) {
2956
- /** Represents content within a Microsoft 365 application. */
2957
- ActionObjectType["M365Content"] = "m365content";
2958
- })(ActionObjectType || (ActionObjectType = {}));
2959
- /**
2960
- * These correspond with field names in the MSGraph.
2961
- * See [commonly accessed resources](https://learn.microsoft.com/graph/api/resources/onedrive?view=graph-rest-1.0#commonly-accessed-resources).
2962
- * @beta
2963
- */
2964
- var SecondaryM365ContentIdName;
2965
- (function (SecondaryM365ContentIdName) {
2966
- /** OneDrive ID */
2967
- SecondaryM365ContentIdName["DriveId"] = "driveId";
2968
- /** Teams Group ID */
2969
- SecondaryM365ContentIdName["GroupId"] = "groupId";
2970
- /** SharePoint ID */
2971
- SecondaryM365ContentIdName["SiteId"] = "siteId";
2972
- /** User ID */
2973
- SecondaryM365ContentIdName["UserId"] = "userId";
2974
- })(SecondaryM365ContentIdName || (SecondaryM365ContentIdName = {}));
2975
- function isSdkError(err) {
2976
- return (err === null || err === void 0 ? void 0 : err.errorCode) !== undefined;
2977
- }
2978
- /** Error codes used to identify different types of errors that can occur while developing apps. */
2979
- var ErrorCode;
2980
- (function (ErrorCode) {
2981
- /**
2982
- * API not supported in the current platform.
2983
- */
2984
- ErrorCode[ErrorCode["NOT_SUPPORTED_ON_PLATFORM"] = 100] = "NOT_SUPPORTED_ON_PLATFORM";
2985
- /**
2986
- * Internal error encountered while performing the required operation.
2987
- */
2988
- ErrorCode[ErrorCode["INTERNAL_ERROR"] = 500] = "INTERNAL_ERROR";
2989
- /**
2990
- * API is not supported in the current context
2991
- */
2992
- ErrorCode[ErrorCode["NOT_SUPPORTED_IN_CURRENT_CONTEXT"] = 501] = "NOT_SUPPORTED_IN_CURRENT_CONTEXT";
2993
- /**
2994
- Permissions denied by user
2995
- */
2996
- ErrorCode[ErrorCode["PERMISSION_DENIED"] = 1000] = "PERMISSION_DENIED";
2997
- /**
2998
- * Network issue
2999
- */
3000
- ErrorCode[ErrorCode["NETWORK_ERROR"] = 2000] = "NETWORK_ERROR";
3001
- /**
3002
- * Underlying hardware doesn't support the capability
3003
- */
3004
- ErrorCode[ErrorCode["NO_HW_SUPPORT"] = 3000] = "NO_HW_SUPPORT";
3005
- /**
3006
- * One or more arguments are invalid
3007
- */
3008
- ErrorCode[ErrorCode["INVALID_ARGUMENTS"] = 4000] = "INVALID_ARGUMENTS";
3009
- /**
3010
- * User is not authorized for this operation
3011
- */
3012
- ErrorCode[ErrorCode["UNAUTHORIZED_USER_OPERATION"] = 5000] = "UNAUTHORIZED_USER_OPERATION";
3013
- /**
3014
- * Could not complete the operation due to insufficient resources
3015
- */
3016
- ErrorCode[ErrorCode["INSUFFICIENT_RESOURCES"] = 6000] = "INSUFFICIENT_RESOURCES";
3017
- /**
3018
- * Platform throttled the request because of API was invoked too frequently
3019
- */
3020
- ErrorCode[ErrorCode["THROTTLE"] = 7000] = "THROTTLE";
3021
- /**
3022
- * User aborted the operation
3023
- */
3024
- ErrorCode[ErrorCode["USER_ABORT"] = 8000] = "USER_ABORT";
3025
- /**
3026
- * Could not complete the operation in the given time interval
3027
- */
3028
- ErrorCode[ErrorCode["OPERATION_TIMED_OUT"] = 8001] = "OPERATION_TIMED_OUT";
3029
- /**
3030
- * Platform code is old and doesn't implement this API
3031
- */
3032
- ErrorCode[ErrorCode["OLD_PLATFORM"] = 9000] = "OLD_PLATFORM";
3033
- /**
3034
- * The file specified was not found on the given location
3035
- */
3036
- ErrorCode[ErrorCode["FILE_NOT_FOUND"] = 404] = "FILE_NOT_FOUND";
3037
- /**
3038
- * The return value is too big and has exceeded our size boundries
3039
- */
3040
- ErrorCode[ErrorCode["SIZE_EXCEEDED"] = 10000] = "SIZE_EXCEEDED";
3041
- })(ErrorCode || (ErrorCode = {}));
3042
- /** @hidden */
3043
- var DevicePermission;
3044
- (function (DevicePermission) {
3045
- DevicePermission["GeoLocation"] = "geolocation";
3046
- DevicePermission["Media"] = "media";
3047
- })(DevicePermission || (DevicePermission = {}));
3048
- /**
3049
- * @hidden
3050
- *
3051
- * @beta
3052
- */
3053
- var Cohort;
3054
- (function (Cohort) {
3055
- Cohort["BCAIS"] = "bcais";
3056
- Cohort["BCWAF"] = "bcwaf";
3057
- Cohort["BCWBF"] = "bcwbf";
3058
- })(Cohort || (Cohort = {}));
3059
- /**
3060
- * @hidden
3061
- *
3062
- * @beta
3063
- */
3064
- var Persona;
3065
- (function (Persona) {
3066
- /**
3067
- * User has a faculty license
3068
- */
3069
- Persona["Faculty"] = "faculty";
3070
- /**
3071
- * User has a student license
3072
- */
3073
- Persona["Student"] = "student";
3074
- /**
3075
- * When user is not a faculty or student
3076
- */
3077
- Persona["Other"] = "other";
3078
- })(Persona || (Persona = {}));
3079
- /**
3080
- * @hidden
3081
- *
3082
- * @beta
3083
- */
3084
- // https://learn.microsoft.com/en-us/graph/api/resources/user?view=graph-rest-1.0#legalagegroupclassification-values
3085
- var LegalAgeGroupClassification;
3086
- (function (LegalAgeGroupClassification) {
3087
- /**
3088
- * The user is considered an adult based on the age-related regulations of their country or region.
3089
- */
3090
- LegalAgeGroupClassification["Adult"] = "adult";
3091
- /**
3092
- * The user is a minor but is from a country or region that has no age-related regulations.
3093
- */
3094
- LegalAgeGroupClassification["MinorNoParentalConsentRequired"] = "minorNoParentalConsentRequired";
3095
- /**
3096
- * Reserved for future use
3097
- */
3098
- LegalAgeGroupClassification["MinorWithoutParentalConsent"] = "minorWithoutParentalConsent";
3099
- /**
3100
- * The user is considered a minor based on the age-related regulations of their country or region, and the administrator
3101
- * of the account obtained appropriate consent from a parent or guardian.
3102
- */
3103
- LegalAgeGroupClassification["MinorWithParentalConsent"] = "minorWithParentalConsent";
3104
- /**
3105
- * The user is from a country or region that has additional age-related regulations, such as the United States,
3106
- * United Kingdom, European Union, or South Korea, and the user's age is between a minor and an adult age
3107
- * (as stipulated based on country or region). Generally, this means that teenagers are considered as notAdult in regulated countries.
3108
- */
3109
- LegalAgeGroupClassification["NonAdult"] = "nonAdult";
3110
- })(LegalAgeGroupClassification || (LegalAgeGroupClassification = {}));
3111
- /**
3112
- * @hidden
3113
- *
3114
- * @beta
3115
- */
3116
- var EduType;
3117
- (function (EduType) {
3118
- /**
3119
- * User is from a tenant labeled as “HigherEd”
3120
- */
3121
- EduType["HigherEducation"] = "higherEducation";
3122
- /**
3123
- * User is from a tenant labeled as “K12”
3124
- */
3125
- EduType["K12"] = "k12";
3126
- /**
3127
- * User is from a tenant labeled as “Others” (e.g. research institutions)
3128
- */
3129
- EduType["Other"] = "other";
3130
- })(EduType || (EduType = {}));
3131
- /**
3132
- * Currently supported Mime type
3133
- */
3134
- var ClipboardSupportedMimeType;
3135
- (function (ClipboardSupportedMimeType) {
3136
- ClipboardSupportedMimeType["TextPlain"] = "text/plain";
3137
- ClipboardSupportedMimeType["TextHtml"] = "text/html";
3138
- ClipboardSupportedMimeType["ImagePNG"] = "image/png";
3139
- ClipboardSupportedMimeType["ImageJPEG"] = "image/jpeg";
3140
- })(ClipboardSupportedMimeType || (ClipboardSupportedMimeType = {}));
3141
-
3142
3322
  ;// ./src/public/constants.ts
3143
3323
  /** HostClientType represents the different client platforms on which host can be run. */
3144
3324
  var HostClientType;
@@ -3781,299 +3961,119 @@ function getCurrentTimestamp() {
3781
3961
  * @hidden
3782
3962
  * @internal
3783
3963
  * Limited to Microsoft-internal use
3784
- *
3785
- * Function to check whether the data is a primitive type or a plain object.
3786
- * Recursion is limited to a maximum depth of 1000 to prevent excessive nesting and potential stack overflow.
3787
- *
3788
- * @param value The value to check
3789
- * @returns true if the value is a primitive type or a plain object, false otherwise
3790
- *
3791
- */
3792
- function isPrimitiveOrPlainObject(value, depth = 0) {
3793
- if (depth > 1000) {
3794
- return false; // Limit recursion depth
3795
- }
3796
- // Check if the value is a primitive type or null
3797
- if (typeof value === 'undefined' ||
3798
- typeof value === 'boolean' ||
3799
- typeof value === 'number' ||
3800
- typeof value === 'bigint' ||
3801
- typeof value === 'string' ||
3802
- value === null) {
3803
- return true;
3804
- }
3805
- if (Array.isArray(value)) {
3806
- // Check if all elements in the array are serializable
3807
- return value.every((element) => isPrimitiveOrPlainObject(element, depth + 1));
3808
- }
3809
- // Check if the value is a plain object
3810
- const isPlainObject = typeof value === 'object' &&
3811
- Object.prototype.toString.call(value) === '[object Object]' &&
3812
- (Object.getPrototypeOf(value) === Object.prototype || Object.getPrototypeOf(value) === null);
3813
- if (!isPlainObject) {
3814
- return false;
3815
- }
3816
- // Check all properties of the object recursively
3817
- return Object.keys(value).every((key) => isPrimitiveOrPlainObject(value[key], depth + 1));
3818
- }
3819
-
3820
- ;// ./src/public/uuidObject.ts
3821
-
3822
- /**
3823
- * @internal
3824
- * Limited to Microsoft-internal use
3825
- *
3826
- * Represents a UUID (Universally Unique Identifier) object.
3827
- * This class provides a way to generate, validate, and represent UUIDs as strings.
3828
- */
3829
- class UUID {
3830
- /**
3831
- * Creates an instance of the UUID class.
3832
- * If no UUID string is provided, a new UUID is generated.
3833
- *
3834
- * @param {string} [uuid=generateGUID()] - The UUID string. Defaults to a newly generated UUID.
3835
- * @throws {Error} - Throws an error if the provided UUID is invalid.
3836
- */
3837
- constructor(uuid = generateGUID()) {
3838
- this.uuid = uuid;
3839
- validateUuid(uuid);
3840
- }
3841
- /**
3842
- * Returns the UUID as a string.
3843
- *
3844
- * @returns {string} - The UUID string.
3845
- */
3846
- toString() {
3847
- return this.uuid;
3848
- }
3849
- }
3850
-
3851
- ;// ./src/internal/telemetry.ts
3852
- // We are directly referencing the browser implementation of `debug` to resolve an issue with polyfilling. For a full write-up on the bug please see ADO Bug #9619161
3853
-
3854
-
3855
- // Each teamsjs instance gets a unique identifier that will be prepended to every log statement
3856
- const teamsJsInstanceIdentifier = new UUID();
3857
- // Every log statement will get prepended with the teamsJsInstanceIdentifier and a timestamp
3858
- const originalFormatArgsFunction = browser.debug.formatArgs;
3859
- browser.debug.formatArgs = function (args) {
3860
- args[0] = `(${new Date().toISOString()}): ${args[0]} [${teamsJsInstanceIdentifier.toString()}]`;
3861
- originalFormatArgsFunction.call(this, args);
3862
- };
3863
- const topLevelLogger = (0,browser.debug)('teamsJs');
3864
- /**
3865
- * @internal
3866
- * Limited to Microsoft-internal use
3867
- *
3868
- * Returns a logger for a given namespace, within the pre-defined top-level teamsJs namespace
3869
- */
3870
- function getLogger(namespace) {
3871
- return topLevelLogger.extend(namespace);
3872
- }
3873
- /**
3874
- * @hidden
3875
- * Creates a string tag for labeling apiVersionTag, which is used for API function call to create message request
3876
- * sent to host(s).
3877
- *
3878
- * @internal
3879
- * Limited to Microsoft-internal use
3880
- */
3881
- function getApiVersionTag(apiVersionNumber, functionName) {
3882
- return `${apiVersionNumber}_${functionName}`;
3883
- }
3884
- /**
3885
- * @hidden
3886
- * Check if apiVersionTag developer sends follows the pattern starting with a lowercase 'v', then
3887
- * followed by one or more digits, then concatenated with underscore and some characters to indicate api name.
3888
- * For example, 'v2_app.getContext'. If yes, return true. Otherwise, return false.
3889
- *
3890
- * @internal
3891
- * Limited to Microsoft-internal use
3892
- */
3893
- function isFollowingApiVersionTagFormat(apiVersionTag) {
3894
- const pattern = /^v\d+_[\w.]+$/;
3895
- return pattern.test(apiVersionTag);
3896
- }
3897
-
3898
- ;// ./src/artifactsForCDN/validDomains.json
3899
- const validDomains_namespaceObject = /*#__PURE__*/JSON.parse('{"validOrigins":["teams.microsoft.com","teams.microsoft.us","gov.teams.microsoft.us","dod.teams.microsoft.us","int.teams.microsoft.com","outlook.office.com","outlook-sdf.office.com","outlook.office365.com","outlook-sdf.office365.com","outlook.live.com","outlook-sdf.live.com","teams.live.com","local.teams.live.com","local.teams.live.com:8080","local.teams.office.com","local.teams.office.com:8080","devspaces.skype.com","*.www.office.com","www.office.com","word.office.com","excel.office.com","powerpoint.office.com","www.officeppe.com","*.www.microsoft365.com","www.microsoft365.com","bing.com","edgeservices.bing.com","work.bing.com","www.bing.com","www.staging-bing-int.com","*.cloud.microsoft","*.m365.cloud.microsoft","chatuxmanager.svc.cloud.microsoft","copilot.microsoft.com","windows.msn.com","fa000000125.resources.office.net","fa000000129.resources.office.net","fa000000124.resources.office.net","fa000000128.resources.office.net","fa000000136.resources.office.net"]}');
3900
- var artifactsForCDN_validDomains_namespaceObject = /*#__PURE__*/__webpack_require__.t(validDomains_namespaceObject, 2);
3901
- ;// ./src/internal/constants.ts
3902
-
3903
- /**
3904
- * @hidden
3905
- * The client version when all SDK APIs started to check platform compatibility for the APIs was 1.6.0.
3906
- * Modified to 2.0.1 which is hightest till now so that if any client doesn't pass version in initialize function, it will be set to highest.
3907
- * Mobile clients are passing versions, hence will be applicable to web and desktop clients only.
3908
- *
3909
- * @internal
3910
- * Limited to Microsoft-internal use
3911
- */
3912
- const defaultSDKVersionForCompatCheck = '2.0.1';
3913
- /**
3914
- * @hidden
3915
- * This is the client version when selectMedia API - VideoAndImage is supported on mobile.
3916
- *
3917
- * @internal
3918
- * Limited to Microsoft-internal use
3919
- */
3920
- const videoAndImageMediaAPISupportVersion = '2.0.2';
3921
- /**
3922
- * @hidden
3923
- * This is the client version when selectMedia API - Video with non-full screen mode is supported on mobile.
3924
- *
3925
- * @internal
3926
- * Limited to Microsoft-internal use
3927
- */
3928
- const nonFullScreenVideoModeAPISupportVersion = '2.0.3';
3929
- /**
3930
- * @hidden
3931
- * This is the client version when selectMedia API - ImageOutputFormats is supported on mobile.
3932
- *
3933
- * @internal
3934
- * Limited to Microsoft-internal use
3935
- */
3936
- const imageOutputFormatsAPISupportVersion = '2.0.4';
3937
- /**
3938
- * @hidden
3939
- * Minimum required client supported version for {@link getUserJoinedTeams} to be supported on {@link HostClientType.android}
3940
- *
3941
- * @internal
3942
- * Limited to Microsoft-internal use
3943
- */
3944
- const getUserJoinedTeamsSupportedAndroidClientVersion = '2.0.1';
3945
- /**
3946
- * @hidden
3947
- * This is the client version when location APIs (getLocation and showLocation) are supported.
3948
- *
3949
- * @internal
3950
- * Limited to Microsoft-internal use
3951
- */
3952
- const locationAPIsRequiredVersion = '1.9.0';
3953
- /**
3954
- * @hidden
3955
- * This is the client version when permisisons are supported
3956
- *
3957
- * @internal
3958
- * Limited to Microsoft-internal use
3959
- */
3960
- const permissionsAPIsRequiredVersion = '2.0.1';
3961
- /**
3962
- * @hidden
3963
- * This is the client version when people picker API is supported on mobile.
3964
- *
3965
- * @internal
3966
- * Limited to Microsoft-internal use
3967
- */
3968
- const peoplePickerRequiredVersion = '2.0.0';
3969
- /**
3970
- * @hidden
3971
- * This is the client version when captureImage API is supported on mobile.
3972
- *
3973
- * @internal
3974
- * Limited to Microsoft-internal use
3975
- */
3976
- const captureImageMobileSupportVersion = '1.7.0';
3977
- /**
3978
- * @hidden
3979
- * This is the client version when media APIs are supported on all three platforms ios, android and web.
3980
- *
3981
- * @internal
3982
- * Limited to Microsoft-internal use
3983
- */
3984
- const mediaAPISupportVersion = '1.8.0';
3985
- /**
3986
- * @hidden
3987
- * This is the client version when getMedia API is supported via Callbacks on all three platforms ios, android and web.
3988
- *
3989
- * @internal
3990
- * Limited to Microsoft-internal use
3991
- */
3992
- const getMediaCallbackSupportVersion = '2.0.0';
3993
- /**
3994
- * @hidden
3995
- * This is the client version when scanBarCode API is supported on mobile.
3996
- *
3997
- * @internal
3998
- * Limited to Microsoft-internal use
3999
- */
4000
- const scanBarCodeAPIMobileSupportVersion = '1.9.0';
4001
- /**
4002
- * @hidden
4003
- * Fallback list of valid origins in JSON format
4004
- *
4005
- * @internal
4006
- * Limited to Microsoft-internal use
4007
- */
4008
- const validOriginsLocal = artifactsForCDN_validDomains_namespaceObject;
4009
- /**
4010
- * @hidden
4011
- * Fallback list of valid origins
4012
- *
4013
- * @internal
4014
- * Limited to Microsoft-internal use
4015
- */
4016
- const validOriginsFallback = validOriginsLocal.validOrigins;
4017
- /**
4018
- * @hidden
4019
- * Timeout length for Fetch Call for Valid Origins
4020
- *
4021
- * @internal
4022
- * Limited to Microsoft-internal use
3964
+ *
3965
+ * Function to check whether the data is a primitive type or a plain object.
3966
+ * Recursion is limited to a maximum depth of 1000 to prevent excessive nesting and potential stack overflow.
3967
+ *
3968
+ * @param value The value to check
3969
+ * @returns true if the value is a primitive type or a plain object, false otherwise
3970
+ *
4023
3971
  */
4024
- const ORIGIN_LIST_FETCH_TIMEOUT_IN_MS = 1500;
3972
+ function isPrimitiveOrPlainObject(value, depth = 0) {
3973
+ if (depth > 1000) {
3974
+ return false; // Limit recursion depth
3975
+ }
3976
+ // Check if the value is a primitive type or null
3977
+ if (typeof value === 'undefined' ||
3978
+ typeof value === 'boolean' ||
3979
+ typeof value === 'number' ||
3980
+ typeof value === 'bigint' ||
3981
+ typeof value === 'string' ||
3982
+ value === null) {
3983
+ return true;
3984
+ }
3985
+ if (Array.isArray(value)) {
3986
+ // Check if all elements in the array are serializable
3987
+ return value.every((element) => isPrimitiveOrPlainObject(element, depth + 1));
3988
+ }
3989
+ // Check if the value is a plain object
3990
+ const isPlainObject = typeof value === 'object' &&
3991
+ Object.prototype.toString.call(value) === '[object Object]' &&
3992
+ (Object.getPrototypeOf(value) === Object.prototype || Object.getPrototypeOf(value) === null);
3993
+ if (!isPlainObject) {
3994
+ return false;
3995
+ }
3996
+ // Check all properties of the object recursively
3997
+ return Object.keys(value).every((key) => isPrimitiveOrPlainObject(value[key], depth + 1));
3998
+ }
3999
+
4000
+ ;// ./src/public/uuidObject.ts
4001
+
4025
4002
  /**
4026
- * @hidden
4027
- * CDN endpoint of the list of valid origins
4028
- *
4029
4003
  * @internal
4030
4004
  * Limited to Microsoft-internal use
4005
+ *
4006
+ * Represents a UUID (Universally Unique Identifier) object.
4007
+ * This class provides a way to generate, validate, and represent UUIDs as strings.
4031
4008
  */
4032
- const validOriginsCdnEndpoint = new URL('https://res.cdn.office.net/teams-js/validDomains/json/validDomains.json');
4009
+ class UUID {
4010
+ /**
4011
+ * Creates an instance of the UUID class.
4012
+ * If no UUID string is provided, a new UUID is generated.
4013
+ *
4014
+ * @param {string} [uuid=generateGUID()] - The UUID string. Defaults to a newly generated UUID.
4015
+ * @throws {Error} - Throws an error if the provided UUID is invalid.
4016
+ */
4017
+ constructor(uuid = generateGUID()) {
4018
+ this.uuid = uuid;
4019
+ validateUuid(uuid);
4020
+ }
4021
+ /**
4022
+ * Returns the UUID as a string.
4023
+ *
4024
+ * @returns {string} - The UUID string.
4025
+ */
4026
+ toString() {
4027
+ return this.uuid;
4028
+ }
4029
+ }
4030
+
4031
+ ;// ./src/internal/telemetry.ts
4032
+ // We are directly referencing the browser implementation of `debug` to resolve an issue with polyfilling. For a full write-up on the bug please see ADO Bug #9619161
4033
+
4034
+
4035
+ // Each teamsjs instance gets a unique identifier that will be prepended to every log statement
4036
+ const teamsJsInstanceIdentifier = new UUID();
4037
+ // Every log statement will get prepended with the teamsJsInstanceIdentifier and a timestamp
4038
+ const originalFormatArgsFunction = browser.debug.formatArgs;
4039
+ browser.debug.formatArgs = function (args) {
4040
+ args[0] = `(${new Date().toISOString()}): ${args[0]} [${teamsJsInstanceIdentifier.toString()}]`;
4041
+ originalFormatArgsFunction.call(this, args);
4042
+ };
4043
+ const topLevelLogger = (0,browser.debug)('teamsJs');
4033
4044
  /**
4034
- * @hidden
4035
- * USer specified message origins should satisfy this test
4036
- *
4037
4045
  * @internal
4038
4046
  * Limited to Microsoft-internal use
4047
+ *
4048
+ * Returns a logger for a given namespace, within the pre-defined top-level teamsJs namespace
4039
4049
  */
4040
- const userOriginUrlValidationRegExp = /^https:\/\//;
4050
+ function getLogger(namespace) {
4051
+ return topLevelLogger.extend(namespace);
4052
+ }
4041
4053
  /**
4042
4054
  * @hidden
4043
- * The protocol used for deep links into Teams
4055
+ * Creates a string tag for labeling apiVersionTag, which is used for API function call to create message request
4056
+ * sent to host(s).
4044
4057
  *
4045
4058
  * @internal
4046
4059
  * Limited to Microsoft-internal use
4047
4060
  */
4048
- const teamsDeepLinkProtocol = 'https';
4061
+ function getApiVersionTag(apiVersionNumber, functionName) {
4062
+ return `${apiVersionNumber}_${functionName}`;
4063
+ }
4049
4064
  /**
4050
4065
  * @hidden
4051
- * The host used for deep links into Teams
4066
+ * Check if apiVersionTag developer sends follows the pattern starting with a lowercase 'v', then
4067
+ * followed by one or more digits, then concatenated with underscore and some characters to indicate api name.
4068
+ * For example, 'v2_app.getContext'. If yes, return true. Otherwise, return false.
4052
4069
  *
4053
4070
  * @internal
4054
4071
  * Limited to Microsoft-internal use
4055
4072
  */
4056
- const teamsDeepLinkHost = 'teams.microsoft.com';
4057
- /** @hidden */
4058
- const errorLibraryNotInitialized = 'The library has not yet been initialized';
4059
- /** @hidden */
4060
- const errorRuntimeNotInitialized = 'The runtime has not yet been initialized';
4061
- /** @hidden */
4062
- const errorRuntimeNotSupported = 'The runtime version is not supported';
4063
- /** @hidden */
4064
- const errorCallNotStarted = 'The call was not properly started';
4065
-
4066
- ;// ./src/internal/globalVars.ts
4067
- class GlobalVars {
4073
+ function isFollowingApiVersionTagFormat(apiVersionTag) {
4074
+ const pattern = /^v\d+_[\w.]+$/;
4075
+ return pattern.test(apiVersionTag);
4068
4076
  }
4069
- GlobalVars.initializeCalled = false;
4070
- GlobalVars.initializeCompleted = false;
4071
- GlobalVars.additionalValidOrigins = [];
4072
- GlobalVars.initializePromise = undefined;
4073
- GlobalVars.isFramelessWindow = false;
4074
- GlobalVars.frameContext = undefined;
4075
- GlobalVars.hostClientType = undefined;
4076
- GlobalVars.printCapabilityEnabled = false;
4077
4077
 
4078
4078
  ;// ./src/public/runtime.ts
4079
4079
  /* eslint-disable @typescript-eslint/ban-types */
@@ -4484,7 +4484,80 @@ function isSerializable(arg) {
4484
4484
  * @hidden
4485
4485
  * Package version.
4486
4486
  */
4487
- const version = "2.34.1-beta.0";
4487
+ const version = "2.35.0-beta.0";
4488
+
4489
+ ;// ./src/internal/messageObjects.ts
4490
+ var messageObjects_rest = (undefined && undefined.__rest) || function (s, e) {
4491
+ var t = {};
4492
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4493
+ t[p] = s[p];
4494
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
4495
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
4496
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
4497
+ t[p[i]] = s[p[i]];
4498
+ }
4499
+ return t;
4500
+ };
4501
+
4502
+ const serializeMessageRequest = (message) => {
4503
+ const { uuid } = message, restOfMessage = messageObjects_rest(message, ["uuid"]);
4504
+ const uuidAsString = uuid === null || uuid === void 0 ? void 0 : uuid.toString();
4505
+ const request = Object.assign(Object.assign({}, restOfMessage), { uuidAsString: uuidAsString });
4506
+ return request;
4507
+ };
4508
+ const deserializeMessageRequest = (message) => {
4509
+ const { uuidAsString } = message, restOfMessage = messageObjects_rest(message, ["uuidAsString"]);
4510
+ const request = Object.assign(Object.assign({}, restOfMessage), { uuid: uuidAsString ? new UUID(uuidAsString) : undefined });
4511
+ return request;
4512
+ };
4513
+ const deserializeMessageResponse = (serializedResponse) => {
4514
+ const { uuidAsString } = serializedResponse, restOfResponse = messageObjects_rest(serializedResponse, ["uuidAsString"]);
4515
+ const messageResponse = Object.assign(Object.assign({}, restOfResponse), { uuid: uuidAsString ? new UUID(uuidAsString) : undefined });
4516
+ return messageResponse;
4517
+ };
4518
+ const serializeMessageResponse = (response) => {
4519
+ const { uuid } = response, restOfResponse = messageObjects_rest(response, ["uuid"]);
4520
+ const uuidAsString = uuid === null || uuid === void 0 ? void 0 : uuid.toString();
4521
+ const messageResponse = Object.assign(Object.assign({}, restOfResponse), { uuidAsString: uuidAsString });
4522
+ return messageResponse;
4523
+ };
4524
+
4525
+ ;// ./src/internal/communicationUtils.ts
4526
+
4527
+
4528
+ /**
4529
+ * @hidden
4530
+ * @internal
4531
+ * Limited to Microsoft-internal use
4532
+ */
4533
+ function getMessageIdsAsLogString(message) {
4534
+ if (message.uuidAsString !== undefined) {
4535
+ return `${message.uuidAsString} (legacy id: ${message.id})`;
4536
+ }
4537
+ if (message.uuid !== undefined) {
4538
+ return `${message.uuid.toString()} (legacy id: ${message.id})`;
4539
+ }
4540
+ return `legacy id: ${message.id} (no uuid)`;
4541
+ }
4542
+ const flushMessageQueueLogger = getLogger('flushMessageQueue');
4543
+ /**
4544
+ * @hidden
4545
+ * @internal
4546
+ * Limited to Microsoft-internal use
4547
+ */
4548
+ function flushMessageQueue(targetWindow, targetOrigin, targetMessageQueue, target) {
4549
+ if (!targetWindow || !targetOrigin || targetMessageQueue.length === 0) {
4550
+ return;
4551
+ }
4552
+ while (targetMessageQueue.length > 0) {
4553
+ const messageRequest = targetMessageQueue.shift();
4554
+ if (messageRequest) {
4555
+ const request = serializeMessageRequest(messageRequest);
4556
+ flushMessageQueueLogger('Flushing message %s from %s message queue via postMessage.', getMessageIdsAsLogString(request), target);
4557
+ targetWindow.postMessage(request, targetOrigin);
4558
+ }
4559
+ }
4560
+ }
4488
4561
 
4489
4562
  ;// ./src/internal/internalAPIs.ts
4490
4563
 
@@ -5931,6 +6004,7 @@ function menus_isSupported() {
5931
6004
 
5932
6005
 
5933
6006
 
6007
+
5934
6008
  let saveHandler;
5935
6009
  let removeHandler;
5936
6010
  /**
@@ -6035,7 +6109,7 @@ function handleSave(result) {
6035
6109
  if (saveHandler) {
6036
6110
  saveHandler(saveEventType);
6037
6111
  }
6038
- else if (Communication.childWindow) {
6112
+ else if (shouldEventBeRelayedToChild()) {
6039
6113
  sendMessageEventToChild('settings.save', [result]);
6040
6114
  }
6041
6115
  else {
@@ -6084,7 +6158,7 @@ function handleRemove() {
6084
6158
  if (removeHandler) {
6085
6159
  removeHandler(removeEventType);
6086
6160
  }
6087
- else if (Communication.childWindow) {
6161
+ else if (shouldEventBeRelayedToChild()) {
6088
6162
  sendMessageEventToChild('settings.remove', []);
6089
6163
  }
6090
6164
  else {
@@ -6502,38 +6576,114 @@ function onClick(handler) {
6502
6576
  });
6503
6577
  }
6504
6578
  /**
6505
- * Registers a handler for entering hover of the app button.
6506
- * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.
6507
- * @param handler - The handler to invoke when entering hover of the personal app button in the app bar.
6579
+ * Registers a handler for entering hover of the app button.
6580
+ * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.
6581
+ * @param handler - The handler to invoke when entering hover of the personal app button in the app bar.
6582
+ */
6583
+ function onHoverEnter(handler) {
6584
+ registerHandlerHelper(getApiVersionTag(pagesTelemetryVersionNumber, "pages.appButton.onHoverEnter" /* ApiName.Pages_AppButton_OnHoverEnter */), 'appButtonHoverEnter', handler, [FrameContexts.content], () => {
6585
+ if (!appButton_isSupported()) {
6586
+ throw errorNotSupportedOnPlatform;
6587
+ }
6588
+ });
6589
+ }
6590
+ /**
6591
+ * Registers a handler for exiting hover of the app button.
6592
+ * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.
6593
+ * @param handler - The handler to invoke when exiting hover of the personal app button in the app bar.
6594
+ */
6595
+ function onHoverLeave(handler) {
6596
+ registerHandlerHelper(getApiVersionTag(pagesTelemetryVersionNumber, "pages.appButton.onHoverLeave" /* ApiName.Pages_AppButton_OnHoverLeave */), 'appButtonHoverLeave', handler, [FrameContexts.content], () => {
6597
+ if (!appButton_isSupported()) {
6598
+ throw errorNotSupportedOnPlatform;
6599
+ }
6600
+ });
6601
+ }
6602
+ /**
6603
+ * Checks if pages.appButton capability is supported by the host
6604
+ * @returns boolean to represent whether the pages.appButton capability is supported
6605
+ *
6606
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
6607
+ */
6608
+ function appButton_isSupported() {
6609
+ return ensureInitialized(runtime) && runtime.supports.pages
6610
+ ? runtime.supports.pages.appButton
6611
+ ? true
6612
+ : false
6613
+ : false;
6614
+ }
6615
+
6616
+ ;// ./src/public/pages/backStack.ts
6617
+ /**
6618
+ * Provides APIs for handling the user's navigational history.
6619
+ * @module
6620
+ */
6621
+
6622
+
6623
+
6624
+
6625
+
6626
+
6627
+
6628
+ /**
6629
+ * @hidden
6630
+ * Register backButtonPress handler.
6631
+ *
6632
+ * @internal
6633
+ * Limited to Microsoft-internal use.
6634
+ */
6635
+ function backStack_initialize() {
6636
+ initializeBackStackHelper();
6637
+ }
6638
+ /**
6639
+ * Navigates back in the hosted application. See {@link pages.backStack.registerBackButtonHandler} for notes on usage.
6640
+ * @returns Promise that resolves when the navigation has completed.
6641
+ */
6642
+ function navigateBack() {
6643
+ return backStackNavigateBackHelper(getApiVersionTag(pagesTelemetryVersionNumber, "pages.backStack.navigateBack" /* ApiName.Pages_BackStack_NavigateBack */));
6644
+ }
6645
+ /**
6646
+ * Registers a handler for user presses of the host client's back button. Experiences that maintain an internal
6647
+ * navigation stack should use this handler to navigate the user back within their frame. If an application finds
6648
+ * that after running its back button handler it cannot handle the event it should call the navigateBack
6649
+ * method to ask the host client to handle it instead.
6650
+ * @param handler - The handler to invoke when the user presses the host client's back button.
6508
6651
  */
6509
- function onHoverEnter(handler) {
6510
- registerHandlerHelper(getApiVersionTag(pagesTelemetryVersionNumber, "pages.appButton.onHoverEnter" /* ApiName.Pages_AppButton_OnHoverEnter */), 'appButtonHoverEnter', handler, [FrameContexts.content], () => {
6511
- if (!appButton_isSupported()) {
6652
+ function registerBackButtonHandler(handler) {
6653
+ registerBackButtonHandlerHelper(getApiVersionTag(pagesTelemetryVersionNumber, "pages.backStack.registerBackButtonHandler" /* ApiName.Pages_BackStack_RegisterBackButtonHandler */), handler, () => {
6654
+ if (!isNullOrUndefined(handler) && !backStack_isSupported()) {
6512
6655
  throw errorNotSupportedOnPlatform;
6513
6656
  }
6514
6657
  });
6515
6658
  }
6516
6659
  /**
6517
- * Registers a handler for exiting hover of the app button.
6518
- * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.
6519
- * @param handler - The handler to invoke when exiting hover of the personal app button in the app bar.
6660
+ * @hidden
6661
+ * Undocumented helper function with shared code between deprecated version and current version of the registerBackButtonHandler API.
6662
+ *
6663
+ * @internal
6664
+ * Limited to Microsoft-internal use
6665
+ * @param apiVersionTag - The tag indicating API version number with name
6666
+ * @param handler - The handler to invoke when the user presses the host client's back button.
6667
+ * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.
6520
6668
  */
6521
- function onHoverLeave(handler) {
6522
- registerHandlerHelper(getApiVersionTag(pagesTelemetryVersionNumber, "pages.appButton.onHoverLeave" /* ApiName.Pages_AppButton_OnHoverLeave */), 'appButtonHoverLeave', handler, [FrameContexts.content], () => {
6523
- if (!appButton_isSupported()) {
6524
- throw errorNotSupportedOnPlatform;
6525
- }
6526
- });
6669
+ function registerBackButtonHandlerHelper(apiVersionTag, handler, versionSpecificHelper) {
6670
+ // allow for registration cleanup even when not finished initializing
6671
+ !isNullOrUndefined(handler) && ensureInitialized(runtime);
6672
+ if (versionSpecificHelper) {
6673
+ versionSpecificHelper();
6674
+ }
6675
+ setBackButtonPressHandler(handler);
6676
+ !isNullOrUndefined(handler) && sendMessageToParent(apiVersionTag, 'registerHandler', ['backButton']);
6527
6677
  }
6528
6678
  /**
6529
- * Checks if pages.appButton capability is supported by the host
6530
- * @returns boolean to represent whether the pages.appButton capability is supported
6679
+ * Checks if the pages.backStack capability is supported by the host
6680
+ * @returns boolean to represent whether the pages.backStack capability is supported
6531
6681
  *
6532
6682
  * @throws Error if {@linkcode app.initialize} has not successfully completed
6533
6683
  */
6534
- function appButton_isSupported() {
6684
+ function backStack_isSupported() {
6535
6685
  return ensureInitialized(runtime) && runtime.supports.pages
6536
- ? runtime.supports.pages.appButton
6686
+ ? runtime.supports.pages.backStack
6537
6687
  ? true
6538
6688
  : false
6539
6689
  : false;
@@ -6931,6 +7081,9 @@ function pages_isSupported() {
6931
7081
 
6932
7082
 
6933
7083
 
7084
+
7085
+
7086
+
6934
7087
  /**
6935
7088
  * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY
6936
7089
  */
@@ -7047,74 +7200,20 @@ function convertNavigateToAppParamsToAppNavigationParameters(params) {
7047
7200
  function convertAppNavigationParametersToNavigateToAppParams(params) {
7048
7201
  return Object.assign(Object.assign({}, params), { appId: params.appId.toString(), webUrl: params.webUrl ? params.webUrl.toString() : undefined });
7049
7202
  }
7050
-
7051
- ;// ./src/public/pages/backStack.ts
7052
- /**
7053
- * Provides APIs for handling the user's navigational history.
7054
- * @module
7055
- */
7056
-
7057
-
7058
-
7059
-
7060
-
7061
-
7062
-
7063
-
7203
+ //Back Stack Helpers
7064
7204
  let backButtonPressHandler;
7065
- /**
7066
- * @hidden
7067
- * Register backButtonPress handler.
7068
- *
7069
- * @internal
7070
- * Limited to Microsoft-internal use.
7071
- */
7072
- function backStack_initialize() {
7073
- registerHandler(getApiVersionTag(pagesTelemetryVersionNumber, "pages.backStack.registerBackButtonPressHandler" /* ApiName.Pages_BackStack_RegisterBackButtonPressHandler */), 'backButtonPress', handleBackButtonPress, false);
7074
- }
7075
- /**
7076
- * Navigates back in the hosted application. See {@link pages.backStack.registerBackButtonHandler} for notes on usage.
7077
- * @returns Promise that resolves when the navigation has completed.
7078
- */
7079
- function navigateBack() {
7080
- return backStackNavigateBackHelper(getApiVersionTag(pagesTelemetryVersionNumber, "pages.backStack.navigateBack" /* ApiName.Pages_BackStack_NavigateBack */));
7205
+ function getBackButtonPressHandler() {
7206
+ return backButtonPressHandler;
7081
7207
  }
7082
- /**
7083
- * Registers a handler for user presses of the host client's back button. Experiences that maintain an internal
7084
- * navigation stack should use this handler to navigate the user back within their frame. If an application finds
7085
- * that after running its back button handler it cannot handle the event it should call the navigateBack
7086
- * method to ask the host client to handle it instead.
7087
- * @param handler - The handler to invoke when the user presses the host client's back button.
7088
- */
7089
- function registerBackButtonHandler(handler) {
7090
- registerBackButtonHandlerHelper(getApiVersionTag(pagesTelemetryVersionNumber, "pages.backStack.registerBackButtonHandler" /* ApiName.Pages_BackStack_RegisterBackButtonHandler */), handler, () => {
7091
- if (!isNullOrUndefined(handler) && !backStack_isSupported()) {
7092
- throw errorNotSupportedOnPlatform;
7093
- }
7094
- });
7095
- }
7096
- /**
7097
- * @hidden
7098
- * Undocumented helper function with shared code between deprecated version and current version of the registerBackButtonHandler API.
7099
- *
7100
- * @internal
7101
- * Limited to Microsoft-internal use
7102
- * @param apiVersionTag - The tag indicating API version number with name
7103
- * @param handler - The handler to invoke when the user presses the host client's back button.
7104
- * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.
7105
- */
7106
- function registerBackButtonHandlerHelper(apiVersionTag, handler, versionSpecificHelper) {
7107
- // allow for registration cleanup even when not finished initializing
7108
- !isNullOrUndefined(handler) && ensureInitialized(runtime);
7109
- if (versionSpecificHelper) {
7110
- versionSpecificHelper();
7111
- }
7208
+ function setBackButtonPressHandler(handler) {
7112
7209
  backButtonPressHandler = handler;
7113
- !isNullOrUndefined(handler) && sendMessageToParent(apiVersionTag, 'registerHandler', ['backButton']);
7210
+ }
7211
+ function initializeBackStackHelper() {
7212
+ registerHandler(getApiVersionTag(pagesTelemetryVersionNumber, "pages.backStack.registerBackButtonPressHandler" /* ApiName.Pages_BackStack_RegisterBackButtonPressHandler */), 'backButtonPress', handleBackButtonPress, false);
7114
7213
  }
7115
7214
  function handleBackButtonPress() {
7116
7215
  if (!backButtonPressHandler || !backButtonPressHandler()) {
7117
- if (Communication.childWindow) {
7216
+ if (shouldEventBeRelayedToChild()) {
7118
7217
  // If the current window did not handle it let the child window
7119
7218
  sendMessageEventToChild('backButtonPress', []);
7120
7219
  }
@@ -7123,19 +7222,6 @@ function handleBackButtonPress() {
7123
7222
  }
7124
7223
  }
7125
7224
  }
7126
- /**
7127
- * Checks if the pages.backStack capability is supported by the host
7128
- * @returns boolean to represent whether the pages.backStack capability is supported
7129
- *
7130
- * @throws Error if {@linkcode app.initialize} has not successfully completed
7131
- */
7132
- function backStack_isSupported() {
7133
- return ensureInitialized(runtime) && runtime.supports.pages
7134
- ? runtime.supports.pages.backStack
7135
- ? true
7136
- : false
7137
- : false;
7138
- }
7139
7225
 
7140
7226
  ;// ./src/internal/handlers.ts
7141
7227
  /* eslint-disable @typescript-eslint/ban-types */
@@ -7155,6 +7241,7 @@ var handlers_awaiter = (undefined && undefined.__awaiter) || function (thisArg,
7155
7241
 
7156
7242
 
7157
7243
 
7244
+
7158
7245
  const handlersLogger = getLogger('handlers');
7159
7246
  /**
7160
7247
  * @internal
@@ -7171,7 +7258,7 @@ class HandlersPrivate {
7171
7258
  HandlersPrivate.handlers['themeChange'] = handleThemeChange;
7172
7259
  HandlersPrivate.handlers['load'] = handleLoad;
7173
7260
  HandlersPrivate.handlers['beforeUnload'] = handleBeforeUnload;
7174
- backStack_initialize();
7261
+ initializeBackStackHelper();
7175
7262
  }
7176
7263
  /**
7177
7264
  * @internal
@@ -7226,7 +7313,7 @@ function callHandler(name, args) {
7226
7313
  const result = handler.apply(this, args);
7227
7314
  return [true, result];
7228
7315
  }
7229
- else if (Communication.childWindow) {
7316
+ else if (shouldEventBeRelayedToChild()) {
7230
7317
  sendMessageEventToChild(name, args);
7231
7318
  return [false, undefined];
7232
7319
  }
@@ -7299,7 +7386,7 @@ function handleThemeChange(theme) {
7299
7386
  if (HandlersPrivate.themeChangeHandler) {
7300
7387
  HandlersPrivate.themeChangeHandler(theme);
7301
7388
  }
7302
- if (Communication.childWindow) {
7389
+ if (shouldEventBeRelayedToChild()) {
7303
7390
  sendMessageEventToChild('themeChange', [theme]);
7304
7391
  }
7305
7392
  }
@@ -7334,88 +7421,268 @@ function registerOnLoadHandler(apiVersionTag, handler) {
7334
7421
  * @internal
7335
7422
  * Limited to Microsoft-internal use
7336
7423
  */
7337
- function handleLoad(loadContext) {
7338
- const resumeContext = convertToResumeContext(loadContext);
7339
- if (HandlersPrivate.resumeHandler) {
7340
- HandlersPrivate.resumeHandler(resumeContext);
7341
- if (Communication.childWindow) {
7342
- sendMessageEventToChild('load', [resumeContext]);
7343
- }
7424
+ function handleLoad(loadContext) {
7425
+ const resumeContext = convertToResumeContext(loadContext);
7426
+ if (HandlersPrivate.resumeHandler) {
7427
+ HandlersPrivate.resumeHandler(resumeContext);
7428
+ if (shouldEventBeRelayedToChild()) {
7429
+ sendMessageEventToChild('load', [resumeContext]);
7430
+ }
7431
+ }
7432
+ else if (HandlersPrivate.loadHandler) {
7433
+ HandlersPrivate.loadHandler(loadContext);
7434
+ if (shouldEventBeRelayedToChild()) {
7435
+ sendMessageEventToChild('load', [loadContext]);
7436
+ }
7437
+ }
7438
+ }
7439
+ /**
7440
+ * @internal
7441
+ * Limited to Microsoft-internal use
7442
+ */
7443
+ function convertToResumeContext(context) {
7444
+ return {
7445
+ entityId: context.entityId,
7446
+ contentUrl: new URL(context.contentUrl),
7447
+ };
7448
+ }
7449
+ /**
7450
+ * @internal
7451
+ * Limited to Microsoft-internal use
7452
+ *
7453
+ * @deprecated
7454
+ */
7455
+ function registerBeforeUnloadHandler(apiVersionTag, handler) {
7456
+ HandlersPrivate.beforeUnloadHandler = handler;
7457
+ !isNullOrUndefined(handler) && sendMessageToParent(apiVersionTag, 'registerHandler', ['beforeUnload']);
7458
+ }
7459
+ /**
7460
+ * @internal
7461
+ * Limited to Microsoft-internal use
7462
+ */
7463
+ function handleBeforeUnload() {
7464
+ return handlers_awaiter(this, void 0, void 0, function* () {
7465
+ const readyToUnload = () => {
7466
+ sendMessageToParent(getApiVersionTag("v2" /* ApiVersionNumber.V_2 */, "handleBeforeUnload" /* ApiName.HandleBeforeUnload */), 'readyToUnload', []);
7467
+ };
7468
+ if (HandlersPrivate.beforeSuspendOrTerminateHandler) {
7469
+ yield HandlersPrivate.beforeSuspendOrTerminateHandler();
7470
+ if (shouldEventBeRelayedToChild()) {
7471
+ sendMessageEventToChild('beforeUnload');
7472
+ }
7473
+ else {
7474
+ readyToUnload();
7475
+ }
7476
+ }
7477
+ else if (!HandlersPrivate.beforeUnloadHandler || !HandlersPrivate.beforeUnloadHandler(readyToUnload)) {
7478
+ if (shouldEventBeRelayedToChild()) {
7479
+ sendMessageEventToChild('beforeUnload');
7480
+ }
7481
+ else {
7482
+ readyToUnload();
7483
+ }
7484
+ }
7485
+ });
7486
+ }
7487
+ /**
7488
+ * @internal
7489
+ * Limited to Microsoft-internal use
7490
+ */
7491
+ function handlers_registerBeforeSuspendOrTerminateHandler(handler) {
7492
+ HandlersPrivate.beforeSuspendOrTerminateHandler = handler;
7493
+ !isNullOrUndefined(handler) &&
7494
+ sendMessageToParent(getApiVersionTag("v2" /* ApiVersionNumber.V_2 */, "registerBeforeSuspendOrTerminateHandler" /* ApiName.RegisterBeforeSuspendOrTerminateHandler */), 'registerHandler', ['beforeUnload']);
7495
+ }
7496
+ /**
7497
+ * @internal
7498
+ * Limited to Microsoft-internal use
7499
+ */
7500
+ function handlers_registerOnResumeHandler(handler) {
7501
+ HandlersPrivate.resumeHandler = handler;
7502
+ !isNullOrUndefined(handler) &&
7503
+ sendMessageToParent(getApiVersionTag("v2" /* ApiVersionNumber.V_2 */, "registerOnResumeHandler" /* ApiName.RegisterOnResumeHandler */), 'registerHandler', [
7504
+ 'load',
7505
+ ]);
7506
+ }
7507
+
7508
+ ;// ./src/internal/childCommunication.ts
7509
+ /* eslint-disable @typescript-eslint/ban-types */
7510
+ /* eslint-disable @typescript-eslint/no-explicit-any */
7511
+ var childCommunication_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
7512
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
7513
+ return new (P || (P = Promise))(function (resolve, reject) {
7514
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
7515
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7516
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7517
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
7518
+ });
7519
+ };
7520
+
7521
+
7522
+
7523
+
7524
+
7525
+ const communicationLogger = getLogger('childProxyingCommunication');
7526
+ /**
7527
+ * @internal
7528
+ * Limited to Microsoft-internal use
7529
+ */
7530
+ class ChildCommunication {
7531
+ }
7532
+ ChildCommunication.messageQueue = [];
7533
+ /**
7534
+ * @internal
7535
+ * Limited to Microsoft-internal use
7536
+ */
7537
+ function uninitializeChildCommunication() {
7538
+ ChildCommunication.window = null;
7539
+ ChildCommunication.origin = null;
7540
+ ChildCommunication.messageQueue = [];
7541
+ }
7542
+ /**
7543
+ * @hidden
7544
+ * @internal
7545
+ * Limited to Microsoft-internal use
7546
+ */
7547
+ function shouldEventBeRelayedToChild() {
7548
+ return !!ChildCommunication.window;
7549
+ }
7550
+ /**
7551
+ * @hidden
7552
+ * @internal
7553
+ * Limited to Microsoft-internal use
7554
+ */
7555
+ function shouldProcessChildMessage(messageSource, messageOrigin) {
7556
+ if (!ChildCommunication.window || ChildCommunication.window.closed || messageSource === ChildCommunication.window) {
7557
+ ChildCommunication.window = messageSource;
7558
+ ChildCommunication.origin = messageOrigin;
7559
+ }
7560
+ // Clean up pointers to child windows
7561
+ if (ChildCommunication.window && ChildCommunication.window.closed) {
7562
+ ChildCommunication.window = null;
7563
+ ChildCommunication.origin = null;
7564
+ return false;
7565
+ }
7566
+ return ChildCommunication.window === messageSource;
7567
+ }
7568
+ /**
7569
+ * @hidden
7570
+ * @internal
7571
+ * Limited to Microsoft-internal use
7572
+ */
7573
+ function handleIncomingMessageFromChild(evt, messageSource, sendMessageToParentHelper, setCallbackForRequest) {
7574
+ return childCommunication_awaiter(this, void 0, void 0, function* () {
7575
+ // Do not do anything if message source does not match child window
7576
+ if (ChildCommunication.window !== messageSource) {
7577
+ return;
7578
+ }
7579
+ // If we have any messages in our queue, send them now
7580
+ flushMessageQueue(ChildCommunication.window, ChildCommunication.origin, ChildCommunication.messageQueue, 'child');
7581
+ // Handle the message
7582
+ handleIncomingMessage(evt, sendMessageToParentHelper, setCallbackForRequest);
7583
+ });
7584
+ }
7585
+ const handleIncomingMessageFromChildLogger = communicationLogger.extend('handleIncomingMessageFromChild');
7586
+ /**
7587
+ * @internal
7588
+ * Limited to Microsoft-internal use
7589
+ */
7590
+ function handleIncomingMessage(evt, sendMessageToParentHelper, setCallbackForRequest) {
7591
+ if (evt.data.id === undefined || evt.data.func === undefined) {
7592
+ return;
7344
7593
  }
7345
- else if (HandlersPrivate.loadHandler) {
7346
- HandlersPrivate.loadHandler(loadContext);
7347
- if (Communication.childWindow) {
7348
- sendMessageEventToChild('load', [loadContext]);
7349
- }
7594
+ // Try to delegate the request to the proper handler, if defined
7595
+ const message = deserializeMessageRequest(evt.data);
7596
+ const [called, result] = callHandler(message.func, message.args);
7597
+ // If a handler was called and returned a value, send the response back to the child
7598
+ if (called && typeof result !== 'undefined') {
7599
+ handleIncomingMessageFromChildLogger('Handler called in response to message %s from child. Returning response from handler to child, action: %s.', getMessageIdsAsLogString(message), message.func);
7600
+ sendMessageResponseToChild(message.id, message.uuid, Array.isArray(result) ? result : [result]);
7601
+ return;
7350
7602
  }
7603
+ // No handler, proxy to parent
7604
+ handleIncomingMessageFromChildLogger('No handler for message %s from child found; relaying message on to parent, action: %s. Relayed message will have a new id.', getMessageIdsAsLogString(message), message.func);
7605
+ sendChildMessageToParent(message, sendMessageToParentHelper, setCallbackForRequest);
7351
7606
  }
7352
7607
  /**
7353
7608
  * @internal
7354
7609
  * Limited to Microsoft-internal use
7355
7610
  */
7356
- function convertToResumeContext(context) {
7357
- return {
7358
- entityId: context.entityId,
7359
- contentUrl: new URL(context.contentUrl),
7360
- };
7611
+ function sendChildMessageToParent(message, sendMessageToParentHelper, setCallbackForRequest) {
7612
+ const request = sendMessageToParentHelper(getApiVersionTag("v2" /* ApiVersionNumber.V_2 */, "tasks.startTask" /* ApiName.Tasks_StartTask */), message.func, message.args, true);
7613
+ setCallbackForRequest(request.uuid, (...args) => {
7614
+ if (ChildCommunication.window) {
7615
+ const isPartialResponse = args.pop();
7616
+ handleIncomingMessageFromChildLogger('Message from parent being relayed to child, id: %s', getMessageIdsAsLogString(message));
7617
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
7618
+ // @ts-ignore
7619
+ sendMessageResponseToChild(message.id, message.uuid, args, isPartialResponse);
7620
+ }
7621
+ });
7361
7622
  }
7362
7623
  /**
7624
+ * @hidden
7625
+ * Send a response to child for a message request that was from child
7626
+ *
7363
7627
  * @internal
7364
7628
  * Limited to Microsoft-internal use
7365
- *
7366
- * @deprecated
7367
7629
  */
7368
- function registerBeforeUnloadHandler(apiVersionTag, handler) {
7369
- HandlersPrivate.beforeUnloadHandler = handler;
7370
- !isNullOrUndefined(handler) && sendMessageToParent(apiVersionTag, 'registerHandler', ['beforeUnload']);
7630
+ function sendMessageResponseToChild(id, uuid, args, isPartialResponse) {
7631
+ const targetWindow = ChildCommunication.window;
7632
+ const response = createMessageResponse(id, uuid, args, isPartialResponse);
7633
+ const serializedResponse = serializeMessageResponse(response);
7634
+ const targetOrigin = ChildCommunication.origin;
7635
+ if (targetWindow && targetOrigin) {
7636
+ handleIncomingMessageFromChildLogger('Sending message %s to %s via postMessage, args = %o', getMessageIdsAsLogString(serializedResponse), 'child', serializedResponse.args);
7637
+ targetWindow.postMessage(serializedResponse, targetOrigin);
7638
+ }
7371
7639
  }
7372
7640
  /**
7641
+ * @hidden
7642
+ * Send a custom message object that can be sent to child window,
7643
+ * instead of a response message to a child
7644
+ *
7373
7645
  * @internal
7374
7646
  * Limited to Microsoft-internal use
7375
7647
  */
7376
- function handleBeforeUnload() {
7377
- return handlers_awaiter(this, void 0, void 0, function* () {
7378
- const readyToUnload = () => {
7379
- sendMessageToParent(getApiVersionTag("v2" /* ApiVersionNumber.V_2 */, "handleBeforeUnload" /* ApiName.HandleBeforeUnload */), 'readyToUnload', []);
7380
- };
7381
- if (HandlersPrivate.beforeSuspendOrTerminateHandler) {
7382
- yield HandlersPrivate.beforeSuspendOrTerminateHandler();
7383
- if (Communication.childWindow) {
7384
- sendMessageEventToChild('beforeUnload');
7385
- }
7386
- else {
7387
- readyToUnload();
7388
- }
7389
- }
7390
- else if (!HandlersPrivate.beforeUnloadHandler || !HandlersPrivate.beforeUnloadHandler(readyToUnload)) {
7391
- if (Communication.childWindow) {
7392
- sendMessageEventToChild('beforeUnload');
7393
- }
7394
- else {
7395
- readyToUnload();
7396
- }
7397
- }
7398
- });
7648
+ function sendMessageEventToChild(actionName, args) {
7649
+ const targetWindow = ChildCommunication.window;
7650
+ /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
7651
+ const customEvent = createMessageEvent(actionName, args);
7652
+ const targetOrigin = ChildCommunication.origin;
7653
+ // If the target window isn't closed and we already know its origin, send the message right away; otherwise,
7654
+ // queue the message and send it after the origin is established
7655
+ if (targetWindow && targetOrigin) {
7656
+ targetWindow.postMessage(customEvent, targetOrigin);
7657
+ }
7658
+ else {
7659
+ ChildCommunication.messageQueue.push(customEvent);
7660
+ }
7399
7661
  }
7400
7662
  /**
7401
7663
  * @internal
7402
7664
  * Limited to Microsoft-internal use
7403
7665
  */
7404
- function handlers_registerBeforeSuspendOrTerminateHandler(handler) {
7405
- HandlersPrivate.beforeSuspendOrTerminateHandler = handler;
7406
- !isNullOrUndefined(handler) &&
7407
- sendMessageToParent(getApiVersionTag("v2" /* ApiVersionNumber.V_2 */, "registerBeforeSuspendOrTerminateHandler" /* ApiName.RegisterBeforeSuspendOrTerminateHandler */), 'registerHandler', ['beforeUnload']);
7666
+ function createMessageResponse(id, uuid, args, isPartialResponse) {
7667
+ return {
7668
+ id: id,
7669
+ uuid: uuid,
7670
+ args: args || [],
7671
+ isPartialResponse,
7672
+ };
7408
7673
  }
7409
7674
  /**
7675
+ * @hidden
7676
+ * Creates a message object without any id and api version, used for custom actions being sent to child frame/window
7677
+ *
7410
7678
  * @internal
7411
7679
  * Limited to Microsoft-internal use
7412
7680
  */
7413
- function handlers_registerOnResumeHandler(handler) {
7414
- HandlersPrivate.resumeHandler = handler;
7415
- !isNullOrUndefined(handler) &&
7416
- sendMessageToParent(getApiVersionTag("v2" /* ApiVersionNumber.V_2 */, "registerOnResumeHandler" /* ApiName.RegisterOnResumeHandler */), 'registerHandler', [
7417
- 'load',
7418
- ]);
7681
+ function createMessageEvent(func, args) {
7682
+ return {
7683
+ func: func,
7684
+ args: args || [],
7685
+ };
7419
7686
  }
7420
7687
 
7421
7688
  ;// ./src/internal/hostToAppTelemetry.ts
@@ -7497,42 +7764,6 @@ class HostToAppMessageDelayTelemetry {
7497
7764
  }
7498
7765
  HostToAppMessageDelayTelemetry.callbackInformation = new Map();
7499
7766
 
7500
- ;// ./src/internal/messageObjects.ts
7501
- var messageObjects_rest = (undefined && undefined.__rest) || function (s, e) {
7502
- var t = {};
7503
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
7504
- t[p] = s[p];
7505
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7506
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7507
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
7508
- t[p[i]] = s[p[i]];
7509
- }
7510
- return t;
7511
- };
7512
-
7513
- const serializeMessageRequest = (message) => {
7514
- const { uuid } = message, restOfMessage = messageObjects_rest(message, ["uuid"]);
7515
- const uuidAsString = uuid === null || uuid === void 0 ? void 0 : uuid.toString();
7516
- const request = Object.assign(Object.assign({}, restOfMessage), { uuidAsString: uuidAsString });
7517
- return request;
7518
- };
7519
- const deserializeMessageRequest = (message) => {
7520
- const { uuidAsString } = message, restOfMessage = messageObjects_rest(message, ["uuidAsString"]);
7521
- const request = Object.assign(Object.assign({}, restOfMessage), { uuid: uuidAsString ? new UUID(uuidAsString) : undefined });
7522
- return request;
7523
- };
7524
- const deserializeMessageResponse = (serializedResponse) => {
7525
- const { uuidAsString } = serializedResponse, restOfResponse = messageObjects_rest(serializedResponse, ["uuidAsString"]);
7526
- const messageResponse = Object.assign(Object.assign({}, restOfResponse), { uuid: uuidAsString ? new UUID(uuidAsString) : undefined });
7527
- return messageResponse;
7528
- };
7529
- const serializeMessageResponse = (response) => {
7530
- const { uuid } = response, restOfResponse = messageObjects_rest(response, ["uuid"]);
7531
- const uuidAsString = uuid === null || uuid === void 0 ? void 0 : uuid.toString();
7532
- const messageResponse = Object.assign(Object.assign({}, restOfResponse), { uuidAsString: uuidAsString });
7533
- return messageResponse;
7534
- };
7535
-
7536
7767
  ;// ./src/internal/nestedAppAuthUtils.ts
7537
7768
 
7538
7769
 
@@ -7662,7 +7893,8 @@ var communication_awaiter = (undefined && undefined.__awaiter) || function (this
7662
7893
 
7663
7894
 
7664
7895
 
7665
- const communicationLogger = getLogger('communication');
7896
+
7897
+ const communication_communicationLogger = getLogger('communication');
7666
7898
  /**
7667
7899
  * @internal
7668
7900
  * Limited to Microsoft-internal use
@@ -7676,7 +7908,6 @@ class Communication {
7676
7908
  class CommunicationPrivate {
7677
7909
  }
7678
7910
  CommunicationPrivate.parentMessageQueue = [];
7679
- CommunicationPrivate.childMessageQueue = [];
7680
7911
  CommunicationPrivate.topMessageQueue = [];
7681
7912
  CommunicationPrivate.nextMessageId = 0;
7682
7913
  CommunicationPrivate.callbacks = new Map();
@@ -7745,16 +7976,14 @@ function uninitializeCommunication() {
7745
7976
  Communication.currentWindow = null;
7746
7977
  Communication.parentWindow = null;
7747
7978
  Communication.parentOrigin = null;
7748
- Communication.childWindow = null;
7749
- Communication.childOrigin = null;
7750
7979
  CommunicationPrivate.parentMessageQueue = [];
7751
- CommunicationPrivate.childMessageQueue = [];
7752
7980
  CommunicationPrivate.nextMessageId = 0;
7753
7981
  CommunicationPrivate.callbacks.clear();
7754
7982
  CommunicationPrivate.promiseCallbacks.clear();
7755
7983
  CommunicationPrivate.portCallbacks.clear();
7756
7984
  CommunicationPrivate.legacyMessageIdsToUuidMap = {};
7757
7985
  HostToAppMessageDelayTelemetry.clearMessages();
7986
+ uninitializeChildCommunication();
7758
7987
  }
7759
7988
  /**
7760
7989
  * @deprecated This function is deprecated and will be removed in a future release. Please use {@link callFunctionInHostAndHandleResponse} or {@link callFunctionInHost} instead.
@@ -7965,7 +8194,7 @@ function sendMessageToParent(apiVersionTag, actionName, argsOrCallback, callback
7965
8194
  CommunicationPrivate.callbacks.set(request.uuid, callback);
7966
8195
  }
7967
8196
  }
7968
- const sendNestedAuthRequestToTopWindowLogger = communicationLogger.extend('sendNestedAuthRequestToTopWindow');
8197
+ const sendNestedAuthRequestToTopWindowLogger = communication_communicationLogger.extend('sendNestedAuthRequestToTopWindow');
7969
8198
  /**
7970
8199
  * @internal
7971
8200
  * Limited to Microsoft-internal use
@@ -7979,7 +8208,7 @@ function sendNestedAuthRequestToTopWindow(message) {
7979
8208
  });
7980
8209
  return sendRequestToTargetWindowHelper(targetWindow, request);
7981
8210
  }
7982
- const sendRequestToTargetWindowHelperLogger = communicationLogger.extend('sendRequestToTargetWindowHelper');
8211
+ const sendRequestToTargetWindowHelperLogger = communication_communicationLogger.extend('sendRequestToTargetWindowHelper');
7983
8212
  /**
7984
8213
  * @internal
7985
8214
  * Limited to Microsoft-internal use
@@ -8009,7 +8238,7 @@ function sendRequestToTargetWindowHelper(targetWindow, messageRequest) {
8009
8238
  }
8010
8239
  return messageRequest;
8011
8240
  }
8012
- const sendMessageToParentHelperLogger = communicationLogger.extend('sendMessageToParentHelper');
8241
+ const sendMessageToParentHelperLogger = communication_communicationLogger.extend('sendMessageToParentHelper');
8013
8242
  /**
8014
8243
  * @internal
8015
8244
  * Limited to Microsoft-internal use
@@ -8025,7 +8254,7 @@ function sendMessageToParentHelper(apiVersionTag, actionName, args, isProxiedFro
8025
8254
  logger('Message %s information: %o', getMessageIdsAsLogString(request), { actionName, args });
8026
8255
  return sendRequestToTargetWindowHelper(targetWindow, request);
8027
8256
  }
8028
- const processIncomingMessageLogger = communicationLogger.extend('processIncomingMessage');
8257
+ const processIncomingMessageLogger = communication_communicationLogger.extend('processIncomingMessage');
8029
8258
  /**
8030
8259
  * @internal
8031
8260
  * Limited to Microsoft-internal use
@@ -8047,19 +8276,21 @@ function processIncomingMessage(evt) {
8047
8276
  processIncomingMessageLogger('Message being ignored by app because it is either coming from the current window or a different window with an invalid origin, message: %o, source: %o, origin: %o', evt, messageSource, messageOrigin);
8048
8277
  return;
8049
8278
  }
8050
- // Update our parent and child relationships based on this message
8279
+ // Update our parent relationship based on this message
8051
8280
  updateRelationships(messageSource, messageOrigin);
8052
- // Handle the message
8281
+ // Handle the message if the source is from the parent
8053
8282
  if (messageSource === Communication.parentWindow) {
8054
8283
  handleIncomingMessageFromParent(evt);
8284
+ return;
8055
8285
  }
8056
- else if (messageSource === Communication.childWindow) {
8057
- handleIncomingMessageFromChild(evt);
8286
+ // Message proxy from child to parent
8287
+ if (shouldProcessChildMessage(messageSource, messageOrigin)) {
8288
+ handleIncomingMessageFromChild(evt, messageSource, sendMessageToParentHelper, (uuid, callback) => CommunicationPrivate.callbacks.set(uuid, callback));
8058
8289
  }
8059
8290
  });
8060
8291
  });
8061
8292
  }
8062
- const processAuthBridgeMessageLogger = communicationLogger.extend('processAuthBridgeMessage');
8293
+ const processAuthBridgeMessageLogger = communication_communicationLogger.extend('processAuthBridgeMessage');
8063
8294
  /**
8064
8295
  * @internal
8065
8296
  * Limited to Microsoft-internal use
@@ -8113,16 +8344,16 @@ function processAuthBridgeMessage(evt, onMessageReceived) {
8113
8344
  Communication.topWindow = messageSource;
8114
8345
  Communication.topOrigin = messageOrigin;
8115
8346
  }
8116
- // Clean up pointers to closed parent and child windows
8347
+ // Clean up pointers to closed parent
8117
8348
  if (Communication.topWindow && Communication.topWindow.closed) {
8118
8349
  Communication.topWindow = null;
8119
8350
  Communication.topOrigin = null;
8120
8351
  }
8121
- flushMessageQueue(Communication.topWindow);
8352
+ flushMessageQueue(Communication.topWindow, Communication.topOrigin, CommunicationPrivate.topMessageQueue, 'top');
8122
8353
  // Return the response to the registered callback
8123
8354
  onMessageReceived(message);
8124
8355
  }
8125
- const shouldProcessIncomingMessageLogger = communicationLogger.extend('shouldProcessIncomingMessage');
8356
+ const shouldProcessIncomingMessageLogger = communication_communicationLogger.extend('shouldProcessIncomingMessage');
8126
8357
  /**
8127
8358
  * @hidden
8128
8359
  * Validates the message source and origin, if it should be processed
@@ -8166,34 +8397,23 @@ function shouldProcessIncomingMessage(messageSource, messageOrigin) {
8166
8397
  * Limited to Microsoft-internal use
8167
8398
  */
8168
8399
  function updateRelationships(messageSource, messageOrigin) {
8169
- // Determine whether the source of the message is our parent or child and update our
8170
- // window and origin pointer accordingly
8171
- // For frameless windows (i.e mobile), there is no parent frame, so the message must be from the child.
8400
+ // Determine if the source of the message is our parent and update our window and
8401
+ // origin pointer accordingly.
8402
+ // For frameless windows (i.e mobile), there is no parent frame
8172
8403
  if (!GlobalVars.isFramelessWindow &&
8173
8404
  (!Communication.parentWindow || Communication.parentWindow.closed || messageSource === Communication.parentWindow)) {
8174
8405
  Communication.parentWindow = messageSource;
8175
8406
  Communication.parentOrigin = messageOrigin;
8176
8407
  }
8177
- else if (!Communication.childWindow ||
8178
- Communication.childWindow.closed ||
8179
- messageSource === Communication.childWindow) {
8180
- Communication.childWindow = messageSource;
8181
- Communication.childOrigin = messageOrigin;
8182
- }
8183
- // Clean up pointers to closed parent and child windows
8408
+ // Clean up pointers to closed parent windows
8184
8409
  if (Communication.parentWindow && Communication.parentWindow.closed) {
8185
8410
  Communication.parentWindow = null;
8186
8411
  Communication.parentOrigin = null;
8187
8412
  }
8188
- if (Communication.childWindow && Communication.childWindow.closed) {
8189
- Communication.childWindow = null;
8190
- Communication.childOrigin = null;
8191
- }
8192
8413
  // If we have any messages in our queue, send them now
8193
- flushMessageQueue(Communication.parentWindow);
8194
- flushMessageQueue(Communication.childWindow);
8414
+ flushMessageQueue(Communication.parentWindow, Communication.parentOrigin, CommunicationPrivate.parentMessageQueue, 'parent');
8195
8415
  }
8196
- const handleIncomingMessageFromParentLogger = communicationLogger.extend('handleIncomingMessageFromParent');
8416
+ const handleIncomingMessageFromParentLogger = communication_communicationLogger.extend('handleIncomingMessageFromParent');
8197
8417
  /**
8198
8418
  * @internal
8199
8419
  * Limited to Microsoft-internal use
@@ -8325,29 +8545,6 @@ function handleIncomingMessageFromParent(evt) {
8325
8545
  function isPartialResponse(evt) {
8326
8546
  return evt.data.isPartialResponse === true;
8327
8547
  }
8328
- const handleIncomingMessageFromChildLogger = communicationLogger.extend('handleIncomingMessageFromChild');
8329
- /**
8330
- * @internal
8331
- * Limited to Microsoft-internal use
8332
- */
8333
- function handleIncomingMessageFromChild(evt) {
8334
- if ('id' in evt.data && 'func' in evt.data) {
8335
- // Try to delegate the request to the proper handler, if defined
8336
- const message = deserializeMessageRequest(evt.data);
8337
- const [called, result] = callHandler(message.func, message.args);
8338
- if (called && typeof result !== 'undefined') {
8339
- handleIncomingMessageFromChildLogger('Handler called in response to message %s from child. Returning response from handler to child, action: %s.', getMessageIdsAsLogString(message), message.func);
8340
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
8341
- // @ts-ignore
8342
- sendMessageResponseToChild(message.id, message.uuid, Array.isArray(result) ? result : [result]);
8343
- }
8344
- else {
8345
- // No handler, proxy to parent
8346
- handleIncomingMessageFromChildLogger('No handler for message %s from child found; relaying message on to parent, action: %s. Relayed message will have a new id.', getMessageIdsAsLogString(message), message.func);
8347
- proxyChildMessageToParent(message);
8348
- }
8349
- }
8350
- }
8351
8548
  /**
8352
8549
  * @internal
8353
8550
  * Limited to Microsoft-internal use
@@ -8370,9 +8567,6 @@ function getTargetMessageQueue(targetWindow) {
8370
8567
  else if (targetWindow === Communication.parentWindow) {
8371
8568
  return CommunicationPrivate.parentMessageQueue;
8372
8569
  }
8373
- else if (targetWindow === Communication.childWindow) {
8374
- return CommunicationPrivate.childMessageQueue;
8375
- }
8376
8570
  else {
8377
8571
  return [];
8378
8572
  }
@@ -8388,9 +8582,6 @@ function getTargetOrigin(targetWindow) {
8388
8582
  else if (targetWindow === Communication.parentWindow) {
8389
8583
  return Communication.parentOrigin;
8390
8584
  }
8391
- else if (targetWindow === Communication.childWindow) {
8392
- return Communication.childOrigin;
8393
- }
8394
8585
  else {
8395
8586
  return null;
8396
8587
  }
@@ -8406,32 +8597,10 @@ function getTargetName(targetWindow) {
8406
8597
  else if (targetWindow === Communication.parentWindow) {
8407
8598
  return 'parent';
8408
8599
  }
8409
- else if (targetWindow === Communication.childWindow) {
8410
- return 'child';
8411
- }
8412
8600
  else {
8413
8601
  return null;
8414
8602
  }
8415
8603
  }
8416
- const flushMessageQueueLogger = communicationLogger.extend('flushMessageQueue');
8417
- /**
8418
- * @internal
8419
- * Limited to Microsoft-internal use
8420
- */
8421
- function flushMessageQueue(targetWindow) {
8422
- const targetOrigin = getTargetOrigin(targetWindow);
8423
- const targetMessageQueue = getTargetMessageQueue(targetWindow);
8424
- const target = getTargetName(targetWindow);
8425
- while (targetWindow && targetOrigin && targetMessageQueue.length > 0) {
8426
- const messageRequest = targetMessageQueue.shift();
8427
- if (messageRequest) {
8428
- const request = serializeMessageRequest(messageRequest);
8429
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
8430
- flushMessageQueueLogger('Flushing message %s from %s message queue via postMessage.', getMessageIdsAsLogString(request), target);
8431
- targetWindow.postMessage(request, targetOrigin);
8432
- }
8433
- }
8434
- }
8435
8604
  /**
8436
8605
  * @internal
8437
8606
  * Limited to Microsoft-internal use
@@ -8448,45 +8617,6 @@ function waitForMessageQueue(targetWindow, callback) {
8448
8617
  }
8449
8618
  }, 100);
8450
8619
  }
8451
- /**
8452
- * @hidden
8453
- * Send a response to child for a message request that was from child
8454
- *
8455
- * @internal
8456
- * Limited to Microsoft-internal use
8457
- */
8458
- function sendMessageResponseToChild(id, uuid, args, isPartialResponse) {
8459
- const targetWindow = Communication.childWindow;
8460
- const response = createMessageResponse(id, uuid, args, isPartialResponse);
8461
- const serializedResponse = serializeMessageResponse(response);
8462
- const targetOrigin = getTargetOrigin(targetWindow);
8463
- if (targetWindow && targetOrigin) {
8464
- handleIncomingMessageFromChildLogger('Sending message %s to %s via postMessage, args = %o', getMessageIdsAsLogString(serializedResponse), getTargetName(targetWindow), serializedResponse.args);
8465
- targetWindow.postMessage(serializedResponse, targetOrigin);
8466
- }
8467
- }
8468
- /**
8469
- * @hidden
8470
- * Send a custom message object that can be sent to child window,
8471
- * instead of a response message to a child
8472
- *
8473
- * @internal
8474
- * Limited to Microsoft-internal use
8475
- */
8476
- function sendMessageEventToChild(actionName, args) {
8477
- const targetWindow = Communication.childWindow;
8478
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
8479
- const customEvent = createMessageEvent(actionName, args);
8480
- const targetOrigin = getTargetOrigin(targetWindow);
8481
- // If the target window isn't closed and we already know its origin, send the message right away; otherwise,
8482
- // queue the message and send it after the origin is established
8483
- if (targetWindow && targetOrigin) {
8484
- targetWindow.postMessage(customEvent, targetOrigin);
8485
- }
8486
- else {
8487
- getTargetMessageQueue(targetWindow).push(customEvent);
8488
- }
8489
- }
8490
8620
  /**
8491
8621
  * @internal
8492
8622
  * Limited to Microsoft-internal use
@@ -8533,58 +8663,6 @@ function createNestedAppAuthRequest(message) {
8533
8663
  data: message,
8534
8664
  };
8535
8665
  }
8536
- /**
8537
- * @internal
8538
- * Limited to Microsoft-internal use
8539
- */
8540
- function createMessageResponse(id, uuid, args, isPartialResponse) {
8541
- return {
8542
- id: id,
8543
- uuid: uuid,
8544
- args: args || [],
8545
- isPartialResponse,
8546
- };
8547
- }
8548
- /**
8549
- * @hidden
8550
- * Creates a message object without any id and api version, used for custom actions being sent to child frame/window
8551
- *
8552
- * @internal
8553
- * Limited to Microsoft-internal use
8554
- */
8555
- function createMessageEvent(func, args) {
8556
- return {
8557
- func: func,
8558
- args: args || [],
8559
- };
8560
- }
8561
- function getMessageIdsAsLogString(message) {
8562
- if ('uuidAsString' in message) {
8563
- return `${message.uuidAsString} (legacy id: ${message.id})`;
8564
- }
8565
- else if ('uuid' in message && message.uuid !== undefined) {
8566
- return `${message.uuid.toString()} (legacy id: ${message.id})`;
8567
- }
8568
- else {
8569
- return `legacy id: ${message.id} (no uuid)`;
8570
- }
8571
- }
8572
- /**
8573
- * @internal
8574
- * Limited to Microsoft-internal use
8575
- */
8576
- function proxyChildMessageToParent(message) {
8577
- const request = sendMessageToParentHelper(getApiVersionTag("v2" /* ApiVersionNumber.V_2 */, "tasks.startTask" /* ApiName.Tasks_StartTask */), message.func, message.args, true);
8578
- CommunicationPrivate.callbacks.set(request.uuid, (...args) => {
8579
- if (Communication.childWindow) {
8580
- const isPartialResponse = args.pop();
8581
- handleIncomingMessageFromChildLogger('Message from parent being relayed to child, id: %s', getMessageIdsAsLogString(message));
8582
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
8583
- // @ts-ignore
8584
- sendMessageResponseToChild(message.id, message.uuid, args, isPartialResponse);
8585
- }
8586
- });
8587
- }
8588
8666
 
8589
8667
  ;// ./src/private/logs.ts
8590
8668
  /**
@@ -8705,6 +8783,7 @@ var UserSettingTypes;
8705
8783
 
8706
8784
 
8707
8785
 
8786
+
8708
8787
  /**
8709
8788
  * @hidden
8710
8789
  * Upload a custom App manifest directly to both team and personal scopes.
@@ -8738,8 +8817,7 @@ function sendCustomMessage(actionName, args, callback) {
8738
8817
  }
8739
8818
  /**
8740
8819
  * @hidden
8741
- * Sends a custom action MessageEvent to a child iframe/window, only if you are not using auth popup.
8742
- * Otherwise it will go to the auth popup (which becomes the child)
8820
+ * Sends a custom action MessageEvent to a child iframe/window.
8743
8821
  *
8744
8822
  * @param actionName - Specifies name of the custom action to be sent
8745
8823
  * @param args - Specifies additional arguments passed to the action
@@ -8751,7 +8829,7 @@ function sendCustomMessage(actionName, args, callback) {
8751
8829
  function sendCustomEvent(actionName, args) {
8752
8830
  ensureInitialized(runtime);
8753
8831
  //validate childWindow
8754
- if (!Communication.childWindow) {
8832
+ if (!shouldEventBeRelayedToChild()) {
8755
8833
  throw new Error('The child window has not yet been initialized or is not present');
8756
8834
  }
8757
8835
  sendMessageEventToChild(actionName, args);
@@ -9570,6 +9648,8 @@ function externalAppAuthenticationForCEA_authenticateWithSSOAndResendRequest(app
9570
9648
  appId,
9571
9649
  conversationId,
9572
9650
  new SerializableActionExecuteInvokeRequest(originalRequestInfo),
9651
+ authTokenRequest.authId,
9652
+ authTokenRequest.connectionName,
9573
9653
  authTokenRequest.claims,
9574
9654
  authTokenRequest.silent,
9575
9655
  ], new ActionExecuteResponseHandler(), getApiVersionTag(externalAppAuthenticationForCEA_externalAppAuthenticationTelemetryVersionNumber, "externalAppAuthenticationForCEA.authenticateWithSSOAndResendRequest" /* ApiName.ExternalAppAuthenticationForCEA_AuthenticateWithSSOAndResendRequest */), isInvokeError);
@@ -12682,6 +12762,14 @@ function validateTab(tab) {
12682
12762
  var AppTypes;
12683
12763
  (function (AppTypes) {
12684
12764
  AppTypes["edu"] = "EDU";
12765
+ /**
12766
+ * Enum to indicate apps should be filtered for base Townhall.
12767
+ */
12768
+ AppTypes["baseTownhall"] = "BASE_TOWNHALL";
12769
+ /**
12770
+ * Enum to indicate apps should be filtered for streaming Townhall.
12771
+ */
12772
+ AppTypes["streamingTownhall"] = "STREAMING_TOWNHALL";
12685
12773
  })(AppTypes || (AppTypes = {}));
12686
12774
  /**
12687
12775
  * @hidden