@microsoft/teams-js 2.38.0 → 2.39.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. package/README.md +4 -4
  2. package/dist/esm/packages/teams-js/dts/internal/telemetry.d.ts +4 -0
  3. package/dist/esm/packages/teams-js/dts/internal/validOrigins.d.ts +7 -0
  4. package/dist/esm/packages/teams-js/dts/private/copilot/copilot.d.ts +2 -1
  5. package/dist/esm/packages/teams-js/dts/private/copilot/sidePanel.d.ts +75 -0
  6. package/dist/esm/packages/teams-js/dts/private/copilot/sidePanelInterfaces.d.ts +320 -0
  7. package/dist/esm/packages/teams-js/dts/private/index.d.ts +1 -0
  8. package/dist/esm/packages/teams-js/dts/private/nestedAppAuth/nestedAppAuthBridge.d.ts +1 -1
  9. package/dist/esm/packages/teams-js/dts/public/runtime.d.ts +6 -0
  10. package/dist/esm/packages/teams-js/src/artifactsForCDN/validDomains.json.js +1 -1
  11. package/dist/esm/packages/teams-js/src/index.js +1 -1
  12. package/dist/esm/packages/teams-js/src/internal/validOrigins.js +1 -1
  13. package/dist/esm/packages/teams-js/src/private/copilot/copilot.js +1 -1
  14. package/dist/esm/packages/teams-js/src/private/copilot/sidePanel.js +1 -0
  15. package/dist/esm/packages/teams-js/src/private/copilot/sidePanelInterfaces.js +1 -0
  16. package/dist/esm/packages/teams-js/src/private/nestedAppAuth/nestedAppAuthBridge.js +1 -1
  17. package/dist/esm/packages/teams-js/src/public/nestedAppAuth.js +1 -1
  18. package/dist/esm/packages/teams-js/src/public/runtime.js +1 -1
  19. package/dist/esm/packages/teams-js/src/public/version.js +1 -1
  20. package/dist/umd/MicrosoftTeams.js +328 -31
  21. package/dist/umd/MicrosoftTeams.js.map +1 -1
  22. package/dist/umd/MicrosoftTeams.min.js +1 -1
  23. package/dist/umd/MicrosoftTeams.min.js.map +1 -1
  24. package/package.json +1 -1
@@ -1093,6 +1093,7 @@ __webpack_require__.d(__webpack_exports__, {
1093
1093
  settings: () => (/* reexport */ settings_namespaceObject),
1094
1094
  shareDeepLink: () => (/* reexport */ publicAPIs_shareDeepLink),
1095
1095
  sharing: () => (/* reexport */ sharing_namespaceObject),
1096
+ sidePanelInterfaces: () => (/* reexport */ sidePanelInterfaces_namespaceObject),
1096
1097
  stageView: () => (/* reexport */ stageView_namespaceObject),
1097
1098
  store: () => (/* reexport */ store_namespaceObject),
1098
1099
  tasks: () => (/* reexport */ tasks_namespaceObject),
@@ -1359,12 +1360,36 @@ __webpack_require__.d(eligibility_namespaceObject, {
1359
1360
  isSupported: () => (eligibility_isSupported)
1360
1361
  });
1361
1362
 
1363
+ // NAMESPACE OBJECT: ./src/private/copilot/sidePanelInterfaces.ts
1364
+ var sidePanelInterfaces_namespaceObject = {};
1365
+ __webpack_require__.r(sidePanelInterfaces_namespaceObject);
1366
+ __webpack_require__.d(sidePanelInterfaces_namespaceObject, {
1367
+ ContentItemType: () => (ContentItemType),
1368
+ MediaSelectionType: () => (MediaSelectionType),
1369
+ SidePanelErrorCode: () => (SidePanelErrorCode),
1370
+ SidePanelErrorImpl: () => (SidePanelErrorImpl),
1371
+ UserConsent: () => (UserConsent)
1372
+ });
1373
+
1374
+ // NAMESPACE OBJECT: ./src/private/copilot/sidePanel.ts
1375
+ var sidePanel_namespaceObject = {};
1376
+ __webpack_require__.r(sidePanel_namespaceObject);
1377
+ __webpack_require__.d(sidePanel_namespaceObject, {
1378
+ copilotSidePanelNotSupportedOnPlatformError: () => (copilotSidePanelNotSupportedOnPlatformError),
1379
+ getContent: () => (getContent),
1380
+ isResponseAReportableError: () => (isResponseAReportableError),
1381
+ isSupported: () => (sidePanel_isSupported),
1382
+ preCheckUserConsent: () => (preCheckUserConsent),
1383
+ registerUserActionContentSelect: () => (registerUserActionContentSelect)
1384
+ });
1385
+
1362
1386
  // NAMESPACE OBJECT: ./src/private/copilot/copilot.ts
1363
1387
  var copilot_namespaceObject = {};
1364
1388
  __webpack_require__.r(copilot_namespaceObject);
1365
1389
  __webpack_require__.d(copilot_namespaceObject, {
1366
1390
  customTelemetry: () => (customTelemetry_namespaceObject),
1367
- eligibility: () => (eligibility_namespaceObject)
1391
+ eligibility: () => (eligibility_namespaceObject),
1392
+ sidePanel: () => (sidePanel_namespaceObject)
1368
1393
  });
1369
1394
 
1370
1395
  // NAMESPACE OBJECT: ./src/private/externalAppAuthentication.ts
@@ -1863,7 +1888,7 @@ __webpack_require__.d(search_namespaceObject, {
1863
1888
  var history_namespaceObject = {};
1864
1889
  __webpack_require__.r(history_namespaceObject);
1865
1890
  __webpack_require__.d(history_namespaceObject, {
1866
- getContent: () => (getContent),
1891
+ getContent: () => (history_getContent),
1867
1892
  isSupported: () => (history_isSupported)
1868
1893
  });
1869
1894
 
@@ -2206,7 +2231,7 @@ var ClipboardSupportedMimeType;
2206
2231
  })(ClipboardSupportedMimeType || (ClipboardSupportedMimeType = {}));
2207
2232
 
2208
2233
  ;// ./src/artifactsForCDN/validDomains.json
2209
- 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"]}');
2234
+ 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","*.outlook.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"]}');
2210
2235
  var artifactsForCDN_validDomains_namespaceObject = /*#__PURE__*/__webpack_require__.t(validDomains_namespaceObject, 2);
2211
2236
  ;// ./src/internal/constants.ts
2212
2237
 
@@ -4355,6 +4380,11 @@ const upgradeChain = [
4355
4380
  },
4356
4381
  },
4357
4382
  ];
4383
+ /**
4384
+ * This version is for legacy Teams mobile clients that don’t pass a runtime object during initialization.
4385
+ * It’s the minimum version required to support deeply nested app auth.
4386
+ */
4387
+ const legacyTeamsMobileVersionForDeeplyNestedAuth = '2.1.2';
4358
4388
  /**
4359
4389
  * This structure is used for versions of Teams that don't pass a runtime object during initialization.
4360
4390
  * Please see the extensive comments in versionAndPlatformAgnosticTeamsRuntimeConfig for more information
@@ -4422,6 +4452,10 @@ const mapTeamsVersionToSupportedCapabilities = {
4422
4452
  hostClientTypes: [HostClientType.android, HostClientType.ios, HostClientType.ipados, HostClientType.visionOS],
4423
4453
  },
4424
4454
  ],
4455
+ '2.1.2': [
4456
+ // isDeeplyNestedAuthSupported: true (based on const legacyTeamsMobileVersionForDeeplyNestedAuth)
4457
+ // for hostClientTypes: [HostClientType.android, HostClientType.ios, HostClientType.ipados, HostClientType.visionOS]
4458
+ ],
4425
4459
  };
4426
4460
  const generateBackCompatRuntimeConfigLogger = runtimeLogger.extend('generateBackCompatRuntimeConfig');
4427
4461
  /**
@@ -4551,7 +4585,7 @@ function isSerializable(arg) {
4551
4585
  * @hidden
4552
4586
  * Package version.
4553
4587
  */
4554
- const version = "2.38.0";
4588
+ const version = "2.39.1";
4555
4589
 
4556
4590
  ;// ./src/public/featureFlags.ts
4557
4591
  // All build feature flags are defined inside this object. Any build feature flag must have its own unique getter and setter function. This pattern allows for client apps to treeshake unused code and avoid including code guarded by this feature flags in the final bundle. If this property isn't desired, use the below runtime feature flags object.
@@ -6607,9 +6641,12 @@ var validOrigins_awaiter = (undefined && undefined.__awaiter) || function (thisA
6607
6641
 
6608
6642
  let validOriginsCache = [];
6609
6643
  const validateOriginLogger = getLogger('validateOrigin');
6644
+ let validOriginsPromise;
6610
6645
  function prefetchOriginsFromCDN() {
6611
6646
  return validOrigins_awaiter(this, void 0, void 0, function* () {
6612
- yield getValidOriginsListFromCDN();
6647
+ if (!validOriginsPromise) {
6648
+ yield getValidOriginsListFromCDN();
6649
+ }
6613
6650
  });
6614
6651
  }
6615
6652
  function isValidOriginsCacheEmpty() {
@@ -6620,11 +6657,15 @@ function getValidOriginsListFromCDN(shouldDisableCache = false) {
6620
6657
  if (!isValidOriginsCacheEmpty() && !shouldDisableCache) {
6621
6658
  return validOriginsCache;
6622
6659
  }
6660
+ if (validOriginsPromise) {
6661
+ // Fetch has already been initiated, return the existing promise
6662
+ return validOriginsPromise;
6663
+ }
6623
6664
  if (!inServerSideRenderingEnvironment()) {
6624
6665
  validateOriginLogger('Initiating fetch call to acquire valid origins list from CDN');
6625
6666
  const controller = new AbortController();
6626
6667
  const timeoutId = setTimeout(() => controller.abort(), ORIGIN_LIST_FETCH_TIMEOUT_IN_MS);
6627
- return fetch(validOriginsCdnEndpoint, { signal: controller.signal })
6668
+ validOriginsPromise = fetch(validOriginsCdnEndpoint, { signal: controller.signal })
6628
6669
  .then((response) => {
6629
6670
  clearTimeout(timeoutId);
6630
6671
  if (!response.ok) {
@@ -6651,6 +6692,7 @@ function getValidOriginsListFromCDN(shouldDisableCache = false) {
6651
6692
  validOriginsCache = validOriginsFallback;
6652
6693
  return validOriginsCache;
6653
6694
  });
6695
+ return validOriginsPromise;
6654
6696
  }
6655
6697
  else {
6656
6698
  validOriginsCache = validOriginsFallback;
@@ -6711,25 +6753,46 @@ function validateHostAgainstPattern(pattern, host) {
6711
6753
  * Limited to Microsoft-internal use
6712
6754
  */
6713
6755
  function validateOrigin(messageOrigin, disableCache) {
6714
- return getValidOriginsListFromCDN(disableCache).then((validOriginsList) => {
6715
- // Check whether the url is in the pre-known allowlist or supplied by user
6716
- if (!isValidHttpsURL(messageOrigin)) {
6717
- validateOriginLogger('Origin %s is invalid because it is not using https protocol. Protocol being used: %s', messageOrigin, messageOrigin.protocol);
6718
- return false;
6719
- }
6720
- const messageOriginHost = messageOrigin.host;
6721
- if (validOriginsList.some((pattern) => validateHostAgainstPattern(pattern, messageOriginHost))) {
6756
+ // Try origin against the cache or hardcoded fallback list first before fetching from CDN
6757
+ const localList = !disableCache && !isValidOriginsCacheEmpty() ? validOriginsCache : validOriginsFallback;
6758
+ if (validateOriginWithValidOriginsList(messageOrigin, localList)) {
6759
+ return Promise.resolve(true);
6760
+ }
6761
+ else {
6762
+ validateOriginLogger('Origin %s is not in the local valid origins list, fetching from CDN', messageOrigin);
6763
+ return getValidOriginsListFromCDN(disableCache).then((validOriginsList) => {
6764
+ return validateOriginWithValidOriginsList(messageOrigin, validOriginsList);
6765
+ });
6766
+ }
6767
+ }
6768
+ function validateOriginWithValidOriginsList(messageOrigin, validOriginsList) {
6769
+ // Check whether the url is in the pre-known allowlist or supplied by user
6770
+ if (!isValidHttpsURL(messageOrigin)) {
6771
+ validateOriginLogger('Origin %s is invalid because it is not using https protocol. Protocol being used: %s', messageOrigin, messageOrigin.protocol);
6772
+ return false;
6773
+ }
6774
+ const messageOriginHost = messageOrigin.host;
6775
+ if (validOriginsList.some((pattern) => validateHostAgainstPattern(pattern, messageOriginHost))) {
6776
+ return true;
6777
+ }
6778
+ for (const domainOrPattern of GlobalVars.additionalValidOrigins) {
6779
+ const pattern = domainOrPattern.substring(0, 8) === 'https://' ? domainOrPattern.substring(8) : domainOrPattern;
6780
+ if (validateHostAgainstPattern(pattern, messageOriginHost)) {
6722
6781
  return true;
6723
6782
  }
6724
- for (const domainOrPattern of GlobalVars.additionalValidOrigins) {
6725
- const pattern = domainOrPattern.substring(0, 8) === 'https://' ? domainOrPattern.substring(8) : domainOrPattern;
6726
- if (validateHostAgainstPattern(pattern, messageOriginHost)) {
6727
- return true;
6728
- }
6729
- }
6730
- validateOriginLogger('Origin %s is invalid because it is not an origin approved by this library or included in the call to app.initialize.\nOrigins approved by this library: %o\nOrigins included in app.initialize: %o', messageOrigin, validOriginsList, GlobalVars.additionalValidOrigins);
6731
- return false;
6732
- });
6783
+ }
6784
+ validateOriginLogger('Origin %s is invalid because it is not an origin approved by this library or included in the call to app.initialize.\nOrigins approved by this library: %o\nOrigins included in app.initialize: %o', messageOrigin, validOriginsList, GlobalVars.additionalValidOrigins);
6785
+ return false;
6786
+ }
6787
+ /**
6788
+ * @internal
6789
+ * Limited to Microsoft-internal use
6790
+ *
6791
+ * This function is only used for testing to reset the valid origins cache and ignore prefetched values.
6792
+ */
6793
+ function resetValidOriginsCache() {
6794
+ validOriginsCache = [];
6795
+ validOriginsPromise = undefined;
6733
6796
  }
6734
6797
  prefetchOriginsFromCDN();
6735
6798
 
@@ -9384,10 +9447,238 @@ function isEligibilityInfoValid(eligibilityInfo) {
9384
9447
  return true;
9385
9448
  }
9386
9449
 
9450
+ ;// ./src/private/copilot/sidePanelInterfaces.ts
9451
+ /**
9452
+ * @hidden
9453
+ *
9454
+ * Interface for content data
9455
+ *
9456
+ * @internal
9457
+ * Limited to Microsoft-internal use
9458
+ */
9459
+ var ContentItemType;
9460
+ (function (ContentItemType) {
9461
+ ContentItemType["EMAIL"] = "email";
9462
+ ContentItemType["TEXT"] = "text";
9463
+ ContentItemType["MEDIA"] = "media";
9464
+ ContentItemType["CALENDAR_INVITE"] = "calendarInvite";
9465
+ ContentItemType["WEB_PAGE"] = "webPage";
9466
+ ContentItemType["MIXED"] = "mixed";
9467
+ })(ContentItemType || (ContentItemType = {}));
9468
+ /**
9469
+ * @hidden
9470
+ *
9471
+ * Enum for media selection types
9472
+ *
9473
+ * @internal
9474
+ * Limited to Microsoft-internal use
9475
+ */
9476
+ var MediaSelectionType;
9477
+ (function (MediaSelectionType) {
9478
+ MediaSelectionType["IMAGE"] = "image";
9479
+ MediaSelectionType["AUDIO"] = "audio";
9480
+ MediaSelectionType["VIDEO"] = "video";
9481
+ })(MediaSelectionType || (MediaSelectionType = {}));
9482
+ /**
9483
+ * @hidden
9484
+ *
9485
+ * Enum representing possible user consent states.
9486
+ *
9487
+ * @internal
9488
+ * Limited to Microsoft-internal use
9489
+ */
9490
+ var UserConsent;
9491
+ (function (UserConsent) {
9492
+ UserConsent["Accepted"] = "accepted";
9493
+ UserConsent["NotAccepted"] = "not_accepted";
9494
+ })(UserConsent || (UserConsent = {}));
9495
+ /**
9496
+ * @hidden
9497
+ *
9498
+ * Type for user action handler functions that receive content data.
9499
+ *
9500
+ * @internal
9501
+ * Limited to Microsoft-internal use
9502
+ */
9503
+ var SidePanelErrorCode;
9504
+ (function (SidePanelErrorCode) {
9505
+ SidePanelErrorCode["ConsentNotAccepted"] = "consent_not_accepted";
9506
+ SidePanelErrorCode["PageContentBlockedPolicy"] = "page_content_blocked_policy";
9507
+ SidePanelErrorCode["PageContentBlockedDlp"] = "page_content_blocked_dlp";
9508
+ SidePanelErrorCode["PageContentTypeNotSupportedYet"] = "page_content_type_not_supported_yet";
9509
+ SidePanelErrorCode["PageContentSizeNotSupported"] = "page_content_size_not_supported";
9510
+ SidePanelErrorCode["PageContextChanged"] = "page_context_changed";
9511
+ SidePanelErrorCode["PageContentExtractionFailed"] = "page_content_extraction_failed";
9512
+ SidePanelErrorCode["PageContentSizeNotSupportedPDF"] = "page_content_size_not_supported_pdf";
9513
+ SidePanelErrorCode["NotSupportedOnPlatform"] = "not_supported_on_platform";
9514
+ SidePanelErrorCode["OtherError"] = "other_error";
9515
+ })(SidePanelErrorCode || (SidePanelErrorCode = {}));
9516
+ /**
9517
+ * @hidden
9518
+ * @beta
9519
+ * Implementation of the SidePanelError interface.
9520
+ * This class extends the built-in Error class and includes an error code.
9521
+ * It is used to represent errors that occur during side panel operations.
9522
+ * The error code can be one of the SidePanelErrorCode values or a general ErrorCode.
9523
+ */
9524
+ class SidePanelErrorImpl extends Error {
9525
+ constructor(errorCode, message) {
9526
+ super(message);
9527
+ this.errorCode = errorCode;
9528
+ this.name = 'SidePanelError';
9529
+ }
9530
+ }
9531
+
9532
+ ;// ./src/private/copilot/sidePanel.ts
9533
+ /**
9534
+ * @beta
9535
+ * @hidden
9536
+ * User information required by specific apps
9537
+ * @internal
9538
+ * Limited to Microsoft-internal use
9539
+ * @module
9540
+ */
9541
+ var sidePanel_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
9542
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
9543
+ return new (P || (P = Promise))(function (resolve, reject) {
9544
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
9545
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
9546
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
9547
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9548
+ });
9549
+ };
9550
+
9551
+
9552
+
9553
+
9554
+
9555
+
9556
+
9557
+
9558
+
9559
+ const sidePanel_copilotTelemetryVersionNumber = "v2" /* ApiVersionNumber.V_2 */;
9560
+ /**
9561
+ * @hidden
9562
+ * @internal
9563
+ * Limited to Microsoft-internal use
9564
+ * @beta
9565
+ * @returns boolean to represent whether copilot.sidePanel capability is supported
9566
+ *
9567
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
9568
+ */
9569
+ function sidePanel_isSupported() {
9570
+ var _a;
9571
+ return ensureInitialized(runtime) && !!((_a = runtime.supports.copilot) === null || _a === void 0 ? void 0 : _a.sidePanel);
9572
+ }
9573
+ /**
9574
+ * @beta
9575
+ * @hidden
9576
+ * Determines if the provided error object is an instance of SidePanelError or SdkError.
9577
+ * @internal
9578
+ * Limited to Microsoft-internal use
9579
+ * @param err The error object to check whether it is of SidePanelError type
9580
+ */
9581
+ function isResponseAReportableError(err) {
9582
+ if (typeof err !== 'object' || err === null) {
9583
+ return false;
9584
+ }
9585
+ const error = err;
9586
+ return ((Object.values(SidePanelErrorCode).includes(error.errorCode) &&
9587
+ (error.message === undefined || typeof error.message === 'string')) ||
9588
+ isSdkError(err) // If the error is an SdkError, it can be considered a SidePanelError
9589
+ );
9590
+ }
9591
+ /**
9592
+ * Get user content data from the hub to send to copilot app.
9593
+ *
9594
+ * @returns { Promise<Content> } - promise resolves with a content object containing user content data
9595
+ * @throws { SidePanelError | SdkError } - Throws a SidePanelError or SdkError if host SDK returns an error as a response to this call
9596
+ *
9597
+ * @hidden
9598
+ * @beta
9599
+ * @internal
9600
+ * Limited to Microsoft-internal use
9601
+ */
9602
+ function getContent(request) {
9603
+ return sidePanel_awaiter(this, void 0, void 0, function* () {
9604
+ ensureInitialized(runtime);
9605
+ const input = request ? [new SerializableContentRequest(request)] : [];
9606
+ return callFunctionInHostAndHandleResponse("copilot.sidePanel.getContent" /* ApiName.Copilot_SidePanel_GetContent */, input, new GetContentResponseHandler(), getApiVersionTag(sidePanel_copilotTelemetryVersionNumber, "copilot.sidePanel.getContent" /* ApiName.Copilot_SidePanel_GetContent */), isResponseAReportableError);
9607
+ });
9608
+ }
9609
+ /**
9610
+ * When the copilot detects a contextual query it gets the user consent status before making the getContent call.
9611
+ *
9612
+ * @returns { Promise<PreCheckContextResponse> } - promise resolves with a content object containing user content data
9613
+ * @throws { SidePanelError | SdkError } - Throws a SidePanelError or SdkError if host SDK returns an error as a response to this call
9614
+ *
9615
+ * @hidden
9616
+ * @beta
9617
+ * @internal
9618
+ * Limited to Microsoft-internal use
9619
+ */
9620
+ function preCheckUserConsent() {
9621
+ return sidePanel_awaiter(this, void 0, void 0, function* () {
9622
+ ensureInitialized(runtime);
9623
+ return callFunctionInHostAndHandleResponse("copilot.sidePanel.preCheckUserConsent" /* ApiName.Copilot_SidePanel_PreCheckUserConsent */, [], new PreCheckContextResponseHandler(), getApiVersionTag(sidePanel_copilotTelemetryVersionNumber, "copilot.sidePanel.preCheckUserConsent" /* ApiName.Copilot_SidePanel_PreCheckUserConsent */), isResponseAReportableError);
9624
+ });
9625
+ }
9626
+ /**
9627
+ * @hidden
9628
+ * @beta
9629
+ * Registers a handler to get updated content data from the hub to send to copilot app.
9630
+ * This handler will be called when the user selects content in the application.
9631
+ * @param handler - The handler for getting user action content select.
9632
+ *
9633
+ * @internal
9634
+ * Limited to Microsoft-internal use
9635
+ */
9636
+ function registerUserActionContentSelect(handler) {
9637
+ registerHandlerHelper(getApiVersionTag(sidePanel_copilotTelemetryVersionNumber, "copilot.sidePanel.registerUserActionContentSelect" /* ApiName.Copilot_SidePanel_RegisterUserActionContentSelect */), 'copilot.sidePanel.userActionContentSelect', handler, [FrameContexts.content], () => {
9638
+ if (!sidePanel_isSupported()) {
9639
+ throw copilotSidePanelNotSupportedOnPlatformError;
9640
+ }
9641
+ });
9642
+ }
9643
+ /**
9644
+ * @hidden
9645
+ * @beta
9646
+ * @internal
9647
+ * Limited to Microsoft-internal use
9648
+ *
9649
+ * Error thrown when the copilot side panel API is not supported on the current platform.
9650
+ */
9651
+ const copilotSidePanelNotSupportedOnPlatformError = new SidePanelErrorImpl(SidePanelErrorCode.NotSupportedOnPlatform, 'This API is not supported on the current platform.');
9652
+ class GetContentResponseHandler extends ResponseHandler {
9653
+ validate(response) {
9654
+ return response !== null && typeof response === 'object';
9655
+ }
9656
+ deserialize(response) {
9657
+ return response;
9658
+ }
9659
+ }
9660
+ class PreCheckContextResponseHandler extends ResponseHandler {
9661
+ validate(response) {
9662
+ return response !== null && typeof response === 'object';
9663
+ }
9664
+ deserialize(response) {
9665
+ return response;
9666
+ }
9667
+ }
9668
+ class SerializableContentRequest {
9669
+ constructor(contentRequest) {
9670
+ this.contentRequest = contentRequest;
9671
+ }
9672
+ serialize() {
9673
+ return this.contentRequest;
9674
+ }
9675
+ }
9676
+
9387
9677
  ;// ./src/private/copilot/copilot.ts
9388
9678
 
9389
9679
 
9390
9680
 
9681
+
9391
9682
 
9392
9683
  ;// ./src/private/externalAppAuthentication.ts
9393
9684
  /**
@@ -11025,7 +11316,7 @@ function messageChannels_isSupported() {
11025
11316
  * @internal
11026
11317
  * Limited to Microsoft-internal use
11027
11318
  */
11028
- const nestedAppAuthBridge_version = '1.0.0';
11319
+ const nestedAppAuthBridge_version = '1.0.1';
11029
11320
  /**
11030
11321
  * Bridge handlers used for processing messages.
11031
11322
  */
@@ -11171,11 +11462,6 @@ function nestedAppAuthBridge_processAuthBridgeMessage(evt, onMessageReceived) {
11171
11462
  onMessageReceived(message);
11172
11463
  }
11173
11464
  function nestedAppAuthBridge_shouldProcessIncomingMessage(messageSource, messageOrigin) {
11174
- // Reject messages if they are not from the top window
11175
- if (messageSource && messageSource !== window.top) {
11176
- log('Should not process message because it is not coming from the top window');
11177
- return false;
11178
- }
11179
11465
  // Check if messageOrigin matches topOriginForNAA
11180
11466
  if (messageOrigin === topOriginForNAA) {
11181
11467
  try {
@@ -13533,6 +13819,8 @@ function serializeValidSize(size) {
13533
13819
 
13534
13820
 
13535
13821
 
13822
+
13823
+
13536
13824
 
13537
13825
 
13538
13826
 
@@ -14982,7 +15270,16 @@ function canParentManageNAATrustedOrigins() {
14982
15270
  */
14983
15271
  function isDeeplyNestedAuthSupported() {
14984
15272
  var _a;
14985
- return (_a = (ensureInitialized(runtime) && runtime.isDeeplyNestedAuthSupported)) !== null && _a !== void 0 ? _a : false;
15273
+ return ((_a = (ensureInitialized(runtime) &&
15274
+ (runtime.isDeeplyNestedAuthSupported || isDeeplyNestedAuthSupportedForLegacyTeamsMobile()))) !== null && _a !== void 0 ? _a : false);
15275
+ }
15276
+ function isDeeplyNestedAuthSupportedForLegacyTeamsMobile() {
15277
+ return ensureInitialized(runtime) &&
15278
+ isHostAndroidOrIOSOrIPadOSOrVisionOS() &&
15279
+ runtime.isLegacyTeams &&
15280
+ isCurrentSDKVersionAtLeast(legacyTeamsMobileVersionForDeeplyNestedAuth)
15281
+ ? true
15282
+ : false;
14986
15283
  }
14987
15284
  function isNAAChannelRecommendedForLegacyTeamsMobile() {
14988
15285
  return ensureInitialized(runtime) &&
@@ -16961,7 +17258,7 @@ const sharingTelemetryVersionNumber_v2 = "v2" /* ApiVersionNumber.V_2 */;
16961
17258
  *
16962
17259
  * @beta
16963
17260
  */
16964
- function getContent() {
17261
+ function history_getContent() {
16965
17262
  return history_awaiter(this, void 0, void 0, function* () {
16966
17263
  ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
16967
17264
  if (!history_isSupported()) {